summaryrefslogtreecommitdiffstats
path: root/private/mvdm/dos
diff options
context:
space:
mode:
Diffstat (limited to 'private/mvdm/dos')
-rw-r--r--private/mvdm/dos/command/cmd.c34
-rw-r--r--private/mvdm/dos/command/cmd.h292
-rw-r--r--private/mvdm/dos/command/cmdconf.c636
-rw-r--r--private/mvdm/dos/command/cmddata.c51
-rw-r--r--private/mvdm/dos/command/cmddisp.c56
-rw-r--r--private/mvdm/dos/command/cmdenv.c696
-rw-r--r--private/mvdm/dos/command/cmdexec.c650
-rw-r--r--private/mvdm/dos/command/cmdexit.c31
-rw-r--r--private/mvdm/dos/command/cmdkeyb.c251
-rw-r--r--private/mvdm/dos/command/cmdkeyb.h18
-rw-r--r--private/mvdm/dos/command/cmdmisc.c897
-rw-r--r--private/mvdm/dos/command/cmdpif.c289
-rw-r--r--private/mvdm/dos/command/cmdpif.h46
-rw-r--r--private/mvdm/dos/command/cmdredir.c664
-rw-r--r--private/mvdm/dos/command/makefile9
-rw-r--r--private/mvdm/dos/command/sources60
-rw-r--r--private/mvdm/dos/dem/dem.c76
-rw-r--r--private/mvdm/dos/dem/dem.h260
-rw-r--r--private/mvdm/dos/dem/demdasd.c734
-rw-r--r--private/mvdm/dos/dem/demdasd.h301
-rw-r--r--private/mvdm/dos/dem/demdata.c24
-rw-r--r--private/mvdm/dos/dem/demdir.c182
-rw-r--r--private/mvdm/dos/dem/demdisp.c245
-rw-r--r--private/mvdm/dos/dem/demerror.c388
-rw-r--r--private/mvdm/dos/dem/demfcb.c768
-rw-r--r--private/mvdm/dos/dem/demfile.c1160
-rw-r--r--private/mvdm/dos/dem/demgset.c1013
-rw-r--r--private/mvdm/dos/dem/demhndl.c605
-rw-r--r--private/mvdm/dos/dem/demioctl.c583
-rw-r--r--private/mvdm/dos/dem/demlabel.c76
-rw-r--r--private/mvdm/dos/dem/demlock.c62
-rw-r--r--private/mvdm/dos/dem/demmisc.c644
-rw-r--r--private/mvdm/dos/dem/demmsg.c48
-rw-r--r--private/mvdm/dos/dem/demmsg.h18
-rw-r--r--private/mvdm/dos/dem/demsrch.c2442
-rw-r--r--private/mvdm/dos/dem/dosdef.h140
-rw-r--r--private/mvdm/dos/dem/makefile9
-rw-r--r--private/mvdm/dos/dem/sources65
-rw-r--r--private/mvdm/dos/dirs26
-rw-r--r--private/mvdm/dos/test/test.bat53
-rw-r--r--private/mvdm/dos/v86/cmd/append/append.asm3565
-rw-r--r--private/mvdm/dos/v86/cmd/append/append.skl43
-rw-r--r--private/mvdm/dos/v86/cmd/append/appendm.asm42
-rw-r--r--private/mvdm/dos/v86/cmd/append/appendp.inc169
-rw-r--r--private/mvdm/dos/v86/cmd/append/makefile41
-rw-r--r--private/mvdm/dos/v86/cmd/backup/makefile13
-rw-r--r--private/mvdm/dos/v86/cmd/command/buildmsg.c1525
-rw-r--r--private/mvdm/dos/v86/cmd/command/comequ.asm258
-rw-r--r--private/mvdm/dos/v86/cmd/command/command.lnk12
-rw-r--r--private/mvdm/dos/v86/cmd/command/command.skl191
-rw-r--r--private/mvdm/dos/v86/cmd/command/command1.asm745
-rw-r--r--private/mvdm/dos/v86/cmd/command/command2.asm1002
-rw-r--r--private/mvdm/dos/v86/cmd/command/comseg.asm61
-rw-r--r--private/mvdm/dos/v86/cmd/command/comsw.asm11
-rw-r--r--private/mvdm/dos/v86/cmd/command/copy.asm1093
-rw-r--r--private/mvdm/dos/v86/cmd/command/copypr1.asm345
-rw-r--r--private/mvdm/dos/v86/cmd/command/copypr2.asm587
-rw-r--r--private/mvdm/dos/v86/cmd/command/cparse.asm423
-rw-r--r--private/mvdm/dos/v86/cmd/command/dir.asm3468
-rw-r--r--private/mvdm/dos/v86/cmd/command/envdata.asm23
-rw-r--r--private/mvdm/dos/v86/cmd/command/fordata.asm25
-rw-r--r--private/mvdm/dos/v86/cmd/command/help.skl62
-rw-r--r--private/mvdm/dos/v86/cmd/command/ifequ.asm19
-rw-r--r--private/mvdm/dos/v86/cmd/command/init.asm2533
-rw-r--r--private/mvdm/dos/v86/cmd/command/iparse.asm43
-rw-r--r--private/mvdm/dos/v86/cmd/command/loadhi.asm574
-rw-r--r--private/mvdm/dos/v86/cmd/command/makefil011
-rw-r--r--private/mvdm/dos/v86/cmd/command/makefile536
-rw-r--r--private/mvdm/dos/v86/cmd/command/parse2.asm428
-rw-r--r--private/mvdm/dos/v86/cmd/command/path1.asm526
-rw-r--r--private/mvdm/dos/v86/cmd/command/path2.asm472
-rw-r--r--private/mvdm/dos/v86/cmd/command/rdata.asm797
-rw-r--r--private/mvdm/dos/v86/cmd/command/readme.txt116
-rw-r--r--private/mvdm/dos/v86/cmd/command/resmsg.equ31
-rw-r--r--private/mvdm/dos/v86/cmd/command/rucode.asm1230
-rw-r--r--private/mvdm/dos/v86/cmd/command/stub.asm336
-rw-r--r--private/mvdm/dos/v86/cmd/command/tbatch.asm1097
-rw-r--r--private/mvdm/dos/v86/cmd/command/tbatch2.asm962
-rw-r--r--private/mvdm/dos/v86/cmd/command/tcmd1a.asm596
-rw-r--r--private/mvdm/dos/v86/cmd/command/tcmd1b.asm781
-rw-r--r--private/mvdm/dos/v86/cmd/command/tcmd2a.asm692
-rw-r--r--private/mvdm/dos/v86/cmd/command/tcmd2b.asm638
-rw-r--r--private/mvdm/dos/v86/cmd/command/tcode.asm1657
-rw-r--r--private/mvdm/dos/v86/cmd/command/tdata.asm1075
-rw-r--r--private/mvdm/dos/v86/cmd/command/tenv.asm667
-rw-r--r--private/mvdm/dos/v86/cmd/command/tenv2.asm711
-rw-r--r--private/mvdm/dos/v86/cmd/command/tfor.asm565
-rw-r--r--private/mvdm/dos/v86/cmd/command/tmisc1.asm877
-rw-r--r--private/mvdm/dos/v86/cmd/command/tmisc2.asm511
-rw-r--r--private/mvdm/dos/v86/cmd/command/tparse.asm82
-rw-r--r--private/mvdm/dos/v86/cmd/command/tpipe.asm834
-rw-r--r--private/mvdm/dos/v86/cmd/command/tprintf.asm376
-rw-r--r--private/mvdm/dos/v86/cmd/command/tranmsg.asm841
-rw-r--r--private/mvdm/dos/v86/cmd/command/tspc.asm568
-rw-r--r--private/mvdm/dos/v86/cmd/command/tucode.asm590
-rw-r--r--private/mvdm/dos/v86/cmd/command/uinit.asm352
-rw-r--r--private/mvdm/dos/v86/cmd/command/usa-ms/bldmsg.h8
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debasm.asm1447
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debcom1.asm1058
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debcom2.asm1495
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debcom3.asm706
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debconst.asm1162
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debdata.asm245
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debems.asm1162
-rw-r--r--private/mvdm/dos/v86/cmd/debug/deberr.asm196
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debmes.asm1662
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debuasm.asm961
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debug.asm1340
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debug.inc179
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debug.lnk13
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debug.skl134
-rw-r--r--private/mvdm/dos/v86/cmd/debug/debug.tag2
-rw-r--r--private/mvdm/dos/v86/cmd/debug/dosdebug/debug.arf13
-rw-r--r--private/mvdm/dos/v86/cmd/debug/makefile225
-rw-r--r--private/mvdm/dos/v86/cmd/debug/sysver.fal10
-rw-r--r--private/mvdm/dos/v86/cmd/debug/sysver.inc15
-rw-r--r--private/mvdm/dos/v86/cmd/debug/sysver.tru10
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlcmd1.asm679
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlcmd2.asm1203
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlequ.asm164
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlin.asm1885
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlin.lnk7
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlin.skl85
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlmes.asm526
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlparse.asm303
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/edlstdsw.inc38
-rw-r--r--private/mvdm/dos/v86/cmd/edlin/makefile104
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/display.asm115
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2bchng.inc27
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2bequ.inc55
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2binit.asm1180
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2bmacro.inc113
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2bparse.inc199
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/e2btable.inc208
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/exe2bin.lnk5
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/exe2bin.skl71
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/exe2bin.tag8
-rw-r--r--private/mvdm/dos/v86/cmd/exe2bin/makefile65
-rw-r--r--private/mvdm/dos/v86/cmd/fastopen/fastopen.asm24
-rw-r--r--private/mvdm/dos/v86/cmd/fastopen/fastopen.lnk2
-rw-r--r--private/mvdm/dos/v86/cmd/fastopen/makefile33
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/graphics.asm82
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/graphics.lnk15
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/graphics.pro572
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/graphics.skl81
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/graphics.tag19
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grbwprt.asm848
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grbwprt.ext30
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcolprt.asm1128
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcolprt.ext31
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcommon.asm1362
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcommon.ext38
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcpsd.asm115
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grcpsd.ext30
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grctrl.asm2230
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grctrl.ext61
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grctrl.str112
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grinst.asm1055
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grinst.ext49
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grint2fh.asm227
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grint2fh.ext35
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload.asm876
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload.ext66
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload2.asm1218
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload2.ext45
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload3.asm922
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grload3.ext34
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grmsg.equ93
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grparms.asm766
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grparms.ext30
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grparse.asm94
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grparse.ext30
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grpattrn.asm223
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grpattrn.ext37
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grpattrn.str126
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grprint.ext35
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/grshar.str190
-rw-r--r--private/mvdm/dos/v86/cmd/graphics/makefile78
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/commsubs.asm648
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/commsubs.inc35
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/kbmsg.inc26
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keyb.asm68
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keyb.lnk3
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keyb.skl47
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keyb.tag23
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybcmd.asm2105
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybcmd.inc56
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybcpsd.asm98
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybcpsd.inc32
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybdcl.inc52
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybequ.inc42
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi2f.asm238
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi2f.inc28
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi9.asm694
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi9.inc34
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi9c.asm1768
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybi9c.inc38
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybmac.inc420
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybmsg.inc47
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybshar.inc337
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybsys.inc139
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybtbbl.asm838
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/keybtbbl.inc37
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/makefile89
-rw-r--r--private/mvdm/dos/v86/cmd/keyb/parser.asm655
-rw-r--r--private/mvdm/dos/v86/cmd/loadfix/loadfix.asm375
-rw-r--r--private/mvdm/dos/v86/cmd/loadfix/makefile35
-rw-r--r--private/mvdm/dos/v86/cmd/makefile76
-rw-r--r--private/mvdm/dos/v86/cmd/mem/_msgret.asm269
-rw-r--r--private/mvdm/dos/v86/cmd/mem/_parse.asm171
-rw-r--r--private/mvdm/dos/v86/cmd/mem/chkvdisk.asm217
-rw-r--r--private/mvdm/dos/v86/cmd/mem/makefile81
-rw-r--r--private/mvdm/dos/v86/cmd/mem/mem.c467
-rw-r--r--private/mvdm/dos/v86/cmd/mem/mem.h233
-rw-r--r--private/mvdm/dos/v86/cmd/mem/mem.lnk11
-rw-r--r--private/mvdm/dos/v86/cmd/mem/mem.skl83
-rw-r--r--private/mvdm/dos/v86/cmd/mem/mem.tag34
-rw-r--r--private/mvdm/dos/v86/cmd/mem/membase.c1160
-rw-r--r--private/mvdm/dos/v86/cmd/mem/memctrlc.c46
-rw-r--r--private/mvdm/dos/v86/cmd/mem/memex.c262
-rw-r--r--private/mvdm/dos/v86/cmd/mem/msgdef.h126
-rw-r--r--private/mvdm/dos/v86/cmd/mem/parse.h147
-rw-r--r--private/mvdm/dos/v86/cmd/mem/submsg.c678
-rw-r--r--private/mvdm/dos/v86/cmd/mem/value139
-rw-r--r--private/mvdm/dos/v86/cmd/mem/xmm.h42
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/doesmac.inc46
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/funcdbcs.inc24
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/funcparm.inc51
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/makefile57
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/msg2nls.inc99
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.asm2013
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.skl30
-rw-r--r--private/mvdm/dos/v86/cmd/nlsfunc/nlsparm.asm154
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/edit.hlpbin0 -> 17898 bytes
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/gorilla.bas1135
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/makefile26
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/money.bas1536
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/nibbles.bas722
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/qbasic.hlpbin0 -> 130810 bytes
-rw-r--r--private/mvdm/dos/v86/cmd/qbasic/remline.bas395
-rw-r--r--private/mvdm/dos/v86/cmd/setver/device.asm233
-rw-r--r--private/mvdm/dos/v86/cmd/setver/dos.asm228
-rw-r--r--private/mvdm/dos/v86/cmd/setver/makefile63
-rw-r--r--private/mvdm/dos/v86/cmd/setver/parse.c568
-rw-r--r--private/mvdm/dos/v86/cmd/setver/setver.c530
-rw-r--r--private/mvdm/dos/v86/cmd/setver/setver.doc194
-rw-r--r--private/mvdm/dos/v86/cmd/setver/setver.h195
-rw-r--r--private/mvdm/dos/v86/cmd/setver/setver.tag16
-rw-r--r--private/mvdm/dos/v86/cmd/setver/usa-ms/message.h75
-rw-r--r--private/mvdm/dos/v86/cmd/share/makefile33
-rw-r--r--private/mvdm/dos/v86/cmd/share/share.asm24
-rw-r--r--private/mvdm/dos/v86/cmd/share/share.lnk2
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansi.asm1848
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansi.inc315
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansi.lnk7
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansi.skl16
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansi.tag19
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansiinit.asm540
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ansivid.inc55
-rw-r--r--private/mvdm/dos/v86/dev/ansi/ioctl.asm1203
-rw-r--r--private/mvdm/dos/v86/dev/ansi/makefile79
-rw-r--r--private/mvdm/dos/v86/dev/ansi/parser.asm356
-rw-r--r--private/mvdm/dos/v86/dev/country/alclbjfk2054
-rw-r--r--private/mvdm/dos/v86/dev/country/country.asm2069
-rw-r--r--private/mvdm/dos/v86/dev/country/dbcs93x.inc58
-rw-r--r--private/mvdm/dos/v86/dev/country/makefile24
-rw-r--r--private/mvdm/dos/v86/dev/country/mkcntry.inc258
-rw-r--r--private/mvdm/dos/v86/dev/country/nls437.inc356
-rw-r--r--private/mvdm/dos/v86/dev/country/nls737.inc69
-rw-r--r--private/mvdm/dos/v86/dev/country/nls850.inc642
-rw-r--r--private/mvdm/dos/v86/dev/country/nls852.inc120
-rw-r--r--private/mvdm/dos/v86/dev/country/nls855.inc102
-rw-r--r--private/mvdm/dos/v86/dev/country/nls857.inc68
-rw-r--r--private/mvdm/dos/v86/dev/country/nls860.inc64
-rw-r--r--private/mvdm/dos/v86/dev/country/nls861.inc64
-rw-r--r--private/mvdm/dos/v86/dev/country/nls862.inc68
-rw-r--r--private/mvdm/dos/v86/dev/country/nls863.inc64
-rw-r--r--private/mvdm/dos/v86/dev/country/nls864.inc39
-rw-r--r--private/mvdm/dos/v86/dev/country/nls865.inc102
-rw-r--r--private/mvdm/dos/v86/dev/country/nls866.inc103
-rw-r--r--private/mvdm/dos/v86/dev/country/nls869.inc66
-rw-r--r--private/mvdm/dos/v86/dev/country/nls93x.inc149
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem.asm1537
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem.inc160
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem1.asm94
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem2.asm1093
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem4.asm674
-rw-r--r--private/mvdm/dos/v86/dev/himem/himem5.asm485
-rw-r--r--private/mvdm/dos/v86/dev/himem/makefile61
-rw-r--r--private/mvdm/dos/v86/dev/himem/usa-ms/messages.asm102
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdf.asm397
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbe.asm1790
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbg.asm689
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbl.asm1107
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbl097.asm811
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbl098.asm807
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbl099.asm805
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbr.asm1165
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfbr275.asm1328
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfcf.asm1776
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfcz.asm2519
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfdk.asm1638
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfdv.asm589
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfeof.asm41
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdffr.asm1535
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdffr120.asm2314
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdffr189.asm1534
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfge.asm1391
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfgk.asm1614
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfhu.asm2363
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfic.asm1836
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfit.asm800
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfit141.asm800
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfit142.asm871
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfjp.asm843
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfla.asm1331
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfnl.asm1522
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfno.asm1614
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfnow.asm831
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfpl.asm2346
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfpl1.asm1011
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfpo.asm1613
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfro.asm2355
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfru.asm1357
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfru091.asm1062
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfru092.asm1057
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfru093.asm1055
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsf.asm1633
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsg.asm1635
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsl.asm2356
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsp.asm1379
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsu.asm1687
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfsv.asm1695
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdftr.asm1410
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdftr440.asm1433
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfuk.asm661
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfuk166.asm661
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfuk168.asm855
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfur.asm1100
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfur094.asm804
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfur095.asm800
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfur096.asm798
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfyc116.asm1120
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfyc117.asm1120
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfyc118.asm1119
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/kdfyu.asm2262
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/keybmac.inc450
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/keyboard.lnk13
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/keybshar.inc338
-rw-r--r--private/mvdm/dos/v86/dev/keyboard/makefile128
-rw-r--r--private/mvdm/dos/v86/dev/makefile32
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/biosbop.inc10
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/biosseg.inc39
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/biostruc.inc101
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/devmark.inc24
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/dosmsg.cmd6
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/makefile92
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msbio.lnk3
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msbio.skl95
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msbio1.asm955
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msbio_4.lnk3
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/mschar.asm1078
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msend.asm52
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msequ.inc56
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msgroup.inc18
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msinit.asm288
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/msint13.asm214
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/spcemm.asm167
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/spckbd.asm2343
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/spcmse_4.asm5399
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/sysconf.asm3972
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/sysimes.asm26
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/sysinit1.asm4007
-rw-r--r--private/mvdm/dos/v86/doskrnl/bios/sysinit2.asm1609
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/abort.asm153
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/alloc.asm760
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/cpmio.asm931
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/cpmio2.asm406
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/crit.asm157
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dev.asm632
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dir2.asm1468
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/disk.asm877
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dispatch.txt214
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/divmes.inc18
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dos.tag270
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dosmes.inc288
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dostab.asm853
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/dup.asm75
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/exepatch.asm1047
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/fcb.asm715
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/fcbio.asm1668
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/fcbio2.asm844
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/file.asm906
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/getset.asm1104
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/handle.asm966
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/ioctl.asm786
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/kstrin.asm758
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/lock.asm218
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/macro.asm434
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/macro2.asm1172
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/makedos.cmd6
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/makefile323
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/misc.asm965
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/misc2.asm657
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/mscode.asm1428
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msconst.asm263
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msctrlc.asm1206
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msdata.asm42
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msdisp.asm924
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msdos.lnk41
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msdos.skl32
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msdosme.asm16
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msinit.asm1382
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msioctl.asm5
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/msproc.asm1973
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/mssw.asm25
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/mstable.asm466
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/open.asm383
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/origin.asm27
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/parse.asm60
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/path.asm431
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/scnam.inc221
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/search.asm353
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/segcheck.asm309
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/srvcall.asm263
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/state.rst11
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/time.asm293
-rw-r--r--private/mvdm/dos/v86/doskrnl/dos/util.asm284
-rw-r--r--private/mvdm/dos/v86/doskrnl/makefile24
-rw-r--r--private/mvdm/dos/v86/h/assert.h35
-rw-r--r--private/mvdm/dos/v86/h/bios.h181
-rw-r--r--private/mvdm/dos/v86/h/bios.inc166
-rw-r--r--private/mvdm/dos/v86/h/conio.h34
-rw-r--r--private/mvdm/dos/v86/h/copyrigh.h4
-rw-r--r--private/mvdm/dos/v86/h/ctype.h66
-rw-r--r--private/mvdm/dos/v86/h/direct.h24
-rw-r--r--private/mvdm/dos/v86/h/dos.h220
-rw-r--r--private/mvdm/dos/v86/h/dos.inc524
-rw-r--r--private/mvdm/dos/v86/h/errno.h50
-rw-r--r--private/mvdm/dos/v86/h/fcntl.h35
-rw-r--r--private/mvdm/dos/v86/h/float.h137
-rw-r--r--private/mvdm/dos/v86/h/graph.h216
-rw-r--r--private/mvdm/dos/v86/h/io.h43
-rw-r--r--private/mvdm/dos/v86/h/limits.h32
-rw-r--r--private/mvdm/dos/v86/h/malloc.h124
-rw-r--r--private/mvdm/dos/v86/h/math.h112
-rw-r--r--private/mvdm/dos/v86/h/memory.h34
-rw-r--r--private/mvdm/dos/v86/h/mixed.inc167
-rw-r--r--private/mvdm/dos/v86/h/process.h65
-rw-r--r--private/mvdm/dos/v86/h/search.h31
-rw-r--r--private/mvdm/dos/v86/h/setjmp.h35
-rw-r--r--private/mvdm/dos/v86/h/share.h15
-rw-r--r--private/mvdm/dos/v86/h/signal.h59
-rw-r--r--private/mvdm/dos/v86/h/stdarg.h20
-rw-r--r--private/mvdm/dos/v86/h/stddef.h48
-rw-r--r--private/mvdm/dos/v86/h/stdio.h165
-rw-r--r--private/mvdm/dos/v86/h/stdlib.h151
-rw-r--r--private/mvdm/dos/v86/h/string.h61
-rw-r--r--private/mvdm/dos/v86/h/time.h75
-rw-r--r--private/mvdm/dos/v86/h/varargs.h21
-rw-r--r--private/mvdm/dos/v86/h/version.h116
-rw-r--r--private/mvdm/dos/v86/h/versionc.h24
-rw-r--r--private/mvdm/dos/v86/inc/_parse.asm117
-rw-r--r--private/mvdm/dos/v86/inc/arena.inc53
-rw-r--r--private/mvdm/dos/v86/inc/bdsize.inc3
-rw-r--r--private/mvdm/dos/v86/inc/bpb.inc49
-rw-r--r--private/mvdm/dos/v86/inc/buffer.inc76
-rw-r--r--private/mvdm/dos/v86/inc/bugtyp.inc59
-rw-r--r--private/mvdm/dos/v86/inc/chkcpu.inc70
-rw-r--r--private/mvdm/dos/v86/inc/cmacros.inc932
-rw-r--r--private/mvdm/dos/v86/inc/const2.asm254
-rw-r--r--private/mvdm/dos/v86/inc/copyrigh.inc7
-rw-r--r--private/mvdm/dos/v86/inc/cpmfcb.inc81
-rw-r--r--private/mvdm/dos/v86/inc/cputype.inc59
-rw-r--r--private/mvdm/dos/v86/inc/dbcs.sw15
-rw-r--r--private/mvdm/dos/v86/inc/devsym.inc227
-rw-r--r--private/mvdm/dos/v86/inc/dirent.inc75
-rw-r--r--private/mvdm/dos/v86/inc/doscntry.inc109
-rw-r--r--private/mvdm/dos/v86/inc/dosmac.inc1197
-rw-r--r--private/mvdm/dos/v86/inc/dosseg.inc23
-rw-r--r--private/mvdm/dos/v86/inc/dossym.inc178
-rw-r--r--private/mvdm/dos/v86/inc/dpb.inc51
-rw-r--r--private/mvdm/dos/v86/inc/dpl.asm15
-rw-r--r--private/mvdm/dos/v86/inc/dseg.inc208
-rw-r--r--private/mvdm/dos/v86/inc/ea.inc72
-rw-r--r--private/mvdm/dos/v86/inc/error.inc169
-rw-r--r--private/mvdm/dos/v86/inc/exe.inc113
-rw-r--r--private/mvdm/dos/v86/inc/fastopen.inc150
-rw-r--r--private/mvdm/dos/v86/inc/fastxxxx.inc12
-rw-r--r--private/mvdm/dos/v86/inc/filemode.inc90
-rw-r--r--private/mvdm/dos/v86/inc/find.inc24
-rw-r--r--private/mvdm/dos/v86/inc/inc.tag95
-rw-r--r--private/mvdm/dos/v86/inc/int2a.inc70
-rw-r--r--private/mvdm/dos/v86/inc/intnat.inc39
-rw-r--r--private/mvdm/dos/v86/inc/ioctl.inc214
-rw-r--r--private/mvdm/dos/v86/inc/keybshar.inc322
-rw-r--r--private/mvdm/dos/v86/inc/lmstub.asm946
-rw-r--r--private/mvdm/dos/v86/inc/lock.inc25
-rw-r--r--private/mvdm/dos/v86/inc/macro.def18
-rw-r--r--private/mvdm/dos/v86/inc/mft.inc176
-rw-r--r--private/mvdm/dos/v86/inc/mi.inc19
-rw-r--r--private/mvdm/dos/v86/inc/ms_data.asm241
-rw-r--r--private/mvdm/dos/v86/inc/msbdata.inc54
-rw-r--r--private/mvdm/dos/v86/inc/msdata2.asm31
-rw-r--r--private/mvdm/dos/v86/inc/msgdcl.inc108
-rw-r--r--private/mvdm/dos/v86/inc/msghan.inc154
-rw-r--r--private/mvdm/dos/v86/inc/msgserv.asm3258
-rw-r--r--private/mvdm/dos/v86/inc/msgserv.sa2629
-rw-r--r--private/mvdm/dos/v86/inc/mshalo.asm247
-rw-r--r--private/mvdm/dos/v86/inc/mshead.asm68
-rw-r--r--private/mvdm/dos/v86/inc/mstable.asm17
-rw-r--r--private/mvdm/dos/v86/inc/mult.inc240
-rw-r--r--private/mvdm/dos/v86/inc/oemnum.inc17
-rw-r--r--private/mvdm/dos/v86/inc/origin.inc78
-rw-r--r--private/mvdm/dos/v86/inc/parse.asm3013
-rw-r--r--private/mvdm/dos/v86/inc/pathmac.inc44
-rw-r--r--private/mvdm/dos/v86/inc/pcgequ.inc184
-rw-r--r--private/mvdm/dos/v86/inc/pcinput.inc3794
-rw-r--r--private/mvdm/dos/v86/inc/pdb.inc57
-rw-r--r--private/mvdm/dos/v86/inc/postequ.inc267
-rw-r--r--private/mvdm/dos/v86/inc/psdata.inc516
-rw-r--r--private/mvdm/dos/v86/inc/redirsym.inc173
-rw-r--r--private/mvdm/dos/v86/inc/rombios.inc20
-rw-r--r--private/mvdm/dos/v86/inc/sf.inc145
-rw-r--r--private/mvdm/dos/v86/inc/smdossym.inc161
-rw-r--r--private/mvdm/dos/v86/inc/smifssym.inc62
-rw-r--r--private/mvdm/dos/v86/inc/struc.inc702
-rw-r--r--private/mvdm/dos/v86/inc/syscall.inc166
-rw-r--r--private/mvdm/dos/v86/inc/sysmsg.inc550
-rw-r--r--private/mvdm/dos/v86/inc/sysvar.inc72
-rw-r--r--private/mvdm/dos/v86/inc/umb.inc64
-rw-r--r--private/mvdm/dos/v86/inc/vector.inc72
-rw-r--r--private/mvdm/dos/v86/inc/version.inc181
-rw-r--r--private/mvdm/dos/v86/inc/versiona.inc26
-rw-r--r--private/mvdm/dos/v86/inc/win386.inc59
-rw-r--r--private/mvdm/dos/v86/inc/wpatch.inc221
-rw-r--r--private/mvdm/dos/v86/inc/xmm.inc71
-rw-r--r--private/mvdm/dos/v86/inc/yesno.asm4
-rw-r--r--private/mvdm/dos/v86/lib/xmm/makefile38
-rw-r--r--private/mvdm/dos/v86/lib/xmm/xmm.asm298
-rw-r--r--private/mvdm/dos/v86/make.inc128
-rw-r--r--private/mvdm/dos/v86/makefile34
-rw-r--r--private/mvdm/dos/v86/messages/comimsg.inc29
-rw-r--r--private/mvdm/dos/v86/messages/comrmsg.inc191
-rw-r--r--private/mvdm/dos/v86/messages/denmark.msg1132
-rw-r--r--private/mvdm/dos/v86/messages/finland.msg1142
-rw-r--r--private/mvdm/dos/v86/messages/france.msg1150
-rw-r--r--private/mvdm/dos/v86/messages/germany.msg1171
-rw-r--r--private/mvdm/dos/v86/messages/holland.msg1142
-rw-r--r--private/mvdm/dos/v86/messages/italy.msg1143
-rw-r--r--private/mvdm/dos/v86/messages/japan.msg1621
-rw-r--r--private/mvdm/dos/v86/messages/loadmsg.msg12
-rw-r--r--private/mvdm/dos/v86/messages/makefile14
-rw-r--r--private/mvdm/dos/v86/messages/nether.msg1107
-rw-r--r--private/mvdm/dos/v86/messages/norway.msg1142
-rw-r--r--private/mvdm/dos/v86/messages/portugal.msg1142
-rw-r--r--private/mvdm/dos/v86/messages/spain.msg1141
-rw-r--r--private/mvdm/dos/v86/messages/state.rst11
-rw-r--r--private/mvdm/dos/v86/messages/sweden.msg1130
-rw-r--r--private/mvdm/dos/v86/messages/usa-ibm.msg1222
-rw-r--r--private/mvdm/dos/v86/messages/usa-ms.idx18
-rw-r--r--private/mvdm/dos/v86/messages/usa-ms.msg764
-rw-r--r--private/mvdm/dos/v86/redir/asmmacro.inc242
-rw-r--r--private/mvdm/dos/v86/redir/debugmac.inc356
-rw-r--r--private/mvdm/dos/v86/redir/enumapis.inc67
-rw-r--r--private/mvdm/dos/v86/redir/fudgedef.inc11
-rw-r--r--private/mvdm/dos/v86/redir/int2a.asm164
-rw-r--r--private/mvdm/dos/v86/redir/int5c.asm418
-rw-r--r--private/mvdm/dos/v86/redir/int5c.inc62
-rw-r--r--private/mvdm/dos/v86/redir/localmac.inc80
-rw-r--r--private/mvdm/dos/v86/redir/mailslot.asm338
-rw-r--r--private/mvdm/dos/v86/redir/makefile223
-rw-r--r--private/mvdm/dos/v86/redir/msgapi.asm100
-rw-r--r--private/mvdm/dos/v86/redir/namepipe.asm578
-rw-r--r--private/mvdm/dos/v86/redir/netapis.asm566
-rw-r--r--private/mvdm/dos/v86/redir/neterror.asm152
-rw-r--r--private/mvdm/dos/v86/redir/rdrint2f.inc94
-rw-r--r--private/mvdm/dos/v86/redir/rdrmisc.inc30
-rw-r--r--private/mvdm/dos/v86/redir/redir.asm558
-rw-r--r--private/mvdm/dos/v86/redir/resident.asm1154
-rw-r--r--private/mvdm/dos/v86/redir/segorder.inc113
-rw-r--r--private/mvdm/dos/v86/redir/usa/redirmsg.inc45
-rw-r--r--private/mvdm/dos/v86/tools/src/buildidx/buildidx.c328
-rw-r--r--private/mvdm/dos/v86/tools/src/buildidx/buildidx.def7
-rw-r--r--private/mvdm/dos/v86/tools/src/buildidx/makefile9
-rw-r--r--private/mvdm/dos/v86/tools/src/buildidx/sources14
-rw-r--r--private/mvdm/dos/v86/tools/src/getsize/getsize.c205
-rw-r--r--private/mvdm/dos/v86/tools/src/getsize/getsize.def7
-rw-r--r--private/mvdm/dos/v86/tools/src/getsize/makefile6
-rw-r--r--private/mvdm/dos/v86/tools/src/getsize/sources14
-rw-r--r--private/mvdm/dos/v86/tools/src/h2inc/h2inc.c2374
-rw-r--r--private/mvdm/dos/v86/tools/src/h2inc/h2inc.def1
-rw-r--r--private/mvdm/dos/v86/tools/src/h2inc/h2inc.doc204
-rw-r--r--private/mvdm/dos/v86/tools/src/h2inc/h2inc.mak27
-rw-r--r--private/mvdm/dos/v86/tools/src/stripdd/makefile6
-rw-r--r--private/mvdm/dos/v86/tools/src/stripdd/sources14
-rw-r--r--private/mvdm/dos/v86/tools/src/stripdd/stripdd.c184
-rw-r--r--private/mvdm/dos/v86/tools/src/stripdd/stripdd.def7
-rw-r--r--private/mvdm/dos/v86/tools/src/stripz/makefile9
-rw-r--r--private/mvdm/dos/v86/tools/src/stripz/sources14
-rw-r--r--private/mvdm/dos/v86/tools/src/stripz/stripz.c71
-rw-r--r--private/mvdm/dos/v86/tools/src/stripz/stripz.def7
602 files changed, 297181 insertions, 0 deletions
diff --git a/private/mvdm/dos/command/cmd.c b/private/mvdm/dos/command/cmd.c
new file mode 100644
index 000000000..c701f8a86
--- /dev/null
+++ b/private/mvdm/dos/command/cmd.c
@@ -0,0 +1,34 @@
+/*
+ * cmd.c - Main Module of Command.lib
+ *
+ * Sudeepb 09-Apr-1991 Craeted
+ */
+
+#include "cmd.h"
+#include "cmdsvc.h"
+
+
+/* CmdInit - COmmand Initialiazation routine.
+ *
+ * Entry
+ * argc,argv - from softpc as it is.
+ * Full path name of the dos binary is preceded with
+ * -a or /a. i.e. -a c:\nt\bin86\kernel.exe reversi.exe
+ *
+ *
+ * Exit
+ *
+ */
+
+BOOL CMDInit (argc,argv)
+INT argc;
+PSZ *argv;
+{
+CHAR RootDir [MAX_PATH];
+UINT Len;
+
+ Len = GetSystemDirectory (RootDir,MAX_PATH);
+ if (Len <= MAX_PATH && Len > 0)
+ cmdHomeDirectory[0] = RootDir[0];
+ return TRUE;
+}
diff --git a/private/mvdm/dos/command/cmd.h b/private/mvdm/dos/command/cmd.h
new file mode 100644
index 000000000..8ace02a73
--- /dev/null
+++ b/private/mvdm/dos/command/cmd.h
@@ -0,0 +1,292 @@
+/* cmd.h - main include file for command.lib
+ *
+ * Modification History
+ *
+ * Sudeepb 17-Sep-1991 Created
+ */
+
+/*
+#define WIN
+#define FLAT_32
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+
+#define _WINDOWS
+#include <windows.h>
+
+*/
+
+#ifdef DOS
+#define SIGNALS
+#endif
+
+#ifdef OS2_16
+#define OS2
+#define SIGNALS
+#endif
+
+#ifdef OS2_32
+#define OS2
+#define FLAT_32
+#endif
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+#include <process.h>
+
+#ifdef WIN_16
+#define WIN
+#define API16
+#endif
+
+#ifdef WIN_32
+#define WIN
+#define FLAT_32
+#define TRUE_IF_WIN32 1
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+#else
+#define TRUE_IF_WIN32 0
+#endif
+
+#ifdef FLAT_32
+#ifndef i386
+#define ALIGN_32
+#else
+#define NOALIGN_32
+#endif
+#endif
+
+#ifdef WIN
+#define _WINDOWS
+#include <windows.h>
+#endif
+
+#ifdef SIGNALS
+#include <conio.h>
+#include <signal.h>
+#endif
+
+#ifdef OS2_32
+#include <excpt.h>
+#define XCPT_SIGNAL 0xC0010003
+#endif
+
+#include <vdmapi.h>
+
+#define COPY_STD_OUT 1
+#define COPY_STD_ERR 2
+
+#define CLOSE_ALL_HANDLES 1
+#define CLOSE_STD_OUT 2
+#define CLOSE_STD_ERR 4
+
+#define DEFAULT_REDIRECTION_SIZE 1024
+#define MAX_SHORTCUT_SIZE 128
+#define STDIN_BUF_SIZE 512
+
+/** Command Macros **/
+
+/** Command Basic Typedefs **/
+
+typedef VOID (*PFNSVC)(VOID);
+
+#pragma pack(1)
+
+typedef struct _PARAMBLOCK {
+ USHORT SegEnv;
+ USHORT OffCmdTail;
+ USHORT SegCmdTail;
+ ULONG pFCB1;
+ ULONG pFCB2;
+} PARAMBLOCK,*PPARAMBLOCK;
+
+typedef struct _SCSINFO {
+ CHAR SCS_ComSpec [64];
+ CHAR SCS_CmdTail [128];
+ PARAMBLOCK SCS_ParamBlock;
+ CHAR SCS_ToSync;
+} SCSINFO, *PSCSINFO;
+
+typedef struct _STD_HANDLES {
+ ULONG hStdErr;
+ ULONG hStdOut;
+ ULONG hStdIn;
+} STD_HANDLES, *PSTD_HANDLES;
+
+#define PIPE_INPUT_BUFFER_SIZE 512
+#define PIPE_OUTPUT_BUFFER_SIZE PIPE_INPUT_BUFFER_SIZE
+#define PIPE_INPUT_TIMEOUT 55
+#define PIPE_OUTPUT_TIMEOUT PIPE_INPUT_TIMEOUT
+
+typedef struct _PIPE_INPUT{
+ struct _PIPE_INPUT *Next;
+ HANDLE hFileRead;
+ HANDLE hFileWrite;
+ HANDLE hPipe;
+ HANDLE hDataEvent;
+ HANDLE hThread;
+ CHAR *pFileName;
+ DWORD BufferSize;
+ BOOL fEOF;
+ BOOL WaitData;
+ BYTE *Buffer;
+ CRITICAL_SECTION CriticalSection;
+} PIPE_INPUT, *PPIPE_INPUT;
+
+typedef struct _PIPE_OUTPUT {
+ HANDLE hFile;
+ HANDLE hPipe;
+ HANDLE hExitEvent;
+ CHAR *pFileName;
+ DWORD BufferSize;
+ BYTE *Buffer;
+} PIPE_OUTPUT, *PPIPE_OUTPUT;
+
+typedef struct _RedirComplete_Info {
+ HANDLE ri_hStdErr;
+ HANDLE ri_hStdOut;
+ HANDLE ri_hStdIn;
+ HANDLE ri_hStdErrFile;
+ HANDLE ri_hStdOutFile;
+ HANDLE ri_hStdInFile;
+ HANDLE ri_hStdOutThread;
+ HANDLE ri_hStdErrThread;
+ PPIPE_INPUT ri_pPipeStdIn;
+ PPIPE_OUTPUT ri_pPipeStdOut;
+ PPIPE_OUTPUT ri_pPipeStdErr;
+
+} REDIRCOMPLETE_INFO, *PREDIRCOMPLETE_INFO;
+
+typedef struct _VDMENVBLK {
+ DWORD cchEnv;
+ DWORD cchRemain;
+ CHAR *lpszzEnv;
+} VDMENVBLK, *PVDMENVBLK;
+
+#pragma pack()
+
+/** Command Function Prototypes */
+
+
+VOID cmdComSpec (VOID);
+VOID cmdGetEnv (VOID);
+VOID cmdGetNextCmd (VOID);
+VOID cmdGetNextCmdForSeparateWow (VOID);
+VOID cmdGetStdHandle (VOID);
+VOID cmdExec (VOID);
+VOID cmdExecComspec32 (VOID);
+VOID cmdExitVDM (VOID);
+VOID cmdReturnExitCode (VOID);
+VOID cmdSaveWorld (VOID);
+VOID cmdSetInfo (VOID);
+VOID cmdGetCurrentDir (VOID);
+VOID cmdSetDirectories (PCHAR,VDMINFO *);
+VOID CheckDotExeForWOW (LPSTR);
+BOOL cmdCheckCopyForRedirection (PREDIRCOMPLETE_INFO);
+BOOL cmdCreateTempFile (PHANDLE,PCHAR *);
+VOID cmdCheckBinary (VOID);
+VOID cmdInitConsole (VOID);
+VOID nt_init_event_thread (VOID);
+VOID cmdExec32 (PCHAR,PCHAR);
+VOID cmdCreateProcess (VOID);
+USHORT cmdMapCodePage (ULONG);
+VOID cmdCheckForPIF (PVDMINFO);
+VOID cmdGetConfigSys (VOID);
+VOID cmdGetAutoexecBat (VOID);
+VOID DeleteConfigFiles (VOID);
+VOID cmdGetKbdLayout (VOID);
+BOOL cmdXformEnvironment (PCHAR, PANSI_STRING);
+VOID cmdGetInitEnvironment (VOID);
+VOID cmdUpdateCurrentDirectories (BYTE);
+BOOL cmdCreateVDMEnvironment (PVDMENVBLK);
+DWORD cmdGetEnvironmentVariable (PVDMENVBLK, PCHAR, PCHAR, DWORD);
+BOOL cmdSetEnvironmentVariable (PVDMENVBLK, PCHAR, PCHAR);
+DWORD cmdExpandEnvironmentStrings (PVDMENVBLK, PCHAR, PCHAR, DWORD);
+PREDIRCOMPLETE_INFO cmdCheckStandardHandles (PVDMINFO,USHORT UNALIGNED *);
+VOID cmdGetStartInfo (VOID);
+BOOL cmdHandleStdinWithPipe (PREDIRCOMPLETE_INFO);
+BOOL cmdHandleStdOutErrWithPipe (PREDIRCOMPLETE_INFO, USHORT);
+LPSTR cmdSkipOverPathName (LPSTR);
+BOOL cmdPipeFileDataEOF (HANDLE, BOOL *);
+BOOL cmdPipeFileEOF (HANDLE);
+VOID cmdPipeInThread (LPVOID);
+VOID cmdPipeOutThread (LPVOID);
+
+/** Command Externs **/
+
+extern USHORT nDrives;
+extern BOOL IsFirstVDMInSystem;
+extern BOOL VDMForWOW;
+extern CHAR lpszComSpec[];
+extern USHORT cbComSpec;
+extern BOOL IsFirstCall;
+extern BOOL IsRepeatCall;
+extern BOOL IsFirstWOWCheckBinary;
+extern BOOL IsFirstVDMInSystem;
+extern BOOL SaveWorldCreated;
+extern PCHAR pSCS_ToSync;
+extern BOOL fBlock;
+extern PCHAR pCommand32;
+extern PCHAR pEnv32;
+extern DWORD dwExitCode32;
+extern PSCSINFO pSCSInfo;
+extern HANDLE hFileStdOut;
+extern HANDLE hFileStdOutDup;
+extern HANDLE hFileStdErr;
+extern HANDLE hFileStdErrDup;
+extern VDMINFO VDMInfo;
+extern PSZ pszFileStdOut;
+extern PSZ pszFileStdErr;
+extern CHAR cmdHomeDirectory[];
+extern HANDLE SCS_hStdIn;
+extern HANDLE SCS_hStdOut;
+extern HANDLE SCS_hStdErr;
+extern CHAR chDefaultDrive;
+extern BOOL DontCheckDosBinaryType;
+extern WORD Exe32ActiveCount;
+extern BOOL fSoftpcRedirection;
+extern BOOL fSoftpcRedirectionOnShellOut;
+extern VOID nt_std_handle_notification (BOOL);
+extern VOID cmdPushExitInConsoleBuffer (VOID);
+
+
+// control handler state, defined in nt_event.h, nt_event.c
+extern ULONG CntrlHandlerState;
+#define CNTRL_SHELLCOUNT 0x0FFFF // The LOWORD is used for shell count
+#define CNTRL_PIFALLOWCLOSE 0x10000
+#define CNTRL_VDMBLOCKED 0x20000
+#define CNTRL_SYSTEMROOTCONSOLE 0x40000
+#define CNTRL_PUSHEXIT 0x80000
+
+
+// Temporary variable till we standardized on wowexec
+extern ULONG iWOWTaskId;
+extern CHAR comspec[];
+extern CHAR ShortCutInfo[];
+
+extern VOID nt_pif_callout (LPVOID);
+extern CHAR *lpszzInitEnvironment;
+extern WORD cchInitEnvironment;
+extern CHAR *lpszzCurrentDirectories;
+extern DWORD cchCurrentDirectories;
+extern BYTE * pIsDosBinary;
+extern WORD * pFDAccess;
+extern CHAR *lpszzcmdEnv16;
+extern BOOL DosEnvCreated;
+extern BOOL IsFirstVDM;
+extern VDMENVBLK cmdVDMEnvBlk;
+extern CHAR *lpszzVDMEnv32;
+extern DWORD cchVDMEnv32;
+extern UINT VdmExitCode;
+
+// application path name extention type.
+#define EXTENTION_STRING_LEN 4
+#define BAT_EXTENTION_STRING ".BAT"
+#define EXE_EXTENTION_STRING ".EXE"
+#define COM_EXTENTION_STRING ".COM"
diff --git a/private/mvdm/dos/command/cmdconf.c b/private/mvdm/dos/command/cmdconf.c
new file mode 100644
index 000000000..0b57d2bf6
--- /dev/null
+++ b/private/mvdm/dos/command/cmdconf.c
@@ -0,0 +1,636 @@
+/* cmdconf.c - handles pre-processing of config.sys\autoexec.bat
+ *
+ * Modification History:
+ *
+ * 21-Nov-1992 Jonle , Created
+ */
+
+#include "cmd.h"
+#include <cmdsvc.h>
+#include <demexp.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+#include <oemuni.h>
+
+//
+// local stuff
+//
+CHAR *pchTmpConfigFile;
+CHAR *pchTmpAutoexecFile;
+CHAR achSYSROOT[] = "%SystemRoot%";
+CHAR achCOMMAND[] = "\\System32\\command.com";
+CHAR achSHELL[] = "shell";
+CHAR achCOUNTRY[] = "country";
+CHAR achREM[] = "rem";
+CHAR achENV[] = "/e:";
+CHAR achEOL[] = "\r\n";
+CHAR achSET[] = "SET";
+CHAR achPROMPT[] = "PROMPT";
+CHAR achPATH[] = "PATH";
+
+DWORD dwLenSysRoot;
+CHAR achSysRoot[64];
+
+
+
+void ExpandConfigFiles(BOOLEAN bConfig);
+DWORD WriteExpanded(HANDLE hFile, CHAR *pch, DWORD dwBytes);
+void WriteFileAssert(HANDLE hFile, CHAR *pBuff, DWORD dwBytes);
+#define ISEOL(ch) ( !(ch) || ((ch) == '\n') || ((ch) == '\r'))
+
+
+
+/** There are still many items we don't supprot for long path name
+ (1). device, install in config.sys
+ (2). Third-party shell
+ (3). lh, loadhigh and any other commands in autoexec.bat
+
+**/
+
+/* cmdGetConfigSys - Creates a temp file to replace c:\config.sys
+ *
+ * Entry - Client (DS:DX) pointer to receive file name
+ *
+ * EXIT - This routine will Terminate the vdm if it fails
+ * And will not return
+ *
+ * The buffer to receive the file name must be at least 64 bytes
+ */
+VOID cmdGetConfigSys (VOID)
+{
+ UNICODE_STRING Unicode;
+ OEM_STRING OemString;
+ ANSI_STRING AnsiString;
+
+ ExpandConfigFiles(TRUE);
+
+ RtlInitAnsiString(&AnsiString, pchTmpConfigFile);
+ if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&Unicode, &AnsiString, TRUE)) )
+ goto ErrExit;
+
+ OemString.Buffer = (char *)GetVDMAddr(getDS(),getDX());
+ OemString.MaximumLength = 64;
+ if ( !NT_SUCCESS(RtlUnicodeStringToOemString(&OemString,&Unicode,FALSE)) )
+ goto ErrExit;
+
+ RtlFreeUnicodeString(&Unicode);
+ return;
+
+ErrExit:
+ RcErrorDialogBox(ED_INITMEMERR, pchTmpConfigFile, NULL);
+ TerminateVDM();
+}
+
+
+
+/* cmdGetAutoexecBat - Creates a temp file to replace c:\autoexec.bat
+ *
+ * Entry - Client (DS:DX) pointer to receive file name
+ *
+ * EXIT - This routine will Terminate the vdm if it fails
+ * And will not return
+ *
+ *
+ * The buffer to receive the file name must be at least 64 bytes
+ */
+VOID cmdGetAutoexecBat (VOID)
+{
+ UNICODE_STRING Unicode;
+ OEM_STRING OemString;
+ ANSI_STRING AnsiString;
+
+ ExpandConfigFiles(FALSE);
+
+ RtlInitAnsiString(&AnsiString, pchTmpAutoexecFile);
+ if (!NT_SUCCESS(RtlAnsiStringToUnicodeString(&Unicode,&AnsiString,TRUE)) )
+ goto ErrExit;
+
+ OemString.Buffer = (char *)GetVDMAddr(getDS(),getDX());
+ OemString.MaximumLength = 64;
+ if (!NT_SUCCESS(RtlUnicodeStringToOemString(&OemString,&Unicode,FALSE)) )
+ goto ErrExit;
+
+ RtlFreeUnicodeString(&Unicode);
+
+ return;
+
+ErrExit:
+ RcErrorDialogBox(ED_INITMEMERR, pchTmpConfigFile, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+}
+
+
+
+/*
+ * DeleteConfigFiles - Deletes the temporray config files created
+ * by cmdGetAutoexecBat and cmdGetConfigSys
+ */
+VOID DeleteConfigFiles(VOID)
+{
+ if (pchTmpConfigFile) {
+#if DBG
+ if (!(fShowSVCMsg & KEEPBOOTFILES))
+#endif
+ DeleteFile(pchTmpConfigFile);
+
+ free(pchTmpConfigFile);
+ pchTmpConfigFile = NULL;
+ }
+
+ if (pchTmpAutoexecFile) {
+#if DBG
+ if (!(fShowSVCMsg & KEEPBOOTFILES))
+#endif
+ DeleteFile(pchTmpAutoexecFile);
+
+ free(pchTmpAutoexecFile);
+ pchTmpAutoexecFile = NULL;
+ }
+
+ return;
+}
+
+
+
+// if it is a config command
+// returns pointer to character immediatly following the equal sign
+// else
+// returns NULL
+
+PCHAR IsConfigCommand(PCHAR pConfigCommand, int CmdLen, PCHAR pLine)
+{
+ PCHAR pch;
+
+ if (!_strnicmp(pLine, pConfigCommand, CmdLen)) {
+ pch = pLine + CmdLen;
+ while (!isgraph(*pch) && !ISEOL(*pch)) // skip to "="
+ pch++;
+
+ if (*pch++ == '=') {
+ return pch;
+ }
+ }
+
+ return NULL;
+}
+
+
+
+
+
+
+/*
+ * Preprocesses the specfied config file (config.sys\autoexec.bat)
+ * into a temporary file.
+ *
+ * - expands %SystemRoot%
+ * - adds SHELL line for config.sys
+ *
+ * entry: BOOLEAN bConfig : TRUE - config.sys
+ * FALSE - autoexec.bat
+ */
+void ExpandConfigFiles(BOOLEAN bConfig)
+{
+ DWORD dw, dwRawFileSize;
+
+ HANDLE hRawFile;
+ HANDLE hTmpFile;
+ CHAR **ppTmpFile;
+ CHAR *pRawBuffer;
+ CHAR *pLine;
+ CHAR *pTmp;
+ CHAR *pEnvParam= NULL;
+ CHAR *pPartyShell=NULL;
+ CHAR achRawFile[MAX_PATH+12];
+ CHAR *lpszzEnv, *lpszName;
+ CHAR cchEnv;
+
+ dw = GetWindowsDirectory(achRawFile, sizeof(achRawFile));
+ dwLenSysRoot = GetShortPathNameA(achRawFile, achSysRoot, sizeof(achSysRoot));
+ if (dwLenSysRoot >= sizeof(achSysRoot)) {
+ dwLenSysRoot = 0;
+ achSysRoot[0] = '\0';
+ }
+ GetPIFConfigFiles(bConfig, achRawFile);
+ ppTmpFile = bConfig ? &pchTmpConfigFile : &pchTmpAutoexecFile;
+
+ hRawFile = CreateFile(achRawFile,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL );
+
+ if (hRawFile == (HANDLE)0xFFFFFFFF
+ || !dwLenSysRoot
+ || dwLenSysRoot >= sizeof(achSysRoot)
+ || !(dwRawFileSize = GetFileSize(hRawFile, NULL))
+ || dwRawFileSize == 0xFFFFFFFF )
+ {
+ RcErrorDialogBox(ED_BADSYSFILE, achRawFile, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+ }
+
+ pRawBuffer = malloc(dwRawFileSize+1);
+ // allocate buffer to save environment settings in autoexec.nt
+ // I know this is bad to allocate this amount of memory at this
+ // moment as we dont know if there are anything we want to keep
+ // at all. This allocation simply provides the following error
+ // handling easily.
+ if(!bConfig) {
+ lpszzEnv = lpszzcmdEnv16 = (PCHAR)malloc(dwRawFileSize);
+ cchEnv = 0;
+ }
+ if (!pRawBuffer || (!bConfig && lpszzcmdEnv16 == NULL)) {
+ RcErrorDialogBox(ED_INITMEMERR, achRawFile, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+ }
+
+ if (!cmdCreateTempFile(&hTmpFile,ppTmpFile)
+ || !ReadFile(hRawFile, pRawBuffer, dwRawFileSize, &dw, NULL)
+ || dw != dwRawFileSize )
+ {
+ GetTempPath(MAX_PATH, achRawFile);
+ achRawFile[63] = '\0';
+ RcErrorDialogBox(ED_INITTMPFILE, achRawFile, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+ }
+ // CHANGE HERE WHEN YOU CHANGE cmdCreateTempFile !!!!!!!!!!
+ // we depend on the buffer size allocated for the file name
+ dw = GetShortPathNameA(*ppTmpFile, *ppTmpFile, MAX_PATH +13);
+ if (dw == 0 || dw > 63)
+ {
+ GetTempPath(MAX_PATH, achRawFile);
+ achRawFile[63] = '\0';
+ RcErrorDialogBox(ED_INITTMPFILE, achRawFile, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+ }
+
+
+ // null terminate the buffer so we can use CRT string functions
+ *(pRawBuffer+dwRawFileSize) = '\0';
+
+ // ensure no trailing backslash in System Directory
+ if (*(achSysRoot+dwLenSysRoot-1) == '\\') {
+ *(achSysRoot + --dwLenSysRoot) = '\0';
+ }
+
+ pLine = pRawBuffer;
+ while (dwRawFileSize) {
+ // skip leading white space
+ while (dwRawFileSize && !isgraph(*pLine)) {
+ pLine++;
+ dwRawFileSize -= sizeof(CHAR);
+ }
+ if (!dwRawFileSize) // anything left to do ?
+ break;
+
+
+ if (bConfig) {
+ //
+ // filter out country= setting we will create our own based
+ // on current country ID and codepage.
+ //
+ pTmp = IsConfigCommand(achCOUNTRY, sizeof(achCOUNTRY) - sizeof(CHAR), pLine);
+ if (pTmp) {
+ while (dwRawFileSize && !ISEOL(*pLine)) {
+ pLine++;
+ dwRawFileSize -= sizeof(CHAR);
+ }
+ continue;
+ }
+
+ // filter out shell= command, saving /E:nn parameter
+ pTmp = IsConfigCommand(achSHELL, sizeof(achSHELL) - sizeof(CHAR),pLine);
+ if (pTmp) {
+ // skip leading white space
+ while (!isgraph(*pTmp) && !ISEOL(*pTmp)) {
+ dwRawFileSize -= sizeof(CHAR);
+ pTmp++;
+ }
+
+ /* if for a third party shell (not SCS command.com)
+ * append the whole thing thru /c parameter
+ * else
+ * append user specifed /e: parameter
+ */
+ if (!_strnicmp(achSYSROOT,pTmp,sizeof(achSYSROOT)-sizeof(CHAR)))
+ {
+ dw = sizeof(achSYSROOT) - sizeof(CHAR);
+ }
+ else if (!_strnicmp(achSysRoot,pTmp, strlen(achSysRoot)))
+ {
+ dw = strlen(achSysRoot);
+ }
+ else {
+ dw = 0;
+ }
+
+ if (!dw ||
+ _strnicmp(achCOMMAND,pTmp+dw,sizeof(achCOMMAND)-sizeof(CHAR)) )
+ {
+ pPartyShell = pTmp;
+ }
+ else {
+ do {
+ while (*pTmp != '/' && !ISEOL(*pTmp)) // save "/e:"
+ pTmp++;
+
+ if(ISEOL(*pTmp))
+ break;
+
+ if (!_strnicmp(pTmp,achENV,sizeof(achENV)-sizeof(CHAR)))
+ pEnvParam = pTmp;
+
+ pTmp++;
+
+ } while(1); // was: while (!ISEOL(*pTmp));
+ // we have break form this loop now,
+ // and don't need in additional macro..
+
+ }
+
+ // skip the "shell=" line
+ while (dwRawFileSize && !ISEOL(*pLine)) {
+ pLine++;
+ dwRawFileSize -= sizeof(CHAR);
+ }
+ continue;
+
+ } // END, really is "shell=" line!
+ }
+
+
+ /** Filter out PROMPT, SET and PATH from autoexec.nt
+ for environment merging. The output we prepare here is
+ a multiple strings buffer which has the format as :
+ "EnvName_1 NULL EnvValue_1 NULL[EnvName_n NULL EnvValue_n NULL] NULL
+ We don't take them out from the file because command.com needs
+ them.
+ **/
+ if (!bConfig)
+ if (!_strnicmp(pLine, achPROMPT, sizeof(achPROMPT) - 1)){
+ // prompt command found.
+ // the syntax of prompt can be eithe
+ // prompt xxyyzz or
+ // prompt=xxyyzz
+ //
+ strcpy(lpszzEnv, achPROMPT); // get the name
+ lpszzEnv += sizeof(achPROMPT);
+ cchEnv += sizeof(achPROMPT);
+ pTmp = pLine + sizeof(achPROMPT) - 1;
+ // skip possible white chars
+ while (!isgraph(*pTmp) && !ISEOL(*pTmp))
+ pTmp++;
+ if (*pTmp == '=') {
+ pTmp++;
+ while(!isgraph(*pTmp) && !ISEOL(*pTmp))
+ pTmp++;
+ }
+ while(!ISEOL(*pTmp)){
+ *lpszzEnv++ = *pTmp++;
+ cchEnv++;
+ }
+ // null terminate this
+ // it may be "prompt NULL NULL" for delete
+ // or "prompt NULL something NULL"
+ *lpszzEnv++ = '\0';
+ cchEnv++;
+ }
+ else if (!_strnicmp(pLine, achPATH, sizeof(achPATH) - 1)) {
+ // PATH was found, it has the same syntax as
+ // PROMPT
+ strcpy(lpszzEnv, achPATH);
+ lpszzEnv += sizeof(achPATH);
+ cchEnv += sizeof(achPATH);
+ pTmp = pLine + sizeof(achPATH) - 1;
+ while (!isgraph(*pTmp) && !ISEOL(*pTmp))
+ pTmp++;
+ if (*pTmp == '=') {
+ pTmp++;
+ while(!isgraph(*pTmp) && !ISEOL(*pTmp))
+ pTmp++;
+ }
+ while(!ISEOL(*pTmp)) {
+ *lpszzEnv++ = *pTmp++;
+ cchEnv++;
+ }
+ *lpszzEnv++ = '\0';
+ cchEnv++;
+ }
+ else if(!_strnicmp(pLine, achSET, sizeof(achSET) -1 )) {
+ // SET was found, first search for name
+ pTmp = pLine + sizeof(achSET) - 1;
+ while(!isgraph(*pTmp) && !ISEOL(*pTmp))
+ *pTmp ++;
+ // get the name
+ lpszName = pTmp;
+ // looking for the '='
+ // note that the name can have white characters
+ while (!ISEOL(*lpszName) && *lpszName != '=')
+ lpszName++;
+ if (!ISEOL(*lpszName)) {
+ // copy the name
+ while (pTmp < lpszName) {
+ *lpszzEnv++ = *pTmp++;
+ cchEnv++;
+ }
+ *lpszzEnv++ = '\0';
+ cchEnv++;
+ // discard the '='
+ pTmp++;
+ // grab the value(may be nothing
+ while (!ISEOL(*pTmp)) {
+ *lpszzEnv++ = *pTmp++;
+ cchEnv++;
+ }
+ *lpszzEnv++ = '\0';
+ cchEnv++;
+ }
+ }
+
+
+ dw = WriteExpanded(hTmpFile, pLine, dwRawFileSize);
+ pLine += dw;
+ dwRawFileSize -=dw;
+
+ WriteFileAssert(hTmpFile,achEOL,sizeof(achEOL) - sizeof(CHAR));
+
+ } // END, while (dwRawFileSize)
+
+
+
+ if (bConfig) {
+ UINT OemCP;
+ UINT CtryId;
+ CHAR szCtryId[64]; // expect "nnn" only
+
+ /* Ensure that the country settings are in sync with NT This is
+ * especially important for DosKrnl file UPCASE tables. The
+ * doskrnl default is "CTRY_UNITED_STATES, 437". But we add the
+ * country= line to config.sys, even if is US,437, so that the DOS
+ * will know where the default country.sys is.
+ */
+ if (GetLocaleInfo(LOCALE_USER_DEFAULT, LOCALE_IDEFAULTCOUNTRY,
+ szCtryId, sizeof(szCtryId) - 1) )
+ {
+ CtryId = strtoul(szCtryId,NULL,10);
+ }
+ else {
+ CtryId = CTRY_UNITED_STATES;
+ }
+
+ OemCP = GetOEMCP();
+
+ sprintf(achRawFile,
+ "%s=%3.3u,%3.3u,%s\\system32\\%s.sys%s",
+ achCOUNTRY, CtryId, OemCP, achSysRoot, achCOUNTRY, achEOL);
+ WriteFileAssert(hTmpFile,achRawFile,strlen(achRawFile));
+
+
+
+ /* We cannot allow the user to set an incorrect shell= command
+ * so we will contruct the correct shell= command appending
+ * either (in order of precedence):
+ * 1. /c ThirdPartyShell
+ * 2. /e:NNNN
+ * 3. nothing
+ *
+ * If there is a third party shell then we must turn the console
+ * on now since we no longer have control once system32\command.com
+ * spawns the third party shell.
+ */
+
+ // write shell=....
+ sprintf(achRawFile,
+ "%s=%s%s /p %s\\system32",
+ achSHELL,achSysRoot, achCOMMAND, achSysRoot);
+ WriteFileAssert(hTmpFile,achRawFile,strlen(achRawFile));
+
+ // write extra string (/c ... or /e:nnn)
+ if (pPartyShell && isgraph(*pPartyShell)) {
+ pTmp = pPartyShell;
+ while (!ISEOL(*pTmp))
+ pTmp++;
+ }
+ else if (pEnvParam && isgraph(*pEnvParam)) {
+ pTmp = pEnvParam;
+ while (isgraph(*pTmp))
+ pTmp++;
+ }
+ else {
+ pTmp = NULL;
+ }
+
+ if (pTmp) {
+ *pTmp = '\0';
+ if (pPartyShell) {
+ cmdInitConsole();
+ strcpy(achRawFile, " /c ");
+ strcat(achRawFile, pPartyShell);
+ }
+ else if (pEnvParam) {
+ strcpy(achRawFile, " ");
+ strcat(achRawFile, pEnvParam);
+ }
+
+ WriteExpanded(hTmpFile, achRawFile, strlen(achRawFile));
+ }
+
+ WriteFileAssert(hTmpFile,achEOL,sizeof(achEOL) - sizeof(CHAR));
+ }
+
+ SetEndOfFile(hTmpFile);
+ CloseHandle(hTmpFile);
+ CloseHandle(hRawFile);
+ free(pRawBuffer);
+ if (!bConfig) {
+ // shrink(or free) the memory
+ if (cchEnv && lpszzcmdEnv16) {
+ // doubld null terminate it
+ lpszzcmdEnv16[cchEnv++] = '\0';
+ // shrink the memory. If it fails, simple keep
+ // it as is
+ lpszzEnv = realloc(lpszzcmdEnv16, cchEnv);
+ if (lpszzEnv != NULL)
+ lpszzcmdEnv16 = lpszzEnv;
+ }
+ else {
+ free(lpszzcmdEnv16);
+ lpszzcmdEnv16 = NULL;
+ }
+ }
+
+}
+
+
+
+
+/*
+ * WriteExpanded - writes up to dwChars or EOL, expanding %SystemRoot%
+ * returns number of CHARs processed in buffer
+ * (not number of bytes actually written)
+ */
+DWORD WriteExpanded(HANDLE hFile, CHAR *pch, DWORD dwChars)
+{
+ DWORD dw;
+ DWORD dwSave = dwChars;
+ CHAR *pSave = pch;
+
+
+ while (dwChars && !ISEOL(*pch)) {
+ if (*pch == '%' &&
+ !_strnicmp(pch, achSYSROOT, sizeof(achSYSROOT)-sizeof(CHAR)) )
+ {
+ dw = pch - pSave;
+ if (dw) {
+ WriteFileAssert(hFile, pSave, dw);
+ }
+
+ WriteFileAssert(hFile, achSysRoot, dwLenSysRoot);
+
+ pch += sizeof(achSYSROOT)-sizeof(CHAR);
+ pSave = pch;
+ dwChars -= sizeof(achSYSROOT)-sizeof(CHAR);
+ }
+ else {
+ pch++;
+ dwChars -= sizeof(CHAR);
+ }
+ }
+
+ dw = pch - pSave;
+ if (dw) {
+ WriteFileAssert(hFile, pSave, dw);
+ }
+
+ return (dwSave - dwChars);
+}
+
+
+
+
+/*
+ * WriteFileAssert
+ *
+ * Cecks for error in wrtiting the temp boot file,
+ * If one occurs displays warning popup and terminates the vdm.
+ *
+ */
+void WriteFileAssert(HANDLE hFile, CHAR *pBuff, DWORD dwBytes)
+{
+ DWORD dw;
+ CHAR ach[MAX_PATH];
+
+ if (!WriteFile(hFile, pBuff, dwBytes, &dw, NULL) ||
+ dw != dwBytes)
+ {
+
+ GetTempPath(MAX_PATH, ach);
+ ach[63] = '\0';
+ RcErrorDialogBox(ED_INITTMPFILE, ach, NULL);
+ TerminateVDM(); // skip cleanup since I insist that we exit!
+ }
+}
diff --git a/private/mvdm/dos/command/cmddata.c b/private/mvdm/dos/command/cmddata.c
new file mode 100644
index 000000000..05d35ad44
--- /dev/null
+++ b/private/mvdm/dos/command/cmddata.c
@@ -0,0 +1,51 @@
+/* cmddata.c - Misc. SCS global data
+ *
+ *
+ * Modification History:
+ *
+ * Sudeepb 22-Apr-1992 Created
+ */
+
+#include "cmd.h"
+#include <mvdm.h>
+
+CHAR lpszComSpec[64+8];
+USHORT cbComSpec=0;
+BOOL IsFirstCall = TRUE;
+BOOL IsRepeatCall = FALSE;
+BOOL IsFirstWOWCheckBinary = TRUE;
+BOOL IsFirstVDMInSystem = FALSE;
+BOOL SaveWorldCreated;
+PCHAR pSCS_ToSync;
+PSCSINFO pSCSInfo;
+BOOL fBlock = FALSE;
+PCHAR pCommand32;
+PCHAR pEnv32;
+DWORD dwExitCode32;
+CHAR cmdHomeDirectory [] = "C:\\";
+CHAR chDefaultDrive;
+CHAR comspec[]="COMSPEC=";
+BOOL fSoftpcRedirection;
+BOOL fSoftpcRedirectionOnShellOut;
+CHAR ShortCutInfo[MAX_SHORTCUT_SIZE];
+BOOL DosEnvCreated = FALSE;
+
+BOOL IsFirstVDM = TRUE;
+// FORCEDOS.EXE supported
+BOOL DontCheckDosBinaryType = FALSE;
+WORD Exe32ActiveCount = 0;
+
+
+
+// Redirection Support variables
+
+VDMINFO VDMInfo;
+CHAR *lpszzInitEnvironment = NULL;
+WORD cchInitEnvironment = 0;
+CHAR *lpszzCurrentDirectories = NULL;
+DWORD cchCurrentDirectories = 0;
+BYTE * pIsDosBinary;
+CHAR *lpszzcmdEnv16 = NULL;
+CHAR *lpszzVDMEnv32 = NULL;
+DWORD cchVDMEnv32;
+VDMENVBLK cmdVDMEnvBlk;
diff --git a/private/mvdm/dos/command/cmddisp.c b/private/mvdm/dos/command/cmddisp.c
new file mode 100644
index 000000000..e1b93683f
--- /dev/null
+++ b/private/mvdm/dos/command/cmddisp.c
@@ -0,0 +1,56 @@
+/*
+ * cmddisp.c - SVC dispatch module of command
+ *
+ * Modification History:
+ *
+ * Sudeepb 17-Sep-1991 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <softpc.h>
+
+
+PFNSVC apfnSVCCmd [] = {
+ cmdExitVDM, //SVC_CMDEXITVDM
+ cmdGetNextCmd, //SVC_CMDGETNEXTCMD
+ cmdComSpec, //SVC_CMDCOMSPEC
+ cmdSaveWorld, //SVC_CMDSAVEWORLD
+ cmdGetCurrentDir, //SVC_CMDGETCURDIR
+ cmdSetInfo, //SVC_CMDSETINFO
+ cmdGetStdHandle, //SVC_GETSTDHANDLE
+ cmdCheckBinary, //SVC_CMDCHECKBINARY
+ cmdExec, //SVC_CMDEXEC
+ cmdInitConsole, //SVC_CMDINITCONSOLE
+ cmdExecComspec32, //SVC_EXECCOMSPEC32
+ cmdReturnExitCode, //SVC_RETURNEXITCODE
+ cmdGetConfigSys, //SVC_GETCONFIGSYS
+ cmdGetAutoexecBat, //SVC_GETAUTOEXECBAT
+ cmdGetKbdLayout, //SVC_GETKBDLAYOUT
+ cmdGetInitEnvironment, //SVC_GETINITENVIRONMENT
+ cmdGetStartInfo //SVC_GETSTARTINFO
+};
+
+
+/* cmdDispatch - Dispatch SVC call to right command handler.
+ *
+ * Entry - iSvc (SVC byte following SVCop)
+ *
+ * Exit - None
+ *
+ */
+
+BOOL CmdDispatch (ULONG iSvc)
+{
+#if DBG
+ if (iSvc >= SVC_CMDLASTSVC){
+ DbgPrint("Unimplemented SVC index for COMMAND %x\n",iSvc);
+ setCF(1);
+ return FALSE;
+ }
+#endif
+ (apfnSVCCmd [iSvc])();
+
+ return TRUE;
+}
diff --git a/private/mvdm/dos/command/cmdenv.c b/private/mvdm/dos/command/cmdenv.c
new file mode 100644
index 000000000..6bbf509e2
--- /dev/null
+++ b/private/mvdm/dos/command/cmdenv.c
@@ -0,0 +1,696 @@
+
+/* cmdenv.c - Environment supporting functions for command.lib
+ *
+ *
+ * Modification History:
+ *
+ * williamh 13-May-1993 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <demexp.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+#include <memory.h>
+#include <oemuni.h>
+
+#define VDM_ENV_INC_SIZE 512
+
+CHAR windir[] = "windir";
+extern BOOL fSeparateWow;
+
+// Transform the given DOS environment to 32bits environment.
+// WARNING!! The environment block we passed to 32bits must be in sort order.
+// Therefore, we call RtlSetEnvironmentVariable to do the work
+// The result string must be in ANSI character set.
+BOOL cmdXformEnvironment(PCHAR pEnv16, PANSI_STRING Env_A)
+{
+ UNICODE_STRING Name_U, Value_U, Temp_U;
+ STRING String;
+ PWCHAR pwch, NewEnv, CurEnv, CurEnvCopy, pTmp;
+ NTSTATUS Status;
+ BOOL fFoundComSpec;
+ USHORT NewEnvLen;
+
+ if (pEnv16 == NULL)
+ return FALSE;
+
+ // flag true if we alread found comspec envirnment
+ // !!!! Do we allow two or more comspec in environment????????
+ fFoundComSpec = FALSE;
+
+ CurEnv = GetEnvironmentStringsW();
+ pwch = CurEnv;
+ // figure how long the environment strings is
+ while (*pwch != UNICODE_NULL || *(pwch + 1) != UNICODE_NULL)
+ pwch++;
+
+ // plus 2 to include the last two NULL chars
+ CurEnvCopy = malloc((pwch - CurEnv + 2) * sizeof(WCHAR));
+ if (!CurEnvCopy)
+ return FALSE;
+
+ // make a copy of current process environment so we can walk through
+ // it. The environment can be changed by any threads in the process
+ // thus is not safe to walk through without a local copy
+ RtlMoveMemory(CurEnvCopy, CurEnv, (pwch - CurEnv + 2) * sizeof(WCHAR));
+
+ // create a new environment block. We don't want to change
+ // any currnt process environment variables, instead, we are
+ // preparing a new one for the new process.
+ Status = RtlCreateEnvironment(FALSE, (PVOID *)&NewEnv);
+ if (!NT_SUCCESS(Status)) {
+ free(CurEnvCopy);
+ return FALSE;
+ }
+ NewEnvLen = 0;
+ // now pick up environment we want from the current environment
+ // and set it to the new environment block
+ // the variables we want:
+ // (1). comspec
+ // (2). current directories settings
+
+ pwch = CurEnvCopy;
+
+ while (*pwch != UNICODE_NULL) {
+ if (*pwch == L'=') {
+ // variable names started with L'=' are current directroy settings
+ pTmp = wcschr(pwch + 1, L'=');
+ if (pTmp) {
+ Name_U.Buffer = pwch;
+ Name_U.Length = (pTmp - pwch) * sizeof(WCHAR);
+ RtlInitUnicodeString(&Value_U, pTmp + 1);
+ Status = RtlSetEnvironmentVariable(&NewEnv, &Name_U, &Value_U);
+ if (!NT_SUCCESS(Status)) {
+ RtlDestroyEnvironment(NewEnv);
+ free(CurEnvCopy);
+ return FALSE;
+ }
+ // <name> + <'='> + <value> + <'\0'>
+ NewEnvLen += Name_U.Length + Value_U.Length + 2 * sizeof(WCHAR);
+ }
+ }
+ else if (!fFoundComSpec) {
+ fFoundComSpec = !_wcsnicmp(pwch, L"COMSPEC=", 8);
+ if (fFoundComSpec) {
+ Name_U.Buffer = pwch;
+ Name_U.Length = 7 * sizeof(WCHAR);
+ RtlInitUnicodeString(&Value_U, pwch + 8);
+ Status = RtlSetEnvironmentVariable(&NewEnv,
+ &Name_U,
+ &Value_U
+ );
+ if (!NT_SUCCESS(Status)) {
+ RtlDestroyEnvironment(NewEnv);
+ free(CurEnvCopy);
+ return FALSE;
+ }
+ NewEnvLen += Name_U.Length + Value_U.Length + 2 * sizeof(WCHAR);
+ }
+ }
+ pwch += wcslen(pwch) + 1;
+ }
+ // we are done with current process environment.
+ free(CurEnvCopy);
+
+ // now deal with 16bits settings passed from dos.
+ // characters in 16bits environment are in OEM character set
+
+ // 16bit comspec environment variable
+ fFoundComSpec = FALSE;
+ while (*pEnv16 != '\0') {
+ RtlInitString(&String, pEnv16);
+ // discard 16bits comspec
+ if (!fFoundComSpec) {
+ fFoundComSpec = !_strnicmp(pEnv16, comspec, 8);
+ if (fFoundComSpec) {
+ // ignore 16bits comspec environment
+ pEnv16 += String.Length + 1;
+ continue;
+ }
+ }
+ Status = RtlOemStringToUnicodeString(&Temp_U, &String, TRUE);
+ if (!NT_SUCCESS(Status)) {
+ RtlDestroyEnvironment(NewEnv);
+ return FALSE;
+ }
+ pwch = wcschr(Temp_U.Buffer, L'=');
+ if (pwch) {
+ Name_U.Buffer = Temp_U.Buffer;
+ Name_U.Length = (pwch - Temp_U.Buffer) * sizeof(WCHAR);
+ RtlInitUnicodeString(&Value_U, pwch + 1);
+ Status = RtlSetEnvironmentVariable( &NewEnv, &Name_U, &Value_U);
+ RtlFreeUnicodeString(&Temp_U);
+ if (!NT_SUCCESS(Status)) {
+ RtlDestroyEnvironment(NewEnv);
+ return FALSE;
+ }
+ NewEnvLen += Name_U.Length + Value_U.Length + 2 * sizeof(WCHAR);
+ }
+ pEnv16 += String.Length + 1;
+ }
+ // count the last terminated null char
+ Temp_U.Length = NewEnvLen + sizeof(WCHAR);
+ Temp_U.Buffer = NewEnv;
+ Status = RtlUnicodeStringToAnsiString(Env_A, &Temp_U, TRUE);
+ RtlDestroyEnvironment(NewEnv); /* don't need it anymore */
+ return(NT_SUCCESS(Status));
+}
+
+
+
+
+/* get ntvdm initial environment. This initial environment is necessary
+ * for the first instance of command.com before it processing autoexec.bat
+ * this function strips off an environment headed with "=" and
+ * replace the comspec with 16bits comspec and upper case all environment vars.
+ *
+ * Entry: Client (ES:0) = buffer to receive the environment
+ * Client (BX) = size in paragraphs of the given buffer
+ *
+ * Exit: (BX) = 0 if nothing to copy
+ * (BX) <= the given size, function okay
+ * (BX) > given size, (BX) has the required size
+ */
+
+VOID cmdGetInitEnvironment(VOID)
+{
+ CHAR *lpszzEnvBuffer, *lpszEnv;
+ WORD cchEnvBuffer;
+ CHAR *lpszzEnvStrings, * lpszz;
+ WORD cchString;
+ WORD cchRemain;
+ WORD cchIncrement = MAX_PATH;
+ BOOL fFoundComSpec = FALSE;
+ BOOL fFoundWindir = FALSE;
+ BOOL fVarIsWindir = FALSE;
+
+ // if not during the initialization return nothing
+ if (!IsFirstCall) {
+ setBX(0);
+ return;
+ }
+ if (cchInitEnvironment == 0) {
+ //
+ // If the PROMPT variable is not set, add it as $P$G. This is to
+ // keep the command.com shell consistent with SCS cmd.exe(which
+ // always does this) when we don't have a top level cmd shell.
+ //
+ {
+ CHAR *pPromptStr = "PROMPT";
+ char ach[2];
+
+ if (!GetEnvironmentVariable(pPromptStr,ach,1)) {
+ SetEnvironmentVariable(pPromptStr, "$P$G");
+ }
+ }
+
+ cchRemain = 0;
+ fFoundComSpec = FALSE;
+ lpszEnv =
+ lpszzEnvStrings = GetEnvironmentStrings();
+ while (*lpszEnv) {
+ cchString = strlen(lpszEnv) + 1;
+ cchVDMEnv32 += cchString;
+ lpszEnv += cchString;
+ }
+ lpszz = lpszzEnvStrings;
+
+ if (lpszzVDMEnv32 != NULL)
+ free(lpszzVDMEnv32);
+ lpszzVDMEnv32 = malloc(++cchVDMEnv32);
+ if (lpszzVDMEnv32 == NULL) {
+ RcMessageBox(EG_MALLOC_FAILURE, NULL, NULL,
+ RMB_ICON_BANG | RMB_ABORT);
+ TerminateVDM();
+ }
+
+ RtlMoveMemory(lpszzVDMEnv32, lpszzEnvStrings, cchVDMEnv32);
+
+ while (*lpszz != '\0') {
+ cchString = strlen(lpszz) + 1;
+ if (*lpszz != '=') {
+
+ if (!fFoundComSpec && !_strnicmp(lpszz, comspec, 8)){
+ fFoundComSpec = TRUE;
+ lpszz += cchString;
+ continue;
+ }
+
+ if (!fFoundWindir && !_strnicmp(lpszz, windir, 6)) {
+ fFoundWindir = TRUE;
+ if (fSeparateWow) {
+ // starting a separate WOW box - flag this one so its
+ // name won't be converted to uppercase later.
+ fVarIsWindir = TRUE;
+ } else {
+ // starting a DOS app, so remove "windir" to make sure
+ // they don't think they are running under Windows.
+ lpszz += cchString;
+ continue;
+ }
+ }
+
+ if (cchRemain < cchString) {
+ if (cchIncrement < cchString)
+ cchIncrement = cchString;
+ lpszzEnvBuffer =
+ (CHAR *)realloc(lpszzInitEnvironment,
+ cchInitEnvironment + cchRemain + cchIncrement
+ );
+ if (lpszzEnvBuffer == NULL) {
+ if (lpszzInitEnvironment != NULL) {
+ free(lpszzInitEnvironment);
+ lpszzInitEnvironment = NULL;
+ }
+ cchInitEnvironment = 0;
+ break;
+ }
+ lpszzInitEnvironment = lpszzEnvBuffer;
+ lpszzEnvBuffer += cchInitEnvironment;
+ cchRemain += cchIncrement;
+ }
+ // the environment strings from base is in ANSI and dos needs OEM
+ AnsiToOemBuff(lpszz, lpszzEnvBuffer, cchString);
+ // convert the name to upper case -- ONLY THE NAME, NOT VALUE.
+ if (!fVarIsWindir && (lpszEnv = strchr(lpszzEnvBuffer, '=')) != NULL){
+ *lpszEnv = '\0';
+ _strupr(lpszzEnvBuffer);
+ *lpszEnv = '=';
+ } else {
+ fVarIsWindir = FALSE;
+ }
+ cchRemain -= cchString;
+ cchInitEnvironment += cchString ;
+ lpszzEnvBuffer += cchString;
+ }
+ lpszz += cchString;
+ }
+ FreeEnvironmentStrings(lpszzEnvStrings);
+
+ lpszzEnvBuffer = (CHAR *) realloc(lpszzInitEnvironment,
+ cchInitEnvironment + 1
+ );
+ if (lpszzInitEnvironment != NULL ) {
+ lpszzInitEnvironment = lpszzEnvBuffer;
+ lpszzInitEnvironment[cchInitEnvironment++] = '\0';
+ }
+ else {
+ if (lpszzInitEnvironment != NULL) {
+ free(lpszzInitEnvironment);
+ lpszzInitEnvironment = NULL;
+ }
+ cchInitEnvironment = 0;
+ }
+ }
+ lpszzEnvBuffer = (CHAR *) GetVDMAddr(getES(), 0);
+ cchEnvBuffer = (WORD)getBX() << 4;
+ if (cchEnvBuffer < cchInitEnvironment + cbComSpec) {
+ setBX((USHORT)((cchInitEnvironment + cbComSpec + 15) >> 4));
+ return;
+ }
+ else {
+ strncpy(lpszzEnvBuffer, lpszComSpec, cbComSpec);
+ lpszzEnvBuffer += cbComSpec;
+ }
+ if (lpszzInitEnvironment != NULL) {
+ setBX((USHORT)((cchInitEnvironment + cbComSpec + 15) >> 4));
+ memcpy(lpszzEnvBuffer, lpszzInitEnvironment, cchInitEnvironment);
+ free(lpszzInitEnvironment);
+ lpszzInitEnvironment = NULL;
+ cchInitEnvironment = 0;
+
+ }
+ else
+ setBX(0);
+
+ return;
+}
+
+
+
+/** create a DOS environment for DOS.
+ This is to get 32bits environment(comes with the dos executanle)
+ and merge it with the environment settings in autoexec.nt so that
+ COMMAND.COM gets the expected environment. We already created a
+ double-null terminated string during autoexec.nt parsing. The string
+ has mutltiple substring:
+ "EnvName_1 NULL EnvValue_1 NULL[EnvName_n NULL EnvValue_n NULL] NULL"
+ When name conflicts happened(a environment name was found in both
+ 16 bits and 32 bits), we do the merging based on the rules:
+ get 16bits value, expands any environment variables in the string
+ by using the current environment.
+
+WARINING !!! The changes made by applications through directly manipulation
+ in command.com environment segment will be lost.
+
+**/
+BOOL cmdCreateVDMEnvironment(
+PVDMENVBLK pVDMEnvBlk
+)
+{
+PCHAR p1, p2;
+BOOL fFoundComSpec;
+BOOL fFoundWindir;
+BOOL fVarIsWindir;
+DWORD Length;
+PCHAR lpszzVDMEnv, lpszzEnv;
+CHAR achBuffer[MAX_PATH + 1];
+
+ pVDMEnvBlk->lpszzEnv = malloc(cchVDMEnv32 + cbComSpec + 1);
+ if ((lpszzVDMEnv = pVDMEnvBlk->lpszzEnv) == NULL)
+ return FALSE;
+
+ pVDMEnvBlk->cchRemain = cchVDMEnv32 + cbComSpec + 1;
+ pVDMEnvBlk->cchEnv = 0;
+
+ // grab the 16bits comspec first
+ if (cbComSpec && lpszComSpec && *lpszComSpec) {
+ RtlCopyMemory(lpszzVDMEnv, lpszComSpec, cbComSpec);
+ pVDMEnvBlk->cchEnv += cbComSpec;
+ pVDMEnvBlk->cchRemain -= cbComSpec;
+ lpszzVDMEnv += cbComSpec;
+ }
+ if (lpszzVDMEnv32) {
+
+ // go through the given 32bits environmnet and take what we want:
+ // everything except:
+ // (1). variable name begin with '='
+ // (2). compsec
+ // (3). string without a '=' -- malformatted environment variable
+ // (4). windir, so DOS apps don't think they're running under Windows
+ // Note that strings pointed by lpszzVDMEnv32 are in ANSI character set
+
+
+ fFoundComSpec = FALSE;
+ fFoundWindir = FALSE;
+ fVarIsWindir = FALSE;
+ lpszzEnv = lpszzVDMEnv32;
+
+ while (*lpszzEnv) {
+ Length = strlen(lpszzEnv) + 1;
+ if (*lpszzEnv != '=' &&
+ (p1 = strchr(lpszzEnv, '=')) != NULL &&
+ (fFoundComSpec || !(fFoundComSpec = _strnicmp(lpszzEnv,
+ comspec,
+ 8
+ ) == 0)) ){
+ if (!fFoundWindir) {
+ fFoundWindir = (_strnicmp(lpszzEnv,
+ windir,
+ 6) == 0);
+ fVarIsWindir = fFoundWindir;
+ }
+ if (!fVarIsWindir || fSeparateWow) {
+ if (Length >= pVDMEnvBlk->cchRemain) {
+ lpszzVDMEnv = realloc(pVDMEnvBlk->lpszzEnv,
+ pVDMEnvBlk->cchEnv +
+ pVDMEnvBlk->cchRemain +
+ VDM_ENV_INC_SIZE
+ );
+ if (lpszzVDMEnv == NULL){
+ free(pVDMEnvBlk->lpszzEnv);
+ return FALSE;
+ }
+ pVDMEnvBlk->cchRemain += VDM_ENV_INC_SIZE;
+ pVDMEnvBlk->lpszzEnv = lpszzVDMEnv;
+ lpszzVDMEnv += pVDMEnvBlk->cchEnv;
+ }
+ AnsiToOemBuff(lpszzEnv, lpszzVDMEnv, Length);
+ if (!fVarIsWindir) {
+ *(lpszzVDMEnv + (DWORD)(p1 - lpszzEnv)) = '\0';
+ _strupr(lpszzVDMEnv);
+ *(lpszzVDMEnv + (DWORD)(p1 - lpszzEnv)) = '=';
+ } else {
+ fVarIsWindir = FALSE;
+ }
+ pVDMEnvBlk->cchEnv += Length;
+ pVDMEnvBlk->cchRemain -= Length;
+ lpszzVDMEnv += Length;
+ }
+ else
+ fVarIsWindir = FALSE;
+ }
+ lpszzEnv += Length;
+ }
+ }
+ *lpszzVDMEnv = '\0';
+ pVDMEnvBlk->cchEnv++;
+ pVDMEnvBlk->cchRemain--;
+
+ if (lpszzcmdEnv16 != NULL) {
+ lpszzEnv = lpszzcmdEnv16;
+
+ while (*lpszzEnv) {
+ p1 = lpszzEnv + strlen(lpszzEnv) + 1;
+ p2 = NULL;
+ if (*p1) {
+ p2 = achBuffer;
+ // expand the strings pointed by p1
+ Length = cmdExpandEnvironmentStrings(pVDMEnvBlk,
+ p1,
+ p2,
+ MAX_PATH + 1
+ );
+ if (Length && Length > MAX_PATH) {
+ p2 = (PCHAR) malloc(Length);
+ if (p2 == NULL) {
+ free(pVDMEnvBlk->lpszzEnv);
+ return FALSE;
+ }
+ cmdExpandEnvironmentStrings(pVDMEnvBlk,
+ p1,
+ p2,
+ Length
+ );
+ }
+ }
+ if (!cmdSetEnvironmentVariable(pVDMEnvBlk,
+ lpszzEnv,
+ p2
+ )){
+ if (p2 && p2 != achBuffer)
+ free(p2);
+ free(pVDMEnvBlk->lpszzEnv);
+ return FALSE;
+ }
+ lpszzEnv = p1 + strlen(p1) + 1;
+ }
+ }
+ lpszzVDMEnv = realloc(pVDMEnvBlk->lpszzEnv, pVDMEnvBlk->cchEnv);
+ if (lpszzVDMEnv != NULL) {
+ pVDMEnvBlk->lpszzEnv = lpszzVDMEnv;
+ pVDMEnvBlk->cchRemain = 0;
+ }
+ return TRUE;
+}
+
+
+BOOL cmdSetEnvironmentVariable(
+PVDMENVBLK pVDMEnvBlk,
+PCHAR lpszName,
+PCHAR lpszValue
+)
+{
+ PCHAR p, p1, pEnd;
+ DWORD ExtraLength, Length, cchValue, cchOldValue;
+
+ pVDMEnvBlk = (pVDMEnvBlk) ? pVDMEnvBlk : &cmdVDMEnvBlk;
+
+ if (pVDMEnvBlk == NULL || lpszName == NULL)
+ return FALSE;
+ if (!(p = pVDMEnvBlk->lpszzEnv))
+ return FALSE;
+ pEnd = p + pVDMEnvBlk->cchEnv - 1;
+
+ cchValue = (lpszValue) ? strlen(lpszValue) : 0;
+
+ Length = strlen(lpszName);
+ while (*p && ((p1 = strchr(p, '=')) == NULL ||
+ (DWORD)(p1 - p) != Length ||
+ _strnicmp(p, lpszName, Length)))
+ p += strlen(p) + 1;
+
+ if (*p) {
+ // name was found in the base environment, replace it
+ p1++;
+ cchOldValue = strlen(p1);
+ if (cchValue <= cchOldValue) {
+ if (!cchValue) {
+ RtlMoveMemory(p,
+ p1 + cchOldValue + 1,
+ (DWORD)(pEnd - p) - cchOldValue
+ );
+ pVDMEnvBlk->cchRemain += Length + cchOldValue + 2;
+ pVDMEnvBlk->cchEnv -= Length + cchOldValue + 2;
+ }
+ else {
+ RtlCopyMemory(p1,
+ lpszValue,
+ cchValue
+ );
+ if (cchValue != cchOldValue) {
+ RtlMoveMemory(p1 + cchValue,
+ p1 + cchOldValue,
+ (DWORD)(pEnd - p1) - cchOldValue + 1
+ );
+ pVDMEnvBlk->cchEnv -= cchOldValue - cchValue;
+ pVDMEnvBlk->cchRemain += cchOldValue - cchValue;
+ }
+ }
+ return TRUE;
+ }
+ else {
+ // need more space for the new value
+ // we delete it from here and fall through
+ RtlMoveMemory(p,
+ p1 + cchOldValue + 1,
+ (DWORD)(pEnd - p1) - cchOldValue
+ );
+ pVDMEnvBlk->cchRemain += Length + 1 + cchOldValue + 1;
+ pVDMEnvBlk->cchEnv -= Length + 1 + cchOldValue + 1;
+ }
+ }
+ if (cchValue) {
+ ExtraLength = Length + 1 + cchValue + 1;
+ if (pVDMEnvBlk->cchRemain < ExtraLength) {
+ p = realloc(pVDMEnvBlk->lpszzEnv,
+ pVDMEnvBlk->cchEnv + pVDMEnvBlk->cchRemain + ExtraLength
+ );
+ if (p == NULL)
+ return FALSE;
+ pVDMEnvBlk->lpszzEnv = p;
+ pVDMEnvBlk->cchRemain += ExtraLength;
+ }
+ p = pVDMEnvBlk->lpszzEnv + pVDMEnvBlk->cchEnv - 1;
+ RtlCopyMemory(p, lpszName, Length + 1);
+ _strupr(p);
+ p += Length;
+ *p++ = '=';
+ RtlCopyMemory(p, lpszValue, cchValue + 1);
+ *(p + cchValue + 1) = '\0';
+ pVDMEnvBlk->cchEnv += ExtraLength;
+ pVDMEnvBlk->cchRemain -= ExtraLength;
+ return TRUE;
+ }
+ return FALSE;
+
+}
+
+
+DWORD cmdExpandEnvironmentStrings(
+PVDMENVBLK pVDMEnvBlk,
+PCHAR lpszSrc,
+PCHAR lpszDst,
+DWORD cchDst
+)
+{
+
+
+ DWORD RequiredLength, RemainLength, Length;
+ PCHAR p1;
+
+ RequiredLength = 0;
+ RemainLength = (lpszDst) ? cchDst : 0;
+ pVDMEnvBlk = (pVDMEnvBlk) ? pVDMEnvBlk : &cmdVDMEnvBlk;
+ if (pVDMEnvBlk == NULL || lpszSrc == NULL)
+ return 0;
+
+ while(*lpszSrc) {
+ if (*lpszSrc == '%') {
+ p1 = strchr(lpszSrc + 1, '%');
+ if (p1 != NULL) {
+ if (p1 == lpszSrc + 1) { // a "%%"
+ lpszSrc += 2;
+ continue;
+ }
+ *p1 = '\0';
+ Length = cmdGetEnvironmentVariable(pVDMEnvBlk,
+ lpszSrc + 1,
+ lpszDst,
+ RemainLength
+ );
+ *p1 = '%';
+ lpszSrc = p1 + 1;
+ if (Length) {
+ if (Length < RemainLength) {
+ RemainLength -= Length;
+ lpszDst += Length;
+ }
+ else {
+ RemainLength = 0;
+ Length --;
+ }
+ RequiredLength += Length;
+ }
+ continue;
+ }
+ else {
+ RequiredLength++;
+ if (RemainLength) {
+ *lpszDst++ = *lpszSrc;
+ RemainLength--;
+ }
+ lpszSrc++;
+ continue;
+ }
+ }
+ else {
+ RequiredLength++;
+ if (RemainLength) {
+ *lpszDst++ = *lpszSrc;
+ RemainLength--;
+ }
+ lpszSrc++;
+ }
+ } // while(*lpszSrc)
+ RequiredLength++;
+ if (RemainLength)
+ *lpszDst = '\0';
+ return RequiredLength;
+}
+
+
+DWORD cmdGetEnvironmentVariable(
+PVDMENVBLK pVDMEnvBlk,
+PCHAR lpszName,
+PCHAR lpszValue,
+DWORD cchValue
+)
+{
+
+ DWORD RequiredLength, Length;
+ PCHAR p, p1;
+
+ pVDMEnvBlk = (pVDMEnvBlk) ? pVDMEnvBlk : &cmdVDMEnvBlk;
+ if (pVDMEnvBlk == NULL || lpszName == NULL)
+ return 0;
+
+ RequiredLength = 0;
+ Length = strlen(lpszName);
+
+ // if the name is "windir", get its value from ntvdm process's environment
+ // for DOS because we took it out of the environment block the application
+ // will see.
+ if (Length == 6 && !fSeparateWow && !_strnicmp(lpszName, windir, 6)) {
+ return(GetEnvironmentVariableOem(lpszName, lpszValue, cchValue));
+ }
+
+ if (p = pVDMEnvBlk->lpszzEnv) {
+ while (*p && ((p1 = strchr(p, '=')) == NULL ||
+ (DWORD)(p1 - p) != Length ||
+ _strnicmp(lpszName, p, Length)))
+ p += strlen(p) + 1;
+ if (*p) {
+ RequiredLength = strlen(p1 + 1);
+ if (cchValue > RequiredLength && lpszValue)
+ RtlCopyMemory(lpszValue, p1 + 1, RequiredLength + 1);
+ else
+ RequiredLength++;
+ }
+ }
+ return RequiredLength;
+}
diff --git a/private/mvdm/dos/command/cmdexec.c b/private/mvdm/dos/command/cmdexec.c
new file mode 100644
index 000000000..61af4c591
--- /dev/null
+++ b/private/mvdm/dos/command/cmdexec.c
@@ -0,0 +1,650 @@
+/* cmdexec.c - Misc SCS routines for non-dos exec and re-entering
+ * the DOS.
+ *
+ *
+ * Modification History:
+ *
+ * Sudeepb 22-Apr-1992 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+#include <oemuni.h>
+#include <wowcmpat.h>
+
+//*****************************************************************************
+// IsWowAppRunnable
+//
+// Returns FALSE if the WOW-specific compatibility flags for the specified
+// task include the bit WOWCF_NOTDOSSPAWNABLE. This is done mostly for
+// "dual mode" executables, e.g., Windows apps that have a real program
+// as a DOS stub. Certain apps that are started via a DOS command shell,
+// for example PWB, really do expect to be started as a DOS app, not a WOW
+// app. For these apps, the compatibility bit should be set in the
+// registry.
+//
+//*****************************************************************************
+
+BOOL IsWowAppRunnable(LPSTR lpAppName)
+{
+ BOOL Result = TRUE;
+ LONG lError;
+ HKEY hKey = 0;
+ char szModName[9];
+ char szHexAsciiFlags[12];
+ DWORD dwType = REG_SZ;
+ DWORD cbData = sizeof(szHexAsciiFlags);
+ ULONG ul = 0;
+ LPSTR pStrt, pEnd;
+ SHORT len;
+
+ lError = RegOpenKeyEx( HKEY_LOCAL_MACHINE,
+ "Software\\Microsoft\\Windows NT\\CurrentVersion\\WOW\\Compatibility",
+ 0,
+ KEY_QUERY_VALUE,
+ &hKey
+ );
+
+ if (ERROR_SUCCESS != lError) {
+ goto Cleanup;
+ }
+
+ //
+ // The following code strips the file name (<9 chars) out of a dos
+ // path name.
+ //
+
+ pStrt = strrchr (lpAppName, '\\');
+
+ if (pStrt==NULL)
+ pStrt = lpAppName;
+ else
+ pStrt++;
+
+ if ( (pEnd = strchr (pStrt, '.')) == NULL)
+ strncpy (szModName, pStrt, 9);
+
+ else {
+ len = (SHORT) (pEnd - pStrt);
+ if (len>8) goto Cleanup;
+ strncpy (szModName, pStrt, len);
+ szModName[len] = '\0';
+ }
+
+
+ //
+ // Look for the file name in the registry
+ //
+
+ lError = RegQueryValueEx( hKey,
+ szModName,
+ 0,
+ &dwType,
+ szHexAsciiFlags,
+ &cbData
+ );
+
+ if (ERROR_SUCCESS != lError) {
+ goto Cleanup;
+ }
+
+ if (REG_SZ != dwType) {
+ goto Cleanup;
+ }
+
+ //
+ // Force the string to lowercase for the convenience of sscanf.
+ //
+
+ _strlwr(szHexAsciiFlags);
+
+ //
+ // sscanf() returns the number of fields converted.
+ //
+
+ if (1 != sscanf(szHexAsciiFlags, "0x%lx", &ul)) {
+ goto Cleanup;
+ }
+
+ if ((ul & WOWCF_NOTDOSSPAWNABLE) != 0)
+ Result = FALSE;
+
+Cleanup:
+ if (hKey) {
+ RegCloseKey(hKey);
+ }
+
+ return Result;
+}
+
+/* cmdCheckBinary - check that the supplied binary name is a 32bit binary
+ *
+ *
+ * Entry - Client (DS:DX) - pointer to pathname for the executable to be tested
+ * Client (ES:BX) - pointer to parameter block
+ *
+ * EXIT - SUCCESS Client (CY) clear
+ * FAILURE Client (CY) set
+ * Client (AX) - error_not_enough_memory if command tail
+ * cannot accomodate /z
+ * - error_file_not_found if patname not found
+ */
+
+VOID cmdCheckBinary (VOID)
+{
+
+ LPSTR lpAppName;
+ ULONG BinaryType;
+ PPARAMBLOCK lpParamBlock;
+ PCHAR lpCommandTail,lpTemp;
+ ULONG AppNameLen,CommandTailLen = 0;
+ USHORT CommandTailOff,CommandTailSeg,usTemp;
+ NTSTATUS Status;
+ UNICODE_STRING Unicode;
+ OEM_STRING OemString;
+ ANSI_STRING AnsiString;
+
+
+ if(DontCheckDosBinaryType){
+ setCF(0);
+ return; // DOS Exe
+ }
+
+ lpAppName = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+ Unicode.Buffer = NULL;
+ AnsiString.Buffer = NULL;
+ RtlInitString((PSTRING)&OemString, lpAppName);
+ Status = RtlOemStringToUnicodeString(&Unicode,&OemString,TRUE);
+ if ( NT_SUCCESS(Status) ) {
+ Status = RtlUnicodeStringToAnsiString(&AnsiString, &Unicode, TRUE);
+ }
+ if ( !NT_SUCCESS(Status) ) {
+ Status = RtlNtStatusToDosError(Status);
+ }
+ else if (GetBinaryType (AnsiString.Buffer,(LPLONG)&BinaryType) == FALSE)
+ {
+ Status = GetLastError();
+ }
+
+ if (Unicode.Buffer != NULL) {
+ RtlFreeUnicodeString( &Unicode );
+ }
+ if (AnsiString.Buffer != NULL) {
+ RtlFreeAnsiString( &AnsiString);
+ }
+
+ if (Status){
+ setCF(1);
+ setAX((USHORT)Status);
+ return; // Invalid path
+ }
+
+
+ if (BinaryType == SCS_DOS_BINARY) {
+ setCF(0);
+ return; // DOS Exe
+ }
+ // Prevent certain WOW apps from being spawned by DOS exe's
+ // This is for win31 compatibility
+ else if (BinaryType == SCS_WOW_BINARY) {
+ if (!IsWowAppRunnable(lpAppName)) {
+ setCF(0);
+ return; // Run as DOS Exe
+ }
+ }
+
+
+ if (VDMForWOW && BinaryType == SCS_WOW_BINARY && IsFirstWOWCheckBinary) {
+ IsFirstWOWCheckBinary = FALSE;
+ setCF(0);
+ return; // Special Hack for krnl286.exe
+ }
+
+ // dont allow running 32bit binaries from autoexec.nt. Reason is that
+ // running non-dos binary requires that we should have read the actual
+ // command from GetNextVDMCommand. Otherwise the whole design gets into
+ // synchronization problems.
+
+ if (IsFirstCall) {
+ setCF(1);
+ setAX((USHORT)ERROR_FILE_NOT_FOUND);
+ return;
+ }
+
+ // Its a 32bit exe, replace the command with "command.com /z" and add the
+ // original binary name to command tail.
+
+ AppNameLen = strlen (lpAppName);
+
+ lpParamBlock = (PPARAMBLOCK) GetVDMAddr (getES(),getBX());
+
+ if (lpParamBlock) {
+ CommandTailOff = FETCHWORD(lpParamBlock->OffCmdTail);
+ CommandTailSeg = FETCHWORD(lpParamBlock->SegCmdTail);
+
+ lpCommandTail = (PCHAR) GetVDMAddr (CommandTailSeg,CommandTailOff);
+
+ if (lpCommandTail){
+ CommandTailLen = *(PCHAR)lpCommandTail;
+ lpCommandTail++; // point to the actual command tail
+ if (CommandTailLen)
+ CommandTailLen++; // For CR
+ }
+
+ // We are adding 3 below for "/z<space>" and anothre space between
+ // AppName and CommandTail.
+
+ if ((3 + AppNameLen + CommandTailLen ) > 128){
+ setCF(1);
+ setAX((USHORT)ERROR_NOT_ENOUGH_MEMORY);
+ return;
+ }
+ }
+
+ // copy the stub command.com name
+ strcpy ((PCHAR)&pSCSInfo->SCS_ComSpec,lpszComSpec+8);
+ lpTemp = (PCHAR) &pSCSInfo->SCS_ComSpec;
+ lpTemp = (PCHAR)((ULONG)lpTemp - (ULONG)GetVDMAddr(0,0));
+ usTemp = (USHORT)((ULONG)lpTemp >> 4);
+ setDS(usTemp);
+ usTemp = (USHORT)((ULONG)lpTemp & 0x0f);
+ setDX((usTemp));
+
+ // Form the command tail, first "3" is for "/z "
+ pSCSInfo->SCS_CmdTail [0] = (UCHAR)(3 +
+ AppNameLen +
+ CommandTailLen);
+ RtlCopyMemory ((PCHAR)&pSCSInfo->SCS_CmdTail[1],"/z ",3);
+ strcpy ((PCHAR)&pSCSInfo->SCS_CmdTail[4],lpAppName);
+ if (CommandTailLen) {
+ pSCSInfo->SCS_CmdTail[4+AppNameLen] = ' ';
+ RtlCopyMemory ((PCHAR)((ULONG)&pSCSInfo->SCS_CmdTail[4]+AppNameLen+1),
+ lpCommandTail,
+ CommandTailLen);
+ }
+ else {
+ pSCSInfo->SCS_CmdTail[4+AppNameLen] = 0xd;
+ }
+
+ // Set the parameter Block
+ if (lpParamBlock) {
+ STOREWORD(pSCSInfo->SCS_ParamBlock.SegEnv,lpParamBlock->SegEnv);
+ STOREDWORD(pSCSInfo->SCS_ParamBlock.pFCB1,lpParamBlock->pFCB1);
+ STOREDWORD(pSCSInfo->SCS_ParamBlock.pFCB2,lpParamBlock->pFCB2);
+ }
+ else {
+ STOREWORD(pSCSInfo->SCS_ParamBlock.SegEnv,0);
+ STOREDWORD(pSCSInfo->SCS_ParamBlock.pFCB1,0);
+ STOREDWORD(pSCSInfo->SCS_ParamBlock.pFCB2,0);
+ }
+
+ lpTemp = (PCHAR) &pSCSInfo->SCS_CmdTail;
+ lpTemp = (PCHAR)((ULONG)lpTemp - (ULONG)GetVDMAddr(0,0));
+ usTemp = (USHORT)((ULONG)lpTemp & 0x0f);
+ STOREWORD(pSCSInfo->SCS_ParamBlock.OffCmdTail,usTemp);
+ usTemp = (USHORT)((ULONG)lpTemp >> 4);
+ STOREWORD(pSCSInfo->SCS_ParamBlock.SegCmdTail,usTemp);
+
+ lpTemp = (PCHAR) &pSCSInfo->SCS_ParamBlock;
+ lpTemp = (PCHAR)((ULONG)lpTemp - (ULONG)GetVDMAddr(0,0));
+ usTemp = (USHORT)((ULONG)lpTemp >> 4);
+ setES (usTemp);
+ usTemp = (USHORT)((ULONG)lpTemp & 0x0f);
+ setBX (usTemp);
+
+ setCF(0);
+ return;
+}
+
+#define MAX_DIR 68
+
+VOID cmdCreateProcess ( VOID )
+{
+
+ VDMINFO VDMInfoForCount;
+ STARTUPINFO StartupInfo;
+ PROCESS_INFORMATION ProcessInformation;
+ HANDLE hStd16In,hStd16Out,hStd16Err;
+ CHAR CurDirVar [] = "=?:";
+ CHAR Buffer [MAX_DIR];
+ CHAR *CurDir = Buffer;
+ DWORD dwRet;
+ BOOL Status;
+ NTSTATUS NtStatus;
+ UNICODE_STRING Unicode;
+ OEM_STRING OemString;
+ LPVOID lpNewEnv=NULL;
+ PSTD_HANDLES pStdHandles;
+ ANSI_STRING Env_A;
+
+ // we have one more 32 executable active
+ Exe32ActiveCount++;
+
+ // Increment the Re-enterancy count for the VDM
+ VDMInfoForCount.VDMState = INCREMENT_REENTER_COUNT;
+ GetNextVDMCommand (&VDMInfoForCount);
+
+ RtlZeroMemory((PVOID)&StartupInfo,sizeof(STARTUPINFO));
+ StartupInfo.cb = sizeof(STARTUPINFO);
+
+ CurDirVar [1] = chDefaultDrive;
+
+ dwRet = GetEnvironmentVariable (CurDirVar,Buffer,MAX_DIR);
+
+ if (dwRet == 0 || dwRet == MAX_DIR)
+ CurDir = NULL;
+
+ pStdHandles = (PSTD_HANDLES) GetVDMAddr (getSS(), getBP());
+ if ((hStd16In = (HANDLE) FETCHDWORD(pStdHandles->hStdIn)) != (HANDLE)-1)
+ SetStdHandle (STD_INPUT_HANDLE, hStd16In);
+
+ if ((hStd16Out = (HANDLE) FETCHDWORD(pStdHandles->hStdOut)) != (HANDLE)-1)
+ SetStdHandle (STD_OUTPUT_HANDLE, hStd16Out);
+
+ if ((hStd16Err = (HANDLE) FETCHDWORD(pStdHandles->hStdErr)) != (HANDLE)-1)
+ SetStdHandle (STD_ERROR_HANDLE, hStd16Err);
+
+ /*
+ * Warning, pEnv32 currently points to an ansi environment.
+ * The DOS is using an ANSI env which isn't quite correct.
+ * If the DOS is changed to use an OEM env then we will
+ * have to convert the env back to ansi before spawning
+ * non-dos exes ?!?
+ * 16-Jan-1993 Jonle
+ */
+
+ Env_A.Buffer = NULL;
+
+ RtlInitString((PSTRING)&OemString, pCommand32);
+ NtStatus = RtlOemStringToUnicodeString(&Unicode,&OemString,TRUE);
+ if (NT_SUCCESS(NtStatus)) {
+ NtStatus = RtlUnicodeStringToAnsiString((PANSI_STRING)&OemString, &Unicode, FALSE);
+ RtlFreeUnicodeString( &Unicode );
+ }
+ if (!NT_SUCCESS(NtStatus)) {
+ SetLastError(RtlNtStatusToDosError(NtStatus));
+ Status = FALSE;
+ }
+ else {
+ if (pEnv32 != NULL && !cmdXformEnvironment (pEnv32, &Env_A)) {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ Status = FALSE;
+ }
+ else {
+
+ Status = CreateProcess (
+ NULL,
+ (LPTSTR)pCommand32,
+ NULL,
+ NULL,
+ TRUE,
+ CREATE_SUSPENDED | CREATE_DEFAULT_ERROR_MODE,
+ Env_A.Buffer,
+ (LPTSTR)CurDir,
+ &StartupInfo,
+ &ProcessInformation);
+ }
+ }
+
+ if (Status == FALSE)
+ dwExitCode32 = GetLastError ();
+
+ if (hStd16In != (HANDLE)-1)
+ SetStdHandle (STD_INPUT_HANDLE, SCS_hStdIn);
+
+ if (hStd16Out != (HANDLE)-1)
+ SetStdHandle (STD_OUTPUT_HANDLE, SCS_hStdOut);
+
+ if (hStd16Err != (HANDLE)-1)
+ SetStdHandle (STD_ERROR_HANDLE, SCS_hStdErr);
+
+ if (Status) {
+ ResumeThread (ProcessInformation.hThread);
+ WaitForSingleObject(ProcessInformation.hProcess, (DWORD)-1);
+ GetExitCodeProcess (ProcessInformation.hProcess, &dwExitCode32);
+ CloseHandle (ProcessInformation.hProcess);
+ CloseHandle (ProcessInformation.hThread);
+ }
+
+ if (Env_A.Buffer)
+ RtlFreeAnsiString(&Env_A);
+
+ // Decrement the Re-enterancy count for the VDM
+ VDMInfoForCount.VDMState = DECREMENT_REENTER_COUNT;
+ GetNextVDMCommand (&VDMInfoForCount);
+
+ // one less 32 executable active
+ Exe32ActiveCount--;
+
+ // Kill this thread
+ ExitThread (0);
+}
+
+
+VOID cmdExec32 (PCHAR pCmd32, PCHAR pEnv)
+{
+
+ DWORD dwThreadId;
+ HANDLE hThread;
+
+ pCommand32 = pCmd32;
+ pEnv32 = pEnv;
+
+ CntrlHandlerState = (CntrlHandlerState & ~CNTRL_SHELLCOUNT) |
+ (((WORD)(CntrlHandlerState & CNTRL_SHELLCOUNT))+1);
+
+ nt_block_event_thread(0);
+ fSoftpcRedirectionOnShellOut = fSoftpcRedirection;
+ fBlock = TRUE;
+
+ if((hThread = CreateThread (NULL,
+ 0,
+ (LPTHREAD_START_ROUTINE)cmdCreateProcess,
+ NULL,
+ 0,
+ &dwThreadId)) == FALSE) {
+ setCF(0);
+ setAL((UCHAR)GetLastError());
+ nt_resume_event_thread();
+ nt_std_handle_notification(fSoftpcRedirectionOnShellOut);
+ fBlock = FALSE;
+ CntrlHandlerState = (CntrlHandlerState & ~CNTRL_SHELLCOUNT) |
+ (((WORD)(CntrlHandlerState & CNTRL_SHELLCOUNT))-1);
+ return;
+ }
+ else
+ CloseHandle (hThread);
+
+ // Wait for next command to be re-entered
+ VDMInfo.VDMState = NO_PARENT_TO_WAKE | RETURN_ON_NO_COMMAND;
+ VDMInfo.EnviornmentSize = 0;
+ VDMInfo.ErrorCode = 0;
+ VDMInfo.CmdSize = 0;
+ VDMInfo.TitleLen = 0;
+ VDMInfo.ReservedLen = 0;
+ VDMInfo.DesktopLen = 0;
+ VDMInfo.CurDirectoryLen = 0;
+ GetNextVDMCommand (&VDMInfo);
+ if (VDMInfo.CmdSize > 0){
+ setCF(1);
+ IsRepeatCall = TRUE;
+ }
+ else {
+ setCF(0);
+ setAL((UCHAR)dwExitCode32);
+ nt_resume_event_thread();
+ nt_std_handle_notification(fSoftpcRedirectionOnShellOut);
+ fBlock = FALSE;
+ }
+
+
+ CntrlHandlerState = (CntrlHandlerState & ~CNTRL_SHELLCOUNT) |
+ (((WORD)(CntrlHandlerState & CNTRL_SHELLCOUNT))-1);
+ return;
+}
+
+/* cmdExecComspec32 - Exec 32bit COMSPEC
+ *
+ *
+ * Entry - Client (ES) - environment segment
+ * Client (AL) - default drive
+ *
+ * EXIT - SUCCESS Client (CY) Clear - AL has return error code
+ * FAILURE Client (CY) set - means DOS is being re-entered
+ */
+
+VOID cmdExecComspec32 (VOID)
+{
+
+ CHAR Buffer[MAX_PATH];
+ DWORD dwRet;
+ PCHAR pEnv;
+
+ dwRet = GetEnvironmentVariable ("COMSPEC",Buffer,MAX_PATH);
+
+ if (dwRet == 0 || dwRet >= MAX_PATH){
+ setCF(0);
+ setAL((UCHAR)ERROR_BAD_ENVIRONMENT);
+ return;
+ }
+
+ pEnv = (PCHAR) GetVDMAddr ((USHORT)getES(),0);
+
+ chDefaultDrive = (CHAR)(getAL() + 'A');
+
+ cmdExec32 (Buffer,pEnv);
+
+ return;
+}
+
+/* cmdExec - Exec a non-dos binary
+ *
+ *
+ * Entry - Client (DS:SI) - command to execute
+ * Client (AL) - default drive
+ * Client (ES) - environment segment
+ * Client (SS:BP) - Pointer to STD_HANDLES
+ * Client (AH) - if 1 means do "cmd /c command" else "command"
+ *
+ * EXIT - SUCCESS Client (CY) Clear - AL has return error code
+ * FAILURE Client (CY) set - means DOS is being re-entered
+ */
+
+VOID cmdExec (VOID)
+{
+
+ DWORD i;
+ DWORD dwRet;
+ PCHAR pCommandTail;
+ PCHAR pEnv;
+ CHAR Buffer[MAX_PATH];
+
+ pCommandTail = (PCHAR) GetVDMAddr ((USHORT)getDS(),(USHORT)getSI());
+ pEnv = (PCHAR) GetVDMAddr ((USHORT)getES(),0);
+ for (i=0 ; i<124 ; i++) {
+ if (pCommandTail[i] == 0x0d){
+ pCommandTail[i] = 0;
+ break;
+ }
+ }
+
+ if (i == 124){
+ setCF(0);
+ setAL((UCHAR)ERROR_BAD_FORMAT);
+ return;
+ }
+
+ chDefaultDrive = (CHAR)(getAL() + 'A');
+
+ if (getAH() == 0) {
+ cmdExec32 (pCommandTail,pEnv);
+ }
+ else {
+ dwRet = GetEnvironmentVariable ("COMSPEC",Buffer,MAX_PATH);
+
+ if (dwRet == 0 || dwRet >= MAX_PATH){
+ setCF(0);
+ setAL((UCHAR)ERROR_BAD_ENVIRONMENT);
+ return;
+ }
+
+ if ((dwRet + 4 + strlen(pCommandTail)) > MAX_PATH) {
+ setCF(0);
+ setAL((UCHAR)ERROR_BAD_ENVIRONMENT);
+ return;
+ }
+
+ strcat (Buffer, " /c ");
+ strcat (Buffer, pCommandTail);
+ cmdExec32 (Buffer,pEnv);
+ }
+
+ return;
+}
+
+/* cmdReturnExitCode - command.com has run a dos binary and returing
+ * the exit code.
+ *
+ * Entry - Client (DX) - exit code
+ * Client (AL) - current drive
+ * Client (BX:CX) - RdrInfo address
+ *
+ * Exit
+ * Client Carry Set - Reenter i.e. a new DOS binary to execute.
+ * Client Carry Clear - This shelled out session is over.
+ */
+
+VOID cmdReturnExitCode (VOID)
+{
+VDMINFO VDMInfo;
+PREDIRCOMPLETE_INFO pRdrInfo;
+
+ VDMInfo.VDMState = RETURN_ON_NO_COMMAND;
+ VDMInfo.EnviornmentSize = 0;
+ VDMInfo.ErrorCode = (ULONG)getDX();
+ VDMInfo.CmdSize = 0;
+ VDMInfo.TitleLen = 0;
+ VDMInfo.ReservedLen = 0;
+ VDMInfo.DesktopLen = 0;
+ VDMInfo.CurDirectoryLen = 0;
+
+
+ CntrlHandlerState = (CntrlHandlerState & ~CNTRL_SHELLCOUNT) |
+ (((WORD)(CntrlHandlerState & CNTRL_SHELLCOUNT))+1);
+
+ nt_block_event_thread(0);
+ fBlock = TRUE;
+
+ // a dos program just terminate, inherit its current directories
+ // and tell base too.
+ cmdUpdateCurrentDirectories((BYTE)getAL());
+
+ // Check for any copying needed for redirection
+ pRdrInfo = (PREDIRCOMPLETE_INFO) (((ULONG)getBX() << 16) + (ULONG)getCX());
+
+ if (cmdCheckCopyForRedirection (pRdrInfo) == FALSE)
+ VDMInfo.ErrorCode = ERROR_NOT_ENOUGH_MEMORY;
+
+ GetNextVDMCommand (&VDMInfo);
+ if (VDMInfo.CmdSize > 0){
+ setCF(1);
+ IsRepeatCall = TRUE;
+ }
+ else {
+ setCF(0);
+ setAL((UCHAR)dwExitCode32);
+ nt_resume_event_thread();
+ nt_std_handle_notification(fSoftpcRedirectionOnShellOut);
+ fBlock = FALSE;
+ }
+
+ CntrlHandlerState = (CntrlHandlerState & ~CNTRL_SHELLCOUNT) |
+ (((WORD)(CntrlHandlerState & CNTRL_SHELLCOUNT))-1);
+
+ return;
+}
diff --git a/private/mvdm/dos/command/cmdexit.c b/private/mvdm/dos/command/cmdexit.c
new file mode 100644
index 000000000..ead4c1434
--- /dev/null
+++ b/private/mvdm/dos/command/cmdexit.c
@@ -0,0 +1,31 @@
+/* cmdexit.c - Exit related SVC routines
+ *
+ * cmdExit
+ *
+ * Modification History:
+ *
+ * Sudeepb 05-Jul-1991 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <softpc.h>
+#include <winbase.h>
+
+/* cmdExitVDM - Terminate the VDM
+ *
+ *
+ * Entry - None
+ *
+ * Exit - None
+ *
+ *
+ *
+ */
+
+VOID cmdExitVDM (VOID)
+{
+ // Kill the VDM process
+ TerminateVDM();
+}
diff --git a/private/mvdm/dos/command/cmdkeyb.c b/private/mvdm/dos/command/cmdkeyb.c
new file mode 100644
index 000000000..f32a394d7
--- /dev/null
+++ b/private/mvdm/dos/command/cmdkeyb.c
@@ -0,0 +1,251 @@
+/* cmdkeyb.c - Keyboard layout support routines
+ *
+ *
+ * Modification History:
+ *
+ * YST 14-Jan_1993 Created
+ */
+
+#include "cmd.h"
+#include <winconp.h>
+#include <cmdsvc.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+#include <string.H>
+#include "cmdkeyb.h"
+
+CHAR szPrev[5] = "US";
+INT iPrevCP = 437;
+CHAR szPrevKbdID[8] = "";
+
+extern BOOL bPifFastPaste;
+
+
+
+
+/************************************************************************\
+*
+* FUNCTION: VOID cmdGetKbdLayout( VOID )
+*
+* Input Client (DX) = 0 - Keyb.com not installed
+* 1 - Keyb.com installed
+* Client (DS:SI) = pointer where exe name has to be placed
+* Client (DS:CX) = pointer where command options are placed
+*
+* Output
+* Success (DX = 1 )
+* Client (DS:SI) = Keyb.com execuatable string
+* Client (DS:CX) = command options
+*
+* Failure (DX = 0)
+*
+* COMMENTS: This function check KEYBOARD ID for Win session
+* and if ID != US then return lines with
+* filename and options to COMMAND.COM
+*
+* If bPifFastPaste is FALSE, then we always run kb16
+* for all keyboard ID including US, to give us a more
+* bios compatible Int 9 handler. 10-Jun-1993 Jonle
+*
+*
+* HISTORY: 01/05/93 YSt Created.
+*
+\************************************************************************/
+
+VOID cmdGetKbdLayout( VOID )
+{
+ INT iSize,iSaveSize;
+ CHAR szKeybCode[12];
+ CHAR szDir[MAX_PATH+15];
+ CHAR szBuf[28];
+ CHAR szNewKbdID[8];
+ CHAR szAutoLine[MAX_PATH+40];
+ PCHAR pVDMKeyb;
+
+ INT iKeyb;
+ HKEY hKey;
+ DWORD dwType;
+ DWORD retCode;
+ INT iNewCP;
+ DWORD cbData;
+ OFSTRUCT ofstr;
+
+
+
+// Get information about 16 bit KEYB.COM from VDM
+ iKeyb = getDX();
+
+
+// Get Keyboard Layout Code (hec string)
+
+ if (!GetConsoleKeyboardLayoutName(szKeybCode)) {
+ goto NoInstallkb16;
+ }
+
+
+// if we have US code 0000409 and KB16 not installed then
+// do nothing and return
+
+ if(bPifFastPaste &&
+ !strcmp(szKeybCode, US_CODE) && !iKeyb) {
+ goto NoInstallkb16;
+ }
+
+// Get keyboard ID from REGISTRY file.
+// Default is US
+
+ // OPEN THE KEY.
+ sprintf(szAutoLine, "%s%s", KBDLAYOUT_PATH, DOSCODES_PATH);
+ retCode = RegOpenKeyEx (HKEY_LOCAL_MACHINE, // Key handle at root level.
+ szAutoLine, // Path name of child key.
+ 0, // Reserved.
+ KEY_EXECUTE, // Requesting read access.
+ &hKey); // Address of key to be returned.
+
+// If retCode != 0 then we cannot find section in Register file
+ if (retCode)
+ {
+ goto NoInstallkb16;
+ }
+
+
+ dwType = REG_SZ;
+ cbData = sizeof(szBuf);
+// Query for line from REGISTER file
+ retCode = RegQueryValueEx( hKey,
+ szKeybCode,
+ NULL,
+ &dwType,
+ szBuf,
+ &cbData);
+
+ RegCloseKey(hKey);
+
+ if (retCode)
+ {
+ goto NoInstallkb16;
+ }
+
+ // look for keyboard id number. For Daytona, Turkish and Italian both
+ // have one key code and two layouts.
+ szNewKbdID[0] = '\0';
+ dwType = REG_SZ;
+ cbData = sizeof(szNewKbdID);
+ sprintf(szAutoLine, "%s%s", KBDLAYOUT_PATH, DOSIDS_PATH);
+ if (RegOpenKeyEx(HKEY_LOCAL_MACHINE,
+ szAutoLine,
+ 0,
+ KEY_EXECUTE,
+ &hKey
+ ) == ERROR_SUCCESS) {
+ if (RegQueryValueEx( hKey,
+ szKeybCode,
+ NULL,
+ &dwType,
+ szNewKbdID,
+ &cbData
+ ) != ERROR_SUCCESS)
+ szNewKbdID[0] = '\0';
+
+ RegCloseKey(hKey);
+ }
+
+ iNewCP = GetConsoleCP();
+
+
+// If keycode, code page and keyboard id aren't changed, do nothing more
+
+ if(bPifFastPaste && iNewCP == iPrevCP &&
+ !_stricmp(szBuf, szPrev) &&
+ !_stricmp(szNewKbdID, szPrevKbdID)) {
+ goto NoInstallkb16;
+ }
+
+ iSaveSize = iSize = GetSystemDirectory(szDir, MAX_PATH);
+
+ if (iSize > MAX_PATH) {
+ goto NoInstallkb16;
+ }
+
+
+// If keyboard ID not found or it is US then return
+
+ if( bPifFastPaste &&
+ !_stricmp(szBuf, DEFAULT_KB_ID) && !iKeyb) {
+ goto NoInstallkb16;
+ }
+
+// Create line: SYSTEMROOT\KB16.COM
+
+ szDir[iSaveSize] = '\0';
+
+// Copy this line for COMMAND.COM
+
+ pVDMKeyb = (PCHAR) GetVDMAddr((USHORT) getDS(), (USHORT) getSI());
+
+ if ((iSaveSize+sizeof(KEYB_COM)) > 128){
+ goto NoInstallkb16;
+ }
+
+
+ sprintf(szAutoLine, "%s%s",
+ szDir, // System directory
+ KEYB_COM // keyb.com
+ );
+
+// if KB16.COM not exist then return
+ dwType = GetFileAttributes(szAutoLine);
+ if (dwType == 0xFFFFFFFF || (dwType & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ goto NoInstallkb16;
+ }
+
+ strcpy(pVDMKeyb,szAutoLine);
+
+// Checking KEYBOARD.SYS
+ sprintf(szAutoLine, "%s%s",
+ szDir, // System directory
+ KEYBOARD_SYS // keyb.com
+ );
+
+ dwType = GetFileAttributes(szAutoLine);
+ if (dwType == 0xFFFFFFFF || (dwType & FILE_ATTRIBUTE_DIRECTORY) != 0)
+ {
+ goto NoInstallkb16;
+ }
+
+
+// Create line: XX,YYY,SYSTEMROOT\Keyboard.sys
+ pVDMKeyb = (PCHAR) GetVDMAddr((USHORT) getDS(), (USHORT) getCX());
+
+ sprintf(szAutoLine, " %s,%d,%s%s",
+ szBuf, // keyboard code
+ iNewCP, // new code page
+ szDir, // System directory
+ KEYBOARD_SYS // keyboard.sys
+ );
+ iSize = strlen(szAutoLine);
+ if (szNewKbdID[0] != '\0') {
+ sprintf(&szAutoLine[iSize], " /ID:%s", szNewKbdID);
+ iSize = strlen(szAutoLine);
+ }
+ szAutoLine[iSize] = 0xd;
+ *pVDMKeyb = iSize;
+ RtlMoveMemory(pVDMKeyb + 1, szAutoLine, iSize + 1);
+
+
+// Save new layout ID and code page for next call
+ strcpy(szPrev, szBuf);
+ strcpy(szPrevKbdID, szNewKbdID);
+ iPrevCP = iNewCP;
+
+ setDX(1);
+ return;
+
+NoInstallkb16:
+ setDX(0);
+ cmdInitConsole(); // make sure conoutput is on
+ return;
+
+}
diff --git a/private/mvdm/dos/command/cmdkeyb.h b/private/mvdm/dos/command/cmdkeyb.h
new file mode 100644
index 000000000..a7c0e5578
--- /dev/null
+++ b/private/mvdm/dos/command/cmdkeyb.h
@@ -0,0 +1,18 @@
+/* cmdkeyb.h - Keyboard layout support routines
+ * include file for CMDKEYB.C
+ *
+ * Modification History:
+ *
+ * YST 14-Jan_1993 Created
+ */
+
+
+#define DOSKEYBCODES "DOSKeybCodes" // section name in layout.inf
+#define LAYOUT_FILE "\\LAYOUT.INF" // INF file name
+#define DEFAULT_KB_ID "US" // Default keyboard ID
+#define KEYBOARD_SYS "\\KEYBOARD.SYS" // Data file for KEYB.COM
+#define US_CODE "00000409" // Code for US keyboard in REGISTER.INI
+#define KEYB_COM "\\KB16.COM" // File name for keyboard program
+#define KBDLAYOUT_PATH "System\\CurrentControlSet\\Control\\Keyboard Layout\\"
+#define DOSCODES_PATH "DosKeybCodes"
+#define DOSIDS_PATH "DosKeybIDs"
diff --git a/private/mvdm/dos/command/cmdmisc.c b/private/mvdm/dos/command/cmdmisc.c
new file mode 100644
index 000000000..4e8ed2557
--- /dev/null
+++ b/private/mvdm/dos/command/cmdmisc.c
@@ -0,0 +1,897 @@
+/* cmdmisc.c - Misc. SVC routines of Command.lib
+ *
+ *
+ * Modification History:
+ *
+ * Sudeepb 17-Sep-1991 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <demexp.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+#include <memory.h>
+#include "oemuni.h"
+#include "nt_pif.h"
+#include "nt_uis.h" // For resource id
+
+
+VOID GetWowKernelCmdLine(VOID);
+extern ULONG fSeparateWow;
+
+VOID cmdGetNextCmd (VOID)
+{
+LPSTR lpszCmd;
+PCMDINFO pCMDInfo;
+ULONG cb;
+PREDIRCOMPLETE_INFO pRdrInfo;
+VDMINFO MyVDMInfo;
+
+char *pSrc, *pDst;
+char achCurDirectory[MAXIMUM_VDM_CURRENT_DIR + 4];
+char CmdLine[MAX_PATH];
+
+ //
+ // This routine is called once for WOW VDMs, to retrieve the
+ // "krnl386" command line.
+ // 5
+ if (VDMForWOW) {
+ GetWowKernelCmdLine();
+ return;
+ }
+
+ VDMInfo.VDMState = 0;
+ pCMDInfo = (LPVOID) GetVDMAddr ((USHORT)getDS(),(USHORT)getDX());
+
+ VDMInfo.ErrorCode = FETCHWORD(pCMDInfo->ReturnCode);
+ VDMInfo.CmdSize = sizeof(CmdLine);
+ VDMInfo.CmdLine = CmdLine;
+ VDMInfo.AppName = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->ExecPathSeg),
+ FETCHWORD(pCMDInfo->ExecPathOff));
+ VDMInfo.AppLen = FETCHWORD(pCMDInfo->ExecPathSize);
+ VDMInfo.PifLen = 0;
+ VDMInfo.EnviornmentSize = 0;
+ VDMInfo.Enviornment = NULL;
+ VDMInfo.CurDrive = 0;
+ VDMInfo.TitleLen = 0;
+ VDMInfo.ReservedLen = 0;
+ VDMInfo.DesktopLen = 0;
+ VDMInfo.CurDirectoryLen = MAX_PATH + 1;
+ VDMInfo.CurDirectory = achCurDirectory;
+
+ if(IsFirstCall){
+ VDMInfo.VDMState = ASKING_FOR_FIRST_COMMAND;
+ VDMInfo.ErrorCode = 0;
+
+ DeleteConfigFiles(); // get rid of the temp boot files
+
+ // When COMMAND.COM issues first cmdGetNextCmd, it has
+ // a completed environment already(cmdGetInitEnvironment),
+ // Therefore, we don't have to ask environment from BASE
+ cmdVDMEnvBlk.lpszzEnv = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->EnvSeg),0);
+ cmdVDMEnvBlk.cchEnv = FETCHWORD(pCMDInfo->EnvSize);
+
+ //clear bits that track printer flushing
+ host_lpt_flush_initialize();
+ }
+ else {
+
+ // program has terminated. If the termiation was issued from
+ // second(or later) instance of command.com(cmd.exe), don't
+ // reset the flag.
+ if (Exe32ActiveCount == 0)
+ DontCheckDosBinaryType = FALSE;
+
+ // tell the base our new current directories (in ANSI)
+ // we don't do it on repeat call(the shell out case is handled in
+ // return exit code
+ if (!IsRepeatCall) {
+ cmdUpdateCurrentDirectories((BYTE)pCMDInfo->CurDrive);
+ }
+
+ VDMInfo.VDMState = 0;
+ if(!IsRepeatCall){
+ demCloseAllPSPRecords ();
+
+ if (!pfdata.CloseOnExit && DosSessionId)
+ nt_block_event_thread(1);
+ else
+ nt_block_event_thread(0);
+
+ if (DosSessionId) {
+ if (!pfdata.CloseOnExit){
+ char achTitle[MAX_PATH];
+ char achInactive[60]; //should be plenty for 'inactive'
+ strcpy (achTitle, "[");
+ if (!LoadString(GetModuleHandle(NULL), EXIT_NO_CLOSE,
+ achInactive, 60))
+ strcat (achTitle, "Inactive ");
+ else
+ strcat(achTitle, achInactive);
+ cb = strlen(achTitle);
+ // GetConsoleTitleA and SetConsoleTitleA
+ // are working on OEM character set.
+ GetConsoleTitleA(achTitle + cb, MAX_PATH - cb - 1);
+ cb = strlen(achTitle);
+ achTitle[cb] = ']';
+ achTitle[cb + 1] = '\0';
+ SetConsoleTitleA(achTitle);
+ Sleep(INFINITE);
+ }
+ else {
+ VdmExitCode = VDMInfo.ErrorCode;
+ TerminateVDM();
+ }
+ }
+ fBlock = TRUE;
+ }
+ }
+
+ if(IsRepeatCall) {
+ VDMInfo.VDMState |= ASKING_FOR_SECOND_TIME;
+ if( VDMInfo.ErrorCode != 0 )
+ IsRepeatCall = FALSE;
+ }
+
+ VDMInfo.VDMState |= ASKING_FOR_DOS_BINARY;
+
+ if (!IsFirstCall && !(VDMInfo.VDMState & ASKING_FOR_SECOND_TIME)) {
+ pRdrInfo = (PREDIRCOMPLETE_INFO) FETCHDWORD(pCMDInfo->pRdrInfo);
+ if (cmdCheckCopyForRedirection (pRdrInfo) == FALSE)
+ VDMInfo.ErrorCode = ERROR_NOT_ENOUGH_MEMORY;
+ }
+
+ // Leave the current directory in a safe place, so that other 32bit
+ // apps etc. can delnode this directory (and other such operations) later.
+ if ( IsFirstCall == FALSE && IsRepeatCall == FALSE )
+ SetCurrentDirectory (cmdHomeDirectory);
+
+ // TSRExit will be set to 1, only if we are coming from command.com's
+ // prompt and user typed an exit. We need to kill our parent also, so we
+ // should write an exit in the console buffer.
+ if (FETCHWORD(pCMDInfo->fTSRExit)) {
+ cmdPushExitInConsoleBuffer ();
+ }
+
+ /**
+ Merging environment is required if
+ (1). Not the first comamnd &&
+ (2). NTVDM is running on an existing console ||
+ NTVDM has been shelled out.
+ Note that WOW doesn't need enviornment merging.
+ **/
+ if (!DosEnvCreated && !IsFirstCall && (!DosSessionId || Exe32ActiveCount)) {
+ RtlZeroMemory(&MyVDMInfo, sizeof(VDMINFO));
+ MyVDMInfo.VDMState = ASKING_FOR_ENVIRONMENT | ASKING_FOR_DOS_BINARY;
+ if (IsRepeatCall) {
+ MyVDMInfo.VDMState |= ASKING_FOR_SECOND_TIME;
+ MyVDMInfo.ErrorCode = 0;
+ }
+ else
+ MyVDMInfo.ErrorCode = VDMInfo.ErrorCode;
+ MyVDMInfo.Enviornment = lpszzVDMEnv32;
+ MyVDMInfo.EnviornmentSize = (USHORT) cchVDMEnv32;
+ if (!GetNextVDMCommand(&MyVDMInfo) && MyVDMInfo.EnviornmentSize > cchVDMEnv32) {
+ MyVDMInfo.Enviornment = realloc(lpszzVDMEnv32, MyVDMInfo.EnviornmentSize);
+ if (MyVDMInfo.Enviornment == NULL) {
+ RcErrorDialogBox(EG_MALLOC_FAILURE, NULL, NULL);
+ TerminateVDM();
+ }
+ lpszzVDMEnv32 = MyVDMInfo.Enviornment;
+ cchVDMEnv32 = MyVDMInfo.EnviornmentSize;
+ MyVDMInfo.VDMState = ASKING_FOR_DOS_BINARY | ASKING_FOR_ENVIRONMENT |
+ ASKING_FOR_SECOND_TIME;
+
+ MyVDMInfo.TitleLen =
+ MyVDMInfo.DesktopLen =
+ MyVDMInfo.ReservedLen =
+ MyVDMInfo.CmdSize =
+ MyVDMInfo.AppLen =
+ MyVDMInfo.PifLen =
+ MyVDMInfo.CurDirectoryLen = 0;
+ MyVDMInfo.ErrorCode = 0;
+ if (!GetNextVDMCommand(&MyVDMInfo)) {
+ RcErrorDialogBox(EG_ENVIRONMENT_ERR, NULL, NULL);
+ TerminateVDM();
+ }
+ }
+ if (!cmdCreateVDMEnvironment(&cmdVDMEnvBlk)) {
+ RcErrorDialogBox(EG_ENVIRONMENT_ERR, NULL, NULL);
+ TerminateVDM();
+ }
+ DosEnvCreated = TRUE;
+ VDMInfo.ErrorCode = 0;
+ }
+ if (cmdVDMEnvBlk.cchEnv > FETCHWORD(pCMDInfo->EnvSize)) {
+ setAX((USHORT)cmdVDMEnvBlk.cchEnv);
+ setCF(1);
+ IsFirstCall = FALSE;
+ IsRepeatCall = TRUE;
+ return;
+ }
+ if (DosEnvCreated)
+ VDMInfo.VDMState |= ASKING_FOR_SECOND_TIME;
+
+ if(!GetNextVDMCommand(&VDMInfo)){
+ RcErrorDialogBox(EG_ENVIRONMENT_ERR, NULL, NULL);
+ TerminateVDM();
+ }
+
+
+ IsRepeatCall = FALSE;
+ IsFirstCall = FALSE;
+
+ if(fBlock){
+ nt_resume_event_thread();
+ fBlock = FALSE;
+ }
+
+ // Sync VDMs enviornment variables for current directories
+ cmdSetDirectories (lpszzVDMEnv32, &VDMInfo);
+
+ // tell DOS that this is a dos executable and no further checking is
+ // necessary
+ *pIsDosBinary = 1;
+
+
+ // Check for PIF files. If a pif file is being executed extract the
+ // executable name, command line, current directory and title from the pif
+ // file and place the stuff appropriately in VDMInfo. Note, if pif file
+ // is invalid, we dont do any thing to vdminfo. In such a case we
+ // pass the pif as it is to scs to execute which we know will fail and
+ // will come back to cmdGettNextCmd with proper error code.
+
+ cmdCheckForPIF (&VDMInfo);
+
+
+ //
+ // if forcedos, then don't check binary type on int 21 exec process,
+ // so that child spawns stay in dos land. Begining with NT 4.0 forcedos.exe
+ // no longer uses pif files to force execution of a binary as a dos exe.
+ // It now uses a bit in CreateProcess (dwCreationFlags).
+ //
+
+ DontCheckDosBinaryType = (VDMInfo.dwCreationFlags & CREATE_FORCEDOS) != 0;
+
+
+ // convert exec path name to upper case. This is what command.com expect
+ if (_strupr(VDMInfo.AppName) == NULL) {
+ pSrc = VDMInfo.AppName;
+ while (*pSrc)
+ *pSrc++ = (char)toupper((int)*pSrc);
+ }
+ // figure out the extention type
+ // at least one char for the base name plus
+ // EXTENTION_STRING_LEN for the extention
+ // plus the NULL char
+ if (VDMInfo.AppLen > 1 + EXTENTION_STRING_LEN + 1) {
+ pSrc = (PCHAR)VDMInfo.AppName + VDMInfo.AppLen - 5;
+ if (!strncmp(pSrc, EXE_EXTENTION_STRING, EXTENTION_STRING_LEN))
+ STOREWORD(pCMDInfo->ExecExtType, EXE_EXTENTION);
+ else if (!strncmp(pSrc, COM_EXTENTION_STRING, EXTENTION_STRING_LEN))
+ STOREWORD(pCMDInfo->ExecExtType, COM_EXTENTION);
+ else if (!strncmp(pSrc, BAT_EXTENTION_STRING, EXTENTION_STRING_LEN))
+ STOREWORD(pCMDInfo->ExecExtType, BAT_EXTENTION);
+ else
+ STOREWORD(pCMDInfo->ExecExtType, UNKNOWN_EXTENTION);
+ }
+ else
+ STOREWORD(pCMDInfo->ExecExtType, UNKNOWN_EXTENTION);
+
+ // tell command.com the length of the app full path name.
+ STOREWORD(pCMDInfo->ExecPathSize, VDMInfo.AppLen);
+
+ //
+ // Prepare ccom's UCOMBUF
+ //
+ lpszCmd = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->CmdLineSeg),
+ FETCHWORD(pCMDInfo->CmdLineOff));
+
+ // Copy filepart of AppName excluding extension to ccom's buffer
+ pSrc = strrchr(VDMInfo.AppName, '\\');
+ if (!pSrc) {
+ pSrc = VDMInfo.AppName;
+ }
+ else {
+ pSrc++;
+ }
+ pDst = lpszCmd + 2;
+ while (*pSrc && *pSrc != '.') {
+ *pDst++ = *pSrc++;
+ }
+ cb = strlen(CmdLine);
+
+ // cmd line must be terminated with "\0xd\0xa\0". This is either done
+ // by BASE or cmdCheckForPif function(cmdpif.c).
+
+ ASSERT((cb >= 2) && (0xd == CmdLine[cb - 2]) && (0xa == CmdLine[cb - 1]));
+
+ // if cmd line is not blank, separate program base name and
+ // cmd line with a SPACE. If it IS blank, do not insert any white chars
+ // or we end up passing white chars to the applications as cmd line
+ // and some applications just can not live with that.
+ // We do not strip leading white characters in the passed command line
+ // so the application sees the original data.
+ if (cb > 2)
+ *pDst++ = ' ';
+
+ // append the command tail(at least, "\0xd\0xa")
+ strncpy(pDst, CmdLine, cb + 1);
+
+ // set the count
+ // cb has the cmd line length including the terminated 0xd and 0xa
+ // It does NOT count the terminated NULL char.
+ ASSERT((cb + pDst - lpszCmd - 2) <= 127);
+
+ // minus 2 because the real data in lpszCmd start from lpszCmd[2]
+ lpszCmd[1] = (CHAR)(cb + pDst - lpszCmd - 2);
+
+
+
+ if (DosEnvCreated) {
+ VDMInfo.Enviornment = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->EnvSeg),0);
+ RtlMoveMemory(VDMInfo.Enviornment,
+ cmdVDMEnvBlk.lpszzEnv,
+ cmdVDMEnvBlk.cchEnv
+ );
+ STOREWORD(pCMDInfo->EnvSize,cmdVDMEnvBlk.cchEnv);
+ free(cmdVDMEnvBlk.lpszzEnv);
+ DosEnvCreated = FALSE;
+ }
+
+ STOREWORD(pCMDInfo->fBatStatus,(USHORT)VDMInfo.fComingFromBat);
+ STOREWORD(pCMDInfo->CurDrive,VDMInfo.CurDrive);
+ STOREWORD(pCMDInfo->NumDrives,nDrives);
+ VDMInfo.CodePage = (ULONG) cmdMapCodePage (VDMInfo.CodePage);
+ STOREWORD(pCMDInfo->CodePage,(USHORT)VDMInfo.CodePage);
+
+ cmdVDMEnvBlk.lpszzEnv = NULL;
+ cmdVDMEnvBlk.cchEnv = 0;
+
+ IsFirstVDM = FALSE;
+
+ // Handle Standard IO redirection
+ pRdrInfo = cmdCheckStandardHandles (&VDMInfo,&pCMDInfo->bStdHandles);
+ STOREDWORD(pCMDInfo->pRdrInfo,(ULONG)pRdrInfo);
+
+ // Tell DOS that it has to invalidate the CDSs
+ *pSCS_ToSync = (CHAR)0xff;
+ setCF(0);
+
+ return;
+}
+
+
+
+VOID GetWowKernelCmdLine(VOID)
+{
+CMDINFO UNALIGNED *pCMDInfo;
+PCHAR pch, pEnvStrings;
+PCHAR pSlash;
+int Len;
+LPSTR pszCmdLine;
+
+
+ DeleteConfigFiles(); // get rid of the temp boot files
+ host_lpt_flush_initialize();
+
+ //
+ // Only a few things need be set for WOW.
+ // 1. NumDrives
+ // 2. Environment (get from current 32-bit env.)
+ // 3. Kernel CmdLine (get from ntvdm command tail)
+ // 4. Current drive
+ //
+
+ pCMDInfo = (LPVOID) GetVDMAddr ((USHORT)getDS(),(USHORT)getDX());
+ pCMDInfo->NumDrives = nDrives;
+
+ //
+ // Get the process's environment into lpszzVDMEnv32 and count
+ // its size into cchVDMEnv32.
+ //
+
+ pEnvStrings = pch = lpszzVDMEnv32 = GetEnvironmentStrings();
+ cchVDMEnv32 = 0;
+ while (pch[0] || pch[1]) {
+ cchVDMEnv32++;
+ pch++;
+ }
+ cchVDMEnv32 += 2; // two terminating nulls not counted in loop.
+
+ //
+ // Transform environment to suit VDM. cmdCreateVDMEnvironment
+ // uses lpszzVDMEnv32 and cchVDMEnv32 as the source.
+ //
+
+ if (!cmdCreateVDMEnvironment(&cmdVDMEnvBlk)) {
+ RcErrorDialogBox(EG_ENVIRONMENT_ERR, NULL, NULL);
+ TerminateVDM();
+ }
+
+ //
+ // Copy the transformed environment to real mode mem and then free it.
+ //
+
+ pch = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->EnvSeg),0);
+ RtlMoveMemory(pch,
+ cmdVDMEnvBlk.lpszzEnv,
+ cmdVDMEnvBlk.cchEnv
+ );
+ STOREWORD(pCMDInfo->EnvSize,cmdVDMEnvBlk.cchEnv);
+ free(cmdVDMEnvBlk.lpszzEnv);
+ // GetEnvironmentStrings needs us to call its corresponding function
+ // to free the memory it allocated.
+ FreeEnvironmentStrings(pEnvStrings);
+
+ //
+ // Get the command line parameter, which consists of a fully
+ // qualified short path file name: "-a %SystemRoot%\system32\krnl386.exe".
+ //
+ // Note that the first token of cmdline is "%SystemRoot%\system32\ntvdm ",
+ // and may be a long file name surrounded by quotes.
+ //
+ pszCmdLine = GetCommandLine();
+ if (pszCmdLine) {
+
+ // skip leading spaces
+ while (*pszCmdLine && !isgraph(*pszCmdLine)) {
+ pszCmdLine++;
+ }
+
+ // skip first token
+ if (*pszCmdLine == '"') {
+ pszCmdLine++;
+ while (*pszCmdLine && *pszCmdLine++ != '"')
+ ;
+ }
+ else {
+ while (isgraph(*pszCmdLine)) {
+ pszCmdLine++;
+ }
+ }
+
+ // mov to beg of WowKernelPathName
+ pszCmdLine = strstr(pszCmdLine, " -a ");
+ pszCmdLine += 4;
+ while (*pszCmdLine && *pszCmdLine == ' ') {
+ pszCmdLine++;
+ }
+ }
+
+ if (!pszCmdLine || !*pszCmdLine) {
+ RcErrorDialogBox(EG_ENVIRONMENT_ERR, NULL, NULL);
+ TerminateVDM();
+ }
+
+
+ //
+ // Copy first token to ExecPath, and find the beg of the file part.
+ //
+ Len = FETCHWORD(pCMDInfo->ExecPathSize);
+ pch = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->ExecPathSeg),
+ FETCHWORD(pCMDInfo->ExecPathOff));
+
+ pSlash = pszCmdLine;
+ while (--Len && isgraph(*pszCmdLine)) {
+ if (*pszCmdLine == '\\') {
+ pSlash = pszCmdLine + 1;
+ }
+ *pch++ = *pszCmdLine++;
+ }
+ *pch = '\0';
+ pCMDInfo->ExecPathSize -= Len;
+ pCMDInfo->ExecExtType = EXE_EXTENTION; // for WOW, use EXE extention
+
+ pszCmdLine = pSlash; // filepart begins here
+
+
+ //
+ // Copy filepart of first token and rest to CmdLine buffer
+ //
+ Len = FETCHWORD(pCMDInfo->CmdLineSize);
+ pch = (PVOID)GetVDMAddr(FETCHWORD(pCMDInfo->CmdLineSeg),
+ FETCHWORD(pCMDInfo->CmdLineOff));
+
+ while (--Len && *pszCmdLine) {
+ *pch++ = *pszCmdLine++;
+ }
+ strcpy(pch, "\x0d\x0a");
+
+
+ *pIsDosBinary = 1;
+ IsRepeatCall = FALSE;
+ IsFirstCall = FALSE;
+
+ // Tell DOS that it has to invalidate the CDSs
+ *pSCS_ToSync = (CHAR)0xff;
+ setCF(0);
+
+ return;
+}
+
+
+/* cmdGetCurrentDir - Return the current directory for a drive.
+ *
+ *
+ * Entry - Client (DS:SI) - buffer to return the directory
+ * Client (AL) - drive being queried (0 = A)
+ *
+ * EXIT - SUCCESS Client (CY) clear
+ * FAILURE Client (CY) set
+ * (AX) = 0 (Directory was bigger than 64)
+ * (AX) = 1 (the drive is not valid)
+ *
+ */
+
+VOID cmdGetCurrentDir (VOID)
+{
+PCHAR lpszCurDir;
+UCHAR chDrive;
+CHAR EnvVar[] = "=?:";
+CHAR RootName[] = "?:\\";
+DWORD EnvVarLen;
+UINT DriveType;
+
+
+ lpszCurDir = (PCHAR) GetVDMAddr ((USHORT)getDS(),(USHORT)getSI());
+ chDrive = getAL();
+ EnvVar[1] = chDrive + 'A';
+ RootName[0] = chDrive + 'A';
+
+ // if the drive doesn't exist, blindly clear the environment var
+ // and return error
+ DriveType = demGetPhysicalDriveType(chDrive);
+ if (DriveType == DRIVE_UNKNOWN) {
+ DriveType = GetDriveTypeOem(RootName);
+ }
+
+ if (DriveType == DRIVE_UNKNOWN || DriveType == DRIVE_NO_ROOT_DIR){
+ SetEnvironmentVariableOem(EnvVar, NULL);
+ setCF(1);
+ setAX(0);
+ return;
+ }
+
+ if((EnvVarLen = GetEnvironmentVariableOem (EnvVar,lpszCurDir,
+ MAXIMUM_VDM_CURRENT_DIR+3)) == 0){
+
+ // if its not in env then and drive exist then we have'nt
+ // yet touched it.
+ strcpy(lpszCurDir, RootName);
+ SetEnvironmentVariableOem (EnvVar,RootName);
+ setCF(0);
+ return;
+ }
+ if (EnvVarLen > MAXIMUM_VDM_CURRENT_DIR+3) {
+ setCF(1);
+ setAX(0);
+ }
+ else {
+ setCF(0);
+ }
+ return;
+}
+
+/* cmdSetInfo - Set the address of SCS_ToSync variable in DOSDATA.
+ * This variable is set whenever SCS dispatches a new
+ * command to command.com. Setting of this variable
+ * indicates to dos to validate all the CDS structures
+ * for local drives.
+ *
+ *
+ * Entry - Client (DS:DX) - pointer to SCSINFO.
+ *
+ * EXIT - None
+ */
+
+VOID cmdSetInfo (VOID)
+{
+
+ pSCSInfo = (PSCSINFO) GetVDMAddr (getDS(),getDX());
+
+ pSCS_ToSync = (PCHAR) &pSCSInfo->SCS_ToSync;
+
+ pIsDosBinary = (BYTE *) GetVDMAddr(getDS(), getBX());
+
+ pFDAccess = (WORD *) GetVDMAddr(getDS(), getCX());
+ return;
+}
+
+
+VOID cmdSetDirectories (PCHAR lpszzEnv, VDMINFO * pVdmInfo)
+{
+LPSTR lpszVal;
+CHAR ch, chDrive, achEnvDrive[] = "=?:";
+
+ ch = pVdmInfo->CurDrive + 'A';
+ if (pVdmInfo->CurDirectoryLen != 0){
+ SetCurrentDirectory(pVdmInfo->CurDirectory);
+ achEnvDrive[1] = ch;
+ SetEnvironmentVariable(achEnvDrive, pVdmInfo->CurDirectory);
+ }
+ if (lpszzEnv) {
+ while(*lpszzEnv) {
+ if(*lpszzEnv == '=' &&
+ (chDrive = toupper(*(lpszzEnv+1))) >= 'A' &&
+ chDrive <= 'Z' &&
+ (*(PCHAR)((ULONG)lpszzEnv+2) == ':') &&
+ chDrive != ch) {
+ lpszVal = (PCHAR)((ULONG)lpszzEnv + 4);
+ achEnvDrive[1] = chDrive;
+ SetEnvironmentVariable (achEnvDrive,lpszVal);
+ }
+ lpszzEnv = strchr(lpszzEnv,'\0');
+ lpszzEnv++;
+ }
+ }
+}
+
+static BOOL fConOutput = FALSE;
+
+VOID cmdComSpec (VOID)
+{
+LPSTR lpszCS;
+
+
+ if(IsFirstCall == FALSE)
+ return;
+
+ lpszCS = (LPVOID) GetVDMAddr ((USHORT)getDS(),(USHORT)getDX());
+ strcpy(lpszComSpec,"COMSPEC=");
+ strcpy(lpszComSpec+8,lpszCS);
+ cbComSpec = strlen(lpszComSpec) +1;
+
+ setAL((BYTE)(!fConOutput || VDMForWOW));
+
+ return;
+}
+
+
+VOID cmdSaveWorld (VOID)
+{
+#ifdef CHECK_IT_LATER
+SAVEWORLD VDMState;
+HANDLE hFile;
+PCHAR pVDM;
+DWORD dwBytesWritten;
+
+ if(IsFirstVDMInSystem) {
+ IsFirstVDMInSystem = FALSE;
+ if ((hFile = CreateFile("c:\\nt\\bin86\\savevdm.wld",
+ GENERIC_WRITE,
+ 0,
+ NULL,
+ OPEN_ALWAYS,
+ 0,
+ NULL)) == (HANDLE)-1){
+ SaveWorldCreated = FALSE;
+ return;
+ }
+ VDMState.ax = getAX();
+ VDMState.bx = getBX();
+ VDMState.cx = getCX();
+ VDMState.dx = getDX();
+ VDMState.cs = getCS();
+ VDMState.ss = getSS();
+ VDMState.ds = getDS();
+ VDMState.es = getES();
+ VDMState.si = getSI();
+ VDMState.di = getDI();
+ VDMState.bp = getBP();
+ VDMState.sp = getSP();
+ VDMState.ip = getIP() + 1;
+ VDMState.flag = 0;
+ VDMState.ImageSize = 1024*1024;
+
+ pVDM = (PVOID)GetVDMAddr(0,0);
+
+ if (WriteFile (hFile,
+ (LPVOID)&VDMState,
+ (DWORD)sizeof(VDMState),
+ &dwBytesWritten,
+ NULL) == FALSE){
+ SaveWorldCreated = FALSE;
+ CloseHandle(hFile);
+ return;
+ }
+
+ if (WriteFile (hFile,
+ (LPVOID)pVDM,
+ (DWORD)VDMState.ImageSize,
+ &dwBytesWritten,
+ NULL) == FALSE){
+ SaveWorldCreated = FALSE;
+ CloseHandle(hFile);
+ return;
+ }
+ CloseHandle(hFile);
+ }
+#endif
+ return;
+}
+
+
+/* cmdInitConsole - Let Video VDD know that it can start console output
+ * operations.
+ *
+ *
+ * Entry - None
+ *
+ *
+ * EXIT - None
+ *
+ */
+
+VOID cmdInitConsole (VOID)
+{
+ if (fConOutput == FALSE) {
+ fConOutput = TRUE;
+ nt_init_event_thread ();
+ }
+ return;
+}
+
+
+/* cmdMapCodePage - Map the Win32 Code page to DOS code page
+ */
+
+USHORT cmdMapCodePage (ULONG CodePage)
+{
+ // Currently We understand US code page only
+ if (CodePage == 1252)
+ return 437;
+ else
+ return ((USHORT)CodePage);
+}
+
+
+
+/* GetWOWShortCutInfo - returns the startupinf.reserved field of
+ * vdminfo for the first wow task.
+ *
+ * Input - Bufsize - pointer to bufsize
+ * Buf - buffer where the info is returned
+ *
+ * Output
+ * Success - returns TRUE, BufSize has the length of buffer filled in
+ * Failure - returns FALSE, Bufsize has the required buffer size.
+ */
+
+BOOL GetWOWShortCutInfo (PULONG Bufsize, PVOID Buf)
+{
+ if (*Bufsize >= VDMInfo.ReservedLen) {
+ *Bufsize = VDMInfo.ReservedLen;
+ if (Bufsize)
+ strncpy (Buf, VDMInfo.Reserved, VDMInfo.ReservedLen);
+ return TRUE;
+ }
+ else {
+ *Bufsize = VDMInfo.ReservedLen;
+ return FALSE;
+ }
+}
+
+VOID cmdUpdateCurrentDirectories(BYTE CurDrive)
+{
+ DWORD cchRemain, cchCurDir;
+ CHAR *lpszCurDir;
+ BYTE Drive;
+ DWORD DriveType;
+ CHAR achName[] = "=?:";
+ CHAR RootName[] = "?:\\";
+
+
+ // allocate new space for the new current directories
+ lpszzCurrentDirectories = (CHAR*) malloc(MAX_PATH);
+ cchCurrentDirectories = 0;
+ cchRemain = MAX_PATH;
+ lpszCurDir = lpszzCurrentDirectories;
+ if (lpszCurDir != NULL) {
+ Drive = 0;
+ // current directory is the first entry
+ achName[1] = CurDrive + 'A';
+ cchCurrentDirectories = GetEnvironmentVariable(
+ achName,
+ lpszCurDir,
+ cchRemain
+ );
+
+ if (cchCurrentDirectories == 0 || cchCurrentDirectories > MAX_PATH) {
+ free(lpszzCurrentDirectories);
+ lpszzCurrentDirectories = NULL;
+ cchCurrentDirectories = 0;
+ return;
+ }
+
+ cchRemain -= ++cchCurrentDirectories;
+ // we got current directory already. Keep the drive number
+ lpszCurDir += cchCurrentDirectories;
+
+ while (Drive < 26) {
+
+ // ignore invalid drives and current drive
+ if (Drive != CurDrive) {
+ DriveType = demGetPhysicalDriveType(Drive);
+ if (DriveType == DRIVE_UNKNOWN) {
+ RootName[0] = (CHAR)('A' + Drive);
+ DriveType = GetDriveTypeOem(RootName);
+ }
+
+ if (DriveType != DRIVE_UNKNOWN &&
+ DriveType != DRIVE_NO_ROOT_DIR )
+ {
+ achName[1] = Drive + 'A';
+ cchCurDir = GetEnvironmentVariable(
+ achName,
+ lpszCurDir,
+ cchRemain
+ );
+ if(cchCurDir > cchRemain) {
+ lpszCurDir = (CHAR *)realloc(lpszzCurrentDirectories,
+ cchRemain + MAX_PATH + cchCurrentDirectories
+ );
+ if (lpszCurDir == NULL) {
+ free(lpszzCurrentDirectories);
+ lpszzCurrentDirectories = NULL;
+ cchCurrentDirectories = 0;
+ return;
+ }
+ lpszzCurrentDirectories = lpszCurDir;
+ lpszCurDir += cchCurrentDirectories;
+ cchRemain += MAX_PATH;
+ cchCurDir = GetEnvironmentVariable(
+ achName,
+ lpszCurDir,
+ cchRemain
+ );
+ }
+ if (cchCurDir != 0) {
+ // GetEnvironmentVariable doesn't count the NULL char
+ lpszCurDir += ++cchCurDir;
+ cchRemain -= cchCurDir;
+ cchCurrentDirectories += cchCurDir;
+ }
+ }
+ }
+ // next drive
+ Drive++;
+ }
+
+
+ lpszCurDir = lpszzCurrentDirectories;
+ // need space for the ending NULL and shrink the space if necessary
+ lpszzCurrentDirectories = (CHAR *) realloc(lpszCurDir, cchCurrentDirectories + 1);
+ if (lpszzCurrentDirectories != NULL && cchCurrentDirectories != 0){
+ lpszzCurrentDirectories[cchCurrentDirectories++] = '\0';
+ SetVDMCurrentDirectories(cchCurrentDirectories, lpszzCurrentDirectories);
+ free(lpszzCurrentDirectories);
+ lpszzCurrentDirectories = NULL;
+ cchCurrentDirectories = 0;
+ }
+ else {
+ free(lpszCurDir);
+ cchCurrentDirectories = 0;
+ }
+
+ }
+}
+
+/* This SVC function tells command.com, if the VDM was started without an
+ * existing console. If so, on finding a TSR, command.com will return
+ * back to GetNextVDMCommand, rather than putting its own popup.
+ *
+ * Entry - None
+ *
+ * Exit - Client (AL) = 0 if started with an existing console
+ * Client (AL) = 1 if started with new console
+ */
+
+VOID cmdGetStartInfo (VOID)
+{
+ setAL((BYTE) (DosSessionId ? 1 : 0));
+ return;
+}
diff --git a/private/mvdm/dos/command/cmdpif.c b/private/mvdm/dos/command/cmdpif.c
new file mode 100644
index 000000000..5fa2c2190
--- /dev/null
+++ b/private/mvdm/dos/command/cmdpif.c
@@ -0,0 +1,289 @@
+/* cmdpif.c - PIF Handling Routines For SCS
+ *
+ *
+ * Modification History:
+ *
+ * Sudeepb 19-Aug-1992 Created
+ * williamh 10-Nov-1992 (1). get params from w386 extention if exist
+ * (2). null terminate caption
+ * williamh 27-May-1993 almost rewrote for better pif support
+ */
+
+#include "cmd.h"
+#include <ctype.h>
+#include <pif.h>
+#include <cmdsvc.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <oemuni.h>
+#include "nt_pif.h"
+
+VOID cmdCheckForPIF (PVDMINFO pvi)
+{
+PCHAR pCmdLine = pvi->CmdLine;
+PCHAR pDot;
+ULONG size;
+UCHAR ch;
+DWORD dw;
+CHAR lpszEnvDir [] = "=?:";
+CHAR FullPathName[MAX_PATH + 1];
+CHAR * pFilePart;
+BOOL IsPIFFile, IsFromForceDos;
+CHAR AppFullPathName[MAX_PATH + 1];
+
+ //
+ // Advance CmdLine pointer to beg of command tail
+ //
+ while (*pCmdLine && !isgraph(*pCmdLine)) { // skip to first nonwhite
+ pCmdLine++;
+ }
+
+ pDot = strrchr(pvi->AppName, '.');
+ if (pDot)
+ IsPIFFile = pDot && !_strnicmp(pDot, ".pif", 4);
+ else
+ IsPIFFile = FALSE;
+
+
+ // if the command is not a pif file and it is not
+ // running on a new console
+ if (!IsPIFFile && !DosSessionId)
+ goto CleanUpAndReturn;
+
+ if (IsPIFFile) {
+ if (!IsFirstVDM) {
+ //
+ // Get the pif data. If no pif data, or not from forcedos
+ // just return -- command.com will receive the pif file
+ // name and fail.
+ //
+ pfdata.AppHasPIFFile =
+ pfdata.IgnoreStartDirInPIF =
+ pfdata.IgnoreTitleInPIF =
+ pfdata.IgnoreCmdLineInPIF =
+ pfdata.IgnoreConfigAutoexec = 1;
+ if (!GetPIFData(&pfdata, pvi->AppName))
+ goto CleanUpAndReturn;
+ }
+
+ // we only run a pif file on two occasions:
+ // (1). it is from a new console
+ // (2). it is from forcedos.
+ if (!DosSessionId && pfdata.SubSysId != SUBSYS_DOS)
+ goto CleanUpAndReturn;
+
+ }
+ if (IsFirstVDM) {
+ // if this is the first vdm, take cmdline, startupdir and title
+ // if they are there
+ if (pfdata.StartDir){
+ dw = cmdExpandEnvironmentStrings(NULL,
+ pfdata.StartDir,
+ FullPathName,
+ MAX_PATH + 1
+ );
+ if (dw != 0 && dw <= MAX_PATH) {
+ dw = GetFullPathNameOem(FullPathName,
+ MAX_PATH + 1,
+ pfdata.StartDir,
+ &pFilePart
+ );
+ }
+
+ if (dw != 0 && dw <= MAX_PATH)
+ dw = GetFileAttributesOem(pfdata.StartDir);
+ else
+ dw = 0;
+
+ if (dw == 0 || dw == 0xFFFFFFFF || !(dw & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ RcMessageBox(EG_PIF_STARTDIR_ERR,
+ NULL,
+ NULL,
+ RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+ }
+
+ dw = GetShortPathNameOem(pfdata.StartDir,
+ pfdata.StartDir,
+ MAX_PATH + 1
+ );
+ if (dw == 0 || dw > MAX_PATH || dw > 64) {
+ RcMessageBox(EG_PIF_STARTDIR_ERR,
+ NULL,
+ NULL,
+ RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+ }
+
+ lpszEnvDir[1] = pfdata.StartDir[0];
+ SetEnvironmentVariableOem(lpszEnvDir, pfdata.StartDir);
+ SetCurrentDirectoryOem(pfdata.StartDir);
+ pvi->CurDrive = toupper(pfdata.StartDir[0]) - 'A';
+ }
+
+ if (pfdata.WinTitle) {
+ strcpy(FullPathName, pfdata.WinTitle);
+ dw = cmdExpandEnvironmentStrings(NULL,
+ FullPathName,
+ pfdata.WinTitle,
+ MAX_PATH + 1
+ );
+ pfdata.WinTitle[MAX_PATH] = '\0';
+ }
+
+ if (!*pCmdLine && pfdata.CmdLine) {
+
+ // if the optinal parameter is '?'
+ // prompt the user
+ pDot = pfdata.CmdLine;
+ while (*pDot && *pDot <= ' ')
+ pDot++;
+
+ if (*pDot == '?') {
+ pfdata.CmdLine[0] = '\0';
+ RcMessageBox(EG_PIF_ASK_CMDLINE,
+ NULL,
+ pfdata.CmdLine,
+ RMB_EDIT | RMB_ICON_INFO | (128 << 16)
+ );
+ }
+
+ if (*pfdata.CmdLine) {
+ strcpy(FullPathName, pfdata.CmdLine);
+ dw = cmdExpandEnvironmentStrings(NULL,
+ FullPathName,
+ pfdata.CmdLine,
+ MAX_PATH + 1
+ );
+ }
+ }
+ }
+
+
+ if(IsPIFFile) {
+ dw = cmdExpandEnvironmentStrings(NULL,
+ pfdata.StartFile,
+ FullPathName,
+ MAX_PATH + 1
+ );
+ if (!dw || dw > MAX_PATH) {
+ RcMessageBox(EG_PIF_STARTFILE_ERR,
+ NULL, NULL, RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+ }
+
+
+
+ // search from the current directory
+ // note that the startup directory specified in
+ // the pif file has been set as our current directory
+ // when we got here
+ dw = SearchPathOem(".",
+ FullPathName,
+ NULL,
+ MAX_PATH + 1,
+ AppFullPathName,
+ &pFilePart
+ );
+ // if couldn't find the file from the current dir
+ // ask win32api help
+ if (dw == 0 || dw > MAX_PATH) {
+ dw = SearchPathOem(NULL,
+ FullPathName,
+ NULL,
+ MAX_PATH + 1,
+ AppFullPathName,
+ &pFilePart
+ );
+ }
+
+ // couldn't find the file, give up
+ if (dw == 0 || dw > MAX_PATH) {
+ RcMessageBox(EG_PIF_STARTFILE_ERR,
+ NULL, NULL, RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+ }
+
+ dw = GetFileAttributesOem(AppFullPathName);
+ if (dw == (DWORD)(-1) || (dw & FILE_ATTRIBUTE_DIRECTORY)) {
+ RcMessageBox(EG_PIF_STARTFILE_ERR, NULL, NULL,
+ RMB_ICON_BANG | RMB_ABORT
+ );
+ goto CleanUpAndReturn;
+ }
+
+ // convert to shortfilename
+ dw = GetShortPathNameOem(AppFullPathName, pvi->AppName,
+ MAX_PATH + 1);
+ if (dw == 0 || dw > MAX_PATH) {
+
+ RcMessageBox(EG_PIF_STARTFILE_ERR, NULL, NULL,
+ RMB_ICON_BANG | RMB_ABORT
+ );
+ goto CleanUpAndReturn;
+ }
+ // update the application path name length(including the terminate NULL)
+ pvi->AppLen = strlen(pvi->AppName) + 1;
+
+ // pvi->AppName contains the application short name.
+ // verify that it has the correct extension(.EXE, .COM or .BAT).
+ pDot = (PCHAR)pvi->AppName + pvi->AppLen - 5;
+ if (pvi->AppLen < 5 ||
+ (_strnicmp(pDot, EXE_EXTENTION_STRING, EXTENTION_STRING_LEN) &&
+ _strnicmp(pDot, COM_EXTENTION_STRING, EXTENTION_STRING_LEN) &&
+ _strnicmp(pDot, BAT_EXTENTION_STRING, EXTENTION_STRING_LEN)))
+ {
+
+ RcMessageBox(EG_DOS_PROG_EXTENSION,AppFullPathName, NULL, RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+
+ }
+ }
+
+
+ //
+ // Copy in pif command tail if original command tail is empty
+ //
+ if (!*pCmdLine && pfdata.CmdLine) {
+ strcpy(FullPathName, pfdata.CmdLine);
+ strcat(FullPathName, "\x0d\x0a");
+ if (strlen(FullPathName) >= 128 - 13) {
+ // too bad, the command line is too long
+ RcMessageBox(EG_PIF_CMDLINE_ERR,NULL,NULL,RMB_ICON_BANG | RMB_ABORT);
+ goto CleanUpAndReturn;
+
+ }
+ strcpy(pvi->CmdLine, FullPathName);
+ pvi->CmdSize = strlen(FullPathName) + 1;
+ }
+
+ if (IsPIFFile)
+ // we don't know the binary type at this point.
+ *pIsDosBinary = 0;
+
+ if (pfdata.WinTitle)
+ SetConsoleTitle(pfdata.WinTitle);
+
+ DontCheckDosBinaryType = (pfdata.SubSysId == SUBSYS_DOS);
+
+CleanUpAndReturn:
+ if (pfdata.CmdLine) {
+ free(pfdata.CmdLine);
+ pfdata.CmdLine = NULL;
+ }
+ if (pfdata.StartDir) {
+ free(pfdata.StartDir);
+ pfdata.StartDir = NULL;
+ }
+ if (pfdata.StartFile) {
+ free(pfdata.StartFile);
+ pfdata.StartFile = NULL;
+ }
+ if (pfdata.WinTitle) {
+ free(pfdata.WinTitle);
+ pfdata.WinTitle = NULL;
+ }
+ return;
+
+}
diff --git a/private/mvdm/dos/command/cmdpif.h b/private/mvdm/dos/command/cmdpif.h
new file mode 100644
index 000000000..bb264236f
--- /dev/null
+++ b/private/mvdm/dos/command/cmdpif.h
@@ -0,0 +1,46 @@
+
+/*================================================================
+Structure used to hold the data that CONFIG will need from the PIF
+file. This is gleaned from both the main data block and from the
+file extensions for Windows 286 and 386.
+================================================================*/
+
+
+/* WARNING !!!!!!
+ This structure is copied from NT_PIF.H in insiginia
+ hsot\inc\nt_pif.h. Make sure you keep them synchronized
+ when you make changes.
+*/
+#pragma pack()
+typedef struct
+ {
+ char *WinTitle; /* caption text(Max. 30 chars) + NULL */
+ char *CmdLine; /* command line (max 63 hars) + NULL */
+ char *StartDir; /* program file name (max 63 chars + NULL */
+ char *StartFile;
+ WORD fullorwin;
+ WORD graphicsortext;
+ WORD memreq;
+ WORD memdes;
+ WORD emsreq;
+ WORD emsdes;
+ WORD xmsreq;
+ WORD xmsdes;
+ char menuclose;
+ char reskey;
+ WORD ShortMod;
+ WORD ShortScan;
+ char idledetect;
+ char fgprio;
+ char CloseOnExit;
+ char AppHasPIFFile;
+ char IgnoreTitleInPIF;
+ char IgnoreStartDirInPIF;
+ char IgnoreShortKeyInPIF;
+ char IgnoreCmdLineInPIF;
+ char IgnoreConfigAutoexec;
+ char SubSysId;
+ } PIF_DATA;
+
+extern PIF_DATA pfdata;
+BOOL GetPIFData(PIF_DATA *, char *);
diff --git a/private/mvdm/dos/command/cmdredir.c b/private/mvdm/dos/command/cmdredir.c
new file mode 100644
index 000000000..5cf700c63
--- /dev/null
+++ b/private/mvdm/dos/command/cmdredir.c
@@ -0,0 +1,664 @@
+/* cmdredir.c - SCS routines for redirection
+ *
+ *
+ * Modification History:
+ *
+ * Sudeepb 22-Apr-1992 Created
+ */
+
+#include "cmd.h"
+
+#include <cmdsvc.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <ctype.h>
+
+#define CMDREDIR_DEBUG 1
+
+PPIPE_INPUT cmdPipeList = NULL;
+
+BOOL cmdCheckCopyForRedirection (pRdrInfo)
+PREDIRCOMPLETE_INFO pRdrInfo;
+{
+PPIPE_INPUT pPipe, pPipePrev;
+PPIPE_OUTPUT pPipeOut;
+
+ if (pRdrInfo == NULL)
+ return TRUE;
+ if (pRdrInfo->ri_pPipeStdIn != NULL) {
+
+ //Piping and Pipe list is empty?
+ ASSERT(cmdPipeList != NULL);
+
+ // in most cases, we have only one pipe for stdin
+ if (pRdrInfo->ri_pPipeStdIn == cmdPipeList){
+ pPipe = pRdrInfo->ri_pPipeStdIn;
+ cmdPipeList = pPipe->Next;
+ }
+ // multiple piping
+ // search for the right one
+ else {
+ pPipe = pPipePrev = cmdPipeList;
+ while (pPipe != NULL && pPipe != pRdrInfo->ri_pPipeStdIn){
+ pPipePrev = pPipe;
+ pPipe = pPipe->Next;
+ }
+ if (pPipe != NULL)
+ // remove it from the list
+ pPipePrev->Next = pPipe->Next;
+ }
+ if (pPipe != NULL) {
+ // grab the critical section. As soon as we have a
+ // a hold on the critical section, it is safe to kill
+ // the piping thread because it is in dormant unless
+ // it has terminated which is also safe for us.
+ EnterCriticalSection(&pPipe->CriticalSection);
+ // if the thread is till running, kill it
+ if (WaitForSingleObject(pPipe->hThread, 0)) {
+ TerminateThread(pPipe->hThread, 0);
+ WaitForSingleObject(pPipe->hThread, INFINITE);
+ }
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ CloseHandle(pPipe->hFileWrite);
+ CloseHandle(pPipe->hPipe);
+ CloseHandle(pPipe->hDataEvent);
+ CloseHandle(pPipe->hThread);
+ DeleteCriticalSection(&pPipe->CriticalSection);
+ DeleteFile(pPipe->pFileName);
+ free(pPipe->pFileName);
+ free (pPipe);
+ }
+ }
+ // the application is terminating, let the output thread knows
+ // about it so it can exit appropriately.
+ // the output thread is responsible for clean up
+ if (pRdrInfo->ri_pPipeStdOut) {
+ // The output thread must wait for the event before
+ // it can exit.
+ SetEvent((pRdrInfo->ri_pPipeStdOut)->hExitEvent);
+ // wait 1 seconds for the thread to go away.
+ // this is done because our parent process may put up
+ // its prompt before our sibling process has a chance to
+ // completely display data on its display surface.
+ // note that we can not wait forever here because
+ // the sibling process could be the other dos application and
+ // we will be deadlock if it is the case
+ WaitForSingleObject(pRdrInfo->ri_hStdOutThread, 1000);
+ CloseHandle(pRdrInfo->ri_hStdOutThread);
+ }
+ if (pRdrInfo->ri_pPipeStdErr) {
+ SetEvent((pRdrInfo->ri_pPipeStdErr)->hExitEvent);
+ WaitForSingleObject(pRdrInfo->ri_hStdErrThread, 1000);
+ CloseHandle(pRdrInfo->ri_hStdErrThread);
+ }
+ free (pRdrInfo);
+
+ return TRUE;
+}
+
+BOOL cmdCreateTempFile (phTempFile,ppszTempFile)
+PHANDLE phTempFile;
+PCHAR *ppszTempFile;
+{
+
+PCHAR pszTempPath = NULL;
+DWORD TempPathSize;
+PCHAR pszTempFileName;
+HANDLE hTempFile;
+SECURITY_ATTRIBUTES sa;
+
+ pszTempPath = malloc(MAX_PATH + 12);
+
+ if (pszTempPath == NULL)
+ return FALSE;
+
+ if ((TempPathSize = GetTempPath (
+ MAX_PATH,
+ pszTempPath)) == 0){
+ free (pszTempPath);
+ return FALSE;
+ }
+
+ if (TempPathSize >= MAX_PATH) {
+ free (pszTempPath);
+ return FALSE;
+ }
+
+ // CMDCONF.C depends on the size of this buffer
+ if ((pszTempFileName = malloc (MAX_PATH + 13)) == NULL){
+ free (pszTempPath);
+ return FALSE;
+ }
+
+ // if this fails it probably means we have a bad path
+ if (!GetTempFileName(pszTempPath, "scs", 0, pszTempFileName))
+ {
+ // lets get something else, which should succeed
+ TempPathSize = GetWindowsDirectory(pszTempPath, MAX_PATH);
+ if (!TempPathSize || TempPathSize >= MAX_PATH)
+ strcpy(pszTempPath, "\\");
+
+ // try again and hope for the best
+ GetTempFileName(pszTempPath, "scs", 0, pszTempFileName);
+ }
+
+
+ // must have a security descriptor so that the child process
+ // can inherit this file handle. This is done because when we
+ // shell out with piping the 32 bits application must have inherited
+ // the temp filewe created, see cmdGetStdHandle
+ sa.nLength = sizeof(SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ if ((hTempFile = CreateFile (pszTempFileName,
+ GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ &sa,
+ OPEN_ALWAYS,
+ FILE_ATTRIBUTE_TEMPORARY,
+ NULL)) == (HANDLE)-1){
+ free (pszTempFileName);
+ free (pszTempPath);
+ return FALSE;
+ }
+
+ *phTempFile = hTempFile;
+ *ppszTempFile = pszTempFileName;
+ free (pszTempPath);
+ return TRUE;
+}
+
+/* cmdCheckStandardHandles - Check if we have to do anything to support
+ * standard io redirection, if so save away
+ * pertaining information.
+ *
+ * Entry - pVDMInfo - VDMInfo Structure
+ * pbStdHandle - pointer to bit array for std handles
+ *
+ * EXIT - return NULL if no redirection involved
+ * return pointer to REDIRECTION_INFO
+ */
+
+PREDIRCOMPLETE_INFO cmdCheckStandardHandles (
+ PVDMINFO pVDMInfo,
+ USHORT UNALIGNED *pbStdHandle
+ )
+{
+USHORT bTemp = 0;
+PREDIRCOMPLETE_INFO pRdrInfo;
+
+ if (pVDMInfo->StdIn)
+ bTemp |= MASK_STDIN;
+
+ if (pVDMInfo->StdOut)
+ bTemp |= MASK_STDOUT;
+
+ if (pVDMInfo->StdErr)
+ bTemp |= MASK_STDERR;
+
+ if(bTemp){
+
+ if ((pRdrInfo = malloc (sizeof (REDIRCOMPLETE_INFO))) == NULL) {
+ RcErrorDialogBox(EG_MALLOC_FAILURE, NULL, NULL);
+ TerminateVDM();
+ }
+
+ RtlZeroMemory ((PVOID)pRdrInfo, sizeof(REDIRCOMPLETE_INFO));
+ pRdrInfo->ri_hStdErr = pVDMInfo->StdErr;
+ pRdrInfo->ri_hStdOut = pVDMInfo->StdOut;
+ pRdrInfo->ri_hStdIn = pVDMInfo->StdIn;
+
+ nt_std_handle_notification(TRUE);
+ fSoftpcRedirection = TRUE;
+ }
+ else{
+ pRdrInfo = NULL;
+ nt_std_handle_notification(FALSE);
+ fSoftpcRedirection = FALSE;
+ }
+
+ *pbStdHandle = bTemp;
+ return pRdrInfo;
+}
+
+/* cmdGetStdHandle - Get the 32 bit NT standard handle for the VDM
+ *
+ *
+ * Entry - Client (CX) - 0,1 or 2 (stdin stdout stderr)
+ * Client (AX:BX) - redirinfo pointer
+ *
+ * EXIT - Client (BX:CX) - 32 bit handle
+ * Client (DX:AX) - file size
+ */
+
+VOID cmdGetStdHandle (VOID)
+{
+USHORT iStdHandle;
+PREDIRCOMPLETE_INFO pRdrInfo;
+
+ iStdHandle = getCX();
+ pRdrInfo = (PREDIRCOMPLETE_INFO) (((ULONG)getAX() << 16) + (ULONG)getBX());
+
+ switch (iStdHandle) {
+
+ case HANDLE_STDIN:
+
+ if (GetFileType(pRdrInfo->ri_hStdIn) == FILE_TYPE_PIPE) {
+ if (!cmdHandleStdinWithPipe (pRdrInfo)) {
+ RcErrorDialogBox(EG_MALLOC_FAILURE, NULL, NULL);
+ TerminateVDM();
+ setCF(1);
+ return;
+ }
+ setCX ((USHORT)pRdrInfo->ri_hStdInFile);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdInFile >> 16));
+ }
+ else {
+ setCX ((USHORT)pRdrInfo->ri_hStdIn);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdIn >> 16));
+ }
+ break;
+
+ case HANDLE_STDOUT:
+ if (GetFileType (pRdrInfo->ri_hStdOut) == FILE_TYPE_PIPE){
+ if (!cmdHandleStdOutErrWithPipe(pRdrInfo, HANDLE_STDOUT)) {
+ RcErrorDialogBox(EG_MALLOC_FAILURE, NULL, NULL);
+ TerminateVDM();
+ setCF(1);
+ return;
+ }
+ setCX ((USHORT)pRdrInfo->ri_hStdOutFile);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdOutFile >> 16));
+
+ }
+ else {
+ // sudeepb 16-Mar-1992; This will be a compatibilty problem.
+ // If the user gives the command "dosls > lpt1" we will
+ // inherit the 32 bit handle of lpt1, so the ouput will
+ // directly go to the LPT1 and a DOS TSR/APP hooking int17
+ // wont see this printing. Is this a big deal???
+ setCX ((USHORT)pRdrInfo->ri_hStdOut);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdOut >> 16));
+ }
+ break;
+
+ case HANDLE_STDERR:
+
+ if (pRdrInfo->ri_hStdErr == pRdrInfo->ri_hStdOut
+ && pRdrInfo->ri_hStdOutFile != 0) {
+ setCX ((USHORT)pRdrInfo->ri_hStdOutFile);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdOutFile >> 16));
+ pRdrInfo->ri_hStdErrFile = pRdrInfo->ri_hStdOutFile;
+ break;
+ }
+
+ if (GetFileType (pRdrInfo->ri_hStdErr) == FILE_TYPE_PIPE){
+ if(!cmdHandleStdOutErrWithPipe(pRdrInfo, HANDLE_STDERR)) {
+ RcErrorDialogBox(EG_MALLOC_FAILURE, NULL, NULL);
+ TerminateVDM();
+ setCF(1);
+ return;
+ }
+ setCX ((USHORT)pRdrInfo->ri_hStdErrFile);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdErrFile >> 16));
+ }
+ else {
+ setCX ((USHORT)pRdrInfo->ri_hStdErr);
+ setBX ((USHORT)((ULONG)pRdrInfo->ri_hStdErr >> 16));
+ }
+ break;
+ }
+ setAX(0);
+ setDX(0);
+ setCF(0);
+ return;
+}
+
+BOOL cmdHandleStdOutErrWithPipe(
+ PREDIRCOMPLETE_INFO pRdrInfo,
+ USHORT HandleType
+ )
+{
+
+ HANDLE hFile;
+ PCHAR pFileName;
+ PPIPE_OUTPUT pPipe;
+ BYTE *Buffer;
+ DWORD ThreadId;
+ HANDLE hEvent;
+ HANDLE hFileWrite;
+ HANDLE hThread;
+
+ if(!cmdCreateTempFile(&hFile,&pFileName))
+ return FALSE;
+ // must have a different handle so that writter(dos app) and reader(us)
+ // wont use the same handle object(especially, file position)
+ hFileWrite = CreateFile(pFileName,
+ GENERIC_WRITE | GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_TEMPORARY,
+ NULL
+ );
+ if (hFileWrite == INVALID_HANDLE_VALUE) {
+ CloseHandle(hFile);
+ DeleteFile(pFileName);
+ return FALSE;
+ }
+ Buffer = malloc(sizeof(PIPE_OUTPUT) + PIPE_OUTPUT_BUFFER_SIZE);
+ if (Buffer == NULL) {
+ CloseHandle(hFile);
+ CloseHandle(hFileWrite);
+ DeleteFile(pFileName);
+ return FALSE;
+ }
+ pPipe = (PPIPE_OUTPUT)Buffer;
+ pPipe->Buffer = Buffer + sizeof(PIPE_OUTPUT);
+ pPipe->BufferSize = PIPE_OUTPUT_BUFFER_SIZE;
+ pPipe->hFile = hFileWrite;
+ pPipe->pFileName = pFileName;
+ pPipe->hExitEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (pPipe->hExitEvent == NULL) {
+ CloseHandle(hFile);
+ CloseHandle(hFileWrite);
+ DeleteFile(pFileName);
+ free(pPipe);
+ return FALSE;
+ }
+
+ if (HandleType == HANDLE_STDOUT) {
+ pPipe->hPipe = pRdrInfo->ri_hStdOut;
+ pRdrInfo->ri_pPipeStdOut = pPipe;
+ pRdrInfo->ri_hStdOutFile = hFile;
+
+ }
+ else {
+ pPipe->hPipe = pRdrInfo->ri_hStdErr;
+ pRdrInfo->ri_pPipeStdErr = pPipe;
+ pRdrInfo->ri_hStdErrFile = hFile;
+
+ }
+ hThread = CreateThread ((LPSECURITY_ATTRIBUTES)NULL,
+ (DWORD)0,
+ (LPTHREAD_START_ROUTINE)cmdPipeOutThread,
+ (LPVOID)pPipe,
+ 0,
+ &ThreadId
+ );
+ if (hThread == NULL) {
+ CloseHandle(pPipe->hExitEvent);
+ CloseHandle(hFileWrite);
+ CloseHandle(hFile);
+ DeleteFile(pFileName);
+ free(Buffer);
+ return FALSE;
+ }
+ if (HandleType == HANDLE_STDOUT)
+ pRdrInfo->ri_hStdOutThread = hThread;
+ else
+ pRdrInfo->ri_hStdErrThread = hThread;
+ return TRUE;
+}
+
+/* independent thread to read application stdout(file) to NTVDM stdout(PIPE).
+ The CPU thread would notify us through hExitEvent when the application
+ is terminating(thus, we can detect EOF and exit
+ */
+
+VOID cmdPipeOutThread(LPVOID lpParam)
+{
+ PPIPE_OUTPUT pPipe;
+ DWORD BytesRead;
+ DWORD BytesWritten;
+ BOOL ExitPending;
+
+ pPipe = (PPIPE_OUTPUT)lpParam;
+
+ ExitPending = FALSE;
+
+ while(ReadFile(pPipe->hFile, pPipe->Buffer, pPipe->BufferSize, &BytesRead, NULL) ) {
+ // go nothing doesn't mean it hits EOF!!!!!!
+ // we can not just exit now, instead, we have to wait and poll
+ // until the application is terminated.
+ //
+ if (BytesRead == 0) {
+ // if read nothing and the application is gone, we can quit now
+ if (ExitPending)
+ break;
+ if (!WaitForSingleObject(pPipe->hExitEvent, PIPE_OUTPUT_TIMEOUT))
+ ExitPending = TRUE;
+ }
+ else {
+ if (!WriteFile(pPipe->hPipe, pPipe->Buffer, BytesRead, &BytesWritten, NULL) ||
+ BytesWritten != BytesRead)
+ break;
+ }
+ }
+ // if we were out of loop because of errors, wait for the cpu thread.
+ if (!ExitPending)
+ WaitForSingleObject(pPipe->hExitEvent, INFINITE);
+
+ CloseHandle(pPipe->hFile);
+ CloseHandle(pPipe->hPipe);
+ CloseHandle(pPipe->hExitEvent);
+ DeleteFile(pPipe->pFileName);
+ free(pPipe->pFileName);
+ free(pPipe);
+ ExitThread(0);
+}
+
+BOOL cmdHandleStdinWithPipe (
+ PREDIRCOMPLETE_INFO pRdrInfo
+ )
+{
+
+ HANDLE hStdinFile;
+ PCHAR pStdinFileName;
+ PPIPE_INPUT pPipe;
+ BYTE *Buffer;
+ DWORD ThreadId;
+ HANDLE hEvent;
+ HANDLE hFileWrite;
+
+ if(!cmdCreateTempFile(&hStdinFile,&pStdinFileName))
+ return FALSE;
+
+
+ // must have a different handle so that reader(dos app) and writter(us)
+ // wont use the same handle object(especially, file position)
+ hFileWrite = CreateFile(pStdinFileName,
+ GENERIC_WRITE | GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_TEMPORARY,
+ NULL
+ );
+ if (hFileWrite == INVALID_HANDLE_VALUE) {
+ CloseHandle(hStdinFile);
+ DeleteFile(pStdinFileName);
+ return FALSE;
+ }
+ Buffer = malloc(sizeof(PIPE_INPUT) + PIPE_INPUT_BUFFER_SIZE);
+ if (Buffer == NULL) {
+ CloseHandle(hStdinFile);
+ CloseHandle(hFileWrite);
+ DeleteFile(pStdinFileName);
+ return FALSE;
+ }
+ hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ if (hEvent == NULL) {
+ CloseHandle(hStdinFile);
+ CloseHandle(hFileWrite);
+ DeleteFile(pStdinFileName);
+ free(Buffer);
+ return FALSE;
+ }
+ pPipe = (PPIPE_INPUT)Buffer;
+ pPipe->Buffer = Buffer + sizeof(PIPE_INPUT);
+ pPipe->BufferSize = PIPE_INPUT_BUFFER_SIZE;
+ pPipe->fEOF = FALSE;
+ pPipe->hFileWrite = hFileWrite;
+ pPipe->hFileRead = hStdinFile;
+ pPipe->hDataEvent = hEvent;
+ pPipe->hPipe = pRdrInfo->ri_hStdIn;
+ pPipe->pFileName = pStdinFileName;
+ InitializeCriticalSection(&pPipe->CriticalSection);
+ pPipe->hThread = CreateThread ((LPSECURITY_ATTRIBUTES)NULL,
+ (DWORD)0,
+ (LPTHREAD_START_ROUTINE)cmdPipeInThread,
+ (LPVOID)pPipe,
+ 0,
+ &ThreadId
+ );
+ if (pPipe->hThread == NULL) {
+ CloseHandle(hFileWrite);
+ CloseHandle(pPipe->hDataEvent);
+ CloseHandle(hStdinFile);
+ DeleteFile(pStdinFileName);
+ free(Buffer);
+ return FALSE;
+ }
+ // always have the new node in the head of the list because
+ // it is the node used by the top command.com running in the process.
+ // We may have multiple command.com instances running in the same
+ // ntvdm proecess and each command.com has a private PREDIRCOMPLETE_INFO
+ // associated with it if its stdin is redirected to a pipe.
+ pPipe->Next = cmdPipeList;
+ cmdPipeList = pPipe;
+ pRdrInfo->ri_hStdInFile = hStdinFile;
+ pRdrInfo->ri_pPipeStdIn = pPipe;
+ return TRUE;
+}
+
+/* Independent thread to read from pipe(NTVDM STDIN) and write to
+ file(DOS application STDIN) until either the pipe is broken or
+ there are some errors.
+ This thread may never terminate itself because it can block
+ in the ReadFile call to the pipe forever. If this is the case,
+ we have to rely on the CPU thread to kill it. To allow the CPU
+ thread safely launching the killing, this thread yields the
+ critical section when it is safe to be killed and the CPU thread
+ would claim the critical section first before going for kill.
+ */
+
+VOID cmdPipeInThread(LPVOID lpParam)
+{
+ PPIPE_INPUT pPipe;
+ DWORD BytesRead, BytesWritten;
+ BOOL ReadStatus, WriteStatus;
+ BOOL ApplicationTerminated, fEOF;
+
+ pPipe = (PPIPE_INPUT)lpParam;
+ while (TRUE) {
+
+ // this read can take forever without getting back anything
+ ReadStatus = ReadFile(pPipe->hPipe, pPipe->Buffer,
+ pPipe->BufferSize, &BytesRead, NULL);
+
+ // claim the critical section so we won't get killed
+ // by the CPU thread
+ EnterCriticalSection(&pPipe->CriticalSection);
+ if (ReadStatus) {
+ if (BytesRead != 0) {
+ WriteStatus = WriteFile(pPipe->hFileWrite,
+ pPipe->Buffer,
+ BytesRead,
+ &BytesWritten,
+ NULL
+ );
+ if (pPipe->WaitData && WriteStatus && BytesWritten != 0)
+ SetEvent(pPipe->hDataEvent);
+ }
+ }
+ else {
+ if (GetLastError() == ERROR_BROKEN_PIPE) {
+
+ // pipe is broken and more data to read?
+ ASSERT(BytesRead == 0);
+ pPipe->fEOF = TRUE;
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ break;
+ }
+ }
+ // as soon as we leave the critical seciton, the CPU thread may
+ // step in and kill us
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ }
+ ExitThread(0);
+}
+
+/* cmdPipeFileDataEOF - Check for new data or EOF
+ *
+ *
+ * Entry - hFile, DOS application STDIN file handle(file)
+ * &fEOF, to return if the pipe is broken
+ * EXIT - TRUE if either there are new data or EOF is true
+ * *fEOF == TRUE if EOF
+ */
+
+BOOL cmdPipeFileDataEOF(HANDLE hFile, BOOL *fEOF)
+{
+ PPIPE_INPUT pPipe;
+ BOOL NewData;
+ DWORD WaitStatus;
+
+ pPipe = cmdPipeList;
+ while (pPipe != NULL && pPipe->hFileRead != hFile)
+ pPipe = pPipe->Next;
+
+ NewData = TRUE;
+ *fEOF = TRUE;
+
+ if (pPipe != NULL) {
+ EnterCriticalSection(&pPipe->CriticalSection);
+ *fEOF = pPipe->fEOF;
+ if (!(*fEOF)) {
+ pPipe->WaitData = TRUE;
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ WaitStatus = WaitForSingleObject(pPipe->hDataEvent, PIPE_INPUT_TIMEOUT);
+ EnterCriticalSection(&pPipe->CriticalSection);
+ *fEOF = pPipe->fEOF;
+ pPipe->WaitData = FALSE;
+ NewData = WaitStatus == 0 ? TRUE : FALSE;
+ }
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ }
+ return(NewData || *fEOF);
+}
+
+/* cmdPipeFileEOF - Check if the pipe is broken
+ *
+ *
+ * Entry - hFile, DOS application STDIN file handle(file)
+ *
+ * EXIT - TRUE if the write end of the pipe is closed
+ */
+
+
+BOOL cmdPipeFileEOF(HANDLE hFile)
+{
+ PPIPE_INPUT pPipe;
+ BOOL fEOF;
+
+ pPipe = cmdPipeList;
+ while (pPipe != NULL && pPipe->hFileRead != hFile)
+ pPipe = pPipe->Next;
+
+ fEOF = TRUE;
+
+ if (pPipe != NULL) {
+ EnterCriticalSection(&pPipe->CriticalSection);
+ fEOF = pPipe->fEOF;
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ }
+ if (!fEOF) {
+ Sleep(PIPE_INPUT_TIMEOUT);
+ EnterCriticalSection(&pPipe->CriticalSection);
+ fEOF = pPipe->fEOF;
+ LeaveCriticalSection(&pPipe->CriticalSection);
+ }
+ return (fEOF);
+}
diff --git a/private/mvdm/dos/command/makefile b/private/mvdm/dos/command/makefile
new file mode 100644
index 000000000..985386d82
--- /dev/null
+++ b/private/mvdm/dos/command/makefile
@@ -0,0 +1,9 @@
+# Command makefile
+# 17-Sep-1991 Sudeep Bharati Created
+#
+
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/private/mvdm/dos/command/sources b/private/mvdm/dos/command/sources
new file mode 100644
index 000000000..5d0049299
--- /dev/null
+++ b/private/mvdm/dos/command/sources
@@ -0,0 +1,60 @@
+!IF 0
+
+Copyright (c) 1989-1991 Microsoft Corporation
+
+Module Name:
+
+ sources.
+
+Abstract:
+
+ This file specifies the target component being built and the list of
+ sources files needed to build that component. Also specifies optional
+ compiler switches and libraries that are unique for the component being
+ built.
+
+
+History:
+ Created 17-Sep-1991 by Sudeep Bharati (sudeepb)
+ from template created 12-Apr-1990 by Steve Wood (stevewo)
+
+
+NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl
+
+!ENDIF
+
+MAJORCOMP=mvdm
+MINORCOMP=command
+
+TARGETNAME=command
+TARGETPATH=\nt\public\sdk\lib
+TARGETTYPE=LIBRARY
+TARGETLIBS=
+
+SOFTPC_TREE=$(BASEDIR)\private\mvdm\softpc.new
+
+INCLUDES=..\..\inc;..\..\..\windows\inc;$(SOFTPC_TREE)\base\inc;$(SOFTPC_TREE)\host\inc
+
+
+NTPROFILEINPUT=YES
+
+SOURCES=cmd.c \
+ cmddata.c \
+ cmddisp.c \
+ cmdexec.c \
+ cmdexit.c \
+ cmdmisc.c \
+ cmdpif.c \
+ cmdredir.c \
+ cmdconf.c \
+ cmdkeyb.c \
+ cmdenv.c
+
+I386_SOURCES=
+MIPS_SOURCES=
+
+C_DEFINES=-DWIN_32 -DNTVDM
+
+UMTYPE=console
+UMTEST=
+UMLIBS=
diff --git a/private/mvdm/dos/dem/dem.c b/private/mvdm/dos/dem/dem.c
new file mode 100644
index 000000000..b8b46868e
--- /dev/null
+++ b/private/mvdm/dos/dem/dem.c
@@ -0,0 +1,76 @@
+/*
+ * dem.c - Main Module of DOS Emulation DLL.
+ *
+ * Sudeepb 09-Apr-1991 Craeted
+ */
+
+#include "io.h"
+#include "dem.h"
+
+/* DemInit - DEM Initialiazation routine. (This name may change when DEM is
+ * converted to DLL).
+ *
+ * Entry
+ * argc,argv - from softpc as it is.
+ *
+ *
+ * Exit
+ * None
+ */
+
+PSZ pszDefaultDOSDirectory;
+
+extern VOID TerminateVDM(VOID);
+
+CHAR demDebugBuffer [256];
+
+#if DBG
+BOOL ToDebugOnF11 = FALSE;
+#endif
+
+BOOL DemInit (int argc, char *argv[])
+{
+ PSZ psz;
+ DWORD dw;
+
+ // Modify default hard error handling
+ // - turn off all file io related popups
+ // - keep GP fault popups from system
+ //
+ SetErrorMode (SEM_FAILCRITICALERRORS | SEM_NOOPENFILEERRORBOX);
+
+ pszDefaultDOSDirectory = (PCHAR) malloc(MAX_PATH+14);
+ if (!pszDefaultDOSDirectory ||
+ !(dw = GetSystemDirectory(pszDefaultDOSDirectory, MAX_PATH)) ||
+ dw >= MAX_PATH )
+ {
+ return FALSE;
+ }
+
+ if (VDMForWOW)
+ return TRUE;
+
+ // Check the debugging level
+ while (--argc > 0) {
+ psz = *++argv;
+ if (*psz == '-' || *psz == '/') {
+ psz++;
+ if(tolower(*psz) == 'd'){
+ fShowSVCMsg = DEMDOSDISP | DEMFILIO;
+ break;
+ }
+ }
+ }
+
+
+#if DBG
+#ifndef i386
+ if( getenv( "YODA" ) != 0 )
+#else
+ if( getenv( "DEBUGDOS" ) != 0 )
+#endif
+ ToDebugOnF11 = TRUE;
+#endif
+
+ return TRUE;
+}
diff --git a/private/mvdm/dos/dem/dem.h b/private/mvdm/dos/dem/dem.h
new file mode 100644
index 000000000..9b1276b7f
--- /dev/null
+++ b/private/mvdm/dos/dem/dem.h
@@ -0,0 +1,260 @@
+/* dem.h - main include file for dem
+ *
+ * Modification History
+ *
+ * Sudeepb 31-Mar-1991 Created
+ */
+
+#ifndef _DEMINCLUDED_
+#define _DEMINCLUDED_
+
+/*
+#define WIN
+#define FLAT_32
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+
+#define _WINDOWS
+#include <windows.h>
+
+*/
+
+#ifdef DOS
+#define SIGNALS
+#endif
+
+#ifdef OS2_16
+#define OS2
+#define SIGNALS
+#endif
+
+#ifdef OS2_32
+#define OS2
+#define FLAT_32
+#endif
+
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <malloc.h>
+#include <process.h>
+
+#ifdef WIN_16
+#define WIN
+#define API16
+#endif
+
+#ifdef WIN_32
+#define WIN
+#define FLAT_32
+#define TRUE_IF_WIN32 1
+#include <nt.h>
+#include <ntrtl.h>
+#include <nturtl.h>
+#include <ntdddisk.h>
+#else
+#define TRUE_IF_WIN32 0
+#endif
+
+#ifdef FLAT_32
+#ifndef i386
+#define ALIGN_32
+#else
+#define NOALIGN_32
+#endif
+#endif
+
+#ifdef WIN
+#define _WINDOWS
+#include <windows.h>
+#endif
+
+#ifdef SIGNALS
+#include <conio.h>
+#include <signal.h>
+#endif
+
+#ifdef OS2_32
+#include <excpt.h>
+#define XCPT_SIGNAL 0xC0010003
+#endif
+#define SIGHIT(flChk) ((iSigCheck++ & 0x7FF)?(flSignals & (flChk)):(kbhit(),(flSignals & (flChk))))
+
+#include <oemuni.h>
+
+
+
+
+/** Basic Typedefs of DEM **/
+
+typedef VOID (*PFNSVC)(VOID);
+
+typedef struct _SAVEDEMWORLD {
+ USHORT ax;
+ USHORT bx;
+ USHORT cx;
+ USHORT dx;
+ USHORT ds;
+ USHORT es;
+ USHORT si;
+ USHORT di;
+ USHORT bp;
+ ULONG iSVC;
+} SAVEDEMWORLD, *PSAVEDEMWORLD;
+
+
+typedef struct _DISKINFO {
+ WORD wSectorsPerCluster;
+ WORD wBytesPerSector;
+ WORD wFreeClusters;
+ WORD wTotalClusters;
+} DISKINFO, *PDISKINFO;
+
+#include "dosdef.h"
+#include "dossvc.h"
+
+
+
+/** DEM Externs **/
+
+extern ULONG UNALIGNED *pulDTALocation;
+extern BOOL VDMForWOW;
+extern PVHE pHardErrPacket;
+extern ULONG CurrentISVC;
+extern PCHAR aSVCNames[];
+extern PFNSVC apfnSVC[];
+extern PSZ pszDefaultDOSDirectory;
+extern USHORT nDrives;
+extern PUSHORT pusCurrentPDB;
+extern PDEMEXTERR pExtendedError;
+
+
+#include "demexp.h"
+#if DEVL
+extern CHAR demDebugBuffer [];
+#endif
+
+
+
+
+/** DEM Macros **/
+
+#define GETULONG(hi,lo) (DWORD)((((int) hi) << 16) + ((int) lo))
+#define GETHANDLE(hi,lo) (HANDLE)(GETULONG(hi,lo))
+#define IS_ASCII_PATH_SEPARATOR(ch) (((ch) == '/') || ((ch) == '\\'))
+
+
+/** Function Prototypes */
+
+VOID demChgFilePtr (VOID);
+VOID demChMod (VOID);
+VOID demClose (VOID);
+VOID demCloseFCB (VOID);
+VOID demCreate (VOID);
+VOID demCreateFCB (VOID);
+VOID demCreateDir (VOID);
+VOID demCreateNew (VOID);
+VOID demDate16 (VOID);
+VOID demDelete (VOID);
+VOID demDeleteDir (VOID);
+VOID demDeleteFCB (VOID);
+VOID demFCBIO (VOID);
+VOID demFileTimes (VOID);
+VOID demFindFirst (VOID);
+VOID demFindFirstFCB (VOID);
+VOID demFindNext (VOID);
+VOID demFindNextFCB (VOID);
+VOID demGetBootDrive (VOID);
+VOID demGetDriveFreeSpace (VOID);
+VOID demGetDrives (VOID);
+VOID demGetFileInfo (VOID);
+VOID demGSetMediaID (VOID);
+VOID demIOCTL (VOID);
+VOID demLoadDos (VOID);
+VOID demLockOper (VOID);
+VOID demOpen (VOID);
+VOID demOpenFCB (VOID);
+VOID demQueryCurrentDir (VOID);
+VOID demQueryDate (VOID);
+VOID demQueryTime (VOID);
+VOID demRead (VOID);
+VOID demRename (VOID);
+VOID demRenameFCB (VOID);
+VOID demRetry (VOID);
+VOID demSetCurrentDir (VOID);
+VOID demSetDate (VOID);
+VOID demSetDefaultDrive (VOID);
+VOID demSetDTALocation (VOID);
+VOID demSetHardErrorInfo(VOID);
+VOID demSetTime (VOID);
+VOID demSetV86KernelAddr(VOID);
+VOID demWrite (VOID);
+VOID demGetDriveInfo (VOID);
+VOID demDiskReset (VOID);
+VOID demLoadDosAppSym (VOID);
+VOID demFreeDosAppSym (VOID);
+VOID demEntryDosApp (VOID);
+VOID demDOSDispCall (VOID);
+VOID demDOSDispRet (VOID);
+VOID demOutputString (VOID);
+VOID demInputString (VOID);
+VOID demIsDebug (VOID);
+VOID demTerminatePDB (VOID);
+VOID demExitVDM (VOID);
+VOID demWOWFiles (VOID);
+VOID demGetComputerName (VOID);
+VOID demCheckPath (VOID);
+VOID demSystemSymbolOp (VOID);
+VOID demCommit (VOID);
+VOID demClientError (HANDLE,CHAR);
+ULONG demClientErrorEx (HANDLE,CHAR,BOOL);
+VOID demCreateCommon (ULONG);
+BOOL demGetMiscInfo (HANDLE, LPWORD, LPWORD, LPDWORD);
+VOID demFCBCommon (ULONG);
+
+VOID demIoctlChangeable (VOID);
+VOID demIoctlInvalid (VOID);
+VOID demSaveHardErrInfo (VOID);
+VOID demRestoreHardErrInfo (VOID);
+VOID demAbsRead (VOID);
+VOID demAbsWrite (VOID);
+VOID demIoctlDiskGeneric (VOID);
+VOID demIoctlDiskQuery (VOID);
+VOID demGetDPB (VOID);
+VOID demGetDPBList (VOID);
+VOID demNotYetImplemented (VOID);
+BOOL GetDiskSpaceInformation(CHAR chDrive, PDISKINFO pDiskInfo);
+BOOL demGetDiskFreeSpace(BYTE Drive, WORD * BytesPerSector,
+ WORD * SectorsPerCluster, WORD * TotalClusters,
+ WORD * FreeClusters);
+BOOL IsCdRomFile (PSTR pszPath);
+
+BOOL GetMediaId( CHAR DriveNum, PVOLINFO pVolInfo);
+VOID demPipeFileDataEOF (VOID);
+VOID demPipeFileEOF (VOID);
+
+/** Debug Function Prototypes */
+
+#if DBG
+
+VOID demPrintMsg (ULONG iMsg);
+
+#else
+
+#define demPrintMsg(x)
+
+#endif
+
+/* Label functions and constants */
+USHORT demDeleteLabel(BYTE Drive);
+USHORT demCreateLabel(BYTE Drive, LPSTR szName);
+#define DRIVEBYTE 0
+#define LABELOFF 3
+
+extern BOOL cmdPipeFileDataEOF (HANDLE,BOOL *);
+extern BOOL cmdPipeFileEOF(HANDLE);
+
+
+#endif /* _DEMINCLUDED_ */
diff --git a/private/mvdm/dos/dem/demdasd.c b/private/mvdm/dos/dem/demdasd.c
new file mode 100644
index 000000000..0afa89204
--- /dev/null
+++ b/private/mvdm/dos/dem/demdasd.c
@@ -0,0 +1,734 @@
+
+/*
+ * demdasd.c - module for direct disk access related support functions
+ *
+ * Williamh 09-Dec-1992 Created
+ * Revision 24-Mar-1993 added fdisk support
+ */
+
+#include "io.h"
+#include "dem.h"
+#include "stdio.h"
+#include "windows.h"
+#include "demdasd.h"
+#include "softpc.h"
+
+PBDS demBDS;
+BYTE NumberOfFloppy;
+BYTE NumberOfFdisk;
+
+extern WORD int13h_vector_off, int13h_vector_seg;
+extern WORD int13h_caller_off, int13h_caller_seg;
+
+BPB StdBpb[MAX_FLOPPY_TYPE] = {
+ {512, 2, 1, 2, 112, 2*9*40, 0xFD, 2, 9, 2, 0, 0}, // 360KB
+ {512, 1, 1, 2, 224, 2*15*80, 0xF9, 7, 15, 2, 0, 0}, // 1.2MB
+ {512, 2, 1, 2, 112, 2*9*80, 0xF9, 3, 9, 2, 0, 0}, // 720KB
+ {512, 1, 1, 2, 224, 2*18*80, 0xF0, 9, 18, 2, 0, 0}, // 1.44MB
+ {512, 2, 1, 2, 240, 2*36*80, 0xF0, 9, 36, 2, 0, 0} // 2.88MB
+ };
+
+BYTE FormFactorTable[MAX_FLOPPY_TYPE] = {
+ FF_360,
+ FF_120,
+ FF_720,
+ FF_144,
+ FF_288
+ };
+
+/* demDasdInit - dem diskette system Initialiazation
+ *
+ * Entry
+ * none
+ *
+ *
+ * Exit
+ * None
+ */
+VOID demDasdInit(VOID)
+{
+ demBDS = NULL;
+ NumberOfFloppy = NumberOfFdisk = 0;
+ demFloppyInit();
+ demFdiskInit();
+}
+/* demAbsRead - int 25, absolute read
+ *
+ * Entry
+ * Client (AL) = drive number (0 based)
+ * (DS:BX) = pointer to the buffer to receive the read data
+ * or pointer to the DISKIO structure
+ * (CX) = number of sectors to read
+ * if (0FFFFh) then DS:DX points to DISKIO
+ * DX contents are discarded
+ * (DX) = starting sector number
+ *
+ *
+ * Exit
+ * Client (CY) = 0 if operation succeed
+ * (AX) = 0
+ *
+ * (CY) = 1 if operation failed
+ * (AX) = error code
+ */
+
+VOID demAbsRead (VOID)
+{
+#if DBG
+ if (fShowSVCMsg & DEM_ABSDRD)
+ OutputDebugStringOem("DEM: INT 25 Called \n");
+#endif
+ demAbsReadWrite(FALSE);
+}
+
+
+
+
+/* demAbsWrite - int 26, absolute read
+ *
+ *
+ * Entry
+ * Client (AL) = drive number (0 based)
+ * (DS:BX) = pointer to the buffer to receive the read data
+ * or pointer to the DISKIO structure
+ * (CX) = number of sectors to read
+ * if (0FFFFh) then DS:DX points to DISKIO
+ * DX contents are discarded
+ * (DX) = starting sector number
+ *
+ *
+ * Exit
+ * Client (CY) = 0 if operation succeed
+ * (AX) = 0
+ *
+ * (CY) = 1 if operation failed
+ * (AX) = error code
+ */
+
+VOID demAbsWrite(VOID)
+{
+#if DBG
+ if (fShowSVCMsg & DEM_ABSWRT)
+ OutputDebugStringOem("DEM: INT 26 Called \n");
+#endif
+ demAbsReadWrite(TRUE);
+}
+
+
+
+VOID demAbsReadWrite(BOOL IsWrite)
+{
+ BYTE Drive;
+ DWORD LastError;
+ DWORD Sectors;
+ DWORD StartSector;
+ PDISKIO DiskIo;
+ DWORD SectorsReturned;
+ PBDS pBDS;
+ WORD BufferOff, BufferSeg;
+
+ Drive = getAL();
+ if ((Sectors = getCX()) == 0xFFFF) {
+ DiskIo = (PDISKIO) GetVDMAddr(getDS(), getBX());
+ Sectors = DiskIo->Sectors;
+ StartSector = DiskIo->StartSector;
+ BufferOff = DiskIo->BufferOff;
+ BufferSeg = DiskIo->BufferSeg;
+ }
+ else {
+ StartSector = getDX();
+ BufferOff = getBX();
+ BufferSeg = getDS();
+ }
+ if ((pBDS = demGetBDS(Drive)) == NULL) {
+ if (!demIsDriveFloppy(Drive))
+ host_direct_access_error(NOSUPPORT_HARDDISK);
+ setAX(DOS_DRIVE_NOT_READY);
+ setCF(1);
+ return;
+ }
+#if DBG
+ if (fShowSVCMsg & (DEM_ABSDRD | DEM_ABSWRT)) {
+ sprintf(demDebugBuffer, "Drive Number: %d\n", Drive);
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer, "StartSector: %d\n", StartSector);
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer, "Total Sectors: %d\n", Sectors);
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer, "Buffer: %x:%x\n", BufferSeg, BufferOff);
+ }
+#endif
+
+ if (IsWrite)
+ SectorsReturned = demDasdWrite(pBDS,
+ StartSector,
+ Sectors,
+ BufferOff,
+ BufferSeg
+ );
+ else
+ SectorsReturned = demDasdRead(pBDS,
+ StartSector,
+ Sectors,
+ BufferOff,
+ BufferSeg
+ );
+ if (SectorsReturned != Sectors) {
+ LastError = GetLastError();
+#if DBG
+ if (fShowSVCMsg & (DEM_ABSDRD | DEM_ABSWRT)) {
+ sprintf(demDebugBuffer, "dem: AbsRDWR Failed, error=%lx\n", LastError);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ setAX(demWinErrorToDosError(LastError));
+ setCF(1);
+ return;
+ }
+ setCF(0);
+ return;
+}
+
+DWORD demDasdRead(
+ PBDS pbds,
+ DWORD StartSector,
+ DWORD Sectors,
+ WORD BufferOff,
+ WORD BufferSeg
+)
+
+{
+
+ ULONG SizeReturned;
+ LARGE_INTEGER LargeInteger;
+ DWORD Size;
+ DWORD SectorSize;
+ WORD CurBiosDiskIoOff, CurBiosDiskIoSeg;
+ PBYTE Buffer;
+
+ // if this is the first time we access the BDS or
+ // the media has been changed, build the bds -- floppy
+ if (!(pbds->Flags & NON_REMOVABLE) &&
+ ((pbds->Flags & UNFORMATTED_MEDIA) ||
+ !nt_floppy_media_check(pbds->DrivePhys))) {
+ if (!demGetBPB(pbds))
+ return 0;
+ }
+ if (StartSector >= pbds->TotalSectors ||
+ StartSector + Sectors > pbds->TotalSectors) {
+ SetLastError(ERROR_SECTOR_NOT_FOUND);
+ return 0 ;
+ }
+ SectorSize = pbds->bpb.SectorSize;
+ LargeInteger.QuadPart = Int32x32To64(Sectors, SectorSize);
+ // size must fit in ulong
+ if (LargeInteger.HighPart != 0) {
+ SetLastError(ERROR_SECTOR_NOT_FOUND);
+ return 0;
+ }
+ Size = LargeInteger.LowPart;
+
+ Buffer = (PBYTE) GetVDMAddr(BufferSeg, BufferOff);
+
+ if (pbds->Flags & NON_REMOVABLE) {
+ LargeInteger.QuadPart = Int32x32To64(StartSector, SectorSize);
+ SizeReturned = nt_fdisk_read(
+ pbds->DrivePhys,
+ &LargeInteger,
+ Size,
+ Buffer
+ );
+ }
+ else {
+ // floppy need special care beacuse application may hook
+ // bios disk interrupt. We dont' do this for hard disks because
+ // we don't allow int13 to them
+ sas_loadw(0x13*4, &CurBiosDiskIoOff);
+ sas_loadw(0x13* 4 + 2, &CurBiosDiskIoSeg);
+ if (int13h_vector_off == CurBiosDiskIoOff &&
+ int13h_vector_seg == CurBiosDiskIoSeg)
+ SizeReturned = nt_floppy_read(
+ pbds->DrivePhys,
+ StartSector * SectorSize,
+ Size,
+ Buffer
+ );
+ else
+ return (demBiosDiskIoRW(pbds,
+ StartSector,
+ Sectors,
+ BufferOff,
+ BufferSeg,
+ FALSE
+ ));
+ }
+ if (SizeReturned == Size)
+ return Sectors;
+ else
+ return SizeReturned / SectorSize;
+
+}
+
+DWORD demDasdWrite(
+ PBDS pbds,
+ DWORD StartSector,
+ DWORD Sectors,
+ WORD BufferOff,
+ WORD BufferSeg
+)
+
+
+{
+ ULONG SizeReturned;
+ LARGE_INTEGER LargeInteger;
+ DWORD Size;
+ DWORD SectorSize;
+ WORD CurBiosDiskIoOff, CurBiosDiskIoSeg;
+ PBYTE Buffer;
+
+ // if this is the first time we access the BDS or
+ // the media has been changed, build the bds
+ if (!(pbds->Flags & NON_REMOVABLE) &&
+ ((pbds->Flags & UNFORMATTED_MEDIA) ||
+ !nt_floppy_media_check(pbds->DrivePhys))) {
+ if (!demGetBPB(pbds))
+ return 0;
+ }
+ if (StartSector >= pbds->TotalSectors ||
+ StartSector + Sectors > pbds->TotalSectors) {
+ SetLastError(ERROR_SECTOR_NOT_FOUND);
+ return 0 ;
+ }
+ SectorSize = pbds->bpb.SectorSize;
+ LargeInteger.QuadPart = Int32x32To64(Sectors, SectorSize);
+ // size must fit in ulong
+ if (LargeInteger.HighPart != 0) {
+ SetLastError(ERROR_SECTOR_NOT_FOUND);
+ return 0;
+ }
+ Size = LargeInteger.LowPart;
+ Buffer = (PBYTE) GetVDMAddr(BufferSeg, BufferOff);
+
+
+ if (pbds->Flags & NON_REMOVABLE) {
+ LargeInteger.QuadPart = Int32x32To64(StartSector, SectorSize);
+ SizeReturned = nt_fdisk_write(
+ pbds->DrivePhys,
+ &LargeInteger,
+ Size,
+ Buffer
+ );
+ }
+ else {
+ // floppy need special care beacuse application may hook
+ // bios disk interrupt. We dont' do this for hard disks because
+ // we don't allow int13 to them
+ sas_loadw(0x13*4, &CurBiosDiskIoOff);
+ sas_loadw(0x13* 4 + 2, &CurBiosDiskIoSeg);
+ if (int13h_vector_off == CurBiosDiskIoOff &&
+ int13h_vector_seg == CurBiosDiskIoSeg)
+ SizeReturned = nt_floppy_write(
+ pbds->DrivePhys,
+ StartSector * SectorSize,
+ Size,
+ Buffer
+ );
+ else
+ return(demBiosDiskIoRW(pbds,
+ StartSector,
+ Sectors,
+ BufferOff,
+ BufferSeg,
+ TRUE
+ ));
+ }
+
+ if (Size == SizeReturned)
+ return Sectors;
+ else
+ return SizeReturned / SectorSize;
+
+
+}
+
+BOOL demDasdFormat(PBDS pbds, DWORD Head, DWORD Cylinder, MEDIA_TYPE * Media)
+{
+ BOOL Result;
+
+ if (pbds->Flags & NON_REMOVABLE)
+ Result = demDasdVerify(pbds, Head, Cylinder);
+ else {
+
+ if (*Media == Unknown) {
+ *Media = nt_floppy_get_media_type(pbds->DrivePhys,
+ pbds->Cylinders,
+ pbds->bpb.TrackSize,
+ pbds->bpb.Heads
+ );
+ return TRUE;
+ }
+ else {
+ Result = nt_floppy_format(pbds->DrivePhys,
+ (WORD)Cylinder,
+ (WORD)Head,
+ *Media
+ );
+ }
+ }
+ return (Result);
+}
+
+
+BOOL demDasdVerify(PBDS pbds, DWORD Head, DWORD Cylinder)
+{
+ DWORD Size, StartSector;
+ LARGE_INTEGER LargeInteger;
+
+ // if floppy, make sure we have up-to-date BPB and a valid media is in
+ if (!(pbds->Flags & NON_REMOVABLE)) {
+ if (!demGetBPB(pbds))
+ return FALSE;
+ Size = pbds->bpb.TrackSize * pbds->bpb.SectorSize;
+ StartSector = pbds->bpb.TrackSize * (Cylinder * pbds->bpb.Heads + Head) + 1;
+ return (nt_floppy_verify(pbds->DrivePhys,
+ StartSector * pbds->bpb.SectorSize,
+ Size));
+ }
+ // hard disk needs special care because of their size
+ Size = pbds->bpb.TrackSize * pbds->bpb.SectorSize;
+ StartSector = pbds->bpb.TrackSize * (Cylinder * pbds->bpb.Heads + Head) + 1;
+ LargeInteger.QuadPart = Int32x32To64(StartSector, pbds->bpb.SectorSize);
+ return (nt_fdisk_verify(pbds->DrivePhys,
+ &LargeInteger,
+ Size
+ ));
+}
+
+PBDS demGetBDS(BYTE DriveLog)
+{
+ PBDS pbds;
+ pbds = demBDS;
+ while (pbds != NULL && pbds->DriveLog != DriveLog)
+ pbds = pbds->Next;
+ return pbds;
+}
+
+BOOL demGetBPB(PBDS pbds)
+{
+ PBOOTSECTOR pbs;
+ BYTE SectorBuffer[BYTES_PER_SECTOR];
+
+ // when RETURN_FAKE_BPB is set(set by Set Device Parameter IOCTL,
+ // the appplication has set a new BPB, we simply return it
+ if (!(pbds->Flags & RETURN_FAKE_BPB) &&
+ !(pbds->Flags & NON_REMOVABLE) &&
+ ((pbds->Flags & UNFORMATTED_MEDIA) || !nt_floppy_media_check(pbds->DrivePhys))
+ ) {
+ pbds->Flags &= ~(UNFORMATTED_MEDIA);
+ nt_floppy_close(pbds->DrivePhys);
+ if (nt_floppy_read(pbds->DrivePhys,
+ 0,
+ BYTES_PER_SECTOR,
+ SectorBuffer
+ ) != BYTES_PER_SECTOR)
+ return FALSE;
+ pbs = (PBOOTSECTOR)SectorBuffer;
+ if ((pbs->Jump == 0x69 || pbs->Jump == 0xE9 ||
+ (pbs->Jump == 0xEB && pbs->Target[1] == 0x90)) &&
+ (pbs->bpb.MediaID & 0xF0) == 0xF0) {
+ pbds->bpb = pbs->bpb;
+ pbds->TotalSectors = (pbs->bpb.Sectors) ? pbs->bpb.Sectors :
+ pbs->bpb.BigSectors;
+ return TRUE;
+ }
+ // an unknown media found
+ else {
+ pbds->Flags |= UNFORMATTED_MEDIA;
+ // What should we do here? The diskette has strange boot sector
+ // should we guess it or what?
+ //
+#if DEVL
+ if (fShowSVCMsg & (DEM_ABSDRD | DEM_ABSWRT)) {
+ sprintf(demDebugBuffer, "Invalid Boot Sector Found\n");
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ host_direct_access_error(NOSUPPORT_FLOPPY);
+ return FALSE;
+ }
+ }
+ return TRUE;
+}
+
+DWORD demBiosDiskIoRW(
+ PBDS pbds,
+ DWORD StartSector,
+ DWORD Sectors,
+ WORD BufferOff,
+ WORD BufferSeg,
+ BOOL IsWrite
+)
+{
+ BYTE CurHead, CurSector, BiosErrorCode;
+ WORD CurTrack, TrackSize, Heads, SectorTrack;
+ WORD AX, BX, CX, DX, ES, CS, IP;
+ BYTE SectorsRead, SectorsToRead;
+ WORD wRetry = 3;
+
+ AX = getAX();
+ BX = getBX();
+ CX = getCX();
+ DX = getDX();
+ ES = getES();
+ CS = getCS();
+ IP = getIP();
+
+ TrackSize = pbds->bpb.TrackSize;
+ Heads = pbds->bpb.Heads;
+ SectorsRead = 0;
+ CurSector = (BYTE) ((StartSector % TrackSize) + 1);
+ CurTrack = (WORD) (StartSector / TrackSize);
+ CurHead = CurTrack % Heads;
+ CurTrack /= Heads;
+ SectorsToRead = TrackSize - CurSector + 1;
+ while (Sectors != 0) {
+ if (Sectors < SectorsToRead)
+ SectorsToRead = (BYTE) Sectors;
+ // low byte: bit 6 and 7 are high bits of track,
+ // bit 0 - 5 are sector number
+ // high byte: bit 0 - bit 7 ->track lower 8 bits
+ SectorTrack = ((CurTrack & 0x300) >> 2) | (CurSector & 0x3f) |
+ ((CurTrack &0xFF) << 8);
+ wRetry = 3;
+BiosRetry:
+ setAH((BYTE) ((IsWrite) ? DISKIO_WRITE : DISKIO_READ));
+ setAL(SectorsToRead);
+ setBX(BufferOff);
+ setES(BufferSeg);
+ setDH(CurHead);
+ setDL(pbds->DrivePhys);
+ setCX(SectorTrack);
+ setCS(int13h_caller_seg);
+ setIP(int13h_caller_off);
+ host_simulate();
+ if (getCF() == 0) {
+ SectorsRead += SectorsToRead;
+ if ((Sectors -= SectorsToRead) == 0)
+ break;
+ CurSector = 1;
+ if (++CurHead == Heads) {
+ CurHead = 0;
+ CurTrack++;
+ }
+ SectorsToRead = (BYTE) TrackSize;
+ }
+ else {
+ BiosErrorCode = getAH();
+ // reset the disk
+ setAH(DISKIO_RESET);
+ setDL(pbds->DrivePhys);
+ setCS(int13h_caller_seg);
+ setIP(int13h_caller_off);
+ host_simulate();
+ // NOTE that we dont' handle DMA boundary here
+ // because it shouldn't happen. -- the NT disk DD
+ // will take care of that.
+ if (BiosErrorCode & BIOS_TIME_OUT) {
+ SetLastError(ERROR_NO_MEDIA_IN_DRIVE);
+ break;
+ }
+ if (wRetry--)
+ goto BiosRetry;
+ SetLastError(BiosErrorToNTError(BiosErrorCode));
+ break;
+ }
+
+ }
+ setAX(AX);
+ setBX(BX);
+ setCX(CX);
+ setDX(DX);
+ setES(ES);
+ setCS(CS);
+ setIP(IP);
+ return SectorsRead;
+
+}
+
+DWORD BiosErrorToNTError(BYTE BiosErrorCode)
+{
+ DWORD NtErrorCode;
+
+ switch (BiosErrorCode) {
+ case BIOS_INVALID_FUNCTION:
+ NtErrorCode = ERROR_BAD_COMMAND;
+ break;
+ case BIOS_BAD_ADDRESS_MARK:
+ NtErrorCode = ERROR_FLOPPY_ID_MARK_NOT_FOUND;
+ break;
+ case BIOS_WRITE_PROTECTED:
+ NtErrorCode = ERROR_WRITE_PROTECT;
+ break;
+ case BIOS_BAD_SECTOR:
+ case BIOS_CRC_ERROR:
+ NtErrorCode = ERROR_SECTOR_NOT_FOUND;
+ break;
+ case BIOS_DISK_CHANGED:
+ NtErrorCode = ERROR_DISK_CHANGE;
+ break;
+ case BIOS_NO_MEDIA:
+ NtErrorCode = ERROR_NO_MEDIA_IN_DRIVE;
+ break;
+ case BIOS_SEEK_ERROR:
+ NtErrorCode = ERROR_SEEK;
+ break;
+ default:
+ NtErrorCode = ERROR_FLOPPY_UNKNOWN_ERROR;
+ }
+ return NtErrorCode;
+
+
+}
+
+
+WORD demWinErrorToDosError(DWORD LastError)
+{
+ WORD DosError;
+
+ switch(LastError) {
+ case ERROR_SEEK:
+ DosError = DOS_SEEK_ERROR;
+ break;
+ case ERROR_BAD_UNIT:
+ DosError = DOS_UNKNOWN_UNIT;
+ break;
+ case ERROR_NO_MEDIA_IN_DRIVE:
+ case ERROR_NOT_READY:
+ DosError = DOS_DRIVE_NOT_READY;
+ break;
+ case ERROR_NOT_DOS_DISK:
+ DosError = DOS_UNKNOWN_MEDIA;
+ break;
+ case ERROR_SECTOR_NOT_FOUND:
+ case ERROR_FLOPPY_WRONG_CYLINDER:
+ DosError = DOS_SECTOR_NOT_FOUND;
+ break;
+ case ERROR_READ_FAULT:
+ DosError = DOS_READ_FAULT;
+ break;
+ case ERROR_WRITE_FAULT:
+ DosError = DOS_WRITE_FAULT;
+ break;
+ case ERROR_WRONG_DISK:
+ case ERROR_DISK_CHANGE:
+ case ERROR_MEDIA_CHANGED:
+ DosError = DOS_INVALID_MEDIA_CHANGE;
+ break;
+ case ERROR_WRITE_PROTECT:
+ DosError = DOS_WRITE_PROTECTION;
+ break;
+ default:
+ DosError = DOS_GEN_FAILURE;
+
+ }
+ return (DosError);
+}
+
+
+VOID demFdiskInit(VOID)
+{
+ PBDS pbds;
+ UCHAR Drive;
+ DISK_GEOMETRY DiskGeometry;
+ BPB bpb;
+
+ Drive = 0;
+ do {
+ // first, the drive must be valid
+ // second, the drive must be a hard disk(fixed)
+ // third, the drive must be a FAT
+ if (demGetPhysicalDriveType(Drive) == DRIVE_FIXED &&
+ nt_fdisk_init(Drive, &bpb, &DiskGeometry)) {
+ pbds = (PBDS) malloc(sizeof(BDS));
+ if (pbds != NULL) {
+ pbds->bpb = bpb;
+ pbds->rbpb = bpb;
+ pbds->DrivePhys = NumberOfFdisk++;
+ pbds->DriveLog = Drive;
+ pbds->DriveType = DRIVETYPE_FDISK;
+ pbds->FormFactor = FF_FDISK;
+ pbds->TotalSectors = (bpb.Sectors) ?
+ bpb.Sectors :
+ bpb.BigSectors;
+ pbds->Cylinders = (WORD) DiskGeometry.Cylinders.LowPart;
+ pbds->Next = demBDS;
+ pbds->Flags = NON_REMOVABLE | PHYS_OWNER;
+ demBDS = pbds;
+ }
+ }
+
+ } while (++Drive < 26);
+
+}
+
+VOID demFloppyInit(VOID)
+{
+
+ WORD AX, BX, CX, DX, DI, ES;
+ BYTE i, NumberOfFloppy;
+ PBDS pbds;
+ BYTE DriveType;
+
+ AX = getAX();
+ BX = getBX();
+ CX = getCX();
+ DX = getDX();
+ DI = getDI();
+ ES = getES();
+
+
+ // reset the floppy system
+ setDL(0);
+ setAH(DISKIO_RESET);
+ diskette_io();
+
+ setDL(0);
+ setAH(DISKIO_GETPARAMS);
+ diskette_io();
+ if (getCF() == 0 && (NumberOfFloppy = getDL()) != 0) {
+ for(i = 0; i < NumberOfFloppy; i++) {
+ setDL(i);
+ setAH(DISKIO_GETPARAMS);
+ diskette_io();
+ if (getCF() == 0) {
+ pbds = (PBDS) malloc(sizeof(BDS));
+ if (pbds == NULL) {
+ OutputDebugStringOem("dem: not enough memory for BDS\n");
+ break;
+ }
+ pbds->DrivePhys = pbds->DriveLog = i;
+ pbds->DriveType = DriveType = getBL() & 0x0F;
+ pbds->fd = NULL;
+ pbds->Cylinders = getCH() + 1;
+ pbds->Sectors = getCL();
+ pbds->rbpb = StdBpb[DriveType - 1];
+ pbds->TotalSectors = 0;
+ pbds->Next = demBDS;
+ pbds->FormFactor = FormFactorTable[DriveType - 1];
+ demBDS = pbds;
+ pbds->Flags = UNFORMATTED_MEDIA | PHYS_OWNER;
+ setAH(DISKIO_DRIVETYPE);
+ setDL(i);
+ diskette_io();
+ if (getAH() == 2 )
+ pbds->Flags |= HAS_CHANGELINE;
+ }
+ }
+ }
+ setAX(AX);
+ setBX(BX);
+ setCX(CX);
+ setDX(DX);
+ setDI(DI);
+ setES(ES);
+}
diff --git a/private/mvdm/dos/dem/demdasd.h b/private/mvdm/dos/dem/demdasd.h
new file mode 100644
index 000000000..9d41fe111
--- /dev/null
+++ b/private/mvdm/dos/dem/demdasd.h
@@ -0,0 +1,301 @@
+
+
+#pragma pack(1)
+
+#define MAX_FLOPPY_TYPE 5
+typedef struct A_DISKIO {
+ DWORD StartSector;
+ WORD Sectors;
+ WORD BufferOff;
+ WORD BufferSeg;
+} DISKIO, * PDISKIO;
+
+// Bios Parameter Block (BPB)
+typedef struct A_BPB {
+WORD SectorSize; // sector size in bytes
+BYTE ClusterSize; // cluster size in sectors
+WORD ReservedSectors; // number of reserved sectors
+BYTE FATs; // number of FATs
+WORD RootDirs; // number of root directory entries
+WORD Sectors; // number of sectors
+BYTE MediaID; // media descriptor
+WORD FATSize; // FAT size in sectors
+WORD TrackSize; // track size in sectors;
+WORD Heads; // number of heads
+DWORD HiddenSectors; // number of hidden sectors
+DWORD BigSectors; // number of sectors for big media
+} BPB, *PBPB;
+
+typedef struct A_DPB {
+
+BYTE DriveNum; // driver numer, 0 - A, 1 -B and so on
+BYTE Unit; // unit number of DPB in the driver
+WORD SectorSize; // sector size in bytes
+BYTE ClusterMask; // cluster mask
+BYTE ClusterShift; // cluster shift count
+WORD FATSector; // starting sector of FAT
+BYTE FATs; // number of FAT
+WORD RootDirs; // number of root directory entries
+WORD FirstDataSector; // first sector for the first cluster
+WORD MaxCluster; // number of cluster + 1
+WORD FATSize; // FAT size in sectors
+WORD DirSector; // starting sector of directory
+DWORD DriveAddr; // address of the corresponding driver
+BYTE MediaID; // media ID
+BYTE FirstAccess; // 0xFF if this DPB is first accessed
+struct A_DPB * Next; // next DPB
+WORD FreeCluster; // cluster # of the last allocated
+WORD FreeClusters; // number of free clusters, 0xFFFF
+ // if unknown
+} DPB, * PDPB;
+
+
+typedef struct A_DEVICEPARAMETERS {
+BYTE Functions;
+BYTE DeviceType;
+WORD DeviceAttrs;
+WORD Cylinders;
+BYTE MediaType;
+BPB bpb;
+} DEVICEPARAMETERS, *PDEVICE_PARAMETERS;
+
+#define LABEL_LENGTH 11
+#define FILESYSTYPE_LENGTH 8
+
+
+typedef struct _DISK_LABEL {
+CHAR Name[LABEL_LENGTH];
+} DISK_LABEL, *PDISK_LABEL;
+
+typedef struct _FILESYSTYPE {
+CHAR Name[FILESYSTYPE_LENGTH];
+} FILESYSTYPE, * PFILESYSTYPE;
+
+// Functions for Get Device Parameters
+#define BUILD_DEVICE_BPB 0x01
+
+// Functions for Set Device Parameters
+#define INSTALL_FAKE_BPB 0x01
+#define ONLY_SET_TRACKLAYOUT 0x02
+#define TRACK_LAYOUT_IS_GOOD 0x04
+// Functions for Format Track
+#define STATUS_FOR_FORMAT 0x01
+// error code from format status call
+#define FORMAT_NO_ROM_SUPPORTED 0x01
+#define FORMAT_COMB_NOT_SUPPORTED 0x02
+
+
+// read and write block
+typedef struct _RWBLOCK {
+BYTE Functions;
+WORD Head;
+WORD Cylinder;
+WORD StartSector;
+WORD Sectors;
+WORD BufferOff;
+WORD BufferSeg;
+} RW_BLOCK, *PRW_BLOCK;
+
+// format and verify track block
+typedef struct _FMT_BLOCK{
+BYTE Functions;
+WORD Head;
+WORD Cylinder;
+} FMT_BLOCK, *PFMT_BLOCK;
+
+// media id block
+typedef struct _MID {
+WORD InfoLevel;
+DWORD SerialNum;
+DISK_LABEL Label;
+FILESYSTYPE FileSysType;
+} MID, *PMID;
+
+// access flage
+typedef struct _ACCESSCTRL {
+BYTE Functions;
+BYTE AccessFlag;
+} ACCESSCTRL, * PACCESSCTRL;
+
+// bit definitions for flags
+
+// definitions for misc flags
+#define NON_REMOVABLE 0x01
+#define HAS_CHANGELINE 0x02
+#define RETURN_FAKE_BPB 0x04
+#define GOOD_TRACKLAYOUT 0x08
+#define MULTI_OWNER 0x10
+#define PHYS_OWNER 0x20
+#define MEDIA_CHANGED 0x40
+#define CHANGED_BY_FORMAT 0x100
+#define UNFORMATTED_MEDIA 0x200
+#define FIRSTACCESS 0x8000
+
+#define EXT_BOOTSECT_SIG 0x29
+
+typedef struct _BOOTSECTOR {
+ BYTE Jump;
+ BYTE Target[2];
+ BYTE OemName[8];
+ BPB bpb;
+ BYTE DriveNum;
+ BYTE Reserved;
+ BYTE ExtBootSig;
+ DWORD SerialNum;
+ DISK_LABEL Label;
+ FILESYSTYPE FileSysType;
+} BOOTSECTOR, * PBOOTSECTOR;
+
+// Bios Data Structure (BDS)
+typedef struct A_BDS {
+struct A_BDS *Next; //pointer to next bds
+BYTE DrivePhys; //physical drive number, 0 based
+BYTE DriveLog; //logical drive number, 0 based
+BPB bpb;
+BYTE FatSize;
+WORD OpenCount;
+BYTE MediaType;
+WORD Flags;
+WORD Cylinders;
+BPB rbpb;
+BYTE LastTrack;
+DWORD Time;
+DWORD SerialNum;
+DISK_LABEL Label;
+FILESYSTYPE FileSysType;
+BYTE FormFactor;
+// the fllowing fields are dedicated for the drive itself
+WORD DriveType;
+WORD Sectors;
+HANDLE fd;
+DWORD TotalSectors;
+} BDS, *PBDS;
+
+#pragma pack()
+
+// drive type
+#define DRIVETYPE_NULL 0
+#define DRIVETYPE_360 1
+#define DRIVETYPE_12M 2
+#define DRIVETYPE_720 3
+#define DRIVETYPE_144 4
+#define DRIVETYPE_288 5
+#define DRIVETYPE_FDISK 0xff
+// FORM FACTOR
+
+#define FF_360 0
+#define FF_120 1
+#define FF_720 2
+#define FF_FDISK 5
+#define FF_144 7
+#define FF_288 9
+#define DOS_DIR_ENTRY_LENGTH 32
+#define DOS_DIR_ENTRY_LENGTH_SHIFT_COUNT 5
+
+// bios diskette i/o functions
+#define DISKIO_RESET 0
+#define DISKIO_GETSTATUS 1
+#define DISKIO_READ 2
+#define DISKIO_WRITE 3
+#define DISKIO_VERIFY 4
+#define DISKIO_FORMAT 5
+#define DISKIO_GETPARAMS 8
+#define DISKIO_DRIVETYPE 0x15
+#define DISKIO_DISKCHANGE 0x16
+#define DISKIO_SETTYPE 0x17
+#define DISKIO_SETMEDIA 0x18
+#define DISKIO_INVALID 0xff
+
+// Block device generic IOCTL(RAWIO) subfunction code
+
+#define IOCTL_SETDPM 0x40
+#define IOCTL_WRITETRACK 0x41
+#define IOCTL_FORMATTRACK 0x42
+#define IOCTL_SETMEDIA 0x46
+#define IOCTL_SETACCESS 0x47
+#define IOCTL_GETDPM 0x60
+#define IOCTL_READTRACK 0x61
+#define IOCTL_VERIFYTRACK 0x62
+#define IOCTL_GETMEDIA 0x66
+#define IOCTL_GETACCESS 0x67
+#define IOCTL_SENSEMEDIA 0x68
+
+#define IOCTL_GENERIC_MIN IOCTL_SETDPM
+#define IOCTL_GENERIC_MAX IOCTL_SENSEMEDIA
+
+
+// dos error code
+
+#define DOS_WRITE_PROTECTION 0
+#define DOS_UNKNOWN_UNIT 1
+#define DOS_DRIVE_NOT_READY 2
+#define DOS_CRC_ERROR 4
+#define DOS_SEEK_ERROR 6
+#define DOS_UNKNOWN_MEDIA 7
+#define DOS_SECTOR_NOT_FOUND 8
+#define DOS_WRITE_FAULT 10
+#define DOS_READ_FAULT 11
+#define DOS_GEN_FAILURE 12
+#define DOS_INVALID_MEDIA_CHANGE 15
+
+//BIOS disk io error code
+#define BIOS_INVALID_FUNCTION 0x01
+#define BIOS_BAD_ADDRESS_MARK 0x02
+#define BIOS_WRITE_PROTECTED 0x03
+#define BIOS_BAD_SECTOR 0x04
+#define BIOS_DISK_CHANGED 0x05
+#define BIOS_DMA_OVERRUN 0x06
+#define BIOS_DMA_BOUNDARY 0x08
+#define BIOS_NO_MEDIA 0x0C
+#define BIOS_CRC_ERROR 0x10
+#define BIOS_FDC_ERROR 0x20
+#define BIOS_SEEK_ERROR 0x40
+#define BIOS_TIME_OUT 0x80
+
+// dos disk generic io control error code
+#define DOS_INVALID_FUNCTION 1
+#define DOS_FILE_NOT_FOUND 2
+#define DOS_ACCESS_DENIED 5
+
+#define BIOS_DISKCHANGED 6
+
+#define BYTES_PER_SECTOR 512
+
+VOID demDasdInit(VOID);
+VOID demFloppyInit(VOID);
+VOID demFdiskInit(VOID);
+VOID demAbsReadWrite(BOOL IsWrite);
+DWORD demDasdRead(PBDS pbds, DWORD StartSector, DWORD Sectors,
+ WORD BufferOff, WORD BufferSeg);
+DWORD demDasdWrite(PBDS pbds, DWORD StartSector, DWORD Sectors,
+ WORD BufferOff, WORD BufferSeg);
+BOOL demDasdFormat(PBDS pbds, DWORD Head, DWORD Cylinder, MEDIA_TYPE * Media);
+BOOL demDasdVerify(PBDS pbds, DWORD Cylinder, DWORD Head);
+PBDS demGetBDS(BYTE Drive);
+BOOL demGetBPB(PBDS pbds);
+WORD demWinErrorToDosError(DWORD LastError);
+VOID diskette_io(VOID);
+
+DWORD BiosErrorToNTError(BYTE BiosError);
+DWORD demBiosDiskIoRW(PBDS pbds, DWORD StartSector, DWORD Sectors,
+ WORD BufferOff, WORD BufferSeg, BOOL IsWrite);
+VOID sas_loadw(DWORD, WORD *);
+
+// imported from host floppy support module
+BOOL nt_floppy_close(BYTE drive);
+ULONG nt_floppy_read(BYTE drive, ULONG offset, ULONG size, PBYTE buffer);
+ULONG nt_floppy_write(BYTE drive, ULONG offset, ULONG size, PBYTE buffer);
+ULONG nt_floppy_format(BYTE drive, WORD cylinder, WORD head, MEDIA_TYPE media);
+BOOL nt_floppy_media_check(BYTE drive);
+MEDIA_TYPE nt_floppy_get_media_type(BYTE Drive, WORD Cylinders, WORD Sectors, WORD Heads);
+BOOL nt_floppy_verify(BYTE drive, DWORD offset, DWORD size);
+
+BOOL nt_fdisk_init(BYTE drive, PBPB bpb, PDISK_GEOMETRY disk_geometry);
+ULONG nt_fdisk_read(BYTE drive, PLARGE_INTEGER offset, ULONG size, PBYTE buffer);
+ULONG nt_fdisk_write(BYTE drive,PLARGE_INTEGER offset, ULONG size, PBYTE buffer);
+BOOL nt_fdisk_verify(BYTE drive, PLARGE_INTEGER offset, ULONG size);
+BOOL nt_fdisk_close(BYTE drive);
+extern PBDS demBDS;
+extern BYTE NumberOfFloppy, NumberOfFdisk;
+
+#define demIsDriveFloppy(DriveLog) (DriveLog < NumberOfFloppy)
diff --git a/private/mvdm/dos/dem/demdata.c b/private/mvdm/dos/dem/demdata.c
new file mode 100644
index 000000000..d784bcde1
--- /dev/null
+++ b/private/mvdm/dos/dem/demdata.c
@@ -0,0 +1,24 @@
+/* demdata.c - All the VDM instance Data.
+ *
+ * Sudeepb 06-Apr-1991 Created
+ */
+
+#include "dem.h"
+
+/** VDM's DTA Address **/
+ULONG UNALIGNED *pulDTALocation; // Address in ntdos where DTA address is kept.
+
+
+/** VDM's Current PDB **/
+
+PUSHORT pusCurrentPDB;
+
+/** SFT Chain Head **/
+
+PDOSSF pSFTHead = NULL;
+
+//
+// address of extended error information in DOS data segment
+//
+
+PDEMEXTERR pExtendedError;
diff --git a/private/mvdm/dos/dem/demdir.c b/private/mvdm/dos/dem/demdir.c
new file mode 100644
index 000000000..def89eb3d
--- /dev/null
+++ b/private/mvdm/dos/dem/demdir.c
@@ -0,0 +1,182 @@
+/* demdir.c - SVC handlers for directory calls
+ *
+ * DemCreateDir
+ * DemDeleteDir
+ * DemQueryCurrentDir
+ * DemSetCurrentDir
+ *
+ * Modification History:
+ *
+ * Sudeepb 04-Apr-1991 Created
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+
+/* demCreateDir - Create a directory
+ *
+ *
+ * Entry - Client (DS:DX) directory name to create
+ * Client (BX:SI) EAs (NULL if no EAs)
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ *
+ * Notes : Extended Attributes is not yet taken care of.
+ */
+
+VOID demCreateDir (VOID)
+{
+LPSTR lpDir;
+
+ // EAs not yet implemented
+ if (getBX() || getSI()){
+ demPrintMsg (MSG_EAS);
+ return;
+ }
+
+ lpDir = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+
+ if(CreateDirectoryOem (lpDir,NULL) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpDir);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+
+/* demDeleteDir - Create a directory
+ *
+ *
+ * Entry - Client (DS:DX) directory name to create
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demDeleteDir (VOID)
+{
+LPSTR lpDir;
+
+ lpDir = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+ if (RemoveDirectoryOem(lpDir) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpDir);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+
+
+/* demQueryCurrentDir - Verifies current dir provided in CDS structure
+ * for $CURRENT_DIR
+ *
+ * First Validates Media, if invalid -> i24 error
+ * Next Validates Path, if invalid set path to root (not an error)
+ *
+ * Entry - Client (DS:SI) Buffer to CDS path to verify
+ * Client (AL) Physical Drive in question (A=0, B=1, ...)
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1 , I24 drive invalid
+ */
+VOID demQueryCurrentDir (VOID)
+{
+PCDS pcds;
+DWORD dw;
+CHAR chDrive;
+CHAR pPath[]="?:\\";
+CHAR EnvVar[] = "=?:";
+
+ pcds = (PCDS)GetVDMAddr(getDS(),getSI());
+
+ // validate media
+ chDrive = getAL() + 'A';
+ pPath[0] = chDrive;
+ dw = GetFileAttributesOem(pPath);
+ if (dw == 0xFFFFFFFF || !(dw & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ demClientError(INVALID_HANDLE_VALUE, chDrive);
+ return;
+ }
+
+ // if invalid path, set path to the root
+ // reset CDS, and win32 env for win32
+ dw = GetFileAttributesOem(pcds->CurDir_Text);
+ if (dw == 0xFFFFFFFF || !(dw & FILE_ATTRIBUTE_DIRECTORY))
+ {
+ strcpy(pcds->CurDir_Text, pPath);
+ pcds->CurDir_End = 2;
+ EnvVar[1] = chDrive;
+ SetEnvironmentVariableOem(EnvVar,pPath);
+ }
+
+ setCF(0);
+ return;
+}
+
+
+
+/* demSetCurrentDir - Set the current directory
+ *
+ *
+ * Entry - Client (DS:DX) directory name
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demSetCurrentDir (VOID)
+{
+LPSTR lpBuf;
+CHAR EnvVar[] = "=?:",ch;
+
+ lpBuf = (LPSTR) GetVDMAddr (getDS(),getDX());
+ ch = toupper(*(PCHAR)lpBuf);
+ if (ch < 'A' || ch > 'Z'){
+ setCF(1);
+ return;
+ }
+
+ if (SetCurrentDirectoryOem (lpBuf) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpBuf);
+ return;
+ }
+
+ EnvVar[1] = *(PCHAR)lpBuf;
+ if(SetEnvironmentVariableOem ((LPSTR)EnvVar,lpBuf) == FALSE)
+ setCF(1);
+ else
+ setCF(0);
+ return;
+}
diff --git a/private/mvdm/dos/dem/demdisp.c b/private/mvdm/dos/dem/demdisp.c
new file mode 100644
index 000000000..c498e4b5b
--- /dev/null
+++ b/private/mvdm/dos/dem/demdisp.c
@@ -0,0 +1,245 @@
+/*
+ * demdisp.c - SVC dispatch module
+ *
+ * Modification History:
+ *
+ * Sudeepb 31-Mar-1991 Created
+ */
+
+#include "dem.h"
+#include <stdio.h>
+#include <softpc.h>
+
+
+#if DBG
+
+PCHAR aSVCNames[] = {
+ "demChgFilePtr",
+ "demChMod",
+ "demClose",
+ "demCreate",
+ "demCreateDir",
+ "demDelete",
+ "demDeleteDir",
+ "demDeleteFCB",
+ "demFileTimes",
+ "demFindFirst",
+ "demFindFirstFCB",
+ "demFindNext",
+ "demFindNextFCB",
+ "demGetBootDrive",
+ "demGetDriveFreeSpace",
+ "demGetDrives",
+ "demGSetMediaID",
+ "demLoadDos",
+ "demOpen",
+ "demQueryCurrentDir",
+ "demQueryDate",
+ "demQueryTime",
+ "demRead",
+ "demRename",
+ "demSetCurrentDir",
+ "demSetDate",
+ "demSetDefaultDrive",
+ "demSetDTALocation",
+ "demSetTime",
+ "demSetV86KernelAddr",
+ "demWrite",
+ "demGetDriveInfo",
+ "demRenameFCB",
+ "demIOCTL",
+ "demCreateNew",
+ "DemDiskReset",
+ "DemSetDPB",
+ "DemGetDPB",
+ "DemSleazeFunc",
+ "demCommit",
+ "DemExtHandle",
+ "DemAbsDRD",
+ "DemAbsDWRT",
+ "DemGsetCDPG",
+ "DemCreateFCB",
+ "DemOpenFCB",
+ "DemCloseFCB",
+ "DemFCBIO",
+ "DemDate16",
+ "DemGetFileInfo",
+ "DemSetHardErrorInfo",
+ "DemRetry",
+ "DemLoadDosAppSym",
+ "DemFreeDosAppSym",
+ "DemEntryDosApp",
+ "DemDOSDispCall",
+ "DemDOSDispRet",
+ "DemOutputString",
+ "DemInputString",
+ "DemIsDebug",
+ "DemTerminatePDB",
+ "DemExitVDM",
+ "DemWOWFiles",
+ "DemLockOper",
+ "demNotYetImplemented",
+ "DemGetComputerName",
+ "DemFastRead",
+ "DemFastWrite",
+ "DemCheckPath",
+ "DemSystemSymbolOp",
+ "DemGetDpbList",
+ "DemPipeFileDataEOF",
+ "DemPipeFileEOF"
+};
+
+#endif // DBG
+
+DWORD fShowSVCMsg = 0;
+ULONG CurrentISVC;
+
+
+PFNSVC apfnSVC [] = {
+ demChgFilePtr, //SVC_DEMCHGFILEPTR
+ demChMod, //SVC_DEMCHMOD
+ demClose, //SVC_DEMCLOSE
+ demCreate, //SVC_DEMCREATE
+ demCreateDir, //SVC_DEMCREATEDIR
+ demDelete, //SVC_DEMDELETE
+ demDeleteDir, //SVC_DEMDELETEDIR
+ demDeleteFCB, //SVC_DEMDELETEFCB
+ demFileTimes, //SVC_DEMFILETIMES
+ demFindFirst, //SVC_DEMFINDFIRST
+ demFindFirstFCB, //SVC_DEMFINDFIRSTFCB
+ demFindNext, //SVC_DEMFINDNEXT
+ demFindNextFCB, //SVC_DEMFINDNEXTFCB
+ demGetBootDrive, //SVC_DEMGETBOOTDRIVE
+ demGetDriveFreeSpace, //SVC_DEMGETDRIVEFREESPACE
+ demGetDrives, //SVC_DEMGETDRIVES
+ demGSetMediaID, //SVC_DEMGSETMEDIAID
+ demLoadDos, //SVC_DEMLOADDOS
+ demOpen, //SVC_DEMOPEN
+ demQueryCurrentDir, //SVC_DEMQUERYCURRENTDIR
+ demQueryDate, //SVC_DEMQUERYDATE
+ demQueryTime, //SVC_DEMQUERYTIME
+ demRead, //SVC_DEMREAD
+ demRename, //SVC_DEMRENAME
+ demSetCurrentDir, //SVC_DEMSETCURRENTDIR
+ demSetDate, //SVC_DEMSETDATE
+ demSetDefaultDrive, //SVC_DEMSETDEFAULTDRIVE
+ demSetDTALocation, //SVC_DEMSETDTALOCATION
+ demSetTime, //SVC_DEMSETTIME
+ demSetV86KernelAddr, //SVC_DEMSETV86KERNELADDR
+ demWrite, //SVC_DEMWRITE
+ demNotYetImplemented, //SVC_GETDRIVEINFO
+ demRenameFCB, //SVC_DEMRENAMEFCB
+ demIOCTL, //SVC_DEMIOCTL
+ demCreateNew, //SVC_DEMCREATENEW
+ demDiskReset, //SVC_DEMDISKRESET
+ demNotYetImplemented, //SVC_DEMSETDPB
+ demGetDPB, //SVC_DEMGETDPB
+ demNotYetImplemented, //SVC_DEMSLEAZEFUNC
+ demCommit, //SVC_DEMCOMMIT
+ demNotYetImplemented, //SVC_DEMEXTHANDLE
+ demAbsRead, //SVC_DEMABSDRD
+ demAbsWrite, //SVC_DEMABSDWRT
+ demNotYetImplemented, //SVC_DEMGSETCDPG
+ demCreateFCB, //SVC_DEMCREATEFCB
+ demOpenFCB, //SVC_DEMOPENFCB
+ demCloseFCB, //SVC_DEMCLOSEFCB
+ demFCBIO, //SVC_FCBIO
+ demDate16, //SVC_DEMDATE16
+ demGetFileInfo, //SVC_DEMGETFILEINFO
+ demSetHardErrorInfo, //SVC_DEMSETHARDERRORINFO
+ demRetry, //SVC_DEMRETRY
+ demLoadDosAppSym, //SVC_DEMLOADDOSAPPSYM
+ demFreeDosAppSym, //SVC_DEMFREEDOSAPPSYM
+ demEntryDosApp, //SVC_DEMENTRYDOSAPP
+ demDOSDispCall, //SVC_DEMDOSDISPCALL
+ demDOSDispRet, //SVC_DEMDOSDISPRET
+ demOutputString, //SVC_OUTPUT_STRING
+ demInputString, //SVC_INPUT_STRING
+ demIsDebug, //SVC_ISDEBUG
+ demTerminatePDB, //SVC_PDBTERMINATE
+ demExitVDM, //SVC_DEMEXITVDM
+ demWOWFiles, //SVC_DEMWOWFILES
+ demLockOper, //SVC_DEMLOCKOPER
+ demNotYetImplemented, //SVC_DEMNOTYETIMPLEMENTED
+ demGetComputerName, //SVC_DEMGETCOMPUTERNAME
+ demNotYetImplemented, //SVC_DEMFASTREAD
+ demNotYetImplemented, //SVC_DEMFASTWRITE
+ demCheckPath, //SVC_DEMCHECKPATH
+ demSystemSymbolOp, //SVC_DEMSYSTEMSYMBOLOP
+ demGetDPBList, //SVC_DEMBUILDDPBLIST
+ demPipeFileDataEOF, //SVC_DEMPIPEFILEDATAEOF
+ demPipeFileEOF //SVC_DEMPIPEFILEEOF
+};
+
+
+/* DemDispatch - Dispatch SVC call to right handler.
+ *
+ * Entry - iSvc (SVC byte following SVCop)
+ *
+ * Exit - None
+ *
+ * Note - Some mechanism has to be worked out to let the emulator know
+ * about DOSKRNL code segment and size. Using these it will figure
+ * out whether SVCop (hlt for the moment) has to be passed to
+ * DEM or to be handled as normal invalid opcode.
+ */
+
+BOOL DemDispatch (ULONG iSvc)
+{
+#if DBG
+ if(iSvc < SVC_DEMLASTSVC && (fShowSVCMsg & DEMSVCTRACE) &&
+ apfnSVC[iSvc] != demNotYetImplemented){
+ sprintf(demDebugBuffer,"DemDispatch: Entering %s\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ aSVCNames[iSvc],getAX(),getBX(),getCX(),getDX(),getDI(),getSI());
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP(),getBP());
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ if (iSvc >= SVC_DEMLASTSVC){
+#if DBG
+ sprintf(demDebugBuffer,"Unimplemented SVC index %x\n",iSvc);
+ OutputDebugStringOem(demDebugBuffer);
+#endif
+ setCF(1);
+ return FALSE;
+ }
+
+ if (pHardErrPacket) {
+ pHardErrPacket->vhe_fbInt24 = 0;
+ }
+ CurrentISVC = iSvc;
+ (apfnSVC [iSvc])();
+
+
+#if DBG
+ if((fShowSVCMsg & DEMSVCTRACE)){
+ sprintf(demDebugBuffer,"DemDispatch:On Leaving %s\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ aSVCNames[iSvc],getAX(),getBX(),getCX(),getDX(),getDI(),getSI());
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x CF=%x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP(),getBP(),getCF());
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ return TRUE;
+}
+
+VOID demNotYetImplemented (VOID)
+{
+ if (fShowSVCMsg) {
+ sprintf(demDebugBuffer,"Unimplemented SVC %d\n",CurrentISVC);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+
+ setCF(0);
+ return;
+}
+
+VOID demSetV86KernelAddr (VOID)
+{
+ // Here debugger callout has to be made for DOSKRNL symbols
+ return;
+}
diff --git a/private/mvdm/dos/dem/demerror.c b/private/mvdm/dos/dem/demerror.c
new file mode 100644
index 000000000..2775ddc23
--- /dev/null
+++ b/private/mvdm/dos/dem/demerror.c
@@ -0,0 +1,388 @@
+/* demerror.c - Error handling routines of DEM
+ *
+ * demSetHardErrorInfo
+ * demClientError
+ * demRetry
+ *
+ * Modification History:
+ *
+ * Sudeepb 27-Nov-1991 Created
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+
+PVHE pHardErrPacket;
+PSYSDEV pDeviceChain;
+SAVEDEMWORLD RetryInfo;
+
+CHAR GetDriveLetterByHandle(HANDLE hFile);
+VOID SubstituteDeviceName( PUNICODE_STRING InputDeviceName,
+ LPSTR OutputDriveLetter);
+
+/* demSetHardErrorInfo - Store away harderr related address of DOSKRNL
+ *
+ * Entry
+ * Client (DS:DX) - VHE structure
+ *
+ * Exit
+ * None
+ */
+
+VOID demSetHardErrorInfo (VOID)
+{
+ pHardErrPacket = (PVHE) GetVDMAddr (getDS(),getDX());
+ pDeviceChain = (PSYSDEV) GetVDMAddr(getDS(),getBX());
+ return;
+}
+
+/* demRetry - Retry the operation which last resulted in hard error
+ *
+ * Entry
+ * None
+ *
+ * Exit
+ * None
+ */
+
+VOID demRetry (VOID)
+{
+ULONG iSvc;
+
+ demRestoreHardErrInfo ();
+ iSvc = CurrentISVC;
+
+#if DBG
+ if(iSvc < SVC_DEMLASTSVC && (fShowSVCMsg & DEMSVCTRACE) &&
+ apfnSVC[iSvc] != demNotYetImplemented){
+ sprintf(demDebugBuffer,"demRetry:Retrying %s\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ aSVCNames[iSvc],getAX(),getBX(),getCX(),getDX(),getDI(),getSI());
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP(),getBP());
+ OutputDebugStringOem(demDebugBuffer);
+ }
+
+ if (iSvc >= SVC_DEMLASTSVC || apfnSVC[iSvc] == demNotYetImplemented ){
+ ASSERT(FALSE);
+ setCF(1);
+ setAX(0xff);
+ return;
+ }
+#endif // DBG
+
+ (apfnSVC [iSvc])();
+
+#if DBG
+ if((fShowSVCMsg & DEMSVCTRACE)){
+ sprintf(demDebugBuffer,"demRetry:After %s\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ aSVCNames[iSvc],getAX(),getBX(),getCX(),getDX(),getDI(),getSI());
+ OutputDebugStringOem(demDebugBuffer);
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x CF=%x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP(),getBP(),getCF());
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ return;
+}
+
+/* demClientError - Update client registers to signal error
+ *
+ * Entry
+ * HANDLE hFile; file handle , if none == -1
+ * char chDrive; drive letter , if none == -1
+ *
+ * Exit
+ * Client (CF) = 1
+ * Client (AX) = Error Code
+ *
+ * Notes
+ * the following errors cause hard errors
+ * errors above ERROR_GEN_FAILURE are mapped to general fail by the DOS
+ *
+ *
+ * ERROR_WRITE_PROTECT 19L
+ * ERROR_BAD_UNIT 20L
+ * ERROR_NOT_READY 21L
+ * ERROR_BAD_COMMAND 22L
+ * ERROR_CRC 23L
+ * ERROR_BAD_LENGTH 24L
+ * ERROR_SEEK 25L
+ * ERROR_NOT_DOS_DISK 26L
+ * ERROR_SECTOR_NOT_FOUND 27L
+ * ERROR_OUT_OF_PAPER 28L
+ * ERROR_WRITE_FAULT 29L
+ * ERROR_READ_FAULT 30L
+ * ERROR_GEN_FAILURE 31L
+ * ERROR_WRONG_DISK 34l
+ * ERROR_NO_MEDIA_IN_DRIVE 1112l
+ *
+ */
+
+VOID demClientError (HANDLE hFile, CHAR chDrive)
+{
+ demClientErrorEx (hFile, chDrive, TRUE);
+}
+
+ULONG demClientErrorEx (HANDLE hFile, CHAR chDrive, BOOL bSetRegs)
+{
+ULONG ulErrCode;
+
+ if(!(ulErrCode = GetLastError()))
+ ulErrCode = ERROR_ACCESS_DENIED;
+
+ if ((ulErrCode < ERROR_WRITE_PROTECT || ulErrCode > ERROR_GEN_FAILURE)
+ && ulErrCode != ERROR_WRONG_DISK )
+ {
+#if DBG
+ if (fShowSVCMsg & DEMERROR) {
+ sprintf(demDebugBuffer,"demClientErr: ErrCode=%ld\n", ulErrCode);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ if (bSetRegs) {
+ setAX((USHORT)ulErrCode);
+ }
+ }
+ else { // handle hard error case
+ if (ulErrCode > ERROR_GEN_FAILURE)
+ ulErrCode = ERROR_GEN_FAILURE;
+
+ // Set the hard error flag
+ pHardErrPacket->vhe_fbInt24 = 1;
+
+ // Get the drive letter
+ if (hFile != INVALID_HANDLE_VALUE)
+ chDrive = GetDriveLetterByHandle(hFile);
+
+ pHardErrPacket->vhe_bDriveNum = chDrive == -1
+ ? -1 : toupper(chDrive) - 'A';
+
+ // convert error code to i24 based error.
+ ulErrCode -= ERROR_WRITE_PROTECT;
+ pHardErrPacket->vhe_HrdErrCode = (UCHAR)ulErrCode;
+
+#if DBG
+ if (fShowSVCMsg & DEMERROR) {
+ sprintf(demDebugBuffer,
+ "demClientErr HRDERR: DriveNum=%ld ErrCode=%ld\n",
+ (DWORD)pHardErrPacket->vhe_bDriveNum,
+ (DWORD)pHardErrPacket->vhe_HrdErrCode);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ // Save Away Information for possible retry operation
+ demSaveHardErrInfo ();
+
+
+ }
+
+ if (bSetRegs)
+ setCF(1);
+ return (ulErrCode);
+}
+
+
+
+/*
+ * GetDriveLetterByHandle
+ *
+ * retrieves the drive letter for the file handle
+ * if its a remote drive or fails returns -1
+ */
+CHAR GetDriveLetterByHandle(HANDLE hFile)
+{
+ NTSTATUS Status;
+ ULONG ul;
+ ANSI_STRING AnsiString;
+ FILE_FS_DEVICE_INFORMATION DeviceInfo;
+ IO_STATUS_BLOCK IoStatusBlock;
+ POBJECT_NAME_INFORMATION pObNameInfo;
+ CHAR Buffer[MAX_PATH+sizeof(OBJECT_NAME_INFORMATION)];
+ CHAR ch;
+
+ // if a remote drive return -1 for drive letter
+ Status = NtQueryVolumeInformationFile(
+ hFile,
+ &IoStatusBlock,
+ &DeviceInfo,
+ sizeof(DeviceInfo),
+ FileFsDeviceInformation );
+
+ if (NT_SUCCESS(Status) &&
+ DeviceInfo.Characteristics & FILE_REMOTE_DEVICE )
+ return (CHAR) -1;
+
+ // get the name
+ pObNameInfo = (POBJECT_NAME_INFORMATION)Buffer;
+ Status = NtQueryObject( // get len of name
+ hFile,
+ ObjectNameInformation,
+ pObNameInfo,
+ sizeof(Buffer),
+ &ul);
+
+ if (!NT_SUCCESS(Status))
+ return -1;
+
+ RtlUnicodeStringToAnsiString(&AnsiString, &(pObNameInfo->Name), TRUE);
+ if (strstr(AnsiString.Buffer,"\\Device") == AnsiString.Buffer)
+ SubstituteDeviceName(&(pObNameInfo->Name), AnsiString.Buffer);
+
+ ch = AnsiString.Buffer[0];
+ RtlFreeAnsiString(&AnsiString);
+ return ch;
+}
+
+static WCHAR wszDosDevices[] = L"\\DosDevices\\?:";
+
+/*
+ * SubstituteDeviceName
+ *
+ * lifted this code from the user\harderror hard error thread
+ */
+VOID SubstituteDeviceName( PUNICODE_STRING InputDeviceName,
+ LPSTR OutputDriveLetter )
+{
+ UNICODE_STRING LinkName;
+ UNICODE_STRING DeviceName;
+ OBJECT_ATTRIBUTES Obja;
+ HANDLE LinkHandle;
+ NTSTATUS Status;
+ ULONG i;
+ PWCHAR p;
+ PWCHAR pSlash = L"\\";
+ WCHAR DeviceNameBuffer[MAXIMUM_FILENAME_LENGTH];
+
+ /*
+ * Ensure have trailing backslash
+ */
+
+ if (InputDeviceName->Buffer[(InputDeviceName->Length >>1) - 1] != *pSlash)
+ RtlAppendUnicodeToString(InputDeviceName, pSlash);
+
+ RtlInitUnicodeString(&LinkName,wszDosDevices);
+ p = (PWCHAR)LinkName.Buffer;
+ p = p+12;
+ for(i=0;i<26;i++){
+ *p = (WCHAR)'A' + (WCHAR)i;
+
+ InitializeObjectAttributes(
+ &Obja,
+ &LinkName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL
+ );
+ Status = NtOpenSymbolicLinkObject(
+ &LinkHandle,
+ SYMBOLIC_LINK_QUERY,
+ &Obja
+ );
+ if (NT_SUCCESS( Status )) {
+
+ //
+ // Open succeeded, Now get the link value
+ //
+ DeviceName.Length = 0;
+ DeviceName.MaximumLength = sizeof(DeviceNameBuffer);
+ DeviceName.Buffer = DeviceNameBuffer;
+
+ Status = NtQuerySymbolicLinkObject(
+ LinkHandle,
+ &DeviceName,
+ NULL
+ );
+ NtClose(LinkHandle);
+ if ( NT_SUCCESS(Status) ) {
+
+ if (DeviceName.Buffer[(DeviceName.Length >>1) - 1] != *pSlash)
+ RtlAppendUnicodeToString(&DeviceName, pSlash);
+
+ if ( RtlEqualUnicodeString(InputDeviceName,&DeviceName,TRUE) )
+ {
+ OutputDriveLetter[0]='A'+(WCHAR)i;
+ OutputDriveLetter[1]='\0';
+ return;
+ }
+ }
+ }
+ }
+
+ // just in case we don't find it
+ OutputDriveLetter[0]=(char)-1;
+ OutputDriveLetter[1]='\0';
+ return;
+
+
+}
+
+
+
+
+
+/* demSaveHardErrInfo
+ * demRestoreHardErrInfo
+ *
+ * These two routines are used to preserve all the DOSKRNL registers
+ * which will be needed to retry an SVC handler, in case user opts for
+ * retry in harderr popup. This is a preferred way to handle retry
+ * as it gives the DOSKRNL code the freedom to trash any register
+ * even though it might have to retry the operation. It saves lots
+ * of code bytes in heavily used DOS macro "HrdSVC".
+ *
+ * Entry
+ * None
+ *
+ * Exit
+ * None
+ *
+ * Notes
+ *
+ * 1. Doing things this way means, DOSKRNL cannot change the
+ * registers for retry. Under any circumstances, i can't think
+ * why it would need to do that anyway.
+ *
+ * 2. This mechanism also assumes that DOSKRNL never uses CS,IP,SS,SP
+ * for passing SVC parameters.
+ *
+ * 3. DOS does'nt allow int24 hookers to make any call which comes
+ * to DEM, so using CurrentISVC is safe.
+ *
+ * 4. If an SVC handler can pssibly return a hard error it should never
+ * modify the client registers.
+ */
+
+
+VOID demSaveHardErrInfo (VOID)
+{
+ RetryInfo.ax = getAX();
+ RetryInfo.bx = getBX();
+ RetryInfo.cx = getCX();
+ RetryInfo.dx = getDX();
+ RetryInfo.ds = getDS();
+ RetryInfo.es = getES();
+ RetryInfo.si = getSI();
+ RetryInfo.di = getDI();
+ RetryInfo.bp = getBP();
+ RetryInfo.iSVC = CurrentISVC;
+ return;
+}
+
+
+VOID demRestoreHardErrInfo (VOID)
+{
+ setAX(RetryInfo.ax);
+ setBX(RetryInfo.bx);
+ setCX(RetryInfo.cx);
+ setDX(RetryInfo.dx);
+ setDS(RetryInfo.ds);
+ setES(RetryInfo.es);
+ setSI(RetryInfo.si);
+ setDI(RetryInfo.di);
+ setBP(RetryInfo.bp);
+ CurrentISVC = RetryInfo.iSVC;
+ return;
+}
diff --git a/private/mvdm/dos/dem/demfcb.c b/private/mvdm/dos/dem/demfcb.c
new file mode 100644
index 000000000..275595d1a
--- /dev/null
+++ b/private/mvdm/dos/dem/demfcb.c
@@ -0,0 +1,768 @@
+/* demfcb.c - SVC handlers for misc. FCB operations
+ *
+ * demCloseFCB
+ * demCreateFCB
+ * demDate16
+ * demDeleteFCB
+ * demFCBIO
+ * demGetFileInfo
+ * demOpenFCB
+ * demRenameFCB
+ *
+ * Modification History:
+ *
+ * Sudeepb 09-Apr-1991 Created
+ * Sudeepb 21-Nov-1991 Added FCB based IO functions
+ * Jonle 30-Jun-1994 add wild card support for fcb rename
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+#include <winbase.h>
+#include <mvdm.h>
+
+#define DOT '.'
+#define QMARK '?'
+
+
+/* demDeleteFCB - FCB based File Delete
+ *
+ *
+ * Entry - Client (ES:DI) - Full File Path
+ * Client (AL) - 0 if not extended FCB
+ * Client (DL) - File Attr. to be deleted (valid only if Al !=0 )
+ *
+ * Exit
+ * SUCCESS
+ * Client (CF) = 0
+ *
+ * FAILURE
+ * Client (CF) = 1
+ * Client (AX) = system status code
+ * HARD ERROR
+ * Client (CF) = 1
+ * Client (AX) = 0ffffh
+ *
+ * Notes: Following are the rules for FCB based delete:
+ * 1. If normal FCB than dont allow delete on hidden,system files
+ * 2. if extended FCB than search attributes should include hidden,
+ * system or read-only if that kind of file is to be deleted.
+ */
+
+VOID demDeleteFCB (VOID)
+{
+HANDLE hFind;
+LPSTR lpFileName;
+BYTE bClientAttr=0;
+BOOL fExtendedFCB=FALSE;
+WIN32_FIND_DATA wfBuffer;
+BOOL fSuccess = FALSE;
+DWORD dwAttr;
+USHORT uErr;
+
+CHAR szPath_buffer[_MAX_PATH];
+CHAR szDrive[_MAX_DRIVE];
+CHAR szDir[_MAX_DIR];
+CHAR szFname[_MAX_FNAME];
+CHAR szExt[_MAX_EXT];
+
+DWORD dwErrCode = 0, dwErrCodeKeep = 0;
+
+ // Get the file name
+ lpFileName = (LPSTR) GetVDMAddr (getES(),getDI());
+
+ _splitpath( lpFileName, szDrive, szDir, szFname, szExt );
+
+ // Check if handling extended FCB
+ if(getAL() != 0){
+ bClientAttr = getDL();
+
+ /* Special case for delete volume label (INT 21 Func 13H, Attr = 8H */
+
+ if((bClientAttr == ATTR_VOLUME_ID)) {
+ if((uErr = demDeleteLabel(lpFileName[DRIVEBYTE]))) {
+ setCF(1);
+ setAX(uErr);
+ return;
+ }
+ setAX(0);
+ setCF(0);
+ return;
+ }
+
+
+ bClientAttr &= (ATTR_READ_ONLY | ATTR_HIDDEN | ATTR_SYSTEM);
+ fExtendedFCB = TRUE;
+ }
+
+ // Find the first instance of file
+ if((hFind = FindFirstFileOem (lpFileName,&wfBuffer)) == (HANDLE)-1){
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+
+ // loop for all files which match the name and attributes
+ do {
+ // Check if read_only,hidden or system file
+ if((dwAttr= wfBuffer.dwFileAttributes & (FILE_ATTRIBUTE_READONLY |
+ FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))){
+
+ // if so, try next file if normal FCB case. If extended fcb case
+ // then check if right attributes are given by client.
+ if(fExtendedFCB && ((dwAttr & (DWORD)bClientAttr) == dwAttr)){
+
+ // Yes, right attributes are given. So if the file is read
+ // only then change the modes to normal. Note NT will
+ // delete hidden and system files anyway.
+ if (dwAttr & FILE_ATTRIBUTE_READONLY){
+ strcpy( szPath_buffer, szDrive);
+ strcat( szPath_buffer, szDir);
+ strcat( szPath_buffer, wfBuffer.cFileName);
+
+ // if set attributes fail try next file
+ if(SetFileAttributesOem (szPath_buffer,
+ FILE_ATTRIBUTE_NORMAL) == -1)
+ continue;
+ }
+ }
+ else {
+ dwErrCodeKeep = ERROR_ACCESS_DENIED;
+ continue;
+ }
+ }
+
+ strcpy( szPath_buffer, szDrive);
+ strcat( szPath_buffer, szDir);
+ strcat( szPath_buffer, wfBuffer.cFileName);
+
+ if(DeleteFileOem(szPath_buffer) == FALSE) {
+ dwErrCode = GetLastError();
+
+ SetLastError(dwErrCode);
+
+ if (((dwErrCode >= ERROR_WRITE_PROTECT) &&
+ (dwErrCode <= ERROR_GEN_FAILURE)) ||
+ dwErrCode == ERROR_WRONG_DISK ) {
+ demClientError(INVALID_HANDLE_VALUE, szPath_buffer[0]);
+ return;
+ }
+ continue;
+ }
+
+ // We have deleted at least one file, so report success
+ fSuccess = TRUE;
+
+ } while (FindNextFileOem(hFind,&wfBuffer) == TRUE);
+
+ if(FindClose(hFind) == FALSE)
+ demPrintMsg (MSG_INVALID_HFIND);
+
+ if (fSuccess == TRUE){
+ setCF(0);
+ return;
+ }
+
+ setCF(1);
+
+ if(dwErrCodeKeep)
+ setAX((SHORT) dwErrCodeKeep);
+ else
+ setAX(ERROR_FILE_NOT_FOUND);
+ return;
+}
+
+
+/* demRenameFCB - FCB based Rename file
+ *
+ * Entry - Client (DS:SI) Sources file to be renamed
+ * Client (ES:DI) Destination file to be renamed to
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demRenameFCB (VOID)
+{
+ LPSTR lpSrc,lpDst;
+ DWORD dw;
+ HANDLE hFind;
+ PCHAR pNewDstFilePart;
+ PCHAR pDstFilePart;
+ PCHAR pCurrSrcFilePart;
+ WIN32_FIND_DATA W32FindData;
+ CHAR NewDst[MAX_PATH];
+ CHAR CurrSrc[MAX_PATH];
+
+ lpSrc = (LPSTR) GetVDMAddr (getDS(),getSI());
+ lpDst = (LPSTR) GetVDMAddr (getES(),getDI());
+
+ // Find the first instance of the source file
+ hFind = FindFirstFileOem (lpSrc,&W32FindData);
+ if (hFind == INVALID_HANDLE_VALUE) {
+ dw = GetLastError();
+ if (dw == ERROR_BAD_PATHNAME || dw == ERROR_DIRECTORY ) {
+ SetLastError(ERROR_PATH_NOT_FOUND);
+ }
+ demClientError(INVALID_HANDLE_VALUE, *lpSrc);
+ return;
+ }
+
+ //
+ // Source string consists of the path taken from the original
+ // source specified plus the filename part retrieved from the
+ // FindFile call
+ //
+ strcpy(CurrSrc, lpSrc);
+ pCurrSrcFilePart = strrchr(CurrSrc, '\\');
+ pCurrSrcFilePart++;
+
+ //
+ // Destination string is template for meta character substitution
+ //
+ pDstFilePart = strrchr(lpDst, '\\');
+ pDstFilePart++;
+
+ //
+ // NewDst string is constructed from template and the source string
+ // when doing meta file character substitution.
+ //
+ strcpy(NewDst, lpDst);
+ pNewDstFilePart = strrchr(NewDst, '\\');
+ pNewDstFilePart++;
+
+
+ do {
+ PCHAR pNew;
+ PCHAR pSrc;
+ PCHAR pDst;
+
+ strcpy(pCurrSrcFilePart,
+ W32FindData.cAlternateFileName[0]
+ ? W32FindData.cAlternateFileName
+ : W32FindData.cFileName //// ??? hpfs lfns ????
+ );
+
+ pSrc = pCurrSrcFilePart; // source fname
+ pNew = pNewDstFilePart; // dest fname to be constructed
+ pDst = pDstFilePart; // raw dest fname template (with metas)
+
+ while (*pDst) {
+
+ //
+ // If Found a '?' in Dest template, use character from src
+ //
+ if (*pDst == QMARK) {
+ if (*pSrc != DOT && *pSrc)
+ *pNew++ = *pSrc++;
+ }
+
+ //
+ // if Found a DOT in Dest template, Align DOTS between Src\Dst
+ //
+ else if (*pDst == DOT) {
+ while (*pSrc != DOT && *pSrc) { // mov src to one past DOT
+ pSrc++;
+ }
+ if (*pSrc)
+ pSrc++;
+
+ *pNew++ = DOT;
+ }
+
+ //
+ // Nothing special found, use character from Dest template
+ //
+ else {
+ if (*pSrc != DOT && *pSrc)
+ pSrc++;
+ *pNew++ = *pDst;
+ }
+
+ pDst++;
+ }
+
+ *pNew = '\0';
+
+ //
+ // MoveFile does not return error if dst and src are the same,
+ // but DOS does, so check first..
+ //
+ if (!_stricmp (CurrSrc, NewDst)) {
+ setCF(1);
+ setAX(0x5);
+ FindClose(hFind);
+ return;
+ }
+
+ if (!MoveFileOem(CurrSrc, NewDst)){
+ demClientError(INVALID_HANDLE_VALUE, *lpSrc);
+ FindClose(hFind);
+ return;
+ }
+
+ } while (FindNextFileOem(hFind,&W32FindData));
+
+
+
+ //
+ // If the search on the source string for any reason besides
+ // no more files, then its a genuine error.
+ //
+ dw = GetLastError();
+ if (dw != ERROR_NO_MORE_FILES) {
+ if (dw == ERROR_BAD_PATHNAME || dw == ERROR_DIRECTORY ) {
+ SetLastError(ERROR_PATH_NOT_FOUND);
+ }
+ demClientError(INVALID_HANDLE_VALUE, *lpSrc);
+ }
+ else {
+ setCF(0);
+ }
+
+ FindClose(hFind);
+ return;
+}
+
+
+
+/* demCloseFCB - Close the NT handle associated with the FCB being closed.
+ *
+ * Entry - Client (AX:SI) DWORD NT handle
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demCloseFCB (VOID)
+{
+HANDLE hFile;
+
+ hFile = GETHANDLE (getAX(),getSI());
+
+ if(hFile == 0) {
+
+ setCF(0);
+ return;
+ }
+
+ if (CloseHandle (hFile) == FALSE){
+
+ demClientError(hFile, (CHAR)-1);
+ return;
+
+ }
+ setCF(0);
+ return;
+}
+
+/* demCreateFCB - An FCB is being created get the NT handle.
+ *
+ * Entry - Client (AL) Creation Mode
+ * 00 - Normal File
+ * 01 - Read-only file
+ * 02 - Hidden File
+ * 04 - System file
+ * Client (DS:SI) Full path filename
+ * Client (ES:DI) SFT address
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ * Client (AX:BP) = NT Handle
+ * Client (BX) = Time
+ * Client (CX) = Date
+ * Client (DX:SI) = Size
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demCreateFCB (VOID)
+{
+ demFCBCommon (CREATE_ALWAYS);
+ return;
+}
+
+/* demDate16 - Get the current date/time in DOS FCB format.
+ *
+ * Entry - None
+ *
+ * Exit - Always Success
+ * Client (AX) has date
+ * Client (DX) has time
+ * NOTES:
+ *
+ * DemDate16 returns the current date in AX, current time in DX in this format
+ * AX - YYYYYYYMMMMDDDDD years months days
+ * DX - HHHHHMMMMMMSSSSS hours minutes seconds/2
+ */
+
+VOID demDate16 (VOID)
+{
+SYSTEMTIME TimeDate;
+
+ GetLocalTime(&TimeDate);
+ setAX ( (USHORT) ((TimeDate.wYear << 9 ) |
+ ((TimeDate.wMonth & 0xf) << 5 ) |
+ (TimeDate.wDay & 0x1f))
+ );
+ setDX ( (USHORT) ((TimeDate.wHour << 11) |
+ ((TimeDate.wMinute & 0x3f) << 5) |
+ ((TimeDate.wSecond / 2) & 0x1f))
+ );
+ return;
+}
+
+/* demFCBIO - Carry out the FCB based IO operation.
+ *
+ * Entry - Client (BX) = 1 if read operation, 0 if write
+ * Client (AX:BP) NT Handle
+ * Client (DI:DX) offset to start the operation with
+ * Client (CX) Count of bytes
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ * Client (CX) = counts of bytes read/written
+ * Client (AX:BX) = size
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demFCBIO (VOID)
+{
+HANDLE hFile;
+ULONG CurOffset;
+PVOID pBuf;
+DWORD dwBytesIO;
+DWORD dwSize,dwSizeHigh;
+DWORD dwErrCode;
+
+ hFile = GETHANDLE (getAX(),getBP());
+ CurOffset = (((ULONG)getDI()) << 16) + (ULONG)getDX();
+
+ if (SetFilePointer (hFile,
+ (LONG)CurOffset,
+ NULL,
+ (DWORD)FILE_BEGIN) == -1L){
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+ pBuf = (PVOID)GetVDMAddr(*((PUSHORT)pulDTALocation + 1),
+ *((PUSHORT)pulDTALocation));
+
+ if(getBX()) { // Read Operation
+ if (ReadFile (hFile,
+ pBuf,
+ (DWORD)getCX(),
+ &dwBytesIO,
+ NULL) == FALSE){
+
+ Sim32FlushVDMPointer(*pulDTALocation, getCX(), pBuf, FALSE);
+ Sim32FreeVDMPointer(*pulDTALocation, getCX(), pBuf, FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+ Sim32FlushVDMPointer (*pulDTALocation, getCX(),pBuf, FALSE);
+ Sim32FreeVDMPointer (*pulDTALocation, getCX(), pBuf, FALSE);
+ }
+ else {
+ if (WriteFile (hFile,
+ pBuf,
+ (DWORD)getCX(),
+ &dwBytesIO,
+ NULL) == FALSE) {
+
+ // If disk is full then we should return number of bytes written
+ // AX = 1 and CF = 1
+
+ dwErrCode = GetLastError();
+ if(dwErrCode == ERROR_DISK_FULL) {
+
+ setCX( (USHORT) dwBytesIO);
+ setAX(1);
+ setCF(1);
+ return;
+ }
+
+ SetLastError(dwErrCode);
+
+ demClientError(hFile, (CHAR)-1);
+ return ;
+
+ }
+ }
+
+ // Get File Size
+ if((dwSize = GetFileSize(hFile,&dwSizeHigh)) == -1){
+
+ demPrintMsg(MSG_FILEINFO);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+
+ if(dwSizeHigh) {
+ demPrintMsg(MSG_FILESIZE_TOOBIG);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+
+ // Setup the exit registers
+ setCX((USHORT)dwBytesIO);
+ setBX((USHORT)dwSize);
+ setAX((USHORT)(dwSize >> 16 ));
+ setCF(0);
+ return;
+}
+
+/* demGetFileInfo - Get Misc. file info in FCB format.
+ *
+ * Entry - Client (DS:SI) full path file name
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ * Client (AX) = Attribute of file
+ * Client (CX) = Time stamp of file
+ * Client (DX = Date stamp of file
+ * Client (BX:DI)= Size of file (32 bit)
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demGetFileInfo (VOID)
+{
+HANDLE hFile;
+LPSTR lpFileName;
+WORD wDate,wTime;
+DWORD dwSize,dwAttr;
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getSI());
+
+ if ((hFile = CreateFileOem(lpFileName,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ 0,
+ NULL)) == (HANDLE)-1){
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+
+ // Get Misc. INfo
+ if (demGetMiscInfo (hFile,&wTime, &wDate, &dwSize) == FALSE) {
+ CloseHandle (hFile);
+ return;
+ }
+
+ CloseHandle (hFile);
+
+ if ((dwAttr = GetFileAttributesOem (lpFileName)) == -1) {
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+
+ if (dwAttr == FILE_ATTRIBUTE_NORMAL)
+ dwAttr = 0;
+
+ setAX((USHORT)dwAttr);
+ setCX(wTime);
+ setDX(wDate);
+ setDI((USHORT)dwSize);
+ setBX((USHORT)(dwSize >> 16));
+ return;
+}
+
+
+/* demOpenFCB - An FCB is being opened get the NT handle.
+ *
+ * Entry - Client (AL) Open Mode
+ * Client (DS:SI) Full path filename
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ * Client (AX:BP) = NT Handle
+ * Client (BX) = Time
+ * Client (CX) = Date
+ * Client (DX:SI) = Size
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+
+VOID demOpenFCB (VOID)
+{
+ demFCBCommon (OPEN_EXISTING);
+ return;
+}
+
+/* demFCBCommon - FCB Open/Create.
+ *
+ * Entry - CreateDirective - Open/Create
+ * Client (AL) Open Mode
+ * Client (DS:SI) Full path filename
+ *
+ * Exit - SUCCESS
+ * Client (CF) = 0
+ * Client (AX:BP) = NT Handle
+ * Client (BX) = Time
+ * Client (CX) = Date
+ * Client (DX:SI) = Size
+ *
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ */
+VOID demFCBCommon (ULONG CreateDirective)
+{
+HANDLE hFile;
+LPSTR lpFileName;
+UCHAR uchMode,uchAccess;
+DWORD dwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+WORD wDate,wTime;
+DWORD dwSize,dwAttr=0;
+USHORT uErr;
+SECURITY_ATTRIBUTES sa;
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getSI());
+ uchMode = getAL();
+
+ /* Special case for delete volume label (INT 21 Func 13H, Attr = 8H */
+
+ if((uchMode == ATTR_VOLUME_ID) && (CreateDirective == CREATE_ALWAYS)) {
+ if((uErr = demCreateLabel(lpFileName[DRIVEBYTE],
+ lpFileName+LABELOFF))) {
+ setCF(1);
+ setAX(uErr);
+ return;
+ }
+ setAX(0);
+ setBP(0);
+ setCF(0);
+ return;
+ }
+
+
+ // In create case AL has creation attributes. By default
+ // Access is for read/write and sharing for both. In open
+ // case AL has appropriate access and sharing information.
+ if((CreateDirective == CREATE_ALWAYS) && ((uchMode &0xff) == 0)) {
+
+ dwAttr = FILE_ATTRIBUTE_NORMAL;
+ dwShareMode = FILE_SHARE_WRITE | FILE_SHARE_READ;
+ }
+ else {
+ uchAccess = uchMode & (UCHAR)ACCESS_MASK;
+
+ if (uchAccess == OPEN_FOR_READ)
+ dwDesiredAccess = GENERIC_READ;
+
+ else if (uchAccess == OPEN_FOR_WRITE)
+ dwDesiredAccess = GENERIC_WRITE;
+
+ uchMode = uchMode & (UCHAR)SHARING_MASK;
+
+ switch (uchMode) {
+ case SHARING_DENY_BOTH:
+ dwShareMode = 0;
+ break;
+ case SHARING_DENY_WRITE:
+ dwShareMode = FILE_SHARE_READ;
+ break;
+ case SHARING_DENY_READ:
+ dwShareMode = FILE_SHARE_WRITE;
+ break;
+ }
+ }
+ sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ if ((hFile = CreateFileOem(lpFileName,
+ dwDesiredAccess,
+ dwShareMode | FILE_SHARE_DELETE,
+ &sa,
+ CreateDirective,
+ dwAttr,
+ NULL)) == (HANDLE)-1){
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+
+ // Get Misc. INfo
+ if (demGetMiscInfo (hFile,&wTime, &wDate, &dwSize) == FALSE)
+ return;
+
+ // Setup the exit registers
+ setBX(wTime);
+ setCX(wDate);
+ setBP((USHORT)hFile);
+ setAX((USHORT)((ULONG)hFile >> 16));
+ setSI((USHORT)dwSize);
+ setDX((USHORT)(dwSize >> 16));
+ setCF(0);
+ return;
+}
+
+
+BOOL demGetMiscInfo (hFile, lpTime, lpDate, lpSize)
+HANDLE hFile;
+LPWORD lpTime;
+LPWORD lpDate;
+LPDWORD lpSize;
+{
+FILETIME LastWriteTime,ftLocal;
+DWORD dwSizeHigh=0;
+
+ if(GetFileTime (hFile,NULL,NULL,&LastWriteTime) == -1){
+ demPrintMsg(MSG_FILEINFO);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ CloseHandle (hFile);
+ return FALSE;
+ }
+
+ FileTimeToLocalFileTime (&LastWriteTime,&ftLocal);
+
+ if(FileTimeToDosDateTime(&ftLocal,
+ lpDate,
+ lpTime) == FALSE){
+ demPrintMsg(MSG_FILEINFO);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return FALSE;
+ }
+
+ if((*lpSize = GetFileSize(hFile,&dwSizeHigh)) == -1){
+ demPrintMsg(MSG_FILEINFO);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return FALSE;
+ }
+
+ if(dwSizeHigh) {
+ demPrintMsg(MSG_FILESIZE_TOOBIG);
+ ASSERT(FALSE);
+ demClientError(hFile, (CHAR)-1);
+ return FALSE;
+ }
+ return TRUE;
+}
diff --git a/private/mvdm/dos/dem/demfile.c b/private/mvdm/dos/dem/demfile.c
new file mode 100644
index 000000000..b2dc18357
--- /dev/null
+++ b/private/mvdm/dos/dem/demfile.c
@@ -0,0 +1,1160 @@
+/* demfile.c - SVC handlers for calls where file name is specified.
+ *
+ * demOpen
+ * demCreate
+ * demUnlink
+ * demChMod
+ * demRename
+ *
+ * Modification History:
+ *
+ * Sudeepb 02-Apr-1991 Created
+ *
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+#include <winbase.h>
+#include <vrnmpipe.h>
+#include <nt_vdd.h>
+
+extern PDOSSF pSFTHead;
+
+BOOL (*VrInitialized)(VOID); // POINTER TO FUNCTION
+extern BOOL LoadVdmRedir(VOID);
+extern BOOL IsVdmRedirLoaded(VOID);
+
+BOOL
+IsNamedPipeName(
+ IN LPSTR Name
+ );
+
+BOOL
+IsNamedPipeName(
+ IN LPSTR Name
+ )
+
+/*++
+
+Routine Description:
+
+ Lifted from VDMREDIR.DLL - we don't want to load the entire DLL if we
+ need to check for a named pipe
+
+ Checks if a string designates a named pipe. As criteria for the decision
+ we use:
+
+ \\computername\PIPE\...
+
+ DOS (client-side) can only open a named pipe which is created at a server
+ and must therefore be prefixed by a computername
+
+Arguments:
+
+ Name - to check for (Dos) named pipe syntax
+
+Return Value:
+
+ BOOL
+ TRUE - Name refers to (local or remote) named pipe
+ FALSE - Name doesn't look like name of pipe
+
+--*/
+
+{
+ int CharCount;
+
+
+ if (IS_ASCII_PATH_SEPARATOR(*Name)) {
+ ++Name;
+ if (IS_ASCII_PATH_SEPARATOR(*Name)) {
+ ++Name;
+ CharCount = 0;
+ while (*Name && !IS_ASCII_PATH_SEPARATOR(*Name)) {
+ ++Name;
+ ++CharCount;
+ }
+ if (!CharCount || !*Name) {
+
+ //
+ // Name is \\ or \\\ or just \\name which I don't understand,
+ // so its not a named pipe - fail it
+ //
+
+ return FALSE;
+ }
+
+ //
+ // bump name past next path separator. Note that we don't have to
+ // check CharCount for max. length of a computername, because this
+ // function is called only after the (presumed) named pipe has been
+ // successfully opened, therefore we know that the name has been
+ // validated
+ //
+
+ ++Name;
+ } else {
+ return FALSE;
+ }
+
+ //
+ // We are at <something> (after \ or \\<name>\). Check if <something>
+ // is [Pp][Ii][Pp][Ee][\\/]
+ //
+
+ if (!_strnicmp(Name, "PIPE", 4)) {
+ Name += 4;
+ if (IS_ASCII_PATH_SEPARATOR(*Name)) {
+ return TRUE;
+ }
+ }
+ }
+ return FALSE;
+}
+
+/* demOpen - Open a file
+ *
+ *
+ * Entry - Client (DS:SI) Full path of File
+ * Client (BL) Open Mode
+ * Client (ES:DI) Address of extended attributes buffer
+ * Client (AL) 0 - No EA's ; 1 - EA's specified
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Assigned Open Handle (high word)
+ * Client (BP) = Assigned Open Handle (low word)
+ * Client (DX) = 1 if pipe was opened
+ * Client (BX) = High word of the file size
+ * Client (CX) = low word of the file size
+ *
+ *
+ * FAILURE
+ * CY = 1
+ * AX = system status code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ *
+ * Notes : Extended Attributes is not yet taken care of.
+ */
+
+VOID demOpen (VOID)
+{
+HANDLE hFile;
+LPSTR lpFileName;
+UCHAR uchMode,uchAccess;
+DWORD dwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+DWORD dwShareMode = FILE_SHARE_READ | FILE_SHARE_WRITE;
+BOOL ItsANamedPipe = FALSE;
+BOOL IsFirst;
+LPSTR dupFileName;
+DWORD dwFileSize,dwSizeHigh;
+SECURITY_ATTRIBUTES sa;
+
+ if (getAL()){
+ demPrintMsg (MSG_EAS);
+ return;
+ }
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getSI());
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: Opening File <%s>\n",lpFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ //
+ // the DOS filename must be 'canonicalized': forward slashes (/) must be
+ // converted to back slashes (\) and the filename should be upper-cased
+ // using the current code page info
+ //
+
+ //
+ // BUBUG: Kanji? (/other DBCS)
+ //
+
+ if (strchr(lpFileName, '/')) {
+ lpFileName = _strdup(lpFileName);
+ if (lpFileName == NULL) {
+ SetLastError(ERROR_NOT_ENOUGH_MEMORY);
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+ for (dupFileName = lpFileName; *dupFileName; ++dupFileName) {
+ if (*dupFileName == '/') {
+ *dupFileName = '\\';
+ }
+ }
+ dupFileName = lpFileName;
+ } else {
+ dupFileName = NULL;
+ }
+
+ uchMode = getBL();
+ uchAccess = uchMode & (UCHAR)ACCESS_MASK;
+
+ if (uchAccess == OPEN_FOR_READ)
+ dwDesiredAccess = GENERIC_READ;
+ else if (uchAccess == OPEN_FOR_WRITE)
+ dwDesiredAccess = GENERIC_WRITE;
+
+ uchMode = uchMode & (UCHAR)SHARING_MASK;
+
+ switch (uchMode) {
+ case SHARING_DENY_BOTH:
+ dwShareMode = 0;
+ break;
+ case SHARING_DENY_WRITE:
+ dwShareMode = FILE_SHARE_READ;
+ break;
+ case SHARING_DENY_READ:
+ dwShareMode = FILE_SHARE_WRITE;
+ break;
+ // compatible mode is a special case
+ case SHARING_COMPAT:
+ dwShareMode |= FILE_SHARE_DELETE;
+ //dwDesiredAccess |= DELETE;
+ break;
+ }
+
+ //
+ // slightly new scheme - the redir isn't automatically loaded anymore. We
+ // may perform a named pipe operation before VDMREDIR is loaded. So now we
+ // load VDMREDIR.DLL if the filespec designates a named pipe
+ //
+
+ if (IsNamedPipeName(lpFileName)) {
+ if (!LoadVdmRedir()) {
+ goto errorReturn;
+ }
+ ItsANamedPipe = TRUE;
+
+ //
+ // convert \\<this_computer>\PIPE\foo\bar\etc to \\.\PIPE\...
+ // if we already allocated a buffer for the slash conversion use
+ // that else this call will allocate another buffer (we don't
+ // want to write over DOS memory)
+ //
+
+ lpFileName = VrConvertLocalNtPipeName(dupFileName, lpFileName);
+ if (!lpFileName) {
+ goto errorReturn;
+ }
+ }
+
+ //
+ // open the file. If we think its a named pipe then use FILE_FLAG_OVERLAPPED
+ // because the client might use DosReadAsyncNmPipe or DosWriteAsyncNmPipe
+ // and the only way to accomplish that is to open the named pipe handle in
+ // overlapped I/O mode now
+ //
+
+ // sudeepb 26-Apr-1993 We are retrying opening the file in case
+ // of failure without GENERIC_WRITE because of the incompatibility
+ // of DOS and NT CD ROM driver. DOS CDROM driver ignores the write
+ // bit which we have to fakeout in this way.
+
+ sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+
+ IsFirst = TRUE;
+
+ while (TRUE) {
+ if ((hFile = CreateFileOem(lpFileName,
+ dwDesiredAccess,
+ dwShareMode,
+ &sa,
+ OPEN_EXISTING,
+ ItsANamedPipe ? FILE_FLAG_OVERLAPPED : 0,
+ NULL)) == (HANDLE)-1){
+ if (IsFirst && dwDesiredAccess & GENERIC_WRITE &&
+ IsCdRomFile(lpFileName)) {
+ dwDesiredAccess &= ~GENERIC_WRITE;
+ IsFirst = FALSE;
+ continue;
+ }
+
+errorReturn:
+
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ if (dupFileName) {
+ free(dupFileName);
+ } else if (ItsANamedPipe && lpFileName) {
+ LocalFree(lpFileName);
+ }
+ return;
+ }
+ else
+ break;
+ }
+
+ //
+ // we have to keep some info around when we open a named pipe
+ //
+
+ if (ItsANamedPipe) {
+ VrAddOpenNamedPipeInfo(hFile, lpFileName);
+ setDX(1);
+ }
+ else {
+ if(((dwFileSize=GetFileSize(hFile,&dwSizeHigh)) == (DWORD)-1) ||
+ dwSizeHigh) {
+ CloseHandle (hFile);
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+ setCX ((USHORT)dwFileSize);
+ setBX ((USHORT)(dwFileSize >> 16 ));
+ setDX(0);
+ }
+
+ setBP((USHORT)hFile);
+ setAX((USHORT)((ULONG)hFile >> 16));
+ setCF(0);
+ if (dupFileName) {
+ free(dupFileName);
+ } else if (ItsANamedPipe) {
+ LocalFree(lpFileName);
+ }
+ return;
+}
+
+#define DEM_CREATE 0
+#define DEM_CREATE_NEW 1
+
+/* demCreate - Create a file
+ *
+ *
+ * Entry - Client (DS:SI) Full path of File
+ * Client (CX) Attributes
+ * 00 - Normal File
+ * 01 - Read-only file
+ * 02 - Hidden File
+ * 04 - System file
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Assigned Open Handle (high word)
+ * VSF(BP) = Assigned Open Handle (low word)
+ *
+ * FAILURE
+ * CY = 1
+ * AX = error code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ */
+
+VOID demCreate (VOID)
+{
+ demCreateCommon (DEM_CREATE);
+ return;
+}
+
+/* demCreateNew - Create a New file
+ *
+ *
+ * Entry - Client (DS:SI) Full path of File
+ * Client (CX) Attributes
+ * 00 - Normal File
+ * 01 - Read-only file
+ * 02 - Hidden File
+ * 04 - System file
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Assigned Open Handle (high word)
+ * VSF(BP) = Assigned Open Handle (low word)
+ *
+ * FAILURE
+ * CY = 1
+ * AX = error code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ */
+
+VOID demCreateNew (VOID)
+{
+ demCreateCommon (DEM_CREATE_NEW);
+ return;
+}
+
+/* demDelete - Delete a file
+ *
+ *
+ * Entry - Client (DS:DX) Full path of File
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * CY = 1
+ * AX = system status code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ */
+
+VOID demDelete (VOID)
+{
+LPSTR lpFileName;
+
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: Deleting File<%s>\n",lpFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ if (DeleteFileOem (lpFileName) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+
+/* demChMod - Change the file modes
+ *
+ * Entry - Client (DS:DX) Full path of File
+ * Client (AL) = 0 Get File Modes 1 Set File Modes
+ * Client (CL) new modes
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (CL) = file attributes in get case.
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = Error Code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ * Compatibility Notes:
+ *
+ * ATTR_VOLUME_ID,ATTR_DEVICE and ATTR_DIRECTORY are not supported
+ * by WIN32 call. Although these are unpublished for DOS world also
+ * but still a compatibility requirement.
+ */
+
+VOID demChMod (VOID)
+{
+LPSTR lpFileName;
+DWORD dwAttr;
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: ChMod File <%s>\n",lpFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+
+ if(getAL() == 0){
+ if ((dwAttr = GetFileAttributesOem(lpFileName)) == -1)
+ goto dcerr;
+
+
+ if (dwAttr == FILE_ATTRIBUTE_NORMAL) {
+ dwAttr = 0;
+ }
+ else {
+ dwAttr &= DOS_ATTR_MASK;
+ }
+
+ setCX((USHORT)dwAttr);
+ setCF(0);
+ return;
+ }
+
+ if((dwAttr = getCX()) == 0)
+ dwAttr = FILE_ATTRIBUTE_NORMAL;
+
+ dwAttr &= DOS_ATTR_MASK;
+ if (!SetFileAttributesOem(lpFileName,dwAttr))
+ goto dcerr;
+
+ setCF(0);
+ return;
+
+dcerr:
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+}
+
+
+/* demRename - Rename a file
+ *
+ * Entry - Client (DS:DX) Source File
+ * Client (ES:DI) Destination File
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = Error Code
+ *
+ */
+
+VOID demRename (VOID)
+{
+LPSTR lpSrc,lpDst;
+
+ lpSrc = (LPSTR) GetVDMAddr (getDS(),getDX());
+ lpDst = (LPSTR) GetVDMAddr (getES(),getDI());
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: Rename File <%s> to <%s>\n",lpSrc,lpDst);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ // DOS rename fails accross drives with 11h error code
+ // This following check is OK even for UNC names and SUBST drives.
+ // SUBST drives come to NTVDM as env variables for current directory
+ // and we will treet them just like a network drive and full qualified
+ // path will be sent from NTDOS.
+ if(toupper(lpSrc[0]) != toupper(lpDst[0])) {
+ setCF(1);
+ setAX(0x11);
+ return;
+ }
+
+ // Now check that SRC and DEST are not pointing to the same file.
+ // if they do return error 5.
+ if (!_stricmp (lpSrc, lpDst)) {
+ setCF(1);
+ setAX(0x5);
+ return;
+ }
+
+ if(MoveFileOem(lpSrc,lpDst) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpSrc);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+/* demCreateCommon - Create a file or Craete a new file
+ *
+ *
+ * Entry - flCreateType - DEM_CREATE_NEW create new
+ * DEM_CREATE create
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Assigned Open Handle (high word)
+ * Client (BP) = Assigned Open Handle (low word)
+ *
+ * FAILURE
+ * CY = 1
+ * AX = error code
+ * HARD ERROR
+ * CY = 1
+ * AX = 0FFFFh
+ *
+ */
+
+VOID demCreateCommon (flCreateType)
+ULONG flCreateType;
+{
+HANDLE hFile;
+LPSTR lpFileName;
+LPSTR lpDot;
+DWORD dwAttr;
+DWORD dwFileSize,dwSizeHigh;
+USHORT uErr;
+DWORD dwDesiredAccess;
+SECURITY_ATTRIBUTES sa;
+CHAR cFOTName[MAX_PATH];
+BOOL ttfOnce,IsFirst;
+DWORD dwLastError;
+
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getSI());
+ dwAttr = (DWORD)getCX();
+
+ if ((dwAttr & 0xff) == 0)
+ dwAttr = FILE_ATTRIBUTE_NORMAL;
+
+ /* Special case for set volume label (INT 21 Func 3CH, Attr = 8H */
+
+ if((flCreateType == DEM_CREATE) && (dwAttr == ATTR_VOLUME_ID)) {
+ if((uErr = demCreateLabel(lpFileName[DRIVEBYTE],
+ lpFileName+LABELOFF))) {
+ setCF(1);
+ setAX(uErr);
+ return;
+ }
+ setAX(0);
+ setBP(0); // in this case handle = 0 and if we will
+ setCF(0); // close this handle CF will be 0(!)
+ return;
+ }
+
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: Creating File <%s>\n",lpFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ dwDesiredAccess = GENERIC_WRITE | GENERIC_READ;
+ sa.nLength = sizeof (SECURITY_ATTRIBUTES);
+ sa.lpSecurityDescriptor = NULL;
+ sa.bInheritHandle = TRUE;
+ ttfOnce = TRUE;
+ IsFirst = TRUE;
+
+ while (TRUE) {
+ if ((hFile = CreateFileOem(lpFileName,
+ // create file with delete access and sharing mode
+ // so that anybody can delete it without closing
+ // the file handle returned from create file
+ dwDesiredAccess,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ &sa,
+ flCreateType == DEM_CREATE ? CREATE_ALWAYS : CREATE_NEW,
+ dwAttr,
+ NULL)) == (HANDLE)-1){
+
+ if (IsFirst && dwDesiredAccess & GENERIC_WRITE &&
+ IsCdRomFile(lpFileName)) {
+ dwDesiredAccess &= ~GENERIC_WRITE;
+ IsFirst = FALSE;
+ continue;
+ }
+
+ // APP COMPATABILITY
+ // Some WOW apps installing .TTF or .FON or Fonts fail to create
+ // The file because the font is already open by GDI32 server.
+ // The Stupid install/setup programs don't gracefully handle
+ // this error, they bomb out of the install with retry or cancel
+ // without offering the user a way to ignore the error (which
+ // would be the right thing since the font already exists.
+ // To work around this problem we do a RemoveFontResource here
+ // which causes GDI32 to unmap the file, we then retry
+ // the create. - mattfe june 93
+
+ // If it is a TTF file then we need to remove the font resource
+ // for the .FOT file of the same name
+
+ if (ttfOnce) {
+
+ // Look for the file extension
+
+ lpDot = strrchr(lpFileName,'.');
+
+ if (lpDot) {
+ if ( (!_strcmpi(lpDot,".TTF")) ||
+ (!_strcmpi(lpDot,".FON")) ||
+ (!_strcmpi(lpDot,".FOT")) ) {
+
+ if ( RemoveFontResourceOem(lpFileName) ) {
+ PostMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
+ ttfOnce = FALSE;
+ continue;
+ }
+
+ // We failed to remove the .TTF file probably because
+ // the .FOT file was loaded, so try to remove it
+
+ if (!_strcmpi(lpDot,".TTF")) {
+
+ RtlZeroMemory(cFOTName,sizeof(cFOTName));
+ RtlCopyMemory(cFOTName,lpFileName,(ULONG)lpDot-(ULONG)lpFileName);
+ strcat(cFOTName,".FOT");
+ if ( RemoveFontResourceOem(cFOTName) ) {
+ PostMessage(HWND_BROADCAST, WM_FONTCHANGE, 0, 0);
+ ttfOnce = FALSE;
+ continue;
+ }
+ }
+ }
+ }
+ }
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+ else
+ break;
+ }
+
+ if((dwFileSize=GetFileSize(hFile,&dwSizeHigh) == -1) || dwSizeHigh) {
+ CloseHandle (hFile);
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+ return;
+ }
+ setCX ((USHORT)dwFileSize);
+ setBX ((USHORT)(dwFileSize >> 16 ));
+ setBP((USHORT)hFile);
+ setAX((USHORT)((ULONG)hFile >> 16));
+ setCF(0);
+ return;
+}
+
+BOOL IsCdRomFile (PSTR pszPath)
+{
+ UCHAR pszRootDir[MAX_PATH];
+ UCHAR file_system[MAX_PATH];
+ int i, j;
+
+ // The given path is either a network path or has D: at the start.
+
+ if (!pszPath[0]) {
+ return FALSE;
+ }
+
+ if (pszPath[1] == ':') {
+ pszRootDir[0] = pszPath[0];
+ pszRootDir[1] = ':';
+ pszRootDir[2] = '\\';
+ pszRootDir[3] = 0;
+ } else if (IS_ASCII_PATH_SEPARATOR(pszPath[0]) &&
+ IS_ASCII_PATH_SEPARATOR(pszPath[1])) {
+ j = 0;
+ for (i = 2; pszPath[i]; i++) {
+ if (IS_ASCII_PATH_SEPARATOR(pszPath[i])) {
+ if (++j == 2) {
+ break;
+ }
+ }
+ }
+ memcpy(pszRootDir, pszPath, i);
+ pszRootDir[i] = '\\';
+ pszRootDir[i+1] = 0;
+ } else {
+ return FALSE;
+ }
+
+ if (GetVolumeInformationOem(pszRootDir, NULL, 0, NULL, NULL, NULL,
+ file_system, MAX_PATH) &&
+ !_stricmp(file_system, "CDFS")) {
+
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/* demCheckPath - Check path (for device only)
+ *
+ *
+ * Entry - Client (DS:SI) Full path (with last '\')
+ *
+ * Exit
+ * SUCCESS
+ * Client (CF) = 0
+ *
+ * FAILURE
+ * CF = 1
+ */
+
+VOID demCheckPath (VOID)
+{
+HANDLE hFile;
+LPSTR lpFileName;
+CHAR cDRV;
+CHAR szFileName[MAX_PATH];
+
+ lpFileName = (LPSTR) GetVDMAddr (getDS(),getSI());
+ cDRV = getDL()+'A'-1;
+
+ setDX(0);
+
+ // If we have \dev dir then return OK, DOS always has this directory for
+ // devices.
+
+ if(!lstrcmpi(lpFileName, "\\DEV\\")) {
+ setCF(0);
+ return;
+ }
+
+ sprintf(szFileName, "%c:%sNUL", cDRV, lpFileName);
+
+#if DBG
+ if(fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demfile: Check Pathe <%s>\n",lpFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+
+ // If path exists then we always can open NUL file in this directory,
+ // if path doesn't exists then CreateFile returns INVALID_HANDLE_VALUE
+ //
+
+ if ((hFile = CreateFileOem((LPSTR) szFileName,
+ GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ CREATE_ALWAYS,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL)) == INVALID_HANDLE_VALUE) {
+
+ demClientError(INVALID_HANDLE_VALUE, *lpFileName);
+
+ setCF(1);
+ return;
+ }
+
+ CloseHandle (hFile);
+ setCF(0);
+
+ return;
+}
+
+
+PDOSSFT GetFreeSftEntry(PDOSSF pSfHead, PWORD usSFN)
+{
+ WORD i;
+ PDOSSFT pSft;
+ DWORD ulSFLink;
+
+ *usSFN = 0;
+ for (;;) {
+
+ pSft = (PDOSSFT) &(pSfHead->SFTable);
+ for (i = 0; i < pSfHead->SFCount; i++) {
+ if (pSft[i].SFT_Ref_Count == 0) {
+ *usSFN += i;
+ return (pSft + i);
+ }
+ }
+ *usSFN += pSfHead->SFCount;
+
+ ulSFLink = pSfHead->SFLink;
+ if (ulSFLink & 0xFFFF == 0xFFFF) {
+ break;
+ }
+
+ pSfHead = (PDOSSF) Sim32GetVDMPointer (ulSFLink, 0, 0);
+ }
+
+ return NULL;
+}
+
+
+/** VDDAllocateDosHandle - Allocates an unused DOS file handle.
+ *
+ * ENTRY -
+ * IN pPDB - OPTIONAL: (16:16) address of the PDB for the task
+ * OUT ppSFT - OPTIONAL: Returns a 32-bit flat pointer to the SFT
+ * associated with the allocated file handle.
+ * OUT ppJFT - OPTIONAL: Returns a 32-bit flat pointer to the JFT
+ * associated with the given PDB.
+ *
+ *
+ * EXIT
+ * SUCCESS - Returns the value of the DOS file handle and associated
+ * pointers.
+ * FAILURE - Returns a negative value. The absolute value of this number
+ * is the DOS error code.
+ *
+ * Comments:
+ * This routine searches for an unused DOS file handle and SFT and "opens"
+ * a file. After the successful completion of this call, the returned file
+ * handle and the corresponding SFT will be reserved for the caller's use, and
+ * will be unavailable to other callers trying to issue DOS Open or Create api
+ * calls. It is the caller's responsibility to release this file handle (with
+ * a call to VDDReleaseDosHandle).
+ *
+ * If the pPDB pointer is not supplied (e.g., is NULL), then the current
+ * PDB as reported by DOS will be used.
+ *
+ * Although the ppSFT parameter is technically optional, it is a required
+ * parameter of the VDDAssociateNtHandle call. This was done to avoid a
+ * second handle lookup in the Associate call.
+ *
+ */
+
+SHORT VDDAllocateDosHandle (pPDB,ppSFT,ppJFT)
+ULONG pPDB;
+PDOSSFT* ppSFT;
+PBYTE* ppJFT;
+{
+PDOSPDB pPDBFlat;
+PBYTE pJFT;
+PDOSSFT pSFT;
+USHORT usSFN;
+WORD JFTLength;
+SHORT hDosHandle;
+
+ if (!pPDB) {
+ pPDB = (ULONG) (*pusCurrentPDB) << 16;
+ }
+
+ //
+ // Get the JFT.
+ //
+
+ pPDBFlat = (PDOSPDB) Sim32GetVDMPointer (pPDB, 0, 0);
+ pJFT = (PBYTE) Sim32GetVDMPointer (pPDBFlat->PDB_JFN_Pointer, 0, 0);
+
+
+ //
+ // Check to see if there's a free entry in the JFT.
+ //
+
+ JFTLength = pPDBFlat->PDB_JFN_Length;
+ for (hDosHandle = 0; hDosHandle < JFTLength; hDosHandle++) {
+ if (pJFT[hDosHandle] == 0xFF) {
+ break;
+ }
+ }
+
+ // If no room in the JFT then return ERROR_TOO_MANY_OPEN_FILES
+
+ if (hDosHandle == JFTLength) {
+ return (- ERROR_TOO_MANY_OPEN_FILES);
+ }
+
+ //
+ // Check the SF for a free SFT.
+ //
+
+ if (!(pSFT = GetFreeSftEntry(pSFTHead, &usSFN))) {
+ return (- ERROR_TOO_MANY_OPEN_FILES);
+ }
+
+ pJFT[hDosHandle] = (BYTE)usSFN;
+ RtlZeroMemory((PVOID)pSFT, sizeof(DOSSFT));
+ pSFT->SFT_Ref_Count = 1;
+
+ if (ppSFT) {
+ *ppSFT = (pSFT);
+ }
+
+ if (ppJFT) {
+ *ppJFT = pJFT;
+ }
+
+ return(hDosHandle);
+
+}
+
+/** VDDAssociateNtHandle - Associates the passed NT handle and access flags
+ * the given DOS handle.
+ *
+ * ENTRY -
+ * IN pSFT - flat address of the SFT to be updated
+ * IN hFile32 - NT handle to be stored
+ * IN wAccess - access flags to set in the SFT
+ *
+ * EXIT -
+ * This routine has no return value.
+ *
+ * Comments:
+ * This routine takes the passed NT handle value and stores it in a DOS SFT
+ * so that it can later be retrieved by the VDDRetrieveNtHandle api. The
+ * pointer to the SFT is returned by the VDDAllocateDosHandle api.
+ *
+ * The format of the third parameter is the same as the file access flags
+ * defined for DOS Open File with Handle call (Int 21h, func 3dh), documented
+ * in Microsoft MS-DOS Programmer's Reference. Only the low order byte of
+ * this parameter is used, the upper byte is reserved and must be zero.
+ * The value of this parameter is placed into the passed SFT. This is provided
+ * to allow the caller to define the access rights for the corresponding
+ * DOS file handle.
+ *
+ */
+
+VOID VDDAssociateNtHandle (pSFT,hFile,wAccess)
+PDOSSFT pSFT;
+HANDLE hFile;
+WORD wAccess;
+{
+
+ pSFT->SFT_Mode = wAccess&0x7f; // take out no_inherit bit
+ pSFT->SFT_Attr = 0; // Not used.
+ pSFT->SFT_Flags = (wAccess&0x80) ? 0x1000 : 0; // copy no_inherit bit.
+ pSFT->SFT_Devptr = (ULONG) -1;
+ pSFT->SFT_NTHandle = (ULONG) hFile;
+
+}
+
+
+/** VDDReleaseDosHandle - Release the given DOS file handle.
+ *
+ * ENTRY -
+ * IN pPDB - OPTIONAL: (16:16) address of the PDB for the task
+ * IN hFile - DOS handle (in low byte)
+ *
+ * EXIT -
+ * TRUE - the file handle was released
+ * FALSE - The file handle was not valid or open
+ *
+ * Comments:
+ * This routine updates the DOS file system data areas to free the passed
+ * file handle. No effort is made to determine if this handle was previously
+ * opened by the VDDAllocateDosHandle call. It is the responsibility of the
+ * caller to insure that the given file handle in the specified PDB should
+ * be closed.
+ *
+ * If the pPDB pointer is not supplied (e.g., is NULL), then the current
+ * PDB as reported by DOS will be used.
+ *
+ */
+
+BOOL VDDReleaseDosHandle (pPDB,hFile)
+ULONG pPDB;
+SHORT hFile;
+{
+PBYTE pJFT;
+PDOSSFT pSFT;
+HANDLE ntHandle;
+
+
+ if (!pPDB) {
+ pPDB = (ULONG) (*pusCurrentPDB) << 16;
+ }
+
+ ntHandle = VDDRetrieveNtHandle(pPDB,hFile,(PVOID *)&pSFT,&pJFT);
+ if (!ntHandle) {
+ return(FALSE);
+ }
+
+ pJFT[hFile] = 0xFF;
+
+ // Decrement reference count.
+
+ pSFT->SFT_Ref_Count--;
+
+ return(TRUE);
+
+}
+
+
+/** VDDRetrieveNtHandle - Given a DOS file handle get the associated
+ * NT handle.
+ *
+ * ENTRY -
+ * IN pPDB - OPTIONAL: (16:16) address of the PDB for the task
+ * IN hFile - DOS handle (in low byte)
+ * OUT ppSFT - OPTIONAL: Returns a 32-bit flat pointer to the SFT
+ * associated with the given file.
+ * OUT ppJFT - OPTIONAL: Returns a 32-bit flat pointer to the JFT
+ * associated with the given PDB.
+ *
+ *
+ * EXIT -
+ * SUCCESS - returns 4byte NT handle
+ * FAILURE - returns 0
+ *
+ * Comments:
+ * The value returned by this function will be the NT handle passed in a
+ * previous VDDAssociateNtHandle call. If no previous call is made to the
+ * the Associate api, then the value returned by this function is undefined.
+ *
+ * If the pPDB pointer is not supplied (e.g., is NULL), then the current
+ * PDB as reported by DOS will be used.
+ *
+ * Although the ppSFT parameter is technically optional, it is a required
+ * parameter of the VDDAssociateNtHandle call. This was done to avoid a
+ * second handle lookup in the Associate call.
+ *
+ * The third and fourth parameters are provided to provide the caller the
+ * ability to update the DOS system data areas directly. This may be useful
+ * for performance reasons, or necessary depending on the application. In
+ * general, care must be taken when using these pointers to avoid causing
+ * system integrity problems.
+ *
+ */
+
+HANDLE VDDRetrieveNtHandle (pPDB,hFile,ppSFT,ppJFT)
+ULONG pPDB;
+SHORT hFile;
+PDOSSFT* ppSFT;
+PBYTE* ppJFT;
+{
+PDOSPDB pPDBFlat;
+PDOSSF pSfFlat;
+PDOSSFT pSftFlat;
+PBYTE pJFT;
+USHORT usSFN;
+USHORT usSFTCount;
+ULONG ulSFLink;
+
+ if (!pPDB) {
+ pPDB = (ULONG) (*pusCurrentPDB) << 16;
+ }
+
+ // Get flat pointer to PDB
+ pPDBFlat = (PDOSPDB) Sim32GetVDMPointer(pPDB, 0, 0);
+
+ // Check that handle is within JFT
+ if (hFile >= pPDBFlat->PDB_JFN_Length) {
+ return 0;
+ }
+
+ // Get the pointer to JFT
+ pJFT = (PBYTE) Sim32GetVDMPointer (pPDBFlat->PDB_JFN_Pointer, 0, 0);
+
+ // Get the SFN, remember -1 indicates unused JFT
+ usSFN = (USHORT) pJFT[hFile];
+ if (usSFN == 0xff) {
+ return 0;
+ }
+
+ // Get flat pointer to SF
+ pSfFlat = pSFTHead;
+
+ // Find the right SFT group
+ while (usSFN >= (usSFTCount = pSfFlat->SFCount)){
+ usSFN = usSFN - usSFTCount;
+ ulSFLink = pSfFlat->SFLink;
+ if (ulSFLink & 0xffff == 0xffff)
+ return 0;
+ pSfFlat = (PDOSSF) Sim32GetVDMPointer (ulSFLink, 0, 0);
+ }
+
+ // Get the begining of SFT
+
+ pSftFlat = (PDOSSFT)&(pSfFlat->SFTable);
+
+ // Get the SFN, Finally
+ if(pSftFlat[usSFN].SFT_Ref_Count == 0) {
+ return 0;
+ }
+
+ if (ppSFT) {
+ *ppSFT = (pSftFlat + usSFN);
+ }
+
+ if (ppJFT) {
+ *ppJFT = pJFT;
+ }
+
+ return (HANDLE) pSftFlat[usSFN].SFT_NTHandle;
+}
diff --git a/private/mvdm/dos/dem/demgset.c b/private/mvdm/dos/dem/demgset.c
new file mode 100644
index 000000000..511867cae
--- /dev/null
+++ b/private/mvdm/dos/dem/demgset.c
@@ -0,0 +1,1013 @@
+/* demgset.c - Drive related SVC hanlers.
+ *
+ * demSetDefaultDrive
+ * demGetBootDrive
+ * demGetDriveFreeSpace
+ * demGetDrives
+ * demGSetMediaID
+ * demQueryDate
+ * demQueryTime
+ * demSetDate
+ * demSetTime
+ * demSetDTALocation
+ * demGSetMediaID
+ * demGetDPB
+
+ * Modification History:
+ *
+ * Sudeepb 02-Apr-1991 Created
+ *
+ */
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+#include <mvdm.h>
+#include <winbase.h>
+#include "demdasd.h"
+
+#define BOOTDRIVE_PATH "Software\\Microsoft\\Windows\\CurrentVersion\\Setup"
+#define BOOTDRIVE_VALUE "BootDir"
+
+
+#define SUCCESS 0
+#define NODISK 1
+#define FAILURE 2
+BYTE demGetDpbI(BYTE Drive, DPB UNALIGNED *pDpb);
+
+
+UCHAR PhysicalDriveTypes[26]={0};
+
+extern PDOSSF pSFTHead;
+
+USHORT nDrives = 0;
+CHAR IsAPresent = TRUE;
+CHAR IsBPresent = TRUE;
+
+/* demSetDefaultDrive - Set the default drive
+ *
+ *
+ * Entry - Client (DL) Drive to be set
+ * Client (DS:SI) Current Directory on that drive
+ *
+ * Exit - SUCCESS
+ * Client (CY) = 0
+ * Current Drive Set
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Current Drive Not Set
+ *
+ *
+ * Notes:
+ * Unlike DOS/CRUISER NT just keeps one current directory for a thread.
+ * So here this routine gets the drive to be set default as well as
+ * the current direcotry on that drive and NT does the job in one shot.
+ */
+
+VOID demSetDefaultDrive (VOID)
+{
+LPSTR lpPath;
+
+ lpPath = (LPSTR)GetVDMAddr (getDS(),getSI());
+
+ if(*(PCHAR)lpPath != (CHAR)(getDL()+'A')){
+ demPrintMsg(MSG_DEFAULT_DRIVE);
+ setCF(1);
+ setAX(1);
+ return;
+ }
+
+ if (SetCurrentDirectoryOem (lpPath) == FALSE){
+ demClientError(INVALID_HANDLE_VALUE, *lpPath);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+/* demGetBootDrive - Get the boot drive
+ *
+ *
+ * Entry - None
+ *
+ * Exit - CLIENT (AL) has 1 base boot drive (i.e. C=3)
+ *
+ * We try to read the registry value that indicates the real boot drive. This
+ * should be the location of autoexec.bat, etc. If we can't find the key,
+ * or if the value indicates some drive letter that is not a fixed drive,
+ * then we use a fallback plan of just saying drive C.
+ *
+ */
+
+VOID demGetBootDrive (VOID)
+{
+ HKEY hKey;
+ DWORD retCode;
+ DWORD dwType, cbData = MAX_PATH;
+ CHAR szBootDir[MAX_PATH];
+ BYTE Drive = 3; // default it to 'C:'
+
+ retCode = RegOpenKeyEx (HKEY_LOCAL_MACHINE,
+ BOOTDRIVE_PATH,
+ 0,
+ KEY_EXECUTE, // Requesting read access.
+ &hKey);
+
+
+ if (retCode) {
+ // error: can't find section
+ goto DefaultBootDrive;
+ }
+
+ retCode = RegQueryValueEx(hKey,
+ BOOTDRIVE_VALUE,
+ NULL,
+ &dwType,
+ szBootDir,
+ &cbData);
+
+ RegCloseKey(hKey);
+
+ if (retCode) {
+ // error: can't find key
+ goto DefaultBootDrive;
+ }
+
+ if (GetDriveType(szBootDir) != DRIVE_FIXED) {
+ // error: drive is not a valid boot drive
+ goto DefaultBootDrive;
+ }
+
+ Drive = (BYTE)(tolower(szBootDir[0])-'a')+1;
+
+DefaultBootDrive:
+
+ setAL(Drive);
+ return;
+
+}
+
+/* demGetDriveFreeSpace - Get free Space on the drive
+ *
+ *
+ * Entry - Client (AL) Drive in question
+ * 0 - A: etc.
+ *
+ * Exit -
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AL) = FAT ID byte
+ * Client (BX) = Number of free allocation units
+ * Client (CX) = Sector size
+ * Client (DX) = Total Number of allocation units on disk
+ * Client (SI) = Sectors per allocation unit
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = Error code
+ */
+
+
+VOID demGetDriveFreeSpace (VOID)
+{
+WORD SectorsPerCluster;
+WORD BytesPerSector;
+WORD FreeClusters;
+WORD TotalClusters;
+
+BYTE Drive;
+PBDS pbds;
+
+
+ Drive = getAL();
+ if (demGetDiskFreeSpace(Drive,
+ &BytesPerSector,
+ &SectorsPerCluster,
+ &TotalClusters,
+ &FreeClusters) == FALSE)
+ {
+ demClientError(INVALID_HANDLE_VALUE, (CHAR)(getAL() + 'A'));
+ return;
+ }
+
+ if (pbds = demGetBDS(Drive)) {
+ // if the device is a floppy, reload its bpb
+ if (!(pbds->Flags & NON_REMOVABLE) && !demGetBPB(pbds))
+ pbds->bpb.MediaID = 0xF8;
+
+ setAL(pbds->bpb.MediaID);
+ }
+ else
+ setAL(0);
+
+ setBX(FreeClusters);
+ setCX(BytesPerSector);
+ setDX(TotalClusters);
+ setSI(SectorsPerCluster);
+ setCF(0);
+ return;
+}
+
+
+//
+// retrieves drive type for physical drives
+// substd, redir drives are returned as unknown
+// uses same DriveType definitions as win32 GetDriveTypeW
+//
+UCHAR
+demGetPhysicalDriveType(
+ UCHAR DriveNum)
+{
+ return DriveNum < 26 ? PhysicalDriveTypes[DriveNum] : DRIVE_UNKNOWN;
+}
+
+
+
+
+//
+// worker function for DemGetDrives
+//
+UCHAR GetPhysicalDriveType(UCHAR DriveNum)
+{
+
+ NTSTATUS Status;
+ HANDLE Handle;
+ UCHAR uchRet;
+ OBJECT_ATTRIBUTES Obja;
+ IO_STATUS_BLOCK IoStatusBlock;
+ OEM_STRING OemString;
+ UNICODE_STRING UniString;
+ UNICODE_STRING FileName;
+ FILE_FS_DEVICE_INFORMATION DeviceInfo;
+ CHAR RootName[] = "A:\\";
+ WCHAR wRootName[sizeof(RootName)*sizeof(WCHAR)];
+
+ OemString.Buffer = RootName;
+ OemString.Length = sizeof(RootName) - 1;
+ OemString.MaximumLength = sizeof(RootName);
+ UniString.Buffer = wRootName;
+ UniString.MaximumLength = sizeof(wRootName);
+
+ RootName[0] = 'A' + DriveNum;
+ Status = RtlOemStringToUnicodeString(&UniString,&OemString,FALSE);
+ if (!NT_SUCCESS(Status) ||
+ !RtlDosPathNameToNtPathName_U(wRootName, &FileName, NULL, NULL) )
+ {
+ return DRIVE_UNKNOWN;
+ }
+
+ uchRet = DRIVE_UNKNOWN;
+ InitializeObjectAttributes(&Obja,
+ &FileName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL
+ );
+
+ //
+ // Open the file, excluding directories
+ //
+ FileName.Length -= sizeof(WCHAR);
+ Status = NtOpenFile(
+ &Handle,
+ FILE_READ_ATTRIBUTES | SYNCHRONIZE,
+ &Obja,
+ &IoStatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ FILE_SYNCHRONOUS_IO_NONALERT | FILE_NON_DIRECTORY_FILE
+ );
+
+ // subst drives are not physical drives (actually dirs)
+ if (!NT_SUCCESS(Status)) {
+ goto GPDExitClean;
+ }
+
+ //
+ // Determine if this is a network or disk file system. If it
+ // is a disk file system determine if this is removable or not
+ //
+
+ Status = NtQueryVolumeInformationFile(
+ Handle,
+ &IoStatusBlock,
+ &DeviceInfo,
+ sizeof(DeviceInfo),
+ FileFsDeviceInformation
+ );
+
+ NtClose(Handle);
+ if (!NT_SUCCESS(Status) ||
+ DeviceInfo.Characteristics & FILE_REMOTE_DEVICE)
+ {
+ goto GPDExitClean;
+ }
+
+ switch ( DeviceInfo.DeviceType ) {
+
+ case FILE_DEVICE_CD_ROM:
+ case FILE_DEVICE_CD_ROM_FILE_SYSTEM:
+ uchRet = DRIVE_CDROM;
+ break;
+
+ case FILE_DEVICE_VIRTUAL_DISK:
+ uchRet = DRIVE_RAMDISK;
+ break;
+
+ case FILE_DEVICE_DISK:
+ case FILE_DEVICE_DISK_FILE_SYSTEM:
+ uchRet = DeviceInfo.Characteristics & FILE_REMOVABLE_MEDIA
+ ? DRIVE_REMOVABLE : DRIVE_FIXED;
+ break;
+ }
+
+GPDExitClean:
+ RtlFreeHeap(RtlProcessHeap(), 0, FileName.Buffer);
+
+ return uchRet;
+}
+
+
+
+
+/* demGetDrives - Get number of logical drives in the system
+ * called by ntdos from msinit to get numio
+ * initializes the physical drive list, which consists
+ * of drive types for true physical drives. subst
+ * and redir drives are classed as DRIVE_UNKNOWN.
+ *
+ * Entry - None
+ *
+ * Exit -
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AL) = number of drives
+ *
+ * FAILURE
+ * None
+ */
+
+VOID demGetDrives (VOID)
+{
+ UCHAR DriveType;
+ UCHAR DriveNum;
+ char RootName[]="?:\\";
+ BOOL bCounting;
+
+ //
+ // Initialize the local drive list with Drive type
+ //
+ DriveNum = 0;
+
+ //
+ // Use win32 for A and B, to prevent the fs from trying to
+ // read floppy drives. Make a special check for subst drives
+ // which get returned as DRIVE_FIXED. (subst drives don't qualify
+ // as physical drives).
+ //
+ do {
+
+ RootName[0] = 'A' + DriveNum;
+ DriveType = GetDriveTypeOem(RootName);
+
+ switch (DriveType) {
+ case DRIVE_NO_ROOT_DIR:
+ case DRIVE_REMOTE:
+ DriveType = DRIVE_UNKNOWN;
+ break;
+
+ case DRIVE_FIXED: // check for substd drive ...
+ DriveType = GetPhysicalDriveType(DriveNum);
+ break;
+ }
+
+ PhysicalDriveTypes[DriveNum] = DriveType;
+
+ } while (++DriveNum < 2);
+
+
+ // if A doesn't exist means b also doesn't exist
+ DriveType = PhysicalDriveTypes[0];
+ if (DriveType == DRIVE_UNKNOWN) {
+ IsAPresent = FALSE;
+ IsBPresent = FALSE;
+ }
+
+ DriveType = PhysicalDriveTypes[1];
+ if (DriveType == DRIVE_UNKNOWN) {
+ IsBPresent = FALSE;
+ }
+
+ nDrives = 2;
+ bCounting = TRUE;
+
+ do {
+ DriveType = GetPhysicalDriveType(DriveNum);
+
+ RootName[0] = 'A' + DriveNum;
+
+ PhysicalDriveTypes[DriveNum] = DriveType;
+ if (bCounting) {
+ if (DriveType == DRIVE_REMOVABLE ||
+ DriveType == DRIVE_FIXED ||
+ DriveType == DRIVE_CDROM ||
+ DriveType == DRIVE_RAMDISK )
+ {
+ nDrives++;
+ }
+ else {
+ bCounting = FALSE;
+ }
+ }
+
+ } while (++DriveNum < 26);
+
+ setAX(nDrives);
+ setCF(0);
+ return;
+}
+
+
+/* demQueryDate - Get The Date
+ *
+ *
+ * Entry - None
+ *
+ * Exit -
+ * SUCCESS
+ * Client (DH) - month
+ * Client (DL) - Day
+ * Client (CX) - Year
+ * Client (AL) - WeekDay
+ *
+ * FAILURE
+ * Never
+ */
+
+VOID demQueryDate (VOID)
+{
+SYSTEMTIME TimeDate;
+
+ GetLocalTime(&TimeDate);
+ setDH((UCHAR)TimeDate.wMonth);
+ setDL((UCHAR)TimeDate.wDay);
+ setCX(TimeDate.wYear);
+ setAL((UCHAR)TimeDate.wDayOfWeek);
+ return;
+}
+
+
+/* demQueryTime - Get The Time
+ *
+ *
+ * Entry - None
+ *
+ * Exit -
+ * SUCCESS
+ * Client (CH) - hour
+ * Client (CL) - minutes
+ * Client (DH) - seconds
+ * Client (DL) - hundredth of seconds
+ *
+ * FAILURE
+ * Never
+ */
+
+VOID demQueryTime (VOID)
+{
+SYSTEMTIME TimeDate;
+
+ GetLocalTime(&TimeDate);
+ setCH((UCHAR)TimeDate.wHour);
+ setCL((UCHAR)TimeDate.wMinute);
+ setDH((UCHAR)TimeDate.wSecond);
+ setDL((UCHAR)(TimeDate.wMilliseconds/10));
+ return;
+}
+
+
+/* demSetDate - Set The Date
+ *
+ *
+ * Entry - Client (CX) - Year
+ * Client (DH) - month
+ * Client (DL) - Day
+ *
+ * Exit - SUCCESS
+ * Client (AL) - 00
+ *
+ *
+ * FAILURE
+ * Client (AL) - ff
+ */
+
+VOID demSetDate (VOID)
+{
+SYSTEMTIME TimeDate;
+
+ GetLocalTime(&TimeDate);
+ TimeDate.wYear = (WORD)getCX();
+ TimeDate.wMonth = (WORD)getDH();
+ TimeDate.wDay = (WORD)getDL();
+ if(SetLocalTime(&TimeDate) || GetLastError() == ERROR_PRIVILEGE_NOT_HELD)
+ setAL(0);
+ else
+ setAL(0xff);
+}
+
+
+/* demSetTime - Set The Time
+ *
+ *
+ * Entry - Client (CH) - hour
+ * Client (CL) - minutes
+ * Client (DH) - seconds
+ * Client (DL) - hundredth of seconds
+ *
+ * Exit - None
+ *
+ */
+
+VOID demSetTime (VOID)
+{
+SYSTEMTIME TimeDate;
+
+ GetLocalTime(&TimeDate);
+ TimeDate.wHour = (WORD)getCH();
+ TimeDate.wMinute = (WORD)getCL();
+ TimeDate.wSecond = (WORD)getDH();
+ TimeDate.wMilliseconds = (WORD)getDL()*10;
+ if (SetLocalTime(&TimeDate) || GetLastError() == ERROR_PRIVILEGE_NOT_HELD)
+ setAL(0);
+ else
+ setAL(0xff);
+}
+
+
+/* demSetDTALocation - Set The address of variable where Disk Transfer Address
+ * is stored in NTDOS.
+ *
+ *
+ * Entry - Client (DS:AX) - DTA variable Address
+ * Client (DS:DX) - CurrentPDB address
+ *
+ * Exit - None
+ *
+ */
+
+VOID demSetDTALocation (VOID)
+{
+ PDOSWOWDATA pDosWowData;
+
+ pulDTALocation = (PULONG) GetVDMAddr(getDS(),getAX());
+ pusCurrentPDB = (PUSHORT) GetVDMAddr(getDS(),getDX());
+ pExtendedError = (PDEMEXTERR) GetVDMAddr(getDS(),getCX());
+
+ pDosWowData = (PDOSWOWDATA) GetVDMAddr(getDS(),getSI());
+ pSFTHead = (PDOSSF) GetVDMAddr(getDS(),(WORD)pDosWowData->lpSftAddr);
+ return;
+}
+
+
+/* demGSetMediaID - Get or set volume serial and volume label
+ *
+ * Entry - Client (BL) - Drive Number (0=A;1=B..etc)
+ * Client (AL) - Get or Set (0=Get;1=Set)
+ * Client (DS:DX) - Buffer to return information
+ * (see VOLINFO in dosdef.h)
+ *
+ * Exit - SUCCESS
+ * Client (CF) - 0
+ *
+ * FAILURE
+ * Client (CF) - 1
+ * Client (AX) - Error code
+ *
+ * NOTES:
+ * Currently There is no way for us to set Volume info.
+ */
+
+VOID demGSetMediaID (VOID)
+{
+CHAR Drive;
+PVOLINFO pVolInfo;
+
+ // Set Volume info is not currently supported
+ if(getAL() != 0){
+ setCF(1);
+ return;
+ }
+
+ pVolInfo = (PVOLINFO) GetVDMAddr (getDS(),getDX());
+ Drive = (CHAR)getBL();
+
+ if (!GetMediaId(Drive, pVolInfo)) {
+ demClientError(INVALID_HANDLE_VALUE, (CHAR)(Drive + 'A'));
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+//
+// GetMediaId
+//
+//
+BOOL
+GetMediaId(
+ CHAR DriveNum,
+ PVOLINFO pVolInfo
+ )
+{
+CHAR RootPathName[] = "?:\\";
+CHAR achVolumeName[NT_VOLUME_NAME_SIZE];
+CHAR achFileSystemType[MAX_PATH];
+DWORD adwVolumeSerial[2],i;
+
+
+
+ // Form Root path
+ RootPathName[0] = DriveNum + 'A';
+
+ // Call the supreme source of information
+ if(!GetVolumeInformationOem( RootPathName,
+ achVolumeName,
+ NT_VOLUME_NAME_SIZE,
+ adwVolumeSerial,
+ NULL,
+ NULL,
+ achFileSystemType,
+ MAX_PATH) )
+ {
+ return FALSE;
+ }
+
+ // Fill in user buffer. Remember to convert the null characters
+ // to spaces in different strings.
+
+ STOREDWORD(pVolInfo->ulSerialNumber,adwVolumeSerial[0]);
+
+ strncpy(pVolInfo->VolumeID,achVolumeName,DOS_VOLUME_NAME_SIZE);
+ for(i=0;i<DOS_VOLUME_NAME_SIZE;i++) {
+ if (pVolInfo->VolumeID[i] == '\0')
+ pVolInfo->VolumeID[i] = '\x020';
+ }
+
+ strncpy(pVolInfo->FileSystemType,achFileSystemType,FILESYS_NAME_SIZE);
+ for(i=0;i<FILESYS_NAME_SIZE;i++) {
+ if (pVolInfo->FileSystemType[i] == '\0')
+ pVolInfo->VolumeID[i] = '\x020';
+ }
+
+
+ return TRUE;
+}
+
+
+
+
+
+
+
+
+
+
+
+/* demGetDPB - Get Devicr Parameter Block
+ *
+ * Entry - Client (AL) - Drive Number (0=A;1=B..etc)
+ * Client (DS:DI) - Buffer to return information
+ *
+ * Exit - SUCCESS
+ * Client (CF) - 0
+ *
+ * FAILURE
+ * Client (CF) - 1
+ * Client (AX) - Error code
+ *
+ */
+VOID demGetDPB(VOID)
+{
+BYTE Drive;
+DPB UNALIGNED *pDPB;
+BYTE Result;
+
+ Drive = getAL();
+ pDPB = (PDPB) GetVDMAddr(getDS(), getDI());
+
+ Result = demGetDpbI(Drive, pDPB);
+ if (Result == FAILURE) {
+ demClientError(INVALID_HANDLE_VALUE,(CHAR)(Drive + 'A'));
+ return;
+ }
+ else if (Result == NODISK){
+ setCF(1);
+ return;
+ }
+ setAX(0);
+ setCF(0);
+}
+
+/* demGetDPBI - Worker for GetDPB and GetDPBList
+ *
+ * Entry -
+ * Drive -- Drive Number (0=A;1=B..etc)
+ * pDPB -- pointer to the location to store the dpb
+ *
+ * Exit - SUCCESS
+ * returns success, fills in DPB
+ * FAILURE
+ * returns FAILURE or NODISK
+ */
+BYTE demGetDpbI(BYTE Drive, DPB UNALIGNED *pDPB)
+{
+ WORD SectorSize, ClusterSize, FreeClusters, TotalClusters;
+ PBDS pbds;
+ WORD DirsPerSector;
+
+ if (demGetDiskFreeSpace(Drive,
+ &SectorSize,
+ &ClusterSize,
+ &TotalClusters,
+ &FreeClusters
+ ))
+ {
+ pDPB->Next = (PDPB) 0xFFFFFFFF;
+ pDPB->SectorSize = SectorSize;
+ pDPB->FreeClusters = FreeClusters;
+ pDPB->MaxCluster = TotalClusters + 1;
+ pDPB->ClusterMask = ClusterSize - 1;
+ pDPB->ClusterShift = 0;
+ pDPB->DriveNum = pDPB->Unit = Drive;
+ while ((ClusterSize & 1) == 0) {
+ ClusterSize >>= 1;
+ pDPB->ClusterShift++;
+ }
+ if (pbds = demGetBDS(Drive)) {
+ // if the device is a floppy, reload its bpb
+ if (!(pbds->Flags & NON_REMOVABLE) && !demGetBPB(pbds)) {
+ return NODISK;
+ }
+ pDPB->MediaID = pbds->bpb.MediaID;
+ pDPB->FATSector = pbds->bpb.ReservedSectors;
+ pDPB->FATs = pbds->bpb.FATs;
+ pDPB->RootDirs = pbds->bpb.RootDirs;
+ pDPB->FATSize = pbds->bpb.FATSize;
+ pDPB->DirSector = pbds->bpb.FATs * pbds->bpb.FATSize +
+ pDPB->FATSector;
+ DirsPerSector = pDPB->SectorSize >> DOS_DIR_ENTRY_LENGTH_SHIFT_COUNT;
+ pDPB->FirstDataSector = pDPB->DirSector +
+ ((pDPB->RootDirs + DirsPerSector - 1) /
+ DirsPerSector);
+ pDPB->DriveAddr = 0x123456;
+ pDPB->FirstAccess = 10;
+ }
+ // if we don't know the drive, fake a DPB for it
+ else {
+
+ pDPB->MediaID = 0xF8;
+ pDPB->FATSector = 1;
+ pDPB->FATs = 2;
+ pDPB->RootDirs = 63;
+ pDPB->FATSize = 512;
+ pDPB->DirSector = 1;
+ pDPB->DriveAddr = 1212L * 64L * 1024L + 1212L;
+ pDPB->FirstAccess = 10;
+ }
+ return SUCCESS;
+ }
+ else {
+ return FAILURE;
+ }
+}
+
+/* demGetComputerName - Get computer name
+ *
+ * Entry -
+ * Client (DS:DX) - 16 byte buffer
+ *
+ * Exit - Always Succeeds
+ * DS:DX is filled with the computer name (NULL terminated).
+ */
+
+VOID demGetComputerName (VOID)
+{
+PCHAR pDOSBuffer;
+CHAR ComputerName[MAX_COMPUTERNAME_LENGTH+1];
+DWORD BufferSize = MAX_COMPUTERNAME_LENGTH+1;
+ULONG i;
+
+ pDOSBuffer = (PCHAR) GetVDMAddr(getDS(), getDX());
+
+ if (GetComputerNameOem(ComputerName, &BufferSize)){
+ if (BufferSize <= 15){
+ for (i = BufferSize ; i < 15 ; i++)
+ ComputerName [i] = ' ';
+ ComputerName[15] = '\0';
+ strcpy (pDOSBuffer, ComputerName);
+ }
+ else{
+ strncpy (pDOSBuffer, ComputerName, 15);
+ pDOSBuffer [15] = '\0';
+ }
+ setCX(0x1ff);
+ }
+ else {
+ *pDOSBuffer = '\0';
+ setCH(0);
+ }
+}
+
+#define APPS_SPACE_LIMIT 999990*1024 //999990kb to be on the safe side
+
+BOOL demGetDiskFreeSpace(
+ BYTE Drive,
+ WORD * BytesPerSector,
+ WORD * SectorsPerCluster,
+ WORD * TotalClusters,
+ WORD * FreeClusters
+)
+{
+CHAR chRoot[]="?:\\";
+DWORD dwBytesPerSector;
+DWORD dwSectorsPerCluster;
+DWORD dwTotalClusters;
+DWORD dwFreeClusters;
+DWORD dwLostFreeSectors;
+DWORD dwLostTotalSectors;
+DWORD dwNewSectorPerCluster;
+ULONG ulTotal,ulTemp;
+
+ // sudeepb 22-Jun-1993;
+ // Please read this routine with an empty stomach.
+ // The most common mistake all the apps do when calculating total
+ // disk space or free space is to neglect overflow. Excel/Winword/Ppnt
+ // and lots of other apps use "mul cx mul bx" never taking care
+ // of first multiplication which can overflow. Hence this routine makes
+ // sure that first multiplication will never overflow by fixing
+ // appropriate values. Secondly, all these above apps use signed long
+ // to deal with these free spaces. This puts a limit of 2Gb-1 on
+ // the final outcome of the multiplication. If its above this the setup
+ // fails. So here we have to make sure that total should never exceed
+ // 0x7fffffff. Another bug in above setup program's that if you return
+ // anything more than 999,999KB then they try to put "999,999KB+\0", but
+ // unfortunately the buffer is only 10 bytes. Hence it corrupts something
+ // with the last byte. In our case that is low byte of a segment which
+ // it later tries to pop and GPF. This shrinks the maximum size that
+ // we can return is 999,999KB.
+
+ chRoot[0]=(CHAR)('A'+ Drive);
+
+ if (GetDiskFreeSpaceOem(chRoot,
+ &dwSectorsPerCluster,
+ &dwBytesPerSector,
+ &dwFreeClusters,
+ &dwTotalClusters) == FALSE)
+ return FALSE;
+
+ /*
+ * HPFS and NTFS can give num clusters over dos limit
+ * For these cases increase SectorPerCluster and lower
+ * cluster number accordingly. If the disk is very large
+ * even this isn't enuf, so pass max sizes that dos can
+ * handle.
+ *
+ * The following algorithm is accurate within 1 cluster
+ * (final figure)
+ *
+ */
+ dwLostFreeSectors = dwLostTotalSectors = 0;
+ while (dwTotalClusters + dwLostTotalSectors/dwSectorsPerCluster > 0xFFFF)
+ {
+ if (dwSectorsPerCluster > 0x7FFF)
+ {
+ dwTotalClusters = 0xFFFF;
+ if (dwFreeClusters > 0xFFFF)
+ dwFreeClusters = 0xFFFF;
+ break;
+ }
+
+ if (dwFreeClusters & 1) {
+ dwLostFreeSectors += dwSectorsPerCluster;
+ }
+ if (dwTotalClusters & 1) {
+ dwLostTotalSectors += dwSectorsPerCluster;
+ }
+ dwSectorsPerCluster <<= 1;
+ dwFreeClusters >>= 1;
+ dwTotalClusters >>= 1;
+ }
+
+ if (dwTotalClusters < 0xFFFF) {
+ dwFreeClusters += dwLostFreeSectors/dwSectorsPerCluster;
+ dwTotalClusters += dwLostTotalSectors/dwSectorsPerCluster;
+ }
+
+ if ((dwNewSectorPerCluster = (0xffff / dwBytesPerSector)) < dwSectorsPerCluster)
+ dwSectorsPerCluster = dwNewSectorPerCluster;
+
+ // finally check for 999,999kb
+ ulTemp = (ULONG)((USHORT)dwSectorsPerCluster * (USHORT)dwBytesPerSector);
+
+ // check that total space does'nt exceed 999,999kb
+ ulTotal = ulTemp * (USHORT)dwTotalClusters;
+
+ if (ulTotal > APPS_SPACE_LIMIT){
+ if (ulTemp <= APPS_SPACE_LIMIT)
+ dwTotalClusters = APPS_SPACE_LIMIT / ulTemp;
+ else
+ dwTotalClusters = 1;
+ }
+
+ ulTotal = ulTemp * (USHORT)dwFreeClusters;
+
+ if (ulTotal > APPS_SPACE_LIMIT) {
+ if (ulTemp <= APPS_SPACE_LIMIT)
+ dwFreeClusters = APPS_SPACE_LIMIT / ulTemp;
+ else
+ dwFreeClusters = 1;
+ }
+
+ *BytesPerSector = (WORD) dwBytesPerSector;
+ *SectorsPerCluster = (WORD) dwSectorsPerCluster;
+ *TotalClusters = (WORD) dwTotalClusters;
+ *FreeClusters = (WORD) dwFreeClusters;
+ return TRUE;
+}
+
+/* demGetDPBList - Create the list of dpbs
+ *
+ * Entry -
+ * Client(ES:BP) - points to destination for the dpb list
+ * Exit - SUCCESS
+ * Client (BP) - points to first byte past dpb list
+ * FAILURE
+ * Client (BP) unchanged
+ *
+ * Notes:
+ * For performance reasons, only the drive and unit fields are
+ * filled in. The only application I know of that depends on the
+ * dpb list is go.exe (a shareware app installer). Even if we filled
+ * in the other fields they would likely be incorrect when the app
+ * looked at them, since ntdos.sys never updates the pdbs in the pdb
+ * list
+ */
+VOID demGetDPBList (VOID)
+{
+ UCHAR DriveType;
+ UCHAR DriveNum;
+ DPB UNALIGNED *pDpb;
+ USHORT usDpbOffset, usDpbSeg;
+
+ usDpbOffset = getBP();
+ usDpbSeg = getES();
+ pDpb = (PDPB)GetVDMAddr(usDpbSeg, usDpbOffset);
+
+ //
+ // Iterate over all of the drive letters.
+ //
+ DriveNum = 0;
+ do {
+ DriveType = demGetPhysicalDriveType(DriveNum);
+
+ //
+ // Only include the local non cd rom drives ?? ramdisk ???
+ //
+ if ((DriveType == DRIVE_REMOVABLE) || (DriveType == DRIVE_FIXED)) {
+
+ //
+ // Fake the Dpb for the drive
+ //
+ pDpb->DriveNum = pDpb->Unit = DriveNum;
+
+ //
+ // Link it to the next dpb
+ //
+ usDpbOffset += sizeof(DPB);
+ pDpb->Next = (PDPB)(((ULONG)usDpbSeg) << 16 | usDpbOffset);
+
+ //
+ // Advance to the next dpb
+ //
+ pDpb += 1;
+
+ ASSERT(usDpbOffset < 0xFFFF);
+ }
+
+ } while (++DriveNum < 26);
+
+ //
+ // Terminate the list if necessary
+ //
+ if (usDpbOffset != getBP()) {
+ pDpb -= 1;
+ pDpb->Next = (PDPB)-1;
+ }
+
+ //
+ // Return the new free space pointer
+ //
+ setBP(usDpbOffset);
+}
diff --git a/private/mvdm/dos/dem/demhndl.c b/private/mvdm/dos/dem/demhndl.c
new file mode 100644
index 000000000..7d6fd5045
--- /dev/null
+++ b/private/mvdm/dos/dem/demhndl.c
@@ -0,0 +1,605 @@
+/* demhndl.c - SVC handlers for calls where file handle is provided.
+ *
+ * demClose
+ * demRead
+ * demWrite
+ * demChgFilePtr
+ * demFileTimes
+ *
+ * Modification History:
+ *
+ * Sudeepb 02-Apr-1991 Created
+ * rfirth 25-Sep-1991 Added Vdm Redir stuff for named pipes
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+#include <io.h>
+#include <fcntl.h>
+#include <vrnmpipe.h>
+#include <exterr.h>
+#include <mvdm.h>
+
+BOOL (*VrInitialized)(VOID); // POINTER TO FUNCTION
+extern BOOL IsVdmRedirLoaded(VOID);
+
+/* demClose - Close a file
+ *
+ *
+ * Entry - Client (AX:BP) File Handle
+ * Client (CX:DX) File position (if -1 no seek needed before closing
+ * the handle.
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demClose (VOID)
+{
+HANDLE hFile;
+LONG lLoc;
+USHORT usDX,usCX;
+
+ hFile = GETHANDLE (getAX(),getBP());
+
+ if (hFile == 0) {
+ setCF (0);
+ return;
+ }
+
+ usCX = getCX();
+ usDX = getDX();
+
+ if (!((usCX == (USHORT)-1) && (usDX == (USHORT)-1))) {
+ lLoc = (LONG)((((int)usCX) << 16) + (int)usDX);
+ if (SetFilePointer (hFile,
+ lLoc,
+ NULL,
+ FILE_BEGIN) == -1L){
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+ }
+
+ if (CloseHandle (hFile) == FALSE){
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+
+ //
+ // if the redir TSR is being run in this VDM session, check if the handle
+ // being closed references a named pipe - we have to delete some info
+ // that we keep for the open named pipe
+ //
+
+ if (IsVdmRedirLoaded()) {
+ VrRemoveOpenNamedPipeInfo(hFile);
+ }
+
+ setCF(0);
+ return;
+}
+
+
+/* demRead - Read a file
+ *
+ *
+ * Entry - Client (AX:BP) File Handle
+ * Client (CX) Count to read
+ * Client (DS:DX) Buffer Address
+ * Client (BX:SI) = current file pointer location.
+ * ZF = 1 if seek is not needed prior to read.
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Count of bytes read
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demRead (VOID)
+{
+HANDLE hFile;
+LPVOID lpBuf;
+DWORD dwBytesRead;
+USHORT usDS,usDX;
+DWORD dwReadError;
+BOOL ok;
+UCHAR locus, action, class;
+LONG lLoc;
+
+ hFile = GETHANDLE (getAX(),getBP());
+ usDS = getDS();
+ usDX = getDX();
+ lpBuf = (LPVOID) GetVDMAddr (usDS,usDX);
+
+ //
+ // if this handle is a named pipe then use VrReadNamedPipe since we have
+ // to perform an overlapped read, and wait on the event handle for completion
+ // even though we're still doing synchronous read
+ //
+
+ if (IsVdmRedirLoaded()) {
+ if (VrIsNamedPipeHandle(hFile)) {
+
+ //
+ // named pipe read always sets the extended error information in the
+ // DOS data segment. This is the only way we can return bytes read
+ // information and a more data indication
+ //
+
+ ok = VrReadNamedPipe(hFile,
+ lpBuf,
+ (DWORD)getCX(),
+ &dwBytesRead,
+ &dwReadError
+ );
+ switch (dwReadError) {
+ case NO_ERROR:
+ locus = action = class = 0;
+ break;
+
+ case ERROR_NO_DATA:
+ case ERROR_MORE_DATA:
+ locus = errLOC_Net;
+ class = errCLASS_TempSit;
+ action = errACT_Retry;
+ break;
+
+ default:
+
+ //
+ // any error other than the specific ones we handle here should be
+ // correctly handled by DOS
+ //
+
+ goto readFailureExit;
+ }
+ pExtendedError->ExtendedErrorLocus = locus;
+ STOREWORD(pExtendedError->ExtendedError, (WORD)dwReadError);
+ pExtendedError->ExtendedErrorAction = action;
+ pExtendedError->ExtendedErrorClass = class;
+ if (ok) {
+ goto readSuccessExit;
+ } else {
+ goto readFailureExit;
+ }
+ }
+ }
+
+ //
+ // if the redir TSR is not loaded, or the handle is not a named pipe then
+ // perform normal file read
+ //
+
+ if (!getZF()) {
+ ULONG Zero = 0;
+ lLoc = (LONG)((((int)getBX()) << 16) + (int)getSI());
+ if ((SetFilePointer (hFile,
+ lLoc,
+ &Zero,
+ FILE_BEGIN) == -1L) &&
+ (GetLastError() != NO_ERROR)) {
+ goto readFailureExit;
+ }
+
+ }
+
+ if (ReadFile (hFile,
+ lpBuf,
+ (DWORD)getCX(),
+ &dwBytesRead,
+ NULL) == FALSE){
+
+readFailureExit:
+ Sim32FlushVDMPointer (((ULONG)(usDS << 16)) | usDX, getCX(),
+ (PBYTE )lpBuf, FALSE);
+ Sim32FreeVDMPointer (((ULONG)(usDS << 16)) | usDX, getCX(),
+ (PBYTE )lpBuf, FALSE);
+
+ if (GetLastError() == ERROR_BROKEN_PIPE) {
+ setAX(0);
+ setCF(0);
+ return;
+ }
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+readSuccessExit:
+ Sim32FlushVDMPointer (((ULONG)(usDS << 16)) | usDX, getCX(),
+ (PBYTE )lpBuf, FALSE);
+ Sim32FreeVDMPointer (((ULONG)(usDS << 16)) | usDX, getCX(),
+ (PBYTE )lpBuf, FALSE);
+ setCF(0);
+ setAX((USHORT)dwBytesRead);
+ return;
+}
+
+
+
+/* demWrite - Write to a file
+ *
+ *
+ * Entry - Client (AX:BP) File Handle
+ * Client (CX) Count to write
+ * Client (DS:DX) Buffer Address
+ * Client (BX:SI) = current file pointer location.
+ * ZF = 1 if seek is not needed prior to write.
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (AX) = Count of bytes written
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demWrite (VOID)
+{
+HANDLE hFile;
+DWORD dwBytesWritten;
+LPVOID lpBuf;
+LONG lLoc;
+DWORD dwErrCode;
+
+ hFile = GETHANDLE (getAX(),getBP());
+ lpBuf = (LPVOID) GetVDMAddr (getDS(),getDX());
+
+
+ //
+ // if this handle is a named pipe then use VrWriteNamedPipe since we have
+ // to perform an overlapped write, and wait on the event handle for completion
+ // even though we're still doing synchronous write
+ //
+
+ if (IsVdmRedirLoaded()) {
+ if (VrIsNamedPipeHandle(hFile)) {
+ if (VrWriteNamedPipe(hFile, lpBuf, (DWORD)getCX(), &dwBytesWritten)) {
+ goto writeSuccessExit;
+ } else {
+ goto writeFailureExit;
+ }
+ }
+ }
+
+ //
+ // if the redir TSR is not loaded, or the handle is not a named pipe then
+ // perform normal file write
+ //
+
+
+ if (!getZF()) {
+ ULONG Zero = 0;
+ lLoc = (LONG)((((int)getBX()) << 16) + (int)getSI());
+ if ((SetFilePointer (hFile,
+ lLoc,
+ &Zero,
+ FILE_BEGIN) == -1L) &&
+ (GetLastError() != NO_ERROR)) {
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+ }
+
+ // In DOS CX=0 truncates or extends the file to current file pointer.
+ if (getCX() == 0){
+ if (SetEndOfFile(hFile) == FALSE){
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+ setCF (0);
+ return;
+ }
+
+ if (WriteFile (hFile,
+ lpBuf,
+ (DWORD)getCX(),
+ &dwBytesWritten,
+ NULL) == FALSE){
+
+ // If disk is full then we should return 0 byte written and CF is clear
+ dwErrCode = GetLastError();
+ if(dwErrCode == ERROR_DISK_FULL) {
+
+ setCF(0);
+ setAX(0);
+ return;
+ }
+
+ SetLastError(dwErrCode);
+
+writeFailureExit:
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+writeSuccessExit:
+ setCF(0);
+ setAX((USHORT)dwBytesWritten);
+ return;
+}
+
+
+
+/* demChgFilePtr - Change File Pointer
+ *
+ *
+ * Entry - Client (AX:BP) File Handle
+ * Client (CX:DX) New Location
+ * Client (BL) Positioning Method
+ * 0 - File Absolute
+ * 1 - Relative to Current Position
+ * 2 - Relative to end of file
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * Client (DX:AX) = New Location
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = system status code
+ *
+ */
+
+VOID demChgFilePtr (VOID)
+{
+HANDLE hFile;
+LONG lLoc;
+DWORD dwLoc;
+
+#if (FILE_BEGIN != 0 || FILE_CURRENT != 1 || FILE_END !=2)
+ #error "Win32 values not DOS compatible"
+#
+
+#endif
+ hFile = GETHANDLE (getAX(),getBP());
+ lLoc = (LONG)((((int)getCX()) << 16) + (int)getDX());
+
+ if ((dwLoc = SetFilePointer (hFile,
+ lLoc,
+ NULL,
+ (DWORD)getBL())) == -1L){
+ demClientError(hFile, (CHAR)-1);
+ return ;
+ }
+
+ setCF(0);
+ setAX((USHORT)dwLoc);
+ setDX((USHORT)(dwLoc >> 16));
+ return;
+}
+
+
+/* demFileTimes - Change or Get File date and times
+ *
+ * GET TIME (Client(BL) = 0)
+ *
+ * Entry
+ * Client(AX:BP)
+ * NT Handle
+ *
+ * Exit
+ * SUCCESS
+ * Client(CF) = 0
+ * Client(CX) = File time
+ * Client(DX) = File date
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ *
+ * SET TIME (Client(BL) = 1)
+ *
+ * Entry
+ * Client(AX:BP)
+ * Nt Handle
+ * Client(CX)
+ * New file time
+ * Client(DX)
+ * New file date
+ *
+ * Exit
+ * SUCCESS
+ * Client(CF) = 0
+ * FAILURE
+ * Client(CF) = 1
+ * Client(AX) = error code
+ *
+ * Hard Error Exit
+ * Client(CF) = 1
+ * Client(AX) = 0FFFFh
+ *
+ * GET TIME For device (Client(BL) = 2)
+ *
+ * Entry
+ * Client(AX:BP)
+ * NT Handle - not in use
+ *
+ * Exit
+ * SUCCESS
+ * Client(CF) = 0
+ * Client(CX) = Current time
+ * Client(DX) = Curren date
+ * FAILURE
+ * None
+ *
+ */
+
+VOID demFileTimes (VOID)
+{
+HANDLE hFile;
+WORD wDate,wTime;
+FILETIME LastWriteTime,ftTemp;
+SYSTEMTIME stCurrentTime;
+UCHAR uchOpt = 0;
+
+ uchOpt = getBL();
+ if(uchOpt != 2)
+ hFile = GETHANDLE(getAX(),getBP());
+
+ if(uchOpt != 1){
+
+ if(!uchOpt) {
+ if(GetFileTime (hFile,NULL,NULL,&LastWriteTime) == -1){
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+ }
+ else { // Device case. We should return current time
+ GetSystemTime(&stCurrentTime);
+ SystemTimeToFileTime(&stCurrentTime, &LastWriteTime);
+
+ }
+
+ FileTimeToLocalFileTime (&LastWriteTime,&ftTemp);
+ if(FileTimeToDosDateTime(&ftTemp,
+ (LPWORD)&wDate,
+ (LPWORD)&wTime) == FALSE){
+ demPrintMsg(MSG_TIMEDATE);
+ setCF(0);
+ return;
+ }
+
+ setCX(wTime);
+ setDX(wDate);
+ setCF(0);
+ return;
+ }
+
+ wDate = getDX();
+ wTime = getCX();
+
+ if (DosDateTimeToFileTime(wDate,
+ wTime,
+ &LastWriteTime) == FALSE){
+ demPrintMsg(MSG_TIMEDATE);
+ setCF(0);
+ return;
+ }
+ LocalFileTimeToFileTime (&LastWriteTime,&ftTemp);
+
+ if(!SetFileTime(hFile,NULL,NULL,&ftTemp)){
+ demClientError(hFile, (CHAR)-1);
+ return;
+ }
+
+ setCF(0);
+ return;
+}
+
+/* DemCommit -- Commit File(Flush file buffers)
+ *
+ * Entry - Client (AX:BP) File Handle
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * buffer flushed
+ *
+ * FAILURE
+ * Client (CY) = 1
+ *
+ */
+VOID demCommit(VOID)
+{
+ HANDLE hFile;
+ BOOL bRet;
+
+ hFile = GETHANDLE(getAX(),getBP());
+ bRet = FlushFileBuffers(hFile);
+#if DBG
+ if (!bRet) {
+
+ //
+ // FlushFileBuffers fails with access denied if the handle
+ // is open for read-only access, however it's not an error
+ // for DOS.
+ //
+
+ DWORD LastError;
+ LastError = GetLastError();
+
+ if (LastError != ERROR_ACCESS_DENIED) {
+ sprintf(demDebugBuffer,
+ "ntvdm demCommit warning: FlushFileBuffers error %d\n",
+ LastError);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+ }
+#endif
+
+ setCF(0);
+
+}
+
+/* function to check if new data has been written to the file or
+ if the file has been marked EOF
+
+ Input: Client (AX:BP) = 32bits NT file handle
+ Output: Client ZF = 1 if new data or EOF
+ CF = 1 if EOF
+*/
+
+
+VOID demPipeFileDataEOF(VOID)
+{
+ HANDLE hFile;
+ BOOL fEOF;
+ BOOL DataEOF;
+ DWORD FileSizeLow;
+ DWORD FileSizeHigh;
+
+ hFile = GETHANDLE(getAX(), getBP());
+
+ DataEOF = cmdPipeFileDataEOF(hFile, &fEOF);
+ if (fEOF) {
+ //EOF, get file size, max size = 32bits
+ FileSizeLow = GetFileSize(hFile, &FileSizeHigh);
+ setAX((WORD)(FileSizeLow / 0x10000));
+ setBP((WORD)FileSizeLow);
+ setCF(1); // EOF is encountered
+ }
+ else
+ setCF(0);
+ setZF(DataEOF ? 0 : 1);
+}
+
+/* function to check if the file has been marked EOF
+ Input: Client(AX:BP) = 32bits NT file handle
+ Output: Client CY = 1 if EOF
+*/
+
+VOID demPipeFileEOF(VOID)
+{
+ HANDLE hFile;
+ DWORD FileSizeLow;
+ DWORD FileSizeHigh;
+
+ hFile = GETHANDLE(getAX(), getBP());
+ if (cmdPipeFileEOF(hFile)) {
+ FileSizeLow = GetFileSize(hFile, &FileSizeHigh);
+ setAX((WORD)(FileSizeLow / 0x10000)); // file size in 32bits
+ setBP((WORD)FileSizeLow);
+ setCF(1); //EOF is encountered
+ }
+ else
+ setCF(0);
+}
diff --git a/private/mvdm/dos/dem/demioctl.c b/private/mvdm/dos/dem/demioctl.c
new file mode 100644
index 000000000..00999f273
--- /dev/null
+++ b/private/mvdm/dos/dem/demioctl.c
@@ -0,0 +1,583 @@
+/* demioctl.c - SVC handlers for DOS IOCTL calls
+ *
+ * demIOCTL
+ *
+ * Modification History:
+ *
+ * Sudeepb 23-Apr-1991 Created
+ *
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+#include <winbase.h>
+#include "demdasd.h"
+
+PFNSVC apfnSVCIoctl [] = {
+ demIoctlInvalid, // IOCTL_GET_DEVICE_INFO 0
+ demIoctlInvalid, // IOCTL_SET_DEVICE_INFO 1
+ demIoctlInvalid, // IOCTL_READ_HANDLE 2
+ demIoctlInvalid, // IOCTL_WRITE_HANDLE 3
+ demIoctlInvalid, // IOCTL_READ_DRIVE 4
+ demIoctlInvalid, // IOCTL_WRITE_DRIVE 5
+ demIoctlInvalid, // IOCTL_GET_INPUT_STATUS 6
+ demIoctlInvalid, // IOCTL_GET_OUTPUT_STATUS 7
+ demIoctlChangeable, // IOCTL_CHANGEABLE 8
+ demIoctlChangeable, // IOCTL_DeviceLocOrRem 9
+ demIoctlInvalid, // IOCTL_HandleLocOrRem a
+ demIoctlInvalid, // IOCTL_SHARING_RETRY b
+ demIoctlInvalid, // GENERIC_IOCTL_HANDLE c
+ demIoctlDiskGeneric, // GENERIC_IOCTL d
+ demIoctlInvalid, // IOCTL_GET_DRIVE_MAP e
+ demIoctlInvalid, // IOCTL_SET_DRIVE_MAP f
+ demIoctlInvalid, // IOCTL_QUERY_HANDLE 10
+ demIoctlDiskQuery, // IOCTL_QUERY_BLOCK 11
+ demIoctlInvalid
+
+};
+
+MEDIA_TYPE MediaForFormat;
+
+#define MAX_IOCTL_INDEX (sizeof (apfnSVCIoctl) / sizeof (PFNSVC))
+
+
+/* demIOCTL - DOS IOCTLS
+ *
+ *
+ * Entry - depends on the subfunction. See dos\ioctl.asm
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * for other registers see the corresponding function header
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * for other registers see the corresponding function header
+ */
+
+VOID demIOCTL (VOID)
+{
+ULONG iIoctl;
+
+ iIoctl = (ULONG) getAL();
+
+#if DBG
+ if (iIoctl >= MAX_IOCTL_INDEX){
+ setAX((USHORT) ERROR_INVALID_FUNCTION);
+ setCF(1);
+ return;
+ }
+#endif
+
+ (apfnSVCIoctl [iIoctl])();
+
+ return;
+}
+
+/* demIoctlChangeable - Is drive removeable (subfunc 8) or remote (subfunc 9)
+ *
+ *
+ * Entry - Client (AL) - subfunc
+ * Client (BL) - drive number (a=0,b=1 etc)
+ *
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * if subfunc 8
+ * AX = 0 if removeable media
+ * AX = 1 otherwise
+ * if subfunc 9
+ * DX = 0 if not remote
+ * DX = 1000 if remote
+ *
+ * FAILURE
+ * Client (CY) = 1
+ * Client (AX) = error code
+ *
+ * CDROM drives are considered remote drives with write protection
+ * by dos. (full support requires a VDD)
+ */
+
+VOID demIoctlChangeable (VOID)
+{
+ULONG ulSubFunc;
+
+CHAR RootPathName[] = "?:\\";
+DWORD DriveType;
+UCHAR DriveNum;
+
+ ulSubFunc = getAL();
+
+ // Form Root path
+ DriveNum = getBL();
+ DriveType = demGetPhysicalDriveType(DriveNum);
+ if (DriveType == DRIVE_UNKNOWN) {
+ RootPathName[0] = (CHAR)('A' + DriveNum);
+ DriveType = GetDriveTypeOem(RootPathName);
+ }
+
+ if (DriveType == DRIVE_UNKNOWN || DriveType == DRIVE_NO_ROOT_DIR){
+ setAX (ERROR_INVALID_DRIVE);
+ setCF(1);
+ return;
+ }
+
+ if (ulSubFunc == IOCTL_CHANGEABLE){
+ if(DriveType == DRIVE_REMOVABLE)
+ setAX(0);
+ else
+ setAX(1); // includes CDROM drives
+ }
+ else {
+ setAL(0);
+ if (DriveType == DRIVE_REMOTE || DriveType == DRIVE_CDROM)
+ setDX(0x1000);
+ else
+ // We have to return 800 rather then 0 as Dos Based Quatrro pro
+ // behaves very badly if this bit is not set. sudeepb 15-Jun-1994
+ setDX(0x800);
+ }
+ setCF(0);
+ return;
+
+}
+
+
+
+/* demIoctlDiskGeneric - Block device generic ioctl
+ *
+ *
+ * Entry - Client (BL) = drive number (a=0;b=1 etc)
+ * (CL) = subfucntion code
+ * (SI:DX) pointer to parameter block.
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * (AX) = 0
+ * parameter block updated
+ * FAILURE
+ * Client (CY) = 1
+ * (AX) = error code
+ */
+
+VOID demIoctlDiskGeneric (VOID)
+
+{
+ BYTE Code, Drive;
+ PDEVICE_PARAMETERS pdms;
+ PMID pmid;
+ PRW_BLOCK pRW;
+ PFMT_BLOCK pfmt;
+ PBDS pbds;
+ DWORD Head, Cylinder;
+ DWORD TrackSize;
+ DWORD Sectors, StartSector;
+ BYTE BootSector[BYTES_PER_SECTOR];
+ PBOOTSECTOR pbs;
+ PBPB pBPB;
+ PACCESSCTRL pAccessCtrl;
+ WORD SectorSize, ClusterSize, TotalClusters, FreeClusters;
+
+ Code = getCL();
+ Drive = getBL();
+
+ if (Code == IOCTL_GETMEDIA) {
+ pmid = (PMID) GetVDMAddr(getSI(), getDX());
+ if (!GetMediaId(Drive, (PVOLINFO)pmid)) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ }
+ else {
+ setAX(0);
+ setCF(0);
+ }
+
+ return;
+ }
+
+
+
+ // if we don't know the drive, bail out
+ if((pbds = demGetBDS(Drive)) == NULL && Code != IOCTL_GETDPM) {
+ if (!demIsDriveFloppy(Drive))
+ host_direct_access_error(NOSUPPORT_HARDDISK);
+ setAX(DOS_FILE_NOT_FOUND);
+ setCF(1);
+ return;
+ }
+ switch (Code) {
+ case IOCTL_SETDPM:
+
+ pdms = (PDEVICE_PARAMETERS)GetVDMAddr(getSI(), getDX());
+ if (!(pdms->Functions & ONLY_SET_TRACKLAYOUT)) {
+ pbds->FormFactor = pdms->DeviceType;
+ pbds->Cylinders = pdms->Cylinders;
+ pbds->Flags = pdms->DeviceAttrs;
+ pbds->MediaType = pdms->MediaType;
+ if (pdms->Functions & INSTALL_FAKE_BPB) {
+ pbds->Flags |= RETURN_FAKE_BPB;
+ pbds->bpb = pdms->bpb;
+ // update the total sectors, we need it
+ // for verification
+ pbds->TotalSectors = (pbds->bpb.Sectors) ?
+ pbds->bpb.Sectors :
+ pbds->bpb.BigSectors;
+ }
+ else {
+ pbds->Flags &= ~RETURN_FAKE_BPB;
+ pbds->rbpb = pdms->bpb;
+ }
+ }
+ MediaForFormat = Unknown;
+ if (!(pbds->Flags & NON_REMOVABLE)){
+ nt_floppy_close(pbds->DrivePhys);
+ }
+ else {
+ nt_fdisk_close(pbds->DrivePhys);
+ }
+ break;
+
+ case IOCTL_WRITETRACK:
+
+ pRW = (PRW_BLOCK) GetVDMAddr(getSI(), getDX());
+ Sectors = pRW->Sectors;
+ StartSector = pRW->StartSector;
+ StartSector += pbds->bpb.TrackSize *
+ (pRW->Cylinder * pbds->bpb.Heads + pRW->Head);
+ Sectors = demDasdWrite(pbds,
+ StartSector,
+ Sectors,
+ pRW->BufferOff,
+ pRW->BufferSeg
+ );
+ if (Sectors != pRW->Sectors) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ break;
+
+ case IOCTL_FORMATTRACK:
+ pfmt = (PFMT_BLOCK)GetVDMAddr(getSI(), getDX());
+ Head = pfmt->Head;
+ Cylinder = pfmt->Cylinder;
+ if ((pbds->Flags & NON_REMOVABLE) &&
+ pfmt->Head < pbds->bpb.Heads &&
+ pfmt->Cylinder < pbds->Cylinders)
+ {
+ if (pfmt->Functions == STATUS_FOR_FORMAT){
+ pfmt->Functions = 0;
+ setCF(0);
+ return;
+ }
+ if (!demDasdFormat(pbds, Head, Cylinder, NULL)) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ }
+ else {
+ if (MediaForFormat == Unknown) {
+ demDasdFormat(pbds,
+ Head,
+ Cylinder,
+ &MediaForFormat
+ );
+ }
+ if (pfmt->Functions & STATUS_FOR_FORMAT){
+ if (MediaForFormat == Unknown)
+ pfmt->Functions = 2; // illegal combination
+ else
+ pfmt->Functions = 0;
+ break;
+ }
+ if (MediaForFormat == Unknown ||
+ !demDasdFormat(pbds, Head, Cylinder, &MediaForFormat)) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ }
+ break;
+
+ case IOCTL_SETMEDIA:
+ pmid = (PMID) GetVDMAddr(getSI(), getDX());
+
+ if (pbds->Flags & NON_REMOVABLE) {
+ Sectors = nt_fdisk_read(pbds->DrivePhys,
+ 0,
+ BYTES_PER_SECTOR,
+ BootSector
+ );
+ }
+ else {
+ if (demGetBPB(pbds))
+ Sectors = nt_floppy_read(pbds->DrivePhys,
+ 0,
+ BYTES_PER_SECTOR,
+ BootSector
+ );
+ else
+ Sectors = 0;
+ }
+ pbs = (PBOOTSECTOR) BootSector;
+ if (Sectors != BYTES_PER_SECTOR ||
+ pbs->ExtBootSig != EXT_BOOTSECT_SIG)
+ {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ pbs->SerialNum = pmid->SerialNum;
+ pbs->Label = pmid->Label;
+ pbs->FileSysType = pmid->FileSysType;
+ if (pbds->Flags & NON_REMOVABLE) {
+ Sectors = nt_fdisk_write(pbds->DrivePhys,
+ 0,
+ BYTES_PER_SECTOR,
+ (PBYTE)pbs
+ );
+ nt_fdisk_close(pbds->DrivePhys);
+ }
+ else {
+ Sectors = nt_floppy_write(pbds->DrivePhys,
+ 0,
+ BYTES_PER_SECTOR,
+ (PBYTE) pbs
+ );
+ nt_floppy_close(pbds->DrivePhys);
+ }
+ if (Sectors != BYTES_PER_SECTOR) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ break;
+
+
+ // ioctl get device parameters
+ case IOCTL_GETDPM:
+ pdms = (PDEVICE_PARAMETERS)GetVDMAddr(getSI(), getDX());
+ // if we couldn't find the bds, fake one
+ if (pbds == NULL) {
+ HANDLE hVolume;
+ CHAR achRoot[]="\\\\.\\?:";
+ DISK_GEOMETRY DiskGM;
+ DWORD SizeReturned;
+
+ if (!demGetDiskFreeSpace(Drive,
+ &SectorSize,
+ &ClusterSize,
+ &TotalClusters,
+ &FreeClusters
+ )){
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+
+ achRoot[4] = Drive + 'A';
+
+ hVolume = CreateFileA(achRoot,
+ FILE_READ_ATTRIBUTES | SYNCHRONIZE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE,
+ NULL,
+ OPEN_EXISTING,
+ 0,
+ NULL);
+ if (hVolume == INVALID_HANDLE_VALUE) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ if (!DeviceIoControl(hVolume,
+ IOCTL_DISK_GET_DRIVE_GEOMETRY,
+ NULL,
+ 0,
+ &DiskGM,
+ sizeof(DISK_GEOMETRY),
+ &SizeReturned,
+ NULL
+ )) {
+ CloseHandle(hVolume);
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ CloseHandle(hVolume);
+ Sectors = DiskGM.Cylinders.LowPart *
+ DiskGM.TracksPerCylinder *
+ DiskGM.SectorsPerTrack;
+ pdms->DeviceType = FF_FDISK;
+ pdms->DeviceAttrs = NON_REMOVABLE;
+ pdms->MediaType = 0;
+ pdms->bpb.SectorSize = SectorSize;
+ pdms->bpb.ClusterSize = (BYTE) ClusterSize;
+ pdms->bpb.ReservedSectors = 1;
+ pdms->bpb.FATs = 2;
+ pdms->bpb.RootDirs = (Sectors > 32680) ? 512 : 64;
+ pdms->bpb.MediaID = 0xF8;
+ pdms->bpb.TrackSize = (WORD) DiskGM.SectorsPerTrack;
+ pdms->bpb.Heads = (WORD) DiskGM.TracksPerCylinder;
+ pdms->Cylinders = (WORD) DiskGM.Cylinders.LowPart;
+ if (Sectors >= 40000) {
+ TrackSize = 256 * ClusterSize + 2;
+ pdms->bpb.FATSize = (WORD) ((Sectors - pdms->bpb.ReservedSectors
+ - pdms->bpb.RootDirs * 32 / 512 +
+ TrackSize - 1 ) / TrackSize);
+ }
+ else {
+ pdms->bpb.FATSize = (WORD) (((Sectors / ClusterSize) * 3 / 2) /
+ 512 + 1);
+ }
+ pdms->bpb.HiddenSectors = Sectors;
+ Sectors = TotalClusters * ClusterSize;
+ if (Sectors >= 0x10000) {
+ pdms->bpb.Sectors = 0;
+ pdms->bpb.BigSectors = Sectors;
+ }
+ else {
+ pdms->bpb.Sectors = (WORD) Sectors;
+ pdms->bpb.BigSectors = 0;
+ }
+ pdms->bpb.HiddenSectors -= Sectors;
+ break;
+ }
+ pdms->DeviceType = pbds->FormFactor;
+ pdms->DeviceAttrs = pbds->Flags & ~(HAS_CHANGELINE);
+ pdms->Cylinders = pbds->Cylinders;
+ pdms->MediaType = 0;
+ if (pdms->Functions & BUILD_DEVICE_BPB){
+ if (!(pbds->Flags & NON_REMOVABLE) &&
+ !demGetBPB(pbds)) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ pBPB = &pbds->bpb;
+ }
+ else
+ // copy recommended bpb
+ pBPB = &pbds->rbpb;
+
+ pdms->bpb = *pBPB;
+ break;
+
+ case IOCTL_READTRACK:
+ pRW = (PRW_BLOCK) GetVDMAddr(getSI(), getDX());
+ Sectors = pRW->Sectors;
+ StartSector = pRW->StartSector;
+ StartSector += pbds->bpb.TrackSize *
+ (pRW->Cylinder * pbds->bpb.Heads + pRW->Head);
+ Sectors = demDasdRead(pbds,
+ StartSector,
+ Sectors,
+ pRW->BufferOff,
+ pRW->BufferSeg
+ );
+
+ if (Sectors != pRW->Sectors) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ break;
+
+ case IOCTL_VERIFYTRACK:
+ pfmt = (PFMT_BLOCK) GetVDMAddr(getSI(), getDX());
+ if(!demDasdVerify(pbds, pfmt->Head, pfmt->Cylinder)) {
+ setAX(demWinErrorToDosError(GetLastError()));
+ setCF(1);
+ return;
+ }
+ break;
+
+ case IOCTL_GETACCESS:
+ pAccessCtrl = (PACCESSCTRL) GetVDMAddr(getSI(), getDX());
+ pAccessCtrl->AccessFlag = (pbds->Flags & UNFORMATTED_MEDIA) ?
+ 0 : 1;
+ break;
+ case IOCTL_SETACCESS:
+ pAccessCtrl = (PACCESSCTRL) GetVDMAddr(getSI(), getDX());
+ pbds->Flags &= ~(UNFORMATTED_MEDIA);
+ if (pAccessCtrl->AccessFlag == 0)
+ pAccessCtrl->AccessFlag |= UNFORMATTED_MEDIA;
+ break;
+
+ default:
+ setAX(DOS_INVALID_FUNCTION);
+ setCF(1);
+ return;
+ }
+ setAX(0);
+ setCF(0);
+}
+
+/* demIoctlDiskQuery - Query block device generic ioctl capability
+ *
+ *
+ * Entry - Client (BL) = drive number (a=0;b=1 etc)
+ * (CL) = generic ioctl subfuntion to be queried
+ * Exit
+ * SUCCESS
+ * Client (CY) = 0
+ * The specific ioctl is supported
+ * FAILURE
+ * Client (CY) = 1
+ * The given ioctl is not supported
+ */
+
+VOID demIoctlDiskQuery (VOID)
+{
+ BYTE Code, Drive;
+
+ Code = getCL();
+ Drive = getBL();
+ if (demGetBDS(Drive) == NULL) {
+ setAX(DOS_FILE_NOT_FOUND);
+ setCF(1);
+ return;
+ }
+ switch (Code) {
+
+ case IOCTL_SETDPM:
+ case IOCTL_WRITETRACK:
+ case IOCTL_FORMATTRACK:
+ case IOCTL_SETMEDIA:
+ case IOCTL_GETDPM:
+ case IOCTL_READTRACK:
+ case IOCTL_VERIFYTRACK:
+ case IOCTL_GETMEDIA:
+// case IOCTL_GETACCESS:
+// case IOCTL_SETACCESS:
+ setAX(0);
+ setCF(0);
+ break;
+ default:
+ setAX(DOS_ACCESS_DENIED);
+ setCF(1);
+ break;
+ }
+}
+
+
+/* demIoctlInvalid - For those subfunctions which may be implemented later
+ *
+ *
+ * Entry -
+ *
+ * Exit
+ * Client (CY) = 1
+ * Client (AX) = error_invalid_function
+ */
+
+
+VOID demIoctlInvalid (VOID)
+{
+ setCF(1);
+ setAX(ERROR_INVALID_FUNCTION);
+ return;
+}
diff --git a/private/mvdm/dos/dem/demlabel.c b/private/mvdm/dos/dem/demlabel.c
new file mode 100644
index 000000000..26e0e0ffc
--- /dev/null
+++ b/private/mvdm/dos/dem/demlabel.c
@@ -0,0 +1,76 @@
+/* demlabel.c - functions for working this volume labels.
+ *
+ * demDeleteLabel()
+ * demCreateLabel()
+ *
+ * Modification History:
+ *
+ * YST 1-Feb-1993 Created
+ *
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+
+#include <winbase.h>
+
+USHORT demDeleteLabel(BYTE Drive)
+{
+ CHAR szStr[32];
+
+
+ sprintf(szStr, "%c:\\", Drive);
+
+ if(!SetVolumeLabelA(szStr, NULL))
+ return(1);
+ else
+ return(0);
+}
+
+
+USHORT demCreateLabel(BYTE Drive, LPSTR lpszName)
+{
+ CHAR szStr[32];
+ CHAR szAnsi[32];
+ CHAR szTmp[32];
+ CHAR *p, *s;
+ int i = 0;
+
+
+ sprintf(szStr, "%c:\\", Drive);
+
+ s = lpszName;
+ p = szTmp;
+
+ while(s) {
+ if(*s != '.') {
+ *p = *s;
+ i++;
+ p++;
+ }
+ else {
+ while(i < 8) {
+ *p++ = ' ';
+ i++;
+ }
+ }
+ s++;
+
+ if(i > 11)
+ break;
+ }
+
+ szTmp[i] = '\0';
+
+ OemToAnsi(szTmp, szAnsi);
+
+ if(!SetVolumeLabelA(szStr, szAnsi))
+ return(1);
+
+ else
+ return(0);
+
+
+}
diff --git a/private/mvdm/dos/dem/demlock.c b/private/mvdm/dos/dem/demlock.c
new file mode 100644
index 000000000..0b35f5d34
--- /dev/null
+++ b/private/mvdm/dos/dem/demlock.c
@@ -0,0 +1,62 @@
+/* demlock.c - SVC handler for file file locking calls
+ *
+ * demLockOper
+ *
+ * Modification History:
+ *
+ * Sudeepb 07-Aug-1992 Created
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+
+#include <softpc.h>
+
+/* demLockOper - Lock or Unlock the file data
+ *
+ * Entry Client(AX) : Lock = 0 Unlock = 1
+ * Client(BX:BP) : NT Handle
+ * Client(CX:DX) : offset in the file
+ * Client(SI:DI) : Data Length to be locked
+ * Exit
+ * SUCCESS: Client CF = 0
+ * FAILURE: Client CF = 1
+ */
+
+VOID demLockOper (VOID)
+{
+HANDLE hFile;
+DWORD dwFileOffset,cbLock;
+
+ // Collect all the parameters
+ hFile = GETHANDLE(getBX(),getBP());
+ dwFileOffset = GETULONG (getCX(),getDX());
+ cbLock = GETULONG (getSI(),getDI());
+
+ if(getAL() == 0){ // Locking case
+ if (LockFile (hFile,
+ dwFileOffset,
+ 0,
+ cbLock,
+ 0
+ ) == TRUE) {
+ setCF (0);
+ return;
+ }
+ }
+ else {
+ if (UnlockFile (hFile,
+ dwFileOffset,
+ 0,
+ cbLock,
+ 0
+ ) == TRUE) {
+ setCF (0);
+ return;
+ }
+ }
+
+ // Operation failed
+ demClientError(hFile, (CHAR)-1);
+ return;
+}
diff --git a/private/mvdm/dos/dem/demmisc.c b/private/mvdm/dos/dem/demmisc.c
new file mode 100644
index 000000000..4ef8e9f3b
--- /dev/null
+++ b/private/mvdm/dos/dem/demmisc.c
@@ -0,0 +1,644 @@
+/* demmisc.c - Misc. SVC routines
+ *
+ * demLoadDos
+ *
+ * Modification History:
+ *
+ * Sudeepb 31-Mar-1991 Created
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+// #include "demdasd.h"
+
+#include <stdio.h>
+#include <string.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <dbgsvc.h>
+#include <nt_vdd.h>
+
+
+#if DEVL
+// int 21h func names
+// index off of function number in ah
+char *scname[] = {
+ "Terminate Program",
+ "Read Kbd with Echo",
+ "Display Character",
+ "Auxillary Input",
+ "Auxillary Output",
+ "Print Character",
+ "Direct Con Output",
+ "Direct Con Input",
+ "Read Kbd without Echo",
+ "Display String",
+ "Read String",
+ "Check Keyboard Status",
+ "Flush Buffer,Read Kbd",
+ "Reset Drive",
+ "Set Default Drive",
+ "FCB Open",
+ "FCB Close",
+ "FCB Find First",
+ "FCB Find Next",
+ "FCB Delete",
+ "FCB Seq Read",
+ "FCB Seq Write",
+ "FCB Create",
+ "FCB Rename",
+ "18h??",
+ "Get Default Drive",
+ "Set Disk Transfer Addr",
+ "Get Default Drive Data",
+ "Get Drive Data",
+ "1Dh??",
+ "1Eh??",
+ "Get Default DPB",
+ "20h??",
+ "FCB Random Read",
+ "FCB Random Write",
+ "FCB Get File Size",
+ "FCB Set Random Record",
+ "Set Interrupt Vector",
+ "Create Process Data Block",
+ "FCB Random Read Block",
+ "FCB Random Write Block",
+ "FCB Parse File Name",
+ "Get Date",
+ "Set Date",
+ "Get Time",
+ "Set Time",
+ "SetReset Write Verify",
+ "Get Disk Transefr Addr",
+ "Get Version Number",
+ "Keep Process",
+ "Get Drive Parameters",
+ "GetSet CTRL C",
+ "Get InDOS Flag",
+ "Get Interrupt Vector",
+ "Get Disk Free Space",
+ "Char Oper",
+ "GetSet Country Info",
+ "Make Dir",
+ "Remove Dir",
+ "Change DirDir",
+ "Create File",
+ "Open File",
+ "Close File",
+ "Read File",
+ "Write File",
+ "Delete File",
+ "Move File Ptr",
+ "GetSet File Attr",
+ "IOCTL",
+ "Dup File Handle",
+ "Force Dup Handle",
+ "Get Current Dir",
+ "Alloc Mem",
+ "Free Mem",
+ "Realloc Mem",
+ "Exec Process",
+ "Exit Process",
+ "Get Child Process Exit Code",
+ "Find First",
+ "Find Next",
+ "Set Current PSP",
+ "Get Current PSP",
+ "Get In Vars",
+ "Set DPB",
+ "Get Verify On Write",
+ "Dup PDB",
+ "Rename File",
+ "GetSet File Date and Time",
+ "Allocation Strategy",
+ "Get Extended Error",
+ "Create Temp File",
+ "Create New File",
+ "LockUnlock File",
+ "SetExtendedErrorNetwork-ServerCall",
+ "Network-UserOper",
+ "Network-AssignOper",
+ "xNameTrans",
+ "PathParse",
+ "GetCurrentPSP",
+ "ECS CALL",
+ "Set Printer Flag",
+ "Extended Country Info",
+ "GetSet CodePage",
+ "Set Max Handle",
+ "Commit File",
+ "GetSetMediaID",
+ "6ah??",
+ "IFS IOCTL",
+ "Extended OpenCreate"
+ };
+#endif
+
+extern BOOL IsFirstCall;
+
+extern void nt_floppy_release_lock(void);
+
+LPSTR pszBIOSDirectory;
+
+// internal func prototype
+BOOL IsDebuggee(void);
+void SignalSegmentNotice(WORD wType,
+ WORD wLoadSeg,
+ WORD wNewSeg,
+ LPSTR lpName,
+ DWORD dwImageLen );
+
+/* demLoadDos - Load NTDOS.SYS.
+ *
+ * This SVC is made by NTIO.SYS to load NTDOS.SYS.
+ *
+ * Entry - Client (DI) - Load Segment
+ *
+ * Exit - SUCCESS returns
+ * FAILURE Kills the VDM
+ */
+VOID demLoadDos (VOID)
+{
+PBYTE pbLoadAddr;
+HANDLE hfile;
+DWORD BytesRead;
+
+ // get linear address where ntdos.sys will be loaded
+ pbLoadAddr = (PBYTE) GetVDMAddr(getDI(),0);
+
+ // set up BIOS path string
+ if(IsDebuggee() &&
+ ((pszBIOSDirectory = (PCHAR)malloc (strlen (pszDefaultDOSDirectory) +
+ 1 + sizeof("\\ntio.sys") + 1 )) != NULL)) {
+ strcpy (pszBIOSDirectory, pszDefaultDOSDirectory);
+ strcat (pszBIOSDirectory,"\\ntio.sys");
+ }
+
+ // prepare the dos file name
+ strcat (pszDefaultDOSDirectory,"\\ntdos.sys");
+
+ hfile = CreateFileOem(pszDefaultDOSDirectory,
+ GENERIC_READ,
+ FILE_SHARE_READ,
+ NULL,
+ OPEN_EXISTING,
+ FILE_ATTRIBUTE_NORMAL,
+ NULL );
+
+ if (hfile == (HANDLE)0xffffffff) {
+ TerminateVDM();
+ }
+
+ BytesRead = 1;
+ while (BytesRead) {
+ if (!ReadFile(hfile, pbLoadAddr, 16384, &BytesRead, NULL)) {
+ TerminateVDM();
+ }
+ pbLoadAddr = (PBYTE)((ULONG)pbLoadAddr + BytesRead);
+
+ }
+
+ CloseHandle (hfile);
+
+ if (!IsDebuggee()) {
+ free(pszDefaultDOSDirectory);
+ }
+ return;
+}
+
+
+/* demDOSDispCall
+ *
+ * This SVC is made by System_Call upon entering the dos
+ *
+ *
+ * Entry: Client registers as per user app upon entry to dos
+ *
+ * Exit - SUCCESS returns, if being debugged and DEMDOSDISP&fShowSvcMsg
+ * dumps user app's registers and service name
+ */
+VOID demDOSDispCall(VOID)
+{
+#if DEVL
+ WORD ax;
+
+ if (!IsDebuggee()) {
+ return;
+ }
+ if (fShowSVCMsg & DEMDOSDISP) {
+ ax = getAX();
+ sprintf(demDebugBuffer,"demDosDispCall %s\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ scname[HIBYTE(ax)],
+ ax,getBX(),getCX(),getDX(),getDI(), getSI());
+
+ OutputDebugStringOem(demDebugBuffer);
+
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP()+2,getBP());
+
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+}
+
+
+
+
+/* demDOSDispRet
+ *
+ * This SVC is made by System_Call upon exiting from the dos
+ *
+ * Entry: Client registers as per user app upon exit to dos
+ *
+ * Exit - SUCCESS returns, if being debugged and DEMDOSDISP&fShowSvcMsg
+ * dumps user app's registers
+ */
+VOID demDOSDispRet(VOID)
+{
+#if DEVL
+ PWORD16 pStk;
+
+ if (!IsDebuggee()) {
+ return;
+ }
+
+ if (fShowSVCMsg & DEMDOSDISP) {
+
+ // get ptr to flag word on stack
+ pStk = (WORD *)GetVDMAddr(getSS(), getSP());
+ pStk += 2;
+
+ sprintf (demDebugBuffer,"demDosDispRet\n\tAX=%.4x BX=%.4x CX=%.4x DX=%.4x DI=%.4x SI=%.4x\n",
+ getAX(),getBX(),getCX(),getDX(),getDI(),getSI());
+
+ OutputDebugStringOem(demDebugBuffer);
+
+ sprintf(demDebugBuffer,"\tCS=%.4x IP=%.4x DS=%.4x ES=%.4x SS=%.4x SP=%.4x BP=%.4x CF=%.1x\n",
+ getCS(),getIP(), getDS(),getES(),getSS(),getSP(),getBP(), (*pStk) & 1);
+
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+}
+
+
+/* demEntryDosApp - Dump Entry Point Dos Apps
+ *
+ * This SVC is made by NTDOS.SYS,$exec just prior to entering dos app
+ *
+ * Entry - Client DS:SI points to entry point
+ * Client AX:DI points to initial stack
+ * Client DX has PDB pointer
+ *
+ * Exit - SUCCESS returns, if being debugged and DEMDOSAPPBREAK&fShowSvcMsg
+ * breaks to debugger
+ */
+VOID demEntryDosApp(VOID)
+{
+USHORT PDB;
+
+ PDB = getDX();
+ if(!IsFirstCall)
+ VDDCreateUserHook(PDB);
+
+#if DEVL
+ if (!IsDebuggee()) {
+ return;
+ }
+
+ if (fShowSVCMsg & DEMDOSAPPBREAK) {
+ sprintf(demDebugBuffer,"demEntryDosApp: Entry=%.4x:%.4x, Stk=%.4x:%.4x PDB=%.4x\n",
+ getCS(),getIP(),getAX(),getDI(),PDB);
+ OutputDebugStringOem(demDebugBuffer);
+ DebugBreak();
+ }
+#endif
+
+}
+
+/* demLoadDosAppSym - Load Dos Apps Symbols
+ *
+ * This SVC is made by NTDOS.SYS,$exec to load Dos App symbols
+ *
+ * Entry - Client ES:DI -Fully Qualified Path Name of executable
+ * Client BX -Load Segment\Reloc Factor
+ * Client DX:AX -HIWORD:LOWORD exe size
+ *
+ * Exit - SUCCESS returns, raises debug exception, if being debugged
+ *
+ */
+VOID demLoadDosAppSym(VOID)
+{
+
+ SignalSegmentNotice(DBG_MODLOAD,
+ getBX(), 0,
+ (LPSTR)GetVDMAddr(getES(),getDI()),
+ MAKELONG(getAX(), getDX()) );
+
+}
+
+
+
+/* demFreeDosAppSym - Free Dos Apps Symbols
+ *
+ * This SVC is made by NTDOS.SYS,$exec to Free Dos App symbols
+ *
+ * Entry - Client ES:DI -Fully Qualified Path Name of executable
+ *
+ * Exit - SUCCESS returns, raises debug exception, if being debugged
+ *
+ */
+VOID demFreeDosAppSym(VOID)
+{
+
+ SignalSegmentNotice(DBG_MODFREE,
+ 0, 0,
+ (LPSTR)GetVDMAddr(getES(), getDI()),
+ 0);
+}
+
+
+/* demSystemSymbolOp - Manipulate Symbols for special modules
+ *
+ * This SVC is made by NTDOS.SYS,NTIO.SYS
+ *
+ * Client AH -Operation
+ * Client AL -module identifier
+ * Client BX -Load Segment\Reloc Factor
+ * Client CX:DX -HIWORD:LOWORD exe size
+ *
+ * Exit - SUCCESS returns, raises debug exception, if being debugged
+ *
+ */
+VOID demSystemSymbolOp(VOID)
+{
+
+ LPSTR pszPathName;
+
+ if (!IsDebuggee()) {
+ return;
+ }
+ switch(getAL()) {
+
+ case ID_NTIO:
+ pszPathName = pszBIOSDirectory;
+ break;
+ case ID_NTDOS:
+ pszPathName = pszDefaultDOSDirectory;
+ break;
+ default:
+ pszPathName = NULL;
+
+ }
+
+ // check this again for the case where the static strings have been freed
+ if (pszPathName != NULL) {
+
+ switch(getAH() & (255-SYMOP_CLEANUP)) {
+
+ case SYMOP_LOAD:
+ SignalSegmentNotice(DBG_MODLOAD,
+ getBX(), 0,
+ pszPathName,
+ MAKELONG(getDX(), getCX()) );
+ break;
+
+ case SYMOP_FREE:
+ //bugbug not implemented yet
+ break;
+
+ case SYMOP_MOVE:
+ SignalSegmentNotice(DBG_SEGMOVE,
+ getBX(), getES(),
+ pszPathName,
+ 0);
+ break;
+ }
+ }
+
+ if (getAH() & SYMOP_CLEANUP) {
+
+ if (pszBIOSDirectory != NULL) {
+ free (pszBIOSDirectory);
+ }
+
+ if (pszDefaultDOSDirectory != NULL) {
+ free(pszDefaultDOSDirectory);
+ }
+
+ }
+
+}
+
+VOID demOutputString(VOID)
+{
+ LPSTR lpText;
+ UCHAR fPE;
+
+ if ( !IsDebuggee() ) {
+ return;
+ }
+
+ fPE = ISPESET;
+
+ lpText = (LPSTR)Sim32GetVDMPointer(
+ ((ULONG)getDS() << 16) + (ULONG)getSI(),
+ (ULONG)getBX(), fPE );
+
+ OutputDebugStringOem( lpText );
+}
+
+VOID demInputString(VOID)
+{
+ LPSTR lpText;
+ UCHAR fPE;
+
+ if ( !IsDebuggee() ) {
+ return;
+ }
+
+ fPE = ISPESET;
+
+ lpText = (LPSTR)Sim32GetVDMPointer(
+ ((ULONG)getDS() << 16) + (ULONG)getDI(),
+ (ULONG)getBX(), fPE );
+
+ DbgPrompt( "", lpText, 0x80 );
+}
+
+/* SignalSegmentNotice
+ *
+ * packs up the data and raises STATUS_SEGMENT_NOTIFICATION
+ *
+ * Entry - WORD wType - DBG_MODLOAD, DBG_MODFREE
+ * WORD wLoadSeg - Starting Segment (reloc factor)
+ * LPSTR lpName - ptr to Name of Image
+ * DWORD dwModLen - Length of module
+ *
+ *
+ * if wType ==DBG_MODLOAD wOldLoadSeg is unused
+ * if wType ==DBG_MODFREE wLoadSeg,dwImageLen,wOldLoadSeg are unused
+ *
+ * Use 0 or NULL for unused parameters
+ *
+ * Exit - void
+ *
+ */
+void SignalSegmentNotice(WORD wType,
+ WORD wLoadSeg,
+ WORD wNewSeg,
+ LPSTR lpName,
+ DWORD dwImageLen )
+{
+ int i;
+ DWORD dw;
+ LPSTR lpstr;
+ LPSTR lpModuleName;
+ char ach[MAX_PATH+9]; // 9 for module name
+
+ if (!IsDebuggee()) {
+ return;
+ }
+
+ // create file name
+ dw = GetFullPathNameOem(lpName,
+ sizeof(ach)-9, // 9 for module name
+ ach,
+ &lpstr);
+
+ if (!dw || dw >= sizeof(ach)) {
+ lpName = " ";
+ strcpy(ach, lpName);
+ }
+ else {
+ lpName = lpstr;
+ }
+
+ // copy in module name
+ i = 8; // limit len of module name
+ dw = strlen(ach);
+ lpModuleName = lpstr = ach+dw+1;
+ while (*lpName && *lpName != '.' && i--)
+ {
+ *lpstr++ = *lpName++;
+ dw++;
+ }
+ *lpstr = '\0';
+ dw += 2;
+
+#if DBG
+ if (fShowSVCMsg) {
+ sprintf(demDebugBuffer,"dem Segment Notify: <%s> Seg=%lxh, ImageLen=%ld\n",
+ ach, (DWORD)wLoadSeg, dwImageLen);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ if (wType == DBG_MODLOAD) {
+ ModuleLoad(lpModuleName, ach, wLoadSeg, dwImageLen);
+ } else if (wType == DBG_MODFREE) {
+ ModuleFree(lpModuleName, ach);
+ } else if (wType == DBG_SEGMOVE) {
+ ModuleSegmentMove(lpModuleName, ach, wLoadSeg, wNewSeg);
+ }
+}
+
+
+
+/* IsDebuggee
+ *
+ * Determines if we are being debugged
+ *
+ * Entry: void
+ *
+ * Exit: BOOL bRet - TRUE we are being debugged
+ *
+ */
+BOOL IsDebuggee(void)
+{
+ HANDLE MyDebugPort;
+ DWORD dw;
+
+ // are we being debugged ??
+ dw = NtQueryInformationProcess(
+ NtCurrentProcess(),
+ ProcessDebugPort,
+ &MyDebugPort,
+ sizeof(MyDebugPort),
+ NULL );
+ if (!NT_SUCCESS(dw) || MyDebugPort == NULL)
+ {
+ return FALSE;
+ }
+
+ return TRUE;
+}
+
+/* demIsDebug - Determine if 16bit DOS should make entry/exit calls at int21
+ *
+ * Entry: void
+ *
+ * Exit: Client AL = 0 if not
+ * Client AL = 1 if yes
+ *
+ */
+VOID demIsDebug(void)
+{
+ BYTE dbgflags = 0;
+
+ if (IsDebuggee()) {
+ dbgflags |= ISDBG_DEBUGGEE;
+ if (fShowSVCMsg)
+ dbgflags |= ISDBG_SHOWSVC;
+ }
+
+ setAL (dbgflags);
+ return;
+}
+
+/* demDiskReset - Reset floppy disks.
+ *
+ * Entry - None
+ *
+ * Exit - FDAccess in DOSDATA (NTDOS.SYS) is 0.
+ */
+
+VOID demDiskReset (VOID)
+{
+ extern WORD * pFDAccess; // defined in SoftPC.
+
+ HostFloppyReset();
+ HostFdiskReset();
+ *pFDAccess = 0;
+
+ return;
+}
+
+/* demExitVDM - Kill the VDM From 16Bit side with a proper message
+ * in case something goes wrong.
+ *
+ * Entry - DS:SI - Message String
+ *
+ * Exit - None (VDM Is killed)
+ */
+
+VOID demExitVDM ( VOID )
+{
+ RcErrorDialogBox(ED_BADSYSFILE,"config.nt",NULL);
+ TerminateVDM ();
+}
+
+/* demWOWFiles - Return what should be the value of files= for WOW VDM.
+ *
+ * Entry - AL - files= specified in config.sys
+ *
+ * Exit - client AL is set to max if WOW VDM else unmodified
+ */
+
+VOID demWOWFiles ( VOID )
+{
+ if(VDMForWOW)
+ setAL (255);
+ return;
+}
diff --git a/private/mvdm/dos/dem/demmsg.c b/private/mvdm/dos/dem/demmsg.c
new file mode 100644
index 000000000..cf3161613
--- /dev/null
+++ b/private/mvdm/dos/dem/demmsg.c
@@ -0,0 +1,48 @@
+/* demmsg.c - debug messages handling for DEM
+ *
+ * Modification History
+ *
+ * Sudeepb 31-Mar-1991 Created
+ */
+#if DBG
+
+#include <stdio.h>
+#include <demmsg.h>
+#include "dem.h"
+
+PCHAR aMsg [] = {
+ "DOS Location Not Found. Using Default.\n",
+ "Read On NTDOS.SYS Failed.\n",
+ "Open On NTDOS.SYS Failed.\n",
+ "EAs Not Supported\n",
+ "Letter mismatch in Set_Default_Drive\n",
+ "Volume ID support is missing\n",
+ "Invalid Date Time Format for NT\n",
+ "DTA has an Invalid Find Handle for FINDNEXT\n",
+ "Unexpected failure to get file information\n",
+ "File Size is too big for DOS\n"
+};
+
+
+/* demPrintMsg - Print Debug Message
+ *
+ * Entry - iMsg (Message Index; See demmsg.h)
+ *
+ * Exit - None
+ *
+ */
+
+VOID demPrintMsg (ULONG iMsg)
+{
+
+ if (fShowSVCMsg){
+ sprintf(demDebugBuffer,aMsg[iMsg]);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+
+ iMsg;
+
+ return;
+}
+
+#endif
diff --git a/private/mvdm/dos/dem/demmsg.h b/private/mvdm/dos/dem/demmsg.h
new file mode 100644
index 000000000..460039790
--- /dev/null
+++ b/private/mvdm/dos/dem/demmsg.h
@@ -0,0 +1,18 @@
+/* demmsg.h - debug message numbers for DEM
+ *
+ * Modification History
+ *
+ * Sudeepb 31-Mar-1991 Created
+ */
+
+
+#define MSG_DEFAULTDOS 0
+#define MSG_PARTIALREAD 1
+#define MSG_OPENFAILED 2
+#define MSG_EAS 3
+#define MSG_DEFAULT_DRIVE 4
+#define MSG_VOLID 5
+#define MSG_TIMEDATE 6
+#define MSG_INVALID_HFIND 7
+#define MSG_FILEINFO 8
+#define MSG_FILESIZE_TOOBIG 9
diff --git a/private/mvdm/dos/dem/demsrch.c b/private/mvdm/dos/dem/demsrch.c
new file mode 100644
index 000000000..bc99d4d4d
--- /dev/null
+++ b/private/mvdm/dos/dem/demsrch.c
@@ -0,0 +1,2442 @@
+/* demsrch.c - SVC handlers for calls to search files
+ *
+ * demFindFirst
+ * demFindNext
+ * demFindFirstFCB
+ * demFindNextFCB
+ *
+ * Modification History:
+ *
+ * Sudeepb 06-Apr-1991 Created
+ *
+ */
+
+#include "dem.h"
+#include "demmsg.h"
+#include "winbasep.h"
+#include <vdm.h>
+#include <softpc.h>
+#include <mvdm.h>
+#include <memory.h>
+#include <nt_vdd.h>
+
+extern BOOL IsFirstCall;
+
+
+
+/*
+ * Internal globals, function prototypes
+ */
+
+#define FINDFILE_DEVICE (HANDLE)0xffffffff
+
+typedef struct _PSP_FILEFINDLIST {
+ LIST_ENTRY PspFFindEntry; // Next psp
+ LIST_ENTRY FFindHeadList; // File Find list for this psp
+ ULONG usPsp; // PSP id
+} PSP_FFINDLIST, *PPSP_FFINDLIST;
+
+typedef struct _FFINDDOSDATA {
+ ULONG FileIndex;
+ ULONG FileNameLength;
+ WCHAR FileName[MAXIMUM_FILENAME_LENGTH + 1];
+ FILETIME ftLastWriteTime;
+ DWORD dwFileSizeLow;
+ UCHAR uchFileAttributes;
+ CHAR cFileName[14];
+} FFINDDOSDATA, *PFFINDDOSDATA;
+
+typedef struct _FILEFINDLIST {
+ LIST_ENTRY FFindEntry;
+ ULONG FFindId;
+ NTSTATUS LastQueryStatus;
+ LARGE_INTEGER FindFileTics;
+ HANDLE DirectoryHandle;
+ PVOID FindBufferBase;
+ PVOID FindBufferNext;
+ ULONG FindBufferLength;
+ FFINDDOSDATA DosData;
+ USHORT usSrchAttr;
+ BOOLEAN SupportReset;
+ UNICODE_STRING PathName;
+ UNICODE_STRING FileName;
+}FFINDLIST, *PFFINDLIST;
+
+LIST_ENTRY PspFFindHeadList= {&PspFFindHeadList, &PspFFindHeadList};
+
+
+#define FFINDID_BASE 0x80000000
+ULONG NextFFindId = FFINDID_BASE;
+BOOLEAN FFindIdWrap = FALSE;
+#define MAX_DIRECTORYHANDLE 64
+#define MAX_FINDBUFFER 128
+ULONG NumDirectoryHandle = 0;
+ULONG NumFindBuffer=0;
+LARGE_INTEGER FindFileTics = {0,0};
+LARGE_INTEGER NextFindFileTics = {0,0};
+
+char szStartDotStar[]="????????.???";
+
+
+PFFINDLIST
+SearchFile(
+ PWCHAR pwcFile,
+ USHORT SearchAttr,
+ PFFINDLIST pFFindEntry,
+ PFFINDDOSDATA pFFindDDOut
+ );
+
+
+NTSTATUS
+FileFindNext(
+ PFFINDDOSDATA pFFindDD,
+ PFFINDLIST pFFindEntry
+ );
+
+NTSTATUS
+FileFindLast(
+ PFFINDLIST pFFindEntry
+ );
+
+VOID
+FileFindClose(
+ PFFINDLIST pFFindEntry
+ );
+
+
+NTSTATUS
+FileFindOpen(
+ PWCHAR pwcFile,
+ PFFINDLIST pFFindEntry,
+ ULONG BufferSize
+ );
+
+NTSTATUS
+FileFindReset(
+ PFFINDLIST pFFindEntry
+ );
+
+
+HANDLE
+FileFindFirstDevice(
+ PWCHAR FileName,
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo
+ );
+
+void
+CloseOldestFileFindBuffer(
+ void
+ );
+
+
+BOOL
+CopyDirInfoToDosData(
+ PFFINDDOSDATA pFFindDD,
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo,
+ USHORT SearchAttr
+ );
+
+BOOL
+DemOemToUni(
+ PUNICODE_STRING pUnicode,
+ LPSTR lpstr
+ );
+
+VOID
+FillFcbVolume(
+ PSRCHBUF pSrchBuf,
+ CHAR *pFileName,
+ USHORT SearchAttr
+ );
+
+BOOL
+FillDtaVolume(
+ CHAR *pFileName,
+ PSRCHDTA pDta,
+ USHORT SearchAttr
+ );
+
+BOOL
+MatchVolLabel(
+ CHAR * pVolLabel,
+ CHAR * pBaseName
+ );
+
+VOID
+NtVolumeNameToDosVolumeName(
+ CHAR * pDosName,
+ CHAR * pNtName
+ );
+
+VOID
+FillFCBSrchBuf(
+ PFFINDDOSDATA pFFindDD,
+ PSRCHBUF pSrchBuf
+ );
+
+VOID
+FillSrchDta(
+ PFFINDDOSDATA pFFindDD,
+ PSRCHDTA pDta
+ );
+
+PFFINDLIST
+AddFFindEntry(
+ PWCHAR pwcFile,
+ PFFINDLIST pFFindEntrySrc
+ );
+
+PPSP_FFINDLIST
+GetPspFFindList(
+ USHORT CurrPsp
+ );
+
+PFFINDLIST
+GetFFindEntryByFindId(
+ ULONG NextFFindId
+ );
+
+VOID
+FreeFFindEntry(
+ PFFINDLIST pFFindEntry
+ );
+
+VOID
+FreeFFindList(
+ PLIST_ENTRY pFFindHeadList
+ );
+
+
+/* demFindFirst - Path-Style Find First File
+ *
+ * Entry - Client (DS:DX) - File Path with wildcard
+ * Client (CX) - Search Attributes
+ *
+ * Exit - Success
+ * Client (CF) = 0
+ * DTA updated
+ *
+ * Failure
+ * Client (CF) = 1
+ * Client (AX) = Error Code
+ *
+ * NOTES
+ * Search Rules: Ignore Read_only and Archive bits.
+ * If CX == ATTR_NORMAL Search only for normal files
+ * If CX == ATTR_HIDDEN Search Hidden or normal files
+ * If CX == ATTR_SYSTEM Search System or normal files
+ * If CX == ATTR_DIRECTORY Search directory or normal files
+ * If CX == ATTR_VOLUME_ID Search Volume_ID
+ * if CX == -1 return everytiing you find
+ *
+ * Limitations - 21-Sep-1992 Jonle
+ * cannot return label from a UNC name,just like dos.
+ * Apps which keep many find handles open can cause
+ * serious trouble, we must rewrite so that we can
+ * close the handles
+ *
+ */
+
+VOID demFindFirst (VOID)
+{
+ DWORD dwRet;
+ PVOID pDta;
+
+
+ LPSTR lpFile = (LPSTR) GetVDMAddr (getDS(),getDX());
+
+ pDta = (PVOID) GetVDMAddr (*((PUSHORT)pulDTALocation + 1),
+ *((PUSHORT)pulDTALocation));
+
+ dwRet = demFileFindFirst (pDta, lpFile, getCX());
+
+ if (dwRet == -1) {
+ dwRet = GetLastError();
+ demClientError(INVALID_HANDLE_VALUE, *lpFile);
+ return;
+ }
+
+ if (dwRet != 0) {
+ setAX((USHORT) dwRet);
+ setCF (1);
+ } else {
+ setCF (0);
+ }
+ return;
+
+}
+
+
+DWORD demFileFindFirst (
+ PVOID pvDTA,
+ LPSTR lpFile,
+ USHORT SearchAttr)
+{
+ PSRCHDTA pDta = (PSRCHDTA)pvDTA;
+ PFFINDLIST pFFindEntry;
+ FFINDDOSDATA FFindDD;
+ UNICODE_STRING FileUni;
+ WCHAR wcFile[MAX_PATH + sizeof(WCHAR)];
+
+
+#if DBG
+ if (SIZEOF_DOSSRCHDTA != sizeof(SRCHDTA)) {
+ sprintf(demDebugBuffer,
+ "demsrch: FFirst SIZEOF_DOSSRCHDTA %ld != sizeof(SRCHDTA) %ld\n",
+ SIZEOF_DOSSRCHDTA,
+ sizeof(SRCHDTA));
+ OutputDebugStringOem(demDebugBuffer);
+ }
+
+ if (fShowSVCMsg & DEMFILIO){
+ sprintf(demDebugBuffer,"demsrch: FindFirst<%s>\n", lpFile);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ STOREDWORD(pDta->FFindId,0);
+ STOREDWORD(pDta->pFFindEntry,0);
+
+ FileUni.Buffer = wcFile;
+ FileUni.MaximumLength = sizeof(wcFile);
+ DemOemToUni(&FileUni, lpFile);
+
+
+ //
+ // Do volume label first.
+ //
+ if (SearchAttr & ATTR_VOLUME_ID) {
+ if (FillDtaVolume(lpFile, pDta, SearchAttr)) {
+
+ // got vol label match
+ // do look ahead before returning
+ if (SearchAttr != ATTR_VOLUME_ID) {
+ pFFindEntry = SearchFile(wcFile, SearchAttr, NULL, NULL);
+ if (pFFindEntry) {
+ STOREDWORD(pDta->pFFindEntry,pFFindEntry);
+ STOREDWORD(pDta->FFindId,pFFindEntry->FFindId);
+ }
+ }
+ return 0;
+ }
+
+ // no vol match, if asking for more than vol label
+ // fall thru to file search code, otherwise ret error
+ else if (SearchAttr == ATTR_VOLUME_ID) {
+ return GetLastError();
+ }
+ }
+
+ //
+ // Search the dir
+ //
+ pFFindEntry = SearchFile(wcFile, SearchAttr, NULL, &FFindDD);
+
+ if (!FFindDD.cFileName[0]) {
+
+ // search.asm in doskrnl never returns ERROR_FILE_NOT_FOUND
+ // only ERROR_PATH_NOT_FOUND, ERROR_NO_MORE_FILES
+ DWORD dw;
+
+ dw = GetLastError();
+ if (dw == ERROR_FILE_NOT_FOUND) {
+ SetLastError(ERROR_NO_MORE_FILES);
+ }
+ else if (dw == ERROR_BAD_PATHNAME || dw == ERROR_DIRECTORY ) {
+ SetLastError(ERROR_PATH_NOT_FOUND);
+ }
+ return (DWORD)-1;
+ }
+
+ FillSrchDta(&FFindDD, pDta);
+
+ if (pFFindEntry) {
+ STOREDWORD(pDta->pFFindEntry,pFFindEntry);
+ STOREDWORD(pDta->FFindId,pFFindEntry->FFindId);
+ }
+
+ return 0;
+}
+
+
+/*
+ * DemOemToUni
+ *
+ * returns TRUE\FALSE for success, sets last error if fail
+ *
+ */
+BOOL DemOemToUni(PUNICODE_STRING pUnicode, LPSTR lpstr)
+{
+ NTSTATUS Status;
+ OEM_STRING OemString;
+
+ RtlInitString(&OemString,lpstr);
+ Status = RtlOemStringToUnicodeString(pUnicode,&OemString,FALSE);
+ if (!NT_SUCCESS(Status)) {
+ if (Status == STATUS_BUFFER_OVERFLOW) {
+ SetLastError(ERROR_FILENAME_EXCED_RANGE);
+ }
+ else {
+ SetLastError(RtlNtStatusToDosError(Status));
+ }
+ return FALSE;
+ }
+
+ pUnicode->Buffer[pUnicode->Length] = UNICODE_NULL;
+
+ return TRUE;
+}
+
+
+
+
+
+/* demFindNext - Path-Style Find Next File
+ *
+ * Entry - None
+ *
+ * Exit - Success
+ * Client (CF) = 0
+ * DTA updated
+ *
+ * Failure
+ * Client (CF) = 1
+ * Client (AX) = Error Code
+ */
+VOID demFindNext (VOID)
+{
+ DWORD dwRet;
+ PVOID pDta;
+
+ pDta = (PVOID) GetVDMAddr(*((PUSHORT)pulDTALocation + 1),
+ *((PUSHORT)pulDTALocation));
+
+ dwRet = demFileFindNext (pDta);
+
+ if (dwRet != 0) {
+ setAX((USHORT) dwRet);
+ setCF (1);
+ return;
+ }
+
+ setCF (0);
+ return;
+
+}
+
+
+DWORD demFileFindNext (
+ PVOID pvDta)
+{
+ PSRCHDTA pDta = (PSRCHDTA)pvDta;
+ USHORT SearchAttr;
+ PFFINDLIST pFFindEntry;
+ FFINDDOSDATA FFindDD;
+
+ pFFindEntry = GetFFindEntryByFindId(FETCHDWORD(pDta->FFindId));
+ if (!pFFindEntry ||
+ FETCHDWORD(pDta->pFFindEntry) != (DWORD)pFFindEntry )
+ {
+ STOREDWORD(pDta->FFindId,0);
+ STOREDWORD(pDta->pFFindEntry,0);
+
+ // DOS has only one error (no_more_files) for all causes.
+ return(ERROR_NO_MORE_FILES);
+ }
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "demFileFindNext<%ws>\n", pFFindEntry->PathName.Buffer);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ SearchAttr = pFFindEntry->usSrchAttr;
+
+ //
+ // Search the dir
+ //
+ pFFindEntry = SearchFile(NULL,
+ SearchAttr,
+ pFFindEntry,
+ &FFindDD
+ );
+
+ if (!FFindDD.cFileName[0]) {
+ STOREDWORD(pDta->FFindId,0);
+ STOREDWORD(pDta->pFFindEntry,0);
+ return GetLastError();
+ }
+
+ FillSrchDta(&FFindDD, pDta);
+
+ if (!pFFindEntry) {
+ STOREDWORD(pDta->FFindId,0);
+ STOREDWORD(pDta->pFFindEntry,0);
+ }
+ return 0;
+}
+
+
+
+/* demFindFirstFCB - FCB based Find First file
+ *
+ * Entry - Client (DS:SI) - SRCHBUF where the information will be returned
+ * Client (ES:DI) - Full path file name with possibly wild cards
+ * Client (Al) - 0 if not an extended FCB
+ * Client (DL) - Search Attributes
+ *
+ * Exit - Success
+ * Client (CF) = 0
+ * SRCHBUF is filled in
+ *
+ * Failure
+ * Client (AL) = -1
+ *
+ * NOTES
+ * Search Rules: Ignore Read_only and Archive bits.
+ * If DL == ATTR_NORMAL Search only for normal files
+ * If DL == ATTR_HIDDEN Search Hidden or normal files
+ * If DL == ATTR_SYSTEM Search System or normal files
+ * If DL == ATTR_DIRECTORY Search directory or normal files
+ * If DL == ATTR_VOLUME_ID Search only Volume_ID
+ * if DL == -1 return everytiing you find
+ */
+
+VOID demFindFirstFCB (VOID)
+{
+ LPSTR lpFile;
+ USHORT SearchAttr;
+ PSRCHBUF pFCBSrchBuf;
+ PDIRENT pDirEnt;
+ PFFINDLIST pFFindEntry;
+ FFINDDOSDATA FFindDD;
+ UNICODE_STRING FileUni;
+ WCHAR wcFile[MAX_PATH];
+
+
+ lpFile = (LPSTR) GetVDMAddr (getES(),getDI());
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "demFindFirstFCB<%s>\n", lpFile);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ pFCBSrchBuf = (PSRCHBUF) GetVDMAddr (getDS(),getSI());
+ pDirEnt = &pFCBSrchBuf->DirEnt;
+
+ STOREDWORD(pDirEnt->pFFindEntry,0);
+ STOREDWORD(pDirEnt->FFindId,0);
+
+
+ if (getDL() == ATTR_VOLUME_ID) {
+ FillFcbVolume(pFCBSrchBuf,lpFile, ATTR_VOLUME_ID);
+ return;
+ }
+
+
+ FileUni.Buffer = wcFile;
+ FileUni.MaximumLength = sizeof(wcFile);
+ if (!DemOemToUni(&FileUni ,lpFile)) {
+ setCF(1);
+ return;
+ }
+
+ SearchAttr = getAL() ? getDL() : 0;
+ pFFindEntry = SearchFile(wcFile, SearchAttr, NULL, &FFindDD);
+ if (!FFindDD.cFileName[0]){
+ demClientError(INVALID_HANDLE_VALUE, *lpFile);
+ return;
+ }
+
+ FillFCBSrchBuf(&FFindDD, pFCBSrchBuf);
+
+ if (pFFindEntry) {
+ STOREDWORD(pDirEnt->pFFindEntry,pFFindEntry);
+ STOREDWORD(pDirEnt->FFindId,pFFindEntry->FFindId);
+ }
+
+ setCF(0);
+ return;
+}
+
+
+
+/* demFindNextFCB - FCB based Find Next file
+ *
+ * Entry - Client (DS:SI) - SRCHBUF where the information will be returned
+ * Client (Al) - 0 if not an extended FCB
+ * Client (DL) - Search Attributes
+ *
+ * Exit - Success
+ * Client (CF) = 0
+ * SRCHBUF is filled in
+ *
+ * Failure
+ * Client (AL) = -1
+ *
+ * NOTES
+ * Search Rules: Ignore Read_only and Archive bits.
+ * If DL == ATTR_NORMAL Search only for normal files
+ * If DL == ATTR_HIDDEN Search Hidden or normal files
+ * If DL == ATTR_SYSTEM Search System or normal files
+ * If DL == ATTR_DIRECTORY Search directory or normal files
+ * If DL == ATTR_VOLUME_ID Search only Volume_ID
+ */
+
+VOID demFindNextFCB (VOID)
+{
+ USHORT SearchAttr;
+ PSRCHBUF pSrchBuf;
+ PDIRENT pDirEnt;
+ PFFINDLIST pFFindEntry;
+ FFINDDOSDATA FFindDD;
+
+
+ pSrchBuf = (PSRCHBUF) GetVDMAddr (getDS(),getSI());
+ pDirEnt = &pSrchBuf->DirEnt;
+
+ pFFindEntry = GetFFindEntryByFindId(FETCHDWORD(pDirEnt->FFindId));
+ if (!pFFindEntry ||
+ FETCHDWORD(pDirEnt->pFFindEntry) != (DWORD)pFFindEntry ||
+ getDL() == ATTR_VOLUME_ID )
+ {
+ if (pFFindEntry &&
+ FETCHDWORD(pDirEnt->pFFindEntry) != (DWORD)pFFindEntry)
+ {
+ FreeFFindEntry(pFFindEntry);
+ }
+
+ STOREDWORD(pDirEnt->pFFindEntry,0);
+ STOREDWORD(pDirEnt->FFindId,0);
+
+ // DOS has only one error (no_more_files) for all causes.
+ setAX(ERROR_NO_MORE_FILES);
+ setCF(1);
+ return;
+ }
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "demFindNextFCB<%ws>\n", pFFindEntry->PathName.Buffer);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ SearchAttr = getAL() ? getDL() : 0;
+
+ //
+ // Search the dir
+ //
+ pFFindEntry = SearchFile(NULL,
+ SearchAttr,
+ pFFindEntry,
+ &FFindDD
+ );
+
+ if (!FFindDD.cFileName[0]) {
+ STOREDWORD(pDirEnt->pFFindEntry,0);
+ STOREDWORD(pDirEnt->FFindId,0);
+ setAX((USHORT) GetLastError());
+ setCF(1);
+ }
+
+ FillFCBSrchBuf(&FFindDD, pSrchBuf);
+
+ if (!pFFindEntry) {
+ STOREDWORD(pDirEnt->FFindId,0);
+ STOREDWORD(pDirEnt->pFFindEntry,0);
+ }
+
+ setCF(0);
+ return;
+}
+
+
+
+/* demTerminatePDB - PDB Terminate Notification
+ *
+ * Entry - Client (BX) - Terminating PDB
+ *
+ * Exit - None
+ *
+ */
+
+VOID demTerminatePDB (VOID)
+{
+ PPSP_FFINDLIST pPspFFindEntry;
+ USHORT PSP;
+
+ PSP = getBX ();
+
+ if(!IsFirstCall)
+ VDDTerminateUserHook(PSP);
+ /* let host knows a process is terminating */
+
+ HostTerminatePDB(PSP);
+
+ pPspFFindEntry = GetPspFFindList(PSP);
+ if (!pPspFFindEntry)
+ return;
+
+ if (!IsListEmpty(&pPspFFindEntry->FFindHeadList)) {
+ FreeFFindList( &pPspFFindEntry->FFindHeadList);
+ }
+
+ RemoveEntryList(&pPspFFindEntry->PspFFindEntry);
+ free(pPspFFindEntry);
+
+ return;
+}
+
+
+/* SearchFile - Common routine for FIND_FRST and FIND_NEXT
+ *
+ * Entry -
+ * PCHAR pwcFile file name to search for
+ * USHORT SearchAttr file attributes to match
+ * PFFINDLIST pFFindEntry, current list entry
+ * if new search FFindId is expected to be zero
+ * PFFINDDOSDATA pFFindDDOut, filled with the next file in search
+ *
+ * Exit - if no more files pFFindDDOut is filled with zeros
+ * returns PFFINDLIST if buffered entries exist, else NULL
+ */
+PFFINDLIST
+SearchFile(
+ PWCHAR pwcFile,
+ USHORT SearchAttr,
+ PFFINDLIST pFFindEntry,
+ PFFINDDOSDATA pFFindDDOut)
+{
+ NTSTATUS Status;
+ ULONG BufferSize;
+ FFINDLIST FFindEntry;
+ PFFINDLIST pFFEntry = NULL;
+
+
+ SearchAttr &= ~(ATTR_READ_ONLY | ATTR_ARCHIVE | ATTR_DEVICE);
+ Status = STATUS_NO_MORE_FILES;
+
+ if (pFFindDDOut) {
+ memset(pFFindDDOut, 0, sizeof(FFINDDOSDATA));
+ }
+
+ try {
+ if (pFFindEntry) {
+ pFFEntry = pFFindEntry;
+ Status = pFFindEntry->LastQueryStatus;
+
+ if (pFFindDDOut) {
+ *pFFindDDOut = pFFEntry->DosData;
+ pFFEntry->DosData.cFileName[0] = '\0';
+ }
+ else {
+ return pFFEntry;
+ }
+
+ if (pFFEntry->FindBufferNext || pFFEntry->DirectoryHandle) {
+ NTSTATUS st;
+
+ st = FileFindNext(&pFFEntry->DosData,
+ pFFEntry
+ );
+
+ if (NT_SUCCESS(st)) {
+ return pFFEntry;
+ }
+
+ if (pFFEntry->DirectoryHandle) {
+ Status = st;
+ }
+ }
+
+ //
+ // Check Last Known Status before retrying
+ //
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+
+
+ //
+ // Reopen the FileFind Handle with a large buffer size
+ //
+ Status = FileFindOpen(NULL,
+ pFFEntry,
+ 4096
+ );
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+
+ //
+ // reset the search to the last known search pos
+ //
+ Status = FileFindReset(pFFEntry);
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+ }
+ else {
+ pFFEntry = &FFindEntry;
+ memset(pFFEntry, 0, sizeof(FFINDLIST));
+ pFFEntry->SupportReset = TRUE;
+ pFFEntry->usSrchAttr = SearchAttr;
+
+
+ Status = FileFindOpen(pwcFile,
+ pFFEntry,
+ 1024
+ );
+
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+
+ //
+ // Fill up pFFindDDOut
+ //
+ if (pFFindDDOut) {
+ Status = FileFindNext(pFFindDDOut, pFFEntry);
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+ }
+ }
+
+ //
+ // Fill up pFFEntry->DosData
+ //
+ Status = FileFindNext(&pFFEntry->DosData, pFFEntry);
+ if (!NT_SUCCESS(Status)) {
+ return NULL;
+ }
+
+
+ //
+ // if findfirst, fill in the static entries, and add the find entry
+ //
+ if (!pFFindEntry) {
+ pFFEntry->FFindId = NextFFindId++;
+ if (NextFFindId == 0xffffffff) {
+ NextFFindId = FFINDID_BASE;
+ FFindIdWrap = TRUE;
+ }
+
+ if (FFindIdWrap) {
+ pFFindEntry = GetFFindEntryByFindId(NextFFindId);
+ if (pFFindEntry) {
+ FreeFFindEntry(pFFindEntry);
+ pFFindEntry = NULL;
+ }
+ }
+
+ pFFEntry = AddFFindEntry(pwcFile, pFFEntry);
+ if (!pFFEntry) {
+ pFFEntry = &FFindEntry;
+ pFFEntry->DosData.cFileName[0] = '\0';
+ Status = STATUS_NO_MEMORY;
+ return NULL;
+ }
+ }
+
+
+ //
+ // Try to fill one more entry. If the NtQuery for this search
+ // is complete we can set the LastQueryStatus, and close dir handles.
+ //
+ Status = FileFindLast(pFFEntry);
+
+
+ }
+ finally {
+
+ if (pFFEntry) {
+
+ pFFEntry->LastQueryStatus = Status;
+
+ //
+ // if nothing is buffered, cleanup look aheads
+ //
+ if (!pFFEntry->DosData.cFileName[0] ||
+ pFFEntry->DirectoryHandle == FINDFILE_DEVICE)
+ {
+ if (pFFEntry == &FFindEntry) {
+ FileFindClose(pFFEntry);
+ RtlFreeUnicodeString(&pFFEntry->FileName);
+ RtlFreeUnicodeString(&pFFEntry->PathName);
+ }
+ else {
+ FreeFFindEntry(pFFEntry);
+ }
+ SetLastError(RtlNtStatusToDosError(Status));
+ pFFEntry = NULL;
+ }
+ }
+
+
+
+ if (pFFEntry) {
+
+ if (pFFEntry->DirectoryHandle) {
+ if (!pFFindEntry || !NT_SUCCESS(pFFEntry->LastQueryStatus)) {
+ NumDirectoryHandle--;
+ NtClose(pFFEntry->DirectoryHandle);
+ pFFEntry->DirectoryHandle = 0;
+ }
+ }
+
+ if (NumFindBuffer > MAX_FINDBUFFER ||
+ NumDirectoryHandle > MAX_DIRECTORYHANDLE)
+ {
+ CloseOldestFileFindBuffer();
+ }
+
+ //
+ // Set HeartBeat timer to close find buffers, directory handle
+ // Tics = 8(min) * 60(sec/min) * 18(tic/sec)
+ //
+ pFFEntry->FindFileTics.QuadPart = 8640 + FindFileTics.QuadPart;
+ if (!FindFileTics.QuadPart) {
+ NextFindFileTics.QuadPart = pFFEntry->FindFileTics.QuadPart;
+ }
+ }
+
+
+ }
+
+ return pFFEntry;
+}
+
+
+
+NTSTATUS
+FileFindOpen(
+ PWCHAR pwcFile,
+ PFFINDLIST pFFindEntry,
+ ULONG BufferSize
+ )
+{
+ NTSTATUS Status;
+ BOOLEAN bStatus;
+ BOOLEAN bReturnSingleEntry;
+ PWCHAR pwc;
+ OBJECT_ATTRIBUTES Obja;
+ PUNICODE_STRING FileName;
+ PUNICODE_STRING PathName;
+ IO_STATUS_BLOCK IoStatusBlock;
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo;
+
+
+ Status = STATUS_SUCCESS;
+ PathName = &pFFindEntry->PathName;
+ FileName = &pFFindEntry->FileName;
+
+ try {
+
+ if (pFFindEntry->DirectoryHandle == FINDFILE_DEVICE) {
+ Status = STATUS_NO_MORE_FILES;
+ goto FFOFinallyExit;
+ }
+
+
+ if (BufferSize <= sizeof(FILE_BOTH_DIR_INFORMATION) +
+ MAXIMUM_FILENAME_LENGTH*sizeof(WCHAR))
+ {
+ Status = STATUS_BUFFER_TOO_SMALL;
+ goto FFOFinallyExit;
+ }
+
+
+
+ if (pwcFile) {
+ bStatus = RtlDosPathNameToNtPathName_U(pwcFile,
+ PathName,
+ &pwc,
+ NULL
+ );
+
+ if (!bStatus ) {
+ Status = STATUS_OBJECT_PATH_NOT_FOUND;
+ goto FFOFinallyExit;
+ }
+
+ //
+ // Copy out the PathName, FileName
+ //
+ if (pwc) {
+ bStatus = RtlCreateUnicodeString(FileName,
+ pwc
+ );
+ if (!bStatus) {
+ Status = STATUS_NO_MEMORY;
+ goto FFOFinallyExit;
+ }
+
+ PathName->Length = (USHORT)((ULONG)pwc - (ULONG)PathName->Buffer);
+ if (PathName->Buffer[(PathName->Length>>1)-2] != (WCHAR)':' ) {
+ PathName->Length -= sizeof(UNICODE_NULL);
+ }
+ }
+ else {
+ FileName->Length = 0;
+ FileName->MaximumLength = 0;
+ }
+
+ bReturnSingleEntry = FALSE;
+ }
+ else {
+ bReturnSingleEntry = pFFindEntry->SupportReset;
+ }
+
+
+
+ //
+ // Prepare Find Buffer for NtQueryDirectory
+ //
+ if (BufferSize != pFFindEntry->FindBufferLength) {
+ if (pFFindEntry->FindBufferBase) {
+ RtlFreeHeap(RtlProcessHeap(), 0, pFFindEntry->FindBufferBase);
+ }
+ else {
+ NumFindBuffer++;
+ }
+
+ pFFindEntry->FindBufferBase = RtlAllocateHeap(RtlProcessHeap(),
+ 0,
+ BufferSize
+ );
+ if (!pFFindEntry->FindBufferBase) {
+ Status = STATUS_NO_MEMORY;
+ goto FFOFinallyExit;
+ }
+ }
+
+ pFFindEntry->FindBufferNext = NULL;
+ pFFindEntry->FindBufferLength = BufferSize;
+ DirectoryInfo = pFFindEntry->FindBufferBase;
+
+ //
+ // Open the directory for list access
+ //
+ if (!pFFindEntry->DirectoryHandle) {
+
+ InitializeObjectAttributes(
+ &Obja,
+ PathName,
+ OBJ_CASE_INSENSITIVE,
+ NULL,
+ NULL
+ );
+
+ Status = NtOpenFile(
+ &pFFindEntry->DirectoryHandle,
+ FILE_LIST_DIRECTORY | SYNCHRONIZE,
+ &Obja,
+ &IoStatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ FILE_DIRECTORY_FILE | FILE_SYNCHRONOUS_IO_NONALERT | FILE_OPEN_FOR_BACKUP_INTENT
+ );
+
+ if (!NT_SUCCESS(Status)) {
+
+ if (pwcFile) {
+ pFFindEntry->DirectoryHandle = FileFindFirstDevice(pwcFile,
+ DirectoryInfo
+ );
+ }
+ else {
+ pFFindEntry->DirectoryHandle = NULL;
+ }
+
+ if (pFFindEntry->DirectoryHandle) {
+ Status = STATUS_SUCCESS;
+ goto FFOFinallyExit;
+ }
+
+ if (Status == STATUS_OBJECT_NAME_NOT_FOUND ||
+ Status == STATUS_OBJECT_TYPE_MISMATCH )
+ {
+ Status = STATUS_OBJECT_PATH_NOT_FOUND;
+ }
+ goto FFOFinallyExit;
+ }
+
+ NumDirectoryHandle++;
+ }
+
+
+ //
+ // Prepare the filename for NtQueryDirectory
+ //
+
+ if (pwcFile) {
+ WCHAR wchCurr, wchPrev;
+
+ int Len = FileName->Length/sizeof(WCHAR);
+
+ //
+ // If there is no file part, but we are not looking at a device exit
+ //
+ if (!Len) {
+ Status = STATUS_OBJECT_PATH_NOT_FOUND;
+ goto FFOFinallyExit;
+ }
+
+
+ //
+ // ntio expects the following transmogrifications:
+ //
+ // - Change all ? to DOS_QM
+ // - Change all . followed by ? or * to DOS_DOT
+ // - Change all * followed by a . into DOS_STAR
+ //
+ // However, the doskrnl and wow32 have expanded '*'s to '?'s
+ // so the * rules can be ignored.
+ //
+ pwc = FileName->Buffer;
+ wchPrev = 0;
+ while (Len--) {
+ wchCurr = *pwc;
+
+ if (wchCurr == L'?') {
+ if (wchPrev == L'.') {
+ *(pwc - 1) = DOS_DOT;
+ }
+
+ *pwc = DOS_QM;
+ }
+
+ wchPrev = wchCurr;
+ pwc++;
+ }
+
+ }
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer,
+ "FFOpen %x %ws (%ws)\n",
+ pFFindEntry->DirectoryHandle,
+ FileName->Buffer,
+ pwcFile
+ );
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+
+ //
+ // Do an initial query to fill the buffers, and verify everything is ok
+ //
+
+ Status = NtQueryDirectoryFile(
+ pFFindEntry->DirectoryHandle,
+ NULL,
+ NULL,
+ NULL,
+ &IoStatusBlock,
+ DirectoryInfo,
+ BufferSize,
+ FileBothDirectoryInformation,
+ bReturnSingleEntry,
+ FileName,
+ FALSE
+ );
+
+FFOFinallyExit:;
+
+ }
+ finally {
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ if ((fShowSVCMsg & DEMFILIO) && !NT_SUCCESS(Status)) {
+ sprintf(demDebugBuffer, "FFOpen Status %x\n", Status);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ FileFindClose(pFFindEntry);
+ RtlFreeUnicodeString(PathName);
+ PathName->Buffer = NULL;
+ RtlFreeUnicodeString(FileName);
+ FileName->Buffer = NULL;
+ }
+ else {
+ pFFindEntry->FindBufferNext = pFFindEntry->FindBufferBase;
+ }
+ }
+
+ return Status;
+}
+
+
+
+/*
+ * Closes a FileFindHandle
+ */
+VOID
+FileFindClose(
+ PFFINDLIST pFFindEntry
+ )
+{
+ NTSTATUS Status;
+ HANDLE DirectoryHandle;
+
+ DirectoryHandle = pFFindEntry->DirectoryHandle;
+ if (DirectoryHandle &&
+ DirectoryHandle != FINDFILE_DEVICE)
+ {
+ NtClose(DirectoryHandle);
+ --NumDirectoryHandle;
+ }
+
+ pFFindEntry->DirectoryHandle = 0;
+
+ if (pFFindEntry->FindBufferBase) {
+ RtlFreeHeap(RtlProcessHeap(), 0, pFFindEntry->FindBufferBase);
+ --NumFindBuffer;
+ }
+
+ pFFindEntry->FindBufferBase = NULL;
+ pFFindEntry->FindBufferNext = NULL;
+ pFFindEntry->FindBufferLength = 0;
+ pFFindEntry->FindFileTics.QuadPart = 0;
+
+ if (!NumDirectoryHandle && !NumFindBuffer) {
+ FindFileTics.QuadPart = 0;
+ NextFindFileTics.QuadPart = 0;
+ }
+}
+
+
+
+/*
+ * FileFindReset
+ *
+ * Resets search pos according to FileName, FileIndex.
+ * The FindBuffers will point to the next file in the search
+ * order. Assumes that the remembered search pos, has not been
+ * reached yet for the current search.
+ *
+ */
+NTSTATUS
+FileFindReset(
+ PFFINDLIST pFFindEntry
+ )
+{
+ NTSTATUS Status;
+ IO_STATUS_BLOCK IoStatusBlock;
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo;
+ UNICODE_STRING LastFileName;
+ UNICODE_STRING CurrFileName;
+ BOOLEAN bSlowReset;
+
+
+ if (pFFindEntry->DirectoryHandle == FINDFILE_DEVICE) {
+ return STATUS_NO_MORE_FILES;
+ }
+
+ Status = STATUS_UNSUCCESSFUL;
+
+ LastFileName.Length = (USHORT)pFFindEntry->DosData.FileNameLength;
+ LastFileName.MaximumLength = (USHORT)pFFindEntry->DosData.FileNameLength;
+ LastFileName.Buffer = pFFindEntry->DosData.FileName;
+
+ RtlInitUnicodeString(&CurrFileName, L".");
+ if (!RtlCompareUnicodeString(&LastFileName, &CurrFileName, TRUE)) {
+ bSlowReset = TRUE;
+ }
+ else {
+ RtlInitUnicodeString(&CurrFileName, L"..");
+ if (!RtlCompareUnicodeString(&LastFileName, &CurrFileName, TRUE)) {
+ bSlowReset = TRUE;
+ }
+ else {
+ bSlowReset = FALSE;
+ }
+ }
+
+ //
+ // if the last file name, wasn't Dots and the volume supports reset
+ // functionality call nt file sysetm to do the reset.
+ //
+ if (!bSlowReset && pFFindEntry->SupportReset) {
+ VDMQUERYDIRINFO VdmQueryDirInfo;
+ UNICODE_STRING UnicodeString;
+
+ DirectoryInfo = (PFILE_BOTH_DIR_INFORMATION) pFFindEntry->FindBufferBase;
+
+ VdmQueryDirInfo.FileHandle = pFFindEntry->DirectoryHandle;
+ VdmQueryDirInfo.FileInformation = DirectoryInfo;
+ VdmQueryDirInfo.Length = pFFindEntry->FindBufferLength;
+ VdmQueryDirInfo.FileIndex = pFFindEntry->DosData.FileIndex;
+
+ UnicodeString.Length = (USHORT)pFFindEntry->DosData.FileNameLength;
+ UnicodeString.MaximumLength = UnicodeString.Length;
+ UnicodeString.Buffer = pFFindEntry->DosData.FileName;
+ VdmQueryDirInfo.FileName = &UnicodeString;
+
+ Status = NtVdmControl(VdmQueryDir, &VdmQueryDirInfo);
+ if (NT_SUCCESS(Status) ||
+ Status == STATUS_NO_MORE_FILES || Status == STATUS_NO_SUCH_FILE)
+ {
+ return Status;
+ }
+
+ pFFindEntry->SupportReset = TRUE;
+
+ }
+
+ //
+ // Reset the slow way by comparing FileName directly.
+ //
+ // WARNING: if the "remembered" File has been deleted we will
+ // fail, is there something else we can do ?
+ //
+
+ Status = STATUS_NO_MORE_FILES;
+ while (TRUE) {
+
+ //
+ // If there is no data in the find file buffer, call NtQueryDir
+ //
+
+ DirectoryInfo = pFFindEntry->FindBufferNext;
+ if (!DirectoryInfo) {
+ DirectoryInfo = pFFindEntry->FindBufferBase;
+
+ Status = NtQueryDirectoryFile(
+ pFFindEntry->DirectoryHandle,
+ NULL, // no event
+ NULL, // no apcRoutine
+ NULL, // no apcContext
+ &IoStatusBlock,
+ DirectoryInfo,
+ pFFindEntry->FindBufferLength,
+ FileBothDirectoryInformation,
+ FALSE, // single entry
+ NULL, // no file name
+ FALSE
+ );
+
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "FFReset Status %x\n", Status);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ return Status;
+ }
+ }
+
+ if ( DirectoryInfo->NextEntryOffset ) {
+ pFFindEntry->FindBufferNext = (PVOID)((ULONG)DirectoryInfo +
+ DirectoryInfo->NextEntryOffset);
+ }
+ else {
+ pFFindEntry->FindBufferNext = NULL;
+ }
+
+
+ if (DirectoryInfo->FileIndex == pFFindEntry->DosData.FileIndex) {
+ CurrFileName.Length = (USHORT)DirectoryInfo->FileNameLength;
+ CurrFileName.MaximumLength = (USHORT)DirectoryInfo->FileNameLength;
+ CurrFileName.Buffer = DirectoryInfo->FileName;
+
+ if (!RtlCompareUnicodeString(&LastFileName, &CurrFileName, TRUE)) {
+ return STATUS_SUCCESS;
+ }
+ }
+
+ }
+
+ return Status;
+
+}
+
+
+
+
+/*
+ * FileFindLast - Attempts to fill the FindFile buffer completely.
+ *
+ *
+ * PFFINDLIST pFFindEntry -
+ *
+ * Returns - Status of NtQueryDir operation if invoked, otherwise
+ * STATUS_SUCCESS.
+ *
+ */
+NTSTATUS
+FileFindLast(
+ PFFINDLIST pFFindEntry
+ )
+{
+ NTSTATUS Status;
+ IO_STATUS_BLOCK IoStatusBlock;
+ PFILE_BOTH_DIR_INFORMATION DirInfo, LastDirInfo;
+ LONG BytesLeft;
+
+ if (pFFindEntry->DirectoryHandle == FINDFILE_DEVICE) {
+ return STATUS_NO_MORE_FILES;
+ }
+
+ if (pFFindEntry->FindBufferNext) {
+ ULONG BytesOffset;
+
+ BytesOffset = (ULONG)pFFindEntry->FindBufferNext -
+ (ULONG)pFFindEntry->FindBufferBase;
+
+ if (BytesOffset) {
+ RtlMoveMemory(pFFindEntry->FindBufferBase,
+ pFFindEntry->FindBufferNext,
+ pFFindEntry->FindBufferLength - BytesOffset
+ );
+ }
+
+ pFFindEntry->FindBufferNext = pFFindEntry->FindBufferBase;
+ DirInfo = pFFindEntry->FindBufferBase;
+
+ while (DirInfo->NextEntryOffset) {
+ DirInfo = (PVOID)((ULONG)DirInfo + DirInfo->NextEntryOffset);
+ }
+ LastDirInfo = DirInfo;
+
+ DirInfo = (PVOID)&DirInfo->FileName[DirInfo->FileNameLength>>1];
+
+ DirInfo = (PVOID) (((ULONG) DirInfo + sizeof(LONGLONG) - 1) &
+ ~(sizeof(LONGLONG) - 1));
+
+ BytesLeft = pFFindEntry->FindBufferLength -
+ ((ULONG)DirInfo - (ULONG)pFFindEntry->FindBufferBase);
+ }
+ else {
+ DirInfo = pFFindEntry->FindBufferBase;
+ LastDirInfo = NULL;
+ BytesLeft = pFFindEntry->FindBufferLength;
+ }
+
+
+ // the size of the dirinfo structure including the name must be a longlong.
+ while (BytesLeft > sizeof(FILE_BOTH_DIR_INFORMATION) + sizeof(LONGLONG)) {
+
+ Status = NtQueryDirectoryFile(
+ pFFindEntry->DirectoryHandle,
+ NULL, // no event
+ NULL, // no apcRoutine
+ NULL, // no apcContext
+ &IoStatusBlock,
+ DirInfo,
+ BytesLeft,
+ FileBothDirectoryInformation,
+ FALSE, // single entry ?
+ NULL, // no file name
+ FALSE
+ );
+
+ if (Status == STATUS_NO_MORE_FILES || Status == STATUS_NO_SUCH_FILE) {
+#if DBG
+ if ((fShowSVCMsg & DEMFILIO)) {
+ sprintf(demDebugBuffer, "FFLast Status %x\n", Status);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ return Status;
+ }
+
+
+ if (!NT_SUCCESS(Status)) {
+ break;
+ }
+
+ if (LastDirInfo) {
+ LastDirInfo->NextEntryOffset =(ULONG)DirInfo - (ULONG)LastDirInfo;
+ }
+ else {
+ pFFindEntry->FindBufferNext = pFFindEntry->FindBufferBase;
+ }
+
+ while (DirInfo->NextEntryOffset) {
+ DirInfo = (PVOID)((ULONG)DirInfo + DirInfo->NextEntryOffset);
+ }
+ LastDirInfo = DirInfo;
+ DirInfo = (PVOID)&DirInfo->FileName[DirInfo->FileNameLength>>1];
+
+ DirInfo = (PVOID) (((ULONG) DirInfo + sizeof(LONGLONG) - 1) &
+ ~(sizeof(LONGLONG) - 1));
+
+ BytesLeft = pFFindEntry->FindBufferLength -
+ ((ULONG)DirInfo - (ULONG)pFFindEntry->FindBufferBase);
+ }
+
+ return STATUS_SUCCESS;
+}
+
+
+
+
+
+
+/*
+ * FileFindNext - retrieves the next file in the current search order,
+ *
+ * PFFINDDOSDATA pFFindDD
+ * Receives File info returned by the nt FileSystem
+ *
+ * PFFINDLIST pFFindEntry -
+ * Contains the DirectoryInfo (FileName,FileIndex) necessary to reset a
+ * search pos. For operations other than QDIR_RESET_SCAN, this is ignored.
+ *
+ * Returns -
+ * If Got a DirectoryInformation Entry, STATUS_SUCCESS
+ * If no Open Directory handle and is unknown if there are more files
+ * returns STATUS_IN`VALID_HANDLE
+ *
+ */
+NTSTATUS
+FileFindNext(
+ PFFINDDOSDATA pFFindDD,
+ PFFINDLIST pFFindEntry
+ )
+{
+ NTSTATUS Status;
+ IO_STATUS_BLOCK IoStatusBlock;
+
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo;
+
+ if (pFFindEntry->DirectoryHandle == FINDFILE_DEVICE) {
+ return STATUS_NO_MORE_FILES;
+ }
+
+ Status = STATUS_UNSUCCESSFUL;
+
+ do {
+
+ //
+ // If there is no data in the find file buffer, call NtQueryDir
+ //
+
+ DirectoryInfo = pFFindEntry->FindBufferNext;
+ if (!DirectoryInfo) {
+ if (!pFFindEntry->DirectoryHandle) {
+ return STATUS_INVALID_HANDLE;
+ }
+
+ DirectoryInfo = pFFindEntry->FindBufferBase;
+
+ Status = NtQueryDirectoryFile(
+ pFFindEntry->DirectoryHandle,
+ NULL, // no event
+ NULL, // no apcRoutine
+ NULL, // no apcContext
+ &IoStatusBlock,
+ DirectoryInfo,
+ pFFindEntry->FindBufferLength,
+ FileBothDirectoryInformation,
+ FALSE, // single entry ?
+ NULL, // no file name
+ FALSE
+ );
+
+ if (!NT_SUCCESS(Status)) {
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "FFNext Status %x\n", Status);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+ return Status;
+ }
+ }
+
+
+ if ( DirectoryInfo->NextEntryOffset ) {
+ pFFindEntry->FindBufferNext = (PVOID)((ULONG)DirectoryInfo +
+ DirectoryInfo->NextEntryOffset);
+ }
+ else {
+ pFFindEntry->FindBufferNext = NULL;
+ }
+
+ } while (!CopyDirInfoToDosData(pFFindDD,
+ DirectoryInfo,
+ pFFindEntry->usSrchAttr
+ ));
+
+ return STATUS_SUCCESS;
+}
+
+
+
+
+/*
+ * CopyDirInfoToDosData
+ *
+ */
+BOOL
+CopyDirInfoToDosData(
+ PFFINDDOSDATA pFFindDD,
+ PFILE_BOTH_DIR_INFORMATION DirInfo,
+ USHORT SearchAttr
+ )
+{
+ NTSTATUS Status;
+ OEM_STRING OemString;
+ UNICODE_STRING UnicodeString;
+ DWORD dwAttr;
+ BOOLEAN SpacesInName = FALSE;
+ BOOLEAN NameValid8Dot3;
+
+ //
+ // match the attributes
+ // See DOS5.0 sources (dir2.asm, MatchAttributes)
+ // ignores READONLY and ARCHIVE bits
+ //
+ if (FILE_ATTRIBUTE_NORMAL == DirInfo->FileAttributes) {
+ DirInfo->FileAttributes = 0;
+ }
+ else {
+ DirInfo->FileAttributes &= DOS_ATTR_MASK;
+ }
+
+
+ dwAttr = DirInfo->FileAttributes;
+ dwAttr &= ~(FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_READONLY);
+ if (((~(ULONG)SearchAttr) & dwAttr) & ATTR_ALL)
+ return FALSE;
+
+
+ //
+ // set up the destination oem string buffer
+ //
+ OemString.Buffer = pFFindDD->cFileName;
+ OemString.MaximumLength = 14;
+
+ //
+ // see if the name is legal fat
+ //
+
+ UnicodeString.Buffer = DirInfo->FileName;
+ UnicodeString.Length = (USHORT)DirInfo->FileNameLength;
+ UnicodeString.MaximumLength = (USHORT)DirInfo->FileNameLength;
+
+ NameValid8Dot3 = RtlIsNameLegalDOS8Dot3( &UnicodeString,
+ &OemString,
+ &SpacesInName );
+
+ //
+ // if failed (incompatible codepage or illegal FAT name),
+ // use the short name
+ //
+ if (!NameValid8Dot3 ||
+ (SpacesInName && (DirInfo->ShortName[0] != UNICODE_NULL))) {
+
+ if (DirInfo->ShortName[0] == UNICODE_NULL) {
+ pFFindDD->cFileName[0] = '\0';
+ return FALSE;
+ }
+
+ UnicodeString.Buffer = DirInfo->ShortName;
+ UnicodeString.Length = (USHORT)DirInfo->ShortNameLength;
+ UnicodeString.MaximumLength = (USHORT)DirInfo->ShortNameLength;
+
+ if (!NT_SUCCESS(RtlUpcaseUnicodeStringToCountedOemString(&OemString, &UnicodeString, FALSE))) {
+ pFFindDD->cFileName[0] = '\0';
+ return FALSE;
+ }
+ }
+
+ OemString.Buffer[OemString.Length] = '\0';
+
+ // fill in time, size and attributes
+ pFFindDD->ftLastWriteTime = *(LPFILETIME)&DirInfo->LastWriteTime;
+ pFFindDD->dwFileSizeLow = DirInfo->EndOfFile.LowPart;
+ pFFindDD->uchFileAttributes = (UCHAR)DirInfo->FileAttributes;
+
+ // Save File Name, Index for restarting searches
+ pFFindDD->FileIndex = DirInfo->FileIndex;
+ pFFindDD->FileNameLength = DirInfo->FileNameLength;
+
+ RtlCopyMemory(pFFindDD->FileName,
+ DirInfo->FileName,
+ DirInfo->FileNameLength
+ );
+
+ pFFindDD->FileName[DirInfo->FileNameLength >> 1] = UNICODE_NULL;
+
+ return TRUE;
+}
+
+
+
+
+HANDLE
+FileFindFirstDevice(
+ PWCHAR FileName,
+ PFILE_BOTH_DIR_INFORMATION DirectoryInfo
+ )
+
+/*++
+
+Routine Description:
+
+ Determines if the FileName is a device, and copies out the
+ device name found if it is.
+
+Arguments:
+
+ FileName - Supplies the device name of the file to find.
+
+ pQueryDirInfo - On a successful find, this parameter returns information
+ about the located file.
+
+Return Value:
+
+
+--*/
+
+{
+ ULONG DeviceNameData;
+ PWSTR DeviceName;
+
+ DeviceNameData = RtlIsDosDeviceName_U(FileName);
+ if (DeviceNameData) {
+ RtlZeroMemory(DirectoryInfo, sizeof(FILE_BOTH_DIR_INFORMATION));
+
+ DirectoryInfo->FileAttributes = FILE_ATTRIBUTE_ARCHIVE;
+ DeviceName = (PWSTR)((ULONG)FileName + (DeviceNameData >> 16));
+
+ DeviceNameData &= 0xffff;
+
+ DirectoryInfo->FileNameLength = DeviceNameData;
+ DirectoryInfo->ShortNameLength = (CCHAR)DeviceNameData;
+
+
+ RtlCopyMemory(DirectoryInfo->FileName,
+ DeviceName,
+ DeviceNameData
+ );
+
+ RtlCopyMemory(DirectoryInfo->ShortName,
+ DeviceName,
+ DeviceNameData
+ );
+
+ return FINDFILE_DEVICE;
+ }
+
+ return NULL;
+}
+
+
+
+
+/* FillFcbVolume - fill Volume info in the FCB
+ *
+ * Entry - pSrchBuf FCB Search buffer to be filled in
+ * FileName File Name (interesting part is the drive letter)
+ *
+ * Exit - SUCCESS
+ * Client (CF) - 0
+ * pSrchBuf is filled with volume info
+ *
+ * FAILURE
+ * Client (CF) - 1
+ * Client (AX) = Error Code
+ */
+VOID
+FillFcbVolume(
+ PSRCHBUF pSrchBuf,
+ CHAR *pFileName,
+ USHORT SearchAttr
+ )
+{
+ CHAR *pch;
+ PDIRENT pDirEnt = &pSrchBuf->DirEnt;
+ CHAR FullPathBuffer[MAX_PATH];
+ CHAR achBaseName[DOS_VOLUME_NAME_SIZE + 2]; // 11 chars, '.', and null
+ CHAR achVolumeName[NT_VOLUME_NAME_SIZE];
+
+ //
+ // form a path without base name
+ // this makes sure only on root directory will get the
+ // volume label(the GetVolumeInformationOem will fail
+ // if the given path is not root directory)
+ //
+
+ strcpy(FullPathBuffer, pFileName);
+ pch = strrchr(FullPathBuffer, '\\');
+ if (pch) {
+ pch++;
+ // truncate to dos file name length (including period)
+ pch[DOS_VOLUME_NAME_SIZE + 1] = '\0';
+ strcpy(achBaseName, pch);
+ _strupr(achBaseName);
+ *pch = '\0';
+ }
+ else {
+ achBaseName[0] = '\0';
+ }
+
+
+ //
+ // if searching for volume only the DOS uses first 3 letters for
+ // root drive path ignoring the rest of the path
+ // as long as the full pathname is valid.
+ //
+ if (SearchAttr == ATTR_VOLUME_ID &&
+ (pch = strchr(FullPathBuffer, '\\')) &&
+ GetFileAttributes(FullPathBuffer) != 0xffffffff )
+ {
+ pch++;
+ *pch = '\0';
+ strcpy(achBaseName, szStartDotStar);
+ }
+
+
+ if (GetVolumeInformationOem(FullPathBuffer,
+ achVolumeName,
+ NT_VOLUME_NAME_SIZE,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0) == FALSE)
+ {
+
+ demClientError(INVALID_HANDLE_VALUE, *pFileName);
+ return;
+ }
+
+ // truncate to dos volumen max size (no period)
+ achVolumeName[DOS_VOLUME_NAME_SIZE] = '\0';
+
+ if (!achVolumeName[0] || !MatchVolLabel(achVolumeName, achBaseName)) {
+ SetLastError(ERROR_NO_MORE_FILES);
+ demClientError(INVALID_HANDLE_VALUE, *pFileName);
+ return;
+ }
+
+ // warning !!! this assumes the FileExt follows FileName immediately
+ memset(pSrchBuf->FileName, ' ', DOS_VOLUME_NAME_SIZE);
+ strncpy(pSrchBuf->FileName, achVolumeName, strlen(achVolumeName));
+
+ // Now copy the directory entry
+ strncpy(pDirEnt->FileName,pSrchBuf->FileName,8);
+ strncpy(pDirEnt->FileExt,pSrchBuf->FileExt,3);
+ setCF (0);
+ return;
+}
+
+
+/* FillDtaVolume - fill Volume info in the DTA
+ *
+ * Entry - CHAR lpSearchName - Optional name to match with volume name
+ *
+ *
+ * Exit - SUCCESS
+ * Returns - 0
+ * pSrchBuf is filled with volume info
+ *
+ * FAILURE
+ * Returns Error Code
+ */
+
+BOOL FillDtaVolume(
+ CHAR *pFileName,
+ PSRCHDTA pDta,
+ USHORT SearchAttr
+ )
+{
+ CHAR *pch;
+ CHAR FullPathBuffer[MAX_PATH];
+ CHAR achBaseName[DOS_VOLUME_NAME_SIZE + 2]; // 11 chars, '.' and null
+ CHAR achVolumeName[NT_VOLUME_NAME_SIZE];
+
+ //
+ // form a path without base name
+ // this makes sure only on root directory will get the
+ // volume label(the GetVolumeInformationOem will fail
+ // if the given path is not root directory)
+ //
+ strcpy(FullPathBuffer, pFileName);
+ pch = strrchr(FullPathBuffer, '\\');
+ if (pch) {
+ pch++;
+ pch[DOS_VOLUME_NAME_SIZE + 1] = '\0'; // max len (including period)
+ strcpy(achBaseName, pch);
+ _strupr(achBaseName);
+ *pch = '\0';
+ }
+ else {
+ achBaseName[0] = '\0';
+ }
+
+
+ //
+ // if searching for volume only the DOS uses first 3 letters for
+ // root drive path ignoring the rest of the path
+ // as long as the full path name is valid.
+ //
+ if (SearchAttr == ATTR_VOLUME_ID &&
+ (pch = strchr(FullPathBuffer, '\\')) &&
+ GetFileAttributes(FullPathBuffer) != 0xffffffff )
+ {
+ pch++;
+ *pch = '\0';
+ strcpy(achBaseName, szStartDotStar);
+ }
+
+ if (GetVolumeInformationOem(FullPathBuffer,
+ achVolumeName,
+ NT_VOLUME_NAME_SIZE,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ 0) == FALSE)
+ {
+ return FALSE;
+ }
+
+ // truncate to dos file name length (no period)
+ achVolumeName[DOS_VOLUME_NAME_SIZE] = '\0';
+
+ if (!achVolumeName[0] || !MatchVolLabel(achVolumeName, achBaseName)) {
+ SetLastError(ERROR_NO_MORE_FILES);
+ return FALSE;
+ }
+
+ //
+ // DOS Dta search returns volume label in 8.3 format. But if label is
+ // more than 8 characters long than NT just returns that as it is
+ // without adding a ".". So here we have to add a "." in volume
+ // labels, if needed. But note that FCB based volume search does'nt
+ // add the "." So nothing need to be done there.
+ //
+ NtVolumeNameToDosVolumeName(pDta->achFileName, achVolumeName);
+ pDta->uchFileAttr = ATTR_VOLUME_ID;
+ STOREWORD(pDta->usLowSize,0);
+ STOREWORD(pDta->usHighSize,0);
+
+ // Zero out dates as we can not fetch dates for volume labels.
+ STOREWORD(pDta->usTimeLastWrite,0);
+ STOREWORD(pDta->usDateLastWrite,0);
+
+ return TRUE;
+}
+
+
+
+/*
+ * MatchVolLabel
+ * Does a string compare to see if the vol label matches
+ * a FAT search string. The search string is expected to
+ * have the '*' character already expanded into '?' characters.
+ *
+ * WARNING: maintanes dos5.0 quirk of not caring about characters past
+ * the defined len of each part of the vol label.
+ * 12345678.123
+ * ^ ^
+ *
+ * foovol foovol1 (srch string)
+ * foo.vol foo.vol1 (srch string)
+ *
+ * entry: CHAR *pVol -- NT volume name
+ * CHAR *pSrch -- dos volume name
+ *
+ * exit: TRUE for a match
+ */
+BOOL MatchVolLabel(CHAR *pVol, CHAR *pSrch )
+{
+ WORD w;
+ CHAR achDosVolumeName[DOS_VOLUME_NAME_SIZE + 2]; // 11 chars, '.' and null
+
+ NtVolumeNameToDosVolumeName(achDosVolumeName, pVol);
+ pVol = achDosVolumeName;
+
+ w = 8;
+ while (w--) {
+ if (*pVol == *pSrch) {
+ if (!*pVol && !*pSrch)
+ return TRUE;
+ }
+ else if (*pSrch == '.') {
+ if (*pVol)
+ return FALSE;
+ }
+ else if (*pSrch != '?') {
+ return FALSE;
+ }
+
+ // move on to the next character
+ // but not past second component part
+ if (*pVol && *pVol != '.')
+ pVol++;
+ if (*pSrch && *pSrch != '.')
+ pSrch++;
+ }
+
+ // skip trailing part of search string, in the first comp
+ while (*pSrch && *pSrch != '.')
+ pSrch++;
+
+
+ w = 4;
+ while (w--) {
+ if (*pVol == *pSrch) {
+ if (!*pVol && !*pSrch)
+ return TRUE;
+ }
+ else if (*pSrch == '.') {
+ if (*pVol)
+ return FALSE;
+ }
+ else if (*pSrch != '?') {
+ return FALSE;
+ }
+
+ // move on to the next character
+ if (*pVol)
+ pVol++;
+ if (*pSrch)
+ pSrch++;
+ }
+
+ return TRUE;
+}
+
+
+VOID NtVolumeNameToDosVolumeName(CHAR * pDosName, CHAR * pNtName)
+{
+
+ char NtNameBuffer[NT_VOLUME_NAME_SIZE];
+ int i;
+ char char8, char9, char10;
+
+ // make a local copy so that the caller can use the same
+ // buffer
+ strcpy(NtNameBuffer, pNtName);
+
+ if (strlen(NtNameBuffer) > 8) {
+ char8 = NtNameBuffer[8];
+ char9 = NtNameBuffer[9];
+ char10 = NtNameBuffer[10];
+ // eat spaces from first 8 characters
+ i = 7;
+ while (NtNameBuffer[i] == ' ')
+ i--;
+ NtNameBuffer[i+1] = '.';
+ NtNameBuffer[i+2] = char8;
+ NtNameBuffer[i+3] = char9;
+ NtNameBuffer[i+4] = char10;
+ NtNameBuffer[i+5] = '\0';
+ }
+ strcpy(pDosName, NtNameBuffer);
+}
+
+
+
+
+
+/* FillFCBSrchBuf - Fill the FCB Search buffer.
+ *
+ * Entry - pSrchBuf FCB Search buffer to be filled in
+ * hFind Search Handle
+ * fFirst TRUE if call from FindFirstFCB
+ *
+ * Exit - None (pSrchBuf filled in)
+ *
+ */
+
+VOID FillFCBSrchBuf(
+ PFFINDDOSDATA pFFindDD,
+ PSRCHBUF pSrchBuf)
+{
+ PDIRENT pDirEnt = &pSrchBuf->DirEnt;
+ PCHAR pDot;
+ USHORT usDate,usTime,i;
+ FILETIME ftLocal;
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "FillFCBSrchBuf<%s>\n", pFFindDD->cFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ // Copy file name (Max Name = 8 and Max ext = 3)
+ if ((pDot = strchr(pFFindDD->cFileName,'.')) == NULL) {
+ strncpy(pSrchBuf->FileName,pFFindDD->cFileName,8);
+ _strnset(pSrchBuf->FileExt,'\x020',3);
+ }
+ else if (pDot == pFFindDD->cFileName) {
+ strncpy(pSrchBuf->FileName,pFFindDD->cFileName,8);
+ _strnset(pSrchBuf->FileExt,'\x020',3);
+ }
+ else {
+ *pDot = '\0';
+ strncpy(pSrchBuf->FileName,pFFindDD->cFileName,8);
+ *pDot++ = '\0';
+ strncpy(pSrchBuf->FileExt,pDot,3);
+ }
+
+
+ for (i=0;i<8;i++) {
+ if (pSrchBuf->FileName[i] == '\0')
+ pSrchBuf->FileName[i]='\x020';
+ }
+
+ for (i=0;i<3;i++) {
+ if (pSrchBuf->FileExt[i] == '\0')
+ pSrchBuf->FileExt[i]='\x020';
+ }
+
+ STOREWORD(pSrchBuf->usCurBlkNumber,0);
+ STOREWORD(pSrchBuf->usRecordSize,0);
+ STOREDWORD(pSrchBuf->ulFileSize, pFFindDD->dwFileSizeLow);
+
+ // Convert NT File time/date to DOS time/date
+ FileTimeToLocalFileTime (&pFFindDD->ftLastWriteTime,&ftLocal);
+ FileTimeToDosDateTime (&ftLocal,
+ &usDate,
+ &usTime);
+
+ // Now copy the directory entry
+ strncpy(pDirEnt->FileName,pSrchBuf->FileName,8);
+ strncpy(pDirEnt->FileExt,pSrchBuf->FileExt,3);
+
+ pDirEnt->uchAttributes = pFFindDD->uchFileAttributes;
+
+ STOREWORD(pDirEnt->usTime,usTime);
+ STOREWORD(pDirEnt->usDate,usDate);
+ STOREDWORD(pDirEnt->ulFileSize,pFFindDD->dwFileSizeLow);
+
+ return;
+}
+
+
+
+/* FillSrchDta - Fill DTA for FIND_FIRST,FIND_NEXT operations.
+ *
+ * Entry - pW32FindData Buffer containing file data
+ * hFind - Handle returned by FindFirstFile
+ * PSRCHDTA pDta
+ *
+ * Exit - None
+ *
+ * Note : It is guranteed that file name adhers to 8:3 convention.
+ * demSrchFile makes sure of that condition.
+ *
+ */
+VOID
+FillSrchDta(
+ PFFINDDOSDATA pFFindDD,
+ PSRCHDTA pDta)
+{
+ USHORT usDate,usTime;
+ FILETIME ftLocal;
+
+ pDta->uchFileAttr = pFFindDD->uchFileAttributes;
+
+ // Convert NT File time/date to DOS time/date
+ FileTimeToLocalFileTime (&pFFindDD->ftLastWriteTime,&ftLocal);
+ FileTimeToDosDateTime (&ftLocal,
+ &usDate,
+ &usTime);
+
+ STOREWORD(pDta->usTimeLastWrite,usTime);
+ STOREWORD(pDta->usDateLastWrite,usDate);
+ STOREWORD(pDta->usLowSize,(USHORT)pFFindDD->dwFileSizeLow);
+ STOREWORD(pDta->usHighSize,(USHORT)(pFFindDD->dwFileSizeLow >> 16));
+
+#if DBG
+ if (fShowSVCMsg & DEMFILIO) {
+ sprintf(demDebugBuffer, "FillSrchDta<%s>\n", pFFindDD->cFileName);
+ OutputDebugStringOem(demDebugBuffer);
+ }
+#endif
+
+ strncpy(pDta->achFileName,pFFindDD->cFileName, 13);
+
+ return;
+}
+
+
+
+
+
+VOID demCloseAllPSPRecords (VOID)
+{
+ PLIST_ENTRY Next;
+ PPSP_FFINDLIST pPspFFindEntry;
+
+ Next = PspFFindHeadList.Flink;
+ while (Next != &PspFFindHeadList) {
+ pPspFFindEntry = CONTAINING_RECORD(Next,PSP_FFINDLIST,PspFFindEntry);
+ FreeFFindList( &pPspFFindEntry->FFindHeadList);
+ Next= Next->Flink;
+ RemoveEntryList(&pPspFFindEntry->PspFFindEntry);
+ free(pPspFFindEntry);
+ }
+}
+
+
+void
+DemHeartBeat(void)
+{
+
+ PLIST_ENTRY Next;
+ PLIST_ENTRY pFFindHeadList;
+ PPSP_FFINDLIST pPspFFindEntry;
+ PFFINDLIST pFFindEntry;
+
+ if (!NumFindBuffer ||
+ NextFindFileTics.QuadPart > ++FindFileTics.QuadPart)
+ {
+ return;
+ }
+
+ pPspFFindEntry = GetPspFFindList(FETCHWORD(pusCurrentPDB[0]));
+ if (!pPspFFindEntry) {
+ return;
+ }
+ pFFindHeadList = &pPspFFindEntry->FFindHeadList;
+ Next = pFFindHeadList->Blink;
+ while (Next != pFFindHeadList) {
+ pFFindEntry = CONTAINING_RECORD(Next,FFINDLIST, FFindEntry);
+
+ if (pFFindEntry->FindFileTics.QuadPart) {
+ if (pFFindEntry->FindFileTics.QuadPart <= FindFileTics.QuadPart) {
+ FileFindClose(pFFindEntry);
+ }
+ else {
+ NextFindFileTics.QuadPart = pFFindEntry->FindFileTics.QuadPart;
+ return;
+ }
+ }
+
+ Next = Next->Blink;
+ }
+
+ NextFindFileTics.QuadPart = 0;
+ FindFileTics.QuadPart = 0;
+}
+
+
+
+
+
+//
+// CloseOldestFileFindBuffer
+// walks the psp file find list backwards to find the oldest
+// entry with FindBuffers, directory handles and closes it.
+//
+void
+CloseOldestFileFindBuffer(
+ void
+ )
+{
+ PLIST_ENTRY Next, NextPsp;
+ PLIST_ENTRY pFFindHeadList;
+ PPSP_FFINDLIST pPspFFindEntry;
+ PFFINDLIST pFFEntry;
+
+ NextPsp = PspFFindHeadList.Blink;
+ while (NextPsp != &PspFFindHeadList) {
+ pPspFFindEntry = CONTAINING_RECORD(NextPsp,PSP_FFINDLIST,PspFFindEntry);
+
+ pFFindHeadList = &pPspFFindEntry->FFindHeadList;
+ Next = pFFindHeadList->Blink;
+ while (Next != pFFindHeadList) {
+ pFFEntry = CONTAINING_RECORD(Next,FFINDLIST, FFindEntry);
+ if (NumFindBuffer >= MAX_FINDBUFFER) {
+ FileFindClose(pFFEntry);
+ }
+ else if (pFFEntry->DirectoryHandle &&
+ NumDirectoryHandle >= MAX_DIRECTORYHANDLE)
+ {
+ NumDirectoryHandle--;
+ NtClose(pFFEntry->DirectoryHandle);
+ pFFEntry->DirectoryHandle = 0;
+ }
+
+ if (NumFindBuffer < MAX_FINDBUFFER &&
+ NumDirectoryHandle < MAX_DIRECTORYHANDLE)
+ {
+ return;
+ }
+ Next = Next->Blink;
+ }
+
+ NextPsp= NextPsp->Blink;
+ }
+}
+
+
+
+
+
+/*
+ * GetFFindEntryByFindId
+ */
+PFFINDLIST GetFFindEntryByFindId(ULONG NextFFindId)
+{
+ PLIST_ENTRY NextPsp;
+ PLIST_ENTRY Next;
+ PPSP_FFINDLIST pPspFFindEntry;
+ PFFINDLIST pFFindEntry;
+ PLIST_ENTRY pFFindHeadList;
+
+ NextPsp = PspFFindHeadList.Flink;
+ while (NextPsp != &PspFFindHeadList) {
+ pPspFFindEntry = CONTAINING_RECORD(NextPsp,PSP_FFINDLIST,PspFFindEntry);
+
+ pFFindHeadList = &pPspFFindEntry->FFindHeadList;
+ Next = pFFindHeadList->Flink;
+ while (Next != pFFindHeadList) {
+ pFFindEntry = CONTAINING_RECORD(Next, FFINDLIST, FFindEntry);
+ if (pFFindEntry->FFindId == NextFFindId) {
+ return pFFindEntry;
+ }
+ Next= Next->Flink;
+ }
+
+ NextPsp= NextPsp->Flink;
+ }
+
+ return NULL;
+}
+
+
+
+/* AddFFindEntry - Adds a new File Find entry to the current
+ * PSP's PspFileFindList
+ *
+ * Entry -
+ *
+ * Exit - PFFINDLIST pFFindList;
+ */
+PFFINDLIST
+AddFFindEntry(
+ PWCHAR pwcFile,
+ PFFINDLIST pFFindEntrySrc
+ )
+
+{
+ PPSP_FFINDLIST pPspFFindEntry;
+ PFFINDLIST pFFindEntry;
+ ULONG Len;
+
+ pPspFFindEntry = GetPspFFindList(FETCHWORD(pusCurrentPDB[0]));
+
+ //
+ // if a Psp entry doesn't exist
+ // Allocate one, initialize it and insert it into the list
+ //
+ if (!pPspFFindEntry) {
+ pPspFFindEntry = (PPSP_FFINDLIST) malloc(sizeof(PSP_FFINDLIST));
+ if (!pPspFFindEntry)
+ return NULL;
+
+ pPspFFindEntry->usPsp = FETCHWORD(pusCurrentPDB[0]);
+ InitializeListHead(&pPspFFindEntry->FFindHeadList);
+ InsertHeadList(&PspFFindHeadList, &pPspFFindEntry->PspFFindEntry);
+ }
+
+ //
+ // Create the FileFindEntry and add to the FileFind list
+ //
+ pFFindEntry = (PFFINDLIST) malloc(sizeof(FFINDLIST));
+ if (!pFFindEntry) {
+ return pFFindEntry;
+ }
+
+ //
+ // Fill in FFindList
+ //
+ *pFFindEntry = *pFFindEntrySrc;
+
+ //
+ // Insert at the head of this psp list
+ //
+ InsertHeadList(&pPspFFindEntry->FFindHeadList, &pFFindEntry->FFindEntry);
+
+ return pFFindEntry;
+}
+
+
+
+
+
+/* FreeFFindEntry
+ *
+ * Entry - PFFINDLIST pFFindEntry
+ *
+ * Exit - None
+ *
+ */
+VOID FreeFFindEntry(PFFINDLIST pFFindEntry)
+{
+ RemoveEntryList(&pFFindEntry->FFindEntry);
+ FileFindClose(pFFindEntry);
+ RtlFreeUnicodeString(&pFFindEntry->FileName);
+ RtlFreeUnicodeString(&pFFindEntry->PathName);
+ free(pFFindEntry);
+ return;
+}
+
+
+
+/* FreeFFindList
+ *
+ * Entry - Frees the entire list
+ *
+ * Exit - None
+ *
+ */
+VOID FreeFFindList(PLIST_ENTRY pFFindHeadList)
+{
+ PLIST_ENTRY Next;
+ PFFINDLIST pFFindEntry;
+
+ Next = pFFindHeadList->Flink;
+ while (Next != pFFindHeadList) {
+ pFFindEntry = CONTAINING_RECORD(Next,FFINDLIST, FFindEntry);
+ Next= Next->Flink;
+ FreeFFindEntry(pFFindEntry);
+ }
+
+ return;
+}
+
+
+/* GetPspFFindList
+ *
+ * Entry - USHORT CurrPsp
+ *
+ * Exit - Success - PPSP_FFINDLIST
+ * Failure - NULL
+ *
+ */
+PPSP_FFINDLIST GetPspFFindList(USHORT CurrPsp)
+{
+ PLIST_ENTRY Next;
+ PPSP_FFINDLIST pPspFFindEntry;
+
+ Next = PspFFindHeadList.Flink;
+ while (Next != &PspFFindHeadList) {
+ pPspFFindEntry = CONTAINING_RECORD(Next,PSP_FFINDLIST,PspFFindEntry);
+ if (CurrPsp == pPspFFindEntry->usPsp) {
+ return pPspFFindEntry;
+ }
+ Next= Next->Flink;
+ }
+
+ return NULL;
+}
diff --git a/private/mvdm/dos/dem/dosdef.h b/private/mvdm/dos/dem/dosdef.h
new file mode 100644
index 000000000..4f9af4dcb
--- /dev/null
+++ b/private/mvdm/dos/dem/dosdef.h
@@ -0,0 +1,140 @@
+/* dosdef.h - This file duplicates few important dos defines of use to
+ * DEM.
+ *
+ * As these defines are not going to change at all, its better to give
+ * DEM a separate copy and not share h and inc files between DOSKRNL and
+ * DEM.
+ *
+ * Sudeepb 05-Apr-1991 Created
+ */
+
+#include <doswow.h>
+#include <curdir.h>
+
+/** DEFINES **/
+
+/** File Attributes **/
+
+#define ATTR_NORMAL 0x0
+#define ATTR_READ_ONLY 0x1
+#define ATTR_HIDDEN 0x2
+#define ATTR_SYSTEM 0x4
+#define ATTR_VOLUME_ID 0x8
+#define ATTR_DIRECTORY 0x10
+#define ATTR_ARCHIVE 0x20
+#define ATTR_DEVICE 0x40
+
+#define ATTR_ALL (ATTR_HIDDEN | ATTR_SYSTEM | ATTR_DIRECTORY)
+#define DOS_ATTR_MASK 0x0037 // ATTR_DEVICE isn't used on 32 bit side.
+ // ATTR_VOL maps to FILE_ATTRIBUTES_NORMAL.
+
+/** File Modes **/
+
+#define ACCESS_MASK 0x0F
+#define OPEN_FOR_READ 0x00
+#define OPEN_FOR_WRITE 0x01
+#define OPEN_FOR_BOTH 0x02
+#define EXEC_OPEN 0x03 /* access code of 3 indicates that
+ open was made from exec */
+
+#define SHARING_MASK 0x70
+#define SHARING_COMPAT 0x00
+#define SHARING_DENY_BOTH 0x10
+#define SHARING_DENY_WRITE 0x20
+#define SHARING_DENY_READ 0x30
+#define SHARING_DENY_NONE 0x40
+#define SHARING_NET_FCB 0x70
+#define SHARING_NO_INHERIT 0x80
+
+
+/* Volume Info **/
+
+#define DOS_VOLUME_NAME_SIZE 11
+#define NT_VOLUME_NAME_SIZE 255
+#define FILESYS_NAME_SIZE 8
+
+/* IOCTLs **/
+
+#define IOCTL_CHANGEABLE 8
+#define IOCTL_DeviceLocOrRem 9
+#define IOCTL_GET_DRIVE_MAP 0xE
+
+/** TYPEDEFS **/
+
+/** SRCHDTA defines the DTA format for FIND_FIRST/NEXT operations **/
+#pragma pack(1)
+
+typedef struct _SRCHDTA { /* DTA */
+ PVOID pFFindEntry; // 21 bytes reserved area begins
+ ULONG FFindId;
+ BYTE bReserved[13]; // 21 bytes reserved area ends
+ UCHAR uchFileAttr;
+ USHORT usTimeLastWrite;
+ USHORT usDateLastWrite;
+ USHORT usLowSize;
+ USHORT usHighSize;
+ CHAR achFileName[13];
+} SRCHDTA;
+
+#pragma pack()
+
+typedef SRCHDTA UNALIGNED *PSRCHDTA;
+
+
+/** SRCHBUF - defines DOS SEARCHBUF data structure which is used in
+ * FCBFINDFIRST/NEXT operations.
+ */
+
+#pragma pack(1)
+
+typedef struct _DIRENT {
+ CHAR FileName[8];
+ CHAR FileExt[3];
+ UCHAR uchAttributes;
+ PVOID pFFindEntry; // DOS Reserved Area
+ ULONG FFindId; // DOS Reserved Area
+ USHORT usDummy; // DOS Reserved Area
+ USHORT usTime;
+ USHORT usDate;
+ USHORT usReserved2; // Cluster Number in actual DOS
+ ULONG ulFileSize;
+} DIRENT;
+
+#pragma pack()
+
+typedef DIRENT *PDIRENT;
+
+#pragma pack(1)
+
+typedef struct _SRCHBUF {
+ UCHAR uchDriveNumber;
+ CHAR FileName[8];
+ CHAR FileExt[3];
+ USHORT usCurBlkNumber;
+ USHORT usRecordSize;
+ ULONG ulFileSize;
+ DIRENT DirEnt;
+} SRCHBUF;
+
+#pragma pack()
+
+typedef SRCHBUF *PSRCHBUF;
+
+
+/** VOLINFO - GetSetMediaID data structure */
+
+#pragma pack(1)
+
+typedef struct _VOLINFO {
+ USHORT usInfoLevel;
+ ULONG ulSerialNumber;
+ CHAR VolumeID[DOS_VOLUME_NAME_SIZE];
+ CHAR FileSystemType[FILESYS_NAME_SIZE];
+} VOLINFO;
+
+#pragma pack()
+
+typedef VOLINFO *PVOLINFO;
+
+
+/** CDS LIST - CurrDirStructure (Moved to DOSWOW.H) */
diff --git a/private/mvdm/dos/dem/makefile b/private/mvdm/dos/dem/makefile
new file mode 100644
index 000000000..ab08ca0cf
--- /dev/null
+++ b/private/mvdm/dos/dem/makefile
@@ -0,0 +1,9 @@
+# DEM makefile
+# 01-Apr-1991 Sudeep Bharati Created
+#
+
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\makefile.def
diff --git a/private/mvdm/dos/dem/sources b/private/mvdm/dos/dem/sources
new file mode 100644
index 000000000..2d9575fd4
--- /dev/null
+++ b/private/mvdm/dos/dem/sources
@@ -0,0 +1,65 @@
+!IF 0
+
+Copyright (c) 1989-1991 Microsoft Corporation
+
+Module Name:
+
+ sources.
+
+Abstract:
+
+ This file specifies the target component being built and the list of
+ sources files needed to build that component. Also specifies optional
+ compiler switches and libraries that are unique for the component being
+ built.
+
+
+History:
+ Created 27-Mar-1991 by Sudeep Bharati (sudeepb)
+ from template created 12-Apr-1990 by Steve Wood (stevewo)
+
+
+NOTE: Commented description of this file is in \nt\public\oak\bin\sources.tpl
+
+!ENDIF
+
+MAJORCOMP=mvdm
+MINORCOMP=dem
+
+TARGETNAME=dem
+TARGETPATH=\nt\public\sdk\lib
+TARGETTYPE=LIBRARY
+TARGETLIBS=
+
+
+NTPROFILEINPUT=YES
+
+SOFTPC_TREE=$(BASEDIR)\private\mvdm\softpc.new
+
+INCLUDES=..\..\inc;..\..\..\windows\inc;..\..\..\inc;$(SOFTPC_TREE)\base\inc;$(SOFTPC_TREE)\host\inc;..\..\vdd\h
+
+SOURCES=dem.c \
+ demfcb.c \
+ demdata.c \
+ demdir.c \
+ demdisp.c \
+ demerror.c \
+ demfile.c \
+ demgset.c \
+ demhndl.c \
+ demioctl.c \
+ demlock.c \
+ demmisc.c \
+ demmsg.c \
+ demsrch.c \
+ demdasd.c \
+ demlabel.c
+
+I386_SOURCES=
+MIPS_SOURCES=
+
+C_DEFINES=-DWIN_32
+
+UMTYPE=console
+UMTEST=
+UMLIBS=
diff --git a/private/mvdm/dos/dirs b/private/mvdm/dos/dirs
new file mode 100644
index 000000000..82a8f3ca1
--- /dev/null
+++ b/private/mvdm/dos/dirs
@@ -0,0 +1,26 @@
+!IF 0
+
+Copyright (c) 1989 Microsoft Corporation
+
+Module Name:
+
+ dirs.
+
+Abstract:
+
+ This file specifies the subdirectories of the current directory that
+ contain component makefiles.
+
+History:
+ Created 27-Mar-91 by Sudeep Bharati (Sudeepb)
+ from template created 12-Apr-1990 by Steve Wood (stevewo)
+
+
+NOTE: Commented description of this file is in \nt\public\oak\bin\dirs.tpl
+
+!ENDIF
+
+DIRS= dem \
+ command
+
+OPTIONAL_DIRS=
diff --git a/private/mvdm/dos/test/test.bat b/private/mvdm/dos/test/test.bat
new file mode 100644
index 000000000..99ed35e4a
--- /dev/null
+++ b/private/mvdm/dos/test/test.bat
@@ -0,0 +1,53 @@
+break on
+
+md a:scratch.rt
+
+cd a:scratch.rt
+
+if exist *.dif del *.dif
+if exist *.out del *.out
+
+showtime >test.log
+
+echo FAT partition >>test.log
+set _ext=exp
+goto contlab
+
+:checkhpfs
+cmp -s c.exh c.out
+if errorlevel 1 goto badlab
+echo HPFS partition >>test.log
+set _ext=exh
+del c.out
+goto contlab
+
+:badlab
+echo ERROR - check partition >>test.log
+goto Done
+
+:contlab
+command /c quick2 a %_ext%
+command /c quick3 a %_ext%
+REM command /c quick4 a %_ext%
+REM command /c quick6 a %_ext%
+command /c quick8 a %_ext%
+command /c quick10 a %_ext%
+command /c quick11 a %_ext%
+REM command /c dostst a %_ext%
+command /c extras a %_ext%
+command /c limtest >>test.log
+command /c xmstest >>test.log
+REM remove work area
+cd a:..
+rd a:scratch.rt
+set _ext=
+type test.log
+goto Done
+
+:DirErr
+echo "Work directory (a:SCRATCH.RT) already exists -- Test stopped"
+goto Done
+
+:NoDir
+echo "Unable to make work directory (a:SCRATCH.RT) -- Test stopped"
+:Done
diff --git a/private/mvdm/dos/v86/cmd/append/append.asm b/private/mvdm/dos/v86/cmd/append/append.asm
new file mode 100644
index 000000000..c71e5cbdb
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/append/append.asm
@@ -0,0 +1,3565 @@
+page 60,120
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;
+.sall
+title APPEND
+include sysmsg.inc
+include version.inc
+msg_utilname<APPEND>
+;-----------------------------------------------------------------------------
+;
+; Title: APPEND
+;
+; Author: G. G. A. Network version
+; B. A. F.` DOS changes
+;
+; Syntax: From the DOS command line:
+;
+; APPEND [d:]path[[;[d:]path]...]
+; - Used to specify the directories to be
+; searched after the working directory.
+;
+; APPEND ;
+; - Used to release all appended directories.
+;
+; APPEND
+; - Used to show appended directories.
+;
+; First time only:
+;
+; APPEND [[d:]path | | /X | /E | /X /E]
+; - [d:]path Normal support and Set path
+; - Normal support
+; - /X Extended support, SEARCH, FIND and EXEC
+; - /E Use DOS Environment for path(s)
+;
+; Revision History:
+; @@01 07/11/86 Fix hang in TopView start PTM P00000??
+; @@02 07/28/86 Fix APPEND size problem PTM P0000045
+; @@03 07/29/86 Fix APPEND status with /E problem PTM P00000??
+; @@04 07/30/86 Fix second APPEND hang PTM P0000053
+; @@05 08/13/86 Fix parameter error PTM P0000125
+; @@06 08/20/86 Fix APPEND xxx fails in TopView PTM P0000217
+; @@07 08/21/86 Resurrect APPEND version message PTM P0000252
+; @@08 08/21/86 APPEND=path first time hangs PTM P0000254
+; @@09 08/22/86 APPEND gets wrong path under nested COMMAND PTM P0000276
+; @@10 08/28/86 Change message for @@05 PTM P0000291
+; @@11 09/10/86 Support message profile and make
+; msg length variable. R.G. PTM P0000479
+; @@12 09/25/86 Allow second external append call. (RG) PTM P0000515
+; @@13 09/30/86 APPEND gets wrong path under nested COMMAND PTM P0000600
+; Again. Fix in COMMAND now, so remove @@09 changes
+; @@14 10/01/86 Lower case drive in path files PTM P0000600
+; @@15 10/06/86 Include "," and "=" in skip leading of
+; argument area parsing. PTM P0000677
+; @@16 10/06/86 Fix not using full APPEND path PTM P0000794
+; @@17 12/03/86 When searching for "APPEND=" string in
+; environment, make sure delimiter precedes.(RG) PTM P0000893
+;
+;-------------------------------------------------------------------
+;
+; AN000 3.30 changes, GGA 6/87 new code. P000
+; AN001 Support DRIVE and PATH modes D043
+; AN002 Add truename function P1276
+; AN003 Add extended handle open function D250
+; AN005
+; AN006 Add DBCS support
+; AN007 Release Environmental Vector space P2666
+; AN008 Allow equal symbol with append - APPEND=A:/1; P2901
+; AN009 Release Environmental Vector on only the P3333
+; first invocation of APPEND
+; AN010 display invalid parm from command line P3908
+;
+;
+;-----------------------------------------------------------------------------
+;Date Rev Comments
+;-----------------------------------------------------------------------------
+;06-02-86 0.0 Begin conversion to PC/DOS version
+;06-20-86 0.0 End conversion to PC/DOS version
+;
+page
+
+cseg segment public para 'CODE'
+ assume cs:cseg
+ assume ds:nothing,es:nothing
+
+;-----------------------------------------------------------------------------
+; Equates
+;-----------------------------------------------------------------------------
+
+.xlist
+;include fsi.lib
+NETSYSUTIL EQU 0C2H ; SYSTEM UTILITIES
+NETENQ EQU 07H ; ENQ RESOURCE
+NETDEQ EQU 08H ; DEQ RESOURCE
+;include task.lib
+TCBR_APPEND EQU 001H ; APPEND ACTIVE
+;include DOS.lib
+DOSSERVER EQU 5DH ; SERVER OPERATION
+DOSSETERROR EQU 0AH ; SET EXTENDED ERROR
+;include server.lib
+DPL STRUC
+DPL_AX DW 0 ;AX REG
+DPL_BX DW 0 ;BX REG
+DPL_CX DW 0 ;CX REG
+DPL_DX DW 0 ;DX REG
+DPL_SI DW 0 ;SI REG
+DPL_DI DW 0 ;DI REG
+DPL_DS DW 0 ;DS REG
+DPL_ES DW 0 ;ES REG
+DPL_XID DW 0 ;RESERVED
+DPL_UID DW 0 ;SERVER USER ID
+DPL_PID DW 0 ;REDIRECTOR PROCESS ID
+DPL ENDS
+include sysmac.lib
+include versiona.inc
+include appendp.inc ; parseing stuff for append ;AN004;
+.list
+; extrn end_address:near ; end of stay resident stuff
+
+; extrn bad_append_msg:byte ; messages
+; extrn path_error_msg:byte
+; extrn parm_error_msg:byte
+; extrn path_parm_error_msg:byte
+; extrn no_append_msg:byte ; @@05
+; extrn append_assign_msg:byte
+; extrn append_TV_msg:byte ; @@01
+; extrn bad_DOS_msg:byte
+; extrn second_APPEND_msg:byte ; @@04
+
+; extrn len_bad_append_msg:word ;@@11
+; extrn len_path_error_msg:word ;@@11
+; extrn len_parm_error_msg:word ;@@11
+; extrn len_path_parm_error_msg:word ;@@11
+; extrn len_no_append_msg:word ;@@11
+; extrn len_append_assign_msg:word ;@@11
+; extrn len_append_TV_msg:word ;@@11
+; extrn len_bad_DOS_msg:word ;@@11
+; extrn len_second_APPEND_msg:word ;@@11
+
+; Environmental Vector
+
+PSP_Env equ 2ch ;Environmental vector segment in PSP ;an007; dms;
+
+; Interrupts
+
+DOS_function equ 21h ; DOS function call interrupt
+int_function equ 2fh ; DOS internal function interrupt, used
+ ; to verify APPEND presence
+termpgm equ 20h ; @@05
+resident equ 27h
+
+; Function calls
+
+get_vector equ 3521h ; DOS function call to get INT 21 vector
+set_vector equ 2521h ; DOS function call to set INT 21 vector
+get_intfcn equ 352fh ; DOS function call to get INT 2f vector
+set_intfcn equ 252fh ; DOS function call to set INT 2f vector
+get_version equ 30h ; DOS function call to get DOS version number
+get_DTA equ 2fh ; DOS function get DTA
+set_DTA equ 1ah ; DOS function set DTA
+get_crit_err equ 3524h ; DOS function call to get INT 24 vector
+set_crit_err equ 2524h ; DOS function call to set INT 24 vector
+get_PSP equ 62h ; DOS function call to get PSP address
+Free_Alloc_Mem equ 49h ; DOS function call to free alloc. mem. ;an007; dms;
+
+print_string equ 09h ; DOS function call to get print a string
+ctrl_break equ 33h ; DOS function call to get/set ctrl-break
+
+awrite equ 40h ; write function
+get_dir equ 47h ; get current dir
+change_dir equ 3bh ; change dir
+get_disk equ 19h ; get current disk
+change_disk equ 0eh ; change disk
+term_stay equ 31h ; terminate a process and stay resident
+term_proc equ 4ch ; terminate a process
+
+redir_flag equ 0000000000001000B ; redir flag for net installation check
+
+; DOS INT 2f function for APPEND presence
+
+append_2f equ 0b7h ; int 2f function code for append
+applic_2f equ 0aeh ; int 2f function code for applications
+COMMAND_2f equ -1 ; int 2f subfunction code for COMMAND call
+append_inst equ 0ffh ; flag means append is there
+
+; INT 2f sub-function codes ;AN000;
+
+are_you_there equ 0 ; function code for presence check
+old_dir_ptr equ 1 ; means APPEND 1.0 is trying to run
+get_app_version equ 2 ; fun code for get ver request
+tv_vector equ 3 ; fun code for set TV vector
+dir_ptr equ 4 ; function code to return dirlist ptr
+get_state equ 6 ; function code to return append ;AN001;
+ ; state ;AN001;
+set_state equ 7 ; function code to set append ;AN001;
+ ; state ;AN001;
+
+DOS_version equ 10h ; function call to get DOS version
+true_name equ 11h ; one-shot truename fcn for ASCIIZ ops ;AN002;
+
+; DOS INT 21 function calls that APPEND traps
+
+FCB_opn equ 0fh
+file_sz equ 23h
+handle_opn equ 3dh
+dat_tim equ 57h
+FCB_sch1 equ 11h
+handle_fnd1 equ 4eh
+exec_proc equ 4bh
+ext_handle_opn equ 6ch ;AN003;
+
+break macro ; this is a dummy break macro so PDB.INC
+ endm ; won't blow up in the build
+
+; define some things for PDB (PSP) ;AN002;
+ ;AN002;
+include pdb.inc ;AN002;
+ ;AN002;
+true_name_flag equ 01h ; flag for true name function ;AN002;
+eo_create equ 00f0h ; mask to check extended opens for create ;AN003;
+
+; Error codes that don't mean stop looking
+
+FCB_failed equ 0ffh ; FCB open failed
+FCB_file_not_found equ 2 ; file not found on FCB open
+handle_file_not_found equ 2 ; file not found on handle open
+handle_path_not_found equ 3 ; path not found on handle open
+FCB_no_more_files equ 18 ; no more matching files
+handle_no_more_files equ 18 ; no more matching files
+
+; Equates for TOPVIEW barrier
+TV_TRUE equ -1 ; this was changed from TRUE ;AN000;
+ ; because 3.30 parser uses TRUE ;AN000;
+false equ 0 ;
+
+; Message equates
+
+tab_char equ 9
+cr equ 13
+lf equ 10
+beep equ 7
+STDOUT equ 0001h ; standard output file
+STDERR equ 0002h ; standard error file
+null equ 0
+
+MSG_OPTIONS_FIRST equ 300
+MSG_OPTIONS_LAST equ 316
+
+page
+
+;-----------------------------------------------------------------------------
+; Resident data area
+;-----------------------------------------------------------------------------
+
+version_loc: ; version number
+ db major_version,minor_version
+; dw message_list ; pointer to message table
+
+ even
+vector_offset dw 0 ; save pointer to old int 21 here
+vector_segment dw 0
+crit_vector_offset dw 0 ; save pointer to old int 24 here
+crit_vector_segment dw 0
+intfcn_offset dw 0 ; save pointer to old int 2f here
+intfcn_segment dw 0
+dirlst_offset dw 0 ; save pointer to dir list here
+dirlst_segment dw 0
+tv_vec_off dw 0 ; save TV vector here
+tv_vec_seg dw 0
+
+pars_off dd cseg: SysParse ; save pointer to parser here
+;pars_off dw offset SysParse ; save pointer to parser here
+;pars_seg dw 0
+
+app_dirs_seg dw 0 ; save ES here during FCB
+
+FCB_ptr dd 0 ; save pointer to FCB here
+handle_ptr dd 0 ; save pointer to ASCIIZ string here
+
+stack_offset dw 0
+stack_segment dw 0 ; Calling process stack
+
+incoming_AX dw 0 ; AX saved at entry to interrupt handler
+incoming_CX dw 0 ; CX saved at entry to interrupt handler
+; must be together
+incoming_BX dw 0 ; BX saved at entry to interrupt handler
+incoming_ES dw 0 ; ES saved at entry to interrupt handler
+; must be together
+ax_after_21 dw 0 ; AX saved after call to real INT 21
+; temp_DS_save dw 0 ; DS saved during stack ops
+temp_CS_save dw 0 ; CS saved during stack ops (set_return_flags)
+temp_IP_save dw 0 ; IP saved during stack ops (set_return_flags)
+FCB_drive_id db 0 ; save the drive id for FCB opens here
+
+;------------------------
+; DBCS stuff here ;AN006;
+ ;AN006;
+DBCSEV_OFF DW 0 ; OFFSET OF DBCS EV ;AN006;
+DBCSEV_SEG DW 0 ; SEGMENT OF DBCS EV ;AN006;
+ ;AN006;
+;DEFAULT DBCS ENVIRONMENTAL VECTOR ;AN006;
+EVEV DB 00H,00H ;AN006;
+ DB 00H,00H ;AN006;
+ DB 00H,00H ;AN006;
+ ;AN006;
+dbcs_fb dw 0 ; offset of DBCS first byte chars found
+;------------------------
+
+initial_pass dw 0 ; flag used to indicate inital APPEND ;AN007;
+
+incoming_DX dw 0 ; used for saves for extended open ;AN003;
+incoming_SI dw 0 ; used for saves for extended open ;AN003;
+incoming_DI dw 0 ; used for saves for extended open ;AN003;
+incoming_DS dw 0 ; used for saves for extended open ;AN003;
+true_name_count dw 0 ; used to save number of chars in true_name dir ;AN003;
+
+int_save_ip dw 0 ; save registers here during critical
+int_save_cs dw 0 ; error handler stack ops
+
+work_disk db "?:\" ; user's working disk
+work_dir db 64 dup(" ") ; user's working dir
+app_disk db "?:\" ; user's working disk
+app_dir db 64 dup(" ") ; user's append disk's working dir
+ctrl_break_state db 0 ; save the old ctrl-break state here
+
+end_search db 0 ; end search flag
+try_dir db 128 dup (0) ; try this dir
+fname db 15 dup (0) ; 8.3 filename stripped from original
+ ; ASCIIZ string
+app_dirs_ptr dw 0 ; pointer to appended dir to try
+
+set_name db "SET " ; SET command
+; must be together
+setappend_name db "SET " ; SET command
+append_id db "APPEND=" ; display from here for user
+; must be together
+app_dirs db ";"
+ db 128 dup (0) ; area for storing appended dirs
+ db 0 ; just to insure that the last dir is null terminated
+semicolon db ";",0 ; null list
+
+; Flags / barriers added for TopView
+
+tv_flag db 0 ; flag to indicate re-entr from TopView
+
+parse_flag db 0 ; flag used by APPEND parsing
+
+FCB_ext_err db 0 ; flag used to indicate that FCB
+ ; open failed and ext err was done
+crit_err_flag db 0 ; flag used to indicate that a critical
+ ; error happened
+ext_err_flag db 0 ; flag used to indicate that ext err
+ ; must be set 0 = don't set, 1 = do set
+in_middle db 0 ; flag used to tell if we made it to
+ ; middle of string before finding a space
+equal_found db 0 ; multiple = check
+;crit_sect_flag db 0 ; critical section flag
+
+stack_area dw 99 dup(0) ; stack area for append
+append_stack dw 0
+
+net_config dw 0 ; flag word for what (if any) network
+ ; config we are running under
+ ; as long as this word is zero, a clear determination
+ ; has not been made about the configuration
+
+ even
+ext_err_dpl DPL <> ; reserve a DPL for get/set extended error code
+
+
+save_ext_err DPL <> ; reserve a DPL for first extended
+ ; error code
+
+;------------------------------------------------------------------- ;AN001;
+; ;AN001;
+; mode_flags This status word is used to control the various ;AN001;
+; APPEND functions and modes. ;AN001;
+; ;AN001;
+;------------------------------------------------------------------- ;AN001;
+mode_flags dw Path_mode + Drive_mode + Enabled ;AN001;
+ ; mode control flags ;AN001;
+ ; initially - path, drive and ;AN001;
+ ; enabled ;AN001;
+
+; equates for mode_flags follow: ;AN001;
+
+X_mode equ 8000h ; in /X mode
+E_mode equ 4000h ; in /E mode
+Path_mode equ 2000h ; PATH in string OK ;AN001;
+Drive_mode equ 1000h ; DRIVE in string OK ;AN001;
+Enabled equ 0001h ; APPEND enabled ;AN001;
+
+;-------------------------------------------------------------------
+
+cmd_name@ dd ? ; internal name string
+
+expected_error dw ? ; error to do append scan
+expected_ext_error dw ? ; error to do append scan
+
+cmd_env dw ? ; pointer to COMMANDs environment
+cmd_buf dw ? ; CMDBUF offset (in SS)
+
+incoming_DTA dd ? ; user's DTA (on EXEC)
+exec_DTA db 21+1+2+2+2+2+13 dup(0) ; find DTA for exec emulation
+
+old_syntax db 0 ; using network syntax
+
+res_append db 0 ; resident append call ; @@05
+
+abort_sp dw ? ; sp to restore on errors ; @@05
+
+crlf label byte
+ db CR,LF
+crlf_len equ $ - crlf
+
+;******************************************************************* ;an010;bgb
+; parser message display area ;an010;bgb
+;******************************************************************* ;an010;bgb
+inv_parm db 0bh ;length ;an010;bgb
+ db 0 ;reserved ;an010;bgb
+si_off dw 0 ;put offset of command line here ;an010;bgb
+si_seg dw 0 ;put segment of command line here ;an010;bgb
+ db 0 ;use percent zero ;an010;bgb
+ db Left_Align+Char_Field_ASCIIZ ;type of data ;an010;bgb
+ db 128 ;max width ;an010;bgb
+ db 1 ;min width ;an010;bgb
+ db ' ' ;pad char ;an010;bgb
+
+;-------------------------------------------------------------------
+;
+; resident message area
+;
+;-------------------------------------------------------------------
+
+MSG_SERVICES <MSGDATA>
+MSG_SERVICES <DISPLAYmsg,CHARmsg> ;an010;bgb
+MSG_SERVICES <APPEND.CLA,APPEND.CL1,APPEND.CTL>
+
+.xlist
+;-----------------------------------------------------------------------------
+; macros
+;-----------------------------------------------------------------------------
+
+;-----------------------------
+; save and restore register macros
+save_regs macro
+ push bx
+ push cx
+ push dx
+
+ push di
+ push si
+ push ds
+ push es
+ endm
+
+restore_regs macro
+ pop es
+ pop ds
+ pop si
+ pop di
+
+ pop dx
+ pop cx
+ pop bx
+ endm
+
+;-----------------------------
+; this macro is used instead of the normal POPF instruction to help
+; prevent a 286 bug from occurring
+popff macro
+ local myret
+ jmp $+3
+myret label near
+ iret
+ push cs
+ call myret
+ endm
+
+;----------------------------- ; @@12
+; check character ; @@12
+; ; @@12
+chkchar macro char ; @@12
+ lodsb ; @@12
+ and al,0dfh ; @@12
+ cmp al,char ; @@12
+ jne ccn_ret ; @@12
+ endm ; @@12
+.list
+
+page
+;-----------------------------------------------------------------------------
+; resident routine - control transferred here on INT 21
+; check to see if this call has a function code we are interested in
+;-----------------------------------------------------------------------------
+
+
+tv_entry:
+ pushf ; @@01
+ jmp SHORT check_fcb_open ; @@01
+
+interrupt_hook:
+resident_routine:
+ pushf ; save the user's flags (old stack)
+
+ cmp tv_flag,TV_TRUE ; see if in TV ;AN000;
+ je use_old ; yes, old_vect
+
+check_fcb_open: ; @@01
+
+;------------------------------------------------------------------- ;AN001;
+; first, check to see if APPEND disabled, if so, skip everything ;AN001;
+; and go to real INT 21 handler ;AN001;
+;------------------------------------------------------------------- ;AN001;
+ test mode_flags,Enabled ; APPEND disabled? ;AN001;
+ jz real_jump ; yes, skip all other checks ;AN001;
+
+ cmp ah,FCB_opn ; FCB open?
+ jump E,FCB_open ; yes, do the APPEND
+
+ cmp ah,handle_opn ; handle open?
+ jump E,handle_open ; yes, do the APPEND
+
+ cmp ah,ext_handle_opn ; extended handle open? ;AN003;
+ jump E,ext_handle_open ; yes, do the APPEND ;AN003;
+ ;AN003;
+ cmp ah,file_sz ; file size?
+ je FCB_open ; yes, do the APPEND
+
+
+ test mode_flags,X_mode ; /X mode not selected
+ jz real_jump
+
+ call IsItFCB_FindFirst?
+ je FCB_search1
+
+;------ following two lines replaced by the above to lines of code Bug #121
+; cmp ah,FCB_sch1 ; search?
+; jump E,FCB_search1 ; yes, do the APPEND
+;--------------------------------------------------------------------------
+
+ call IsItHandle_FindFirst?
+ jump E, handle_find1
+
+;------ following two lines replaced by the above to lines of code Bug #121
+; cmp ah,handle_fnd1 ; find?
+; jump E,handle_find1 ; yes, do the APPEND
+;--------------------------------------------------------------------------
+
+ cmp tv_flag,TV_TRUE ; cant do in TopView ;AN000;
+ je skip_exec
+ cmp ax,exec_proc*256+0 ; EXEC?
+ jump E,exec_pgm ; yes, do the APPEND
+skip_exec:
+ cmp ax,exec_proc*256+3 ; EXEC?
+ jump E,exec_pgm ; yes, do the APPEND
+
+ page
+;-----------------------------------------------------------------------------
+; By here, we know that the call was not one we are interested in,
+; pass through to old INT 21.
+; Since this is done with a jmp, control will pass back to original caller
+; after DOS is finished.
+;-----------------------------------------------------------------------------
+
+real_jump:
+ cmp tv_flag,TV_TRUE ; see if called by TV ;AN000;
+ jne use_old ; yes, use old vect
+
+ popff ; restore user's flags
+ jmp dword ptr tv_vec_off ; pass through to TV
+
+use_old:
+ popff ; restore user's flags (old stack)
+ jmp dword ptr Vector_Offset ; jump to old INT 21
+
+page
+;-----------------------------------------------------------------------------
+; New functions added to resolve Bug #121
+; IsItFCB_FindFirst?
+; IsItHandle_FindFirst?
+;-----------------------------------------------------------------------------
+VOL_LABEL equ 08h
+IsItFCB_FindFirst? proc near
+ cmp ah, FCB_sch1 ; search?
+ jne not_FCB_FindFirst
+ push bx
+ mov bx, dx ; ds:bx == ptr to FCB
+ cmp byte ptr [bx], 0ffh ; extended FCB ?
+ jne FCB_FindFirst
+ test byte ptr [bx+6], VOL_LABEL ; search for label ?
+ pop bx
+ ret
+FCB_FindFirst:
+ pop bx ; restore BX (bug #1027)
+ cmp al, al
+not_FCB_FindFirst:
+ ret
+IsItFCB_FindFirst? endp
+;
+;----------------- This routine can be made in line MOHAN
+;
+IsItHandle_FindFirst? proc near
+ cmp ah, handle_fnd1 ; handle find ?
+ jne not_Handle_FindFirst
+ test cl, VOL_LABEL
+not_Handle_FindFirst:
+ ret
+IsItHandle_FindFirst? endp
+;
+page
+;-----------------------------------------------------------------------------
+; FCB_search1 - this routine handles FCB search first calls
+;-----------------------------------------------------------------------------
+
+FCB_search1:
+ mov expected_ext_error,fcb_no_more_files
+ jmp short FCB_openx1
+
+;-----------------------------------------------------------------------------
+; FCB_open - this routine handles FCB open calls
+;-----------------------------------------------------------------------------
+
+FCB_open:
+ mov expected_ext_error,fcb_file_not_found
+FCB_openx1:
+ call check_config ; check the config flags
+ call crit_sect_set ; set critical section flag
+
+ call tv_barrier
+
+ mov incoming_AX,ax ; save user's AX
+ mov word ptr FCB_ptr+0,dx ; save FCB pointer
+ mov word ptr FCB_ptr+2,ds
+
+ popff ; restore user's flags
+ call int_21 ; try the open
+
+ cli
+ mov AX_after_21,ax ; save AX as it came back from INT
+ pushf ; save flags from operation
+ cmp al,FCB_failed ; open failed ?
+ je check_error ; yes, lets check extended error
+ jmp set_return_flags ; no, fix the stack, then ret to caller
+
+check_error:
+ call get_ext_err_code ; get the extended error code
+ mov FCB_ext_err,1 ; set FCB ext error
+ call save_first_ext_err ; save first extended error code
+ mov ax,ext_err_dpl.DPL_AX ; get error in ax
+ cmp ax,expected_ext_error ; file not found?
+ je FCB_openx2 ; yes, lets look around for file
+ lea dx,save_ext_err ;
+ call set_ext_err_code ; set the extended error code
+ jmp set_return_flags ; no, fix the stack, then return
+
+FCB_openx2:
+
+; set up APPEND's stack
+
+ popff ; get rid of the flags from the
+ ; real operation
+; mov temp_DS_save,ds ; Save DS reg
+ mov stack_segment,ss ; Save it
+ mov stack_offset,sp ; Save it
+ mov ax,cs ; Get current segment
+ mov ss,ax ; and point stack seg here
+ lea sp,append_stack ; set up new stack
+
+ save_regs ; save registers
+
+ push cs ; establish addressability
+ pop ds
+
+ call ctrl_break_set ; set ctrl-break handler
+ call crit_err_set ; set crit err handler
+
+ mov ext_err_flag,1 ; flag for setting critical error
+
+; fix FCB drive spec
+
+ les bx,dword ptr FCB_ptr ; ES:BX points to FCB
+ mov ah,ES:byte ptr [bx] ; get FCB drive spec
+ cmp ah,-1 ; extended FCB?
+ jne not_ext_FCB1
+ add bx,1+5+1 ; point to real drive letter
+ mov ah,ES:byte ptr [bx] ; get FCB drive spec
+
+not_ext_FCB1:
+ mov FCB_drive_id,ah ; save it for later
+ mov ES:byte ptr [bx],0 ; zero the drive field out to
+ ; use default drive
+
+ mov ah,get_disk ; get disk
+ call int_21 ; call DOS INT 21 handler
+
+ add al,"A" ; make it a character
+ mov work_disk,al ; save it
+
+ mov ah,get_dir ; get directory
+ xor dx,dx ; default drive
+ lea si,work_dir ; save area
+ call int_21 ; call DOS INT 21 handler
+
+ call address_path ; get address of path
+ cmp es: byte ptr [di],";" ; is the append list null?
+ jump E,null_list ; exit append
+ mov app_dirs_seg,es ; save app dirs segment
+ mov si,di ; source
+
+try_another1:
+ lea di,try_dir ; destination
+ call get_app_dir ; copy dir to try into try_dir
+ mov app_dirs_ptr,si ; save updated pointer
+
+
+;-----------------------------
+try_app_dir1:
+ mov app_disk,0 ; zero for current dir
+ cmp try_dir+1,":" ; see if we have a drive
+ jne no_drive ; char should be a colon
+
+; yes, there was a drive specified, must do the change disk function call
+
+ mov ah,change_disk ; change disk
+ mov dl,try_dir ; get the char representation of the drive
+ mov app_disk,dl ; save it away for later use
+ call cap_dl
+ sub dl,"A" ; convert from char to drive spec
+ call int_21 ; call DOS INT 21 handler
+; jc check_end_dir_list ; there was an error, see if there is
+ ; another to try
+
+ cmp crit_err_flag,0 ; did we experience a critical error
+ jne set_err_code ; yes, fake a file_not_found
+
+no_drive:
+ mov ah,get_dir ; get directory
+ xor dx,dx ; default drive
+ lea si,app_dir ; save area
+ call int_21 ; call DOS INT 21 handler
+
+; check to see if there was a critical error
+
+ cmp crit_err_flag,0 ; did we experience a critical error
+ je cd_worked ; no, the cd worked
+ jmp short set_err_code
+
+save_regs_and_set:
+ pushf ; save everything again
+ save_regs
+ push cs ; re-establish addressability
+ pop ds ; ds = cs
+
+set_err_code:
+ xor ah,ah ; make ax look like open failed
+ mov al,FCB_failed
+ mov ax_after_21,ax ; save it away so we can restore it below
+
+ jmp no_more_to_try
+
+cd_worked:
+ lea dx,try_dir ; point dx to dir to try
+ mov ah,change_dir ; change dir to appended directory
+ call int_21 ; call DOS INT 21 handler
+
+; try the open in this dir
+
+ restore_regs ; make regs look like when user
+ mov ax,incoming_AX ; called us
+
+ call int_21 ; call DOS INT 21 handler
+ mov ax_after_21,ax ; save AX
+ cmp crit_err_flag,0 ; did we get critical error?
+ jne save_regs_and_set ; yes, fake a file_not_found
+ cmp al,FCB_failed ; did open work?
+ jne open_ok
+ call get_ext_err_code ; get the extended error code
+
+open_ok:
+ pushf ; save everything again
+ save_regs
+
+ push cs ; re-establish addressability
+ pop ds ; ds = cs
+
+; restore user's working disk and restore the dir on the appended drive
+
+ mov ah,change_disk ; change disk back to our original
+ mov dl,work_disk
+ call cap_dl
+ sub dl,"A" ; convert from char to drive spec
+ call int_21 ; call DOS INT 21 handler
+
+ mov ah,change_dir ; change dir
+ lea dx,app_disk ; save area (this time include drive)
+ call int_21 ; call DOS INT 21 handler
+
+; this is for ..\dirname ptr
+
+ mov ah,change_dir ; change dir
+ lea dx,work_disk ; save area (this time include drive)
+ call int_21 ; call DOS INT 21 handler
+
+ mov ax,ax_after_21 ; restore AX
+ cmp al,FCB_failed ; did open work?
+ jne FCB_open_worked
+ mov ax,ext_err_dpl.DPL_AX
+ cmp ax,expected_ext_error
+ jne no_more_to_try ; not file not found
+
+check_end_dir_list:
+ mov es,app_dirs_seg ; restore es
+ mov si,app_dirs_ptr
+ cmp si,null ; should we try again?
+ je no_more_to_try ; no
+ jmp try_another1 ; yes
+
+FCB_open_worked:
+ mov byte ptr ext_err_flag,0 ; the open worked, no need to set ext err code
+ jmp short set_disk
+
+no_more_to_try:
+; restore user's working disk and dir
+
+; The following code up to label "null_list" which
+; restores the user's drive and path was moved in front
+; of the code to restore the drive spec in FCB.
+;
+ mov ah,change_disk ; change disk
+ mov dl,work_disk
+ call cap_dl
+ sub dl,"A" ; convert from char to drive spec
+ call int_21 ; call DOS INT 21 handler
+
+ mov ah,change_dir ; change dir
+ lea dx,work_disk ; save area (this time include drive)
+ call int_21 ; call DOS INT 21 handler
+
+null_list:
+ mov ah,FCB_drive_id ; get FCB drive spec
+; cmp ah,0 ; did they ask for default drive?
+; je fix_drive_spec ; yes, leave it alone
+ jmp short fix_drive_spec
+
+set_disk: ; set drive number in FCB
+ mov ah,work_disk ; no, give them the found drive spec
+ sub ah,"A"-1 ; convert from char to drive spec
+
+; ah has proper drive spec to put into FCB, do it
+
+fix_drive_spec:
+ les bx,dword ptr FCB_ptr ; ES:BX points to FCB
+ cmp ES:byte ptr[bx],-1 ; extended FCB
+ jne not_ext_FCB2 ; put in the proper drive spec
+ add bx,1+5+1 ; point to real drive letter
+
+not_ext_FCB2:
+ mov ES:byte ptr [bx],ah
+
+
+ call ctrl_break_restore
+ call crit_err_restore
+
+; find out if there is a need to set the extended error code
+
+ cmp ext_err_flag,0 ; do we need to set the extended error code?
+ je no_ext_err ; no, finish up
+ lea dx,ext_err_dpl
+ cmp FCB_ext_err,0
+ je handle_ext_err
+ lea dx,save_ext_err
+
+handle_ext_err:
+ call set_ext_err_code ; yes, go set the ext error info
+
+; all done with append, clean things back up for the user
+
+no_ext_err:
+ restore_regs ; restore registers
+
+ jmp reset_stack ; fix stack, ret to caller
+page
+
+;-----------------------------------------------------------------------------
+; handle_find - APPEND handle find function
+;-----------------------------------------------------------------------------
+
+handle_find1:
+ mov incoming_CX,cx ; save user's CX
+ mov expected_error,handle_no_more_files
+; mov expected_ext_error,handle_no_more_files
+ jmp short handle_openx
+
+;-----------------------------------------------------------------------------
+; exec_pgm - APPEND exec program function
+;-----------------------------------------------------------------------------
+
+exec_pgm:
+ mov incoming_BX,bx ; save user's ES:BX
+ mov incoming_ES,es
+ mov expected_error,handle_file_not_found
+; mov expected_ext_error,handle_no_more_files
+ jmp short handle_openx
+
+;----------------------------------------------------------------------------- ;AN003;
+; ext_handle_open - APPEND extended handle open function ;AN003;
+;----------------------------------------------------------------------------- ;AN003;
+ext_handle_open: ;AN003;
+ test dx,eo_create ; does this call specify create? ;AN003;
+ jz no_eo_create ; no, we can continue ;AN003;
+ ;AN003;
+ jmp real_jump ; yes, do nothing but pass on to real ;AN003;
+ ; INT 21 handler ;AN003;
+ ;AN003;
+; getting here means the caller did not specify the create option ;AN003;
+ ;AN003;
+no_eo_create: ;AN003;
+ ;AN003;
+ mov incoming_BX,bx ; save user's registers ;AN003;
+ mov incoming_CX,cx ; extended open sure does use a lot ;AN003;
+ mov incoming_DX,dx ; of registers ;AN003;
+ mov incoming_SI,si ;AN003;
+ mov incoming_DI,di ;AN003;
+ mov incoming_ES,es ;AN003;
+ mov incoming_DS,ds ;AN003;
+ ;AN003;
+ mov expected_error,handle_file_not_found ;AN003;
+ jmp short handle_openx ; for now ... ;AN003;
+ ;AN003;
+;-----------------------------------------------------------------------------
+; handle_open - APPEND handle open function
+;-----------------------------------------------------------------------------
+
+handle_open:
+ mov expected_error,handle_file_not_found
+; mov expected_ext_error,handle_file_not_found
+
+handle_openx:
+ call check_config ; check the config flags
+ call crit_sect_set ; set critical section flag
+
+ call tv_barrier ; no op on exec
+
+ mov incoming_AX,ax ; save user's AX
+ mov word ptr handle_ptr+0,dx ; save path pointer
+ mov word ptr handle_ptr+2,ds
+
+ popff ; restore user's flags
+ call int_21 ; try the open
+
+ cli
+ mov AX_after_21,ax ; save AX as it came back from INT
+ pushf ; save flags from operation
+
+; find out if we had an error, and if so was it the one we were
+; looking for
+
+ jc what_happened ; yes, lets find out what happened
+ mov incoming_AX,-1 ; insure no exec done later
+ jmp set_return_flags ; no, fix the stack, then ret to caller
+ ; this means that the real call worked,
+ ; APPEND does not need to do anything
+
+what_happened:
+; cmp ax,handle_path_not_found ; normal errors
+; je handle_search ; yes, look for the file
+ cmp ax,expected_error ; was the error file not found?
+ je handle_search ; yes, look for the file
+ jmp set_return_flags ; no, fix the stack, then ret to caller
+
+
+handle_search:
+ call get_ext_err_code ; get the extended error code information
+
+; set up APPEND's stack
+ popff ; get rid of the flags from the
+ ; real operation
+; mov temp_DS_save,ds ; Save DS reg
+ mov stack_segment,ss ; Save it
+ mov stack_offset,sp ; Save it
+ mov ax,cs ; Get current segment
+ mov ss,ax ; and point stack seg here
+ lea sp,append_stack ; set up new stack
+
+ save_regs ; save registers
+ pushf ;
+ push cs ; establish addressability
+ pop ds
+
+ call crit_err_set
+
+ call ctrl_break_set
+
+; all done with the prep stuff, let's get down to business
+
+;------------------------------------------------------------------- ;AN001;
+; ;AN001;
+; before doing anything else, check DRIVE and PATH modes ;AN001;
+; ;AN001;
+;------------------------------------------------------------------- ;AN001;
+; ;AN001;
+
+ pushf ; save flags ;AN001;
+ push ax ; save AX ;AN001;
+ ;AN001;
+ cmp incoming_AX,exec_proc*256 ; is this call an exec?
+ je drive_and_path_ok
+
+
+;-------------------------------------------------------------------
+; Set up ES:SI to point to incoming string
+;-------------------------------------------------------------------
+
+ cmp incoming_AX,ext_handle_opn*256+0 ;is this call an ext open? ;AN003;
+ jne no_eo13 ;AN003;
+ mov si,incoming_SI ; DS:SI points to original name for ex open ;AN003;
+ mov es,incoming_DS ; but this code wants ES:SI to point to it ;AN003;
+ lea di,fname ; DS:DI points to fname area ;AN003;
+ jmp SHORT eo_skip3 ; skip the old stuff ;AN003;
+ ;AN003;
+no_eo13: ;AN003;
+ les si,dword ptr handle_ptr ; ES:SI points to original handle
+ lea di,fname ; DS:DI points to fname area
+eo_skip3:
+;-------------------------------------------------------------------
+
+ test mode_flags,Drive_mode ; Drive_mode enabled?
+ jnz check_path_mode ; yes, go check path mode
+
+ call check_for_drive ; no, find out if there is a drive
+ ; specified
+ cmp ax,0 ; was there a drive letter?
+ je check_path_mode ; no, go check path mode
+
+;-------------------------------------------------------------------
+; getting here means that Drive_mode is disabled and that a drive letter
+; was found. This means we give up on this APPEND operation
+
+ jmp SHORT drive_or_path_conflict
+
+
+check_path_mode:
+ test mode_flags,Path_mode ; Path_mode enabled?
+ jnz drive_and_path_ok ; yes, go do the APPEND function
+
+ call check_for_path ; no, find out if there is a path
+ ; specified
+
+ cmp ax,0 ; was there a path?
+ jne drive_or_path_conflict ; no, go do the APPEND function
+
+
+ call check_for_drive ; no, find out if there is a drive
+ ; specified
+ cmp ax,0 ; was there a drive letter?
+ je drive_and_path_ok ; no, everything is OK
+ ; yes, fall through and exit w/error
+
+;------------------------------------------------------------------- ;AN001;
+; getting here means that Drive_mode is disabled and that a drive ;AN001;
+; letter was found. This means we give up on this APPEND operatio ;AN001; n
+
+drive_or_path_conflict:
+
+ pop ax ; clean up stack
+ popff
+
+; restore_regs ; restore some regs ;AN002;
+; pop ax
+
+ mov ext_err_flag,1 ; we need to set extended error info
+ mov ax,expected_error ; make ax look like we got file not found
+ mov ax_after_21,ax ; save it away so we can restore it below
+ popff ; get flags from stack
+ stc ; set the carry flag
+ pushf ; put 'em back
+
+ jmp no_more_to_try2
+
+
+drive_and_path_ok: ;AN001;
+ pop ax ; restore AX ;AN001;
+ popff ; restore flags ;AN001;
+ ;AN001;
+;------------------------------------------------------------------- ;AN001;
+; end of code to check DRIVE and PATH modes ;AN001;
+;------------------------------------------------------------------- ;AN001;
+
+ cmp incoming_AX,ext_handle_opn*256+0 ;is this call an ext open? ;AN003;
+ jne no_eo1 ;AN003;
+ mov si,incoming_SI ; DS:SI points to original name for ex open ;AN003;
+ mov es,incoming_DS ; but this code wants ES:SI to point to it ;AN003;
+ lea di,fname ; DS:DI points to fname area ;AN003;
+ jmp SHORT eo_skip1 ; skip the old stuff ;AN003;
+ ;AN003;
+no_eo1: ;AN003;
+ les si,dword ptr handle_ptr ; ES:SI points to original handle
+ lea di,fname ; DS:DI points to fname area
+eo_skip1: ;AN003;
+ call get_fname ; strip just the 8.3 filename from
+ ; the original ASCIIZ string
+ call address_path ; address the path
+ cmp es: byte ptr [di],";" ; is append list null ?
+ jump E,no_more_to_try2 ; exit append
+ popff ;
+ mov si,di ; pointer to list of appended directories
+ pushf ; push flags onto stack just for the
+ ; popff below
+
+try_another2:
+ popff
+ lea di,try_dir ; buffer to be filled with dir name
+ ; to try
+ push cx ; save CX
+ call get_app_dir ; this routine will return with a dir
+ ; to try in try_dir
+ mov true_name_count,cx ; save number of chars for later us ;AN003;
+ pop cx
+ mov app_dirs_ptr,si ; save updated pointer
+
+
+;-----------------------------
+try_app_dir2:
+
+ call append_fname ; glue the filename onto the end of the dir to try
+
+
+; we now have an ASCIIZ string that includes the original 8.3 filename
+; and one of the appended dir paths
+
+ mov ax,incoming_AX
+ mov cx,incoming_CX
+ lea dx,try_dir ; point to new ASCIIZ string
+
+ cmp incoming_AX,ext_handle_opn*256+0 ; extended open? ;AN003;
+ jne not_eo1 ;AN003;
+ ;AN003;
+; this is an extended open call ;AN003;
+ ;AN003;
+ save_regs ;AN003;
+ ;AN003;
+ mov si,dx ; ext open wants DS:SI -> filename ;AN003;
+ push cs ;AN003;
+ pop ds ;AN003;
+ ;AN003;
+ mov ax,incoming_AX ; function code ;AN003;
+ mov bx,incoming_BX ; mode word ;AN003;
+ mov cx,incoming_CX ; attributes ;AN003;
+ mov dx,incoming_DX ; flags ;AN003;
+ mov es,incoming_ES ; ES:DI parm_list pointer ;AN003;
+ mov di,incoming_DI ;AN003;
+ ;AN003;
+ call int_21 ; try the extended open ;AN003;
+ ;AN003;
+ restore_regs ;AN003;
+ pushf ; save flags ;AN003;
+; mov es,incoming_ES ; restore es as it was ;AN003;
+ jmp SHORT not_exec2 ; go find out what happened ;AN003;
+ ;AN003;
+ ;AN003;
+not_eo1: ;AN003;
+ cmp incoming_AX,exec_proc*256+0 ; exec pgm call
+ jne not_exec1
+
+; this is an exec call ;AN003;
+
+ push es
+ push bx
+ mov ah,get_DTA
+ call int_21
+ mov word ptr incoming_DTA+0,bx ; save callers DTA
+ mov word ptr incoming_DTA+2,es
+ pop bx
+ pop es
+ push ds
+ push dx
+ mov ah,set_DTA
+ lea dx,exec_DTA ; set for fake exec search
+ push cs
+ pop ds
+ call int_21
+ pop dx
+ pop ds
+ mov ah,handle_fnd1 ; precess search by finds
+ mov expected_error,handle_no_more_files
+
+not_exec1:
+
+ push es ; save append's ES
+ push bx ; save append's BX
+ mov es,incoming_ES ; must restore ES before doing the call ; fix for P37, GGA 9/10/87
+ mov bx,incoming_BX ; must resatore user's ES:BX
+
+ call int_21 ; try the open
+
+ pop bx ; restore append's BX
+ pop es ; restore append's es
+ pushf ; save flags
+ cmp incoming_AX,exec_proc*256+0 ; exec pgm call
+ jne not_exec2
+ push ds
+ push dx
+ push ax
+ mov ah,set_DTA
+ mov dx,word ptr incoming_DTA+0 ; restore callers DTA
+ mov ds,word ptr incoming_DTA+2
+ call int_21
+ pop ax
+ pop dx
+ pop ds
+not_exec2:
+ popff
+ pushf
+ jnc found_it_remote ; all done
+
+ cmp crit_err_flag,0 ; process critical errors
+ jne check_crit_err
+
+ cmp ax,handle_path_not_found ; normal errors
+ je should_we_look_more
+
+ cmp ax,expected_error ; was the error we found file not found?
+ je should_we_look_more ; yes, look some more
+ jmp no_more_to_try2 ; no, any other error, we pack it in
+
+should_we_look_more:
+ mov si,app_dirs_ptr ; yes, see if we should look more
+ cmp si,null ; should we try again?
+ je no_more_to_tryx
+ jmp try_another2 ; yes
+no_more_to_tryx:
+ jmp no_more_to_try2
+
+check_crit_err:
+ mov ext_err_flag,1 ; we need to set extended error info
+ mov ax,expected_error ; make ax look like we got file not found
+ mov ax_after_21,ax ; save it away so we can restore it below
+ popff ; get clags from stack
+ stc ; set the carry flag
+ pushf ; put 'em back
+
+ jmp no_more_to_try2
+
+found_it_remote: ; come here only if the file was found in
+ ; an appended directory
+ mov ax_after_21,ax ; save AX
+
+
+; ;AN002;
+; Find out if this process has the true_name flag set in thier PSP. ;AN002;
+; At this point, DS:DX points to the true name of the found file ;AN002;
+; ;AN002;
+ ;AN002;
+ push ax ; save some regs ;AN002;
+ save_regs
+ ;AN002;
+ mov ah,get_PSP ; function code for get PSP operation ;AN002;
+ call int_21 ; get the PSP, segment returned in BX ;AN002;
+ mov es,bx ; need to use it as a segment ;AN002;
+ mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002;
+ ;AN002;
+ mov ax,es:[di] ; get APPEND flag into AX ;AN002;
+ test ax,true_name_flag ; is true name flag armed? ;AN002;
+ jz no_true_name ; no, don't copy true name ;AN002;
+ ;AN002;
+ sub ax,true_name_flag ; clear true name flag ;AN002;
+ mov es:[di],ax ; save it in PSP ;AN002;
+ ;AN002;
+ mov di,word ptr handle_ptr+0 ; get user's buffer pointer ES:DI ;AN002;
+ mov es,word ptr handle_ptr+2 ;AN002;
+
+; find out if this is a handle find or an open or an exec
+
+ cmp incoming_AX,exec_proc*256+0 ; exec?
+ je no_true_name ; yes, do nothing with true name
+ ;AN002;
+ cmp incoming_AX,handle_fnd1*256+0 ; handle find?
+ jne not_hf ; no, go do the easy stuff
+ ;AN002;
+; function we are doing is a handle find, must get part of true_name
+; string from append path, part from DTA. Messy!
+
+ lea si,try_dir ; buffer that has last APPEND path tried
+
+ mov cx,true_name_count ; get number of chars in true_name dir ;AN002;
+
+copy_true_name_loop2:
+ mov ah,ds:[si] ; get byte of append dir path ;AN002;
+ mov es:[di],ah ; copy it to user's buffer ;AN002;
+ inc si ; in this loop, the null is not copied ;AN002;
+ inc di ;AN002;
+ loop copy_true_name_loop2 ;AN002;
+
+; put in the "\"
+
+ mov ah,"\" ; get a \
+ mov es:[di],ah ; copy it
+ inc di ; increment pointer
+
+; we have copied the first part of the string, now get the real filename
+; from the DTA
+
+ push es
+ push bx
+
+ mov ah,get_DTA
+ call int_21
+ push es
+ pop ds
+ mov si,bx
+
+ pop bx
+ pop es
+
+copy_true_name_loop3:
+ mov ah,ds:[si+30] ; get byte of actual filename ;AN002;
+ mov es:[di],ah ; copy it to user's buffer ;AN002;
+ cmp ah,null ; is it a null? ;AN002;
+ je true_name_copied ; yes, all done ;AN002;
+ inc si ; in this loop the null is copied ;AN002;
+ inc di ;AN002;
+ jmp copy_true_name_loop3 ;AN002;
+
+not_hf:
+ mov si,dx ; make DS:SI point to true name
+
+copy_true_name_loop: ;AN002;
+ mov ah,ds:[si] ; get byte of true name ;AN002;
+ mov es:[di],ah ; copy it to user's buffer ;AN002;
+ cmp ah,null ; is it a null? ;AN002;
+ je true_name_copied ; yes, all done ;AN002;
+ inc si ;AN002;
+ inc di ;AN002;
+ jmp copy_true_name_loop ;AN002;
+ ;AN002;
+true_name_copied: ;AN002;
+ ;AN002;
+no_true_name: ;AN002;
+ restore_regs ; restore some regs ;AN002;
+ pop ax
+ ;AN002;
+ ;AN002;
+no_more_to_try2:
+
+ call ctrl_break_restore ; restore normal control break address
+ call crit_err_restore ; restore normal critical error address
+
+; find out if there is a need to set the extended error code
+
+ cmp ext_err_flag,0 ; do we need to set the extended error code?
+ je no_ext_err2 ; no, finish up
+ lea dx,ext_err_dpl
+ call set_ext_err_code ; yes, go set the ext error info
+
+; reset flags, and pack it in
+
+no_ext_err2:
+ popff
+ restore_regs ; restore registers
+ pushf ; put the real flags on the stack
+
+ jmp reset_stack ; fix stack, ret to caller
+
+page
+;-------------------------------------------------------------------
+;
+; support routines for drive and path mode checking
+;
+;
+;-------------------------------------------------------------------
+
+
+check_for_drive: ; input: ES:SI -> original string
+ ; output: AX = 0 no drive present
+ ; output: AX = -1 drive present
+
+ xor ax,ax ; assume no drive letter present
+
+ cmp es: byte ptr [si+1],':' ; is the second char a ":"?
+ jne exit_check_for_drive ; no, skip setting the flag
+
+ mov ax,-1 ; yes, set the flag
+
+exit_check_for_drive:
+
+ ret
+
+;-------------------------------------------------------------------
+
+check_for_path: ; input: ES:SI -> original string
+ ; output: AX = 0 no path present
+ ; output: AX = -1 path present
+
+ push si ; save pointer
+
+ xor ax,ax ; assume no path present
+
+
+; walk the string and look for "/", or "\". Any of these mean that a
+; path is present
+
+walk_handle_string:
+
+ push ax ;AN006;
+ mov al,es: byte ptr [si] ; is this a dbcs char? ;AN006;
+ call Chk_DBCS ;AN006;
+ pop ax ;AN006;
+ ;AN006;
+ jnc no_dbcs1 ; no, keep looking ;AN006;
+
+ add si,2 ; yes, skip it and the next char ;AN006;
+ jmp walk_handle_string ; the next char could be a "\", but ;AN006;
+ ; would not mean a path was found ;AN006;
+ ;AN006;
+no_dbcs1: ;AN006;
+ cmp es: byte ptr [si],"\" ; is the char a "\"?
+ je found_path ; yes, set flag and return
+ cmp es: byte ptr [si],"/" ; is the char a "/"?
+ je found_path ; yes, set flag and return
+ cmp es: byte ptr [si],0 ; is the char a null
+ je exit_check_for_path ; yes, got to the end of the
+ ; handle string
+
+ inc si ; point to next char
+ jmp walk_handle_string ; and look again
+
+found_path:
+ mov ax,-1 ; yes, set the flag
+
+exit_check_for_path:
+ pop si ; restore si
+ ret
+
+page
+;-----------------------------------------------------------------------------
+; Entry point for interrupt 2f handler
+;-----------------------------------------------------------------------------
+
+intfcn_hook:
+ cmp ah,append_2f ; is this function call for append?
+;;;;;; je do_appends ; @@12
+ jne ih_10 ; @@12
+ jmp do_appends ; @@12
+ih_10: ; @@12
+ cmp ah,applic_2f ; is this function call for applications
+ je do_applic
+ jmp pass_it_on
+
+do_applic:
+ cmp dx,-1 ; not COMMAND call
+ jump NE,pass_it_on
+ cmp al,0 ; match name request
+ jne ck01
+
+ mov cmd_buf,bx ; save CMDBUF offset
+ call check_cmd_name
+ jne no_internal1
+ mov al,append_inst ; inidicate I want this command
+no_internal1:
+ iret
+
+ck01:
+ cmp al,1 ; match name request
+ jne ck02
+
+; save pointer to parser
+
+ mov word ptr pars_off+0,di ; ES:DI points to COMMAND.COM's parser
+ mov word ptr pars_off+2,es ; save it for later
+
+ mov cmd_env,bx ; save env pointer address
+ call check_cmd_name
+ jne no_internal2
+ call COMMAND_begin ; process internal command
+no_internal2:
+ iret
+
+ck02:
+; cmp al,2 ; set COMMAND active ; @@13; @@09
+; jne ck03 ; @@13; @@09
+; mov cmd_active,1 ; @@13; @@09
+; iret ; @@13; @@09
+ck03: ; @@13; @@09
+; cmp al,3 ; set COMMAND in active ; @@13; @@09
+; jne ck04 ; @@13; @@09
+; mov cmd_active,0 ; @@13; @@09
+; iret ; @@13; @@09
+ck04: ; @@13; @@09
+ jmp pass_it_on
+
+;*******************************************************************************
+; The following old code is commented out. @@12
+;*******************************************************************************
+;check_cmd_name: ; see if internal APPEND
+; push es
+; push cs
+; pop es
+; push di
+; push cx
+; push si
+; cmp ds:byte ptr[si],6 ; length must match
+; jne skip_comp
+; comp append_id,6,[si+1] ; see if APPEND is command
+;skip_comp:
+; pop si
+; pop cx
+; pop di
+; pop es
+; ret
+;*********************************************************************
+check_cmd_name: ; See if APPEND @@12
+ push ax ; @@12
+ push si ; @@12
+ push cx ; @@12
+ push di ; @@12
+ push es ; @@12
+ mov si,cmd_buf ; DS:SI -> cmd buf ended with cr @@12
+ add si,2 ; 1st 2 bytes garbage @@12
+ ; @@12
+ccn_skip_leading: ; @@12
+ lodsb ; skip leading stuff @@12
+
+ call Chk_DBCS ; find out if this is DBCS ;AN006;
+ jnc no_dbcs2 ; no, keep looking ;AN006;
+ lodsb ; yes, skip it and the next byte ;AN006;
+ jmp ccn_skip_leading ; the second byte will be skipper when ;AN006;
+ ; we go back through ;AN006;
+
+no_dbcs2: ;AN006;
+ cmp al," " ; blank @@12
+ je ccn_skip_leading ; @@12
+ cmp al,tab_char ; tab @@12
+ je ccn_skip_leading ; @@12
+ cmp al,"," ; comma @@12
+ je ccn_skip_leading ; @@12
+ cmp al,"=" ; equal @@12
+ je ccn_skip_leading ; @@12
+ cmp al,";" ; semi-colon @@12
+ je ccn_skip_leading ; @@12
+ cmp al,"\" ; back slash @@12
+ je ccn_skip_leading ; @@12
+ cmp al,cr ; bad ret for early terminate @@12
+ jne ccn_02 ; @@12
+ cmp al,0 ; reset z for no match @@12
+ jmp SHORT ccn_ret ; @@12
+ccn_02: ; @@12
+ mov di,si ; di -> beginning of possible @@12
+ dec di ; "APPEND " string @@12
+ lodsb ; @@12
+ cmp al,":" ; @@12
+ jne ccn_cont ; @@12
+ mov di,si ; @@12
+ lodsb ; @@12
+ccn_cont: ; @@12
+ call Chk_DBCS ;AN006;
+ jnc no_dbcs3 ; no, carry on ;AN006;
+ add si,2 ; yes, skip it and the next byte ;AN006;
+ jmp SHORT ccn_20 ;AN006;
+ ;AN006;
+no_dbcs3: ;AN006;
+ cmp al,"\" ; move di up upon "\" @@12
+ jne ccn_20 ; @@12
+ mov di,si ; @@12
+ccn_10: ; @@12
+ lodsb ; @@12
+ jmp ccn_cont ; @@12
+ccn_20: ; @@12
+ cmp al," " ; look for separator @@12
+ je ccn_30 ; if found, then have command @@12
+ cmp al,"=" ; @@12
+ je ccn_30 ; @@12
+ cmp al,cr ; @@12
+ je ccn_30 ; @@12
+ cmp al,tab_char ; @@12
+ je ccn_30 ; @@12
+ cmp al,"," ; @@12
+ je ccn_30 ; @@12
+ cmp al,";" ; @@12
+ jne ccn_10 ; @@12
+
+ccn_30: ; @@12
+ sub si,di ; @@12
+ cmp si,7 ; @@12
+ jne ccn_ret ; no match @@12
+ ; @@12
+ mov si,di ; @@12
+ chkchar "A" ; look for "APPEND" string @@12
+ chkchar "P" ; @@12
+ chkchar "P" ; @@12
+ chkchar "E" ; @@12
+ chkchar "N" ; @@12
+ chkchar "D" ; @@12
+ ; exit with z set for match @@12
+ccn_ret: ; @@12
+ pop es ; @@12
+ pop di ; @@12
+ pop cx ; @@12
+ pop si ; @@12
+ pop ax ; @@12
+ ret ; @@12
+
+page
+;------------------------------------------------------------------- ;AN000;
+; ;AN000;
+; do_appends ;AN000;
+; ;AN000;
+; This is the INT 2F handler for the APPEND ;AN000;
+; subfunction ;AN000;
+; ;AN000;
+; New functions added for 3.30: ;AN000;
+; ;AN000;
+; ;AN000;
+; ;AN000;
+; Get /X status ;AN000;
+; ;AN000;
+; Input: AX = B706 ;AN000;
+; ;AN000;
+; Output: BX = 0000 /X not active ;AN000;
+; = 0001 /X active ;AN000;
+; ;AN000;
+; ;AN000;
+; ;AN000;
+; Set /X status ;AN000;
+; ;AN000;
+; Input: AX = B707 ;AN000;
+; ;AN000;
+; BX = 0000 turn /X off ;AN000;
+; BX = 0001 turn /X on (active) ;AN000;
+; ;AN000;
+;------------------------------------------------------------------- ;AN000;
+;
+do_appends:
+ cmp al,are_you_there ; is the function request for presence?
+ jne ck1
+
+ mov al,-1 ; set flag to indicate we are here
+ iret ; return to user
+
+ck1:
+ cmp al,dir_ptr ; is the function request for pointer?
+ jne ck2
+
+ les di,dword ptr dirlst_offset ; return dirlist pointer to caller
+ iret
+
+ck2:
+ cmp al,get_app_version ; is the function request for version?
+ jne ck3 ; no, check for next function
+
+ mov ax,-1 ; yes, set NOT NETWORK version
+ iret
+
+ck3:
+ cmp al,tv_vector ; is the function request for TV vector?
+ jne ck4 ; no, check for old dir ptr
+
+ mov tv_vec_seg,es ; yes, save the TV vector
+ mov tv_vec_off,di
+
+ push cs ; set ES:DI to tv ent pnt
+ pop es ;
+ lea di,tv_entry
+
+ xor byte ptr tv_flag,TV_TRUE ; set flag ;AN000;
+ iret
+
+ck4: ;
+ cmp al,old_dir_ptr ; is it the old dir ptr
+ jne ck5 ; no, pass it on
+
+ push ds
+ push cs
+ pop ds
+
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,1 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+
+ pop ds
+ mov al,1
+ call terminate ; exit to DOS ; @@05
+
+ck5: ;
+ cmp al,DOS_version ; is it the new version check
+ jne ck6 ; no, pass it on
+
+ mov ax,mode_flags ; set mode bits
+ xor bx,bx ; destroy registers
+ xor cx,cx
+ mov dl,byte ptr version_loc ; major version num
+ mov dh,byte ptr version_loc+1 ; minor version num
+ iret
+
+ck6: ;AN000;
+ cmp al,get_state ; is it get state call? ;AN001;
+ jne ck7 ; no, look some more ;AN000;
+ ;AN000;
+ mov bx,mode_flags ; get mode bits ;AN000;
+ iret ; return to user ;AN000;
+ ;AN000;
+ck7: ;AN000;
+ cmp al,set_state ; is it set state call? ;AN001;
+ jne ck8 ; no, look some more ;AN000;
+ ;AN000;
+ mov mode_flags,bx ; save the new state ;AN001;
+ iret ;AN000;
+ ;AN000;
+ck8: ;AN000;
+
+ cmp al,true_name ; is it the set true name function? ;AN002;
+ jne ck9 ; no, look some more ;AN002;
+ ;AN002;
+ push ax ; save some regs ;AN002;
+ push bx ;AN002;
+ push es ;AN002;
+ push di ;AN002;
+ ;AN002;
+ ;AN002;
+; get the PSP and then get the APPEND flags byte
+
+ mov ah,get_PSP ; function code to get PSP address ;AN002;
+ call int_21 ; get the PSP address ;AN002;
+ mov es,bx ; need to use it as a segment ;AN002;
+ mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002;
+ ;AN002;
+; is the flag already set?
+
+ mov ax,es:[di] ; get APPEND flag into AX ;AN002;
+ test ax,true_name_flag ; is it set? ;AN002;
+ jnz no_set_true_name ; yes, do nothing ;AN002;
+ ;AN002;
+; set the true_name flag
+
+set_true_name: ;AN002;
+ add ax,true_name_flag ; set true name flag ;AN002;
+ mov es:[di],ax ; save in PSP ;AN002;
+ ;AN002;
+no_set_true_name:
+ pop di ; restore some regs ;AN002;
+ pop es ;AN002;
+ pop bx ;AN002;
+ pop ax ;AN002;
+ ;AN002;
+ iret ; return ;AN002;
+ ;AN002;
+ck9: ;AN002;
+
+;-------------------------------------------------------------------
+; fill in additional 2F functions here
+;-------------------------------------------------------------------
+
+pass_it_on: ; the function call (ah) was not for append
+ jmp dword ptr intfcn_Offset ; jump to old INT 2f
+
+page
+;-----------------------------------------------------------------------------
+; Entry point for interrupt 24 handler
+;-----------------------------------------------------------------------------
+
+crit_err_handler:
+
+ mov crit_err_flag,0ffh ; set critical error flag
+ mov al,3 ; fail int 21h
+ iret
+
+page
+;-----------------------------------------------------------------------------
+; miscellaneous routines
+;-----------------------------------------------------------------------------
+;-----------------------------------------------------------------------------
+; tv_barrier
+;-----------------------------------------------------------------------------
+
+tv_barrier:
+
+ cmp tv_flag,TV_TRUE ; in Topview ;AN000;
+ jne no_barrier
+
+ push ax
+ mov ax,2002h ; wait on DOS barrier
+ int 2Ah
+ pop ax
+no_barrier:
+ ret
+
+;-----------------------------
+; check_config - this routine is called by both the FCB and handle open
+; code. I checks the net_config flag to see if it is zero, if so it
+; does an installation check. If it is non-zero, nothing is done.
+
+check_config:
+
+ push ax ; save a few registers
+ push bx
+
+; examine the config flag to see if we already know what config we have
+
+ cmp net_config,0
+ jne do_not_look ; we know config already
+
+; the flag word has not been set before, go find out what config we have
+
+ mov ax,0b800h ; installation code function code
+ int 2fh ; do the installation check
+
+ mov net_config,bx ; save flag word for later
+
+do_not_look:
+ pop bx ;restore regs and leave
+ pop ax
+ ret
+
+;*( Chk_DBCS ) *************************************************************
+;* *
+;* Function: Check if a specified byte is in ranges of the DBCS lead bytes*
+;* Attention: If your code is resident, comment out the lines marked *
+;* ;** . *
+;* *
+;* Input: *
+;* AL = Code to be examined *
+;* *
+;* *
+;* Output: *
+;* If CF is on then a lead byte of DBCS *
+;* *
+;* Register: *
+;* FL is used for the output, others are unchanged. *
+;* *
+;***************************************************************************
+Chk_DBCS PROC
+ PUSH DS
+ PUSH SI
+; CMP CS:DBCSEV_SEG,0 ; ALREADY SET ? ;**
+; JNE DBCS00 ;**
+ MOV SI,OFFSET EVEV ; SET DEFAULT OFFSET ;**
+ PUSH CS ;**
+ POP DS ; SET DEFAULT SEGMENT ;**
+ PUSH AX
+ MOV AX,6300H ; GET DBCS EV CALL
+ INT 21H
+ MOV CS:DBCSEV_OFF,SI ;**
+ MOV CS:DBCSEV_SEG,DS ;**
+ POP AX
+DBCS00:
+ MOV SI,CS:DBCSEV_OFF ;**
+ MOV DS,CS:DBCSEV_SEG ;**
+DBCS_LOOP:
+ CMP WORD PTR [SI],0
+ JE NON_DBCS
+ CMP AL,[SI]
+ JB DBCS01
+ CMP AL,[SI+1]
+ JA DBCS01
+ STC
+ JMP SHORT DBCS_EXIT
+DBCS01:
+ ADD SI,2
+ JMP DBCS_LOOP
+NON_DBCS:
+ CLC
+DBCS_EXIT:
+ POP SI
+ POP DS
+ RET
+Chk_DBCS ENDP
+
+
+;-----------------------------
+; append_fname - glues the fname onto the end of the dir to try
+
+append_fname:
+ push es
+ push ds
+ pop es
+ lea di,try_dir ; destination, sort of (dir name)
+ lea si,fname ; source (filename)
+
+; find the end of the dir name
+
+ mov dbcs_fb,-1 ; set flag for no dbcs first byte chars ;AN006;
+
+walk_dir_name:
+ mov al,byte ptr [di] ; get a char from dir name
+ cmp al,null ; are we at the end?
+ je end_of_dir ; yes, add on the fname
+
+ call Chk_DBCS ; char is in al ;AN006;
+ jnc no_dbcs4 ; no, keep looking ;AN006;
+ mov dbcs_fb,di ; save offset ;AN006;
+ inc di ; skip second byte
+
+no_dbcs4:
+ inc di ; no, keep stepping
+ jmp walk_dir_name
+
+; now it is time to append the filename
+
+end_of_dir:
+ mov al,byte ptr [di-1] ; get last char of dir name
+ cmp al,"\" ; is it a dir seperator?
+ jne check_next_dir_sep ; no, check the next dir sep char ;AN006;
+ ;AN006;
+ sub di,2 ; yes, must find out if real dir sep ;AN006;
+ ; or DBCS second byte ;AN006;
+ cmp dbcs_fb,di ; is the char before our dir sep a DBCS ;AN006;
+ ; first byte? ;AN006;
+ jne no_dbcs4a ; no, must check for the next dir sep ;AN006;
+ ; yes, this means we must put in a dir sep ;AN006;
+ add di,2 ; restore di ;AN006;
+ jmp SHORT put_in_dir_sep ; put int the dir sep char ;AN006;
+ ;AN006;
+no_dbcs4a: ;AN006;
+ add di,1 ; restore di, then check next dir sep ;AN006;
+
+check_next_dir_sep:
+ cmp al,"/" ; is it the other dir seperator?
+ je add_fname ; yes, no need to add one
+put_in_dir_sep: ;AN006;
+ mov al,"\" ; get dir seperator
+ stosb ; add to end of dir
+
+add_fname:
+ lodsb ; get a char from fname
+ stosb ; copy the char
+ cmp al,null ; are we at the and of the filename?
+ je eo_name ; yes, all done!
+ jmp add_fname
+
+
+
+
+
+
+
+eo_name:
+ pop es
+ ret
+
+
+;-----------------------------
+; get_fname strips out the 8.3 filename from the original ASCIIZ string
+;
+; INPUT: ES:SI points to original string
+; DS:DI points to area for filename
+
+get_fname:
+
+ mov bx,si ; save the pointer
+ mov dbcs_fb,-1 ; set the dbcs flag off ;AN006;
+
+gfn1:
+ mov ah,ES:byte ptr [si] ; get a char from the source
+ cmp ah,null ; is it a null?
+ je got_the_end ; yes, we found the end
+
+ call chk_dbcs ; is this char a DBCS first byte? ;AN006;
+ jnc no_dbcs5 ; no, carry on
+ mov dbcs_fb,si ; yes, save pointer
+ inc si ; skip second byte
+
+no_dbcs5:
+ inc si ; no, point to next char
+ jmp gfn1 ; loop till end found
+
+got_the_end:
+ mov ah,ES:byte ptr [si] ; get a char
+ cmp ah,"/" ; did we find a /
+ je went_too_far ; yes, we found the start
+ cmp ah,"\" ; did we find a \
+ je found_bslash ; yes, we found the start ;AN006;
+ cmp ah,":" ; did we find a :
+ je went_too_far ; yes, we found the start
+ cmp si,bx ; are we back to the original start?
+ je got_the_beg ; yes, we found the start of the fname
+ dec si ; step back a char, then look some more
+ jmp got_the_end
+
+found_bslash: ; found a backslash, must figure out if ;AN006;
+ ; is second byte of DBCS ;AN006;
+ dec si ; point to next char ;AN006;
+ cmp si,dbcs_fb ; do they match?
+ jne no_dbcs5a ; no, fix up si and carry on ;AN006;
+ dec si ; skip dbcs byte and loop some more ;AN006;
+ jmp got_the_end ;AN006;
+
+no_dbcs5a: ;AN006;
+ inc si ; went too far by one extra ;AN006;
+ ;AN006;
+went_too_far:
+ inc si ; went one char too far back
+
+; ES:SI now points to the beginning of the filename
+
+got_the_beg:
+ mov ah,ES:byte ptr [si] ; get a char from the source
+ mov byte ptr [di],ah ; copy to dest
+ cmp ah,null ; did we just copy the end?
+ je done_with_fname ; yes, all done
+ inc si ; no, get the next char
+ inc di
+ cmp di,offset app_dirs_ptr ; make sure we dont try to copy past the
+ je done_with_fname ; area
+ jmp got_the_beg
+
+done_with_fname:
+ ret
+
+;-----------------------------
+; this code executed to return to caller after APPEND's stack has been
+; initialized
+
+reset_stack:
+
+; reset the stack ;AN002;
+
+ popff ; restore flags from real open
+ mov ss,Stack_Segment ; Get original stack segment
+ mov sp,Stack_Offset ; Get original stack pointer
+ pushf ; put the flags on the old stack
+
+
+;-----------------------------
+; before jumping to this routine, SS:SP must point to the caller's stack,
+; and the flags from the real INT 21 operation must have been pushed
+
+set_return_flags:
+
+; must be sure to clear the true_name flag before leaving ;AN002;
+ ;AN002;
+ push ax ; save some regs ;AN002;
+ push bx ;AN002;
+ push es ;AN002;
+ push di ;AN002;
+ ;AN002;
+ mov ah,get_PSP ; function code for get PSP operation ;AN002;
+ call int_21 ; get the PSP, segment returned in BX ;AN002;
+ mov es,bx ; need to use it as a segment ;AN002;
+ mov di,PDB_Append ; get pointer to APPEND flag in PDB ;AN002;
+ ;AN002;
+ mov ax,es:[di] ; get APPEND flag into AX ;AN002;
+ test ax,true_name_flag ; is true name flag armed? ;AN002;
+ jz reset_stack2 ; no, don't copy true name ;AN002;
+ ;AN002;
+ sub ax,true_name_flag ; clear true name flag ;AN002;
+ mov es:[di],ax ; save it in PSP ;AN002;
+ ;AN002;
+ ;AN002;
+reset_stack2: ;AN002;
+ ;AN002;
+ pop di ; restore ;AN002;
+ pop es ;AN002;
+ pop bx ;AN002;
+ pop ax ;AN002;
+ ;AN002;
+ cmp tv_flag,TV_TRUE ;AN000;
+ jne tv_flag_not_set
+
+ mov ax,2003h ; clear open barrier
+ int 2Ah
+
+
+; pop down to the old flags on the user's stack
+
+tv_flag_not_set:
+
+ cmp incoming_AX,exec_proc*256+0 ; need to do exec
+ jne not_exec3
+ popff ; discard bad flags
+ mov ax,incoming_AX ; set exec parms
+
+ push ds ; save DS, this must be done ;an005;
+ ; to pervent DS from being trashed on return to caller ;an005;
+
+ push cs
+ pop ds
+ lea dx,try_dir
+ mov bx,incoming_BX
+ mov es,incoming_ES
+ call int_21 ; issue the exec
+
+ pop ds ; restore DS ; an005;
+
+ pushf
+
+not_exec3:
+ popff ; get flags from real int 21 (old stack)
+ pop temp_IP_save ; save IP, CS
+ pop temp_CS_save
+ lahf ; save flags in AH
+ popff ; pop old flags off stack
+ sahf ; replace old with new
+
+; push the new flags onto the stack, then fix CS and IP on stack
+
+ pushf ; push new flags onto stack
+ push temp_CS_save ; restore IP, CS
+ push temp_IP_save
+ mov ax,AX_after_21 ; Set AX as it was after open
+
+ call crit_sect_reset ; clear the critical section flag
+ iret ; return to the calling routine
+
+
+;-----------------------------
+; This routine is used to extract an appended dir from the dir list
+; On entry, DS:DI points to an area for the appended dir
+; and ES:SI points to the source string
+
+get_app_dir:
+
+ xor cx,cx ; keep a count of chars in cx ;AN003;
+copy_dir:
+ mov ah,es:byte ptr [si] ; get the char, and copy it into dest
+ cmp ah,null ; find a null?
+ je no_more_dirs ; yes, inform caller that this is the last one
+
+ cmp ah,";" ; check to see if we are at the end of a dir
+ je update_pointer ; yes,
+
+ mov byte ptr [di],ah ; if not null or semi-colon, then copy it
+ inc si ; increment both pointers
+ inc di
+ inc cx ; count of chars ;AN003;
+ jmp copy_dir ; do it some more
+
+update_pointer:
+ inc si ; point to next char
+ mov ah,es:byte ptr [si] ; get char ; @@16
+ cmp ah,null ; did we reach the end of the dir list?
+ je no_more_dirs ;
+
+ cmp ah,";" ; is is a semi-colon
+ je update_pointer
+ jmp SHORT all_done
+
+
+no_more_dirs:
+ xor si,si ; set end search flag
+
+all_done:
+ mov byte ptr [di],null ; null terminate destination
+ ret ; return to caller
+
+;-----------------------------
+; set ctrl-break check off
+; first, save the old state so we can restore it later,
+; then turn ctrl-break checking off
+
+ctrl_break_set:
+
+ mov ah,ctrl_break ; function code for ctrl-break check
+ xor al,al ; 0 = get current state
+ call int_21 ; call DOS INT 21 handler
+
+ mov ctrl_break_state,dl ; save the old ctrl-break state
+
+ mov ah,ctrl_break ; function code for ctrl-break check
+ mov al,01 ; set current state
+ xor dl,dl ; 0 = off
+ call int_21 ; call DOS INT 21 handler
+ ret
+
+
+;-----------------------------
+; restore ctrl-break checking flag to the way it was
+ctrl_break_restore:
+ mov ah,ctrl_break ; function code for ctrl-break check
+ mov al,01 ; set current state
+ mov dl,ctrl_break_state ; get the way is was before we messed with it
+ call int_21 ; call DOS INT 21 handler
+ ret
+
+;-----------------------------
+; restore ctrl-break checking flag to the way it was
+ctrl_break_rest:
+ mov ah,ctrl_break ; function code for ctrl-break check
+ mov al,01 ; set current state
+ mov dl,ctrl_break_state ; get the way is was before we messed with it
+ call int_21
+ ret
+
+;-----------------------------
+;
+crit_err_set:
+ mov crit_err_flag,0 ; clear the critical error flag
+
+ mov ax,get_crit_err ; Get INT 24h vector
+ call int_21 ; call DOS INT 21 handler
+
+ mov crit_vector_offset,bx ; Save it
+ mov ax,es ; es hase segment for resident code
+ mov crit_vector_segment,ax
+
+ lea dx,crit_err_handler ; DS:DX = New INT 21h vector
+ mov ax,set_crit_err ; function code for setting critical error vector
+ call int_21 ; call DOS INT 21 handler
+ ret ; go back to the caller
+
+
+;-----------------------------
+;
+crit_err_restore:
+ push ds ; save ds for this function
+ mov ax,set_crit_err ; function code for setting critical error vector
+ mov dx,crit_vector_offset ; get old int 24 offset
+ mov ds,crit_vector_segment ; get old int 24 segment
+ call int_21 ; call INT 21
+ pop ds
+ ret
+
+;-----------------------------
+; crit_sect_set - issues an enque request to the server to protect
+; against reentry. This request is issued only if the network is started,
+; and then, only for RCV, MSG, and SRV configurations
+crit_sect_set:
+ push ax
+ push bx
+ push di
+ push es
+
+ mov ax,net_config ; check the server config flag
+ cmp ax,0 ; is it zero?
+ je dont_set_crit_sect ; yes, skip it
+
+ cmp ax,redir_flag ; is it a redir?
+ je dont_set_crit_sect ; yes, skip it
+ ; otherwise, issue the request
+
+; the config flag was not zero or redir, so set crit section
+
+ mov ah,NETSYSUTIL
+ mov al,NETENQ
+ mov bx,TCBR_APPEND
+ int 2Ah
+
+dont_set_crit_sect: ; because of the config we don't want
+ pop es ; to set critical section
+ pop di
+ pop bx
+ pop ax
+ ret
+
+;-----------------------------
+;
+crit_sect_reset:
+ push ax
+ push bx
+
+ mov ax,net_config ; check the server config flag
+ cmp ax,0 ; is it zero?
+ je not_set ; yes, skip it
+
+ cmp ax,redir_flag ; is it a redir?
+ je not_set ; yes, skip it
+
+ mov ah,NETSYSUTIL ; turn critical section off
+ mov al,NETDEQ
+ mov bx,TCBR_APPEND
+ int 2Ah
+
+not_set:
+ pop bx
+ pop ax
+ ret
+
+
+;-----------------------------
+; save_first_ext_err - this routine is used to save the extended
+; error info after the first FCB open.
+save_first_ext_err:
+
+ push ax
+
+ mov ax,ext_err_dpl.DPL_AX ; copy all registers
+ mov save_ext_err.DPL_AX,ax
+ mov ax,ext_err_dpl.DPL_BX
+ mov save_ext_err.DPL_BX,ax
+ mov ax,ext_err_dpl.DPL_CX
+ mov save_ext_err.DPL_CX,ax
+ mov ax,ext_err_dpl.DPL_DX
+ mov save_ext_err.DPL_DX,ax
+ mov ax,ext_err_dpl.DPL_SI
+ mov save_ext_err.DPL_SI,ax
+ mov ax,ext_err_dpl.DPL_DI
+ mov save_ext_err.DPL_DI,ax
+ mov ax,ext_err_dpl.DPL_DS
+ mov save_ext_err.DPL_DS,ax
+ mov ax,ext_err_dpl.DPL_ES
+ mov save_ext_err.DPL_ES,ax
+
+ pop ax
+ ret
+
+;-----------------------------
+; get_ext_err_code - this routine is used to get the extended error
+; info for the error that cause append to start its search
+
+get_ext_err_code:
+ push ax ; save register that are changed by this
+ push bx ; DOS function
+ push cx
+ push di
+ push si
+ push es
+ push ds
+
+; get the extended error information
+
+ mov ah,59h ; function code for get extended error
+ xor bx,bx ; version number
+ call int_21 ; get the extended error
+
+; save it away in a DPL for set_ext_error_code
+; all fields in the DPL will be filled in except the last three,
+; which will be left at zero
+
+ mov ext_err_dpl.DPL_AX,ax
+ mov ext_err_dpl.DPL_BX,bx
+ mov ext_err_dpl.DPL_CX,cx
+ mov ext_err_dpl.DPL_DX,dx
+ mov ext_err_dpl.DPL_SI,si
+ mov ext_err_dpl.DPL_DI,di
+ mov ext_err_dpl.DPL_DS,ds
+ mov ext_err_dpl.DPL_ES,es
+
+
+; restore regs and return
+
+ pop ds
+ pop es ; restore registers
+ pop si
+ pop di
+ pop cx
+ pop bx
+ pop ax
+ ret
+
+;-----------------------------
+; set_ext_err_code - this routine is used to get the extended error
+; info for the error that cause append to start its search
+; CS:DX points to return list
+set_ext_err_code:
+ push ax ; save register that are changed by this
+ push ds ; DOS function
+
+; get the extended error information
+
+ mov ah,DOSSERVER ; function code for DOSSERVER call
+ mov al,DOSSETERROR ; sub-function code for set extended error
+ push cs
+ pop ds
+ call int_21 ; set the extended error
+
+; restore regs and return
+
+ pop ds ; restore registers
+ pop ax
+ ret
+page
+;-----------------------------
+; This routine is used to initiate DOS calls from within the APPEND interrupt
+; handlers. An INT instruction can not be used because it would cause APPEND
+; to be re-entered.
+;
+; SS, SP saved incase call is EXEC which blows them away
+int_21: ;
+ cmp tv_flag,TV_TRUE ; see if being re-entered ;AN000;
+ jne use_old_vec ; yes, pass through to DOS
+
+ pushf ; to comp for iret pops
+ call dword ptr tv_vec_off ; Call INT 21h
+ ret ;
+
+use_old_vec:
+ cmp vector_segment,0 ; not installed yet
+ je use_int
+
+ pushf ; to comp for iret pops
+ call dword ptr vector_offset ; Call INT 21h
+ ret ;
+
+use_int:
+ int DOS_function
+ ret
+page
+;-----------------------------
+; This routine is used to locate the current APPEND path string
+; result to ES:DI
+
+address_path:
+address_status: ; @@13
+ test mode_flags,E_mode
+ jnz get_env_mode
+
+address_pathx:
+ mov ax,append_2f*256+dir_ptr ; get from buffer
+ int int_function
+ clc
+ ret
+
+get_env_mode: ; get from environment
+; cmp cmd_active,0 ; different logic ; @@13; @@09
+; jne use_cmd_env ; if in COMMAND ; @@13; @@09
+ push bx
+ mov ah,get_PSP
+ call int_21 ; get the PSP
+ mov es,bx
+ mov bx,002ch ; address environment
+ mov ax,es:word ptr[bx]
+ mov es,ax
+ pop bx
+ cmp ax,0 ; PSP pointer is set
+ je address_pathx ; @@13
+use_cmd_env: ; @@13
+; cmp cmd_env,0 ; have not set my pointer yet
+; je address_pathx ; @@13
+; mov es,cmd_env ; @@13
+env_mode1:
+ mov di,0 ; start at start
+ cmp es:byte ptr[di],0 ; no environment
+ je no_appendeq
+find_append:
+ cmp es:word ptr[di],0 ; at environment end
+ je no_appendeq
+ push di
+ push si
+ push cx
+ push ds
+ push cs
+ pop ds
+ comp ,6+1,append_id ; string = "APPEND="
+ pop ds
+ pop cx
+ pop si
+ pop di
+ je at_appendeq
+ inc di
+ jmp find_append
+at_appendeq: ; must insure this is @@17
+ cmp di,0 ; genuine "APPEND=" string @@17
+ je at_appendeq_genuine ; if start of environ ok @@17
+ dec di ; else check that 0 @@17
+ cmp es:byte ptr[di],0 ; precedes string @@17
+ je at_appendeq_10 ; jmp if ok @@17
+ add di,8 ; else cont.search after @@17
+ jmp find_append ; "=" @@17
+at_appendeq_10: ; @@17
+ inc di ; @@17
+at_appendeq_genuine: ; @@17
+ add di,6+1 ; skip APPEND=
+ cmp es:byte ptr[di],0 ; null value
+ je no_appendeq ; treat as not found
+ cmp es:byte ptr[di]," "
+ je no_appendeq
+ cmp es:byte ptr[di],";"
+ je no_appendeq
+ clc ; set ok
+ ret
+
+no_appendeq: ; not found, use default
+ lea di,semicolon ; null list
+ push cs
+ pop es
+ stc ; set error
+ ret
+
+;----------------------------- ; @@03
+; This routine is used to locate the current APPEND path string ; @@03
+; result to ES:DI. Used by APPEND status. ; @@03
+
+;address_status: ; @@13; @@03
+; test mode_flags,E_mode ; @@13; @@03
+; jump Z,address_pathx ; @@13; @@03
+; jmp use_cmd_env ; @@13; @@03
+
+cap_dl: ; convert dl to uppercase
+ cmp dl,"a" ; find out if we have a lower case; @@14
+ jb cap_dlx ; char ; @@14
+ cmp dl,"z" ; @@14
+ ja cap_dlx ; @@14
+ sub dl,"a"-"A" ; convert char to upper case ; @@14
+cap_dlx:
+ ret
+
+; end_address: ; this is the end of the TSR stuff ;AN002;
+
+page
+;-----------------------------------------------------------------------------
+; Main routine. Used to determine if APPEND has been loaded
+; before. If not, load resident portion of APPEND. Then handle setting
+; or displaying appended directory list.
+;-----------------------------------------------------------------------------
+
+main_begin: ; DOS entry point
+
+ mov ax,seg mystack ; set up stack
+ mov ss,ax
+ lea sp,mystack
+
+ cld
+
+ mov res_append,0 ; set external copy ; @@05
+
+ push cs ; make DS point to CS
+ pop ds
+
+ push cs ; make ES point to CS
+ pop es
+
+
+; find out if append has been loaded ; @@04
+ ; @@04
+ mov ah,append_2f ; int 2f function code for append ; @@04
+ mov al,are_you_there ; function code to ask if append ; @@04
+ ; has been loaded ; @@04
+ int int_function ; @@04
+ ; @@04
+ cmp al,append_inst ; is append there? ; @@04
+ jne not_there_yet ; no ; @@04
+
+ mov dx,0 ; set for network version ; @@07
+ mov ah,append_2f ; int 2F function code for append ; @@07
+ mov al,DOS_version ; function code for get version ; @@07
+ int int_function ; @@07
+ cmp dx,word ptr version_loc ; does the version match? ; @@07
+ jne bad_append_ver ; no, cough up an error messsage ; @@07
+
+
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,9 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+; mov cx,len_second_APPEND_msg; length of string ;AN000; ; @@04
+; lea dx,second_APPEND_msg ; second load message ;AN000; ; @@04
+; call print_STDERR ; display error message ;AN000; ; @@04
+; lea dx,crlf ; carriage return, line feed ; @@04
+; mov cx,crlf_len ; length of string ; @@04
+; call print_STDERR ; @@04
+ ; @@04
+ mov al,0fch ; second load ; @@05
+ call terminate ; exit to DOS ; @@05
+
+bad_append_ver: ; append version mismatch ; @@07
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,1 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+; mov cx,len_bad_append_msg ;AN000; ; @@07
+; lea dx,bad_append_msg ; bad app message ;AN000; ; @@07
+; call print_STDERR ;AN000; ; @@07
+; lea dx,crlf ; carriage return, line feed ; @@07
+; mov cx,crlf_len ; length of string ; @@07
+; call print_STDERR ; @@07
+ mov ax,0feh ; bad APPEND version ; @@05
+ call terminate ; exit to DOS ; @@05
+
+not_there_yet: ; @@04
+
+ mov cs:initial_pass,-1 ; set a flag for initial pass ;AN007;
+ call do_command ; do actual APPEND
+
+ mov bx,4 ; close all standard files
+do_closes:
+ mov ah,3eh ; close file handle
+ call int_21
+ dec bx
+ jns do_closes
+
+ call set_vectors ; set append vectors on success ; @@05
+
+ call Release_Environment ; release the environmental vector space ;an007; dms;
+
+ lea dx,end_address+15 ; normal end
+ mov cl,4 ; calc end address in paragraphs
+ shr dx,cl
+ mov ah,get_PSP ; calc space from PSP to my code ; @@02
+ call int_21 ; @@02
+ mov ax,cs ; @@02
+ sub ax,bx ; @@02
+ add dx,ax ; calc length to keep ; @@02
+ mov al,0 ; exit with no error
+ mov ah,term_stay
+ call int_21
+
+page
+
+COMMAND_begin: ; COMMAND entry point
+ save_regs
+ mov word ptr cmd_name@+0,si ; save internal command buffer @
+ mov word ptr cmd_name@+2,ds
+ cld
+
+ mov abort_sp,sp ; save sp for aborts ; @@05
+ mov res_append,1 ; set resident copy ; @@05
+ call do_command ; do actual APPEND
+abort_exit: ; exit to abort append ; @@05
+ mov sp,abort_sp ; @@05
+
+ push es
+ push di
+ les di,cmd_name@
+ mov es:byte ptr[di],0 ; set no command now
+ pop di
+ pop es
+
+ cmp ax,0 ; error
+ jne no_E_mode_via
+ test mode_flags,E_mode ; no /E processing
+ jz no_E_mode_via
+
+ mov ax,append_2f*256+dir_ptr; int 2f function code for append
+ int int_function
+ push es
+ pop ds
+ mov si,di
+
+; mov ah,get_PSP ; set new command
+; call int_21
+ mov bx,ss
+ mov es,bx
+ mov bx,cmd_buf ; command line iput buffer
+ inc bx ; skip max length
+ mov es:byte ptr[bx],3+1+6+1
+ mov di,bx ; address command line buffer
+ inc di ; skip current length
+ push ds
+ push si
+ push cs
+ pop ds
+ move ,3+1+6+1,setappend_name ; set in "SET APPEND="
+ pop si
+ pop ds
+ cmp ds:byte ptr[si],";" ; null list is special case
+ jne copy_path
+append_blank:
+ mov al," "
+ stosb
+ inc es:byte ptr[bx]
+ jmp short copy_path_done
+no_E_mode_via:
+ jmp short no_E_mode
+copy_path:
+ mov dl, byte ptr es:[bx-1] ; get max len of command buffer
+ sub dl, 3+1+6+1 ; take care of 'SET APPEND='
+;
+;------ now find the strlen of path string pointed by ds:si
+;
+; REPLACE WITH BETTER CODE LATER --- mohan
+;
+ push si ; save ptr to paths
+ xor cx, cx
+count_next_char:
+ lodsb
+ or al, al
+ jz check_len
+ inc cx
+ jmp count_next_char
+null_path:
+ pop si
+ jmp append_blank
+check_len:
+ pop si
+;
+;------ check whether the length is ok
+;
+ cmp cl, dl ; len < maxlen ?
+ jb copy_it
+ push si
+ add si, cx ; point to end of path str
+next_char:
+ jcxz null_path ; null str ?
+ dec cl
+ dec si
+ cmp byte ptr ds:[si], ';'
+ jne next_char
+ cmp cl, dl ; found ';' but is len ok?
+ jae next_char
+ pop si
+ add byte ptr es:[bx], cl
+copy_it:
+ rep movsb
+;
+;------ The code in this box replaced by code below copy_path:------------
+; lodsb ;
+; cmp al,0 ;
+; je copy_path_done ;
+; stosb ;
+; inc es:byte ptr[bx] ;
+; jmp copy_path ;
+;--------------------------------------------------------------------------
+copy_path_done:
+ mov es:byte ptr[di],cr ; set end delimiter
+
+ les di,cmd_name@
+ mov al,3 ; SET length
+ stosb
+ push cs ; @@06
+ pop ds ; @@06
+ move ,8,set_name ; set up "SET" command
+
+ mov ax,0 ; set to do SET
+no_E_mode:
+
+ restore_regs
+ ret
+
+page
+
+do_command: ; APPEND process
+
+; set ctrl-break check off
+; first, save the old state so we can restore it later,
+; then turn ctrl-break checking off
+
+ mov ah,ctrl_break ; function code for ctrl-break check
+ xor al,al ; 0 = get current state
+ call int_21
+
+ mov ctrl_break_state,dl ; save the old ctrl-break state
+
+ mov ah,ctrl_break ; function code for ctrl-break check
+ mov al,01 ; set current state
+ xor dl,dl ; 0 = off
+ call int_21
+
+; find out if append has been loaded
+
+ mov ah,append_2f ; int 2f function code for append
+ mov al,are_you_there ; function code to ask if append
+ ; has been loaded
+ int int_function
+
+ cmp al,append_inst ; is append there?
+ jne not_already_there ; yes, don't try to put it
+ jmp already_there ; yes, don't try to put it
+ ; there again
+
+; get DOS version and decide if it is in the allowed range for
+; APPEND
+
+not_already_there:
+ mov ah,get_version ; lets find out if we should do it
+ call int_21 ; try the open
+ cmp ax,expected_version ; compare with DOS version
+ jne bad_DOS
+
+ jmp SHORT check_assign ; valid range
+ ; lets see if assign has been loaded
+
+; Break it to the user that he's trying to do an APPEND with
+; the wrong DOS version
+
+bad_DOS:
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,8 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+
+; mov cx,len_bad_DOS_msg ; length of string ;AN000;
+; lea dx,bad_DOS_msg ; bad DOS message ;AN000;
+; call print_STDERR ; display error message ;AN000;
+
+ call ctrl_break_rest
+ mov al,0ffh ; bad DOS version ; @@05
+ call terminate ; exit to DOS ; @@05
+
+check_assign:
+ mov ax,0600h
+ int 2fh
+ or al,al
+ jnz assign_there
+ jmp SHORT check_TopView ; ASSIGN has not been loaded, ; @@01
+
+; ASSIGN has been loaded before APPEND, bad news!
+
+assign_there:
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,6 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+
+; mov cx,len_append_assign_msg; length of string
+; lea dx,append_assign_msg
+; call print_STDERR ; display error message
+ jmp SHORT conflict_exit ; @@01
+ ; @@01
+check_Topview: ; @@01
+ mov bx,0 ; incase not there ; @@01
+if not MSVER ; MSKK02 07/14/89
+ mov ax,10h*256+34 ; TopView version check ; @@01
+ int 15h ; @@01
+endif
+ cmp bx,0 ; @@01
+ jnz TopView_there ; @@01
+ jmp replace_vector ; TopView has not been loaded, ; @@01
+ ; @@01
+; TopView has been loaded before APPEND, bad news! ; @@01
+ ; @@01
+TopView_there: ; @@01
+; mov cx,len_append_TV_msg ; length of string ; @@01
+; lea dx,append_TV_msg ; @@01
+; call print_STDERR ; display error message ; @@01
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,7 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+
+ ; @@01
+conflict_exit: ; @@01
+ call ctrl_break_rest
+ mov al,0fdh ; @@05
+ call terminate ; exit to DOS ; @@05
+
+; get pointer to dir list, on return ES:DI points to buffer
+
+already_there:
+
+; This code has been moved to main_begin ; @@07
+; ; @@07
+; make sure the right version of APPEND has been loaded ; @@07
+;
+
+; mov dx,0 ; set for network version ; @@07
+; mov ah,append_2f ; int 2F function code for append ; @@07
+; mov al,DOS_version ; function code for get version ; @@07
+; int int_function ; @@07
+; cmp dx,word ptr version_loc ; does the version match? ; @@07
+; jump NE,bad_append_ver ; no, cough up an error messsage ; @@07
+
+process_args: ; process all arguments
+
+;-------------------------------------------------------------------
+ mov si,0081h ; DS:SI points to argument area
+ mov cs:byte ptr e_switch+9,0 ; turn /E switch off
+
+process_argsx: ; process all arguments
+;
+
+
+; make sure that the /PATH and /X switches are re-enabled, and
+; various flags are cleared
+
+ xor cx,cx ; ordinal value, must start as 0
+ xor dx,dx ; these regs must be 0 for call to Scan_For_Equal
+
+ mov ah,"/"
+ mov cs:byte ptr x_switch+9,ah ; re-enable /X switch
+ mov cs:byte ptr path_switch+9,ah ; re-enable /PATH switch
+ mov cs:byte ptr x_result.$P_Type,cl ; clear flag
+ mov cs:byte ptr path_result.$P_Type,cl ; clear flag
+ mov cs:byte ptr dirs_result.$P_Type,cl ; clear flag
+ mov cs:parse_flag,cl ; clear parse flag
+
+; set up things to call PARSER
+
+ push cs ; make sure ES points to segment where
+ pop es ; parm block info is
+ lea di,cs:p_block2 ; ES:DI points to parm block, for secondary parsing
+
+;
+; Note CX and DX, cleared above, must stay cleared for this call
+
+ call Scan_For_Equal ; yes - let's see if we have "=" symbol ;an008; dms;
+ ; parse past it if we do
+
+get_pars_info:
+ call dword ptr pars_off ; call to COMMAND.COM's parser
+
+ or ax,ax ; end of line? -1 if yes
+ jns not_end_of_line ; no, carry on
+ jmp end_of_line_reached ; yes, go figure out what we got
+
+not_end_of_line:
+
+ or ax,ax ; no, find out if there an error
+ je not_parse_error ; no, carry on
+ jmp parse_error ; yes, go display the error message
+
+; got here without any errors, set the proper bits in mode_flags
+
+not_parse_error:
+ mov cs: parse_flag,0ffh ; set parse flag
+
+check_e:
+ cmp e_result.$P_Type,3 ; was there a /E in this pass?
+ jne check_? ; no, look for an ?
+
+ mov byte ptr e_switch+9,0 ; turn this off so we don't allow another
+ mov e_result.$P_Type,0 ; clear this so we don't get fooled later
+
+ or mode_flags,E_mode ; set E mode on
+
+ jmp get_pars_info ; go get another argument
+
+
+check_?:
+ cmp qu_result.$P_Type,3
+ jne check_x
+ mov qu_result.$P_Type,0 ; clear this so we don't get fooled later
+ call sysloadmsg
+
+ mov ax,MSG_OPTIONS_FIRST
+p_n: cmp ax,MSG_OPTIONS_LAST
+ jg end_?
+ mov bx,STDOUT ; no handle
+ xor cx,cx ; sub count
+ xor dl,dl ; no input
+ mov dh,-1 ; message class
+ call sysdispmsg
+ inc ax ; sysdispmsg does NOT trash ax
+ jmp short p_n
+
+end_?: xor ax,ax ; return normal exit code
+ call ctrl_break_rest
+ call terminate
+
+check_x:
+ cmp x_result.$P_Type,3 ; was there a /X on this pass? list index
+ je set_x ; yes, and it was /X w/o ON or OFF
+
+ cmp x_result.$P_Type,2 ; was there a /X on this pass? list index
+ jne check_path
+
+ mov byte ptr x_switch+9,0 ; turn this off so we don't allow another
+ mov x_result.$P_Type,0 ; clear this so we don't get fooled later
+
+ cmp x_result.$P_Item_Tag,1 ; was /X or /X:ON specified?
+ je set_x ; yes, set X mode on
+ and mode_flags,NOT x_mode ; no, clear it
+ jmp get_pars_info
+
+set_x:
+ or mode_flags,x_mode
+ jmp get_pars_info
+
+check_path:
+ cmp path_result.$P_Type,2 ; was there a /path on this pass? list index
+ jne check_dirs
+
+ xor ah,ah ; turn this off so we don't allow
+ mov byte ptr path_switch+9,ah ; another
+ mov path_result.$P_Type,0 ; clear this so we don't get fooled later
+
+
+ cmp path_result.$P_Item_Tag,1 ; was /PATH:ON specified?
+ je set_path ; yes, set PATH mode
+ and mode_flags,NOT path_mode ; no, clear it
+ jmp get_pars_info
+
+set_path:
+ or mode_flags,path_mode ; set PATH mode on
+ jmp get_pars_info
+
+; find out if dirs specified
+
+check_dirs:
+ cmp dirs_result.$P_Type,3 ; was a simple string returned?
+ je check_dirs2 ; yes, carry on
+ jmp get_pars_info ; no, all done for now
+
+; set up stuff to do the dirs copy
+
+check_dirs2:
+ push es
+ push ds
+ push si
+ push di
+
+ lds si,dword ptr dirs_result.$P_Picked_Val ; get pointer to dirs string
+ mov dirs_result.$P_Type,0 ; clear this so we don't get fooled later
+
+ mov di,0 ; set incase int 2f not installed ; @@08
+ mov es,di ; @@08
+ mov ax,append_2f*256+dir_ptr ; es:di -> internal result area ; @@08
+ int int_function ; @@08
+ mov ax,es ; see if active yet ; @@08
+ or ax,di ; @@08
+ jnz copy_dirs_loop ; ok, do the copy ; @@08
+ push cs ; not active, set myself ; @@08
+ pop es ; @@08
+ lea di,app_dirs ; @@08
+
+copy_dirs_loop:
+ movs es: byte ptr[di],ds:[si]; copy char
+
+ cmp byte ptr ds:[si-1],0 ; is char a null
+ je done_copy_dirs
+
+ jmp copy_dirs_loop
+
+done_copy_dirs:
+
+ pop di
+ pop si
+ pop ds
+ pop es
+
+ jmp get_pars_info ; no error yet, loop till done
+
+end_of_line_reached:
+ mov old_syntax,0 ; process old format operands
+
+ cmp cs:initial_pass,-1 ; is this the first APPEND ;AN006;
+ je first_one ; yes, clear flag and exit ;AN006;
+
+ cmp cs:parse_flag,0 ; if this flag is off, means null command line
+ ; was nothing on the command line
+ je display_dirs ; go display the dirs
+
+first_one: ;AN006;
+ mov cs:initial_pass,0 ; clear first pass flag ;AN006;
+
+done_for_now:
+normal_exit:
+ call ctrl_break_rest ; reset control break checking
+ mov ax,0 ; set string
+ ret ; exit to COMMAND
+
+
+parse_error:
+ push ax ;save parser error code ;an010;bgb
+ call sysloadmsg ;AN000;
+ pop ax ;restore parser error coed ;an010;bgb
+ call do_parse_err ;an010;bgb
+ jmp SHORT bad_parmx ; display message and get out
+
+;-------------------------------------------------------------------
+
+; mov si,0081h ; point si to argument area
+; mov bx,ss
+; mov ds,bx
+;
+;process_argsx: ; process all arguments
+; mov di,0 ; set incase int 2f not installed ; @@08
+; mov es,di ; @@08
+; mov ax,append_2f*256+dir_ptr ; es:di -> internal result area ; @@08
+; int int_function ; @@08
+; mov ax,es ; see if active yet ; @@08
+; or ax,di ; @@08
+; jnz have_ptr ; @@08
+; push cs ; not active, set myself ; @@08
+; pop es ; @@08
+; lea di,app_dirs ; @@08
+;have_ptr: ; @@08
+;
+;; step through the DOS command line argument area, and copy the new dir
+;; list to the proper place in APPEND. This requires some parsing for
+;; spaces, tabs chars, equal signs, as well as conversion to upper case
+;
+; cmp byte ptr[si],"=" ; APPEND=path is OK syntax
+; jne skip_leading
+; inc si
+;skip_leading: ; skip leading spaces
+; lodsb
+; cmp al," "
+; je skip_leading
+; cmp al,tab_char
+; je skip_leading
+; cmp al,"," ; @@15
+; je skip_leading ; @@15
+; cmp al,"=" ; @@15
+; je skip_leading ; @@15
+; cmp al,cr ; did we have command line arguments?
+; jump E,display_dirs ; no, display the dirs currently appended
+; cmp al,"/" ; is it a parm starter? ; @@05
+; jump E,bad_path_parm ; yes, it's an error ; @@05
+; dec si
+;
+;copy_args:
+; lodsb ; get char from command line area
+; cmp al,cr ; are we at the end?
+; jump E,found_end ; yes, display the currently appended dirs
+; cmp al," " ; is it a space?
+; je found_space ; yes, at end
+; cmp al,tab_char ; is it a tab?
+; je found_space ; yes, treat it like a space
+; cmp al,"/" ; is it a parm starter?
+; je bad_path_parm ; yes, it's an error ; @@05
+; cmp al,"a" ; find out if we have a lower case char
+; jb copy_char ; @@14
+; cmp al,"z"
+; ja copy_char ; @@14
+; sub al,"a"-"A" ; convert char to upper case ; @@14
+;
+;copy_char:
+; mov in_middle,-1 ; say that we made it to the middle
+; stosb ; no, copy char into resident storage area
+; jmp copy_args ; do it some more
+;
+;found_space:
+; cmp in_middle,0 ; set the space flag then go through
+; jump E,copy_args ; loop some more
+;
+;found_end:
+; cmp in_middle,0 ; if I found the end of string but not
+; jump E,display_dirs ; in the middle, go display some dirs
+;
+; mov es:byte ptr [di],0 ; null terminate the string
+; mov in_middle,0
+; cmp al,cr
+; je past_trailing
+;
+;skip_trailing: ; skip end spaces
+; lodsb
+; cmp al," "
+; je skip_trailing
+; cmp al,tab_char
+; je skip_trailing
+; cmp al,"/" ; path and parm not together ; @@05
+; je bad_path_parm ; @@05
+; cmp al,cr ; only white space allowed at end
+; jne bad_path
+;past_trailing:
+;
+; cmp old_syntax,0 ; go back to normal mode
+; je normal_exit
+; jmp exit_append2
+;normal_exit:
+; call ctrl_break_rest ; reset control break checking
+; mov ax,0 ; set string
+; ret ; exit to COMMAND
+
+bad_path: ; bad paath operand
+; mov cx,len_path_error_msg ; length of string
+; lea dx,path_error_msg
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,3 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+;gga call sysdispmsg ;AN000;
+
+ jmp short bad_parmx
+
+bad_path_parm: ; bad parameter ; @@05
+; mov cx,len_path_parm_error_msg ; length of string ; @@05
+; lea dx,path_parm_error_msg ; @@05
+ call sysloadmsg ;AN000;
+ mov ax,3 ; message number ;AN000;
+ mov bx,STDERR ; standard error ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ jmp short bad_parmx ; @@05
+bad_parm: ; bad parameter
+; mov cx,len_parm_error_msg ; length of string
+; lea dx,parm_error_msg
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,3 ; message number ;AN000;
+ mov bx,STDERR ; standard error ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+
+bad_parmx: ; bad parameter
+ push ds
+ push cs
+ pop ds
+; call print_STDERR ; display error message
+ lea si,inv_parm ; point to msg parm ;an010;bgb
+ call sysdispmsg ;AN000;
+ pop ds
+ call ctrl_break_rest
+ mov al,1 ; @@05
+ call terminate ; exit to DOS ; @@05
+
+; This code has been moved to main_begin ; @@07
+;bad_append_ver: ; append version mismatch ; @@07
+; push ds ; @@07
+; push cs ; @@07
+; pop ds ; @@07
+; mov cx,len_bad_append_msg ; @@07
+; lea dx,bad_append_msg ; bad app message ; @@07
+; call print_STDERR ; @@07
+; lea dx,crlf ; carriage return, line feed ; @@07
+; mov cx,crlf_len ; length of string ; @@07
+; call print_STDERR ; @@07
+; pop ds ; @@07
+; call ctrl_break_rest ; @@07
+; mov ax,0feh ; bad APPEND version ; @@05
+; call terminate ; exit to DOS ; @@05
+
+; Display currently appended directories
+
+display_dirs:
+ call address_status ; get working path ; @@03
+ push ds
+ push es
+ pop ds
+
+ cmp es:byte ptr[di],";" ; no append now
+ je no_dirs_appended
+
+; count the chars in the dir list, cx will hold the count
+
+ mov si,di
+ sub si,6+1 ; move pointer to APPEND
+ mov dx,si ; save pointer to string
+ xor cx,cx
+
+scanit:
+ lodsb ; get character
+ cmp al,null ; are we at end?
+ je print_it ; yes, print it
+ inc cx ; look at the next character
+ jmp scanit ; loop till we find the end
+
+print_it:
+ call print_STDOUT ; display appended dirs
+ push cs
+ pop ds
+ lea dx,crlf ; carriage return, line feed
+ mov cx,crlf_len ; length of string
+ call print_STDOUT
+ pop ds
+
+exit_append:
+ cmp old_syntax,0 ; process old format operands
+ je exit_append2
+ mov si,0081h ; set up rescan
+ mov ah,get_PSP
+ call int_21
+ mov ds,bx
+ jmp process_argsx
+
+exit_append2:
+ mov old_syntax,0 ; after first time this must be off
+ call ctrl_break_rest ; reset control break checking
+ mov ax,-1 ; no action
+ ret ; exit to COMMAND
+
+no_dirs_appended:
+ push cs
+ pop ds
+
+ call sysloadmsg ;AN000;
+ ;AN000;
+ mov ax,5 ; message number ;AN000;
+ mov bx,STDERR ; handle ;AN000;
+ xor cx,cx ; sub count ;AN000;
+ xor dl,dl ; no input ;AN000;
+ mov dh,-1 ; message class ;AN000;
+ call sysdispmsg ;AN000;
+
+; lea dx,no_append_msg ; no dirs message ;AN000;
+; mov cx,len_no_append_msg ; length of string ;AN000;
+; call print_STDOUT ;AN000;
+ pop ds
+ jmp exit_append2 ; APPEND = = fix ;GGA
+
+page
+;-------------------------------------------------------------------
+; Getting here means that APPEND has not been loaded yet. Get the
+; old vector, save it, and point the vector to the new routine.
+;-------------------------------------------------------------------
+
+replace_vector:
+
+ push ds
+ mov si,0081h ; point si to argument area
+ mov ah,get_PSP
+ call int_21
+ mov ds,bx
+
+; Process /X and /E parameters
+
+skip_leading2: ; skip leading spaces
+; lodsb
+; cmp al," "
+; je skip_leading2
+; cmp al,tab_char
+; je skip_leading2
+; cmp al,cr ; at end
+; jump E,parms_done
+; cmp al,"/"
+; jne set_old_syntax
+
+found_slash:
+; lodsb
+; cmp al,"e"
+; je slash_E
+; cmp al,"E"
+; je slash_E
+; cmp al,"x"
+; je slash_X
+; cmp al,"X"
+; je slash_X
+bad_parmy:
+; pop ds
+; jmp bad_parm
+bad_path_parmy:
+; pop ds
+; jmp bad_path_parm
+
+slash_X:
+; test mode_flags,X_mode ; no duplicates allowed
+; jnz bad_parmy
+; or mode_flags,X_mode
+; jmp short slashx
+
+slash_E:
+; test mode_flags,E_mode ; no duplicates allowed
+; jnz bad_parmy
+; or mode_flags,E_mode
+slashx:
+; jmp skip_leading2 ; loop some more
+set_old_syntax:
+;; test mode_flags,0 ; no /? switches on old mode
+;; jne bad_path_parmy
+ mov old_syntax,1
+parms_done:
+ pop ds
+ jmp exit_append
+page
+
+set_vectors: ; set append hooks ; @@05
+ push es
+
+; Get INT 2f vector. Save to call older 2f handlers
+
+ mov ax,get_intfcn ; Get INT 2fh vector
+ call int_21
+ mov intfcn_offset,bx ; Save it
+ mov intfcn_segment,es
+
+; get int 21 vector
+
+ mov ax,get_vector ; Get INT 21h vector
+ call int_21
+ mov vector_offset,bx ; Save it
+ mov vector_segment,es
+ pop es
+
+ push ds ; @@08
+ push cs ; @@08
+ pop ds ; @@08
+ lea dx,intfcn_hook ; DS:DX = New INT 2fh vector
+ mov ax,set_intfcn ; Hook the interrupt
+ call int_21
+
+ lea dx,interrupt_hook ; DS:DX = New INT 21h vector
+ mov ax,set_vector ; Hook the interrupt
+ call int_21
+
+ mov dirlst_segment,cs ; save the address of the dirlist
+ lea dx,app_dirs
+ mov dirlst_offset,dx
+ pop ds ; @@08
+
+ ret ; @@05
+
+terminate: ; terminate to dos or return ; @@05
+ cmp res_append,0 ; @@05
+ jne is_res ; @@05
+ call Release_Environment ; release environmental vector ;ac009; dms;
+ mov ah,term_proc ; return to DOS on first time ; @@05
+ call int_21 ; @@05
+is_res: ; @@05
+ mov ax,-1 ; set abort requested ; @@05
+ jmp abort_exit ; must go back to COMMAND ; @@05
+
+
+print_STDOUT:
+ mov bx,STDOUT ; Standard output device handle
+ mov ah,awrite ; function code for write
+ call int_21
+ ret
+
+print_STDERR:
+ mov bx,STDERR ; Standard output device handle
+ mov ah,awrite
+ call int_21
+ ret
+
+Release_Environment: ;an007; dms;
+
+ push ax ;save regs ;an007; dms;
+ push bx ; ;an007; dms;
+ push es ; ;an007; dms;
+ mov ah,Get_PSP ; get the PSP segment ;an007; dms;
+ call int_21 ; invoke INT 21h ;an007; dms;
+ mov es,bx ; BX contains PSP segment - put in ES ;an007; dms;
+ mov bx,word ptr es:[PSP_Env]; get segment of environmental vector ;an007; dms;
+ mov es,bx ; place segment in ES for Free Memory ;an007; dms;
+ mov ah,Free_Alloc_Mem ; Free Allocated Memory ;an007; dms;
+ int 21h ; invoke INT 21h ;an007; dms;
+ pop es ; restore regs ;an007; dms;
+ pop bx ; ;an007; dms;
+ pop ax ; ;an007; dms;
+
+ ret ; return to caller ;an007; dms;
+
+;=========================================================================
+; Scan_For_Equal : This routine scans the command line from the
+; beginning until it encounters anything other
+; than the equal, tab, or space characters.
+; Register SI is sent back to the caller pointing
+; to the character that does not meet the match
+; criteria.
+;
+; Inputs : DS:SI - pointer to next parm
+;
+; Outputs : SI - adjusted to byte not matching the following:
+; "="
+; " "
+; TAB
+;
+; Author : David M. Sewell
+; Date : 1/27/88
+; Version : DOS 3.4
+;=========================================================================
+
+Scan_For_Equal:
+
+ push ax ; save regs ;an008; dms;
+ push cx ; ;an008; dms;
+
+ xor cx,cx ; clear cx ;an008; dms;
+ mov cl,byte ptr ds:[80h] ; get length of command line ;an008; dms;
+
+Scan_For_Equal_Loop:
+
+ cmp cx,0 ; at end? ;an008; dms;
+ jbe Scan_For_Equal_Exit ; exit loop ;an008; dms;
+ mov al,byte ptr ds:[si] ; get 1st. character ;an008; dms;
+ call Chk_DBCS ; DBCS lead byte? ;an008; dms;
+ jnc Scan_For_Equal_No_DBCS ; no ;an008; dms;
+ cmp byte ptr ds:[si],DB_SP_HI ; blank lead byte ;an008; dms;
+ jne Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms;
+ cmp byte ptr ds:[si+1],DB_SP_LO ; DBCS blank ;an008; dms;
+ jne Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms;
+
+ add si,2 ; yes - DBCS lead byte ;an008; dms;
+ sub dx,2 ; decrease counter ;an008; dms;
+ jmp Scan_For_Equal_Loop
+
+Scan_For_Equal_No_DBCS:
+
+ cmp al,"=" ; = found? ;an008; dms;
+ je Scan_For_Equal_Next ; next character ;an008; dms;
+ cmp al,20h ; space? ;an008; dms;
+ je Scan_For_Equal_Next ; next character ;an008; dms;
+ cmp al,09h ; tab? ;an008; dms;
+ je Scan_For_Equal_Next ; next character ;an008; dms;
+ jmp SHORT Scan_For_Equal_Exit ; exit with adjusted SI ;an008; dms;
+
+Scan_For_Equal_Next:
+
+ inc si ; adjust ptr ;an008; dms;
+ dec cx ; decrease counter ;an008; dms;
+ jmp Scan_For_Equal_Loop ; continue loop ;an008; dms;
+
+Scan_For_Equal_Exit:
+
+ pop cx ; ;an008; dms;
+ pop ax ; ;an008; dms;
+
+ ret ; return to caller ;an008; dms;
+
+
+
+;========================================================================= ;an010;bgb
+; do_parse_err : This routine sets up for the display of a parse ;an010;bgb
+; error, and displays the offending parameter. ;an010;bgb
+; ;an010;bgb
+; Inputs : DS:SI - points just past offending parm in command line ;an010;bgb
+; ;an010;bgb
+; Outputs : si_off- parm for msg ret. ;an010;bgb
+; si_seg- parm for msg ret. ;an010;bgb
+; command line - hex zero at end of offending parm ;an010;bgb
+; ;an010;bgb
+; Date : 3/29/88 ;an010;bgb
+; Version : DOS 4.0 (wow!) ;an010;bgb
+;========================================================================= ;an010;bgb
+do_parse_err PROC ;an010;bgb
+;;;;;;;;mov ax,3 ;removed- parser handles this ;an010;bgb
+ mov bx,STDERR ; handle ;an010;bgb
+;;;;;;;;xor cx,cx ; sub count ;an010;bgb
+ mov cx,1 ;display invalid parm ;an010;bgb
+ xor dl,dl ; no input ;an010;bgb
+ mov dh,02 ; message class of parse error ;an010;bgb
+;;;;;;;;mov cs:si_off,81h ;initialize pointer ;an010;bgb
+ ;an010;bgb
+ dec si ;point to last byte of invalid parm ;an010;bgb
+public decsi ;an010;bgb
+decsi: cmp byte ptr [si],' ' ;are we pointing to a space? ;an010;bgb
+; $IF E,OR ;if so, we dont want to do that ;an010;bgb
+ JE $$LL1
+ cmp byte ptr [si],0dh ;are we pointing to CR? ;an010;bgb
+; $IF E ;if so, we dont want to do that ;an010;bgb
+ JNE $$IF1
+$$LL1:
+ dec si ;find the last byte of parm ;an010;bgb
+ jmp decsi ;an010;bgb
+; $ENDIF ;an010;bgb
+$$IF1:
+ mov byte ptr [si+1],00 ;zero terminate display string ;an010;bgb
+nextsi: ;an010;bgb
+public nextsi ;an010;bgb
+ dec si ;look at previous char ;an010;bgb
+ cmp byte ptr [si],' ' ;find parm separator ;an010;bgb
+ jnz nextsi ;loop until begin of parm found ;an010;bgb
+ ;an010;bgb
+ mov cs:si_off,si ;mov si into display parms ;an010;bgb
+ mov cs:si_seg,ds ;initialize pointer ;an010;bgb
+ ret ; return to caller ;an010;bgb
+do_parse_err ENDP ;an010;bgb
+
+
+;-------------------------------------------------------------------
+;
+;-------------------------------------------------------------------
+
+MSG_SERVICES <LOADmsg>
+MSG_SERVICES <APPEND.CLB,APPEND.CL2,APPEND.CTL>
+
+end_address: ; this is the end of the TSR stuff ;AN004;
+
+include parse.asm ; include the parser code
+include msgdcl.inc
+
+cseg ends
+sseg segment para stack 'STACK'
+ assume ss:sseg
+ dw 512 dup(0)
+mystack dw 0
+sseg ends
+
+
+
+ end main_begin
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/append/append.skl b/private/mvdm/dos/v86/cmd/append/append.skl
new file mode 100644
index 000000000..61313bcbe
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/append/append.skl
@@ -0,0 +1,43 @@
+
+;-------------------------------------------------------------------
+; message retriever skeleton file for APPEND
+;-------------------------------------------------------------------
+:util APPEND
+
+:class a
+;:use 1 COMMON1
+:def 1 "Incorrect APPEND version",CR,LF
+:def 2 "Invalid path",CR,LF
+:def 3 "Invalid parameter",CR,LF
+:def 4 "Invalid combination of parameters",CR,LF
+:def 5 "No Append",CR,LF
+
+; 300 - 399 reserved for options help messages
+:def 300 APPEND /?
+:def 301 APPEND /?
+:def 302 APPEND /?
+:def 303 APPEND /?
+:def 304 APPEND /?
+:def 305 APPEND /?
+:def 306 APPEND /?
+:def 307 APPEND /?
+:def 308 APPEND /?
+:def 309 APPEND /?
+:def 310 APPEND /?
+:def 311 APPEND /?
+:def 312 APPEND /?
+:def 313 APPEND /?
+:def 314 APPEND /?
+:def 315 APPEND /?
+:def 316 APPEND /?
+
+:class b
+:def 6 "APPEND / ASSIGN Conflict",CR,LF
+:def 7 "APPEND / TopView Conflict",CR,LF
+:def 8 "Incorrect DOS Version",CR,LF
+:def 9 "APPEND already installed",CR,LF
+;:use 8 COMMON1 ;"Incorrect DOS Version"
+;:use 9 COMMON1 ;"APPEND already installed"
+
+:end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/append/appendm.asm b/private/mvdm/dos/v86/cmd/append/appendm.asm
new file mode 100644
index 000000000..b6822efdf
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/append/appendm.asm
@@ -0,0 +1,42 @@
+page 60,120
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; @@04 07/30/86 Fix second APPEND hang PTM P0000053
+; @@05 08/13/86 Fix bad parm message PTM P0000125
+; @@10 08/28/86 Change message for @@05 PTM P0000291
+; @@11 09/10/86 Support message profile and make
+; msg length variable. R.G. PTM P0000479
+cseg segment public para 'CODE'
+ assume cs:cseg
+
+ public bad_append_msg ;@@11
+ public path_error_msg ;@@11
+ public parm_error_msg ;@@11
+ public path_parm_error_msg ;@@11
+ public no_append_msg ;@@11
+ public append_assign_msg ;@@11
+ public append_tv_msg ;@@11
+ public bad_DOS_msg ;@@11
+ public second_append_msg ;@@11
+
+ public len_bad_append_msg ;@@11
+ public len_path_error_msg ;@@11
+ public len_parm_error_msg ;@@11
+ public len_path_parm_error_msg ;@@11
+ public len_no_append_msg ;@@11
+ public len_append_assign_msg ;@@11
+ public len_append_tv_msg ;@@11
+ public len_bad_DOS_msg ;@@11
+ public len_second_append_msg ;@@11
+
+cr equ 13
+lf equ 10
+
+include appendm.inc
+
+cseg ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/append/appendp.inc b/private/mvdm/dos/v86/cmd/append/appendp.inc
new file mode 100644
index 000000000..3f2609ca3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/append/appendp.inc
@@ -0,0 +1,169 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+INCSW EQU 0 ;INCLUDE PSDATA.INC ;AN000;
+FARSW EQU 1 ;CALL THE PARSER BY NEAR CALL
+DATESW EQU 0 ;SUPPRESS DATE CHECKING ;AN000;
+TIMESW EQU 0 ;SUPPRESS TIME CHECKING ;AN000;
+FILESW EQU 0 ;SUPPRESS CHECKING FILE SPECIFICATION ;AN000;
+CAPSW EQU 0 ;SUPPRESS FILE TABLE CAPS ;AN000;
+CMPXSW EQU 1 ;SUPPRESS CHECKING COMPLEX LIST
+DRVSW EQU 1 ;SUPPRESS SUPPORT OF DRIVE ONLY FORMAT
+QUSSW EQU 0 ;SUPPRESS SUPPORT OF QUOTED STRING FORMAT ;AN000;
+NUMSW EQU 1 ;SUPPRESS CHECKING NUMERIC VALUE
+KEYSW EQU 0 ;SUPPRESS KEYWORD SUPPORT ;AN000;
+SWSW EQU 1 ;DO SUPPORT SWITCHES ;AN000;
+VAL1SW EQU 0 ;SUPPRESS SUPPORT OF VALUE DEFINITION 1 ;AN000;
+VAL2SW EQU 0 ;SUPPRESS SUPPORT OF VALUE DEFINITION 2 ;AN000;
+VAL3SW EQU 1 ;DO SUPPORT VALUE DEFINITION 3
+
+include psdata.inc
+;***********************************************************************
+
+;-------------------------------------------------------------------
+;
+; parser stuff for APPEND
+;
+;-------------------------------------------------------------------
+
+
+
+p_block1 $P_PARMS_Blk <offset px_block1, 0, 0> ; parm block
+p_block2 $P_PARMS_Blk <offset px_block2, 0, 0> ; parm block
+
+;------------------------
+; extended parameter block for APPEND first load
+
+px_block1:
+ db 0 ; min number positional operands
+ db 0 ; max number positional operands
+; dw 0 ; offset into control block for positionals
+
+ db 4 ; APPEND has two switches /E, /X, /PATH, /?
+ dw offset e_switch ; control block for /E switch
+ dw offset x_switch ; control block for /X switch
+ dw offset qu_switch ; " " for /? switch
+ dw offset path_switch ; control block for /PATH switch
+
+ db 0 ; max number of keywords
+ dw 0 ; offset of keyword control block
+
+;------------------------
+; extended parameter block for 2nd, 3rd, ... APPEND invocations
+
+px_block2:
+ db 0 ; min number positional operands
+ db 1 ; max number positional operands
+ dw offset dirs_control ; pointer to dirs control block
+
+; db 2 ; APPEND after first load has two switches /X, /PATH
+ db 4 ; APPEND has two switches /E, /X, /PATH
+ dw offset e_switch ; control block for /E switch
+ dw offset x_switch ; control block for /X switch
+ dw offset qu_switch ; " " for /? switch
+ dw offset path_switch ; control block for /PATH switch
+
+ db 0 ; max number of keywords
+
+;------------------------
+dirs_control:
+ dw $P_Simple_S+$P_Optional ; complex, optional string
+ dw $P_CAP_File ; cap by file table
+ dw offset dirs_result ; dirs result buffer
+ dw offset dirs_values ; pointer to null value list
+ db 0 ; no synonyms
+
+dirs_values:
+ db 0 ; null value list for dirs
+
+
+
+;------------------------
+x_switch:
+ dw $P_Simple_s+$P_Optional ; /X, /X:ON, /X:OFF simple, optional string
+ dw $P_CAP_Char ; cap by char table
+ dw offset x_result ; pointer to result block
+ dw offset x_values ; pointer to values block
+ db 1 ; number of switches and synonyms
+ db "/X",0 ; only /X is valid
+
+x_values:
+ db 3 ; string values
+ db 0 ; zeroes here for ranges and
+ db 0 ; values
+ db 2 ; 2 possible string values
+ db 0 ; /X:OFF = 0
+ dw offset off_string ; pointer to "OFF"
+ db 1 ; /X:ON = 1
+ dw offset on_string
+;------------------------
+
+e_switch:
+ dw 0 ; /E
+ dw $P_CAP_Char ; cap by char table
+ dw offset e_result ; pointer to result block
+ dw offset e_values ; pointer to values block, none
+ db 1 ; number of switches and synonyms
+ db "/E",0 ; only /E is valid
+
+e_values:
+ db 0 ; null value list for /E
+
+
+;------------------------
+
+qu_switch:
+ dw 1 ; optional
+ dw 0
+ dw offset qu_result ; pointer to result block
+ dw offset qu_values ; pointer to values block, none
+ db 1 ; number of switches and synonyms
+ db "/?",0 ; only /? is valid
+
+qu_values:
+ db 0 ; null value list for /E
+
+
+
+path_switch:
+ dw $P_Simple_s ; /PATH:ON, /PATH:OFF simple string
+ dw $P_CAP_Char ; cap by char table
+ dw offset path_result ; pointer to result block
+ dw offset path_values ; pointer to values block
+ db 1 ; number of switches and synonyms
+ db "/PATH",0 ; only /PATH is valid
+
+
+path_values:
+ db 3 ; string values
+ db 0 ; zeroes here for ranges and
+ db 0 ; values
+ db 2 ; 2 possible string values
+ db 0 ; /PATH:OFF = 0
+ dw offset off_string ; pointer to "OFF"
+ db 1 ; /PATH:ON = 1
+ dw offset on_string
+
+
+;------------------------
+
+off_string:
+ db "OFF",0 ; off string
+
+on_string:
+ db "ON",0 ; on string
+
+
+;------------------------
+
+x_result $P_Result_Blk <> ; /X result block
+e_result $P_Result_Blk <> ; /E result block
+qu_result $P_Result_Blk <> ; /? result block
+path_result $P_Result_Blk <> ; /PATH result block
+dirs_result $P_Result_Blk <> ; dirs result block
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/append/makefile b/private/mvdm/dos/v86/cmd/append/makefile
new file mode 100644
index 000000000..12362746c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/append/makefile
@@ -0,0 +1,41 @@
+# Makefile for debug.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =append.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+append.ctl: append.skl \
+ makefile \
+ $(msg)\$(COUNTRY).msg
+
+append.obj: append.asm \
+ appendp.inc \
+ $(inc)\parse.asm \
+ makefile \
+ append.ctl
+
+$(dest): append.obj \
+ makefile
+ link16 $(exelink) append;
diff --git a/private/mvdm/dos/v86/cmd/backup/makefile b/private/mvdm/dos/v86/cmd/backup/makefile
new file mode 100644
index 000000000..67df245e5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/backup/makefile
@@ -0,0 +1,13 @@
+# MVDM\bin86 makefile
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 08-Jun-1992 Craig Jones (v-cjones)
+# Created.
+#
+
+all:
+ binplace backup.exe
+
+clean:
diff --git a/private/mvdm/dos/v86/cmd/command/buildmsg.c b/private/mvdm/dos/v86/cmd/command/buildmsg.c
new file mode 100644
index 000000000..ee01cf4fe
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/buildmsg.c
@@ -0,0 +1,1525 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+/* -------------------------------------------------------------------------- */
+
+#include "dos.h"
+#include "string.h"
+#include "stdio.h"
+#include "stdlib.h"
+#include "ctype.h"
+#include "process.h"
+#include "malloc.h"
+#include "bldmsg.h"
+
+/* -------------------------------------------------------------------------- */
+
+#define FALSE (char) (1==0)
+#define TRUE (char) !FALSE
+#define NUL (char) '\0'
+#define READONLY 0
+#define NAME_COMMAND "COMMAND\0" /* Mar 88, SWN */
+
+#define MAXLINE 200 /* Supposed to be used for getting the message text. */
+#define MAXUTILERROR 300
+#define MAXEXTENDEDERROR 100
+#define MAXPARSERERROR 20
+#define MAXCOMMONERROR 100
+#define MAXLENGTH 500
+#define TOTALUTIL 45
+
+/* -------------------------------------------------------------------------- */
+
+#define ParseOrExtend ((!_strnicmp(USEstring,"PARSE\n",5) ) || (!_strnicmp(USEstring,"EXTEND\0",5) ) )
+#define IsReserved(c) ( (c == '1') || (c == '2') )
+
+/* -------------------------------------------------------------------------- */
+
+ char *MessageSkeletonFilePtr;
+
+
+ char *CommentLinePtr = "\x0d\x0a; ----------------------------------------------------------\x0d\x0a\x0d\x0a";
+
+ char EofFlags[256];
+
+ char ClassFlag1;
+ char ClassFlag2;
+ int ClassCount;
+ int ClassCounts[256];
+ int CurrentClass;
+ int CurrentClassIndex;
+ int CurrentMessageNumber;
+ int LineNumber;
+ int add_crlf ;
+
+ int Pass;
+
+ char Done;
+ char MessagePending;
+ char ClassPending;
+
+ char UtilityName[16];
+ char USEstring[16] ;
+ char Is_Utility_Command[16]; /* Mar 88, SWN */
+ char Is_Command_set[] = "12cdeCDE";
+ char CurrentClassFileName[128];
+
+ unsigned SkeletonHandle = 0xffff;
+ unsigned ClassHandle = 0xffff;
+ unsigned CommonMessageLines;
+ unsigned ParserMessageLines;
+ unsigned ExtendedMessageLines;
+ unsigned UtilMessageLines;
+ unsigned ContinueLine;
+
+ char CountryIdx[128];
+ char CountryMsg[128];
+ char CountryName[128];
+
+ char ReadCommonFlag = FALSE;
+ char ReadExtendFlag = FALSE;
+ char ReadParserFlag = FALSE;
+ char ReadUtilFlag = FALSE;
+
+ char *UtilErrorTexts[MAXUTILERROR+1];
+ char *ExtendedErrorTexts[MAXEXTENDEDERROR+1];
+ char *ParserErrorTexts[MAXPARSERERROR+1];
+ char *CommonErrorTexts[MAXCOMMONERROR+1];
+
+ char Debugging = FALSE;
+
+/* -------------------------------------------------------------------------- */
+
+void error(union REGS *, union REGS *, struct SREGS *);
+
+void LineInput( unsigned, char far * );
+unsigned DosRead( unsigned, char far *, int );
+unsigned DosWrite( unsigned, char far *, int );
+long DosLSeek( unsigned, long, int );
+void DosClose( unsigned );
+unsigned DosOpen( char far *, unsigned );
+unsigned DosCreate( char far *, unsigned );
+
+unsigned LowOf(long);
+unsigned HighOf(long);
+long LongOf(unsigned, unsigned);
+
+void main(int, char * []);
+
+void ProcessSkeletonFile(char *);
+void UtilRecord(char *);
+void ClassRecord(char *);
+void DefRecord(char *);
+void UseRecord(char *);
+void EndRecord(char *);
+void DefContinue(char *);
+void UseContinue(char *);
+void MessageTerminate(void);
+void ClassTerminate(void);
+
+void CommentLine(void);
+void BlankLine(void);
+void PublicLine(void);
+void ReadCommon(void);
+
+char *MyMalloc(int);
+
+/* -------------------------------------------------------------------------- */
+
+void main(argc,argv)
+int argc;
+char *argv[];
+{
+
+ int i;
+ char *s;
+ unsigned len;
+
+ char far *PspCharPtr;
+ unsigned far *PspWordPtr;
+ unsigned long ProgramSize;
+ unsigned long MemoryAllocatable;
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ /* check for assistance needed */
+
+ if ( (argc < 3) && (*argv[1] == (char) '?') )
+ {
+ printf("BUILDMSG country skeleton-file-spec\n");
+ exit(1);
+ }
+
+ /* get the 1st parm is the Country name */
+ /* get the skeleton file name (2nd Parm) to be processed */
+
+ strcpy(CountryName, argv[1]);
+ _strupr(CountryName);
+ strcpy(CountryIdx,CountryName);
+ strcat(CountryIdx, ".IDX");
+ strcpy(CountryMsg,CountryName);
+ strcat(CountryMsg, ".MSG");
+
+ for (i = 0; i <= MAXUTILERROR ; i++) UtilErrorTexts[i] = "";
+ for (i = 0; i <= MAXEXTENDEDERROR; i++) ExtendedErrorTexts[i] = "";
+ for (i = 0; i <= MAXPARSERERROR ; i++) ParserErrorTexts[i] = "";
+ for (i = 0; i <= MAXCOMMONERROR ; i++) CommonErrorTexts[i] = "";
+
+ for (i = 0; i < 256; i++)
+ {
+ ClassCounts[i] = 0;
+ EofFlags[i] = TRUE;
+ }
+
+ if ( (argc > 3) && (_strnicmp(argv[3],"/D",2) == 0) ) Debugging = TRUE;
+
+ InRegs.x.ax = 0x6200;
+ intdos(&InRegs, &OutRegs);
+
+ printf("BuildMsg - PSP at %04x\n",OutRegs.x.bx);
+ FP_SEG(PspWordPtr) = OutRegs.x.bx;
+ FP_OFF(PspWordPtr) = 0;
+ FP_SEG(PspCharPtr) = OutRegs.x.bx;
+ FP_OFF(PspCharPtr) = 0;
+ ProgramSize = (unsigned long) *(PspWordPtr+1);
+ printf("Program memory size is %ld\n",ProgramSize);
+
+ InRegs.x.ax = 0x4800;
+ InRegs.x.bx = 0xffff;
+ intdos(&InRegs, &OutRegs);
+ if (OutRegs.x.cflag)
+ {
+ InRegs.x.bx = OutRegs.x.bx;
+ }
+ else {
+ SegRegs.es = OutRegs.x.ax;
+ InRegs.x.ax = 0x4900;
+ intdosx(&InRegs, &OutRegs, &SegRegs);
+ }
+
+ MemoryAllocatable = (unsigned long) InRegs.x.bx;
+ MemoryAllocatable *= 16;
+ printf("Allocatable memory size is %ld\n",MemoryAllocatable);
+
+
+ ProcessSkeletonFile(argv[2]);
+
+ exit(0);
+
+}
+
+/* -------------------------------------------------------------------------- */
+
+void ProcessSkeletonFile(FileName)
+char *FileName;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ unsigned SkeletonHandle;
+
+ char *s;
+ int i;
+ char out[128];
+
+ char CurrentRecord[256];
+ char RecordTypeText[32];
+ int LastRecord;
+ char Processed;
+
+
+ MessageSkeletonFilePtr = FileName;
+
+ printf("Processing [%s]\n",MessageSkeletonFilePtr);
+
+ /* Process the MESSAGE.SKL file */
+
+ SkeletonHandle = DosOpen( (char far *) MessageSkeletonFilePtr, READONLY);
+
+ ClassCount = 0;
+
+ for (Pass = 1; Pass < 3; Pass++)
+ {
+ if (Debugging) printf("--> Starting Pass %d <--\n",Pass);
+ ClassFlag1 = FALSE;
+ ClassFlag2 = FALSE;
+ CurrentClassIndex = 0;
+ LineNumber = 0;
+ CurrentClass = 0;
+ Done = FALSE;
+ LastRecord = 0;
+ MessagePending = FALSE;
+ ClassPending = FALSE;
+
+ InRegs.x.ax = 0x4200;
+ InRegs.x.bx = SkeletonHandle;
+ InRegs.x.cx = 0;
+ InRegs.x.dx = 0;
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+ if (OutRegs.x.cflag)
+ error(&InRegs,&OutRegs,&SegRegs);
+
+ while ( (!EofFlags[SkeletonHandle]) && (!Done) )
+ { CurrentRecord[0] = NUL;
+ LineInput(SkeletonHandle, (char far *) &CurrentRecord[0] );
+ LineNumber++;
+
+ RecordTypeText[0] = NUL;
+ sscanf(&CurrentRecord[0]," %s ",&RecordTypeText[0]);
+ i = strlen(RecordTypeText);
+
+ _strupr(RecordTypeText);
+
+ if (RecordTypeText[0] == (char) ':') Processed = FALSE;
+ else Processed = TRUE;
+
+ if (strcmp(RecordTypeText,":UTIL") == 0)
+ { UtilRecord(&CurrentRecord[i]);
+ Processed = TRUE;
+ LastRecord = 1;
+ }
+
+ if (strcmp(RecordTypeText,":CLASS") == 0)
+ { ClassRecord(&CurrentRecord[i]);
+ Processed = TRUE;
+ LastRecord = 2;
+ }
+
+ if (strcmp(RecordTypeText,":DEF") == 0)
+ { DefRecord(&CurrentRecord[i]);
+ Processed = TRUE;
+ LastRecord = 3;
+ }
+
+ if (strcmp(RecordTypeText,":USE") == 0)
+ { UseRecord(&CurrentRecord[i]);
+ Processed = TRUE;
+ LastRecord = 4;
+ }
+
+ if (strcmp(RecordTypeText,":END") == 0)
+ { EndRecord(&CurrentRecord[i]);
+ Processed = TRUE;
+ LastRecord = 5;
+ }
+
+ if (!Processed)
+ { printf("Error: unrecognized record in skeleton file, line %d\n",LineNumber);
+ exit(1);
+ }
+
+ }
+
+ if (!ClassFlag1) ClassRecord(" 1 ");
+ if (!ClassFlag2) ClassRecord(" 2 ");
+
+ if (MessagePending) MessageTerminate();
+ if (ClassPending) ClassTerminate();
+
+ if (Debugging) printf("--> Ending Pass %d <--\n",Pass);
+ }
+
+ DosClose(SkeletonHandle);
+
+ sprintf(CurrentClassFileName,"%s.CTL",UtilityName);
+ ClassHandle = DosCreate((char far *) &CurrentClassFileName[0], 0);
+ i = sprintf(out,"$M_NUM_CLS EQU %d\x0d\x0a",ClassCount-2);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ DosClose(ClassHandle);
+
+ SkeletonHandle = 0xfffe; /* 0xfffe == -2 */
+
+ return;
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void UtilRecord(Record)
+char *Record;
+{
+
+ sscanf(Record," %s ",UtilityName);
+
+ _strupr(UtilityName);
+
+ if (Pass == 1)
+ {
+ printf(" Utility Name = [%s]\n",UtilityName);
+ ReadCommon();
+
+ }
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void PublicLine()
+{
+
+ int i;
+ char out[128];
+
+ if ( !IsReserved(CurrentClass) ) i = sprintf(out," PUBLIC $M_CLS_%d\x0d\x0a",CurrentClassIndex);
+ else i = sprintf(out," PUBLIC $M_MSGSERV_%c\x0d\x0a",CurrentClass);
+
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+
+ return;
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void ClassRecord(Record)
+char *Record;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ int i;
+ char out[128];
+
+ MessageTerminate();
+ ClassTerminate();
+
+ while ( isspace(*Record) ) Record++;
+
+ *Record = (char) toupper(*Record);
+ CurrentClass = (int) *Record;
+
+ if ( !IsReserved(CurrentClass) ) CurrentClassIndex++;
+
+ if (CurrentClass == '1') ClassFlag1 = TRUE;
+ if (CurrentClass == '2') ClassFlag2 = TRUE;
+
+ sprintf(CurrentClassFileName,"%s.%s%c",UtilityName,"CL",CurrentClass);
+
+ if (Pass == 1)
+ {
+ ClassHandle = DosCreate((char far *) &CurrentClassFileName[0], 0);
+
+ printf(" Created include file [%s]\n",CurrentClassFileName);
+
+ CommentLine();
+
+ PublicLine();
+ i = sprintf(out," IF1\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," %%out ... Including message Class %c\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," ENDIF\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+
+ CommentLine();
+
+ i = sprintf(out,"$M_CLASS_%c_STRUC LABEL BYTE\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," $M_CLASS_ID <%03XH,EXPECTED_VERSION,Class_%c_MessageCount>\x0d\x0a",
+ ((!IsReserved(CurrentClass)) ? 255 : (CurrentClass-'0')),CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+
+ CommentLine();
+
+ ClassCount++;
+
+ }
+
+ if (Pass == 2)
+ {
+
+ ClassHandle = DosOpen((char far *) &CurrentClassFileName[0], 2);
+
+ InRegs.x.ax = 0x4202;
+ InRegs.x.bx = ClassHandle;
+ InRegs.x.cx = 0;
+ InRegs.x.dx = 0;
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+ if (OutRegs.x.cflag)
+ error(&InRegs,&OutRegs,&SegRegs);
+
+ }
+
+ ClassPending = TRUE;
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void CommentLine()
+{
+
+ DosWrite(ClassHandle,(char far *) CommentLinePtr, strlen(CommentLinePtr) );
+
+ return;
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void BlankLine()
+{
+
+ DosWrite(ClassHandle,(char far *) "\x0d\x0a", 2 );
+
+ return;
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void DefRecord(Record)
+char *Record;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ int i,m;
+ char *TextPtr;
+ char *NumberPtr;
+ char out[128];
+ char ActualMsg[256];
+ int MsgNumber;
+
+ char MsgStatus;
+ char MsgLevel[5];
+
+ char *LfPtr;
+
+ if ( IsReserved(CurrentClass) )
+ { printf("Error: :DEF not allowed in Class 1 or Class2, line %d\n",LineNumber);
+ exit(1);
+ }
+
+ MessageTerminate();
+
+ TextPtr = Record;
+ while ( (isspace(*TextPtr)) && (*TextPtr != NUL) ) TextPtr++;
+ NumberPtr = TextPtr;
+ while ( (!isspace(*TextPtr)) && (*TextPtr != NUL) ) TextPtr++;
+
+ sscanf(NumberPtr," %d ",&CurrentMessageNumber);
+
+ if (Pass == 1)
+ {
+ BlankLine();
+
+ i = sprintf(out,"$M_%c_%05XH_STRUC LABEL BYTE\x0d\x0a",CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," $M_ID <%05XH,0,$M_%c_%05XH_MSG-$M_%c_%05XH_STRUC>\x0d\x0a", */
+ i = sprintf(out," $M_ID <%05XH,$M_%c_%05XH_MSG-$M_%c_%05XH_STRUC>\x0d\x0a", /* Mar 88, SWN */
+ CurrentMessageNumber,CurrentClass,CurrentMessageNumber,CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+
+ if (Pass == 2)
+ {
+ BlankLine();
+ while ( (*TextPtr != NUL) && (isspace(*TextPtr)) ) TextPtr++;
+
+ i = sprintf(out,"$M_%c_%05XH_MSG LABEL BYTE\x0d\x0a",CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DW $M_%c_%05XH_END-$M_%c_%05XH_MSG-2\x0d\x0a", */
+ i = sprintf(out," DB $M_%c_%05XH_END-$M_%c_%05XH_MSG-1\x0d\x0a", /* Mar 88, SWN */
+ CurrentClass,CurrentMessageNumber,CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+
+ for ( m=1; m <= UtilMessageLines; m++)
+ {
+ sscanf(UtilErrorTexts[m], " %d %s %s ",&MsgNumber,&MsgStatus,&MsgLevel[0]);
+ LfPtr = strchr(UtilErrorTexts[m], ' ');
+ LfPtr = strchr(LfPtr+1, ' ');
+ LfPtr = strchr(LfPtr+1, ' ');
+ strcpy(ActualMsg, LfPtr+1 );
+ if ( MsgNumber == CurrentMessageNumber)
+ {
+ if (Debugging) printf("DefRecord() :: MsgNumber = %d, CurrentMessageNumber = %d\n",
+ MsgNumber,CurrentMessageNumber);
+ i = sprintf(out," DB %s\x0d\x0a",ActualMsg);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ ContinueLine = m + 1;
+ }
+ }
+
+ MessagePending = TRUE;
+ }
+
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void UseRecord(Record)
+char *Record;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ int i,j;
+ char *TextPtr;
+ char *NumberPtr;
+ int TempNumber;
+ char out[128];
+
+ MessageTerminate();
+
+ NumberPtr = Record;
+ while ( (isspace(*NumberPtr)) && (*NumberPtr != NUL) ) NumberPtr++;
+
+ if ( (isdigit(*NumberPtr)) || ( (*NumberPtr == (char) '-') && (isdigit(*(NumberPtr+1))) ) )
+ { if ( IsReserved(CurrentClass) )
+ { printf("Error: :USE in CLASS 1, cannot specify a msg-number on line %d\n",LineNumber);
+ exit(1);
+ }
+
+ sscanf(NumberPtr," %d ",&CurrentMessageNumber);
+
+ TextPtr = NumberPtr;
+ while ( (!isspace(*TextPtr)) && (*TextPtr != NUL) ) TextPtr++;
+ while ( ( isspace(*TextPtr)) && (*TextPtr != NUL) ) TextPtr++;
+
+ strcpy(USEstring, "empty\0");
+
+ if (_strnicmp(TextPtr,"PARSE",5) == 0) { strcpy(USEstring, "PARSE\0"); i = 5; j = 1; }
+ if (_strnicmp(TextPtr,"COMMON",6) == 0) { i = 6; j = 2; }
+ if (_strnicmp(TextPtr,"EXTEND",6) == 0) { strcpy(USEstring, "EXTEND\0"); i = 6; j = 3; }
+
+ NumberPtr = TextPtr + i;
+ sscanf(NumberPtr," %d ",&TempNumber);
+
+ switch(j)
+ {
+ case 1: if (TempNumber <= MAXPARSERERROR)
+ TextPtr = ParserErrorTexts[TempNumber];
+ else if (TempNumber == 999)
+ { TextPtr = ParserErrorText999;
+ }
+ else TextPtr = "";
+ break;
+ case 2: if (TempNumber <= MAXCOMMONERROR)
+ TextPtr = CommonErrorTexts[TempNumber];
+ else TextPtr = "";
+ break;
+ case 3: if (TempNumber <= MAXEXTENDEDERROR)
+ TextPtr = ExtendedErrorTexts[TempNumber];
+ else if (TempNumber == 999)
+ { TextPtr = ExtendedErrorText999;
+ }
+ else TextPtr = "";
+ break;
+
+ default:TextPtr = "";
+ break;
+ }
+
+ if (*TextPtr == NUL)
+ { printf("Error: :USE of PARSE, COMMON or EXTENDED with invalid msg-number, line %d\n",LineNumber);
+ if (Debugging) printf("then ->CurrentMessageNumber = %d, TempNumber = %d, j = %d\n",
+ CurrentMessageNumber,TempNumber,j);
+ exit(1);
+ }
+
+ }
+
+ else {
+
+ strcpy(USEstring, "empty\0");
+
+ TextPtr = NumberPtr;
+ if (_strnicmp(TextPtr,"PARSE",5) == 0) { strcpy(USEstring, "PARSE\0"); i = 5; j = 1; }
+ if (_strnicmp(TextPtr,"COMMON",6) == 0) { i = 6; j = 2; }
+ if (_strnicmp(TextPtr,"EXTEND",6) == 0) { strcpy(USEstring, "PARSE\0"); i = 6; j = 3; }
+
+ NumberPtr += i;
+ sscanf(NumberPtr," %d ",&CurrentMessageNumber);
+
+ TempNumber = CurrentMessageNumber;
+
+ if ( (CurrentClass == '1') && (j != 3) )
+ { printf("Error: :USE in CLASS 1 must be EXTENDED ERROR on line %d\n",LineNumber);
+ exit(1);
+ }
+
+ if ( (CurrentClass == '2') && (j != 1) )
+ { printf("Error: :USE in CLASS 1 must be PARSE ERROR on line %d\n",LineNumber);
+ exit(1);
+ }
+
+ switch(j)
+ {
+ case 1: if (TempNumber <= MAXPARSERERROR)
+ TextPtr = ParserErrorTexts[TempNumber];
+ else if (TempNumber == 999)
+ TextPtr = ParserErrorText999;
+ else TextPtr = "";
+ break;
+ case 2: if (TempNumber <= MAXCOMMONERROR)
+ TextPtr = CommonErrorTexts[TempNumber];
+ else TextPtr = "";
+ break;
+ case 3: if (TempNumber <= MAXEXTENDEDERROR)
+ TextPtr = ExtendedErrorTexts[TempNumber];
+ else if (TempNumber == 999)
+ TextPtr = ExtendedErrorText999;
+ else TextPtr = "";
+ break;
+
+ default:TextPtr = "";
+ break;
+ }
+
+ if (*TextPtr == NUL)
+ { printf("Error: :USE of PARSE, COMMON or EXTENDED with invalid msg-number, line %d\n",LineNumber);
+ if (Debugging) printf("else ->CurrentMessageNumber = %d, TempNumber = %d, j = %d\n",
+ CurrentMessageNumber,TempNumber,j);
+ exit(1);
+ }
+
+ }
+
+ if (Pass == 1)
+ {
+ BlankLine();
+
+ i = sprintf(out,"$M_%c_%05XH_STRUC LABEL BYTE\x0d\x0a",CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," $M_ID <%05XH,0,$M_%c_%05XH_MSG-$M_%c_%05XH_STRUC>\x0d\x0a", */
+ i = sprintf(out," $M_ID <%05XH,$M_%c_%05XH_MSG-$M_%c_%05XH_STRUC>\x0d\x0a", /* Mar 88, SWN */
+ CurrentMessageNumber,CurrentClass,CurrentMessageNumber,CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+
+ if (Pass == 2)
+ {
+ strcpy( Is_Utility_Command, NAME_COMMAND ) ;
+ if ( !ParseOrExtend )
+ {
+ add_crlf = 0 ;
+ }
+ else
+ {
+ if ( !_strnicmp( Is_Utility_Command, UtilityName, 5) )
+ {
+ if ( ( CurrentClass != 67 ) && ( CurrentClass != 68 ) &&
+ ( CurrentClass != 69 ) && ( CurrentClass != '1') &&
+ ( CurrentClass != '2') )
+ {
+ add_crlf = 1 ;
+ }
+ else
+ {
+ add_crlf = 0 ;
+ }
+
+ }
+ else
+ {
+ if ( ( CurrentClass != '1') && ( CurrentClass != '2') )
+ {
+ add_crlf = 1 ;
+ }
+ else
+ {
+ add_crlf = 0 ;
+ }
+
+ }
+ }
+
+ BlankLine();
+
+ i = sprintf(out,"$M_%c_%05XH_MSG LABEL BYTE\x0d\x0a",CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DW $M_%c_%05XH_END-$M_%c_%05XH_MSG-2\x0d\x0a", */
+ i = sprintf(out," DB $M_%c_%05XH_END-$M_%c_%05XH_MSG-1\x0d\x0a", /* Mar 88, SWN */
+ CurrentClass,CurrentMessageNumber,CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ if ( add_crlf )
+ {
+ i = sprintf(out," DB %s,CR,LF\x0d\x0a",TextPtr);
+ }
+ else
+ {
+ i = sprintf(out," DB %s\x0d\x0a",TextPtr);
+ }
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+
+ MessagePending = TRUE;
+ }
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void DefContinue(Record)
+char *Record;
+{
+
+ printf("Error: :DEF continue should not occur",LineNumber);
+ exit(1);
+
+ return;
+
+}
+
+/* -------------------------------------------------------------------------- */
+
+void UseContinue(Record)
+char *Record;
+{
+
+ printf("Error: :USE continue should not occur",LineNumber);
+ exit(1);
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void EndRecord(Record)
+char *Record;
+{
+
+ if (!ClassFlag1) ClassRecord(" 1 ");
+ if (!ClassFlag2) ClassRecord(" 2 ");
+
+ MessageTerminate();
+ ClassTerminate();
+
+ Done = TRUE;
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void MessageTerminate()
+{
+
+ char out[128];
+
+ if (MessagePending)
+ {
+ sprintf(out,"$M_%c_%05XH_END LABEL BYTE\x0d\x0a",CurrentClass,CurrentMessageNumber);
+ DosWrite(ClassHandle,(char far *) &out[0],strlen(out) );
+ /* sprintf(out," DB \"$\"\x0d\x0a"); */
+ sprintf(out," \0",CurrentClass,CurrentMessageNumber); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0],strlen(out) );
+
+ ClassCounts[CurrentClass]++;
+ }
+
+ MessagePending = FALSE;
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void ClassTerminate()
+{
+
+ int i;
+ char out[128];
+
+ if ( (ClassPending) && (Pass == 1) )
+ { CommentLine();
+
+ if (CurrentClass == '1')
+ { i = sprintf(out,"$M_1_FF_STRUC LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," $M_ID <0FFFFH,0,$M_1_FF_MSG-$M_1_FF_STRUC>\x0d\x0a"); */
+ i = sprintf(out," $M_ID <0FFFFH,$M_1_FF_MSG-$M_1_FF_STRUC>\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ ClassCounts[CurrentClass] ++;
+ CommentLine();
+ }
+
+ if (CurrentClass == '2')
+ { i = sprintf(out,"$M_2_FF_STRUC LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," $M_ID <0FFFFH,0,$M_2_FF_MSG-$M_2_FF_STRUC>\x0d\x0a"); */
+ i = sprintf(out," $M_ID <0FFFFH,$M_2_FF_MSG-$M_2_FF_STRUC>\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ ClassCounts[CurrentClass] ++;
+ CommentLine();
+ }
+
+
+ DosClose(ClassHandle);
+ ClassHandle = 0xfffe; /* 0xfffe == -2 */
+ }
+
+ if ( (ClassPending) && (Pass == 2) )
+ { CommentLine();
+
+ if (CurrentClass == '1')
+ { i = sprintf(out,"$M_1_FF_MSG LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DW $M_1_FF_END-$M_1_FF_MSG-2\x0d\x0a"); */
+ i = sprintf(out," DB $M_1_FF_END-$M_1_FF_MSG-1\x0d\x0a"); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out, EXTENDED_STR); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out,"$M_1_FF_END LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DB \"$\"\x0d\x0a"); */
+ i = sprintf(out," \0"); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ CommentLine();
+ }
+
+ if (CurrentClass == '2')
+ { i = sprintf(out,"$M_2_FF_MSG LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DW $M_2_FF_END-$M_2_FF_MSG-2\x0d\x0a"); */
+ i = sprintf(out," DB $M_2_FF_END-$M_2_FF_MSG-1\x0d\x0a"); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out,PARSE_STR); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out,"$M_2_FF_END LABEL BYTE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ /* i = sprintf(out," DB \"$\"\x0d\x0a"); */
+ i = sprintf(out," \0"); /* Mar 88, SWN */
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ CommentLine();
+ }
+
+ i = sprintf(out,"Class_%c_MessageCount EQU %d\x0d\x0a",CurrentClass,ClassCounts[CurrentClass]);
+ DosWrite(ClassHandle,(char far *) &out[0], i );
+
+ CommentLine();
+
+ i = sprintf(out," IF FARmsg\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ if ( !IsReserved(CurrentClass) )
+ { i = sprintf(out,"$M_CLS_%d PROC FAR\x0d\x0a",CurrentClassIndex);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+ else { i = sprintf(out,"$M_MSGSERV_%c PROC FAR\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+ i = sprintf(out," ELSE\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ if ( !IsReserved(CurrentClass) )
+ { i = sprintf(out,"$M_CLS_%d PROC NEAR\x0d\x0a",CurrentClassIndex);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+ else { i = sprintf(out,"$M_MSGSERV_%c PROC NEAR\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+ i = sprintf(out," ENDIF\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ BlankLine();
+ i = sprintf(out," PUSH CS\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," POP ES\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," LEA DI,$M_CLASS_%c_STRUC\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," ADD CX,$-$M_CLASS_%c_STRUC\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ i = sprintf(out," RET\x0d\x0a");
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ BlankLine();
+ if ( !IsReserved(CurrentClass) )
+ { i = sprintf(out,"$M_CLS_%d ENDP\x0d\x0a",CurrentClassIndex);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+ else { i = sprintf(out,"$M_MSGSERV_%c Endp\x0d\x0a",CurrentClass);
+ DosWrite(ClassHandle,(char far *) &out[0], i);
+ }
+
+ CommentLine();
+
+ DosClose(ClassHandle);
+ ClassHandle = 0xfffe; /* 0xfffe == -2 */
+
+ printf(" Completed [%s]\n",CurrentClassFileName);
+
+ }
+
+ ClassPending = FALSE;
+
+ return;
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned LowOf(LongValue)
+long LongValue;
+{
+
+ return ( (unsigned) ( LongValue & 0x0000FFFFl ) );
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned HighOf(LongValue)
+long LongValue;
+{
+
+ return ( (unsigned) ( (LongValue & 0xFFFF0000l) >> 16 ) );
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+long LongOf(HighValue,LowValue)
+unsigned HighValue;
+unsigned LowValue;
+{
+
+ long hv;
+ long lv;
+
+ hv = (long) HighValue;
+ lv = (long) LowValue;
+
+ return ( ( hv << 16 ) + lv );
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned DosOpen(FileNamePtr,OpenType)
+char far *FileNamePtr;
+unsigned OpenType;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ InRegs.x.ax = 0x3d00 + OpenType;
+ InRegs.x.dx = FP_OFF(FileNamePtr);
+ SegRegs.ds = FP_SEG(FileNamePtr);
+ intdosx(&InRegs, &OutRegs, &SegRegs);
+ if (OutRegs.x.cflag)
+ error(&InRegs,&OutRegs,&SegRegs);
+
+ EofFlags[OutRegs.x.ax] = FALSE;
+ return(OutRegs.x.ax);
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+long DosLSeek(Handle, ToPosition, Relative)
+unsigned Handle;
+long ToPosition;
+int Relative;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ InRegs.x.ax = 0x4200 + (Relative & 0x000f);
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = HighOf(ToPosition);
+ InRegs.x.dx = LowOf(ToPosition);
+ intdosx(&InRegs, &OutRegs, &SegRegs);
+
+ if (OutRegs.x.cflag)
+ error(&InRegs,&OutRegs,&SegRegs);
+
+ return( LongOf(OutRegs.x.dx,OutRegs.x.ax) );
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned DosCreate(FileNamePtr,Attributes)
+char far *FileNamePtr;
+unsigned Attributes;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ InRegs.x.ax = 0x3c00;
+ InRegs.x.cx = Attributes;
+ InRegs.x.dx = FP_OFF(FileNamePtr);
+ SegRegs.ds = FP_SEG(FileNamePtr);
+ intdosx(&InRegs, &OutRegs, &SegRegs);
+ if (OutRegs.x.cflag)
+ error(&InRegs,&OutRegs,&SegRegs);
+
+ EofFlags[OutRegs.x.ax] = FALSE;
+ return(OutRegs.x.ax);
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void DosClose(Handle)
+unsigned Handle;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ InRegs.x.ax = 0x3e00;
+ InRegs.x.bx = Handle;
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+ if (OutRegs.x.cflag) error(&InRegs,&OutRegs,&SegRegs);
+
+ return;
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned DosRead(Handle,BufferPtr,ReadLength)
+unsigned Handle;
+char far *BufferPtr;
+int ReadLength;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ InRegs.x.ax = 0x3f00;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = ReadLength;
+ InRegs.x.dx = FP_OFF(BufferPtr);
+ SegRegs.ds = FP_SEG(BufferPtr);
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+ if (OutRegs.x.cflag) error(&InRegs,&OutRegs,&SegRegs);
+
+ return(OutRegs.x.ax);
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+unsigned DosWrite(Handle,BufferPtr,WriteLength)
+unsigned Handle;
+char far *BufferPtr;
+int WriteLength;
+{
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ union REGS InRegs2;
+ union REGS OutRegs2;
+ struct SREGS SegRegs2;
+
+ InRegs.x.ax = 0x4000;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = WriteLength;
+ InRegs.x.dx = FP_OFF(BufferPtr);
+ SegRegs.ds = FP_SEG(BufferPtr);
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+ if (OutRegs.x.cflag)
+ { InRegs2.x.ax = 0x4000;
+ InRegs2.x.bx = 1;
+ InRegs2.x.cx = WriteLength;
+ InRegs2.x.dx = FP_OFF(BufferPtr);
+ SegRegs2.ds = FP_SEG(BufferPtr);
+ /* intdosx(&InRegs2,&OutRegs2,&SegRegs2); */
+ error(&InRegs,&OutRegs,&SegRegs);
+ }
+
+ return(OutRegs.x.ax);
+
+ }
+
+/* -------------------------------------------------------------------------- */
+
+void LineInput(Handle,BufferPtr)
+unsigned Handle;
+char far *BufferPtr;
+{
+ char c;
+ char far *BufferPosition;
+
+ BufferPosition = BufferPtr;
+ *BufferPosition = NUL;
+
+ if (DosRead( Handle, (char far *) &c, 1) != 1)
+ EofFlags[Handle] = TRUE;
+
+ while ( (c != (char) '\x0a') && !EofFlags[Handle])
+ {
+ *BufferPosition = c;
+ if (c == (char) '\x0d') *BufferPosition = NUL;
+ BufferPosition++;
+
+ if (DosRead( Handle, (char far *) &c, 1) != 1)
+ EofFlags[Handle] = TRUE;
+
+ }
+
+ *BufferPosition = NUL;
+
+ return;
+}
+
+/*----------------------------------------------------------------------------*/
+
+void error(InRegs,OutRegs,SegRegs)
+union REGS *InRegs;
+union REGS *OutRegs;
+struct SREGS *SegRegs;
+{
+
+ char far *s;
+ char *t;
+ char AsciizString[256];
+
+ struct DOSERROR ErrorInformation;
+
+ dosexterr(&ErrorInformation);
+
+ printf("\n Function %02X, Error %d, Class %d, Action %d, Locus %d \n",
+ InRegs->h.ah,
+ ErrorInformation.exterror,ErrorInformation.class,
+ ErrorInformation.action,ErrorInformation.locus);
+
+ printf(" InRegs:\n");
+ printf(" AX:%04X BX:%04X CX:%04X DX:%04X SI:%04X DI:%04X DS:%04X ES:%04X\n",
+ InRegs->x.ax,InRegs->x.bx,InRegs->x.cx,InRegs->x.dx,InRegs->x.si,InRegs->x.di,
+ SegRegs->ds,SegRegs->es);
+
+ switch(InRegs->h.ah)
+ {
+ case 0x3d:
+ case 0x3c:
+ case 0x4e:
+ FP_SEG(s) = SegRegs->ds;
+ FP_OFF(s) = InRegs->x.dx;
+ t = &AsciizString[0];
+ while (*s != (char) '\0') *t++ = *s++;
+ *t++ = (char) '\0';
+ printf(" DS:DX -> [%s]\n",AsciizString);
+ break;
+ }
+
+ printf(" OutRegs:\n");
+ printf(" AX:%04X BX:%04X CX:%04X DX:%04X SI:%04X DI:%04X DS:%04X ES:%04X\n",
+ OutRegs->x.ax,OutRegs->x.bx,OutRegs->x.cx,OutRegs->x.dx,OutRegs->x.si,OutRegs->x.di,
+ SegRegs->ds,SegRegs->es);
+
+
+
+ exit(1);
+
+ }
+
+
+/* -------------------------------------------------------------------------- */
+
+char * MyMalloc(Length)
+int Length;
+{
+ char *Ptr;
+
+ Ptr = malloc(Length);
+
+ if (Ptr == (char *) 0)
+ { printf("ERROR: insufficient memory available, line %d\n",LineNumber);
+ exit(1);
+ }
+
+ return (Ptr);
+ }
+
+
+/* -------------------------------------------------------------------------- */
+
+ unsigned IdxHandle;
+ unsigned MsgHandle;
+
+void ReadCommon()
+{
+
+
+ char IdxComponentName[16];
+ long MsgOffset;
+ int MsgCount;
+
+ char Line[MAXLENGTH];
+ char NextLine[MAXLENGTH];
+ char CurrentIdxRecord[256];
+ char CurrentMsgRecord[256];
+ int CurrentIdxLevel;
+ int CurrentMsgLevel;
+ char RcdIDXType[32];
+ struct Idx_Structure *IdxPtr;
+ int i;
+ int NumberOfMsg;
+ int k;
+ long n;
+ int ComponentNameLen = 20;
+ char *s, *p;
+ unsigned len;
+ char ContinueMessageInfo[32];
+ int ContinueMessageInfoLen;
+
+ /* initialize the things that need to be... */
+
+ printf(" Loading messages from %s\n",CountryMsg);
+
+ k = 32000;
+ s = malloc(k);
+ while ( (s == (char *) 0) && (k > 1) )
+ {
+ k -= 1000;
+ s = malloc(k);
+ }
+ if (s != (char *) 0) free(s);
+ printf(" (Available message memory space: %d bytes)\n",k);
+
+ IdxHandle = DosOpen( (char far *) CountryIdx, READONLY);
+ MsgHandle = DosOpen( (char far *) CountryMsg, READONLY);
+
+ LineInput(IdxHandle, (char far *) &CurrentIdxRecord[0] );
+ LineInput(MsgHandle, (char far *) &CurrentMsgRecord[0] );
+
+ sscanf(CurrentIdxRecord," %d ",&CurrentIdxLevel);
+ sscanf(CurrentIdxRecord," %d ",&CurrentMsgLevel);
+ if ( CurrentIdxLevel != CurrentMsgLevel )
+ {
+ printf("\nERROR: %s and %s levels do not match\n",CountryIdx,CountryMsg);
+ exit(1);
+ }
+
+ /* find out the offset into the big message file for COMMON error */
+ /* EXTENDED */
+ /* PARSER */
+ /* Utility */
+
+ while ( !EofFlags[IdxHandle] )
+ {
+ LineInput(IdxHandle, (char far *) &CurrentIdxRecord[0] );
+
+ sscanf(CurrentIdxRecord, " %s %lx %d ",
+ IdxComponentName, &MsgOffset, &MsgCount);
+ if (Debugging) printf("---> [%s] %04lX %04d<---\n",IdxComponentName, MsgOffset, MsgCount);
+
+ _strupr(IdxComponentName);
+
+ if (strcmp(IdxComponentName,"COMMON") == 0)
+ {
+ if ( !ReadCommonFlag )
+ {
+ ReadCommonFlag = TRUE;
+ DosLSeek( MsgHandle, MsgOffset, 0);
+ LineInput(MsgHandle, (char far *) &CurrentMsgRecord[0] );
+ if (strcmp(CurrentIdxRecord, CurrentMsgRecord) != 0)
+ {
+ printf("\nERROR: %s and %s COMMON headers do not match\n",CountryIdx,CountryMsg);
+ exit(1);
+ }
+ CommonMessageLines = 1;
+ ExtendedMessageLines = 1;
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ while ( ( !isalpha(Line[0]) ) && (!EofFlags[MsgHandle]) )
+ {
+ p = strchr(Line, ' ') + 1; /* skip msg number */
+ p = strchr(p, ' ') + 1; /* skip status flag */
+ p = strchr(p, ' ') + 1; /* skip revision level */
+ len = strlen(p);
+ CommonErrorTexts[CommonMessageLines] = MyMalloc(len+1);
+ strcpy(CommonErrorTexts[CommonMessageLines], p);
+ if (Debugging) printf("CommonErrorTexts[%d] = (%s)\n",
+ CommonMessageLines,CommonErrorTexts[CommonMessageLines]);
+ CommonMessageLines++;
+ if (CommonMessageLines >= MAXCOMMONERROR)
+ {
+ printf("\nERROR: COMMON message number too large, %d\n",CommonMessageLines);
+ exit(1);
+ }
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ }
+ }
+ }
+
+ else if (strcmp(IdxComponentName,"EXTEND") == 0)
+ {
+ if ( !ReadExtendFlag )
+ {
+ ReadExtendFlag = TRUE;
+ DosLSeek( MsgHandle, MsgOffset, 0);
+ LineInput(MsgHandle, (char far *) &CurrentMsgRecord[0] );
+ if (strcmp(CurrentIdxRecord, CurrentMsgRecord) != 0)
+ {
+ printf("\nERROR: %s and %s EXTEND headers do not match\n",CountryIdx,CountryMsg);
+ exit(1);
+ }
+ ExtendedMessageLines = 1;
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ while ( ( !isalpha(Line[0]) ) && (!EofFlags[MsgHandle]) )
+ {
+ p = strchr(Line, ' ') + 1; /* skip msg number */
+ p = strchr(p, ' ') + 1; /* skip status flag */
+ p = strchr(p, ' ') + 1; /* skip revision level */
+ len = strlen(p);
+ ExtendedErrorTexts[ExtendedMessageLines] = MyMalloc(len+1);
+ strcpy(ExtendedErrorTexts[ExtendedMessageLines], p);
+ if (Debugging) printf("ExtendedErrorTexts[%d] = (%s)\n",
+ ExtendedMessageLines,ExtendedErrorTexts[ExtendedMessageLines]);
+ ExtendedMessageLines++;
+ if (ExtendedMessageLines >= MAXEXTENDEDERROR)
+ {
+ printf("\nERROR: EXTENDED message number too large, %d\n",ExtendedMessageLines);
+ exit(1);
+ }
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ }
+ }
+ }
+
+ else if (strcmp(IdxComponentName,"PARSE") == 0)
+ {
+ if ( !ReadParserFlag )
+ {
+ ReadParserFlag = TRUE;
+ DosLSeek( MsgHandle, MsgOffset, 0);
+ LineInput(MsgHandle, (char far *) &CurrentMsgRecord[0] );
+ if (strcmp(CurrentIdxRecord, CurrentMsgRecord) != 0)
+ {
+ printf("\nERROR: %s and %s PARSE headers do not match\n",CountryIdx,CountryMsg);
+ exit(1);
+ }
+ ParserMessageLines = 1;
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ while ( ( !isalpha(Line[0]) ) && (!EofFlags[MsgHandle]) )
+ {
+ p = strchr(Line, ' ') + 1;
+ p = strchr(p, ' ') + 1;
+ p = strchr(p, ' ') + 1;
+ len = strlen(p);
+ ParserErrorTexts[ParserMessageLines] = MyMalloc(len+1);
+ strcpy(ParserErrorTexts[ParserMessageLines], p);
+ if (Debugging) printf("ParserErrorTexts[%d] = (%s)\n",
+ ParserMessageLines,ParserErrorTexts[ParserMessageLines]);
+ ParserMessageLines++;
+ if (ParserMessageLines >= MAXPARSERERROR)
+ {
+ printf("\nERROR: PARSER message number too large, %d\n",ParserMessageLines);
+ exit(1);
+ }
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ }
+ }
+ }
+
+ else if (strcmp(IdxComponentName,UtilityName) == 0)
+ {
+ if ( !ReadUtilFlag )
+ {
+ ReadUtilFlag = TRUE;
+ DosLSeek( MsgHandle, MsgOffset, 0);
+ LineInput(MsgHandle, (char far *) &CurrentMsgRecord[0] );
+ if (strcmp(CurrentIdxRecord, CurrentMsgRecord) != 0)
+ {
+ printf("\nERROR: %s and %s %s headers do not match\n",
+ CountryIdx,CountryMsg,UtilityName);
+ exit(1);
+ }
+ UtilMessageLines = 1;
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ while ( ( !isalpha(Line[0]) ) && (!EofFlags[MsgHandle]) )
+ {
+ if ( !isdigit(Line[0]) )
+ {
+ MsgCount++;
+ /* need to fake MsgNumber, Status, Level fields*/
+ len = strlen(Line) + strlen(ContinueMessageInfo);
+ UtilErrorTexts[UtilMessageLines] = MyMalloc(len+1);
+ strcpy(UtilErrorTexts[UtilMessageLines], ContinueMessageInfo);
+ strcat(UtilErrorTexts[UtilMessageLines], Line);
+ if (Debugging) printf("UtilErrorTexts[%d] = (%s)\n",
+ UtilMessageLines,UtilErrorTexts[UtilMessageLines]);
+ }
+ else
+ {
+ len = strlen(Line);
+ UtilErrorTexts[UtilMessageLines] = MyMalloc(len+1);
+ strcpy(UtilErrorTexts[UtilMessageLines], Line);
+ if (Debugging) printf("UtilErrorTexts[%d] = (%s)\n",
+ UtilMessageLines,UtilErrorTexts[UtilMessageLines]);
+ strncpy(ContinueMessageInfo,Line,12);
+ ContinueMessageInfo[12] = (char) '\0';
+ if (Debugging) printf(" ContinueMessageInfo = (%s)\n",
+ ContinueMessageInfo);
+ }
+ UtilMessageLines++;
+ if (UtilMessageLines >= MAXUTILERROR)
+ {
+ printf("\nERROR: Utility message number too large, %d\n",UtilMessageLines);
+ exit(1);
+ }
+ LineInput(MsgHandle, (char far *) &Line[0] );
+ }
+ }
+ }
+
+ }
+
+ DosClose(IdxHandle);
+ DosClose(MsgHandle);
+
+ UtilMessageLines--;
+ CommonMessageLines--;
+ ParserMessageLines--;
+ ExtendedMessageLines--;
+
+ k = 32000;
+ s = malloc(k);
+ while ( (s == (char *) 0) && (k > 1) )
+ {
+ k -= 1000;
+ s = malloc(k);
+ }
+ if (s != (char *) 0) free(s);
+ printf(" (Still available message memory space: %d bytes)\n",k);
+
+ if (!ReadCommonFlag)
+ { printf("\nERROR: COMMON messages not found in %s\n",CountryIdx);
+ exit(1);
+ }
+
+ if (!ReadExtendFlag)
+ { printf("\nERROR: EXTEND messages not found in %s\n",CountryIdx);
+ exit(1);
+ }
+
+ if (!ReadParserFlag)
+ { printf("\nERROR: PARSE messages not found in %s\n",CountryIdx);
+ exit(1);
+ }
+
+ if (!ReadUtilFlag)
+ { printf("\nERROR: %s messages not found in %s\n",UtilityName,CountryIdx);
+ exit(1);
+ }
+
+ return;
+
+ }
diff --git a/private/mvdm/dos/v86/cmd/command/comequ.asm b/private/mvdm/dos/v86/cmd/command/comequ.asm
new file mode 100644
index 000000000..965389f23
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/comequ.asm
@@ -0,0 +1,258 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)comequ.asm 1.1 85/05/14
+; SCCSID = @(#)comequ.asm 1.1 85/05/14
+;*************************************
+; COMMAND EQUs which are not switch dependant
+
+ include curdir.inc ; to get DIRSTRLEN
+; Note dossym.inc must already have been included!
+
+EMGDEBUG = FALSE
+
+SYM EQU ">"
+
+ifdef JAPAN
+LINESPERPAGE EQU 24
+else ; if Not JAPAN
+LINESPERPAGE EQU 25 ;AC000; default lines per page
+endif
+NORMPERLIN EQU 1
+WIDEPERLIN EQU 5
+COMBUFLEN EQU 128 ; Length of commmand buffer
+EXECPATHLEN EQU 273 ; MAX_PATH+13 (expanded for ntvdm)
+BatLen EQU 32 ; buffer for batch files
+YES_ECHO EQU 1 ; echo line
+NO_ECHO EQU 0 ; don't echo line
+No_Echo_Char EQU "@" ; don't echo line if this is first char
+call_in_progress EQU 1 ; indicate we're in the CALL command
+length_call EQU 4 ; length of CALL
+max_nest EQU 10 ; max # levels of batch nesting allowed
+fail_allowed EQU 00001000b ; critical error
+retry_allowed EQU 00010000b ; critical error
+Ignore_allowed EQU 00100000b ; critical error
+nullcommand EQU 1 ; no command on command line
+end_of_line EQU -1 ;AN000; end of line return from parser
+end_of_line_out EQU 0 ;AN000; end of line for output
+end_of_line_in EQU 0dh ;AN000; end of line for input
+result_number EQU 1 ;AN000; number returned from parser
+result_string EQU 3 ;AN000; string returned from parser
+result_filespec EQU 5 ;AN000; filespec returned from parser
+result_drive EQU 6 ;AN000; drive returned from parser
+result_date EQU 7 ;AN000; date returned from parser
+result_time EQU 8 ;AN000; time returned from parser
+result_no_error EQU 0 ;AN000; no error returned from parser
+no_cont_flag EQU 0 ;AN000; no control flags for message
+util_msg_class EQU -1 ;AN000; message class for utility
+ext_msg_class EQU 1 ;AN000; message class for extended error
+parse_msg_class EQU 2 ;AN000; message class for parse error
+crit_msg_class EQU 3 ;AN000; message class for critical error
+ext_crlf_class EQU 081h ;AN054; message class for extended error with no CRLF
+colon_char EQU ":" ;AN000; colon character
+crt_ioctl_ln EQU 14 ;AN000; default length of data for display ioctl
+text_mode EQU 1 ;AN000; text mode return from ioctl
+get_generic EQU 07Fh ;AN000; generic ioctl - get device info
+set_crit_dev EQU 0100H ;AN000; device attribute for critical error on I/0
+mult_ansi EQU 01Ah ;AC064; multiplex for ansi.sys
+mult_shell_get EQU 01902h ;AC065; multiplex for Shell - get next command
+mult_shell_brk EQU 01903h ;AN000; multiplex for Shell - ^C batch check
+shell_action equ 0ffh ;AN000; SHELL - return for taking SHELL specific action
+bat_not_open EQU -1 ;AN000; batch handle will be set to this if not open
+bat_open_handle EQU 19 ;AN000; handle will be in this position in JFN table
+Ptr_seg_pos equ 7 ;AN000; Offset from start of message block for subst segment
+Ptr_off_pos equ 5 ;AN000; Offset from start of message block for subst offset
+Parm_off_pos equ word ptr 2 ;AN000; Offset from start of subst list for subst offset
+parm_block_size equ 11 ;AN000; size of message subst block
+blank equ " " ;AN000; blank character
+no_subst equ 0 ;AN000; no substitutions for messages
+one_subst equ 1 ;AN000; one substitution for messages
+no_handle_out equ -1 ;AN000; use function 1 thru 12 for message retriever
+res_subst equ 2 ;AN000; offset from start of message definition to number of subst
+read_open_mode equ 0000000000000000b ;AN024; extended open mode for read
+deny_write equ 0000000000100000b ; deny write sharing mode ;M031
+deny_none equ 0000000001000000b ; deny none sharing mode ;Myyy
+read_open_flag equ 0000000100000001b ;AN000; extended open flags for read
+write_open_mode equ 0000000000000001b ;AN024; extended open mode for read
+write_open_flag equ 0000000100000001b ;AN000; extended open flags for read
+creat_open_flag equ 0000000100010010b ;AN000; extended open flags for read
+capital_A equ 'A' ;AC000;
+vbar equ '|' ;AC000;
+labracket equ '<' ;AC000;
+rabracket equ '>' ;AC000;
+dollar equ '$' ;AC000;
+lparen equ '(' ;AC000;
+rparen equ ')' ;AC000;
+nullrparen equ 29h ;AC000;
+in_word equ 4e49h ;AC000; 'NI' ('IN' backwards)
+do_word equ 4f44h ;AC000; 'OD' ('DO' backwards)
+star equ '*' ;AC000;
+plus_chr equ '+' ;AC000;
+small_a equ 'a' ;AC000;
+small_z equ 'z' ;AC000;
+dot_chr equ '.' ;AC000;
+tab_chr equ 9 ;AN032;
+equal_chr equ '=' ;AN032;
+semicolon equ ';' ;AN049;
+dot_qmark equ 2e3fh ;AC000; '.?'
+dot_colon equ 2e3ah ;AC000; '.:'
+capital_n equ 0 ;AC000; result from Y/N call if N entered
+capital_y equ 1 ;AC000; result from Y/N call if Y entered
+AppendInstall equ 0B700H ;AN020; append install check
+AppendDOS equ 0B702H ;AN020; append DOS version check
+AppendGetState equ 0B706H ;AN020; append get current state
+AppendSetState equ 0B707H ;AN020; append set current state
+AppendTruename equ 0B711H ;AN042; Get file's real location for Batch
+search_attr equ attr_read_only+attr_hidden+attr_directory ;AC042;
+
+;*************************************
+;* PARSE ERROR MESSAGES
+;*************************************
+
+MoreArgs_Ptr equ 1 ;AN000;"Too many parameters" message number
+LessArgs_Ptr equ 2 ;AN000;"Required parameter missing" message number
+BadSwt_Ptr equ 3 ;AN000;"Invalid switch" message number
+BadParm_Ptr equ 10 ;AN000;"Invalid parameter" message number
+
+;*************************************
+;* EQUATES FOR MESSAGE RETRIEVER
+;*************************************
+
+GET_EXTENDED_MSG EQU 0 ;AN000; get extended message address
+SET_EXTENDED_MSG EQU 1 ;AN000; set extended message address
+GET_PARSE_MSG EQU 2 ;AN000; get parse message address
+SET_PARSE_MSG EQU 3 ;AN000; set parse message address
+GET_CRITICAL_MSG EQU 4 ;AN000; get critical message address
+SET_CRITICAL_MSG EQU 5 ;AN000; set critical message address
+MESSAGE_2F EQU 46 ;AN000; minor code for message retriever
+
+;*********************************
+;* EQUATES FOR INT 10H
+;*********************************
+
+VIDEO_IO_INT EQU 10H ;AN000; equate for int 10h
+SET_VIDEO_MODE EQU 0 ;AN000; set video mode
+SET_CURSOR_POSITION EQU 2 ;AN000; set new cursor position
+SCROLL_VIDEO_PAGE EQU 6 ;AN000; scroll active page up
+VIDEO_ATTRIBUTE EQU 7 ;AN000; attribute to be used on blank line
+SET_COLOR_PALETTE EQU 11 ;AN000; set color for video
+GET_VIDEO_STATE EQU 15 ;AN000; get current video state
+VIDEO_ALPHA EQU 3 ;AN000; alpha video is 3 or below
+VIDEO_BW EQU 7 ;AN000; mode for 80X25 black & white
+
+AltPipeChr equ "|" ; alternate pipe character
+
+FCB EQU 5CH
+
+VARSTRUC STRUC
+ISDIR DB ?
+SIZ DB ?
+TTAIL DW ?
+INFO DB ?
+BUF DB DIRSTRLEN + 20 DUP (?)
+VARSTRUC ENDS
+
+;
+; Flags for internal command parsing
+;
+fCheckDrive equ 00000001b ; validate drive letter
+fSwitchAllowed equ 00000010b ; switches allowed
+fLimitHelp equ 00000100b ; /? must appear alone
+
+;
+; Test switches
+;
+fParse EQU 0001h ; display results of parseline
+
+;
+; Batch segment structure
+;
+; BYTE type of segment
+; BYTE echo state of parent on entry to batch file
+; WORD segment of last batch file
+; WORD segment for FOR command
+; BYTE FOR flag state on entry to batch file
+; DWORD offset for next line
+; 10 WORD pointers to parameters. -1 is empty parameter
+; ASCIZ file name (with . and ..)
+; BYTES CR-terminated parameters
+; BYTE 0 flag to indicate end of parameters
+;
+
+BatchType equ 0
+
+BatchSegment struc
+BatType DB BatchType ; signature
+Batechoflag DB 0 ; G state of echo
+BatchEOF DB 0 ;records if EOF reached on file
+Batlast DW 0 ; G segment of last batch file
+Batforptr DW 0 ; G segment for FOR command
+Batforflag DB 0 ; G state of FOR
+BatSeek DD ? ; lseek position of next char
+BatParm DW 10 dup (?) ; pointers to parameters
+BatFile DB ? ; beginning of batch file name
+BatchSegment ends
+
+ANULL equ 0 ; terminates an argv string
+ARGMAX equ 64 ; max args on a command line
+ARGBLEN equ 2*128 ; 1char each plus term NUL
+tplen equ 64 ; max size of one argument
+arg_cnt_error equ 1 ; number of args > MAXARG
+arg_buf_ovflow equ 2 ; overflowed argbuffer
+
+argv_ele STRUC ; elements in the argv array
+ argpointer DW (?) ; pointer to the argstring
+ argflags DB (?) ; cparse flags for this argstring
+ argstartel DW (?) ; the result of cparse's [STARTEL]
+ arglen DW (?) ; cparse's char count + one (for null)
+ argsw_word DW (?) ; any switches after this? what kinds?
+ arg_ocomptr DW (?) ; pointer into original command string
+argv_ele ENDS
+
+arg_unit STRUC
+ argv DB (ARGMAX * SIZE argv_ele) DUP (?)
+ argvcnt DW (?) ; number of arguments
+ argswinfo DW (?) ; Switch information for entire line
+ argbuf DW ARGBLEN DUP (?) ; storage for argv strings
+ argforcombuf db COMBUFLEN DUP (?) ; Original for loop command string
+arg_unit ENDS
+
+parseflags RECORD special_delim:1, unused:4, path_sep:1, wildcard:1, sw_flag:1
+
+SwitchQues EQU 20h
+SwitchV EQU 10h
+SwitchB EQU 08h
+SwitchA EQU 04h
+SwitchP EQU 02h
+SwitchW EQU 01h
+fSwitch EQU 8000h
+fBadSwitch EQU 4000h
+
+SwitchDir EQU SwitchP + SwitchW + fSwitch
+SwitchCopy EQU SwitchV + SwitchA + SwitchB + fSwitch
+
+break <Trap: Get the attention of MSDOS>
+; TRAP snares the operating system for a service call
+; AX, as well as any other registers MS-DOS takes a fancy to, will be crunched.
+trap MACRO dos_function,dos_info
+ ifnb <dos_info>
+ mov AX, (dos_function SHL 8) + dos_info
+ else
+ mov AX, (dos_function SHL 8)
+ endif
+ int 21h
+ENDM
+
+;
+; Equates for initialization
+;
+initInit equ 01h ; initialization in progress
+initSpecial equ 02h ; in initialization time/date routine
+initCtrlC equ 04h ; already in ^C handler
+
+;M052 BETA3WARN equ 1 ; Yank anything related to this EQU
+ ; out before we ship
+
+
diff --git a/private/mvdm/dos/v86/cmd/command/command.lnk b/private/mvdm/dos/v86/cmd/command/command.lnk
new file mode 100644
index 000000000..e28d4f888
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/command.lnk
@@ -0,0 +1,12 @@
+/map +
+command1.obj command2.obj rucode.obj stub.obj rdata.obj +
+init.obj iparse.obj uinit.obj +
+tcode.obj tbatch.obj tbatch2.obj tfor.obj +
+dir.obj tcmd1b.obj tcmd2a.obj tcmd2b.obj +
+tenv.obj tenv2.obj tmisc1.obj tmisc2.obj +
+tpipe.obj parse2.obj path1.obj path2.obj +
+tucode.obj copy.obj copypr1.obj copypr2.obj +
+cparse.obj tparse.obj tprintf.obj loadhi.obj+
+tdata.obj tspc.obj
+command.exc,,;
+
diff --git a/private/mvdm/dos/v86/cmd/command/command.skl b/private/mvdm/dos/v86/cmd/command/command.skl
new file mode 100644
index 000000000..6de40c85c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/command.skl
@@ -0,0 +1,191 @@
+
+;*************************
+;* MESSAGE SKELETON FILE *
+;*************************
+
+:util COMMAND ;AC000;
+
+:class 1 ;AC000; Transient extended errors
+
+:use EXTEND2 ;AC000; "File not found"
+:use EXTEND3 ;AC000; "Path not found"
+:use EXTEND8 ;AC000; "Insufficient memory"
+
+:class 2 ;AC000; Transient parse errors
+
+:class 3 ;AC000; Resident extended errors
+:use -1 EXTEND999 ;AN000; "Extended error #"
+
+:class 4 ;AC000; Resident parse errors
+:use -1 PARSE999 ;AN000; "Parse error #"
+
+:class F ;AC000; Transient messages
+
+:use 1020 COMMON4 ;AC000; "%1 bytes free",CR,LF
+:use 1015 COMMON18 ;AC000; "File cannot be copied onto itself",CR,LF
+:use 1004 COMMON20 ;AC000; "Insufficient disk space",CR,LF
+:use 1026 COMMON22 ;AC000; "Invalid code page",CR,LF
+:use 1031 COMMON23 ;AC000; "Invalid date"
+:use 1035 COMMON24 ;AC000; "Invalid time"
+:use 1062 COMMON25 ;AC000; "Invalid path"
+:use 1028 COMMON28 ;AC000; "Press any key to continue"
+:use 1045 COMMON32 ;AC000; "Unable to create directory",CR,LF
+:use 1041 COMMON33 ;AC000; "Volume in drive %1 has no label"
+:use 1042 COMMON34 ;AC000; "Volume in drive %1 is %2"
+:use 1043 COMMON36 ;AC000; "Volume Serial Number is %1"
+:def 1002 "Duplicate file name or file not found",CR,LF ;AC000;
+:def 1003 "Invalid path or file name",CR,LF ;AC000;
+:def 1007 "Out of environment space",CR,LF ;AC000;
+:def 1008 "File creation error",CR,LF ;AC000;
+:def 1009 "Batch file missing",CR,LF ;AC000;
+:def 1010 CR,LF,"Insert disk with batch file",CR,LF ;AC000;
+:def 1011 "Bad command or file name",CR,LF ;AC000;
+:use 1014 EXTEND5 ;AC000;
+:def 1016 "Content of destination lost before copy",CR,LF ;AC000;
+:def 1017 "Invalid filename or file not found",CR,LF ;AC000;
+:def 1018 "%1 File(s) copied",CR,LF ;AC000;
+:def 1019 "%1 File(s) " ;AC000;
+:use 1021 EXTEND15 ;AC000;
+:def 1022 "Code page %1 not prepared for system",CR,LF ;AC000;
+:def 1023 "Code page %1 not prepared for all devices",CR,LF ;AC000;
+:def 1024 "Active code page: %1",CR,LF ;AC000;
+:def 1025 "NLSFUNC not installed",CR,LF ;AC000;
+:def 1027 "Current drive is no longer valid" ;AC000;
+:def 1029 "Label not found",CR,LF ;AC000;
+:def 1030 "Syntax error",CR,LF ;AC000;
+:def 1032 "Current date is %1 %2",CR,LF ;AC000;
+:def 1033 "SunMonTueWedThuFriSat" ;AC000;
+:def 1034 "Enter new date (%1): " ;AC031;
+:def 1036 "Current time is %1",CR,LF ;AC000;
+:def 1037 "Enter new time: " ;AC031;
+:def 1038 ", Delete (Y/N)?" ;AC000;
+:def 1039 "All files in directory will be deleted!",CR,LF
+ "Are you sure (Y/N)?" ;AC000;
+:def 1040 "Microsoft DOS Version %1.%2",CR,LF ;AC000;
+:def 1044 "Invalid directory",CR,LF ;AC000;
+:def 1046 "Invalid path, not directory,",CR,LF,"or directory not empty",CR,LF ;AC000;
+:def 1047 "Must specify ON or OFF",CR,LF ;AC000;
+:def 1048 "Directory of %1",CR,LF ;AC000;
+:def 1049 "No Path",CR,LF ;AC000;
+:def 1050 "Invalid drive in search path",CR,LF ;AC000;
+:def 1051 "Invalid device",CR,LF ;AC000;
+:def 1052 "FOR cannot be nested",CR,LF ;AC000;
+:def 1053 "Intermediate file error during pipe",CR,LF ;AC000;
+:def 1054 "Cannot do binary reads from a device",CR,LF ;AC000;
+:def 1055 "BREAK is %1",CR,LF ;AC000;
+:def 1056 "VERIFY is %1",CR,LF ;AC000;
+:def 1057 "ECHO is %1",CR,LF ;AC000;
+:def 1059 "off",0 ;AC000;
+:def 1060 "on",0 ;AC000;
+:def 1061 "Error writing to device",CR,LF ;AC000;
+:def 1063 "%1" ;AC000;
+:def 1064 "%1" ;AC000;
+:def 1065 "%1" ;AC000;
+:def 1066 "%1" ;AC000;
+:def 1067 9 ;AC000;
+:def 1068 " <DIR> " ;AC000;
+:def 1069 8," ",8 ;AC000;
+:def 1070 CR,LF ;AC000;
+:def 1071 "%1" ;AC000;
+:def 1072 "mm-dd-yy" ;AC000;
+:def 1073 "dd-mm-yy" ;AC000;
+:def 1074 "yy-mm-dd" ;AC000;
+:def 1075 "%1 %2" ;AC000;
+:def 1076 "%1" ;AC000;
+:def 1077 " %1 %2" ;AC053;
+:def 1078 "Directory already exists",CR,LF ;AC000;
+:def 1079 "%1 bytes",CR,LF
+:def 1080 "Total files listed:",CR,LF
+:def 1081 "(Error occurred in environment variable)",CR,LF
+:def 1084 "(continuing %1)"
+:def 1090 "Revision %1",CR,LF
+:def 1091 "DOS is in ROM"
+:def 1092 "DOS is in HMA"
+:def 1093 "DOS is in low memory"
+
+:def 1094 "Cannot Loadhigh batch file" ; M016
+:def 1095 "LoadHigh: Invalid filename" ; M016
+:def 1096 "Cannot open specified country information file" ;M045
+
+:def 1200 /? unimplemented
+:def 1300 BREAK /?
+:def 1320 CHCP /?
+:def 1321 CHCP /?
+:def 1340 CD /?
+:def 1341 CD /?
+:def 1342 CD /?
+:def 1360 CLS /?
+:def 1400 COPY /?
+:def 1401 COPY /?
+:def 1402 COPY /?
+:def 1403 COPY /?
+:def 1404 COPY /?
+:def 1420 CTTY /?
+:def 1440 DATE /?
+:def 1441 DATE /?
+:def 1460 DEL /?
+:def 1461 DEL /?
+:def 1462 DEL /?
+:def 1480 DIR /?
+:def 1481 DIR /?
+:def 1482 DIR /?
+:def 1483 DIR /?
+:def 1484 DIR /?
+:def 1485 DIR /?
+:def 1486 DIR /?
+:def 1487 DIR /?
+:def 1488 DIR /?
+:def 1500 EXIT /?
+:def 1520 MD /?
+:def 1540 PATH /?
+:def 1541 PATH /?
+:def 1542 PATH /?
+:def 1560 PROMPT /?
+:def 1561 PROMPT /?
+:def 1562 PROMPT /?
+:def 1563 PROMPT /?
+:def 1564 PROMPT /?
+:def 1565 PROMPT /?
+:def 1566 PROMPT /?
+:def 1567 PROMPT /?
+:def 1568 PROMPT /?
+:def 1580 RD /?
+:def 1600 REN /?
+:def 1601 REN /?
+:def 1602 REN /?
+:def 1620 SET /?
+:def 1621 SET /?
+:def 1622 SET /?
+:def 1640 TIME /?
+:def 1641 TIME /?
+:def 1660 TYPE /?
+:def 1680 VER /?
+:def 1700 VERIFY /?
+:def 1720 VOL /?
+:def 1740 CALL /? ;M014
+:def 1741 CALL /? ;M014
+:def 1760 REM /? ;M014
+:def 1780 PAUSE /? ;M014
+:def 1800 ECHO /? ;M014
+:def 1801 ECHO /?
+:def 1820 GOTO /? ;M014
+:def 1821 GOTO /? ;M014
+:def 1840 SHIFT /? ;M014
+:def 1860 IF /? ;M014
+:def 1861 IF /? ;M014
+:def 1862 IF /? ;M014
+:def 1863 IF /? ;M014
+:def 1864 IF /? ;M014
+:def 1865 IF /? ;M014
+:def 1866 IF /? ;M014
+:def 1880 FOR /? ;M014
+:def 1881 FOR /? ;M014
+:def 1882 FOR /? ;M014
+:def 1883 FOR /? ;M014
+:def 1900 TRUENAME /? ;M014
+:def 1920 LOADHIGH /? ;M014
+:def 1921 LOADHIGH /? ;M014
+:def 1922 LOADHIGH /? ;M014
+
+:end ;AC000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/command1.asm b/private/mvdm/dos/v86/cmd/command/command1.asm
new file mode 100644
index 000000000..16687b9f3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/command1.asm
@@ -0,0 +1,745 @@
+ page ,132
+ title COMMAND - resident code for COMMAND.COM
+ name COMMAND
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;*****************************************************************************
+;
+; MODULE: COMMAND.COM
+;
+; DESCRIPTIVE NAME: Default DOS command interpreter
+;
+; FUNCTION: This version of COMMAND is divided into three distinct
+; parts. First is the resident portion, which includes
+; handlers for interrupts 23H (Cntrl-C), 24H (fatal
+; error), and 2EH (command line execute); it also has
+; code to test and, if necessary, reload the transient
+; portion. Following the resident is the init code, which
+; is overwritten after use. Then comes the transient
+; portion, which includes all command processing (whether
+; internal or external). The transient portion loads at
+; the end of physical memory, and it may be overlayed by
+; programs that need as much memory as possible. When the
+; resident portion of command regains control from a user
+; program, a check sum is performed on the transient
+; portion to see if it must be reloaded. Thus programs
+; which do not need maximum memory will save the time
+; required to reload COMMAND when they terminate.
+;
+; ENTRY POINT: PROGSTART
+;
+; INPUT: command line at offset 81H
+;
+; EXIT_NORMAL: No exit from root level command processor. Can exit
+; from a secondary command processor via the EXIT
+; internal command.
+;
+; EXIT_ERROR: Exit to prior command processor if possible, otherwise
+; hang the system.
+;
+; INTERNAL REFERENCES:
+;
+; ROUTINES: See the COMMAND Subroutine Description Document
+; (COMMAND.DOC)
+;
+; DATA AREAS: See the COMMAND Subroutine Description Document
+; (COMMAND.DOC)
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINES: none
+;
+; DATA AREAS: none
+;
+;*****************************************************************************
+;
+; REVISION HISTORY
+; ----------------
+;
+; DOS 1.00 to DOS 3.30
+; --------------------------
+; SEE REVISION LOG IN COPY.ASM ALSO
+;
+; REV 1.17
+; 05/19/82 Fixed bug in BADEXE error (relocation error must return to
+; resident since the EXELOAD may have overwritten the transient.
+;
+; REV 1.18
+; 05/21/82 IBM version always looks on drive A
+; MSVER always looks on default drive
+;
+; REV 1.19
+; 06/03/82 Drive spec now entered in command line
+; 06/07/82 Added VER command (print DOS version number) and VOL command
+; (print volume label)
+;
+; REV 1.20
+; 06/09/82 Prints "directory" after directories
+; 06/13/82 MKDIR, CHDIR, PWD, RMDIR added
+;
+; REV 1.50
+; Some code for new 2.0 DOS, sort of HACKey. Not enough time to
+; do it right.
+;
+; REV 1.70
+; EXEC used to fork off new processes
+;
+; REV 1.80
+; C switch for single command execution
+;
+; REV 1.90
+; Batch uses XENIX
+;
+; Rev 2.00
+; Lots of neato stuff
+; IBM 2.00 level
+;
+; Rev 2.01
+; 'D' switch for date time suppression
+;
+; Rev 2.02
+; Default userpath is NUL rather than BIN
+; same as IBM
+; COMMAND split into pieces
+;
+; Rev 2.10
+; INTERNATIONAL SUPPORT
+;
+; Rev 2.50
+; all the 2.x new stuff -MU
+;
+; Rev 3.30 (Ellen G)
+; CALL internal command (TBATCH2.ASM)
+; CHCP internal command (TCMD2B.ASM)
+; INT 24H support of abort, retry, ignore, and fail prompt
+; @ sign suppression of batch file line
+; Replaceable environment value support in batch files
+; INT 2FH calls for APPEND
+; Lots of PTR fixes!
+;
+; Beyond 3.30 to forever (Ellen G)
+; ----------------------
+;
+; A000 DOS 4.00 - Use SYSPARSE for internal commands
+; Use Message Retriever services
+; /MSG switch for resident extended error msg
+; Convert to new capitalization support
+; Better error recovery on CHCP command
+; Code page file tag support
+; TRUENAME internal command
+; Extended screen line support
+; /P switch on DEL/ERASE command
+; Improved file redirection error recovery
+; (removed) Improved batch file performance
+; Unconditional DBCS support
+; Volume serial number support
+; (removed) COMMENT=?? support
+;
+; A001 PTM P20 Move system_cpage from TDATA to TSPC
+;
+; A002 PTM P74 Fix PRESCAN so that redirection symbols do not
+; require delimiters.
+;
+; A003 PTM P5,P9,P111 Included in A000 development
+;
+; A004 PTM P86 Fix IF command to turn off piping before
+; executing
+;
+; A005 DCR D17 If user specifies an extension on the command
+; line search for that extension only.
+;
+; A006 DCR D15 New message for MkDir - "Directory already
+; exists"
+;
+; A007 DCR D2 Change CTTY so that a write is done before XDUP
+;
+; A008 PTM P182 Change COPY to set default if invalid function
+; returned from code page call.
+;
+; A009 PTM P179 Add CRLF to invalid disk change message
+;
+; A010 DCR D43 Allow APPEND to do a far call to SYSPARSE in
+; transient COMMAND.
+;
+; A011 DCR D130 Change redirection to overwrite an EOF mark
+; before appending to a file.
+;
+; A012 PTM P189 Fix redirection error recovery.
+;
+; A013 PTM P330 Change date format
+;
+; A014 PTM P455 Fix echo parsing
+;
+; A015 PTM P517 Fix DIR problem with * vs *.
+;
+; A016 PTM P354 Fix extended error message addressing
+;
+; A017 PTM P448 Fix appending to 0 length files
+;
+; A018 PTM P566,P3903 Fix parse error messages to print out parameter
+; the parser fails on. Fail on duplicate switches.
+;
+; A019 PTM P542 Fix device name to be printed correctly during
+; critical error
+;
+; A020 DCR D43 Set append state off while in DIR
+;
+; A021 PTM P709 Fix CTTY printing ascii characters.
+;
+; A022 DCR D209 Enhanced error recovery
+;
+; A023 PTM P911 Fix ANSI.SYS IOCTL structure.
+;
+; A024 PTM P899 Fix EXTOPEN open modes.
+;
+; A025 PTM P922 Fix messages and optimize PARSE switches
+;
+; A026 DCR D191 Change redirection error recovery support.
+;
+; A027 PTM P991 Fix so that KAUTOBAT & AUTOEXEC are terminated
+; with a carriage return.
+;
+; A028 PTM P1076 Print a blank line before printing invalid
+; date and invalid time messages.
+;
+; A029 PTM P1084 Eliminate calls to parse_check_eol in DATE
+; and TIME.
+;
+; A030 DCR D201 New extended attribute format.
+;
+; A031 PTM P1149 Fix DATE/TIME add blank before prompt.
+;
+; A032 PTM P931 Fix =ON, =OFF for BREAK, VERIFY, ECHO
+;
+; A033 PTM P1298 Fix problem with system crashes on ECHO >""
+;
+; A034 PTM P1387 Fix COPY D:fname+,, to work
+;
+; A035 PTM P1407 Fix so that >> (appending) to a device does
+; do a read to determine eof.
+;
+; A036 PTM P1406 Use 69h instead of 44h to get volume serial
+; so that ASSIGN works correctly.
+;
+; A037 PTM P1335 Fix COMMAND /C with FOR
+;
+; A038 PTM P1635 Fix COPY so that it doesn't accept /V /V
+;
+; A039 DCR D284 Change invalid code page tag from -1 to 0.
+;
+; A040 PTM P1787 Fix redirection to cause error when no file is
+; specified.
+;
+; A041 PTM P1705 Close redirected files after internal APPEND
+; executes.
+;
+; A042 PTM P1276 Fix problem of APPEND paths changes in batch
+; files causing loss of batch file.
+;
+; A043 PTM P2208 Make sure redirection is not set up twice for
+; CALL'ed batch files.
+;
+; A044 PTM P2315 Set switch on PARSE so that 0ah is not used
+; as an end of line character
+;
+; A045 PTM P2560 Make sure we don't lose parse, critical error,
+; and extended message pointers when we EXIT if
+; COMMAND /P is the top level process.
+;
+; A046 PTM P2690 Change COPY message "fn File not found" to
+; "File not found - fn"
+;
+; A047 PTM P2819 Fix transient reload prompt message
+;
+; A048 PTM P2824 Fix COPY path to be upper cased. This was broken
+; when DBCS code was added.
+;
+; A049 PTM P2891 Fix PATH so that it doesn't accept extra characters
+; on line.
+;
+; A050 PTM P3030 Fix TYPE to work properly on files > 64K
+;
+; A051 PTM P3011 Fix DIR header to be compatible with prior releases.
+;
+; A052 PTM P3063,P3228 Fix COPY message for invalid filename on target.
+;
+; A053 PTM P2865 Fix DIR to work in 40 column mode.
+;
+; A054 PTM P3407 Code reduction and critical error on single line
+; PTM P3672 (Change to single parser exported under P3407)
+;
+; A055 PTM P3282 Reset message service variables in INT 23h to fix
+; problems with breaking out of INT 24h
+;
+; A056 PTM P3389 Fix problem of environment overlaying transient.
+;
+; A057 PTM P3384 Fix COMMAND /C so that it works if there is no space
+; before the "string". EX: COMMAND /CDIR
+;
+; A058 PTM P3493 Fix DBCS so that CPARSE eats second character of
+; DBCS switch.
+;
+; A059 PTM P3394 Change the TIME command to right align the display of
+; the time.
+;
+; A060 PTM P3672 Code reduction - change PARSE and EXTENDED ERROR
+; messages to be disk based. Only keep them if /MSG
+; is used.
+;
+; A061 PTM P3928 Fix so that transient doesn't reload when breaking
+; out of internal commands, due to substitution blocks
+; not being reset.
+;
+; A062 PTM P4079 Fix segment override for fetching address of environment
+; of parent copy of COMMAND when no COMSPEC exists in
+; secondary copy of environment. Change default slash in
+; default comspec string to backslash.
+;
+; A063 PTM P4140 REDIRECTOR and IFSFUNC changed interface for getting
+; text for critical error messages.
+;
+; A064 PTM P4934 Multiplex number for ANSI.SYS changed due to conflict
+; 5/20/88 with Microsoft product already shipped.
+;
+; A065 PTM P4935 Multiplex number for SHELL changed due to conflict
+; 5/20/88 with Microsoft product already shipped.
+;
+; A066 PTM P4961 DIR /W /P scrolled first line off the screen in some
+; 5/24/88 cases; where the listing would barely fit without the
+; header and space remaining.
+;
+; A067 PTM P5011 For /E: values of 993 to 1024 the COMSPEC was getting
+; 6/6/88 trashed. Turns out that the SETBLOCK for the new
+; environment was putting a "Z block" marker in the old
+; environment. The fix is to move to the old environment
+; to the new environment before doing the SETBLOCK.
+;
+; A068 PTM P5568 IR79754 APPEND /x:on not working properly with DIR/VOL
+; 09/19/88 because the check for APPEND needed to be performed
+; before the DIR's findfirst.
+;
+; A069 PTM P5726 IR80540 COMSPEC_flag not properly initialized and
+; 10/30/88 executed. Causing AUSTIN problem testing LAN/DW4 re-
+; loading trans w/new comspec with no user change comspec.
+;
+; A070 PTM P5734 IR80484 Batch file causes sys workspace to be corrupted.
+; 11/05/88 Expansion of environment variables into batch line of
+; 128 chars was not being counted and "%" which should be
+; ignored were being counted.
+;
+; A071 PTM P5854 IR82061 Invalid COMMAND.COM when Word Perfect, Prompt
+; 03/02/89 used. Comspec_flag was not in protected data file be-
+; ing included in checksum and was being overwritten by
+; WP. Moved var from Tspc to Tdata so Trans would reload.
+; Also removed fix A069 (because flag now protected).
+;
+; C001 VERSION 4.1 Add new internal command - SERVICE - to display the DOS
+; 07/25/89 version and CSD version in U.S. date format. Files
+; changed - TRANMSG,.SKL,COMMAND1,TDATA,TCMD2A,USA.MSG
+;
+;***********************************************************************************
+
+;
+; Revision History
+; ================
+;
+; M021 SR 08/23/90 Fixed Ctrl-C handler to handle Ctrl-C
+; at init time (date/time prompt)
+;
+
+
+.xcref
+.xlist
+ include dossym.inc ; basic DOS symbol set
+ include syscall.inc ; DOS function names
+ include comsw.asm ; build version info
+ include comequ.asm ; common command.com symbols
+ include resmsg.equ ; resident message names
+
+ include comseg.asm ;segment ordering
+.list
+.cref
+
+CODERES segment public byte
+CODERES ends
+
+DATARES segment public byte
+ extrn AccDen:byte
+ extrn Batch:word
+ extrn EchoFlag:byte
+ extrn ExeBad:byte
+ extrn ExecEMes:byte
+ extrn ExecErrSubst:byte
+ extrn ExtCom:byte
+ extrn ForFlag:byte
+ extrn IfFlag:byte
+ extrn InitFlag:BYTE
+ extrn Nest:word
+ extrn PipeFlag:byte
+ extrn RBadNam:byte
+ extrn RetCode:word
+ extrn SingleCom:word
+ extrn TooBig:byte
+
+ extrn OldDS:word
+ EXTRN SCS_REENTERED:BYTE
+ EXTRN SCS_CMDPROMPT:BYTE
+
+DATARES ends
+
+
+INIT segment public para
+ extrn ConProc:near
+ extrn Init_Contc_SpecialCase:near
+INIT ends
+
+
+ include envdata.asm
+
+Prompt32 equ 1
+
+;*** START OF RESIDENT PORTION
+
+CODERES segment public byte
+
+ public Ext_Exec
+ public ContC
+ public Exec_Wait
+ public Exec_Ret
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ extrn LodCom:near
+ extrn LodCom1:near
+
+ org 0
+Zero = $
+
+;; org 80h - 1
+;;ResCom label byte
+;; public ResCom
+
+;; org 100h
+
+public StartCode
+StartCode:
+;; jmp RESGROUP:ConProc
+
+
+
+;*** EXEC error handling
+;
+; COMMAND has issued an EXEC system call and it has returned an error.
+; We examine the error code and select an appropriate message.
+
+; Bugbug: optimize reg usage in following code? Careful of DX!
+; Condense the error scan?
+; RBADNAM is checked by transient, no need here?
+; Move below Ext_Exec.
+
+Exec_Err:
+;SR;
+; ds,es are setup when the transient jumps to Ext_Exec. So segment regs are
+;in order here
+
+ assume ds:DATARES,es:DATARES
+
+; Bugbug: can we use byte compares here?
+; Might be able to use byte msg#s, too.
+
+; Store errors in a 3 or 4 byte table. Msg #s in another.
+; Speed not high priority here.
+
+; Move this to transient.
+
+ mov bx,offset DATARES:RBadNam
+ cmp al,ERROR_FILE_NOT_FOUND
+ je GotExecEMes ; bad command
+ mov bx,offset DATARES:TooBig
+ cmp al,ERROR_NOT_ENOUGH_MEMORY
+ je GotExecEMes ; file not found
+ mov bx,offset DATARES:ExeBad
+ cmp al,ERROR_BAD_FORMAT
+ je GotExecEMes ; bad exe file
+ mov bx,offset DATARES:AccDen
+ cmp al,ERROR_ACCESS_DENIED
+ je GotExecEMes ; access denied
+
+Default_Message:
+ mov bx,offset DATARES:ExecEMes ; default message
+ mov si,offset DATARES:ExecErrSubst ; get address of subst block
+
+GotExecEMes:
+ mov dx,bx ; DX = ptr to msg
+;; williamh: no reason of doing this. When command.com receives a command,
+;; it means the VDM process has been created successfully and there
+;; is no way for the parent process to know that we are not able
+;; to launch the program and therefore, it won't display any error
+;; message for us.
+;; cmp byte ptr [scs_reentered],1
+;; jne NoErrMsg
+;; cmp byte ptr [scs_cmdprompt],Prompt32
+;; je NoErrMsg
+ invoke RPrint
+NoErrMsg:
+ jmp short NoExec
+
+
+
+;*** EXEC call
+;
+; The transient has set up everything for an EXEC system call.
+; For cleanliness, we issue the EXEC here in the resident
+; so that we may be able to recover cleanly upon success.
+;
+; CS,DS,ES,SS = DATARES seg addr
+
+Ext_Exec:
+;SR;
+; The words put on the stack by the stub will be popped off when we finally
+;jump to LodCom ( by LodCom).
+;
+;; int 21h ; do the exec
+
+Exec_Ret:
+ jc Exec_Err ; exec failed
+
+; The exec has completed. Retrieve the exit code.
+
+Exec_Wait:
+ mov ah,WAITPROCESS ; get errorlevel
+ int 21h ; get the return code
+ mov RetCode,ax
+
+; See if we can reload the transient. The external command
+; may have overwritten part of the transient.
+
+NoExec:
+;SR;
+; ds = es = ss = DATARES when we jump to LodCom
+;
+ jmp LodCom
+
+
+
+
+;*** Int 23 (ctrl-c) handler
+;
+; This is the default system INT 23 handler. All processes
+; (including COMMAND) get it by default. There are some
+; games that are played: We ignore ^C during most of the
+; INIT code. This is because we may perform an ALLOC and
+; diddle the header! Also, if we are prompting for date/time
+; in the init code, we are to treat ^C as empty responses.
+
+
+; Bugbug: put init ctrl-c handling in init module.
+
+;SR;
+; The stub has pushed the previous ds and DATARES onto the stack. We get
+;both these values off the stack now
+;
+ContC proc far
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+; pop OldDS ;OldDS = old ds
+
+ test InitFlag,INITINIT ; in initialization?
+ jz NotAtInit ; no
+ test InitFlag,INITSPECIAL ; doing special stuff?
+ jz CmdIRet ; no, ignore ^C
+ pop ds ; restore before jumping; M021
+ jmp RESGROUP:Init_ContC_SpecialCase ; Yes, go handle it
+CmdIret:
+;SR;
+; Restore ds to its previous value
+;
+
+; mov ds,OLdDS ;
+ pop ds
+ iret ; yes, ignore the ^C
+
+NotAtInit:
+ test InitFlag,INITCTRLC ; are we already in a ^C?
+ jz NotInit ; nope too.
+
+;* We are interrupting ourselves in this ^C handler. We need
+; to set carry and return to the user sans flags only if the
+; system call was a 1-12 one. Otherwise, we ignore the ^C.
+
+ cmp ah,1
+ jb CmdIRet
+ cmp ah,12
+ ja CmdIRet
+
+ pop ds ;restore ds to old value
+ add sp,6 ; remove int frame
+ stc
+
+; mov ds,OldDS ;restore ds to its old value
+ ret 2 ; remove those flags...
+
+NotInit:
+
+;* We have now received a ^C for some process (maybe ourselves
+; but not at INIT).
+;
+; Note that we are running on the user's stack!!! Bad news if
+; any of the system calls below go and issue another INT
+; 24... Massive stack overflow! Another bad point is that
+; SavHand will save an already saved handle, thus losing a
+; possible redirection...
+;
+; All we need to do is set the flag to indicate nested ^C.
+; The above code will correctly flag the ^C diring the
+; message output and prompting while ignoring the ^C the rest
+; of the time.
+;
+; Clean up: flush disk. If we are in the middle of a batch
+; file, we ask if he wants to terminate it. If he does, then
+; we turn off all internal flags and let the DOS abort.
+
+ or InitFlag,INITCTRLC ; nested ^c is on
+ sti
+
+;; push cs ; el yucko! change the user's ds!!
+;; pop ds
+;; assume ds:RESGROUP
+
+ pop ax ;discard the old ds value
+
+ mov ax,SingleCom
+ or ax,ax
+ jnz NoReset
+ push ax
+ mov ah,DISK_RESET
+ int 21h ; reset disks in case files were open
+ pop ax
+
+NoReset:
+
+; In the generalized version of FOR, PIPE and BATCH, we would
+; walk the entire active list and free each segment. Here,
+; we just free the single batch segment.
+
+ test Batch,-1
+ jz ContCTerm
+ or ax,ax
+ jnz ContCTerm
+ invoke SavHand
+ invoke AskEnd ; ask if user wants to end batch
+
+; If the carry flag is clear, we do NOT free up the batch file
+
+ jnc ContBatch
+ mov cl,EchoFlag ; get current echo flag
+ push bx
+
+ClearBatch:
+ mov es,Batch ; get batch segment
+ mov di,BatFile ; get offset of batch file name
+; Bugbug: verify the following shell interface still works
+;; mov ax,MULT_SHELL_BRK ; does the SHELL want this terminated?
+;; int 2Fh ; call the SHELL
+;; cmp al,SHELL_ACTION ; does shell want this batch?
+;; je Shell_Bat_Cont ; yes - keep it
+
+ mov bx,es:BatForPtr ; get old FOR segment
+ cmp bx,0 ; is a FOR in progress
+ je no_bat_for ; no - don't deallocate
+ push es ;
+ mov es,bx ; yes - free it up...
+ mov ah,DEALLOC ;
+ int 21h ;
+ pop es ; restore to batch segment
+
+No_Bat_For:
+ mov cl,es:BatEchoFlag ; get old echo flag
+ mov bx,es:BatLast ; get old batch segment
+ mov ah,DEALLOC ; free it up...
+ int 21h
+ mov Batch,bx ; get ready to deallocate next batch
+ dec nest ; is there another batch file?
+ jnz ClearBatch ; keep going until no batch file
+
+
+; We are terminating a batch file; restore the echo status
+
+
+Shell_Bat_Cont: ; continue batch for SHELL
+
+ pop bx
+ mov EchoFlag,cl ; reset echo status
+ mov PipeFlag,0 ; turn off pipeflag
+ContBatch:
+ invoke Crlf ; print out crlf before returning
+ invoke RestHand
+
+; Yes, we are terminating. Turn off flags and allow the DOS to abort.
+
+ContCTerm:
+ xor ax,ax ; indicate no read
+ mov bp,ax
+
+; The following resetting of the state flags is good for the
+; generalized batch processing.
+
+ mov IfFlag,al ; turn off iffing
+ mov ForFlag,al ; turn off for processing
+ call ResPipeOff
+ cmp SingleCom,ax ; see if we need to set singlecom
+ jz NoSetSing
+ mov SingleCom,-1 ; cause termination on
+ ; pipe, batch, for
+NoSetSing:
+
+; If we are doing an internal command, go through the reload process.
+; If we are doing an external, let DOS abort the process.
+; In both cases, we are now done with the ^C processing.
+
+ and InitFlag,not INITCTRLC
+ cmp ExtCom,al
+ jnz DoDAb ; internal ^c
+ jmp LodCom1
+DoDAb:
+ stc ; tell dos to abort
+
+;SR;
+;We dont need to restore ds here because we are forcing DOS to do an abort
+;by setting carry and leaving flags on the stack
+;
+ ret ; Leave flags on stack
+ContC endp
+
+
+;SR;
+; ds = DATARES on entry. This routine is called from DskErr and LodCom1 and
+;both have ds = DATARES
+;
+
+ResPipeOff:
+ public ResPipeOff
+
+ assume ds:DATARES,es:NOTHING
+
+ savereg <ax>
+ xor ax,ax
+ xchg PipeFlag,al
+ or al,al
+ jz NoPipePop
+ shr EchoFlag,1
+NoPipePop:
+ restorereg <ax>
+ return
+
+
+CODERES ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/command2.asm b/private/mvdm/dos/v86/cmd/command/command2.asm
new file mode 100644
index 000000000..b9ab38171
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/command2.asm
@@ -0,0 +1,1002 @@
+ page ,132
+ title COMMAND2 - resident code for COMMAND.COM part II
+ name COMMAND2
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M038 SR 11/5/90 Changed stuff for Novell RPL. These guys cannot
+; reserve memory by changing int 12h and then give it
+; back to DOS by changing arenas in autoexec.bat.
+; This makes command.com reload transient and this
+; cannot be done at this stage.
+;
+;
+
+
+
+.xcref
+.xlist
+ include dossym.inc
+ include pdb.inc
+ include syscall.inc
+ include comsw.asm
+ include comequ.asm
+ include resmsg.equ
+
+ include comseg.asm
+.list
+.cref
+
+
+DATARES segment public byte
+ extrn Append_State:word
+ extrn Append_Flag:byte
+ extrn BMemMes:byte
+ extrn ComBad:byte
+ extrn ComDrv:byte
+ extrn ComSpec:byte
+ extrn EnvirSeg:word
+ extrn ExtCom:byte
+ extrn FRetMes:byte
+ extrn HaltMes:byte
+ extrn Handle01:word
+ extrn InitFlag:BYTE
+ extrn Int_2e_Ret:dword
+ extrn Io_Save:word
+ extrn Io_Stderr:byte
+ extrn Loading:byte
+ extrn LTpa:word
+ extrn MemSiz:word
+ extrn NoHandMes:byte
+ extrn OldTerm:dword
+ extrn Parent:word
+ extrn PermCom:byte
+ extrn Prompt:byte
+ extrn PutBackDrv:byte
+ extrn PutBackMsg:byte
+ extrn PutBackSubst:byte
+ extrn Res_Tpa:word
+ extrn RetCode:word
+ extrn Save_Pdb:word
+ extrn SingleCom:word
+ extrn Sum:word
+ extrn Trans:dword
+ extrn TranVarEnd:byte
+ extrn TranVars:byte
+ extrn TrnSeg:word
+ extrn VerVal:word
+
+ extrn ResSize:word
+ extrn OldDS:word
+ extrn RStack:word
+
+ extrn Ctrlc_Trap:near
+ extrn CritErr_Trap:near
+ extrn LodCom_Trap:near
+
+DATARES ends
+
+;;ENVARENA segment public para
+;;ENVARENA ends
+
+;;ENVIRONMENT segment public para ; default COMMAND environment
+;;ENVIRONMENT ends
+
+INIT segment public para
+ extrn EnvSiz:word
+ extrn OldEnv:word
+ extrn ResetEnv:byte
+ extrn UsedEnv:word
+
+ extrn Chuckenv:byte
+
+
+INIT ends
+
+
+TRANDATA segment public byte
+ extrn trandataend:byte
+TRANDATA ends
+
+TRANSPACE segment public byte
+ extrn transpaceend:byte
+ extrn headcall:dword
+TRANSPACE ends
+
+
+
+
+CODERES segment public byte
+
+ public BadMemErr
+
+ public ChkSum
+;; public EndInit
+ public GetComDsk2
+ public Int_2e
+ public LoadCom
+ public LodCom
+ public LodCom1
+ public RestHand
+ public SavHand
+ public SetVect
+ public THeadFix
+ public TRemCheck
+ public TJmp
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ extrn ContC:near
+ extrn DskErr:near
+
+ extrn Alloc_error:near
+
+;* If we cannot allocate enough memory for the transient or there
+; was some other allocation error, we display a message and
+; then die.
+
+;SR;
+; We will have to make sure that at this entry point and at FatalC,
+;ds = DATARES. All jumps to these points are made from only within this file
+;and so we should be able to do this
+
+ assume ds:DATARES
+BadMemErr:
+ mov dx,offset DATARES:BMemMes ; DX = ptr to msg
+FatalC:
+
+;; push cs
+;; pop ds
+;; assume ds:ResGroup
+ invoke RPrint
+
+; If this is NOT a permanent (top-level) COMMAND, then we exit;
+; we can't do anything else!
+
+ cmp PermCom,0
+ je FatalRet
+
+; We are a permanent command. If we are in the process of the
+; magic interrupt (Singlecom) then exit too.
+
+ cmp SingleCom,0 ; if permcom and singlecom
+ jne FatalRet ; must take int_2e exit
+
+; Permanent command. We can't do ANYthing except halt.
+
+ mov dx,offset DATARES:HaltMes ; DX = ptr to msg
+ invoke RPrint
+ sti
+Stall:
+ jmp Stall ; crash the system nicely
+
+FatalRet:
+ mov dx,offset DATARES:FRetMes ; DX = ptr to msg
+ invoke RPrint
+FatalRet2:
+ cmp PermCom,0 ; if we get here and permcom,
+ jne Ret_2e ; must be int_2e
+
+; Bugbug: this is where we'd want to unhook int 2F, *if* we
+; were a non-permanent COMMAND that had hooked it! (Just in
+; case we decide to do that.)
+ mov ax,Parent
+ mov word ptr ds:Pdb_Parent_Pid,ax
+ mov ax,word ptr OldTerm
+ mov word ptr ds:Pdb_Exit,ax
+ mov ax,word ptr OldTerm+2
+ mov word ptr ds:Pdb_Exit+2,ax
+ mov ax,(EXIT shl 8) ; return to lower level
+ int 21h
+
+Ret_2e:
+;SR;
+; We will ensure that ds = DATARES for all entries to this place
+;
+
+;; push cs
+;; pop ds
+;; assume ds:resgroup,es:nothing,ss:nothing
+
+ assume ds:DATARES
+
+ mov SingleCom,0 ; turn off singlecom
+ mov es,Res_Tpa
+ mov ah,DEALLOC
+ int 21h ; free up space used by transient
+ mov bx,Save_Pdb
+ mov ah,SET_CURRENT_PDB
+ int 21h ; current process is user
+ mov ax,RetCode
+ cmp ExtCom,0
+ jne GotECode
+ xor ax,ax ; internals always return 0
+GotECode:
+ mov ExtCom,1 ; force external
+
+;SR; This is actually returning to the caller. However, the old code had
+;ds = RESGROUP so I guess we can keep ds = DATARES for us.
+;Yes, int 2eh can corrupt all registers so we are ok.
+;
+ jmp Int_2e_Ret ;"iret"
+
+
+
+
+;*** Int_2e, magic command executer
+
+Int_2e:
+ assume ds:NOTHING,es:NOTHING,ss:NOTHING
+;SR;
+; We are going to come here from the stub with the old ds and DATARES value
+;pushed on the stack in that order. Pick up this stuff off the stack
+;
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+ pop ax
+; pop ds:OldDS ;Save old value of ds
+
+ pop word ptr Int_2e_Ret
+ pop word ptr [Int_2e_Ret+2] ; store return address
+ ;pop ax ; chuck flags
+ add sp,2
+
+;; push cs
+;; pop es
+
+ push ds
+ pop es ;es = DATARES
+; mov ds,OldDS
+ mov ds,ax
+ assume ds:nothing ;ds = old value
+
+ mov di,80h
+ mov cx,64
+; Bugbug: cld
+ rep movsw
+ mov ah,GET_CURRENT_PDB
+ int 21h ; get user's header
+ mov es:Save_Pdb,bx
+ mov ah,SET_CURRENT_PDB
+
+;; mov bx,cs
+;SR;
+; Set ds = DATARES because BadMemErr expects this
+;
+ push es
+ pop ds
+ assume ds:DATARES
+
+ mov bx,ds ;es = our PSP now
+
+ int 21h ; current process is me
+ mov SingleCom,81h
+ mov ExtCom,1 ; make sure this case forced
+
+;SR;
+; We can enter LodCom directly after a command shell is terminated or we
+;can fall thru from above. When we enter directly from the stub, the stack
+;has the old ds value and the data seg value on the stack, so that ds can
+;be properly set. To fake this, we push dummy values here.
+;
+ push ds ;old value of ds
+ push ds ;data seg value, ds = DATARES
+
+LodCom: ; termination handler
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+ add sp,2
+; pop OldDS ;store old ds
+
+ cmp ExtCom,0
+ jne @f ; internal cmd - memory allocated
+ jmp LodCom1
+@@:
+ mov bx,0FFFFh
+ mov ah,ALLOC
+ int 21h
+ call SetSize
+ add ax,20h
+ cmp bx,ax
+ jnc MemOk ; > 512 byte buffer - good enough
+BadMemErrJ:
+ jmp BadMemErr ; not enough memory
+
+
+
+
+;*** SetSize - get transient size in paragraphs
+
+SetSize proc
+ assume ds:NOTHING,es:NOTHING
+ mov ax,offset TRANGROUP:TranSpaceEnd + 15
+ mov cl,4
+ shr ax,cl
+ ret
+SetSize endp
+
+
+
+
+MemOk:
+ assume ds:DATARES ;we have set ds = DATARES
+
+ mov ah,ALLOC
+ int 21h
+ jc BadMemErrJ ; memory arenas probably trashed
+ mov ExtCom,0 ; flag not to alloc again
+ mov Res_Tpa,ax ; save current tpa segment
+ and ax, 0F000h
+ add ax, 01000h ; round up to next 64k boundary
+ jc Bad_Tpa ; memory wrap if carry set
+
+; Make sure that new boundary is within allocated range
+
+ mov dx,Res_Tpa
+ add dx,bx ; compute maximum address
+ cmp dx,ax ; is 64k address out of range?
+ jbe Bad_Tpa
+
+; Must have 64K of usable space.
+
+ sub dx,ax ; compute the usable space
+ cmp dx,01000h ; is space >= 64k ?
+ jae LTpaSet
+Bad_Tpa:
+ mov ax,Res_Tpa
+LTpaSet:
+ mov LTpa,ax ; usable tpa is 64k buffer aligned
+ mov ax,Res_Tpa ; actual tpa is buffer allocated
+ add bx,ax
+ mov MemSiz,bx
+ call SetSize
+ sub bx,ax
+;
+;M038; Start of changes
+; Changes for Novell RPL. These guys reserve memory for themselves by
+;reducing int 12h size and add this memory to the system at autoexec time by
+;running a program that changes arenas. This changes the largest block that
+;command.com gets and so changes the transient segment. So, command.com does
+;a checksum at the wrong address and thinks that the transient is destroyed
+;and tries to reload it. At this point, no Comspec is defined and so the
+;reload fails, hanging the system. To get around this we just copy the
+;transient from the previous address to the new address(if changed) and
+;then let command.com do the checksum. So, if the transient area is not
+;corrupted, there will not be any reload. In Novell's case, the transient
+;is not really corrupted and so this should work.
+;
+ cmp bx,TrnSeg ;Segment still the same?
+ je LodCom1 ;yes, dont copy
+;
+;Check if the new segment is above or below the current move. If the new
+;segment is above(i.e new block is larger than previous block), then we
+;have to move in the reverse direction
+;
+ mov cx,offset TRANGROUP:TranSpaceEnd ;cx = length to move
+ ja mov_down ;new seg > old seg, reverse move
+ xor si,si ;normal move
+ mov di,si
+ cld
+ jmp short copy_trans
+mov_down:
+ mov si,cx ;reverse move, start from end
+ dec si
+ mov di,si
+ std
+copy_trans:
+ push ds
+ push es
+ mov es,bx ;dest segment
+ mov ds,TrnSeg ;source segment
+ assume ds:nothing
+
+ rep movsb ;copy transient
+ cld
+ pop es
+ pop ds
+ assume ds:DATARES
+;
+;M038; End of changes
+;
+
+ mov TrnSeg,bx ;new location of transient
+LodCom1:
+;; mov ax,cs
+;; mov ss,ax
+;SR; At this point ds = DATARES which is where the stack is located
+;
+ mov ax,ds
+ mov ss,ax
+ assume ss:DATARES
+ mov sp,offset DATARES:RStack
+
+;; mov ds,ax
+
+ assume ds:DATARES
+ call HeadFix ; close files, restore stdin, stdout
+ xor bp,bp ; flag command ok
+ mov ax,-1
+ xchg ax,VerVal
+ cmp ax,-1
+ je NoSetVer
+ mov ah,SET_VERIFY_ON_WRITE ; AL has correct value
+ int 21h
+NoSetVer:
+ cmp SingleCom,-1
+ jne NoSng
+ jmp FatalRet2 ; we have finished the single command
+NoSng:
+ call ChkSum ; check the transient
+ cmp dx,Sum
+ je HavCom ; transient ok
+Bogus_Com:
+ mov Loading,1 ; flag DskErr routine
+ call LoadCom
+ChkSame:
+
+ call ChkSum
+ cmp dx,Sum
+ jz HavCom ; same command
+Also_Bogus:
+ call WrongCom
+ jmp short ChkSame
+HavCom:
+ mov Loading,0 ; flag to DskErr
+ mov si,offset DATARES:TranVars
+ mov di,offset TRANGROUP:HeadCall
+ mov es,TrnSeg
+ cld
+ mov cx,offset DATARES:TranVarEnd
+ sub cx,si
+ rep movsb ; transfer info to transient
+ mov ax,MemSiz
+ mov word ptr ds:Pdb_Block_Len,ax ; adjust my own header
+
+;*** TJmp - jump-off to transient
+;
+; Public label so debugger can find this spot.
+
+TJmp:
+ jmp Trans
+
+
+
+
+;*** TRemCheck - far version of RemCheck for transient
+
+TRemCheck proc far
+
+ pop ds ;ds = DATARES
+ add sp,2 ;discard old value of ds
+
+ call RemCheck
+ ret
+
+TRemCheck endp
+
+
+
+
+;*** RemCheck
+;
+; ENTRY AL = drive (0=default, 1=A, ...)
+;
+; EXIT ZR set if removeable media
+; ZR clear if fixed media
+;
+; USED none
+
+RemCheck:
+ savereg <ax,bx>
+ mov bx,ax
+ mov ax,(IOCTL shl 8) + 8
+ int 21h
+ jnc rcCont
+
+; If an error occurred, assume the media is non-removable.
+; AX contains the non-zero error code from the int 21, so
+; 'or ax,ax; sets non-zero. This behavior makes network drives
+; appear to be non-removable.
+
+ or ax,ax
+ jmp short ResRegs
+rcCont:
+ and ax,1
+ not ax
+ResRegs:
+ restorereg <bx,ax>
+ ret
+
+
+
+
+;*** THeadFix
+;
+; Far version of HeadFix, called from transient.
+
+THeadFix proc far
+ pop ds ;ds = DATARES
+ add sp,2 ;discard old ds value on stack
+
+ call HeadFix
+ ret
+
+THeadFix endp
+
+
+
+
+;*** HeadFix
+
+HeadFix:
+ call SetVect ; set vectors to our values
+
+; Clean up header
+
+; Bugbug: optimize:
+; mov word ptr ds:Pdb_Jfn_Table,cx instead of separate bytes
+
+ xor bx,bx ; BX = handle = 0
+ mov cx,Io_Save ; CX = original stdin, stdout
+ mov dx,word ptr ds:Pdb_Jfn_Table ; DX = current stdin, stdout
+ cmp cl,dl
+ je Chk1 ; stdin matches
+ mov ah,CLOSE
+ int 21h ; close stdin
+ mov ds:Pdb_Jfn_Table,cl ; restore stdin
+Chk1:
+ inc bx ; BX = handle = 1
+ cmp ch,dh
+ je ChkStderr ; stdout matches
+ mov ah,CLOSE
+ int 21h ; close stdout
+ mov ds:Pdb_Jfn_Table+1,ch ; restore stdout
+
+ChkStderr:
+ inc bx ; BX = handle = 2
+ mov dl,byte ptr ds:[Pdb_Jfn_Table+2] ; Dl = current stderr
+ mov cl,Io_Stderr ; Cl = original stderr
+ cmp dl,cl
+ je ChkOtherHand ; stderr matches
+ mov ah,CLOSE
+ int 21h ; close stderr
+ mov ds:Pdb_Jfn_Table+2,cl ; restore stderr
+
+ChkOtherHand:
+ add bx,3 ; skip handles 3,4
+ mov cx,FILPERPROC - 5 ; CX = # handles to close
+ ; (handles 0-4 already done)
+;; williamh: March 30, 1993, don't close invalid handle , save some time
+ push si
+ mov si, pdb_jfn_table ;go to the handle table
+CloseLoop:
+ cmp byte ptr [bx][si], 0ffh
+ je Skip_this_handle
+ mov ah,CLOSE
+ int 21h ; close each handle
+Skip_this_handle:
+ inc bx
+ loop CloseLoop
+ pop si
+; Bugbug: since this is for transient code, move it there
+
+; M012: remove this CS -> DS. Must've been missed during
+; purification.
+;; push ds ; save data segment
+;; push cs ; get local segment into DS
+;; pop ds ;
+ cmp Append_Flag,-1 ; do we need to reset APPEND?
+ jne Append_Fix_End ; no - just exit
+ mov ax,AppendSetState ; set the state of Append
+ mov bx,Append_State ; back to the original state
+ int 2Fh ;
+ mov Append_Flag,0 ; set append flag to invalid
+Append_Fix_End: ;
+;; pop ds ; get data segment back
+ ret
+
+
+
+
+;*** SavHand - save current program's stdin/out & set to our stderr
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED flags
+;
+; EFFECTS
+; Handle01 = current program's stdin,stdout JFN entries
+; current program's stdin,stdout set to our stderr
+;
+
+;SR;
+; Changed ds = DATARES. We need it to access our JFN_Table
+; Called from ContC ( ds = DATARES ) and DskErr ( ds = DATARES ).
+;
+SavHand proc
+
+ assume ds:DATARES,es:NOTHING,ss:NOTHING
+
+ push bx ;preserve registers
+ push ax
+ push es
+ push ds ; save DATARES value
+
+ mov ah,GET_CURRENT_PDB
+ int 21h ; BX = user's header seg addr
+ mov ds,bx ; DS = user's header seg addr
+ lds bx,ds:PDB_JFN_POINTER ; DS:BX = ptr to JFN table
+ mov ax,word ptr ds:[bx] ; AX = stdin,stdout JFN's
+
+ pop es ;es = DATARES
+ push es ;save it back on stack
+ mov es:Handle01,ax ; save user's stdin, stdout
+
+;SR;
+; Use es to address Handle01 & our JFN_Table
+;
+
+ mov al,es:[PDB_JFN_TABLE+2] ; AL = COMMAND stderr
+ mov ah,al ; AH = COMMAND stderr
+ mov word ptr ds:[bx],ax ; set user's stdin/out to our stderr
+
+ pop ds ; restore registers
+ pop es
+ pop ax
+ pop bx
+ ret
+
+SavHand endp
+
+
+
+
+ assume ds:DATARES
+
+GetComDsk2:
+ call GetComDsk
+ jmp LodCom1 ; memory already allocated
+
+RestHand:
+ push ds
+ push bx ; restore stdin, stdout to user
+ push ax
+ mov ah,GET_CURRENT_PDB
+ int 21h ; point to user's header
+ mov ax,Handle01
+ mov ds,bx
+ assume ds:NOTHING
+ lds bx,ds:Pdb_Jfn_Pointer ; DS:BX = ptr to jfn table
+ mov word ptr ds:[bx],ax ; stuff his old 0 and 1
+ pop ax
+ pop bx
+ pop ds
+ ret
+
+
+
+
+ assume ds:DATARES,ss:DATARES
+
+Hopeless:
+ mov dx,offset DATARES:ComBad
+ jmp FatalC
+
+GetComDsk:
+ mov al,ComDrv
+ call RemCheck
+ jnz Hopeless ; non-removable media
+GetComDsk3:
+ cmp dx,offset DATARES:ComBad
+ jnz GetComDsk4
+ mov dx,offset DATARES:ComBad ; DX = ptr to msg
+ invoke RPrint ; say COMMAND is invalid
+GetComDsk4:
+; Bugbug: there's always a drive here? No need to check?
+ cmp PutBackDrv,0 ; is there a drive in the comspec?
+ jnz Users_Drive ; yes - use it
+ mov ah,GET_DEFAULT_DRIVE ; use default drive
+ int 21h
+ add al,"A" ; convert to ascii
+ mov PutBackDrv,al ; put in message to print out
+
+Users_Drive:
+ mov dx,offset DATARES:PutBackMsg ; prompt for diskette
+ mov si,offset DATARES:PutBackSubst ; containing COMMAND
+ invoke RPrint
+ mov dx,offset DATARES:Prompt ; "Press any key"
+ invoke RPrint
+ call GetRawFlushedByte
+ ret
+
+
+
+
+;*** GetRawFlushedByte - flush world and get raw input
+
+GetRawFlushedByte:
+ mov ax,(STD_CON_INPUT_FLUSH shl 8) or RAW_CON_INPUT
+ int 21h ; get char without testing or echo
+ mov ax,(STD_CON_INPUT_FLUSH shl 8) + 0
+ int 21h
+; Bugbug: get rid of this return and the following retz.
+ return
+
+
+
+
+;*** LoadCom - load in transient
+
+LoadCom:
+ inc bp ; flag command read
+ mov dx,offset DATARES:ComSpec
+ mov ax,OPEN shl 8
+ int 21h ; open command.com
+ jnc ReadCom
+ cmp ax,ERROR_TOO_MANY_OPEN_FILES
+ jnz TryDoOpen
+ mov dx,offset DATARES:NoHandMes
+ jmp FatalC ; will never find a handle
+
+TryDoOpen:
+ call GetComDsk
+ jmp LoadCom
+
+ReadCom:
+ mov bx,ax ; BX = handle
+ mov dx,offset RESGROUP:TranStart
+ xor cx,cx ; CX:DX = seek loc
+ mov ax,LSEEK shl 8
+ int 21h
+ jc WrongCom1
+ mov cx,offset TRANGROUP:TranSpaceEnd - 100h
+
+ push ds
+ mov ds,TrnSeg
+ assume ds:NOTHING
+ mov dx,100h
+ mov ah,READ
+ int 21h
+ pop ds
+ assume ds:DATARES
+WrongCom1:
+ pushf
+ push ax
+ mov ah,CLOSE
+ int 21h ; close command.com
+ pop ax
+ popf
+ jc WrongCom ; error on read
+ cmp ax,cx
+ retz ; size matched
+WrongCom:
+ mov dx,offset DATARES:ComBad
+ call GetComDsk
+ jmp LoadCom ; try again
+
+
+
+;*** ChkSum - compute transient checksum
+
+ChkSum:
+ push ds
+ mov ds,TrnSeg
+ mov si,100h
+ mov cx,offset TRANGROUP:TranDataEnd - 100H
+
+Check_Sum:
+ cld
+ shr cx,1
+ xor dx,dx
+Chk:
+ lodsw
+ add dx,ax
+ adc dx,0
+ loop Chk
+ pop ds
+ ret
+
+
+
+
+;*** SetVect - set interrupt vectors
+
+SetVect:
+ mov dx,offset DATARES:LodCom_Trap
+ mov ax,(SET_INTERRUPT_VECTOR shl 8) or 22h
+ mov word ptr ds:Pdb_Exit,dx
+ mov word ptr ds:Pdb_Exit+2,ds
+ int 21h
+ mov dx,offset DATARES:Ctrlc_Trap
+ inc al
+ int 21h
+ mov dx,offset DATARES:CritErr_Trap
+ inc al
+ int 21h
+ ret
+
+;SR;
+; We have this to take care of the extra values pushed on the stack by
+;the stub before jumping to LodCom1. We set up ds here and then jump to
+;Lodcom1
+;
+public TrnLodCom1
+TrnLodCom1:
+ pop ds ;ds = DATARES
+ add sp,2
+; pop ds:OldDS
+ jmp LodCom1
+
+
+
+
+;*** EndInit - end up initialization sequence
+;
+; Move the environment to a newly allocated segment.
+
+;;EndInit:
+;; push ds ; save segments
+;; push es ;
+;; push cs ; get resident segment to DS
+;; pop ds ;
+;; assume ds:RESGROUP
+;; mov cx,UsedEnv ; get number of bytes to move
+;; mov es,EnvirSeg ; get target environment segment
+;; assume es:NOTHING
+;;
+;; mov ds:Pdb_Environ,es ; put new environment in my header
+;; mov ds,OldEnv ; source environment segment
+;; assume ds:NOTHING
+;; xor si,si ; set up offsets to start of segments
+;; xor di,di
+;; cld
+;; rep movsb ; move it
+;; xor ax,ax
+;; stosb ; make sure it ends with double-null
+;;
+;; cmp ResetEnv,1 ; do we need to setblock to env end?
+;; jne NoReset ; no - we already did it
+;; mov bx,EnvSiz ; BX = size of environ in paragraphs
+;; push es ; save environment - just to be sure
+;; mov ah,SETBLOCK ;
+;; int 21h
+;; pop es
+;;
+;;NoReset:
+;; mov InitFlag,FALSE ; turn off init flag
+;; pop es
+;; pop ds
+;; jmp LodCom ; allocate transient
+
+;
+;The init code has been changed to take care of the new way in which the
+;environment segment is allocated.
+;NB: We can use all the init variables at this point because they are all in
+;RESGROUP
+;Bugbug: The above approach will not work for ROMDOS
+;
+
+IF 0
+
+EndInit:
+ push ds
+ push es ;save segments
+ push cs
+ pop ds
+ assume ds:RESGROUP
+;
+;Chuckenv flag signals whether it is a passed environment or not
+;
+ mov bx,ds
+ mov es,bx ;es = RESGROUP
+;
+;ResSize is the actual size to be retained -- only data for HIMEM COMMAND,
+; code + data for low COMMAND
+;
+ mov bx,ResSize ;Total size of resident
+ mov ah,SETBLOCK
+ int 21h ;Set block to resident size
+;
+;Allocate the correct size for the environment
+;
+ mov bx,EnvSiz ;bx = env size in paras
+ mov ah,ALLOC
+ int 21h ;get memory
+ jc nomem_err ;out of memory,signal error
+
+ mov EnvirSeg,ax ;Store new environment segment
+ mov ds:PDB_Environ,ax ;Put new env seg in PSP
+ mov es,ax ;es = address of allocated memory
+ assume es:nothing
+
+;
+;Copy the environment to the newly allocated segment
+;
+ mov cx,UsedEnv ;number of bytes to move
+
+ push ds
+ mov ds,OldEnv ;ds = Old environment segment
+ assume ds:nothing
+
+ xor si,si
+ mov di,si ;Start transfer from 0
+
+ cld
+ rep movsb ;Do the copy
+
+ xor ax,ax
+ stosb ;Make it end with double-null
+
+ pop ds ;ds = RESGROUP
+ assume ds:RESGROUP
+;
+;We have to free the old environment block if it was allocated by INIT
+;
+ cmp Chuckenv,0 ;has env been allocated by INIT?
+ jne no_free ;no, do not free it
+
+ mov ax,OldEnv ;Get old environment
+ mov es,ax
+ mov ah,DEALLOC
+ int 21h ;Free it
+no_free:
+ mov InitFlag,FALSE ;indicate INIT is done
+
+ pop es
+ pop ds
+ assume ds:nothing
+
+ jmp LodCom ;allocate transient
+
+nomem_err:
+;
+;We call the error routine which will never return. It will either exit
+;with an error ( if not the first COMMAND ) or just hang after an error
+;message ( if first COMMAND )
+;
+
+ call Alloc_error
+ENDIF
+
+CODERES ends
+
+
+
+; This TAIL segment is used to produce a PARA aligned label in
+; the resident group which is the location where the transient
+; segments will be loaded initial.
+
+TAIL segment public para
+
+ org 0
+TranStart label word
+ public TranStart
+
+TAIL ends
+
+
+
+; This TAIL segment is used to produce a PARA aligned label in
+; the transient group which is the location where the exec
+; segments will be loaded initial.
+;
+; Bugbug: Is TRANTAIL used anymore?
+
+TRANTAIL segment public para
+
+ org 0
+ExecStart label word
+
+TRANTAIL ends
+
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/comseg.asm b/private/mvdm/dos/v86/cmd/command/comseg.asm
new file mode 100644
index 000000000..bb2255464
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/comseg.asm
@@ -0,0 +1,61 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; The following are all of the segments used in the load order
+;
+;SR; We switch the order of the CODE and DATA segments since we will have to
+;move the CODE segment for HIMEM COMMAND
+;
+
+
+DATARES segment public byte ; resident data
+DATARES ends
+
+;
+;Dummy segment to align the code segment on a paragraph boundary
+;
+DUMMY segment public para
+DUMMY ENDS
+
+CODERES segment public byte ; resident code
+CODERES ends
+
+;SR;
+;No environment segments
+;
+;;ENVARENA segment public para ; space for DOS ALLOCATE header
+;;ENVARENA ends
+
+;;ENVIRONMENT segment public para ; default COMMAND environment
+;;ENVIRONMENT ends
+
+INIT segment public para ; initialization code
+INIT ends
+
+TAIL segment public para ; end of init - start of transient
+TAIL ends
+
+TRANCODE segment public byte ; transient code
+TRANCODE ends
+
+TRANDATA segment public byte ; transient data area
+TRANDATA ends
+
+TRANSPACE segment public byte ; transient modifiable data area
+TRANSPACE ends
+
+TRANTAIL segment public para ; end of transient
+TRANTAIL ends
+
+;SR;
+; We still keep the CODE and DATA in a group. This is to make addressability
+;easy during init. This will not work for COMMAND in ROM but it is fine for
+;HIMEM COMMAND. However, the resident code will not refer to any data using
+;RESGROUP
+;
+
+RESGROUP group CODERES,DATARES,INIT,TAIL
+TRANGROUP group TRANCODE,TRANDATA,TRANSPACE,TRANTAIL
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/comsw.asm b/private/mvdm/dos/v86/cmd/command/comsw.asm
new file mode 100644
index 000000000..150d207ff
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/comsw.asm
@@ -0,0 +1,11 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)comsw.asm 1.1 85/05/14
+; SCCSID = @(#)comsw.asm 1.1 85/05/14
+
+include version.inc
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/copy.asm b/private/mvdm/dos/v86/cmd/command/copy.asm
new file mode 100644
index 000000000..df33faadf
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/copy.asm
@@ -0,0 +1,1093 @@
+ page ,132
+ title COMMAND COPY routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+comment % -----------------------------------------------------------------
+
+;*** COPY.ASM
+
+Source files: copy.asm, copypr1.asm, copypr2.asm
+
+
+;*** MODIFICATION HISTORY
+
+11/01/83 EE Added a few lines at the end of SCANSRC2 to get multiple
+ file concatenations (eg copy a.*+b.*+c.*) to work properly.
+11/02/83 EE Commented out the code in CPARSE which added drive designators
+ to tokens which begin with path characters so that PARSELINE
+ will work correctly.
+11/04/83 EE Commented out the code in CPARSE that considered paren's to be
+ individual tokens. That distinction is no longer needed for
+ FOR loop processing.
+11/17/83 EE CPARSE upper case conversion is now flag dependent. Flag is
+ 1 when Cparse is called from COPY.
+11/17/83 EE Took out the comment chars around code described in 11/04/83
+ mod. It now is conditional on flag like previous mod.
+11/21/83 NP Added printf
+12/09/83 EE CPARSE changed to use CPYFLAG to determine when a colon should
+ be added to a token.
+05/30/84 MZ Initialize all copy variables. Fix confusion with destclosed
+ NOTE: DestHand is the destination handle. There are two
+ special values: -1 meaning destination was never opened and
+ 0 which means that the destination has been openned and
+ closed.
+06/01/84 MZ Above reasoning totally specious. Returned things to normal
+06/06/86 EG Change to fix problem of source switches /a and /b getting
+ lost on large and multiple file (wildcard) copies.
+06/09/86 EG Change to use xnametrans call to verify that source and
+ destination are not equal.
+
+06/24/90 DO If the destination of a file concatenation is the same as
+ first source file AND we run out of disk space before
+ completing the concatenation, restore the first source
+ file as best we can. See SeekEnd and CopErr. Bug #859.
+
+M031 SR 10/11/90 Bug #3069. Use deny write sharing mode to open files
+ instead of compatibility mode. This gives lesser sharing
+ violations when files are opened for read on a copy.
+
+% -------------------------------------------------------------------------
+
+ .xlist
+ .xcref
+
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include sf.inc
+ include comseg.asm
+ include comequ.asm
+ .list
+ .cref
+
+
+DATARES segment public byte
+ extrn VerVal:word
+DATARES ends
+
+TRANDATA segment public byte
+ extrn BadCd_Ptr:word
+ extrn Copied_Ptr:word
+ extrn Extend_Buf_Ptr:word
+ extrn Extend_Buf_Sub:byte
+ extrn File_Name_Ptr:word
+ extrn InBDev_Ptr:word
+ extrn Msg_Disp_Class:byte
+ extrn Overwr_Ptr:word
+TRANDATA ends
+
+TRANSPACE segment public byte
+ extrn AllSwitch:word
+ extrn ArgC:byte
+ extrn Ascii:byte
+ extrn Binary:byte
+ extrn BytCnt:word
+ extrn CFlag:byte
+ extrn Comma:byte
+ extrn Concat:byte
+ extrn Copy_Num:word
+ extrn CpDate:word
+ extrn CpTime:word
+ extrn CpyFlag:byte
+ extrn CurDrv:byte
+ extrn DestBuf:byte
+ extrn DestClosed:byte
+ extrn DestFcb:byte
+ extrn DestFcb2:byte
+ extrn DestHand:word
+ extrn DestInfo:byte
+ extrn DestIsDir:byte
+ extrn DestSiz:byte
+ extrn DestSwitch:word
+ extrn DestTail:word
+ extrn DestVars:byte
+ extrn DirBuf:byte
+ extrn Expand_Star:byte
+ extrn FileCnt:word
+ extrn FirstDest:byte
+ extrn FrstSrch:byte
+ extrn Inexact:byte
+ extrn MelCopy:byte
+ extrn MelStart:word
+ extrn Msg_Flag:byte
+ extrn NoWrite:byte
+ extrn NxtAdd:word
+ extrn ObjCnt:byte
+ extrn OCtrlZ:byte
+ extrn OFilePtr_Hi:word
+ extrn OFilePtr_Lo:word
+ extrn One_Char_Val:byte
+ extrn Parse_Last:word
+ extrn Plus:byte
+ extrn Plus_Comma:byte
+ extrn RdEof:byte
+ extrn ResSeg:word
+ extrn ScanBuf:byte
+ extrn SDirBuf:byte
+ extrn SrcBuf:byte
+ extrn SrcHand:word
+ extrn SrcInfo:byte
+ extrn SrcIsDev:byte
+ extrn SrcPt:word
+ extrn SrcSiz:byte
+ extrn SrcTail:word
+ extrn SrcVars:byte
+ extrn SrcXName:byte
+ extrn StartEl:word
+ extrn String_Ptr_2:word
+ extrn TermRead:byte
+ extrn Tpa:word
+ extrn UserDir1:byte
+ extrn Written:word
+TRANSPACE ends
+
+
+
+
+;*** COPY CODE
+
+TRANCODE segment public byte
+
+ extrn CError:near
+ extrn CopErr:near
+ extrn TCommand:near
+
+ public Copy
+
+ assume cs:TRANGROUP,ds:TRANGROUP,es:TRANGROUP,ss:NOTHING
+
+ break Copy
+
+Copy:
+ assume ds:TRANGROUP,es:TRANGROUP
+
+; Initialize internal variables.
+
+ xor ax,ax ; AX = 0
+ mov Copy_Num,ax ; # files copied (destinations) = 0
+ mov SrcPt,ax ; cmd line ptr for source scan = 0
+ mov SrcTail,ax ; ptr to last element of source pathname = 0
+ mov CFlag,al ; 'destination file created' = false
+ mov NxtAdd,ax ; ptr into TPA buffer = 0
+ mov DestSwitch,ax ; destination switches = none
+ mov StartEl,ax ; CParse ptr to last pathname element = 0
+ mov DestTail,ax ; ptr to last element of dest pathname = 0
+ mov DestClosed,al ; 'destination file closed' = false
+ mov DestSiz,al ; length of destination pathname = 0
+ mov SrcSiz,al ; length of source pathname = 0
+ mov DestInfo,al ; destination pathname flags = none
+ mov SrcInfo,al ; source pathname flags = none
+ mov Inexact,al ; 'inexact copy' = false
+ mov DestVars,al ; 'dest pathname is directory' = false
+ mov SrcVars,al ; 'source pathname is directory' = false
+ mov UserDir1,al ; saved working directory = null
+ mov NoWrite,al ; 'no write' (source = dest) = false
+ mov RdEof,al ; 'read end of file' = false
+ mov SrcHand,ax ; source handle = 0
+ mov CpDate,ax ; copy date = 0
+ mov CpTime,ax ; copy time = 0
+ mov SrcIsDev,al ; 'source is device' = false
+ mov OCtrlZ,al ; 'Ctrl+Z removed from original' = false
+ mov OFilePtr_Lo,ax
+ mov OFilePtr_Hi,ax ; original destination file ptr = null
+ mov TermRead,al ; 'terminate read' = false
+ mov Comma,al ; '"+,," found' = false
+ mov Plus_Comma,al ; '"+,," found last time' = false (?)
+ mov Msg_Flag,al ;AN022; 'non-utility msg issued' = false
+ mov AllSwitch,ax ; all switches = none
+ mov ArgC,al ; source/dest argument count = 0
+ mov Plus,al ; '"+" in command line' = false
+ mov Binary,al ; 'binary copy' = false
+ mov Ascii,al ; 'ascii copy' = false
+ mov FileCnt,ax ; # files copied (destinations) = 0
+ mov Written,ax ; 'destination written to' = false
+ mov Concat,al ; 'concatenating' = false
+ mov MelCopy,al ; 'Mel Hallerman copy' = false
+ mov MelStart,ax ; Mel Hallerman cmd line ptr = 0
+
+; Initialize buffers with double-nulls.
+
+ mov word ptr ScanBuf,ax
+ mov word ptr DestBuf,ax
+ mov word ptr SrcBuf,ax
+ mov word ptr SDirBuf,ax
+ mov word ptr DirBuf,ax
+ mov word ptr DestFcb,ax
+
+ mov ObjCnt,al ; # CParse cmd-line objects found = 0
+
+ dec ax ; AX = 0FFFFh
+ mov DestHand,ax ; destination handle = 'never opened'
+ mov FrstSrch,al ; 'first search for source' = true
+ mov FirstDest,al ; 'first time for dest' = true
+ mov DestIsDir,al ; 'haven't analyzed destination'
+
+ mov si,81h ; SI = ptr to command line
+ mov bl,PLUS_CHR ; BL = special delimiter = "+"
+ inc Expand_Star ; CParse 'expand * to ?s' = true
+ mov CpyFlag,1 ; CParse 'called from COPY' = true
+
+
+;* Scan the command line for destination information.
+
+DestScan:
+ xor bp,bp ; BP = switch flag accumulator
+ mov di,offset TRANGROUP:ScanBuf ; ES:DI = ptr to pathname buf
+ mov Parse_Last,si ;AN018; save cmd line ptr
+ invoke CParse ; parse next object
+ pushf ; save CParse flags
+ inc ObjCnt ; count object
+
+ test bh,80h
+ jz @f ; no "+" delimiter
+ mov Plus,1 ; "+" delimiter occurred
+@@:
+ test bh,1
+ jz TestP2 ; not a switch
+
+; Found a switch.
+
+ test bp,SwitchV ;AN038; Verify requested?
+ jz Not_SlashV ;AN038; No - set the switch
+ test AllSwitch,SwitchV ;AN038; Verify already entered?
+ jz Not_SlashV ;AN038; No - set the switch
+;AD018; or AllSwitch,FBadSwitch ;AN038; Set up bad switch
+ or bp,FBadSwitch ;AN018; Set up bad switch
+
+Not_SlashV: ;AN038;
+ or DestSwitch,bp ; assume destination
+ or AllSwitch,bp ; keep tabs on all switches
+
+ test bp,not SwitchCopy ;AN018; Bad switch?
+ jz Not_Bad_Switch ;AN018; Switches are okay
+ popf ;AN018; fix up stack
+ mov ax,BadSwt_ptr ;AN018; get "Invalid switch" message number
+ invoke Setup_Parse_Error_Msg ;AN018; setup to print the message
+ jmp CError ;AC018; exit
+
+Not_Bad_Switch: ;AN018; switch okay
+ popf ; restore CParse flags
+ jc CheckDone ; found CR
+ jmp short DestScan ; continue scanning for destination
+
+TestP2:
+ popf ; restore CParse flags
+ jc CheckDone ; found CR
+
+ test bh,80h
+ jnz @f ; found a "+pathname" argument
+ inc ArgC ; count independent pathname args
+@@:
+ push si ; save cmd line ptr
+ mov ax,StartEl ; AX = ptr to last path element
+ mov si,offset TRANGROUP:ScanBuf ; SI = ptr to path string
+ sub ax,si ; AX = offset of last element
+ mov di,offset TRANGROUP:DestBuf ; DI = ptr to destination buf
+ add ax,di ; AX = ptr to last element in
+ ; destination path buffer
+ mov DestTail,ax ; save ptr to last element
+ mov DestSiz,cl ; save path string length
+
+ inc cx ; CX = mov length (incl null)
+ rep movsb ; DestBuf = possible destination path
+ mov DestInfo,bh ; save CParse info flags
+ mov DestSwitch,0 ; clear destination switches
+ pop si ; SI = ptr into cmd line again
+ jmp DestScan ;AC018; continue scanning for dest
+
+CheckDone:
+
+; We reached the CR. The destination scan is finished.
+
+; Disallow "copy file1+" as file overwriting itself.
+;
+; (Note that "copy file1+file2+" will be accepted, and
+; equivalent to "copy file1+file2".)
+
+; Bugbug: it looks like "copy /x file1+" would slip
+; through this check, since the switch would count
+; as another object in ObjCnt.
+
+ cmp Plus,1 ; "+" with
+ jne cdCont
+ cmp ArgC,1 ; one arg,
+ jne cdCont
+ cmp ObjCnt,2 ; two objects..
+ jne cdCont
+ mov dx,offset TRANGROUP:OverWr_ptr
+ jmp CopErr ; is file overwrite.
+
+cdCont: mov al,Plus ; AL = '"+" occurred'
+ mov Concat,al ; if "+" occurred, we're concatenating
+ shl al,1
+ shl al,1
+ mov Inexact,al ; therefore making an inexact copy
+
+ mov al,ArgC ; AL = # independent arguments
+ or al,al
+ jnz Try_Too_Many ; more than 0 args; check if too many
+
+ mov dx,offset TRANGROUP:Extend_Buf_Ptr ; DX = ptr to msg block
+ mov Extend_Buf_Ptr,LessArgs_Ptr ; set msg # "param missing"
+ jmp short CError_ParseJ ; take parse error exit
+
+Try_Too_Many:
+ cmp al,2
+ jbe ACountOk ; <= 2 arguments - ok
+
+ mov dx,offset TRANGROUP:Extend_Buf_Ptr ; DX = ptr to msg block
+ mov Extend_Buf_Ptr,MoreArgs_Ptr ; set msg # "too many params"
+CError_ParseJ:
+ mov Msg_Disp_Class,PARSE_MSG_CLASS ; parse error message
+CError4J:
+ jmp CError ; command error exit
+
+
+ACountOk:
+ mov bp,offset TRANGROUP:DestVars ; BP = base of dest variables
+
+; Bugbug: use of BP without segment override implies SS.
+; SS is implicitly assumed to point at TRANGROUP.
+
+ cmp al,1
+ jne Got2Args ; we have 2 arguments
+
+; Only one independent pathname argument on command line.
+; Set destination to d:*.*, where d: is current drive.
+
+; Bugbug: but is this appropriate for "copy x:file1+x:file2"?
+; The two files would be appended as d:file1, rather than x:file1.
+
+ mov al,CurDrv ; AL = current drive (0 = A)
+ add al,CAPITAL_A ; AL = current drive letter
+ mov ah,':' ; AX = "d:"
+ mov [bp].siz,2 ; pathname length = 2
+
+ mov di,offset TRANGROUP:DestBuf ; ES:DI = ptr to dest path buf
+ stosw ; store "d:"
+
+ mov DestSwitch,0 ; clear destination switches
+ mov [bp].info,2 ; mark destination 'wildcard present'
+ mov [bp].isdir,0 ; mark destination 'not a directory'
+ invoke SetStars ; add wildcards
+
+Got2Args:
+
+; If destination pathname is "d:", add full wildcard filename
+
+ cmp [bp].siz,2
+ jne NotShortDest ; not two chars, can't be "d:"
+
+ mov al,':'
+ cmp destbuf+1,al
+ jne NotShortDest ; it's just a 2-character filename
+
+ or [bp].info,2 ; mark destination 'wildcard present'
+ mov di,offset TRANGROUP:DestBuf+2
+ ; ES:DI = ptr after "d:"
+ mov [bp].isdir,0 ; mark destination 'not a directory'
+ invoke SetStars ; add wildcards
+
+NotShortDest:
+
+; If destination pathname ends with "\", try to make
+; sure it's "d:\".
+
+ mov di,[bp].ttail ; DI = ptr to last path element
+ cmp byte ptr [di],0
+ jne ChkSwtches ; not a null, so last char not "\"
+
+ mov dx,offset TRANGROUP:BadCD_Ptr ; DX = ptr to msg block
+ mov al,':'
+ cmp byte ptr [di-2],al
+ jne CError4J ; it's not "d:\", exit with error msg
+ mov [bp].isdir,2 ; destination 'is a directory'
+ or [bp].info,6 ; destination wildcarded and contains
+ ; path character
+ invoke SetStars ; add wildcards
+
+ChkSwtches:
+
+;AD018; mov ax,[ALLSWITCH]
+;AD018; test ax,NOT SwitchCopy
+;AD018; jz NOT_BAD_SWITCH ;AN000; Switches are okay
+;AD018; MOV DX,OFFSET TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+;AD018; mov Extend_Buf_ptr,BadSwt_ptr ;AN000; get "Invalid switch" message number
+;AD018; jmp short CERROR_PARSEJ ;AC000; Switch specified which is not known
+;AD018; NOT_BAD_SWITCH:
+
+; We have enough information about the destination for now.
+
+; Turn on verify if requested. Save the current verify flag.
+
+ mov ax,AllSwitch ; AX = all switch flags
+ test ax,SwitchV
+ jz NoVerif ; no /v, no verify
+
+ mov ah,GET_VERIFY_ON_WRITE ; AH = 'Get Verify Flag'
+ int 21h ; call DOS
+
+ push ds
+ mov ds,ResSeg
+ assume ds:RESGROUP
+ xor ah,ah
+ mov VerVal,ax ; save current verify flag
+ pop ds
+ assume ds:TRANGROUP
+ mov ax,(SET_VERIFY_ON_WRITE shl 8) or 1 ; AX = 'Set Verify Flag'
+ int 21h ; call DOS
+
+NoVerif:
+
+;* Scan for first source.
+
+ xor bp,bp ; BP = switch flags accumulator
+ mov si,81h ; SI = ptr into command line
+ mov bl,PLUS_CHR ; BL = special CParse delimiter = "+"
+ScanFSrc:
+ mov di,offset TRANGROUP:ScanBuf ; DI = ptr to pathname buf
+ invoke CParse ; parse first source pathname
+ test bh,1 ; switch?
+ jnz ScanFSrc ; yes, try again
+ or DestSwitch,bp ; include copy-wide switches on dest
+
+; Set ascii copying mode if concatenating, unless /b is specified.
+
+ test bp,SWITCHB
+ jnz NoSetCAsc ; /b - explicit binary copy
+ cmp Concat,0
+ je NoSetCAsc ; we're not concatenating
+ mov Ascii,SWITCHA ; set ascii copy
+NoSetCAsc:
+ call Source_Set ; set source variables
+ call FrstSrc ; set up first source copy
+ jmp FirstEnt ; jump into the copy loop
+
+
+
+
+ public EndCopy
+
+EndCopy:
+
+;* End of the road. Close destination, display # files
+; copied (meaning # destinations), and go back to main
+; transient COMMAND code.
+
+ call CloseDest
+EndCopy2:
+ mov dx,offset TRANGROUP:Copied_Ptr
+ mov si,FileCnt
+ mov Copy_Num,si
+ invoke Std_PrintF
+ jmp TCommand ; stack could be messed up
+
+
+
+
+SrcNonexist:
+
+;* Source doesn't exist. If concatenating, ignore and continue.
+; Otherwise, say 'file not found' and quit.
+
+ cmp Concat,0
+ jne NextSrc ; concatenating - go on to next source
+
+; Set up error message.
+
+ mov Msg_Disp_Class,EXT_MSG_CLASS ; extended error msg
+ mov dx,offset TRANGROUP:Extend_Buf_Ptr ; DX = ptr to msg block
+ mov Extend_Buf_Ptr,ERROR_FILE_NOT_FOUND ; 'file not found' msg#
+ mov String_Ptr_2,offset TRANGROUP:SrcBuf ; point at bad pathname
+ mov Extend_Buf_Sub,ONE_SUBST ; 1 substitution
+
+ jmp CopErr ; print msg and clean up
+
+
+
+
+SourceProc:
+
+;* Preparatory processing for each source file.
+; Called at FrstSrc for first source file.
+
+ call Source_Set ; set source variables & ascii/binary
+ cmp Concat,0
+ jne LeaveCFlag ; concatenating - leave CFlag alone
+FrstSrc:
+ xor ax,ax
+ mov CFlag,al ; 'destination not created'
+ mov NxtAdd,ax ; copy buffer ptr = 0
+ mov DestClosed,al ; 'destination not closed'
+LeaveCFlag:
+ mov SrcPt,si ; save cmd-line ptr
+ mov di,offset TRANGROUP:UserDir1 ; DI = ptr to buf for user's
+ ; current dir
+ mov bp,offset TRANGROUP:SrcVars ; BP = base of source variables
+ invoke BuildPath ; cd to source dir, figure
+ ; out stuff about source
+ mov si,SrcTail ; SI = ptr to source filename
+ return
+
+
+
+
+NextSrc:
+
+;* Next source. Come here after handling each pathname.
+; We're done unless there are additional source pathnames
+; to be appended.
+;
+; Note that all files matching an ambiguous pathname
+; are processed before coming here.
+
+ cmp Plus,0
+ jne MoreCp ; copying "+" sources - keep going
+
+EndCopyJ2:
+ jmp EndCopy ; done copying
+
+MoreCp:
+ xor bp,bp ; BP = switch flags accumulator
+ mov si,SrcPt ; SI = ptr to current pos'n in cmd line
+ mov bl,PLUS_CHR ; BL = special delimiter = "+"
+
+ScanSrc:
+ mov di,offset TRANGROUP:ScanBuf ; DI = ptr to pathname buf
+ invoke CParse ; parse first source name
+ jc EndCopyJ2 ; CR found - we're done
+
+ test bh,80h
+ jz EndCopyJ2 ; no "+" delimiter - we're done
+
+ test bh,1
+ jnz ScanSrc ; switch found - keep looking
+
+; ScanBuf contains the next source pathname.
+
+ call SourceProc ; prepare this source
+ cmp Comma,1 ;g was +,, found last time?
+ jne NoStamp ;g no - try for a file
+ mov Plus_Comma,1 ;g yes - set flag
+ jmp SrcNonexist ;g we know we won't find it
+
+NoStamp: ;g
+ mov Plus_Comma,0 ;g reset +,, flag
+
+FirstEnt:
+;
+;M047
+; The only case we need to worry about is when the source is wildcarded and
+;the destination is not. For this case, ConCat is not yet set to indicate
+;concatenation. We check for this case.
+;
+;NB: This change has been backed out and replaced by M048. This is not the
+;right place to do this check.
+;
+
+; This is where we enter the loop with the first source.
+
+ mov di,FCB ; DI = ptr to FCB
+ mov ax,PARSE_FILE_DESCRIPTOR shl 8 ; 'Parse Filename'
+ int 21h ; call DOS
+
+ cmp byte ptr [si],0 ; did we parse the whole thing?
+ jne SrchDone ; no, error, simulate 'not found'
+
+ mov ax,word ptr SrcBuf ; AX = possible "d:"
+ cmp ah,':'
+ je @f ; AX = definite "d:"
+ mov al,'@' ; AL = drive 'letter' for current drive
+@@:
+ or al,20h ; AL = lowercase drive letter
+ sub al,60h ; AL = drive id (0=current,1=A,..)
+ mov ds:FCB,al ; put drive id in FCB
+
+; FCB contains drive and filename to search.
+
+ mov ah,DIR_SEARCH_FIRST ; AH = 'Find First File'
+ call Search
+
+SrchDone:
+ pushf ; save flags from Search
+ invoke RestUDir1 ; restore users current directory
+ popf ; restore flags from search
+ jz @f ; found the source - continue
+ jmp SrcNonexist ; didn't find the source
+@@:
+ xor al,al
+ xchg al,FrstSrch
+ or al,al
+ jz NextAmbig
+
+SetNMel:
+ mov cx,12
+ mov di,offset TRANGROUP:SDirBuf
+ mov si,offset TRANGROUP:DirBuf
+ rep movsb ; save very first source name
+
+NextAmbig:
+ xor al,al
+ mov NoWrite,al ; turn off nowrite
+ mov di,SrcTail
+ mov si,offset TRANGROUP:DirBuf + 1
+ invoke Fcb_To_Ascz ; SrcBuf has complete name
+
+MelDo:
+ cmp Concat,0
+ jne ShowCpNam ; concatenating - show name
+ test SrcInfo,2 ; wildcard - show name
+ jz DoRead
+
+ShowCpNam:
+ mov dx,offset TRANGROUP:File_Name_Ptr
+ invoke Std_PrintF
+ invoke CrLf2
+
+DoRead:
+ call DoCopy
+ cmp Concat,0
+ jne NoDClose ; concatenating - don't close dest
+
+ call CloseDest ; close current destination
+ jc NoDClose ; concatenating - dest not closed
+
+ mov CFlag,0 ; 'destination not created'
+
+NoDClose:
+ cmp Concat,0
+ je NoFlush ; not concatenating - don't flush
+
+; Concatenating - flush output between source files so LostErr
+; stuff works correctly.
+
+ invoke FlshFil
+ test MelCopy,0FFh
+ jz @f
+ jmp short DoMelCopy
+@@:
+NoFlush:
+ call SearchNext ; try next match
+ jnz NextSrcJ ; not found - finished with
+ ; this source spec
+ mov DestClosed,0 ; 'destination not closed'
+ jmp NextAmbig ; do next ambig match
+
+
+
+
+DoMelCopy:
+ cmp MelCopy,0FFh
+ je ContMel
+ mov si,SrcPt
+ mov MelStart,si
+ mov MelCopy,0FFh
+ContMel:
+ xor bp,bp
+ mov si,SrcPt
+ mov bl,PLUS_CHR
+ScanSrc2:
+ mov di,offset TRANGROUP:ScanBuf
+ invoke CParse
+ test bh,80h
+ jz NextMel ; no "+" - go back to start
+
+ test bh,1
+ jnz ScanSrc2 ; switch - keep scanning
+
+ call SourceProc
+ invoke RestUDir1
+ mov di,offset TRANGROUP:DestFcb2
+ mov ax,PARSE_FILE_DESCRIPTOR shl 8
+ int 21h
+ mov bx,offset TRANGROUP:SDirBuf + 1
+ mov si,offset TRANGROUP:DestFcb2 + 1
+ mov di,SrcTail
+
+ invoke BuildName
+
+ cmp Concat,0
+ je MelDoJ ; not concatenating - continue
+
+; Yes, turn off nowrite because this part of the code
+; is only reached after the first file has been dealt with.
+
+ mov NoWrite,0
+
+MelDoJ:
+ jmp MelDo
+
+NextSrcJ:
+ jmp NextSrc
+
+NextMel:
+ call CloseDest
+ xor ax,ax
+ mov CFlag,al
+ mov NxtAdd,ax
+ mov DestClosed,al
+ mov si,MelStart
+ mov SrcPt,si
+ call SearchNext
+ jz SetNMelJ
+ jmp EndCopy2
+SetNMelJ:
+ jmp SetNMel
+
+
+
+
+SearchNext:
+ mov ah,DIR_SEARCH_NEXT
+ test SrcInfo,2
+ jnz Search ; do search-next if ambig
+ or ah,ah ; reset zero flag
+ return
+
+Search:
+ push ax
+ mov ah,SET_DMA
+ mov dx,offset TRANGROUP:DirBuf
+ int 21h ; put result of search in dirbuf
+ pop ax ; restore search first/next command
+ mov dx,FCB
+ int 21h ; Do the search
+ or al,al
+ return
+
+
+
+
+DoCopy:
+ mov si,offset TRANGROUP:SrcBuf ;g do name translate of source
+ mov di,offset TRANGROUP:SrcXName ;g save for name comparison
+ mov ah,XNAMETRANS ;g
+ int 21h ;g
+
+ mov RdEof,0 ; no EOF yet
+
+ mov ax,EXTOPEN shl 8 ; open the file
+;M046
+; For reads, the sharing mode should be deny none so that any process can
+;open this file again in any other sharing mode. This is mainly to allow
+;multiple command.com's to access the same file without getting sharing
+;violations
+;
+ mov bx,DENY_NONE or READ_OPEN_MODE ; open mode for COPY ;M046
+ xor cx,cx ; no special files
+ mov dx,READ_OPEN_FLAG ; set up open flags
+ int 21h
+
+ jnc OpenOk
+
+; Bogosity: IBM wants us to issue Access Denied in this case.
+; They asked for it...
+
+ jmp short Error_On_Source ;AC022; clean up and exit
+
+OpenOk:
+ mov bx,ax ; save handle
+ mov SrcHand,bx ; save handle
+ mov ax,(FILE_TIMES shl 8)
+ int 21h
+ jc Error_On_Source
+ mov CpDate,dx ; save date
+ mov CpTime,cx ; save time
+ jmp short No_Copy_Xa ; (xa copy code removed)
+
+
+Error_On_Source: ;AN022; we have a BAD error
+ invoke Set_Ext_Error_Msg ;AN022; set up the error message
+ mov String_Ptr_2,offset TRANGROUP:SrcBuf ;AN022; get address of failed string
+ mov Extend_Buf_Sub,ONE_SUBST ;AN022; put number of subst in control block
+ invoke Std_EprintF ;AN022; print it
+ cmp SrcHand,0 ;AN022; did we open the file?
+ je No_Close_Src ;AN022; no - don't close
+ call CloseSrc ;AN022; clean up
+No_Close_Src: ;AN022;
+ cmp CFlag,0 ;AN022; was destination created?
+ je EndCopyJ3 ;AN022; no - just cleanup and exit
+ jmp EndCopy ;AN022; clean up concatenation and exit
+EndCopyJ3: ;AN022;
+ jmp EndCopy2 ;AN022;
+
+No_Copy_Xa:
+ mov bx,SrcHand ;AN022; get handle back
+ mov ax,(IOCTL shl 8)
+ int 21h ; get device stuff
+ and dl,DEVID_ISDEV
+ mov SrcIsDev,dl ; set source info
+ jz CopyLp ; source not a device
+ cmp Binary,0
+ je CopyLp ; ascii device ok
+ mov dx,offset TRANGROUP:InBDev_Ptr ; cannot do binary input
+ jmp CopErr
+
+
+CopyLp:
+ mov bx,SrcHand
+ mov cx,BytCnt
+ mov dx,NxtAdd
+ sub cx,dx ; compute available space
+ jnz GotRoom
+ invoke FlshFil
+ cmp TermRead,0
+ jne CloseSrc ; give up
+ mov cx,BytCnt
+GotRoom:
+ push ds
+ mov ds,Tpa
+ assume ds:NOTHING
+ mov ah,READ
+ int 21h
+ pop ds
+ assume ds:TRANGROUP
+ jc Error_On_Source ;AC022; give up if error
+ mov cx,ax ; get count
+ jcxz CloseSrc ; no more to read
+ cmp SrcIsDev,0
+ jne NoTestA ; is a device, ascii mode
+ cmp Ascii,0
+ je BinRead
+NoTestA:
+ mov dx,cx
+ mov di,NxtAdd
+ mov al,1Ah
+ push es
+ mov es,Tpa
+ repne scasb ; scan for EOF
+ pop es
+ jne UseAll
+ inc RdEof
+ inc cx
+UseAll:
+ sub dx,cx
+ mov cx,dx
+BinRead:
+ add cx,NxtAdd
+ mov NxtAdd,cx
+ cmp cx,BytCnt ; is buffer full?
+ jb TestDev ; if not, we may have found eof
+ invoke FlshFil
+ cmp TermRead,0
+ jne CloseSrc ; give up
+ jmp short CopyLp
+
+TestDev:
+ cmp SrcIsDev,0
+ je CloseSrc ; if file then EOF
+ cmp RdEof,0
+ je CopyLp ; on device, go till ^Z
+CloseSrc:
+ mov bx,SrcHand
+ mov ah,CLOSE
+ int 21h
+ return
+
+
+
+
+CloseDest:
+
+; We are called to close the destination.
+; We need to note whether or not there is any internal data left
+; to be flushed out.
+
+ cmp DestClosed,0
+ retnz ; don't double close
+ mov al,byte ptr DestSwitch
+ invoke SetAsc ; check for b or a switch
+ jz BinClos ; on destination
+ mov bx,NxtAdd
+;
+;M048 -- TryFlush changes the state of ConCat flag. So, before we append a
+;^Z, let's always flush out. This way if the ConCat flag changes, we will
+;just return without appending a ^Z incorrectly for the first file(since we
+;are concatenating now). Also, in case it is a single file copy, we will
+;anyway write the ^Z out separately. The only drawback is that there is a
+;performance overhead on single ASCII file copies which now always involve
+;2 writes instead of 1 before. Is this really that important?
+;
+;M048; cmp bx,BytCnt ; is memory full?
+;M048; jne PutZ
+
+ invoke TryFlush ; flush (and double-check for concat)
+ je NoConc
+ConChng: ; concat flag changed on us
+ stc
+ return
+NoConc:
+ xor bx,bx
+PutZ:
+ push ds
+ mov ds,Tpa
+ mov word ptr [bx],1Ah ; add EOF mark (ctrl-Z)
+ pop ds
+ inc NxtAdd
+ mov NoWrite,0 ; make sure our ^z gets written
+ mov ax,Written
+ add ax,NxtAdd
+ jc BinClos ; > 1
+ cmp ax,1
+ je ForgetItJ ; Written = 0 NxtAdd = 1 (the ^Z)
+BinClos:
+ invoke TryFlush
+ jnz ConChng
+ cmp Written,0
+ForgetItJ:
+ jne No_Forget ; wrote something
+ jmp ForgetIt ; never wrote nothing
+No_Forget:
+ mov bx,DestHand
+ mov cx,CpTime
+ mov dx,CpDate
+ cmp Inexact,0 ; copy not exact?
+ je DoDClose ; if no, copy date & time
+ mov ah,GET_TIME
+ int 21h
+ shl cl,1
+ shl cl,1 ; left justify min in cl
+ shl cx,1
+ shl cx,1
+ shl cx,1 ; hours to high 5 bits, min to 5-10
+ shr dh,1 ; divide seconds by 2 (now 5 bits)
+ or cl,dh ; and stick into low 5 bits of cx
+ push cx ; save packed time
+ mov ah,GET_DATE
+ int 21h
+ sub cx,1980
+ xchg ch,cl
+ shl cx,1 ; year to high 7 bits
+ shl dh,1 ; month to high 3 bits
+ shl dh,1
+ shl dh,1
+ shl dh,1
+ shl dh,1 ; most sig bit of month in carry
+ adc ch,0 ; put that bit next to year
+ or dl,dh ; or low three of month into day
+ mov dh,ch ; get year and high bit of month
+ pop cx ; get time back
+DoDClose:
+ cmp bx,0
+ jle CloseDone
+ mov ax,(FILE_TIMES shl 8) or 1
+ int 21h ; set date and time
+ jc Cleanup_Err ;AN022; handle error
+
+; See if the destination has *anything* in it.
+; If not, just close and delete it.
+
+ mov ax,(LSEEK shl 8) + 2 ; seek to EOF
+ xor dx,dx
+ mov cx,dx
+ int 21h
+
+; DX:AX is file size
+
+ or dx,ax
+ pushf
+ mov ax,(IOCTL SHL 8) + 0 ; get the destination attributes
+ int 21h
+ push dx ; save them away
+ mov ah,CLOSE
+ int 21h
+ pop dx
+ jnc Close_Cont ;AN022; handle error on close
+ popf ;AN022; get the flags back
+Cleanup_Err: ;AN022;
+ call CleanUpErr ;AN022; attempt to delete the target
+ call DestDelete ;AN022; attempt to delete the target
+ jmp short FileClosed ;AN022; close the file
+Close_Cont: ;AN022; no error - continue
+ popf
+ jnz CloseDone
+ test dx,80h ; is the destination a device?
+ jnz CloseDone ; yes, copy succeeded
+ call DestDelete
+ jmp short FileClosed
+CloseDone:
+ inc FileCnt
+FileClosed:
+ inc DestClosed
+Ret50:
+ clc
+ return
+
+
+ForgetIt:
+ mov bx,DestHand
+ call DoDClose ; close the dest
+ call DestDelete
+ mov FileCnt,0 ; no files transferred
+ jmp Ret50
+
+
+DestDelete:
+ mov dx,offset TRANGROUP:DestBuf
+ mov ah,UNLINK
+ int 21h ; and delete it
+ return
+
+
+
+
+Source_Set proc near
+
+ push si
+ mov ax,StartEl
+ mov si,offset TRANGROUP:ScanBuf ; adjust to copy
+ sub ax,si
+ mov di,offset TRANGROUP:SrcBuf
+ add ax,di
+ mov SrcTail,ax
+ mov SrcSiz,cl ; save its size
+ inc cx ; include the nul
+ rep movsb ; save this source
+ mov SrcInfo,bh ; save info about it
+ pop si
+ mov ax,bp ; switches so far
+ invoke SetAsc ; set a,b switches accordingly
+ invoke Switch ; get any more switches on this arg
+ invoke SetAsc ; set
+ return
+
+Source_Set endp
+
+
+
+
+;****************************************************************
+;*
+;* ROUTINE: CleanupErr
+;*
+;* FUNCTION: Issues extended error message for destination
+;* if not alreay issued
+;*
+;* INPUT: return from INT 21
+;*
+;* OUTPUT: none
+;*
+;****************************************************************
+
+CleanupErr proc near ;AN022;
+
+ cmp Msg_Flag,0 ;AN022; have we already issued a message?
+ jnz CleanupErr_Cont ;AN022; yes - don't issue duplicate error
+ invoke Set_Ext_Error_Msg ;AN022; set up error message
+ mov String_Ptr_2,offset TRANGROUP:DestBuf ;AN022; get address of failed string
+ mov Extend_Buf_Sub,ONE_SUBST ;AN022; put number of subst in control block
+ invoke Std_EPrintF ;AN022; issue the error message
+
+CleanupErr_Cont: ;AN022;
+ ret ;AN022; return to caller
+
+CleanupErr endp ;AN022;
+
+
+TRANCODE ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/copypr1.asm b/private/mvdm/dos/v86/cmd/command/copypr1.asm
new file mode 100644
index 000000000..53237e32b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/copypr1.asm
@@ -0,0 +1,345 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+ .xlist
+ .xcref
+
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include sf.inc
+ include comseg.asm
+ include comequ.asm
+
+ .list
+ .cref
+
+
+TRANDATA segment public byte
+ extrn DevWMes_Ptr:word
+ extrn Extend_Buf_Sub:byte
+ extrn LostErr_Ptr:word
+ extrn NoSpace_Ptr:word
+ extrn Overwr_Ptr:word
+TRANDATA ends
+
+TRANSPACE segment public byte
+ extrn Ascii:byte
+ extrn Binary:byte
+ extrn CFlag:byte
+ extrn Concat:byte
+ extrn DestBuf:byte
+ extrn DestClosed:byte
+ extrn DestHand:word
+ extrn DestIsDev:byte
+ extrn DestSwitch:word
+ extrn Inexact:byte
+ extrn NoWrite:byte
+ extrn NxtAdd:word
+ extrn OCtrlZ:byte
+ extrn OFilePtr_Hi:word
+ extrn OFilePtr_Lo:word
+ extrn Plus_Comma:byte
+ extrn RdEof:byte
+ extrn SrcIsDev:byte
+ extrn String_Ptr_2:word
+ extrn TermRead:byte
+ extrn Tpa:word
+ extrn Written:word
+TRANSPACE ends
+
+TRANCODE segment public byte
+
+ extrn EndCopy:near
+
+ public FlshFil
+ public TryFlush
+
+ assume cs:TRANGROUP,ds:TRANGROUP,es:TRANGROUP,ss:NOTHING
+
+
+
+;*** TryFlush - flush copy buffer, double-check for concatenation
+;
+; EXIT ZR set if concatenate flag unchanged
+
+TryFlush:
+ mov al,Concat
+ push ax
+ call FlshFil
+ pop ax
+ cmp al,Concat
+ return
+
+
+;*** Flshfil - write out any data remaining in copy buffer.
+;
+; Inputs:
+; [NXTADD] = No. of bytes to write
+; [CFLAG] <> 0 if file has been created
+; Outputs:
+; [NXTADD] = 0
+
+FlshFil:
+ mov TermRead,0
+ cmp CFlag,0
+ je NotExists
+ jmp Exists
+
+NotExists:
+ invoke BuildDest ; find out all about the destination
+ invoke CompName ; source and dest. the same?
+ jne ProcDest ; if not, go ahead
+
+ cmp SrcIsDev,0
+ jne ProcDest ; same name on device ok
+
+ cmp Concat,0 ; concatenation?
+ mov dx,offset TRANGROUP:Overwr_Ptr
+ jne No_Concat_Err ; concatenating
+
+ jmp CopErr ; not concatenating - overwrite error
+
+No_Concat_Err:
+ mov NoWrite,1 ; flag not writing (just seeking)
+
+ProcDest:
+ mov ax,EXTOPEN shl 8 ; open the file
+ mov si,offset TRANGROUP:DestBuf ; get file name
+;M046
+; For writes, we want to deny writes by anyone else at the same time that we
+;are writing to it. For instance, on a network, 2 workstations could try
+;writing to the same file. Also, because we opened the source file with
+;DENY NONE, it is fine if the source and destination files are the same as
+;would happen when we append to an existing file.
+;
+ mov bx,DENY_WRITE or WRITE_OPEN_MODE;get open mode for copy; M046
+ xor cx,cx ; no special files
+ mov dx,WRITE_OPEN_FLAG ; set up open flags
+
+ cmp NoWrite,0
+ jne DoDestOpen ; don't actually create if nowrite set
+ mov dx,CREAT_OPEN_FLAG ; set up create flags
+
+DoDestOpen:
+ int 21h
+
+; We assume that the error is normal.
+; TriageError will correct the DX value appropriately.
+
+ jnc Dest_Open_Okay ;AC030;
+
+Xa_Set_Error: ;AN030; error occurred on XA
+ invoke Set_Ext_Error_Msg ;AN030; get extended error
+
+Ext_Err_Set: ;AN030;
+ mov String_Ptr_2,offset TRANGROUP:DestBuf ;AN000; get address of failed string
+ mov Extend_Buf_Sub,ONE_SUBST ;AN030; put number of subst in control block
+
+
+CopErrJ2: ;AN030;
+ jmp CopErr ;AN030; go issue message
+
+Dest_Open_Okay: ;AC030
+ mov DestHand,ax ; save handle
+ mov CFlag,1 ; destination now exists
+ mov bx,ax
+ mov ax,(IOCTL shl 8)
+ int 21h ; get device stuff
+ mov DestIsDev,dl ; set dest info
+ test dl,DEVID_ISDEV
+ jz Exists ;AC030; Dest not a device
+
+; Destination is device.
+
+ mov al,byte ptr DestSwitch
+ and al,SWITCHA+SWITCHB
+ jnz TestBoth
+ mov al,Ascii ; neither set, use current setting
+ or al,Binary
+ jz ExSetA ; neither set, default to ascii
+
+TestBoth:
+ jpe Exists ; both are set, ignore
+ test al,SWITCHB
+ jz Exists ; leave in cooked mode
+ mov ax,(IOCTL shl 8) or 1
+ xor dh,dh
+ or dl,DEVID_RAW
+ mov DestIsDev,dl ; new value
+ int 21h ; set device to raw mode
+ jmp short Exists
+
+CopErrJ:
+ jmp CopErr
+
+
+ExSetA:
+
+; What we read in may have been in binary mode, flag zapped write OK
+
+ mov Ascii,SWITCHA ; set ascii mode
+ or Inexact,SWITCHA ; ascii -> inexact
+
+Exists:
+ cmp NoWrite,0
+ jne NoChecking ; if nowrite don't bother with name check
+ cmp Plus_Comma,1 ;g don't check if just doing +,,
+ je NoChecking ;g
+ invoke CompName ; source and dest. the same?
+ jne NoChecking ; if not, go ahead
+ cmp SrcIsDev,0
+ jne NoChecking ; same name on device ok
+
+; At this point we know in append (would have gotten overwrite error
+; on first destination create otherwise), and user trying to specify
+; destination which has been scribbled already (if dest had been named
+; first, NoWrite would be set).
+
+ mov dx,offset TRANGROUP:LostErr_Ptr ; tell him he's not going to get it
+ invoke Std_EprintF ;ac022;
+ mov NxtAdd,0 ; set return
+ inc TermRead ; tell read to give up
+
+Ret60:
+ return
+
+
+NoChecking:
+ mov bx,DestHand ; get handle
+ xor cx,cx
+ xchg cx,NxtAdd
+ jcxz Ret60 ; if nothing to write, forget it
+ inc Written ; flag that we wrote something
+ cmp NoWrite,0 ; if nowrite set, just seek cx bytes
+ jne SeekEnd
+ xor dx,dx
+ push ds
+ mov ds,Tpa
+ assume ds:NOTHING
+ mov ah,WRITE
+ int 21h
+ pop ds
+ assume ds:TRANGROUP
+ mov dx,offset TRANGROUP:NoSpace_Ptr
+ jnc @f
+ jmp Xa_Set_Error ;AC022; failure
+@@: sub cx,ax
+ retz ; wrote all supposed to
+ test DestIsDev,DEVID_ISDEV
+ jz CopErr ; is a file, error
+ test DestIsDev,DEVID_RAW
+ jnz DevWrtErr ; is a raw device, error
+ cmp Inexact,0
+ retnz ; inexact so ok
+ dec cx
+ retz ; wrote one byte less (the ^z)
+
+
+DevWrtErr:
+ mov dx,offset TRANGROUP:DevWMes_Ptr
+ jmp short CopErr
+
+
+
+
+SeekEnd:
+ xor dx,dx ; zero high half of offset
+ xchg dx,cx ; cx:dx is seek location
+ mov ax,(LSEEK shl 8) or 1
+ int 21h ; seek ahead in the file
+
+; Save the file pointer in DX:AX to restore the file
+; with in case the copy should fail.
+
+ mov OFilePtr_Lo,ax
+ mov OFilePtr_Hi,dx
+
+ cmp RdEof,0
+ retz ; EOF not read yet
+
+; ^Z has been read - we must set the file size to the current
+; file pointer location
+
+ mov ah,WRITE
+ int 21h ; cx is zero, truncates file
+ jc Xa_Set_Error_Jmp ;AC022; failure
+
+; Make note that ^Z was removed, in case the
+; copy should fail and we need to restore the file.
+
+ mov OCtrlZ,1Ah
+
+ return
+
+
+
+
+ public CopErr
+CopErr:
+ invoke Std_EPrintF ;AC022;
+
+CopErrP:
+ inc DestClosed
+ cmp CFlag,0
+ je EndCopyJ ; never actually got it open
+ mov bx,DestHand
+ cmp bx,0
+ jle NoClose
+
+; Check to see if we should save part of the destination file.
+
+ mov cx,OFilePtr_Hi ; CX = hi word of original file ptr
+ mov dx,OFilePtr_Lo ; DX = lo word of original file ptr
+
+ mov ax,cx
+ or ax,dx
+ jz ceClose ; null file ptr means nothing to save
+
+; Destination was also the first source. Do the best we can to
+; restore it. Truncate it back to the size we took from it (which
+; may have been due to a Ctrl-Z, so may not have included the whole
+; file). If a Ctrl-Z was originally read, put it back.
+
+ mov ax,LSEEK shl 8
+ int 21h
+
+ xor cx,cx ; CX = # bytes to write = 0
+ mov ah,WRITE
+ int 21h ; truncate file
+
+ cmp OCtrlZ,0
+ je @f ; no ctrl-z removed from original
+ inc cx ; CX = # bytes to write = 1
+ mov dx,offset TRANGROUP:OCtrlZ ; DS:DX = ptr to original ctrl-z
+ mov ah,WRITE
+ int 21h ; write ctrl-z
+@@:
+ mov ah,CLOSE
+ int 21h ; close it
+;; mov CFlag,0
+ jmp EndCopy ; and go home
+
+ceClose:
+ mov ah,CLOSE ; close the file
+ int 21h
+
+NoClose:
+ mov dx,offset TRANGROUP:DestBuf
+ mov ah,UNLINK
+ int 21h ; and delete it
+ mov CFlag,0
+
+EndCopyJ:
+ jmp EndCopy
+
+Xa_Set_Error_Jmp: ;AN022; go set up error message
+ jmp Xa_Set_Error ;AN022;
+
+TRANCODE ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/copypr2.asm b/private/mvdm/dos/v86/cmd/command/copypr2.asm
new file mode 100644
index 000000000..277dca374
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/copypr2.asm
@@ -0,0 +1,587 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+;M031 SR 10/11/90 Bug #3069. Use deny write sharing mode to open files
+; instead of compatibility mode. This gives lesser
+; sharing violations when files are opened for read on
+; a copy operation.
+;
+;
+
+
+
+
+ .xlist
+ .xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include sf.inc
+ include comseg.asm
+ include comequ.asm
+ .list
+ .cref
+
+
+TRANDATA segment public byte
+ extrn FulDir_Ptr:word ;AN052;
+TRANDATA ends
+
+TRANSPACE segment public byte
+ extrn Ascii:byte
+ extrn Binary:byte
+ extrn Concat:byte
+ extrn DestBuf:byte
+ extrn DestFcb:byte
+ extrn DestInfo:byte
+ extrn DestIsDir:byte
+ extrn DestTail:word
+ extrn DestVars:byte
+ extrn DirBuf:byte
+ extrn DirChar:byte
+ extrn FirstDest:byte
+ extrn Inexact:byte
+ extrn MelCopy:byte
+ extrn NxtAdd:word
+ extrn Plus:byte
+ extrn SDirBuf:byte
+ extrn SrcInfo:byte
+ extrn SrcXName:byte
+ extrn Tpa:word
+ extrn TrgXName:byte
+ extrn UserDir1:byte
+TRANSPACE ends
+
+TRANCODE segment public byte
+
+ extrn BadPath_Err:near ;AN022;
+ extrn CopErr:near ;AN052;
+ extrn Extend_Setup:near ;AN022;
+
+ public BuildPath
+ public SetStars
+ public SetAsc
+
+ASSUME cs:TRANGROUP,ds:TRANGROUP,es:TRANGROUP,ss:NOTHING
+
+
+
+
+;*** SetAsc - set Ascii, Binary, Inexact flags based on switches
+;
+; Given switch vector in AX,
+; Set Ascii flag if /a is set
+; Clear Ascii flag if /b is set
+; Binary set if /b specified
+; Leave Ascii unchanged if neither or both are set
+; Also sets Inexact if Ascii is ever set.
+; AL = Ascii on exit, flags set
+;
+
+SetAsc:
+
+ and al,SWITCHA+SWITCHB ; AL = /a, /b flags
+ jpe LoadSw ; even parity - both or neither
+ push ax
+ and al,SWITCHB
+ mov Binary,al
+ pop ax
+ and al,SWITCHA
+ mov Ascii,al
+ or Inexact,al
+
+LoadSw:
+ mov al,Ascii
+ or al,al
+ return
+
+
+
+
+;*** BuildDest
+
+ public BuildDest
+
+BuildDest:
+
+ cmp DestIsDir,-1
+ jne KnowAboutDest ; figuring already done
+ mov di,offset TRANGROUP:UserDir1
+ mov bp,offset TRANGROUP:DestVars
+ call BuildPath
+ invoke RestUDir1
+
+; We now know all about the destination.
+
+KnowAboutDest:
+ xor al,al
+ xchg al,FirstDest
+ or al,al
+ jnz FirstDst
+ jmp NotFirstDest
+
+FirstDst:
+
+; Create an fcb of the original dest.
+
+ mov si,DestTail
+ mov di,offset TRANGROUP:DestFcb
+ mov ax,PARSE_FILE_DESCRIPTOR shl 8
+ int 21h
+ cmp byte ptr [si],0
+ je GoodParse
+;AD052; mov byte ptr [di+1],"|" ; must be illegal file name character
+ mov dx,offset TRANGROUP:FulDir_Ptr ;AN052; issue "file creation error"
+ jmp CopErr ;AN052;
+
+GoodParse:
+ mov ax,word ptr DestBuf ; AX = possible "d:"
+ cmp ah,':'
+ je @f
+ mov al,'@'
+@@:
+; AX = "d:" for following FCB drive computation
+
+ mov cl,Ascii ; CL = saved Ascii flag
+ or al,20h
+ sub al,60h
+ mov DestFcb,al ; store drive # in FCB
+
+;* Figure out what copy mode we're in.
+; Letters stand for unambiguous, * for ambiguous pathnames.
+; +n stands for additional sources delimited by +'s.
+;
+; copy a b not concatenating
+; copy a * not concatenating
+; copy * a concatenating
+; copy * * not concatenating
+; copy a+n b concatenating
+; copy *+n a concatenating
+; copy *+n * concatenating, Mel Hallorman style
+
+; Bugbug: copy *.a+a.b *.t picks up only 1st *.a file.. Why?
+; copy a.b+*.a *.t picks up all *.a files.
+
+ mov al,DestInfo ; AL = destination CParse flags
+ mov ah,SrcInfo ; AH = source CParse flags
+ and ax,0202h ; AH,AL = source,dest wildcard flags
+ or al,al
+ jz NotMelCopy ; no destination wildcard
+
+; Destination is wildcarded.
+
+ cmp al,ah
+ jne NotMelCopy ; no source wildcard
+
+; Source and destination are both wildcarded.
+
+ cmp Plus,0
+ je NotMelCopy ; no +'s in source
+
+; Source and destination are wildcarded, and source includes +'s.
+; It's Mel Hallorman copy time.
+
+ inc MelCopy ; 'Mel copy' = true
+ xor al,al
+ jmp short SetConc
+
+NotMelCopy:
+ xor al,2 ; AL=0 -> ambiguous destination, 2 otherwise
+ and al,ah
+ shr al,1 ; AL=1 -> ambiguous source, unambiguous dest
+ ; (implies concatenation)
+
+SetConc:
+ or al,Plus ; "+" always infers concatenation
+
+; Whew. AL = 1 if concatenating, 0 if not.
+
+ mov Concat,al
+ shl al,1
+ shl al,1
+ mov Inexact,al ; concatenation -> inexact copy
+ cmp Binary,0
+ jne NotFirstDest ; explicit binary copy
+
+ mov Ascii,al ; otherwise, concatenate in ascii mode
+ or cl,cl
+ jnz NotFirstDest ; Ascii flag set before, data read correctly
+ or al,al
+ jz NotFirstDest ; Ascii flag did not change state
+
+; At this point there may already be binary read data in the read
+; buffer. We need to find the first ^Z (if there is one) and trim the
+; amount of data in the buffer correctly.
+
+ mov cx,NxtAdd
+ jcxz NotFirstDest ; no data, everything ok
+ mov al,1Ah
+ push es
+ xor di,di
+ mov es,Tpa
+ repne scasb ; scan for EOF
+ pop es
+ jne NotFirstDest ; no ^z in buffer, everything ok
+ dec di ; point at ^z
+ mov NxtAdd,di ; new buffer length
+
+NOTFIRSTDEST:
+ mov bx,offset trangroup:DIRBUF+1 ; Source of replacement chars
+ cmp CONCAT,0
+ jz GOTCHRSRC ; Not a concat
+ mov bx,offset trangroup:SDIRBUF+1 ; Source of replacement chars
+
+GOTCHRSRC:
+ mov si,offset trangroup:DESTFCB+1 ; Original dest name
+ mov di,DESTTAIL ; Where to put result
+
+public buildname
+BUILDNAME:
+
+ifdef DBCS ; ### if DBCS ###
+
+ mov cx,8
+ call make_name
+ cmp byte ptr [si],' '
+ jz @f ; if no extention
+ mov al,dot_chr
+ stosb
+ mov cx,3
+ call make_name
+@@:
+ xor al,al
+ stosb ; nul terminate
+ return
+
+else ; ### if Not DBCS ###
+
+ mov cx,8
+
+BUILDMAIN:
+ lodsb
+ cmp al,'?'
+ jnz NOTAMBIG
+ mov al,byte ptr [BX]
+
+NOTAMBIG:
+ cmp al,' '
+ jz NOSTORE
+ stosb
+
+NOSTORE:
+ inc bx
+ loop BUILDMAIN
+ mov cl,3
+ mov al,' '
+ cmp byte ptr [SI],al
+ jz ENDDEST ; No extension
+ mov al,dot_chr
+ stosb
+
+BUILDEXT:
+ lodsb
+ cmp al,'?'
+ jnz NOTAMBIGE
+ mov al,byte ptr [BX]
+
+NOTAMBIGE:
+ cmp al,' '
+ jz NOSTOREE
+ stosb
+
+NOSTOREE:
+ inc bx
+ loop BUILDEXT
+ENDDEST:
+ xor al,al
+ stosb ; NUL terminate
+ return
+
+endif ; ### end if Not DBCS ###
+
+
+ifdef DBCS ; ### if DBCS ###
+make_name:
+ mov ah,0 ; reset DBCS flag
+ mov dh,cl ; save length to do
+mkname_loop:
+ cmp ah,1 ; if it was lead byte
+ jz mkname_dbcs
+ mov ah,0 ; reset if it was single or tail byte
+ mov al,[bx] ; get source char
+ invoke testkanj
+ jz mkname_load ; if not lead byte
+mkname_dbcs:
+ inc ah ; set dbcs flag
+mkname_load:
+ lodsb ; get raw char
+ cmp al,'?'
+ jnz mkname_store ; if not '?'
+ cmp ah,0
+ jz mkname_conv ; if source is single
+ cmp ah,1
+ jnz mkname_pass ; if source is not lead
+ cmp cl,dh
+ jnz mkname_lead ; if this is not 1st char
+ cmp byte ptr [si],' '
+ jz mkname_double ; if this is the end
+mkname_lead:
+ cmp byte ptr [si],'?'
+ jnz mkname_pass ; if no '?' for tail byte
+ cmp cx,1
+ jbe mkname_pass ; if no room for tail byte
+mkname_double:
+ mov al,[bx]
+ stosb
+ inc bx
+ inc si
+ dec cx
+ inc ah ; tail byte will be loaded
+mkname_conv:
+ mov al,[bx]
+mkname_store:
+ cmp al,' '
+ jz mkname_pass
+ stosb ; store in destination
+mkname_pass:
+ inc bx
+ loop mkname_loop
+ return
+endif ; ### end if DBCS ###
+
+BUILDPATH:
+ test [BP.INFO],2
+ jnz NOTPFILE ; If ambig don't bother with open
+ mov dx,bp
+ add dx,BUF ; Set DX to spec
+
+ push di ;AN000;
+ MOV AX,EXTOPEN SHL 8 ;AC000; open the file
+ mov bx,DENY_NONE or READ_OPEN_MODE ; open mode for COPY ;M046
+ xor cx,cx ;AN000; no special files
+ mov si,dx ;AN030; get file name offset
+ mov dx,read_open_flag ;AN000; set up open flags
+ INT 21h
+ pop di ;AN000;
+ jnc pure_file ;AN022; is pure file
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_file_not_found ;AN022; if file not found - okay
+ jz notpfile ;AN022;
+ cmp ax,error_path_not_found ;AN022; if path not found - okay
+ jz notpfile ;AN022;
+ cmp ax,error_access_denied ;AN022; if access denied - okay
+ jz notpfile ;AN022;
+ jmp extend_setup ;AN022; exit with error
+
+pure_file:
+ mov bx,ax ; Is pure file
+ mov ax,IOCTL SHL 8
+ INT 21h
+ mov ah,CLOSE
+ INT 21h
+ test dl,devid_ISDEV
+ jnz ISADEV ; If device, done
+ test [BP.INFO],4
+ jz ISSIMPFILE ; If no path seps, done
+
+NOTPFILE:
+ mov dx,word ptr [BP.BUF]
+ cmp dl,0 ;AN034; If no drive specified, get
+ jz set_drive_spec ;AN034; default drive dir
+ cmp dh,':'
+ jz DRVSPEC5
+
+set_drive_spec: ;AN034;
+ mov dl,'@'
+
+DRVSPEC5:
+ or dl,20h
+ sub dl,60h ; A = 1
+ invoke SAVUDIR1
+ jnc curdir_ok ;AN022; if error - exit
+ invoke get_ext_error_number ;AN022; get the extended error
+ jmp extend_setup ;AN022; exit with error
+
+curdir_ok: ;AN022;
+ mov dx,bp
+ add dx,BUF ; Set DX for upcomming CHDIRs
+ mov bh,[BP.INFO]
+ and bh,6
+ cmp bh,6 ; Ambig and path ?
+ jnz CHECKAMB ; jmp if no
+ mov si,[BP.TTAIL]
+ mov bl,':'
+ cmp byte ptr [si-2],bl
+ jnz KNOWNOTSPEC
+ mov [BP.ISDIR],2 ; Know is d:/file
+ jmp short DOPCDJ
+
+KNOWNOTSPEC:
+ mov [BP.ISDIR],1 ; Know is path/file
+ dec si ; Point to the /
+
+DOPCDJ:
+ jmp DOPCD ;AC022; need long jump
+
+CHECKAMB:
+ cmp bh,2
+ jnz CHECKCD
+
+ISSIMPFILE:
+ISADEV:
+ mov [BP.ISDIR],0 ; Know is file since ambig but no path
+ return
+
+CHECKCD:
+ invoke SETREST1
+ mov ah,CHDIR
+ INT 21h
+ jc NOTPDIR
+ mov di,dx
+ xor ax,ax
+ mov cx,ax
+ dec cx
+
+Kloop: ;AN000; 3/3/KK
+ MOV AL,ES:[DI] ;AN000; 3/3/KK
+ INC DI ;AN000; 3/3/KK
+ OR AL,AL ;AN000; 3/3/KK
+ JZ Done ;AN000; 3/3/KK
+ xor ah,ah ;AN000; 3/3/KK
+ invoke Testkanj ;AN000; 3/3/KK
+ JZ Kloop ;AN000; 3/3/KK
+ INC DI ;AN000; 3/3/KK
+ INC AH ;AN000; 3/3/KK
+ jmp Kloop ;AN000; 3/3/KK
+
+Done: ;AN000; 3/3/KK
+ dec di
+ mov al,DIRCHAR
+ mov [bp.ISDIR],2 ; assume d:/file
+ OR AH, AH ;AN000; 3/3/KK
+ JNZ Store_pchar ;AN000; 3/3/KK this is the trailing byte of ECS code
+ cmp al,[di-1]
+ jz GOTSRCSLSH
+
+Store_pchar: ;AN000; 3/3/KK
+ stosb
+ mov [bp.ISDIR],1 ; know path/file
+
+GOTSRCSLSH:
+ or [bp.INFO],6
+ call SETSTARS
+ return
+
+
+NOTPDIR:
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_path_not_found ;AN022; if path not found - okay
+ jz notpdir_try ;AN022;
+ cmp ax,error_access_denied ;AN022; if access denied - okay
+ jnz extend_setupj ;AN022; otherwise - exit error
+
+notpdir_try: ;AN022;
+ mov [bp.ISDIR],0 ; assume pure file
+ mov bh,[bp.INFO]
+ test bh,4
+ retz ; Know pure file, no path seps
+ mov [bp.ISDIR],2 ; assume d:/file
+ mov si,[bp.TTAIL]
+ cmp byte ptr [si],0
+ jz BADCDERRJ2 ; Trailing '/'
+ mov bl,dot_chr
+ cmp byte ptr [si],bl
+ jz BADCDERRJ2 ; If . or .. pure cd should have worked
+ mov bl,':'
+ cmp byte ptr [si-2],bl
+ jz DOPCD ; Know d:/file
+ mov [bp.ISDIR],1 ; Know path/file
+ dec si ; Point at last '/'
+
+DOPCD:
+ xor bl,bl
+ xchg bl,[SI] ; Stick in a NUL
+ invoke SETREST1
+ CMP DX,SI ;AN000; 3/3/KK
+ JAE LookBack ;AN000; 3/3/KK
+ PUSH SI ;AN000; 3/3/KK
+ PUSH CX ;AN000; 3/3/KK
+ MOV CX,SI ;AN000; 3/3/KK
+ MOV SI,DX ;AN000; 3/3/KK
+
+Kloop2: ;AN000; 3/3/KK
+ LODSB ;AN000; 3/3/KK
+ invoke TestKanj ;AN000; 3/3/KK
+ jz NotKanj4 ;AN000; 3/3/KK
+ LODSB ;AN000; 3/3/KK
+ CMP SI,CX ;AN000; 3/3/KK
+ JB Kloop2 ;AN000; 3/3/KK
+ POP CX ;AN000; 3/3/KK
+ POP SI ;AN000; 3/3/KK
+ JMP SHORT DoCdr ;AN000; 3/3/KK Last char is ECS code, don't check for
+ ; trailing path sep
+NotKanj4: ;AN000; 3/3/KK
+ CMP SI,CX ;AN000; 3/3/KK
+ JB Kloop2 ;AN000; 3/3/KK
+ POP CX ;AN000; 3/3/KK
+ POP SI ;AN000; 3/3/KK
+
+LookBack: ;AN000; 3/3/KK
+ CMP BL,[SI-1] ; if double slash, then complain.
+ JZ BadCDErrJ2
+
+DoCdr: ;AN000; 3/3/KK
+ mov ah,CHDIR
+ INT 21h
+ xchg bl,[SI]
+ retnc
+ invoke get_ext_error_number ;AN022; get the extended error
+
+EXTEND_SETUPJ: ;AN022;
+ JMP EXTEND_SETUP ;AN022; go issue the error message
+
+BADCDERRJ2:
+ jmp badpath_err ;AC022; go issue path not found message
+
+SETSTARS:
+ mov [bp.TTAIL],DI
+ add [bp.SIZ],12
+ mov ax,dot_qmark
+ mov cx,8
+ rep stosb
+ xchg al,ah
+ stosb
+ xchg al,ah
+ mov cl,3
+ rep stosb
+ xor al,al
+ stosb
+ return
+
+PUBLIC CompName
+COMPNAME:
+
+ mov si,offset trangroup:DESTBUF ;g do name translate of target
+ mov di,offset trangroup:TRGXNAME ;g save for name comparison
+ mov ah,xnametrans ;g
+ int 21h ;g
+
+ MOV si,offset trangroup:SRCXNAME ;g get name translate of source
+ MOV di,offset trangroup:TRGXNAME ;g get name translate of target
+
+
+ invoke STRCOMP
+
+ return
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/cparse.asm b/private/mvdm/dos/v86/cmd/command/cparse.asm
new file mode 100644
index 000000000..663510a25
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/cparse.asm
@@ -0,0 +1,423 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)cparse.asm 1.1 85/05/14
+; SCCSID = @(#)cparse.asm 1.1 85/05/14
+ INCLUDE comsw.asm
+
+.xlist
+.xcref
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ INCLUDE comseg.asm
+ INCLUDE comequ.asm
+.list
+.cref
+
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BADCD_PTR:WORD ;AC022;
+ EXTRN BADCPMES_ptr:word ;AC000;
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN comma:byte
+ EXTRN cpyflag:byte
+ EXTRN CURDRV:BYTE
+ EXTRN ELCNT:BYTE
+ EXTRN ELPOS:BYTE
+ EXTRN EXPAND_STAR:BYTE
+ EXTRN SKPDEL:BYTE
+ EXTRN STARTEL:WORD
+ EXTRN SWITCHAR:BYTE
+ EXTRN switch_list:byte
+ EXTRN TPA:WORD
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:TRANGROUP,SS:NOTHING
+
+ EXTRN CERROR:NEAR
+
+ PUBLIC BADCDERR ;AC022;
+ PUBLIC CPARSE
+
+SWCOUNT EQU 6 ; Must agree with length of switch_list
+
+;-----------------------------------------------------------------------;
+; ENTRY: ;
+; DS:SI Points input buffer ;
+; ES:DI Points to the token buffer ;
+; BL Special delimiter for this call ;
+; Always checked last ;
+; set it to space if there is no special delimiter ;
+; EXIT: ;
+; DS:SI Points to next char in the input buffer ;
+; ES:DI Points to the token buffer ;
+; [STARTEL] Points to start of last element of path in token ;
+; points to a NUL for no element strings 'd:' 'd:/' ;
+; CX Character count ;
+; BH Condition Code ;
+; Bit 1H of BH set if switch character ;
+; Token buffer contains char after ;
+; switch character ;
+; BP has switch bits set (ORing only) ;
+; Bit 2H of BH set if ? or * in token ;
+; if * found element ? filled ;
+; Bit 4H of BH set if path sep in token ;
+; Bit 80H of BH set if the special delimiter ;
+; was skipped at the start of this token ;
+; Token buffer always starts d: for non switch tokens ;
+; CARRY SET ;
+; if CR on input ;
+; token buffer not altered ;
+; ;
+; DOES NOT RETURN ON BAD PATH, OR TRAILING SWITCH CHAR ERROR ;
+; MODIFIES: ;
+; CX, SI, AX, BH, DX and the Carry Flag ; ;
+; ;
+; -----------------------------------------------------------------------;
+;---------------
+; Modifications to cparse: recognition of right and left parentheses
+; as integral tokens, and removal of automatic upper-case conversion code.
+;
+; Both modifications were installed in the course of adding a coherent
+; command-line parser to COMMAND.COM which builds a UNIX-style argv[]/argc
+; structure for command-line arguments. This parser relies on cparse to
+; recognize individual tokens.
+;
+; To process for-loops correctly, parentheses must therefore be
+; recognized as tokens. The upper-case conversion code was removed so
+; that commands (such as for and echo) would be able to use the "original"
+; text of the command line.
+;
+; Note also the modification to prevent the automatic conversion of colons
+; into spaces WITHIN THE SOURCE TEXT!
+;
+; Also note that BP is also clobbered if cparse recognizes any switches
+; on the command line.
+;
+; Alan L, OS/MSDOS 14 August 1983
+;---------------
+
+CPARSE:
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+ xor ax,ax
+ mov [STARTEL],DI ; No path element (Is DI correct?)
+ mov [ELPOS],al ; Start in 8 char prefix
+ mov [SKPDEL],al ; No skip delimiter yet
+ mov bh,al ; Init nothing
+ pushf ; save flags
+ push di ; save the token buffer addrss
+ xor cx,cx ; no chars in token buffer
+ mov comma,cl ;g reset comma flag
+moredelim:
+ LODSB
+ INVOKE DELIM
+ JNZ SCANCDONE
+ CMP AL,' '
+ JZ moredelim
+ CMP AL,9
+ JZ moredelim
+ xchg al,[SKPDEL]
+ or al,al
+ jz moredelim ; One non space/tab delimiter allowed
+ test bh,080h ;g has a special char been found?
+ jz no_comma ;g no - just exit
+ mov comma,1 ;g set comma flag
+no_comma:
+ JMP x_done ; Nul argument
+
+SCANCDONE:
+
+;;;; IFNDEF DBCS 3/3/KK
+;---------------
+; Mod to avoid upper-case conversion.
+; cmp cpyflag,1 3/3/KK
+; jnz cpcont1 3/3/KK
+; invoke UPCONV 3/3/KK
+cpcont1:
+;---------------
+;;;; ENDIF 3/3/KK
+
+ cmp al,bl ; Special delimiter?
+ jnz nospec
+ or bh,80H
+ jmp short moredelim
+
+nospec:
+ cmp al,0DH ; a CR?
+ jne ncperror
+ jmp cperror
+
+ncperror:
+ cmp al,[SWITCHAR] ; is the char the switch char?
+ jne na_switch ; yes, process...
+ jmp a_switch
+
+na_switch:
+ mov dl,':'
+ cmp byte ptr [si],dl
+ jne anum_chard ; Drive not specified
+
+;;;; IFDEF DBCS 3/3/KK
+;---------------
+; Mod to avoid upper-case conversion.
+ cmp cpyflag,1
+ jnz cpcont2
+ invoke UPCONV
+cpcont2:
+;---------------
+;;;; ENDIF 3/3/KK
+
+ call move_char
+ lodsb ; Get the ':'
+ call move_char
+ mov [STARTEL],di
+ mov [ELCNT],0
+ jmp anum_test
+
+anum_chard:
+ mov [STARTEL],di
+ mov [ELCNT],0 ; Store of this char sets it to one
+ cmp cpyflag,1 ; Was CPARSE called from COPY?
+ jnz anum_char ; No, don't add drive spec.
+ invoke PATHCHRCMP ; Starts with a pathchar?
+ jnz anum_char ; no
+ push ax
+ mov al,[CURDRV] ; Insert drive spec
+ add al,capital_A
+ call move_char
+ mov al,':'
+ call move_char
+ pop ax
+ mov [STARTEL],di
+ mov [ELCNT],0
+
+anum_char:
+
+;;;; IFDEF DBCS 3/3/KK
+ invoke TESTKANJ
+ jz NOTKANJ ;AC048;
+ call move_char
+ lodsb
+ jmp short notspecial
+
+NOTKANJ: ;AN048; If not kanji
+ cmp cpyflag,1 ;AN048; and if we're in COPY
+ jnz testdot ;AN048;
+ invoke upconv ;AN048; upper case the char
+
+TESTDOT:
+;;;; ENDIF 3/3/KK
+
+ cmp al,dot_chr
+ jnz testquest
+ inc [ELPOS] ; flag in extension
+ mov [ELCNT],0FFH ; Store of the '.' resets it to 0
+
+testquest:
+ cmp al,'?'
+ jnz testsplat
+ or bh,2
+
+testsplat:
+ cmp al,star
+ jnz testpath
+ or bh,2
+ cmp byte ptr [expand_star],0
+ jnz expand_filename
+ jmp SHORT testpath
+
+badperr2j:
+ jmp short badperr2
+
+expand_filename:
+ mov ah,7
+ cmp [ELPOS],0
+ jz gotelcnt
+ mov ah,2
+
+gotelcnt:
+ mov al,'?'
+ sub ah,[ELCNT]
+ jc badperr2j
+ xchg ah,cl
+ jcxz testpathx
+
+qmove:
+ xchg ah,cl
+ call move_char
+ xchg ah,cl
+ loop qmove
+
+testpathx:
+ xchg ah,cl
+
+testpath:
+ invoke PATHCHRCMP
+ jnz notspecial
+ or bh,4
+ cmp byte ptr [expand_star],0
+ jz no_err_check
+ test bh,2 ; If just hit a '/', cannot have ? or * yet
+ jnz badperr
+
+no_err_check:
+ mov [STARTEL],di ; New element
+ INC [STARTEL] ; Point to char after /
+ mov [ELCNT],0FFH ; Store of '/' sets it to 0
+ mov [ELPOS],0
+
+notspecial:
+ call move_char ; just an alphanum string
+anum_test:
+
+ lodsb
+
+;;;; IFNDEF DBCS 3/3/KK
+;---------------
+; Mod to avoid upper-case conversion.
+; cmp cpyflag,1 3/3/KK
+; jnz cpcont3 3/3/KK
+; invoke UPCONV 3/3/KK
+cpcont3:
+;---------------
+;;;; ENDIF 3/3/KK
+
+ INVOKE DELIM
+ je x_done
+
+ cmp al,0DH
+ je x_done
+ cmp al,[SWITCHAR]
+ je x_done
+ cmp al,bl
+ je x_done
+ cmp al,':' ; ':' allowed as trailer because
+ ; of devices
+;;;; IFDEF DBCS 3/3/KK
+ je FOO15
+ jmp anum_char
+FOO15:
+;;; ELSE 3/3/KK
+;;; jne anum_charj 3/3/KK
+;;; ENDIF 3/3/KK
+
+;---------------
+; Modification made for parseline.
+; Why would it be necessary to change colons to spaces? In this
+; case, EVERY colon is changed to a space; e.g., 'f:' yields 'f ',
+; but so does 'echo foo:bar' yield 'echo foo bar'.
+;---------------
+ cmp cpyflag,2 ; Is CPARSE parsing the 1st token from
+ ; from PARSELINE?
+ jnz cpcont4 ; No, continue
+ call move_char ; Yes, save the ':' and go get another
+ jmp anum_test ; character.
+
+cpcont4:
+ inc si ;Skip the ':'
+ jmp short x_done
+
+anum_charj:
+ jmp anum_char
+
+badperr2:
+ mov dx,offset trangroup:BADCPMES_ptr
+ jmp CERROR
+
+badperr:
+BADCDERR: ;AC022; Issue "Invalid Directory"
+ MOV DX,OFFSET TRANGROUP:BADCD_ptr ;AC022; message
+ JMP CERROR ;AC022;
+
+cperror:
+ dec si ; adjust the pointer
+ pop di ; retrive token buffer address
+ popf ; restore flags
+ stc ; set the carry bit
+ return
+
+x_done:
+ dec si ; adjust for next round
+;---------------
+; Mod to recognize right and left parens as integral tokens.
+x_done2:
+;---------------
+ jmp short out_token
+
+a_switch:
+ OR BH,1 ; Indicate switch
+ OR BP,fSwitch
+ INVOKE SCANOFF
+ INC SI
+ invoke testkanj ;AN057; See if DBCS lead byte
+ jz a_switch_notkanj ;AN057; no - continue processing
+ call move_char ;AN057; DBCS - store first byte
+ lodsb ;AN057; get second byte
+ call move_char ;AN057; store second byte
+ or bp,fBadSwitch ;AN057; DBCS switch is invalid
+ jmp short out_token ;AN057; don't bother checking switch
+a_switch_notkanj: ;AN057;
+ cmp al,0DH
+ jne Store_swt
+ mov al,0
+ stosb ; null at the end
+ OR BP,fBadSwitch
+ jmp cperror ; Trailing switch character error
+ ; BP = fSwitch but no switch
+ ; bit is set (unknown switch)
+Store_swt:
+ call move_char ; store the character
+;
+;---------------
+; This upconv call must stay. It is used to identify copy-switches
+; on the command line, and won't store anything into the output buffer.
+ invoke UPCONV
+;---------------
+;
+ PUSH ES
+ PUSH DI
+ PUSH CX
+ PUSH CS
+ POP ES
+ASSUME ES:TRANGROUP
+ MOV DI,OFFSET TRANGROUP:switch_list
+ MOV CX,SWCOUNT
+ OR BP,fBadSwitch
+ REPNE SCASB
+ JNZ out_tokenp
+ AND BP,NOT fBadSwitch
+ MOV AX,1
+ SHL AX,CL
+ OR BP,AX
+
+out_tokenp:
+ POP CX
+ POP DI
+ POP ES
+
+ASSUME ES:NOTHING
+out_token:
+ mov al,0
+ stosb ; null at the end
+ pop di ; restore token buffer pointer
+ popf
+ clc ; clear carry flag
+ return
+
+move_char:
+ stosb ; store char in token buffer
+ inc cx ; increment char count
+ inc [ELCNT] ; increment element count for * substi
+ return
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/dir.asm b/private/mvdm/dos/v86/cmd/command/dir.asm
new file mode 100644
index 000000000..7e23f78f8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/dir.asm
@@ -0,0 +1,3468 @@
+ page ,132
+ title DIR Internal Command
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;*** DIR.ASM - DIR internal command
+
+comment % =================================================================
+
+This module replaces TCMD1A.ASM. The old module was titled
+"PART4 COMMAND Transient routines".
+
+From residual documentation, I surmise that TCMD.ASM originally
+contained the internal commands DIR, PAUSE, ERASE, TYPE, VOL, and
+VER. The file seems to have been successively split:
+
+ TCMD -> TCMD1,TCMD2 -> TCMD1A,TCMD1B,TCMD2A,TCMD2B
+
+TCMD1A.ASM contained only the DIR command.
+
+Usage:
+------
+
+DIR <filespec> /w /p /b /s /l /o<sortorder> /a<attriblist>
+
+DIR /?
+
+
+<filespec> may include any or none of: drive; directory path;
+ wildcarded filename. If drive or directory path are
+ omitted, the current defaults are used. If the
+ file name or extension is omitted, wildcards are
+ assumed.
+
+/w Wide listing format. Files are displayed in compressed
+ 'name.ext' format. Subdirectory files are enclosed in
+ brackets, '[dirname]'.
+
+/p Paged, or prompted listing. A screenful is displayed
+ at a time. The name of the directory being listed appears
+ at the top of each page.
+
+ Bugbug: pages nead to be uniform length..?
+
+/b Bare listing format. Turns off /w or /p. Files are
+ listed in compressed 'name.ext' format, one per line,
+ without additional information. Good for making batch
+ files or for piping. When used with /s, complete
+ pathnames are listed.
+
+/s Descend subdirectory tree. Performs command on current
+ or specified directory, then for each subdirectory below
+ that directory. Directory header and footer is displayed
+ for each directory where matching files are found, unless
+ used with /b. /b suppresses headers and footers.
+
+ Tree is explored depth first, alphabetically within the
+ same level.
+
+ Bugbug: hidden directories aren't searched.
+
+/l Display file names, extensions and paths in lowercase. ;M010
+
+/o Sort order. /o alone sorts by default order (dirs-first, name,
+ extension). A sort order may be specified after /o. Any of
+ the following characters may be used: nedsg (name, extension,
+ date/time, size, group-dirs-first). Placing a '-' before any
+ letter causes a downward sort on that field. E.g., /oe-d
+ means sort first by extension in alphabetical order, then
+ within each extension sort by date and time in reverse chronological
+ order.
+
+/a Attribute selection. Without /a, hidden and system files
+ are suppressed from the listing. With /a alone, all files
+ are listed. An attribute list may follow /a, consisting of
+ any of the following characters: hsdar (hidden, system,
+ directory, archive, read-only). A '-' before any letter
+ means 'not' that attribute. E.g., /ar-d means files that
+ are marked read-only and are not directory files. Note
+ that hidden or system files may be included in the listing.
+ They are suppressed without /a but are treated like any other
+ attribute with /a.
+
+/? Help listing. Display DIR useage information. ;M008;Handled externally
+
+/h has been removed. ;M008
+
+DIRCMD An environment variable named DIRCMD is parsed before the
+ DIR command line. Any command line options may be specified
+ in DIRCMD, and become defaults. /? will be ignored in DIRCMD.
+ A filespec may be specified in DIRCMD and will be used unless
+ a filespec is specified on the command line. Any switch
+ specified in DIRCMD may be overridden on the command line.
+ If the original DIR default action is desired for a particular
+ switch, the switch letter may be preceded by a '-' on the
+ command line. E.g.,
+
+ /-w use long listing format
+ /-p don't page the listing
+ /-b don't use bare format
+ /-s don't descend subdirectory tree
+ /-o display files in disk order
+ /-a suppress hidden and system files
+
+
+Notes:
+------
+
+For sorted listings, file entries are loaded into the TPA buffer, which
+is usually about 64K in size. This allows sorts of up to 3000 files at
+a time. Each entry takes up 21 bytes in the buffer (see EntryStruc below).
+The byte after the last entry is 0FFh. The first byte of each entry is
+a flag byte which is made zero when the entry is loaded, and made one
+when the entry is used.
+
+
+Revision History
+================
+M01 md 7/13/90 Use ROM BIOS data area to obtain screen height
+ in the absence of ANSI.SYS
+
+M007 sa 8/1/90 Allow /p/b combination
+
+M008 sa 8/1/90 Remove /h parameter. Eliminate code used
+ to internally handle /? message.
+
+M010 sa 8/5/90 Add support for /l (lowercase) option.
+
+M011 sa 8/5/90 Patch up bug where MS-DOS does not load the
+ first FCB with the drive number when the drive
+ letter in the command line is preceded by a
+ switch. Now dir manually loads the drive
+ number after parsing.
+
+M018 md 8/12/90 Increment the screen height by 1 when obtained
+ from the ROM BIOS.
+
+M023 sa 8/31/90 Prevent DIR from failing if it encounters
+ a subdirectory having len(pathname)>MAXPATH.
+ Just skip over that subdirectory.
+
+M028 dbo 9/24/90 When country=US, sort by strict character
+ byte value, rather than collating table.
+ This to match MS-DOS Shell's sort order.
+
+========================================================================= %
+
+
+
+
+;*** SYMBOLS & MACROS
+
+ .xlist
+ .xcref
+
+ include comsw.asm ; get COMMAND version switches
+ include dossym.inc ; get DOS basic symbol set
+ include syscall.inc ; get DOS call names
+ include doscntry.inc ; get extended country info symbols
+ include bpb.inc
+ include filemode.inc
+ include find.inc
+ include comseg.asm ; define segment order
+ include comequ.asm ; get equates for COMMAND routines
+ include ioctl.inc ; get symbols for ioctl's
+ include rombios.inc ; get ROM BIOS data definition
+
+ .list
+ .cref
+
+ ;M008;NUM_DIR_SWS reduced by 2 for /h,/? not used
+ ;M010;NUM_DIR_SWS increased by 2 for /l,/-l
+NUM_DIR_SWS equ 14 ; # of dir switch synonyms in Dir_Sw_Ptrs list
+
+ ;M010;'lcase' replaces removed 'help' in OptionRec
+OptionRec record inmem:1,lcase:1,bare:1,subd:1,pagd:1,wide:1
+; on/off bit record for /l, /b, /s, /p, /w options
+; (order is hard-coded; see OnOffSw)
+; Inmem is set when entries are loaded in memory.
+
+NUM_ATTR_LTRS equ 6 ; length of attribute letter list
+NUM_ORDER_LTRS equ 5 ; length of sort order letter list
+
+ResultBuffer struc ; structure of parse result buffer
+ValueType db ?
+ValueTag db ?
+SynPtr dw ?
+ValuePtr dd ?
+ResultBuffer ends
+
+ErrorRec record baddir:1,dev:1
+; Error bits are:
+; Invalid directory format
+; File is device
+
+EntryStruc struc ; our private directory entry structure
+used db ? ; =0 until entry used, then =1
+filename db 8 dup (?) ; filename
+fileext db 3 dup (?) ; extension
+fileattr db ? ; file attributes
+filetime dw ? ; file time
+filedate dw ? ; file date
+filesize dd ? ; file size
+EntryStruc ends
+
+shove macro val ; hose-bag 8086 doesn't push immediate
+ mov ax,val ; invisible, dangerous use of AX!
+ push ax
+ endm
+
+
+
+
+;*** DATA
+
+DATARES segment public byte
+
+ extrn Append_Flag:byte ; true when APPEND needs to be reset
+ extrn Append_State:word ; state to reset APPEND to
+
+DATARES ends
+
+
+TRANDATA segment public byte
+
+ extrn AttrLtrs:byte ; list of attribute letters
+ extrn BadCd_Ptr:word ; "invalid directory" msg block
+ extrn Bytes_Ptr:word ; "%1 bytes" msg block
+ extrn BytMes_Ptr:word ; "%1 bytes free" msg block
+ extrn DirCont_Ptr:word ; "(continuing %1)" msg block
+ extrn DirDat_Yr:word ; year field of date msg block
+ extrn DirDat_Mo_Day:word ; month/day field of date msg block
+ extrn DirDatTim_Ptr:word ; date/time msg block
+ extrn DirEnvVar:byte ; DIR environment variable name
+ extrn DirHead_Ptr:word ; directory header message block
+ extrn DirMes_Ptr:word ; "%1 File(s)" msg block
+ extrn DirTim_Hr_Min:word ; time field of msg block
+ extrn Dir_Sw_Ptrs:word ; list of DIR switch synonym ptrs
+ extrn Disp_File_Size_Ptr:word ; file size message block
+ extrn DMes_Ptr:word ; <DIR> message block
+ extrn ErrParsEnv_Ptr:word ; "(Error occurred in env.." msg blk
+ extrn Extend_Buf_Ptr:word ; extended error message block
+ extrn Extend_Buf_Sub:byte ; # substitions in message block
+ extrn Msg_Disp_Class:byte ; message display class
+ extrn OrderLtrs:byte ; list of sort order letters
+ extrn Parse_Dir:byte ; DIR parse block
+ extrn String_Buf_Ptr:word ; message block ptr to string
+ extrn Tab_Ptr:word ; tab output block
+ extrn Total_Ptr:word ; "Total:" msg block
+
+TRANDATA ends
+
+
+TRANSPACE segment public byte
+
+ extrn AttrSelect:byte ; attribute select states -
+ extrn AttrSpecified:byte ; attribute mask -
+
+; Attribute conditions are recorded in two steps.
+; AttrSpecified indicates which attributes are to be checked.
+; AttrSelect indicates which state the specified attributes
+; must be in for a file to be included in the listing.
+; Attributes not indicated in AttrSpecified are ignored when
+; deciding which files to include.
+
+ extrn Bits:word ; some option flags (see OptionRec)
+ extrn BwdBuf:byte ; 'build working dir string' buf
+ extrn BytCnt:word ; # bytes in TPA
+ extrn Bytes_Free:word ; #bytes free for BytMes_Ptr msg block
+ extrn CharBuf:byte ; character string buffer
+ extrn ComSw:word ; error bits (see ErrorRec)
+ extrn CountryPtrInfo:byte ; buffer for collating table ptr
+ extrn CountryPtrId:byte ; info ID for collating table ptr
+ extrn CountryPtr:dword ; collating table ptr
+ extrn CurDrv:byte ; current drive # (0-based)
+ extrn DestBuf:byte ; null-terminated sort codes -
+
+; Sort order is specified as a series of 0 to 5 sort code
+; bytes, followed by a zero byte.
+; Codes are 1=name, 2=extension, 3=date&time, 4=size, and
+; 5=filetype (subdir or not).
+; Bit 7 of code is set for a downwards sort.
+
+ extrn DestIsDir:byte ; indicator of delim char's in path
+ extrn DestTail:word ; ptr to filename in pathname
+ extrn Dir_Num:word ; #files for DirMes_Ptr msg block
+ extrn DirBuf:byte ; DTA buffer for DOS calls
+ extrn DirFlag:byte ; signal to PathCrunch routine
+ extrn Display_Ioctl:word ; display info block for IOCTL call
+ extrn EndDestBuf:byte ; end of DestBuf (sort order codes)
+ extrn File_Size_High:word ; field for file size message block
+ extrn File_Size_Low:word ; field for file size message block
+ extrn FileCnt:word ; file count in a single directory
+ extrn FileCntTotal:dword ; file count in all directories
+ extrn FileSiz:dword ; file sizes in a single directory
+ extrn FileSizTotal:dword ; file sizes in all directories
+ extrn InternatVars:byte ; buffer for international info
+ extrn LeftOnLine:byte ; entries left on current display line
+ extrn LeftOnPage:word ; lines left on page
+ extrn LinPerPag:word ; lines/page entry in Display_Ioctl
+ extrn Msg_Numb:word ; extended error code
+ extrn OldCtrlCHandler:dword ; old int 23 vector
+ extrn Parse1_Syn:word ; ptr to matched synonym
+ extrn PathCnt:word ; length of pathname (see PathPos)
+ extrn PathPos:word ; ptr to pathname buffer (see SrcBuf)
+ extrn PerLine:byte ; # entries per line
+ extrn ResSeg:word ; RESGROUP seg addr
+ extrn ScanBuf:byte ; buffer for environment value and
+ ; subdirectory names
+ extrn SrcBuf:byte ; pathname buffer
+ extrn String_Ptr_2:word ; message substitution string ptr
+ extrn Tpa:word ; TPA buffer seg addr
+
+TRANSPACE ends
+
+
+
+
+;*** PRINCIPAL ROUTINES
+
+TRANCODE segment public byte
+
+ extrn CError:near ; COMMAND error recycle point
+
+ public Catalog ; our entry point
+
+ break <DIR (Catalog) principal routines>
+
+ assume cs:TRANGROUP,ds:TRANGROUP,es:nothing,ss:TRANGROUP
+
+; Bugbug: Each routine should start with it's own ASSUME.
+
+
+
+
+;*** Catalog - DIR command main routine
+;
+; ENTRY FCB #1 in PSP has drive# from cmd-line or default
+; Cmd-line tail text is at 81h, terminated by 0Dh
+; CS, DS, ES, SS = TRANGROUP seg addr
+; Tpa = TPA buffer seg addr
+; BytCnt = # bytes in TPA buffer
+;
+; EXIT nothing
+;
+; USED AX,BX,CX,DX,SI,DI,BP
+;
+; ERROR EXITS
+;
+; Errors are handled by setting up error message pointers
+; for Std_EPrintf and jumping to CError. Syntax errors in
+; the environment variable, however, are handled by printing
+; an error message and continuing.
+;
+; EFFECTS
+;
+; Directory listing is displayed (on standard output).
+; APPEND is disabled. HeadFix routine is expected to
+; restore APPEND state.
+; Working directory may be changed. The user's default
+; directory is saved and flagged for restoration by RestUDir
+; during COMMAND cycle.
+; Lots of variables may be changed in TRANSPACE segment.
+;
+; NOTES
+;
+; ES = TRANGROUP seg addr except when used to address the
+; the TPA buffer, where directory entries are loaded from disk.
+
+Catalog proc
+
+ call SetDefaults
+ call ParseEnvironment
+ call ParseCmdLine
+ jnc @F ; no parse error
+ jmp catErr ; error msg is set up
+@@: call SetOptions
+ call SetCollatingTable
+
+; Drive # to operate on has already been placed in FCB by
+; COMMAND preprocessing. OkVolArg & PathCrunch depend on that.
+
+ test Bits,mask bare
+ jnz @F ; don't display volume info for /b
+ invoke OkVolArg ; find & display volume info
+ sub LeftOnPage,2 ; record display lines used by volume info
+ jmp short catCrunch
+
+; OkVolArg side effects:
+; APPEND is disabled;
+; DTA established at DirBuf;
+; Filename fields in FCB are wildcarded.
+
+@@:
+; OkVolArg wasn't executed, so we have to do these ourselves.
+
+ invoke DisAppend ; disable APPEND
+
+ mov dx,offset TRANGROUP:DirBuf
+ mov ah,Set_DMA
+ int 21h ; set DTA
+
+ mov di,FCB ; ES:DI = ptr to FCB
+ inc di ; ES:DI = ptr to filename field of FCB
+ mov al,'?' ; AL = wildcard character
+ mov cx,11
+ rep stosb ; wildcard filename field
+
+catCrunch:
+ call CrunchPath ; crunch pathname to get directory and filename
+ jc catRecErr ; handle recorded or extended error
+
+; User's directory has been saved, we've changed to specified directory.
+; ComSw = error bits for later use
+; FCB contains parsed filename
+
+ cmp ComSw,0
+ jne catRecErr ; handle recorded error
+
+ call InstallCtrlC ; install control-C handler
+
+ call ZeroTotals ; zero grand totals
+ call ListDir ; list main directory
+ jc catExtErr
+
+ test Bits,mask subd
+ jz @F ; subdirectories option not set
+ call ListSubds ; list subdirectories
+ jc catExtErr
+@@:
+; Check if any files were found.
+
+ test Bits,mask bare
+ jnz catRet ; don't bother for bare format
+
+ mov ax,word ptr FileCntTotal
+ or ax,ax
+ jz catNoFiles ; no files found
+
+ call DisplayTotals ; display trailing grand totals
+ jmp short catRet ; all done
+
+catRecErr:
+
+; ComSw may have error bit set. If not, do extended error.
+
+ test ComSw,mask dev
+ jnz catNoFiles ; filename is device, respond 'file not found'
+
+ test ComSw,mask baddir
+ jz catExtErr ; no ComSw error bits, must be extended error
+ mov dx,offset TRANGROUP:BadCd_Ptr ; invalid directory
+ jmp short catErr
+
+catNoFiles:
+
+; Display header and force 'file not found' message.
+
+ call DisplayHeader
+ mov ax,ERROR_FILE_NOT_FOUND
+ mov Msg_Disp_Class,EXT_MSG_CLASS
+ mov dx,offset TRANGROUP:Extend_Buf_ptr
+ mov Extend_Buf_ptr,ax
+ jmp short catErr
+
+catExtErr:
+
+; DOS has returned an error status. Get the extended error#, and
+; set up an error message, changing 'No more files' error
+; to 'File not found' error.
+
+ invoke Set_Ext_Error_Msg
+ cmp Extend_Buf_Ptr,ERROR_NO_MORE_FILES
+ jne @F
+ mov Extend_Buf_Ptr,ERROR_FILE_NOT_FOUND
+@@:
+
+; Error exit. Error message information has been set up
+; for Std_EPrintf.
+
+catErr: jmp CError ; go to COMMAND error recycle point
+
+catRet: ret
+
+Catalog endp
+
+
+
+
+;*** SetDefaults - set default pathname, options
+;
+; ENTRY DS = TRANGROUP seg addr
+;
+; EXIT nothing
+;
+; USED AX,DI
+;
+; EFFECTS
+; SrcBuf = '*',EOL - default pathname
+; PathPos = ptr to pathname
+; PathCnt = length of pathname
+
+
+
+SetDefaults proc
+
+ mov di,offset TRANGROUP:SrcBuf ; DI = ptr to pathname buffer
+ mov PathPos,di ; PathPos = ptr to pathname
+ mov al,STAR
+ stosb
+ mov al,END_OF_LINE_IN
+ stosb ; SrcBuf = '*',0Dh
+ mov PathCnt,1 ; PathCnt = pathname length
+
+ xor ax,ax ; AX = 0
+ mov ComSw,ax ; = no error
+ mov Bits,ax ; = options off
+ mov DestBuf,al ; = no sort
+ mov AttrSpecified,ATTR_HIDDEN+ATTR_SYSTEM
+ mov AttrSelect,al ; exclude hidden, system files
+
+ ret
+
+SetDefaults endp
+
+
+
+
+;*** ParseEnvironment - find and parse our environment variable
+;
+; Find our environment variable and parse it. If a parse
+; error occurs, issue an error message. The parse results
+; up to the error will still have effect. Always leave
+; the option variables in a useable state.
+;
+; ENTRY DS = TRANGROUP seg addr
+;
+; EXIT nothing
+;
+; USED AX,BX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Bits may contain new option settings.
+; DestBuf may contain new series of sort codes.
+; AttrSpecified, AttrSelect may contain new attribute conditions.
+; SrcBuf may contain a new default pathname/filespec.
+; PathPos, PathCnt updated for new pathname.
+;
+; If a parse error occurred, an error message will be issued.
+
+ParseEnvironment proc
+
+ call GetEnvValue ; get environment variable value
+ jc peRet ; name not found in environment
+
+; SI = ptr to value of environment variable, in TRANGROUP seg
+
+ call ParseLine ; parse environment value
+ cmp ax,END_OF_LINE
+ je peRet ; successful completion
+
+; Some kind of parse error occurred.
+; We're set up for a Std_EPrintf call.
+
+ invoke Std_EPrintf ; display the parse error
+ mov Msg_Disp_Class,UTIL_MSG_CLASS ; restore default msg class
+
+ mov dx,offset TRANGROUP:ErrParsEnv_Ptr
+ invoke Printf_Crlf ; "(Error occurred in environment.."
+
+ ;M008;Internal handling of /? removed
+;peOk: and Bits,not mask help ; disallow /h in environment variable
+
+peRet: ret
+
+ParseEnvironment endp
+
+
+
+
+;*** ParseCmdLine - parse and record command line parameters
+;
+; ENTRY PSP offset 81h is beginning of cmd line buffer
+; DS, ES, CS = TRANGROUP seg addr
+;
+; EXIT CY = set if parse error occurred
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; AX = system parser error code
+; DX = ptr to message block
+;
+; USED AX,BX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Bits may contain new option settings.
+; DestBuf may contain new series of sort codes.
+; AttrSpecified, AttrSelect may contain new attribute conditions.
+; SrcBuf may contain a new default pathname/filespec.
+; PathPos, PathCnt updated for new pathname.
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; Msg_Disp_Class = parse error class
+; Byte after last parameter in text is zeroed to make ASCIIZ string
+; Message block (see DX) is set up for parse error message
+
+ParseCmdLine proc
+
+ mov si,81h ; SI = ptr to cmd-line tail text
+ call ParseLine ; parse cmd line tail
+ cmp AX,END_OF_LINE
+ je pcOk ; parse completed successfully
+
+; A parse error occurred. We're all set up for message output.
+
+ stc ; return failure
+ jmp short pcRet
+
+pcOk: clc ; return success
+
+pcRet: ret
+
+ParseCmdLine endp
+
+
+
+
+;*** SetCollatingTable - set up character collating table for sorting
+;
+; If country is other than USA, try to get a collating table
+; for character sorting. For USA, use straight byte values.
+; This is so DIR behaves like the MS-DOS Shell, which sorts
+; by straight byte values in the USA for better performance.
+;
+; ENTRY ES = TRANGROUP seg addr
+;
+; EXIT nothing
+;
+; USED AX,BX,CX,DX,DI
+;
+; EFFECTS
+;
+; If collating table is set -
+; CountryPtrId = 6.
+; CountryPtr points to collating table.
+;
+; Otherwise -
+; CountryPtrId = 0.
+
+SetCollatingTable proc
+
+; Begin modification M028
+
+ mov dx,offset TRANGROUP:InternatVars
+ ; DS:DX = ptr to international info buffer
+ mov ax,INTERNATIONAL shl 8
+ ; AX = 'Get current country info'
+ int 21h ; call DOS
+ jc scNoTable ; error - so don't collate
+
+; BX = country code
+
+ cmp bx,1
+ je scNoTable ; we're in USA, don't collate
+
+; End modification M028
+
+;* Country code is other than USA. Try to get a collating table.
+
+ mov ax,(GETEXTCNTRY shl 8) + SETCOLLATE
+ ; AH = 'Get Extended Country Info'
+ ; AL = 'Get Pointer to Collating Table'
+ mov bx,-1 ; BX = code page of interest = CON
+ mov cx,5 ; CX = length of info buffer
+ mov dx,bx ; DX = country ID = default
+ mov di,offset TRANGROUP:CountryPtrInfo
+ ; ES:DI = ptr to info buffer
+ int 21h ; call DOS
+ jnc scRet ; success
+
+;* Set CountryPtrId = 0 to signal no collating table.
+
+scNoTable: ;M028
+ mov CountryPtrId,0
+
+scRet: ret
+
+SetCollatingTable endp
+
+
+
+
+;*** SetOptions - check and set options
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED AX,BX,CX,DX
+;
+; EFFECTS
+;
+; Bits may contain modified option settings.
+; Display_Ioctl table, including LinPerPag variable, is filled in.
+; LeftOnPage is initialized to # lines till end of page is handled.
+; PerLine is set according to /w presence.
+
+SetOptions proc
+
+; If bare listing requested, cancel wide listings.
+
+ test Bits,mask bare
+ jz @F
+ and Bits,not mask wide ;M007;Allow /p with /b
+
+@@:
+
+; Set # lines per display page.
+
+;M01 Obtain screen height from ROM BIOS data area
+;
+;M01 mov LinPerPag,LINESPERPAGE ; default value
+
+ifndef JAPAN
+ push ds
+ MOV AX,ROMBIOS_DATA ; Get ROM Data segment
+ MOV DS,AX ;
+ Assume DS:ROMBIOS_DATA
+
+ MOV al,CRT_Rows ; Get max rows
+ pop ds ;
+ Assume DS:Trangroup
+
+ or al,al ; If zero specified
+ jnz @F ;
+endif
+ MOV al,LINESPERPAGE ; assume 24 rows
+
+@@:
+ xor ah,ah
+ifndef JAPAN
+ inc al ; height + 1 ;M018
+endif
+ mov LinPerPag,ax ; set the rows now
+
+; Now the console driver can change the rows if it knows better (M01 end)
+
+ mov ax,(IOCTL shl 8)+GENERIC_IOCTL_HANDLE ; IOCTL for handles
+ mov bx,STDOUT ; handle #
+ mov ch,IOC_SC ; screen
+ mov cl,GET_GENERIC ; get display info
+ mov dx,offset TRANGROUP:Display_Ioctl ; info block
+ int 21h ; call DOS
+
+ mov ax,LinPerPag ; AX = # lines per page
+ mov LeftOnPage,ax ; initialize # lines left on page
+
+; Set # entries per line.
+
+ mov PerLine,NORMPERLIN ; # entries per line without /w
+ test Bits,mask wide
+ jz @F
+ mov PerLine,WIDEPERLIN ; # entries per line with /w
+@@:
+ ;M011;start;The following code checks if a drive
+ ;letter has been parsed into SrcBuf, and if
+ ;so, the correct drive number is loaded into
+ ;the first FCB, at offset 5C.
+
+ cmp TRANGROUP:[SrcBuf+1],COLON_CHAR ; is this a drive letter?
+ jne soRet
+ mov al,TRANGROUP:[SrcBuf] ; load drive letter into al
+ and al,not 20h ; capitalize ASCII drive letter (LowerCase-32)-->UpperCase
+ sub al,'@' ; convert to 1-based number (1=A)
+ mov ds:FCB,al ; store in first FCB
+ ;M011;end
+soRet: ret
+
+SetOptions endp
+
+
+
+
+;*** CrunchPath - analyze supplied or default pathname
+;
+; ENTRY PathPos = ptr to pathname buffer
+; PathCnt = length of pathname, not incl trailing delimiter
+; Pathname in buffer must end in delimiter (like CR) and
+; must have space for another char after the delimiter.
+;
+; EXIT CY = clear if no error
+; We are changed to directory found in pathname
+; Previous directory ready to be restored via RestUDir
+; FCB filename fields contain filename (possibly w/ wildcards)
+;
+; If error occurred,
+; CY = set
+; ComSw = error bits (see ErrorRec)
+; If ComSw not set,
+; Ready for DOS Get Extended Error call
+
+
+CrunchPath proc
+
+ call FileIsDevice
+ jne @F ; not a device, skip ahead
+ or ComSw,mask dev ; signal file is device
+ jmp short cpErr ; return error
+@@:
+ push PathPos ; save ptr to pathname
+ mov DirFlag,-1 ; tell PathCrunch not to parse file into FCB
+ invoke PathCrunch ; change to directory in pathname
+ mov DirFlag,0 ; reset our little flag
+ pop si ; SI = ptr to pathname
+ jc cpNoDir ; didn't find directory path
+ jz cpRet ; found directory path w/ no filename
+ ; - leave wildcard default in FCB and return
+
+;* We found a directory, and there was a filename attached.
+; DestTail = ptr to ASCIIZ filename
+
+ mov si,DestTail ; SI = ptr to filename
+ jmp short cpFile ; go parse the file into FCB
+
+;* PathCrunch failed to find a directory in the pathname.
+;
+; Msg_Numb = error code
+; DestIsDir = nonzero if path delimiter char's occur in pathname
+; SI = ptr to pathname (now an ASCIIZ string)
+
+cpNoDir:
+ mov ax,Msg_Numb ; AX = error code from PathCrunch
+ or ax,ax
+ jnz cpErr ; error occurred - return it
+ cmp DestIsDir,0
+ je cpMaybe ; no path delimiters seen, maybe it's a file
+ or ComSw,mask baddir ; signal invalid directory name
+ jmp short cpErr ; return error
+
+cpMaybe:
+
+; SI = ptr to pathname
+
+ cmp byte ptr [si+1],COLON_CHAR
+ jnz @F ; no drive specifier, skip ahead
+ lodsw ; SI = ptr past drive specifier "d:"
+@@: cmp [si],".."
+ jne cpFile ; if not "..", treat as a file
+ cmp byte ptr [si+2],0
+ jne cpFile ; or if there's more after "..", treat as file
+ or ComSw,mask baddir ; signal invalid directory
+ jmp short cpErr ; return error
+
+; The preceding code was taken from the old DIR routine.
+; It's garbage, I'm afraid. It's meant to check for ".."
+; occurring when we're at the root directory. Too bad it
+; doesn't handle problems with "..\..", etc.
+
+
+; We're ready to parse a filename into the FCB.
+; SI = ptr to ASCIIZ filename
+
+cpFile: mov di,FCB ; DI = ptr to FCB
+ mov ax,(PARSE_FILE_DESCRIPTOR shl 8) or 0Eh
+ ; wildcards already in FCB used as defaults
+ int 21h
+ clc ; return success
+ jmp short cpRet
+
+cpErr: stc ; return error
+
+cpRet: ret
+
+CrunchPath endp
+
+
+
+
+;*** InstallCtrlC - install our private control-C handler
+;
+; Put our control-c handler in front of command.com's default
+; handler, to make sure the user's default directory gets restored.
+; This shouldn't be necessary, but, for now, there are situations
+; where the TDATA segment is left in a modified state when a
+; control-c occurs. This means that the transient will be
+; reloaded, and the user's directory cannot be restored.
+;
+; Bugbug: fix the wider problem? Involves message services. Ugly.
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED AX,BX,DX
+;
+; EFFECTS
+;
+; CtrlCHandler address placed in int 23 vector.
+;
+; NOTE
+;
+; Command.com's basic control-c handler will be restored
+; to the int 23 vector by the HeadFix routine, after DIR finishes.
+
+InstallCtrlC proc
+
+ push es ; preserve ES
+ mov ax,(GET_INTERRUPT_VECTOR shl 8) + 23h
+ int 21h
+ mov word ptr OldCtrlCHandler,bx ; save old int 23 vector
+ mov word ptr OldCtrlCHandler+2,es
+ pop es ; restore ES
+
+ mov dx,offset TRANGROUP:CtrlCHandler ; DS:DX = ptr to CtrlCHandler
+ mov ax,(SET_INTERRUPT_VECTOR shl 8) + 23h
+ int 21h
+ ret
+
+InstallCtrlC endp
+
+
+
+
+;*** ListSubds - search and list files in subdirectories
+;
+; ENTRY Current directory (on selected drive) is top of subdir tree
+; FCB is still set up for file searches
+; Bits, AttrSpecified, AttrSelect, DestBuf all still set up
+;
+; EXIT CY = clear if no error
+; FileCnt = # files found & displayed
+; FileSiz = total size of files found
+;
+; If error,
+; CY = set
+; Ready for DOS Get Extended Error call
+;
+; USED AX,BX,CX,DX,SI,DI,BP
+;
+; EFFECTS
+;
+; FileCntTotal, FileSizTotal are updated.
+; Subdirectories may be listed on standard output device.
+;
+; NOTES
+;
+; ListSubds seeds the recursive entry point lsNode with a ptr
+; to a buffer where we'll stack up subdirectory filenames.
+; Each name is stored ASCIIZ.
+
+ListSubds proc
+
+ invoke SetRest1 ; make sure user's dir gets restored
+
+ mov bx,offset TRANGROUP:ScanBuf ; BX = ptr to child name buffer
+
+lsNode:
+ mov byte ptr ds:[bx],0 ; start with null child name
+lsLoop:
+ call FindNextChild ; search for next subdirectory
+ jc lsErr ; search failed - examine error
+
+ mov dx,bx ; DX = ptr to child's name
+ call ChangeDir ; enter child directory
+
+ ; M023;start
+ jnc @F ; check for error
+ cmp ax,ERROR_PATH_NOT_FOUND ; error due to len(pathname)>MAXPATH?
+ je lsLoop ; yes, skip over this subdirectory
+ jmp SHORT lsRet ; no, other error: DIR must fail
+ ; M023;end
+
+@@: push bx
+ call ListDir ; list the directory
+ pop bx
+
+; Note we're ignoring errors returned here.
+
+ mov di,bx ; DI = ptr to child's name
+ mov cx,13 ; CX = max name length w/ null
+ xor al,al ; AL = zero byte to look for
+ repne scasb ; DI = ptr to next name pos'n in buf
+ push bx ; save ptr to child's name
+ mov bx,di ; BX = ptr to next name pos'n in buf
+ call lsNode ; recurse from new node
+ pop bx ; BX = ptr to child's name
+ pushf ; save error condition
+
+ shove 0
+ shove ".."
+ mov dx,sp ; DX = ptr to "..",0 on stack
+ call ChangeDir ; return to parent directory
+ pop ax ; restore stack
+ pop ax
+
+ popf ; restore error condition from child
+ jc lsRet ; return error
+
+ jmp lsLoop ; look for more children
+lsErr:
+ invoke Get_Ext_Error_Number ; AX = extended error code
+ cmp ax,ERROR_FILE_NOT_FOUND
+ je lsRet ; file not found, we're ok
+ cmp ax,ERROR_NO_MORE_FILES
+ je lsRet ; no more files, we're ok
+ stc ; return other errors
+
+lsRet: ret
+
+ListSubds endp
+
+
+
+
+ break <DIR support routines>
+
+;*** SUPPORT ROUTINES
+
+
+
+
+;*** CheckChild - check potential subdirectory name for FindNextChild
+;
+; ENTRY DirBuf contains DOS Find-buffer with potential child
+; BX = ptr to last child's name
+; BP = ptr to temp child's name
+;
+; EXIT nothing
+;
+; USED AX,CX,SI,DI
+;
+; EFFECTS
+;
+; Filename pointed to by BP may be changed.
+;
+; NOTES
+;
+; Potential filename replaces temp filename if:
+; it's a subdirectory file;
+; it doesn't start with a '.';
+; it's alphanumerically greater than last child's name;
+; and it's alphanumerically less than temp name.
+
+CheckChild proc
+
+ test DirBuf.find_buf_attr,ATTR_DIRECTORY
+ jz ccRet ; not a subdirectory file- return
+
+ cmp DirBuf.find_buf_pname,'.'
+ je ccRet ; starts with a dot- return
+
+ mov si,offset TRANGROUP:DirBuf+find_buf_pname
+ mov di,bx
+ call CmpAscz ; compare candidate to last child's name
+ jna ccRet ; it's not above it- return
+
+ mov si,offset TRANGROUP:DirBuf+find_buf_pname
+ mov di,bp
+ call CmpAscz ; compare candidate to temp name
+ jnb ccRet ; it's not below it- return
+
+; New kid is alright. Copy to temp.
+
+ mov si,offset TRANGROUP:DirBuf+find_buf_pname
+ mov di,bp
+ mov cx,13
+ rep movsb
+
+ccRet: ret
+
+CheckChild endp
+
+
+
+
+;*** CmpEntry - compare one directory entry to another in sort order
+;
+; Compare one directory entry against another according to
+; the sort codes in DestBuf. One or more comparisons
+; may be made of file name, extension, time/date, and
+; size. Comparisons may be made for upward or downward
+; sort order.
+;
+; ENTRY ES:BX = ptr to entry to compare
+; ES:BP = ptr to entry to be compared against
+; DestBuf contains sort codes (see DestBuf)
+; DS = TRANGROUP seg addr
+;
+; EXIT BX = unchanged
+; BP = unchanged
+; Condition flags set for same, above, or below
+; comparing BX entry against BP entry.
+; 'Same, above, below' translate to 'same, after, before'.
+;
+; USED: AX,CX,DX,SI,DI
+
+CmpEntry proc
+
+ mov si,offset TRANGROUP:DestBuf ; (DS:SI) = ptr to sort codes
+ceLoop:
+ xor ax,ax ; AX = 0
+ mov al,[si] ; AL = sort code
+ or al,al
+ jz ceDone ; sort code is zero, we're done
+ inc si ; DS:SI = ptr to next sort code
+ push si ; save ptr to next sort code
+ dec al
+ sal al,1 ; AX = index into cmp call table
+ ; CY set for downward sort order
+ mov si,ax ; SI = index into cmp call table
+ mov ax,cs:FieldCmps[si] ; AX = addr of compare routine
+ jc ceDn ; downwards sort - go swap entries
+ call ax ; do upwards sort
+ jmp short @F
+ceDn:
+ xchg bx,bp ; swap entry ptrs for downward sort order
+ call ax ; do sort
+ xchg bx,bp ; swap ptrs back
+@@:
+ pop si ; SI = ptr to next sort code
+ je ceLoop ; compare showed no difference, keep trying
+
+ceDone:
+
+; Get here either from unequal compare or sort code = 0.
+; In the latter case, condition codes indicate equality,
+; which is correct.
+
+ ret
+
+FieldCmps label word ; call table of entry comparisons
+ dw CmpName
+ dw CmpExt
+ dw CmpTime
+ dw CmpSize
+ dw CmpType
+
+CmpEntry endp
+
+
+
+
+;*** CmpName - compare file name of two entries
+;*** CmpExt - compare extension of two entries
+;
+; ENTRY ES:BX = ptr to one entry
+; ES:BP = ptr to another entry
+;
+; EXIT BX = unchanged
+; BP = unchanged
+; Condition flags set for same, above, or below
+; comparing BX entry to BP entry.
+;
+; USED: AX,CX,DX,SI,DI
+
+CmpName proc
+
+ mov si,bx ; ES:SI = ptr to BX entry
+ mov di,bp ; ES:DI = ptr to BP entry
+ add si,filename ; ES:SI = ptr to BX name
+ add di,filename ; ES:DI = ptr to BP name
+ mov cx,size filename; CX = length of name
+ jmp short CmpStr
+
+CmpExt: mov si,bx ; ES:SI = ptr to BX entry
+ mov di,bp ; ES:DI = ptr to BP entry
+ add si,fileext ; ES:SI = ptr to BX extension
+ add di,fileext ; ES:DI = ptr to BP extension
+ mov cx,size fileext ; CX = length of extension field
+
+; Bugbug: use symbol for subfunction code.
+
+CmpStr: cmp CountryPtrId,6
+ jne cnNoCollTable ; no collating table available
+
+;* Compare strings using collating table.
+;
+; ES:SI = ptr to 1st string
+; ES:DI = ptr to 2nd string
+; CX = length
+
+ push bp ; preserve BP
+ push bx ; preserve BX
+ push ds ; preserve DS
+ lds bx,CountryPtr ; DS:BX = ptr to collating table
+ assume ds:NOTHING
+ mov bp,ds:[bx] ; BP = size of collating table
+ inc bx
+ inc bx ; DS:BX = ptr to collating values
+ ; DS:[BX]-2 = size of table
+ xor ax,ax ; AX = 0 for starters
+
+; Bugbug: Investigate removing collating table length checks.
+
+cnNextChar:
+ mov al,es:[di] ; AL = AX = char from 2nd string
+ inc di ; ES:DI = ptr to next char 2nd string
+ cmp ax,bp ; compare to collating table length
+ jae @F ; char not in table
+ xlat
+@@: ; AL = AX = collating value
+ mov dx,ax ; DX = collating value from 2nd string
+ lods byte ptr es:[si] ; AL = AX = char from 1st string
+ ; ES:SI = ptr to next char 1st string
+ cmp ax,bp ; compare to collating table length
+ jae @F ; char not in table
+ xlat
+@@: ; AL = AX = collating value
+ cmp ax,dx ; compare collating values
+
+ifdef DBCS ; DBCS tail byte must not use
+ ; collating table
+ jnz cnNot_Same
+ mov al,es:[di-1] ; get previous 2nd string character
+ invoke testkanj
+ jz cnDo_Next ; if it was not DBCS lead byte
+ mov al,es:[di] ; get tail byte from 2nd string
+ cmp es:[si],al ; compare with 1st strings tail byte
+ jnz cnNot_Same
+ inc si ; pass tail byte
+ inc di
+ dec cx
+cnDo_Next:
+ loop cnNextChar
+cnNot_Same:
+
+else ; Not DBCS
+
+ loope cnNextChar ; until unequal or no more left
+endif
+
+ pop ds ; restore DS
+ assume ds:TRANGROUP
+ pop bx ; restore BX
+ pop bp ; restore BP
+ ret
+
+;* If no collating table is available, simply compare raw ASCII values.
+; Don't we wish we could just do this all the time? Sigh.
+
+cnNoCollTable:
+ rep cmps byte ptr es:[si],[di]
+ ret
+
+CmpName endp
+
+
+
+
+;*** CmpTime - compare entries by date/time
+;
+; ENTRY ES:BX = ptr to one entry
+; ES:BP = ptr to another entry
+;
+; EXIT BX = unchanged
+; BP = unchanged
+; Condition flags set for same, above, or below
+; comparing BX entry to BP entry.
+;
+; USED: CX,SI,DI
+;
+; NOTE Filetime and filedate fields in our private entry
+; structure must be adjacent and in that order.
+
+CmpTime proc
+
+ mov si,bx
+ mov di,bp
+ add si,filedate + size filedate - 1
+ add di,filedate + size filedate - 1
+ mov cx,size filetime + size filedate
+ std
+ repe cmps byte ptr es:[si],[di]
+ cld
+ ret
+
+CmpTime endp
+
+
+
+
+;*** CmpSize - compare entries by size
+;
+; ENTRY ES:BX = ptr to one entry
+; ES:BP = ptr to another entry
+;
+; EXIT BX = unchanged
+; BP = unchanged
+; Condition flags set for same, above, or below
+; comparing BX entry to BP entry.
+;
+; USED: CX,SI,DI
+
+CmpSize proc
+
+ mov si,bx
+ mov di,bp
+ add si,filesize + size filesize - 1
+ add di,filesize + size filesize - 1
+ mov cx,size filesize
+ std
+ repe cmps byte ptr es:[si],[di]
+ cld
+ ret
+
+CmpSize endp
+
+
+
+
+;*** CmpType - compare entries by file type (subdirectory or not)
+;
+; ENTRY ES:BX = ptr to one entry
+; ES:BP = ptr to another entry
+;
+; EXIT BX = unchanged
+; BP = unchanged
+; Condition flags set for same, above, or below
+; comparing BX entry to BP entry.
+;
+; USED: AX
+
+CmpType proc
+
+ mov al,es:[bx].fileattr
+ mov ah,es:[bp].fileattr
+ and ax,(ATTR_DIRECTORY shl 8) + ATTR_DIRECTORY
+ cmp ah,al
+ ret
+
+CmpType endp
+
+
+
+
+
+;*** DefaultAttr - set default attribute conditions
+;
+; ENTRY nothing
+;
+; EXIT CY clear
+;
+; USED
+;
+; EFFECTS
+;
+; AttrSpecified, AttrSelect are updated with new attribute conditions.
+
+DefaultAttr proc
+
+ mov AttrSpecified,ATTR_HIDDEN+ATTR_SYSTEM ; specify H and S
+ mov AttrSelect,0 ; H and S must be off
+ clc ; return success
+ ret
+
+DefaultAttr endp
+
+
+
+
+;*** DisplayTotals - display grand total stats
+;
+; If we searched subdirectories, display the total # files found
+; and total size of files found.
+; Display disk space remaining.
+;
+; ENTRY FileCntTotal, FileSizTotal contain correct values
+; Bits contains setting of /s
+; FCB contains drive #
+;
+; EXIT nothing
+;
+; USES AX,DX
+; FileSiz
+
+DisplayTotals proc
+
+ test Bits,mask subd
+ jz dtFree ; no subdirectories- do bytes free
+
+ invoke Crlf2 ; start on new line
+ call UseLine
+
+ mov dx,offset TRANGROUP:Total_Ptr
+ invoke Std_Printf ; "Total:",cr,lf
+ call UseLine
+
+ mov ax,word ptr FileCntTotal ; AX = # files found mod 64K
+ mov si,offset TRANGROUP:FileSizTotal
+ mov di,offset TRANGROUP:FileSiz
+ movsw
+ movsw ; move total size to size variable
+ call DisplayCntSiz ; display file count & size
+dtFree:
+ mov ah,GET_DRIVE_FREESPACE ; AH = DOS Get Free Space function
+ mov dl,byte ptr ds:FCB ; DL = drive#
+ int 21h ; call DOS
+ cmp ax,-1 ; check 'invalid drive' return code
+ jz dtRet ; can't get drive space - return
+ mul cx
+ mul bx
+ mov Bytes_Free,ax
+ mov Bytes_Free+2,dx
+ mov dx,offset TRANGROUP:BytMes_Ptr
+ invoke Std_Printf ; "nnn bytes free",cr,lf
+ call UseLine
+
+dtRet: ret
+
+DisplayTotals endp
+
+
+
+
+;*** FileIsDevice - see if file looks like a device
+;
+; ENTRY PathPos = ptr to pathname
+; PathCnt = length of pathname w/o terminating char
+; DirBuf is DOS DTA
+;
+; EXIT ZR = set if file looks like a device
+;
+; USED AX,BX,CX,DX,DI
+;
+; EFFECTS
+;
+; DTA buffer holds results of Find First function
+;
+; NOTES
+;
+; We try to flag devices in two ways. First, we try
+; the DOS Find First function. It returns attribute bit 6
+; set on a successful find if it identifies a device name.
+; Unfortunately, it returns 'path not found' for a device
+; name terminated with colon, such as "CON:". So, we look
+; for any colon in the pathname after the 2nd character,
+; and flag the pathname as a device if we find one.
+
+FileIsDevice proc
+
+ mov dx,PathPos ; DX = ptr to pathname
+
+ mov di,dx
+ add di,PathCnt ; DI = ptr to byte after pathname
+ xor bl,bl ; BL = NUL to terminate pathname with
+ xchg bl,byte ptr [di] ; BL = saved pathname terminating char
+
+ xor cx,cx ; CX = attribute mask (normal search)
+ mov ah,FIND_FIRST ; AH = DOS Find First function code
+ int 21h ; call DOS
+ xchg bl,byte ptr [di] ; restore pathname terminating char
+ jc piCol ; didn't find a dir entry, check for colon
+
+; Found a dir entry, see if Find First thinks it's a device.
+
+ test byte ptr DirBuf.Find_Buf_Attr,ATTR_DEVICE
+ jz piCol ; device attribute not set, look for colon
+ xor cx,cx ; it's a device, return ZR flag
+ jmp short piRet
+
+; Device attribute not returned by Find First function. But
+; let's check for a colon anywhere in the pathname after the
+; second byte.
+;
+; DI = ptr to byte after pathname
+
+piCol: dec di ; DI = ptr to last char in pathname
+ mov al,COLON_CHAR ; AL = colon char to search for
+ mov cx,PathCnt ; CX = # chars to scan
+ dec cx
+ dec cx ; ignore 1st two chars of pathname
+ or cx,cx
+ js piRet ; if < 2 chars in pathname, just return
+ or di,di ; clear ZR in case CX = 0
+ std ; scan downward
+ repne scasb
+ cld ; restore default upward direction
+
+; After scanning, the ZR flag is set to indicate presence of a colon.
+
+piRet: ret
+
+FileIsDevice endp
+
+
+
+
+;*** FindFirst - find first directory entry to display
+;*** FindNext - find next directory entry to display
+;
+; ENTRY Bits<inmem> = set if entries are loaded in TPA
+; AttrSpecified, AttrSelect are set
+;
+; EXIT CY = clear if successful
+; BX = offset in TPA buffer of directory entry found
+;
+; If unsuccessful,
+; CY = set
+; AX = DOS error code
+; DOS Get Extended Error call will get error code
+;
+; NOTE: if entries were loaded into TPA, AX contains
+; ERROR_NO_MORE_FILES when no more entries are available,
+; but DOS Get Extended Error call WON'T return the correct
+; error. That's ok, because we'll see the value in AX
+; and recognize it as a non-error condition.
+;
+; USED AX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Entries in memory may be marked as output.
+; If not sorted, entry is loaded at TPA.
+;
+; NOTES
+;
+; If we don't find a qualifying file, we return after the final
+; DOS Find File call. A DOS Get Extended Error call will then
+; indicate an appropriate condition.
+
+FindFirst proc
+
+ mov ax,offset TRANGROUP:GetFirst
+ jmp short ffFindEntry
+
+FindNext:
+ mov ax,offset TRANGROUP:GetNext
+
+; AX = address of correct disk get routine to use.
+
+ffFindEntry:
+ push es ; save TRANGROUP seg addr
+ test Bits,mask inmem
+ jz ffDisk ; entries not in memory, search disk
+
+; Entries are loaded in memory to sort out. Find the first one.
+; There will always be one, or LoadEntries would've failed.
+
+ call FindInMem ; find first entry in TPA
+ jmp short ffRet ; return what TPA search returns
+
+; Get entry from disk.
+
+ffDisk:
+ call ax ; get entry from disk
+ jc ffGetErr ; get & return error
+ mov es,Tpa ; ES = seg addr of TPA
+ xor di,di ; ES:DI = ptr to TPA
+ mov bx,di ; BX = offset of entry in TPA
+ call LoadEntry ; load entry to TPA
+ clc ; return success
+ jmp short ffRet
+
+ffGetErr:
+ invoke Get_Ext_Error_Number ; AX = DOS error code
+ stc
+
+ffRet: pop es ; ES = TRANGROUP seg addr again
+ ret
+
+FindFirst endp
+
+
+
+
+;*** FindInMem - find next directory entry in TPA buffer
+;
+; ENTRY TPA is loaded (see LoadEntries)
+;
+; EXIT BX = offset in TPA of entry found
+;
+; If no more files,
+; CY = set
+; AX = DOS 'no more files' error code
+;
+; USED AX,BX,CX,DX,SI,DI,BP,ES
+;
+; EFFECTS
+;
+; Entry found is flagged as 'used' (see EntryStruc).
+
+FindInMem proc
+
+ mov es,Tpa ; ES = TPA seg addr
+ xor bx,bx ; ES:BX = ptr to 1st entry in TPA
+ cld ; make sure default string direction is up
+
+ call FindOneInMem ; locate an entry
+ jc fiNoMore ; none left, set up 'no more files' error
+
+; BX = ptr to entry in TPA
+
+fiBest:
+ mov bp,bx ; BP = ptr to best entry so far
+fiNext:
+ call FindNextInMem ; locate next entry
+ jc fiFound ; no more, best entry so far wins
+
+; BX = ptr to next entry
+
+ call CmpEntry ; compare it to best found so far (BP)
+ jnb fiNext ; it's not better, go look at next one
+ jmp fiBest ; it's better, go mark it as best so far
+
+fiNoMore:
+
+; No more entries available in TPA. Set up 'no more files' error.
+
+ mov ax,ERROR_NO_MORE_FILES ; AX = 'no more files' error code
+ stc ; return error
+ jmp short fiRet
+
+fiFound:
+ mov bx,bp ; BX = ptr to best entry found
+ mov byte ptr es:[bx],1 ; mark entry 'used'
+ clc ; return success
+fiRet: ret
+
+FindInMem endp
+
+
+
+
+;*** FindNextChild - find next subdirectory in current directory
+;
+; ENTRY BX = ptr to last child found, ASCIIZ filename
+; DirBuf is established DTA
+;
+; EXIT BX = ptr (same addr) to next child found, ASCIIZ filename
+;
+; If failure,
+; CY = set
+; DOS Get Extended Error call will get error
+;
+; USED AX,CX,DX,SI,DI,BP
+;
+; EFFECTS
+;
+; DirBuf is used for find first/next calls.
+;
+; NOTES
+;
+; We keep on checking files until DOS returns an error. If
+; the error is 'no more files' and the temp filename is not
+; the initial high tag, copy the temp to the child's name spot
+; and return success. Otherwise, send the error back to caller.
+;
+; This routine depends on DS,ES,CS, & SS all being equal.
+
+FindNextChild proc
+
+ sub sp,12 ; make temp filename buf on stack
+ shove 00FFh ; temp filename = high tag
+ mov bp,sp ; BP = ptr to temp filename buf
+ shove "*"
+ shove ".*"
+ call GetDriveLtr ; AX = "d:"
+ push ax
+ mov dx,sp ; DX = ptr to "d:*.*",0 on stack
+
+; See that the stack is restored properly at the end of this proc.
+
+ mov cx,ATTR_DIRECTORY ; CX = attributes for file search
+ mov ah,FIND_FIRST
+ int 21h ; DOS- Find First matching file
+ jc fcRet ; return error
+
+ call CheckChild ; check child against last, temp
+
+fcNext: mov cx,ATTR_DIRECTORY ; CX = attributes for file search
+ mov ah,FIND_NEXT
+ int 21h ; DOS- Find Next matching file
+ jc fcErr ; examine error
+
+ call CheckChild ; check child against last, temp
+ jmp fcNext ; go find another child
+
+fcErr:
+ invoke Get_Ext_Error_Number ; AX = extended error code
+ cmp ax,ERROR_NO_MORE_FILES ; no more files?
+ jne short fcNope ; some other error- return it
+
+; We ran out of files. See if we qualified at least one.
+
+ cmp byte ptr [bp],0FFh
+ je fcNope ; temp filename is unused- no child
+
+; Move temp filename to child name position.
+
+ mov si,bp ; SI = ptr to temp filename
+ mov di,bx ; DI = ptr to child name pos'n
+fcMove: lodsb ; AL = next byte of filename
+ stosb ; store byte
+ or al,al
+ jz fcRet ; byte was zero, return success (CY clear)
+ jmp fcMove ; go move another byte
+
+fcNope: stc ; return error
+fcRet: lahf
+ add sp,20 ; restore stack
+ sahf
+ ret
+
+FindNextChild endp
+
+
+
+
+
+;*** FindOneInMem - find the first available entry in TPA
+;*** FindNextInMem - find the next available entry in TPA
+;
+; ENTRY ES = TPA seg addr
+; BX = ptr to entry in TPA
+;
+; EXIT BX = ptr to entry found
+; CY = set if no more entries available in TPA
+;
+; USED AL
+
+FindOneInMem proc
+
+ mov al,es:[bx] ; examine 'used' byte of starting entry
+ cmp al,1
+ je FindNextInMem ; entry has already been used
+ cmp al,0FFh
+ je foNoMore ; 0FFh, we're at the end of the list
+
+; BX = ptr to entry that hasn't been output yet.
+
+ clc ; return success
+ ret
+
+FindNextInMem:
+ add bx,size EntryStruc ; BX = ptr to next entry
+ jmp FindOneInMem ; go look at it
+
+foNoMore:
+ stc ; ran out of entries, return failure
+ ret
+
+FindOneInMem endp
+
+
+
+
+;*** GetEnvValue - get value of our environment variable
+;
+; ENTRY DS, ES = TRANGROUP seg addr
+;
+; EXIT CY = set if environment variable not in environment
+;
+; Otherwise:
+; SI = ptr to environment variable asciiz value in TRANGROUP
+;
+; USED AX,BX,CX,DX,DI
+; (We assume the (almost) worst, since we don't know about
+; Find_Name_In_Environment.)
+;
+; EFFECTS
+;
+; ScanBuf is loaded with value text
+
+GetEnvValue proc
+
+ push es ; save ES
+ mov si,offset TRANGROUP:DirEnvVar ; DS:SI = ptr to variable name
+ invoke Find_Name_In_Environment
+ jc geRet ; name not found in environment
+
+; ES:DI = ptr to value of environment variable
+; We're assuming DS, CS, and SS are unchanged.
+
+ push ds
+ push es
+ pop ds
+ pop es
+
+ assume ds:nothing
+
+; DS = seg addr of environment variable value (in environment segment)
+; ES = TRANGROUP seg addr
+
+ mov si,di ; DS:SI = ptr to value string
+ mov di,offset TRANGROUP:ScanBuf ; ES:DI = ptr to dest buffer
+@@: lodsb
+ or al,al
+ stosb
+ loopnz @B ; move the string, including trailing null
+
+ push es
+ pop ds ; DS = TRANGROUP seg addr again
+ assume ds:TRANGROUP
+
+ mov si,offset TRANGROUP:ScanBuf ; SI = ptr to var value
+geRet: pop es ; restore ES
+ ret
+
+GetEnvValue endp
+
+
+
+
+;*** GetFirst - get first directory entry from disk
+;
+; ENTRY DOS DTA established at DirBuf
+; FCB contains drive # and filename
+; Current directory (on selected drive) is the one to search
+; AttrSpecified & AttrSelect masks set
+;
+; EXIT CY = clear if success
+; DirBuf contains extended FCB for file found
+;
+; If unsuccessful,
+; CY = set
+; Ready for DOS Get Extended Error call
+;
+; USED AX,DX
+;
+; EFFECTS
+;
+; FCB-7 = 0FFh to mark extended FCB
+; FCB-1 = attribute mask to find all files
+; These fields should remain unmodified for GetNext calls.
+;
+;
+;*** GetNext - get next directory entry from disk
+;
+; ENTRY As for GetFirst, plus
+; FCB-7 set up as extended FCB w/ find-all attribute byte
+;
+; EXIT As for GetFirst
+;
+; USED AX,DX
+
+GetFirst proc
+
+ mov byte ptr ds:FCB-7,0FFh ; signal extended FCB
+ mov byte ptr ds:FCB-1,ATTR_ALL
+ ; find any file
+ mov dx,FCB-7 ; DX = ptr to extended FCB
+ mov ah,DIR_SEARCH_FIRST ; AH = DOS Find First function code
+ int 21h ; call DOS
+ shl al,1 ; CY = set if error
+ jc gfRet ; return error
+ jmp short gfFound ; go look at attr's
+
+GetNext:
+ mov dx,FCB-7 ; DX = ptr to extended FCB
+ mov ah,DIR_SEARCH_NEXT ; AH = DOS Find Next function code
+ int 21h ; call DOS
+ shl al,1 ; CY = set if error
+ jc gfRet ; return error
+
+;* Found an entry. Check attributes.
+
+gfFound:
+ mov al,[DirBuf+8].dir_attr ; AL = file attributes
+ mov ah,AttrSpecified ; AH = mask of pertinent attr's
+ and al,ah ; AL = pertinent attr's of file
+ and ah,AttrSelect ; AH = attr settings to match
+ cmp al,ah
+ jne GetNext ; attr's don't match, look for another
+
+gfRet: ret
+
+GetFirst endp
+
+
+
+
+;*** ListDir - search for and list files in the current directory
+;
+; List header, files, and trailer for current directory on selected
+; drive. Header & trailer are listed if at least one file is found.
+; If no qualifying files are found, no display output occurs.
+;
+; ENTRY Current directory (on selected drive) is the one to be listed
+; FCB contains selected drive # and filename spec
+; Option bits, attribute masks, and sort codes set up
+;
+; EXIT CY = clear if no error
+; FileCnt = # files found & displayed
+;
+; If error,
+; CY = set
+; Ready for DOS Get Extended Error call
+;
+; USED AX,BX,CX,DX,SI,DI,BP
+; FileSiz
+;
+; EFFECTS
+;
+; FileCntTotal, FileSizTotal are updated.
+; Files found are listed. A directory header and trailer are
+; displayed only if files are found.
+
+ListDir proc
+
+ xor ax,ax
+ mov FileCnt,ax ; zero file count
+ mov word ptr FileSiz,ax ; zero file size accumulator
+ mov word ptr FileSiz+2,ax
+
+ cmp DestBuf,0 ; check for sort code
+ je @F ; no sort
+ call LoadEntries ; load entries for sorted listing
+ jnc @F ; no error - continue
+ invoke Get_Ext_Error_Number ; AX = DOS error code
+ stc
+ jmp short ldErr ; return error
+@@:
+ call FindFirst ; find first file
+ jc ldErr ; not found, return error
+
+; BX = offset in TPA buffer of entry found
+
+ call DisplayHeader ; if at least one file, display header
+ call DisplayFile ; display the file entry
+ldNext:
+ call FindNext ; find another file
+ jc ldErr ; not found
+ call DisplayFile ; display entry
+ jmp ldNext ; go find another one
+
+ldErr:
+ cmp ax,ERROR_FILE_NOT_FOUND
+ je ldDone ; file not found, we're done
+ cmp ax,ERROR_NO_MORE_FILES
+ je ldDone ; no more files, we're done
+ stc
+ jmp short ldRet
+
+ldDone:
+ cmp FileCnt,0
+ je @F ; no files found, just return
+ call DisplayTrailer ; display trailing info
+@@: clc ; return success
+
+ldRet: ret
+
+ListDir endp
+
+
+
+
+;*** LoadEntries - attempt to load entries from current directory
+;
+; Load all qualifying directory entries from the current directory
+; into the TPA. If an error is returned by FindFirst/FindNext calls
+; other than 'no more files', return to caller with carry flag set.
+; If we run out of buffer space, display a message that we haven't
+; enough memory to sort this directory, but return without error.
+; Other routines know whether or not entries have been loaded by
+; the 'inmem' flag bit, which we set here.
+;
+; The TPA is usually 64K - 512 bytes long. At 20 bytes per entry,
+; this allows sorting over 3000 entries in a directory.
+;
+; ENTRY Tpa = buffer seg addr
+; BytCnt = buffer length, in bytes
+; Current directory (on selected drive) is the one to load
+; FCB contains drive # and filespec
+; Bits, AttrSpecified, AttrSelect, & DestBuf (sort codes) are set
+;
+; EXIT CY = set if error
+; If error, DOS Get Extended Error will get error info
+;
+; USED AX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Inmem bit of Bits = set if load succeeded.
+; Tpa buffer contains directory entries.
+; Byte after last entry = 0FFh.
+
+LoadEntries proc
+
+ push es ; save TRANGROUP seg addr
+ mov es,Tpa ; ES = TPA seg addr
+ xor di,di ; ES:DI = destination ptr
+ and Bits,not mask inmem ; signal entries not loaded
+
+ call GetFirst ; look for first file
+ jc leRet ; return any error
+ call LoadEntry ; load entry into TPA
+
+leNext: call GetNext ; get another file
+ jc leLoaded ; assume any error is no more files
+ mov ax,BytCnt ; AX = size of TPA
+ sub ax,di ; AX = bytes left in TPA
+ cmp ax,size EntryStruc+2 ; insist on entry size + 2 bytes
+ jb leOk ; not enough memory left, give up
+ call LoadEntry ; load entry into TPA
+ jmp leNext ; go get another file
+
+leLoaded:
+ mov byte ptr es:[di],0FFh ; mark end of entry list
+ or Bits,mask inmem ; signal entries loaded in memory
+leOk: clc ; return no error
+
+leRet: pop es ; ES = TRANGROUP seg addr again
+ ret
+
+LoadEntries endp
+
+
+
+
+;*** LoadEntry - load directory entry from DirBuf ext'd FCB
+;
+; ENTRY ES:DI = ptr to load point in TPA
+; DirBuf contains extended FCB of entry to load
+;
+; EXIT ES:DI = ptr to next byte available in TPA
+;
+; USED AX,CX,SI
+;
+; NOTES
+;
+; I could've used symbolic offsets and sizes of fields from
+; the dir_entry struc to do this, but this is time-critical,
+; so I hard-wired the structure of the DOS 4.x returned FCB,
+; as well as our private directory entry structure.
+;
+; We force a zero size for subdirectory files. A zero size is
+; ordinarily returned for subdirectories, but with Novell
+; Netware 286 or 386 loaded, we can't depend on it. Bug #1594.
+
+LoadEntry proc
+
+ mov si,offset TRANGROUP:Dirbuf+8 ; DS:SI = ptr to filename
+ xor al,al ; AL = 0
+ stosb ; 'used' byte = false
+ mov cx,11
+ rep movsb ; transfer filename & extension
+ lodsb ; AL = attrib byte
+ stosb ; store attrib byte
+ add si,dir_time-dir_attr-1 ; skip to time field
+ movsw ; transfer time
+ movsw ; transfer date
+ inc si ; skip alloc unit
+ inc si
+
+ and al,ATTR_DIRECTORY
+ jnz leSetDirSize ; force zero size for subdir
+
+ movsw
+ movsw ; transfer size
+ ret
+
+leSetDirSize:
+ xor ax,ax
+ stosw
+ stosw ; store zero size
+ ret
+
+LoadEntry endp
+
+
+
+
+;*** NoOrder - turn sorting off
+;
+; ENTRY nothing
+;
+; EXIT CY clear
+;
+; USED AX
+;
+; EFFECTS
+;
+; DestBuf is updated with sort code bytes. See DestBuf description.
+
+NoOrder proc
+
+ mov DestBuf,0 ; no sort
+ clc ; no error
+ ret
+
+NoOrder endp
+
+
+
+
+;*** OnOffSw - record occurence of on/off option switch
+;
+; ENTRY DI = index into word list of switches
+;
+; EXIT CY clear
+;
+; USED AX,CX
+;
+; EFFECTS
+;
+; Bits modified to indicate option state.
+
+OnOffSw proc
+
+ mov cx,di ; CX = index into word list of options
+ shr cx,1
+ shr cx,1 ; CX = bit position of option
+ mov ax,1
+ shl ax,cl ; AX = bit mask of option
+ test di,2 ; check if it is a negated option
+ jz @F ; it's negated
+ or Bits,ax ; turn option on
+ jmp short ooRet
+
+@@: not ax ; AX = complemented bit mask of option
+ and Bits,ax ; turn option off
+
+ooRet: clc ; always return success
+ ret
+
+OnOffSw endp
+
+
+
+
+;*** ParseAttr - parse and record /A option
+;
+; ENTRY BX = ptr to system parser result buffer for /A occurence
+;
+; EXIT CY = set if error occurs parsing attribute conditions
+;
+; For parse error, we set up for Std_EPrintf call:
+; AX = parse error code, like system parser
+; DX = ptr to message block
+;
+; USED AX,CX,DX,DI
+;
+; EFFECTS
+;
+; AttrSpecified, AttrSelect are updated with new attribute conditions.
+; If parse error occurs, attribute conditions parsed so far hold.
+;
+; For parse error, we set up for Std_EPrintf call:
+; Msg_Disp_Class = parse error message class
+; Message block (see DX) is set up for parse error message
+
+ParseAttr proc
+
+ push si ; save SI
+ mov AttrSpecified,0 ; cancel all attribute conditions
+
+; Each /A invocation starts by assuming all files are to be listed.
+
+ mov si,word ptr [bx].ValuePtr ; SI = ptr to string after /A
+
+paLoop: mov dx,1 ; DX = 1 (for un-negated attribute)
+
+ lodsb ; AL = next char in string
+ or al,al
+ jz paOk ; it's terminating null, we're done
+ cmp al,'-'
+ jne @F ; not '-', go look for letter
+ dec dx ; DX = 0 (for negated attribute)
+ lodsb ; AL = next char
+@@:
+ mov di,offset TRANGROUP:AttrLtrs ; DI = ptr to attrib letter list
+ mov cx,NUM_ATTR_LTRS ; CX = length of attrib letter list
+ repne scasb ; look for our letter in the list
+ jne paErr ; not found, return error
+
+ not cx
+ add cx,NUM_ATTR_LTRS ; CX = attrib bit #, 0-5
+
+; Note that we rely on AttrLtrs to be in the attribute bit order,
+; starting from bit 0.
+
+; Record this attribute bit in AttrSpecified.
+
+ mov al,1
+ shl al,cl ; AL = mask for our bit
+ or AttrSpecified,al ; set it in the 'specified' mask
+
+; Record the selected state for this attribute in AttrSelect.
+; DX = 0 or 1, the selected state for this attribute.
+
+ not al ; AL = mask for all other bits
+ and AttrSelect,al ; clear our bit
+ shl dl,cl ; DL = our bit state in position
+ or AttrSelect,dl ; set selected attr state
+ jmp paLoop ; go look at next char
+
+; The attribute letter string is invalid.
+
+paErr:
+ call SetupParamError ; set message up for Std_EPrintf
+ stc ; return error
+ jmp short paRet
+
+paOk: clc ; return success
+
+paRet: pop si ; restore SI
+ ret
+
+ParseAttr endp
+
+
+
+
+;*** ParseLine - parse a line of text
+;
+; Parse text until an EOL (CR or NUL) is found, or until a parse
+; error occurs.
+;
+; ENTRY DS:SI = ptr to text
+; CS, DS, ES = TRANGROUP seg addr
+;
+; EXIT AX = last return code from system parser
+; CX = # positional parameters (pathnames) found - 0 or 1
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; DX = ptr to message block
+;
+; USED BX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Bits may contain new option settings.
+; DestBuf may contain new series of sort codes.
+; AttrSpecified, AttrSelect may contain new attribute conditions.
+; SrcBuf may contain a new default pathname/filespec.
+; PathPos, PathCnt updated for new pathname.
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; Msg_Disp_Class = parse error class
+; Byte after last parameter in text is zeroed to make ASCIIZ string
+; Message block (see DX) is set up for parse error message
+
+ParseLine proc
+
+ mov di,offset TRANGROUP:Parse_Dir ; ES:DI = ptr to parse block
+ xor cx,cx ; CX = # positionals found
+plPars:
+ invoke Parse_With_Msg ; call parser
+ cmp ax,END_OF_LINE
+ je plRet ; EOL encountered, return
+ cmp ax,RESULT_NO_ERROR
+ jne plRet ; parse error occurred, return
+
+; Parse call succeeded. We have a filespec or a switch.
+; DX = ptr to result buffer
+
+ mov bx,dx ; BX = ptr to parse result buffer
+ cmp byte ptr [bx],RESULT_FILESPEC
+ je plFil ; we have a filespec
+
+ call ParseSwitch ; else we have a switch
+ jc plRet ; error parsing switch, return
+ jmp plPars ; parse more
+
+plFil: call CopyPathname ; copy pathname into our buffer
+ jmp plPars ; parse more
+
+plRet: ret
+
+ParseLine endp
+
+
+
+
+;*** ParseOrder - parse and record /O option
+;
+; ENTRY BX = ptr to system parser result buffer for /O occurence
+;
+; EXIT CY = set if error occurs parsing order
+;
+; For parse error, we set up for Std_EPrintf call:
+; AX = parse error code, like system parser
+; DX = ptr to message block
+;
+; USED AX,CX,DX,DI
+;
+; EFFECTS
+;
+; DestBuf is updated with sort code bytes. See DestBuf description.
+;
+; For parse error, we set up for Std_EPrintf call:
+; Msg_Disp_Class = parse error message class
+; Message block (see DX) is set up for parse error message
+
+ParseOrder proc
+
+ push si ; save SI
+ push bx ; save ptr to result buffer
+
+ mov si,word ptr [bx].ValuePtr ; SI = ptr to order letters
+ mov bx,offset TRANGROUP:DestBuf ; BX = ptr to sort code buffer
+ mov al,[si] ; AL = 1st char of order string
+ or al,al
+ jnz poLtr ; not NUL, go parse letters
+
+; We have /O alone. Set standard sort order.
+; Note hardwired dependency on character order in OrderLtrs.
+
+ mov byte ptr [bx],5 ; sort 1st by group (subdirs 1st)
+ inc bx
+ mov byte ptr [bx],1 ; then by name
+ inc bx
+ mov byte ptr [bx],2 ; then by extension
+ inc bx
+ jmp short poOk ; return success
+
+; We have /O<something>. Parse sort order letters.
+
+poLtr: xor dl,dl ; DL = 0 (upward sort)
+ lodsb ; AL = next sort order letter
+ or al,al
+ jz poOk ; NUL found, return success
+
+ cmp al,'-'
+ jne @F ; not '-', go look for letter
+ mov dl,80h ; DL = downward sort mask
+ lodsb ; AL = next char
+@@:
+ mov di,offset TRANGROUP:OrderLtrs ; DI = ptr to list of letters
+ mov cx,NUM_ORDER_LTRS ; CX = length of list
+ repne scasb ; look for our letter in the list
+ jne poErr ; not found, return error
+
+ neg cx
+ add cx,NUM_ORDER_LTRS ; CL = sort order code, 1-5
+ or cl,dl ; CL = sort code with up/dn bit
+ mov [bx],cl ; store sort order code in buffer
+ inc bx ; BX = ptr to next spot in buffer
+ cmp bx,offset TRANGROUP:EndDestBuf
+ jae poErr ; too many letters
+
+ jmp poLtr ; go look at next char
+
+; The sort order string is invalid.
+
+poErr: pop bx ; BX = ptr to result buffer
+ call SetupParamError ; set message up for Std_EPrintf
+ stc ; return failure
+ jmp short poRet
+
+poOk: mov byte ptr [bx],0 ; mark end of sort code list
+ pop bx ; BX = ptr to result buffer
+ clc ; return success
+
+poRet: pop si ; restore SI
+ ret
+
+ParseOrder endp
+
+
+
+
+;*** ParseSwitch - parse a switch
+;
+; ENTRY BX = ptr to parse result buffer after system parser processed
+; a switch
+;
+; EXIT CY = set if parse error occurred
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; AX = parse error code, like system parser
+; DX = ptr to message block
+;
+; USED AX,BX,DX
+;
+; EFFECTS
+;
+; Bits may contain new option settings.
+; DestBuf may contain new series of sort codes.
+; AttrSpecified, AttrSelect may contain new attribute conditions.
+;
+; If parse error occurred, we're set up for Std_EPrintf call:
+; Msg_Disp_Class = parse error class
+; Byte after last parameter in text is zeroed to make ASCIIZ string
+; Message block (see DX) is set up for parse error message
+
+ParseSwitch proc
+
+ push cx ; save CX
+ push di ; save DI
+
+ mov ax,[bx].SynPtr ; AX = synonym ptr
+ mov di,offset TRANGROUP:Dir_Sw_Ptrs
+ ; ES:DI = ptr to list of synonym ptrs
+ mov cx,NUM_DIR_SWS ; CX = # of dir switches in list
+ cld ; scan direction = upward
+ repne scasw ; locate synonym ptr in list
+ sub di,offset TRANGROUP:Dir_Sw_Ptrs + 2
+
+; DI = index into word list of synonym ptrs
+
+ call cs:SwHandlers[di] ; use same index into call table
+
+ pop di ; restore DI
+ pop cx ; restore CX
+
+ ret
+
+; Order in this table must correspond to order in Dir_Sw_Ptrs list.
+; Simple on/off switches must occur first in both lists, and must be
+; in order of option bits in Bits, starting with bit 0.
+
+SwHandlers label word
+ dw OnOffSw ; /-W
+ dw OnOffSw ; /W
+ dw OnOffSw ; /-P
+ dw OnOffSw ; /P
+ dw OnOffSw ; /-S
+ dw OnOffSw ; /S
+ dw OnOffSw ; /-B
+ dw OnOffSw ; /B
+ dw OnOffSw ; /-L ;M010
+ dw OnOffSw ; /L ;M010
+ dw NoOrder ; /-O
+ dw ParseOrder ; /O
+ dw DefaultAttr ; /-A
+ dw ParseAttr ; /A
+
+ParseSwitch endp
+
+
+
+ break <DIR utility routines>
+
+;*** UTILITY ROUTINES
+
+
+
+
+;*** ChangeDir - change directory on target drive
+;
+; ENTRY FCB contains drive #
+; DS:DX = ptr to ASCIIZ string w/o drive specifier
+;
+; EXIT Changed current directory on drive
+;
+; If error,
+; CY = set
+; DOS Get Extended Error call will get error
+;
+; USED AX,DX,SI,DI
+;
+; EFFECTS
+;
+; DirBuf is used to build "d:string".
+
+ChangeDir proc
+
+ mov di,offset TRANGROUP:DirBuf
+ call GetDriveLtr ; AX = "d:"
+ stosw ; put drive specifier in buffer
+ mov si,dx ; SI = ptr to argument string
+cdLoop:
+ lodsb
+ stosb ; move byte to buffer
+ or al,al
+ jne cdLoop ; continue until null transferred
+
+ mov dx,offset TRANGROUP:DirBuf ; DX = ptr to "d:string"
+ mov ah,CHDIR
+ int 21h ; change directory
+ ret ; return what CHDIR returns
+
+ChangeDir endp
+
+
+
+
+;*** CmpAscz - compare two ASCIIZ strings alphanumerically
+;
+; ENTRY DS:SI = ptr to one ASCIIZ string
+; ES:DI = ptr to another ASCIIZ string
+;
+; EXIT flags set after REPE CMPSB
+;
+; USED AL,CX,SI,DI
+;
+; NOTES
+;
+; Maximum run of comparison is length of DS:SI string.
+; This ensures that two identical strings followed by
+; random characters will compare correctly.
+
+CmpAscz proc
+
+ push di
+
+ mov di,si
+ xor al,al
+ mov cx,0FFFFh
+ repne scasb
+ not cx
+
+ pop di
+ repe cmpsb
+ ret
+
+CmpAscz endp
+
+
+
+
+;*** CopyPathname - copy pathname to our buffer
+;
+; ENTRY BX = ptr to parse result buffer after system parser processed
+; a filespec
+;
+; EXIT nothing
+;
+; USED AX
+;
+; EFFECTS
+;
+; SrcBuf may contain a new pathname/filespec.
+; PathPos, PathCnt updated for new pathname.
+
+CopyPathname proc
+
+ push si
+ lds si,dword ptr [bx].ValuePtr ; load far ptr from result buffer
+ invoke Move_To_SrcBuf ; copy pathname to SrcBuf
+ pop si
+ ret
+
+CopyPathname endp
+
+
+
+;*** CountFile - update counters with current file
+;
+; ENTRY BX = offset of entry in TPA buffer
+;
+; EXIT nothing
+;
+; USED AX,DX
+;
+; EFFECTS
+;
+; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated.
+
+CountFile proc
+
+ push es ; save TRANGROUP seg addr
+ mov es,Tpa ; ES = TPA seg addr
+
+ inc FileCnt ; # files this directory
+ inc word ptr FileCntTotal ; # files total
+ jnz @F
+ inc word ptr FileCntTotal+2
+@@:
+ mov ax,word ptr es:[bx].filesize ; AX = low word of file size
+ mov dx,word ptr es:[bx].filesize+2 ; DX = high word of file size
+ add word ptr FileSiz,ax
+ adc word ptr FileSiz+2,dx ; size of this directory
+ add word ptr FileSizTotal,ax
+ adc word ptr FileSizTotal+2,dx ; total size of files listed
+
+ pop es ; ES = TRANGROUP seg addr again
+ ret
+
+CountFile endp
+
+
+
+
+;*** DisplayBare - display filename in bare format
+;
+; ENTRY BX = offset of entry in TPA buffer
+;
+; EXIT DX = # char's displayed, including dot
+;
+; USED AX,CX,SI,DI
+;
+; EFFECTS
+;
+; Filename is displayed in name.ext format, followed by cr/lf.
+; If /s is on, complete pathname is displayed.
+;
+; NOTE
+;
+; Directory pseudofiles . and .. and suppressed in bare listing.
+
+DisplayBare proc
+
+; Suppress . and .. files from bare listing.
+
+ mov cx,ds ; CX = saved TRANGROUP seg addr
+ mov ds,Tpa ; DS:BX = ptr to file entry
+ assume ds:NOTHING
+ cmp ds:[bx].filename,'.' ; check 1st char of filename
+ mov ds,cx ; DS = TRANGROUP seg addr again
+ assume ds:TRANGROUP
+ je dbRet ; it's . or .. - don't display
+
+ test Bits,mask subd
+ jz dbNameExt ; not /s - display filename only
+
+ invoke Build_Dir_String
+ mov di,offset TRANGROUP:BwdBuf ; ES:DI = ptr to dir string
+
+ test Bits,mask lcase ;M010;check for lowercase option
+ jz @F ;M010;lowercase not needed
+ mov si,di ;M010;DS:SI --> ASCIIZ string in BwdBuf
+ call LowercaseString ;M010;path string is in BwdBuf
+
+@@: xor al,al ; AL = 0
+ mov cx,0FFFFh
+ cld
+ repne scasb ; ES:DI = ptr to byte after null
+ dec di ; ES:DI = ptr to null byte
+
+ifdef DBCS
+ push si
+ push di
+ mov si,offset TRANGROUP:BwdBuf
+ dec di
+ call CheckDBCSTailByte
+ pop di
+ pop si
+ jz dbTailByte ; if last char is double byte
+endif
+
+ cmp byte ptr es:[di-1],'\'
+ je @F ; already terminated w/ '\'
+
+ifdef DBCS
+dbTailByte:
+endif
+
+ mov ax,'\' ; AX = '\',0
+ stosw ; add to dir string
+@@:
+ mov String_Ptr_2,offset TRANGROUP:BwdBuf
+ mov dx,offset TRANGROUP:String_Buf_Ptr
+ invoke Std_Printf ; display device & directory path
+
+dbNameExt:
+ call DisplayDotForm ; display name.ext
+ invoke CrLf2 ; display cr/lf
+ call UseLine ;M007;Allow /p with /b
+dbRet: ret
+
+DisplayBare endp
+
+
+
+
+;*** DisplayDotForm - display filename in compressed dot format
+;
+; Display name.ext, with no cr/lf's. Dot is displayed only
+; if the filename has a nonblank extension.
+;
+; ENTRY BX = offset of entry in TPA buffer
+;
+; EXIT DX = # char's displayed, including dot
+;
+; USED AX,CX,SI,DI
+;
+; EFFECTS
+;
+; Filename is displayed in name.ext format.
+;
+; NOTE
+;
+; We allow for bogus filenames that have blanks embedded
+; in the name or extension.
+
+; Bugbug: might be a good performance gain if we buffered
+; up the output and used DOS function 9.
+
+DisplayDotForm proc
+
+ push ds ; save TRANGROUP seg addr
+ push es ; save ES
+ mov ax,cs:Tpa ; AX = TPA seg addr
+ mov ds,ax ; DS:BX = ptr to entry
+ assume ds:nothing
+ mov es,ax ; ES:BX = ptr to entry
+
+ mov di,bx ; ES:DI = ptr to entry
+ add di,filename + size filename - 1
+ ; ES:DI = ptr to last char in name field
+ mov cx,size filename ; CX = length of name field
+ mov al,' '
+ std ; scan down
+ repe scasb ; scan for nonblank
+
+; Assume file name has at least one character.
+
+ inc cx ; CX = # chars in name
+ mov dx,cx ; DX = # chars to be displayed
+
+ mov si,bx ; DS:SI = ptr to entry
+ add si,filename ; DS:SI = ptr to name
+
+NextNameChar:
+ cld
+ lodsb ; AL = next char
+
+ifdef DBCS
+ invoke testkanj
+ jz @f ; if this is not lead byte
+ invoke Print_Char ; display lead byte
+ dec cx
+ jz ExtChar ; if this is end
+ lodsb ; get tail byte
+ jmp short NameChar10 ; display tail byte
+@@:
+endif
+
+ test Bits,mask lcase ;M010;check for lowercase option
+ jz @F ;M010;lowercase not required
+ call LowerCase ;M010;filename char is in AL
+
+ifdef DBCS
+NameChar10:
+endif
+
+@@: invoke Print_Char ; display it
+ loop NextNameChar
+
+ifdef DBCS
+ExtChar:
+endif
+
+; Now do extension.
+
+ mov di,bx ; ES:DI = ptr to entry
+ add di,fileext + size fileext - 1
+ ; ES:DI = ptr to last char in ext field
+ mov cx,size fileext ; CX = length of ext field
+ mov al,' '
+ std ; scan down
+ repe scasb ; scan for nonblank
+ je ddDone ; no nonblank chars in ext
+
+ inc cx ; CX = # chars in ext
+ add dx,cx ; DX = total # chars to be displayed
+ inc dx ; including dot
+
+ mov al,'.'
+ invoke Print_Char
+ mov si,bx ; DS:SI = ptr to entry
+ add si,fileext ; DS:SI = ptr to ext
+
+NextExtChar:
+ cld
+ lodsb ; AL = next char
+
+ifdef DBCS
+ invoke testkanj
+ jz @f ; if this is not lead byte
+ invoke Print_Char ; display lead byte
+ dec cx
+ jz ddDone ; if this is end
+ lodsb ; get tail byte
+ jmp short ExtChar10 ; display tail byte
+@@:
+endif
+
+ test CS:Bits,mask lcase ;M010;check for lowercase option
+ jz @F ;M010;lowercase not required
+ call LowerCase ;M010;fileext char is in AL
+
+ifdef DBCS
+ExtChar10:
+endif
+
+@@: invoke Print_Char ; display it
+ loop NextExtChar
+
+ddDone: pop es ; restore ES
+ pop ds ; DS = TRANGROUP seg addr again
+ assume ds:TRANGROUP
+ cld ; leave direction flag = up
+ ret
+
+DisplayDotForm endp
+
+
+
+
+;*** DisplayFile - display file entry, update counters
+;
+; ENTRY BX = offset of entry in TPA buffer
+; Bits contains /w, /p settings
+;
+; EXIT nothing
+;
+; USED AX,CX,DX,SI,DI,BP
+;
+; EFFECTS
+;
+; Entry is displayed.
+; If not /b,
+; Cursor is left at end of entry on screen.
+; FileCnt, FileCntTotal, FileSiz, FileSizTotal are updated.
+; If /b,
+; Cursor is left at beginning of next line.
+; Cnt's and Siz's aren't updated.
+
+DisplayFile proc
+
+ test Bits,mask bare
+ jz dfNorm ; not /b - do normal display
+
+ call DisplayBare ; display file in bare format
+ jmp short dfRet
+
+dfNorm: call DisplayNext ; pos'n cursor for next entry
+ test Bits,mask wide
+ jz dfFull ; full format
+ call DisplayWide ; wide format
+ jmp short dfCnt
+
+dfFull: call DisplayName ; display filename & extension
+ call DisplayTheRest ; display size, date, time
+
+dfCnt: call CountFile ; update file counters
+dfRet: ret
+
+DisplayFile endp
+
+
+
+
+;*** DisplayHeader - display directory header of working directory
+;
+; ENTRY Current directory (on selected drive) is the one to display
+; LeftOnPage = # lines left on display page
+;
+; EXIT nothing
+;
+; ERROR EXIT
+;
+; Build_Dir_String will exit through CError with "Invalid drive
+; specification" if there's a problem obtaining the current
+; directory pathname.
+;
+; USED AX,DX,SI,DI
+;
+; EFFECTS
+;
+; BwdBuf (which is really the same buffer as DirBuf, which
+; we are using for the DTA) contains the directory string.
+; LeftOnPage is adjusted.
+
+DisplayHeader proc
+
+ test Bits,mask bare
+ jnz dhRet ; /b - don't display header
+
+ test Bits,mask subd
+ jz dhNorm ; not /s
+
+; For subdirectory listings, put a blank line before the header.
+
+ invoke Crlf2 ; start with a blank line
+ call UseLine
+ jmp short dhCom
+dhNorm:
+ mov al,BLANK ; if not /s, precede by a blank
+ invoke Print_Char ; print a leading blank
+dhCom:
+ invoke Build_Dir_String
+ mov dx,offset TRANGROUP:DirHead_ptr
+ invoke Std_Printf ; print header & cr/lf
+ call UseLine
+ invoke Crlf2 ; another cr/lf
+ call UseLine
+dhRet: ret
+
+DisplayHeader endp
+
+
+
+
+;*** DisplayName - display file name & extension
+;
+; ENTRY BX = offset of entry in TPA buffer
+;
+; EXIT nothing
+;
+; USED AX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Filename & extension are displayed in spread format.
+; Cursor is left at end of extension.
+
+DisplayName proc
+
+ push ds ; save TRANGROUP seg addr
+ mov ds,Tpa ; DS:BX = ptr to entry
+ assume ds:nothing
+ mov si,bx ; DS:SI = ptr to entry
+ add si,filename ; DS:SI = ptr to filename
+ mov di,offset TRANGROUP:CharBuf ; ES:DI = ptr to CharBuf
+
+ mov cx,8
+ cld
+ rep movsb ; move filename to CharBuf
+ mov al,' '
+ stosb ; add a blank
+ mov cx,3
+ rep movsb ; add extension
+ xor al,al
+ stosb ; add a NULL
+
+ pop ds ; DS = TRANGROUP seg addr again
+ assume ds:TRANGROUP
+
+ test Bits,mask lcase ;M010;check for lowercase option
+ jz @F ;M010;lowercase not required
+ mov si,offset TRANGROUP:CharBuf ;M010;DS:SI --> ASCIIZ string
+ call LowercaseString ;M010;filename.ext string is in CharBuf
+
+@@: mov String_Ptr_2,offset TRANGROUP:CharBuf
+ mov dx,offset TRANGROUP:String_Buf_Ptr
+ invoke Std_Printf ; print filename & extension
+ ret
+
+DisplayName endp
+
+
+
+
+;*** DisplayNext - move display cursor to next entry position
+;
+; ENTRY LeftOnLine = # entries can still be printed on this line
+; LeftOnPage = # lines can still be printed for this page
+; FileCnt = # files in this dir displayed before this one
+; Bits contains /w setting
+;
+; EXIT nothing
+;
+; USED AX,DX
+;
+; EFFECTS
+;
+; LeftOnLine will be updated to reflect the entry about to be
+; displayed.
+; LeftOnPage may be updated.
+
+DisplayNext proc
+
+ cmp FileCnt,0
+ je dn1st ; 1st file in directory
+ cmp LeftOnLine,0
+ jng dnEol ; no more room on this line
+
+; We are in wide mode (LeftOnLine is always 0 otherwise) and
+; we still have room for more on this line.
+; Tab to next position.
+
+ mov dx,offset TRANGROUP:Tab_Ptr
+ invoke Std_Printf
+ jmp short dnDone
+
+dnEol:
+
+; Start this entry on a new line.
+
+ invoke Crlf2 ; start on new line
+ call UseLine
+dn1st: mov al,PerLine
+ mov LeftOnLine,al ; reset # entries left on line
+
+dnDone: dec LeftOnLine ; reflect the entry about to be displayed
+ ret
+
+DisplayNext endp
+
+
+
+
+;*** DisplayTheRest - display file size/dir, date, time
+;
+; ENTRY BX = offset of entry in TPA buffer
+; Display cursor is at end of file extension
+;
+; EXIT nothing
+;
+; USED AX,CX,DX,SI,DI,BP
+;
+; EFFECTS
+;
+; File size, date, & time are displayed.
+
+DisplayTheRest proc
+
+ push es ; save TRANGROUP seg addr
+ mov es,Tpa ; ES = TPA seg addr
+ mov bp,bx ; BP = offset of entry in TPA
+ test es:[bp].fileattr,ATTR_DIRECTORY
+ jz drNonDir ; not a directory file
+
+; For a directory file, display <DIR> instead of size.
+
+ mov dx,offset TRANGROUP:DMes_Ptr
+ invoke Std_Printf
+ jmp short drCom ; skip to common fields
+
+drNonDir:
+
+; For a non-directory file, display file size.
+
+ mov dx,word ptr es:[bp].filesize
+ mov File_Size_Low,dx
+ mov dx,word ptr es:[bp].filesize+2
+ mov File_Size_High,dx
+ mov dx,offset TRANGROUP:Disp_File_Size_Ptr
+ invoke Std_Printf
+
+drCom:
+
+; For all files, display date & time.
+
+ mov ax,es:[bp].filedate ; AX = date word
+ or ax,ax ; test for null date (DOS 1.x)
+ jz drDone ; no date, skip date/time display
+ mov bx,ax ; BX = date word
+ and ax,1Fh ; AX = day of month
+ mov dl,al ; DL = day of month
+ mov ax,bx ; AX = date word
+ mov cl,5
+ shr ax,cl ; shift day out
+ and al,0Fh ; AL = month
+ mov dh,al ; DH = month
+ mov cl,bh
+ shr cl,1 ; CL = year - 1980
+ xor ch,ch ; CX = year - 1980
+ add cx,80 ; CX = 2-digit year
+ cmp cl,100
+ jb @F ; not year 2000 yet, skip ahead
+ sub cl,100 ; adjust for 21st century
+@@: xchg dh,dl ; DX = month/day
+ mov DirDat_Yr,cx ; move year to msg block
+ mov DirDat_Mo_Day,dx ; move month/day to msg block
+ mov cx,es:[bp].filetime ; CX = file time
+ jcxz drPrint ; no time field - go print
+ shr cx,1
+ shr cx,1
+ shr cx,1 ; CH = hours
+ shr cl,1
+ shr cl,1 ; CL = minutes
+ xchg ch,cl ; CX = hr/min
+ mov DirTim_Hr_Min,cx ; move time to msg block
+drPrint:mov dx,offset TRANGROUP:DirDatTim_Ptr
+ invoke Std_Printf ; print date & time
+
+drDone: pop es ; ES = TRANGROUP seg addr again
+ mov bx,bp ; BX = offset of entry in TPA again
+ ret
+
+DisplayTheRest endp
+
+
+
+
+;*** DisplayTrailer - display trailing lines for directory listing
+;
+; ENTRY LeftOnPage = # lines left on display page
+; FileCnt = # files listed
+; FileSiz = total size of files listed
+;
+; EXIT nothing
+;
+; USED
+;
+; EFFECTS
+;
+; Trailing info lines are displayed
+
+DisplayTrailer proc
+
+ test Bits,mask bare
+ jnz dtrRet ; /b - don't display trailer
+
+ invoke Crlf2 ; start on new line
+ call UseLine
+ mov ax,FileCnt ; AX = # files found
+
+DisplayCntSiz:
+
+; DisplayTotals uses this entry point.
+;
+; AX = # files
+; FileSiz = dword total size of files
+
+ mov Dir_Num,ax ; load # files
+ mov dx,offset TRANGROUP:DirMes_Ptr ; DX = ptr to message block
+ invoke Std_Printf ; "nnn File(s)"
+
+ mov dx,offset TRANGROUP:Bytes_Ptr
+ invoke Std_Printf ; "nnn bytes",cr,lf
+ call UseLine
+
+dtrRet: ret
+
+DisplayTrailer endp
+
+
+
+
+;*** DisplayWide - display filename in wide format
+;
+; ENTRY BX = offset of entry in TPA buffer
+;
+; EXIT nothing
+;
+; USED AX,CX,DX,SI,DI
+;
+; EFFECTS
+;
+; Name.ext is displayed. Cursor left at end of field (padded
+; with blanks). Subdirectory files are displayed as [name.ext].
+
+DisplayWide proc
+
+ push ds ; save TRANGROUP seg addr
+ mov ds,Tpa ; DS:BX = ptr to entry
+ assume ds:nothing
+
+ test ds:[bx].fileattr,ATTR_DIRECTORY
+ jz @F ; not a subdirectory file
+ mov al,'['
+ invoke Print_Char ; prefix subdirectory
+
+@@: call DisplayDotForm ; display name.ext
+
+; DX = # chars displayed in name.ext
+
+ test ds:[bx].fileattr,ATTR_DIRECTORY
+ jz @F ; not a subdirectory file
+ mov al,']'
+ invoke Print_Char ; postfix subdirectory
+@@:
+; Pad field with blanks.
+
+ mov cx,size filename + size fileext + 1
+ ; CX = field size
+ sub cx,dx ; CX = # pad char's
+ jcxz dwDone
+ mov al,' '
+
+@@: invoke Print_Char
+ loop @B
+
+dwDone: pop ds ; DS = TRANGROUP seg addr again
+ assume ds:TRANGROUP
+ ret
+
+DisplayWide endp
+
+
+
+
+;*** EndPage - end the current display page
+;
+; ENTRY LeftOnPage = # lines left on display page
+; Current directory (on selected drive) is the one being listed
+; Bits contains /p setting
+;
+; EXIT LeftOnPage = # lines left for next page
+;
+; USED AX,DX
+;
+; EFFECTS
+;
+; Pause is invoked to display a message and wait for a keystroke.
+; BwdBuf (same as DirBuf) used to build directory string.
+
+EndPage proc
+
+ test Bits,mask pagd
+ jz epNew ; paged display isn't enabled
+
+ push bx ; save BX
+ push cx ; save CX
+
+ invoke Pause ; "Press any key to continue..."
+
+ invoke Build_Dir_String
+ mov dx,offset TRANGROUP:DirCont_Ptr
+ invoke Printf_Crlf ; "(continuing <dir>)", cr/lf
+
+ pop cx ; restore CX
+ pop bx ; restore BX
+
+epNew: mov ax,LinPerPag ; AX = # lines per page
+ dec ax ; AX = # lines till next EndPage
+ mov LeftOnPage,ax ; LeftOnPage = countdown variable
+
+ ret
+
+EndPage endp
+
+
+
+
+;*** GetDriveLtr - get target drive letter
+;
+; ENTRY FCB contains drive #
+;
+; EXIT AX = "d:"
+;
+; USED nothing
+
+GetDriveLtr proc
+
+ mov al,ds:Fcb ; AL = target drive #
+ or al,al
+ jnz @F ; not current drive default, skip ahead
+ mov al,ds:CurDrv ; AL = current drive #
+ inc al ; AL = 1-based drive #
+@@: add al,'A'-1 ; AL = target drive letter
+ mov ah,':' ; AX = "d:"
+ ret
+
+GetDriveLtr endp
+
+
+
+
+
+;*** SetupParamError - set up for Std_EPrintf parameter parse error message
+;
+; Do for our /O and /A string parsers what Parse_With_Msg does
+; for system parser calls. Set up a message substitution block,
+; etc. for invalid value strings. I copied the procedure from
+; Setup_Parse_Error_Msg.
+;
+; ENTRY BX = ptr to system parser result buffer (contains ptr to str)
+;
+;
+; EXIT AX = system parser error return code for bad param format
+; DX = ptr to message description block for Std_EPrintf
+;
+; USED SI
+;
+; EFFECTS
+;
+; Msg_Disp_Class = parse error message class
+; Message block (see DX) is set up for parse error message
+
+SetupParamError proc
+
+ mov ax,9 ; parse error #
+ mov Msg_Disp_Class,PARSE_MSG_CLASS
+ mov Extend_Buf_Ptr,ax
+ mov si,word ptr [bx].ValuePtr
+ mov String_Ptr_2,si
+ mov Extend_Buf_Sub,ONE_SUBST
+ mov dx,offset TRANGROUP:Extend_Buf_Ptr
+ ret
+
+SetupParamError endp
+
+
+
+
+;*** UseLine - use a display line, start a new page if none left
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED flags
+
+UseLine proc
+
+ dec LeftOnPage
+ cmp LeftOnPage,2
+ ja ulRet
+ call EndPage
+ulRet: ret
+
+UseLine endp
+
+
+
+
+;*** ZeroTotals - zero grand total file count, size
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED AX
+;
+; EFFECTS
+;
+; FileCntTotal & FileSizTotal are zeroed.
+;
+; NOTES
+;
+; FileCntTotal & FileSizTotal must be juxtaposed, in that order.
+
+ZeroTotals proc
+
+ mov di,offset TRANGROUP:FileCntTotal
+ mov cx,size FileCntTotal+size FileSizTotal
+ xor al,al
+ rep stosb
+ ret
+
+ZeroTotals endp
+
+
+
+
+;*** CtrlCHandler - our own control-c handler
+;
+; Make sure user's default directory gets restored. See notes
+; at InstallCtrlCHandler.
+;
+; ENTRY control-c
+;
+; EXIT to OldCtrlCHandler
+;
+; USED DS,flags
+;
+; EFFECTS
+;
+; Restore user's default directory.
+;
+; NOTES
+;
+; This handler is only installed after calling PathCrunch,
+; which sets UserDir1, so the restoration will work.
+;
+; The original control-c vector will be restored, whether
+; or not this one is invoked, in the HeadFix routine.
+
+CtrlCHandler proc far
+
+;SR;
+; Save all registers used: ds, dx, ax. I know ax is being used by the
+;CtrlC handler, am not sure about ds & dx. Save them to be safe
+;
+ push ds
+ push cs
+ pop ds ; DS = TRANGROUP seg addr
+ push ax
+ push dx
+ invoke RestUDir ; restore user's default directory
+ pop dx
+ pop ax
+ pop ds
+ jmp cs:OldCtrlCHandler ; go to previous int 23 handler
+
+CtrlCHandler endp
+
+
+;M010;start
+;*** LowerCase - convert ASCII character in AL to lowercase
+;
+; ENTRY AL = character to be displayed
+;
+; EXIT AL is lowercase
+;
+; USED nothing
+
+LowerCase proc
+
+ assume ds:NOTHING,es:NOTHING
+
+ cmp al,'A' ; ensure AL is in range 'A'-'Z'
+ jb lcRet
+ cmp al,'Z'
+ ja lcRet
+
+ or al,20h ; convert to ASCII lowercase (UpperCase+32)-->LowerCase
+
+lcRet: ret
+
+LowerCase endp
+
+
+
+
+;*** LowercaseString - convert ASCIIZ string at DS:SI to lowercase
+;
+; ENTRY DS:SI points to start of ASCIIZ string
+; ES = DS
+;
+; EXIT nothing
+;
+; USED AL,SI
+
+LowercaseString proc
+
+ assume ds:NOTHING,es:NOTHING
+
+ push di ; save di
+ mov di,si ; ES:DI --> ASCIIZ string
+ cld
+
+NextChar:
+ lodsb ; get character from string into al
+ or al,al ; are we at end of string?
+ jz EndOfString
+
+ifdef DBCS
+ invoke testkanj
+ jz @f ; if this is not lead byte
+ stosb ; store lead byte
+ lodsb ; get tail byte
+ or al,al
+ jz EndOfString ; if end
+ stosb ; store tail byte
+ jmp short NextChar
+@@:
+endif
+
+ call LowerCase ; convert character to lowercase
+ stosb ; store character back into buffer
+ jmp SHORT NextChar ; repeat until end of string
+
+EndOfString:
+ pop di ; restore di
+ ret
+
+LowercaseString endp
+;M010;end
+
+ifdef DBCS
+;
+; Check if the character position is at Tail Byte of DBCS
+;
+; input: ds:si = start address of the string
+; ds:di = character position to check
+; output: ZF = 1 if at Tail Byte
+;
+CheckDBCSTailByte proc near
+ push ax
+ push cx
+ push di
+ mov cx,di ; save character position
+cdtb_check:
+ cmp di,si
+ jz cdtb_next ; if at the top
+ dec di ; go back
+ mov al,[di] ; get character
+ invoke testkanj
+ jnz cdtb_check ; if DBCS lead byte do next
+ inc di ; adjust
+cdtb_next:
+ sub cx,di ; if the length is odd then
+ xor cl,1 ; the character position is
+ test cl,1 ; at the tail byte
+ pop di
+ pop cx
+ pop ax
+ ret
+CheckDBCSTailByte endp
+endif
+
+
+TRANCODE ends
+
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/envdata.asm b/private/mvdm/dos/v86/cmd/command/envdata.asm
new file mode 100644
index 000000000..a1809ce71
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/envdata.asm
@@ -0,0 +1,23 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)envdata.asm 1.1 85/05/14
+; SCCSID = @(#)envdata.asm 1.1 85/05/14
+; This file is included by command.asm and is used as the default command
+; environment.
+
+Environment Struc ; Default COMMAND environment
+
+Env_PathString db "path="
+ db 0 ; Null path
+Env_Comstring db "comspec="
+Env_Ecomspec db "\command.com" ;AC062
+ db 134 dup (0)
+
+Environment ends
+
+ENVIRONSIZ equ SIZE Environment
+ENVIRONSIZ2 equ SIZE Environment - Env_Ecomspec
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/fordata.asm b/private/mvdm/dos/v86/cmd/command/fordata.asm
new file mode 100644
index 000000000..c49aea55c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/fordata.asm
@@ -0,0 +1,25 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)fordata.asm 1.1 85/05/14
+; SCCSID = @(#)fordata.asm 1.1 85/05/14
+; Data structure definitions included by tfor.asm
+
+for_info STRUC
+ for_args DB (SIZE arg_unit) DUP (?) ; argv[] structure
+ FOR_COM_START DB (?) ; beginning of <command>
+ FOR_EXPAND DW (?) ; * or ? item in <list>?
+ FOR_MINARG DW (?) ; beginning of <list>
+ FOR_MAXARG DW (?) ; end of <list>
+ forbuf DW 64 DUP (?) ; temporary buffer
+ fordma DW 64 DUP (?) ; FindFirst/Next buffer
+ FOR_VAR DB (?) ; loop control variable
+for_info ENDS
+
+; empty segment done for bogus addressing
+for_segment segment
+f LABEL BYTE
+for_segment ends
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/help.skl b/private/mvdm/dos/v86/cmd/command/help.skl
new file mode 100644
index 000000000..8ab3e3ff4
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/help.skl
@@ -0,0 +1,62 @@
+:def 0300 BREAK /?
+:def 0301 BREAK /?
+:def 0320 CHCP /?
+:def 0321 CHCP /?
+:def 0322 CHCP /?
+:def 0340 CD /?
+:def 0341 CD /?
+:def 0342 CD /?
+:def 0360 CLS /?
+:def 0361 CLS /?
+:def 0380 COMMAND /?
+:def 0381 COMMAND /?
+:def 0382 COMMAND /?
+:def 0383 COMMAND /?
+:def 0384 COMMAND /?
+:def 0385 COMMAND /?
+:def 0386 COMMAND /?
+:def 0400 COPY /?
+:def 0401 COPY /?
+:def 0402 COPY /?
+:def 0403 COPY /?
+:def 0404 COPY /?
+:def 0420 CTTY /?
+:def 0421 CTTY /?
+:def 0440 DATE /?
+:def 0441 DATE /?
+:def 0460 DEL /?
+:def 0461 DEL /?
+:def 0462 DEL /?
+:def 0480 DIR /?
+:def 0481 DIR /?
+:def 0482 DIR /?
+:def 0483 DIR /?
+:def 0484 DIR /?
+:def 0485 DIR /?
+:def 0486 DIR /?
+:def 0487 DIR /?
+:def 0500 EXIT /?
+:def 0501 EXIT /?
+:def 0520 MD /?
+:def 0521 MD /?
+:def 0540 PATH /?
+:def 0541 PATH /?
+:def 0560 PROMPT /?
+:def 0561 PROMPT /?
+:def 0562 PROMPT /?
+:def 0580 RD /?
+:def 0581 RD /?
+:def 0600 REN /?
+:def 0601 REN /?
+:def 0620 SET /?
+:def 0621 SET /?
+:def 0640 TIME /?
+:def 0641 TIME /?
+:def 0660 TYPE /?
+:def 0661 TYPE /?
+:def 0680 VER /?
+:def 0681 VER /?
+:def 0700 VERIFY /?
+:def 0701 VERIFY /?
+:def 0720 VOL /?
+:def 0721 VOL /?
diff --git a/private/mvdm/dos/v86/cmd/command/ifequ.asm b/private/mvdm/dos/v86/cmd/command/ifequ.asm
new file mode 100644
index 000000000..b0d5ec33e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/ifequ.asm
@@ -0,0 +1,19 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)ifequ.asm 1.1 85/05/14
+; SCCSID = @(#)ifequ.asm 1.1 85/05/14
+;*************************************
+; COMMAND EQUs which are switch dependant
+
+IF1
+ IF IBM
+ %OUT DBCS Enabled IBM version
+ ELSE
+ %OUT Normal version
+ ENDIF
+
+ENDIF
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/init.asm b/private/mvdm/dos/v86/cmd/command/init.asm
new file mode 100644
index 000000000..4f3a50493
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/init.asm
@@ -0,0 +1,2533 @@
+ page ,132
+ title COMMAND Initialization
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+; M002 SR 07/15/90 Resize right at the start because
+; Carousel depends on it.
+;
+; M004 SR 07/17/90 Initialization reworked so that
+; transient is now moved at EndInit.
+; The old approach assumed that the
+; biggest block is the one currently
+; loaded in, an assumption not true
+; for UMBs.
+;
+; M005 SR 07/20/90 Numerous hacks for Carousel
+; 1. Set CurrentPDB to ours at start
+; 2. Normalize cs:ip of int 2fh hook
+; so that cs is different.
+;
+; M013 SR 08/06/90 Fixed Setup_res_end & Move_res_code
+; to use new GetVersion call that
+; returns info about whether DOS is in
+; HMA or not.
+;
+; M015 SR 08/09/90 Increased default environment size to
+; 256 bytes from 160 bytes
+;
+; M026 SR 9/12/90 Fixed environment trashing on second
+; Command if new comspec is given.
+;
+; M030 SR 10/3/90 Before calling int 2fh 4a02h, set di
+; to 0ffffh so that we are ok if no one
+; answers this int 2fh.
+;
+; M042 SR 12/13/90 Bug #4660. Changed setup_res_end to
+; take care of the dummy segment that
+; adds a para to the resident size.
+;
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include pdb.inc
+ include mult.inc
+ include syscall.inc
+ include doscntry.inc
+ include comseg.asm
+ include comequ.asm
+ include resmsg.equ
+
+ include envdata.asm
+ include xmm.inc
+ include cmdsvc.inc
+ include dossvc.inc
+.list
+.cref
+
+
+
+ENVBIG equ 32768
+ENVSML equ 256 ;Increased to 256 ; M015
+KOREA_COUNTRY_CODE equ 82
+
+
+CODERES segment public byte
+
+ extrn ContC :near
+ extrn DskErr :near
+ extrn Int_2e :near
+ extrn LodCom :near
+ extrn MsgInt2fHandler :far
+ extrn SetVect :near
+ extrn ChkSum :near
+ extrn CrLf :near
+ extrn LoadCom :near
+ extrn RPrint :near
+
+ extrn EndCode :byte
+ extrn StartCode :byte
+
+ ifdef DBCS
+ extrn ItestKanj :near
+ endif
+
+ extrn BadMemErr :near
+
+CODERES ends
+
+DATARES segment public byte
+
+ extrn Abort_Char :byte
+ extrn AccDen :byte
+ extrn Append_State :word
+ extrn Batch :word
+ extrn Com_Fcb1 :dword
+ extrn Com_Fcb2 :dword
+ extrn Com_Ptr :dword
+ extrn ComDrv :byte
+ extrn ComSpec :byte
+ extrn ComSpec_End :word
+ extrn Crit_Msg_Off :word
+ extrn Crit_Msg_Seg :word
+ extrn DataResEnd :byte
+ extrn Dbcs_Vector_Addr :word
+ extrn EchoFlag :byte
+ extrn EnvirSeg :word
+ extrn ExtMsgEnd :byte
+ extrn fFail :byte
+ extrn FUCase_addr :word
+ extrn InitFlag :byte
+ extrn Int2fHandler :dword
+ extrn Io_Save :word
+ extrn Io_Stderr :byte
+ extrn LTpa :word
+ extrn MemSiz :word
+ extrn MySeg :word
+ extrn MySeg1 :word
+ extrn MySeg2 :word
+ extrn MySeg3 :word
+ extrn Nest :word
+ extrn OldTerm :dword
+ extrn Parent :word
+ extrn ParseMes_Ptr :word
+ extrn ParsMsgPtrs :word
+ extrn PermCom :byte
+ extrn PutBackDrv :byte
+ extrn PutBackComSpec :byte
+ extrn RDirChar :byte
+ extrn Res_Tpa :word
+ extrn ResMsgEnd :word
+ extrn RSwitChar :byte
+ extrn SingleCom :word
+ extrn Sum :word
+ extrn TrnSeg :word
+ extrn TrnMvFlg :byte
+
+ extrn ResSize :word
+ extrn RStack :word
+
+ extrn ComInHMA :byte ;flag set if in HMA
+ extrn XMMCallAddr :dword ;far call address to XMM
+ EXTRN SCS_CMDPROMPT :BYTE
+ EXTRN SCS_DOSONLY :BYTE
+
+;
+;All far pointers to resident routines that are to be patched
+;
+ extrn Int2f_Entry :dword
+ extrn Int2e_Entry :dword
+ extrn Ctrlc_Entry :dword
+ extrn CritErr_Entry :dword
+
+ extrn Int2f_Trap :near
+ extrn Int2e_Trap :near
+ extrn Ctrlc_Trap :near
+ extrn CritErr_Trap :near
+ extrn LodCom_Trap :near
+
+ EXTRN SCS_PAUSE:BYTE ; yst
+
+ extrn EndInit :near
+
+ extrn Carousel_i2f_Hook :byte ; M005
+
+ extrn SCS_REENTERED :byte
+ extrn SCS_FIRSTCOM :byte
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+ extrn Beta3Warned:byte
+endif
+
+
+DATARES ends
+
+
+;;ENVIRONMENT segment public para ; default COMMAND environment
+;;
+;; extrn EComSpec :byte
+;; extrn EnvirEnd :byte
+;; extrn PathString :byte
+;;
+;;ENVIRONMENT ends
+
+
+TAIL segment public para
+
+ extrn TranStart :word
+
+TAIL ends
+
+
+TRANCODE segment public byte
+
+ extrn DatInit :far
+
+TRANCODE ends
+
+TRANDATA segment
+
+ extrn TranDataEnd :byte
+
+TRANDATA ends
+
+TRANSPACE segment public byte
+
+ extrn TranSpaceEnd :byte
+
+TRANSPACE ends
+
+
+
+
+; *******************************************************************
+; START OF INIT PORTION
+; This code is deallocated after initialization.
+
+INIT SEGMENT PUBLIC PARA
+
+;NTVDM not used extrn AutoBat :byte
+ extrn BadComAccMsg :byte
+ extrn BadComLkMsg :byte
+ extrn Badcspfl :byte
+ extrn BadVerMsg :byte
+
+ extrn Chuckenv :byte
+ extrn Command_?_syn :byte
+ extrn Command_c_syn :byte
+ extrn Command_d_syn :byte
+ extrn Command_e_syn :byte
+ extrn Command_f_syn :byte
+ extrn Command_m_syn :byte
+ extrn Command_p_syn :byte
+ extrn Command_z_syn :byte
+ extrn Comnd1_syn :word
+ extrn Comnd1_addr :dword
+ extrn ComSpect :byte
+ extrn ComspString :byte
+ extrn CopyrightMsg :byte
+ extrn Dswitch :byte
+;; extrn Ecomloc :word
+ extrn EnvMax :word
+ extrn EnvSiz :word
+ extrn EqualSign :byte
+ extrn Eswitch :byte
+ extrn Ext_msg :byte
+ extrn HelpMsgs:word
+ extrn InitAdd :dword
+ extrn InitEnd :word
+ extrn Init_Parse :dword
+ extrn Internat_Info :byte
+; NTVDM not used extrn KautoBat :byte
+ extrn Lcasea :byte
+ extrn Lcasez :byte
+ extrn Num_positionals :word
+ extrn OldEnv :word
+ extrn Old_parse_ptr :word
+ extrn OutEnvMsg :byte
+ extrn Parse_command :byte
+ extrn PrdAttm :byte
+ extrn ResetEnv :word
+ extrn Scswitch :byte
+ extrn Space :byte
+ extrn Triage_Add :dword
+ extrn TrnSize :word
+ extrn Ucasea :byte
+ extrn UsedEnv :word
+
+ extrn PathString :byte
+ extrn ComspString :byte
+ extrn Reloc_Table :word
+ extrn FirstCom :byte
+ extrn ResJmpTable :dword
+
+ extrn TriageError :near
+
+ extrn NUM_RELOC_ENTRIES :abs
+
+ extrn DevFlag :byte
+ extrn PathFlag :byte
+
+ PUBLIC ConProc
+ PUBLIC Init_ContC_SpecialCase
+
+ assume cs:ResGroup,ds:ResGroup,es:ResGroup,ss:ResGroup
+
+ org 0
+ZERO = $
+
+
+ConProc:
+ mov sp,offset ResGroup:RStack ; must be first instruction
+;
+; M005; We need to set the PSP to us right at start because Carousel needs
+; M005; to be lied to and it does not set PSP when it transfers control to
+; M005; us after loading us as an overlay. By setting PSP, we ensure that
+; M005; command.com is also not lied to.
+;
+ mov ah,SET_CURRENT_PDB ; M005
+ mov bx,es ; M005
+ int 21h ; M005
+
+ mov ah,GET_VERSION
+ int 21h
+ cmp ax,EXPECTED_VERSION
+ je OkDos ; DOS version is ok
+
+ mov dx,offset ResGroup:BadVerMsg ; DX = ptr to msg
+ call RPrint
+ mov ax,es
+ cmp es:PDB_Parent_Pid,ax ; if COMMAND is own parent,
+Here: jnz GoExit ; loop forever
+ SVC SVC_DEMEXITVDM
+
+GoExit:
+ int 20h ; otherwise, exit
+okdos:
+
+;
+; Calculate and save the end of the INIT segment (which is also
+; the beginning of TRANGROUP).
+;
+
+ mov dx,offset resgroup:TranStart+15 ;eg get end of init code
+ mov cl,4 ;eg change to paragraphs
+ shr dx,cl ;eg
+ mov ax,cs ;eg get current segment
+ add ax,dx ;eg calculate segment of end of init
+ mov InitEnd,ax ;eg save this
+
+ SAVE <SI,BP>
+ xor si,si
+ xor bp,bp
+ mov al,5 ; query cmdprompt
+ mov ah,setdpb
+ int 21h
+ mov byte ptr [scs_cmdprompt],al ; ds is resseg
+ mov al,7 ; query DOSONLY bit
+ mov ah,setdpb
+ int 21h
+ mov byte ptr [scs_dosonly],al ; ds is resseg
+ RESTORE <BP,SI>
+
+;
+; Check for /? on the command line. If found, display help text
+; and exit.
+;
+; NOTE: this routine may terminate the program, never returning.
+;
+ call CheckHelp
+
+ call CheckZSwitch
+
+;SR;
+; We have to patch the segment values for the various interrupt entry points.
+;This is because we need to have the default addresses of the handlers in our
+;stub before the relocation is done. These values will then be changed once
+;the resident is relocated
+;
+ call patch_segs
+
+;
+; Turn APPEND off during initialization processing
+;
+ mov ax,APPENDINSTALL ; see if append installed
+ int 2fh ;
+ cmp al,0 ; append installed?
+ je set_msg_addr ; no - continue
+ mov ax,APPENDDOS ; see if append DOS version right
+ int 2fh ;
+ cmp ax,-1 ; append version correct?
+ jne set_msg_addr ; no - continue
+ mov ax,APPENDGETSTATE ; Get the state of Append
+ int 2fh ;
+ mov Append_State,bx ; save append state
+ xor bx,bx ; clear out state
+ mov ax,APPENDSETSTATE ; Set the state of Append
+ int 2fh ; set everything off
+
+set_msg_addr:
+ mov di,offset resgroup:DataresEnd ; get address of resident end
+ mov ResMsgEnd,di ; save it
+
+
+ call get_XMMAddr ;get XMM call address
+;
+;Check if this is the first instance of command.com. If not, we just exit
+;this routine without moving any code.
+;After the int 2fh, ds:si points at the resident jump table in the previous
+;stub. We just have to copy this over
+;
+
+ mov ax,GET_COMMAND_STATE
+ int 2fh
+ assume ds:nothing
+
+ or ax,ax
+ jnz first_com ;this is the first instance
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+ mov es:Beta3Warned, 0ffh
+endif
+
+ mov word ptr es:ResJmpTable,si ;save old stub jump table
+ mov word ptr es:ResJmpTable+2,ds
+ jmp short init_cntry
+
+first_com:
+ mov es:FirstCom,1 ;indicate first command.com
+ mov SCS_FIRSTCOM,1
+
+init_cntry:
+ push es
+ pop ds
+ assume ds:RESGROUP
+
+
+ mov ah,GETEXTCNTRY ; get extended country info
+ mov al,4 ; get file ucase table
+ mov dx,-1 ;
+ mov bx,-1 ;
+ mov cx,5 ; number of bytes we want
+ mov di,offset resgroup:Fucase_addr ; buffer for address
+ int 21h ;
+
+; Bugbug: conditionalize dbcs_vector stuff?
+ push ds ;
+ mov ax, (ECS_CALL shl 8) or GETLEADBTBL ;
+ int 21h ;
+ mov bx,ds ; get segment to bx
+ pop ds ;
+ mov Dbcs_vector_addr,si ; save address of
+ mov Dbcs_vector_addr+2,bx ; dbcs vector
+
+
+ mov ax,word ptr ds:PDB_Parent_Pid ; Init PARENT so we can exit
+ mov Parent,ax ; correctly.
+ mov ax,word ptr ds:Pdb_Exit
+ mov word ptr OldTerm,ax
+ mov ax,word ptr ds:Pdb_Exit+2
+ mov word ptr Oldterm+2,ax
+
+
+ mov ax,offset ResGroup:EndCode + 15
+ mov cl,4 ; ax = size of resident part of
+ shr ax,cl ; command in paragraphs. Add
+ mov cx,cs ; this to CS and you get the
+ add ax,cx ; segment of the TPA.
+
+ mov Res_tpa, ax ; Temporarily save the TPA segment
+ and ax, 0f000h
+ add ax, 01000h ; Round up to next 64K boundary
+ jnc TpaSet ; Memory wrap if carry set
+ mov ax, Res_tpa
+TpaSet:
+ mov Ltpa,ax ; Good enough for the moment
+ mov ax,word ptr ds:PDB_Block_Len ; ax = # of paras given to command
+
+ mov Myseg1,ds ; These 3 variables are used as part of
+ mov Myseg2,ds ; 3 long ptrs that the transient will
+ mov Myseg,ds ; use to call resident routines.
+ mov Myseg3,ds ; segment of msg retriever routine
+ mov Memsiz,ax ; Needed for execing other programs
+
+; M002;
+; M002; First reallocate the COMMAND size to its memory image
+; M002;
+ push ax ; M002
+ mov bx,offset RESGROUP:TranStart ; M002
+ add bx,offset TRANGROUP:TranSpaceEnd; M002
+ add bx,15 ; M002; round up the size
+
+ mov cl,4 ; M002
+ shr bx,cl ;size of command.com ; M002
+
+ mov ah,SETBLOCK ;free all memory above pgm ; M002
+ int 21h ; M002
+ pop ax ; M002
+
+
+;
+; Compute maximum size of environment
+;
+ mov EnvMax,(Environsiz + 15) / 16 + (EnvMaximum-zero + 15)/16 - 1
+;
+; Compute minimum size of environment
+;
+
+ mov EnvSiz, ENVSML / 16
+
+ mov dx,offset TranGroup:Transpaceend + 15 ; dx = size of transient
+ mov cl,4 ; in paragraphs.
+ shr dx,cl
+ mov Trnsize,dx ;eg save size of transient in paragraphs
+
+ sub ax,dx ; max seg addr - # para's needed for transient
+ mov Trnseg,ax ; = seg addr to load the transient at.
+ mov ax,ds:PDB_Environ ; ax = environment segment
+ or ax,ax ; if there is no environment segment,
+ jz buildenv ; go compute one.
+ inc byte ptr Chuckenv ; flag no new environseg to set up
+ jmp short environpassed ; otherwise one was passed to us.
+
+buildenv: ; (this label isn't very accurate)
+;
+;We allocate a buffer here just large enough to hold the 'PATH=' and
+;the COMSPEC. After parsing, we will allocate an environment of the right
+;size and free this buffer. We need this buffer because we no longer have an
+;ENVIRONMENT segment but need a place to store the COMSPEC which can be
+;given on the command line before we know the environment size. This routine
+;will not return in case of an allocation error. It will either exit or hang
+;depending on whether or not this is the first COMMAND.COM or not.
+;
+
+ call alloc_env ;try to allocate buffer
+
+;; mov ax,offset ResGroup:PathString ; compute the segment of the
+;; mov cl,4 ; environment and put it in
+;; shr ax,cl ; ax.
+;; mov dx,ds
+;; add ax,dx
+
+environpassed:
+ mov Envirseg,ax ; save the environment's segment and
+ mov es,ax ; load into es.
+ assume es:nothing
+
+gottheenvir:
+;
+; initialize the command drive
+;
+ mov ah,GET_DEFAULT_DRIVE
+ int 21h
+ inc al
+ mov Comdrv,al
+
+ mov al,byte ptr ds:Fcb ; al = default drive number for command
+ or al,al
+ jz nocomdrv ; no drive specified
+
+ mov ah,':'
+ mov Comdrv,al
+ add al,40h ; convert number to uppercase character
+
+ std
+ cmp byte ptr Chuckenv,0 ; if a new environment is being built,
+ jnz notwidenv ; move the default comspec string in it
+ push ds ; 2 bytes to make room for a drivespec.
+ push es ; the drivespec is in ax and is copied
+ pop ds ; on to the front of the string.
+ mov di,Env_Ecomspec + ENVIRONSIZ2 - 1 ;eg
+ mov si,Env_Ecomspec + ENVIRONSIZ2 - 3 ;eg
+
+ mov cx,ENVIRONSIZ2 - 2
+ rep movsb
+ pop ds
+ mov word ptr es:Env_Ecomspec,ax
+
+notwidenv:
+ cld ; add the drivespec to the string
+; NTVDM not used
+; mov word ptr AutoBat,ax ; used to reference autoexec.bat
+; mov word ptr KautoBat,ax ; used to reference kautoexe.bat 3/3/kk
+
+nocomdrv:
+ call setvect ; set interrupt vectors 22h, 23h, & 24h
+
+;*********************************
+; parsing starts here
+;*********************************
+
+ push cs ; get local segment
+ push cs ; into ds,es
+ pop ds ;
+ pop es ;
+
+assume ds:ResGroup,es:ResGroup ;
+
+ mov si,80h ; get command line
+ lodsb ; get length of line
+ mov di,si ; get line position in di
+ xor ah,ah ; ax = length of command line
+;
+; insure that the command line correctly ends with a cr
+;
+ add di,ax ; go to end of command line
+ mov byte ptr [di],0dh ; insert a carriage return
+ xor cx,cx ; clear cx
+ mov Num_positionals,cx ; initialize positionals
+;
+; Scan the command line looking for the parameters
+;
+
+Parse_command_line:
+ mov di,offset ResGroup:Parse_Command ; Get address of parse_command
+ mov cx,Num_positionals ; Get number of positionals
+ xor dx,dx ; clear dx
+ mov Old_parse_ptr,si ; save position before calling parser
+ call init_parse ; call parser
+ mov Num_positionals,cx ; Save number of positionals
+ cmp ax,END_OF_LINE ; are we at end of line?
+ jz ArgsDoneJ3 ; yes - exit
+ cmp ax,RESULT_NO_ERROR ; did an error occur
+ jz parse_cont ; no - continue
+
+;
+; Before issuing error message - make sure switch is not /C
+;
+
+parse_line_error:
+ push si ; save line position
+ push ax ; save error number
+ cmp ax,BADSWT_PTR ; Was error invalid switch?
+ jnz parse_line_error_disp ; No - just issue message
+ mov di,si ; Get terminating pointer in DI
+ mov si,Old_parse_ptr ; Get starting pointer in SI
+
+init_chk_delim:
+ cmp si,di ; at end of parsed parameter?
+ jz parse_line_error_disp ; Yes - just display message
+ lodsb ;
+ cmp al,Space ; Skip blank spaces
+ jz init_chk_delim ;
+ cmp al,TAB_CHR ; Skip tab characters
+ jz init_chk_delim ;
+
+ cmp al,Rswitchar ; Switch?
+ jnz parse_line_error_disp ; No - just issue message
+ lodsb ; Get the char after the switch
+
+ ifdef DBCS
+ call ItestKanj ; Is it DBCS?
+ jnz parse_line_error_disp ; Yes - can't be /C
+ endif
+
+ call iupconv ; upper case it
+ cmp al,Scswitch ; it is /C?
+ jnz parse_line_error_disp ;
+ pop dx ; even up stack
+ pop dx ; even up stack
+ jmp setSSwitch ; Yes - go set COMMAND /C
+
+parse_line_error_disp:
+
+ pop ax ; restore error number
+ pop si ; restore line position
+ mov dx,ax ; get message number
+ call RPrintParse
+ call CrLf
+ jmp short Parse_command_line ; continue parsing
+
+parse_cont:
+;
+; See if a switch was entered
+;
+; Bugbug: See if Comnd1_Syn can be moved into a reg. before the compare
+
+ cmp Comnd1_Syn,offset ResGroup:Command_f_syn ; was /F entered?
+ jz SetFSwitch ; yes go set fail switch
+ cmp Comnd1_Syn,offset resgroup:Command_p_syn ; was /P entered?
+ Jz SetPSwitch ; yes go set up PERMCOM
+ cmp Comnd1_Syn,offset resgroup:Command_d_syn ; was /D entered?
+ jz SetDSwitch ; yes go set date switch
+ cmp Comnd1_Syn,offset resgroup:Command_c_syn ; was /C entered?
+ jz SetSSwitch ; yes go set up SINGLECOM
+ cmp Comnd1_Syn,offset resgroup:Command_e_syn ; was /E entered?
+ jz SetESwitch ; yes go set up environment
+ cmp Comnd1_Syn,offset resgroup:Command_m_syn ; was /MSG entered?
+ jz SetMSwitchjmp ; yes go set up message flag
+ jmp ChkOtherArgs ; Must be something else
+
+SetMSwitchjmp: ; long jump needed
+ jmp SetMswitch ;
+
+ArgsdoneJ3: ; long jump needed
+ jmp ArgsDone ;
+
+SetFSwitch:
+ cmp fFail,-1 ; has fail switch been set?
+ jnz failok ; no - set it
+ mov ax,Moreargs_ptr ; set up too many arguments
+ jmp parse_line_error ; go issue error message
+
+failok:
+ mov fFail,-1 ; fail all INT 24s.
+ jmp Parse_command_line ;
+
+SetPSwitch:
+;
+; We have a permanent COMMAND switch /P. Flag this and stash the
+; termination address.
+;
+ cmp PermCom,0 ; has /p switch been set?
+ jz permcomok ; no - set it
+ mov ax,moreargs_ptr ; set up too many arguments
+ jmp parse_line_error ; go issue error message
+
+permcomok:
+ inc PermCom
+ mov word ptr OldTerm,offset DATARES:LodCom_Trap
+ mov word ptr OldTerm+2,ds
+;
+; make sure that we display the date and time. if the flag was not
+; initialized, set it to indicate yes, do prompt.
+;
+ cmp byte ptr PrdAttm,-1
+ jnz Parse_command_line_jmp ; keep parsing
+ mov byte ptr PrdAttm,0 ; if not set explicit, set to prompt
+
+Parse_command_line_jmp: ;
+ jmp parse_command_line ; keep parsing
+
+ArgsDoneJump:
+ jmp ArgsDone
+
+SetDSwitch:
+;
+; Flag no date/time prompting.
+;
+ cmp Dswitch,0 ; has /D switch been set?
+ jz setdateok ; no - set it
+ mov ax,Moreargs_ptr ; set up too many arguments
+ jmp parse_line_error ; go issue error message
+
+setdateok:
+ inc Dswitch ; indicate /D entered
+ mov byte ptr PrdAttm,1 ; user explicitly says no date time
+ jmp Parse_command_line ; continue parsing
+
+SetSSwitch:
+;
+; Set up pointer to command line, flag no date/time and turn off singlecom.
+;
+ mov SingleCom,si ; point to the rest of the command line
+ mov Permcom,0 ; a singlecom must not be a permcom
+ mov byte ptr PrdAttm,1 ; no date or time either, explicit
+ jmp ArgsDone
+;
+; Look for environment-size setting switch
+;
+; The environment size is represented in decimal bytes and is
+; converted into pargraphs (rounded up to the next paragraph).
+;
+
+SetESwitch:
+ cmp Eswitch,0 ; has fail switch been set?
+ jz eswitchok ; no - set it
+ mov ax,Moreargs_ptr ; set up too many arguments
+ jmp Parse_line_error ; go issue error message
+
+eswitchok:
+ inc Eswitch ; indicate /E entered
+ mov di,offset ResGroup:Comnd1_Addr ; get number returned
+ mov bx,word ptr [di] ; into bx
+
+ add bx, 0fh ; Round up to next paragraph
+ mov cl,4 ; convert to pargraphs
+ shr bx, cl ; by right 4
+
+ mov EnvSiz,BX ; EnvSiz is in paragraphs
+ jmp Parse_command_line ; continue parsing command line
+
+SetMSwitch:
+ cmp Ext_msg,SET_EXTENDED_MSG ; has /MSG switch been set?
+ jnz setMswitchok ; no - set it
+ mov ax,Moreargs_ptr ; set up too many arguments
+ jmp Parse_line_error ; go issue error message
+setMswitchok:
+ mov Ext_msg,SET_EXTENDED_MSG ; set /MSG switch
+ jmp Parse_command_line ; keep parsing
+
+ArgsDoneJ:
+ jmp ArgsDone
+
+;
+; We have a non-switch character here.
+;
+ChkOtherArgs:
+ push ds ;
+ push si ; save place in command line
+ lds si,Comnd1_Addr ; get address of filespec
+ assume ds:nothing ;
+
+ mov dx,si ; put in dx also
+ mov ax,(OPEN shl 8) or 2 ; Read and write
+ int 21h
+ jc ChkSrchSpec ; Wasn't a file
+ mov bx,ax
+ mov ax,IOCTL shl 8
+ int 21h
+ test dl,80h
+ jnz IsaDevice
+
+BadSetCon: ;
+ mov ah,CLOSE ; Close initial handle, wasn't a device
+ int 21h
+ jmp short ChkSrchSpec
+
+IsaDevice:
+ xor dh,dh
+ or dl,3 ; Make sure has CON attributes
+ mov ax,(IOCTL shl 8) or 1
+ int 21h
+ jc BadSetCon ; Can't set attributes - quit
+ mov dx,bx ; Save new handle
+
+ cmp es:DevFlag,1
+ jz DevErr
+
+ push cx
+ mov cx,3
+ xor bx,bx
+
+rcclloop: ; Close 0,1 and 2
+ mov ah,CLOSE
+ int 21h
+ inc bx
+ loop rcclloop
+
+ mov bx,dx ; New device handle
+ mov ah,XDUP
+ int 21h ; Dup to 0
+ mov ah,XDUP
+ int 21h ; Dup to 1
+ mov ah,XDUP
+ int 21h ; Dup to 2
+ mov ah,CLOSE
+ int 21h ; Close initial handle
+ pop cx
+ pop si ; restore position of command line
+ pop ds ;
+;SR;
+; Register the fact that we already have redirected the output and cannot do
+;it again
+;
+ inc es:DevFlag ;
+ jmp Parse_command_line ; continue parsing
+
+DevErr:
+ pop si
+ pop ds
+ mov dx,1
+ call RPrintParse ;"Too many parameters"
+ call CrLf
+ jmp Parse_command_line
+
+ChkSrchSpec: ; Not a device, so must be directory spec
+
+ cmp es:PathFlag,1 ;already set COMSPEC?
+ jz DevErr ;yes, error
+
+ inc es:PathFlag ;mark that we have a path
+;
+;We do not have an ENVIRONMENT segment any more so we need to allocate a
+;temporary buffer to hold the COMSPEC. Later, this buffer will be freed and
+;its contents moved to the final location of the environment. If there was
+;no environment passed before, then a buffer has already been allocated and
+;so we check for this case. Fortunately, Chuckenv would have been previously
+;set if we had been passed an environment.
+;
+
+ mov ax,EnvirSeg
+ cmp byte ptr Chuckenv,1 ;passed environment?
+ mov byte ptr Chuckenv,0 ;ignore passed environment
+ jne no_alloc ;no, default, dont allocate
+;
+;We have to override the passed environment. Allocate a buffer for use now.
+;This buffer will later be replaced by a proper environment
+;
+ call alloc_env ;allocate env buffer
+
+;; mov ax,offset ResGroup:PathString ; Figure environment pointer
+;; mov cl,4
+;; shr ax,cl
+;; mov dx,cs ;
+;; add ax,dx
+
+ mov EnvirSeg,ax
+no_alloc:
+ mov es,ax
+ assume es:nothing
+ push si ; remember location of file
+ xor cx,cx ; clear cx for counting
+
+countloop:
+ lodsb ; get a character
+ inc cx ; increment counter
+ cmp al,END_OF_LINE_OUT ; are we at end of line?
+ jnz countloop ; no - keep counting
+
+ mov al,Space
+ dec si ; move back one
+ mov byte ptr [si],al ; put a space at end of line
+ pop si ; get location back
+
+ mov di,Env_Ecomspec ; get location of COMSPEC
+
+ComtrLoop:
+ lodsb
+ dec cx
+ cmp al,Space
+ jz SetComsr
+ stosb
+
+ ifdef DBCS
+ xor ah,ah
+ endif
+
+ jcxz setcomsr
+
+ ifdef DBCS
+
+ push ds ; Make sure we have
+ push cs ; local DS for
+ pop ds ; ItestKanj
+ call ItestKanj
+ pop ds ; restore parser ds
+ jz ComtrLoop
+ dec cx
+ movsb
+ inc ah
+ jcxz setcomsr
+
+ endif
+
+ jmp short comtrloop
+
+setcomsr:
+ push cx
+
+ push cs ; Get local segment
+ pop ds ;
+ assume ds:ResGroup ;
+
+ push ds
+ mov si,offset ResGroup:ComSpect
+ mov cx,14
+
+ mov al,es:[di-1]
+
+ ifdef DBCS
+ or ah,ah
+ jnz iNotRoot ; Last char was KANJI second byte, might be '\'
+ endif
+
+ cmp al,RDirChar
+ jnz iNotRoot
+ inc si ; Don't make a double /
+ dec cx
+
+iNotRoot:
+ rep movsb
+
+ mov dx,Env_Ecomspec ; Now lets make sure its good!
+ push es
+ pop ds
+
+ mov ax,OPEN shl 8
+ int 21h ; Open COMMAND.COM
+ pop ds
+ jc SetComsrBad ; No COMMAND.COM here
+ mov bx,ax ; Handle
+ mov ah,CLOSE
+ int 21h ; Close COMMAND.COM
+
+SetComsrRet:
+ pop cx
+ pop si
+ pop ds ;
+ assume ds:ResGroup ;
+
+ArgsDoneJ2:
+ push cs ; Make sure local ES is
+ pop es ; restored
+ jmp Parse_command_line ; continue parsing command line
+
+SetComsrBad:
+ mov dx,offset ResGroup:BadComlkMsg ; dx = ptr to msg
+
+; Note: we're about to make a near call to TriageError, which
+; lives in a different segment and group. Some linkers will
+; generate a warning like "Possible fix-up overflow". We're
+; ok, though, because we all fit in 64 KB and, at init time,
+; we're still all together.
+
+ call triageError
+ cmp ax, 65
+ jnz doprt
+ mov dx,offset ResGroup:BadComaccMsg ; dx = ptr to msg
+DoPrt:
+ call RPrint
+ mov si,offset ResGroup:ComSpect
+ mov di,Env_Ecomspec
+ mov cx,14
+ rep movsb ; get my default back
+
+ jmp short SetComsrRet
+
+;*********************************
+; Parsing Ends Here
+;*********************************
+
+ArgsDone:
+
+ mov es,EnvirSeg ; get environment back
+ assume es:nothing ;
+
+ cmp PermCom,0
+ jz ComReturns
+
+ push es ; Save environment pointer
+ mov ah,SET_CURRENT_PDB
+ mov bx,ds
+ mov es,bx
+ int 21h ; current process is me
+ mov di,PDB_EXIT ; Diddle the addresses in my header
+ mov ax,offset DATARES:LodCom_Trap
+ stosw
+ mov ax,ds
+ stosw
+ mov ax,offset DATARES:Ctrlc_Trap
+ stosw
+ mov ax,ds
+ stosw
+ mov ax,offset DATARES:CritErr_Trap
+ stosw
+ mov ax,ds
+ stosw
+ mov word ptr ds:PDB_Parent_Pid,ds ; Parent is me forever
+
+ mov dx,offset DATARES:Int2e_Trap
+ mov ax,(SET_INTERRUPT_VECTOR shl 8) or 02eh
+ int 21h ;set magic interrupt
+ pop es ;Remember environment
+
+ComReturns:
+ mov ax,word ptr ds:PDB_Parent_Pid
+ mov Parent,ax ; Save parent
+ mov word ptr ds:PDB_Parent_Pid,ds ; Parent is me
+ mov ax,word ptr ds:PDB_Jfn_Table
+ mov Io_save,ax ; Get the default stdin and out
+ mov al,byte ptr ds:[PDB_Jfn_Table+2]
+ mov Io_Stderr,al ; Get the default stdin and out
+ mov word ptr Com_ptr+2,ds ; set all these to resident
+ mov word ptr Com_fcb1+2,ds
+ mov word ptr Com_fcb2+2,ds
+ mov di,offset ResGroup:ComSpec
+
+ mov si,Env_Ecomspec
+ cmp byte ptr Chuckenv,0
+
+ mov ax,ds ; Xchg es,ds
+ push es
+ pop ds
+ mov es,ax
+
+ jz CopyComsp ; All set up for copy
+
+ push cs
+ pop ds
+
+ mov si,offset ResGroup:ComspString
+ push es
+ push di
+ call IfindE
+ mov si,di
+ push es
+ pop ds
+ pop di
+ pop es
+ jnc CopyComsp
+
+ComSpecNofnd:
+ mov si,Env_Ecomspec ;
+ push cs
+ pop ds
+
+ assume es:ResGroup
+
+CopyComsp:
+ mov es:PutBackComSpec.SubstPtr,di ; Save ptr to beginning of comspec path
+ cmp byte ptr [si+1],':' ; Is there a drive specifier in comspec
+ jnz CopyComspLoop ; If not, do not skip over first 2 bytes
+ add es:PutBackComSpec.SubstPtr,2
+
+CopyComspLoop:
+ lodsb
+ stosb
+ or al,al
+ jnz CopyComspLoop
+ mov es:Comspec_end,di ; Save ptr to end of comspec path
+ dec es:Comspec_end
+ mov ah,es:comdrv
+ add ah,'A'-1
+ mov es:PutBackDrv,ah ; save drive letter
+
+
+ call setup_for_messages ; set up parse and extended error messages
+;SR;
+;The routine below sets up the exact resident size of COMMAND. If this is not
+;the first COMMAND, then the resident code is not duplicated and the resident
+;size is just the data. If we are the first COMMAND, it checks if we are to
+;be loaded into HIMEM. If not, then the resident size includes the code and
+;the data otherwise it is just the data.
+;
+ call Setup_res_end ;put resident size in ResSize
+
+ push cs
+ pop ds
+ assume ds:RESGROUP
+
+;; if we are the permanent one, tell ntvdm the real comspec.
+ cmp PermCom, 0
+ je comspec_to_32_done
+ push ax
+ mov dx, offset RESGROUP:ComSpec
+ CMDSVC SVC_CMDCOMSPEC
+ mov SCS_PAUSE,al ; yst 4-5-93
+ pop ax
+
+
+comspec_to_32_done:
+;; mov bx,ResMsgEnd ; get end of resident
+;; add bx,15
+;; mov cl,4
+;; shr bx,cl
+
+Public EnvMaximum
+EnvMaximum:
+;;;
+;;; NOTE: The transient has to loaded directly after shrinking to the
+;;; resident size.
+;;; There is an assumption made when loading the transient that it
+;;; still intact after the resident portion.
+;;; If any other ALLOC/DEALLOC/SETBLOCK operations are performed
+;;; inbetween, then there is a real good chance that the non-resident
+;;; portion will be overwritten by arena information.
+
+;SR;
+;Do not shrink to the resident now. We will then be running in deallocated
+;memory and BAAADNESS! can ensue.
+;
+
+;; mov ah,SETBLOCK
+;; int 21h ; shrink to the resident only
+
+;
+; Load in the transient and compute the checksum. We may do this in one of
+; two ways: First, cheat and use the transient loading code that exists in
+; the resident piece. This may be OK except that it will hit the disk.
+;
+; But we do not need to hit the disk! The transient is already loaded but is
+; in the wrong place. We need to block transfer it up to the correct spot.
+;
+
+;
+; M004; Start of changes
+;
+
+;
+; Compute checksum right now before we can get corrupted and save it
+;
+
+ mov si,offset RESGROUP:TranStart
+ add si,100h
+ mov cx,offset TRANGROUP:TranDataEnd - 100H
+
+ cld
+ shr cx,1
+ xor dx,dx
+Ichksum:
+ lodsw
+ add dx,ax
+ adc dx,0
+ loop Ichksum
+
+ mov Sum,dx ;store checksum
+
+;
+; M004; End of changes
+;
+
+ cmp byte ptr PrdAttm,0 ;eg
+ jnz NoBatchSeg ;eg don't do autoexec or date time
+;
+; allocate batch segment for d:/autoexec.bat + no arguments
+;
+
+; NTVDM temp name of the batch file may be up to 63 bytes, plus NULL
+; mov bx,((SIZE BatchSegment) + 15 + 1 + 0fh)/16 ;eg
+ mov bx,((SIZE BatchSegment) + 64 + 0fh)/16 ;eg
+
+ mov ah,ALLOC ;eg
+ int 21h ;eg
+ jc NoBatchSeg ;eg didn't allocate - pretend no batch
+ mov Batch,ax ;eg save batch segment
+
+nobatchseg:
+;; mov bx, 0ffffh ; get size of largest block for env
+;; mov ah, ALLOC
+;; int 21h
+;;
+;;; only allocate maximum 64k worth of environment
+;;
+;; sub bx,TrnSize ;eg subtract # of transient paragraphs
+;; sub bx,128 ;eg make sure we have 2k left
+;; mov EnvMax, bx
+;; cmp bx, 4096 ; 64k = 4096 paragraphs
+;; jb maxok
+;; mov bx, 4096-1
+;; mov EnvMax, bx
+;;maxok:
+;;
+;; mov ah, ALLOC ; get max size
+;; int 21h
+;;
+ mov bx,EnvirSeg ;g get old environment segment
+ mov OldEnv,bx ;g save it
+
+ mov UsedEnv,0 ;g initialize env size counter
+ mov ds,bx
+ assume ds:nothing
+
+;; mov EnvirSeg,ax
+;;;Bugbug: There is no need to initialize es at this point-- no string moves
+;; mov es,ax
+
+ xor si,si
+ mov di,si
+;SR;
+;This is the maximum allowed size for the environment
+;
+ mov bx,4096 - 1 ; max. allowed env. size
+ mov EnvMax,bx
+
+ shl bx,1
+ shl bx,1
+ shl bx,1
+ shl bx,1
+ mov EnvMax, bx ; convert envmax to bytes
+ dec bx ; dec by one to leave room for double 0
+ xor dx,dx ; use dx to indicate that there was
+ ; no environment size error.
+public NxtStr
+NxtStr:
+ call GetStrLen ; get the size of the current env string
+
+;Bugbug: Can use ss here to address UsedEnv
+
+ push ds ;g get addressability to environment
+ push cs ;g counter
+ pop ds ;g
+ assume ds:ResGroup
+ add UsedEnv,cx ;g add the string length to env size
+ pop ds ;g
+ assume ds:nothing
+ cmp cx,1 ; end of environment was encountered.
+ jz EnvExit
+ sub bx,cx
+ jae OkCpyStr ; can't fit in all of enviroment.
+ inc dx ; out of env space msg must be displayed
+ jmp short EnvExit
+OkCpyStr:
+ jmp NxtStr
+EnvExit:
+
+ push cs
+ pop ds
+ assume ds:ResGroup
+ or dx,dx ; dx will be non-zero if error
+ jz EnvNoErr
+ mov dx,offset ResGroup:OutEnvMsg ; dx = ptr to msg
+ call RPrint
+
+EnvNoErr:
+ mov ax,EnvSiz ;env size previously set
+ mov cl,4
+ shl ax,cl ;get size in bytes
+ cmp ax,UsedEnv ;is it a new env?
+ ja st_envsize ;yes, store the size
+
+ mov ax,UsedEnv
+ add ax,15 ;round up
+st_envsize:
+ shr ax,cl
+ mov EnvSiz,ax ;store env size needed(paras)
+;;;
+;;; bx now has the left over size of the maximum environment
+;;; we want to shrink the environment down to the minimum size
+;;; set the environment size to max(envsiz,env used)
+
+;; mov cx, EnvMax
+;; sub cx, bx ; cx now has the environment used
+;; add cx, 16 ; round up to next paragraph
+;; shr cx, 1
+;; shr cx, 1
+;; shr cx, 1
+;; shr cx, 1
+;; cmp cx, EnvSiz ; is environment used > envsiz
+;; jb EnvSet
+;; mov EnvSiz, cx
+;;EnvSet:
+;; mov bx, EnvSiz ; set environment to size needed
+;; mov ax,es ;eg get environment segment
+;; add ax,bx ;eg add number of environment paragraphs
+;; cmp ax,InitEnd ;eg does this go past end of init?
+;; ja EnvSetOk ;eg yes - do the setblock
+;; mov ax,es ;eg no - get back the environment segment
+;; mov bx,InitEnd ;eg get the segment at end of init
+;; sub bx,ax ;eg setblock envir segment to end of init code
+;; mov ResetEnv,1 ;eg set flag so we know to set envir later
+;;
+;;envsetok:
+;; mov ah, setblock
+;; int 21h
+
+ cmp SCS_FIRSTCOM,1
+ jz nophead ; don't print header for first instance
+ cmp SCS_CMDPROMPT,1
+ je nophead
+ cmp SingleCom,0
+ jnz nophead ; don't print header if singlecom
+ mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg
+ call RPrint
+
+nophead:
+
+ cmp Batch,0 ;eg did we set up a batch segment?
+ jnz DoDate ;eg yes - go initialize it
+ jmp NoDttm ; don't do autoexec or date time
+;
+; allocate batch segment for d:/autoexec.bat + no arguments
+;
+DoDate:
+ mov ax,Batch ;eg get batch segment
+ mov EchoFlag,3 ; set batch echo
+ mov Nest,1 ; g set nest flag to 1 batch
+ mov es,ax
+;
+; initialize the segment
+;
+ xor di,di
+ mov al,BATCHTYPE
+ stosb
+ mov al,1 ; g initialize echo for batch exit
+ stosb ; g
+;SR;
+; Hosebag! This guy does not use the struct fields to init the BatchSegment
+;
+ xor ax,ax ; initialize to zero
+ stosb ; clear out BatchEOF
+
+ stosw ; g batch segment of last job - batlast
+ stosw ; g segment for for
+ stosb ; g for flag
+ stosw ; position in file - batseek
+ stosw
+;
+; clean out the parameters
+;
+ mov ax,-1 ; initialize to no parameters
+ mov cx,10
+ rep stosw
+
+;
+; NTVDM Get temp file name from 32 bit command.lib
+;
+if 0
+;
+; decide whether we should grab the default drive
+;
+ cmp byte ptr AutoBat,0
+ jnz NoAutSet
+ mov ah,GET_DEFAULT_DRIVE
+ int 21h
+ add al,Ucasea
+
+ mov AutoBat,al
+ mov KautoBat,al ; 3/3/kk
+
+NoAutSet:
+
+
+;
+; copy in the batch file name (including nul)
+;
+ mov si,offset ResGroup:AutoBat
+ mov cx,8
+ rep movsw
+ movsb ; move in carriage return to terminate string
+endif
+ push es
+ pop ds
+ assume ds:nothing
+
+ mov dx, di
+ CMDSVC SVC_GETAUTOEXECBAT
+
+;NTVDM not used mov dx,offset ResGroup:AutoBat
+ mov ax,OPEN shl 8
+ int 21h ; see if autoexec.bat exists
+
+ push cs
+ pop ds
+ assume ds:ResGroup
+
+ jc NoAbat
+ mov bx,ax
+ mov ah,CLOSE
+ int 21h
+ jmp Drv0 ; go process autoexec
+
+noabat:
+ push ax
+ call Setup_Seg
+ mov word ptr Triage_Add+2,ax
+ pop ax
+ call Triage_Add
+ cmp ax, 65
+ jz AccDenErr ; was network access denied
+
+; NTVDM we don't do kautoexe.bat
+if 0
+; If AUTOEXEC.BAT is not found, then check for KAUTOEXE.BAT. Changed
+; by Ellen to check only when in Korea. The country information
+; returned will overlay the old parse data area, but we don't care
+; since we won't need the parse information or country information.
+; We only care about the country code returned in BX.
+
+ mov dx,offset ResGroup:Internat_Info ; set up internat vars
+ mov ax,INTERNATIONAL shl 8 ; get country dependent info
+ int 21h ;
+ jc NoKabat ; error - don't bother with it
+ cmp bx,KOREA_COUNTRY_CODE ; are we speaking korean?
+ jnz OpenErr ; no, don't check for kautoexe
+
+ mov di,BatFile ; 3/3/kk
+ mov si,offset ResGroup:KautoBat ; another trial to do 3/3/kk
+ mov cx,8 ; auto execution for the 3/3/kk
+ rep movsw ; non-english country 3/3/kk
+ movsb ; move in carraige return to terminate string
+ mov dx,offset ResGroup:KautoBat ; 3/3/kk
+ mov ax,OPEN shl 8 ; 3/3/kk
+ int 21h ; see if kautoexe.bat exists 3/3/kk
+ jc NoKabat ; 3/3/kk
+ mov bx,ax ; 3/3/kk
+ mov ah,CLOSE ; 3/3/kk
+ int 21h ; 3/3/kk
+ jmp short Drv0 ; 3/3/kk
+
+NoKabat: ; 3/3/kk
+ call Triage_Add ; get extended error
+ cmp ax, 65 ; network access denied?
+ jnz OpenErr ; no - go deallocate batch
+endif
+
+AccDenErr: ; yes - put out message
+ mov dx,offset ResGroup:AccDen ; dx = ptr to msg
+ call RPrint
+
+OpenErr:
+ mov es,Batch ; not found--turn off batch job
+ mov ah,DEALLOC
+ int 21h
+ mov Batch,0 ; after dealloc in case of ^c
+ mov EchoFlag,1
+ mov Nest,0 ;g indicate no batch in progress
+
+DoDttm:
+ mov ax,offset TranGroup:Datinit
+ mov word ptr InitAdd,ax
+;;;M004 mov ax,TrnSeg
+;
+; M004; We cant use TrnSeg now because it is not initialized. We now that
+; M004; the transient starts on a para boundary at the label TranStart.
+; M004; We use TranStart to get the start of the transient segment.
+;
+ mov ax,offset RESGROUP:TranStart ; M004
+ mov cl,4 ; M004
+ shr ax,cl ; get relative seg ; M004
+ mov cx,cs
+ add ax,cx ; ax = transient seg ; M004
+
+ mov word ptr InitAdd+2,ax
+; call dword ptr InitAdd
+
+NoDttm:
+
+Copyright:
+ public Copyright
+; Bugbug: remove Copyright label.
+
+;if IBMVER
+; cmp SingleCom,0
+; jnz Drv0 ; don't print header if singlecom
+; mov dx,offset ResGroup:CopyrightMsg ; dx = ptr to msg
+; call RPrint
+;endif
+
+Drv0: ; Reset APPEND state
+ push ds ; save data segment
+ push cs ; Get local segment into DS
+ pop ds ;
+ mov ax,APPENDSETSTATE ; Set the state of Append
+ mov bx,Append_State ; back to the original state
+ int 2fh ;
+ pop ds ; get data segment back
+;
+;Check FirstCom set previously to see if this is the first instance of
+;command.com. If not, we do not move command.com. Instead, we copy over the
+;jump table from the previous stub to the current stub.
+;
+ cmp FirstCom,1 ;first command.com?
+ jz move_code ;yes, move it
+
+ push es
+ push ds
+
+ push ds
+ pop es
+ mov di,offset DATARES:Int2f_Entry
+
+ mov ds,word ptr es:ResJmpTable+2 ;get segment address
+ mov si,word ptr es:ResJmpTable ;get offset address
+
+ mov cx,NUM_RELOC_ENTRIES ;number of dword ptrs
+ shl cx,1
+ shl cx,1 ;size of table in bytes
+
+ cld
+ rep movsb ;copy the jump table
+;
+;Check if the resident code is in HMA. We assume that it is in HMA if its
+;code segment > 0f000h. If in HMA, we set the ComInHMA flag
+;
+ cmp es:[di-2],0f000h ;is resident code in HMA?
+ jb res_low ;no, dont set flag
+
+ mov es:ComInHMA,1 ;indicate code in HMA
+
+res_low:
+ pop ds
+ pop es
+ jmp short finish_init
+;
+;Now, we can move the resident code to its final location, either to HIMEM
+;or to overlay the messages in the data segment if the user has not used the
+;/msg switch.
+;
+move_code:
+ call Move_res_code ;move the code
+
+finish_init:
+ jmp RESGROUP:EndInit ;g finish initializing
+
+;
+; Get length of string pointed to by DS:SI. Length includes NULL.
+; Length is returned in CX
+;
+GetStrLen:
+ xor cx,cx
+NxtChar:
+ lodsb
+ inc cx
+ or al,al
+ jnz NxtChar
+ ret
+;
+; If the transient has been loaded in TranSeg, then we need to use that
+; segment for calls to routines in the transient area. Otherwise, the current
+; code segment is used
+; Segment returned in AX.
+;
+Setup_Seg:
+ mov ax,TrnSeg
+ cmp TrnMvFlg, 1 ; Has transient portion been moved
+ jz setup_end
+ push bx
+ mov bx,cs
+ mov ax,offset ResGroup:TranStart
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ add ax,bx
+ pop bx
+setup_end:
+ ret
+
+
+;*** RPrintParse - display parse error message
+;
+; ENTRY DX = parse error #
+;
+; EXIT nothing
+;
+; USED flags
+;
+; EFFECTS
+; Message is displayed on stdout.
+
+RPrintParse proc
+
+ assume ds:ResGroup,ss:ResGroup
+
+ push dx ; preserve DX
+ xchg bx,dx ; bx = parse error #
+ ; dx = saved BX
+ dec bx ; bx = parse error index, from 0
+ shl bx,1 ; bx = offset in word table
+ mov bx,ParsMsgPtrs[bx] ; bx = ptr to error msg
+ xchg bx,dx ; dx = ptr to error msg
+ ; bx = restored
+ call RPrint ; print the message
+ pop dx ; restore DX
+ ret
+
+RPrintParse endp
+
+
+
+IfindE:
+ call ifind ; find the name
+ jc ifind2 ; carry means not found
+ jmp short Iscasb1 ; scan for = sign
+;
+; on return of find1, es:di points to beginning of name
+;
+ifind:
+ cld
+ call Icount0 ; cx = length of name
+ mov es,EnvirSeg
+ xor di,di
+
+ifind1:
+ push cx
+ push si
+ push di
+
+Ifind11:
+ lodsb
+
+ ifdef DBCS
+
+ call ItestKanj
+ jz NotKanj4
+ dec si
+ lodsw
+ inc di
+ inc di
+ cmp ax,es:[di-2]
+ jnz Ifind12
+ dec cx
+ loop Ifind11
+ jmp short Ifind12
+NotKanj4:
+
+ endif
+
+ call IupConv
+ inc di
+ cmp al,es:[di-1]
+ jnz Ifind12
+ loop Ifind11
+
+Ifind12:
+ pop di
+ pop si
+ pop cx
+ jz Ifind2
+ push cx
+ call Iscasb2 ; scan for a nul
+ pop cx
+ cmp byte ptr es:[di],0
+ jnz Ifind1
+ stc ; indicate not found
+
+Ifind2:
+ ret
+
+Icount0:
+ push ds
+ pop es
+ mov di,si
+
+ push di ; count number of chars until "="
+ call Iscasb1
+ jmp short Icountx
+ push di ; count number of chars until nul
+ call Iscasb2
+
+Icountx:
+ pop cx
+ sub di,cx
+ xchg di,cx
+ ret
+
+Iscasb1:
+ mov al,Equalsign ; scan for an =
+ jmp short Iscasbx
+
+Iscasb2:
+ xor al,al ; scan for a nul
+
+Iscasbx:
+ mov cx,100h
+ repnz scasb
+ ret
+
+
+; ****************************************************************
+; *
+; * ROUTINE: IUPCONV (ADDED BY EMG 4.00)
+; *
+; * FUNCTION: This routine returns the upper case equivalent of
+; * the character in AL from the file upper case table
+; * in DOS if character if above ascii 128, else
+; * subtracts 20H if between "a" and "z".
+; *
+; * INPUT: DS set to resident
+; * AL char to be upper cased
+; * FUCASE_ADDR set to the file upper case table
+; *
+; * OUTPUT: AL upper cased character
+; *
+; ****************************************************************
+
+
+IupConv proc near
+ assume ds:ResGroup ;
+
+ cmp al,80h ; see if char is > ascii 128
+ jb other_fucase ; no - upper case math
+ sub al,80h ; only upper 128 chars in table
+ push ds ;
+ push bx ;
+ lds bx,dword ptr fucase_addr+1 ; get table address
+ add bx,2 ; skip over first word
+ xlat ds:byte ptr [bx] ; convert to upper case
+ pop bx ;
+ pop ds ;
+ jmp short iupconv_end ; we finished - exit
+
+other_fucase: ;
+ cmp al,Lcasea ; if between "a" and "z",
+ jb iupconv_end ; subtract 20h to get
+ cmp al,Lcasez ; upper case equivalent.
+ ja iupconv_end ;
+ sub al,20h ; Change lower-case to upper
+
+iupconv_end: ;
+ ret
+
+IupConv endp ;
+
+
+init_contc_specialcase:
+ ; This routine is called if control-C
+ add sp,6 ; is type during the date/time prompt
+ push si ; at initialization time. The desired
+ mov si,dx ; response is to make it look like the
+ mov word ptr [si+1],0d00h ; user typed <CR> by "popping" the
+ pop si ; INT 21h stuff off the stack, putting
+ iret ; a <CR> in the user's buffer, and
+ ; returning directly to the user.
+ ; In this case the user is TCODE.
+
+
+; ****************************************************************
+; *
+; * ROUTINE: Setup_for_messages
+; *
+; * FUNCTION: Sets up system for PARSE and EXTENDED ERROR
+; * messages as follows:
+; *
+; * IF /P and /MSG are entered
+; * keep PARSE and EXTENDED ERRORS in memory
+; * ELSE IF /P is entered
+; * use PARSE and EXTENDED ERRORS on disk
+; * remove PARSE ERRORS from memory
+; * ELSE
+; * remove PARSE ERRORS from memory
+; * ENDIF
+; *
+; * INPUT: PERMCOM Set up with user input
+; * EXT_MSG Set up with user input
+; * System set up to retain PARSE ERRORS
+; *
+; * OUTPUT: registers unchanged
+; *
+; ****************************************************************
+
+
+setup_for_messages proc near
+
+ push bx
+ push ds ; save data segment
+ push es ; save environment segment
+ push ax ;
+ push dx ;
+ push di ;
+ mov ax,cs ; get local segment to ES and DS
+ mov ds,ax ;
+ mov es,ax ;
+
+ cmp PermCom,0 ; was permcom set?
+ jz no_permcom ; No - don't worry about messages
+
+;* We're permanent. Install our message services int 2f handler.
+
+ push es
+ mov ax,(GET_INTERRUPT_VECTOR shl 8) or 2Fh
+ int 21h
+ mov word ptr Int2fHandler,bx
+ mov word ptr Int2fHandler+2,es
+ pop es
+
+; DS = RESGROUP seg addr
+
+;
+; M005; We will not hook int 2fh on any command.com other than the first.
+; M005; Carousel loads as a permanent command.com and when we exit Carousel,
+; M005; it just wipes our arena out. So, int 2fh is still hooked and the
+; M005; first int 2fh call after exit from Carousel (from the DOS terminate
+; M005; call) goes off into space.
+;
+ cmp FirstCom,0 ; M005
+ je no_msg_hook ; M005
+;
+; M005; !!!SLIMIEST CAROUSEL HACK OFF ALL!!!
+; M005; Carousel plays around with the interrupt vector tables. He saves it
+; M005; before loading a new command.com. Then, it takes hold of the current
+; M005; command.com's PSP and then looks at all interrupt vectors whose
+; M005; segment matches the command.com PSP and then updates these segments
+; M005; to the new command.com's PSP in his saved vector table. Whenever we
+; M005; we pop into his menu, he puts this saved table into the vector table.
+; M005; If we now quit, Carousel just wipes out command.com's arena and then
+; M005; issues a terminate. Unfortunately, the int 2fh vector is pointing at
+; M005; the command.com that was wiped out and so the next int 2fh call will
+; M005; bomb. To prevent Carousel from doing this clever(1**$$#) patching, we
+; M005; renormalize our int 2fh pointer so that its cs is not the same as the
+; M005; command.com PSP. Now, he does no such patching and our int 2fh vector
+; M005; remains nice and happy. The renormalized pointer points at a far
+; M005; jump to the actual int 2fh entry point.
+;
+ push ds ; M005
+ mov dx,offset DATARES:Carousel_i2f_Hook ; M005
+ sub dx,10h ; renormalize offset; M005
+ mov ax,ds ; M005
+ inc ax ; Relocated cs ; M005
+ mov ds,ax ; M005
+ mov ax,(SET_INTERRUPT_VECTOR shl 8) or 2Fh
+ int 21h
+ pop ds ; M005
+ mov word ptr Carousel_i2f_Hook+3,ds ; M005
+ ; patch in the cs for jump
+no_msg_hook: ; M005
+
+ cmp Ext_Msg,SET_EXTENDED_MSG
+ jne short permcom_end ; no /msg - exit
+
+permcom_slash_msg: ; Keep messages in memory
+ mov di,offset ResGroup:ExtMsgEnd ; get address of resident end
+ mov ResMsgEnd,di ; save it
+ jmp short permcom_end ; exit
+
+no_permcom:
+ cmp Ext_msg,SET_EXTENDED_MSG ; was /msg specified?
+ jnz permcom_end ; no - no error
+ mov dx,LessArgs_Ptr ; get message number for "Required parameter missing"
+ call RPrintParse
+
+permcom_end:
+ pop di ;
+ pop dx ;
+ pop ax ;
+ pop es ; get environment back
+ pop ds ;
+ pop bx
+
+ ret ;
+
+setup_for_messages endp
+
+
+
+
+;*** CheckHelp - print help text and exit if /? is on command line
+;
+; ENTRY command-line tail at 81h
+;
+; EXIT return if /? not found
+; terminate if /? found
+;
+; USED AX,BX,CX,DX,SI,DI
+;
+; EFFECTS Help text displayed if /? found on command line
+
+CheckHelp proc
+
+ assume cs:RESGROUP,ds:RESGROUP,es:RESGROUP,ss:RESGROUP
+
+ mov si,81h ; DS:SI = ptr to command-line tail
+ mov di,offset RESGROUP:Parse_Command
+ ; ES:DI = ptr to primary parse block
+ xor cx,cx ; CX = # positional param's found
+ xor dx,dx ; DX will be ptr to result buffer
+
+chParse:
+ call Init_Parse ; call system parser
+
+ cmp ax,END_OF_LINE
+ je chRet ; end of command line, no /? found
+ cmp ax,RESULT_NO_ERROR
+ je chWhich ; valid syntax element found
+ jmp chParse ; go parse more
+
+chWhich:
+ cmp Comnd1_Syn,offset RESGROUP:Command_?_Syn
+ je chHelp ; /? found - display help & exit
+ cmp Comnd1_Syn,offset RESGROUP:Command_C_Syn
+ je chRet ; /c found - ignore rest of line
+ cmp Comnd1_Syn,offset RESGROUP:Command_z_Syn
+ je chRet ; /c found - ignore rest of line
+ jmp chParse ; anything else - ignore, keep looking
+
+chHelp:
+ mov si,offset RESGROUP:HelpMsgs ; SI = ptr to msg ptr list
+chHelpNext:
+ lodsw ; AX = ptr to msg
+ or ax,ax
+ jz chHelpDone ; end of list - all done
+ mov dx,ax ; DX = ptr to msg
+ call RPrint ; display msg
+ jmp chHelpNext ; go do next msg
+chHelpDone:
+ int 20h ; terminate program
+
+chRet: ret
+
+CheckHelp endp
+
+st_invalid macro
+ mov ax,0ffffh
+ push ax
+ push ax
+endm
+
+st_valid macro
+ push bx
+ push cx
+endm
+
+CleanForStd macro
+ add sp,12
+endm
+
+;*** CheckZSwitch - Handle special /Z switch of command.com.
+; This switch has been added for SCS functionality
+; such that DOS apps can exec non-dos apps and
+; still leave DOS in a consistant state such that
+; it can be re-entered.
+;
+; ENTRY command-line tail at 81h
+;
+; EXIT non-dos binary is execed and command.com terminates after
+; non-dos binary completes.
+;
+; EFFECTS
+
+CheckZSwitch proc
+ assume cs:RESGROUP,ds:RESGROUP,es:RESGROUP,ss:RESGROUP
+
+ mov si,81h ; DS:SI = ptr to command-line tail
+ mov di,offset RESGROUP:Parse_Command
+ ; ES:DI = ptr to primary parse block
+ xor cx,cx ; CX = # positional param's found
+ xor dx,dx ; DX will be ptr to result buffer
+
+czParse:
+ call Init_Parse ; call system parser
+
+ cmp ax,END_OF_LINE
+ je czRet ; end of command line, no /? found
+ cmp ax,RESULT_NO_ERROR
+ je czWhich ; valid syntax element found
+ jmp short czRet
+
+czWhich:
+ cmp Comnd1_Syn,offset RESGROUP:Command_z_Syn
+ je czSwitch
+ jmp short czRet
+
+czSwitch:
+ push bp
+ xor bx,bx
+ mov si,bx
+ mov bp,bx
+ mov ax,5303h
+ int 21h
+ jnc st_stdin
+ st_invalid
+ jmp short go_stdout
+st_stdin:
+ st_valid
+go_stdout:
+ mov bx,1
+ mov ax,5303h
+ int 21h
+ jnc st_stdout
+ st_invalid
+ jmp short go_stderr
+st_stdout:
+ st_valid
+go_stderr:
+ mov bx,2
+ mov ax,5303h
+ int 21h
+ jnc st_stderr
+ st_invalid
+ jmp short std_done
+st_stderr:
+ st_valid
+std_done:
+ mov ah,19h
+ int 21h
+ mov si,84h ; 84h because that is where the real
+ ; command starts (i.e. 7/z\bfoo.exe)
+ mov bx,ds:2ch
+ mov bp,sp
+ push es
+ mov es,bx
+ xor ah,ah ; no "cmd /c"
+ CMDSVC SVC_CMDEXEC ; Exec non-dos binary
+ pop es ; ds:si is command tail (DOS_style)
+ ; es is env segment
+ ; al = current drive
+ ; ss:bp = std handles
+ ; returns al = return code
+ lahf
+ CleanForStd
+ pop bp
+ sahf
+ jc czReEnter
+
+ mov ah,4ch
+ int 21h
+
+czRet: ret
+
+czReEnter:
+ xor ah,ah
+ mov [SCS_REENTERED],3
+ mov byte ptr ds:80h,0
+ ret
+
+CheckZSwitch endp
+
+;***** Setup_res_end -- This routine determines the resident size of COMMAND.
+; It determines based on 2 factors:
+; 1. Is this is the first COMMAND?
+; 2. Is COMMAND to be loaded into HIMEM?
+; The strategy works as follows:
+;
+; if ( First COMMAND)
+; then if (COMMAND in HIMEM)
+; ResSize = resident_data;
+; else
+; ResSize = resident_data + resident_code;
+; else
+; ResSize = resident_data;
+;
+; Int 2fh calls have been added to determine whether or not we are the first
+;COMMAND and whether DOS is in HIMEM.
+;
+; ENTRY: ResMsgEnd = resident size of data in paras
+;
+; EXIT: ResSize = resident size in low memory
+;
+; REGISTERS AFFECTED: ax,cx,dx
+;
+
+; NTVDM use diff al value so we don't confuse dos 5.0
+; NTVDM command.com GET_COMMAND_STATE equ 5500h
+GET_COMMAND_STATE equ 5501h
+GET_HMA_ADDR equ 4a02h
+
+Setup_res_end proc near
+
+ push ds
+ mov ax,cs
+ mov ds,ax ;ds = RESGROUP
+ assume ds:RESGROUP
+
+ mov cx,ResMsgEnd ;set resident size = data
+
+;M042 -- Begin changes
+;If messages are to be kept behind, we need to round up the messages to
+;the next para boundary. This is because we have a dummy segment between the
+;data and the resident code segment so that the code segment starts on a
+;para boundary
+;
+ cmp cx,offset RESGROUP: ExtMsgEnd ;messages to be resident?
+ jne calc_res ;no, continue
+ add cx,15 ;round up
+ and cx,0fff0h
+calc_res:
+;
+;M042 -- End changes
+;
+ xor ax,ax
+ cmp FirstCom,1 ;is it first command.com?
+ jnz not_first ;no, do not keep code
+;
+;We issue a version check call with al=01 to detect if DOS is in HMA. If so,
+;bit 4 of dh is set
+;
+ push bx
+ push cx
+ mov ax,(SET_CTRL_C_TRAPPING shl 8) or 06h ;is DOS in HIMEM? ;M013
+ int 21h
+ pop cx
+;bugbug: remove version check after testing
+ cmp bl,5 ;bl has true version ; M013
+ jb oldver
+
+ xor ax,ax
+ and dh,10h ;is DOS in HMA ; M013
+ pop bx
+ jnz not_first ;DOS in HIMEM, code not
+ ; resident
+
+ mov ax,offset CODERES: EndCode ;size of code in bytes
+not_first:
+;
+;Note that ax = 0(side effect of int 2fh), if the code is not to be retained
+;
+ add cx,ax
+ add cx,15 ;round up to next para
+ shr cx,1
+ shr cx,1
+ shr cx,1
+ shr cx,1 ;ax = para size of res code
+ mov ResSize,cx ;store resident size
+
+ pop ds
+ assume ds:nothing
+ ret
+;bugbug: remove this code (for version independent COMMAND) after testing
+oldver:
+ pop bx
+ mov ax,offset CODERES: EndCode ;size of code in bytes
+ jmp short not_first
+
+setup_res_end endp
+
+
+;*** Move_res_code -- This routine moves the resident code to its final
+; location. We check if DOS is in HIMEM. If so, we try to load ourselves
+; in HIMEM. If we fail, then we remain low and update ResSize to reflect
+; the correct resident size. When remaining low, we have to check if we
+; need to overlay the messages part of the data segment which is determined
+; by the /msg switch.
+;
+; ENTRY: ResMsgEnd = end of resident data
+;
+; EXIT: The resident code is either up high or in its final location
+; down low.
+;
+; REGISTERS AFFECTED: ax,bx,cx,dx,si,di
+;
+
+Move_res_code proc near
+
+ push ds
+ push es
+
+ mov ax,cs
+ mov ds,ax
+ assume ds:RESGROUP
+
+ mov ax,(SET_CTRL_C_TRAPPING shl 8) or 06h ; M013
+ int 21h ;DOS in HIMEM?
+
+ and dh,10h ; M013
+ jnz move_high ;yes, move code high
+
+;
+;Check if messages have been discarded or not
+;
+load_low:
+ push ds
+ pop es ;es = RESGROUP
+ mov di,ResMsgEnd ;end offset in DATARES
+ mov bx,offset RESGROUP: ExtMsgEnd ;end offset of messages
+
+ cmp di,bx ;are messages to be kept?
+ jz no_move ;yes, dont move code
+
+ jmp short setup_move ;es:di points at dest.
+
+move_high:
+
+;
+;We have to call DOS to get the load address in HIMEM for COMMAND
+;We pass in bx the number of bytes we need
+;
+ mov bx,offset CODERES: EndCode
+
+;M030;
+; Set di=0ffffh so that we load low in case no one answers this int 2fh
+;
+ mov di,0ffffh ;DT - in case no-one handles
+ ;this ; M030
+ mov ax,GET_HMA_ADDR
+ int 2fh
+
+;
+;If the offset = 0xffff, then no HMA available
+;
+ cmp di,0ffffh ;HMA available?
+ mov ComInHMA,1 ;assume command.com in HMA
+ jnz setup_move ;no error, es:di = memory
+
+ mov ComInHMA,0 ;could not load in HMA
+;
+;Zero means that we do not have enough HIMEM. Remain low and update
+;ResSize to reflect this
+;
+ mov cx,ResMsgEnd ;size of data in bytes
+ mov ax,offset CODERES: EndCode ;size of code in bytes
+
+ add cx,ax
+ add cx,15 ;round up to next para
+ shr cx,1
+ shr cx,1
+ shr cx,1
+ shr cx,1 ;ax = para size of res code
+ mov ResSize,cx ;store resident size
+ jmp short load_low ;let code remain low
+
+no_move:
+ mov cl,4
+ add di,0fh
+ and di,0fff0h ;round it to a para offset
+ jmp short patch_up
+
+setup_move:
+ mov si,offset RESGROUP: StartCode
+ mov cx,offset CODERES: EndCode ;cx = bytes to move
+
+ cld
+ push di ;need di for patching offset
+ rep movsb
+ pop di
+
+patch_up:
+ call patch_stub
+ pop es
+ pop ds
+ assume ds:nothing
+ ret
+
+Move_res_code endp
+
+
+;*** Alloc_env -- This routine allocates the temporary environment for the
+; Init code to initialize the COMSPEC. This is not a complete environment.
+; Later on, at EndInit time, a proper sized environment is allocated and
+; the contents of this temporary environment are copied to it. This routine
+; will not be called in case a valid environment is passed to command.com
+;
+; ENTRY: None
+;
+; EXIT: ax = segment of allocated environment segment
+;
+; REGISTERS AFFECTED: ax,bx,cx
+;
+
+Alloc_env proc near
+
+ push ds
+ push es
+ push si
+ push di
+
+;
+;Allocate default environment size
+;
+ mov bx,SIZE Environment / 16 ;temp env size in paras
+ mov ah,ALLOC
+ int 21h
+ jc init_nomem ;insufficient memory, error
+
+ mov es,ax
+ assume es:nothing ;es = temp env segment
+ xor di,di
+ mov ax,di
+;
+;First clear out the entire buffer
+;
+ mov cx,SIZE Environment
+ rep stosb
+
+;
+;Init. the path string (PATH=) first
+;
+
+ push ss ; M026
+ pop ds ; ds = RESGROUP ; M026
+ assume ds:RESGROUP ; M026
+ mov si,offset RESGROUP: PathString ;ds:si = "PATH=\0"
+ mov di,Env_Pathstring ;offset of Path in env seg
+pathlp:
+ lodsb
+ stosb
+ or al,al ;end of string?
+ jnz pathlp ;no, continue transfer
+;
+;Init. the Comspec string
+;
+ mov si,offset RESGROUP: ComspString ;"COMSPEC=\COMMAND.COM\0"
+ mov di,Env_Comstring ;location of Comspec string
+comsplp:
+ lodsb
+ stosb
+ or al,al ;end of string?
+ jnz comsplp
+
+ mov ax,es ;return env seg in ax
+
+ pop di
+ pop si
+ pop es
+ pop ds
+ assume ds:nothing
+ ret
+
+init_nomem:
+;
+;We call the error routine from here. This routine never returns. It either
+;terminates COMMAND with error( if it is not the first invocation ) or hangs
+;the system ( if it is the first COMMAND.COM ).
+;
+ call alloc_error
+
+Alloc_env endp
+
+;*** Alloc_error: This routine just jumps to the actual label where we
+; check if this is a permanent or secondary command.com and take the
+; appropriate action.
+;
+; ENTRY: ds = RESGROUP = DATARES
+;
+; EXIT: None - does not return
+;
+; REGISTERS AFFECTED: Does not matter
+;
+
+public Alloc_error
+Alloc_error proc near
+
+ jmp RESGROUP:BadMemErr
+
+Alloc_error endp
+
+;*** Patch_stub -- This routine patches in the segment and offset values in
+; the stub table of the various entry points in the resident code segment.
+; Some of them are interrupt entry points and some of them are entries from
+; the transient to the resident code segment.
+;
+; ENTRY: ds = RESGROUP
+; es:di = segment:offset of final location of resident code
+;
+; EXIT: All segments and offsets patched into the stub table
+;
+; REGISTERS AFFECTED: ax, bx, cx, dx, si, di
+;
+;
+Patch_stub proc near
+
+ assume ds:RESGROUP
+
+ push es
+
+ mov bx,es ;bx = resident code segment
+ mov dx,di
+ mov di,offset DATARES:Int2f_Entry
+ mov si,offset RESGROUP:Reloc_Table
+ push ds
+ pop es ;es = RESGROUP = DATARES
+;
+;bx:dx = segment:offset of resident code segment
+;es:di = entry point table in stub
+;ds:si = offset table in INIT segment -- offsets of code entry points now
+;
+ mov cx,NUM_RELOC_ENTRIES ;number of entry points
+patchlp:
+ lodsw ;get current offset
+ add ax,dx ;offset it by code seg location
+ stosw ;store offset
+ mov ax,bx
+ stosw ;store segment
+ loop patchlp
+
+ pop es
+ ret
+
+Patch_stub endp
+
+;*** Patch_segs -- This routine patches the segment values in the dword
+; pointers that the stub uses to jump to the actual handler. These values
+; are temporarily needed to handle these interrupts if they occur before
+; the resident is relocated to its final position and all the addresses of
+; the handlers have been updated.
+;
+; ENTRY: es = PSP segment = code segment
+;
+; EXIT: Current segment values patched into the jump table in the
+; stub.
+;
+; REGISTERS AFFECTED: ax, cx, di
+;
+
+Patch_segs proc near
+
+ mov di,offset RESGROUP:Int2f_Entry
+ mov cx,4 ;we have to patch 4 handlers
+ add di,2
+ mov ax,es
+
+pseglp:
+ stosw ;store the segment value
+ add di,2 ;skip the next offset value
+ loop pseglp
+
+ ret
+
+Patch_segs endp
+
+
+;*** get_XMMAddr -- This routine gets the call address for the XMM driver
+; by issuing the appropriate int 2fh. This is stored in a stub variable
+; and is used by the stub when we have to jump to the resident in HMA
+;
+; ENTRY: ds = RESGROUP
+;
+; EXIT: XMMCallAddr = XMM driver far call address
+;
+; REGISTERS AFFECTED:
+;
+
+get_XMMAddr proc near
+ assume ds:RESGROUP
+
+ push es
+
+ mov ax,XMM_MULTIPLEX SHL 8 + XMM_INSTALL_CHECK
+ int 2Fh
+ cmp al,80h ; Q: installed
+ jne short cXMMexit ; N: set error, quit
+;
+; get the XMM control functions entry point, save it, we
+; need to call it later.
+;
+ mov ax,XMM_MULTIPLEX SHL 8 + XMM_FUNCTION_ADDR
+ int 2Fh
+
+ mov word ptr [XMMCallAddr], bx
+ mov word ptr [XMMCallAddr+2],es
+
+cXMMexit:
+ pop es
+ ret ; done
+
+get_XMMAddr endp
+
+
+; IRename
+; Input : ds:dx - Existing File
+; ds:di - NewFile
+; Output None
+;
+
+
+IRename proc near
+
+ mov ah,56h
+ push ds
+ pop es
+ int 21h
+ ret
+
+IRename endp
+
+; IAccess
+; Input : ds:dx - file name
+; Output CY Set if file not found
+; CY Clear if file found
+
+IAccess proc near
+
+ mov ax,4300h
+ int 21h
+ ret
+
+IAccess endp
+
+; IDelete
+; Input ds:dx - file to delete
+; Output None
+
+IDelete proc near
+
+ mov ah,41h
+ int 21h
+ ret
+
+IDelete endp
+
+INIT ENDS
+
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/command/iparse.asm b/private/mvdm/dos/v86/cmd/command/iparse.asm
new file mode 100644
index 000000000..4c6535e6f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/iparse.asm
@@ -0,0 +1,43 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)iparse.asm 4.1 87/04/28
+; SCCSID = @(#)iparse.asm 4.1 87/04/28
+TITLE COMMAND interface to SYSPARSE
+
+.xlist
+.xcref
+ INCLUDE comseg.asm ;AN000;
+.list
+.cref
+
+
+INIT SEGMENT PUBLIC PARA ;AN000;
+
+ASSUME CS:RESGROUP,DS:RESGROUP,ES:NOTHING,SS:NOTHING ;AN000;
+
+
+;AD054; public SYSPARSE ;AN000;
+
+ DateSW equ 0 ;AN000; do not Check date format
+ TimeSW equ 0 ;AN000; do not Check time format
+ CmpxSW equ 0 ;AN000; do not check complex list
+ KeySW equ 0 ;AN025; do not support keywords
+ Val2SW equ 0 ;AN025; do not Support value definition 2
+ Val3SW equ 0 ;AN000; do not Support value definition 3
+ QusSW equ 0 ;AN025; do not include quoted string
+ DrvSW equ 0 ;AN025; do not include drive only
+
+.xlist
+.xcref
+;AD054; INCLUDE parse.asm ;AN000;
+.list
+.cref
+
+
+INIT ends ;AN000;
+ end ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/loadhi.asm b/private/mvdm/dos/v86/cmd/command/loadhi.asm
new file mode 100644
index 000000000..10fe0d711
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/loadhi.asm
@@ -0,0 +1,574 @@
+ page ,132
+ title LOADHIGH Internal Command
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+;************ LOADHIGH command -- loads programs into UMBs.
+;
+comment %==================================================================
+
+This is a new module added to support loading programs into UMBs provided
+by DOS 5.0.
+
+Usage:
+
+LOADHIGH <filespec>
+
+<filespec> has to be a filename that is not wildcarded.
+
+
+==========================================================================%
+
+;
+; Revision History
+; ================
+;
+; M009 SR 08/01/90 Set flags to indicate that we are
+; loading and high and also remember
+; current UMB state.
+;
+; M016 SR 08/09/90 Give special error message on attempt
+; to loadhigh batch files and invalid
+; filename on Loadhigh command line.
+;
+; M039 SR 11/19/90 Bug #4270. Copy all the whitespaces
+; after the program name also as part
+; of the command line being passed to
+; the program to be invoked.
+;
+
+
+;*** INCLUDE FILES
+
+
+ .xlist
+ .xcref
+
+ include comseg.asm
+ include comequ.asm
+ include dossym.inc
+ include syscall.inc
+ include arena.inc
+
+ .list
+ .cref
+
+;*** EQUATES AND STRUCTURES
+
+NUM_LH_SWS equ 5 ;number of valid switches
+
+
+ResultBuffer struc ; structure of parse result buffer
+
+ValueType db ?
+ValueTag db ?
+SynPtr dw ?
+ValuePtr dd ?
+
+ResultBuffer ends
+
+
+DATARES segment
+
+ extrn LoadHiFlg :BYTE
+
+DATARES ends
+
+
+TRANDATA segment
+
+ extrn ComExt :BYTE
+ extrn ExeExt :BYTE
+ extrn Extend_Buf_Ptr :WORD
+ extrn Msg_Disp_Class :BYTE
+ extrn Parse_LoadHi :BYTE
+ extrn NoExecBat_Ptr :WORD ; M016
+ extrn LhInvFil_Ptr :WORD ; M016
+
+TRANDATA ends
+
+TRANSPACE segment
+
+ extrn ResSeg :WORD
+ extrn ExecPath :BYTE
+ extrn Comsw :WORD
+ extrn Arg :BYTE
+ extrn SwitChar :BYTE ; M039
+
+TRANSPACE ends
+
+TRANCODE segment
+
+ extrn Cerror:near
+ extrn Parse_With_Msg:near
+ extrn Lh_Execute:near ;new execute label; M051
+ extrn Path_Search:near
+
+ assume cs:TRANGROUP,ds:TRANGROUP,es:nothing,ss:TRANGROUP
+
+;**** LoadHigh -- Main routine for Loadhigh command
+;
+; ENTRY Command line tail is at PSP:81h terminated by 0dh
+; CS = DS = SS = TRANGROUP
+;
+; EXIT None
+;
+; USED ax, bx, cx, dx, si, di, es
+;
+; ERROR EXITS
+; Message pointers are setup at the error locations and then
+; we jump back to CERROR which is the transient error recycle point.
+; Apart from parse errors, the other errors handled are too many
+; switches anf invalid filenames.
+;
+; EFFECTS
+; The allocation strategy and the state of the arena chain are
+; put in the requested state according to the given options. If a
+; filename is also given, it is executed as well.
+;
+;
+
+ public LoadHigh
+
+LoadHigh proc near
+
+ push ds
+ pop es
+ assume es:TRANGROUP
+;
+;M039
+; Get command tail to be passed to the program. This includes any whitespace
+;chars between the program name and its parameters as well.
+;On return, ds:si points at the start of the command tail.
+;
+ call GetCmdTail ;Get command tail for pgm ;M039
+ push si ;save its start offset ;M039
+
+ call ParseLhCmd ;parse the command line
+ pop si ;restore start offset ;M039
+ jc LhErr ;error parsing, abort
+
+ call SetupCmdLine ;setup pgm's command line
+
+ call SetupPath ;setup path for file
+ jc LhErr ;file not found
+
+;
+;Set allocation strategy to HighFirst and link in UMBs for exec. This will
+;be reset after return from the Exec
+;We will also set a resident flag to indicate that UMBs were activated for
+;the Exec. On return from the Exec, this flag will be used to deactivate UMBs
+;
+ call SetupUMBs ;set alloc strat & link state
+
+ jmp Lh_Execute ;go and exec file ;M051
+
+LhErr:
+;
+;The error message has been setup at this stage
+;
+ jmp Cerror ;print error message and recycle
+
+LoadHigh endp
+
+
+;*** ParseLhCmd -- calls system parser to parse command line
+;
+; ENTRY Parse block Parse_LoadHi setup
+;
+; EXIT Carry clear -- command line parsed successfully
+; Carry set -- appropriate error message setup
+;
+; USED di, cx, bx, ax, si, dx
+;
+; EFFECTS
+; Options set up
+; Filename to be executed setup
+;
+
+
+ParseLhCmd proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ mov si,81h ;ds:si points at command line
+ mov Comsw,0 ;clear switch indicator
+ mov di,offset TRANGROUP:Parse_LoadHi ;es:di = ptr to parse blk
+ xor cx,cx ;no positionals found yet
+lhParse:
+ call Parse_With_Msg
+ cmp ax,END_OF_LINE
+ je lhpRet ;EOL encountered, return(no carry)
+ cmp ax,RESULT_NO_ERROR
+ jne lhperrRet ;parse error, return
+;
+;Parse call succeeded. We have a filespec
+;DX = ptr to result buffer
+;
+ mov bx,dx ;BX = ptr to parse result buffer
+ call LhCopyFilename ;copy filename into our buffer
+ jc lhpRet ;bad filename, return
+ jmp short lhpRet ;done parsing, return (no error)
+
+lhperrRet:
+ stc
+lhpRet:
+ ret
+
+
+ParseLhCmd endp
+
+
+;*** Lh_On -- Activate allocation of UMBs
+;
+; ENTRY None
+;
+; EXIT None
+;
+; USED
+;
+; EFFECTS
+; Allocation strategy is set to HighFirst
+;
+
+Lh_On proc near
+
+ mov ax,(ALLOCOPER shl 8) OR 0
+ int 21h ;get alloc strategy
+
+ mov bx,ax
+ or bx,HIGH_FIRST ;set alloc to HighFirst
+
+ mov ax,(ALLOCOPER shl 8) OR 1
+ int 21h ;set alloc strategy
+
+ ret
+Lh_On endp
+
+
+;*** Lh_Link -- links UMBs to arena
+;
+; ENTRY None
+;
+; EXIT None
+;
+; USED ax, bx
+;
+; EFFECTS
+; UMBs are linked into the DOS arena chain
+;
+
+Lh_Link proc near
+
+ mov ax,(ALLOCOPER shl 8) OR 3
+ mov bx,1
+ int 21h ;link in UMBs
+
+ ret
+
+Lh_Link endp
+
+
+;*** LhCopyFilename -- copy filename from command line to buffer
+;
+; ENTRY ds:bx points at parse result block
+;
+; EXIT CY set -- filename has wildcards
+; Setup for error message
+;
+; USED ax
+;
+; EFFECTS
+; ExecPath contains the filename
+;
+
+LhCopyFilename proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ push ds
+ push si
+ push di
+
+ lds si,[bx].ValuePtr
+ mov di,offset TRANGROUP:ExecPath
+
+movlp:
+ lodsb
+;
+;If there are any wildcards in the filename, then we have an error
+;
+ cmp al,'*' ;wildcard?
+ je lhfilerr ;yes, error
+ cmp al,'?' ;wildcard?
+ je lhfilerr ;yes, error
+
+ stosb ;store char
+ or al,al ;EOS reached?
+ jnz movlp ;no, continue
+
+ clc ;indicate no error
+lhcopyret:
+ pop di
+ pop si
+ pop ds
+ ret
+
+lhfilerr:
+ mov dx,offset TRANGROUP:LhInvFil_Ptr ; "Invalid Filename" ; M016
+ stc
+ jmp short lhcopyret
+
+LhCopyFilename endp
+
+;
+;M039; Begin changes
+
+;*** GetCmdTail -- scan through the command line looking for the start
+; of the command tail to be passed to program that is to be invoked.
+;
+; ENTRY ds = TRANGROUP
+; At ds:80h, command tail for lh is present.
+;
+; EXIT ds:si points at the command tail for program
+;
+; USED
+;
+
+GetCmdTail proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ mov si,81h ;ds:si = command line for lh
+
+ invoke scanoff ;scan all delims before name
+;
+; Skip over the program name until we hit a delimiter
+;
+lhdo_skipcom:
+ lodsb ;
+ invoke delim ;is it a delimiter?
+ jz scandone ;yes, we are done
+ cmp AL, 0DH ;end of line?
+ jz scandone ;yes, found command tail
+ cmp al,SwitChar ;switch char?
+ jnz lhdo_skipcom ;no, continue scanning
+
+scandone:
+ dec si ;point at the command tail start
+
+ ret
+
+GetCmdTail endp
+
+;M039; End changes
+;
+
+;*** SetupCmdLine -- prepare command line for the program
+;
+; ENTRY ds:si = points just beyond prog name on command line
+;
+; EXIT None
+;
+; USED
+;
+; EFFECTS
+; The rest of the command line following the pgm name is
+; moved to the top of the command line buffer (at TRANGROUP:80h)
+; and a new command line length is put in
+;
+
+SetupCmdLine proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ mov di,81h
+ xor cl,cl
+ dec cl ;just CR means count = 0
+stcllp:
+ lodsb
+ stosb
+ inc cl ;update count
+
+ cmp al,0dh ;carriage return?
+ jne stcllp ;no, continue storing
+
+ mov es:[80h],cl ;store new cmd line length
+
+ ret
+
+SetupCmdLine endp
+
+
+
+;*** LhSetupErrMsg -- Sets up error messages
+;
+; ENTRY ax = error message number
+;
+; EXIT None
+;
+; USED dx
+;
+; EFFECTS
+; Everything setup to display error message
+;
+
+LhSetupErrMsg proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ mov msg_disp_class,EXT_MSG_CLASS
+ mov dx,offset TranGroup:Extend_Buf_ptr
+ mov Extend_Buf_ptr,ax
+
+ ret
+
+LhSetupErrMsg endp
+
+;
+;M009; Start of changes
+;
+
+;*** GetUMBState -- get the current alloc strat and link state
+;
+; ENTRY None
+;
+; EXIT al contains the status as follows:
+; b0 = 1 if Alloc strat is HighFirst
+; = 0 if alloc strat is LowFirst
+; b1 = 1 if UMBs are linked in
+; = 0 if UMBs are unlinked
+;
+; USED ax, bx
+;
+
+GetUMBState proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+ mov ax,(ALLOCOPER shl 8) OR 0 ;get alloc strat
+ int 21h
+ mov bl,al
+
+ mov ax,(ALLOCOPER shl 8) OR 2 ;get link state
+ int 21h
+ mov bh,al
+
+ xchg ax,bx ;ax contains the state
+ rol al,1 ;get HighFirst state in b0
+ and al,01 ;mask off b1-b7
+ shl ah,1 ;linkstate in b1
+ or al,ah ;b0=HighFirst, b1=Linkstate
+
+ ret
+
+GetUMBState endp
+
+;
+; M009; End of changes
+;
+
+
+;*** SetupUMBs -- set allocation strategy to HighFirst and link in UMBs to
+; DOS arena to load the program into UMBs
+;
+; ENTRY None
+;
+; EXIT None
+;
+; USED
+;
+; EFFECTS
+; Allocation strategy set to HighFirst
+; UMBs linked into DOS arena
+
+SetupUMBs proc near
+ assume ds:TRANGROUP
+
+ push ds
+
+ call GetUMBState ;get current state of UMBs ;M009
+
+ mov ds,ds:ResSeg ; M009
+ assume ds:DATARES ; M009
+ mov LoadHiFlg,al ; M009
+ or LoadHiFlg,80h ;indicate loadhigh issued ; M009
+
+ pop ds
+ assume ds:TRANGROUP
+
+ call Lh_On ;alloc strategy to HighFirst
+ call Lh_Link ;link in UMBs
+
+ ret
+
+SetupUMBs endp
+
+;*** SetupPath -- Do path search for the file to be executed
+;
+; ENTRY None
+;
+; EXIT Carry set if file not found or not executable file
+;
+; EFFECTS
+; ExecPath contains the full path of the file to be executed
+;
+
+SetupPath proc near
+ assume ds:TRANGROUP, es:TRANGROUP
+
+;
+;Juggle around the argv pointers to make argv[1] into argv[0]. This is
+;because the path search routine that we are about to invoke expects the
+;filename to search for to be argv[0]
+;
+ mov ax,arg.argvcnt ;total number of arguments
+ dec ax ;less one - skip "LoadHigh"
+ mov bx,SIZE Argv_ele
+ mul bx ;dx:ax = size of argument lists
+
+;
+;Move argv[1]..argv[n] to argv[0]..argv[n-1]
+;
+ mov di,offset TRANGROUP:Arg
+ mov si,di
+ add si,SIZE Argv_ele
+ mov cx,ax ;size to move
+
+ cld
+ rep movsb ;Move the argument list
+
+ dec arg.argvcnt ;fake one less argument
+
+ call path_search ;look in the path
+;
+;ax = 0, no file found
+;ax < 4, batch file found -- cant be executed
+;ax = 4,8 => .com or .exe file found
+;
+ or ax,ax ;any file found?
+ jz no_exec_file ;no, error
+
+ cmp ax,4 ;executable file?
+ jl no_exec_bat ;no, indicate fail ; M016
+
+ clc
+ ret
+
+no_exec_bat: ; M016
+ mov dx,offset TRANGROUP:NoExecBat_Ptr ;Setup message ptr ; M016
+ jmp short lhsp_errret ;return error; M016
+
+no_exec_file:
+ mov ax,ERROR_FILE_NOT_FOUND
+ call LhSetupErrMsg ;setup error message
+
+lhsp_errret: ; M016
+ stc
+ ret
+
+SetupPath endp
+
+
+
+TRANCODE ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/makefil0 b/private/mvdm/dos/v86/cmd/command/makefil0
new file mode 100644
index 000000000..81a55ad77
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/makefil0
@@ -0,0 +1,11 @@
+!IFNDEF COUNTRY
+COUNTRY=usa-ms
+!ENDIF
+
+$(COUNTRY)\buildmsg.exe: buildmsg.c
+ cl16 -I.\$(COUNTRY) -Ic:\dosdev\c6\include buildmsg.c
+ forcedos link buildmsg,$(COUNTRY)\buildmsg,,, /stack:4096
+
+clean:
+ if exist .\$(COUNTRY)\buildmsg.exe del .\$(COUNTRY)\buildmsg.exe
+ if exist .\$(COUNTRY)\*.obj del .\$(COUNTRY)\*.obj
diff --git a/private/mvdm/dos/v86/cmd/command/makefile b/private/mvdm/dos/v86/cmd/command/makefile
new file mode 100644
index 000000000..7469988d9
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/makefile
@@ -0,0 +1,536 @@
+#************************** makefile for cmd\command *********************
+#
+# SUDEEPB 22-Mar-1991 Ported For NT
+#
+#*************************************************************************
+
+include ..\..\make.inc
+
+dest =command.com
+
+#
+####################### dependencies begin here. #########################
+#
+
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exc del *.exc
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist command.com del command.com
+
+command.ctl: command.skl \
+ $(msg)\$(COUNTRY).msg \
+ makefile
+ $(COUNTRY)\buildmsg.exe $(msg)\$(COUNTRY) command.skl
+
+command1.obj: command1.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ comsw.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ resmsg.equ \
+ envdata.asm
+
+command2.obj: command2.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\pdb.inc \
+ $(inc)\syscall.inc \
+ comsw.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ resmsg.equ
+
+copy.obj: copy.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\sf.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+copypr1.obj: copypr1.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\sf.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+copypr2.obj: copypr2.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\sf.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+cparse.obj: cparse.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\devsym.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+init.obj: init.asm \
+ $(inc)\dossym.inc \
+ $(inc)\pdb.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\mult.inc \
+ $(inc)\syscall.inc \
+ $(inc)\doscntry.inc \
+ $(cinc)\cmdsvc.inc \
+ comsw.asm \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ resmsg.equ
+
+iparse.obj: iparse.asm \
+ comseg.asm \
+ $(inc)\parse.asm \
+ $(inc)\psdata.inc
+
+parse2.obj: parse2.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\devsym.inc \
+ comsw.asm \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+path1.obj: path1.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ comsw.asm \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+path2.obj: path2.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\find.inc \
+ comsw.asm \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+rdata.obj: rdata.asm \
+ comsw.asm \
+ comseg.asm \
+ resmsg.equ \
+ $(msg)\comrmsg.inc
+
+stub.obj: stub.asm \
+ comseg.asm
+
+rucode.obj: rucode.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\filemode.inc \
+ $(inc)\pdb.inc \
+ $(inc)\mult.inc \
+ $(inc)\doscntry.inc \
+ $(inc)\devsym.inc \
+ comsw.asm \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ resmsg.equ
+
+tbatch.obj: tbatch.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\doscntry.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+tbatch2.obj: tbatch2.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm
+
+dir.obj: dir.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\bpb.inc \
+ $(inc)\filemode.inc \
+ $(inc)\find.inc \
+ $(inc)\ioctl.inc \
+ $(inc)\devsym.inc \
+ $(inc)\rombios.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ ifequ.asm
+
+tcmd1b.obj: tcmd1b.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\bpb.inc \
+ $(inc)\syscall.inc \
+ $(inc)\filemode.inc \
+ $(inc)\sf.inc \
+ $(inc)\ioctl.inc \
+ comseg.asm \
+ $(cinc)\curdir.inc \
+ comequ.asm \
+ $(inc)\ea.inc
+
+tcmd2a.obj: tcmd2a.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\bpb.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\filemode.inc \
+ $(inc)\sf.inc \
+ $(inc)\ioctl.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\rombios.inc \
+ comseg.asm comequ.asm
+
+tcmd2b.obj: tcmd2b.asm comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\pdb.inc \
+ $(inc)\mult.inc \
+ comseg.asm \
+ comequ.asm \
+ $(cinc)\cmdsvc.inc
+
+tcode.obj: tcode.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ comseg.asm \
+ comequ.asm \
+ $(inc)\vector.inc \
+ $(inc)\pdb.inc \
+ $(inc)\arena.inc \
+ $(inc)\mshalo.asm \
+ $(cinc)\cmdsvc.inc \
+ $(cinc)\vint.inc
+
+tdata.obj: tdata.asm \
+ comsw.asm \
+ comseg.asm \
+ $(inc)\dirent.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\error.inc \
+ ifequ.asm \
+ comequ.asm \
+ $(inc)\sysmsg.inc \
+ $(inc)\versiona.inc \
+ command.ctl \
+ $(inc)\msgdcl.inc \
+ $(inc)\msgserv.asm \
+ tranmsg.asm \
+ $(inc)\ea.inc
+
+tenv.obj: tenv.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\arena.inc \
+ comseg.asm \
+ comequ.asm \
+ $(inc)\doscntry.inc
+
+tenv2.obj: tenv2.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\find.inc \
+ comseg.asm \
+ comequ.asm
+
+tfor.obj: tfor.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\find.inc \
+ $(inc)\devsym.inc \
+ comseg.asm \
+ comequ.asm \
+ fordata.asm
+
+tmisc1.obj: tmisc1.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ comseg.asm \
+ comequ.asm
+
+tmisc2.obj: tmisc2.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\ioctl.inc \
+ $(cinc)\curdir.inc \
+ comseg.asm \
+ comequ.asm
+
+tparse.obj: tparse.asm \
+ comsw.asm \
+ comseg.asm \
+ $(inc)\parse.asm \
+ $(inc)\psdata.inc
+
+tpipe.obj: tpipe.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\pdb.inc \
+ comseg.asm \
+ comequ.asm
+
+
+tprintf.obj: tprintf.asm \
+ comsw.asm \
+ $(inc)\dosmac.inc \
+ comseg.asm \
+ comequ.asm \
+ $(cinc)\curdir.inc \
+ $(inc)\sysmsg.inc \
+ $(inc)\versiona.inc \
+ command.ctl \
+ $(inc)\msgdcl.inc \
+ $(inc)\msgserv.asm
+
+tspc.obj: tspc.asm \
+ comsw.asm \
+ $(inc)\dossym.inc \
+ $(inc)\find.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ $(inc)\intnat.inc \
+ comequ.asm \
+ comseg.asm \
+ $(inc)\ea.inc
+
+tucode.obj: tucode.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\dbcs.sw \
+ $(inc)\dosmac.inc \
+ $(inc)\versiona.inc \
+ $(inc)\buffer.inc \
+ $(inc)\dirent.inc \
+ $(inc)\error.inc \
+ $(cinc)\curdir.inc \
+ comsw.asm \
+ comseg.asm \
+ comequ.asm
+
+uinit.obj: uinit.asm \
+ comsw.asm \
+ comseg.asm \
+ ifequ.asm \
+ $(msg)\comimsg.inc
+
+loadhi.obj: loadhi.asm \
+ comseg.asm \
+ comequ.asm \
+ $(inc)\dossym.inc \
+ $(inc)\syscall.inc \
+ $(inc)\arena.inc
+
+
+command.exc: command1.obj tenv2.obj \
+ command2.obj tmisc1.obj \
+ rucode.obj tmisc2.obj \
+ rdata.obj tpipe.obj \
+ init.obj parse2.obj \
+ iparse.obj path1.obj \
+ uinit.obj path2.obj \
+ tcode.obj tucode.obj \
+ tbatch.obj copy.obj \
+ tbatch2.obj copypr1.obj \
+ tfor.obj copypr2.obj \
+ dir.obj cparse.obj \
+ tcmd1b.obj tparse.obj \
+ tcmd2a.obj tprintf.obj \
+ tcmd2b.obj tdata.obj \
+ tenv.obj tspc.obj \
+ stub.obj loadhi.obj
+ link16 @command.lnk
+
+$(dest): command.exc
+ copy $*.exc $*.exe
+ reloc $* $*.com
+ del $*.exe
diff --git a/private/mvdm/dos/v86/cmd/command/parse2.asm b/private/mvdm/dos/v86/cmd/command/parse2.asm
new file mode 100644
index 000000000..149a6e34d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/parse2.asm
@@ -0,0 +1,428 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)parse.asm 1.1 85/05/14
+; SCCSID = @(#)parse.asm 1.1 85/05/14
+.sall
+.xlist
+.xcref
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include comsw.asm
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+break <Parse.Asm>
+;----------------------------------------------------------------------------
+; PARSE.ASM contains the routines to perform command line parsing.
+; Parse and Path share a buffer and argv[] definitions.
+; Invoking <Parseline> maps the unparsed command line in COMBUF into an
+; array of pointers to the parsed tokens. The resulting array, argv[],
+; also contains extra information provided by cparse about each token
+; <Parseline> should be executed prior to <Path_Search>
+;
+; Alan L, OS/MSDOS August 15, 1983
+;
+;
+; ENTRY:
+; <Parseline>: command line in COMTAB.
+; EXIT:
+; <Parseline>: success flag, argcnt (number of args), argv[].
+; NOTE(S):
+; * <Argv_calc> handily turns an array index into an absolute pointer.
+; The computation depends on the size of an argv[] element (arg_ele).
+; * <Parseline> calls <cparse> for chunks of the command line. <Cparse>
+; does not function as specified; see <Parseline> for more details.
+; * <Parseline> now knows about the flags the internals of COMMAND.COM
+; need to know about. This extra information is stored in a switch_flag
+; word with each command-line argument; the switches themselves will not
+; appear in the resulting arg structure.
+; * With the exception of CARRY, flags are generally preserved across calls.
+;---------------
+; CONSTANTS:
+;---------------
+ DEBUGx equ FALSE ; prints out debug info
+;---------------
+; DATA:
+;---------------
+
+DATARES SEGMENT PUBLIC BYTE
+ EXTRN FORFLAG:BYTE
+DATARES ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN combuf:byte
+ EXTRN cpyflag:byte
+ EXTRN expand_star:byte
+ EXTRN RESSEG:word
+ EXTRN STARTEL:word
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+ PUBLIC argv_calc ; convert array index into address
+ PUBLIC parseline
+
+
+assume cs:trangroup, ds:trangroup, es:trangroup, ss:nothing
+
+
+break <Parseline: Munch on the command line>
+;----------------------------------------------------------------------------
+; PARSELINE takes an MSDOS command line and maps it into a UNIX-style
+; argv[argvcnt] array. The most important difference between this array and
+; the tradition UNIX format is the extra cparse information included with
+; each argument element.
+;---------------
+; ENTRY:
+; (BL special delimiter for cparse -- not implemented)
+;---------------
+; EXIT:
+; CF set if error
+; AL error code (carry set). Note AH clobbered in any event.
+; argv[] array of cparse flags and pointers to arguments
+; argvcnt argument count
+;---------------
+; NOTE(S):
+; * BL (special delimiter) is ignored, for now (set to space).
+; * Parseflags record contains cparse flags, as follows:
+; sw_flag -- was this arg a switch?
+; wildcard -- whether or not it contained a * or ?
+; path_sep -- maybe it was a pathname
+; unused -- for future expansion
+; special_delim -- was there an initial special delimiter?
+; * argv[] and argvcnt are undefined if CF/AL indicates an error.
+; * Relationship between input, cparse output, and comtail can be
+; found in the following chart. Despite the claim of the cparse
+; documentation that, "Token buffer always starts d: for non switch
+; tokens", such is not the case (see column two, row two).
+; Similarly, [STARTEL] is not null when the command line is one of
+; the forms, "d:", "d:\", or "d:/". In fact, *STARTEL (i.e., what
+; STARTEL addresses) will be null. This is clearly just a
+; documentation error.
+; * cparse also returns a switch code in BP for each switch it
+; recognizes on the command line.
+; * arglen for each token does NOT include the terminating null.
+; * Finally, note that interesting constructions like 'foodir/*.exe'
+; parse as three separate tokens, and the asterisk is NOT a wildcard.
+; For example, 'for %i in (foodir/*.exe) do echo %i' will first
+; echo 'foodir', then '*', then '.exe'. Using cparse for command-
+; line parsing may result in slightly different behavior than
+; previously observed with the old COMMAND.COM command-line parser.
+;
+; Input Cparse Command Line (80H)
+; \alan\foo.bat c:\alan\foo.bat \alan\foo.bat
+; alan\foo.bat alan\foo.bat alan\foo.bat
+; foo.bat foo.bat foo.bat
+; c:\alan\foo.bat c:\alan\foo.bat c:\alan\foo.bat
+; c:alan\foo.bat c:alan\foo.bat c:alan\foo.bat
+; c:foo.bat c:foo.bat c:foo.bat
+;---------------
+; CONSTANTS:
+;---------------
+;---------------
+; DATA:
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte
+ EXTRN argbufptr:word
+ EXTRN comptr:word
+ EXTRN last_arg:word
+ EXTRN tpbuf:byte
+TRANSPACE ENDS
+
+;---------------
+parseline:
+;---------------
+
+ push AX ; most of these are clobbered
+ push BX ; by cparse...
+ push CX
+ push DX
+ push DI
+ push SI
+ pushf
+ mov cpyflag,0 ; Turn "CPARSE called from COPY flag" off
+
+ mov [LAST_ARG], -1 ; last argument at which to accumulate
+ xor ax,ax
+ mov cx,SIZE arg_unit
+ mov di,offset trangroup:arg
+ rep stosb
+ mov argbufptr,offset trangroup:arg.argbuf
+ mov arg.argswinfo, 0 ; switch information, and info to date
+ mov arg.argvcnt, 0 ; initialize argvcnt/argv[]
+ mov SI, OFFSET TRANGROUP:combuf+2 ; prescan leaves cooked input in combuf
+
+; This next section of code (up to pcont:) makes sure that si is set up for
+; parsing. It should point at COMBUF if FORFLAG is set and arg.argforcombuf
+; otherwise. This is done so that commands can get arg pointers into their
+; original command line (or an exact copy of it) in arg_ocomptr.
+; Arg.argforcombuf is used so that the for loop processor will always be able
+; to get a hold of its original command line; even after COMBUF is blasted by
+; the command to be repeated or the transient part of command has been
+; reloaded.
+
+ push ds
+ mov ds,[RESSEG]
+ assume ds:resgroup
+ cmp FORFLAG,0
+ pop ds
+ assume ds:trangroup
+ jnz pcont
+ mov di,OFFSET TRANGROUP:arg.argforcombuf
+ xor ch,ch
+ mov cl,[COMBUF+1]
+ inc cl
+ rep movsb
+ mov si,OFFSET TRANGROUP:arg.argforcombuf
+
+pcont:
+ mov DI, OFFSET TRANGROUP:tpbuf ; destination is temporary token buffer
+ mov BL, ' ' ; no special delimiter, for now
+
+parseloop:
+ mov comptr,si ; save ptr into original command buffer
+ xor BP, BP ; switch information put here by cparse
+ mov byte ptr [expand_star],0 ; don't expand *'s to ?'s
+ invoke scanoff ; skip leading blanks...
+ invoke cparse ; byte off a token (args in SI, DI, BL)
+ jnc More_prse
+ or BP,BP ; Check for trailing switch character
+ jz parsedone
+ call newarg ; We hit CR but BP is non-zero. The
+ ; typical cause of this is that a
+ ; switch char IMMEDIATELY preceeds
+ ; the CR. We have an argument, but it
+ ; is sort of an error.
+ jmp short parsedone ; We're done (found the CR).
+
+More_prse:
+ mov cpyflag,2 ; tell CPARSE that 1st token is done
+ call newarg ; add to argv array (CX has char count)
+ jnc parseloop ; was everything OK?
+ jmp short parse_error ; NO, it wasn't -- bug out (CF set)
+
+parsedone: ; successful completion of parseline
+ popf
+ clc
+ jmp short parse_exit
+
+parse_error: ; error entry (er, exit) point
+ popf
+ stc
+parse_exit: ; depend on not changing CF
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ pop AX
+ ret
+
+;---------------
+; parseline ends
+;----------------------------------------------------------------------------
+
+
+break <NewArg>
+;----------------------------------------------------------------------------
+; NEWARG adds the supplied argstring and cparse data to arg.argv[].
+; ENTRY:
+; BH argflags
+; CX character count in argstring
+; DI pointer to argstring
+; comptr ptr to starting loc of current token in original command
+; [STARTEL] cparse's answer to where the last element starts
+; EXIT:
+; argbufptr points to next free section of argbuffer
+; arg.argbuf contains null-terminated argument strings
+; arg.argvcnt argument count
+; arg.argv[] array of flags and pointers
+; arg.arg_ocomptr ptr to starting loc of current token in original command
+; CF set if error
+; AL carry set: error code; otherwise, zero
+;---------------
+newarg:
+;---------------
+
+ push BX
+ push CX
+ push DX ; one never knows, do one?
+ push DI
+ push SI
+ pushf
+ call arg_switch ; if it's a switch, record switch info
+ ; LEAVE SWITCH ON COMMAND LINE!!
+;;; jc newarg_done ; previous arg's switches -- and leave
+
+ cmp arg.argvcnt, ARGMAX ; check to ensure we've not
+ jge too_many_args ; exceeded array limits
+ mov DH, BH ; save argflags
+ mov BX, arg.argvcnt ; argv[argvcnt++] = arg data
+ inc arg.argvcnt
+ mov AX, OFFSET TRANGROUP:arg.argv
+ call argv_calc ; convert offset to pointer
+ mov [BX].argsw_word, 0 ; no switch information, yet...
+ mov [BX].arglen, CX ; argv[argvcnt].arglen = arg length
+ mov [BX].argflags, DH ; argv[argvcnt].argflags = cparse flags
+ mov SI, argbufptr
+ mov [BX].argpointer, SI ; argv[argvcnt].argpointer = [argbufptr]
+ add SI, [STARTEL] ; save startel from new location
+ sub SI, DI ; form pointer into argbuf
+ mov [BX].argstartel, SI ; argv[argvcnt].argstartel = new [STARTEL]
+ mov si,[comptr]
+ mov [BX].arg_ocomptr,si ; arg_ocomptr=ptr into original com line
+
+ mov SI, DI ; now save argstring in argbuffer
+ mov DI, argbufptr ; load the argbuf pointer and make
+ add DI, CX ; sure we're not about to run off
+ cmp DI, OFFSET TRANGROUP:arg.argbuf+ARGBLEN-1
+ jge buf_ovflow ; the end of the buffer (plus null byte)
+ sub DI, CX ; adjust the pointer
+ cld
+ rep movsb ; and save the string in argbuffer
+ mov AL, ANULL ; tack a null byte on the end
+ stosb
+ mov argbufptr, DI ; update argbufptr after copy
+
+newarg_done:
+ popf
+ clc
+ jmp short newarg_exit
+
+too_many_args:
+ mov AX, arg_cnt_error
+ jmp short newarg_error
+
+buf_ovflow:
+ mov AX, arg_buf_ovflow
+
+newarg_error:
+ popf
+ stc
+
+newarg_exit:
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ ret
+
+;---------------
+; NewArg ends
+;----------------------------------------------------------------------------
+
+
+break <Arg_Switch>
+;----------------------------------------------------------------------------
+; ARG_SWITCH decides if an argument might really be a switch. In the
+; event that it is, and we can recognize
+; ENTRY:
+; As in <newarg>.
+; EXIT:
+; CF -- clear (wasn't a switch); set (was a switch)
+; NOTE(S):
+; * The mechanism mapping a switch into a bit-value depends entirely
+; on the order of definition in the <switch_list> variable and the
+; values chosen to define the bits in CMDT:COMEQU.ASM. Change either
+; <switch_list> or the definitions in CMDT:COMEQU.ASM -- and rewrite
+; this mechanism. This code taken from CMDT:TCODE.ASM.
+; * The <switch_list> declared below is redundant to one declared in
+; TDATA.ASM, and used in TCODE.ASM.
+; * An ugly routine.
+;---------------
+; CONSTANTS:
+;---------------
+; Constants come from the definitions in CMDT:COMEQU.ASM.
+;---------------
+; DATA:
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ extrn switch_list:byte
+ switch_count EQU $-switch_list
+transpace ends
+
+;---------------
+Arg_Switch:
+;---------------
+
+ push AX
+ push BX
+ push CX
+ push DI
+ pushf
+ test BH, MASK sw_flag ; is it a switch? (preserve flag word)
+ jz arg_no_switch0
+ cmp [LAST_ARG], -1 ; have we encountered any REAL args yet?
+ je arg_no_switch1 ; no, so leading switches don't matter
+ mov BX, [LAST_ARG] ; yes, add switch info to last REAL arg
+ mov AX, OFFSET TRANGROUP:arg.argv
+ call argv_calc
+ or [BX].argsw_word, BP
+ or arg.argswinfo, BP
+
+arg_yes_switch: ; ah, sweet success...
+ popf
+ stc
+ jmp short arg_switch_exit
+
+arg_no_switch0:
+ mov AX, arg.argvcnt ; future switches should then affect
+ mov [LAST_ARG], AX ; this argument
+
+arg_no_switch1: ; wasn't a switch, or we're pretending
+ popf
+ clc
+
+arg_switch_exit:
+ pop DI
+ pop CX
+ pop BX
+ pop AX
+ ret
+
+;---------------
+; Arg_Switch ends
+;----------------------------------------------------------------------------
+
+
+break <Argv_calc>
+;----------------------------------------------------------------------------
+; ARGV_CALC maps an array index into a byte-offset from the base of
+; the supplied array. Method used for computing the address is:
+; Array Index * Array Elt Size + Base Addr = Elt Addr
+; ENTRY:
+; AX -- base of array
+; BX -- array index
+; EXIT:
+; BX -- byte offset
+;---------------
+
+argv_calc:
+ push ax ; Save base
+ mov al,bl ; al = array index
+ mov bl,SIZE argv_ele ; bl = size of an argv element
+ mul bl ; ax = base offset
+ pop bx ; Get base
+ add ax,bx ; Add in base offset
+ xchg ax,bx ; Restore ax and put byte offset in bx
+ ret
+
+;---------------
+; argv_calc ends
+;----------------------------------------------------------------------------
+
+
+
+trancode ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/path1.asm b/private/mvdm/dos/v86/cmd/command/path1.asm
new file mode 100644
index 000000000..36ce0a72a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/path1.asm
@@ -0,0 +1,526 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)path1.asm 1.1 85/05/14
+; SCCSID = @(#)path1.asm 1.1 85/05/14
+.sall
+.xlist
+.xcref
+ include dossym.inc
+ include syscall.inc
+ include comsw.asm
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+break <Path.Asm>
+;----------------------------------------------------------------------------
+; PATH.ASM contains the routines to perform pathname incovation. Path and
+; Parse share a temporary buffer and argv[] definitions. <Path_Search>,
+; given a pathname, attempts to find a corresponding executable or batch
+; file on disk. Directories specified in the user's search path will be
+; searched for a matching file, if a match is not found in the current
+; directory and if the pathname is actually only an MSDOS filename.
+; <Path_Search> assumes that the parsed command name can be found in
+; argv[0] -- in other words, <Parseline> should be executed prior to
+; <Path_Search>. Alternatively, the command name and appropriate
+; information could be placed in argv[0], or <Path_Search> could be
+; (easily) modified to make no assumptions about where its input is found.
+; Please find enclosed yet another important routine, <Save_Args>, which
+; places the entire arg/argv[]/argbuf structure on a piece of newly
+; allocated memory. This is handy for for-loop processing, and anything
+; else that wants to save the whole shebang and then process other command
+; lines.
+;
+; Alan L, OS/MSDOS August 15, 1983
+;
+; ENTRY:
+; <Path_Search>: argv[0].
+; <Save_Args>: bytes to allocate in addition to arg structure
+; EXIT:
+; <Path_Search>: success flag, best pathname match in EXECPATH.
+; <Save_Args>: success flag, segment address of new memory
+; NOTE(S):
+; * <Argv_calc> handily turns an array index into an absolute pointer.
+; The computation depends on the size of an argv[] element (arg_ele).
+; * <Parseline> calls <cparse> for chunks of the command line. <Cparse>
+; does not function as specified; see <Parseline> for more details.
+; * <Parseline> now knows about the flags the internals of COMMAND.COM
+; need to know about. This extra information is stored in a switch_flag
+; word with each command-line argument; the switches themselves will not
+; appear in the resulting arg structure.
+; * With the exception of CARRY, flags are generally preserved across calls.
+;---------------
+; CONSTANTS:
+;---------------
+ DEBUGx equ FALSE ; prints out debug info
+;---------------
+; DATA:
+;---------------
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN baddrv_ptr:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte
+ EXTRN BADPMES_ptr:word
+ EXTRN curdrv:byte
+ EXTRN EXECPATH:byte
+ EXTRN search_best_buf:byte
+ EXTRN search_error:word
+ EXTRN string_ptr_2:word
+ EXTRN tpbuf:byte
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+
+assume cs:trangroup, ds:trangroup, es:trangroup, ss:nothing
+
+break <Path_Search>
+;------------------------------------------------------------------------------
+; PATH_SEARCH tries to find the file it's given, somewhere. An initial value
+; of *argv[0].argstartel == 0 implies that there is no command (empty line
+; or 'd:' or 'd:/'). This check is done in strip; otherwise, strip formats
+; the filename/pathname into tpbuf. Search(tpbuf) is executed to see if we
+; have a match, either in the current working directory if we were handed
+; a filename, or in the specified directory, given a pathname. If this call
+; fails, and we were given a pathname, then Path_Search fails. Otherwise,
+; Path_Crunch is repeatedly invoked on tpbuf[STARTEL] (if there's a drive
+; prefix, we want to skip it) for each pathstring in userpath. Success on
+; either the first invocation of search or on one of the succeeding calls
+; sets up the appropriate information for copying the successful pathname
+; prefix (if any) into the result buffer, followed by the successful filename
+; match (from [search_best_buf]). The result is returned in in EXECPATH.
+; ENTRY:
+; argv[0] -- command name and associated information
+; EXIT:
+; AX -- non-zero indicates type of file found
+; EXECPATH -- successful pathname (AX non-zero)
+; NOTE(S):
+; 1) Uses the temporary buffer, tpbuf, from the parse routines.
+; 2) Some files are more equal than others. See search: for rankings.
+; 3) Path_Search terminates as soon as a call to search succeeds, even
+; if search returns an .exe or .bat.
+; 5) Clobbers dma address.
+
+pbuflen equ EXECPATHLEN ; len EXECPATH - ntvdm extended
+path_sep_char equ ';'
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN fbuf:byte
+ EXTRN pathinfo:word
+ EXTRN psep_char:byte
+TRANSPACE ENDS
+
+Procedure Path_Search,NEAR
+ assume ds:trangroup, es:trangroup
+
+ push BX
+ push CX
+ push DX ; could use a "stack 'em" instruction
+ push SI
+ push DI
+ push BP
+ pushf
+ test DS:arg.argv[0].argflags, (MASK wildcard) + (MASK sw_flag)
+ jz path_search_ok
+
+path_failure_jmp:
+ jmp path_failure ; ambiguous commands not allowed
+
+path_search_ok:
+ call store_pchar ; figure out the pathname separator
+ mov DX, OFFSET TRANGROUP:fbuf ; clobber old dma value with
+ trap set_dma ; a pointer to our dma buffer
+ push ES
+ invoke find_path ; get a handle (ES:DI) on user path
+ mov DS:pathinfo[0], ES ; and squirrel it away
+ mov DS:pathinfo[2], DI ; "old" pathstring pointer
+ mov DS:pathinfo[4], DI ; "new" pathstring pointer
+ pop ES
+
+ mov BX, pbuflen ; copy/format argv[0] into temp buffer
+ mov SI, OFFSET TRANGROUP:EXECPATH
+ invoke strip
+ jc path_failure_jmp ; if possible, of course
+
+ mov DX, SI ; search(EXECPATH, error_message)
+ mov [search_error], OFFSET TRANGROUP:BADDRV_ptr
+ invoke search ; must do at least one search
+ or AX, AX ; find anything?
+ jz path_noinit ; failure ... search farther
+
+ mov BP, AX ; success... save filetype code
+ mov DI, OFFSET TRANGROUP:EXECPATH
+ mov SI, DS:arg.argv[0].argpointer
+ mov CX, DS:arg.argv[0].argstartel
+ sub CX, SI ; compute prefix bytes to copy
+;
+; We have the number of bytes in the prefix (up to the final component).
+; We need to form the complete pathname including leading drive and current
+; directory.
+;
+; Is there a drive letter present?
+;
+ cmp word ptr [si], 05c5ch ; If a UNC name, copy straight in
+ je CopyPath
+
+ mov ah,':'
+ cmp cx,2 ; room for drive letter?
+ jb AddDrive ; no, stick it in
+ cmp [si+1],ah ; colon present?
+ jz MoveDrive ; yes, just move it
+
+AddDrive:
+ mov al,curdrv ; get current drive
+ add al,"A" ; convert to uppercase letter
+ stosw ; store d:
+ jmp short CheckPath
+
+MoveDrive:
+ lodsw ; move d:
+ stosw
+ sub cx,2 ; 2 bytes less to move
+
+CheckPath:
+ or al,20h
+ mov dl,al
+ sub dl,"a"-1 ; convert to 1-based for current dir
+;
+; Stick in beginning path char
+;
+ mov al,psep_char
+ stosb
+;
+; Is there a leading /? If so, then no current dir copy is necessary.
+; Otherwise, get current dir for DL.
+;
+ cmp cx,1 ; is there room for path char?
+ jb AddPath ; no, go add path
+ lodsb
+ dec cx
+ cmp al,psep_char ; is there a path separator?
+ jz MovePath ; yes, go move remainder of path
+ inc cx
+ dec si ; undo the lodsb
+
+AddPath:
+ SaveReg <SI>
+ mov si,di ; remainder of buffer
+ trap Current_dir
+;
+; The previous current dir will succeed a previous find_first already worked.
+;
+; Find end of string.
+;
+ mov di,si
+ RestoreReg <SI>
+ mov al,psep_char
+ cmp byte ptr [di],0 ; root (empty dir string)?
+ jz MovePath ; yes, no need for path char
+
+ScanEnd:
+ cmp byte ptr [dI],0 ; end of string?
+ jz FoundEnd
+ inc di
+ jmp ScanEnd
+;
+; Stick in a trailing path char
+;
+FoundEnd:
+ stosb
+;
+; Move remaining part of path. Skip leading path char if present.
+;
+MovePath:
+ cmp [si],al ; first char a path char?
+ jnz CopyPath
+ inc si ; move past leading char
+ dec cx ; drop from count
+
+CopyPath:
+ jcxz CopyDone ; no chars to move!
+ rep movsb
+
+CopyDone:
+ jmp path_success ; run off and form complete pathname
+
+path_noinit:
+ test DS:arg.argv[0].argflags, MASK path_sep
+ jnz path_failure ; complete pathname specified ==> fail
+
+ mov BH, path_sep_char ; semicolon terminates pathstring
+ mov DX, DS:arg.argv[0].argstartel ; this is where the last element starts
+ sub DX, DS:arg.argv[0].argpointer ; form pointer into EXECPATH,
+ add DX, OFFSET TRANGROUP:EXECPATH ; skipping over drive spec, if any
+
+path_loop:
+ call path_crunch ; pcrunch(EXECPATH, pathinfo)
+ mov BP, AX ; save filetype code
+
+ lahf ; save flags, just in case
+ or BP, BP ; did path_crunch find anything?
+ jne path_found
+ sahf ; see? needed those flags, after all!
+ jnc path_loop ; is there anything left to the path?
+
+path_failure:
+ xor AX, AX
+;; jmp short path_exit ; 3/3/KK
+ jmp path_exit ;AC000; 3/3/KK
+
+path_found: ; pathinfo[] points to winner
+ mov DI, OFFSET TRANGROUP:EXECPATH
+ mov CX, pathinfo[4] ; "new" pointer -- end of string
+ mov SI, pathinfo[2] ; "old" pointer -- beginning of string
+
+;
+; BAS Nov 20/84
+; Look at the pathname and expand . and .. if they are the first element
+; in the pathname (after the drive letter)
+;
+ push ES
+ push pathinfo[0]
+ pop ES
+;SR;
+; Oops! Gets fooled if path= \;..
+; We should also check if a drive letter is really present
+;
+ cmp Byte Ptr ES:[SI+2],'.' ; Look for Current dir at start of path
+ jnz path_cpy
+
+ cmp byte ptr es:[si+1],':' ;does path have drive letter?
+ jnz path_cpy ;no, copy the path string
+
+ push CX ; Save pointer to end of string
+ mov AL, ES:[SI]
+ mov [DI],AL ; Copy drive letter, :, and root char
+ mov AL, ES:[SI+1] ; to EXECPATH
+ mov [DI+1],AL
+ mov AL,psep_char
+ mov [DI+2],AL
+ push SI ; Save pointer to begining of string
+ mov DL,ES:[SI] ; Convert device letter for cur dir
+ or DL,20h
+ sub DL,"a"-1
+ mov SI,DI ; pointer to EXECPATH
+ add SI, 3 ; Don't wipe out drive and root info
+ trap Current_dir
+ invoke DStrlen ; Determine length of present info
+ add SI,CX ; Don't copy over drive and root info
+ dec SI
+ mov DI,SI ; Point to end of target string
+ pop SI ; Restore pointer to begining of string
+ add SI, 3 ; Point past drive letter, :, .
+ pop CX ; Restore pointer to end of string
+
+path_cpy:
+ pop ES
+ sub CX, SI ; yields character count
+ push DS ; time to switch segments
+ push pathinfo[0] ; string lives in this segment
+ pop DS
+ cld
+;; rep movsb 3/3/KK ; copy the prefix path into EXECPATH
+
+Kloop: ;AN000; 3/3/KK
+ lodsb ;AN000; 3/3/KK
+ stosb ;AN000; 3/3/KK
+ invoke testkanj ;AN000; 3/3/KK
+ jz NotKanj1 ;AN000; 3/3/KK
+ dec cx ;AN000; 3/3/KK
+ JCXZ PopDone ;AN000; Ignore boundary error 3/3/KK
+ movsb ;AN000; 3/3/KK
+ dec cx ;AN000; 3/3/KK
+ cmp cx,1 ;AN000; One char (the terminator) left ? 3/3/KK
+ ja Kloop ;AN000; no. 3/3/KK
+
+PopDone: ;AN000; 3/3/KK
+ POP DS ;AN000; Yes ES:DI->terminator, last char is 3/3/KK
+ mov AL, psep_char ;AN000; KANJI 3/3/KK
+ jmp Short path_store ;AN000; 3/3/KK
+
+NotKanj1:
+ loop Kloop
+ pop DS ; return to our segment
+ dec DI ; overwrite terminator
+ mov AL, psep_char ; with a pathname separator
+ cmp al,byte ptr [di-1]
+ jz path_success
+
+path_store: ;AN000; 3/3/KK
+ stosb
+
+path_success:
+ mov SI, OFFSET TRANGROUP:search_best_buf
+ xor CX, CX
+
+path_succ_loop:
+ lodsb ; append winning filename to path
+ stosb ; (including terminating null)
+ or al,al
+ jnz path_succ_loop
+ mov AX, BP ; retrieve filetype code
+
+path_exit:
+ popf
+ pop BP
+ pop DI
+ pop SI ; chill out...
+ pop DX
+ pop CX
+ pop BX
+ ret
+EndProc Path_Search
+
+break <Store_Pchar>
+;----------------------------------------------------------------------------
+; STORE_PCHAR determines the pathname-element separator and squirrels
+; it away. In other words, must we say '/bin/ls' or '\bin\ls'?
+; ENTRY:
+; EXIT:
+; NOTE(S):
+; * Uses <psep_char>, defined in <path_search>.
+;---------------
+;---------------
+Procedure Store_PChar,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+
+ push AX
+ mov AL, '/' ; is the pathname-element separator
+ invoke pathchrcmp ; a regular slash?
+ jz store_slash ; if yes, remember slash
+ mov al,'\'
+ mov [psep_char], al ; otherwise, remember back-slash
+ pop ax
+ ret
+
+store_slash:
+ mov [psep_char], al
+ pop ax
+ return
+;---------------
+EndProc Store_Pchar
+;----------------------------------------------------------------------------
+
+break <Path_Crunch>
+;----------------------------------------------------------------------------
+; PATH_CRUNCH takes a prefix from a prefix string, and a suffix from
+; EXECPATH, and smooshes them into tpbuf. The caller may supply an
+; additional separator to use for breaking up the path-string. Null is the
+; default. Once the user-string has been formed, search is invoked to see
+; what's out there.
+; ENTRY:
+; BH -- additional terminator character
+; SI -- pointer into pathstring to be dissected
+; DX -- pointer to stripped filename
+; EXIT:
+; AX -- non-zero (file type), zero (nothing found)
+; SI -- moves along pathstring from call to call
+; [search_best_buf] -- name of best file (AX non-zero)
+; [tpbuf] -- clobbered
+; NOTE(S):
+; * Implicit in this code is the ability to specify when to search
+; the current directory (if at all) through the PATH defined by
+; the user, a la UNIX (e.g., PATH=;c:\bin;c:\etc searches the
+; current directory before the bin and etc directories of drive c).
+;---------------
+Procedure Path_Crunch,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+ push BX
+ push CX
+ push DX
+ push DI
+ push SI
+ pushf
+ call store_pchar ; figure out pathname separator
+ mov DI, OFFSET TRANGROUP:tpbuf ; destination of concatenated string
+ mov SI, pathinfo[4] ; "new" pointer to start with
+ mov pathinfo[2], SI ; becomes "old" pointer
+ push DS ; save old segment pointer
+ push pathinfo[0] ; replace with pointer to userpath's
+ pop DS ; segment
+ xor cl,cl ;AN000; clear flag for later use 3/3/KK
+
+path_cr_copy:
+ lodsb ; get a pathname byte
+ or al,al ; check for terminator(s)
+ jz path_seg ; null terminates segment & pathstring
+ cmp AL, BH
+ jz path_seg ; BH terminates a pathstring segment
+ invoke testkanj ;AN000; 3/3/KK
+ jz NotKanj2 ;AN000; 3/3/KK
+ stosb ;AN000; 3/3/KK
+ movsb ;AN000; 3/3/KK
+ MOV CL,1 ;AN000; CL=1 means latest stored char is DBCS 3/3/KK
+ jmp path_cr_copy ;AN000; 3/3/KK
+
+NotKanj2: ;AN000; 3/3/KK
+ xor cl,cl ;AN000; CL=0 means latest stored char is SBCS 3/3/KK
+ stosb ; save byte in concat buffer
+ jmp path_cr_copy ; loop until we see a terminator
+
+path_seg:
+ pop DS ; restore old data segment
+ mov pathinfo[4], SI ; save "new" pointer for next time
+ mov BL, AL ; remember if we saw null or not...
+ ;;; REMOVE NEXT 3 LINES FOR CURDIR SPEC
+ xor AX, AX ; in case nothing in pathstr...
+ cmp DI, OFFSET TRANGROUP:tpbuf ; was there really anything in pathstr?
+ je path_cr_leave ; if nothing was copied, pathstr empty
+
+path_cr_look: ; form complete pathname
+ mov al, psep_char ; add pathname separator for suffix
+ or cl,cl ;AN000; 3/3/KK
+ jnz path_cr_store ;AN000; this is a trailing byte of ECS code 3/3/KK
+ cmp al,byte ptr [di-1]
+ jz path_cr_l1
+
+path_cr_store: ;AN000; 3/3/KK
+ stosb
+
+path_cr_l1:
+ mov SI, DX
+
+path_cr_l2:
+ lodsb ; tack the stripped filename onto
+ stosb ; the end of the path, up to and
+ or AL, AL ; including the terminating null
+ jnz path_cr_l2
+ mov DX, OFFSET TRANGROUP:tpbuf ; and look for an appropriate file...
+ mov [search_error], OFFSET TRANGROUP:BADPMES_ptr
+ invoke search ; results are in AX & search_best_buf
+
+path_cr_leave:
+ or BL, BL ; did we finish off the pathstring?
+ jz path_cr_empty ; null in BL means all gone...
+ popf ; otherwise, plenty left
+ clc
+ jmp short path_cr_exit
+
+path_cr_empty:
+ popf
+ stc
+
+path_cr_exit:
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ ret
+;---------------
+EndProc Path_Crunch
+;----------------------------------------------------------------------------
+
+
+trancode ends
+END
+
diff --git a/private/mvdm/dos/v86/cmd/command/path2.asm b/private/mvdm/dos/v86/cmd/command/path2.asm
new file mode 100644
index 000000000..101d03257
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/path2.asm
@@ -0,0 +1,472 @@
+ page ,132
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)path2.asm 1.1 85/05/14
+; SCCSID = @(#)path2.asm 1.1 85/05/14
+.sall
+.xlist
+.xcref
+ include dossym.inc
+ include syscall.inc
+ include find.inc
+ include comsw.asm
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE
+ EXTRN FORFLAG:BYTE
+DATARES ENDS
+
+
+break <Path.Asm>
+;----------------------------------------------------------------------------
+; PATH.ASM contains the routines to perform pathname incovation. Path and
+; Parse share a temporary buffer and argv[] definitions. <Path_Search>,
+; given a pathname, attempts to find a corresponding executable or batch
+; file on disk. Directories specified in the user's search path will be
+; searched for a matching file, if a match is not found in the current
+; directory and if the pathname is actually only an MSDOS filename.
+; <Path_Search> assumes that the parsed command name can be found in
+; argv[0] -- in other words, <Parseline> should be executed prior to
+; <Path_Search>. Alternatively, the command name and appropriate
+; information could be placed in argv[0], or <Path_Search> could be
+; (easily) modified to make no assumptions about where its input is found.
+; Please find enclosed yet another important routine, <Save_Args>, which
+; places the entire arg/argv[]/argbuf structure on a piece of newly
+; allocated memory. This is handy for for-loop processing, and anything
+; else that wants to save the whole shebang and then process other command
+; lines.
+;
+; Alan L, OS/MSDOS August 15, 1983
+;
+; ENTRY:
+; <Path_Search>: argv[0].
+; <Save_Args>: bytes to allocate in addition to arg structure
+; EXIT:
+; <Path_Search>: success flag, best pathname match in EXECPATH.
+; <Save_Args>: success flag, segment address of new memory
+; NOTE(S):
+; * <Argv_calc> handily turns an array index into an absolute pointer.
+; The computation depends on the size of an argv[] element (arg_ele).
+; * <Parseline> calls <cparse> for chunks of the command line. <Cparse>
+; does not function as specified; see <Parseline> for more details.
+; * <Parseline> now knows about the flags the internals of COMMAND.COM
+; need to know about. This extra information is stored in a switch_flag
+; word with each command-line argument; the switches themselves will not
+; appear in the resulting arg structure.
+; * With the exception of CARRY, flags are generally preserved across calls.
+;---------------
+; CONSTANTS:
+;---------------
+ DEBUGx equ FALSE ; prints out debug info
+;---------------
+; DATA:
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte
+ EXTRN BADPMES_ptr:word
+ EXTRN curdrv:byte
+ EXTRN EXECPATH:byte
+ EXTRN ext_entered:byte ;AN005;
+ EXTRN fbuf:byte
+ EXTRN pathinfo:word
+ EXTRN psep_char:byte
+ EXTRN string_ptr_2:word
+ EXTRN tpbuf:byte
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+
+assume cs:trangroup, ds:trangroup, es:trangroup, ss:nothing
+
+break <Search>
+;----------------------------------------------------------------------------
+; SEARCH, when given a pathname, attempts to find a file with
+; one of the following extensions: .com, .exe, .bat (highest to
+; lowest priority). Where conflicts arise, the extension with
+; the highest priority is favored.
+; ENTRY:
+; DX -- pointer to null-terminated pathname
+; fbuf -- dma buffer for findfirst/next
+; EXIT:
+; AX -- 8) file found with .com extension
+; 4) file found with .exe extension
+; 2) file found with .bat extension
+; 0) no such file to be found
+; (if AX is non-zero:)
+; [search_best] identical to AX
+; [search_best_buf] null-terminated filename
+; NOTES:
+; 1) Requires caller to have allocated a dma buffer and executed a setdma.
+;---------------
+; CONSTANTS:
+;---------------
+search_file_not_found equ 0
+search_com equ 8
+search_exe equ 4
+search_bat equ 2
+fname_len equ 8
+fname_max_len equ 13
+dot equ '.'
+wildchar equ '?'
+
+;---------------
+; DATA:
+;---------------
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN search_best:byte
+ EXTRN search_best_buf:byte
+ EXTRN search_curdir_buf:byte
+ EXTRN search_error:word
+TRANSPACE ENDS
+
+;---------------
+Procedure Search,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+ push CX
+ push DX
+ push DI
+ push SI
+ pushf
+
+ push DX ; check drivespec (save pname ptr)
+ mov DI, DX ; working copy of pathname
+ mov SI, OFFSET TRANGROUP:search_curdir_buf
+ xor DX, DX ; zero means current drive
+ cmp BYTE PTR [DI+1],':' ; is there a drive spec?
+ jne search_dir_check
+ mov DL, [DI] ; get the drive byte
+ and DL, NOT 20H ; uppercase the sucker
+ sub DL, '@' ; and convert to drive number
+
+search_dir_check:
+ trap Current_Dir ; can we get the drive's current
+ pop DX ; directory? If we can't we'll
+ jc search_invalid_drive ; assume it's a bad drive...
+
+ mov CX, search_attr ; filetypes to search for
+ trap Find_First ; request first match, if any
+ jc search_no_file
+ mov search_best, search_file_not_found
+ mov [search_best_buf], ANULL ; nothing's been found, yet
+
+search_loop:
+ call search_ftype ; determine if .com, &c...
+ cmp AL, search_best ; better than what we've found so far?
+ jle search_next ; no, look for another
+ mov search_best, AL ; found something... save its code
+ mov SI, OFFSET TRANGROUP:fbuf.find_buf_pname
+ mov DI, OFFSET TRANGROUP:search_best_buf
+ mov CX, fname_max_len
+ cld
+ rep movsb ; save complete pathname representation
+ cmp AL, search_com ; have we found the best of all?
+ je search_done
+
+search_next: ; keep on looking
+ mov CX, search_attr
+ trap Find_Next ; next match
+ jnc search_loop
+
+search_done: ; it's all over with...
+ mov AL, search_best ; pick best to return with
+ cmp ext_entered,1 ;AN005; Did user request a specific ext?
+ jz search_exit ;AN005; no - exit
+ mov al,ext_entered ;AN005; yes - get the real file type back
+ mov search_best,al ;AN005; save the real file type
+ jmp short search_exit
+
+search_invalid_drive: ; Tell the user path/drive
+ mov DX, [search_error] ; appropriate error message
+ invoke std_printf ; and pretend no file found
+
+search_no_file: ; couldn't find a match
+ mov AX, search_file_not_found
+
+search_exit:
+ popf
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ ret
+;---------------
+EndProc Search
+;----------------------------------------------------------------------------
+
+
+break <Search_Ftype>
+;----------------------------------------------------------------------------
+; SEARCH_FTYPE determines the type of a file by examining its extension.
+; ENTRY:
+; fbuf -- dma buffer containing filename
+; EXIT:
+; AX -- file code, as given in search header
+; NOTE(S):
+; * Implicit assumption that NULL == search_file_not_found
+;---------------
+; DATA:
+;---------------
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ extrn comext:byte,exeext:byte,batext:byte
+trandata ends
+;---------------
+Procedure Search_Ftype,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+ push DI
+ push si
+ mov AX, ANULL ; find the end of the filename
+ mov DI, OFFSET TRANGROUP:fbuf.find_buf_pname
+ mov CX, fname_max_len
+ cld
+ repnz scasb ; search for the terminating null
+ jnz ftype_exit ; weird... no null byte at end
+ sub di,5 ; . + E + X + T + NULL
+;
+; Compare .COM
+;
+ mov si,offset trangroup:comext
+ mov ax,di
+ cmpsw
+ jnz ftype_exe
+ cmpsw
+ jnz ftype_exe
+ mov AX, search_com ; success!
+ jmp short ftype_exit
+;
+; Compare .EXE
+;
+
+ftype_exe: ; still looking... now for '.exe'
+ mov di,ax
+ mov si,offset trangroup:exeext
+ cmpsw
+ jnz ftype_bat
+ cmpsw
+ jnz ftype_bat
+ mov AX, search_exe ; success!
+ jmp short ftype_exit
+;
+; Compare .BAT
+;
+
+ftype_bat: ; still looking... now for '.bat'
+ mov di,ax
+ mov si,offset trangroup:batext
+ cmpsw
+ jnz ftype_fail
+ cmpsw
+ jnz ftype_fail
+ mov AX, search_bat ; success!
+ jmp short ftype_exit
+
+ftype_fail: ; file doesn't match what we need
+ mov ax,ANULL
+
+ftype_exit:
+ cmp ext_entered,1 ;AN005; was an extension entered?
+ jz ftype_done ;AN005; no - exit
+ cmp ax,ANULL ;AN005; was any match found
+ jz ftype_done ;AN005; no - exit
+ mov ext_entered,al ;AN005; save the match type found
+ mov AX, search_com ;AN005; send back best was found to stop search
+
+ftype_done: ;AN005;
+ pop SI
+ pop DI
+ ret
+
+;---------------
+EndProc Search_Ftype
+;----------------------------------------------------------------------------
+
+
+break <Strip>
+;----------------------------------------------------------------------------
+; STRIP copies the source string (argv[0]) into the destination buffer,
+; replacing any extension with wildcards.
+; ENTRY:
+; BX -- maximum length of destination buffer
+; DS:SI -- address of destination buffer
+; argv[0] -- command name to be stripped
+; EXIT:
+; CF -- set if failure, clear if successful
+; NOTE(S):
+;---------------
+Procedure Strip,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+ push AX
+ push BX
+ push CX
+ push DX
+ push DI
+ push SI
+ pushf
+
+ mov ext_entered,1 ;AN005; assume no extension on file name
+ mov DX, DS:arg.argv[0].argpointer ; save pointer to beginning of argstring
+ mov DI, DS:arg.argv[0].argstartel ; beginning of last pathname element
+ cmp BYTE PTR [DI], 0 ; *STARTEL == NULL means no command
+ jz strip_error
+ mov CX, DX ; compute where end of argstring lies
+ add CX, DS:arg.argv[0].arglen
+ sub CX, DI ; and then find length of last element
+ inc CX ; include null as well
+ mov AL, dot ; let's find the filetype extension
+ cld
+ repnz scasb ; wind up pointing to either null or dot
+ jcxz process_ext ;AN005; if no extension found, just continue
+ mov ext_entered,0 ;AN005; we found an extension
+ mov al,ANULL ;AN005; continue scanning until the
+ repnz scasb ;AN005; end of line is reached.
+
+process_ext: ;AN005;
+ mov CX, DI ; pointer to end of argstring yields
+ sub CX, DX ; number of bytes to be copied
+ sub BX, 4 ; can argstring fit into dest. buffer?
+ cmp CX, BX
+ jg strip_error ; if not, we must have a bad pathname
+ mov DI, SI ; destination buffer
+ mov SI, DX ; source is beginning of pathname
+ cld
+ rep movsb ; SI=arg,DI=buffer,CX=argend-argbeg
+ cmp ext_entered,1 ;AN005; if an extension was entered
+ jnz skip_wilds ;AN005; don't set up wildcard ext.
+
+ dec DI ; overwrite null or dot
+ stosb ; with a dot
+ mov AL, wildchar ; now add wildcards
+ stosb
+ stosb
+ stosb
+ mov AL, ANULL ; and a terminating null
+ stosb
+
+skip_wilds: ;AN005;
+ popf
+ clc ; chill out...
+ jmp short strip_exit
+
+strip_error:
+ popf
+ stc
+
+strip_exit:
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ pop AX
+ ret
+;---------------
+EndProc Strip
+;----------------------------------------------------------------------------
+
+
+break <Save_Args>
+;----------------------------------------------------------------------------
+; SAVE_ARGS attempts to preserve the existing argv[]/argvcnt/argbuffer
+; structure in newly allocated memory. The argv[] structure is found at the
+; beginning of this area. The caller indicates how much extra space is
+; needed in the resulting structure; Save_Args returns a segment number and
+; an offset into that area, indicating where the caller may preserve its own
+; data. Note that <argvcnt> can be found at <offset-2>.
+; ENTRY:
+; BX -- size (in bytes) of extra area to allocate
+; EXIT:
+; AX -- segment of new area.
+; CF -- set if unable to save a copy.
+; NOTE(S):
+; 1) The allocated area will be AT LEAST the size requested -- since
+; the underlying MSDOS call, <alloc> returns an integral number of
+; paragraphs.
+; 2) It is an error if MSDOS can't allocate AT LEAST as much memory
+; as the caller of Save_Args requests.
+; 3) AX is undefined if CF indicates an error.
+;---------------
+Procedure Save_Args,NEAR
+;---------------
+ assume ds:trangroup, es:trangroup
+ push BX
+ push CX
+ push DX
+ push DI
+ push SI
+ push BP
+ pushf
+ add BX, SIZE arg_unit + 0FH ; space for arg structure, round up
+ mov CL, 4 ; to paragraph size and convert
+ shr BX, CL ; size in bytes to size in paragraphs
+ trap Alloc
+ jc save_error
+ mov BP, AX ; save segment id
+ push ES ; save TRANGROUP address
+ mov ES, AX ; switch to new memory segment
+assume ES:nothing
+ mov CX, SIZE arg_unit ; get back structure size
+ xor DI, DI ; destination is new memory area
+ mov SI, OFFSET TRANGROUP:arg ; source is arg structure
+ rep movsb ; move that sucker!
+ mov CX, arg.argvcnt ; adjust argv pointers
+ xor AX, AX ; base address for argv_calc
+; Bugbug: What did they mean by this?
+; Note that the replacement line produces exactly the same code.
+;; mov SI, OFFSET TRANGROUP:arg.argbuf - OFFSET arg_unit.argbuf
+ mov SI, OFFSET TRANGROUP:arg
+
+save_ptr_loop:
+ dec CX ; exhausted all args?
+ jl save_done
+ mov BX, CX ; get arg index and
+ invoke argv_calc ; convert to a pointer
+ mov DX, DS:arg.argv[BX].argpointer
+ sub DX, SI ; adjust argpointer
+ mov ES:argv[BX].argpointer, DX
+ mov DX, DS:arg.argv[BX].argstartel
+ sub DX, SI ; and adjust argstartel
+ mov ES:argv[BX].argstartel, DX
+ mov DX, DS:arg.argv[BX].arg_ocomptr
+ sub DX, SI ; and adjust arg_ocomptr
+ mov ES:argv[BX].arg_ocomptr, DX
+ jmp save_ptr_loop
+
+save_done:
+ pop ES ; back we go to TRANGROUP
+assume ES:trangroup
+ mov AX, BP ; restore segment id
+ jmp short save_ok
+
+save_error:
+ popf
+ stc
+ jmp short save_exit
+
+save_ok:
+ popf
+ clc
+save_exit:
+ pop BP
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ ret
+;---------------
+EndProc Save_Args
+;----------------------------------------------------------------------------
+
+trancode ends
+END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/rdata.asm b/private/mvdm/dos/v86/cmd/command/rdata.asm
new file mode 100644
index 000000000..dabfa188b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/rdata.asm
@@ -0,0 +1,797 @@
+ page ,132
+ title COMMAND Resident DATA
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+; M003 SR 07/16/90 Added LoadHiFlg for LoadHigh support
+;
+; M004 SR 07/17/90 Transient is now moved to its final
+; location at EndInit time by allocating
+; the largest available block, moving
+; the transient to the top of the block
+; and then freeing up the block.
+;
+; M027 SR 9/20/90 Fixed bug #2827. EndInit was using
+; INIT seg variables after INIT seg
+; had been freed.
+;
+; M036 SR 11/1/90 Free up environment segment passed
+; by Exec always.
+;
+
+.xlist
+.xcref
+ include dossym.inc
+ include pdb.inc
+ include syscall.inc
+ include comsw.asm
+ include comseg.asm
+ include resmsg.equ
+ include comequ.asm
+ include cmdsvc.inc
+.list
+.cref
+
+; Equates for initialization (from COMEQU)
+;
+; Bugbug: Toss these after putting ctrl-c handler in init module.
+
+INITINIT equ 01h ; initialization in progress
+INITSPECIAL equ 02h ; in initialization time/date routine
+INITCTRLC equ 04h ; already in ^C handler
+
+
+CODERES segment public byte
+ extrn Ext_Exec:near
+ extrn MsgRetriever:far
+ extrn TRemCheck:near
+
+;SR;
+; The stack has no right to be in the code segment. Moved it to DATARES
+;
+; bugbug: Why this odd stack size? And what should stack size be?
+;; db (80h - 3) dup (?)
+;;RStack label word
+;; public RStack
+CODERES ends
+
+INIT segment
+
+ extrn ConProc:near
+ extrn Chuckenv:byte
+ extrn UsedEnv:word
+ extrn OldEnv:word
+ extrn EnvSiz:word
+ extrn TrnSize:word ; M004
+
+INIT ends
+
+TAIL segment
+
+ extrn TranStart :word
+
+TAIL ends
+
+TRANCODE segment public byte
+ extrn Command:near
+TRANCODE ends
+
+TRANSPACE segment
+
+ extrn TranSpaceEnd :byte
+
+TRANSPACE ends
+
+;SR;
+; All the routines below are entry points into the stub from the transient.
+;The stub will then transfer control to the appropriate routines in the
+;resident code segment, wherever it is present.
+;
+
+DATARES segment
+
+ extrn Exec_Trap :near
+ extrn RemCheck_Trap :near
+ extrn MsgRetrv_Trap :near
+ extrn HeadFix_Trap :near
+ extrn Issue_Exec_Call :near
+
+DATARES ends
+
+
+DATARES segment public byte
+ assume cs:DATARES
+ Org 0
+ZERO = $
+
+;; Org 100h
+;;ProgStart:
+;; jmp RESGROUP:ConProc
+
+ public Abort_Char
+ public Append_Flag
+ public Append_State
+ public BadFatSubst
+ public Batch
+ public Batch_Abort
+ public BlkDevErrRw
+ public BlkDevErrSubst
+ public Call_Batch_Flag
+ public Call_Flag
+ public CDevAt
+ public CharDevErrSubst
+ public CharDevErrRw
+ public Com_Fcb1
+ public Com_Fcb2
+ public Com_Ptr
+ public ComDrv
+ public ComSpec
+ public ComSpec_End
+ public Crit_Err_Info
+ public Crit_Msg_Off
+ public Crit_Msg_Seg
+ public CritMsgPtrs
+ public DataResEnd
+ public Dbcs_Vector_Addr
+ public DevName
+ public DrvLet
+ public EchoFlag
+ public EnvirSeg
+ public ErrCd_24
+ public ErrType
+ public Exec_block
+ public ExecErrSubst
+ public Extcom
+ public ExtMsgEnd
+ public Fail_Char
+ public fFail
+ public ForFlag
+ public ForPtr
+ public FUCase_Addr
+ public Handle01
+ public IfFlag
+ public Ignore_Char
+ public In_Batch
+ public InitFlag
+ public InPipePtr
+ public Int_2e_Ret
+ public Int2fHandler
+ public Io_Save
+ public Io_Stderr
+ public LenMsgOrPathBuf
+ public Loading
+ public LTpa
+ public MemSiz
+ public MsgBuffer
+ public MsgPtrLists
+ public MySeg
+ public MySeg1
+ public MySeg2
+ public MySeg3
+ public NeedVol
+ public NeedVolSubst
+ public Nest
+ public Next_Batch
+ public No_Char
+ public NullFlag
+ public NUMEXTMSGS
+ public NUMPARSMSGS
+ public OldErrNo
+ public OldTerm
+ public OutPipePtr
+ public Parent
+ public ParsMsgPtrs
+ public PermCom
+ public Pipe1
+;;; public Pipe1T
+ public Pipe2
+;;; public Pipe2T
+ public PipeFiles
+ public PipeFlag
+ public PipePtr
+ public PipeStr
+ public PutBackComSpec
+ public PutBackDrv
+ public PutBackSubst
+ public RDirChar
+ public Re_Out_App
+ public Re_OutStr
+ public ResMsgEnd
+ public Res_Tpa
+ public RestDir
+ public ResTest
+ public RetCode
+ public Retry_Char
+ public RSwitChar
+ public SafePathBuffer ; MSKK01 07/14/89
+ public Save_Pdb
+ public SingleCom
+ public Sum
+ public Suppress
+ public Trans
+ public TranVarEnd
+ public TranVars
+ public TrnSeg
+ public TrnMvFlg
+ public VerVal
+ public VolName
+ public VolSer
+ public Yes_Char
+
+ public ResSize
+ public RStack
+ public OldDS
+
+
+ public LoadHiFlg ;For LoadHigh support ; M003
+ public SCS_Is_First
+ public SCS_REENTERED
+ public SCS_FIRSTCOM
+
+ public SCS_PAUSE
+ public SCS_CMDPROMPT
+ public SCS_DOSONLY
+ public SCS_PROMPT16
+ public SCS_FIRSTTSR
+ public RES_RDRINFO
+ public RES_BATSTATUS
+
+ extrn LodCom_Trap:near
+ extrn Alloc_error:near
+
+
+;*** Message substitution blocks
+
+
+BlkDevErrSubst label byte
+BlkDevErrRw subst <STRING,> ; "reading" or "writing"
+ subst <CHAR,DATARES:DrvLet> ; block device drive letter
+
+DrvLet db 'A' ; drive letter
+
+
+CharDevErrSubst label byte
+CharDevErrRw subst <STRING,> ; "reading" or "writing"
+CharDevErrDev subst <STRING,DATARES:DevName> ; character device name
+
+DevName db 8 dup (?),0 ; device name, asciiz
+
+
+NeedVolSubst label byte
+ subst <STRING,DATARES:VolName> ; volume name
+ subst <HEX,DATARES:VolSer+2> ; hi word of serial #
+ subst <HEX,DATARES:VolSer> ; lo word of serial #
+
+; NOTE: VolName and VolSer must be adjacent
+VolName db 11 dup (?),0 ; volume name
+VolSer dd 0 ; volume serial #
+
+
+CDevAt db ?
+
+
+BadFatSubst label byte
+ subst <CHAR,DATARES:DrvLet> ; drive letter
+
+
+PutBackSubst label byte
+PutBackComSpec subst <STRING,> ; comspec string
+ subst <CHAR,DATARES:PutBackDrv> ; drive to put it in
+
+PutBackDrv db ' ' ; drive letter
+
+
+ExecErrSubst subst <STRING,DATARES:SafePathBuffer>
+
+
+NeedVol dd ? ; ptr to volume name from get ext err
+ErrType db ? ; critical error message style, 0=old, 1=new
+
+Int_2e_Ret dd ? ; magic command executer return address
+Save_Pdb dw ?
+Parent dw ?
+OldTerm dd ?
+ErrCd_24 dw ?
+Handle01 dw ?
+Loading db 0
+Batch dw 0 ; assume no batch mode initially
+
+;;;;SR;
+;;;; This flag has been added for a gross hack introduced in batch processing.
+;;;;We use it to indicate that this batch file has no CR-LF before EOF and that
+;;;;we need to fake the CR-LF for the line to be properly processed
+;;;;
+;;;BatchEOF db 0
+
+; Bugbug: ComSpec should be 64+3+12+1?
+; What's this comspec_end about?
+ComSpec db 64 dup (0)
+ComSpec_End dw ?
+
+Trans label dword
+ dw TRANGROUP:Command
+TrnSeg dw ?
+
+TrnMvFlg db 0 ; set if transient portion has been moved
+
+In_Batch db 0 ; set if we are in batch processing mode
+Batch_Abort db 0 ; set if user wants to abort from batch mode
+
+ComDrv db ? ; drive spec to load autoexec and command
+MemSiz dw ?
+Sum dw ?
+ExtCom db 1 ; for init, pretend just did an external
+RetCode dw ?
+Crit_Err_Info db ? ; hold critical error flags for r,i,f
+
+
+; The echo flag needs to be pushed and popped around pipes and batch files.
+; We implement this as a bit queue that is shr/shl for push and pop.
+
+EchoFlag db 00000001b ; low bit true => echo commands
+Suppress db 1 ; used for echo, 1=echo line
+Io_Save dw ?
+Io_Stderr db ?
+RestDir db 0
+PermCom db 0 ; true => permanent command
+SingleCom dw 0 ; true => single command version
+VerVal dw -1
+fFail db 0 ; true => fail all int 24s
+IfFlag db 0 ; true => IF statement in progress
+
+ForFlag db 0 ; true => FOR statement in progress
+ForPtr dw 0
+
+Nest dw 0 ; nested batch file counter
+Call_Flag db 0 ; no CALL (batch command) in progress
+Call_Batch_Flag db 0
+Next_Batch dw 0 ; address of next batch segment
+NullFlag db 0 ; flag if no command on command line
+FUCase_Addr db 5 dup (0) ; buffer for file ucase address
+; Bugbug: don't need crit_msg_ anymore?
+Crit_Msg_Off dw 0 ; saved critical error message offset
+Crit_Msg_Seg dw 0 ; saved critical error message segment
+Dbcs_Vector_Addr dw 0 ; DBCS vector offset
+ dw 0 ; DBCS vector segment
+
+Append_State dw 0 ; current state of append
+ ; (if Append_Flag is set)
+Append_Flag db 0 ; set if append state is valid
+
+SCS_PAUSE db 0 ; yst 4-5-93
+
+Re_Out_App db 0
+Re_OutStr db 64+3+13 dup (?)
+SCS_Is_First db 1
+SCS_REENTERED db 0
+SCS_FIRSTCOM db 0
+SCS_CMDPROMPT db 0 ; means on TSR/Shell out use command.com
+SCS_DOSONLY db 0 ; means by default run all binaries
+ ; when at command.com prompt. if 1 means
+ ; allow only dos binaries.
+SCS_PROMPT16 db 0
+SCS_FIRSTTSR db 1
+RES_RDRINFO DD 0
+RES_BATSTATUS db 0
+
+; We flag the state of COMMAND in order to correctly handle the ^Cs at
+; various times. Here is the breakdown:
+;
+; INITINIT We are in the init code.
+; INITSPECIAL We are in the date/time prompt
+; INITCTRLC We are handling a ^C already.
+;
+; If we get a ^C in the initialization but not in the date/time prompt, we
+; ignore the ^C. This is so the system calls work on nested commands.
+;
+; If we are in the date/time prompt at initialization, we stuff the user's
+; input buffer with a CR to pretend an empty response.
+;
+; If we are already handling a ^C, we set the carry bit and return to the user
+; (ourselves). We can then detect the carry set and properly retry the
+; operation.
+
+InitFlag db INITINIT
+
+; Note: these two bytes are referenced as a word
+PipeFlag db 0
+PipeFiles db 0
+
+;--- 2.x data for piping
+;
+; All the "_" are substituted later, the one before the : is substituted
+; by the current drive, and the others by the CreateTemp call with the
+; unique file name. Note that the first 0 is the first char of the pipe
+; name. -MU
+;
+;--- Order-dependent, do not change
+
+;;;Pipe1 db "_:/"
+;;;Pipe1T db 0
+;;; db "_______.___",0
+;;;Pipe2 db "_:/"
+;;;Pipe2T db 0
+;;; db "_______.___",0
+
+;SR
+; Pipe1 & Pipe2 now need to store full-fledged pathnames
+;
+
+; Bugbug: can we find any way around maintaining these
+; large buffers?
+
+Pipe1 db 67+12 dup (?)
+Pipe2 db 67+12 dup (?)
+
+PipePtr dw ?
+
+PipeStr db 129 dup (?)
+
+EndPipe label byte ; marks end of buffers; M004
+
+;SR;
+; We can move our EndInit code into above buffers. This way, the code will
+;automatically be discarded after init.
+;
+; M004; We overlap our code with the Pipe buffers located above by changing
+; M004; the origin.
+;
+ ORG Pipe1 ; M004
+
+; Bugbug: really need a procedure header for EndInit, describing
+; what it expects, what it does.
+
+Public EndInit
+EndInit:
+ push ds
+ push es ;save segments
+ push cs
+ pop ds
+ assume ds:RESGROUP
+
+;
+; M004; Save size of transient here before INIT segment is deallocated
+;
+ mov dx,TrnSize ; M004
+;M027
+; These variables are also defined in the INIT segment and need to be saved
+;before we resize
+;
+ mov ax,OldEnv ; Old Environment seg ;M027
+ mov bx,EnvSiz ; Size of new environment ;M027
+ mov cx,UsedEnv ; Size of old environment ;M027
+ push ax ; Save all these values ;M027
+ push bx ; M027
+ push cx ; M027
+
+
+; Bugbug: push ds, pop es here.
+ mov bx,ds
+ mov es,bx ;es = RESGROUP
+;
+;ResSize is the actual size to be retained -- only data for HIMEM COMMAND,
+; code + data for low COMMAND
+;
+ mov bx,ResSize ;Total size of resident
+ mov ah,SETBLOCK
+ int 21h ;Set block to resident size
+;
+;We check if this is for autoexec.bat (PermCom = 1). If so, we then
+;allocate a new batch segment, copy the old one into new batchseg and free
+;the old batchseg. Remember that the old batchseg was allocated on top of the
+;transient and we will leave a big hole if TSRs are loaded by autoexec.bat
+;
+; Bugbug: also describe why we alloc & copy batch seg BEFORE environment.
+ cmp PermCom,1 ;permanent command.com?
+ jne adjust_env ;no, do not free batchseg
+
+ cmp Batch,0 ;was there a valid batchseg?
+ je adjust_env ;no, dont juggle
+
+; NTVDM temp name of the batch file may be up to 63 bytes, plus NULL
+; mov bx,((SIZE BatchSegment) + 15 + 1 + 0fh)/16 ;batchseg size
+ mov bx,((SIZE BatchSegment) + 64 + 1 + 0fh)/16 ;batchseg size
+ mov ah,ALLOC
+ int 21h
+; Bugbug: I just had a thought. If DOS or SHARE or somebody leaves
+; a hole, the batch segment COULD already be in the ideal place. We
+; could be making it worse! We're second-guessing where memory
+; allocations go, which might not be such a great idea. Is there
+; a strategy, short of doing something even worse like diddling
+; arena headers, where we can minimize the possibility of fragmentation
+; under all cases? Hmm..
+ jc adjust_env ;no memory, use old batchseg
+ mov es,ax ;es = New batch segment
+ xor di,di
+ xor si,si
+
+ push ds
+ mov ds,Batch ;ds = Old Batch Segment
+ assume ds:nothing
+ mov cx,SIZE BatchSegment
+; NTVDM temp name of the batch file may be up to 63 bytes, plus NULL
+; add cx,16 ;for the filename
+ add cx,64
+ ; Bugbug: 16? Shouldn't this be a common equate or something?
+ ; It's sure be bad if we copied more bytes than the batch segment
+ ; holds!
+ cld
+ rep movsb
+ pop ds
+ assume ds:RESGROUP
+
+ mov cx,es ;save new batch segment
+ mov es,Batch
+ mov ah,DEALLOC
+ int 21h ;free the old batch segment
+ ; Bugbug: should we check for error?
+
+ mov Batch,cx ;store new batch segment address
+
+adjust_env:
+ pop cx ;cx = size of old env ;M027
+ pop bx ;bx = size of new env needed ;M027
+ pop bp ;bp = old env seg ;M027
+;
+;Allocate the correct size for the environment
+;
+ mov ah,ALLOC
+ int 21h ;get memory
+ jc init_env_err ;out of memory,signal error
+
+ ; Bugbug: why not continue, leaving environment where it is?
+
+ mov EnvirSeg,ax ;Store new environment segment
+ mov ds:PDB_Environ,ax ;Put new env seg in PSP
+ mov es,ax ;es = address of allocated memory
+ assume es:nothing
+
+ cmp PermCom, 1
+ jne copy_old_env
+ CMDSVC SVC_GETINITENVIRONMENT
+ cmp bx, 0 ;bx returns 0, use old environment
+ je copy_old_env
+ cmp bx, EnvSiz ;bx > EnvSiz, need more room
+ jbe adjust_env_done
+ mov ah, DEALLOC ;free the block
+ int 21h
+ mov ah, ALLOC ;and get a new block(don't use realloc please)
+ int 21h
+ jc nomem_err
+
+ mov EnvirSeg,ax ;Store new environment segment
+ mov ds:PDB_Environ,ax ;Put new env seg in PSP
+ mov es,ax ;es = address of allocated memory
+ mov EnvSiz, bx ;new size
+ CMDSVC SVC_GETINITENVIRONMENT ;get new environment
+ cmp bx, EnvSiz
+ jz adjust_env_done
+init_env_err:
+ jmp short nomem_err
+copy_old_env:
+;
+;Copy the environment to the newly allocated segment
+;
+ push ds
+ mov ds,bp ;ds = Old environment segment
+ assume ds:nothing
+
+ xor si,si
+ mov di,si ;Start transfer from 0
+
+ cld
+ rep movsb ;Do the copy
+
+ pop ds ;ds = RESGROUP
+ assume ds:RESGROUP
+adjust_env_done:
+;
+;We have to free the old environment block if it was allocated by INIT
+;
+; Bugbug: is this only for the case when we were NOT passed an environment,
+; or does it also apply to passed environments?
+;M036
+; Free up old env segment always because this is a copy passed by Exec and
+;takes up memory that is never used
+;
+;M044
+;Go back to the old strategy of not freeing the environment. Freeing it leaves
+;a hole behind that Ventura does not like. Basically, Ventura gives strange
+;errors if it gets a memory alloc that it is below its load segment. The
+;freed environment creates a large enough hole for some of its allocs to fit
+;in
+;
+ cmp Chuckenv,0 ;has env been allocated by INIT?
+ jne no_free ;no, do not free it
+
+ mov es,bp
+ mov ah,DEALLOC
+ int 21h ;Free it
+no_free:
+
+;
+; M004; Start of changes
+;
+
+;
+; Move the transient now. We will allocate the biggest block available
+; now and move the transient to the top of the block. We will then
+; deallocate this block. When the resident starts executing, it will
+; hopefully allocate this block again and find the transient intact.
+;
+ MOV TrnMvFlg, 1 ; Indicate that transient has been moved
+ push es
+ mov si,offset ResGroup:TranStart
+ mov di,0
+ mov cx,offset TranGroup:TranSpaceEnd ;size to move
+;
+; Find the largest block available
+;
+ mov bx,0ffffh
+ mov ah,ALLOC
+ int 21h
+
+;
+; dx = size of transient saved previously
+;
+ cmp bx,dx ;enough memory?
+ jb nomem_err ;not enough memory for transient
+
+ mov ah,ALLOC
+ int 21h ;get the largest block
+ jc nomem_err ;something is really screwed up
+
+ push ax ;save memory address
+ add ax,bx ;ax = top of my memory block
+ sub ax,dx ;less size of transient
+ mov TrnSeg,ax ;save transient segment
+ mov es,ax ;
+ pop ax ;restore our seg addr
+
+;
+; Everything is set for a move. We need to move in the reverse direction to
+; make sure we dont overwrite ourselves while copying
+;
+ add si,cx
+ dec si
+ add di,cx
+ dec di
+ std
+ rep movsb
+ cld
+;
+; Now we have to free up this block so that resident can get hold of it
+;
+ mov es,ax
+ mov ah,DEALLOC
+ int 21h ;release the memory block
+
+;
+; M004; End of changes
+;
+
+ mov InitFlag,FALSE ;indicate INIT is done
+
+ pop es
+ pop ds
+ ; Bugbug: did we need to save & restore seg reg's during EndInit?
+ assume ds:nothing
+
+ jmp LodCom_Trap ;allocate transient
+
+nomem_err:
+;
+;We call the error routine which will never return. It will either exit
+;with an error ( if not the first COMMAND ) or just hang after an error
+;message ( if first COMMAND )
+;
+
+ jmp Alloc_error
+
+public EndCodeInit ; M004
+EndCodeInit label byte ; M004
+
+;
+; M004; Check if the EndInit code will fit into the Pipe buffers above.
+; M004; If not, we signal an assembly error
+;
+IF2
+ IF ($ GT EndPipe)
+ .err
+ %out "ENDINIT CODE TOO BIG"
+ ENDIF
+ENDIF
+;
+; M004; Set the origin back to what it was at the end of the buffers
+;
+ ORG EndPipe ; M004
+
+
+
+InPipePtr dw offset DATARES:Pipe1
+OutPipePtr dw offset DATARES:Pipe2
+
+Exec_Block label byte ; the data block for exec calls
+EnvirSeg dw ?
+Com_Ptr label dword
+ dw 80h ; point at unformatted parameters
+ dw ?
+Com_Fcb1 label dword
+ dw 5Ch
+ dw ?
+Com_Fcb2 label dword
+ dw 6Ch
+ dw ?
+
+; variables passed to transient
+TranVars label byte
+ dw offset DATARES:HeadFix_Trap
+MySeg dw 0 ; put our own segment here
+LTpa dw 0 ; will store tpa segment here
+RSwitChar db "/"
+RDirChar db "\"
+ dw offset DATARES:Issue_Exec_Call
+MySeg1 dw ?
+ dw offset DATARES:RemCheck_Trap
+MySeg2 dw 0
+ResTest dw 0
+Res_Tpa dw 0 ; original tpa (not rounded to 64k)
+TranVarEnd label byte
+
+OldErrNo dw ?
+
+
+;* NOTE: MsgBuffer and SafePathBuffer use the same
+; memory. MsgBuffer is only used while a command
+; is being executed. SafePathBuffer is no longer
+; needed, since it is used for unsuccessful program
+; launches.
+
+MsgBuffer label byte ; buffer for messages from disk
+SafePathBuffer label byte ; resident pathname for EXEC
+; db 128 dup (0) ; path + 'd:\' 'file.ext' + null
+ db EXECPATHLEN dup (0) ; MAX_PATH+13 ntvdm extended
+LenMsgOrPathBuf equ $ - MsgBuffer
+
+
+Int2fHandler dd ? ; address of next int 2f handler
+ResMsgEnd dw 0 ; holds offset of msg end (end of resident)
+
+;SR;
+; The three vars below have been added for a pure COMMAND.COM
+;
+
+ResSize dw ?
+
+;SR;
+; Moved the stack here from the code segment
+;
+; bugbug: Why this odd stack size? And what should stack size be?
+ db (80h - 3) dup (?)
+RStack label word
+
+OldDS dw ? ;keeps old ds value when jumping to
+ ;resident code segments
+
+LoadHiFlg db 0 ;Flag set to 1 if UMB loading enabled ; M003
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+public Beta3Warned
+Beta3Warned db 0
+endif
+
+;*** MESSAGES
+; and other translatable text
+
+ include comrmsg.inc ;M00
+
+DATARES ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/readme.txt b/private/mvdm/dos/v86/cmd/command/readme.txt
new file mode 100644
index 000000000..5668041ad
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/readme.txt
@@ -0,0 +1,116 @@
+This directory contains source files for COMMAND.COM, including
+internal commands.
+
+A list of the internal commands, some characteristics, and hints
+about where they're found appears in TDATA.ASM, labelled COMTAB.
+
+COMSEG.ASM contains a brief description of each segment in
+COMMAND.COM.
+
+ TRANDATA contains data which doesn't usually change, so is
+ included in the transient checksum area, while TRANSPACE is
+ modifiable, and excluded from the transient checksum. TRANSPACE
+ variable should be treated as uninitialized data for every
+ command cycle.
+
+----------------------------------------------------------------------
+
+Here's a listing of the general contents of files,
+concentrating on central functions and publics in each module.
+
+Sizes are approximate and probably obsolete by the time you
+read this.
+
+
+Name Size Contents
+ (000's)
+
+COMEQU ASM 10 Command.com equates, structures, macros.
+COMMAND1 ASM 19 Main header & some resident code:
+ command.com entry point; exec call; ctrl/c handler.
+COMMAND2 ASM 14 Resident code: alloc mem, load, & checksum transient;
+ int 2E (single command line execute) entry point;
+ check for removable media (callable by transient);
+ save user's stdin/out & set to stderr; restore stdin/out;
+ clean up program header, closing files;
+ set terminate, ctrl/c, disk error 'interrupt' vectors;
+ move environment to new segment at end of init.
+COMSEG ASM 1 All segments, in load order.
+COMSW ASM Build switches: refers to version.inc.
+COPY ASM 28 COPY command.
+COPYPR1 ASM 6 Routines for COPY command.
+COPYPR2 ASM 10 Routines for COPY command.
+CPARSE ASM 9 Command-line parse routine.
+DIR ASM 73 DIR command.
+ENVDATA ASM Default environment data definitions.
+FORDATA ASM A data definition for FOR loop routine (tfor.asm).
+IFEQU ASM 'Equates which are switch-dependent' (none here).
+INIT ASM 47 Command.com initialization routine.
+IPARSE ASM SYSPARSE equates (this file is probably obsolete).
+PARSE2 ASM 13 Command-line parse routines, argv style.
+PATH1 ASM 16 Pathname invocation (find an executable or batch file).
+PATH2 ASM 13 See PATH1.
+RDATA ASM 17 Resident data definitions.
+RUCODE ASM 19 Language-dependent resident code:
+ ctrl/c batch termination dialog;
+ int 24 disk error handler;
+ DBCS lead byte check ITESTKANJ;
+ reset parse & critical error message ptrs before exiting;
+ RPRINT message printer.
+TBATCH ASM 26 Batch processing routines.
+TBATCH2 ASM 15 Batch processing routines.
+TCMD1A ASM 17 Obsolete DIR command. Module no longer used.
+TCMD1B ASM 20 PAUSE, DEL, RENAME, TYPE, VOL commands.
+ Find & print volume label & serial #.
+ Get/set a file's code page;
+ Set extended error message pointer;
+ Get extended error number.
+TCMD2A ASM 12 VER, CLS command.
+ Support routines for transient:
+ build directory strings; print things.
+TCMD2B ASM 18 CTTY, CHCP, TRUENAME commands.
+ Parse routines to set up error messages.
+TCODE ASM 13 Main entry points to transient.
+TDATA ASM 21 Transient data: internal command table;
+ parse control blocks; miscellaneous.
+TENV ASM 13 PROMPT, SET commands. Environment utilities.
+ Restore user directory.
+TENV2 ASM 14 CHDIR, MKDIR, RMDIR commands. Path crunch.
+ Save user directory.
+TFOR ASM 15 FOR loop processing.
+TMISC1 ASM 15 Old switch parser; find & execute commands;
+ prescan command-line, removing pipes & redirects;
+ Error recycle point for command.com.
+TMISC2 ASM 10 Examine pathname, set up pathname argument.
+ Move string to srcbuf.
+ Set up error message for extended error.
+ Some redirection stuff (IOSET).
+TPARSE ASM 1 Transient interface to system parser SYSPARSE.
+TPIPE ASM 17 Pipe stuff. DATE, TIME commands.
+ Check for single command execute.
+ Set flag (in resident) to restore default directory.
+TPRINTF ASM 11 Set up and print messages, with substitutions.
+TRANMSG ASM 20 Transient messages and substitution blocks.
+TSPC ASM 11 Transient 'uninitialized' data.
+TUCODE ASM 14 Transient 'modifiable' code:
+ verification prompts for DEL;
+ ECHO, BREAK, VERIFY commands;
+ print date;
+UINIT ASM 7 Data definitions/messages for initialization.
+ Includes parse control block for COMMAND command.
+COMMAND CL1 2 Messages, class 1. Automatically generated.
+COMMAND CL2 1 Messages, class 2. Automatically generated.
+COMMAND CL3 1 Messages, class 3. Automatically generated.
+COMMAND CL4 1 Messages, class 4. Automatically generated.
+COMMAND CLA 8 Messages, class A. Automatically generated.
+COMMAND CLB 2 Messages, class B. Automatically generated.
+COMMAND CLC 3 Messages, class C. Automatically generated.
+COMMAND CLD 5 Messages, class D. Automatically generated.
+COMMAND CLE 7 Messages, class E. Automatically generated.
+COMMAND CLF 18 Messages, class F. Automatically generated.
+COMMAND CTL Number of message classes. Automatically generated.
+RESMSG EQU 2 Message number equates for resident and init code.
+COMMAND LNK LINK input file.
+COMMAND SKL 10 Message skeleton file.
+README TXT This file.
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/resmsg.equ b/private/mvdm/dos/v86/cmd/command/resmsg.equ
new file mode 100644
index 000000000..f401fedf1
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/resmsg.equ
@@ -0,0 +1,31 @@
+;*** Message substitution block for resident messages
+
+Subst struc
+SubstType db ? ; value type (char, string, hex - see below)
+SubstPtr dw ? ; offset in RESGROUP of value
+Subst ends
+
+ENDOFSUBST equ 0 ; could be used after last subst of a set
+CHAR equ 1 ; a single character
+STRING equ 2 ; an ASCIIZ string
+HEX equ 3 ; a word value to be displayed in hex
+
+; Note: RPrint is hard-coded for these values of
+; CHAR, STRING, and HEXDWORD.
+
+
+
+;*** Message text macro, equates
+
+msg macro name,text
+ local EndText
+name db EndText-$-1 ;; message length byte
+ db text
+ public name
+EndText label byte
+ endm
+
+
+CR equ 13
+LF equ 10
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/rucode.asm b/private/mvdm/dos/v86/cmd/command/rucode.asm
new file mode 100644
index 000000000..772285b48
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/rucode.asm
@@ -0,0 +1,1230 @@
+ page ,132
+ title Localizable code for resident COMMAND
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+; M003 SR 07/16/90 Added routines Lh_Off, Lh_Unlink &
+; Lh_OffUnlink for UMB support
+;
+; M009 SR 08/01/90 Rewrote Lh_OffUnlink to restore the
+; initial UMB state. Removed Lh_off
+; and Lh_Unlink.
+;
+
+.xlist
+.xcref
+ include dossym.inc
+ include syscall.inc
+ include filemode.inc
+ include pdb.inc
+ include mult.inc
+ include doscntry.inc
+ include devsym.inc
+ include comsw.asm
+ include comseg.asm
+ include comequ.asm
+ include resmsg.equ
+ include arena.inc ; M003
+.list
+.cref
+
+
+DATARES segment public byte
+ extrn Abort_Char:byte
+ extrn BadFatMsg:byte
+ extrn BadFatSubst:byte
+ extrn Batch_Abort:byte
+ extrn BlkDevErr:byte
+ extrn BlkDevErrRw:byte
+ extrn BlkDevErrSubst:byte
+ extrn CDevAt:byte
+ extrn CharDevErr:byte
+ extrn CharDevErrRw:byte
+ extrn CharDevErrSubst:byte
+ extrn ComSpec:byte
+ extrn Crit_Err_Info:byte
+ extrn Crit_Msg_Off:word
+ extrn Crit_Msg_Seg:word
+ extrn CritMsgPtrs:word
+ extrn Dbcs_Vector_Addr:dword
+ extrn DevName:byte
+ extrn DrvLet:byte
+ extrn EndBatMes:byte
+ extrn ErrCd_24:word
+ extrn ErrType:byte
+ extrn Fail_Char:byte
+ extrn fFail:byte
+ extrn ForFlag:byte
+ extrn Ignore_Char:byte
+ extrn InitFlag:byte
+ extrn In_Batch:byte
+ extrn Int2fHandler:dword
+ extrn Loading:byte
+ extrn MsgBuffer:byte
+ extrn MsgPtrLists:dword
+ extrn MRead:byte
+ extrn MWrite:byte
+ extrn NeedVol:dword
+ extrn NeedVolMsg:byte
+ extrn NeedVolSubst:byte
+ extrn Newlin:byte
+ extrn No_Char:byte
+ extrn NUMEXTMSGS:abs
+ extrn NUMPARSMSGS:abs
+ extrn OldErrNo:word
+ extrn Parent:word
+ extrn ParsMsgPtrs:word
+ extrn Patricide:byte
+ extrn PermCom:byte
+ extrn Retry_Char:byte
+ extrn Req_Abort:byte
+ extrn Req_End:byte
+ extrn Req_Fail:byte
+ extrn Req_Ignore:byte
+ extrn Req_Retry:byte
+ extrn ResMsgEnd:word
+ extrn PipeFlag:byte
+ extrn SingleCom:word
+ extrn VolName:byte
+ extrn Yes_Char:byte
+
+ extrn OldDS:word
+ extrn Int2f_Entry:dword
+
+DATARES ends
+
+; NTVDM use diff al value so we don't confuse dos 5.0
+; NTVDM command.com GET_COMMAND_STATE equ 5500h
+GET_COMMAND_STATE equ 5501h
+
+
+
+CODERES segment public byte
+
+ extrn GetComDsk2:near
+
+ public AskEnd
+ public Crlf
+ public DskErr
+ public MsgInt2fHandler
+ public MsgRetriever
+ public RPrint
+
+ ifdef DBCS
+ public ITestKanj
+ endif
+
+; Bugbug: Move rest of PUBLIC declarations up here.
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+
+
+;*** AskEnd - ask user to confirm batch file termination
+;
+; Confirm with user before freeing batch ...
+;
+; ENTRY nothing
+;
+; EXIT CY = set if batch termination is confirmed
+;
+; CY = clear if batch should continue
+;
+; USED AX,DX,...
+
+; Bugbug: move this to transient, copy to batch segment.
+; Bugbug: or move it to command1 1st.
+
+; Bugbug: No_Char and Yes_Char should be constants.
+
+AskEnd proc
+
+ assume ds:DATARES
+
+ mov dx,offset DATARES:EndBatMes ; DX = message #
+ call RPrint
+ mov ax,(STD_CON_INPUT_FLUSH shl 8) + STD_CON_INPUT
+ int 21h
+ call CharToUpper ; change to upper case
+ cmp al,No_Char
+ je aeRet ; answer is no (CY is clear)
+ cmp al,Yes_Char
+ jne AskEnd ; invalid response, try again
+ stc ; answer is yes
+aeRet: ret
+
+AskEnd endp
+
+
+
+
+;*** DskErr - critical error handler
+;
+; Default critical error handler unless user intercepts int 24h.
+;
+; ENTRY int 24h
+;
+; EXIT
+;
+; USED
+;
+; EFFECTS
+
+;
+;SR;
+; The stub is going to push the old ds value and the resident data segment
+;onto the stack in that order. Get it off the stack
+;
+
+DskErr proc far
+
+ assume ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+ pop OldDS ;save old ds value
+
+ sti
+ push es
+ push si
+ push cx
+ push di
+ push cx
+ push ax
+
+ push ds ;save our data segment
+ pop es ;es = DATARES
+
+ mov ds,bp
+ assume ds:nothing
+
+ mov ax,[si].SDEVATT
+ mov es:CDevAt,ah
+
+;; push cs
+;; pop es
+
+ mov di,offset DATARES:DevName
+ mov cx,8
+ add si,SDEVNAME ; save device name (even for block device)
+
+ cld
+ rep movsb
+ pop ax
+ pop cx
+ pop di
+
+; Stack still contains DS and ES.
+
+;SR;
+; We need ds = DATARES for SavHand
+;
+ push es
+ pop ds
+ assume ds:DATARES
+
+ invoke SavHand ; save user's stdin/out, set to our stderr
+
+;; push cs
+;; pop ds ; set up local data segment
+;; assume ds:resgroup
+
+ push dx
+ call Crlf
+ pop dx
+
+; Bugbug: rename Crit_Err_Info to CritErrAH?
+
+ mov Crit_Err_Info,ah ; save critical error flags
+
+; Compute and save ASCII drive letter (nonsense for char devices)
+
+ add al,'A'
+ mov DrvLet,al
+
+; Bugbug: These labels are awful. Change, especially 'NoHardE'.
+
+ test ah,80h
+ jz NoHardE ; it's a disk-device error
+ test CDevAt,DEVTYP shr 8
+ jnz NoHardE ; it's a character device
+ jmp FatErr ; it's a FAT error
+
+NoHardE:
+ mov si,offset DATARES:MRead ; SI = "read" msg #
+ test ah,1
+ jz SavMes ; it's a read error
+ mov si,offset DATARES:MWrite ; SI = "write" msg #
+
+SavMes:
+ mov OldErrNo,di ; save critical error code
+
+; Bugbug: don't need to save/restore all here?
+ push es
+ push ds ; GetExtendedError likes to STOMP
+ push bp
+ push si
+ push dx
+ push cx
+ push bx
+ mov ah,GetExtendedError ; get extended error info
+ int 21h
+ pop bx
+ pop cx
+ pop dx
+ pop si
+ pop bp
+ pop ds
+ mov word ptr NeedVol,di ; save possible ptr to volume label
+ mov word ptr NeedVol+2,es
+ pop es
+
+; Bugbug: AX has extended error code, so no need to zero AH?
+
+ xor ah,ah
+ mov di,ax ; DI = error code
+
+; Bugbug: somewhat obsolete documentation?
+;
+; DI is now the correct error code. Classify things to see what we are
+; allowed to report. We convert DI into a 0-based index into a message table.
+; This presumes that the int 24 errors (oldstyle) and new errors (sharing and
+; the like) are contiguous.
+;
+
+; Bugbug: simplify following code by cmp'ing instead of sub'ing.
+; Check use of ErrCd_24, though.
+
+ sub di,ERROR_WRITE_PROTECT
+ jae HavCod
+
+; Bugbug wouldn't it be better to display the original error msg,
+; even though it's not a critical error?
+
+ mov di,ERROR_GEN_FAILURE - ERROR_WRITE_PROTECT
+;
+; DI now has the mapped error code. Old style errors are:
+; FOOBAR <read|writ>ing drive ZZ.
+; New style errors are:
+; FOOBAR
+; We need to figure out which the particular error belongs to.
+;
+
+HavCod:
+ mov ErrType,0 ; assume old style
+ cmp di,ERROR_FCB_UNAVAILABLE - ERROR_WRITE_PROTECT
+ je SetStyle
+ cmp di,ERROR_SHARING_BUFFER_EXCEEDED - ERROR_WRITE_PROTECT
+ jne GotStyle
+
+SetStyle:
+; Bugbug: use INC
+ mov ErrType,1 ; must be new type
+
+GotStyle:
+ mov [ErrCd_24],di
+ cmp di,ERROR_HANDLE_DISK_FULL - ERROR_WRITE_PROTECT
+ ; If the error message is unknown
+ jbe NormalError ; redirector, continue. Otherwise,
+;
+; We do not know how to handle this error. Ask IFSFUNC if she knows
+; how to handle things
+;
+
+;input to IFSFUNC: AL=1
+; BX=extended error number
+;
+;output from IFSFUNC: AL=error type (0 or 1)
+; 0=<message> error (read/writ)ing (drive/device) xxx
+; Abort, Retry, Ignore
+; 1=<message>
+; Abort, Retry, Ignore
+; ES:DI=pointer to message text
+; carry set=>no message
+
+ mov di,ax ; retrieve correct extended error...
+ mov ax,0500h ; is the redir there?
+ int 2fh
+ cmp al,0ffh
+ jne NoHandler ; no, go to NoHandler
+ push bx
+ mov bx,di ; get ErrType and ptr to error msg
+ mov ax,0501h
+ int 2fh
+ pop bx
+ jc NoHandler
+
+; Bugbug: need to record error type?
+ mov ErrType,al
+ push ds
+ push es
+ pop ds
+ mov dx,di
+ mov cx,-1 ; find end of msg
+ xor al,al
+
+ cld
+ repnz scasb
+
+; Bugbug: we can do better than this.
+
+ mov byte ptr [di-1],'$'
+ mov ah,STD_CON_STRING_OUTPUT ; print the message
+ int 21h
+ mov byte ptr [di-1],0 ; restore terminal byte
+
+ pop ds ; clean up and continue
+ jmp short CheckErrType
+
+;* Redir isn't available or doesn't recognize the error.
+; Restore regs to unextended error.
+
+NoHandler:
+ mov ErrType,0
+; Bugbug: won't this break, since we add error_write_protect back in?
+ mov di,OldErrNo
+ mov ErrCd_24,di
+
+NormalError:
+ add di,ERROR_WRITE_PROTECT
+ xchg di,dx ; may need dx later
+ call RPrintCrit ; print error type
+
+CheckErrType:
+ cmp ErrType,0 ; Check error style...
+ je ContOld
+ call CrLf ; if new style then done printing
+ jmp short Ask
+
+ContOld:
+ inc si ; DS:SI = ptr to asciiz string
+
+; Bugbug: combine some of the following two sections?
+
+ test [CDevAt],DEVTYP shr 8
+ jz BlkErr
+ mov dx,offset DATARES:CharDevErr ; DX = ptr to device message
+ mov CharDevErrRw.SubstPtr,si ; point to read/write string
+ mov si,offset DATARES:CharDevErrSubst; SI = ptr to subst block
+
+ call RPrint ; print the message
+ jmp short Ask ; don't ralph on command
+
+BlkErr:
+ mov dx,offset DATARES:BlkDevErr ; DX = error msg #
+ mov BlkDevErrRw.SubstPtr,si ; "reading","writing" ptr
+ mov si,offset DATARES:BlkDevErrSubst ; SI = ptr to subst block
+ call RPrint
+
+ cmp Loading,0
+ jz Ask
+ invoke RestHand
+ jmp GetComDsk2 ; if error loading COMMAND, re-prompt
+
+Ask:
+ cmp [ErrCd_24],15 ; error 15 has an extra message
+ jne Not15 ; not error 15
+
+;* For error 15, tell the user which volume/serial # are needed.
+
+ push cx
+
+; Bugbug: does this push/pop need to be done?
+ push ds
+ pop es
+ lds si,NeedVol
+ assume ds:NOTHING
+ push di
+ mov di,offset DATARES:VolName
+ mov cx,16 ; copy volume name & serial #
+ cld
+ rep movsb
+ pop di
+ push es
+ pop ds
+ pop cx
+ assume ds:DATARES
+ mov dx,offset DATARES:NeedVolMsg ; DX = ptr to msg
+ mov si,offset DATARES:NeedVolSubst ; DS:SI = ptr to subst block
+ call RPrint
+Not15:
+
+;* Print abort, retry, ignore, fail message.
+; Print only options that are valid.
+
+; Bugbug: sizzle this.
+
+ mov dx,offset DATARES:Req_Abort
+ call RPrint
+ test Crit_Err_Info,RETRY_ALLOWED
+ jz Try_Ignore
+ mov dx,offset DATARES:Req_Retry
+ call RPrint
+
+Try_Ignore:
+ test Crit_Err_Info,IGNORE_ALLOWED
+ jz Try_Fail
+ mov dx,offset DATARES:Req_Ignore
+ call RPrint
+
+Try_Fail:
+ test Crit_Err_Info,FAIL_ALLOWED
+ jz Term_Question
+ mov dx,offset DATARES:Req_Fail
+ call RPrint
+
+Term_Question:
+ mov dx,offset DATARES:Req_End
+ call RPrint
+
+; If the /f switch was given, we fail all requests.
+
+ test fFail,-1
+ jz DoPrompt
+ mov ah,3 ; signal fail
+ jmp EExit
+
+DoPrompt:
+ mov ax,(STD_CON_INPUT_FLUSH shl 8) + STD_CON_INPUT
+ int 21h ; get response
+
+
+; Bugbug: can Kanji code be conditional?
+
+ ifdef DBCS
+
+ invoke TestKanjR ; 3/3/KK
+ jz NotKanj ; 3/3/KK
+ mov ax,(STD_CON_INPUT shl 8) ; eat the 2nd byte of ECS code 3/3/KK
+ int 21h ; 3/3/KK
+ call Crlf ; 3/3/KK
+ jmp Ask ; 3/3/KK
+NotKanj: ; 3/3/KK
+
+ endif
+
+ call Crlf
+ call CharToUpper ; convert to upper case
+ mov ah,0 ; return code for ignore
+ test Crit_Err_Info,IGNORE_ALLOWED ; is ignore allowed?
+ jz user_retry
+ cmp al,Ignore_Char ; ignore?
+ jz EExitJ
+
+; Bugbug: optimize following code.
+
+User_Retry:
+ inc ah ; return code for retry
+ test Crit_Err_Info,RETRY_ALLOWED ; is retry allowed?
+ jz User_Abort
+ cmp al,Retry_Char ; retry?
+ jz EExitJ
+
+User_Abort:
+ inc ah ; return code for abort
+ ; (abort always allowed)
+ cmp al,Abort_Char ; abort?
+ jz Abort_Process ; exit user program
+ inc ah ; return code for fail
+ test Crit_Err_Info,FAIL_ALLOWED ; is fail allowed?
+ jz AskJ
+ cmp al,Fail_Char ; fail?
+ jz EExitJ
+
+AskJ:
+ jmp Ask
+
+EExitJ:
+ jmp short EExit
+
+Abort_Process:
+ test InitFlag,INITINIT ; COMMAND init interrupted?
+ jz AbortCont ; no, handle it normally
+ cmp PermCom,0 ; are we top level process?
+ jz JustExit ; yes, just exit
+ mov dx,offset DATARES:Patricide ; no, load ptr to error msg
+ call RPrint ; print it
+
+DeadInTheWater:
+ jmp DeadInTheWater ; loop until the user reboots
+
+JustExit:
+ assume ds:DATARES
+ mov ax,Parent ; load real parent pid
+ mov word ptr ds:Pdb_Parent_Pid,ax ; put it back where it belongs
+ mov ax,(EXIT shl 8) or 255
+ int 21h
+
+AbortCont:
+ test byte ptr In_Batch,-1 ; Are we accessing a batch file?
+ jz Not_Batch_Abort
+ mov byte ptr Batch_Abort,1 ; set flag for abort
+
+Not_Batch_Abort:
+ mov dl,PipeFlag
+ invoke ResPipeOff
+ or dl,dl
+ je CheckForA
+ cmp SingleCom,0
+ je CheckForA
+ mov SingleCom,-1 ; make sure singlecom exits
+
+CheckForA:
+ cmp ErrCd_24,0 ; write protect?
+ je AbortFor
+ cmp ErrCd_24,2 ; drive not ready?
+ jne EExit ; don't abort the FOR
+
+abortfor:
+ mov ForFlag,0 ; abort a FOR in progress
+ cmp SingleCom,0
+ je EExit
+ mov SingleCom,-1 ; make sure singlecom exits
+
+EExit:
+ mov al,ah
+ mov dx,di
+
+RestHd:
+ invoke RestHand
+ pop cx
+ pop si ; restore registers
+ pop es
+
+;; pop ds
+;SR;
+; ds has to be got from the variable we saved it in
+;
+
+ mov ds,OldDS ;restore old value of ds
+; pop ds
+ assume ds:nothing
+
+ iret
+
+FatErr:
+ mov dx,offset DATARES:BadFatMsg
+ mov si,offset DATARES:BadFatSubst
+ call RPrint
+
+ mov al,2 ; abort
+ jmp RestHd
+
+DskErr endp
+
+
+
+
+;*** RPrint - print message
+;*** Crlf - display cr/lf
+;
+; ENTRY DS:DX = ptr to count byte, followed by message text
+; DS:SI = ptr to 1st substitution block for this msg, if any
+; variable fields related to substitution blocks are set
+;
+; EXIT nothing
+;
+; USED flags
+;
+; EFFECTS
+; Message is displayed on stdout.
+;
+; NOTE
+; Number of substitutions (%1, %2,...) in message text must not
+; be greater than number of substition blocks present.
+
+
+Crlf:
+ mov dx,offset DATARES:Newlin ; cheap newline
+
+RPrint proc
+
+ assume ds:DATARES,ss:DATARES
+
+; Bugbug: do we need to save all reg's?
+
+ push si ; preserve registers
+ push ax
+ push bx
+ push cx
+ push dx
+
+ mov bx,si ; DS:BX = ptr to subst block
+ mov si,dx ; DS:SI = ptr to count byte
+ lodsb ; AL = message length
+ ; DS:SI = ptr to message text
+ xor cx,cx
+ mov cl,al ; CX = message length
+ jcxz rpRet
+
+ call RDispMsg
+
+rpRet: pop dx
+ pop cx
+ pop bx
+ pop ax
+ pop si
+ ret
+
+RPrint endp
+
+
+
+
+;*** RPrintCrit - print critical error message
+;
+; ENTRY DX = extended error # (19-39)
+;
+; EXIT nothing
+;
+; USED flags
+;
+; EFFECTS
+; Message is displayed on stdout
+
+RPrintCrit proc
+
+ assume ds:DATARES,ss:DATARES
+
+ push dx ; preserve DX
+ xchg bx,dx ; BX = extended error #
+ ; DX = saved BX
+ sub bx,19 ; BX = critical error index, from 0
+ shl bx,1 ; BX = offset in word table
+ mov bx,CritMsgPtrs[bx] ; BX = ptr to error msg
+ xchg bx,dx ; DX = ptr to error msg
+ ; BX = restored
+ call RPrint ; print the message
+ pop dx ; restore DX
+ ret
+
+RPrintCrit endp
+
+
+
+
+;*** RDispMsg - display message
+;
+; Display message, with substitutions, for RPrint.
+;
+; ENTRY DS:SI = ptr to message text
+; CX = message length
+; DS:BX = ptr to substitution block, if any
+;
+; EXIT nothing
+;
+; USED AX,CX,DX,SI
+
+RDispMsg proc
+
+ assume ds:DATARES,ss:DATARES
+
+rdNextChar:
+ lodsb ; AL = next char
+ cmp al,'%'
+ jne rdOutChar ; not a substitution
+ mov dl,ds:[si] ; DL = possible '1' - '9'
+ sub dl,'1' ; DL = 0 - 8 = '1' - '9'
+ cmp dl,9
+ jae rdOutChar ; not a substitution
+
+;* A substitution code %1 - %9 has been encountered.
+; DL = 0-8, indicating %1-%9
+; DS:BX = ptr to substitution block
+
+ call SubstMsg ; display the substitution
+ inc si ; SI = ptr past %n
+ dec cx ; count extra character in %n
+ jmp short rdCharDone
+
+;* Normal character output.
+
+rdOutChar:
+ mov dl,al ; DL = char
+ mov ah,2 ; AH = DOS Character Output code
+ int 21h ; call DOS
+rdCharDone:
+ loop rdNextChar
+ ret
+
+RDispMsg endp
+
+
+
+
+;*** SubstMsg - display message substitution
+;
+; Display a substitution string within a message.
+; Substitution can be a char, an ASCIIZ string, or
+; a word to be displayed as hex digits.
+;
+; ENTRY DL = substitution index 0-8 (for codes %1-%9)
+; DS:BX = ptr to substitution block
+;
+; EXIT nothing
+;
+; USED AX,DX
+
+SubstMsg proc
+
+ assume ds:DATARES,ss:DATARES
+
+ push bx ; preserve BX
+ push cx ; preserve CX
+
+ mov al,size SUBST ; AL = size of substitution block
+ mul dl ; AX = offset of desired subst block
+ add bx,ax ; DS:BX = ptr to desired subst block
+
+ mov al,[bx].SubstType ; AX = substitution type flag
+ mov bx,[bx].SubstPtr ; BX = ptr to char, str, or hex value
+
+; AL = 1, 2, or 3 for char, string, or hex type
+
+ dec al
+ jz smChar
+ dec al
+ jz smStr
+
+;* Hex number substitution.
+
+ mov ax,ds:[bx] ; AX = word value
+ mov cx,4 ; CX = # digits to display
+smDigit:
+ rol ax,1
+ rol ax,1
+ rol ax,1
+ rol ax,1 ; AL<3:0> = next digit
+
+ push ax ; save other digits
+ and al,0Fh ; AL = binary digit
+ add al,'0' ; AL = ascii digit if 0-9
+ cmp al,'9'
+ jbe @F ; it's 0-9
+ add al,'A' - '0' - 10 ; AL = ascii digit A-F
+@@:
+ mov dl,al ; DL = ascii digit
+ mov ah,2
+ int 21h ; output the ascii digit
+ pop ax ; restore all digits
+
+ loop smDigit
+ jmp short smRet
+
+;* Char substitution.
+
+smChar:
+ mov dl,ds:[bx] ; DL = char to output
+ mov ah,2
+ int 21h
+ jmp short smRet
+
+;* String substitution.
+
+smStr:
+ mov dl,ds:[bx] ; DL = next char
+ or dl,dl
+ jz smRet ; null char - we're done
+ mov ah,2
+ int 21h ; display char
+ inc bx ; DS:BX = ptr to next char
+ jmp smStr
+
+smRet: pop cx
+ pop bx
+ ret
+
+SubstMsg endp
+
+
+
+
+;*** CharToUpper - convert character to uppercase
+;
+; ENTRY AL = char
+;
+; EXIT AL = uppercase char
+;
+; USED AX
+
+CharToUpper proc
+
+ assume ds:DATARES
+
+ push ax ; put char on stack as arg to int 2F
+ mov ax,1213h ; AX = DOS int 2F 'Convert Char to Uppercase'
+ int 2Fh
+ inc sp ; throw away old char on stack
+ inc sp
+ ret
+
+CharToUpper endp
+
+
+
+
+
+ ifdef DBCS
+
+;*** ITestKanj - DBCS lead byte check
+
+ITestKanj:
+TestKanjR: ; 3/3/KK
+ push ds
+ push si
+ push ax
+ lds si,Dbcs_Vector_Addr
+
+ktLop:
+ cmp word ptr ds:[si],0 ; end of Lead Byte Table
+ je NotLead
+ pop ax
+ push ax
+ cmp al, byte ptr ds:[si]
+ jb NotLead
+ inc si
+ cmp al, byte ptr ds:[si]
+ jbe IsLead
+ inc si
+ jmp short ktLop ; try another range
+
+NotLead:
+ xor ax,ax ; set zero
+ jmp short ktRet
+
+Islead:
+ xor ax,ax ; reset zero
+ inc ax
+
+ktRet:
+ pop ax
+ pop si
+ pop ds
+ ret
+
+ endif
+
+
+
+
+;*** MsgInt2fHandler - int 2f handler for message retrieval
+;
+; ENTRY If we handle it -
+; AX = ((MULTDOS shl 8) or MESSAGE_2F) = 122Eh
+; DL = operation =
+; 0 = get extended error messages
+; 1 = set extended error messages
+; 2 = get parse error messages
+; 3 = set parse error messages
+; 4 = get critical error messages
+; 5 = set critical error messages
+; 6 = get file system error messages
+; 7 = set file system error messages
+; 8 = get disk retriever routine
+; 9 = set disk retriever routine
+; ES:DI = address for 'set' operations
+;
+; EXIT ES:DI = ptr to list of message ptrs, for 'get' operations
+;
+; NOTE
+; This handler replaces the one that used to reside in DOS.
+; 'Set' operations are ignored.
+; 'File system error messages' are not supported.
+
+;SR;
+; At the int 2fh entry point we push the old ds value and the resident data
+;segment address. Get them off the stack
+;
+
+MsgInt2fHandler proc far
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+; pop OldDS ;save old value of ds
+
+ cmp ax,(MULTDOS shl 8) or MESSAGE_2F
+ je miOurs ; it's ours
+
+ cmp ax, GET_COMMAND_STATE
+ je fcOurs
+
+;SR;
+; We cannot do a far jump any more because cs cannot be used. Push the cs:ip
+;onto the stack and do a far return to jump to the next 2fh handler.
+;Our old ds is on the stack. We need to restore it but we cannot lose the
+;current value of ds as it points at the data segment. So we do some kinky
+;stack manipulations.
+;
+ push ax
+ push ax ;create 2 words on stack for retf
+
+ push bp
+ push ax
+
+ mov bp,sp ;bp can be used to address stack
+;
+;Swap the old ds value with the second dummy word on the stack. Now, we can
+;do a 'pop ds' at the end to restore our ds
+;
+ mov ax,[bp+8] ;ax = old ds value
+ mov [bp+4],ax
+
+ mov ax,word ptr ds:Int2fHandler+2
+ mov [bp+8],ax ;put segment address
+ mov ax,word ptr ds:Int2fHandler
+ mov [bp+6],ax ;put offset address
+
+
+ pop ax
+ pop bp
+ pop ds
+
+ retf ;chain on to next handler
+
+;; jmp Int2fHandler ; hand off to next 2f handler
+
+fcOurs:
+;
+;We have to clear ax, and return in ds:si a pointer to the stub jump table
+;
+ pop ax ;discard ds currently on stack
+ push ds ;store our data segment
+
+ mov si,offset DATARES:Int2f_Entry ;start of table
+
+ xor ax,ax ;indicate COMMAND present
+ jmp short miRet ;return to caller
+
+
+miOurs:
+ test dl,1
+ jnz miRet ; ignore 'set' operations
+
+ push bx ; preserve BX
+ mov bx,dx
+ xor bh,bh ; BX = index in word table
+ shl bx,1 ; BX = index in dword table
+ les di,MsgPtrLists[bx] ; ES:DI = ptr to msg ptr list
+ pop bx ; restore BX
+
+miRet:
+; mov ds,OldDS ;restore ds
+ pop ds
+ assume ds:nothing
+
+ iret
+
+MsgInt2fHandler endp
+
+
+
+
+;*** MsgRetriever - message retrieval routine for utilities
+;
+; Address of this routine is passed to utility programs via
+; message services int 2f. We try to find the desired message
+; in memory or in our disk image.
+;
+; ENTRY AX = message #
+; DI = offset in RESGROUP of msg ptr list
+; ComSpec = asciiz pathname to our disk image
+;
+; EXIT CY clear for success
+; ES:DI = ptr to count byte, followed by message text
+;
+; CY set for failure
+;
+; USED flags
+;
+; NOTE
+; The message # in AX is used to compute an offset into
+; the message ptr list pointed to by DI. The lists must
+; start with message # 1 and proceed through consecutive
+; message #'s.
+;
+; It is assumed that the msg ptr list is either ParsMsgPtrs or
+; ExtMsgPtrs. We use NUMPARSEMSGS and NUMEXTMSGS to check for
+; valid message #. ;M033
+;
+; List positions with no corresponding message text are
+; indicated by null pointers, which this routine detects.
+
+;SR; This routine will be called directly by the utilities. So, we have
+; trap for it in the stub. The stub pushes the old value of ds and the
+; DATARES value on the stack. We get them off the stack to setup ds here
+;
+
+MsgRetriever proc far
+
+ assume cs:CODERES,ds:NOTHING,es:NOTHING,ss:NOTHING
+
+ pop ds ;ds = DATARES
+ assume ds:DATARES
+; pop OldDS ;save old ds
+
+ push ax ; preserve registers
+ push bx
+ push cx
+ push dx
+ push si
+
+;; push ds
+;; push cs
+;; pop ds ; DS = DATARES seg addr
+;; assume ds:RESGROUP
+;; push cs
+
+ push ds ; get es from ds
+ pop es ; ES = DATARES seg addr
+
+; Begin modification M033.
+
+; Make sure msg # is valid.
+; Assume msg ptr list is either ParsMsgPtrs or ExtMsgPtrs.
+
+ mov bx,NUMPARSMSGS ; BX = # parse error msgs in list
+ cmp di,offset DATARES:ParsMsgPtrs
+ je @f ; it's ParsMsgPtrs
+ mov bx,NUMEXTMSGS ; BX = # extended error msgs in list
+@@: cmp bx,ax
+ jc mrRet ; msg # too high, return carry
+
+; Msg # is valid.
+
+; End modification M033.
+
+ dec ax
+ shl ax,1 ; AX = offset into msg ptr list
+ add di,ax ; DI = ptr to msg ptr
+
+ cmp di,ResMsgEnd
+ jb mrInMem ; ptr (and message) in memory
+
+;* Retrieve message from disk.
+; Read once to get the ptr to the message, then again for the message.
+
+ mov si,offset DATARES:ComSpec ; DS:SI = ptr to pathname
+ mov dx,EXT_EXISTS_OPEN ; DX = 'open existing file'
+ mov bx,INT_24_ERROR ; BX = 'fail on crit error'
+ mov ax,EXTOPEN shl 8 ; AX = 'Extended Open File'
+ int 21h ; call DOS
+ jc mrRet ; return failure
+
+ mov bx,ax ; BX = file handle
+ mov dx,di ; DX = ptr to msg ptr
+ xor si,si ; SI = read count
+mrRead:
+ sub dx,100h ; DX = LSW of file offset
+ xor cx,cx ; CX = MSW of file offset
+ mov ax,LSEEK shl 8 ; AX = 'Set File Pointer'
+ int 21h ; call DOS
+ jc mrCloseFile ; handle error
+
+ mov dx,offset DATARES:MsgBuffer ; DS:DX = input buffer
+ mov cx,64 ; CX = # bytes to read
+ mov ah,READ ; AH = 'Read File'
+ int 21h ; call DOS
+ jc mrCloseFile ; handle error
+
+ or si,si ; (CY cleared)
+ jnz mrCloseFile ; 2nd time thru - we're done
+ inc si ; mark one read done
+ mov dx,word ptr MsgBuffer ; DX = ptr to message
+ or dx,dx
+ jnz mrRead ; go read the message
+ stc ; null ptr found- no msg
+
+mrCloseFile:
+ pushf ; save success/failure (CY)
+ mov ah,CLOSE ; AH = 'Close File'
+ int 21h ; call DOS
+; Bugbug: should we avoid this popf?
+ popf ; CY = success/failure
+ mov di,dx ; ES:DI = ptr to msg, if successful
+ jmp short mrRet ; we're done
+
+
+;* Message ptr is in memory.
+; If ptr is in memory, assume message is in memory (/msg).
+
+mrInMem:
+ mov di,es:[di] ; ES:DI = ptr to msg
+ or di,di ; (CY cleared)
+ jnz mrRet ; found message
+ stc ; null ptr found- no message
+
+mrRet:
+ pop si ;restore all registers
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+
+; mov ds,OldDS ;restore ds
+ pop ds
+ assume ds:nothing
+
+ ret
+
+MsgRetriever endp
+
+;
+; M003; Start of changes for UMB support
+;
+
+
+;*** Lh_OffUnlink -- Restore allocation strat and link state
+;
+; ENTRY al = Saved alloc strat and link state
+; b0 = 1 if alloc strat to restore is HighFirst
+; b1 = 1 if link state to restore is Linked
+;
+; EXIT None
+;
+; USED ax, bx, cx
+;
+;
+
+public Lh_OffUnlink
+Lh_OffUnlink proc far
+
+ mov ch,al
+ mov cl,al
+ mov ax,(ALLOCOPER shl 8) OR 0
+ int 21h
+ mov bx,ax
+ ror cl,1 ;b7 = HighFirst bit
+ and cl,80h ;mask off b6-b0
+ and bl,7fh ;mask off HighFirst bit
+ or bl,cl ;set HighFirst bit state
+ mov ax,(ALLOCOPER shl 8) OR 1
+ int 21h ;set alloc strat
+
+ mov bl,ch
+ shr bl,1
+ xor bh,bh ;bx = linkstate
+ mov ax,(ALLOCOPER shl 8) OR 3
+ int 21h ;set linkstate
+
+ ret
+
+Lh_OffUnlink endp
+
+;
+; M003; End of changes for UMB support
+;
+
+public EndCode
+EndCode label byte
+
+CODERES ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/stub.asm b/private/mvdm/dos/v86/cmd/command/stub.asm
new file mode 100644
index 000000000..5e0e3e52c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/stub.asm
@@ -0,0 +1,336 @@
+ page ,132
+ title Command Stub
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M003 SR 07/16/90 Check if UMB loading enabled and if so
+; turn it off on return from Exec
+;
+; M005 SR 07/20/90 Carousel hack. Added a hard-coded far
+; jump to the actual int 2fh entry
+; point to fix Carousel problems.
+;
+; M009 SR 08/01/90 Restore the UMB state before the Exec
+; from the saved state in LoadHiFlg.
+;
+; M035 SR 10/27/90 Enable interrupts at the start of
+; the dispatch code. Otherwise interrupts
+; remain disabled through a whole
+; of code which is not good.
+;
+; M049 SR 1/16/91 Bug #5075. Reworked the scheduling
+; strategy. There is no common
+; dispatcher now. Each entry point
+; now checks A20 and then does a far
+; jump to the appropriate code. This
+; added about 15 bytes of code but the
+; speed increase and reentrancy are
+; well worth the price.
+;
+
+
+
+;
+;This file contains the low memory stub for command.com which hooks all the
+;entry points into the resident command.com and directs the calls to the
+;appropriate routines in the resident code which may be located in HIMEM.
+; The stub has been made part of the resident data and will always
+;be duplicated on every invocation of command.com. However, the only stubs
+;that actually hook the interrupt vectors belong to either the first
+;command.com or to any other command.com executed with the /p switch.
+; The stub also keeps track of the current active data segment. The
+;INIT code of each command.com updates this variable via an int 2fh mechanism
+;with its own data segment. The INIT code also updates a pointer in its data
+;segment to the previous resident data segment. Whenever a command.com exits,
+;the exit code picks up the previous data segment pointer from the current
+;data segment and patches it into the CurResDataSeg variable in the stub.
+; Right now the stub does not bother about A20 switching. We assume
+;A20 is always on. It just does a far jump to the resident code with the
+;value of the current data segment in one of the registers. A20 toggle
+;support maybe added as a future enhancement, if the need is felt.
+;
+
+
+ include comseg.asm
+ include xmm.inc
+
+INIT segment
+
+ extrn ConProc:near
+
+INIT ends
+
+CODERES segment
+
+ extrn MsgInt2fHandler :near
+ extrn Int_2e :near
+ extrn Contc :near
+ extrn DskErr :near
+
+CODERES ends
+
+DATARES segment
+ assume cs:DATARES,ds:nothing,es:nothing,ss:nothing
+ Org 0
+ZERO = $
+
+ Org 100h
+ProgStart:
+ jmp RESGROUP:ConProc
+
+ db ? ;make following table word-alligned
+
+
+;
+;All the entry points declared below are patched in at INIT time with the
+;proper segment and offset values after the resident code segment has been
+;moved to its final location
+;
+public Int2f_Entry, Int2e_Entry, Ctrlc_Entry, CritErr_Entry, Lodcom_Entry
+public Exec_Entry, RemCheck_Entry, TrnLodCom1_Entry, MsgRetrv_Entry
+public HeadFix_Entry
+public XMMCallAddr, ComInHMA
+
+;!!!WARNING!!!
+; All the dword ptrs from Int2f_Entry till MsgRetrv_Entry should be contiguous
+;because the init routine 'Patch_stub' (in init.asm) relies on this to patch
+;in the correct segments and offsets
+;
+
+Int2f_Entry label dword
+ dw offset RESGROUP:MsgInt2fHandler ;Address of int 2fh handler
+ dw 0
+
+Int2e_Entry label dword
+ dw offset RESGROUP:Int_2e ;Address of int 2eh handler
+ dw 0
+
+Ctrlc_Entry label dword
+ dw offset RESGROUP:ContC ;Address of Ctrl-C handler
+ dw 0
+
+CritErr_Entry label dword
+ dw offset RESGROUP:DskErr ;Address of critical error handler
+ dw 0
+
+Exec_Entry dd ? ;Entry from transient to Ext_Exec
+RemCheck_Entry dd ? ;Entry from transient to TRemCheck
+TrnLodCom1_Entry dd ? ;Entry from transient to LodCom1
+LodCom_Entry dd ? ;Entry after exit from command.com
+MsgRetrv_Entry dd ? ;Entry from external to MsgRetriever
+HeadFix_Entry dd ? ;Entry from trans to HeadFix
+
+UMBOff_Entry dd ? ;Entry from here to UMBOff routine; M003
+
+XMMCallAddr dd ? ;Call address for XMM functions
+ComInHMA db 0 ;Flags if command.com in HMA
+
+public Int2f_Trap, Int2e_Trap, Ctrlc_Trap, CritErr_Trap
+public Exec_Trap, RemCheck_Trap, LodCom_Trap, MsgRetrv_Trap, TrnLodcom1_Trap
+public HeadFix_Trap
+
+
+Int2f_Trap:
+ sti
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp Int2f_Entry
+
+Int2e_Trap:
+ sti
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp Int2e_Entry
+
+Ctrlc_Trap:
+ sti
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp Ctrlc_Entry
+
+CritErr_Trap:
+ sti
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp CritErr_Entry
+
+Exec_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp Exec_Entry
+
+RemCheck_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp RemCheck_Entry
+
+TrnLodCom1_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp TrnLodCom1_Entry
+
+LodCom_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp LodCom_Entry
+
+MsgRetrv_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp MsgRetrv_Entry
+
+HeadFix_Trap:
+ call CheckA20
+ push ds ;push current ds value
+ push cs ;push resident data segment value
+ jmp HeadFix_Entry
+
+CheckA20 proc
+
+ pushf ;save current flags
+ push ax
+ cmp cs:ComInHMA,0 ;is resident in HMA?
+ jz A20_on ;no, jump to resident
+
+ call QueryA20
+ jnc A20_on ;A20 is on, jump to resident
+
+ call EnableA20 ;turn A20 on
+A20_on:
+ pop ax
+ popf ;flags have to be unchanged
+ ret
+
+CheckA20 endp
+
+
+;
+; M005; This is a far jump to the actual int 2fh entry point. The renormalized
+; M005; int 2fh cs:ip points here. We hardcode a far jump here to the int 2fh
+; M005; handler. Note that we have to hardcode a jump and we cannot use any
+; M005; pointers because our cs is going to be different. The segment to
+; M005; jump to is patched in at init time. (in init.asm)
+;
+
+public Carousel_i2f_Hook ; M005
+Carousel_i2f_Hook: ; M005
+ db 0eah ; far jump opcode; M005
+ dw offset DATARES:Int2f_Trap ; int 2fh offset ; M005
+ dw ? ; int 2fh segment; M005
+
+
+QueryA20 proc near
+
+ push bx
+ push ax
+ mov ah, XMM_QUERY_A20
+ call cs:XMMCallAddr
+ or ax, ax
+ pop ax
+ pop bx
+ jnz short QA20_ON ; AX = 1 => ON
+
+ stc ; OFF
+ ret
+QA20_ON:
+ clc ; ON
+ ret
+
+QueryA20 endp
+
+
+
+EnableA20 proc near
+
+ push bx
+ push ax
+ mov ah, XMM_LOCAL_ENABLE_A20
+ call cs:XMMCallAddr
+ or ax, ax
+ jz XMMerror ; AX = 0 fatal error
+ pop ax
+ pop bx
+ ret
+;
+;If we get an error, we just loop forever
+;
+XMMerror:
+ jmp short XMMerror
+
+EnableA20 endp
+
+
+;
+;The Exec call has to be issued from the data segment. The reason for this
+;is TSRs. When a TSR does a call to terminate and stay resident, the call
+;returns with all registers preserved and so all our segment registers are
+;still set up. However, if the TSR unloads itself later on, it still
+;comes back here. In this case the segment registers and the stack are
+;not set up and random things can happen. The only way to setup all the
+;registers is to use the cs value and this can only be done when we are in
+;the data segment ourselves. So, this piece of code had to be moved from
+;the code segment to the data segment.
+;
+
+ extrn RStack:WORD
+ extrn LoadHiFlg:BYTE
+
+public Issue_Exec_Call
+Issue_Exec_Call:
+ int 21h
+;
+;We disable interrupts while changing the stack because there is a bug in
+;some old 8088 processors where interrupts are let through while ss & sp
+;are being changed.
+;
+ cli
+ push cs
+ pop ss
+ mov sp,offset DATARES:RStack ;stack is set up
+ sti
+ push cs
+ pop ds ;ds = DATARES
+;
+; M009; Restore UMB state to that before Exec
+;
+;; save execution status(carry flag)
+;; and the error code(AL)
+ pushf ;save flags ; M003
+ push ax
+ mov al,LoadHiFlg ;current UMB state ; M009
+ test al,80h ;did we try to loadhigh? ;M009
+ jz no_lh ;no, dont restore ;M009
+ and al,7fh ;clear indicator bit ;M009
+ call dword ptr UMBOff_Entry ;restore UMB state ; M009
+no_lh: ; M009
+ and LoadHiFlg,7fh ;clear loadhigh indicator bit
+ ;M009
+ pop ax
+ popf ; M003; *bugbug -- popff??
+;
+;We now jump to the stub trap which returns us to the resident code. All
+;flags are preserved by the stub code.
+;
+ jmp Exec_Trap
+
+
+DATARES ends
+ end ProgStart
+
+
diff --git a/private/mvdm/dos/v86/cmd/command/tbatch.asm b/private/mvdm/dos/v86/cmd/command/tbatch.asm
new file mode 100644
index 000000000..61c93a3d1
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tbatch.asm
@@ -0,0 +1,1097 @@
+ page ,132
+; SCCSID = @(#)tbatch.asm 4.5 85/10/01
+; SCCSID = @(#)tbatch.asm 4.5 85/10/01
+TITLE Batch processing routines
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M006 SR 07/20/90 Changed BatCom to understand batch
+; segments in UMBs. Check only for
+; overlap.
+; M017 MD 08/10/90 Eliminate extra DEC, to fix bug #1
+;
+; M037 SR 11/1/90 Bug #1745 & #3438 fixed. Fixed ReadBat
+; to check if we have hit EOF on
+; batchfile and if so, just clear everything
+; and return finishing batch processing.
+;
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include comseg.asm
+ include comequ.asm
+ include doscntry.inc ;an000;
+ include version.inc
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BATCH:WORD
+ EXTRN Batch_Abort:byte
+ EXTRN call_batch_flag:byte
+ EXTRN ECHOFLAG:BYTE
+ EXTRN forflag:byte
+ EXTRN forptr:word
+ EXTRN IFFlag:BYTE
+ EXTRN In_Batch:byte
+ EXTRN LTPA:WORD
+ EXTRN Nest:word
+ EXTRN next_batch:word
+ EXTRN nullflag:byte
+ EXTRN PIPEFLAG:BYTE
+ EXTRN RES_TPA:WORD
+ EXTRN SINGLECOM:WORD
+ EXTRN SUPPRESS:BYTE ;AC000;
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BADBAT_PTR:WORD
+ EXTRN Extend_buf_ptr:word ;AC000;
+ EXTRN Extend_buf_sub:byte ;AN022;
+ EXTRN msg_disp_class:byte ;AC000;
+ EXTRN NEEDBAT_PTR:WORD
+ EXTRN pausemes_ptr:word ;AC000;
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BatBufPos:WORD
+ EXTRN BATHAND:WORD
+ EXTRN bwdbuf:byte ;AN022;
+ EXTRN BYTCNT:WORD
+ EXTRN COMBUF:BYTE
+ EXTRN EXECPATH:BYTE
+ EXTRN ID:BYTE
+ EXTRN RCH_ADDR:DWORD
+ EXTRN RESSEG:WORD
+ EXTRN string_ptr_2:word ;AC000;
+ EXTRN TPA:WORD
+ EXTRN TRAN_TPA:WORD
+
+ extrn TranSpaceEnd:byte ; M006
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN cerror:near
+ EXTRN tcommand:near
+
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ extrn arg:byte ; the arg structure!
+transpace ends
+;---------------
+
+Break <PromptBat - Open or wait for batch file>
+
+;
+; Open the batch file. If we cannot find the batch file. If the media is
+; changeable, we prompt for the change. Otherwise, we terminate the batch
+; file. Leave segment registers alone.
+;
+
+Procedure PromptBat,NEAR
+ ASSUME DS:ResGroup,ES:NOTHING
+ invoke BATOPEN ; attempt to open batch file
+ retnc
+ cmp dx,error_file_not_found ;AN022; Ask for diskette if file not found
+ jz Bat_Remcheck ;AN022;
+ cmp dx,error_path_not_found ;AN022; Ask for diskette if path not found
+ jz Bat_Remcheck ;AN022; Otherwise, issue message and exit
+ invoke output_batch_name ;AN022; set up batch name in bwdbuf
+ jmp short BatDie ;AN022;
+
+Bat_Remcheck: ;AN022; Go see if media is removable
+ CALL [RCH_ADDR] ; DX has error number
+ JZ AskForBat ; Media is removable
+;
+; The media is not changeable. Turn everything off.
+;
+ invoke ForOff
+ invoke PipeOff
+ MOV IfFlag,AL ; No If in progress.
+ MOV DX,OFFSET TRANGROUP:BADBAT_ptr
+
+BatDie:
+ call BatchOff
+ PUSH CS
+ POP DS
+ ASSUME DS:TranGroup
+ invoke std_eprintf ;AC022; display message
+
+;
+; TCOMMAND resets the stack. This is the equivalent of a non-local goto.
+;
+ JMP TCOMMAND ; he cleans off stack
+
+;
+; Ask the user to reinsert the batch file
+;
+ASKFORBAT:
+ ASSUME DS:ResGroup
+ PUSH DS
+ PUSH CS
+ POP DS
+ ASSUME DS:TranGroup
+ MOV DX,OFFSET TRANGROUP:NEEDBAT_ptr ;AN022;
+ invoke std_eprintf ;Prompt for batch file on stderr
+ mov dx,offset trangroup:pausemes_ptr ;AN000; get second part of message
+ invoke std_eprintf ;AN000; print it to stderr
+ CALL GetKeystroke
+ POP DS
+ ASSUME DS:ResGroup
+ jmp PromptBat
+EndProc PromptBat
+
+;****************************************************************
+;*
+;* ROUTINE: Output_batch_name
+;*
+;* FUNCTION: Sets up batch name to be printed on extended error
+;*
+;* INPUT: DX - extended error number
+;*
+;* OUTPUT: Ready to call print routine
+;*
+;****************************************************************
+
+public output_batch_name ;AN022;
+
+Output_batch_name proc near ;AN022;
+
+ push ds ;AN022; save resident segment
+ mov ds,[batch] ;AN022; get batch file segment
+assume DS:nothing ;AN022;
+ mov SI,BatFile ;AN022; get offset of batch file
+ invoke dstrlen ;AN022; get length of string
+ mov di,offset Trangroup:bwdbuf ;AN022; target for batch name
+ rep movsb ;AN022; move the name
+
+ push cs ;AN022; get local segment
+ pop ds ;AN022;
+assume DS:trangroup ;AN022;
+ mov extend_buf_ptr,dx ;AN022; put message number in block
+ mov msg_disp_class,ext_msg_class ;AN022; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AN022; get extended message pointer
+ mov string_ptr_2,offset trangroup:bwdbuf ;AN022; point to substitution
+ mov extend_buf_sub,one_subst ;AN022; set up for one subst
+ pop ds ;AN022; restore data segment
+
+ ret ;AN022; return
+
+Output_batch_name endp ;AN022;
+
+Break <GetKeystroke - get a keystroke and flush queue>
+
+;
+; read the next keystroke. Since there may be several characters in the queue
+; after the one we ask for (function keys/Kanji), we need to flush the queue
+; AFTER waiting.
+;
+Procedure GetKeyStroke,NEAR
+;
+; read any character at any mode, interim mode or not.
+;
+ assume ds:trangroup
+
+ PUSH DX ;AN000; 3/3/KK
+ MOV AX,(ECS_call SHL 8) OR GetInterimMode ;AN000; 3/3/KK
+ INT 21h ;AN000; 3/3/KK
+ PUSH DX ;AN000; save interim state 3/3/KK
+ MOV AX,(ECS_call SHL 8) OR SetInterimMode ;AN000; 3/3/KK
+ MOV DL,InterimMode ;AN000; 3/3/KK
+ INT 21h ;AN000; 3/3/KK
+
+ MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_INPUT_no_echo
+ INT 21h ; Get character with KB buffer flush
+ MOV AX,(STD_CON_INPUT_FLUSH SHL 8) + 0
+ INT 21h
+
+ MOV AX,(ECS_call SHL 8) OR SetInterimMode ;AN000; 3/3/KK
+ POP DX ;AN000; restore interim state 3/3/KK
+ INT 21h ;AN000; 3/3/KK
+ POP DX ;AN000; 3/3/KK
+
+ return
+EndProc GetKeyStroke
+
+Break <ReadBat - read 1 line from batch file>
+
+;
+; ReadBat - read a single line from the batch file. Perform all substitutions
+; as appropriate
+;
+
+Procedure ReadBat,NEAR
+ ASSUME DS:ResGroup,ES:TranGroup
+ mov suppress,yes_echo ;g initialize line suppress status
+ test byte ptr [Batch_Abort],-1
+ jnz Trying_To_Abort
+ mov byte ptr [In_Batch],1 ; set flag to indicate batch job
+;
+;M037; Start of changes
+; We check here if we have set the flag indicating that the batchfile is at
+;EOF. In this case, we do not want to continue with the normal processing.
+;We call GetBatByt once more so that the batch segment gets freed up, the
+;batch file gets closed etc. and then return as if everything is done.
+;
+ push ds
+ mov ds,Batch
+ cmp ds:BatchEOF,0 ; are we at EOF in batchfile
+ pop ds
+ jz contbat ; no, continue normal processing
+ invoke GetBatByt ; frees up batchseg
+ mov es:ComBuf+2,al ; stuff CR into command buffer
+ ; as a dummy command
+ invoke CrLf2 ; print a CR-LF
+ return ; done batch processing
+contbat:
+;
+;M037; End of changes
+;
+
+ CALL PromptBat
+
+Trying_To_Abort:
+ MOV DI,OFFSET TRANGROUP:COMBUF+2
+
+;
+; Save position and try to scan for first non delimiter.
+;
+
+TESTNOP:
+ MOV AX,DS
+ MOV DS,Batch
+ ASSUME DS:NOTHING
+ PUSH WORD PTR DS:[BatSeek]
+ PUSH WORD PTR DS:[BatSeek+2] ; save current location.
+ MOV DS,AX
+ ASSUME DS:ResGroup
+ invoke SkipDelim ; skip to first non-delim
+;
+; If the first non-delimiter is not a : (label), we reseek back to the
+; beginning and read the line.
+;
+ CMP AL,':' ; is it a label?
+ POP CX
+ POP DX ; restore position in bat file
+ JZ NopLine ; yes, resync everything.
+ TEST [BATCH],-1 ; are we done with the batch file?
+ JZ RdBat
+
+ CMP AL, NO_ECHO_CHAR ;g see if user wants to suppress line
+ JNZ SET_BAT_POS ;g no - go and set batch file position
+ MOV SUPPRESS, NO_ECHO ;g yes set flag to indicate
+ jmp short Rdbat ;g go read batch file
+
+SET_BAT_POS: ;g
+ PUSH DS
+ MOV DS,Batch
+ ASSUME DS:NOTHING
+ MOV WORD PTR DS:[BatSeek],DX ; reseek back to beginning
+ MOV WORD PTR DS:[BatSeek+2],CX
+ POP DS
+ ASSUME DS:ResGroup
+ MOV AX,(LSEEK SHL 8) + 0 ; seek back
+ INT 21h
+ MOV BatBufPos,-1 ; nuke batch buffer position
+ xor cx,cx ; Initialize line length to zero
+ JMP SHORT RdBat
+;
+; The first non-delimiter is a :. This line is not echoed and is ignored.
+; We eat characters until a CR is seen.
+;
+
+NOPLINE:
+ CALL SkipToEOL
+ invoke GetBatByt ; eat trailing LF
+ TEST [BATCH],-1 ; are we done with the batch file?
+ JNZ TESTNOP ; no, go get another line
+ return ; Hit EOF
+
+;
+; Read a line into the buffer pointed to by ES:DI. If any %s are seen in the
+; input, we are to consider two special cases:
+;
+; %0 to %9 These represent replaceable parameters from the batch segment
+; %sym% This is a symbol from the environment
+;
+
+RDBAT:
+ invoke GetBatByt
+ inc cx ; Inc the line length
+
+ invoke testkanj ; MSKK04 07/14/89
+ jz rdbat1 ;
+ cmp cx, COMBUFLEN-1 ;
+ jae TooLong ; can't start DBCS char at last pos'n
+ stosb ;
+ invoke GetBatByt ;
+ inc cx ;
+ jmp short SAVBATBYT ;
+rdbat1: ;
+
+ cmp cx,COMBUFLEN ; Is it too long?
+ jae TooLong ; Yes - handle it, handle it
+;
+; See if we have a parameter character.
+;
+ CMP AL,'%' ; Check for parameter
+ JZ NEEDPARM
+;
+; no parameter character. Store it as usual and see if we are done.
+;
+
+SAVBATBYT:
+ STOSB
+ CMP AL,0DH ; End of line found?
+ JNZ RDBAT ; no, go for more
+;
+; We have read in an entire line. Decide whether we should echo the command
+; line or not.
+;
+
+Found_EOL:
+ SUB DI,OFFSET TRANGROUP:COMBUF+3
+ MOV AX,DI ; remember that we've not counted the CR
+ MOV ES:[COMBUF+1],AL ; Set length of line
+ invoke GetBatByt ; Eat linefeed
+ invoke BATCLOSE
+ CMP SUPPRESS, NO_ECHO ;G
+ JZ Reset ;G
+ test [echoflag],1 ; To echo or not to echo, that is the
+ jnz try_nextflag
+
+Reset:
+ PUSH CS ; question. (Profound, huh?)
+ POP DS ; Go back to local segment
+ retz ; no echoing here...
+;
+; Echo the command line with appropriate CRLF...
+;
+
+
+try_nextflag:
+ cmp nullflag,nullcommand ;G was there a command last time?
+ jz No_crlf_print ;G no - don't print crlf
+ invoke CRLF2 ;G Print out prompt
+
+no_crlf_print:
+ invoke PRINT_PROMPT ;G
+ PUSH CS ;G change data segment
+ POP DS ;G
+
+ASSUME DS:TRANGROUP
+ mov dx,OFFSET TRANGROUP:COMBUF+2 ; get command line for echoing
+ invoke CRPRINT
+ invoke CRLF2
+ return
+;
+; The line was too long. Eat remainder of input text up until the CR
+;
+TooLong:
+ ASSUME DS:ResGroup
+ cmp al,0dh ; Has the end of the line been reached?
+ jz Ltlcont ; Yes, continue
+ CALL SkipToEOL ; Eat remainder of line
+
+Ltlcont:
+ stosb ; Terminate the command
+ jmp Found_EOL ; Go process the valid part of the line
+;
+; We have found a parameter lead-in character. Check for the 0-9 case first
+;
+
+NEEDPARM:
+ invoke GetBatByt ; get next character
+ CMP AL,'%' ; Check for two consecutive %
+ JZ SAVBATBYT ; if so, replace with a single %
+ CMP AL,0Dh ; Check for end-of-line
+ JZ SAVBATBYT ; yes, treat it normally
+;
+; We have found %<something>. If the <something> is in the range 0-9, we
+; retrieve the appropriate parameter from the batch segment. Otherwise we
+; see if the <something> has a terminating % and then look up the contents
+; in the environment
+;
+PAROK:
+ SUB AL,'0'
+ JB NEEDENV ; look for parameter in the environment
+ CMP AL,9
+ JA NEEDENV
+;
+; We have found %<number>. This is taken from the parameters in the
+; allocated batch area.
+;
+ CBW
+ MOV BX,AX ; move index into AX
+ SHL BX,1 ; convert word index into byte ptr
+ SaveReg <ES>
+ MOV ES,Batch
+;
+; The structure of the batch area is:
+;
+; BYTE type of segment
+; DWORD offset for next line
+; 10 WORD pointers to parameters. -1 is empty parameter
+; ASCIZ file name (with . and ..)
+; BYTES CR-terminated parameters
+; BYTE 0 flag to indicate end of parameters
+;
+; Get pointer to BX'th argument
+;
+ MOV SI,ES:BatParm[BX]
+ RestoreReg <ES>
+;
+; Is there a parameter here?
+;
+ CMP SI,-1 ; Check if parameter exists
+ JNZ Yes_there_is ;G Yes go get it
+ JMP RDBAT ; Ignore if it doesn't
+;
+; Copy in the found parameter from batch segment
+;
+
+Yes_there_is:
+ PUSH DS
+ MOV DS,Batch
+ ASSUME DS:NOTHING
+ dec cx ; Don't count '%' in line length
+
+CopyParm:
+ LODSB ; From resident segment
+ CMP AL,0DH ; Check for end of parameter
+ JZ EndParam
+ inc cx ; Inc the line length
+ cmp cx,COMBUFLEN ; Is it too long?
+ jae LineTooL ; Yes - handle it, handle it
+ STOSB
+ JMP CopyParm
+;
+; We have copied up to the limit. Stop copying and eat remainder of batch
+; line. We need to make sure that the tooLong code isn't fooled into
+; believing that we are at EOL. Clobber AL too.
+;
+
+LineTooL:
+ XOR AL,AL
+ POP DS
+ ASSUME DS:RESGROUP
+ JMP TooLong
+;
+; We have copied in an entire parameter. Go back for more
+;
+
+EndParam:
+ POP DS
+ JMP RDBat
+;
+; We have found % followed by something other than 0-9. We presume that there
+; will be a following % character. In between is an environment variable that
+; we will fetch and replace in the batch line with its value.
+;
+
+NEEDENV:
+ dec cx ;AN070; Don't count "%"
+ SaveReg <DS,DI>
+ MOV DI,OFFSET TRANGROUP:ID ; temp spot for name
+ ADD AL,'0' ; reconvert character
+ STOSB ; store it in appropriate place
+;
+; loop getting characters until the next % is found or until EOL
+;
+
+GETENV1:
+ invoke GetBatByt ; get the byte
+ STOSB ; store it
+ CMP AL,0Dh ; EOL?
+ JNZ GETENV15 ; no, see if it the term char
+;
+; The user entered a string with a % but no trailing %. We copy the string.
+;
+ mov byte ptr es:[di-1],0 ; nul terminate the string
+ mov si,offset TranGroup:ID ; point to buffer
+ pop di ; point to line buffer
+ push cs
+ pop ds
+ call StrCpy
+ jc LineTooL
+ pop ds
+ jmp SavBatByt
+
+GETENV15:
+ CMP AL,'%' ; terminating %?
+ JNZ GETENV1 ; no, go suck out more characters
+
+; M017 - following DEC is wrong, because we replace the % with a = here.
+; This was the source of bug #1.
+; dec cx ;AN070; Don't count "%"
+
+ mov al,'=' ; terminate with =
+ MOV ES:[DI-1],al
+;
+; ID now either has a =-terminated string which we are to find in the
+; environment or a non =-terminated string which will not be found in the
+; environment.
+;
+GETENV2:
+ MOV SI,OFFSET TRANGROUP:ID
+ PUSH CS
+ POP DS ; DS:SI POINTS TO NAME
+ ASSUME DS:TRANGROUP
+ PUSH CX
+ INVOKE FIND_NAME_IN_environment
+ ASSUME ES:RESGROUP
+ POP CX
+ PUSH ES
+ POP DS
+ assume ds:resgroup
+ PUSH CS
+ POP ES
+ ASSUME ES:TRANGROUP
+ MOV SI,DI
+ POP DI ; get back pointer to command line
+;
+; If the parameter was not found, there is no need to perform any replacement.
+; We merely pretend that we've copied the parameter.
+;
+ JC GETENV6
+;
+; ES:DI points to command line being built
+; DS:SI points either to nul-terminated environment object AFTER =
+;
+
+ ASSUME ES:NOTHING
+ call StrCpy ; (let RdBat handle overflow)
+GETENV6:
+ pop ds
+ JMP RDBAT ; no, go back to batch file
+
+EndProc ReadBat
+
+;
+; SkipToEOL - read from batch file until end of line
+;
+
+Procedure SkipToEOL,NEAR
+
+ ASSUME DS:ResGroup,ES:NOTHING
+
+ TEST Batch,-1
+ retz ; no batch file in effect
+ invoke GetBatByt
+ CMP AL,0Dh ; eol character?
+ JNZ SkipToEOL ; no, go eat another
+ return
+
+EndProc SkipToEOL
+
+Break <Allocate and deallocate the transient portion>
+
+;
+; Free Transient. Modify ES,AX,flags
+;
+
+Procedure Free_TPA,NEAR
+
+ASSUME DS:TRANGROUP,ES:RESGROUP
+
+ PUSH ES
+ MOV ES,[RESSEG]
+ MOV ES,[RES_TPA]
+ MOV AH,DEALLOC
+ INT 21h ; Make lots of free memory
+ POP ES
+
+ return
+
+EndProc Free_TPA
+
+;
+; Allocate transient. Modify AX,BX,DX,flags
+;
+
+Procedure Alloc_TPA,NEAR
+
+ASSUME DS:TRANGROUP,ES:RESGROUP
+
+ PUSH ES
+ MOV ES,[RESSEG]
+ MOV BX,0FFFFH ; Re-allocate the transient
+ MOV AH,ALLOC
+ INT 21h
+ PUSH BX ; Save size of block
+ MOV AH,ALLOC
+ INT 21h
+;
+; Attempt to align TPA on 64K boundary
+;
+ POP BX ; Restore size of block
+ MOV [RES_TPA], AX ; Save segment to beginning of block
+ MOV [TRAN_TPA], AX
+;
+; Is the segment already aligned on a 64K boundary
+;
+ MOV DX, AX ; Save segment
+ AND AX, 0FFFH ; Test if above boundary
+ JNZ Calc_TPA
+ MOV AX, DX
+ AND AX, 0F000H ; Test if multiple of 64K
+ JNZ NOROUND
+
+Calc_TPA:
+ MOV AX, DX
+ AND AX, 0F000H
+ ADD AX, 01000H ; Round up to next 64K boundary
+ JC NOROUND ; Memory wrap if carry set
+;
+; Make sure that new boundary is within allocated range
+;
+ MOV DX, [RES_TPA]
+ ADD DX, BX ; Compute maximum address
+ CMP DX, AX ; Is 64K address out of range?
+ JB NOROUND
+;
+; Make sure that we won't overwrite the transient
+;
+ MOV BX, CS ; CS is beginning of transient
+ CMP BX, AX
+ JB NOROUND
+;
+; The area from the 64K boundary to the beginning of the transient must
+; be at least 64K.
+;
+ SUB BX, AX
+ CMP BX, 4096 ; Size greater than 64K?
+ JAE ROUNDDONE
+
+NOROUND:
+ MOV AX, [RES_TPA]
+
+ROUNDDONE:
+ MOV [LTPA],AX ; Re-compute everything
+ MOV [TPA],AX
+ MOV BX,AX
+ MOV AX,CS
+ SUB AX,BX
+ PUSH BX
+ MOV BX,16
+ MUL BX
+ POP BX
+ OR DX,DX
+ JZ SAVSIZ2
+ MOV AX,-1
+
+SAVSIZ2:
+;
+; AX is the number of bytes free in the buffer between the resident and the
+; transient with a maximum of 64K-1. We round this down to a multiple of 512.
+;
+ CMP AX,512
+ JBE GotSize
+ AND AX,0FE00h ; NOT 511 = NOT 1FF
+
+GotSize:
+ MOV [BYTCNT],AX
+ POP ES
+
+ return
+
+EndProc Alloc_TPA
+
+Break <BatCom - enter a batch file>
+
+;
+; The exec search has determined that the user has requested a batch file for
+; execution. We parse the arguments, create the batch segment, and signal
+; batch processing.
+;
+Procedure BatCom,NEAR
+
+ASSUME DS:TRANGROUP, ES:NOTHING
+
+;
+; Batch parameters are read with ES set to segment of resident part
+;
+
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+ cmp es:[call_batch_flag],call_in_progress ;AN043; If in CALL,
+ jz skip_ioset ;AN043; redirection was already set up
+ invoke IOSET ; Set up any redirection
+
+skip_ioset: ;AN043;
+ CALL FREE_TPA ; G
+ cmp es:[call_batch_flag],call_in_progress ;G
+ jz getecho ; G if we're in a call, don't execute
+;
+; Since BATCH has lower precedence than PIPE or FOR. If a new BATCH file is
+; being started it MUST be true that no FOR or PIPE is currently in progress.
+; Don't execute if in call
+;
+ invoke ForOff
+
+getecho:
+ invoke PipeOff
+ mov al,EchoFlag ; preserve echo state for chaining
+
+ and al, 1 ; Save current echo state
+ push ax
+
+ xor ax,ax ;G
+ test es:[batch],-1 ;G Are we in a batch file?
+ jz leavebat ;G No, nothing to save
+ mov ax,es:[batch] ;G get current batch segment
+ cmp es:[call_batch_flag],call_in_progress ;G
+ jz leavebat ;G
+;
+; We are in a chained batch file, save batlast from previous batch segment
+; so that if we're in a CALL, we will return to the correct batch file.
+;
+ push es ;G
+ mov es,ax ;G get current batch segment
+ mov ax,es:[batlast] ;G get previous batch segment
+ pop es ;G
+
+leavebat: ;G
+ push ax ;G keep segment until new one created
+ cmp es:[call_batch_flag],call_in_progress ;G are we in a CALL?
+ jz startbat ;G Yes, keep current batch segment
+ call BatchOff ;G No, deallocate old batch segment
+
+;
+; Find length of batch file
+;
+
+startbat: ;G
+ ASSUME ES:RESGROUP
+ MOV es:[CALL_BATCH_FLAG], 0 ;G reset call flag
+ mov SI, OFFSET TRANGROUP:EXECPATH
+
+ mov ax,AppendTruename ;AN042; Get the real path where the batch file
+ int 2fh ;AN042; was found with APPEND
+ mov ah,Find_First ;AN042; The find_first will return it
+ mov dx,si ;AN042; Get the string
+ mov cx,search_attr ;AN042; filetypes to search for
+ int 21h ;AN042;
+
+ invoke DStrLen
+;
+; Allocate batch area:
+; BYTE type of segment
+; WORD segment of last batch file
+; WORD segment for FOR command
+; BYTE FOR flag state on entry to batch file
+; DWORD offset for next line
+; 10 WORD pointers to parameters. -1 is empty parameter
+; ASCIZ file name (with . and ..)
+; BYTES CR-terminated parameters
+; BYTE 0 flag to indicate end of parameters
+;
+; We allocate the maximum size for the command line and use setblock to shrink
+; later when we've squeezed out the extra
+;
+
+ MOV BX,CX ; length of file name.
+ ADD BX,0Fh + (SIZE BatchSegment) + COMBUFLEN + 0Fh
+ ; structure + max len + round up
+ SaveReg <CX>
+ MOV CL,4
+ SHR BX,CL ; convert to paragraphs
+ PUSH BX ;G save size of batch segment
+ MOV AH,ALLOC
+ INT 21h ; Allocate batch segment
+ POP BX ;G get size of batch segment
+;
+; This should *NEVER* return an error. The transient is MUCH bigger than
+; the batch segment. This may not be true, however, in a multitasking system.
+; G This error will occur with nesting of batch files. We also need to
+; G make sure that we don't overlay the transient.
+;
+ jc mem_error ;G not enough memory - exit
+ push ax ;G save batch segment
+ add ax,bx ;G get end of batch segment
+ add ax,20h ;G add some tpa work area
+ mov bx,cs ;G get the transient segment
+;
+; M006; We cant check just for above. If the batchseg goes into a UMB, the
+; M006; batchseg is always above the transient. We need to change this code
+; M006; to only check for an overlap
+;
+ mov dx,offset TRANGROUP:TranSpaceEnd ; M006
+ add dx,15 ;round up para; M006
+ shr dx,cl ;para size of transient; M006
+ add dx,bx ;dx = top of transient; M006
+
+ cmp ax,bx ; M006
+ jb enough_mem ; Batchseg below transient
+ ; enough memory ; M006
+ cmp ax,dx ; M006
+ ja enough_mem ; Batchseg above transient
+ ; enough memory ; M006
+;
+; M006; Batchseg overlaps transient -- insufficient memory
+;
+ pop ax ; restore ax; M006
+
+;M006; cmp ax,bx ;G do we end before the transient
+;M006; pop ax ;G get batch segment back
+;M006; jb enough_mem ;G we have enough memory - continue
+
+ push es ;G no we're hitting the transient
+ mov es,ax
+ mov ax,DEALLOC SHL 8 ;G deallocate the batch segment
+ int 21h
+ pop es
+
+mem_error:
+ jmp no_memory ;G Set up for message and exit
+
+enough_mem:
+ pop ax ; restore ax; M006
+
+ MOV [BATCH],AX
+ CALL ALLOC_TPA
+;
+; Initialize batch segment
+;
+ RestoreReg <DX> ; length of name
+ POP AX ;G get saved batch segment back
+ inc es:nest ;G increment # batch files in progress
+ PUSH ES
+ MOV ES,[BATCH]
+ASSUME ES:NOTHING
+ MOV ES:[BatType],BatchType ; signal batch file type
+ MOV ES:[batlast],ax ;G save segment of last batch file
+ push DS ;G
+ mov DS,[resseg] ;G set to resident data
+ASSUME DS:RESGROUP
+ xor ax,ax ;G
+ mov bl,forflag ;G get the current FOR state
+ mov ES:[batforflag],bl ;G save it in the batch segment
+ test bl,-1 ;G are we in a FOR?
+ jz for_not_on ;G no, for segment set to 0
+ mov ax,forptr ;G yes, get current FOR segment
+ mov forflag,0 ;G reset forflag
+
+for_not_on:
+ mov ES:[batforptr],ax ;G save FOR segment in batch segment
+ XOR AX,AX
+ mov forptr,ax ;G make sure for segment is not active
+ mov bl,echoflag ;G
+ pop DS ;G
+
+ mov byte ptr es:[Batechoflag],bl ;G save echo state of parent
+;SR;
+; Initialize the new BatchEOF flag we have added to 0
+;
+ mov es:BatchEOF,0
+
+ MOV WORD PTR ES:[BatSeek],AX ; point to beginning of file
+ MOV WORD PTR ES:[BatSeek+2],AX
+;
+; Initialize pointers
+;
+ DEC AX ; put -1 into AX
+ MOV DI,BatParm ; point to parm area
+ MOV BX,DI
+ MOV CX,10
+ REP STOSW ; Init to no parms
+;
+; Move in batch file name
+;
+ MOV CX,DX
+ rep movsb ; including NUL.
+;
+; Now copy the command line into batch segment, parsing the arguments along
+; the way. Segment will look like this:
+;
+; <arg0>CR<arg1>CR...<arg9>CR<arg10>CR...<ARGn>CR 0
+;
+; or, in the case of fewer arguments:
+;
+; <arg0>CR<arg1>CR...<arg6>CR CR CR ... CR 0
+;
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ MOV CX,10 ; at most 10 arguments
+;
+; Look for beginning of next argument
+;
+EACHPARM:
+ invoke SCANOFF ; skip to argument
+;
+; AL is first non-delimiter. DS:SI points to char = AL
+;
+ CMP AL,0DH ; end of road?
+ JZ HAVPARM ; yes, no more arguments
+;
+; If CX = 0 then we have stored the most parm we can. Skip store
+;
+ JCXZ MOVPARM ; Only first 10 parms get pointers
+;
+; Go into allocated piece and stick in new argument pointer.
+;
+ MOV ES:[BX],DI ; store batch pointer
+ ADD BX,2 ; advance arg counter
+;
+; Move the parameter into batch segment
+;
+MOVPARM:
+ LODSB ; get byte
+ INVOKE DELIM ; if delimiter
+ JZ ENDPARM ; then done with parm
+ STOSB ; store byte
+ CMP AL,0DH ; if CR then not delimiter
+ JZ HAVPARM ; but end of parm list, finish
+ JMP SHORT MOVPARM
+;
+; We have copied a parameter up until the first separator. Terminate it with
+; CR
+;
+
+ENDPARM:
+ MOV AL,0DH
+ STOSB
+ JCXZ EACHPARM ; if no parameters, don't dec
+ DEC CX ; remember that we've seen one.
+ JMP SHORT EACHPARM
+;
+; We have parsed the entire line. Terminate the arg list
+;
+
+HAVPARM:
+ XOR AL,AL
+ STOSB ; Nul terminate the parms
+;
+; Now we know EXACTLY how big the BATCH segment is. Round up size (from DI)
+; into paragraphs and setblock to the appropriate size
+;
+ LEA BX,[DI+15]
+ MOV CL,4
+ SHR BX,CL
+ MOV AH,SetBlock
+ INT 21h
+
+ POP ES
+ASSUME ES:RESGROUP
+ PUSH ES
+ POP DS ; Simply batch FCB setup
+ASSUME DS:RESGROUP
+ CMP [SINGLECOM],-1
+ JNZ NOBATSING
+ MOV [SINGLECOM],0FFF0H ; Flag single command BATCH job
+
+NOBATSING:
+;
+; Enter the batch file with the current echo state
+;
+ pop ax ; Get original echo state
+ mov echoflag,al ;g restore it
+ JMP TCOMMAND
+
+;
+; The following is executed if there isn't enough memory for batch segment
+;
+
+NO_MEMORY:
+ assume ds:trangroup,es:resgroup
+ pop dx ;g even up our stack
+ pop ax ;g
+ pop ax ;g
+ call Alloc_tpa ;g reallocate memory
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,error_not_enough_memory ;AN000; get message number in control block
+ jmp cerror ;g print error message and go...
+
+EndProc BatCom
+
+Procedure BatchOff
+
+ ASSUME DS:NOTHING,ES:NOTHING
+
+ SaveReg <AX,ES>
+ PUSH DS ;G
+ PUSH BX ;G
+ MOV ES,ResSeg
+ MOV DS,ResSeg ;G
+ ASSUME ES:ResGroup,DS:Resgroup ;G
+ MOV AX,Batch ; Free the batch segment
+ OR AX,AX
+ JZ nofree
+
+ PUSH ES
+ MOV ES,AX
+ test [echoflag],1 ;G Is echo on?
+ jnz echo_last_line ;G Yes - echo last line in file
+ mov suppress,no_echo ;G no - don't echo last line in file
+
+echo_last_line:
+ MOV BL,ES:[BATECHOFLAG] ;G Get echo state
+ mov [echoflag],bl ;G and restore it
+ MOV BX,ES:[BATFORPTR] ;G Get FOR segment
+ MOV FORPTR,BX ;G and restore it
+ MOV BL,ES:[BATFORFLAG] ;G Get FOR flag
+ MOV FORFLAG,BL ;G and restore it
+ MOV BX,es:[batlast] ;G get old batch segment
+ MOV AH,DEALLOC
+ INT 21h
+ POP ES
+ MOV Next_BATCH,BX ;G reset batch segment
+ DEC es:NEST ;G
+
+ XOR AX,AX
+ MOV Batch,AX ; No batch in progress
+
+NoFree:
+ POP BX ;G
+ pop ds ;G
+ RestoreReg <ES,AX>
+
+ return
+
+EndProc BatchOff
+
+
+; StrCpy - copy string, checking count in CX against COMBUFLEN
+; Entry : DS:SI ==> source string
+; ES:DI ==> destination string
+; CX = current length of destination string
+; Exit : string copied, CX updated, Carry set if length limit exceeded
+Procedure StrCpy,NEAR
+ push ax
+ccycle:
+ lodsb
+ inc cx
+ cmp cx,COMBUFLEN
+ jb ccopy
+ stc ; set carry to signal error
+ jmp short ccend
+ccopy:
+ stosb
+ or al,al
+ jnz ccycle
+
+ccend:
+ dec cx ; discount extra byte
+ dec di ; back up pointer
+ pop ax
+ return ; return carry clear
+EndProc StrCpy
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tbatch2.asm b/private/mvdm/dos/v86/cmd/command/tbatch2.asm
new file mode 100644
index 000000000..b21546044
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tbatch2.asm
@@ -0,0 +1,962 @@
+ page ,132
+; SCCSID = @(#)tbatch2.asm 4.2 85/07/22
+; SCCSID = @(#)tbatch2.asm 4.2 85/07/22
+TITLE Batch processing routines part II
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M020 SR 08/20/89 Changed GetBatByt to check if we
+; already reached EOF before trying
+; to read from batchfile. Also fixed
+; old bug of ds not being setup on an
+; error while reading the batchfile.
+;
+; M037 SR 11/1/90 Bug #1745 & #3438 fixed. On a GOTO, we
+; reseek to the beginning of the
+; batchfile. Clear the BatchEOF flag
+; to indicate that we are no longer at
+; EOF.
+;
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BATCH:WORD
+ EXTRN Batch_Abort:byte
+ EXTRN call_batch_flag:byte
+ EXTRN call_flag:byte
+ EXTRN IFFlag:BYTE
+ EXTRN In_Batch:byte
+ EXTRN Nest:word
+ EXTRN PIPEFILES:BYTE
+ EXTRN RETCODE:WORD
+ EXTRN SINGLECOM:WORD
+
+;;; extrn BatchEOF:byte
+ extrn EchoFlag:byte
+ extrn Next_Batch:word
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BADLAB_PTR:WORD
+ EXTRN BatBufLen:WORD
+ EXTRN IFTAB:BYTE
+ EXTRN SYNTMES_PTR:WORD
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+ EXTRN BatBuf:BYTE
+ EXTRN BatBufEnd:WORD
+ EXTRN BatBufPos:WORD
+ EXTRN BATHAND:WORD
+ EXTRN COMBUF:BYTE
+ EXTRN DIRBUF:BYTE
+ EXTRN GOTOLEN:WORD
+ EXTRN if_not_count:word
+ EXTRN IFNOTFLAG:BYTE
+ EXTRN RESSEG:WORD
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN cerror:near
+ EXTRN docom1:near
+ EXTRN tcommand:near
+
+ public $if,iferlev,goto,shift,ifexists,ifnot,forerror,$call
+
+
+Break <GetBatByt - retrieve a byte from the batch file>
+
+; Get one byte from the batch file and return it in AL. End-of-file returns
+; <CR> and ends batch mode. DS must be set to resident segment.
+; AH, DX destroyed.
+
+Procedure GETBATBYT,NEAR
+
+ASSUME DS:RESGROUP
+
+ SaveReg <BX,CX,DS>
+ test byte ptr [Batch_Abort],-1
+ jz @f
+ jmp BatEOF
+@@:
+ TEST Batch,-1
+ JnZ @f
+ jmp BatEOF
+@@:
+ PUSH ES
+ MOV ES,Batch
+ ASSUME ES:NOTHING
+
+;M020;
+;Check if we have already reached EOF (BatchEOF flag set. Then, we do not
+;try to read from the batchfile again.
+;
+ cmp es:BatchEOF,0 ;already reached EOF? ;M020
+ jz not_eof ;no, read batch file ;M020
+ jmp At_EOF ;yes, no more reads ;M020
+not_eof: ;M020
+
+ ADD WORD PTR ES:[BatSeek],1
+ ADC WORD PTR ES:[BatSeek+2],0
+ POP ES
+;
+; See if we have bytes buffered...
+;
+ MOV AX,CS
+ MOV DS,AX
+ ASSUME DS:TranGroup
+ MOV BX,BatBufPos
+ CMP BX,-1
+ JNZ UnBuf
+;
+; There are no bytes in the buffer. Let's try to fill it up.
+;
+ MOV DX,OFFSET TranGROUP:BatBuf
+ MOV CX,BatBufLen ; max to read.
+ MOV BX,BatHand
+ MOV AH,READ
+ INT 21h ; Get one more byte from batch file
+ jnc bat_read_ok ;AN022; if no error - continue
+ invoke get_ext_error_number ;AN022; get the error
+ push ds ;AN022; save local segment
+ mov ds,[resseg] ;AN022; get resident segment
+assume ds:resgroup ;AN022;
+ mov dx,ax ;AN022; put error in DX
+ invoke output_batch_name ;AN022; set up to print the error
+ pop ds ;AN022;
+assume ds:trangroup ;AN022;
+ invoke std_eprintf ;AN022; print out the error
+ mov byte ptr combuf+2,end_of_line_in;AN022; terminate the batch line for parsing
+ mov byte ptr combuf+3,end_of_line_out ;AN022; terminate the batch line for output
+;M020;
+;Old bug! We jump to BatEof from here without ds=RESGROUP. Probably, this
+;error is never hit (and it shouldn't be)
+;
+ mov ds,ResSeg ; ds = RESGROUP ; M020
+
+ jmp short bateof ;AN022; terminate the batch file
+
+bat_read_ok: ;AN022;
+ MOV CX,AX
+ JCXZ BATEOFDS
+ MOV BatBufEnd,CX
+ XOR BX,BX
+ MOV BatBufPos,BX
+;
+; Buffered bytes!
+;
+UnBuf:
+ MOV AL,BatBuf[BX] ; get next byte
+ INC BX
+ CMP BX,BatBufEnd ; beyond end of buffer?
+ JB SetBufPos
+ MOV BX,-1
+
+SetBufPos:
+ MOV BatBufPos,BX
+ CMP AL,1AH ; ^Z for termination?
+ jnz GetByteDone
+;
+;We get here only when we hit an EOF
+;
+BatEOFDS:
+;SR;
+; HACK!!! A massive hack being put in here to get batch processing to work
+;properly on EOF. Previously, a CR was returned and batch processing turned
+;off the moment we hit an EOF. Unfortunately, if the last line had no CR-LF,
+;batch processing is turned off before the last line is processed and so
+;this line would never be executed.
+; To fix this, a new flag BatchEOF has been introduced. This flag is
+;set to 4 if there is no CR-LF before the EOF -- this is determined by looking
+;at the buffer contents. If there is no LF ( we assume that presence of LF
+;indicated a CR-LF combination), then we set BatchEOF to 4 and return a
+;fake CR to the caller. This decrements BatchEOF. On the next call to this
+;routine, BatchEOF is decremented to 2 and a fake lF is returned. On the
+;third call, BatchEOF becomes zero and batch processing is turned off,
+;now that the last line has been processed. If the EOF is the first char read into the buffer
+;during this call, and there was a CR-LF previously, we are going to fake
+;another redundant CR-LF. There is no work-around I can think of.
+; I would love to restructure this entire routine and its caller to
+;make the flow really easy to understand but I guess this will have to wait.
+;
+ push es
+ mov es,ResSeg
+;SR;
+; If we had already set the BatchEOF flag on a previous call (BatchEOF == 2
+;or BatchEOF == 1 now), then do not do the LF check.
+;
+ mov es,es:Batch
+ cmp es:BatchEOF,0
+ jnz crpresent
+
+ inc es:BatchEOF ;match the dec following
+ mov bx,BatBufEnd
+ cmp BatBuf[bx-1],0ah ;was a LF present?
+ je crpresent ;yes, no need to fake it
+
+ add es:BatchEOF,3 ;BatchEOF == 4 to fake CR-LF
+
+crpresent:
+;;; pop es
+
+ ASSUME DS:TranGroup
+ MOV DS,ResSeg
+ ASSUME DS:ResGroup
+
+;SR;
+; The shift operation is done here to replace the decrement. This is because
+;we can jump to this label directly from above when bogus calls are made to
+;this routine even after batch processing is turned off. The shift ensures
+;maintains the following invariance : 4 -> 2; 2 -> 1 ; 1 -> 0; 0 -> 0. Thus,
+;it is used as a decrement and also as a NOP to just fall through on bogus
+;calls.
+; We turn batch processing off if BatchEOF == 1 or BatchEOF == 0.
+;BatchEOF == 1 when we fall through from BatEOFDS and BatchEOF == 0 on a
+;direct jump to BATEOF. If BatchEOF == 4, we return a fake CR-LF without
+;turning batch processing off.
+;
+At_EOF: ;new label added ;M020
+ shr es:BatchEOF,1 ;decrement the flag
+ jz turn_off ;zero,turn batch off
+ cmp es:BatchEOF,1
+ jz ret_lf ;BatchEOF was 2, return LF
+;
+;BatchEOF == 4, indicates return fake CR now and fake LF next.
+;
+ mov al,0dh ;return fake CR.
+ pop es
+ jmp short GetByteDone
+ret_lf:
+ mov al,0ah ;return fake LF
+ pop es
+ jmp short GetByteDone
+turn_off:
+ pop es
+
+BATEOF:
+ invoke BatchOff ;turn batch processing off
+ CALL BATCLOSE
+;;; mov BatchEOF,0 ;make sure BatchEOF = 0
+
+;SR; BugBug
+; There is a good reason why this carriage return is being returned here.
+;This was part of the old code, thanks to some brain-damaged coding. Because,
+;of the way the caller is structured, a fake CR has to be returned again on
+;EOF to ensure the termination of the caller's loop. If echo is on, this
+;results in an extra linefeed after the batchfile is run if the last line of
+;the batchfile already had a CR-LF.
+;NB: Do not confuse this with the faked CR. The fake CR-LF was to mark
+;the end-of-line. This CR is to mark the end-of-file.
+;
+ MOV AL,0dH ; If end-of-file, then end of line
+
+ test byte ptr [Batch_Abort],-1
+ mov byte ptr [Batch_Abort],0
+ jz Cont_Get_Byt
+ mov di,offset TRANGROUP:COMBUF+2 ; reset pointer to beginning of buffer
+ xor cx,cx ; zero line length
+ jmp short GetByteDone
+
+Cont_Get_Byt:
+ CMP [SINGLECOM],0FFF0H ; See if we need to set SINGLECOM
+ JNZ GetByteDone
+ CMP NEST,0 ;G See if we have nested batch files
+ JNZ GETBYTEDONE ;G Yes - don't exit just yet
+ MOV [SINGLECOM],-1 ; Cause termination
+
+GetByteDone:
+ RestoreReg <DS,CX,BX>
+
+ return
+
+EndProc GetBatByt
+
+ break <$If - conditional execution>
+assume ds:trangroup,es:trangroup
+
+IFERRORP:
+ POP AX
+IFERROR:
+FORERROR:
+ MOV DX,OFFSET TRANGROUP:SYNTMES_ptr
+ JMP CERROR
+
+$IF:
+;
+; Turn off any pipes in progress.
+;
+ push ds ;AN004; save local DS
+ mov ds,[resseg] ;AN004; get resident segment
+ assume ds:resgroup ;AN004;
+ cmp [PIPEFILES],0 ;AN004; Only turn off if present.
+ jz IFNoPipe ;AN004; no pipe - continue
+ invoke PipeDel ;AN004; turn off piping
+
+IFNoPipe: ;AN004;
+ pop ds ;AN004; get local DS back
+ assume ds:trangroup ;AN004;
+ MOV [IFNOTFLAG],0
+ mov [if_not_count], 0
+ MOV SI,81H
+
+IFREENT:
+ invoke SCANOFF
+ CMP AL,0DH
+ JZ IFERROR
+ MOV BP,SI
+ MOV DI,OFFSET TRANGROUP:IFTAB ; Prepare to search if table
+ MOV CH,0
+
+IFINDCOM:
+ MOV SI,BP
+ MOV CL,[DI]
+ INC DI
+ JCXZ IFSTRING
+ JMP SHORT FIRSTCOMP
+
+IFCOMP:
+ JNZ IF_DIF ;AC000;
+
+FIRSTCOMP:
+ LODSB
+ MOV AH,ES:[DI]
+ INC DI
+ CMP AL,AH
+ JZ IFLP
+ OR AH,20H ; Try lower case
+ CMP AL,AH
+
+IFLP:
+ LOOP IFCOMP
+
+IF_DIF: ;AC000;
+ LAHF
+ ADD DI,CX ; Bump to next position without affecting flags
+ MOV BX,[DI] ; Get handler address
+ INC DI
+ INC DI
+ SAHF
+ JNZ IFINDCOM
+ LODSB
+ CMP AL,0DH
+
+IFERRORJ:
+ JZ IFERROR
+ invoke DELIM
+ JNZ IFINDCOM
+ invoke SCANOFF
+ JMP BX
+
+IFNOT:
+ NOT [IFNOTFLAG]
+ inc [if_not_count]
+ JMP IFREENT
+
+;
+; We are comparing two strings for equality. First, find the end of the
+; first string.
+;
+
+IFSTRING:
+ PUSH SI ; save away pointer for later compare
+ XOR CX,CX ; count of chars in first string
+
+FIRST_STRING:
+ LODSB ; get character
+ CMP AL,0DH ; end of line?
+ JZ IFERRORP ; yes => error
+ invoke DELIM ; is it a delimiter?
+ JZ EQUAL_CHECK ; yes, go find equal sign
+ INC CX ; remember 1 byte for the length
+ JMP FIRST_STRING ; go back for more
+;
+; We have found the end of the first string. Unfortunately, we CANNOT use
+; scanoff to find the next token; = is a valid separator and will be skipped
+; over.
+;
+
+EQUAL_CHECK:
+ CMP AL,'=' ; is char we have an = sign?
+ JZ EQUAL_CHECK2 ; yes, go find second one.
+ CMP AL,0DH ; end of line?
+ JZ IFERRORPj ;AC004; yes, syntax error
+ LODSB ; get next char
+ JMP EQUAL_CHECK
+;
+; The first = has been found. The next char had better be an = too.
+;
+
+EQUAL_CHECK2:
+ LODSB ; get potential = char
+ CMP AL,'=' ; is it good?
+ jnz iferrorpj ; no, error
+;
+; Find beginning of second string.
+;
+ invoke SCANOFF
+ CMP AL,0DH
+ jz iferrorpj
+ POP DI
+;
+; DS:SI points to second string
+; CX has number of chars in first string
+; ES:DI points to first string
+;
+; Perform compare to elicit match
+;
+ REPE CMPSB
+ JZ MATCH ; match found!
+;
+; No match. Let's find out what was wrong. The character that did not match
+; has been advanced over. Let's back up to it.
+;
+ DEC SI
+;
+; If it is EOL, then syntax error
+;
+ CMP BYTE PTR [SI],0DH
+ JZ IFERRORJ
+;
+; Advance pointer over remainder of unmatched text to next delimiter
+;
+
+SKIPSTRINGEND:
+ LODSB
+
+NOTMATCH:
+ CMP AL,0DH
+
+IFERRORJ2:
+ JZ IFERRORJ
+ invoke DELIM
+ JNZ SKIPSTRINGEND
+;
+; Signal that we did NOT have a match
+;
+ MOV AL,-1
+ JMP SHORT IFRET
+
+iferrorpj:
+ jmp iferrorp
+;
+; The compare succeeded. Was the second string longer than the first? We
+; do this by seeing if the next char is a delimiter.
+;
+
+MATCH:
+ LODSB
+ invoke DELIM
+ JNZ NOTMATCH ; not same.
+ XOR AL,AL
+ JMP SHORT IFRET
+
+IFEXISTS:
+ifexist_attr EQU attr_hidden+attr_system
+
+moredelim:
+ lodsb ; move command line pointer over
+ invoke delim ; pathname -- have to do it ourselves
+ jnz moredelim ; 'cause parse_file_descriptor is dumb
+ mov DX, OFFSET TRANGROUP:dirbuf
+ trap set_dma
+ mov BX, 2 ; if(0) [|not](|1) exist[1|2] file(2|3)
+ add BX, [if_not_count]
+ mov AX, OFFSET TRANGROUP:arg.argv
+ invoke argv_calc ; convert arg index to pointer
+ mov DX, [BX].argpointer ; get pointer to supposed filename
+ mov CX, ifexist_attr ; filetypes to search for
+ trap Find_First ; request first match, if any
+ jc if_ex_c ; carry is how to determine error
+ xor AL, AL
+ jmp short ifret
+
+if_ex_c:
+ mov AL, -1 ; false 'n' fall through...
+
+IFRET:
+ TEST [IFNOTFLAG],-1
+ JZ REALTEST
+ NOT AL
+
+REALTEST:
+ OR AL,AL
+ JZ IFTRUE
+ JMP TCOMMAND
+
+IFTRUE:
+ invoke SCANOFF
+ MOV CX,SI
+ SUB CX,81H
+ SUB DS:[80H],CL
+ MOV CL,DS:[80H]
+ MOV [COMBUF+1],CL
+ MOV DI,OFFSET TRANGROUP:COMBUF+2
+ CLD
+ REP MOVSB
+ MOV AL,0DH
+ STOSB
+;
+; Signal that an IF was done. This prevents the redirections from getting
+; lost.
+;
+ PUSH DS
+ MOV DS,ResSeg
+ ASSUME DS:RESGROUP
+ MOV IFFlag,-1
+ POP DS
+ ASSUME DS:TRANGROUP
+;
+; Go do the command
+;
+ JMP DOCOM1
+
+iferrorj3:
+ jmp iferrorj2
+
+IFERLEV:
+ MOV BH,10
+ XOR BL,BL
+
+GETNUMLP:
+ LODSB
+ CMP AL,0DH
+ jz iferrorj3
+ invoke DELIM
+ JZ GOTNUM
+ SUB AL,'0'
+ XCHG AL,BL
+ MUL BH
+ ADD AL,BL
+ XCHG AL,BL
+ JMP SHORT GETNUMLP
+
+GOTNUM:
+ PUSH DS
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV AH,BYTE PTR [RETCODE]
+ POP DS
+ASSUME DS:TRANGROUP
+ XOR AL,AL
+ CMP AH,BL
+ JAE IFRET
+ DEC AL
+ JMP SHORT IFRET
+
+
+ break <Shift - advance arguments>
+
+;
+; Shift the parameters in the batch structure by 1 and set up the new argument.
+; This is a NOP if no batch in progress.
+;
+
+Procedure Shift,NEAR
+
+assume ds:trangroup,es:trangroup
+
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV AX,[BATCH] ; get batch pointer
+ OR AX,AX ; in batch mode?
+ retz ; no, done.
+ MOV ES,AX ; operate in batch segment
+ MOV DS,AX
+
+ASSUME DS:NOTHING,ES:NOTHING
+
+;
+; Now move the batch args down by 1 word
+;
+ MOV DI,BatParm ; point to parm table
+ LEA SI,[DI+2] ; make source = dest + 2
+ MOV CX,9 ; move 9 parameters
+ REP MOVSW ; SHIFT down
+;
+; If the last parameter (the one not moved) is empty (= -1) then we are done.
+; We have copied it into the previous position
+;
+ CMP WORD PTR [DI],-1 ; if last one was not in use then
+ retz ; No new parm
+;
+; This last pointer is NOT nul. Get it and scan to find the next argument.
+; Assume, first, that there is no next argument
+;
+ MOV SI,[DI]
+ MOV WORD PTR [DI],-1 ; Assume no parm
+;
+; The parameters are CR separated. Scan for end of this parm
+;
+SKIPCRLP:
+ LODSB
+ CMP AL,0DH
+ JNZ SKIPCRLP
+;
+; We are now pointing at next arg. If it is 0 (end of original line) then we
+; are finished. There ARE no more parms and the pointer has been previously
+; initialized to indicate it.
+;
+ CMP BYTE PTR [SI],0
+ retz ; End of parms
+ MOV [DI],SI ; Pointer to next parm as %9
+
+ return
+
+EndProc Shift
+
+;
+; Skip delim reads bytes from the batch file until a non-delimiter is seen.
+; returns char in AL, carry set -> eof
+;
+
+Procedure SkipDelim,NEAR
+
+ ASSUME DS:ResGroup,ES:NOTHING
+ TEST Batch,-1
+ JZ SkipErr ; batch file empty. OOPS!
+ CALL GetBatByt ; get a char
+ invoke Delim ; check for ignoreable chars
+ JZ SkipDelim ; ignore this char.
+ clc
+ return
+
+SkipErr:
+ stc
+ return
+
+EndProc SkipDelim
+
+ break $Call
+
+; CALL is an internal command that transfers control to a .bat, .exe, or
+; .com file. This routine strips the CALL off the command line, sets
+; the CALL_FLAG to indicate a call in progress, and returns control to
+; DOCOM1 in TCODE to reprocess the command line and execute the file
+; being CALLed.
+
+$CALL:
+
+; strip off CALL from command line
+
+ ASSUME DS:trangroup,ES:trangroup
+ push si
+ push di
+ push ax
+ push cx
+ mov si,offset trangroup:combuf+2
+ invoke scanoff ;get to first non-delimeter
+ add si,length_call ;point to char past CALL
+ mov di,offset trangroup:combuf+2
+ mov cx,combuflen-length_call ;get length of buffer
+ rep movsb ;move it
+ pop cx
+ pop ax
+ pop di
+ pop si
+
+
+; set call flag to indicate call in progress
+
+ push ds
+ mov ds,[resseg]
+ ASSUME DS:resgroup,ES:resgroup
+ mov call_flag, call_in_progress
+ mov call_batch_flag, call_in_progress
+;
+; Turn off any pipes in progress.
+;
+ cmp [PIPEFILES],0 ; Only turn off if present.
+ jz NoPipe
+ invoke PipeDel
+NoPipe:
+ pop ds
+
+ ret
+
+ break Goto
+
+GOTO:
+
+ assume ds:trangroup,es:trangroup
+ MOV DS,[RESSEG]
+ assume ds:resgroup
+ TEST [BATCH],-1
+ retz ; If not in batch mode, a nop
+ XOR DX,DX
+ PUSH DS
+ MOV DS,Batch
+ MOV WORD PTR DS:[BatSeek],DX ; Back to start
+ MOV WORD PTR DS:[BatSeek+2],DX ; Back to start
+;M037
+; Clear EOF indicator because we have reseeked to the beginning of the file.
+;
+ mov ds:BatchEOF,0 ; clear eof indicator ;M037
+
+ POP DS
+
+GotoOpen:
+ invoke promptBat
+ MOV DI,FCB+1 ; Get the label
+ MOV CX,11
+ MOV AL,' '
+ REPNE SCASB
+ JNZ NOINC
+ INC CX
+
+NOINC:
+ SUB CX,11
+ NEG CX
+ MOV [GOTOLEN],CX
+;
+; At beginning of file. Skip to first non-delimiter char
+;
+ CALL SkipDelim
+ JC BadGoto
+ CMP AL,':'
+ JZ CHKLABEL
+
+LABLKLP: ; Look for the label
+ CALL GETBATBYT
+ CMP AL,0AH
+ JNZ LABLKTST
+;
+; At beginning of line. Skip to first non-delimiter char
+;
+ CALL SkipDelim
+ JC BadGoto
+ CMP AL,':'
+ JZ CHKLABEL
+
+LABLKTST:
+ TEST [BATCH],-1
+ JNZ LABLKLP
+
+BadGoto:
+ CALL BATCLOSE
+;SR;
+; At this point we are terminating without freeing up any nested batch
+;segments i.e if the error occurred within a called batch file. This routine
+;will traverse the linked list of batch segments and free all of them.
+;
+ call free_batch ;free up nested batch segments
+
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET TRANGROUP:BADLAB_ptr
+ JMP CERROR
+
+;
+; Found the :. Skip to first non-delimiter char
+;
+
+CHKLABEL:
+ CALL SkipDelim
+ JC BadGoto
+ MOV DI,FCB+1
+ MOV CX,[GOTOLEN]
+ JMP SHORT GotByte
+
+NEXTCHRLP:
+ PUSH CX
+ CALL GETBATBYT
+ POP CX
+
+GotByte:
+ INVOKE TESTKANJ ;AN000; 3/3/KK
+ JZ NOTKANJ1 ;AN000; 3/3/KK
+ CMP AL, ES:[DI] ;AN000; 3/3/KK
+ JNZ LABLKTST ;AN000; 3/3/KK
+ INC DI ;AN000; 3/3/KK
+ DEC CX ;AN000; 3/3/KK
+ JCXZ LABLKTST ;AN000; 3/3/KK
+ PUSH CX ;AN000; 3/3/KK
+ CALL GETBATBYT ;AN000; 3/3/KK
+ POP CX ;AN000; 3/3/KK
+ CMP AL, ES:[DI] ;AN000; 3/3/KK
+ JMP SHORT KNEXTLABCHR ;AN000; 3/3/KK
+
+NOTKANJ1: ;AN000; 3/3/KK
+ OR AL,20H
+ CMP AL,ES:[DI]
+ JNZ TRYUPPER
+ JMP SHORT NEXTLABCHR
+
+TRYUPPER:
+ SUB AL,20H
+ CMP AL,ES:[DI]
+
+KNEXTLABCHR: ;AN000; 3/3/KK
+ JNZ LABLKTST
+
+NEXTLABCHR:
+ INC DI
+ LOOP NEXTCHRLP
+ CALL GETBATBYT
+ cmp [GOTOLEN],8 ; Is the label atleast 8 chars long?
+ jge gotocont ; Yes, then the next char doesn't matter
+ CMP AL,' '
+ JA LABLKTST
+
+gotocont:
+ CMP AL,0DH
+ JZ SKIPLFEED
+
+TONEXTBATLIN:
+ CALL GETBATBYT
+ CMP AL,0DH
+ JNZ TONEXTBATLIN
+
+SKIPLFEED:
+ CALL GETBATBYT
+
+;SR;
+; The BatchEOF flag is set in GetBatByt to indicate that we are faking a
+;CR-LF for the last line. On a goto, this flag has to be cleared, because
+;BatchEOF == 1 now, after returning a CR-LF. The next call to GetBatByt
+;to get the EOF has not been made yet because we encountered the Goto. On
+;all other cases, EOF will be hit while trying to read the next line and
+;we are fine. I know, I know, what a massive hack from hell!! God help us!!
+;
+ push es
+ mov es,Batch
+ mov es:BatchEOF,0 ;invalidate fake CR-LF flag
+ pop es
+ CALL BatClose
+
+ return
+
+Procedure BatClose,NEAR
+ assume ds:resgroup
+
+ MOV BX,CS:[BATHAND]
+ CMP BX,5
+ JB CloseReturn
+ MOV AH,CLOSE
+ INT 21h
+
+CloseReturn:
+ mov byte ptr [In_Batch],0 ; reset flag
+ return
+
+EndProc BatClose
+
+;
+; Open the BATCH file, If open fails, AL is drive of batch file (A=1)
+; Also, fills internal batch buffer. If access denied, then AX = -1
+;
+
+Procedure BatOpen,NEAR
+
+ASSUME DS:RESGROUP,ES:TRANGROUP
+
+ PUSH DS
+ MOV DS,[BATCH]
+ASSUME DS:NOTHING
+
+ MOV DX,BatFile
+ MOV AX,OPEN SHL 8
+ INT 21h ; Open the batch file
+ JC SETERRDL
+ MOV DX,WORD PTR DS:[BatSeek]
+ MOV CX,WORD PTR DS:[BatSeek+2]
+ POP DS
+ASSUME DS:RESGROUP
+
+ MOV [BATHAND],AX
+ MOV BX,AX
+ MOV AX,LSEEK SHL 8 ; Go to the right spot
+ INT 21h
+ MOV BatBufPos,-1 ; nuke batch buffer position
+
+ return
+
+SETERRDL:
+ MOV BX,DX
+ invoke get_ext_error_number ;AN022; get the extended error
+ mov dx,ax ;AN022; save extended error in DX
+ MOV AL,[BX] ; Get drive spec
+ SUB AL,'@' ; A = 1
+ POP DS
+ STC ; SUB mucked over carry
+
+ return
+
+EndProc BatOpen
+
+
+;
+;Free_batch : This routine traverses the linked batch segments freeing all
+;the batch and FOR segments until all of them are freed. It also restores
+;the old state of the EchoFlag.
+;
+; ENTRY: ds = RESGROUP
+;
+; EXIT: All batch & FOR segments freed.
+; EchoFlag restored to old state before batch process.
+;
+; REGISTERS AFFECTED: bx, cx
+
+
+free_batch proc near
+ assume ds:RESGROUP,es:nothing
+
+ push es
+ mov bx,Next_Batch
+ or bx,bx
+ jz fb_ret
+
+ClearBatch:
+ mov es,bx ; get batch segment
+
+ mov bx,es:BatForPtr ; get old FOR segment
+ cmp bx,0 ; is a FOR in progress
+ je no_bat_for ; no - don't deallocate
+ push es ;
+ mov es,bx ; yes - free it up...
+ mov ah,DEALLOC ;
+ int 21h ;
+ pop es ; restore to batch segment
+
+No_Bat_For:
+ mov cl,es:BatEchoFlag ; get old echo flag
+ mov bx,es:BatLast ; get old batch segment
+ mov ah,DEALLOC ; free it up...
+ int 21h
+ mov Batch,bx ; get ready to deallocate next batch
+ dec nest ; is there another batch file?
+ jnz ClearBatch ; keep going until no batch file
+
+ mov EchoFlag,cl ;restore echo status
+ mov Batch,0 ;no batch process in progress
+
+fb_ret:
+ pop es
+ ret
+
+free_batch endp
+
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tcmd1a.asm b/private/mvdm/dos/v86/cmd/command/tcmd1a.asm
new file mode 100644
index 000000000..1b844210f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tcmd1a.asm
@@ -0,0 +1,596 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+************************************************************
+************************************************************
+** **
+** THIS FILE IS OBSOLETE, NO LONGER USED, DEFUNCT, **
+** AND, IN FACT, DOESN'T EVEN EXIST. YOU ARE NOT **
+** HERE. YOU MAY NOT BE ANYWHERE AT ALL. THIS **
+** WHOLE THING COULDN'T POSSIBLY BE HAPPENING. **
+** **
+** See DIR.ASM for a reality check. **
+** **
+************************************************************
+************************************************************
+
+ page 80,132
+; SCCSID = @(#)tcmd1a.asm 1.1 85/05/14
+; SCCSID = @(#)tcmd1a.asm 1.1 85/05/14
+TITLE PART4 COMMAND Transient routines.
+
+; Internal commands DIR,PAUSE,ERASE,TYPE,VOL,VER
+
+ INCLUDE comsw.asm
+.xlist
+.xcref
+ INCLUDE DOSSYM.INC
+ INCLUDE comseg.asm
+ INCLUDE comequ.asm ;AC000;
+ include ioctl.inc ;AN000;
+.list
+.cref
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BadCD_ptr:word
+ EXTRN bits:word
+ EXTRN Bytmes_ptr:word
+ EXTRN comsw:word
+ EXTRN dir_w_syn:word ;AC000;
+ EXTRN dirdat_mo_day:word ;AC000;
+ EXTRN dirdat_yr:word ;AC000;
+ EXTRN dirdattim_ptr:word
+ EXTRN dirhead_ptr:word
+ EXTRN dirtim_hr_min:word ;AC000;
+ EXTRN Dirmes_ptr:word
+ EXTRN disp_file_size_ptr:word
+ EXTRN Dmes_ptr:word
+ EXTRN Extend_buf_ptr:word ;AN000;
+ EXTRN msg_disp_class:byte ;AN000;
+ EXTRN parse_dir:byte ;AC000;
+ EXTRN slash_p_syn:word ;AC000;
+ EXTRN string_buf_ptr:word
+ EXTRN tab_ptr:word ;AC000;
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN bytes_free:word
+ EXTRN charbuf:byte
+ EXTRN COM:byte
+ EXTRN Destisdir:byte
+ EXTRN Desttail:word
+ EXTRN dir_num:word
+ EXTRN Dirbuf:byte
+ EXTRN dirflag:byte ;AN015;
+ EXTRN display_ioctl:word ;AC000;
+ EXTRN display_mode:byte ;AC000;
+ EXTRN filecnt:word
+ EXTRN file_size_high:word
+ EXTRN file_size_low:word
+ EXTRN fullscr:word
+ EXTRN ID:byte
+ EXTRN lincnt:byte ;AC000;
+ EXTRN linlen:byte
+ EXTRN linperpag:word ;AC000;
+ EXTRN msg_numb:word ;AN022;
+ EXTRN parse1_addr:dword ;AC000;
+ EXTRN parse1_syn:word ;AC000;
+ EXTRN parse1_type:byte ;AC000;
+ EXTRN pathcnt:word ;AN000;
+ EXTRN pathpos:word ;AN000;
+ EXTRN srcbuf:byte ;AC000;
+ EXTRN string_ptr_2:word
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+TRANSPACE ENDS
+;---------------
+
+ EXTRN cerror:near
+ EXTRN std_printf:near
+
+
+ PUBLIC catalog
+
+
+ break Catalog - Directory command
+assume ds:trangroup,es:trangroup
+
+;
+; The DIR command displays the contents of a directory.
+;
+; ****************************************************************
+; *
+; * ROUTINE: CATALOG - display file(s) in directory
+; *
+; * FUNCTION: PARSE command line for drive, file, or path name.
+; * DIR allows two switches, /P (pause) and /W (wide).
+; * If an error occurs issue and error message and
+; * transfer control to CERROR.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+CATALOG:
+
+;
+; Set up DTA for dir search firsts
+;
+ mov dx,offset trangroup:Dirbuf ;AC000; Set Disk transfer address
+ mov ah,Set_DMA ;AC000;
+ int int_command ;AC000;
+;
+; Set up defaults for switches and parse the command line.
+;
+ mov msg_numb,0 ;AN022; initialize message flag
+ mov di,offset trangroup:srcbuf ;AN000; get address of srcbuf
+ mov [pathpos],di ;AN000; this is start of path
+ mov [pathcnt],1 ;AN000; initialize length to 1 char
+ mov al,star ;AN000; initialize srcbuf to *,0d
+ stosb ;AN000;
+ mov al,end_of_line_in ;AN000;
+ stosb ;AN000;
+ mov si,81H ;AN000; Get command line
+ mov di,offset trangroup:parse_dir ;AN000; Get adderss of PARSE_DIR
+ xor cx,cx ;AC000; clear counter for positionals
+ mov ComSw,cx ;AC000; initialize flags
+ mov bits,cx ;AC000; initialize switches
+ mov linperpag,linesperpage ;AC000; Set default for lines per page
+ mov linlen,normperlin ;AC000; Set number of entries per line
+ mov lincnt,normperlin ;AC000;
+
+dirscan:
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,end_of_line ;AN000; are we at end of line?
+ jne dirscan_cont ;AN000; No - continue parsing
+ jmp scandone ;AN000; yes - go process
+
+dirscan_cont:
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jz dirscan_cont2 ;AN000; No - continue parsing
+ jmp badparm ;AN000; yes - exit
+
+dirscan_cont2:
+ cmp parse1_syn,offset trangroup:dir_w_syn ;AN000; was /W entered?
+ je set_dir_width ;AN000; yes - go set wide lines
+ cmp parse1_syn,offset trangroup:slash_p_syn ;AN000; was /P entered?
+ je set_dir_pause ;AN000; yes - go set pause at end of screen
+;
+; Must be filespec since no other matches occurred. move filename to srcbuf
+;
+ push si ;AC000; save position in line
+ lds si,parse1_addr ;AC000; get address of filespec
+ push si ;AN000; save address
+ invoke move_to_srcbuf ;AC000; move to srcbuf
+ pop dx ;AC000; get address in DX
+
+;
+; The user may have specified a device. Search for the path and see if the
+; attributes indicate a device.
+;
+ mov ah,Find_First ;AC000; find the file
+ int int_command ;AC000;
+ jnc Dir_check_device ;AN022; if no error - check device
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_no_more_files ;AN022; was error no file found
+ jz Dir_fspec_end ;AC022; yes -> obviously not a device
+ cmp ax,error_path_not_found ;AN022; was error no file found
+ jz Dir_fspec_end ;AC022; yes -> obviously not a device
+ jmp dir_err_setup ;AN022; otherwise - go issue error message
+
+dir_check_device: ;AN022;
+ test byte ptr (DirBuf+find_buf_attr),attr_device ;AC000;
+ jz Dir_fspec_end ;AC000; no, go do normal operation
+ mov ComSw,-2 ;AC000; signal device
+
+dir_fspec_end:
+ pop si ;AC000; restore position in line
+ jmp short dirscan ;AC000; keep parsing
+
+set_dir_width:
+ test byte ptr[bits],SwitchW ;AN018; /W already set?
+ jz ok_set_width ;AN018; no - okay to set width
+ mov ax,moreargs_ptr ;AN018; set up too many arguments
+ invoke setup_parse_error_msg ;AN018; set up an error message
+ jmp badparm ;AN018; exit
+
+ok_set_width:
+ or bits,switchw ;AC000; indicate /w was selected
+ mov linlen,wideperlin ;AC000; Set number of entries per line
+ mov lincnt,wideperlin ;AC000;
+ jmp short dirscan ;AC000; keep parsing
+
+set_dir_pause:
+ test byte ptr[bits],SwitchP ;AN018; /p already set?
+ jz ok_set_pause ;AN018; no - okay to set width
+ mov ax,moreargs_ptr ;AN018; set up too many arguments
+ invoke setup_parse_error_msg ;AN018; set up an error message
+ jmp badparm ;AN018; exit
+
+ok_set_pause:
+ or bits,switchp ;AC000; indicate /p was selected
+ push cx ;AN000; save necessary registers
+ push si ;AN000;
+ mov ax,(IOCTL SHL 8) + generic_ioctl_handle ;AN000; get lines per page on display
+ mov bx,stdout ;AN000; lines for stdout
+ mov ch,ioc_sc ;AN000; type is display
+ mov cl,get_generic ;AN000; get information
+ mov dx,offset trangroup:display_ioctl ;AN000;
+ int int_command ;AN000;
+
+lines_set:
+ dec linperpag ;AN000; lines per actual page should
+ dec linperpag ;AN000; two less than the max
+ mov ax,linperpag ;AN000; get number of lines into
+ mov [fullscr],ax ;AC000; screen line counter
+ pop si ;AN000; restore registers
+ pop cx ;AN000;
+ jmp dirscan ;AC000; keep parsing
+
+;
+; The syntax is incorrect. Report only message we can.
+;
+BadParm:
+ jmp cerror ;AC000; invalid switches get displayed
+
+ScanDone:
+
+;
+; Find and display the volume ID on the drive.
+;
+
+ invoke okvolarg ;AC000;
+;
+; OkVolArg also disables APPEND, which will be re-enabled
+; in the HeadFix routine, after we're done.
+;
+ mov [filecnt],0 ;AC000; Keep track of how many files found
+ cmp comsw,0 ;AC000; did an error occur?
+ jnz doheader ;AC000; yes - don't bother to fix path
+
+ mov dirflag,-1 ;AN015; set pathcrunch called from DIR
+ invoke pathcrunch ;AC000; set up FCB for dir
+ mov dirflag,0 ;AN015; reset dirflag
+ jc DirCheckPath ;AC015; no CHDIRs worked.
+ jz doheader ;AC015; chdirs worked - path\*.*
+ mov si,[desttail] ;AN015; get filename back
+ jmp short DoRealParse ;AN015; go parse it
+
+DirCheckPath:
+ mov ax,[msg_numb] ;AN022; get message number
+ cmp ax,0 ;AN022; Is there a message?
+ jnz dir_err_setup ;AN022; yes - there's an error
+ cmp [destisdir],0 ;AC000; Were pathchars found?
+ jz doparse ;AC000; no - no problem
+ inc comsw ;AC000; indicate error
+ jmp short doheader ;AC000; go print header
+
+DirNF:
+ mov ax,error_file_not_found ;AN022; get message number in control block
+
+dir_err_setup:
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov extend_buf_ptr,ax ;AN022;
+
+DirError:
+ jmp Cerror
+
+;
+; We have changed to something. We also have a file. Parse it into a
+; reasonable form, leaving drive alone, leaving extention alone and leaving
+; filename alone. We need to special case ... If we are at the root, the
+; parse will fail and it will give us a file not found instead of file not
+; found.
+;
+DoParse:
+ mov si,offset trangroup:srcbuf ;AN000; Get address of source
+ cmp byte ptr [si+1],colon_char ;AN000; Is there a drive?
+ jnz dir_no_drive ;AN000; no - keep going
+ lodsw ;AN000; bypass drive
+
+dir_no_drive:
+ cmp [si],".."
+ jnz DoRealParse
+ cmp byte ptr [si+2],0
+ jnz DoRealParse
+ inc ComSw
+ jmp short DoHeader
+
+DoRealParse:
+ mov di,FCB ; where to put the file name
+ mov ax,(Parse_File_Descriptor SHL 8) OR 0EH
+ int int_command
+
+;
+; Check to see if APPEND installed. If it is installed, set all flags
+; off. This will be reset in the HEADFIX routine
+;
+
+DoHeader:
+; ORIGINAL APPEND CHECK CODE LOCATION ******************************
+
+;
+; Display the header
+;
+
+DoHeaderCont:
+ mov al,blank ;AN051; Print out a blank
+ invoke print_char ;AN051; before DIR header
+ invoke build_dir_string ; get current dir string
+ mov dx,offset trangroup:Dirhead_ptr
+ invoke printf_crlf ; bang!
+
+;
+; If there were chars left after parse or device, then invalid file name
+;
+ cmp ComSw,0
+ jz DoSearch ; nothing left; good parse
+ jl DirNFFix ; not .. => error file not found
+ invoke RestUDir
+ mov dx,offset TranGroup:BadCD_ptr
+ jmp Cerror ; was .. => error directory not found
+DirNFFix:
+ invoke RestUDir
+ jmp DirNF
+;
+; We are assured that everything is correct. Let's go and search. Use
+; attributes that will include finding directories. perform the first search
+; and reset our directory afterward.
+;
+DoSearch:
+ mov byte ptr DS:[FCB-7],0FFH
+ mov byte ptr DS:[FCB-1],010H
+;
+; Caution! Since we are using an extended FCB, we will *also* be returning
+; the directory information as an extended FCB. We must bias all fetches into
+; DIRBUF by 8 (Extended FCB part + drive)
+;
+ mov ah,Dir_Search_First
+ mov dx,FCB-7
+ int int_command
+
+ push ax ;AN022; save return state
+ inc al ;AN022; did an error occur?
+ pop ax ;AN022; get return state back
+ jnz found_first_file ;AN022; no error - start dir
+ invoke set_ext_error_msg ;AN022; yes - set up error message
+ push dx ;AN022; save message
+ invoke restudir ;AN022; restore user's dir
+ pop dx ;AN022; restore message
+ cmp word ptr Extend_Buf_Ptr,Error_No_More_Files ;AN022; convert no more files to
+ jnz DirCerrorJ ;AN022; file not found
+ mov Extend_Buf_Ptr,Error_File_Not_Found ;AN022;
+
+DirCerrorJ: ;AN022;
+ jmp Cerror ;AN022; exit
+
+;
+; Restore the user's directory. We preserve, though, the return from the
+; previous system call for later checking.
+;
+
+found_first_file:
+ push ax
+ invoke restudir
+ pop ax
+;
+; Main scanning loop. Entry has AL = Search first/next error code. Test for
+; no more.
+;
+DIRSTART:
+ inc al ; FF = file not found
+ jnz Display
+ jmp DirDone ; Either an error or we are finished
+;
+; Note that we've seen a file and display the found file.
+;
+
+Display:
+ inc [filecnt] ; Keep track of how many we find
+ mov si,offset trangroup:dirbuf+8 ; SI -> information returned by sys call
+ call shoname
+;
+; If we are displaying in wide mode, do not output the file info
+;
+ test byte ptr[bits],SwitchW ; W switch set?
+ jz DirTest
+ jmp nexent ; If so, no size, date, or time
+
+;
+; Test for directory.
+;
+DirTest:
+ test [dirbuf+8].dir_attr,attr_directory
+ jz fileent
+;
+; We have a directory. Display the <DIR> field in place of the file size
+;
+ mov dx,offset trangroup:Dmes_ptr
+ call std_printf
+ jmp short nofsiz
+;
+; We have a file. Display the file size
+;
+fileent:
+ mov dx,[DirBuf+8].dir_size_l
+ mov file_size_low,dx
+ mov dx,[DirBuf+8].dir_size_h
+ mov file_size_high,dx
+ mov dx,offset trangroup:disp_file_size_ptr
+ call std_printf
+;
+; Display time and date of last modification
+;
+nofsiz:
+ mov ax,[DirBuf+8].dir_date ; Get date
+;
+; If the date is 0, then we have found a 1.x level diskette. We skip the
+; date/time fields as 1.x did not have them.
+;
+ or ax,ax
+ jz nexent ; Skip if no date
+ mov bx,ax
+ and ax,1FH ; get day
+ mov dl,al
+ mov ax,bx
+ mov cl,5
+ shr ax,cl ; Align month
+ and al,0FH ; Get month
+ mov dh,al
+ mov cl,bh
+ shr cl,1 ; Align year
+ xor ch,ch
+ add cx,80 ; Relative 1980
+ cmp cl,100
+ jb millenium
+ sub cl,100
+
+millenium:
+ xchg dh,dl ;AN000; switch month & day
+ mov DirDat_yr,cx ;AC000; put year into message control block
+ mov DirDat_mo_day,dx ;AC000; put month and day into message control block
+ mov cx,[DirBuf+8].dir_time ; Get time
+ jcxz prbuf ; Time field present?
+ shr cx,1
+ shr cx,1
+ shr cx,1
+ shr cl,1
+ shr cl,1 ; Hours in CH, minutes in CL
+ xchg ch,cl ;AN000; switch hours & minutes
+ mov DirTim_hr_min,cx ;AC000; put hours and minutes into message subst block
+
+prbuf:
+ mov dx,offset trangroup:DirDatTim_ptr
+ call std_printf
+ invoke crlf2 ;AC066;end the line
+ dec byte ptr [fullscr] ;AC066;count the line
+ jnz endif04 ;AN066;IF the last on the screen THEN
+ call check_for_P ;AN066; pause if /P requested
+ endif04: ;AN066;
+ jmp scroll ; If not, just continue
+;AD061; mov DirDat_yr,0 ;AC000; reset year, month and day
+;AD061; mov DirDat_mo_day,0 ;AC000; in control block
+;AD061; mov DirTim_hr_min,0 ;AC000; reset hour & minute in control block
+;
+; We are done displaying an entry. The code between "noexent:" and "scroll:"
+; is only for /W case.
+;
+nexent:
+ mov bl,[lincnt] ;AN066;save for check for first entry on line
+ dec [lincnt] ;count this entry on the line
+ jnz else01 ;AX066;IF last entry on line THEN
+ mov al,[linlen]
+ mov [lincnt],al
+ invoke crlf2
+ cmp [fullscr],0 ;AC066;IF have filled the screen THEN
+ jnz endif02 ;AN066;
+ call check_for_P ;AN066; reinitialize fullscr,
+ endif02: ;AN066; IF P requested THEN pause
+ jmp short endif01 ;AN066;
+ else01: ;AN066;ELSE since screen not full
+ cmp bl,[linlen] ;AN066; IF starting new line THEN
+ jne endif03 ; count the line
+ dec byte ptr [fullscr] ;AN066; ENDIF
+ endif03: ;AC066;We are outputting on the same line, between fields, we tab.
+ mov dx,offset trangroup:tab_ptr ;Output a tab
+ call std_printf
+ endif01: ;AX066;
+;
+; All we need to do now is to get the next directory entry.
+;
+scroll:
+ mov ah,Dir_Search_Next
+ mov dx,FCB-7 ; DX -> Unopened FCB
+ int int_command ; Search for a file to match FCB
+ jmp DirStart
+;
+; If no files have been found, display a not-found message
+;
+DirDone:
+ invoke get_ext_error_number ;AN022; get the extended error number
+ cmp ax,error_no_more_files ;AN022; was error file not found?
+ jnz dir_err_setup_jmp ;AN022; no - setup error message
+ test [filecnt],-1
+ jnz Trailer
+ mov ax,error_file_not_found ;AN022;
+
+dir_err_setup_jmp: ;AN022;
+ jmp dir_err_setup ;AN022; go setup error msg & print it
+;
+; If we have printed the maximum number of files per line, terminate it with
+; CRLF.
+;
+Trailer:
+ mov al,[linlen]
+ cmp al,[lincnt] ; Will be equal if just had CR/LF
+ jz mmessage
+ invoke crlf2
+ cmp [fullscr],0 ;AN066;IF on last line of screen THEN
+ jnz endif06 ;AN066; pause before going on
+ call check_for_P ;AN066; to number and freespace
+ endif06: ;AN066; displays
+
+mmessage:
+ mov dx,offset trangroup:Dirmes_ptr
+ mov si,[filecnt]
+ mov dir_num,si
+ call std_printf
+ mov ah,Get_Drive_Freespace
+ mov dl,byte ptr DS:[FCB]
+ int int_command
+ cmp ax,-1
+ retz
+ mul cx ; AX is bytes per cluster
+ mul bx
+ mov bytes_free,ax ;AC000;
+ mov bytes_free+2,dx ;AC000;
+ MOV DX,OFFSET TRANGROUP:BYTMES_ptr
+ jmp std_printf
+
+shoname:
+ mov di,offset trangroup:charbuf
+ mov cx,8
+ rep movsb
+ mov al,' '
+ stosb
+ mov cx,3
+ rep movsb
+ xor ax,ax
+ stosb
+ push dx
+ mov dx,offset trangroup:charbuf
+ mov string_ptr_2,dx
+ mov dx,offset trangroup:string_buf_ptr
+ call std_printf
+ pop DX
+ return
+
+check_for_P PROC NEAR ;AN066;
+
+test byte ptr[bits],SwitchP ;P switch present?
+jz endif05 ;AN066;
+ mov ax,linperpag ;AN000; transfer lines per page
+ mov [fullscr],ax ;AC000; to fullscr
+ invoke Pause
+endif05:
+ret ;AN066;
+
+check_for_P ENDP ;AN066;
+
+trancode ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tcmd1b.asm b/private/mvdm/dos/v86/cmd/command/tcmd1b.asm
new file mode 100644
index 000000000..c76d6d395
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tcmd1b.asm
@@ -0,0 +1,781 @@
+ page ,132
+; SCCSID = @(#)tcmd1b.asm 1.1 85/05/14
+; SCCSID = @(#)tcmd1b.asm 1.1 85/05/14
+TITLE PART4 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; Internal commands DIR,PAUSE,ERASE,TYPE,VOL,VER
+
+.xlist
+.xcref
+ include dossym.inc
+ include bpb.inc
+ include syscall.inc
+ include filemode.inc
+ include sf.inc
+ include comseg.asm
+ include comsw.asm ;ac000;
+ include comequ.asm
+ include ioctl.inc ;an000;
+.list
+.cref
+
+DATARES SEGMENT PUBLIC BYTE ;AN020;AC068;
+ EXTRN append_flag:byte ;AN020;AC068;
+ EXTRN append_state:word ;AN020;AC068;
+ EXTRN SCS_PAUSE:BYTE ; yst 4-5-93
+DATARES ENDS ;AN020;AC068;
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN badcpmes_ptr:word ;AC022;
+ EXTRN Extend_buf_ptr:word ;AC000;
+ EXTRN Extend_buf_sub:byte ;AN000;
+ EXTRN inornot_ptr:word
+ EXTRN msg_disp_class:byte ;AC000;
+ EXTRN parse_erase:byte ;AC000;
+ EXTRN parse_mrdir:byte ;AC000;
+ EXTRN parse_rename:byte ;AC000;
+ EXTRN parse_vol:byte ;AC000;
+ EXTRN PauseMes_ptr:word
+ EXTRN renerr_ptr:word
+ EXTRN slash_p_syn:word ;AC000;
+ EXTRN volmes_ptr:word ;AC000;
+ EXTRN volmes_ptr_2:word ;AC000;
+ EXTRN volsermes_ptr:word ;AC000;
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN bytcnt:word
+ EXTRN charbuf:byte
+ EXTRN comsw:word
+ EXTRN curdrv:byte
+ EXTRN destinfo:byte
+ EXTRN destisdir:byte
+ EXTRN dirbuf:byte
+ EXTRN msg_numb:word ;AN022;
+ EXTRN one_char_val:byte
+ EXTRN parse1_addr:dword ;AN000;
+ EXTRN parse1_syn:word ;AN000;
+ EXTRN resseg:word ;AN020;AC068;
+ EXTRN srcbuf:byte ;AN000;
+ EXTRN string_ptr_2:word ;AN000;
+ EXTRN TPA:word
+ EXTRN vol_drv:byte
+ EXTRN vol_ioctl_buf:byte ;AC000;
+ EXTRN vol_label:byte ;AC000;
+ EXTRN vol_serial:dword ;AC000;
+ EXTRN zflag:byte
+
+ extrn TypeFilSiz:dword
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+transpace ends
+;---------------
+
+ EXTRN cerror:near
+ EXTRN error_output:near
+ EXTRN notest2:near
+ EXTRN slashp_erase:near ;AN000;
+ EXTRN std_printf:near
+ EXTRN tcommand:near
+
+ PUBLIC badpath_err ;AN022;
+ PUBLIC crename
+ PUBLIC DisAppend
+ PUBLIC erase
+ PUBLIC extend_setup ;AN022;
+ PUBLIC Get_ext_error_number ;AN022;
+ PUBLIC pause
+ PUBLIC Set_ext_error_msg ;AN000;
+ PUBLIC typefil
+ PUBLIC volume
+
+
+ break Pause
+PAUSE:
+ push ds
+ mov ds, ResSeg
+ assume ds:resgroup
+ cmp SCS_PAUSE, 0
+ pop ds
+ jne pause_break
+
+assume ds:trangroup,es:trangroup
+ mov dx,offset trangroup:pausemes_ptr
+ call std_printf
+ invoke GetKeystroke
+ invoke crlf2
+pause_break:
+ return
+
+ break Erase
+
+;****************************************************************
+;*
+;* ROUTINE: DEL/ERASE - erase file(s)
+;*
+;* FUNCTION: PARSE command line for file or path name and /P
+;* and invoke PATHCRUNCH. If an error occurs, set
+;* up an error message and transfer control to CERROR.
+;* Otherwise, transfer control to NOTEST2 if /P not
+;* entered or SLASHP_ERASE if /P entered.
+;*
+;* INPUT: command line at offset 81H
+;*
+;* OUTPUT: if no error:
+;* FCB at 5ch set up with filename(s) entered
+;* Current directory set to entered directory
+;*
+;****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+ERASE:
+ mov si,81H ;AC000; get command line
+ mov comsw,0 ;AN000; clear switch indicator
+ mov di,offset trangroup:parse_erase ;AN000; Get adderss of PARSE_erase
+ xor cx,cx ;AN000; clear cx,dx
+
+erase_scan:
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,end_of_line ;AN000; are we at end of line?
+ jz good_line ;AN000; yes - done parsing
+ cmp ax,result_no_error ;AC000; did we have an error?
+ jnz errj2 ;AC000; yes exit
+
+ cmp parse1_syn,offset trangroup:slash_p_syn ;AN000; was /P entered?
+ je set_erase_prompt ;AN000; yes - go set prompt
+
+;
+; Must be filespec since no other matches occurred. move filename to srcbuf
+;
+ push si ;AC000; save position in line
+ lds si,parse1_addr ;AC000; get address of filespec
+ cmp byte ptr[si+1],colon_char ;AC000; drive specified?
+ jnz Erase_drive_ok ;AC000; no - continue
+ cmp byte ptr[si+2],end_of_line_out ;AC000; was only drive entered?
+ jnz erase_drive_ok ;AC000; no - continue
+ mov ax,error_file_not_found ;AN022; get message number in control block
+ jmp short extend_setup ;AC000; exit
+
+erase_drive_ok:
+ invoke move_to_srcbuf ;AC000; move to srcbuf
+ pop si ;AC000; get position back
+ jmp short erase_scan ;AN000; continue parsing
+
+set_erase_prompt:
+ cmp comsw,0 ;AN018; was /P already entered?
+ jz ok_to_set_erase_prompt ;AN018; no go set switch
+ mov ax,moreargs_ptr ;AN018; set up too many arguments
+ invoke setup_parse_error_msg ;AN018; set up an error message
+ jmp short errj2 ;AN018; exit
+
+ok_to_set_erase_prompt: ;AN018;
+ inc comsw ;AN000; indicate /p specified
+ jmp short erase_scan ;AN000; continue parsing
+
+good_line: ;G We know line is good
+ invoke pathcrunch
+ jnc checkdr
+ mov ax,[msg_numb] ;AN022; get message number
+ cmp ax,0 ;AN022; was message flag set?
+ jnz extend_setup ;AN022; yes - print out message
+ cmp [destisdir],0 ; No CHDIRs worked
+ jnz badpath_err ;AC022; see if they should have
+
+checkdr:
+ cmp comsw,0 ;AN000; was /p specified
+ jz notest2j ;AN000; no - go to notest2
+ jmp slashp_erase ;AN000; yes - go to slashp_erase
+
+notest2j:
+ jmp notest2
+
+badpath_err: ;AN022; "Path not found" message
+ mov ax,error_path_not_found ;AN022; set up error number
+
+extend_setup: ;AN022;
+ mov msg_disp_class,ext_msg_class ;AN022; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC022; get extended message pointer
+ mov Extend_Buf_ptr,ax ;AN022; get message number in control block
+errj2: ;AC022; exit jump
+ jmp Cerror ;AN022;
+
+ break Rename
+
+; ****************************************************************
+; *
+; * ROUTINE: CRENAME - rename file(s)
+; *
+; * FUNCTION: PARSE command line for one full filespec and one
+; * filename. Invoke PATHCRUNCH on the full filespec.
+; * Make sure the second filespec only contains a
+; * filename. If both openands are valid, attempt
+; * to rename the file.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+CRENAME:
+
+ mov si,81H ;AC000; Point to command line
+ mov di,offset trangroup:parse_rename;AN000; Get adderss of PARSE_RENAME
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,result_no_error ;AC000; did we have an error?
+;; jz crename_no_parse_error ;AC000; no - continue
+ jnz crename_parse_error ;AC000; Yes, fail. (need long jump)
+
+;
+; Get first file name returned from parse into our buffer
+;
+crename_no_parse_error:
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AN000; get address of filespec
+ invoke move_to_srcbuf ;AN000; move to srcbuf
+ pop si ;AN000; restore position in line
+
+ xor dx,dx ;AN000; clear dx
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,result_no_error ;AN000; did we have an error?
+ JNZ crename_parse_error ;AN000; Yes, fail.
+
+;
+; Check the second file name for drive letter colon
+;
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AC000; get address of path
+
+ mov al,':' ;AC000;
+ cmp [si+1],al ;AC000; Does the 2nd parm have a drive spec?
+ jnz ren_no_drive ;AN000; Yes, error
+ mov msg_disp_class,parse_msg_class ;AN000; set up parse error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,BadParm_ptr ;AN000; get "Invalid parameter" message number
+
+ pop si ;AN000;
+crename_parse_error: ;AC022;
+ jmp short errj ;AC000;
+
+;
+; Get second file name returned from parse into the fCB. Save
+; character after file name so we can later check to make sure it
+; isn't a path character.
+;
+
+ren_no_drive:
+ mov di,FCB+10H ;AC000; set up to parse second file name
+ mov ax,(Parse_File_Descriptor SHL 8) OR 01H ;AC000;
+ int 21h ;AC000; do the function
+ lodsb ;AC000; Load char after filename
+ mov one_char_val,al ;AN000; save char after filename
+ pop si ;AN000; get line position back
+
+;
+; We have source and target. See if any args beyond.
+;
+
+ mov di,offset trangroup:parse_rename;AC000; get address of parse_rename
+ invoke parse_check_eol ;AC000; are we at end of line?
+ jnz crename_parse_error ;AN000; no, fail.
+
+ invoke pathcrunch
+ mov dx,offset trangroup:badcpmes_ptr
+ jz errj2 ; If 1st parm a dir, print error msg
+ jnc notest3
+ mov ax,[msg_numb] ;AN022; get message number
+ cmp ax,0 ;AN022; was message flag set?
+ jnz extend_setup ;AN022; yes - print out message
+ cmp [destisdir],0 ; No CHDIRs worked
+ jz notest3 ; see if they should have
+ Jmp badpath_err ;AC022; set up error
+
+notest3:
+ mov al,one_char_val ;AN000; move char into AX
+ mov dx,offset trangroup:inornot_ptr ; Load invalid fname error ptr
+ invoke pathchrcmp ; Is the char in al a path sep?
+ jz errj ; Yes, error - 2nd arg must be
+ ; filename only.
+
+ mov ah,FCB_Rename
+ mov dx,FCB
+ int 21h
+ cmp al, 0FFH ; Did an error occur??
+ jnz renameok
+
+ invoke get_ext_error_number ;AN022; get extended error
+ SaveReg <AX> ;AC022; Save results
+ mov al, 0FFH ; Restore original error state
+
+renameok:
+ push ax
+ invoke restudir
+ pop ax
+ inc al
+ retnz
+
+ RestoreReg <AX> ;AC022; get the error number back
+ cmp ax,error_file_not_found ;AN022; error file not found?
+ jz use_renerr ;AN022; yes - use generic error message
+ cmp ax,error_access_denied ;AN022; error file not found?
+ jz use_renerr ;AN022; yes - use generic error message
+ jmp extend_setup ;AN022; need long jump - use extended error
+
+use_renerr:
+ mov dx,offset trangroup:RenErr_ptr ;AC022;
+
+ERRJ:
+ jmp Cerror
+
+ret56: ret
+
+ break Type
+
+;****************************************************************
+;*
+;* ROUTINE: TYPEFIL - Display the contents of a file to the
+;* standard output device
+;*
+;* SYNTAX: TYPE filespec
+;*
+;* FUNCTION: If a valid filespec is found, read the file until
+;* 1Ah and display the contents to STDOUT.
+;*
+;* INPUT: command line at offset 81H
+;*
+;* OUTPUT: none
+;*
+;****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+TYPEFIL:
+ mov si,81H
+ mov di,offset trangroup:parse_mrdir ;AN000; Get adderss of PARSE_MRDIR
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,result_no_error ;AC000; did we have an error?
+ jnz typefil_parse_error ;AN000; yes - issue error message
+
+ push si ;AC000; save position in line
+ lds si,parse1_addr ;AC000; get address of filespec
+ invoke move_to_srcbuf ;AC000; move to srcbuf
+ pop si ;AC000; get position back
+ mov di,offset trangroup:parse_mrdir ;AC000; get address of parse_mrdir
+ invoke parse_check_eol ;AC000; are we at end of line?
+ jz gottarg ;AC000; yes - continue
+
+typefil_parse_error: ;AN000; no - set up error message and exit
+ jmp Cerror
+
+gottarg:
+ invoke setpath
+ test [destinfo],00000010b ; Does the filespec contain wildcards
+ jz nowilds ; No, continue processing
+ mov dx,offset trangroup:inornot_ptr ; Yes, report error
+ jmp Cerror
+nowilds:
+ mov ax,ExtOpen SHL 8 ;AC000; open the file
+ mov bx,read_open_mode ;AN000; get open mode for TYPE
+ xor cx,cx ;AN000; no special files
+ mov dx,read_open_flag ;AN000; set up open flags
+ mov si,offset trangroup:srcbuf ;AN030; get file name
+ int 21h
+ jnc typecont ; If open worked, continue. Otherwise load
+
+Typerr: ;AN022;
+ push cs ;AN022; make sure we have local segment
+ pop ds ;AN022;
+ invoke set_ext_error_msg ;AN022;
+ mov string_ptr_2,offset trangroup:srcbuf ;AC022; get address of failed string
+ mov Extend_buf_sub,one_subst ;AC022; put number of subst in control block
+ jmp cerror ;AC022; exit
+
+typecont:
+ mov bx,ax ;AC000; get Handle
+;M043
+; We should do the LSEEK for filesize only if this handle belongs to a file
+;and not if it belongs to a device. If device, set TypeFilSiz+2 to -1 to
+;indicate it is a device.
+;
+ mov ax,(IOCTL shl 8) or 0
+ int 21h
+
+ test dl,80h ;is it a device?
+ jz not_device ;no, a file
+
+ mov word ptr TypeFilSiz+2,-1 ;indicate it is a device
+ jmp short dotype
+not_device:
+
+;SR;
+; Find the filesize by seeking to the end and then reset file pointer to
+;start of file
+;
+ mov ax,(LSEEK shl 8) or 2
+ xor dx,dx
+ mov cx,dx ;seek to end of file
+ int 21h
+
+ mov word ptr TypeFilSiz,ax
+ mov word ptr TypeFilSiz+2,dx ;store filesize
+
+ mov ax,(LSEEK shl 8) or 0
+ xor dx,dx
+ int 21h ;reset file pointer to start
+dotype: ;M043
+ mov zflag,0 ; Reset ^Z flag
+ mov ds,[TPA]
+ xor dx,dx
+ASSUME DS:NOTHING
+
+typelp:
+ cmp cs:[zflag],0 ;AC050; Is the ^Z flag set?
+ retnz ; Yes, return
+ mov cx,cs:[bytcnt] ;AC056; No, continue
+;
+;Update the filesize left to read
+;
+ cmp word ptr cs:TypeFilSiz+2,-1 ;is it a device? M043
+ je typ_read ;yes, just read from it; M043
+
+ cmp word ptr cs:TypeFilSiz+2,0 ;more than 64K left?
+ jz lt64k ;no, do word subtraction
+ sub word ptr cs:TypeFilSiz, cx
+ sbb word ptr cs:TypeFilSiz+2, 0 ;update filesize
+ jmp short typ_read ;do the read
+lt64k:
+ cmp cx,word ptr cs:TypeFilSiz ;readsize <= buffer?
+ jbe gtbuf ;yes, just update readsize
+;
+;Buffer size is larger than bytes to read
+;
+ mov cx,word ptr cs:TypeFilSiz
+ jcxz typelp_ret
+ mov word ptr cs:TypeFilSiz,0
+ jmp short typ_read
+gtbuf:
+ sub word ptr cs:TypeFilSiz,cx ;update filesize remaining
+typ_read:
+ mov ah,read
+ int 21h
+ jnc @f ;M043
+ jmp typerr ;M043
+@@: ;M043
+;M043; jc typerr ;AN022; Exit if error
+
+ mov cx,ax
+ jcxz typelp_ret ;AC000; exit if nothing read
+ push ds
+ pop es ; Check to see if a ^Z was read.
+assume es:nothing
+ xor di,di
+ push ax
+ mov al,1ah
+ repnz scasb
+ pop ax
+ xchg ax,cx
+ cmp ax,0
+ jnz foundz ; Yes, handle it
+ cmp byte ptr [di-1],1ah ; No, double check
+ jnz typecont2 ; No ^Z, continue
+
+foundz:
+ sub cx,ax ; Otherwise change cx so that only those
+ dec cx ; bytes up to but NOT including the ^Z
+ push cs ; will be typed.
+ pop es
+assume es:trangroup
+ not zflag ; Turn on ^Z flag so that the routine
+
+typecont2: ; will quit after this write.
+ push bx
+ mov bx,1
+ mov ah,write
+ int 21h
+ pop bx
+ jc Error_outputj
+ cmp ax,cx
+ jnz @f ;M043
+ jmp typelp ;M043
+@@: ;M043
+;M043; jz typelp
+ dec cx
+ cmp ax,cx
+ retz ; One less byte OK (^Z)
+
+Error_outputj:
+ mov bx,1
+ mov ax,IOCTL SHL 8
+ int 21h
+ test dl,devid_ISDEV
+ retnz ; If device, no error message
+ jmp error_output
+
+typelp_ret:
+ ret
+
+ break Volume
+assume ds:trangroup,es:trangroup
+
+;
+; VOLUME command displays the volume ID on the specified drive
+;
+VOLUME:
+
+ mov si,81H
+ mov di,offset trangroup:parse_vol ;AN000; Get adderss of PARSE_VOL
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ jz OkVolArg ;AC000; Yes, display default volume ID
+ cmp ax,result_no_error ;AC000; did we have an error?
+ jnz BadVolArg ;AC000; Yes, fail.
+;
+; We have parsed off the drive. See if there are any more chars left
+;
+
+ mov di,offset trangroup:parse_vol ;AC000; get address of parse_vol
+ xor dx,dx ;AC000;
+ invoke parse_check_eol ;AC000; call parser
+ jz OkVolArg ;AC000; yes, end of road
+;
+; The line was not interpretable. Report an error.
+;
+badvolarg:
+ jmp Cerror
+
+
+
+
+;*** DisAppend - disable APPEND
+;
+; ENTRY nothing
+;
+; EXIT nothing
+;
+; USED AX,BX
+;
+; EFFECTS
+;
+; APPEND is disabled. If it was active, it will be re-enabled
+; after the command finishes, by the HeadFix routine.
+;
+; NOTE
+;
+; This routine must not be called more than once during a single
+; command cycle. The second call would permanently disable APPEND.
+
+DisAppend proc
+
+ assume ds:TRANGROUP,es:NOTHING
+
+ push ds ; save DS
+ push es ; save ES
+ push di
+
+ mov ax,APPENDINSTALL ; AX = Append Installed Check code
+ int 2Fh ; talk to APPEND via multiplex
+ or al,al
+ jz daRet ; APPEND not installed, return
+
+ mov ax,APPENDDOS ; AX = Get Append Version code
+ int 2Fh ; talk to APPEND via multiplex
+ cmp ax,0FFFFh
+ jne daRet ; it's not a local version, return
+
+ mov ax,APPENDGETSTATE ; AX = Get Function State code
+ int 2Fh ; talk to APPEND via multiplex
+
+ mov ds,ResSeg ; DS = resident seg addr
+
+ assume ds:RESGROUP
+
+ mov Append_State,bx ; Append_State = saved APPEND state
+ mov Append_Flag,-1 ; Append_Flag = true, restore state
+
+ xor bx,bx ; BX = APPEND state = off
+ mov AX,APPENDSETSTATE ; AX = Set Append State code
+ int 2Fh ; talk to APPEND via multiplex
+
+daRet: pop di
+ pop es ; restore ES
+ pop ds ; restore DS
+
+ assume ds:TRANGROUP
+
+ ret
+
+DisAppend endp
+
+
+
+;
+; Find the Volume ID on the disk.
+;
+PUBLIC OkVolArg
+OKVOLARG:
+ assume ds:TRANGROUP,es:TRANGROUP
+
+ call DisAppend ; disable APPEND
+ invoke crlf2
+ mov al,blank ;AN051; Print out a blank
+ invoke print_char ;AN051; before volume message
+ push ds
+ pop es
+;
+; Volume IDs are only findable via extended FCBs or find_first with attributes
+; of volume_id ONLY.
+;
+
+ mov di,FCB-7 ; Point to extended FCB beginning
+ mov al,-1 ; Tag to indicate Extention
+ stosb
+ xor ax,ax ; Zero padding to volume label
+ stosw
+ stosw
+ stosb
+ mov al,attr_volume_ID ; Look for volume label
+ stosb
+ inc di ; Skip drive byte; it is already set
+ mov cx,11 ; fill in remainder of file
+ mov al,'?'
+ rep stosb
+;
+; Set up transfer address (destination of search first information)
+;
+ mov dx,offset trangroup:dirbuf
+ mov ah,set_DMA
+ int 21h
+;
+; Do the search
+;
+ mov dx,FCB-7
+ mov ah,Dir_Search_First
+ int 21h
+
+;********************************
+; Print volume ID info
+
+ push ax ;AC000; AX return from SEARCH_FIRST for VOL ID
+ mov al,DS:[FCB] ;AC000; get drive letter
+ add al,'@'
+ cmp al,'@'
+ jnz drvok
+ mov al,[curdrv]
+ add al,capital_A
+drvok:
+ mov vol_drv,al ;AC000; get drive letter into argument
+ pop ax ;AC000; get return code back
+ or al,al ;AC000; volume label found?
+ jz Get_vol_name ;AC000; volume label exists - go get it
+ mov dx,offset trangroup:VolMes_ptr_2 ;AC000; set up no volume message
+ jmp short print_serial ;AC000; go print it
+
+Get_vol_name:
+ mov di,offset trangroup:charbuf
+ mov dx,di
+ mov si,offset trangroup:dirbuf + 8 ;AN000; 3/3/KK
+ mov cx,11 ;AN000; 3/3/KK
+ rep movsb ;AN000; 3/3/KK
+
+ xor al,al ;AC000; store a zero to terminate the string
+ stosb
+ mov dx,offset trangroup:VolMes_ptr ;AC000; set up message
+
+PRINT_SERIAL:
+
+;
+; Attempt to get the volume serial number from the disk. If an error
+; occurs, do not print volume serial number.
+;
+
+ push dx ;AN000; save message offset
+ mov ax,(GetSetMediaID SHL 8) ;AC036; Get the volume serial info
+ mov bl,DS:[FCB] ;AN000; get drive number from FCB
+ mov dx,offset trangroup:vol_ioctl_buf ;AN000;target buffer
+ int 21h ;AN000; do the call
+ pop dx ;AN000; get message offset back
+ jc printvol_end ;AN000; if error, just go print label
+ call std_printf ;AC000; go print volume message
+ mov al,blank ;AN051; Print out a blank
+ invoke print_char ;AN051; before volume message
+ mov dx,offset trangroup:VolSerMes_ptr ;AN000; get serial number message
+
+printvol_end:
+ jmp std_printf ;AC000; go print and exit
+
+
+;****************************************************************
+;*
+;* ROUTINE: Set_ext_error_msg
+;*
+;* FUNCTION: Sets up extended error message for printing
+;*
+;* INPUT: return from INT 21
+;*
+;* OUTPUT: extended error message set up in extended error
+;* buffer.
+;*
+;****************************************************************
+
+Set_ext_error_msg proc near ;AN000;
+
+ call get_ext_error_number ;AC022; get the extended error
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,ax ;AN000; get message number in control block
+ stc ;AN000; make sure carry is set
+
+ ret ;AN000; return
+
+Set_ext_error_msg endp ;AN000;
+
+;****************************************************************
+;*
+;* ROUTINE: Get_ext_error_number
+;*
+;* FUNCTION: Does get extended error function call
+;*
+;* INPUT: return from INT 21
+;*
+;* OUTPUT: AX - extended error number
+;*
+;****************************************************************
+
+Get_ext_error_number proc near ;AN022;
+
+ SaveReg <BX,CX,DX,SI,DI,BP,ES,DS> ;AN022; save registers
+ mov ah,GetExtendedError ;AN022; get extended error
+ xor bx,bx ;AN022; clear BX
+ int 21h ;AN022;
+ RestoreReg <DS,ES,BP,DI,SI,DX,CX,BX> ;AN022; restore registers
+
+ ret ;AN022; return
+
+Get_ext_error_number endp ;AN022;
+
+trancode ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/tcmd2a.asm b/private/mvdm/dos/v86/cmd/command/tcmd2a.asm
new file mode 100644
index 000000000..a845fbe0d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tcmd2a.asm
@@ -0,0 +1,692 @@
+ page ,132
+; SCCSID = @(#)tcmd2a.asm 4.1 85/06/25
+; SCCSID = @(#)tcmd2a.asm 4.1 85/06/25
+TITLE PART5 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; Revision History
+; ================
+; M01 md 7/13/90 Changed CLS to access ROM BIOS data directly
+;
+; M013 SR 08/06/90 Changed Version to use new call to
+; get info about DOS in HMA or ROM.
+; M018 md 08/12/90 Increment screen height by 1 when
+; obtained from ROM BIOS.
+; M022 md 08/29/80 Set correct video page in REG_CLS
+
+ INCLUDE comsw.asm
+
+.xlist
+.xcref
+ include dossym.inc
+ include bpb.inc
+ include syscall.inc
+ include filemode.inc
+ include sf.inc
+ include comequ.asm
+ include comseg.asm
+ include ioctl.inc
+ include rombios.inc ;M01
+.list
+.cref
+
+
+CODERES SEGMENT PUBLIC BYTE ;AC000;
+CODERES ENDS
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg_buf_ptr:word
+ EXTRN BadCurDrv:byte ;AC000;
+ EXTRN clsstring:byte
+ EXTRN dback_ptr:word
+ EXTRN display_ioctl:word ;AN000;
+ EXTRN display_width:word ;AN000;
+ EXTRN DosHma_Ptr:word
+ EXTRN DosLow_Ptr:word
+ EXTRN DosRev_Ptr:word
+ EXTRN DosRom_Ptr:word
+ EXTRN Extend_buf_ptr:word ;AN049;
+ EXTRN linperpag:word ;AN000;
+ EXTRN msg_disp_class:byte ;AN049;
+ EXTRN nulpath_ptr:word
+ EXTRN Parse_Ver:byte
+ EXTRN prompt_table:word
+ EXTRN string_buf_ptr:word ;AC000;
+ EXTRN vermes_ptr:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN Arg_Buf:byte
+ EXTRN bwdbuf:byte
+ EXTRN curdrv:byte
+ EXTRN dirchar:byte
+ EXTRN major_ver_num:word
+ EXTRN minor_ver_num:word
+ EXTRN One_Char_Val:byte
+ EXTRN srcxname:byte ;AN049;
+ EXTRN string_ptr_2:word
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+transpace ends
+;---------------
+
+ EXTRN cerror:near ;AN049;
+ EXTRN crlf2:near
+ EXTRN drvbad:near
+ EXTRN std_printf:near
+
+ PUBLIC build_dir_for_chdir
+ PUBLIC build_dir_for_prompt
+ PUBLIC build_dir_string
+ PUBLIC cls
+ PUBLIC path
+ PUBLIC print_char
+ PUBLIC print_drive
+ PUBLIC print_version
+ PUBLIC print_b
+ PUBLIC print_back
+ PUBLIC print_eq
+ PUBLIC print_esc
+ PUBLIC print_g
+ PUBLIC print_l
+ PUBLIC print_prompt
+ PUBLIC version
+
+
+ break Version
+
+;*** Version - display DOS version
+;
+; SYNTAX ver [/debug]
+;
+; /debug - display additional DOS configuration info
+;
+; ENTRY command-line tail is in PSP
+;
+; EXIT if successful, nothing
+; if parse fails,
+; parse error message is set up (for Std_EPrintf)
+; AX = system parser error code
+; DX = ptr to message block
+; we jump to CError
+;
+; EFFECTS
+; If parse fails, a parse error message is displayed.
+; Otherwise, version message is displayed.
+; If /debug is specified, additional DOS info is displayed.
+
+Version:
+ assume ds:TRANGROUP,es:TRANGROUP
+
+; Parse command line for /debug switch.
+
+ mov si,81h ; DS:SI = ptr to command tail
+ mov di,offset TRANGROUP:Parse_Ver ; ES:DI = ptr to parse block
+ xor cx,cx ; CX = # positional param's found
+ invoke Parse_With_Msg
+
+ mov bl,1 ; BL = flag = /debug present
+ cmp ax,RESULT_NO_ERROR
+ je verPrintVer ; something parsed - must be /debug
+ dec bl ; BL = flag = no /debug present
+ cmp ax,END_OF_LINE
+ je verPrintVer ; reached end of line - ok
+
+; The parse failed. Error message has been set up.
+
+ jmp CError
+
+verPrintVer:
+ push bx ; save /debug flag
+ call Crlf2
+ call Print_Version
+ call Crlf2
+ pop bx ; BL = /debug flag
+ or bl,bl
+ jz verDone ; /debug is false - we're done
+
+;* For /debug, display DOS internal revision and DOS location
+; (low memory, HMA, or ROM).
+
+; Bugbug: use symbols for bitmasks below.
+
+ mov ax,(SET_CTRL_C_TRAPPING shl 8) + 6 ; M013
+ int 21h
+ mov al,dl ;revision number in dl; M013
+ mov bh,dh ;flags in dh now; M013
+;M032 and al,7 ; AL = DOS internal revision
+ cmp al,'Z'-'A' ;M032 ; revision in A-to-Z range?
+ jbe @f ;M032 ; A-to-Z revision ok
+ mov al,'*'-'A' ;M032 ; beyond Z, just say revision *
+@@: add al,'A' ; AL = DOS internal rev letter
+ mov One_Char_Val,al
+ mov dx,offset TRANGROUP:DosRev_Ptr
+ invoke Std_Printf ; print DOS internal revision
+
+ mov cl,4
+ shr bh,cl ; CY = DOS in ROM
+ jc verRom
+ shr bh,1 ; CY = DOS in HMA
+ jc verHma
+
+; DOS isn't in ROM or HMA, so it must be in lower memory.
+
+ mov dx,offset TRANGROUP:DosLow_Ptr
+ jmp short verPrintLoc
+verRom: mov dx,offset TRANGROUP:DosRom_Ptr
+ jmp short verPrintLoc
+verHma: mov dx,offset TRANGROUP:DosHma_Ptr
+verPrintLoc:
+ invoke Std_Printf
+verDone:
+ jmp Crlf2
+
+Print_Version:
+ mov ah,GET_VERSION
+ int 21h
+ push ax
+ xor ah,ah
+ mov Major_Ver_Num,ax
+ pop ax
+ xchg ah,al
+ xor ah,ah
+ mov Minor_Ver_Num,ax
+ mov dx,offset TRANGROUP:VerMes_Ptr
+ jmp Std_Printf
+
+
+
+
+ assume ds:TRANGROUP,es:TRANGROUP
+print_prompt:
+ push ds
+ push cs
+ pop ds ; MAKE SURE DS IS IN TRANGROUP
+ push es
+ invoke find_prompt ; LOOK FOR PROMPT STRING
+ jc PP0 ; CAN'T FIND ONE
+ cmp byte ptr es:[di],0
+ jnz PP1
+PP0:
+ call print_drive ; USE DEFAULT PROMPT
+ mov al,sym
+ call print_char
+ jmp short PP5
+
+PP1:
+ mov al,es:[di] ; GET A CHAR
+ inc di
+ or al,al
+ jz PP5 ; NUL TERMINATED
+ cmp al,dollar ; META CHARACTER?
+ jz PP2 ; NOPE
+PPP1:
+ call print_char
+ jmp PP1
+
+PP2:
+ mov al,es:[di]
+ inc di
+ mov bx,offset trangroup:prompt_table-3
+ or al,al
+ jz PP5
+
+PP3:
+ add bx,3
+ invoke upconv
+ cmp al,[bx]
+ jz PP4
+ cmp byte ptr [bx],0
+ jnz PP3
+ jmp PP1
+
+PP4:
+ push es
+ push di
+ push cs
+ pop es
+ call [bx+1]
+ pop di
+ pop es
+ jmp PP1
+
+PP5:
+ pop es ; RESTORE SEGMENTS
+ pop ds
+ return
+
+
+print_back:
+ mov dx,offset trangroup:dback_ptr
+ jmp std_printf
+
+print_EQ:
+ mov al,'='
+ jmp short print_char
+
+print_esc:
+ mov al,1BH
+ jmp short print_char
+
+print_G:
+ mov al,rabracket
+ jmp short print_char
+
+print_L:
+ mov al,labracket
+ jmp short print_char
+
+print_B:
+ mov al,vbar
+
+print_char:
+
+; Bugbug: Why bother with ds,es here?
+
+ push es
+ push ds
+ pop es
+ push di
+ push dx
+ mov dl,al ;AC000; Get char into al
+ mov ah,Std_CON_output ;AC000; print the char to stdout
+ int 21h ;AC000;
+ pop dx
+ pop di
+ pop es
+ ret
+
+print_drive:
+ mov ah,Get_Default_drive
+ int 21h
+ add al,capital_A
+ call print_char
+ ret
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+build_dir_for_prompt:
+ xor dl,dl
+ mov si,offset trangroup:bwdbuf
+ mov di,SI
+ mov al,CurDrv
+ add al,'A'
+ mov ah,':'
+ stosw
+ mov al,[dirchar]
+ stosb
+ xchg si,di
+ mov string_ptr_2,di
+ mov ah,Current_dir
+ int 21h
+ mov dx,offset trangroup:string_buf_ptr
+ jnc DoPrint
+ mov dx,offset trangroup:BadCurDrv
+DoPrint:
+ call std_printf
+
+ ret
+
+build_dir_for_chdir:
+ call build_dir_string
+ mov dx,offset trangroup:bwdbuf
+ mov string_ptr_2,dx
+ mov dx,offset trangroup:string_buf_ptr
+ call std_printf
+ ret
+
+build_dir_string:
+ mov dl,ds:[FCB]
+ mov al,DL
+ add al,'@'
+ cmp al,'@'
+ jnz gotdrive
+ add al,[CURDRV]
+ inc al
+
+gotdrive:
+ push ax
+ mov si,offset trangroup:bwdbuf+3
+ mov ah,Current_dir
+ int 21h
+ jnc dpbisok
+ push cs
+ pop ds
+ jmp drvbad
+
+dpbisok:
+ mov di,offset trangroup:bwdbuf
+ mov dx,di
+ pop ax
+ mov ah,':'
+ stosw
+ mov al,[dirchar]
+ stosb
+
+ ret
+
+ break Path
+assume ds:trangroup,es:trangroup
+
+PATH:
+ xor al,al ;AN049; Set up holding buffer
+ mov di,offset Trangroup:srcxname ;AN049; for PATH while parsing
+ stosb ;AN049; Initialize PATH to null
+ dec di ;AN049; point to the start of buffer
+ invoke PGetarg ; Pre scan for arguments
+ jz disppath ; Print the current path
+ cmp al,semicolon ;AC049; NUL path argument?
+ jnz pathslp ;AC049;
+ inc si ;AN049; point past semicolon
+ jmp short scan_white ;AC049; Yes - make sure nothing else on line
+
+pathslp: ; Get the user specified path
+ lodsb ; Get a character
+ cmp al,end_of_line_in ;AC049; Is it end of line?
+ jz path_eol ;AC049; yes - end of command
+
+ invoke testkanj ;See if DBCS
+ jz notkanj2 ;No - continue
+ stosb ;AC049; Yes - store the first byte
+ lodsb ;skip second byte of DBCS
+
+path_hold: ;AN049;
+ stosb ;AC049; Store a byte in the PATH buffer
+ jmp short pathslp ;continue parsing
+
+notkanj2:
+ invoke upconv ;upper case the character
+ cmp al,semicolon ;AC049; ';' not a delimiter on PATH
+ jz path_hold ;AC049; go store it
+ invoke delim ;delimiter?
+ jnz path_hold ;AC049; no - go store character
+
+scan_white: ;AN049; make sure were at EOL
+ lodsb ;AN049; get a character
+ cmp al,end_of_line_in ;AN049; end of line?
+ jz path_eol ;AN049; yes - go set path
+ cmp al,blank ;AN049; whitespace?
+ jz scan_white ;AN049; yes - continue scanning
+ cmp al,tab_chr ;AN049; whitespace?
+ jz scan_white ;AN049; yes - continue scanning
+
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AN049; no - set up error message
+ mov Extend_Buf_ptr,MoreArgs_ptr ;AN049; get "Too many parameters" message number
+ mov msg_disp_class,parse_msg_class ;AN049; set up parse error msg class
+ jmp cerror ;AN049;
+
+path_eol: ;AN049; Parsing was clean
+ xor al,al ;AN049; null terminate the PATH
+ stosb ;AN049; buffer
+ invoke find_path ;AN049; Find PATH in environment
+ invoke delete_path ;AC049; Delete any offending name
+ invoke scan_double_null ;AC049; Scan to end of environment
+ invoke move_name ;AC049; move in PATH=
+ mov si,offset Trangroup:srcxname ;AN049; Set up source as PATH buffer
+
+store_path: ;AN049; Store the PATH in the environment
+ lodsb ;AN049; Get a character
+ cmp al,end_of_line_out ;AN049; null character?
+ jz got_paths ;AN049; yes - exit
+ invoke store_char ;AN049; no - store character
+ jmp short store_path ;AN049; continue
+
+got_paths: ;AN049; we're finished
+ xor ax,ax ;null terminate the PATH in
+ stosw ; the environment
+ return
+
+disppath:
+ invoke find_path ;AN049;
+ call print_path
+ call crlf2
+ return
+
+print_path:
+ cmp byte ptr es:[di],0
+ jnz path1
+
+path0:
+ mov dx,offset trangroup:nulpath_ptr
+ push cs
+ pop es
+ push cs
+ pop ds
+ jmp std_printf
+
+path1:
+ push es
+ pop ds
+ sub di,5
+ mov si,di
+ASSUME DS:RESGROUP
+ xor al,al ; count str len to copy
+ mov cx,128 ; up to arg_bug len
+ repnz scasb
+ mov cx,di
+ sub cx,si
+
+ push cs
+ pop es
+ mov di,offset trangroup:arg_buf
+ rep movsb
+ mov dx,offset trangroup:arg_buf_ptr
+ push cs
+ pop ds
+ jmp std_printf
+
+ASSUME DS:TRANGROUP
+
+ break Cls
+
+; ****************************************************************
+; *
+; * ROUTINE: CLS
+; *
+; * FUNCTION: Clear the screen using INT 10h. If ANSI.SYS is
+; * installed, send a control string to clear the
+; * screen.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+ANSI_installed equ 0ffh
+
+CLS:
+ mov ah,Mult_ANSI ;AN000; see if ANSI.SYS installed
+ mov al,0 ;AN000;
+ int 2fh ;AN000;
+ cmp al,ANSI_installed ;AN000;
+ jz ansicls ;AN000; installed - go do ANSI CLS
+
+check_lines:
+ mov ax,(IOCTL SHL 8) + generic_ioctl_handle ;AN000; get lines per page on display
+ mov bx,stdout ;AN000; lines for stdout
+ mov ch,ioc_sc ;AN000; type is display
+ mov cl,get_generic ;AN000; get information
+ mov dx,offset trangroup:display_ioctl ;AN000;
+ int 21h ;AN000;
+ jc no_variable ;AN000; function had error, use default
+ mov ax,linperpag ;AN000; get number of rows returned
+ mov dh,al ;AN000; set number of rows
+ mov ax,display_width ;AN000; get number of columns returned
+ mov dl,al ;AN000; set number of columns
+ jmp short regcls ;AN000; go do cls
+
+no_variable:
+ mov bx,stdout ;AC000; set handle as stdout
+ mov ax,IOCTL SHL 8 ;AC000; do ioctl - get device
+ int 21h ;AC000; info
+ test dl,devid_ISDEV ;AC000; is handle a device
+ jz ANSICLS ;AC000; If a file put out ANSI
+ test dl,devid_SPECIAL ;AC000;
+ jnz cls_normal ;AC000; If not special CON, do ANSI
+
+ansicls:
+ call ansi_cls ;AN000; clear the screen
+ jmp short cls_ret ;AN000; exit
+
+;
+; Get video mode
+;
+
+cls_normal: ;AC000;
+
+ mov ah,get_video_state ;AC000; set up to get video state
+ int video_io_int ;AC000; do int 10h - BIOS video IO
+ cmp al,video_alpha ;AC000; see if in text mode
+ jbe DoAlpha
+ cmp al,video_bw ;AC000; see if black & white card
+ jz DoAlpha
+;
+; We are in graphics mode. Bogus IBM ROM does not scroll correctly. We will
+; be just as bogus and set the mode that we just got. This will blank the
+; screen too.
+;
+ mov ah,set_video_mode ;AC000; set video mode call
+ int video_io_int ;AC000; do int 10h - BIOS video IO
+ jmp short cls_ret ;AC000; exit
+
+DoAlpha:
+;
+; Get video mode and number of columns to scroll
+;
+
+;M01 - INT 10 Function 0F doesn't reliably return the number of rows on some
+;M01 adaptors. We circumvent this by reaching directly into the BIOS data
+;M01 area
+;M01 Commented out code here is the original
+;M01 mov ah,get_video_state ;AC000; set up to get current video state
+;M01 int video_io_int ;AC000; do int 10h - BIOS video IO
+;M01 mov dl,ah
+;M01 mov dh,linesperpage ;AC000; have 25 rows on the screen
+
+;M01 Following code lifted from a fix Compaq applied to ANSI
+
+ push ds
+ MOV AX,ROMBIOS_DATA ; GET ROM Data segment M01
+ MOV DS,AX ; * M01
+ Assume DS:ROMBIOS_DATA
+
+ mov dx,CRT_Cols ; Get Columns - assume < 256 M01
+ MOV dh,CRT_Rows ; GET MAX NUM OF ROWS M01
+ pop ds ; M01
+ Assume DS:Trangroup
+
+ or dh,dh ; Q:ZERO M01
+ jnz regcls ; *JMP IF NO M01
+
+ MOV dh,LINESPERPAGE ; SET TO 24 ROWS M01
+
+regcls:
+ inc dh ; height+1 M018
+ call reg_cls ; go clear the screen
+
+cls_ret:
+ ret ; exit
+
+; ****************************************************************
+; *
+; * ROUTINE: REG_CLS
+; *
+; * FUNCTION: Clear the screen using INT 10H.
+; *
+; * INPUT: DL = NUMBER OF COLUMNS
+; * DH = NUMBER OF ROWS
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+reg_cls proc near
+
+;
+; Set overscan to black.
+;
+
+ dec dh ; decrement rows and columns
+ dec dl ; to zero base
+ push dx ; save rows,columns
+ mov ah,set_color_palette ; set up to set the color to blank
+ xor bx,bx
+ int video_io_int ; do int 10h - BIOS video IO
+ pop dx ; retore rows,colums
+
+ xor ax,ax ; zero out ax
+ mov CX,ax ; an cx
+;
+; Scroll active page
+;
+ mov ah,scroll_video_page ; set up to scroll page up
+ mov bh,video_attribute ; attribute for blank line
+ xor bl,bl ; set BL to 0
+ int video_io_int ; do int 10h - BIOS video IO
+;
+; Seek to cursor to 0,0
+;
+;M022 following two lines added
+ mov ah,get_video_state ; get current video page in BH
+ int video_io_int
+ mov ah,set_cursor_position ; set up to set cursor position
+ xor dx,dx ; row and column 0
+;M022 mov bh.0
+ int video_io_int ; do into 10h - BIOS video IO
+
+ ret
+
+reg_cls endp
+
+
+
+; ****************************************************************
+; *
+; * ROUTINE: ANSI_CLS
+; *
+; * FUNCTION: Clear the screen using by writing a control code
+; * to STDOUT.
+; *
+; * INPUT: none
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+ansi_cls proc near ;AC000;
+
+ mov si,offset trangroup:clsstring
+ lodsb
+ mov cl,al
+ xor ch,ch
+ mov ah,Raw_CON_IO
+clrloop:
+ lodsb
+ mov DL,al
+ int 21h
+ loop clrloop
+ return
+
+ansi_cls endp ;AC000;
+
+trancode ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/tcmd2b.asm b/private/mvdm/dos/v86/cmd/command/tcmd2b.asm
new file mode 100644
index 000000000..f7e3c0cf4
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tcmd2b.asm
@@ -0,0 +1,638 @@
+ page ,132
+; SCCSID = @(#)tcmd2b.asm 4.1 85/09/22
+; SCCSID = @(#)tcmd2b.asm 4.1 85/09/22
+TITLE PART5 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include pdb.inc
+ include mult.inc
+ include comseg.asm
+ include comequ.asm
+ include cmdsvc.inc
+.list
+.cref
+
+
+;;CODERES SEGMENT PUBLIC BYTE ;AC000;
+;; EXTRN LODCOM1:NEAR
+;;CODERES ENDS
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN crit_msg_off:word ;AC000;
+ EXTRN crit_msg_seg:word ;AC000;
+ EXTRN IO_SAVE:WORD
+ EXTRN OldTerm:DWORD
+ EXTRN PARENT:WORD
+;AD060; EXTRN pars_msg_off:word ;AC000;
+;AD060; EXTRN pars_msg_seg:word ;AC000;
+ EXTRN PERMCOM:BYTE ;AN045;
+ EXTRN RetCode:WORD
+ EXTRN SingleCom:word
+
+ extrn TrnLodCom1_Trap:far
+
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN ACRLF_PTR:WORD ;AN007;
+ EXTRN baddev_ptr:word
+ EXTRN CP_active_Ptr:word
+ EXTRN CP_not_all_Ptr:word
+ EXTRN CP_not_set_Ptr:word
+ EXTRN Extend_buf_ptr:word ;AN000;
+ EXTRN Extend_buf_sub:byte ;AN000;
+ EXTRN inv_code_page:word ;AC000;
+ EXTRN msg_disp_class:byte ;AN000;
+ EXTRN NLSFUNC_Ptr:word ;AC000;
+ EXTRN parse_chcp:byte ;AC000;
+ EXTRN parse_chdir:byte ;AC000;
+ EXTRN parse_ctty:byte ;AC000;
+ EXTRN string_buf_ptr:word ;AC000;
+
+ extrn NoCntry_Ptr:word ;M045
+
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN COMBUF:BYTE
+ EXTRN parse_last:word ;AN018;
+ EXTRN parse1_addr:dword ;AC000;
+ EXTRN parse1_type:byte ;AC000;
+ EXTRN RESSEG:WORD
+ EXTRN srcbuf:byte
+ EXTRN srcxname:byte ;AC000;
+ EXTRN string_ptr_2:word
+ EXTRN system_cpage:word
+ EXTRN TRAN_TPA:WORD
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;---------------
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+TRANSPACE ENDS
+;---------------
+
+ EXTRN cerror:near
+ extrn TCommand:near
+
+ PUBLIC $exit
+ PUBLIC chcp
+ PUBLIC ctty
+ PUBLIC parse_check_eol ;AN000;
+ PUBLIC parse_with_msg ;AN018;
+ PUBLIC setup_parse_error_msg ;AN018;
+ PUBLIC truename ;AN000;
+
+ break Ctty
+assume ds:trangroup,es:trangroup
+
+; ****************************************************************
+; *
+; * ROUTINE: CTTY - Change console
+; *
+; * SYNTAX: CTTY device
+; *
+; * FUNCTION: If a valid console device is specified, CTTY will
+; * duplicate the device handle to STDIN, STDOUT and
+; * STDERR. This routine returns to LODCOM1.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+CTTY:
+ push ds ;AN000; Get local ES
+ pop es ;AN000;
+ mov si,81H ;AC000; Get command argument for CTTY
+
+ mov di,offset trangroup:parse_ctty ;AC000; Get adderss of PARSE_CTTY
+ xor cx,cx ;AC000; clear cx,dx
+ xor dx,dx ;AC000;
+ invoke cmd_parse ;AC000; call parser
+ cmp ax,end_of_line ;AN000; are we at end of line?
+ jz ctty_error ;AN000; yes - error
+ cmp ax,result_no_error ;AN000; did an error occur
+ jnz ctty_error ;AN000; YES -ERROR
+
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AN000; get address of filespec
+ mov di,offset trangroup:srcbuf ;AN000; get address of srcbuf
+
+ctty_move_filename: ;AN000; put filespec in srcbuf
+ lodsb ;AN000; get a char from buffer
+ stosb ;AN000; store in srcbuf
+ cmp al,end_of_line_out ;AN000; it char a terminator?
+ jnz ctty_move_filename ;AN000; no - keep moving
+ pop si ;AN000; get line position back
+ mov di,offset trangroup:parse_ctty ;AC000; Get adderss of PARSE_CTTY
+ call parse_check_eol ;AN000; are we at end of line?
+ jz nocolon ;AN000; yes - continue
+
+ctty_error:
+ jmp short isbaddev ;AC000; yes - exit
+
+nocolon:
+ mov dx,offset trangroup:srcbuf ;AN000; get address of srcbuf
+ MOV AX,(OPEN SHL 8) OR 2 ; Read and write
+ INT 21h ; Open new device
+ JC ISBADDEV
+ MOV BX,AX
+ MOV AX,IOCTL SHL 8
+ INT 21h
+ TEST DL,80H
+ JNZ DEVISOK
+
+CLOSEDEV: ;AN007;
+ MOV AH,CLOSE ; Close initial handle
+ INT 21h
+
+ISBADDEV:
+ MOV DX,OFFSET TRANGROUP:BADDEV_ptr
+ invoke std_printf
+ JMP SHORT RESRET
+
+DEVISOK:
+ push dx ;AN007; save device info
+ mov ax,acrlf_ptr ;AN021; get message number for 0d, 0a
+ mov dh,util_msg_class ;AN021; this is a utility message
+ push bx ;AN021; save handle
+ invoke Tsysgetmsg ;AN021; get the address of the message
+ mov dx,si ;AN021; get address into dx
+ mov ax,(write shl 8) ;AN007; write to device
+ mov cx,2 ;AN007; write two bytes
+ int 21h ;AN007;
+ pop bx ;AN021; get back handle
+ pop dx ;AN007; get back device info
+ jc closedev ;AN007; if error, quit
+ XOR DH,DH
+ OR DL,3 ; Make sure has CON attributes
+ MOV AX,(IOCTL SHL 8) OR 1
+ INT 21h
+ PUSH BX ; Save handle
+ MOV CX,3
+ XOR BX,BX
+
+ICLLOOP: ; Close basic handles
+ MOV AH,CLOSE
+ INT 21h
+ INC BX
+ LOOP ICLLOOP
+ POP BX ; Get handle
+ MOV AH,XDUP
+ INT 21h ; Dup it to 0
+ MOV AH,XDUP
+ INT 21h ; Dup to 1
+ MOV AH,XDUP
+ INT 21h ; Dup to 2
+ MOV AH,CLOSE ; Close initial handle
+ INT 21h
+
+RESRET:
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ PUSH DS
+ MOV AX,WORD PTR DS:[PDB_JFN_Table] ; Get new 0 and 1
+ MOV [IO_SAVE],AX
+ MOV AX,OFFSET DATARES:TrnLodCom1_Trap
+ PUSH AX
+
+ZMMMM PROC FAR
+ RET ; Force header to be checked
+ZMMMM ENDP
+
+ break Chcp
+
+;****************************************************************
+;*
+;* ROUTINE: CHCP - Change code page internal command
+;* (added DOS 3.30 07/21/86)
+;*
+;* SYNTAX: CHCP [xxx]
+;* where xxx is a valid code page
+;*
+;* FUNCTION: If xxx is specified, CHCP will use INT 21H function
+;* 6402H to set the code page to xxxx. If no parameters
+;* are specified, CHCP will use INT 21H function 6401H
+;* to get global code page and display it to the user.
+;*
+;* INPUT: command line at offset 81H
+;*
+;* OUTPUT: none
+;*
+;****************************************************************
+
+NLSFUNC_installed equ 0ffh
+set_global_cp equ 2
+get_global_cp equ 1
+
+assume ds:trangroup,es:trangroup
+
+CHCP:
+ push ds ;AN000; Get local ES
+ pop es ;AN000;
+ mov si,81H ;AC000; Get command argument for CHCP
+
+ mov di,offset trangroup:parse_chcp ;AN000; Get adderss of PARSE_CHCP
+ xor cx,cx ;AC000; clear cx,dx
+ xor dx,dx ;AC000;
+ call parse_with_msg ;AC018; call parser
+ cmp ax,end_of_line ;AN000; are we at end of line?
+
+;; jnz setcp ;AC000; no go get number & set code page
+ jz getcp ;AC000; yes - no parm - get code page
+
+setcp:
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne cp_error ;AC018; yes - go issue message
+
+ push cx ;AN000; save positional count
+ mov bx,offset trangroup:parse1_addr ;AN000; get number returned
+ mov cx,word ptr [bx] ;AN000; into cx
+ mov system_cpage,cx ;AN000; save user input number
+ pop cx ;AC000; restore positional count
+ mov di,offset trangroup:parse_chcp ;AN000; Get adderss of PARSE_CHCP
+ call parse_check_eol ;AN000; are we at end of line?
+ jnz cp_error ;AC000; no - exit
+
+okset:
+ mov ah,NLSFUNC ;AN000; see if NLSFUNC installed
+ mov al,0 ;AN000;
+ int 2fh ;AN000;
+ cmp al,NLSFUNC_installed ;AN000;
+ jz got_NLS ;AN000; Yes - continue
+ mov dx,offset trangroup:NLSFUNC_ptr ;AN000; no - set up error message
+ jmp short cp_error ;AN000; error exit
+
+got_NLS:
+ mov bx,system_cpage ;AN000; get user input code page
+ mov ah,getsetcdpg ;get/set global code page function
+ mov al,set_global_cp ;minor - set
+ int 21h
+ jnc chcp_return ;no error - exit
+;
+;added for p716
+;
+ cmp ax,error_file_not_found ;p716 was the error file not found?
+ jnz chcp_other_error ;no - country.sys was found
+
+ mov ah,GetExtendedError ;p850 see if error is invalid data
+ xor bx,bx ; which is file was found but CP
+ int 21h ; information was not found.
+ cmp ax,error_invalid_data ;AC000; invalid code page
+ jnz no_countrysys ;no - use file not found
+ mov dx,offset trangroup:inv_code_page ;AN000; get message
+ jmp short cp_error ;AC000; error exit
+
+no_countrysys:
+;M045; mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+;M045; mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+;M045; mov Extend_Buf_ptr,error_file_not_found ;AN000; get message number in control block
+
+ mov dx,offset TRANGROUP:NoCntry_Ptr ;M045
+
+ jmp short cp_error ;AC000; error exit
+
+chcp_other_error:
+;
+; end of p716
+;
+ mov ah,GetExtendedError ;error - see what it is
+ xor bx,bx
+ int 21h
+ cmp ax,65 ;was it access denied?
+ jnz none_set ;no - assume all failed
+ mov dx,offset trangroup:cp_not_all_ptr ;set up message
+ jmp short cp_error ;AC000; error exit
+
+none_set:
+ mov dx,offset trangroup:cp_not_set_ptr ;set up message
+cp_error: ;AN000;
+ jmp cerror ;exit
+
+getcp:
+ mov ah,getsetcdpg ;get/set global code page function
+ mov al,get_global_cp ;minor - get
+ int 21h
+ mov system_cpage,bx ;get active cp for output
+ mov dx,offset trangroup:cp_active_ptr
+ invoke std_printf ;print it out
+
+chcp_return:
+
+ RET
+
+ break TRUENAME ;AN000;
+
+
+; ****************************************************************
+; *
+; * ROUTINE: TRUENAME
+; *
+; * FUNCTION: Entry point for the internal TRUENAME command.
+; * Parses the command line. If a path is found, set
+; * SRCXNAME to path. If only a drive letter is
+; * found, set SRCXNAME to the drive letter. If
+; * no path is found, set the path of SRCXNAME to
+; * dot (.) for current directory. Use the NAME
+; * TRANSLATE system call to get the real name and
+; * then display the real name. If an error occurs
+; * issue an error message and transfer control to
+; * CERROR.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup ;AN000;
+
+TRUENAME: ;AN000; TRUENAME entry point
+ push ds ;AN000; Get local ES
+ pop es ;AN000;
+ mov si,81H ;AN000; Get command line
+ mov di,offset trangroup:parse_chdir ;AN000; Get adderss of PARSE_CHDIR
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ call parse_with_msg ;AC018; call parser
+
+ mov di,offset trangroup:srcxname ;AN000; get address of srcxname
+ cmp ax,end_of_line ;AN000; are we at end of line?
+ je tn_eol ;AN000; yes - go process
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne tn_parse_error ;AN000; yes - go issue message
+ cmp parse1_type,result_drive ;AN000; was a drive entered?
+ je tn_drive ;AN000; yes - go process
+ jmp short tn_filespec ;AN000; nothing else - must be filespec
+
+tn_eol: ;AN000; no parameters on line
+ mov ah,end_of_line_out ;AN000; set buffer to .
+ mov al,dot_chr ;AN000; for current dir
+ stosw ;AN000; store in srcxname
+ jmp short tn_doit ;AN000; go do command
+
+tn_drive: ;AN000; a drive was entered
+ push si ;AN000; save position in line
+ mov si,offset trangroup:parse1_addr ;AN000; get address of drive
+ lodsb ;AN000; get the drive number
+ add al,"A"-1 ;AN000; convert it to char
+ stosb ;AN000; store it in srcxname
+ mov ax,dot_colon ;AN000; get colon and . and
+ stosw ;AN000; store in srcxname
+ mov al,end_of_line_out ;AN000; put a terminator char
+ stosb ;AN000;
+ pop si ;AN000; get line position back
+ jmp short tn_check_eol ;AN000; check to make sure eol
+
+tn_filespec: ;AN000; a filespec was entered
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AN000; get address of filespec
+
+tn_move_filename: ;AN000; put filespec in srcxname
+ lodsb ;AN000; get a char from buffer
+ stosb ;AN000; store in srcxname
+ cmp al,end_of_line_out ;AN000; it char a terminator?
+ jnz tn_move_filename ;AN000; no - keep moving
+ pop si ;AN000; get line position back
+
+tn_check_eol: ;AN000; make sure no extra parms
+ mov di,offset trangroup:parse_chdir ;AN000; get address of parse_chdir
+ call parse_check_eol ;AN000; are we at end of line?
+ je tn_doit ;AN000; Yes - do the command
+
+tn_parse_error: ;AN000; A parse error occurred
+ jmp cerror ;AN000; Go to error routine
+
+tn_doit: ;AN000;
+ mov si,offset trangroup:srcxname ;AN000; set up srcxname as source
+ mov di,offset trangroup:combuf ;AN000; set up combuf as target (need big target)
+ mov ah,xnametrans ;AN000; do name translate call
+ int 21h ;AN000;
+ jnc tn_print_xname ;AN000; If no error - print result
+
+ invoke Set_ext_error_msg ;AN000; get extended message
+ mov string_ptr_2,offset trangroup:srcxname ;AN000; get address of failed string
+ mov Extend_buf_sub,one_subst ;AN000; put number of subst in control block
+ jmp cerror ;AN000; Go to error routine
+
+tn_print_xname: ;AN000;
+ mov string_ptr_2,offset Trangroup:combuf ;AN000; Set up address of combuf
+ mov dx,offset trangroup:string_buf_ptr ;AN000; Set up address of print control block
+ invoke crlf2 ;AN000; print a crlf
+ invoke printf_crlf ;AN000; print it out
+
+ ret ;AN000;
+
+ break $Exit
+
+assume ds:trangroup,es:trangroup
+
+$EXIT:
+ push ds ;AN000; save data segment
+ mov ds,[resseg] ;AN000; get resident data segment
+
+assume ds:resgroup ;AN000;
+
+ cmp [permcom],0 ;AN045; is this a permanent COMMAND?
+ jz free_com ;AN045; no - free everything
+
+; We're a permanent command.
+; Unless this is a singlecom (int 2Eh), don't deallocate transient.
+
+ cmp [singlecom],-1 ;M034
+ je no_reset ;M034 ;exit singlecom
+
+; jmp TCommand ;permanent command, recycle
+
+;Sudeepb 05-Jul-1991; Removed above jmp to terminate the top level
+; command.com.
+ CMDSVC SVC_CMDEXITVDM ; Never returns
+ int 3
+
+;AD060; mov ah,multdos ;AN000; reset parse message pointers
+;AD060; mov al,message_2f ;AN000; call for message retriever
+;AD060; mov dl,set_parse_msg ;AN000; set up parse message address
+;AD060; mov di,pars_msg_off ;AN000; old offset of parse messages
+;AD060; mov es,pars_msg_seg ;AN000; old segment of parse messages
+;AD060; int 2fh ;AN000; go set it
+
+;AD060; mov ah,multdos ;AN000; set up to call DOS through int 2fh
+;AD060; mov al,message_2f ;AN000; call for message retriever
+
+free_com:
+ mov ax,(multdos shl 8 or message_2f);AN060; reset parse message pointers
+ mov dl,set_critical_msg ;AN000; set up critical error message address
+ mov di,crit_msg_off ;AN000; old offset of critical messages
+ mov es,crit_msg_seg ;AN000; old segment of critical messages
+ int 2fh ;AN000; go set it
+no_reset: ;AN045;
+ pop ds ;AN000; restore local data segment
+
+assume ds:trangroup ;AN000;
+;
+;M040
+; Restore user directory if the restore flag is set. RestUDir1 checks for
+;this, restores user dir if flag is set and resets the flag.
+;
+ invoke RestUDir1 ;restore user dir if needed ;M040
+ MOV ES,[RESSEG]
+
+assume es:resgroup
+
+ MOV AX,[PARENT]
+ MOV WORD PTR ES:[PDB_Parent_PID],AX
+ MOV AX,WORD PTR OldTerm
+ MOV WORD PTR ES:[PDB_Exit],AX
+ MOV AX,WORD PTR OldTerm+2
+ MOV WORD PTR ES:[PDB_Exit+2],AX
+
+ PUSH ES
+ MOV ES,[TRAN_TPA]
+ MOV AH,DEALLOC
+ INT 21h ; Now running in "free" space
+ POP ES
+
+ MOV AH,Exit
+ MOV AL,BYTE PTR RetCode
+ INT 21h
+
+
+; ****************************************************************
+; *
+; * ROUTINE: PARSE_CHECK_EOL
+; *
+; * FUNCTION: Calls parser to see if end of line occurred.
+; * If not end of line, set up to print parse
+; * error message. ASSUMES NO MORE PARAMETERS ARE
+; * EXPECTED!
+; *
+; * INPUT: DS:SI last output from parser
+; * ES:DI points to parse block
+; * CX last output from parser
+; *
+; * OUTPUT: AX parser return code
+; *
+; * if end of line found
+; * zero flag set
+; * else
+; * MSG_DISPLAY_CLASS set to parse error
+; *
+; ****************************************************************
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN000;
+
+parse_check_eol Proc near ;AN000;
+
+ xor dx,dx ;AN000;
+ mov [parse_last],si ;AN018; save start of parameter
+ invoke cmd_parse ;AN000; call parser
+ cmp al,end_of_line ;AN000; Are we at end of line?
+ jz parse_good_eol ;AN000; yes - no problem
+
+ cmp ax,result_no_error ;AN018; was any error found?
+ jnz ok_to_setup_pmsg ;AN018; yes - continue
+ inc ax ;AN018; set AX to 1 and turn off zero flag
+
+ok_to_setup_pmsg:
+ call setup_parse_error_msg ;AN018; go set up error message
+
+parse_good_eol:
+ ret ;AN000;
+
+parse_check_eol endp ;AN000;
+
+; ****************************************************************
+; *
+; * ROUTINE: PARSE_WITH_MSG
+; *
+; * FUNCTION: Calls parser. If an error occurred, the error
+; * message is set up.
+; *
+; * INPUT: DS:SI last output from parser
+; * ES:DI points to parse block
+; * CX last output from parser
+; *
+; * OUTPUT: AX parser return code
+; *
+; * if no error
+; * outputs from parser
+; * else
+; * MSG_DISPLAY_CLASS set to parse error
+; * error message set up for STD_PRINTF
+; *
+; ****************************************************************
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN018;
+
+parse_with_msg Proc near ;AN018;
+
+ mov [parse_last],si ;AN018; save start of parameter
+ invoke cmd_parse ;AN018; call parser
+ cmp al,end_of_line ;AN018; Are we at end of line?
+ jz parse_msg_good ;AN018; yes - no problem
+ cmp ax,result_no_error ;AN018; did an error occur
+ jz parse_msg_good ;AN018; yes - no problem
+
+ call setup_parse_error_msg ;AN018; go set up error message
+
+parse_msg_good:
+ ret ;AN018;
+
+parse_with_msg endp ;AN018;
+
+; ****************************************************************
+; *
+; * ROUTINE: SETUP_PARSE_ERROR_MSG
+; *
+; * FUNCTION: Calls parser. If an error occurred, the error
+; * message is set up.
+; *
+; * INPUT: AX Parse error number
+; * SI Set to past last parameter
+; * Parse_last Set to start of last parameter
+; *
+; * OUTPUT: MSG_DISPLAY_CLASS set to parse error
+; * error message set up for STD_PRINTF
+; *
+; ****************************************************************
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING ;AN018;
+
+SETUP_PARSE_ERROR_MSG Proc near ;AN018;
+
+ mov msg_disp_class,parse_msg_class ;AC018; Set up parse message class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC018; get extended message pointer
+ mov byte ptr [si],end_of_line_out ;AC018; terminate the parameter string
+ mov Extend_Buf_ptr,ax ;AC018; get message number in control block
+ cmp ax,lessargs_ptr ;AC018; if required parameter missing
+ jz Setup_parse_msg_ret ;AN018; no subst
+ mov si,[parse_last] ;AC018; get start of parameter
+ mov string_ptr_2,si ;AC018; get address of failed string
+ mov Extend_buf_sub,one_subst ;AC018; put number of subst in control block
+
+setup_parse_msg_ret:
+ inc si ;AN018; make sure zero flag not set
+
+ ret ;AC018;
+
+SETUP_PARSE_ERROR_MSG Endp ;AN018;
+
+trancode ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/tcode.asm b/private/mvdm/dos/v86/cmd/command/tcode.asm
new file mode 100644
index 000000000..0f4638bd4
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tcode.asm
@@ -0,0 +1,1657 @@
+ page ,132
+; SCCSID = @(#)tcode.asm 1.1 85/05/14
+; SCCSID = @(#)tcode.asm 1.1 85/05/14
+TITLE Part1 COMMAND Transient Routines
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M025 SR 9/12/90 Removed calls to SetStdInOn,SetStdInOff
+; SetStdOutOn & SetStdOutOff.
+;
+
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include comseg.asm
+ include comequ.asm
+ include cmdsvc.inc
+ include mult.inc
+ include vint.inc
+.list
+.cref
+
+Prompt32 equ 1
+Start16 equ 0
+Return16 equ 1
+DOSONLY_YES equ 1
+FOR_TSR equ 0
+FOR_SHELLOUT equ 1
+
+
+CODERES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN EXEC_WAIT:NEAR
+CODERES ENDS
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BATCH:WORD
+ EXTRN CALL_BATCH_FLAG:byte
+ EXTRN CALL_FLAG:BYTE
+ EXTRN ECHOFLAG:BYTE
+ EXTRN envirseg:word
+ EXTRN EXTCOM:BYTE
+ EXTRN FORFLAG:BYTE
+ EXTRN IFFLAG:BYTE
+ EXTRN next_batch:word
+ EXTRN nullflag:byte
+ EXTRN PIPEFILES:BYTE
+ EXTRN PIPEFLAG:BYTE
+ EXTRN RE_OUT_APP:BYTE
+ EXTRN RE_OUTSTR:BYTE
+ EXTRN RESTDIR:BYTE
+ EXTRN SINGLECOM:WORD
+ EXTRN VERVAL:WORD
+ EXTRN SCS_Is_First:BYTE
+ EXTRN SCS_PAUSE:BYTE
+ EXTRN SCS_REENTERED:BYTE
+ EXTRN SCS_FIRSTCOM:BYTE
+ EXTRN SCS_CMDPROMPT:BYTE
+ EXTRN SCS_DOSONLY:BYTE
+ EXTRN SCS_PROMPT16:BYTE
+ EXTRN SCS_FIRSTTSR:BYTE
+ EXTRN RES_RDRINFO:DWORD
+ EXTRN RES_BATSTATUS:BYTE
+ EXTRN crit_msg_off:word ;AC000;
+ EXTRN crit_msg_seg:word ;AC000;
+ EXTRN OldTerm:DWORD
+ EXTRN PARENT:WORD
+ extrn RetCode:word
+ extrn Io_Save:word
+ extrn Io_Stderr:byte
+ extrn RES_TPA:WORD ; YST
+ extrn LTPA:WORD ; YST
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BadNam_Ptr:word ;AC000;
+ EXTRN comspec:byte
+ EXTRN NT_INTRNL_CMND:byte
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN APPEND_EXEC:BYTE ;AN041;
+ EXTRN ARG1S:WORD
+ EXTRN ARG2S:WORD
+ EXTRN ARGTS:WORD
+ EXTRN BYTCNT:WORD
+ EXTRN COMBUF:BYTE
+ EXTRN COMSW:WORD
+ EXTRN CURDRV:BYTE
+ EXTRN HEADCALL:DWORD
+ EXTRN IDLEN:BYTE
+ EXTRN INTERNATVARS:BYTE
+ EXTRN PARM1:BYTE
+ EXTRN PARM2:BYTE
+ EXTRN RE_INSTR:BYTE
+ EXTRN RESSEG:WORD
+ EXTRN SPECDRV:BYTE
+ EXTRN STACK:WORD
+ EXTRN SWITCHAR:BYTE
+ EXTRN TPA:WORD
+ EXTRN UCOMBUF:BYTE
+ EXTRN USERDIR1:BYTE
+ IF IBM
+ EXTRN ROM_CALL:BYTE
+ EXTRN ROM_CS:WORD
+ EXTRN ROM_IP:WORD
+ ENDIF
+ EXTRN ENV_PTR_SEG:WORD
+ EXTRN ENV_SIZE:WORD
+ EXTRN SCS_TSREXIT:WORD
+ EXTRN CMD_PTR_SEG:WORD
+ EXTRN CMD_PTR_OFF:WORD
+ EXTRN CMD_SIZE:WORD
+ EXTRN SCS_EXIT_CODE:WORD
+ EXTRN SCS_RDRINFO:DWORD
+ EXTRN SCS_BATSTATUS:DWORD
+ EXTRN SCS_NUM_DRIVES:WORD
+ EXTRN SCS_CUR_DRIVE:WORD
+ EXTRN SCS_CODEPAGE:WORD
+ EXTRN SCS_STD_HANDLE:WORD
+ EXTRN SCS_STD_BITS:BYTE
+ EXTRN EXECPATH_SEG:WORD
+ EXTRN EXECPATH_OFF:WORD
+ EXTRN EXECPATH_SIZE:WORD
+ EXTRN EXECPATH:BYTE
+
+ EXTRN TRAN_TPA:WORD
+ extrn transpaceend:byte ; (YST)
+
+TRANSPACE ENDS
+
+; (YST)
+TAIL segment public para
+extrn TranStart:word
+TAIL ENDS
+; End of (YST)
+
+
+; ********************************************************************
+; START OF TRANSIENT PORTION
+; This code is loaded at the end of memory and may be overwritten by
+; memory-intensive user programs.
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN $EXIT:NEAR
+ EXTRN DRVBAD:NEAR
+ EXTRN EXTERNAL:NEAR
+ EXTRN FNDCOM:NEAR
+ EXTRN FORPROC:NEAR
+ EXTRN PIPEPROC:NEAR
+ EXTRN PIPEPROCSTRT:NEAR
+ EXTRN GETENVSIZ:near
+
+ PUBLIC COMMAND
+ PUBLIC DOCOM
+ PUBLIC DOCOM1
+ PUBLIC NOPIPEPROC
+ PUBLIC TCOMMAND
+
+ IF IBM
+ PUBLIC ROM_EXEC
+ PUBLIC ROM_SCAN
+ ENDIF
+
+
+; NTVDM use diff al value so we don't confuse dos 5.0
+; NTVDM command.com GET_COMMAND_STATE equ 5500h
+GET_COMMAND_STATE equ 5501h
+
+NLSFUNC_installed equ 0ffh
+KEYB16_installed equ 0ffh ; (YST)
+CHECK_KEYB16 equ 0AD80h ; (YST)
+set_global_cp equ 2
+get_global_cp equ 1
+
+
+ ORG 0
+ZERO = $
+
+ ORG 100H ; Allow for 100H parameter area
+
+SETDRV:
+ MOV AH,SET_DEFAULT_DRIVE
+ INT 21h
+;
+; TCOMMAND is the recycle point in COMMAND. Nothing is known here.
+; No registers (CS:IP) no flags, nothing.
+;
+
+TCOMMAND:
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV AX,-1
+ XCHG AX,[VERVAL]
+ CMP AX,-1
+ JZ NOSETVER2
+ MOV AH,SET_VERIFY_ON_WRITE ; AL has correct value
+ INT 21h
+
+NOSETVER2:
+ CALL [HEADCALL] ; Make sure header fixed
+ XOR BP,BP ; Flag transient not read
+ CMP [SINGLECOM],-1
+ JNZ COMMAND
+
+$EXITPREP:
+ PUSH CS
+ POP DS
+ JMP $EXIT ; Have finished the single command
+ASSUME DS:NOTHING
+;
+; Main entry point from resident portion.
+;
+; If BP <> 0, then we have just loaded transient portion otherwise we are
+; just beginning the processing of another command.
+;
+
+COMMAND:
+
+;
+; We are not always sure of the state of the world at this time. We presume
+; worst case and initialize the relevant registers: segments and stack.
+;
+ ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+ CLD
+ MOV AX,CS
+ FCLI
+ MOV SS,AX
+ASSUME SS:TRANGROUP
+ MOV SP,OFFSET TRANGROUP:STACK
+ FSTI
+ MOV ES,AX
+ MOV DS,AX ;AN000; set DS to transient
+ASSUME ES:TRANGROUP,DS:TRANGROUP ;AC000;
+ invoke TSYSLOADMSG ;AN000; preload messages
+ mov append_exec,0 ;AN041; set internal append state off
+
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+
+ MOV [UCOMBUF],COMBUFLEN ; Init UCOMBUF
+ MOV [COMBUF],COMBUFLEN ; Init COMBUF (Autoexec doing DATE)
+
+ mov [EXECPATH_SIZE], 0 ; ntvdm execpath extended
+
+;
+; If we have just loaded the transient, then we do NOT need to initialize the
+; command buffer. ???? DO WE NEED TO RESTORE THE USERS DIRECTORY ???? I
+; guess not: the only circumstances in which we reload the command processor
+; is after a transient program execution. In this case, we let the current
+; directory lie where it may.
+;
+ OR BP,BP ; See if just read
+ JZ TESTRDIR ; Not read, check user directory
+ MOV WORD PTR [UCOMBUF+1],0D01H ; Reset buffer
+ JMP SHORT NOSETBUF
+
+TESTRDIR:
+ CMP [RESTDIR],0
+ JZ NOSETBUF ; User directory OK
+ PUSH DS
+;
+; We have an unusual situation to handle. The user *may* have changed his
+; directory as a result of an internal command that got aborted. Restoring it
+; twice may not help us: the problem may never go away. We just attempt it
+; once and give up.
+;
+ MOV [RESTDIR],0 ; Flag users dirs OK
+ PUSH CS
+ POP DS
+ASSUME DS:TRANGROUP
+ MOV DX,OFFSET TRANGROUP:USERDIR1
+ MOV AH,CHDIR
+ INT 21h ; Restore users directory
+ POP DS
+ASSUME DS:RESGROUP
+
+NOSETBUF:
+ CMP [PIPEFILES],0
+ JZ NOPCLOSE ; Don't bother if they don't exist
+ CMP [PIPEFLAG],0
+ JNZ NOPCLOSE ; Don't del if still piping
+ INVOKE PIPEDEL
+
+NOPCLOSE:
+ MOV [EXTCOM],0 ; Flag internal command
+ MOV AX,CS ; Get segment we're in
+ MOV DS,AX
+ASSUME DS:TRANGROUP
+
+ PUSH AX
+ MOV DX,OFFSET TRANGROUP:INTERNATVARS
+ MOV AX,INTERNATIONAL SHL 8
+ INT 21H
+ POP AX
+ SUB AX,[TPA] ; AX=size of TPA in paragraphs
+ PUSH BX
+ MOV BX,16
+ MUL BX ; DX:AX=size of TPA in bytes
+ POP BX
+ OR DX,DX ; See if over 64K
+ JZ SAVSIZ ; OK if not
+ MOV AX,-1 ; If so, limit to 65535 bytes
+
+SAVSIZ:
+;
+; AX is the number of bytes free in the buffer between the resident and the
+; transient with a maximum of 64K-1. We round this down to a multiple of 512.
+;
+ CMP AX,512
+ JBE GotSize
+ AND AX,0FE00h ; NOT 511 = NOT 1FF
+
+GotSize:
+ MOV [BYTCNT],AX ; Max no. of bytes that can be buffered
+ MOV DS,[RESSEG] ; All batch work must use resident seg.
+ASSUME DS:RESGROUP
+
+ TEST [ECHOFLAG],1
+ JZ GETCOM ; Don't do the CRLF
+ INVOKE SINGLETEST
+ JB GETCOM
+ TEST [PIPEFLAG],-1
+ JNZ GETCOM
+ TEST [FORFLAG],-1 ; G Don't print prompt in FOR
+ JNZ GETCOM ; G
+ TEST [BATCH], -1 ; G Don't print prompt if in batch
+ JNZ GETCOM ; G
+; INVOKE CRLF2
+
+GETCOM:
+ MOV CALL_FLAG,0 ; G Reset call flags
+ MOV CALL_BATCH_FLAG,0 ; G
+ MOV AH,GET_DEFAULT_DRIVE
+ INT 21h
+ MOV [CURDRV],AL
+ TEST [PIPEFLAG],-1 ; Pipe has highest presedence
+ JZ NOPIPE
+ JMP PIPEPROC ; Continue the pipeline
+
+NOPIPE:
+ TEST [ECHOFLAG],1
+ JZ NOPDRV ; No prompt if echo off
+ INVOKE SINGLETEST
+ JB NOPDRV
+ TEST [FORFLAG],-1 ; G Don't print prompt in FOR
+ JNZ NOPDRV ; G
+ TEST [BATCH], -1 ; G Don't print prompt if in batch
+ JNZ TESTFORBAT ; G
+; INVOKE PRINT_PROMPT ; Prompt the user
+
+NOPDRV:
+ TEST [FORFLAG],-1 ; FOR has next highest precedence
+ JZ TESTFORbat
+ JMP FORPROC ; Continue the FOR
+
+TESTFORBAT:
+ MOV [RE_INSTR],0 ; Turn redirection back off
+ MOV [RE_OUTSTR],0
+ MOV [RE_OUT_APP],0
+ MOV IFFlag,0 ; no more ifs...
+ TEST [BATCH],-1 ; Batch has lowest precedence
+ JZ ISNOBAT
+
+; Bugbug: MULT_SHELL_GET no longer used?
+ push es ;AN000; save ES
+ push ds ;AN000; save DS
+ mov ax,mult_shell_get ;AN000; check to see if SHELL has command
+ mov es,[batch] ;AN000; get batch segment
+ mov di,batfile ;AN000; get batch file name
+ push cs ;AN000; get local segment to DS
+ pop ds ;AN000;
+ mov dx,offset trangroup:combuf ;AN000; pass communications buffer
+ int 2fh ;AN000; call the shell
+ cmp al,shell_action ;AN000; does shell have a commmand?
+ pop ds ;AN000; restore DS
+ pop es ;AN000; restore ES
+ jz jdocom1 ;AN000; yes - go process command
+
+ PUSH DS ;G
+ INVOKE READBAT ; Continue BATCH
+ POP DS ;G
+ mov nullflag,0 ;G reset no command flag
+ TEST [BATCH],-1 ;G
+ JNZ JDOCOM1 ;G if batch still in progress continue
+ MOV BX,NEXT_BATCH ;G
+ CMP BX,0 ;G see if there is a new batch file
+ JZ JDOCOM1 ;G no - go do command
+ MOV BATCH,BX ;G get segment of next batch file
+ MOV NEXT_BATCH,0 ;G reset next batch
+JDOCOM1:
+ PUSH CS ;G
+ POP DS ;G
+ JMP DoCom1 ; echoing already done
+
+ISNOBAT:
+ CMP [SINGLECOM],0
+ JZ REGCOM
+ MOV SI,-1
+ XCHG SI,[SINGLECOM]
+ MOV DI,OFFSET TRANGROUP:COMBUF + 2
+ XOR CX,CX
+
+SINGLELOOP:
+ LODSB
+ STOSB
+ INC CX
+ CMP AL,0DH
+ JNZ SINGLELOOP
+ DEC CX
+ PUSH CS
+ POP DS
+ASSUME DS:TRANGROUP
+ MOV [COMBUF + 1],CL
+;
+; do NOT issue a trailing CRLF...
+;
+ JMP DOCOM1
+
+;
+; We have a normal command.
+; Printers are a bizarre quantity. Sometimes they are a stream and
+; sometimes they aren't. At this point, we automatically close all spool
+; files and turn on truncation mode.
+;
+
+REGCOM:
+ MOV AX,(ServerCall SHL 8) + 9
+ INT 21h
+ MOV AX,(ServerCall SHL 8) + 8
+ MOV DL,1
+ INT 21h
+
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ cmp byte ptr [SCS_FIRSTCOM],0
+ jnz first_inst ;this is the first instance
+
+ jmp DoReEnter
+DRE_RET:
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ xor ax,ax
+ jmp short do_again
+
+first_inst:
+ mov [SCS_PAUSE],0 ; yst 4-5-93
+ cmp [SCS_Is_First],1
+ jne cont_scs
+ mov [SCS_Is_First],0
+
+ SAVE <SI,BP>
+ xor si,si
+ xor bp,bp
+ mov al,2
+ mov ah,setdpb
+ int 21h ; resets the TSR bit
+ RESTORE <BP,SI>
+ xor ax,ax
+ jmp short do_again
+
+cont_scs:
+ SAVE <AX,SI,BP>
+ xor si,si
+ xor bp,bp
+ mov al,2
+ mov ah,setdpb
+ int 21h ; resets the TSR bit
+ RESTORE <BP,SI,AX>
+ jnc cont_scs2
+
+cont_tsr:
+ jmp tsr_loop
+tsr_loop_ret:
+ jmp short cont_scs1
+
+cont_scs2:
+ cmp byte ptr [scs_firsttsr],1
+ je cont_scs1
+ jmp short cont_tsr
+
+cont_scs1:
+; call free_con
+
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ mov ax,[retcode]
+
+do_again:
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ push es
+ mov es,[envirseg]
+ mov [ENV_PTR_SEG],es
+ call GETENVSIZ
+ pop es
+ push cs
+ pop ds
+ ASSUME DS:TRANGROUP
+ mov [ENV_SIZE],cx
+
+;; williamh - Jan 11 1993
+;; nt expects 16bits exit code while DOS has only 8 bits
+;; clear the high byte so that things won't go wrong
+ xor ah, ah
+
+
+ MOV [SCS_EXIT_CODE],ax
+ mov ah,19h
+ int 21h
+ xor ah,ah
+ mov [SCS_CUR_DRIVE], ax ; a= 0 , b = 1 etc
+ mov [CMD_SIZE],COMBUFLEN
+ MOV DX,OFFSET TRANGROUP:UCOMBUF
+
+if 0
+; Try to read interactive command line via DOSKey.
+; If that fails, use DOS Buffered Keyboard Input.
+
+ mov ax,4810h ; AX = DOSKey Read Line function
+ int 2fh
+ or ax,ax
+ jz GotCom ; DOSKey gave us a command line
+else
+ mov [CMD_PTR_SEG],ds
+ mov [CMD_PTR_OFF],dx
+
+ mov dx,OFFSET TRANGROUP:EXECPATH
+ mov [EXECPATH_SEG], ds
+ mov [EXECPATH_OFF], dx
+ mov [EXECPATH_SIZE], EXECPATHLEN
+
+ push es
+ mov es,cs:[RESSEG]
+ ASSUME es:RESGROUP
+ mov dx,word ptr es:[RES_RDRINFO]
+ mov word ptr ds:[SCS_RDRINFO],dx
+ mov dx,word ptr es:[RES_RDRINFO+2]
+ mov word ptr ds:[SCS_RDRINFO+2],dx
+ pop es
+ ASSUME ES:TRANGROUP
+ MOV DX,OFFSET TRANGROUP:ENV_PTR_SEG
+
+
+ CMDSVC SVC_CMDGETNEXTCMD ; DS:DX is the buffer
+ jnc run_cmd
+
+; If carry is set that means our enviornment buffer was smaller. So get
+; a big enough buffer and get the command again.
+ cmp ax,32*1024 ; Env size cannot be more than 32k.
+ jae op_fail
+ push ax ; the new size in bytes for env in bytes
+ invoke FREE_TPA
+ pop bx
+ MOV CL,4
+ SHR BX,CL ; Convert back to paragraphs
+ inc bx ; an extra para
+ push es
+ push ds
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ mov es,[envirseg]
+ pop ds
+ ASSUME DS:TRANGROUP
+ MOV CX,ES ;AN056; Get environment segment
+ ADD CX,BX ;AN056; Add in size of environment
+ ADD CX,020H ;AN056; Add in some TPA
+ MOV AX,CS ;AN056; Get the transient segment
+ CMP CX,AX ;AN056; Are we hitting the transient?
+ JNB blk_xxx ;AN056; Yes - don't do it!!!
+
+ push bx
+ MOV AH,SETBLOCK
+ INT 21h
+ pop bx
+ jnc blk_xxx
+
+ mov ah,ALLOC
+ int 21h
+ jc blk_xxx
+ push ax
+
+ mov ah,DEALLOC
+ int 21h
+
+ pop ax
+ push ds
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ mov [envirseg],ax
+ pop ds
+ ASSUME DS:TRANGROUP
+ clc
+blk_xxx:
+ lahf
+ push ax
+ MOV ES,cs:[RESSEG]
+ invoke ALLOC_TPA
+ pop ax
+ sahf
+ JC op_fail1
+ pop es
+ xor ax,ax ; error code zero, its important
+ jmp do_again
+op_fail1:
+ pop es
+op_fail:
+ mov ax,error_not_enough_memory
+ jmp do_again
+
+run_cmd:
+ push es
+ mov es,cs:[RESSEG]
+ ASSUME es:RESGROUP
+ mov ax,word ptr ds:[SCS_RDRINFO]
+ mov word ptr es:[RES_RDRINFO],ax
+ mov ax,word ptr ds:[SCS_RDRINFO+2]
+ mov word ptr es:[RES_RDRINFO+2],ax
+ mov ax,word ptr ds:[SCS_BATSTATUS]
+ mov byte ptr es:[RES_BATSTATUS],al
+ pop es
+ ASSUME ES:TRANGROUP
+ test [SCS_STD_HANDLE],ALL_HANDLES
+ jz no_rdr
+ test [SCS_STD_HANDLE],MASK_STDIN
+ jz scs_std_out
+ xor cx,cx ; CX = HANDLE_STDIN
+ call alloc_con
+ jnc scs_std_out
+rdr_err:
+ call free_con
+ mov ax,error_not_enough_memory
+ jmp do_again
+
+scs_std_out:
+ ; Make Sure Stdout is checked before stderr. Its very important.
+ test [SCS_STD_HANDLE],MASK_STDOUT
+ jz scs_std_err
+ mov cx,HANDLE_STDOUT
+ call alloc_con
+ jc rdr_err
+
+scs_std_err:
+ test [SCS_STD_HANDLE],MASK_STDERR
+ jz no_rdr
+ mov cx,HANDLE_STDERR
+ call alloc_con
+ jc rdr_err
+
+no_rdr:
+ mov ah,GetSetCdPg
+ mov al,1
+ int 21h
+ jc cdpg_done
+ cmp bx,[SCS_CODEPAGE]
+ jz cdpg_done
+
+ mov ah,NLSFUNC ; see if NLSFUNC installed
+ mov al,0 ;
+ int 2fh ;
+ cmp al,NLSFUNC_installed ;
+ jnz no_nlsf_msg ; NO NLSFUNC ; Print message
+; jz got_nls ; Yes - continue
+; mov dx,offset trangroup:NLSFUNC_ptr ; no - set up error message
+; jmp short cp_error ; error exit
+
+ mov bx,[SCS_CODEPAGE] ;SCS Code page
+ mov ah,getsetcdpg ;set global code page function
+ mov al,set_global_cp ;minor - set
+ int 21h
+ jnc cdpg_done ;no error - exit
+nlsf_failed:
+; BUGBUG Sudeepb 28-Apr-1992 Putup a message saying NLSFunc failed
+no_nlsf_msg:
+; BUGBUG Sudeepb 28-Apr-1992 Putup a message saying NLSFunc not installed
+
+cdpg_done:
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; (YST) 08-Jan-1993 Checking and installing 16-bit KEYB.COM ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ jmp YST_beg
+
+;; Data for KB16
+
+KEY_LINE db 128 dup (0) ; "d:\nt\system32\kb16.com", 0
+YST_ARG db 128 dup (0) ; 32, " XX,,d:\nt\system32\keyboard.sys", 0DH
+
+
+YPAR dw 0
+ dd 0
+ dw 005ch, 0
+ dw 006ch, 0
+
+KEEP_SS dw 0
+KEEP_SP dw 0
+
+YST_beg:
+
+ SAVE <BX, ES, DS> ; save all regs for INT 2FH
+
+ mov ax, CHECK_KEYB16 ; see if KEYB16 installed
+ int 2fh
+ xor dx,dx
+ cmp al, KEYB16_installed
+ jne keyb_cont ; KEYB16 not installed, DX == 0
+ inc dx ; installed DX == 1
+
+keyb_cont:
+ RESTORE <DS, ES, BX>
+
+ push ds
+ push cs
+ pop ds
+
+ mov si, offset KEY_LINE ; name of KB16.COM
+ mov cx, offset YST_ARG ; command line
+
+ CMDSVC SVC_GETKBDLAYOUT ; Call 32-bit API for checking
+ ; and installing correct layout
+ or dx,dx ; if DX != 0 after BOP then we need
+ pop ds ; to install 16-bit KEYB.COM
+ jnz run_keyb
+
+ jmp End_keyb ; No installation of KB16.COM
+
+run_keyb:
+
+;; This part run KB16.COM
+
+ SAVE <DS, BX>
+
+ PUSH ES ; free TPA for running KB16
+ MOV ES,[TRAN_TPA]
+ MOV AH,DEALLOC
+ INT 21h ; Now running in "free" space
+
+ push cs
+ pop ds
+ push cs
+ pop es
+
+ mov dx, offset KEY_LINE ; file name
+ mov YPAR+0, 0000H ; keep current enviroment
+ mov YPAR+2, offset YST_ARG ; arguments (options) for KB16.COM
+ mov YPAR+4, ds
+ mov bx, offset YPAR
+
+ mov KEEP_SS, ss ; Peter Norton suggests to keep
+ mov KEEP_SP, sp ; SS and SP
+
+ mov ah, 4bh
+ xor al, al
+
+ int 21h ; RUN!
+
+ mov ss, cs:KEEP_SS ; Restore SS and SP
+ mov sp, cs:KEEP_SP
+
+ POP ES
+
+ SAVE <BP> ; We need to restore TSR bit
+ xor si,si ; for running next app.
+ xor bp,bp ; use "undocumented" call.
+ mov al,2
+ mov ah,setdpb
+ int 21h ; resets the TSR bit
+ RESTORE <BP>
+
+
+; Allocate transient again after runnig KB16.
+; Copied from TBATCH.ASM
+; Modify AX,BX,DX,flags
+;
+
+ ASSUME DS:TRANGROUP,ES:RESGROUP
+
+ PUSH ES
+ MOV ES,cs:[RESSEG]
+ MOV BX,0FFFFH ; Re-allocate the transient
+ MOV AH,ALLOC
+ INT 21h
+ PUSH BX ; Save size of block
+ MOV AH,ALLOC
+ INT 21h
+;
+; Attempt to align TPA on 64K boundary
+;
+ POP BX ; Restore size of block
+ MOV [RES_TPA], AX ; Save segment to beginning of block
+ MOV [TRAN_TPA], AX
+;
+; Is the segment already aligned on a 64K boundary
+;
+ MOV DX, AX ; Save segment
+ AND AX, 0FFFH ; Test if above boundary
+ JNZ Calc_TPA
+ MOV AX, DX
+ AND AX, 0F000H ; Test if multiple of 64K
+ JNZ NOROUND
+
+Calc_TPA:
+ MOV AX, DX
+ AND AX, 0F000H
+ ADD AX, 01000H ; Round up to next 64K boundary
+ JC NOROUND ; Memory wrap if carry set
+;
+; Make sure that new boundary is within allocated range
+;
+ MOV DX, [RES_TPA]
+ ADD DX, BX ; Compute maximum address
+ CMP DX, AX ; Is 64K address out of range?
+ JB NOROUND
+;
+; Make sure that we won't overwrite the transient
+;
+ MOV BX, CS ; CS is beginning of transient
+ CMP BX, AX
+ JB NOROUND
+;
+; The area from the 64K boundary to the beginning of the transient must
+; be at least 64K.
+;
+ SUB BX, AX
+ CMP BX, 4096 ; Size greater than 64K?
+ JAE ROUNDDONE
+
+NOROUND:
+ MOV AX, [RES_TPA]
+
+ROUNDDONE:
+ MOV [LTPA],AX ; Re-compute everything
+ MOV [TPA],AX
+ MOV BX,AX
+ MOV AX,CS
+ SUB AX,BX
+ PUSH BX
+ MOV BX,16
+ MUL BX
+ POP BX
+ OR DX,DX
+ JZ SAVSIZ2
+ MOV AX,-1
+
+SAVSIZ2:
+;
+; AX is the number of bytes free in the buffer between the resident and the
+; transient with a maximum of 64K-1. We round this down to a multiple of 512.
+;
+ CMP AX,512
+ JBE GotSize1
+ AND AX,0FE00h ; NOT 511 = NOT 1FF
+
+GotSize1:
+ MOV [BYTCNT],AX
+ POP ES
+
+
+; End Alloc_TPA
+
+
+ RESTORE <BX, DS>
+
+ CMDSVC SVC_CMDINITCONSOLE ; make sure console is turned on
+
+End_keyb:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; End of (YST) 08-Jan-1993 Checking and installing 16-bit KEYB.COM ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+
+ mov dx,[SCS_CUR_DRIVE]
+ mov [curdrv],dl
+ mov ah,0eh
+ int 21h
+ push cs
+ pop ds
+ MOV DX,OFFSET TRANGROUP:UCOMBUF
+
+endif
+
+GotCom:
+ MOV CL,[UCOMBUF]
+ XOR CH,CH
+ ADD CX,3
+ MOV SI,OFFSET TRANGROUP:UCOMBUF
+ MOV DI,OFFSET TRANGROUP:COMBUF
+ REP MOVSB ; Transfer it to the cooked buffer
+
+;---------------
+
+transpace segment
+ extrn arg:byte ; the arg structure!
+transpace ends
+;---------------
+
+
+DOCOM:
+; INVOKE CRLF2
+
+DOCOM1:
+ INVOKE PRESCAN ; Cook the input buffer
+ JZ NOPIPEPROC
+ JMP PIPEPROCSTRT ; Fire up the pipe
+
+nullcomj:
+ jmp nullcom
+
+NOPIPEPROC:
+ invoke parseline
+ jnc OkParse ; user error? or maybe we goofed?
+
+BadParse:
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET TRANGROUP:BADNAM_ptr
+ INVOKE std_eprintf
+ JMP TCOMMAND
+
+OkParse:
+ test arg.argv[0].argflags, MASK wildcard
+ jnz BadParse ; ambiguous commands not allowed
+ cmp arg.argvcnt, 0 ; there WAS a command, wasn't there?
+ jz nullcomj
+ cmp arg.argv[0].arglen, 0 ; probably an unnecessary check...
+ jz nullcomj ; guarantees argv[0] at least x<NULL>
+
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ MOV DI,OFFSET TRANGROUP:IDLEN
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR 01H ; Make FCB with blank scan-off
+ INT 21h
+ mov BX, arg.argv[0].argpointer
+ cmp WORD PTR [BX], 05c5ch ; leading "\\" means UNC name
+ je IsUncName
+ cmp BYTE PTR [BX+1],':' ; was a drive specified?
+ jne short drvgd ; no, use default of zero...
+
+ mov DL, BYTE PTR [BX] ; pick-up drive letter
+ and DL, NOT 20H ; uppercase the sucker
+ sub DL, capital_A ; convert it to a drive number, A=0
+
+ CMP AL,-1 ; See what PARSE said about our drive letter.
+ JZ drvbadj2 ; It was invalid.
+
+IsUncName:
+ mov DI, arg.argv[0].argstartel
+ cmp BYTE PTR [DI], 0 ; is there actually a command there?
+ jnz drvgd ; if not, we have: "d:", "d:\", "d:/"
+ jmp setdrv ; and set drive to new drive spec
+
+drvbadj2:
+ jmp drvbad
+
+DRVGD:
+ MOV AL,[DI]
+ MOV [SPECDRV],AL
+ MOV AL,' '
+ MOV CX,9
+ INC DI
+ REPNE SCASB ; Count no. of letters in command name
+ MOV AL,8
+ SUB AL,CL
+ MOV [IDLEN],AL ; IDLEN is truly the length
+ MOV DI,81H
+ PUSH SI
+
+ mov si, OFFSET TRANGROUP:COMBUF+2 ; Skip over all leading delims
+ invoke scanoff
+;SR;
+; We are going to skip over the first char always. The logic is that the
+;command tail can never start from the first character. The code below is
+;trying to figure out the command tail and copy it to the command line
+;buffer in the PSP. However, if the first character happens to be a switch
+;character and the user given command line is a full 128 bytes, we try to
+;copy 128 bytes to the PSP while it can take only 127 chars. This extra
+;char overwrites the code and leads to a crash on future commands.
+;
+
+ inc si
+
+do_skipcom:
+ lodsb ; move command line pointer over
+ invoke delim ; pathname -- have to do it ourselves
+ jz do_skipped ; 'cause parse_file_descriptor is dumb
+ cmp AL, 0DH ; can't always depend on argv[0].arglen
+ jz do_skipped ; to be the same length as the user-
+ cmp AL, [SWITCHAR] ; specified command string
+ jnz do_skipcom
+
+do_skipped:
+ dec SI
+ XOR CX,CX
+
+COMTAIL:
+ LODSB
+ STOSB ; Move command tail to 80H
+ CMP AL,13
+ LOOPNZ COMTAIL
+ DEC DI
+ MOV BP,DI
+ NOT CL
+ MOV BYTE PTR DS:[80H],CL
+ POP SI
+
+;-----
+; Some of these comments are sadly at odds with this brave new code.
+;-----
+; If the command has 0 parameters must check here for
+; any switches that might be present.
+; SI -> first character after the command.
+
+ mov DI, arg.argv[0].argsw_word
+ mov [COMSW], DI ; ah yes, the old addressing mode problem...
+ mov SI, arg.argv[1 * SIZE argv_ele].argpointer ; s = argv[1];
+ OR SI,SI ; if (s == NULL)
+ JNZ DoParse
+ MOV SI,BP ; s = bp; (buffer end)
+
+DoParse:
+ MOV DI,FCB
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR 01H
+ INT 21h
+ MOV [PARM1],AL ; Save result of parse
+
+ mov DI, arg.argv[1*SIZE argv_ele].argsw_word
+ mov [ARG1S], DI
+ mov SI, arg.argv[2*SIZE argv_ele].argpointer ; s = argv[2];
+ OR SI,SI ; if (s == NULL)
+ JNZ DoParse2
+ MOV SI,BP ; s = bp; (bufend)1
+
+DoParse2:
+ MOV DI,FCB+10H
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR 01H
+ INT 21h ; Parse file name
+ MOV [PARM2],AL ; Save result
+
+ mov DI, arg.argv[2*SIZE argv_ele].argsw_word
+ mov [ARG2S], DI
+ mov DI, arg.argv[0].argsw_word
+ not DI ; ARGTS doesn't include the flags
+ and DI, arg.argswinfo ; from COMSW...
+ mov [ARGTS], DI
+
+ MOV AL,[IDLEN]
+ MOV DL,[SPECDRV]
+ or DL, DL ; if a drive was specified...
+ jnz externalj1 ; it MUST be external, by this time
+ dec al ; (I don't know why -- old code did it)
+ jmp fndcom ; otherwise, check internal com table
+
+externalj1:
+ jmp external
+
+nullcom:
+ mov [EXECPATH_SIZE], 0
+ MOV DS,cs:[RESSEG]
+ASSUME DS:RESGROUP
+ TEST [BATCH], -1 ;G Are we in a batch file?
+ JZ nosetflag ;G only set flag if in batch
+ mov nullflag,nullcommand ;G set flag to indicate no command
+
+nosetflag:
+ CMP [SINGLECOM],-1
+ JZ EXITJ
+ JMP GETCOM
+
+EXITJ:
+ JMP $EXITPREP
+
+IF IBM
+ include vector.inc
+ include pdb.inc
+ include arena.inc
+ include mshalo.asm
+ENDIF
+
+std_invalid macro
+ mov ax,0ffffh
+ push ax
+ push ax
+endm
+
+std_valid macro
+ push bx
+ push cx
+endm
+
+CleanForStd macro
+ add sp,12
+endm
+
+DoReEnter:
+ ASSUME DS:RESGROUP
+
+ cmp byte ptr [scs_reentered],3
+ jne reent_chk
+
+; Control comes here after command /z ran a non-dos binary and
+; we re-entered. We just make scs_reentered as 2 indicating that on next
+; time we need to return the exit code to 32bit side.
+
+ mov byte ptr [scs_reentered],2
+ jmp reent
+
+reent_chk:
+ cmp byte ptr [scs_reentered],2
+ jne reent_cont
+ jmp retcode32
+
+reent_cont:
+ cmp byte ptr [scs_reentered],0
+ je exec_comspec
+ jmp reent_ret
+
+; Control comes here when we have to exec either command.com or
+; cmd.exe. This decision depends on scs_cmdprompt. Here we
+; mark scs_reentered state as 1 indicating on return to handle
+; exit code.
+
+exec_comspec:
+
+ mov byte ptr [scs_reentered],1
+ cmp byte ptr [scs_cmdprompt],Prompt32
+ je do32bitprompt
+ mov al,Start16 ; parameter to put prompt
+ mov ah,FOR_SHELLOUT
+ call Do16BitPrompt ; ds is resseg here on return its transseg
+ or al,al ; return al=0 to run 16bit binary al=1 getnextvdmcommand
+ jz dos_only
+ jmp reent
+dos_only:
+ jmp GotCom ; go run through int21/exec
+
+do32BitPrompt:
+ SAVE <bp,bx,si>
+ xor bx,bx
+ mov si,bx
+ mov bp,bx
+ mov ax,5303h
+ int 21h
+ jnc st_stdin
+ std_invalid
+ jmp short go_stdout
+st_stdin:
+ std_valid
+go_stdout:
+ mov bx,1
+ mov ax,5303h
+ int 21h
+ jnc st_stdout
+ std_invalid
+ jmp short go_stderr
+st_stdout:
+ std_valid
+go_stderr:
+ mov bx,2
+ mov ax,5303h
+ int 21h
+ jnc st_stderr
+ std_invalid
+ jmp short std_done
+st_stderr:
+ std_valid
+std_done:
+ mov bp,sp
+ push es
+ mov es,[envirseg]
+ mov ah,19h
+ int 21h
+ CMDSVC SVC_EXECCOMSPEC32
+ pop es
+ mov bp,ax
+ lahf
+ CleanForStd
+ sahf
+ mov ax,bp
+ RESTORE <si,bx,bp>
+
+ jc reent
+
+ jmp reent_exit
+
+reent_ret:
+ ; ds is already set to RESSEG
+ cmp byte ptr [scs_cmdprompt],Prompt32
+ je retcode32
+ mov al,return16
+ mov ah,FOR_SHELLOUT
+ call Do16BitPrompt ; ds = resseg , on return its transseg
+ or al,al ; return al=0 to run 16bit binary al=1 getnextvdmcommand
+ jnz reent
+ jmp dos_only
+
+retcode32:
+ mov dx,ds:[retcode]
+ mov ah,19h
+ int 21h ; al = cur drive
+ mov cx,word ptr ds:[RES_RDRINFO]
+ mov bx,word ptr ds:[RES_RDRINFO+2] ; bx:cx - rdrinfo
+ CMDSVC SVC_RETURNEXITCODE
+ mov ds:[retcode],0
+ jnc reent_exit
+reent:
+ push cs
+ pop ds
+ assume ds:trangroup
+ mov [scs_tsrexit],0
+ jmp DRE_RET
+
+reent_exit:
+ASSUME DS:RESGROUP
+ push ax
+ mov ax,(multdos shl 8 or message_2f);AN060; reset parse message pointers
+ mov dl,set_critical_msg ;AN000; set up critical error message address
+ mov di,crit_msg_off ;AN000; old offset of critical messages
+ mov es,crit_msg_seg ;AN000; old segment of critical messages
+ int 2fh ;AN000; go set it
+
+ push cs
+ pop ds
+assume ds:trangroup ;AN000;
+
+; Restore user directory if the restore flag is set. RestUDir1 checks for
+; this, restores user dir if flag is set and resets the flag.
+
+ invoke RestUDir1 ;restore user dir if needed ;M040
+ MOV ES,cs:[RESSEG]
+
+assume es:resgroup
+
+ MOV AX,[PARENT]
+ MOV WORD PTR ES:[PDB_Parent_PID],AX
+ MOV AX,WORD PTR OldTerm
+ MOV WORD PTR ES:[PDB_Exit],AX
+ MOV AX,WORD PTR OldTerm+2
+ MOV WORD PTR ES:[PDB_Exit+2],AX
+
+ PUSH ES
+ MOV ES,[TRAN_TPA]
+ MOV AH,DEALLOC
+ INT 21h ; Now running in "free" space
+ POP ES
+
+ pop ax
+ MOV AH,Exit
+ INT 21h
+
+; Entry al = Start16 means put the command.com prompt, get the command
+; return16 means return the exit code if needed
+; ah = FOR_SHELLOUT means came from shellout code (DoReEnter)
+; ah = FOR_TSR means came from TSR (tsr_loop)
+;
+; Exit al = 0 means run 16bit binary
+; al = 1 means do getnextvdmcommand
+; if came with FOR_TSR, then additionaly
+; ah = 1 means returning on exit command
+; ah = 0 means otherwise
+
+Do16BitPrompt:
+ push es
+ push ax
+ mov es,cs:[RESSEG] ; es is resident group
+ ASSUME ES:resgroup
+ PUSH CS
+ POP DS ; Need local segment to point to buffer
+ assume ds:trangroup
+ cmp al,Start16
+ jne d16_ret
+
+d16_loop:
+ INVOKE CRLF2
+ INVOKE PRINT_PROMPT ; put the prompt
+ MOV DX,OFFSET TRANGROUP:UCOMBUF
+
+ mov ah,STD_CON_STRING_INPUT ; AH = Buffered Keyboard Input
+ int 21h ; call DOS
+
+ push si
+ mov si,dx
+ inc si
+ inc si
+ INVOKE SCANOFF ; eat leading delimeters
+
+ cmp byte ptr ds:[si],0dh ; special case CR
+ jne d16_gotcom
+ pop si
+ jmp d16_loop
+
+d16_gotcom:
+ INVOKE CRLF2
+ call check_command ; check for exit and cd
+ pop si
+ jnc d16_run
+
+ or al,al
+ jz d16_exit
+
+d16_dosonly:
+ mov byte ptr es:[scs_prompt16],0
+ pop ax
+ xor ax,ax ; go run the command
+ pop es
+ ret
+
+d16_run:
+ cmp byte ptr es:[scs_dosonly], DOSONLY_YES
+ je d16_dosonly
+
+ push es
+ push bp
+ push si
+ mov ax,0ffffh
+ push ax ; no standard handle to pass
+ push ax
+ push ax
+ push ax
+ push ax
+ push ax
+ mov bp,sp ; ss:bp is standard handles
+ mov es,es:[envirseg]
+ mov si,dx
+ add si,2 ; first two bytes are the count, after that real command
+ mov ah,19h
+ int 21h ; al = cur drive
+ mov ah,1 ; do cmd /c
+ CMDSVC SVC_CMDEXEC ; Exec through cmd
+ lahf
+ add sp,12 ; recover std handle space
+ pop si
+ pop bp
+ pop es
+ sahf
+
+ jnc d16_loop ; command completed, go put the prompt
+
+ ; carry set means re-entered
+d16_retback:
+ mov byte ptr es:[scs_prompt16],1 ; mark that on return we have
+ ; to go to 32bit with retcode
+ pop ax
+ mov ax,1 ; go do getnextvdmcommand
+ pop es
+ ret
+
+d16_ret:
+ cmp byte ptr es:[scs_prompt16],0 ; mark 0 to mean to come back
+ ; and put prompt fro next command
+ je d16_loop
+
+
+d16_return32:
+ push dx
+ mov dx,es:[retcode]
+ mov ah,19h
+ int 21h ; al = cur drive
+ mov cx,word ptr es:[RES_RDRINFO]
+ mov bx,word ptr es:[RES_RDRINFO+2] ; bx:cx - rdrinfo
+ CMDSVC SVC_RETURNEXITCODE
+ pop dx
+ mov es:[retcode],0
+ jc d16_retback
+ mov byte ptr es:[scs_prompt16],0
+ jmp d16_loop
+
+
+d16_exit:
+ ; exit command was given, turn off the lights
+
+ pop ax
+ cmp ah,FOR_TSR
+ je d16_exittsr
+ jmp reent_exit
+
+d16_exittsr:
+ mov ah,1
+ pop es
+ ret
+
+
+; check if the typed command is one of the commands in NT_INTRL_CMND, if
+; so return carry set plus al = 0 if the command was "exit".
+;
+; input ds:si is the command buffer
+; si can be trashed.
+
+check_command:
+
+ SAVE <CX,DI,ES>
+
+ cmp byte ptr ds:[si+1],':' ; special case drive change i.e C:
+ jne cc_0
+ mov al,byte ptr ds:[si+2]
+ cmp al,0dh ; DELIM for some reason does'nt
+ je ok_delim ; include 0d
+ invoke DELIM
+ jnz no_match
+ok_delim:
+ mov al,1 ; Not exit command
+ok_xt:
+ stc ; Carry means command found
+ jmp short cc_ret
+
+no_match:
+ clc ; Carry clear, command not found
+cc_ret:
+ RESTORE <ES,DI,CX>
+ ret
+
+cc_0:
+ push si
+ xor cx,cx
+
+ ; Convert the source string to upper case and get the length
+cc_1:
+ mov al,byte ptr ds:[si]
+ invoke DELIM
+ jz go_look
+ invoke MOREDELIM
+ jz go_look
+
+ INVOKE UPCONV
+ mov byte ptr ds:[si],al
+ inc si
+ inc cx
+ jmp short cc_1
+
+go_look:
+ pop si
+ jcxz no_match ; zero length, go fail
+ mov di, OFFSET TRANGROUP:NT_INTRNL_CMND
+ push cs
+ pop es
+
+ ; search through the commands in the table
+cc_5:
+ push si
+ push di
+ push cx
+ cmp cl, byte ptr es:[di]
+ jne try_next
+ inc di
+ repz cmpsb
+ jnz try_next
+ jmp short cc_found
+
+try_next:
+ pop cx
+ pop di
+ pop si
+ mov al,byte ptr es:[di]
+ or al,al
+ jz no_match
+ xor ah,ah
+ add ax,di
+ mov di,ax
+ add di,2
+ jmp short cc_5
+
+cc_found:
+ mov al, byte ptr es:[di] ; Is it exit command
+ pop cx
+ pop di
+ pop si
+ jmp short ok_xt
+
+;
+; Input: AL is character to classify
+; Output: Z set if delimiter
+; NZ set otherwise
+; Registers modified: none
+;
+
+MOREDELIM:
+ cmp al,0dh
+ retz
+ cmp al,'/'
+ retz
+ cmp al,'\'
+ retz
+ cmp al,'.'
+ retz
+ cmp al,'<'
+ retz
+ cmp al,'>'
+ retz
+ cmp al,'|'
+ retz
+ cmp al,'"'
+ retz
+ cmp al,'+'
+ retz
+ cmp al,':'
+ retz
+ cmp al,';'
+ retz
+ cmp al,'['
+ retz
+ cmp al,']'
+ return
+
+
+
+free_con:
+ push ds
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ xor bx,bx ; BX = handle = 0
+ mov cx,Io_Save ; CX = original stdin, stdout
+ mov dx,word ptr ds:Pdb_Jfn_Table ; DX = current stdin, stdout
+ cmp cl,dl
+ je Chk1 ; stdin matches
+ mov ah,CLOSE
+ int 21h ; close stdin
+ mov ds:Pdb_Jfn_Table,cl ; restore stdin
+Chk1:
+ inc bx ; BX = handle = 1
+ cmp ch,dh
+ je Chk2 ; stdout matches
+ mov ah,CLOSE
+ int 21h ; close stdout
+ mov ds:Pdb_Jfn_Table+1,ch ; restore stdout
+Chk2:
+ inc bx ; BX = handle = 2
+ mov dl,byte ptr ds:[Pdb_Jfn_Table+2] ; Dl = current stderr
+ mov cl,Io_Stderr ; Cl = original stderr
+ cmp dl,cl
+ je chk_x ; stderr matches
+ mov ah,CLOSE
+ int 21h ; close stderr
+ mov ds:Pdb_Jfn_Table+2,cl ; restore stderr
+chk_x:
+ pop ds
+ ret
+
+alloc_con:
+ SAVE <DX,SI,BP,BX,DS>
+ MOV DS,cs:[RESSEG]
+ ASSUME DS:RESGROUP
+ push cx
+ pop ax
+ mov bx, offset Pdb_Jfn_Table
+ add bx,ax
+ mov al,byte ptr ds:[bx]
+ push ax
+ push bx
+ mov byte ptr ds:[bx],0ffh
+
+ mov bx,word ptr ds:[RES_RDRINFO]
+ mov ax,word ptr ds:[RES_RDRINFO+2]
+
+ CMDSVC SVC_GETSTDHANDLE ; std hanlde in bx:cx
+ jc alloc_err
+;; bx:cx = nt file handle
+;; dx:ax = file size
+ push di
+ mov di, ax
+ xor si,si
+ xor bp,bp
+ mov al,0 ; free original console
+ mov ah,setdpb
+ int 21h
+ pop di
+ jc alloc_err
+ pop bx
+ pop ax
+ RESTORE <DS,BX,BP,SI,DX>
+ ret
+
+alloc_err:
+ pop bx
+ pop ax
+ mov byte ptr ds:[bx],al
+ RESTORE <DS,BX,BP,SI,DX>
+ ret
+
+
+; ds for tsr_loop is resseg on entry on exit transseg
+
+ ASSUME DS:RESGROUP
+
+tsr_loop:
+ cmp byte ptr ds:[scs_cmdprompt],Prompt32
+ je tsr_ret
+
+ cmp byte ptr ds:[res_batstatus],0
+ je short tsr_nobat
+ cmp byte ptr ds:[scs_firsttsr],1
+ jne short tsr_retcode
+ jmp tsr_ret
+
+tsr_nobat:
+
+ CMDSVC SVC_GETSTARTINFO ; return al = 1, if vdm has to
+ ; terminate on app exit.
+ or al,al
+ jne tsr_ret
+
+ cmp byte ptr [scs_firsttsr],1
+ jne tsr_retcode
+
+ cmp word ptr ds:[RES_RDRINFO],0
+ je tsr_nordr
+ cmp word ptr ds:[RES_RDRINFO+2],0
+ jne tsr_ret
+tsr_nordr:
+ mov byte ptr ds:[scs_firsttsr],0
+ mov al,Start16 ; parameter to put prompt
+ mov ah,FOR_TSR
+ call Do16BitPrompt ; ds is resseg here on return its transseg
+ or ah,ah
+ jnz tsr_exit
+ or al,al ; return al=0 to run 16bit binary al=1 getnextvdmcommand
+ jz tsr_dosonly
+ jmp tsr_ret
+tsr_dosonly:
+ jmp GotCom ; go run through int21/exec
+
+tsr_retcode:
+ mov al,return16 ; parameter to retun exit code if needed
+ mov ah,FOR_TSR
+ call Do16BitPrompt ; ds = resseg , on return its transseg
+ or ah,ah
+ jnz tsr_exit
+ or al,al ; return al=0 to run 16bit binary al=1 getnextvdmcommand
+ jnz tsr_ret
+ jmp GotCom
+
+tsr_exit:
+ push cs
+ pop ds
+ assume ds:trangroup
+ mov [scs_tsrexit],1
+tsr_ret:
+ jmp tsr_loop_ret
+
+
+TRANCODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/cmd/command/tdata.asm b/private/mvdm/dos/v86/cmd/command/tdata.asm
new file mode 100644
index 000000000..57a23ebf2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tdata.asm
@@ -0,0 +1,1075 @@
+ page ,132
+; SCCSID = @(#)tdata.asm 4.3 85/05/17
+; SCCSID = @(#)tdata.asm 4.3 85/05/17
+TITLE COMMAND Transient Initialized DATA
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; MODIFICATION HISTORY
+;
+; EE 10-20-83 Changed the drive check indicator bytes (DCIB's) in
+; COMTAB to be a flag byte in which bit 0 is now the
+; DCIB(bit) and bit 1 is on if the command can take
+; switches.
+;
+; M003 SR 07/16/90 Added LoadHigh to command table, added
+; parse control block for LoadHigh
+;
+; M008 SA 8/1/90 Remove /h parameter. Eliminate code to
+; internally handle /? message.
+;
+; M010 SA 8/5/90 Add support for /l (lowercase) option.
+;
+; M016 SR 08/09/90 Added public statements for new error
+; messages for LoadHigh.
+;
+
+
+
+comment %
+
+The TRANDATA segment contains data that is assumed to have predefined
+initial values at the beginning of each command cycle. It is
+included in the transient checksum area. If values in TRANDATA
+change, the transient will be reloaded for the next command cycle.
+
+Modification History
+--------------------
+
+8/12/89 DBO History resumes after six years.
+
+8/12/89 DBO Added for new DIR:
+-8/14/89 DirEnvVar, AttrLtrs, OrderLtrs;
+ New PARSE_DIR and subordinate parse blocks
+ (called PARSE_DIR_E for now);
+
+%
+
+
+
+
+fmt macro name,string,args
+ local a
+a db string
+PUBLIC name
+name dw offset trangroup:a
+irp val,<args>
+ dw offset trangroup:val
+endm
+endm
+
+btab macro b,sym
+ db b
+ dw offset trangroup:sym
+ endm
+
+.xlist
+.xcref
+ INCLUDE comsw.asm ;AC000;
+ INCLUDE comseg.asm
+ INCLUDE dirent.inc ;AN042;
+.list
+.cref
+
+BREAK MACRO subtitle
+ SUBTTL subtitle
+ PAGE
+ENDM
+
+;
+; WARNING: DO NOT INCLUDE DOSSYM.INC BECAUSE IT DESTROYS THE MACRO 'FMT' THAT
+; has been defined above - RS.
+;
+ INCLUDE ERROR.INC
+ INCLUDE ifequ.asm
+ INCLUDE comequ.asm
+; Note curdir.inc is included by comequ.asm
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg_buf:BYTE
+ EXTRN bwdbuf:byte
+ EXTRN bytes_free:WORD
+ EXTRN charbuf:byte
+ EXTRN copy_Num:WORD
+ EXTRN DATE_OUTPUT:BYTE ;AC000;
+ EXTRN Dir_Num:WORD
+ EXTRN DRIVE_OUTPUT:BYTE ;AC000;
+ EXTRN file_size_high:WORD
+ EXTRN file_size_low:WORD
+ EXTRN FileSiz:DWORD ; accumulated file size for DIR
+ EXTRN major_ver_num:WORD
+ EXTRN minor_ver_num:WORD
+ EXTRN one_char_val:BYTE
+ EXTRN PARSE1_OUTPUT:BYTE ;AC000;
+ EXTRN srcbuf:byte
+ EXTRN string_ptr_2:WORD
+ EXTRN system_cpage:word
+ EXTRN TIME_OUTPUT:BYTE ;AC000;
+ EXTRN vol_drv:BYTE
+ EXTRN vol_serial:dword ;AN000;
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN $CALL:NEAR
+ EXTRN $CHDIR:NEAR
+ EXTRN $EXIT:NEAR
+ EXTRN $FOR:NEAR
+ EXTRN $IF:NEAR
+ EXTRN $MKDIR:NEAR
+ EXTRN $RMDIR:NEAR
+ EXTRN ADD_NAME_TO_ENVIRONMENT:NEAR
+ EXTRN ADD_PROMPT:NEAR
+ EXTRN build_dir_for_prompt:near
+ EXTRN CATALOG:NEAR
+ EXTRN CHCP:NEAR
+ EXTRN CLS:NEAR
+ EXTRN CNTRLC:NEAR
+ EXTRN COPY:NEAR
+ EXTRN CRENAME:NEAR
+ EXTRN CRLF2:NEAR
+ EXTRN CTIME:NEAR
+ EXTRN CTTY:NEAR
+ EXTRN DATE:NEAR
+ EXTRN ECHO:NEAR
+ EXTRN ERASE:NEAR
+ EXTRN GOTO:NEAR
+ EXTRN IFERLEV:NEAR
+ EXTRN IFEXISTS:NEAR
+ EXTRN IFNOT:NEAR
+ EXTRN PATH:NEAR
+ EXTRN PAUSE:NEAR
+ EXTRN PRINT_B:NEAR
+ EXTRN PRINT_BACK:NEAR
+ EXTRN PRINT_DATE:NEAR
+ EXTRN PRINT_CHAR:NEAR
+ EXTRN PRINT_DRIVE:NEAR
+ EXTRN PRINT_EQ:NEAR
+ EXTRN PRINT_ESC:NEAR
+ EXTRN PRINT_G:NEAR
+ EXTRN PRINT_L:NEAR
+ EXTRN PRINT_TIME:NEAR
+ EXTRN PRINT_VERSION:NEAR
+ EXTRN SHIFT:NEAR
+ EXTRN TCOMMAND:NEAR
+ EXTRN TRUENAME:NEAR ;AN000;
+ EXTRN TYPEFIL:NEAR
+ EXTRN VERSION:NEAR
+ EXTRN VOLUME:NEAR
+ EXTRN VERIFY:NEAR
+
+ extrn LoadHigh:NEAR ; M003
+;
+; WARNING!!! No code may appear after this label!!!!
+;
+;
+; Bugbug:
+; 8/12/89 Looks like somebody ignored/missed this warning. TRANCODE
+; is added to at the end of this file. Fortunately, it looks
+; like no modules refer to this label.
+;
+PUBLIC TranCodeLast
+TranCodeLast LABEL BYTE
+TRANCODE ENDS
+
+; Data for transient portion
+
+TRANDATA SEGMENT PUBLIC BYTE
+
+ PUBLIC accden_ptr ;AN000;
+ PUBLIC acrlf_ptr ;AN000;
+ PUBLIC arg_buf_ptr ;AN000;
+ PUBLIC AttrLtrs
+ PUBLIC badbat_ptr ;AN000;
+ PUBLIC badcd_ptr ;AN000;
+ PUBLIC badCPmes_ptr ;AN000;
+ PUBLIC badcurdrv ;AN000;
+ PUBLIC baddat_ptr ;AN000;
+ PUBLIC baddev_ptr ;AN000;
+ PUBLIC baddrv_ptr ;AN000;
+ PUBLIC badlab_ptr ;AN000;
+ PUBLIC badmkd_ptr ;AN000;
+ PUBLIC badnam_ptr ;AN000;
+ PUBLIC bad_on_off_ptr ;AN000;
+ PUBLIC badPmes_ptr ;AN000;
+ PUBLIC badrmd_ptr ;AN000;
+ PUBLIC badtim_ptr ;AN000;
+ PUBLIC batext
+ PUBLIC bytes_ptr
+ PUBLIC bytmes_ptr ;AN000;
+ PUBLIC CLSSTRING
+ PUBLIC comext
+ PUBLIC comspec_flag ;AN071;
+ PUBLIC COMSPECSTR
+ PUBLIC COMTAB
+ PUBLIC copied_ptr ;AN000;
+ PUBLIC cp_active_ptr ;AN000;
+ PUBLIC cp_not_all_ptr ;AN000;
+ PUBLIC cp_not_set_ptr ;AN000;
+ PUBLIC ctrlcmes_ptr ;AN000;
+ PUBLIC curdat_mo_day ;AN000;
+ PUBLIC curdat_ptr ;AN000;
+ PUBLIC curdat_yr ;AN000;
+ PUBLIC curtim_hr_min ;AN000;
+ PUBLIC curtim_ptr ;AN000;
+ PUBLIC curtim_sec_hn ;AN000;
+ PUBLIC dback_ptr ;AN000;
+ PUBLIC del_Y_N_ptr ;AN000;
+ PUBLIC devwmes_ptr ;AN000;
+ PUBLIC dircont_ptr
+ PUBLIC dirdattim_ptr ;AN000;
+ PUBLIC dirdat_mo_day ;AN000;
+ PUBLIC dirdat_yr ;AN000;
+ PUBLIC DirEnvVar
+ PUBLIC dirhead_ptr ;AN000;
+ PUBLIC dirmes_ptr ;AN000;
+ PUBLIC dirtim_hr_min ;AN000;
+ PUBLIC dirtim_sec_hn ;AN000;
+ PUBLIC DIR_SW_PTRS
+ PUBLIC disp_file_size_ptr ;AN000;
+ PUBLIC DosHma_Ptr
+ PUBLIC DosLow_Ptr
+ PUBLIC DosRev_Ptr
+ PUBLIC DosRom_Ptr
+ PUBLIC dmes_ptr ;AN000;
+ PUBLIC echomes_ptr ;AN000;
+ PUBLIC enverr_ptr ;AN000;
+ PUBLIC errparsenv_ptr
+ PUBLIC eurdat_ptr ;AN000;
+ PUBLIC exeext
+ PUBLIC extend_buf_off ;AN000;
+ PUBLIC extend_buf_ptr ;AN000;
+ PUBLIC extend_buf_seg ;AN000;
+ PUBLIC extend_buf_sub ;AN000;
+ PUBLIC file_name_ptr ;AN000;
+ PUBLIC fornestmes_ptr ;AN000;
+ PUBLIC fuldir_ptr ;AN000;
+ PUBLIC IFTAB
+ PUBLIC inBdev_ptr ;AN000;
+ PUBLIC inornot_ptr ;AN000;
+ PUBLIC Inv_code_page ;AN000;
+ PUBLIC inval_path_ptr ;AN000;
+ PUBLIC japdat_ptr ;AN000;
+ PUBLIC Losterr_ptr ;AN000;
+ PUBLIC md_exists_ptr ;AN006;
+ PUBLIC msg_cont_flag ;AN000;
+ PUBLIC msg_disp_class ;AN000;
+ PUBLIC needbat_ptr ;AN000;
+ PUBLIC newdat_format ;AN000;
+ PUBLIC newdat_ptr ;AN000;
+ PUBLIC newtim_ptr ;AN000;
+ PUBLIC NLSFUNC_ptr ;AN000;
+ PUBLIC nospace_ptr ;AN000;
+ PUBLIC no_values ;AN000;
+ PUBLIC nulpath_ptr ;AN000;
+ PUBLIC offmes_ptr ;AN000;
+ PUBLIC onmes_ptr ;AN000;
+ PUBLIC OrderLtrs ; list of sort order letters for DIR
+ PUBLIC overwr_ptr ;AN000;
+ PUBLIC PARSE_BREAK ;AN000;
+ PUBLIC PARSE_CHCP ;AN000;
+ PUBLIC PARSE_CHDIR ;AN000;
+ PUBLIC PARSE_CTTY ;AN000;
+ PUBLIC PARSE_DATE ;AN000;
+ PUBLIC PARSE_DIR ;AN000;
+ PUBLIC PARSE_ERASE ;AN000;
+ PUBLIC PARSE_MRDIR ;AN000;
+ PUBLIC PARSE_RENAME ;AN000;
+ PUBLIC PARSE_TIME ;AN000;
+ PUBLIC PARSE_VER
+ PUBLIC PARSE_VOL ;AN000;
+
+ public Parse_LoadHi ; Parse block for LoadHigh; M003
+
+ PUBLIC PATH_TEXT
+ PUBLIC pausemes_ptr ;AN000;
+ PUBLIC pipeEmes_ptr ;AN000;
+ PUBLIC promptdat_moday ;AN000;
+ PUBLIC promptdat_ptr ;AN000;
+ PUBLIC promptdat_yr ;AN000;
+ PUBLIC PROMPT_TABLE
+ PUBLIC PROMPT_TEXT
+ PUBLIC promtim_hr_min ;AN000;
+ PUBLIC promtim_ptr ;AN000;
+ PUBLIC promtim_sec_hn ;AN000;
+ PUBLIC renerr_ptr ;AN000;
+ PUBLIC SLASH_P_SYN ;AN000;
+ PUBLIC string_buf_ptr ;AN000;
+ PUBLIC suremes_ptr ;AN000;
+ PUBLIC switch_list
+ PUBLIC syntmes_ptr ;AN000;
+ PUBLIC tab_ptr ;AN000;
+ PUBLIC total_ptr
+ PUBLIC TRANDATAEND
+ PUBLIC usadat_ptr ;AN000;
+ PUBLIC verimes_ptr ;AN000;
+ PUBLIC vermes_ptr ;AN000;
+ PUBLIC volmes_ptr ;AN000;
+ PUBLIC volmes_ptr_2 ;AN000;
+ PUBLIC volsermes_ptr ;AN000;
+ PUBLIC WEEKTAB
+
+ public NoExecBat_Ptr ; M016
+ public LhInvFil_Ptr ; M016
+ public NoCntry_Ptr ; M045
+
+INCLUDE tranmsg.asm
+
+; Lists of help message numbers for internal commands and /?
+
+;;NoHelpMsgs dw 1200,0 ;M014
+BreakHelpMsgs dw 1300,0
+ChcpHelpMsgs dw 1320,1321,0
+CdHelpMsgs dw 1340,1341,1342,0
+ClsHelpMsgs dw 1360,0
+CopyHelpMsgs dw 1400,1401,1402,1403,1404,0
+CttyHelpMsgs dw 1420,0
+DateHelpMsgs dw 1440,1441,0
+DelHelpMsgs dw 1460,1461,1462,0
+DirHelpMsgs dw 1480,1481,1482,1483,1484,1485,1486,1487,1488,0
+ExitHelpMsgs dw 1500,0
+MdHelpMsgs dw 1520,0
+PathHelpMsgs dw 1540,1541,1542,0
+PromptHelpMsgs dw 1560,1561,1562,1563,1564,1565,1566,1567,1568,0
+RdHelpMsgs dw 1580,0
+RenHelpMsgs dw 1600,1601,1602,0
+SetHelpMsgs dw 1620,1621,1622,0
+TimeHelpMsgs dw 1640,1641,0
+TypeHelpMsgs dw 1660,0
+VerHelpMsgs dw 1680,0
+VerifyHelpMsgs dw 1700,0
+VolHelpMsgs dw 1720,0
+
+CallHelpMsgs dw 1740,1741,0 ;M014
+RemHelpMsgs dw 1760,0 ;M014
+PauseHelpMsgs dw 1780,0 ;M014
+EchoHelpMsgs dw 1800,1801,0 ;M014
+GotoHelpMsgs dw 1820,1821,0 ;M014
+ShiftHelpMsgs dw 1840,0 ;M014
+IfHelpMsgs dw 1860,1861,1862,1863,1864,1865,1866,0 ;M014
+ForHelpMsgs dw 1880,1881,1882,1883,0 ;M014
+TruenameHelpMsgs dw 1900,0 ;M014
+LoadhighHelpMsgs dw 1920,1921,1922,0 ;M014
+
+
+CLSSTRING DB 4,01BH,"[2J" ; ANSI Clear screen
+
+PROMPT_TABLE LABEL BYTE
+ btab "B",Print_B
+ btab "D",PRINT_DATE
+ btab "E",PRINT_ESC
+ btab "G",PRINT_G
+ btab "H",PRINT_BACK
+ btab "L",PRINT_L
+ btab "N",PRINT_DRIVE
+ btab "P",build_dir_for_prompt
+ btab "Q",PRINT_EQ
+ btab "T",PRINT_TIME
+ btab "V",PRINT_VERSION
+ btab "_",CRLF2
+ btab "$",PRINT_CHAR
+ DB 0 ; NUL TERMINATED
+
+IFTAB LABEL BYTE ; Table of IF conditionals
+ DB 3,"NOT" ; First byte is count
+ DW OFFSET TRANGROUP:IFNOT
+ DB 10,"ERRORLEVEL"
+ DW OFFSET TRANGROUP:IFERLEV
+ DB 5,"EXIST"
+ DW OFFSET TRANGROUP:IFEXISTS
+ DB 0
+
+; Table for internal command names
+COMTAB DB 3,"DIR",fSwitchAllowed+fCheckDrive
+ DW OFFSET TRANGROUP:CATALOG ; In TCMD1.ASM
+ DW TRANGROUP:DirHelpMsgs
+ DB 4,"CALL",fSwitchAllowed
+ DW OFFSET TRANGROUP:$CALL ; In TBATCH2.ASM
+ DW TRANGROUP:CallHelpMsgs
+ DB 4,"CHCP",fSwitchAllowed
+ DW OFFSET TRANGROUP:CHCP ; In TCMD2B.ASM
+ DW TRANGROUP:ChcpHelpMsgs
+ DB 6,"RENAME",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:CRENAME ; In TCMD1.ASM
+ DW TRANGROUP:RenHelpMsgs
+ DB 3,"REN",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:CRENAME ; In TCMD1.ASM
+ DW TRANGROUP:RenHelpMsgs
+ DB 5,"ERASE",fSwitchAllowed+fCheckDrive
+ DW OFFSET TRANGROUP:ERASE ; In TCMD1.ASM
+ DW TRANGROUP:DelHelpMsgs
+ DB 3,"DEL",fSwitchAllowed+fCheckDrive
+ DW OFFSET TRANGROUP:ERASE ; In TCMD1.ASM
+ DW TRANGROUP:DelHelpMsgs
+ DB 4,"TYPE",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:TYPEFIL ; In TCMD1.ASM
+ DW TRANGROUP:TypeHelpMsgs
+ DB 3,"REM",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:TCOMMAND ; In TCODE.ASM
+ DW TRANGROUP:RemHelpMsgs
+ DB 4,"COPY",fSwitchAllowed+fCheckDrive
+ DW OFFSET TRANGROUP:COPY ; In COPY.ASM
+ DW TRANGROUP:CopyHelpMsgs
+ DB 5,"PAUSE",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:PAUSE ; In TCMD1.ASM
+ DW TRANGROUP:PauseHelpMsgs
+ DB 4,"DATE",fSwitchAllowed
+ DW OFFSET TRANGROUP:DATE ; In TPIPE.ASM
+ DW TRANGROUP:DateHelpMsgs
+ DB 4,"TIME",fSwitchAllowed ;AC018; P3903
+ DW OFFSET TRANGROUP:CTIME ; In TPIPE.ASM
+ DW TRANGROUP:TimeHelpMsgs
+ DB 3,"VER",fSwitchAllowed
+ DW OFFSET TRANGROUP:VERSION ; In TCMD2.ASM
+ DW TRANGROUP:VerHelpMsgs
+ DB 3,"VOL",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:VOLUME ; In TCMD1.ASM
+ DW TRANGROUP:VolHelpMsgs
+ DB 2,"CD",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$CHDIR ; In TENV.ASM
+ DW TRANGROUP:CdHelpMsgs
+ DB 5,"CHDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$CHDIR ; In TENV.ASM
+ DW TRANGROUP:CdHelpMsgs
+ DB 2,"MD",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$MKDIR ; In TENV.ASM
+ DW TRANGROUP:MdHelpMsgs
+ DB 5,"MKDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$MKDIR ; In TENV.ASM
+ DW TRANGROUP:MdHelpMsgs
+ DB 2,"RD",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$RMDIR ; In TENV.ASM
+ DW TRANGROUP:RdHelpMsgs
+ DB 5,"RMDIR",fSwitchAllowed+fCheckDrive ;AC018; P3903
+ DW OFFSET TRANGROUP:$RMDIR ; In TENV.ASM
+ DW TRANGROUP:RdHelpMsgs
+ DB 5,"BREAK",fSwitchAllowed ;AC018; P3903
+ DW OFFSET TRANGROUP:CNTRLC ; In TUCODE.ASM
+ DW TRANGROUP:BreakHelpMsgs
+ DB 6,"VERIFY",fSwitchAllowed ;AC018; P3903
+ DW OFFSET TRANGROUP:VERIFY ; In TUCODE.ASM
+ DW TRANGROUP:VerifyHelpMsgs
+ DB 3,"SET",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:ADD_NAME_TO_ENVIRONMENT; In TENV.ASM
+ DW TRANGROUP:SetHelpMsgs
+ DB 6,"PROMPT",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:ADD_PROMPT ; In TENV.ASM
+ DW TRANGROUP:PromptHelpMsgs
+ DB 4,"PATH",fSwitchAllowed
+ DW OFFSET TRANGROUP:PATH ; In TCMD2.ASM
+ DW TRANGROUP:PathHelpMsgs
+ DB 4,"EXIT",0
+ DW OFFSET TRANGROUP:$EXIT ; In TCMD2.ASM
+ DW TRANGROUP:ExitHelpMsgs
+ DB 4,"CTTY",fCheckDrive+fSwitchAllowed
+ DW OFFSET TRANGROUP:CTTY ; In TCMD2.ASM
+ DW TRANGROUP:CttyHelpMsgs
+ DB 4,"ECHO",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:ECHO ; In TUCODE.ASM
+ DW TRANGROUP:EchoHelpMsgs
+ DB 4,"GOTO",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:GOTO ; In TBATCH.ASM
+ DW TRANGROUP:GotoHelpMsgs
+ DB 5,"SHIFT",fSwitchAllowed
+ DW OFFSET TRANGROUP:SHIFT ; In TBATCH.ASM
+ DW TRANGROUP:ShiftHelpMsgs
+ DB 2,"IF",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:$IF ; In TBATCH.ASM
+ DW TRANGROUP:IfHelpMsgs
+ DB 3,"FOR",fSwitchAllowed+fLimitHelp
+ DW OFFSET TRANGROUP:$FOR ; In TBATCH.ASM
+ DW TRANGROUP:ForHelpMsgs
+ DB 3,"CLS",0
+ DW OFFSET TRANGROUP:CLS ; In TCMD2.ASM
+ DW TRANGROUP:ClsHelpMsgs
+ DB 8,"TRUENAME",fSwitchAllowed+fCheckDrive ;AN000; P3903 changed
+ DW OFFSET TRANGROUP:TRUENAME ;AN000;
+ DW TRANGROUP:TruenameHelpMsgs
+ DB 8,"LOADHIGH",fSwitchAllowed ; M003
+ DW OFFSET TRANGROUP:LoadHigh ; In loadhi.asm ; M003
+ DW TRANGROUP:LoadhighHelpMsgs ; M003
+ DB 2,"LH",fSwitchAllowed ; Short form; M003
+ DW OFFSET TRANGROUP:LoadHigh ; In loadhi.asm ; M003
+ DW TRANGROUP:LoadhighHelpMsgs ; M003
+ DB 0 ; Terminate command table
+
+
+comext dB ".COM"
+exeext dB ".EXE"
+batext dB ".BAT"
+
+switch_list DB "?VBAPW" ; flags we can recognize
+
+AttrLtrs DB "RHSvDA" ; attribute letters for DIR
+
+; Attribute letters in AttrLtrs must appear in the order that
+; attribute bits occur in the attribute byte returned by
+; directory searches, starting with bit 0.
+; The volume label attribute is lowercased to keep it from
+; being matched (by an uppercase comparison).
+
+OrderLtrs DB "NEDSG" ; sort order letters for DIR
+
+; Sort order letters stand for file name, extension,
+; date/time, size, and grouped (directory files before others).
+; DIR routines rely on the specific order of the
+; letters in this list.
+
+comspec_flag db 0 ;AN071;
+
+
+
+PUBLIC BatBufLen
+BatBufLen DW BatLen
+
+; *****************************************************
+; EMG 4.00
+; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00
+; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE
+; *****************************************************
+
+;
+; COMMON PARSE BLOCKS
+;
+
+;
+; Indicates no value list for PARSE.
+;
+
+NO_VALUES DW 0 ;AN000; no values
+
+NULL_VALUE_LIST LABEL BYTE ; for unvalidated value
+ DB 0 ; no value lists
+
+;
+; PARSE control block for a required file specification (upper cased)
+;
+
+FILE_REQUIRED LABEL BYTE ;AN000;
+ DW 0200H ;AN000; filespec - required
+ DW 1 ;AN000; capitalize - file table
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE control block for an optional file specification (upper cased)
+; or drive number
+;
+
+FILE_OPTIONAL LABEL BYTE ;AN000;
+ DW 0301H ;AN000; filespec or drive number
+ ; optional
+ DW 1 ;AN000; capitalize - file table
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE control block for an optional file specification (upper cased)
+;
+
+FILE_OPTIONAL2 LABEL BYTE ;AN000;
+ DW 0201H ;AN000; filespec optional
+ DW 1 ;AN000; capitalize - file table
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE control block for an optional /P switch
+;
+
+SLASH_P_SWITCH LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize - char table
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 1 ;AN000; 1 keyword
+SLASH_P_SYN DB "/P",0 ;AN000; /P switch
+
+
+
+; PARSE BLOCK FOR BREAK, VERIFY, ECHO
+
+;
+; The following parse control block can be used for any command which
+; needs only the optional "ON" and "OFF" keywords as operands. Allows
+; the equal sign as an additional delimiter. Returns verified result
+; in PARSE1_OUTPUT. Currently used for the BREAK, VERIFY, and ECHO
+; internal commands.
+;
+
+PARSE_BREAK LABEL BYTE ;AN000;
+ DW TRANGROUP:BREAK_PARMS ;AN000;
+ DB 0 ;AN032; no extra delimiter
+
+BREAK_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:BREAK_CONTROL1;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+BREAK_CONTROL1 LABEL BYTE ;AN000;
+ DW 2001H ;AN000; string value - optional
+ DW 2 ;AN000; capitalize - char table
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:BREAK_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+BREAK_VALUES LABEL BYTE ;AN000;
+ DB 3 ;AN000;
+ DB 0 ;AN000; no ranges
+ DB 0 ;AN000; no numeric values
+ DB 2 ;AN000; 2 string values
+ DB 0 ;AN000; returned if ON
+ DW TRANGROUP:BREAK_ON ;AN000; point to ON string
+ DB 'f' ;AN000; returned if OFF
+ DW TRANGROUP:BREAK_OFF ;AN000; point to OFF string
+
+BREAK_ON DB "ON",0 ;AN000;
+BREAK_OFF DB "OFF",0 ;AN000;
+
+;
+; PARSE BLOCK FOR CHCP
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only one optional three digit decimal parameter for operands.
+; Returns verified result in PARSE1_OUTPUT. Currently used for the
+; CHCP internal command.
+;
+CHCP_MINVAL EQU 100 ;AN000;
+CHCP_MAXVAL EQU 999 ;AN000;
+
+PARSE_CHCP LABEL BYTE ;AN000;
+ DW TRANGROUP:CHCP_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+CHCP_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:CHCP_CONTROL1 ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+CHCP_CONTROL1 LABEL BYTE ;AN000;
+ DW 8001H ;AN000; numeric value - optional
+ DW 0 ;AN000; no function flags
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:CHCP_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+CHCP_VALUES LABEL BYTE ;AN000;
+ DB 1 ;AN000;
+ DB 1 ;AN000; 1 range
+ DB 1 ;AN000; returned if result
+ DD CHCP_MINVAL,CHCP_MAXVAL ;AN000; minimum & maximum value
+ DB 0 ;AN000; no numeric values
+ DB 0 ;AN000; no string values
+
+
+;
+; PARSE BLOCK FOR DATE
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only an optional date string as an operand. Returns unverified
+; result in DATE_OUTPUT. Currently used for the DATE internal command.
+;
+
+PARSE_DATE LABEL BYTE ;AN000;
+ DW TRANGROUP:DATE_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+DATE_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:DATE_CONTROL1 ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+DATE_CONTROL1 LABEL BYTE ;AN000;
+ DW 1001H ;AN000; date - optional
+ DW 0 ;AN000; no function flags
+ DW TRANGROUP:DATE_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR TIME
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only an optional time string as an operand. Returns unverified
+; result in TIME_OUTPUT. Currently used for the TIME internal command.
+;
+
+PARSE_TIME LABEL BYTE ;AN000;
+ DW TRANGROUP:TIME_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+TIME_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:TIME_CONTROL1 ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+TIME_CONTROL1 LABEL BYTE ;AN000;
+ DW 0801H ;AN000; TIME - optional
+ DW 0 ;AN000; no function flags
+ DW TRANGROUP:TIME_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+
+;
+; PARSE BLOCK FOR VOL
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only an optional drive letter as an operand. Returns unverified
+; drive number (one based) in DRIVE_OUTPUT. Currently used for the VOL
+; internal command.
+;
+
+PARSE_VOL LABEL BYTE ;AN000;
+ DW TRANGROUP:VOL_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+VOL_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:DRIVE_CONTROL1;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+DRIVE_CONTROL1 LABEL BYTE ;AN000;
+ DW 0101H ;AN000; DRIVE - optional
+ DW 1 ;AN000; capitalize - file table
+ DW TRANGROUP:DRIVE_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+
+;
+; PARSE BLOCK FOR MKDIR, RMDIR, TYPE
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only one required file specification as an operand. Returns a
+; pointer to the unverified string in PARSE1_OUTPUT. Currently used
+; for the MKDIR, RMDIR, and TYPE internal commands.
+;
+
+PARSE_MRDIR LABEL BYTE ;AN000;
+ DW TRANGROUP:MRDIR_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+MRDIR_PARMS LABEL BYTE ;AN000;
+ DB 1,1 ;AN000; 1 positional parm
+ DW TRANGROUP:FILE_REQUIRED ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR CHDIR, TRUENAME
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only one optional file specification an operand. Returns a
+; pointer to the unverified string in PARSE1_OUTPUT. Currently used
+; for the CHDIR and TRUENAME internal commands.
+;
+
+PARSE_CHDIR LABEL BYTE ;AN000;
+ DW TRANGROUP:CHDIR_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+CHDIR_PARMS LABEL BYTE ;AN000;
+ DB 0,1 ;AN000; 1 positional parm
+ DW TRANGROUP:FILE_OPTIONAL ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR ERASE
+;
+
+;
+; The following parse control block is used for the DEL/ERASE internal
+; commands. This command has one required file specification and an
+; optional switch (/p) as operands. The verified switch or unverified
+; file specification is returned in PARSE1_OUTPUT.
+;
+
+PARSE_ERASE LABEL BYTE ;AN000;
+ DW TRANGROUP:ERASE_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+ERASE_PARMS LABEL BYTE ;AN000;
+ DB 1,1 ;AN000; 1 positional parm
+ DW TRANGROUP:FILE_REQUIRED ;AN000;
+ DB 1 ;AN000; 1 switch
+ DW TRANGROUP:SLASH_P_SWITCH;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR DIR
+;
+
+;
+; The following parse control block is used for the DIR internal command.
+; This command has one optional file specification and several optional
+; switches. Switches, switch values, and the filespec are returned in
+; PARSE1_OUTPUT.
+;
+; Switches are /a[value], /-a, /o[value], /-o, /s, /-s, /?, /b, /-b,
+; /w, /-w, /p, and /-p. The string values for /a and /o are optional,
+; do not require colons, and are not checked against a value list.
+;
+; Switch /h has been removed from the DIR command ;M008
+; Switch /? is no longer handled internally ;M008
+;
+; A list of pointers to all the switch synonyms is provided here to
+; help identify which switch has been matched.
+;
+
+PARSE_DIR LABEL BYTE
+ DW TRANGROUP:DIR_PARMS
+ DB 0 ; no extra delimiters
+
+DIR_PARMS LABEL BYTE
+ DB 0,1 ; 1 optional positional param
+ DW TRANGROUP:FILE_OPTIONAL2
+ DB 2 ; 2 kinds of switches
+ DW TRANGROUP:DIR_SW_VALUED
+ DW TRANGROUP:DIR_SW_UNVALUED
+ DB 0 ; no keywords
+
+DIR_SW_VALUED LABEL BYTE
+ DW 2001H ; optional string value
+ DW 21H ; optional colon; capitalize
+ DW TRANGROUP:PARSE1_OUTPUT ; result buffer
+ DW TRANGROUP:NULL_VALUE_LIST ; don't validate value
+ DB 2 ; 2 'synonyms'
+DIR_SW_A DB "/A",0
+DIR_SW_O DB "/O",0
+
+DIR_SW_UNVALUED LABEL BYTE
+ DW 0 ; no value
+ DW 0 ; no format functions
+ DW TRANGROUP:PARSE1_OUTPUT ; result buffer
+ DW TRANGROUP:NO_VALUES
+ DB 14 ; 14 'synonyms'
+DIR_SW_NEG_A DB "/-A",0
+DIR_SW_NEG_O DB "/-O",0
+DIR_SW_S DB "/S",0
+DIR_SW_NEG_S DB "/-S",0
+DIR_SW_B DB "/B",0
+DIR_SW_NEG_B DB "/-B",0
+DIR_SW_W DB "/W",0
+DIR_SW_NEG_W DB "/-W",0
+DIR_SW_P DB "/P",0
+DIR_SW_NEG_P DB "/-P",0
+DIR_SW_L DB "/L",0 ;M010
+DIR_SW_NEG_L DB "/-L",0 ;M010
+
+;
+; Here's a list of pointers to DIR's switch synonyms, for easier
+; identification. Order is critical - DIR routines rely on the
+; specific order in this list. Negated options appear at odd
+; positions in the list, and simple on/off options appear first.
+;
+
+DIR_SW_PTRS LABEL WORD ; list of ptrs to switch synonyms
+ DW TRANGROUP:DIR_SW_NEG_W
+ DW TRANGROUP:DIR_SW_W
+ DW TRANGROUP:DIR_SW_NEG_P
+ DW TRANGROUP:DIR_SW_P
+ DW TRANGROUP:DIR_SW_NEG_S
+ DW TRANGROUP:DIR_SW_S
+ DW TRANGROUP:DIR_SW_NEG_B
+ DW TRANGROUP:DIR_SW_B
+ DW TRANGROUP:DIR_SW_NEG_L ;M010
+ DW TRANGROUP:DIR_SW_L ;M010
+ DW TRANGROUP:DIR_SW_NEG_O
+ DW TRANGROUP:DIR_SW_O
+ DW TRANGROUP:DIR_SW_NEG_A
+ DW TRANGROUP:DIR_SW_A
+
+;
+; PARSE BLOCK FOR RENAME
+;
+
+;
+; The following parse control block can be used for any command which
+; needs only two required file specifications as operands. Returns
+; pointers to the unverified string in PARSE1_OUTPUT.
+; Currently used for the RENAME internal command.
+;
+
+PARSE_RENAME LABEL BYTE ;AN000;
+ DW TRANGROUP:RENAME_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+RENAME_PARMS LABEL BYTE ;AN000;
+ DB 2,2 ;AN000; 2 positional parms
+ DW TRANGROUP:FILE_REQUIRED ;AN000;
+ DW TRANGROUP:FILE_REQUIRED ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR CTTY
+;
+
+;
+; The following parse control block can be used for any command which
+; needs one required device name as an operand. Returns a pointer to
+; unverified string in PARSE1_OUTPUT. Currently used for the CTTY
+; internal command.
+;
+
+PARSE_CTTY LABEL BYTE ;AN000;
+ DW TRANGROUP:CTTY_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+CTTY_PARMS LABEL BYTE ;AN000;
+ DB 1,1 ;AN000; 1 positional parm
+ DW TRANGROUP:CTTY_CONTROL1 ;AN000;
+ DB 0 ;AN000; no switches
+ DB 0 ;AN000; no keywords
+
+CTTY_CONTROL1 LABEL BYTE ;AN000;
+ DW 2000H ;AN000; string value - required
+ DW 11H ;AN000; capitalize - file table
+ ;AN000; remove colon at end
+ DW TRANGROUP:PARSE1_OUTPUT ;AN000; result buffer
+ DW TRANGROUP:NO_VALUES ;AN000;
+ DB 0 ;AN000; no keywords
+
+;
+; PARSE BLOCK FOR VER
+;
+
+;
+; The following parse control block can be used for any command which
+; needs an optional switch "/debug". Currently used for the VER command.
+;
+
+PARSE_VER LABEL BYTE
+ DW TRANGROUP:VER_PARMS
+ DB 0 ; no extra delimiters
+
+VER_PARMS LABEL BYTE
+ DB 0,0 ; no positional parameters
+ DB 1 ; one switch
+ DW TRANGROUP:SLASH_R
+ DB 0 ; no keywords
+
+SLASH_R LABEL BYTE
+ DW 0 ; no values
+ DW 2 ; capitalize by filename table
+ DW TRANGROUP:PARSE1_OUTPUT ; result buffer
+ DW TRANGROUP:NO_VALUES ; no values
+ DB 1 ; one synonym
+SLASH_R_SYN DB "/R",0
+
+;
+; M003 ; Start of changes for LoadHigh support
+;
+
+;
+;Parse Control Block for LOADHIGH command
+;
+
+Parse_LoadHi label byte
+ dw TRANGROUP:LoadHi_Parms ;extended parm table
+ db 0 ;no extra delimiters
+
+LoadHi_Parms label byte
+ db 1,1 ;min. 1 parm, max. 1 parm
+ dw TRANGROUP:File_Required ;control struc for filename
+ db 0 ;no switches
+ db 0 ;no keywords
+;
+; M003 ; End of changes for LoadHigh support
+;
+
+; Table of internal command which have special meaning under NT while at
+; command.com prompt. First field is the command name length. Second is the
+; command name. Third is only 1 for exit command, rest are all 0. This field
+; is returned in al.
+
+ public NT_INTRNL_CMND
+
+NT_INTRNL_CMND label byte
+ db 4,"EXIT",0
+ db 6,"PROMPT",1
+ db 3,"SET",1
+ db 4,"PATH",1
+ db 2,"CD",1
+ db 5,"CHDIR",1
+ db 0
+
+
+
+public TempVarName
+TempVarName db "TEMP=",0
+
+ifdef BETA3WARN
+%out Take this out before we ship
+public Beta3WarnMsg
+Beta3WarnMsg label byte
+
+ db '+--------------------- WARNING! ------------------------+', 0dh, 0ah
+ db '| |', 0dh, 0ah
+ db '| |', 0dh, 0ah
+ db '| The license for this pre-release version of MS-DOS |', 0dh, 0ah
+ db '| 5.0 has expired. Please replace it with an updated |', 0dh, 0ah
+ db '| version of MS-DOS 5.0 immediately. |', 0dh, 0ah
+ db '| |', 0dh, 0ah
+ db '| |', 0dh, 0ah
+ db '| <Press any key to continue> |', 0dh, 0ah
+ db '| |', 0dh, 0ah
+ db '+-------------------------------------------------------+', 0dh, 0ah
+ db '$'
+endif
+
+
+TRANDATA ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AN000;
+
+.xlist
+.xcref
+
+INCLUDE SYSMSG.INC ;AN000;
+
+.list
+.cref
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP,CS:TRANGROUP
+
+MSG_UTILNAME <COMMAND> ;AN000; define utility name
+
+MSG_SERVICES <COMT,COMMAND.CLF,COMMAND.CL1,COMMAND.CL2> ;AN000; The transient messages
+
+include msgdcl.inc
+
+TRANCODE ENDS ;AN000;
+
+TRANDATA SEGMENT PUBLIC BYTE
+
+TRANDATAEND LABEL BYTE
+
+TRANDATA ENDS ;AN000;
+
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/command/tenv.asm b/private/mvdm/dos/v86/cmd/command/tenv.asm
new file mode 100644
index 000000000..4d55b342c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tenv.asm
@@ -0,0 +1,667 @@
+ page ,132
+; SCCSID = @(#)tenv.asm 4.2 85/08/16
+; SCCSID = @(#)tenv.asm 4.2 85/08/16
+TITLE Part6 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; Environment utilities and misc. routines
+;
+; Revision History
+; ================
+;
+; M024 SR 9/5/90 Zero out comspec_flag to fix bug
+; #710 about comspec getting trashed.
+;
+
+
+
+ INCLUDE comsw.asm
+
+.xlist
+.xcref
+ include dossym.inc
+ include syscall.inc
+ include arena.inc
+ include comseg.asm
+ include comequ.asm
+ include doscntry.inc ;an000;
+ include resmsg.equ
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN comdrv:byte
+ EXTRN comspec_end:word
+ EXTRN dbcs_vector_addr:dword ;AN000;
+ EXTRN ENVIRSEG:WORD
+ EXTRN fucase_addr:word ;AC000;
+ EXTRN PutBackDrv:byte
+ EXTRN PutBackComSpec:byte
+ EXTRN RESTDIR:BYTE
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg_buf_ptr:word
+ EXTRN comspec:byte
+ EXTRN comspec_flag:byte
+ EXTRN comspecstr:byte
+ EXTRN ENVERR_PTR:WORD
+ EXTRN PATH_TEXT:byte
+ EXTRN PROMPT_TEXT:byte
+ EXTRN SYNTMES_PTR:WORD
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN Arg_Buf:BYTE
+ EXTRN RESSEG:WORD
+ EXTRN USERDIR1:BYTE
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC byte
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN cerror:near
+
+ PUBLIC add_name_to_environment
+ PUBLIC add_prompt
+ PUBLIC delete_path
+ PUBLIC find_name_in_environment
+ PUBLIC find_path
+ PUBLIC find_prompt
+ PUBLIC move_name
+ PUBLIC restudir
+ PUBLIC restudir1
+ PUBLIC scan_double_null
+ PUBLIC scasb2
+ PUBLIC store_char
+ PUBLIC Testkanj ;AN000; 3/3/KK
+ PUBLIC upconv
+ PUBLIC GETENVSIZ
+
+BREAK <Environment utilities>
+ASSUME DS:TRANGROUP
+
+ break Prompt command
+assume ds:trangroup,es:trangroup
+
+ADD_PROMPT:
+ CALL DELETE_PROMPT ; DELETE ANY EXISTING PROMPT
+ CALL SCAN_DOUBLE_NULL
+
+ADD_PROMPT2:
+ PUSH SI
+ CALL GETARG
+ POP SI
+ retz ; PRE SCAN FOR ARGUMENTS
+ CALL MOVE_NAME ; MOVE IN NAME
+ CALL GETARG
+ PUSH SI
+ JMP SHORT ADD_NAME
+
+
+ break The SET command
+assume ds:trangroup,es:trangroup
+
+;
+; Input: DS:SI points to a CR terminated string
+; Output: carry flag is set if no room
+; otherwise name is added to environment
+;
+
+DISP_ENVj:
+ jmp DISP_ENV
+
+ADD_NAME_TO_ENVIRONMENT:
+ CALL GETARG
+ JZ DISP_ENVj
+;
+; check if line contains exactly one equals sign
+;
+ XOR BX,BX ;= COUNT IS 0
+ PUSH SI ;SAVE POINTER TO BEGINNING OF LINE
+
+EQLP:
+ LODSB ;GET A CHAR
+ CMP AL,13 ;IF CR WE'RE ALL DONE
+ JZ QUEQ
+ CMP AL,'=' ;LOOK FOR = SIGN
+ JNZ EQLP ;NOT THERE, GET NEXT CHAR
+ INC BL ;OTHERWISE INCREMENT EQ COUNT
+ CMP BYTE PTR [SI],13 ;LOOK FOR CR FOLLOWING = SIGN
+ JNZ EQLP
+ INC BH ;SET BH=1 MEANS NO PARAMETERS
+ JMP EQLP ;AND LOOK FOR MORE
+
+QUEQ:
+ POP SI ;RESTORE BEGINNING OF LINE
+ DEC BL ;ZERO FLAG MEANS ONLY ONE EQ
+ JZ ONEQ ;GOOD LINE
+ MOV DX,OFFSET TRANGROUP:SYNTMES_ptr
+ JMP CERROR
+
+ONEQ:
+ PUSH BX
+ CALL DELETE_NAME_IN_ENVIRONMENT
+ POP BX
+ DEC BH
+ retz
+
+ CALL SCAN_DOUBLE_NULL
+ mov bx,di ; Save ptr to beginning of env var name
+ CALL MOVE_NAME
+ push si
+ xchg bx,di ; Switch ptrs to beginning and end of
+ ; env var name
+;
+; We want to special-case COMSPEC. This is to reduce the amount of code
+; necessary in the resident for re-reading the transient. Let's look for
+; COMSPEC=
+;
+ mov comspec_flag,0 ; clear flag ; M024
+ mov si,offset trangroup:comspecstr ; Load ptr to string "COMSPEC"
+ mov cx,4 ; If the new env var is comspec, set
+ repz cmpsw ; the comspec_flag
+;
+; Zero set => exact match
+;
+ jnz not_comspec
+ inc comspec_flag ; comspec is changing ; M024
+
+not_comspec:
+ mov di,bx ; Load ptr to end of env var name
+
+ADD_NAME: ; Add the value of the new env var
+ pop si ; to the environment.
+ push si
+
+add_name1:
+ LODSB
+ CMP AL,13
+ jz add_name_ret
+ CALL STORE_CHAR
+ JMP ADD_NAME1
+
+add_name_ret:
+ pop si
+ cmp comspec_flag,0 ; If the new env var is comspec,
+ retz ; copy the value into the
+;
+; We have changed the COMSPEC variable. We need to update the resident
+; pieces necessary to reread in the info. First, skip all delimiters
+;
+ invoke ScanOff
+ mov es,[resseg] ; comspec var in the resident
+ assume es:resgroup
+;
+; Make sure that the printer knows where the beginning of the string is
+;
+ mov di,offset resgroup:comspec
+ mov bx,di
+;
+; Generate drive letter for display
+;
+ xor ax,ax ;g assume no drive first
+ mov comdrv,al ;g
+ push ax ;AN000; 3/3/KK
+ mov al,[si] ;AN000; 3/3/KK
+ call testkanj ;AN000; 3/3/KK
+ pop ax ;AN000; 3/3/KK
+ jnz GotDrive
+ cmp byte ptr [si+1],':' ; drive specified?
+ jnz GotDrive
+ mov al,[si] ; get his specified drive
+ call UpConv ; convert to uppercase
+ sub al,'A' ; convert to 0-based
+ add di,2
+ inc al ; convert to 1-based number
+ mov comdrv,al
+;
+; Stick the drive letter in the prompt message. Nothing special needs to be
+; done here..
+;
+
+ add al,'A'-1
+
+GotDrive: ;g
+ mov PutBackComSpec.SubstPtr,di ;g point to beginning of name after drive
+ mov es:PutBackDrv,al
+;
+; Copy chars until delim
+;
+
+ mov di,bx
+
+copy_comspec:
+ lodsb
+ invoke Delim
+ jz CopyDone
+ cmp al,13
+ jz CopyDone
+ stosb
+ jmp short copy_comspec
+
+CopyDone:
+ xor al,al ; Null terminate the string and quit
+ stosb
+ mov comspec_flag,0
+ dec di
+ mov comspec_end,di
+
+ ret
+
+DISP_ENV:
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV DS,[ENVIRSEG]
+ASSUME DS:NOTHING
+ XOR SI,SI
+
+PENVLP:
+ CMP BYTE PTR [SI],0
+ retz
+ mov di,offset trangroup:arg_buf
+
+PENVLP2:
+ LODSB
+ stosb
+ OR AL,AL
+ JNZ PENVLP2
+ mov dx,offset trangroup:arg_buf_ptr
+ push ds
+ push es
+ pop ds
+ invoke printf_crlf
+ pop ds
+ JMP PENVLP
+
+ASSUME DS:TRANGROUP
+
+DELETE_PATH:
+ MOV SI,OFFSET TRANGROUP:PATH_TEXT
+ JMP SHORT DELETE_NAME_IN_environment
+
+DELETE_PROMPT:
+ MOV SI,OFFSET TRANGROUP:PROMPT_TEXT
+
+DELETE_NAME_IN_environment:
+;
+; Input: DS:SI points to a "=" terminated string
+; Output: carry flag is set if name not found
+; otherwise name is deleted
+;
+ PUSH SI
+ PUSH DS
+ CALL FIND ; ES:DI POINTS TO NAME
+ JC DEL1
+ MOV SI,DI ; SAVE IT
+ CALL SCASB2 ; SCAN FOR THE NUL
+ XCHG SI,DI
+;SR;
+; If we have only one env string, then the double null is lost when the last
+;string is deleted and we have an invalid empty environment with only a
+;single null. To avoid this, we will look for the double null case and then
+;move an extra null char.
+; Bugbug: The only possible problem is that the last pathstring
+;will be followed by a triple null. Is this really a problem?
+;
+ cmp byte ptr es:[si],0 ;null char?
+ jnz not_dnull ;no, we are at a double null
+ dec si ;point at the double null
+not_dnull:
+
+ CALL GETENVSIZ
+ SUB CX,SI
+ PUSH ES
+ POP DS ; ES:DI POINTS TO NAME, DS:SI POINTS TO NEXT NAME
+ REP MOVSB ; DELETE THE NAME
+
+DEL1:
+ POP DS
+ POP SI
+ return
+
+FIND_PATH:
+ MOV SI,OFFSET TRANGROUP:PATH_TEXT
+ JMP SHORT FIND_NAME_IN_environment
+
+FIND_PROMPT:
+ MOV SI,OFFSET TRANGROUP:PROMPT_TEXT
+
+FIND_NAME_IN_environment:
+;
+; Input: DS:SI points to a "=" terminated string
+; Output: ES:DI points to the arguments in the environment
+; zero is set if name not found
+; carry flag is set if name not valid format
+;
+ CALL FIND ; FIND THE NAME
+ retc ; CARRY MEANS NOT FOUND
+ JMP SCASB1 ; SCAN FOR = SIGN
+;
+; On return of FIND1, ES:DI points to beginning of name
+;
+FIND:
+ CLD
+ CALL COUNT0 ; CX = LENGTH OF NAME
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+ MOV ES,[ENVIRSEG]
+ASSUME ES:NOTHING
+ XOR DI,DI
+
+FIND1:
+ PUSH CX
+ PUSH SI
+ PUSH DI
+
+FIND11:
+ LODSB
+ CALL TESTKANJ
+ JZ NOTKANJ3
+ DEC SI
+ LODSW
+ INC DI
+ INC DI
+ CMP AX,ES:[DI-2]
+ JNZ FIND12
+ DEC CX
+ LOOP FIND11
+ JMP SHORT FIND12
+
+NOTKANJ3:
+ CALL UPCONV
+ INC DI
+ CMP AL,ES:[DI-1]
+ JNZ FIND12
+ LOOP FIND11
+
+FIND12:
+ POP DI
+ POP SI
+ POP CX
+ retz
+ PUSH CX
+ CALL SCASB2 ; SCAN FOR A NUL
+ POP CX
+ CMP BYTE PTR ES:[DI],0
+ JNZ FIND1
+ STC ; INDICATE NOT FOUND
+ return
+
+COUNT0:
+ PUSH DS
+ POP ES
+ MOV DI,SI
+
+COUNT1:
+ PUSH DI ; COUNT NUMBER OF CHARS UNTIL "="
+ CALL SCASB1
+ JMP SHORT COUNTX
+
+COUNT2:
+ PUSH DI ; COUNT NUMBER OF CHARS UNTIL NUL
+ CALL SCASB2
+
+COUNTX:
+ POP CX
+ SUB DI,CX
+ XCHG DI,CX
+ return
+
+MOVE_NAME:
+ CMP BYTE PTR DS:[SI],13
+ retz
+ LODSB
+
+;;;; IFDEF DBCS 3/3/KK
+ CALL TESTKANJ
+ JZ NOTKANJ1
+ CALL STORE_CHAR
+ LODSB
+ CALL STORE_CHAR
+ JMP SHORT MOVE_NAME
+
+NOTKANJ1:
+;;;; ENDIF 3/3/KK
+
+ CALL UPCONV
+ CALL STORE_CHAR
+ CMP AL,'='
+ JNZ MOVE_NAME
+ return
+
+GETARG:
+ MOV SI,80H
+ LODSB
+ OR AL,AL
+ retz
+ invoke SCANOFF
+ CMP AL,13
+ return
+
+;
+; Point ES:DI to the final NULL string. Note that in an empty environment,
+; there is NO double NULL, merely a string that is empty.
+;
+SCAN_DOUBLE_NULL:
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+ MOV ES,[ENVIRSEG]
+ASSUME ES:NOTHING
+ XOR DI,DI
+;
+; Top cycle-point. If the string here is empty, then we are done
+;
+SDN1:
+ cmp byte ptr es:[di],0 ; nul string?
+ retz ; yep, all done
+ CALL SCASB2
+ JMP SDN1
+
+SCASB1:
+ MOV AL,'=' ; SCAN FOR AN =
+ JMP SHORT SCASBX
+SCASB2:
+ XOR AL,AL ; SCAN FOR A NUL
+SCASBX:
+ MOV CX,1000H
+ REPNZ SCASB
+ return
+;Bugbug: This is Kanji stuff - put it in conditionals
+
+TESTKANJ:
+ push ds ;AN000; 3/3/KK
+ push si ;AN000; 3/3/KK
+ push ax ;AN000; 3/3/KK
+ mov ds,cs:[resseg] ;AN000; Get resident segment
+ assume ds:resgroup ;AN000;
+ lds si,dbcs_vector_addr ;AN000; get DBCS vector
+ktlop: ;AN000; 3/3/KK
+ cmp word ptr ds:[si],0 ;AN000; end of Table 3/3/KK
+ je notlead ;AN000; 3/3/KK
+ pop ax ;AN000; 3/3/KK
+ push ax ;AN000; 3/3/KK
+ cmp al, byte ptr ds:[si] ;AN000; 3/3/KK
+ jb notlead ;AN000; 3/3/KK
+ inc si ;AN000; 3/3/KK
+ cmp al, byte ptr ds:[si] ;AN000; 3/3/KK
+ jbe islead ;AN000; 3/3/KK
+ inc si ;AN000; 3/3/KK
+ jmp short ktlop ;AN000; try another range ; 3/3/KK
+Notlead: ;AN000; 3/3/KK
+ xor ax,ax ;AN000; set zero 3/3/KK
+ jmp short ktret ;AN000; 3/3/KK
+Islead: ;AN000; 3/3/KK
+ xor ax,ax ;AN000; reset zero 3/3/KK
+ inc ax ;AN000; 3/3/KK
+ktret: ;AN000; 3/3/KK
+ pop ax ;AN000; 3/3/KK
+ pop si ;AN000; 3/3/KK
+ pop ds ;AN000; 3/3/KK
+ return ;AN000; 3/3/KK
+;------------------------------------- ;3/3/KK
+
+
+; ****************************************************************
+; *
+; * ROUTINE: UPCONV (ADDED BY EMG 4.00)
+; *
+; * FUNCTION: This routine returns the upper case equivalent of
+; * the character in AL from the file upper case table
+; * in DOS if character if above ascii 128, else
+; * subtracts 20H if between "a" and "z".
+; *
+; * INPUT: AL char to be upper cased
+; * FUCASE_ADDR set to the file upper case table
+; *
+; * OUTPUT: AL upper cased character
+; *
+; ****************************************************************
+
+assume ds:trangroup ;AN000;
+
+upconv proc near ;AN000;
+
+ cmp al,80h ;AN000; see if char is > ascii 128
+ jb oth_fucase ;AN000; no - upper case math
+ sub al,80h ;AN000; only upper 128 chars in table
+ push ds ;AN000;
+ push bx ;AN000;
+ mov ds,[resseg] ;AN000; get resident data segment
+assume ds:resgroup ;AN000;
+ lds bx,dword ptr fucase_addr+1 ;AN000; get table address
+ add bx,2 ;AN000; skip over first word
+ xlat ds:byte ptr [bx] ;AN000; convert to upper case
+ pop bx ;AN000;
+ pop ds ;AN000;
+assume ds:trangroup ;AN000;
+ jmp short upconv_end ;AN000; we finished - exit
+
+oth_fucase: ;AN000;
+ cmp al,small_a ;AC000; if between "a" and "z",
+ jb upconv_end ;AC000; subtract 20h to get
+ cmp al,small_z ;AC000; upper case equivalent.
+ ja upconv_end ;AC000;
+ sub al,20h ;AC000; Change lower-case to upper
+
+upconv_end: ;AN000;
+ ret
+
+upconv endp ;AN000;
+
+
+;
+; STORE A CHAR IN environment, GROWING IT IF NECESSARY
+;
+STORE_CHAR:
+ PUSH CX
+ PUSH BX
+ PUSH ES ;AN056;
+ PUSH DS ;AN056; Save local DS
+ MOV DS,[RESSEG] ;AN056; Get resident segment
+ ASSUME DS:RESGROUP ;AN056;
+ MOV ES,[ENVIRSEG] ;AN056; Get environment segment
+ ASSUME ES:NOTHING ;AN056;
+ POP DS ;AN056; Get local segment back
+ ASSUME DS:TRANGROUP ;AN056;
+ CALL GETENVSIZ
+ MOV BX,CX
+ SUB BX,2 ; SAVE ROOM FOR DOUBLE NULL
+ CMP DI,BX
+ JB STORE1
+
+ PUSH AX
+ PUSH CX
+ PUSH BX ; Save Size of environment
+ invoke FREE_TPA
+ POP BX
+ ADD BX,2 ; Recover true environment size
+
+ CMP BX, 8000H ; Don't let environment grow > 32K
+ JB ENVSIZ_OK
+BAD_ENV_SIZE: ;AN056;
+ STC
+ JMP SHORT ENVNOSET
+ENVSIZ_OK:
+
+ MOV CL,4
+ SHR BX,CL ; Convert back to paragraphs
+ INC BX ; Try to grow environment by one para
+ MOV CX,ES ;AN056; Get environment segment
+ ADD CX,BX ;AN056; Add in size of environment
+ ADD CX,020H ;AN056; Add in some TPA
+ MOV AX,CS ;AN056; Get the transient segment
+ CMP CX,AX ;AN056; Are we hitting the transient?
+ JNB BAD_ENV_SIZE ;AN056; Yes - don't do it!!!
+ MOV AH,SETBLOCK
+ INT 21h
+ENVNOSET:
+ PUSHF
+ PUSH ES
+ MOV ES,[RESSEG]
+ invoke ALLOC_TPA
+ POP ES
+ POPF
+ POP CX
+ POP AX
+ JNC STORE1
+ POP ES ;AN056;
+ MOV DX,OFFSET TRANGROUP:ENVERR_ptr
+ JMP CERROR
+STORE1:
+ STOSB
+ MOV WORD PTR ES:[DI],0 ; NULL IS AT END
+ POP ES ;AN056;
+ POP BX
+ POP CX
+ return
+
+GETENVSIZ:
+;Get size of environment in bytes, rounded up to paragraph boundry
+;ES has environment segment
+;Size returned in CX, all other registers preserved
+
+ PUSH ES
+ PUSH AX
+ MOV AX,ES
+ DEC AX ;Point at arena
+ MOV ES,AX
+ MOV AX,ES:[arena_size]
+ MOV CL,4
+ SHL AX,CL ;Convert to bytes
+ MOV CX,AX
+ POP AX
+ POP ES
+ return
+
+
+ASSUME DS:TRANGROUP
+
+
+RESTUDIR1:
+ PUSH DS
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ CMP [RESTDIR],0
+ POP DS
+ASSUME DS:TRANGROUP
+ retz
+
+RESTUDIR:
+ MOV DX,OFFSET TRANGROUP:USERDIR1
+ MOV AH,CHDIR
+ INT 21h ; Restore users DIR
+ XOR AL,AL
+ invoke SETREST
+RET56:
+ return
+
+trancode ends
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/tenv2.asm b/private/mvdm/dos/v86/cmd/command/tenv2.asm
new file mode 100644
index 000000000..8ae53942f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tenv2.asm
@@ -0,0 +1,711 @@
+ page ,132
+; SCCSID = @(#)tenv2.asm 1.1 85/05/14
+; SCCSID = @(#)tenv2.asm 1.1 85/05/14
+TITLE Part6 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; Environment utilities and misc. routines
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include find.inc
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN pipeflag:byte
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN ACRLF_PTR:WORD
+ EXTRN BadCD_Ptr:WORD
+ EXTRN Badmkd_ptr:word
+ EXTRN BADRMD_PTR:WORD
+ EXTRN Extend_buf_ptr:word ;AN000;
+ EXTRN Extend_buf_sub:byte ;AN022;
+ EXTRN MD_exists_ptr:word ;AN006;
+ EXTRN msg_disp_class:byte ;AC000;
+ EXTRN NOSPACE_PTR:WORD
+ EXTRN parse_chdir:byte ;AC000;
+ EXTRN parse_mrdir:byte ;AC000;
+ EXTRN PIPEEMES_PTR:WORD
+ EXTRN string_buf_ptr:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN CURDRV:BYTE
+ EXTRN DESTINFO:BYTE
+ EXTRN DESTTAIL:WORD
+ EXTRN DIRCHAR:BYTE
+ EXTRN dirflag:byte ;AN015;
+ EXTRN KPARSE:BYTE ;AC000; 3/3/KK
+ EXTRN msg_numb:word ;AN022;
+ EXTRN parse1_addr:dword ;AC000;
+ EXTRN parse1_type:byte ;AC000;
+ EXTRN PATHPOS:WORD
+ EXTRN RESSEG:WORD
+ EXTRN srcxname:byte ;AC000;
+ EXTRN string_ptr_2:word
+ EXTRN SWITCHAR:BYTE
+ EXTRN USERDIR1:BYTE
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC byte
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN cerror:near
+
+ PUBLIC $chdir
+ PUBLIC $mkdir
+ PUBLIC $rmdir
+ PUBLIC crlf2
+ PUBLIC crprint
+ PUBLIC delim
+ PUBLIC error_output
+ PUBLIC fcb_to_ascz
+ PUBLIC pathchrcmp
+ PUBLIC pathcrunch
+ PUBLIC savudir
+ PUBLIC savudir1
+ PUBLIC scanoff
+ PUBLIC strcomp
+
+break $Chdir
+
+; ****************************************************************
+; *
+; * ROUTINE: $CHDIR
+; *
+; * FUNCTION: Entry point for CHDIR command. Parse the command
+; * line. If path is found, CHDIR to path. If a drive
+; * letter is found, get and display the current dir
+; * of the specified drive. If nothing is found, get
+; * and display the current dir of the default drive.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+$CHDIR:
+
+ mov si,81H
+ mov di,offset trangroup:parse_chdir ;AN000; Get adderss of PARSE_CHDIR
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC018; call parser
+
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ jz bwdJ ; No args
+ cmp ax,result_no_error ;AC000; did we have an error?
+ jnz ChDirErr ;AC018; yes - exit
+
+ cmp parse1_type,result_drive ;AC000; was a drive entered?
+ jnz REALCD ; no
+;
+; D: was found. See if there is anything more.
+;
+ mov di,offset trangroup:parse_chdir ;AC000; get address of parse_chdir
+ xor dx,dx ;AC000;
+ invoke parse_check_eol ;AC000; call parser
+ jnz ChDirErr ;AC000;
+
+bwdJ:
+ invoke build_dir_for_chdir ; Drive only specified
+ call crlf2
+ return
+
+REALCD:
+
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AN000; get address of filespec
+ invoke move_to_srcbuf ;AN000; move to srcbuf
+ pop si ;AN000; restore position in line
+ mov di,offset trangroup:parse_chdir ;AC000; get address of parse_chdir
+ xor dx,dx ;AC000;
+ invoke parse_check_eol ;AC000; call parser
+ jnz ChDirErr ;AC000;
+
+ invoke SETPATH
+ TEST [DESTINFO],2
+ JNZ BadChdir
+ MOV AH,CHDIR
+ INT 21h
+ retnc
+
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_path_not_found ;AN022; see if path not found
+ jz BadChDir ;AN022; yes - issue old message
+;SR;
+; We want to issue "Invalid Directory" message even if the path is valid
+;but is not a directory. The extended error returns "Access denied" which
+;is kind of confusing. Issue the old message if access denied error is
+;returned
+;
+ cmp ax,error_access_denied
+ jz BadChDir
+
+ call Set_Ext_Error_Subst ;AN022;
+ jmp short chdirerr ;AN022;
+
+BadChDir:
+ MOV DX,OFFSET TRANGROUP:BADCD_ptr
+
+ChDirErr:
+ invoke Std_Eprintf
+ return
+
+break $Mkdir
+
+assume ds:trangroup,es:trangroup
+
+$MKDIR:
+ CALL SETRMMK
+ JC MkDirErr
+ MOV AH,MKDIR
+ INT 21h
+ retnc
+
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_path_not_found ;AN022; see if path not found
+ jz MD_other_err ;AN022; yes - issue old message
+ cmp ax,error_access_denied ;AN022; access denied?
+ jz badmderr ;AN022; yes - see if file exists
+
+ call Set_Ext_Error_Subst ;AN022;
+ jmp short MkDirerr ;AC022; yes - go print it
+
+BADMDERR:
+ mov dx,offset trangroup:srcxname ;AN006; Set Disk transfer address
+ mov ah,Set_DMA ;AN006;
+ int 21h ;AN006;
+ MOV AH,Find_First ;AN006; see if file/dir exists
+ mov cx,attr_directory ;AN006; search for directory
+ INT 21h ;AN006;
+ jc MD_other_err ;AN006; doesn't exist - must be something else
+ mov dl,srcxname.find_buf_attr ;AN006; we found a file/dir
+ test dl,attr_directory ;AN006; was it a directory?
+ jz MD_other_err ;AN006; no - must have been a file
+ mov dx,offset trangroup:MD_exists_ptr ;AN006; set up already exists error
+ jmp short MkDirErr ;AN006; make sure we didn't have network error
+MD_other_err: ;AN006;
+ MOV DX,OFFSET TRANGROUP:BADMKD_ptr
+MkDirErr:
+ invoke Std_Eprintf
+ return
+
+Break <Common MkDir/RmDir set up code>
+
+;****************************************************************
+;*
+;* ROUTINE: SETRMMK
+;*
+;* FUNCTION: Parse routine for the internal MKDIR and RMDIR
+;* commands. Parses the command line for a required
+;* filespec.
+;*
+;* INPUT: command line at offset 81H
+;*
+;* OUTPUT: carry clear
+;* DS:DX points to ASCIIZ argument
+;* carry set
+;* DS:DX has error message pointer
+;*
+;****************************************************************
+
+SETRMMK:
+ mov si,81H
+ mov di,offset trangroup:parse_mrdir ;AN000; Get adderss of PARSE_MRDIR
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke parse_with_msg ;AC000; call parser
+ cmp ax,result_no_error ;AC000; did we have an error?
+ jnz NOARGERR ;AC000; yes - exit
+
+ mov di,offset trangroup:srcxname ;AN000; get address of srcxname
+ push di ;AN000; save address
+ push si ;AN000; save position in line
+ lds si,parse1_addr ;AN000; get address of path
+
+mrdir_move_filename: ;AN000; put filespec in srcxname
+ lodsb ;get a char from buffer
+ stosb ;AN000; store in srcxname
+ cmp al,end_of_line_out ;AC000; it char a terminator?
+ jnz mrdir_move_filename ;AC000; no - keep moving
+ pop si ;AN000; get line position back
+
+;
+; we have scanned an argument. See if any args beyond.
+;
+
+ mov di,offset trangroup:parse_mrdir ;AC000; get address of parse_mrdir
+ invoke parse_check_eol ;AC000; are we at end of line?
+ pop dx ;AC000; get address of SRCXNAME
+ retz ;yes - return no error
+NOARGERR:
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ XOR AX,AX
+ STC
+ return
+
+break $Rmdir
+
+assume ds:trangroup,es:trangroup
+
+$RMDIR:
+ CALL SETRMMK
+ JC RmDirErr
+ JNZ BADRDERR
+ MOV AH,RMDIR
+ INT 21h
+ retnc
+
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_path_not_found ;AN022; see if path not found
+ jz badrderr ;AN022; yes - issue old message
+ cmp ax,error_access_denied ;AN022; access denied?
+ jz badrderr ;AN022; yes - issue old message
+
+ call Set_Ext_Error_Subst ;AN022;
+ jmp short RmDirerr ;AC022; yes - go print it
+
+BADRDERR:
+ MOV DX,OFFSET TRANGROUP:BADRMD_ptr
+
+RmDirErr:
+ invoke STD_Eprintf
+ return
+
+;****************************************************************
+;*
+;* ROUTINE: Set_ext_error_subst
+;*
+;* FUNCTION: Sets up substitution for extended error
+;*
+;* INPUT: AX - extended error number
+;* DX - offset of string
+;*
+;* OUTPUT: Extend_Buf_Ptr set up for STD_EPRINTF
+;*
+;****************************************************************
+
+Set_ext_error_subst proc near ;AN022;
+
+ mov msg_disp_class,ext_msg_class ;AN022; set up extended error msg class
+ mov string_ptr_2,dx ;AN022; get address of failed string
+ mov Extend_buf_sub,one_subst ;AN022; put number of subst in control block
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AN022; get extended message pointer
+ mov Extend_Buf_ptr,ax ;AN022; get message number in control block
+
+ ret ;AN022; return
+
+Set_ext_error_subst endp ;AN022;
+
+
+
+
+
+Break <SavUDir - preserve the users current directory on a particular drive>
+
+;
+; SavUDir - move the user's current directory on a drive into UserDir1
+; SavUDir1 - move the user's current directory on a drive into a specified
+; buffer
+;
+; Inputs: DL has 1-based drive number
+; ES:DI has destination buffer (SavUDir1 only)
+; Outputs: Carry Clear
+; DS = TranGroup
+; Carry Set
+; AX has error code
+; Registers Modified: AX, SI
+;
+
+SAVUDIR:
+ MOV DI,OFFSET TRANGROUP:USERDIR1
+
+SAVUDIR1:
+ MOV AL,DL
+ ADD AL,'@'
+ CMP AL,'@'
+ JNZ GOTUDRV
+ ADD AL,[CURDRV]
+ INC AL ; A = 1
+
+GOTUDRV:
+ STOSB
+ MOV AH,[DIRCHAR]
+ MOV AL,':'
+ STOSW
+ PUSH ES
+ POP DS
+ASSUME DS:NOTHING
+
+ MOV SI,DI
+ MOV AH,CURRENT_DIR ; Get the Directory Text
+ INT 21h
+ retc
+ PUSH CS
+ POP DS
+ASSUME DS:TRANGROUP
+
+ return
+
+
+CRLF2:
+ PUSH DX
+ MOV DX,OFFSET TRANGROUP:ACRLF_ptr
+
+PR:
+ PUSH DS
+ PUSH CS
+ POP DS
+ invoke std_printf
+ POP DS
+ POP DX
+
+ return
+
+;
+; These routines (SCANOFF, DELIM) are called in batch processing when DS
+; may NOT be TRANGROUP
+;
+ASSUME DS:NOTHING,ES:NOTHING
+
+SCANOFF:
+ LODSB
+ CALL DELIM
+ JZ SCANOFF
+ DEC SI ; Point to first non-delimiter
+ return
+
+;
+; Input: AL is character to classify
+; Output: Z set if delimiter
+; NZ set otherwise
+; Registers modified: none
+;
+
+DELIM:
+ CMP AL,' '
+ retz
+ CMP AL,'='
+ retz
+ CMP AL,','
+ retz
+ CMP AL,';'
+ retz
+ CMP AL,9 ; Check for TAB character
+ retz
+ CMP AL,0ah ; Check for line feed character - BAS
+ return
+
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+
+FCB_TO_ASCZ: ; Convert DS:SI to ASCIZ ES:DI
+ MOV CX,8
+
+MAINNAME:
+ LODSB
+ CMP AL,' '
+ JZ SKIPSPC
+ STOSB
+
+SKIPSPC:
+ LOOP MAINNAME
+ LODSB
+ CMP AL,' '
+ JZ GOTNAME
+ MOV AH,AL
+ MOV AL,dot_chr
+ STOSB
+ XCHG AL,AH
+ STOSB
+ MOV CL,2
+
+EXTNAME:
+ LODSB
+ CMP AL,' '
+ JZ GOTNAME
+ STOSB
+ LOOP EXTNAME
+
+GOTNAME:
+ XOR AL,AL
+ STOSB
+ return
+
+STRCOMP:
+;
+; Compare ASCIZ DS:SI with ES:DI.
+; SI,DI destroyed.
+;
+ CMPSB
+ retnz ; Strings not equal
+ cmp byte ptr [SI-1],0 ; Hit NUL terminator?
+ retz ; Yes, strings equal
+ jmp short STRCOMP ; Equal so far, keep going
+
+
+CRPRINT:
+ PUSH AX
+ MOV AL,13
+ PUSH CX
+ PUSH DI
+ MOV DI,DX
+ MOV CX,-1
+ PUSH ES
+ PUSH DS
+ POP ES
+
+ REPNZ SCASB ; LOOK FOR TERMINATOR
+ mov byte ptr [di-1],0 ; nul terminate the string
+ POP ES
+ mov string_ptr_2,dx
+ mov dx,offset trangroup:string_buf_ptr
+ invoke std_printf
+ mov ds:byte ptr [di-1],13 ; now put the CR back
+ JC ERROR_OUTPUT
+
+ POP DI
+ POP CX
+ POP AX
+
+ return
+
+ERROR_OUTPUT:
+ PUSH CS
+ POP DS
+ASSUME DS:TRANGROUP
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+
+ MOV DX,OFFSET TRANGROUP:NOSPACE_ptr
+ CMP [PIPEFLAG],0
+ JZ GO_TO_ERROR
+
+ invoke PipeOff
+ MOV DX,OFFSET TRANGROUP:PIPEEMES_ptr
+GO_TO_ERROR:
+ JMP CERROR
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+PATHCHRCMP:
+;---- Mod for path invocation ----
+PUBLIC pathchrcmp
+;----
+
+ push ax
+ mov ah,'/'
+ CMP [SWITCHAR],ah
+ JZ NOSLASHT
+ CMP AL,'/'
+ jz pccont
+
+NOSLASHT:
+ CMP AL,'\'
+pccont:
+ pop ax
+
+ return
+
+;
+; PATHCRUNCH -
+;
+; ENTRY FCB (in PSP) contains drive # to crunch on
+; PathPos = ptr to string with pathname in it
+; PathCnt = length of string
+;
+; EXIT PathPos = ptr after pathname (w/ NULL) in string
+; PathCnt = length left in string
+; DestIsDir = nonzero if pathname delimiter char's found in pathname
+; DestInfo<bit1> = set if wildcard char's found in pathname
+; If path crunched successfully,
+; CY = clear
+; Current directory is changed to directory in pathname
+; UserDir1 contains previous directory for use by RestUDir
+; RestDir = nonzero to flag later restoration of user's dir
+; DestTail = ptr to beginning of filename
+; If filename found in pathname,
+; ZR = clear
+; FCB filename fields contain filename
+; If filename not found (pure directory path),
+; ZR = set
+; FCB filename fields are wildcarded with ?'s
+; If pathcrunch failed (no ChDir's worked),
+; CY = set
+; Msg_Numb = extended error code
+;
+; NOTE DIR asks PathCrunch to forego parsing the filename into the
+; FCB by setting DirFlag. In this case, the FCB is returned
+; with the filename wildcarded.
+;
+PATHCRUNCH:
+ mov [msg_numb],0 ;AN022; Set up message flag
+ MOV DL,DS:[FCB] ; DL = drive # (1 = A)
+ CALL SAVUDIR ; save current directory in UserDir1
+ jc pcrunch_cderrJ ;AN022; if error on current dir - report
+
+ invoke SETPATH ; scan past switches, whitespace
+
+; DX = ptr to pathname, NULL-terminated
+; PathPos = ptr to byte after NULL at end of pathname
+
+ TEST [DESTINFO],2 ; test if wildcards (? or *) seen
+ JNZ TRYPEEL ; wildcard seen, peel filename
+
+ MOV AH,CHDIR ; AH = DOS ChDir function code
+ INT 21h ; call DOS
+ jnc chdir_worked ;AN022; no error - continue
+
+ invoke get_ext_error_number ;AN022; get the extended error
+ cmp ax,error_path_not_found ;AN022; if path not found
+ jz trypeel ;AC022; keep trying
+ cmp ax,error_access_denied ;AN022; if access denied
+ jz trypeel ;AC022; keep trying
+ mov [msg_numb],ax ;AN022; set up message flag
+ jmp peelfail ;AN022; exit with other error
+
+chdir_worked:
+ invoke SETREST1 ; set 'Restore Directory' flag true
+ MOV AL,'?' ; if pure dir, wildcard filename in FCB
+ MOV DI,5DH
+ MOV CX,11
+ REP STOSB
+ XOR AL,AL ; return carry clear, zero set
+ return
+
+pcrunch_cderrj: ;AN022; need this for long jmp
+ jmp pcrunch_cderr ;AN022;
+
+TRYPEEL:
+ MOV SI,[PATHPOS]
+ DEC SI ; SI = ptr to NULL at end of pathname
+ MOV AL,[SI-1] ; AL = last char of pathname
+
+ CMP [KPARSE],0
+ JNZ DELSTRT ; Last char is second KANJI byte, might be '\'
+
+ CALL PATHCHRCMP
+ JZ PEELFAIL ; Trailing '/'
+
+DELSTRT:
+ MOV CX,SI ; CX = ptr to NULL at end of pathname
+ MOV SI,DX ; SI = ptr to start of pathname
+ PUSH DX ; save ptr to pathname
+DELLOOP:
+ CMP SI,CX
+ JZ GOTDELE ; no char's left, we have what we have
+ LODSB ; AL = next char of pathname
+ invoke TESTKANJ
+ JZ NOTKANJ8 ; not Kanji, move along
+ INC SI
+ JMP DELLOOP
+
+NOTKANJ8:
+ CALL PATHCHRCMP
+ JNZ DELLOOP ; not a path delimiter, keep looking
+ MOV DX,SI
+ DEC DX ; DX = ptr to last delimiter found
+ JMP DELLOOP ; go look for more
+
+GOTDELE:
+ MOV SI,DX ; SI = ptr to pathname or last delim
+ POP DX ; DX = ptr to pathname
+ CMP SI,DX
+ JZ BADRET ; didn't find path delim
+ MOV CX,SI ; CX = ptr to last path delimiter
+ MOV SI,DX ; SI = ptr to pathname
+
+DELLOOP2: ; Set value of KPARSE
+ CMP SI,CX
+ JZ TRYCD ; roll up till SI meets CX
+ MOV [KPARSE],0
+ LODSB
+ INVOKE TESTKANJ
+ JZ DELLOOP2
+ INC SI
+ INC [KPARSE]
+ JMP DELLOOP2
+
+TRYCD:
+ push ax
+ mov al,dot_chr ; AL = '.'
+ CMP BYTE PTR [SI+1],al ; check for '.' after path delim
+ ;M019; allow continuation if '. ' or
+ ;M019; '..' is not found.
+ jnz @F ;M019; '.' not found
+ cmp BYTE PTR [SI+2],al ;M019; check for '..'
+ jz @F ;M019; found '..'
+ cmp BYTE PTR [SI+2],0 ;M019; check for '. ' (null terminated)
+@@: pop ax
+ JZ PEELFAIL ; if . or .., pure cd should have worked
+ mov al,[si-1]
+ CMP al,':' ; Special case d:\file
+ JZ BADRET
+
+ CMP [KPARSE],0
+ JNZ NOTDOUBLESL ; Last char is second KANJI byte, might be '\'
+
+ CALL PATHCHRCMP
+ JNZ NOTDOUBLESL
+PEELFAIL:
+ STC ; //
+ return
+NOTDOUBLESL:
+ MOV BYTE PTR [SI],0
+ MOV AH,CHDIR
+ INT 21h
+ JNC CDSUCC
+pcrunch_cderr:
+ invoke get_ext_error_number ;AN022; get the extended error
+ mov [msg_numb],ax ;AN022; set up message flag
+ or si,si ;AN022; set up zero flag to not zero
+ stc ;AN022; set up carry flag
+ return
+
+BADRET:
+ MOV AL,[SI]
+ CALL PATHCHRCMP ; Special case 'DIRCHAR'file
+ STC
+ retnz
+ XOR BL,BL
+ XCHG BL,[SI+1]
+ MOV AH,CHDIR
+ INT 21h
+ jc pcrunch_cderr ;AN022; go to error exit
+ MOV [SI+1],BL
+CDSUCC:
+ invoke SETREST1
+ INC SI ; Reset zero
+ MOV [DESTTAIL],SI
+ pushf ;AN015; save flags
+ cmp dirflag,-1 ;AN015; don't do parse if in DIR
+ jz pcrunch_end ;AN015;
+ MOV DI,FCB
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR 02H ; Parse with default drive
+ INT 21h
+pcrunch_end:
+ popf ;AN015; get flags back
+ return
+
+trancode ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tfor.asm b/private/mvdm/dos/v86/cmd/command/tfor.asm
new file mode 100644
index 000000000..56c1189a0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tfor.asm
@@ -0,0 +1,565 @@
+ page ,132
+; SCCSID = @(#)tfor.asm 4.1 85/09/17
+; SCCSID = @(#)tfor.asm 4.1 85/09/17
+TITLE Part3 COMMAND Transient Routines
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; For loop processing routines
+
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include find.inc
+ include devsym.inc
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BATCH:WORD
+ EXTRN ECHOFLAG:BYTE
+ EXTRN FORFLAG:BYTE
+ EXTRN FORPTR:WORD
+ EXTRN NEST:WORD
+ EXTRN NULLFLAG:BYTE
+ EXTRN PIPEFILES:BYTE
+ EXTRN SINGLECOM:WORD
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN Extend_buf_ptr:word ;AN000;
+ extrn fornestmes_ptr:word
+ EXTRN msg_disp_class:byte ;AN000;
+ extrn string_buf_ptr:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ extrn arg:byte ; the arg structure!
+ EXTRN COMBUF:BYTE
+ EXTRN RESSEG:WORD
+ EXTRN string_ptr_2:word
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN cerror:near
+ EXTRN docom:near
+ EXTRN docom1:near
+ EXTRN forerror:near
+ EXTRN tcommand:near
+
+ PUBLIC $for
+ PUBLIC forproc
+
+
+; All batch proccessing has DS set to segment of resident portion
+ASSUME DS:RESGROUP,ES:TRANGROUP
+
+
+FORTERM:
+ push cs ;AN037; Get local segment into
+ pop ds ;AN037; DS, ES
+ push cs ;AN037;
+ pop es ;AN037;
+ call ForOff
+ mov ds,ResSeg
+ASSUME DS:RESGROUP
+ CMP [SINGLECOM],0FF00H
+ JNZ BATCRLF
+ CMP NEST,0 ;G See if we have nested batch files
+ JNZ BATCRLF ;G Yes - don't exit just yet
+ MOV [SINGLECOM],-1 ; Cause a terminate
+ JMP SHORT NOFORP2
+
+BATCRLF:
+ test [ECHOFLAG],1 ;G Is echo on?
+ JZ NOFORP2 ;G no - exit
+ TEST [BATCH], -1 ;G print CRLF if in batch
+ JZ NOFORP2 ;G
+ invoke CRLF2
+
+NOFORP2:
+ JMP TCOMMAND
+
+
+;------
+; For-loop processing. For loops are of the form:
+; for %<loop-variable> in (<list>) do <command>
+; where <command> may contain references of the form %<variable>, which are
+; later substituted with the items in <list>. The for-loop structure is
+; set-up by the procedure '$for'; successive calls to 'forproc' execute
+; <command> once for each item in <list>. All of the information needed for
+; loop processing is stored on a piece of memory gotten from 'alloc'. This
+; structure is actually fairly large, on the order of 700 bytes, and includes
+; a complete copy of the original command-line structure as parsed by
+; 'parseline', loop control variables, and a dma buffer for the
+; 'FindFirst/FindNext' expansion of wildcard filenames in <list>. When loop
+; processing has completed, this chunk of memory is returned to the system.
+;
+; All of the previously defined variables, in 'datares', used for loop
+; processing may be erased. Only one, (DW) ForPtr, need be allocated.
+;
+; The error message, 'for_alloc_mes', should be moved into the file
+; containing all of the other error messages.
+;
+; Referencing the allocated for-loop structure is a little tricky.
+; At the moment, a byte is defined as part of a new segment, 'for_segment'.
+; When 'forproc' actually runs, ES and DS are set to point to the base of the
+; new chunk of memory. References to this byte, 'f', thus assemble correctly
+; as offsets of ES or DS. 'f' would not be necessary, except that the
+; assembler translates an instruction such as 'mov AX, [for_minarg]' as an
+; immediate move of the offset of 'for_minarg' into AX. In other words, in
+; terms of PDP-11 mnemonics, the assembler ACTUALLY assembles
+; mov AX, #for_minarg ; AX := 02CA (for example)
+; instead of
+; mov AX, for_minarg ; AX := [02CA] (contents of 02CA)
+; By using 'f', we pretend that we are actually referencing an allocated
+; structure, and the assembler coughs up the code we want. Notice that it
+; doesn't matter whether we put brackets around the location or not -- the
+; assembler is "smart" enough to know that we want an address instead of the
+; contents of that location.
+;
+; Finally, there now exists the potential to easily implement nested loops.
+; One method would be to have a link field in each for-structure pointing to
+; its parent. Variable references that couldn't be resolved in the local
+; frame would cause a search of prior frames. For-structures would still be
+; allocated and released in exactly the same fashion. The only limit on the
+; number of nested loops would be memory size (although at 700 bytes a pop,
+; memory wouldn't last THAT long). Alternately, a small structure could be
+; maintained in the resident data area. This structure would be an array of
+; control-variable names and pointers to for-structure blocks. This would
+; greatly speed up the resolution of non-local variable references. However,
+; since space in the resident is precious, we would have to compromise on a
+; "reasonable" level of nesting -- 10, 16, 32 levels, whatever. For-structure
+; allocation and de-allocation would have to be modified slightly to take this
+; new structure into account.
+;
+; Oops, just one more thing. Forbuf need not be a part of the for-structure.
+; It could just as well be one structure allocated in 'transpace'. Actually,
+; it may be easier to allocate it as part of 'for_segment'.
+;------
+
+ include fordata.asm
+
+$for_exit:
+ jmp forterm ; exceeding maxarg means all done
+
+forproc:
+assume DS:resgroup
+ mov AX, [ForPtr]
+ mov DS, AX
+ mov ES, AX ; operate in for-info area
+assume DS:for_segment, ES:for_segment
+
+ mov DX, fordma
+ trap Set_Dma
+for_begin:
+ cmp f.for_expand, 0 ; non-zero for_expand equals FALSE
+ je for_begin1
+ inc f.for_minarg
+for_begin1:
+ mov BX, f.for_minarg ; current item in <list> to examine
+ cmp BX, f.for_maxarg
+ jg $for_exit ; exceeding maxarg means all done
+ mov AX, for_args.argv
+ invoke argv_calc ; compute argv[x] address
+
+ mov CX, [BX].argstartel
+ mov DX, [BX].argpointer
+ test [bx].argflags,00000100b ; Is there a path separator in this arg?
+ jnz forsub ; Yes, argstartel should be correct
+ mov si, [BX].argpointer
+ mov al,lparen
+ cmp byte ptr [si-1],al ; If the current token is the first
+ jnz forsub ; one in the list and originally had
+ inc cx ; the opening paren as its first char,
+ ; the argstartel ptr needs to be
+ ; advanced passed it before the prefix
+ ; length is computed.
+ mov al,':'
+ cmp byte ptr [si+1],al ; If the token begins with "(d:",
+ jnz forsub ; argstartel has to be moved over the
+ add cx,2 ; rest of the prefix as well.
+
+forsub:
+ sub CX, DX ; compute length of pathname prefix
+ cmp f.for_expand, 0 ; are we still expanding a name?
+ je for_find_next ; if so, get next matching filename
+
+ test [BX].argflags, MASK wildcard
+ jnz for_find_first ; should we expand THIS (new) arg?
+ mov CX, [BX].arglen ; else, just copy all of it directly
+ jmp short for_smoosh
+
+for_find_first:
+ PUSH CX
+ XOR CX,CX
+ trap Find_First ; and search for first filename match
+ POP CX
+ jmp short for_result
+for_find_next:
+ trap Find_Next ; search for next filename match
+
+for_result:
+ mov AX, -1 ; assume worst case
+ jc forCheck
+ mov ax,0
+forCheck: ; Find* returns 0 for SUCCESS
+ mov f.FOR_EXPAND, AX ; record success of findfirst/next
+ or AX, AX ; anything out there?
+ jnz for_begin ; if not, try next arg
+
+for_smoosh:
+ mov SI, [BX].argpointer ; copy argv[arg][0,CX] into destbuf
+ mov DI, forbuf ; some days this will be the entire
+ rep movsb ; arg, some days just the path prefix
+
+ cmp f.FOR_EXPAND, 0 ; if we're not expanding, we can
+ jnz for_make_com ; skip the following
+
+ mov SI, fordma.find_buf_pname
+for_more: ; tack on matching filename
+ cmp BYTE PTR [SI], 0
+ je for_make_com
+ movsb
+ jnz for_more
+
+for_make_com:
+ xor AL, AL ; tack a null byte onto the end
+ stosb ; of the substitute string
+
+ xor CX, CX ; character count for command line
+ not CX ; negate it -- take advantage of loopnz
+ xor BX, BX ; argpointer
+ mov DI, OFFSET TRANGROUP:COMBUF+2
+ mov bl, f.FOR_COM_START ; argindex
+ mov DH, f.FOR_VAR ; %<for-var> is replaced by [forbuf]
+ ; time to form the <command> string
+ push CS
+ pop ES
+assume ES:trangroup
+
+ mov AX, for_args ; translate offset to pointer
+ invoke argv_calc
+ mov si,[bx].arg_ocomptr
+ inc si ; mov ptr passed beginning space
+
+for_make_loop:
+ mov al,[si] ; the <command> arg, byte by byte
+ inc si
+ cmp AL,'%' ; looking for %<control-variable>
+ jne for_stosb ; no % ... add byte to string
+ cmp BYTE PTR [SI], DH ; got the right <variable>?
+ jne for_stosb ; got a %, but wrong <variable>
+ inc SI ; skip over <for-variable>
+
+ push SI
+ mov SI, forbuf ; substitute the <item> for <variable>
+ ; to make a final <command> to execute
+sloop:
+ lodsb ; grab all those <item> bytes, and
+ stosb ; add 'em to the <command> string,
+ or AL, AL ; until we run into a null
+ loopnz sloop
+ dec DI ; adjust length and <command> pointer
+ inc CX ; so we can overwrite the null
+
+ pop SI
+ jmp for_make_loop ; got back for more <command> bytes
+for_stosb:
+ stosb ; take a byte from the <command> arg
+ dec CX ; and put it into the <command> to be
+ ; executed (and note length, too)
+ cmp al,0dh ; If not done, loop.
+ jne for_make_loop
+
+for_made_com: ; finished all the <command> args
+ not CL ; compute and record command length
+ mov [COMBUF+1], CL
+
+ mov DS, [RESSEG]
+assume DS:resgroup
+
+ test [ECHOFLAG],1 ; shall we echo this <command>, dearie?
+ jz noecho3
+ cmp nullflag,nullcommand ;G was there a command last time?
+ jz No_crlf_pr ;G no - don't print crlf
+ invoke CRLF2 ;G Print out prompt
+
+no_crlf_pr:
+ mov nullflag,0 ;G reset no command flag
+ push CS
+ pop DS
+ assume DS:trangroup
+ push di
+ invoke PRINT_PROMPT ;G Prompt the user
+ pop di
+ mov BYTE PTR ES:[DI-1],0 ; yeah, PRINT it out...
+ mov string_ptr_2,OFFSET TRANGROUP:COMBUF+2
+ mov dx,offset trangroup:string_buf_ptr
+ invoke std_printf
+ mov BYTE PTR ES:[DI-1], 0DH
+ jmp DoCom
+noecho3: ; run silent, run deep...
+ assume DS:resgroup
+ mov nullflag,0 ;G reset no command flag
+ push CS
+ pop DS
+ assume DS:trangroup
+ jmp docom1
+
+
+fornesterrj: ; no multi-loop processing... yet!
+assume ES:resgroup
+ call ForOff
+ jmp fornesterr
+
+forerrorj:
+ jmp forerror
+
+ break $For
+assume ds:trangroup,es:trangroup
+
+$for:
+ mov ES, [RESSEG]
+assume ES:resgroup
+
+ cmp ForFlag,0 ; is another one already running?
+ jnz fornesterrj ; if flag is set.... boom!
+
+;
+; Turn off any pipes in progress.
+;
+ cmp [PIPEFILES],0 ; Only turn off if present.
+ jz NoPipe
+ invoke PipeDel
+NoPipe:
+ xor DX, DX ; counter (0 <= DX < argvcnt)
+ call nextarg ; move to next argv[n]
+ jc forerrorj ; no more args -- bad forloop
+ cmp AL,'%' ; next arg MUST start with '%'...
+ jne forerrorj
+ mov BP, AX ; save forloop variable
+ lodsb
+ or AL, AL ; and MUST end immediately...
+ jne forerrorj
+
+ call nextarg ; let's make sure the next arg is 'in'
+ jc forerrorj
+ and AX, NOT 2020H ; uppercase the letters
+ cmp AX, in_word
+ jne forerrorj
+ lodsb
+ or AL, AL ; it, too, must end right away
+
+; Compaq bug fix -- exit from this loop on error
+
+ jne forerrorj ; jump on error
+
+;; je CheckLParen
+;
+; Not null. Perhaps there are no spaces between this and the (:
+; FOR %i in(foo bar...
+; Check for the Lparen here
+;
+;; CMP AL,lparen
+;; JNZ forerrorj
+;
+; The token was in(... We strip off the "in" part to simulate a separator
+; being there in the first place.
+;
+;; ADD [BX].argpointer,2 ; advance source pointer
+;; ADD [BX].arg_ocomptr,2 ; advance original string
+;; SUB [BX].arglen,2 ; decrement the appropriate length
+;
+; SI now points past the in(. Simulate a nextarg call that results in the
+; current value.
+;
+;; MOV ax,[si-1] ; get lparen and next char
+;; jmp short lpcheck
+;
+;; end of Compaq bug fix
+
+CheckLParen:
+ call nextarg ; lparen delimits beginning of <list>
+ jc forerrorj
+lpcheck:
+ cmp al, lparen
+ jne forerrorj
+ cmp ah,0
+ je for_paren_token
+
+ cmp ah, rparen ; special case: null list
+ jne for_list_not_empty
+ jmp forterm
+
+for_list_not_empty:
+ inc [bx].argpointer ; Advance ptr past "("
+ ; Adjust the rest of this argv entry
+ dec [bx].arglen ; to agree.
+ inc si ; Inc si so check for ")" works
+ jmp short for_list
+
+for_paren_token:
+ call nextarg ; what have we in our <list>?
+ jc forerrorj
+ cmp ax, nullrparen ; special case: null list
+ jne for_list
+ jmp forterm
+
+forerrorjj:
+ jmp forerror
+
+for_list: ; skip over rest of <list>
+ mov CX, DX ; first arg of <list>
+skip_list:
+ add si,[bx].arglen
+ sub si,3 ; si = ptr to last char of token
+ mov al,rparen
+ cmp byte ptr [si],al ; Is this the last element in <list>
+ je for_end_list ; Yes, exit loop.
+ call nextarg ; No, get next arg <list>
+ jc forerrorjj ; If no more and no rparen, error.
+ jmp skip_list
+for_end_list:
+ mov DI, DX ; record position of last arg in <list>
+ mov byte ptr [si],0 ; Zap the rparen
+ cmp ax,nullrparen ; Was this token only a rparen
+ jz for_do ; Yes, continue
+ inc di ; No, inc position of last arg
+
+for_do:
+ call nextarg ; now we had BETTER find a 'do'...
+ jc forerrorjj
+ and AX, NOT 2020H ; uppercase the letters
+ cmp AX, do_word
+ jne forerrorjj
+ lodsb
+ or AL, AL ; and it had BETTER be ONLY a 'do'...
+ jne forerrorjj
+
+ call nextarg ; on to the beginning of <command>
+ jc forerrorjj ; null <command> not legal
+
+ push AX
+ push BX
+ push CX
+ push DX ; preserve registers against disaster
+ push DI
+ push SI
+ push BP
+ invoke FREE_TPA ; need to make free memory, first
+ASSUME ES:RESGROUP
+ call ForOff
+ mov BX, SIZE for_info - SIZE arg_unit
+ invoke Save_Args ; extra bytes needed for for-info
+ pushf
+ mov [ForPtr], AX
+ invoke ALLOC_TPA ; ALLOC_TPA clobbers registers...
+ popf
+ pop BP
+ pop SI
+ pop DI
+ pop DX
+ pop CX
+ pop BX
+ pop AX
+ jc for_alloc_err
+
+ push ES ; save resgroup seg...
+ push [ForPtr]
+ pop ES
+assume ES:for_segment ; make references to for-info segment
+
+ dec CX ; forproc wants min pointing before
+ dec DI ; first arg, max right at last one
+ mov f.for_minarg, CX
+ mov f.for_maxarg, DI
+ mov f.for_com_start, DL
+ mov f.for_expand, -1 ; non-zero means FALSE
+ mov AX, BP
+ mov f.for_var, AH
+ pop ES
+assume ES:resgroup
+
+ inc [FORFLAG]
+ cmp [SINGLECOM], -1
+ jnz for_ret
+ mov [SINGLECOM], 0FF00H
+for_ret:
+ ret
+
+for_alloc_err:
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,error_not_enough_memory ;AN000; get message number in control block
+ jmp cerror
+
+nextarg:
+ inc DX ; next argv[n]
+ cmp DX, arg.argvcnt ; make sure we don't run off end
+ jge nextarg_err ; of argv[]...
+ mov BX, DX
+ mov AX, OFFSET TRANGROUP:arg.argv
+ invoke argv_calc ; convert array index to pointer
+ mov SI, [BX].argpointer ; load pointer to argstring
+ lodsw ; and load first two chars
+ clc
+ ret
+nextarg_err:
+ stc
+ ret
+
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+FORNESTERR:
+ PUSH DS
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV DX,OFFSET TRANGROUP:FORNESTMES_ptr
+ CMP [SINGLECOM],0FF00H
+ JNZ NOFORP3
+ MOV [SINGLECOM],-1 ; Cause termination
+NOFORP3:
+ POP DS
+ASSUME DS:TRANGROUP
+ JMP CERROR
+;
+; General routine called to free the for segment. We also clear the forflag
+; too. Change no registers.
+;
+PUBLIC ForOff
+ForOff:
+ assume DS:NOTHING,ES:NOTHING
+ SaveReg <AX,ES>
+ mov es,ResSeg
+ assume es:ResGroup
+ mov AX,ForPtr
+ or ax,ax
+ jz FreeDone
+ push es
+ mov es,ax
+ mov ah,dealloc
+ int 21h
+ pop es
+FreeDone:
+ mov ForPtr,0
+ mov ForFlag,0
+ RestoreReg <ES,AX>
+ return
+
+trancode ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tmisc1.asm b/private/mvdm/dos/v86/cmd/command/tmisc1.asm
new file mode 100644
index 000000000..5fbf0f012
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tmisc1.asm
@@ -0,0 +1,877 @@
+ page ,132
+; SCCSID = @(#)tmisc1.asm 4.1 85/09/22
+; SCCSID = @(#)tmisc1.asm 4.1 85/09/22
+TITLE Part7 COMMAND Transient Routines
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+; M003 SR 07/16/90 Made Execute public to jump to it for
+; LoadHigh support
+;
+; M025 SR 9/12/90 Removed calls to SetStdInOn,SetStdInOff
+; SetStdOutOn & SetStdOutOff.
+;
+
+
+; More misc routines
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+
+CODERES SEGMENT PUBLIC BYTE ;AC000;
+;; EXTRN RSTACK:BYTE
+CodeRes ENDS
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN CALL_FLAG:BYTE
+ EXTRN EchoFlag:BYTE
+ EXTRN EXEC_BLOCK:BYTE
+ EXTRN EXTCOM:BYTE
+ EXTRN LenMsgOrPathBuf:ABS
+ EXTRN PIPEFLAG:BYTE
+ EXTRN PIPEPTR:WORD
+ EXTRN PIPESTR:BYTE
+ EXTRN RESTDIR:BYTE
+ EXTRN RE_OUT_APP:BYTE
+ EXTRN RE_OUTSTR:BYTE
+ EXTRN SAFEPATHBUFFER:BYTE
+
+ extrn RStack:word
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+ EXTRN Beta3Warned:byte
+ EXTRN TrnSeg:word
+endif
+
+
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BADDRV_PTR:WORD
+ EXTRN BADNAM_PTR:WORD
+ EXTRN COMTAB:BYTE ;AC000;
+ EXTRN extend_buf_ptr:word ;AN000;
+ EXTRN msg_disp_class:byte ;AN000;
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+ EXTRN Beta3WarnMsg:byte
+endif
+
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg:byte ; the arg structure!
+ EXTRN ALLSWITCH:WORD
+ EXTRN APPEND_EXEC:BYTE ;AN041;
+ EXTRN CHKDRV:BYTE
+ EXTRN COMBUF:BYTE
+ EXTRN COMSW:WORD
+ EXTRN EXECPATH:BYTE
+ EXTRN EXEC_ADDR:DWORD
+ EXTRN FILTYP:BYTE
+ EXTRN IDLEN:BYTE
+ EXTRN KPARSE:BYTE ;AC000;
+ EXTRN PARM1:BYTE
+ EXTRN PARM2:BYTE
+ EXTRN PathPos:word
+ EXTRN RESSEG:WORD
+ EXTRN RE_INSTR:BYTE
+ EXTRN SPECDRV:BYTE
+ EXTRN SWITCHAR:BYTE
+ EXTRN switch_list:byte
+ EXTRN TRAN_TPA:WORD
+
+ EXTRN EXECPATH_SIZE:WORD
+ EXTRN EXECEXT_TYPE:WORD
+ IF IBM
+ EXTRN ROM_CALL:BYTE
+ EXTRN ROM_CS:WORD
+ EXTRN ROM_IP:WORD
+ ENDIF
+
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC byte
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN APPEND_PARSE:NEAR ;AN010;
+ EXTRN BATCOM:NEAR
+ EXTRN DOCOM1:NEAR
+ EXTRN PIPEERRSYN:NEAR
+ EXTRN TCOMMAND:NEAR
+
+ IF IBM
+ EXTRN ROM_EXEC:NEAR
+ EXTRN ROM_SCAN:NEAR
+ ENDIF
+
+ PUBLIC CERROR
+ PUBLIC DRVBAD
+ PUBLIC EXTERNAL
+ PUBLIC FNDCOM
+ PUBLIC PRESCAN
+ PUBLIC SWITCH
+
+ public Lh_Execute ; M051
+
+
+ASSUME DS:TRANGROUP
+
+;---------------------------
+; We can get rid of this switch processing code if we can take
+; care of the remaining two calls to switch, later in the file.
+; However, I have not checked whether or not any other files use
+; switch -- after all, it IS public!
+;---------------------------
+
+SWCOUNT EQU 6 ; Length of switch_list
+
+RETSW:
+ XCHG AX,BX ; Put switches in AX
+ return
+
+SWITCH:
+ XOR BX,BX ; Initialize - no switches set
+SWLOOP:
+ INVOKE SCANOFF ; Skip any delimiters
+ CMP AL,[SWITCHAR] ; Is it a switch specifier?
+ JNZ RETSW ; No -- we're finished
+ OR BX,fSwitch ; Indicate there is a switch specified
+ INC SI ; Skip over the switch character
+ INVOKE SCANOFF
+ CMP AL,0DH
+ JZ RETSW ; Oops
+ INC SI
+; Convert lower case input to upper case
+ INVOKE UPCONV
+ MOV DI,OFFSET TRANGROUP:switch_list
+ MOV CX,SWCOUNT
+ REPNE SCASB ; Look for matching switch
+ JNZ BADSW
+ MOV AX,1
+ SHL AX,CL ; Set a bit for the switch
+ OR BX,AX
+ JMP SHORT SWLOOP
+
+BADSW:
+ JMP SHORT SWLOOP
+
+DRVBAD:
+ MOV DX,OFFSET TRANGROUP:BADDRV_ptr
+ JMP CERROR
+
+externalj:
+ jmp EXTERNAL
+
+fndcom: ; search the internal command table
+ OR AL,AL ; Get real length of first arg
+ jz externalj ; If 0, it must begin with "\" so has
+ ; to be external.
+; barryf code starts here
+
+ IF IBM
+ call test_append ; see if APPEND installed
+ je contcom ; not loaded
+
+append_internal:
+ mov cl,TRANGROUP:IDLEN
+ mov ch,0
+ mov pathpos,cx
+ inc append_exec ;AN041; set APPEND to ON
+
+ invoke ioset ; re-direct the o'l io
+
+ mov SI, offset TRANGROUP:IDLEN ; address command name, DS already set
+ mov DX,-1 ; set invoke function
+ mov di,offset TRANGROUP:APPEND_PARSE;AN010; Get the entry point for PARSE for APPEND
+ mov AX,0AE01H
+ int 2FH ; execute command
+ cmp TRANGROUP:IDLEN,0 ; execute requested
+;; je Cmd_done
+ jne contcom
+ jmp Cmd_done
+
+contcom: ; continue with internal scan
+ ENDIF
+
+; barryf code ends here
+
+ mov DI, OFFSET TRANGROUP:COMTAB
+ XOR CX,CX
+
+findcom:
+ mov SI, offset TRANGROUP:IDLEN+1 ; pointer to command argument
+ mov CL, [DI] ; load length of internal command
+ inc di ; advance past length
+ jcxz externalj ; if it's zero, we're out of internals
+ cmp CL, IDLEN ; that of the command argument
+ jnz abcd ; lengths not equal ==> strings not eq
+ MOV PathPos,CX ; store length of command
+ repz cmpsb
+
+abcd:
+ lahf ; save the good ol' flags
+ add DI, CX ; skip over remaining internal, if any
+ mov AL, BYTE PTR [DI] ; load drive-check indicator byte (DCIB)
+ mov [CHKDRV], AL ; save command flag byte in chkdrv
+ inc DI ; increment DI (OK, OK, I'll stop)
+ mov BX, WORD PTR [DI] ; load internal command address
+ inc DI ; skip over the puppy
+ inc DI
+ mov DX, WORD PTR [DI] ; load ptr to help msg #s
+ inc DI
+ inc DI
+ sahf ; remember those flags?
+ jnz findcom ; well, if all the cmps worked...
+;
+; All messages get redirected.
+;
+ cmp append_exec,0 ;AN041; APPEND just executed?
+ jnz dont_set_io ;AN041; Yes - this junk is already set
+ invoke ioset ; re-direct the ol' i/o
+
+dont_set_io: ;AN041;
+;
+; Check for /?. Certain commands, flagged fLimitHelp,
+; respond to /? only if it is the only command-line argument.
+;
+ mov ax,[COMSW] ; AX = switches after command
+ or ax,[ALLSWITCH] ; AX = all switches
+ and ax,SwitchQues
+ jz drive_check ; /? not in command line
+
+ test [CHKDRV],fLimitHelp
+ jz do_help ; /? allowed in combination
+;
+; Make sure /? is the only argument on the command line.
+;
+ cmp [arg.argvcnt],2
+ jne drive_check ; /? not only arg - ignore
+;
+; Note: this is all the check we need, even against things like /??.
+; Our argv parser breaks /?? into two args, /? and ?.
+;
+
+do_help:
+
+; DX = ptr to word list of msg #s, terminated by zero word
+
+ mov si,dx ; SI = ptr to list of msg #s
+ mov ax,NO_SUBST ; AL = no subst's code
+ push ax ; build subst block on stack
+
+next_help_msg:
+ lodsw ; AX = help msg # or zero
+ or ax,ax
+ jz help_done
+ push ax ; SS:SP = ptr to subst block
+ ; (msg # and no_subst byte)
+; We assume DS = SS.
+
+ mov dx,sp ; DS:DX = ptr to subst block
+ invoke Std_PrintF ; display help message
+ pop ax ; remove msg # from stack
+ jmp next_help_msg
+
+help_done:
+ pop ax ; clean up stack
+ jmp TCommand
+
+drive_check:
+ test [CHKDRV], fCheckDrive ; did we wanna check those drives?
+ jz nocheck
+ mov AL, [PARM1] ; parse_file_descriptor results tell
+ or AL, [PARM2] ; us whether those drives were OK
+ cmp AL, -1
+ jnz nocheck
+ jmp drvbad
+
+
+;
+; The user may have omitted the space between the command and its arguments.
+; We need to copy the remainder of the user's command line into the buffer.
+; Note that thisdoes not screw up the arg structure; it points into COMBUF not
+; into the command line at 80.
+;
+nocheck:
+ call cmd_copy
+
+switcheck:
+ test [CHKDRV], fSwitchAllowed ; Does the command take switches
+ jnz realwork ; Yes, process the command
+ call noswit ; No, check to see if any switches
+ jnz realwork ; None, process the command
+ mov msg_disp_class,parse_msg_class ;AN000; set up parse error msg class
+ MOV DX,OFFSET TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,BadSwt_ptr ;AN000; get "Invalid switch" message number
+ jmp CERROR ; Print error and chill out...
+realwork:
+ call BX ; do some real work, at last
+
+; See if we're in a batch CALL command. If we are, reprocess the command line,
+; otherwise, go get another command.
+
+Cmd_done:
+ push cs ; g restore data segment
+ pop ds ; g
+ push ds ; g save data segment
+ mov ds,[resseg] ; g get segment containing call flag
+ ASSUME ds:resgroup
+ cmp call_flag, call_in_progress ; G Is a call in progress?
+ mov call_flag, 0 ; G Either way, reset flag
+ pop ds ; g get data segment back
+ jz incall ; G
+ jmp tcommand ; chill out...
+
+incall:
+ JMP DOCOM1
+
+noswit:
+ push di ; Save di
+ mov di,81h ; di = ptr to command args
+ mov si,80h ; Get address of length of command args
+ lodsb ; Load length
+ mov cl,al ; Move length to cl
+ xor ch,ch ; Zero ch
+ mov al,[SWITCHAR] ; al = switch character
+ cmp al,0 ; Turn off ZF
+ repnz scasb ; Scan for a switch character and return
+ pop di ; with ZF set if one was found
+ ret
+
+EXTERNAL:
+
+IF IBM
+ call test_append ; check to see if append installed
+ je not_barryf ; no - truly external command
+ jmp append_internal ; yes - go to Barryf code
+
+not_barryf:
+
+ENDIF
+
+ MOV [FILTYP],0
+ MOV DL,[SPECDRV]
+ MOV [IDLEN],DL
+IF IBM
+ MOV [ROM_CALL],0
+ PUSH DX
+ MOV DX,OFFSET TRANGROUP:IDLEN
+ CALL ROM_SCAN
+ POP DX
+ JNC DO_SCAN
+ INC [ROM_CALL]
+ JMP short PostSave
+DO_SCAN:
+ENDIF
+IF IBM
+PostSave:
+ENDIF
+
+ ;
+ ; when ntvdm execs via GetNextVdmCommand, execpath is already
+ ; fully qualified application name. We know this because the
+ ; vdminfo is filled
+ ;
+ ; Note that EXECPATH_SIZE is used only once(the one we got it from
+ ; CMDGETNEXTCMD bop). And that is why we reset it everytime after
+ ; we have accessed it. For other executables, we do the regular
+ ; search(processing a batch file, for example).
+ ;
+ ; Two pieces of information we got from 32bits:
+ ; (1). the application full path name(in EXECPATH)
+ ; (2). the application file extention type(in EXECEXT_TYPE)
+ ; EXECEXT_TYPE 2 -> .BAT
+ ; 4 -> .EXE
+ ; 8 -> .COM
+ ; >8 -> unknown
+ ; for unknown extention type, we simply launch it because
+ ; (1). DOS doesn't impose any extention on program file.
+ ; (2). If we ever get here, we are sure that the program file
+ ; is a valid DOS executable(otherwise, CreateProcess would
+ ; have failed and we won't have any file to execute).
+ ;
+ ;
+
+ xor ax, ax
+ xchg ax, [EXECPATH_SIZE] ;get and set
+ or ax, ax ;do we have appname already?
+ mov ax, [EXECEXT_TYPE] ;
+ jnz execute_with_type ;yes, No search
+
+ MOV DI,OFFSET TRANGROUP:EXECPATH
+ MOV BYTE PTR [DI],0 ; Initialize to current directory
+IF IBM
+ CMP [ROM_CALL],0
+ JNZ NeoExecute
+ENDIF
+ invoke path_search ; find the mother (result in execpath)
+
+execute_with_type:
+ or AX, AX ; did we find anything?
+ je badcomj45 ; null means no (sob)
+ cmp AX, 04H ; 04H and 08H are .exe and .com
+ ; sixteen-bit machine ought
+ jnl execute ; to be able to handle a SIXTEEN-BIT
+ ; DISPLACEMENT!!
+ jmp batcom ; 02H is .bat
+BADCOMJ45:
+ifdef BETA3WARN
+ JMP BADCOM
+else
+ JMP short BADCOM
+endif
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+EXECUTE:
+NeoExecute:
+ invoke IOSET
+;M051
+; Previously LoadHigh was jumping to the execute label above. This was wrong
+;because IOSET was getting invoked twice resulting in 2 sets of redirections.
+;After a close, this would still leave one open active resulting in sharing
+;errors on subsequent opens of the redirected file.
+;
+Lh_Execute: ;M051
+
+ MOV ES,[TRAN_TPA]
+ MOV AH,DEALLOC
+ INT 21h ; Now running in "free" space
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+ INC [EXTCOM] ; Indicate external command
+ MOV [RESTDIR],0 ; Since USERDIR1 is in transient, insure
+ ; this flag value for re-entry to COMMAND
+ MOV SI,OFFSET TRANGROUP:EXECPATH
+ MOV DI,OFFSET RESGROUP:SAFEPATHBUFFER
+ MOV CX,LenMsgOrPathBuf
+ CLD
+LE_copy_loop:
+ lodsb
+ stosb
+ cmp al, 0
+ je LE_copy_done
+ loop LE_copy_loop
+;; the program name is too long, terminate it with
+;; null character. The Exec call will fail and we will print out error message
+;; see command1.asm
+ mov byte ptr es:[di - 1], 0
+LE_copy_done:
+
+ MOV DI,FCB
+ MOV SI,DI
+ MOV CX,052H ; moving (100h-5Ch)/2 = 80h-2Eh
+ REP MOVSW ; Transfer parameters to resident header
+ MOV DX,OFFSET RESGROUP:SAFEPATHBUFFER
+ PUSH ES
+ POP DS
+ ASSUME DS:RESGROUP
+ MOV BX,OFFSET RESGROUP:EXEC_BLOCK
+ MOV AX,EXEC SHL 8
+IF IBM
+ TEST [ROM_CALL],-1
+ JZ OK_EXEC
+ JMP ROM_EXEC
+OK_EXEC:
+ENDIF
+;
+; we are now running in free space. anything we do from here on may get
+; trashed. Move the stack (also in free space) to allocated space because
+; since EXEC restores the stack, somebody may trash what is on the stack.
+;
+ MOV CX,ES
+ MOV SS,CX
+ MOV SP,OFFSET DATARES:RStack
+
+ifdef BETA3WARN
+ %out Take this out before we ship
+
+ cmp Beta3Warned, 0
+ jne NoWarning
+ mov Beta3Warned, 0ffh
+ push ax
+ push cx
+ push dx
+ push ds
+
+ mov ah, 2ah ; get date
+ int 21h
+ cmp cx, 1991
+ jb nwx
+ ja bwarn
+
+ cmp dh, 4
+ jb nwx
+bwarn:
+ mov ds, trnseg
+ assume ds:trangroup
+ mov dx, offset trangroup:Beta3WarnMsg
+ mov ah, 9
+ int 21h
+
+; wait till a key is hit
+
+@@:
+ mov ah, 6 ; console I/O
+ mov dl, 0ffh ; Read
+ int 21h
+ jz @b
+nwx:
+ pop ds
+ assume ds:resgroup
+ pop dx
+ pop cx
+ pop ax
+NoWarning:
+endif
+ JMP [EXEC_ADDR] ; Jmp to the EXEC in the resident
+
+ ASSUME DS:TRANGROUP
+BADCOM:
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET TRANGROUP:BADNAM_ptr
+
+CERROR:
+ INVOKE std_eprintf
+ JMP TCOMMAND
+
+;
+; Prescan converts the input buffer into a canonicalized form. All
+; redirections and pipes are removed.
+;
+PRESCAN: ; Cook the input buffer
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+ XOR CX,CX
+ MOV ES,[RESSEG]
+ASSUME ES:RESGROUP
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ MOV DI,SI
+
+CountQuotes:
+ LODSB ; get a byte
+ CMP AL,22h ; is it a quote?
+ JNZ CountEnd ; no, try for end of road
+ INC CH ; bump count
+ JMP CountQuotes ; go get next char
+
+CountEnd:
+ CMP AL,13 ; end of road?
+ JNZ CountQuotes ; no, go back for next char
+
+;;;; IFDEF DBCS 3/3/KK
+ PUSH CX ; save count
+ MOV SI,DI ; get back beginning of buffer
+
+KanjiScan:
+ LODSB ; get a byte
+ INVOKE TestKanj ; is it a leadin byte
+ JZ KanjiQuote ; no, check for quotes
+ MOV AH,AL ; save leadin
+ LODSB ; get trailing byte
+ CMP AX,DB_SPACE ; is it Kanji space
+ JNZ KanjiScan ; no, go get next
+ MOV [SI-2],2020h ; replace with spaces
+ JMP KanjiScan ; go get next char
+
+KanjiQuote:
+ CMP AL,22h ; beginning of quoted string
+ JNZ KanjiEnd ; no, check for end
+ DEC CH ; drop count
+ JZ KanjiScan ; if count is zero, no quoting
+
+KanjiQuoteLoop:
+ LODSB ; get next byte
+ CMP AL,22h ; is it another quote
+ JNZ KanjiQuoteLoop ; no, get another
+ DEC CH ; yes, drop count
+ JMP KanjiScan ; go get next char
+
+KanjiEnd:
+ CMP AL,13 ; end of line character?
+ JNZ KanjiScan ; go back to beginning
+ POP CX ; get back original count
+;;;; ENDIF 3/3/KK
+
+ MOV SI,DI ; restore pointer to begining
+
+PRESCANLP:
+ LODSB
+
+;;;; IFDEF DBCS 3/3/KK
+ INVOKE TESTKANJ
+ JZ NOTKANJ6
+ MOV [DI],AL
+ INC DI ; fake STOSB into DS
+ LODSB ; grab second byte
+ MOV [DI],AL ; fake stosb into DS
+ INC DI
+ INC CL
+ INC CL
+ JMP PRESCANLP
+
+NOTKANJ6:
+;;;; ENDIF 3/3/KK
+
+ CMP AL,'"' ; " character
+ JNZ TRYGREATER
+ DEC CH
+ JZ TRYGREATER
+
+QLOOP:
+ MOV [DI],AL
+ INC DI
+ INC CL
+ LODSB
+ CMP AL,'"' ; " character
+ JNZ QLOOP
+ DEC CH
+
+TRYGREATER:
+ CMP AL,rabracket
+ JNZ NOOUT
+;
+; We have found a ">" char. We need to see if there is another ">"
+; following it.
+;
+ CMP BYTE PTR [SI],al
+ JNZ NOAPPND
+ LODSB
+ INC [RE_OUT_APP] ; Flag >>
+
+NOAPPND:
+;
+; Now we attempt to find the file name. First, scan off all whitespace
+;
+ INVOKE SCANOFF
+ CMP AL,labracket ;AN040; was there no filename?
+ JZ REOUT_ERRSET ;AN040; yes - set up error
+ CMP AL,0DH
+ JNZ GOTREOFIL
+;
+; There was no file present. Set us up at end-of-line.
+;
+REOUT_ERRSET: ;AN040; set up for an error
+ mov byte ptr [di], 0dh ; Clobber first ">"
+ MOV WORD PTR [RE_OUTSTR],09H ; Cause an error later
+ JMP PRESCANEND
+
+GOTREOFIL:
+ PUSH DI
+ MOV DI,OFFSET RESGROUP:RE_OUTSTR
+ MOV BX,DI
+ PUSH ES
+
+SETREOUTSTR: ; Get the output redirection name
+
+ ; MSKK06 07/14/89
+ push cx ; save cx
+ mov cx,64+13 ; CX = max string length
+
+SETREOUTSTR_LOOP:
+
+ LODSB
+ CMP AL,0DH
+ JZ GOTRESTR_J
+ INVOKE DELIM
+ JZ GOTRESTR_J
+ CMP AL,[SWITCHAR]
+ JZ GOTRESTR_J
+ CMP AL,'"' ;AN033; Is the character a quote?
+ JZ PIPEERRSYNJ5_J ;AN033; Yes - get out quick - or system crashes
+ CMP AL,labracket ;AN002; Is char for input redirection
+ JZ ABRACKET_TERM ;AN002; yes - end of string
+ CMP AL,rabracket ;AN002; Is char for output redirection
+ JNZ NO_ABRACKET ;AN002; no - not end of string
+
+ABRACKET_TERM: ;AN002; have end of string by < or >
+ DEC SI ;AN002; back up over symbol
+ MOV AL,BLANK ;AN002; show delimiter as char
+GOTRESTR_J:
+ pop cx ; MSKK06 07/14/89
+ JMP SHORT GOTRESTR ;AN002; go process it
+
+NO_ABRACKET: ;AN002; NOT AT END OF STRING
+ STOSB ; store it into resgroup
+
+ifdef DBCS
+ invoke testkanj
+ jz @f ; if not lead byte of DBCS
+ jcxz gotrestr_j ; if no tail byte
+ lodsb
+ cmp al,0dh
+ jz gotrestr_j ; if tail byte does't come and ends
+ stosb ; copy tail byte
+ dec cx
+@@:
+endif
+
+ LOOP SETREOUTSTR_LOOP ; MSKK06 07/14/89
+ jmp GOTRESTR_j
+
+PIPEERRSYNJ5_J:
+ pop cx ; recover CX
+ jmp short PIPEERRSYNJ5
+
+NOOUT:
+ CMP AL,labracket
+ JNZ CHKPIPE
+ mov bx,si ; Save loc of "<"
+ INVOKE SCANOFF
+ CMP AL,rabracket ;AN040; was there no filename?
+ JZ REIN_ERRSET ;AN040; yes - set up error
+ CMP AL,0DH
+ JNZ GOTREIFIL
+
+REIN_ERRSET: ;AN040; set up for error
+ mov byte ptr [di],0dh ; Clobber "<"
+ MOV WORD PTR [RE_INSTR],09H ; Cause an error later
+ JMP SHORT PRESCANEND
+
+GOTREIFIL:
+ PUSH DI
+ MOV DI,OFFSET TranGROUP:RE_INSTR
+ MOV BX,DI
+ PUSH ES
+ PUSH CS
+ POP ES ; store in TRANGROUP
+ JMP SHORT SETREOUTSTR ; Get the input redirection name
+
+CHKPIPE:
+ MOV AH,AL
+ CMP AH,AltPipeChr
+ JZ IsPipe3
+ CMP AH,vbar
+ JNZ CONTPRESCAN
+
+IsPipe3:
+;
+; Only push the echo flag if we are entering the pipe for the first time.
+;
+ CMP PipeFlag,0
+ JNZ NoEchoPush
+ SHL EchoFlag,1 ; push echo state and turn it off
+NoEchoPush:
+ INC [PIPEFLAG]
+ INVOKE SCANOFF
+ CMP AL,0DH
+ JZ PIPEERRSYNJ5
+ CMP AL,AltPipeChr
+ JZ PIPEERRSYNJ5
+ CMP AL,vbar ; Double '|'?
+ JNZ CONTPRESCAN
+
+PIPEERRSYNJ5:
+ PUSH ES
+ POP DS ; DS->RESGROUP
+ JMP PIPEERRSYN
+
+;
+; Trailing :s are allowed on devices. Check to be sure that there is more
+; than just a : in the redir string.
+;
+GOTRESTR:
+ XCHG AH,AL
+ mov al,':'
+ SUB BX,DI ; compute negatinve of number of chars
+ CMP BX,-1 ; is there just a :?
+ JZ NotTrailCol ; yep, don't change
+ CMP BYTE PTR ES:[DI-1],al ; Trailing ':' OK on devices
+ JNZ NOTTRAILCOL
+ DEC DI ; Back up over trailing ':'
+
+NOTTRAILCOL:
+ XOR AL,AL
+ STOSB ; NUL terminate the string
+ POP ES
+ POP DI ; Remember the start
+
+CONTPRESCAN:
+ MOV [DI],AH ; "delete" the redirection string
+ INC DI
+ CMP AH,0DH
+ JZ PRESCANEND
+ INC CL
+ JMP PRESCANLP
+
+PRESCANEND:
+ CMP [PIPEFLAG],0
+ JZ ISNOPIPE
+ MOV DI,OFFSET RESGROUP:PIPESTR
+ MOV [PIPEPTR],DI
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ INVOKE SCANOFF
+
+PIPESETLP: ; Transfer the pipe into the resident
+ LODSB ; pipe buffer
+ STOSB
+ CMP AL,0DH
+ JNZ PIPESETLP
+
+ISNOPIPE:
+ MOV [COMBUF+1],CL
+ CMP [PIPEFLAG],0
+ PUSH CS
+ POP ES
+ return
+
+cmd_copy proc near
+
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ INVOKE Scanoff ; advance past separators...
+ add si,PathPos
+ mov di,81h
+ xor cx,cx
+
+CmdCopy:
+ lodsb
+ stosb
+ cmp al,0dh
+ jz CopyDone
+ inc cx
+ jmp CmdCopy
+
+CopyDone:
+ mov byte ptr ds:[80h],cl ; Store count
+
+ ret
+cmd_copy endp
+
+
+test_append proc near
+
+ mov BX,offset TRANGROUP:COMBUF ; barry can address
+ mov SI, offset TRANGROUP:IDLEN ; address command name, DS already set
+ mov DX,-1 ; set install check function
+ mov AX,0AE00H
+ int 2FH ; see if loaded
+ cmp AL,00H
+
+ ret
+
+test_append endp
+
+TRANCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/command/tmisc2.asm b/private/mvdm/dos/v86/cmd/command/tmisc2.asm
new file mode 100644
index 000000000..6876ab879
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tmisc2.asm
@@ -0,0 +1,511 @@
+ page ,132
+; SCCSID = @(#)tmisc2.asm 4.3 85/06/25
+; SCCSID = @(#)tmisc2.asm 4.3 85/06/25
+TITLE Part7 COMMAND Transient Routines
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+; More misc routines
+
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include pdb.inc
+ include bpb.inc
+ include sf.inc
+ include comseg.asm
+ include comequ.asm
+ include ioctl.inc
+.list
+.cref
+
+
+CODERES SEGMENT PUBLIC BYTE ;AC000;
+CodeRes ENDS
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN IFFlag:BYTE
+ EXTRN PIPEFLAG:BYTE
+ EXTRN RE_OUTSTR:BYTE
+ EXTRN RE_OUT_APP:BYTE
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN AccDen_PTR:WORD
+ EXTRN Extend_buf_ptr:word ;AN000;
+ EXTRN FULDIR_PTR:WORD
+ EXTRN msg_disp_class:byte ;AN000;
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN DESTINFO:BYTE
+ EXTRN DESTISDIR:BYTE
+ EXTRN KPARSE:BYTE ;AC000;
+ EXTRN ONE_CHAR_VAL:BYTE ;AN011;
+ EXTRN PATHCNT:WORD
+ EXTRN PATHPOS:WORD
+ EXTRN PATHSW:WORD
+ EXTRN RE_INSTR:BYTE
+ EXTRN RESSEG:WORD
+ EXTRN SRCBUF:BYTE
+ EXTRN SWITCHAR:BYTE
+
+ IF IBM
+ EXTRN ROM_CALL:BYTE
+ EXTRN ROM_CS:WORD
+ EXTRN ROM_IP:WORD
+ ENDIF
+
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC byte
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN CERROR:NEAR
+
+ IF IBM
+ EXTRN ROM_EXEC:NEAR
+ EXTRN ROM_SCAN:NEAR
+ ENDIF
+
+ PUBLIC IOSET
+ PUBLIC MOVE_TO_SRCBUF ;AN000;
+ PUBLIC PGETARG
+ PUBLIC SETPATH
+ PUBLIC TESTDOREIN
+ PUBLIC TESTDOREOUT
+
+
+ASSUME DS:TRANGROUP
+
+SETPATH:
+;
+; ENTRY PathPos = ptr to string
+; PathCnt = length of string
+;
+; EXIT PathPos = ptr to string after pathname
+; PathCnt = length of rest of string
+; DX = ptr to pathname in string, made ASCIIZ
+; DestIsDir = 1 if pathname delimiters appeared in pathname, 0 otherwise
+; DestInfo = 2 if wildcards (?, *) appeared in pathname, 0 otherwise
+;
+; A null character is dropped at the end of the pathname. If the
+; character in that spot previously was CR, it is copied into the
+; following byte. So there must be at least two two character
+; positions in the buffer following the pathname.
+;
+ MOV AX,[PATHCNT] ;AC000; get length of string
+ MOV SI,[PATHPOS] ;AC000; get start of source buffer
+
+GETPATH:
+ MOV [DESTINFO],0
+ MOV [DESTISDIR],0
+ MOV SI,[PATHPOS] ; SI = ptr to string
+ MOV CX,[PATHCNT] ; CX = string length
+ MOV DX,SI ; DX = ptr to string
+ JCXZ PATHDONE ; string length is zero, we're done
+ PUSH CX ; save string length
+ PUSH SI ; save ptr to string
+ INVOKE SWITCH
+
+; After Switch, SI has been scanned past any switches, and
+; switches that COMMAND intrinsically recognizes are recorded in AX.
+
+ MOV [PATHSW],AX ; PathSw = switch occurrence mask
+ POP BX ; BX = ptr to original string
+ SUB BX,SI ; BX = -(# chars scanned by Switch)
+ POP CX ; CX = string length
+ ADD CX,BX ; CX = string length from current SI
+ MOV DX,SI ; DX = ptr to current string
+
+SKIPPATH:
+
+;;;; IFDEF DBCS 3/3/KK
+ MOV [KPARSE],0
+
+SKIPPATH2:
+;;;; ENDIF 3/3/KK
+
+ JCXZ PATHDONE ; string length is zero, we're done
+ DEC CX ; CX = length left after next char
+ LODSB ; AL = next char of string
+ ; SI = ptr to char after this one
+
+;;;; IFDEF DBCS 3/3/KK
+ INVOKE TESTKANJ
+ JZ TESTPPSEP ; no Kanji, move along
+ DEC CX
+ INC SI
+ INC [KPARSE]
+ JMP SKIPPATH2
+
+TESTPPSEP:
+;;;; ENDIF 3/3/KK
+
+ INVOKE PATHCHRCMP ; compare AL to path delimiter char
+ JNZ TESTPMETA ; it's not a path delim
+ INC [DESTISDIR] ; DestIsDir = 1, signalling path char
+
+TESTPMETA:
+ CMP AL,'?'
+ JNZ TESTPSTAR ; char is not '?'
+ OR [DESTINFO],2 ; DestInfo = 2, signalling wildcard
+
+TESTPSTAR:
+ CMP AL,star
+ JNZ TESTPDELIM ; char is not '*'
+ OR [DESTINFO],2 ; DestInfo = 2, signalling wildcard
+
+TESTPDELIM:
+ INVOKE DELIM ; compare AL to all delimiters
+ JZ PATHDONEDEC ; delimiter found, back up & leave
+ CMP AL,[SWITCHAR]
+ JNZ SKIPPATH ; char isn't switch, go get next char
+
+PATHDONEDEC:
+ DEC SI ; SI = ptr to char after pathname
+
+PATHDONE:
+ XOR AL,AL ; AL = NULL
+ XCHG AL,[SI] ; place NULL after pathname
+ INC SI ; SI = ptr to byte after NULL
+ CMP AL,0DH ; were we at end of line?
+ JNZ NOPSTORE ; not EOL, finish up
+ MOV [SI],AL ; save EOL after NULL
+
+NOPSTORE:
+ MOV [PATHPOS],SI ; PathPos = ptr to char after NULL
+ MOV [PATHCNT],CX ; PathCnt = length of string left
+ return
+
+PGETARG:
+ MOV SI,80H
+ LODSB
+ OR AL,AL
+ retz
+ CALL PSCANOFF
+ CMP AL,13
+ return
+
+PSCANOFF:
+ LODSB
+ INVOKE DELIM
+ JNZ PSCANOFFD
+ CMP AL,';'
+ JNZ PSCANOFF ; ';' is not a delimiter
+
+PSCANOFFD:
+ DEC SI ; Point to first non-delimiter
+ return
+
+IOSET:
+;
+; ALL REGISTERS PRESERVED
+;
+ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ PUSH DS
+ PUSH DX
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+
+ CMP [PIPEFLAG],0
+ JNZ NOREDIR ; Don't muck up the pipe
+ TEST IFFlag,-1
+ JNZ NoRedir
+ CALL TESTDOREIN
+ CALL TESTDOREOUT
+
+NOREDIR:
+ POP CX
+ POP BX
+ POP AX
+ POP DX
+ POP DS
+ASSUME DS:NOTHING
+ return
+
+TESTDOREIN:
+
+ASSUME DS:RESGROUP
+
+ CMP [RE_INSTR],0
+ retz
+ PUSH DS
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET tranGROUP:RE_INSTR
+ MOV AX,(OPEN SHL 8)
+ MOV BX,AX
+ INT 21h
+ POP DS
+ JC REDIRERR
+ MOV BX,AX
+ MOV AL,0FFH
+;
+; Mega sleaze!! We move the SFN from the new handle spot into the old stdin
+; spot. We invalidate the new JFN we got.
+;
+ XCHG AL,[BX.PDB_JFN_Table]
+ MOV DS:[PDB_JFN_Table],AL
+
+ return
+;
+; We had some kind of error on the redirection. Figure out what the
+; appropriate message should be; BX has the system call that failed
+;
+REDIRERR:
+ PUSH CS
+ POP DS
+ Call TriageError
+;
+; At this point, we have recognized the network-generated access denied error.
+; The correct message is in DX
+;
+ CMP AX,65
+ JZ CERRORJ ;AC000; just issue message returned
+ CMP BH,OPEN
+ JZ OpenError
+;
+; The error was for a create operation. Report the error as a creation error.
+;
+ MOV DX,OFFSET TranGroup:FULDIR_PTR
+
+CERRORJ:
+ JMP CERROR
+;
+; The system call was an OPEN. Report either file not found or path not found.
+;
+
+OpenError:
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,ax ;AN000; get message number in control block
+ JMP CERROR
+
+TESTDOREOUT:
+
+ASSUME DS:RESGROUP
+
+ CMP [RE_OUTSTR],0
+ JNZ REOUTEXISTS ;AN017; need long jump
+ JMP NOREOUT ;AN017;
+
+REOUTEXISTS:
+ CMP [RE_OUT_APP],0
+ JZ REOUTCRT
+;
+; The output redirection was for append. We open for write and seek to the
+; end.
+;
+ MOV DX,OFFSET RESGROUP:RE_OUTSTR
+ MOV AX,(OPEN SHL 8) OR 2 ;AC011; Open for read/write
+ PUSH AX
+ INT 21h
+ POP BX
+ JC OpenWriteError
+
+ MOV BX,AX
+ MOV AX,IOCTL SHL 8 ;AN035; Get attributes of handle
+ INT 21h ;AN035;
+ TEST DL,devid_ISDEV ;AN035; Is it a device?
+ JNZ SET_REOUT ;AN035; Yes, don't read from it
+
+ MOV AX,(LSEEK SHL 8) OR 2
+ MOV CX,-1 ;AC011; MOVE TO EOF -1
+ MOV DX,CX ;AC011;
+ INT 21h
+ PUSH CS ;AN011; Get transient seg to DS
+ POP DS ;AN011;
+ assume DS:Trangroup ;AN011;
+ MOV AX,(READ SHL 8) ;AN011; Read one byte from the
+ MOV CX,1 ;AN011; file into one_char_val
+ MOV DX,OFFSET Trangroup:ONE_CHAR_VAL;AN011;
+ INT 21h ;AN011;
+ JC OpenWriteError ;AN011; If error, exit
+ cmp ax,cx ;AN017; Did we read 1 byte?
+ jnz reout_0_length ;AN017; No - file must be 0 length
+
+ cmp one_char_val,01ah ;AN011; Was char an eof mark?
+ mov DS,[resseg] ;AN011; Get resident segment back
+ assume DS:Resgroup ;AN011;
+ JNZ SET_REOUT ;AN011; No, just continue
+ MOV AX,(LSEEK SHL 8) OR 1 ;AN011; EOF mark found
+ MOV CX,-1 ;AN011; LSEEK back one byte
+ MOV DX,CX ;AN011;
+ INT 21h ;AN011;
+ JMP SHORT SET_REOUT
+
+reout_0_length: ;AN017; We have a 0 length file
+ mov DS,[resseg] ;AN017; Get resident segment back
+ assume DS:Resgroup ;AN017;
+ MOV AX,(LSEEK SHL 8) ;AN017; Move to beginning of file
+ XOR CX,CX ;AN017; Offset is 0
+ MOV DX,CX ;AN017;
+ INT 21h ;AN017;
+ JMP SHORT SET_REOUT ;AN017; now finish setting up redirection
+
+OpenWriteError:
+ CMP AX,error_access_denied
+ STC ; preserve error
+ JNZ REOUTCRT ;AN017; need long jump
+ JMP REDIRERR ;AN017;
+
+REOUTCRT:
+ MOV DX,OFFSET RESGROUP:RE_OUTSTR
+ XOR CX,CX
+ MOV AH,CREAT
+ PUSH AX
+ INT 21h
+ POP BX
+ JNC NOREDIRERR ;AC011;
+ JMP REDIRERR ;AC011;
+
+NOREDIRERR: ;AN011;
+ MOV BX,AX
+
+SET_REOUT:
+;
+; Mega sleaze!! We move the SFN from the new handle spot into the old stdout
+; spot. We invalidate the new JFN we got.
+;
+ MOV AL,0FFH
+ XCHG AL,[BX.PDB_JFN_Table]
+ MOV DS:[PDB_JFN_Table+1],AL
+
+NOREOUT:
+ return
+
+;
+; Compute length of string (including NUL) in DS:SI into CX. Change no other
+; registers
+;
+Procedure DSTRLEN,NEAR
+
+ SaveReg <AX>
+ XOR CX,CX
+ CLD
+
+DLoop: LODSB
+ INC CX
+ OR AL,AL
+ JNZ DLoop
+ SUB SI,CX
+ RestoreReg <AX>
+ return
+
+EndProc DSTRLEN
+
+Break <Extended error support>
+
+;
+; TriageError will examine the return from a carry-set system call and
+; return the correct error if applicable.
+;
+; Inputs: outputs from a carry-settable system call
+; No system calls may be done in the interrim
+; Outputs: If carry was set on input
+; carry set on output
+; DX contains trangroup offset to printf message
+; else
+; No registers changed
+;
+
+Procedure TriageError,NEAR
+
+ retnc ; no carry => do nothing...
+ PUSHF
+ SaveReg <BX,CX,SI,DI,BP,ES,DS,AX,DX>
+ MOV AH,GetExtendedError
+ INT 21h
+ RestoreReg <CX,BX> ; restore original AX
+ MOV DX,OFFSET TranGroup:AccDen_PTR
+ CMP AX,65 ; network access denied?
+ JZ NoMove ; Yes, return it.
+ MOV AX,BX
+ MOV DX,CX
+
+NoMove:
+ RestoreReg <DS,ES,BP,DI,SI,CX,BX>
+ popf
+ return
+
+EndProc TriageError
+
+PUBLIC Triage_Init
+Triage_Init proc FAR
+ call TriageError
+ ret
+Triage_Init endp
+
+
+; ****************************************************************
+; *
+; * ROUTINE: MOVE_TO_SRCBUF
+; *
+; * FUNCTION: Move ASCIIZ string from DS:SI to SRCBUF. Change
+; * terminating 0 to 0dH. Set PATHCNT to length of
+; * string. Set PATHPOS to start of SRCBUF.
+; *
+; * INPUT: DS:SI points to ASCIIZ string
+; * ES points to TRANGROUP
+; *
+; * OUTPUT: SRCBUF filled in with string terminated by 0dH
+; * PATHCNT set to length of string
+; * PATHPOS set to start of SRCBUF
+; * CX,AX changed
+; *
+; ****************************************************************
+
+assume es:trangroup,ds:nothing ;AN000;
+
+MOVE_TO_SRCBUF PROC NEAR ;AN000;
+
+ push si ;AN000; save si,di
+ push di ;AN000;
+ push cx ;AN000;
+ mov di,offset TRANGROUP:srcbuf ;AN000; set ES:DI to srcbuf
+ xor cx,cx ;AN000; clear cx for counint
+ mov ax,cx ;AN000; clear ax
+ push di ;AN000; save start of srcbuf
+ lodsb ;AN000; get a character from DS:SI
+
+mts_get_chars: ;AN000;
+ cmp al,0 ;AN000; was it a null char?
+ jz mts_end_string ;AN000; yes - exit
+ stosb ;AN000; no - store it in srcbuf
+ inc cx ;AN000; increment length count
+ lodsb ;AN000; get a character from DS:SI
+ jmp short mts_get_chars ;AN000; go check it
+
+mts_end_string: ;AN000; we've reached the end of line
+ mov al,end_of_line_in ;AN000; store 0dH in srcbuf
+ stosb ;AN000;
+ pop di ;AN000; restore start of srcbuf
+
+ push cs ;AN000; set DS to local segment
+ pop ds ;AN000;
+assume ds:trangroup ;AN000;
+ mov [pathcnt],cx ;AN000; set patchcnt to length count
+ mov [pathpos],di ;AN000; set pathpos to start of srcbuf
+ pop cx ;AN000; restore cx,di,si
+ pop di ;AN000;
+ pop si ;AN000;
+
+ RET ;AN000; exit
+
+MOVE_TO_SRCBUF ENDP ;AN000;
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tparse.asm b/private/mvdm/dos/v86/cmd/command/tparse.asm
new file mode 100644
index 000000000..133352c1e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tparse.asm
@@ -0,0 +1,82 @@
+ page ,132
+; SCCSID = @(#)tparse.asm 4.1 87/04/28
+; SCCSID = @(#)tparse.asm 4.1 87/04/28
+TITLE COMMAND interface to SYSPARSE
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+.xlist
+.xcref
+ include comsw.asm
+ include comseg.asm ;an000;
+.list
+.cref
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AN000;
+
+ CmpxSW equ 0 ;AN000; do not check complex list
+ KeySW equ 0 ;AN000; do not support keywords
+ Val2SW equ 0 ;AN000; do not Support value definition 2
+ IncSW equ 0 ;AN000; do not include psdata.inc
+ QusSW equ 0 ;AN025; do not include quoted string
+ LFEOLSW equ 0 ;AN044; do not use 0ah as line terminator
+
+.xlist
+.xcref
+
+include psdata.inc ;AN000;
+
+.list
+.cref
+
+TRANSPACE ENDS ;AN000;
+
+TRANCODE SEGMENT PUBLIC BYTE ;AN000;
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING ;AN054;
+
+; ****************************************************************
+; *
+; * ROUTINE: CMD_PARSE
+; *
+; * FUNCTION: Interface for transient COMMAND to invoke
+; * SYSPARSE.
+; *
+; * INPUT: inputs to SYSPARSE
+; *
+; * OUTPUT: outputs from SYSPARSE
+; *
+; ****************************************************************
+
+ public Cmd_parse ;AN000;
+
+.xlist
+.xcref
+ INCLUDE parse.asm ;AN000;
+.list
+.cref
+
+Cmd_parse Proc near ;AN000;
+
+ call sysparse ;AN000;
+
+ ret ;AN000;
+
+Cmd_parse endp ;AN000;
+
+ public Append_parse ;AN010;
+
+Append_parse Proc Far ;AN010;
+
+ call sysparse ;AN010;
+
+ ret ;AN010;
+
+Append_parse endp ;AN010;
+
+trancode ends ;AN000;
+ end ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tpipe.asm b/private/mvdm/dos/v86/cmd/command/tpipe.asm
new file mode 100644
index 000000000..06814ae39
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tpipe.asm
@@ -0,0 +1,834 @@
+ page ,132
+; SCCSID = @(#)tpipe.asm 1.1 85/05/14
+; SCCSID = @(#)tpipe.asm 1.1 85/05/14
+TITLE PART8 COMMAND Transient routines.
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M025 SR 9/12/90 Removed calls to SetStdInOn,SetStdInOff
+; SetStdOutOn & SetStdOutOff.
+;
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include syscall.inc
+ include pdb.inc
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN ECHOFLAG:BYTE
+ EXTRN InitFlag:byte
+ EXTRN INPIPEPTR:WORD
+ EXTRN OUTPIPEPTR:WORD
+ EXTRN PIPE1:BYTE
+;;; EXTRN PIPE1T:BYTE
+ EXTRN PIPE2:BYTE
+;;; EXTRN PIPE2T:BYTE
+ EXTRN PIPEFILES:BYTE
+ EXTRN PIPEFLAG:BYTE
+ EXTRN PIPEPTR:WORD
+ EXTRN RESTDIR:BYTE
+ EXTRN SINGLECOM:WORD
+
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BADDAT_PTR:WORD
+ EXTRN BADTIM_PTR:WORD
+ EXTRN curdat_mo_day:word ;AN000;
+ EXTRN CURDAT_PTR:WORD
+ EXTRN curdat_yr:word ;AN000;
+ EXTRN curtim_hr_min:word ;AN000;
+ EXTRN CURTIM_PTR:WORD
+ EXTRN curtim_sec_hn:word ;AN000;
+ EXTRN eurdat_ptr:word
+ EXTRN japdat_ptr:word
+ EXTRN newdat_format:word ;AN000;
+ EXTRN NEWDAT_PTR:WORD
+ EXTRN NEWTIM_PTR:WORD
+ EXTRN parse_date:byte ;AN000;
+ EXTRN parse_time:byte ;AN000;
+ EXTRN PIPEEMES_PTR:WORD
+ EXTRN promtim_hr_min:word ;AN000;
+ EXTRN promtim_ptr:word ;AN000;
+ EXTRN promtim_sec_hn:word ;AN000;
+ EXTRN STRING_BUF_PTR:WORD ;AC000;
+ EXTRN SYNTMES_PTR:WORD
+ EXTRN usadat_ptr:word
+
+ extrn TempVarName:byte
+
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN COMBUF:BYTE
+ EXTRN date_day:byte ;AN000;
+ EXTRN date_month:byte ;AN000;
+ EXTRN date_year:word ;AN000;
+ EXTRN INTERNATVARS:BYTE
+ EXTRN RESSEG:WORD
+ EXTRN time_fraction:byte ;AN000;
+ EXTRN time_hour:byte ;AN000;
+ EXTRN time_minutes:byte ;AN000;
+ EXTRN time_seconds:byte ;AN000;
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ EXTRN CERROR:NEAR
+ EXTRN NOPIPEPROC:NEAR
+ EXTRN STD_PRINTF:NEAR
+ EXTRN TCOMMAND:NEAR
+ EXTRN TESTDOREIN:NEAR
+ EXTRN TESTDOREOUT:NEAR
+ EXTRN TESTKANJ:NEAR ;AN000;3/3/KK
+ EXTRN TSYSGETMSG:NEAR ;AN000;
+
+ extrn Find_Name_In_Environment:near
+
+ PUBLIC CTIME
+ PUBLIC DATE
+ PUBLIC DATINIT
+ PUBLIC PIPEDEL
+ PUBLIC PIPEERRSYN
+ PUBLIC PIPEPROC
+ PUBLIC PIPEPROCSTRT
+ PUBLIC PRINT_TIME
+ PUBLIC SETREST
+ PUBLIC SETREST1
+ PUBLIC SINGLETEST
+
+SINGLETEST:
+ ASSUME DS:NOTHING
+ push ds
+ MOV DS,ResSeg
+ ASSUME DS:ResGroup
+ CMP [SINGLECOM],0
+ JZ TestDone
+ CMP [SINGLECOM],0EFFFH
+TestDone:
+ pop ds
+ return
+
+
+ASSUME DS:TRANGROUP
+SETREST1:
+ MOV AL,1
+SETREST:
+ PUSH DS
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV [RESTDIR],AL
+ POP DS
+ASSUME DS:TRANGROUP
+ return
+
+ASSUME DS:RESGROUP
+
+;
+; Note that we need to handle the same thing that RestDir handles: the
+; requirement that we try only once to restore the user's environment after
+; and INT 24 or the like. If the condition that causes the INT 24 does not
+; disappear, we just give up.
+;
+
+PIPEDEL:
+ assume ds:nothing
+ push ds
+ PUSH DX
+ mov ds,ResSeg
+ assume ds:ResGroup
+ mov DX,OFFSET RESGROUP:PIPE1 ; Clean up in case ^C
+ MOV AH,UNLINK
+ INT 21h
+ MOV DX,OFFSET RESGROUP:PIPE2
+ MOV AH,UNLINK
+ INT 21h
+ POP DX
+ call PipeOff
+ mov PipeFiles,0
+ pop ds
+ return
+
+PIPEERRSYN:
+ MOV DX,OFFSET TRANGROUP:SYNTMES_ptr
+ CALL PIPEDEL
+ PUSH CS
+ POP DS
+ JMP CERROR
+PIPEERR:
+ pushf
+ invoke triageError
+ SaveReg <AX,DX> ; Save results from TriageError
+ MOV DX,OFFSET TRANGROUP:PIPEEMES_ptr
+ CALL PIPEDEL
+ PUSH CS
+ POP DS
+ invoke std_eprintf
+ RestoreReg <DX,AX> ; Restore results from TriageError
+ popf
+ cmp ax, 65
+ jnz tcommandj
+ JMP CERROR
+tcommandj:
+ jmp tcommand
+
+PIPEPROCSTRT:
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ INC [PIPEFILES] ; Flag that the pipe files exist
+
+ push es
+ push di
+ push ds
+ push si
+
+ push ds
+ push es
+ pop ds ;ds = TRANGROUP
+ mov si,offset TRANGROUP:TempVarName ;ds:si = "TEMP="
+;
+;Some hideous code in Find_Name_In_Environment. Expects ds = TRANGROUP and
+;so the routine is not really general
+;
+ call Find_Name_In_Environment ;es:di points at path
+ pop ds ;ds = DATARES again
+ jc no_temp_path
+
+ push ds
+ push es
+ pop ds
+ pop es ;swap ds and es
+ mov si,di ;ds:si points at path
+
+ call skip_white ;skip white space chars
+;
+;This copies the path into both buffers -- Pipe1 & Pipe2
+;
+ call copy_pipe_path ;copy the pipe path
+
+
+;
+;Check if the TEMP path is valid
+;
+ push es
+ pop ds ;ds = DATARES
+ mov dx,offset DATARES:Pipe1 ;ds:dx = path to look for
+ mov ax, (CHMOD shl 8) or 0
+ int 21h
+ jc no_temp_path
+
+ test cx,10h ;is it a directory?
+ jnz no_temp_path ;yes, continue (carry clear)
+
+ stc ;no, indicate fail
+
+no_temp_path:
+ pop si
+ pop ds
+ pop di
+ pop es
+ jnc crt_temp ;path found, create tempfiles
+;;;;
+;;;;Invalid or no TEMP path, default to root of current drive
+;;;;
+
+;;; MOV AH,Get_Default_Drive ; Get current drive
+;;; INT 21h
+;;; ADD AL,capital_A
+;;; MOV PIPE2,AL ; Make pipe files in root of def drv
+;;; MOV Pipe1,AL
+;;; mov al,':'
+;;; mov ah,'\'
+;;; mov word ptr Pipe1+1,ax
+;;; mov word ptr Pipe2+1,ax ;store ':\'
+;;;
+;;; xor ah,ah ; nul terminate path names
+;;; mov Pipe1+3,ah
+;;; mov Pipe2+3,ah
+
+;SR;
+; We want to create temp files in the current directory rather than in the
+;root of the drive. This is because the number of files that can be present
+;in the root directory is fixed, whereas it is not so in subdirectories.
+;
+ mov ah,'.'
+ mov Pipe1,ah
+ mov Pipe2,ah
+ xor ah,ah
+ mov Pipe1+1,ah
+ mov Pipe2+1,ah ;create files in current dir
+
+crt_temp:
+ MOV DX,offset DATARES:Pipe1
+ XOR CX,CX
+ mov ah,CreateTempFile ; the CreateTemp call
+ INT 21h
+ JnC @f
+ jmp PIPEERR ; Couldn't create
+@@:
+ MOV BX,AX
+ MOV AH,CLOSE ; Don't proliferate handles
+ INT 21h
+
+ MOV DX,OFFSET RESGROUP:PIPE2
+ mov ah,createTempFile ; the CreateTemp call
+ INT 21h
+ JnC @f
+ jmp PIPEERR
+@@:
+ MOV BX,AX
+ MOV AH,CLOSE
+ INT 21h
+
+ CALL TESTDOREIN ; Set up a redirection if specified
+ MOV SI,[PIPEPTR]
+ CMP [SINGLECOM],-1
+ JNZ NOSINGP
+ MOV [SINGLECOM],0F000H ; Flag single command pipe
+NOSINGP:
+ JMP SHORT FIRSTPIPE
+
+PIPEPROC:
+ASSUME DS:RESGROUP
+ AND [ECHOFLAG],0FEh ; force current echo to be off
+ MOV SI,[PIPEPTR]
+ LODSB
+ CMP AL,AltPipeChr ; Alternate pipe char?
+ JZ IsPipe1 ; Yes
+ CMP AL,vbar
+ jz IsPipe1
+ jmp PIPEEND ; Pipe done
+IsPipe1:
+ MOV DX,[INPIPEPTR] ; Get the input file name
+ MOV AX,(OPEN SHL 8)
+ INT 21h
+PIPEERRJ:
+ jnc no_pipeerr
+ JMP PIPEERR ; Lost the pipe file
+no_pipeerr:
+ MOV BX,AX
+ MOV AL,0FFH
+ XCHG AL,[BX.PDB_JFN_Table]
+ MOV DS:[PDB_JFN_Table],AL ; Redirect
+
+FIRSTPIPE:
+ MOV DI,OFFSET TRANGROUP:COMBUF + 2
+ XOR CX,CX
+ CMP BYTE PTR [SI],0DH ; '|<CR>'
+ JNZ PIPEOK1
+PIPEERRSYNJ:
+ JMP PIPEERRSYN
+PIPEOK1:
+ mov al,vbar
+ CMP BYTE PTR [SI],al ; '||'
+ JZ PIPEERRSYNJ
+ CMP BYTE PTR [SI],AltPipeChr ; '##' or '|#'?
+ JZ PipeErrSynJ ; Yes, Error
+PIPECOMLP:
+ LODSB
+ STOSB
+
+;;;; IFDEF DBCS 3/3/KK
+ CALL TESTKANJ
+ JZ NOTKANJ5
+ MOVSB
+;
+; Added following 2 commands to the fix pipe bug.
+;
+ inc cx ;AN000; 3/3/KK
+ inc cx ;AN000; 3/3/KK
+;
+ JMP PIPECOMLP
+
+NOTKANJ5:
+;;;; ENDIF ; 3/3/KK
+
+ CMP AL,0DH
+ JZ LASTPIPE
+ INC CX
+ CMP AL,AltPipeChr
+ JZ IsPipe2
+ CMP AL,vbar
+ JNZ PIPECOMLP
+IsPipe2:
+ MOV BYTE PTR ES:[DI-1],0DH
+ DEC CX
+ MOV [COMBUF+1],CL
+ DEC SI
+ MOV [PIPEPTR],SI ; On to next pipe element
+ MOV DX,[OUTPIPEPTR]
+ PUSH CX
+ XOR CX,CX
+ MOV AX,(CREAT SHL 8)
+ INT 21h
+ POP CX
+ JC PIPEERRJ ; Lost the file
+ MOV BX,AX
+ MOV AL,0FFH
+ XCHG AL,[BX.PDB_JFN_Table]
+ MOV DS:[PDB_JFN_Table+1],AL
+ XCHG DX,[INPIPEPTR] ; Swap for next element of pipe
+ MOV [OUTPIPEPTR],DX
+ JMP SHORT PIPECOM
+
+LASTPIPE:
+ MOV [COMBUF+1],CL
+ DEC SI
+ MOV [PIPEPTR],SI ; Point at the CR (anything not '|' will do)
+ CALL TESTDOREOUT ; Set up the redirection if specified
+PIPECOM:
+ PUSH CS
+ POP DS
+ JMP NOPIPEPROC ; Process the pipe element
+
+PIPEEND:
+ CALL PIPEDEL
+ CMP [SINGLECOM],0F000H
+ JNZ NOSINGP2
+ MOV [SINGLECOM],-1 ; Make it return
+NOSINGP2:
+ JMP TCOMMAND
+
+ASSUME DS:TRANGROUP,ES:TRANGROUP
+
+; Date and time are set during initialization and use
+; this routines since they need to do a long return
+
+DATINIT PROC FAR
+ mov cs:[resseg],ds ; SetInitFlag needs resseg initialized
+ PUSH ES
+ PUSH DS ; Going to use the previous stack
+ MOV AX,CS ; Set up the appropriate segment registers
+ MOV ES,AX
+ MOV DS,AX
+ invoke TSYSLOADMSG ;AN000; preload messages
+ MOV DX,OFFSET TRANGROUP:INTERNATVARS;Set up internat vars
+ MOV AX,INTERNATIONAL SHL 8
+ INT 21H
+ MOV WORD PTR DS:[81H],13 ; Want to prompt for date during initialization
+ MOV [COMBUF],COMBUFLEN ; Init COMBUF
+ MOV WORD PTR [COMBUF+1],0D01H
+ CALL DATE
+ CALL CTIME
+ POP DS
+ POP ES
+ RET
+DATINIT ENDP
+
+; DATE - Gets and sets the time
+
+
+ break Date
+
+
+; ****************************************************************
+; *
+; * ROUTINE: DATE - Set system date
+; *
+; * FUNCTION: If a date is specified, set the system date,
+; * otherwise display the current system date and
+; * prompt the user for a new date. If an invalid
+; * date is specified, issue an error message and
+; * prompt for a new date. If the user enters
+; * nothing when prompted for a date, terminate.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+DATE:
+ MOV SI,81H ; Accepting argument for date inline
+ mov di,offset trangroup:parse_date ;AN000; Get adderss of PARSE_DATE
+ xor cx,cx ;AN000; clear counter for positionals
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AC000; call parser
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ JZ PRMTDAT ;AC000; yes - go ask for date
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne daterr ;AN000; yes - go issue message
+ JMP short COMDAT ;AC000; we have a date
+
+PRMTDAT:
+ ; Print "Current date is
+
+ invoke GetDate ;AN000; get date for output
+ xchg dh,dl ;AN000; switch month & day
+ mov CurDat_yr,cx ;AC000; put year into message control block
+ mov CurDat_mo_day,dx ;AC000; put month and day into message control block
+ mov dx,offset trangroup:CurDat_ptr ;AC000; set up message for output
+ invoke std_printf
+;AD061; mov CurDat_yr,0 ;AC000; reset year, month and day
+;AD061; mov CurDat_mo_day,0 ;AC000; pointers in control block
+
+GET_NEW_DATE: ;AN000;
+ call getdat ;AC000; prompt user for date
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ jz date_end ;AC000; yes - exit
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne daterr ;AN000; yes - go issue message
+COMDAT:
+ mov cx,date_year ;AC000; get parts of date in
+ mov dh,date_month ;AC000; cx and dx for set
+ mov dl,date_day ;AC000; date function call.
+ push cx ;AC000; save date
+ push dx ;AC000;
+ mov cx,1 ;AC000; set 1 positional entered
+ xor dx,dx ;AN029;
+ invoke cmd_parse ;AN029; call parser
+ cmp al,end_of_line ;AN029; Are we at end of line?
+ pop dx ;AC000; retrieve date
+ pop cx ;AC000;
+ jnz daterr ;AC000; extra stuff on line - try again
+ MOV AH,SET_DATE ;yes - set date
+ INT 21h
+ OR AL,AL
+ JNZ DATERR
+date_end:
+ ret
+
+DATERR:
+ invoke crlf2 ;AN028; print out a blank line
+ MOV DX,OFFSET TRANGROUP:BADDAT_ptr
+ invoke std_printf
+ JMP GET_NEW_DATE ;AC000; get date again
+
+
+; TIME gets and sets the time
+
+ break Time
+
+; ****************************************************************
+; *
+; * ROUTINE: TIME - Set system time
+; *
+; * FUNCTION: If a time is specified, set the system time,
+; * otherwise display the current system time and
+; * prompt the user for a new time. If an invalid
+; * time is specified, issue an error message and
+; * prompt for a new time. If the user enters
+; * nothing when prompted for a time, terminate.
+; *
+; * INPUT: command line at offset 81H
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+CTIME:
+ MOV SI,81H ; Accepting argument for time inline
+ mov di,offset trangroup:parse_time ;AN000; Get adderss of PARSE_time
+ xor cx,cx ;AN000; clear counter for positionals
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AC000; call parser
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ JZ PRMTTIM ;AC000; yes - prompt for time
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne timerr ;AN000; yes - go issue message
+ JMP short COMTIM ;AC000; we have a time
+
+PRMTTIM:
+ ;Printf "Current time is ... "
+
+ MOV AH,GET_TIME ;AC000; get the current time
+ INT 21h ;AC000; Get time in CX:DX
+ xchg ch,cl ;AN000; switch hours & minutes
+ xchg dh,dl ;AN000; switch seconds & hundredths
+ mov CurTim_hr_min,cx ;AC000; put hours and minutes into message subst block
+ mov CurTim_sec_hn,dx ;AC000; put seconds and hundredths into message subst block
+ mov dx,offset trangroup:CurTim_ptr ;AC000; set up message for output
+ invoke std_printf
+;AD061; mov CurTim_hr_min,0 ;AC000; reset hour, minutes, seconds, and hundredths
+;AD061; mov CurTim_sec_hn,0 ;AC000; pointers in control block
+
+GET_NEW_TIME:
+ call gettim ;AC000;
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ jz time_end ;AC000;
+ cmp ax,result_no_error ;AN000; did we have an error?
+ jne timerr ;AN000; yes - go issue message
+
+COMTIM:
+ mov ch,time_hour ;AC000; get parts of time in
+ mov cl,time_minutes ;AC000; cx and dx for set
+ mov dh,time_seconds ;AC000; time function call
+ mov dl,time_fraction ;AC000;
+ push cx ;AC000; save time
+ push dx ;AC000;
+ mov cx,1 ;AC000; set 1 positional parm entered
+ xor dx,dx ;AN029;
+ invoke cmd_parse ;AN029; call parser
+ cmp al,end_of_line ;AN029; Are we at end of line?
+ pop dx ;AC000; retieve time
+ pop cx ;AC000;
+ jnz timerr ;AC000; extra stuff on line - try again
+
+SAVTIM:
+ MOV AH,SET_TIME
+ INT 21h
+ OR AL,AL
+ JNZ TIMERR ;AC000; if an error occured, try again
+
+TIME_END:
+
+ ret
+
+TIMERR:
+ invoke crlf2 ;AN028; print out a blank line
+ MOV DX,OFFSET TRANGROUP:BADTIM_ptr
+ invoke std_printf ; Print error message
+ JMP GET_NEW_TIME ;AC000; Try again
+
+
+;
+; Set the special flag in the INIT flag to the value in CX.
+;
+SetInitFlag:
+ mov ds,[RESSEG]
+assume ds:resgroup
+ and InitFlag,NOT initSpecial
+ or InitFlag,cL
+ push cs
+ pop ds
+ return
+
+Public PipeOff
+PipeOff:
+ ASSUME DS:NOTHING,ES:NOTHING
+ SaveReg <DS,AX>
+ MOV DS,ResSeg
+ ASSUME DS:RESGroup
+ XOR AL,AL
+ XCHG PipeFlag,AL
+ OR AL,AL
+ JZ PipeOffDone
+ SHR EchoFlag,1
+PipeOffDone:
+ RestoreReg <AX,DS>
+ return
+
+
+PRINT_TIME:
+
+ MOV AH,GET_TIME
+ INT 21h ; Get time in CX:DX
+
+ PUSH ES
+ PUSH CS
+ POP ES
+ xchg ch,cl ;AN000; switch hours & minutes
+ xchg dh,dl ;AN000; switch seconds & hundredths
+ mov promTim_hr_min,cx ;AC000; put hours and minutes into message subst block
+ mov promTim_sec_hn,dx ;AC000; put seconds and hundredths into message subst block
+ mov dx,offset trangroup:promTim_ptr ;AC000; set up message for output
+ invoke std_printf
+;AD061; mov promTim_hr_min,0 ;AC000; reset hour, minutes, seconds, and hundredths
+;AD061; mov promTim_sec_hn,0 ;AC000; pointers in control block
+
+ POP ES
+ return
+
+
+; ****************************************************************
+; *
+; * ROUTINE: GETDAT - Prompt user for date
+; *
+; * FUNCTION: Gets the date format from the COUNTRY DEPENDENT
+; * INFORMATION and issues the "Enter new date"
+; * message with the proper date format. COMBUF
+; * is reset to get a date from the command line.
+; * The PARSE_DATE blocks are then reset and the
+; * PARSE function call is issued.
+; *
+; * INPUT: NONE
+; *
+; * OUTPUT: COMBUF
+; * PARSER RETURN CODES
+; *
+; ****************************************************************
+
+
+GETDAT proc near ;AC000;
+
+ mov ax,(International SHL 8) ; Determine what format the date
+ mov dx,5ch ; should be entered in and
+ int 21h ; print a message describing it
+ mov si,dx
+ lodsw
+ mov dx,usadat_ptr ;AC000; get mm-dd-yy
+ dec ax
+ js printformat
+ mov dx,eurdat_ptr ;AC000; get dd-mm-yy
+ jz printformat
+ mov dx,japdat_ptr ;AC000; get yy-mm-dd
+printformat:
+ mov ax,dx ;AN000; get message number of format
+ mov dh,util_msg_class ;AN000; this is a utility message
+ call Tsysgetmsg ;AN000; get the address of the message
+ mov newdat_format,si ;AN000; put the address in subst block
+ MOV DX,OFFSET TRANGROUP:NEWDAT_ptr ;AC000; get address of message to print
+ invoke std_printf
+ mov newdat_format,no_subst ;AN000; reset subst block
+
+ MOV AH,STD_CON_STRING_INPUT
+ MOV DX,OFFSET TRANGROUP:COMBUF
+ mov cx,initSpecial ; Set bit in InitFlag that indicates
+ call SetInitFlag ; prompting for date.
+ INT 21h ; Get input line
+ xor cx,cx ; Reset bit in InitFlag that indicates
+ call SetInitFlag ; prompting for date.
+ invoke CRLF2
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ mov di,offset trangroup:parse_date ;AN000; Get adderss of PARSE_DATE
+ xor cx,cx ;AN000; clear counter for positionals
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AC000; call parser
+
+ ret
+
+GETDAT endp ;AC000;
+
+
+; ****************************************************************
+; *
+; * ROUTINE: GETTIME - Prompt user for time
+; *
+; * FUNCTION: Gets the time format from the COUNTRY DEPENDENT
+; * INFORMATION and issues the "Enter new time"
+; * message. COMBUF is reset to get a time from the
+; * command line. The PARSE_TIME blocks are then
+; * reset and the PARSE function call is issued.
+; *
+; * INPUT: NONE
+; *
+; * OUTPUT: COMBUF
+; * PARSER RETURN CODES
+; *
+; ****************************************************************
+
+
+GETTIM proc near ;AC000;
+
+ XOR CX,CX ; Initialize hours and minutes to zero
+ MOV DX,OFFSET TRANGROUP:NEWTIM_ptr
+ invoke std_printf
+ MOV AH,STD_CON_STRING_INPUT
+ MOV DX,OFFSET TRANGROUP:COMBUF
+ mov cx,initSpecial ; Set bit in InitFlag that indicates
+ call SetInitFlag ; prompting for time.
+ INT 21h ; Get input line
+ xor cx,cx ; Reset bit in InitFlag that indicates
+ call SetInitFlag ; prompting for time.
+ invoke CRLF2
+ MOV SI,OFFSET TRANGROUP:COMBUF+2
+ mov di,offset trangroup:parse_time ;AN000; Get adderss of PARSE_TIME
+ xor cx,cx ;AN000; clear counter for positionals
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AC000; call parser
+
+ ret
+
+GETTIM endp ;AC000;
+
+;
+;Skip_white: Skips over the whitespace chars that could be present after
+;the '=' sign in the environment variable before the actual path.
+;
+; ENTRY: ds:si = arguments of the environment variable
+;
+; EXIT: ds:si = start of the path
+;
+; REGISTERS AFFECTED: ax
+;
+
+Skip_white proc near
+
+ cld
+skw_lp:
+ lodsb
+ cmp al,' ' ;blank char?
+ jz skw_lp ;yes, skip it
+ cmp al,09 ;tab char?
+ jz skw_lp ;yes, skip it
+
+ dec si ;point at first non-white
+
+ ret
+
+Skip_white endp
+
+;
+;Copy_pipe_path: This routine copies the path from the TEMP environment
+;variable into the path buffers Pipe1 & Pipe2.
+;
+; ENTRY: ds:si = path to be copied
+; es = RESGROUP
+;
+; EXIT: Path copied into Pipe1 and Pipe2.
+;
+; REGISTERS AFFECTED: si, di, cx, ax
+;
+
+Copy_pipe_path proc near
+
+ mov cx,0ffffh
+ xor al,al
+
+ mov di,si
+ push es ;save es
+ push ds
+ pop es ;es:di = path to be copied
+
+ cld
+ push di
+ repnz scasb ;look for the null char
+ pop di
+
+ pop es ;es = RESGROUP again
+
+ not cx ;length including the null
+
+ mov di,offset DATARES:Pipe1
+ push di
+ push cx
+ rep movsb ;copy path into Pipe1
+ pop cx
+ pop di
+
+ push ds
+ push es
+ pop ds ;ds:si = Pipe1
+ mov si,di
+ mov di,offset DATARES:Pipe2 ;es:di = Pipe2
+ rep movsb ;copy path into Pipe2
+ pop ds
+
+ ret ;
+
+Copy_pipe_path endp
+
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tprintf.asm b/private/mvdm/dos/v86/cmd/command/tprintf.asm
new file mode 100644
index 000000000..cea4e7dc0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tprintf.asm
@@ -0,0 +1,376 @@
+ page ,132
+; SCCSID = @(#)tprintf.asm 4.3 85/07/02
+; SCCSID = @(#)tprintf.asm 4.3 85/07/02
+TITLE COMMAND Transient Printf routine
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+;
+; M025 SR 9/12/90 Removed calls to SetStdInOn,SetStdInOff
+; SetStdOutOn & SetStdOutOff.
+;
+
+
+;****************************************************************
+;*
+;* ROUTINE: STD_PRINTF/STD_EPRINTF
+;*
+;* FUNCTION: Set up to print out a message using SYSDISPMSG.
+;* Set up substitutions if utility message. Make
+;* sure any changes to message variables in TDATA
+;* are reset to avoid reloading the transient.
+;*
+;* INPUT: Msg_Disp_Class - set to message class
+;* Msg_Cont_Flag - set to control flags
+;* DS points to transient segment
+;*
+;* if utility message:
+;* DX points to a block with message number
+;* (word), number of substitutions (byte),
+;* followed by substitution list if there
+;* are substitutions. If substitutions
+;* are not in transient segment they must
+;* be set.
+;* else
+;* AX set to message number
+;*
+;* OUTPUT: none
+;*
+;****************************************************************
+
+.xlist
+.xcref
+ INCLUDE comsw.asm ;AC000;
+ INCLUDE DOSSYM.INC
+ INCLUDE comseg.asm
+ INCLUDE comequ.asm ;AN000;
+ INCLUDE SYSMSG.INC ;AN000;
+.list
+.cref
+
+datares segment public
+ extrn pipeflag:byte
+datares ends
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN extend_buf_off:word ;AN000;
+ EXTRN Extend_Buf_ptr:word ;AN000;
+ EXTRN Extend_Buf_seg:word ;AN000;
+ EXTRN Msg_Cont_Flag:byte ;AN000;
+ EXTRN Msg_disp_Class:byte ;AN000;
+ EXTRN pipeemes_ptr:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN msg_flag:byte ;AN022;
+ EXTRN print_err_flag:word ;AN000;
+ EXTRN RESSEG:WORD
+ EXTRN String_ptr_2:word ;AC000;
+ EXTRN Subst_buffer:byte ;AN061;
+;AD061; EXTRN String_ptr_2_sb:word ;AN000;
+
+ ; include data area for message services
+
+ MSG_UTILNAME <COMMAND> ;AN000; define utility name
+
+ MSG_SERVICES <MSGDATA> ;AN000;
+
+PRINTF_HANDLE DW ? ;AC000;
+
+TRANSPACE ENDS ;AC000;
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+
+ EXTRN cerror:near
+ EXTRN crlf2:near
+ EXTRN tcommand:near ;AN026;
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:NOTHING,SS:NOTHING ;AC000;
+
+ PUBLIC TSYSGETMSG ;AN000;
+ PUBLIC TSYSLOADMSG ;AN000;
+
+PUBLIC Printf_Init
+printf_init proc far
+ call std_printf
+ ret
+printf_init endp
+
+Public Printf_Crlf
+PRINTF_CRLF:
+ CALL STD_PRINTF
+ CALL CRLF2
+ RET
+
+PUBLIC Std_EPrintf
+STD_EPRINTF:
+ mov Printf_Handle,2 ;AC000;Print to STDERR
+ jmp short NEW_PRINTF ;AC000;
+PUBLIC Std_Printf
+STD_PRINTF:
+ mov Printf_Handle,1 ;AC000;Print to STDOUT
+
+NEW_PRINTF:
+ push ax ;AN000;save registers
+ push bx ;AN000;
+ push cx ;AN000;
+ push es ;AN000;get local ES
+ push ds ;AN000;
+ pop es ;AN000;
+ push di ;AN000;
+ push si ;AN000;
+ push dx ;AN000;
+ assume es:trangroup ;AN000;
+;AD061; mov string_ptr_2_sb,0 ;AN000;initialize
+ mov print_err_flag,0 ;AN000;
+
+UTILITY_SETUP:
+ mov si,dx ;AN000;Get offset of message number
+ lodsw ;AN000;load message number
+ push ax ;AN000;save it
+ lodsb ;AN000;get number of substitutions
+ mov cl,al ;AN000;set up CX as # of subst
+ xor ch,ch ;AN000; SI now points to subst list
+ pop ax ;AN000;get message number back
+ cmp cx,0 ;AN000;Any substitutions?
+ jz READY_TO_PRINT ;AN000;No - continue
+
+;AD061; add dx,Ptr_Seg_Pos ;AN000;Point to position of first segment
+;AD061; push cx ;AN000;save substitution count
+
+;AD061;SET_SUBST:
+;AD061; mov bx,dx ;AN000;get dx into base register
+;AD061; cmp word ptr [bx],0 ;AN000;has segment been set?
+;AD061; jnz SUBST_SEG_SET ;AN000;if not 0, don't replace it
+;AD061; test word ptr [bx+3],date_type ;AN000;if date or time - don't set segment
+;AD061; jnz subst_seg_set ;AN000;yes - skip it
+;AD061; mov word ptr [bx],cs ;AN000;put segment of subst parm in list
+
+;AD061;SUBST_SEG_SET:
+;AD061; add dx,Parm_Block_Size ;AN000;point to position of next segment
+;AD061; loop SET_SUBST ;AN000;keep replacing until complete
+;AD061; pop cx ;AN000;
+
+;AD061;NO_REPLACEMENT:
+;AD061; mov bx,parm_off_pos [si] ;AN000;get subst offset
+;AD061; cmp bx,offset trangroup:string_ptr_2 ;AN000;this is used for double indirection
+;AD061; jnz ready_to_print ;AN000;we already have address
+;AD061; mov dx,string_ptr_2 ;AN000;get address in string_ptr_2
+;AD061; mov parm_off_pos [si],dx ;AN000;put proper address in table
+;AD061; mov string_ptr_2_sb,si ;AN000;save block changed
+
+ mov di,offset trangroup:subst_buffer;AN061; Get address of message subst buffer
+ push di ;AN061; save it
+ push cx ;AN061; save number of subst
+
+MOVE_SUBST:
+ push cx ;AN061;save number of subst
+ mov bx,si ;AN061;save start of sublist
+ mov cx,parm_block_size ;AN061;get size of sublist
+ rep movsb ;AN061;move sublist
+ test byte ptr [bx.$M_S_FLAG],date_type ;AN061;are we doing date/time?
+ jz move_subst_cont ;AN061;no - no need to reset
+ mov word ptr [bx.$M_S_VALUE],0 ;AN061;reset original date or time to 0
+ mov word ptr [bx.$M_S_VALUE+2],0 ;AN061;
+
+MOVE_SUBST_CONT: ;AN061;
+ pop cx ;AN061;get number of subst back
+ loop move_subst ;AN061;move cx sublists
+
+ pop cx ;AN061;get number of subst
+ push ax ;AN061;save message number
+ cmp Msg_Disp_Class,Util_Msg_Class ;AN061;Is this a utility message
+ jz CHECK_FIX ;AN061;YES - go see if substitutions
+ mov msg_flag,ext_msg_class ;AN061;set message flag
+ mov di,offset trangroup:extend_buf_ptr ;AN061; Get address of extended message block
+ xor ax,ax ;AN061;clear ax register
+ stosw ;AN061;clear out message number
+ stosb ;AN061;clear out subst count
+
+CHECK_FIX: ;AN061;
+ pop ax ;AN061;get message number back
+ pop di ;AN061;get start of sublists
+ mov si,di ;AN061;get into SI for msgserv
+ mov bx,si ;AN061;get into BX for addressing
+ push cx ;AN061;save number of subst
+
+SET_SUBST: ;AN061;store the segment of the subst
+ cmp word ptr [bx.$M_S_VALUE+2],0 ;AN061;was it set already?
+ jnz subst_seg_set ;AN061;if not 0, don't replace it
+ test byte ptr [bx.$M_S_FLAG],date_type ;AN061;don't replace if date or time
+ jnz subst_seg_set ;AN061;yes - skip it
+ mov word ptr [bx.$M_S_VALUE+2],cs ;AN061;set segment value
+
+SUBST_SEG_SET: ;AN061;
+ add bx,parm_block_size ;AN061;go to next sublist
+ loop set_subst ;AN061;loop CX times
+ pop cx ;AN061;get number of subst back
+
+ mov bx,si ;AN061;get start of sublist to BX
+ cmp word ptr [bx.$M_S_VALUE],offset trangroup:string_ptr_2 ;AN061;are we using double indirection?
+ jnz ready_to_print ;AN061;no - we already have address
+ mov dx,string_ptr_2 ;AN061;get address in string_ptr_2
+ mov word ptr [bx.$M_S_VALUE],dx ;AN061;put it into the subst block
+
+READY_TO_PRINT:
+ mov bx,Printf_Handle ;AN000;get print handle
+ mov dl,Msg_Cont_Flag ;AN000;set up control flag
+ mov dh,Msg_Disp_Class ;AN000;set up display class
+ mov Msg_Cont_Flag,No_Cont_Flag ;AN061;reset flags to avoid
+ mov Msg_Disp_Class,Util_Msg_Class ;AN061; transient reload
+
+;AD061; push bx ;AN026; save registers
+;AD061; push cx ;AN026;
+;AD061; push dx ;AN026;
+;AD061; push si ;AN026;
+;AD061; push di ;AN026;
+ push ds ;AN026;
+ push es ;AN026;
+
+
+ call SYSDISPMSG ;AN000;call Rod
+
+ pop es ;AN026; restore registers
+ pop ds ;AN026;
+;AD061; pop di ;AN026;
+;AD061; pop si ;AN026;
+;AD061; pop dx ;AN026;
+;AD061; pop cx ;AN026;
+;AD061; pop bx ;AN026;
+
+ jnc Print_success ;AN000; everything went okay
+ mov print_err_flag,ax ;AN000;
+
+print_success:
+;AD061; cmp Msg_Disp_Class,Util_Msg_Class ;AN000;Is this a utility message
+;AD061; jz CHECK_FIX ;AN000;YES - go see if substitutions
+;AD061; mov msg_flag,ext_msg_class ;AN022;set message flag
+;AD061; mov di,offset trangroup:extend_buf_ptr ;AN000; Get address of extended message block
+;AD061; xor ax,ax ;AN000;clear ax register
+;AD061; stosw ;AN000;clear out message number
+;AD061; stosb ;AN000;clear out subst count
+
+;AD061; CHECK_FIX:
+;AD061; pop dx ;AN000;restore dx
+;AD061; cmp cx,0 ;AN000;Any substitutions?
+;AD061; jz NO_FIXUP ;AN000;No - leave
+
+;AD061; mov si,dx ;AN000;Reset changes so transient won't reload
+;AD061; add si,Ptr_Seg_Pos ;AN000;Point to position of first segment
+
+;AD061;FIX_SUBST:
+;AD061; mov word ptr [si],0 ;AN000;reset segment to 0
+;AD061; add si,Parm_Block_Size ;AN000;point to position of next segment
+;AD061; loop FIX_SUBST ;AN000;keep replacing until complete
+;AD061; cmp string_ptr_2_sb,no_subst ;AN000;was double indirection used?
+;AD061; jz no_fixup ;AN000;no - we're finished
+;AD061; mov si,string_ptr_2_sb ;AN000;get offset changed
+;AD061; mov parm_off_pos [si],offset trangroup:string_ptr_2 ;AN000; set address back to string_ptr_2
+
+;AD061;NO_FIXUP:
+;AD061; mov Msg_Cont_Flag,No_Cont_Flag ;AN000;reset flags to avoid
+;AD061; mov Msg_Disp_Class,Util_Msg_Class ;AN000; transient reload
+ pop dx ;AN061;restore dx
+ pop si ;AN000;restore registers
+ pop di ;AN000;
+ pop es ;AN000;restore registers
+ pop cx ;AN000;
+ pop bx ;AN000;
+ pop ax ;AN000;
+ cmp print_err_flag,0 ;AN000; if an error occurred - handle it
+ jnz print_err ;AN000;
+
+ ret ;AC000;
+
+print_err:
+ push cs
+ pop es
+ cmp Printf_Handle,2 ;AN026;Print to STDERR?
+ jnz not_stderr ;AN026;no - continue
+ jmp tcommand ;AN026;Yes - hopless - just exit
+
+not_stderr:
+ mov ax,print_err_flag ;AN026;get extended error number back
+ mov es,[resseg] ; No, set up for error, load the
+assume es:resgroup ; right error msg, and jmp to cerror.
+ test PipeFlag,-1
+ jz go_to_error
+ invoke PipeOff
+ mov dx,offset trangroup:pipeemes_ptr
+ jmp short print_err_exit ;AC000;
+
+go_to_error:
+ mov msg_disp_class,ext_msg_class ;AN000; set up extended error msg class
+ mov dx,offset TranGroup:Extend_Buf_ptr ;AC000; get extended message pointer
+ mov Extend_Buf_ptr,ax ;AN000; get message number in control block
+
+PRINT_ERR_EXIT: ;AC000;
+ push cs
+ pop es
+ JMP CERROR
+
+;****************************************************************
+;*
+;* ROUTINE: TSYSLOADMSG
+;*
+;* FUNCTION: Interface to call SYSLOADMSG to avoid duplicate
+;* names since these routines are also used in the
+;* resident.
+;*
+;* INPUT: Inputs to SYSLOADMSG
+;*
+;* OUTPUT: Outputs from SYSLOADMSG
+;*
+;****************************************************************
+
+
+TSYSLOADMSG PROC NEAR ;AN000;
+
+ push bx ;AN000;
+ call sysloadmsg ;AN000; call routine
+ pop bx ;AN000;
+ ret ;AN000; exit
+
+TSYSLOADMSG ENDP ;AN000;
+
+;****************************************************************
+;*
+;* ROUTINE: TSYSGETMSG
+;*
+;* FUNCTION: Interface to call SYSGETMSG to avoid duplicate
+;* names since these routines are also used in the
+;* resident.
+;*
+;* INPUT: Inputs to SYSGETMSG
+;*
+;* OUTPUT: Outputs from SYSGETMSG
+;*
+;****************************************************************
+
+
+TSYSGETMSG PROC NEAR ;AN000;
+
+ push cx ;AN000;
+ call sysgetmsg ;AN000; call routine
+ pop cx ;AN000;
+ ret ;AN000; exit
+
+TSYSGETMSG ENDP ;AN000;
+
+MSG_SERVICES <COMT,NOVERCHECKmsg,NEARmsg,LOADmsg,NOCHECKSTDIN,NOCHECKSTDOUT,GETmsg> ;AC026; The message services
+MSG_SERVICES <COMT,NEARmsg,SETSTDIO,DISPLAYmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg> ;AC026; The message services
+
+PRINTF_LAST LABEL WORD
+
+include msgdcl.inc
+
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/tranmsg.asm b/private/mvdm/dos/v86/cmd/command/tranmsg.asm
new file mode 100644
index 000000000..aa794342c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tranmsg.asm
@@ -0,0 +1,841 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+include version.inc
+
+;
+; Revision History
+; ================
+;
+; M016 SR 08/09/90 Added 2 error messages for LoadHigh
+;
+;
+
+
+
+;****************************************************
+;* TRANSIENT MESSAGE POINTERS & SUBSTITUTION BLOCKS *
+;****************************************************
+
+msg_disp_class db Util_msg_class
+msg_cont_flag db No_cont_flag
+
+; extended error string output
+;
+Extend_Buf_ptr dw 0 ;AN000;set to no message
+Extend_Buf_sub db 0 ;AN000;set to no substitutions
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+Extend_Buf_off dw OFFSET TranGroup:String_ptr_2 ;AN000;offset of arg
+Extend_Buf_seg dw 0 ;AN000;segment of arg
+ db 0 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Duplicate file name or file not found"
+;
+Renerr_Ptr dw 1002 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid path or file name"
+;
+BadCPMes_Ptr dw 1003 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Insufficient disk space"
+;
+NoSpace_Ptr dw 1004 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Out of environment space"
+;
+EnvErr_Ptr dw 1007 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "File creation error"
+;
+FulDir_Ptr dw 1008 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Batch file missing",13,10
+;
+BadBat_Ptr dw 1009 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Insert disk with batch file",13,10
+;
+NeedBat_Ptr dw 1010 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Bad command or file name",13,10
+;
+BadNam_Ptr dw 1011 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+
+; "Access denied",13,10
+;
+AccDen_Ptr dw 1014 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "File cannot be copied onto itself",13,10
+;
+OverWr_Ptr dw 1015 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Content of destination lost before copy",13,10
+;
+LostErr_Ptr dw 1016 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid filename or file not found",13,10
+;
+InOrNot_Ptr dw 1017 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "%1 File(s) copied",13,10
+;
+Copied_Ptr dw 1018 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Copy_num ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 9 ;AN000;maximum width
+ db 9 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "%1 File(s) "
+;
+DirMes_Ptr dw 1019 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Dir_num ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 9 ;AN000;maximum width
+ db 9 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "%1 bytes free",13,10
+;
+BytMes_Ptr dw 1020 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Bytes_Free ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_DWord ;AN000;long binary to decimal
+ifdef KOREA
+ db 11 ; <MSCH>
+ db 11 ; <MSCH>
+else
+ db 28 ;AN000;maximum width
+ db 28 ;AN000;minimum width
+endif ; KOREA
+ db blank ;AN000;pad character
+
+; "Invalid drive specification",13,10
+;
+BadDrv_Ptr dw 1021 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+
+; "Code page %1 not prepared for system",13,10
+;
+CP_not_set_Ptr dw 1022 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:System_cpage ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 5 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Code page %1 not prepared for all devices",13,10
+;
+CP_not_all_Ptr dw 1023 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:System_cpage ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 5 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Active code page: %1",13,10
+;
+CP_active_Ptr dw 1024 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:System_cpage ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 5 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "NLSFUNC not installed",13,10
+;
+NLSFUNC_Ptr dw 1025 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid code page",13,10
+;
+Inv_Code_Page dw 1026 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Current drive is no longer valid"
+;
+BadCurDrv dw 1027 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Press any key to continue"
+;
+PauseMes_Ptr dw 1028 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Label not found",13,10
+;
+BadLab_Ptr dw 1029 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Syntax error",13,10
+;
+SyntMes_Ptr dw 1030 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid date",13,10
+;
+BadDat_Ptr dw 1031 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Current date is %1 %2",13,10
+;
+CurDat_Ptr dw 1032 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Arg_Buf ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+IFNDEF DBCS ; MSKK03 07/14/89
+ db 1 ;AN000;first subst
+ ELSE
+ IFDEF JAPAN
+ db 2 ;AN000;first subst
+ ELSE
+ db 1 ;AN000;first subst
+ ENDIF
+ENDIF
+ db Char_field_ASCIIZ ;AN000;character string
+IFNDEF DBCS
+ db 3 ;AN000;maximum width
+ db 3 ;AN000;minimum width
+ ELSE
+ IFDEF JAPAN ; MSKK02 07/14/89
+ db 4 ;AN000;maximum width
+ db 4 ;AN000;minimum width
+ ENDIF
+ IFDEF TAIWAN
+ db 6 ;AN000;maximum width
+ db 6 ;AN000;minimum width
+ ENDIF
+ IFDEF KOREA
+ db 2 ;3 Keyl ;AN000;maximum width
+ db 2 ;3 Keyl ;AN000;minimum width
+ ENDIF
+ENDIF
+ db blank ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+CurDat_yr dw 0 ;AN000;year
+CurDat_mo_day dw 0 ;AN000;month,day
+IFNDEF DBCS ; MSKK03 07/14/89
+ db 2 ;AN000;second subst
+ ELSE
+ IFDEF JAPAN
+ db 1 ;AN000;second subst
+ ELSE
+ db 2 ;AN000;second subst
+ ENDIF
+ENDIF
+
+ db DATE_MDY_4 ;AN000;date
+ db 10 ;AN000;maximum width
+ db 10 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+
+; "SunMonTueWedThuFriSat"
+;
+WeekTab dw 1033 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Enter new date (%1):"
+;
+NewDat_Ptr dw 1034 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+NewDat_Format dw 0 ;AN000;offset of replacement
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 8 ;AN000;maximum width
+ db 8 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Invalid time",13,10
+;
+BadTim_Ptr dw 1035 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Current time is %1",13,10
+;
+CurTim_Ptr dw 1036 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+CurTim_hr_min dw 0 ;AN000;hours,minutes
+CurTim_Sec_hn dw 0 ;AN000;seconds,hundredths
+ db 1 ;AN000;first subst
+ db Right_Align+TIME_HHMMSSHH_Cty ;AC059;time
+ db 12 ;AC059;maximum width
+ db 12 ;AC059;minimum width
+ db blank ;AN000;pad character
+
+; "Enter new time:"
+;
+NewTim_Ptr dw 1037 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; ", Delete (Y/N)?",13,10
+;
+Del_Y_N_Ptr dw 1038 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "All files in directory will be deleted!",13,10
+; "Are you sure (Y/N)?",13,10
+;
+SureMes_Ptr dw 1039 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Microsoft DOS Version %1.%2",13,10
+;
+VerMes_Ptr dw 1040 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Major_Ver_Num ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 2 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Minor_Ver_Num ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 2 ;AN000;second subst
+ db Right_Align+Unsgn_Bin_Word ;AN000;binary to decimal
+ db 2 ;AN000;maximum width
+ db 2 ;AN000;minimum width
+ db "0" ;AN000;pad character
+
+; "Volume in drive %1 has no label",13,10
+;
+VolMes_Ptr_2 dw 1041 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:vol_drv ;AN000;offset of drive
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_Char ;AN000;character
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Volume in drive %1 is %2",13,10
+;
+VolMes_Ptr dw 1042 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:vol_drv ;AN000;offset of drive
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db 00000000b ;AN000;character
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:CHARBUF ;AN000;offset of string
+ dw 0 ;AN000;segment of arg
+ db 2 ;AN000;second subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Volume Serial Number is %1-%2",13,10
+;
+VolSerMes_Ptr dw 1043 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:vol_serial+2 ;AN000;offset of serial
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Bin_Hex_Word ;AN000;binary to hex
+ db 4 ;AN000;maximum width
+ db 4 ;AN000;minimum width
+ db "0" ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:vol_serial ;AN000;offset of serial
+ dw 0 ;AN000;segment of arg
+ db 2 ;AN000;second subst
+ db Right_Align+Bin_Hex_Word ;AN000;binary to hex
+ db 4 ;AN000;maximum width
+ db 4 ;AN000;minimum width
+ db "0" ;AN000;pad character
+
+; "Invalid directory",13,10
+;
+BadCD_Ptr dw 1044 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Unable to create directory",13,10
+;
+BadMkD_Ptr dw 1045 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid path, not directory,",13,10
+; "or directory not empty",13,10
+;
+BadRmD_Ptr dw 1046 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Must specify ON or OFF",13,10
+;
+Bad_ON_OFF_Ptr dw 1047 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Directory of %1",13,10
+;
+DirHead_Ptr dw 1048 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:BWDBUF ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "No Path",13,10
+;
+NulPath_Ptr dw 1049 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid drive in search path",13,10
+;
+BadPMes_Ptr dw 1050 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid device",13,10
+;
+BadDev_Ptr dw 1051 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "FOR cannot be nested",13,10
+;
+ForNestMes_Ptr dw 1052 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Intermediate file error during pipe",13,10
+;
+PipeEMes_Ptr dw 1053 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Cannot do binary reads from a device",13,10
+;
+InBDev_Ptr dw 1054 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "BREAK is %1",13,10
+;
+CtrlcMes_Ptr dw 1055 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw 0 ;AN000;offset of on/off (new)
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "VERIFY is %1",13,10
+;
+VeriMes_Ptr dw 1056 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw 0 ;AN000;offset of on/off (new)
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "ECHO is %1",13,10
+;
+EchoMes_Ptr dw 1057 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw 0 ;AN000;offset of on/off (new)
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 1 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "off"
+;
+OffMes_Ptr dw 1059 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "on"
+;
+OnMes_Ptr dw 1060 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Error writing to device",13,10
+;
+DevWMes_Ptr dw 1061 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "Invalid path",13,10
+;
+Inval_Path_Ptr dw 1062 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; unformatted string output
+;
+arg_Buf_Ptr dw 1063 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Arg_Buf ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; file name output
+;
+File_Name_Ptr dw 1064 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:SRCBUF ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; file size output for dir
+;
+Disp_File_Size_Ptr dw 1065 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:File_size_low ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Right_Align+Unsgn_Bin_DWord ;AN000;long binary to decimal
+ db 10 ;AN000;maximum width
+ db 10 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; unformatted string output
+; %s
+String_Buf_Ptr dw 1066 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:String_ptr_2 ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+ db 0 ;AN000;
+
+; tab character
+;
+Tab_ptr dw 1067 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; " <DIR> "
+;
+DMes_Ptr dw 1068 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; destructive back space
+;
+Dback_Ptr dw 1069 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; carriage return / line feed
+;
+ACRLF_Ptr dw 1070 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; output a single character
+;
+;One_Char_Buf_Ptr dw 1071 ;AN000;message number
+; db 1 ;AN000;number of subst
+; db parm_block_size ;AN000;size of sublist
+; db 0 ;AN000;reserved
+; dw OFFSET TranGroup:One_Char_Val ;AN000;offset of charcacter
+; dw 0 ;AN000;segment of arg
+; db 1 ;AN000;first subst
+; db Char_field_Char ;AN000;character
+; db 1 ;AN000;maximum width
+; db 1 ;AN000;minimum width
+; db blank ;AN000;pad character
+
+; "mm-dd-yy"
+;
+USADat_Ptr dw 1072 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "dd-mm-yy"
+;
+EurDat_Ptr dw 1073 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "yy-mm-dd"
+;
+JapDat_Ptr dw 1074 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; date string for prompt
+;
+promptDat_Ptr dw 1075 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:Arg_Buf ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+IFNDEF DBCS ; MSKK03 07/14/89
+ db 1 ;AN000;first subst
+ ELSE
+ IFDEF JAPAN
+ db 2 ;AN000;first subst
+ ELSE
+ db 1 ;AN000;first subst
+ ENDIF
+ENDIF
+
+ db Char_field_ASCIIZ ;AN000;character string
+IFNDEF DBCS
+ db 3 ;AN000;maximum width
+ db 3 ;AN000;minimum width
+ ELSE
+ IFDEF JAPAN ; MSKK02 07/14/89
+ db 4 ;AN000;maximum width
+ db 4 ;AN000;minimum width
+ ENDIF
+ IFDEF TAIWAN
+ db 6 ;AN000;maximum width
+ db 6 ;AN000;minimum width
+ ENDIF
+ IFDEF KOREA
+ db 2 ;3 Keyl ;AN000;maximum width
+ db 2 ;3 Keyl ;AN000;minimum width
+ ENDIF
+ENDIF
+ db blank ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+promptDat_yr dw 0 ;AN000;year
+promptDat_moday dw 0 ;AN000;month,day
+IFNDEF DBCS ; MSKK03 07/14/89
+ db 2 ;AN000;second subst
+ ELSE
+ IFDEF JAPAN
+ db 1 ;AN000;second subst
+ ELSE
+ db 2 ;AN000;second subst
+ ENDIF
+ENDIF
+ db DATE_MDY_4 ;AN000;date
+ db 10 ;AN000;maximum width
+ db 8 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+
+; Time for prompt
+;
+promTim_Ptr dw 1076 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+PromTim_hr_min dw 0 ;AN000;hours,minutes
+PromTim_Sec_hn dw 0 ;AN000;seconds,hundredths
+ db 1 ;AN000;first subst
+ db Right_Align+TIME_HHMMSSHH_24 ;AC013;time
+ db 11 ;AN000;maximum width
+ db 11 ;AC013;minimum width
+ db blank ;AN000;pad character
+
+; Date and time for DIR
+;
+DirDatTim_Ptr dw 1077 ;AN000;message number
+ db 2 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+DirDat_yr dw 0 ;AN000;year
+DirDat_mo_day dw 0 ;AN000;month,day
+ db 1 ;AN000;first subst
+ db Right_Align+DATE_MDY_2 ;AN000;date
+ db 10 ;AN000;maximum width
+ db 8 ;AN000;minimum width
+ db blank ;AN000;pad character
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+DirTim_hr_min dw 0 ;AN000;hours,minutes
+DirTim_Sec_hn dw 0 ;AN000;seconds,hundredths
+ db 2 ;AN000;second subst
+ db Right_align+TIME_HHMM_Cty ;AN000;time
+ db 6 ;AN000;maximum width
+ db 6 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Directory already exists"
+;
+MD_exists_ptr dw 1078 ;AN000;message number
+ db no_subst ;AN000;number of subst
+
+; "%1 bytes",13,10
+;
+Bytes_Ptr dw 1079 ; message number
+ db 1 ; number of subst
+ db parm_block_size ; size of sublist
+ db 0 ; reserved
+ dw OFFSET TranGroup:FileSiz ; offset of arg
+ dw 0 ; segment of arg
+ db 1 ; first subst
+ db Right_Align+Unsgn_Bin_DWord ; long binary to decimal
+ db 10 ; maximum width
+ db 10 ; minimum width
+ db blank ; pad character
+
+; "Total:",13,10
+;
+Total_ptr dw 1080 ; message number
+ db no_subst ; number of subst
+
+; "Error parsing environment variable:",13,10
+;
+ErrParsEnv_ptr dw 1081 ; message number
+ db no_subst ; number of subst
+
+; "(continuing %1)",13,10
+;
+DirCont_Ptr dw 1084 ;AN000;message number
+ db 1 ;AN000;number of subst
+ db parm_block_size ;AN000;size of sublist
+ db 0 ;AN000;reserved
+ dw OFFSET TranGroup:BWDBUF ;AN000;offset of arg
+ dw 0 ;AN000;segment of arg
+ db 1 ;AN000;first subst
+ db Char_field_ASCIIZ ;AN000;character string
+ db 128 ;AN000;maximum width
+ db 0 ;AN000;minimum width
+ db blank ;AN000;pad character
+
+; "Revision %1",CR,LF
+;
+DosRev_Ptr dw 1090
+ db 1 ; one substitution
+ db PARM_BLOCK_SIZE
+ db 0
+ dw offset TRANGROUP:One_Char_Val ; ptr to char
+ dw 0 ; segment addr?
+ db 1 ; 1st substitution
+ db CHAR_FIELD_CHAR ; character
+ db 1 ; max width
+ db 1 ; min width
+ db BLANK ; pad char
+
+; "DOS is in ROM"
+;
+DosRom_Ptr dw 1091
+ db NO_SUBST
+
+; "DOS is in HMA"
+;
+DosHma_Ptr dw 1092
+ db NO_SUBST
+
+; "DOS is in low memory"
+;
+DosLow_Ptr dw 1093
+ db NO_SUBST
+
+; "Cannot Loadhigh batch file" ;M016
+;
+NoExecBat_Ptr dw 1094 ; M016
+ db NO_SUBST ; M016
+
+; "LoadHigh: Invalid filename" ; M016
+;
+LhInvFil_Ptr dw 1095 ; M016
+ db NO_SUBST ; M016
+
+; "Could not open specified country information file" ;M045
+;
+NoCntry_Ptr dw 1096 ;M045
+ db NO_SUBST ;M045
+
+
+PATH_TEXT DB "PATH="
+PROMPT_TEXT DB "PROMPT="
+COMSPECSTR DB "COMSPEC="
+DirEnvVar DB "DIRCMD=" ; DIR's environment variable
+
diff --git a/private/mvdm/dos/v86/cmd/command/tspc.asm b/private/mvdm/dos/v86/cmd/command/tspc.asm
new file mode 100644
index 000000000..d8458afff
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tspc.asm
@@ -0,0 +1,568 @@
+ page ,132
+; SCCSID = @(#)tspc.asm 4.1 85/09/22
+; SCCSID = @(#)tspc.asm 4.1 85/09/22
+TITLE COMMAND Transient Uninitialized DATA
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+comment %
+
+The TRANSPACE segment contains variable data that is considered
+volatile between command cycles, and therefore is not included in the
+transient checksum area. Contents of these variables MUST be
+initialized before use, and must not be relied upon from command
+cycle to command cycle.
+
+No constant data values should be stored here.
+
+%
+
+
+
+
+.xlist
+.xcref
+ include comsw.asm
+ include dossym.inc
+ include find.inc
+ include intnat.inc
+ include comequ.asm
+ include comseg.asm
+.list
+.cref
+
+; Uninitialized transient data
+TRANSPACE SEGMENT PUBLIC BYTE
+
+ PUBLIC ALLSWITCH
+ PUBLIC append_exec ;AN041;
+ PUBLIC arg
+ PUBLIC argbufptr
+ PUBLIC ARGC
+ PUBLIC ARG1S
+ PUBLIC ARG2S
+ PUBLIC ARGTS
+ PUBLIC arg_buf
+ PUBLIC ASCII
+ PUBLIC AttrSelect
+ PUBLIC AttrSpecified
+ PUBLIC BatBuf
+ PUBLIC BatBufEnd
+ PUBLIC BatBufPos
+ PUBLIC BATHAND
+ PUBLIC BINARY
+ PUBLIC BITS
+ PUBLIC BWDBUF
+ PUBLIC BYTCNT
+ PUBLIC bytes_free
+ PUBLIC CFLAG
+ PUBLIC CHARBUF
+ PUBLIC CHKDRV
+ PUBLIC COM
+ PUBLIC COMBUF
+ PUBLIC comma
+ PUBLIC comptr
+ PUBLIC COMSW
+ PUBLIC CONCAT
+ PUBLIC copy_Num
+ PUBLIC CountryPtrInfo
+ PUBLIC CountryPtrId
+ PUBLIC CountryPtr
+ PUBLIC CPDATE
+ PUBLIC CPTIME
+ PUBLIC cpyflag
+ PUBLIC CURDRV
+ PUBLIC DATE_DAY ;AN000;
+ PUBLIC DATE_MONTH ;AN000;
+ PUBLIC DATE_OUTPUT ;AN000;
+ PUBLIC DATE_TYPE ;AN000;
+ PUBLIC DATE_YEAR ;AN000;
+ PUBLIC DEST
+ PUBLIC DESTBUF
+ PUBLIC DestClosed
+ PUBLIC DESTDIR
+ PUBLIC DESTFCB
+ PUBLIC DESTFCB2
+ PUBLIC DESTHAND
+ PUBLIC DESTINFO
+ PUBLIC DESTISDEV
+ PUBLIC DESTISDIR
+ PUBLIC DESTNAME
+ PUBLIC DESTSIZ
+ PUBLIC DESTSWITCH
+ PUBLIC DESTTAIL
+ PUBLIC DESTVARS
+ PUBLIC DIRBUF
+ PUBLIC DIRCHAR
+ PUBLIC dirflag ;AN015;
+ PUBLIC Dir_Num
+ PUBLIC display_ioctl ;AN000;
+ PUBLIC display_mode ;AN000;
+ PUBLIC display_width ;AN000;
+ PUBLIC DRIVE_NUMBER ;AN000;
+ PUBLIC DRIVE_OUTPUT ;AN000;
+ PUBLIC DRIVE_TYPE ;AN000;
+ PUBLIC DRIVE_VALUE ;AN000;
+ PUBLIC ELCNT
+ PUBLIC ELPOS
+ PUBLIC ENDDESTBUF
+ PUBLIC EXECPATH
+ PUBLIC EXEC_ADDR
+ PUBLIC EXEFCB
+ PUBLIC expand_star
+ PUBLIC ext_entered ;AN005;
+ PUBLIC FBUF
+ PUBLIC FileCnt
+ PUBLIC FileCntTotal
+ PUBLIC FileSiz
+ PUBLIC FileSizTotal
+ PUBLIC file_size_high
+ PUBLIC file_size_low
+ PUBLIC FILTYP
+ PUBLIC FIRSTDEST
+ PUBLIC FRSTSRCH
+ PUBLIC GOTOLEN
+ PUBLIC HEADCALL
+ PUBLIC ID
+ PUBLIC IDLEN
+ PUBLIC IFNOTFLAG
+ PUBLIC if_not_count
+ PUBLIC INEXACT
+ PUBLIC INTERNATVARS
+ PUBLIC KPARSE
+ PUBLIC last_arg
+ PUBLIC PerLine
+ PUBLIC LeftOnLine
+ PUBLIC LeftOnPage
+ PUBLIC linperpag ;AN000;
+ PUBLIC major_ver_num
+ PUBLIC MELCOPY
+ PUBLIC MELSTART
+ PUBLIC minor_ver_num
+ PUBLIC msg_flag ;AN022;
+ PUBLIC msg_numb ;AN022;
+ PUBLIC NOWRITE
+ PUBLIC NXTADD
+ PUBLIC objcnt
+ PUBLIC OCtrlZ
+ PUBLIC OFilePtr_Hi
+ PUBLIC OFilePtr_Lo
+ PUBLIC OldCtrlCHandler
+ PUBLIC one_char_val
+ PUBLIC PARM1
+ PUBLIC PARM2
+ PUBLIC parse_last ;AN018;
+ PUBLIC PARSE1_ADDR ;AN000;
+ PUBLIC PARSE1_CODE ;AN000;
+ PUBLIC PARSE1_OUTPUT ;AN000;
+ PUBLIC PARSE1_SYN ;AN000;
+ PUBLIC PARSE1_TYPE ;AN000;
+ PUBLIC PATHCNT
+ PUBLIC pathinfo
+ PUBLIC PATHPOS
+ PUBLIC PATHSW
+ PUBLIC PLUS
+ PUBLIC plus_comma
+ PUBLIC print_err_flag ;AN000;
+ PUBLIC psep_char
+ PUBLIC RCH_ADDR
+ PUBLIC RDEOF
+ PUBLIC RE_INSTR
+ PUBLIC RESSEG
+ PUBLIC SCANBUF
+ PUBLIC SDIRBUF
+ PUBLIC search_best
+ PUBLIC search_best_buf
+ PUBLIC search_curdir_buf
+ PUBLIC search_error
+ PUBLIC SKPDEL
+ PUBLIC SOURCE
+ PUBLIC SPECDRV
+ PUBLIC SRCBUF
+ PUBLIC SRCHAND
+ PUBLIC SRCINFO
+ PUBLIC SRCISDEV
+ PUBLIC SRCISDIR
+ PUBLIC SRCPT
+ PUBLIC SRCSIZ
+ PUBLIC SRCTAIL
+ PUBLIC SRCVARS
+ PUBLIC srcxname
+ PUBLIC STACK
+ PUBLIC STARTEL
+ PUBLIC string_ptr_2
+;AD061; PUBLIC string_ptr_2_sb ;AN000;
+ PUBLIC subst_buffer ;AN061;
+ PUBLIC SWITCHAR
+ PUBLIC system_cpage
+ PUBLIC TERMREAD
+ PUBLIC TIME_FRACTION ;AN000;
+ PUBLIC TIME_HOUR ;AN000;
+ PUBLIC TIME_MINUTES ;AN000;
+ PUBLIC TIME_OUTPUT ;AN000;
+ PUBLIC TIME_SECONDS ;AN000;
+ PUBLIC TIME_TYPE ;AN000;
+ PUBLIC TPA
+ PUBLIC tpbuf
+ PUBLIC TRANSPACEEND
+ PUBLIC TRAN_TPA
+ PUBLIC trgxname
+ PUBLIC UCOMBUF
+ PUBLIC USERDIR1
+ PUBLIC vol_drv
+ PUBLIC vol_ioctl_buf ;AC030;
+ PUBLIC vol_serial ;AC030;
+ PUBLIC vol_label ;AC030;
+ PUBLIC WRITTEN
+ PUBLIC zflag
+ PUBLIC ENV_PTR_SEG
+ PUBLIC ENV_SIZE
+ PUBLIC CMD_PTR_SEG
+ PUBLIC CMD_PTR_OFF
+ PUBLIC CMD_SIZE
+ PUBLIC SCS_EXIT_CODE
+ PUBLIC SCS_CUR_DRIVE
+ PUBLIC SCS_NUM_DRIVES
+ PUBLIC SCS_STD_HANDLE
+ PUBLIC SCS_STD_BITS
+ PUBLIC SCS_CODEPAGE
+ PUBLIC SCS_TSREXIT
+ PUBLIC SCS_BATSTATUS
+ PUBLIC SCS_RDRINFO
+ PUBLIC EXECPATH_SEG
+ PUBLIC EXECPATH_OFF
+ PUBLIC EXECPATH_SIZE
+ PUBLIC EXECEXT_TYPE
+
+ Public TypeFilSiz ;stores size of file to be typed
+
+ IF IBM
+ PUBLIC ROM_CALL
+ PUBLIC ROM_CS
+ PUBLIC ROM_IP
+ ENDIF
+
+
+ ORG 0
+ZERO = $
+SRCXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
+TRGXNAME DB DIRSTRLEN + 20 DUP (?) ;g buffer for name translate
+JUNK1 DB 2(?)
+FOO_JUNK DB 2 (?)
+UCOMBUF DB COMBUFLEN+3 DUP(?) ; Raw console buffer
+COMBUF DB COMBUFLEN+3 DUP(?) ; Cooked console buffer
+USERDIR1 DB DIRSTRLEN+3 DUP(?) ; Storage for users current directory
+;EXECPATH DB COMBUFLEN+3 DUP(?) ; Path for external command
+EXECPATH DB EXECPATHLEN DUP(?) ; ntvdm MAX_PATH+13 extended
+RE_INSTR DB DIRSTRLEN+3+13 DUP (?) ; path for input to redirection
+
+
+; sudeepb - start of cmdinfo structure (it should always match cmdsvc.h
+; definition of cmdinfo.
+
+ENV_PTR_SEG DW ?
+ENV_SIZE DW ?
+SCS_CUR_DRIVE DW ?
+SCS_NUM_DRIVES DW ?
+CMD_PTR_SEG DW ?
+CMD_PTR_OFF DW ?
+CMD_SIZE DW ?
+SCS_EXIT_CODE DW ?
+SCS_STD_HANDLE DW 0
+SCS_RDRINFO DD 0
+SCS_CODEPAGE DW ?
+SCS_TSREXIT DW 0
+SCS_BATSTATUS DW 0
+EXECPATH_SEG DW 0
+EXECPATH_OFF DW 0
+EXECPATH_SIZE DW 0
+EXECEXT_TYPE DW 0
+
+; end of cmdinfo
+
+SCS_STD_BITS DB 0
+
+; Variables passed up from resident
+HEADCALL LABEL DWORD
+ DW ?
+RESSEG DW ?
+TPA DW ?
+SWITCHAR DB ?
+DIRCHAR DB ?
+EXEC_ADDR DD ?
+RCH_ADDR DD ?
+fTest DW ?
+TRAN_TPA DW ?
+
+CHKDRV DB ?
+RDEOF LABEL BYTE ; Misc flags
+IFNOTFLAG LABEL BYTE
+FILTYP DB ?
+CURDRV DB ?
+CONCAT LABEL BYTE
+PARM1 DB ?
+ARGC LABEL BYTE
+PARM2 DB ?
+COMSW DW ? ; Switches between command and 1st arg
+ARG1S DW ? ; Switches between 1st and 2nd arg
+DESTSWITCH LABEL WORD
+ARG2S DW ? ; Switches after 2nd arg
+ALLSWITCH LABEL WORD
+ARGTS DW ? ; ALL switches except for COMSW
+CFLAG DB ?
+DESTCLOSED LABEL BYTE
+SPECDRV DB ?
+BYTCNT DW ? ; Size of buffer between RES and TRANS
+NXTADD DW ?
+FRSTSRCH DB ?
+LeftOnLine DB ? ; entries left on line u.b. DIR
+PerLine DB ? ; entries/line u.b. DIR
+LeftOnPage DW ? ; lines left on page u.b. DIR
+FileCnt DW ? ; file count u.b. DIR
+FileSiz DD ? ; file size u.b. DIR
+
+; Note: keep FileCntTotal & FileSizTotal adjacent.
+
+FileCntTotal DD ? ; total file count u.b. DIR
+FileSizTotal DD ? ; total file size u.b. DIR
+CHARBUF DB 80 DUP (?) ;line byte character buffer for xenix write
+DESTFCB2 LABEL BYTE
+IDLEN DB ?
+ID DB 8 DUP(?)
+COM DB 3 DUP(?)
+DEST DB 37 DUP(?)
+DESTNAME DB 11 DUP(?)
+DESTFCB LABEL BYTE
+DESTDIR DB DIRSTRLEN DUP(?) ; Directory for PATH searches
+GOTOLEN LABEL WORD
+BWDBUF LABEL BYTE
+EXEFCB LABEL WORD
+DIRBUF DB DIRSTRLEN+3 DUP(?)
+SDIRBUF DB 12 DUP(?)
+BITS DW ?
+PATHCNT DW ?
+PATHPOS DW ?
+PATHSW DW ?
+AttrSpecified db ? ; attribute bits u.b. DIR
+AttrSelect db ? ; attribute bits u.b. DIR
+comma db 0 ;g flag set if +,, occurs
+plus_comma db 0 ;g flag set if +,, occurs
+dirflag db 0 ;AN015; set when pathcrunch called from DIR
+parse_last dw 0 ;AN018; used to hold parsing position
+
+system_cpage DW 0 ;AC001; used for CHCP variable
+
+
+
+arg_buf db 128 dup (?)
+file_size_low dw ? ;AC000;
+file_size_high dw ? ;AC000;
+string_ptr_2 dw ?
+;AD061;string_ptr_2_sb dw ?
+copy_Num dw ?
+cpyflag db ?
+Dir_Num DW ?
+bytes_free dw ?
+ dw ?
+major_ver_num dw ?
+minor_ver_num dw ?
+one_char_val db ?,0
+vol_drv db ?
+
+IF IBM
+ROM_CALL DB ? ; flag for rom function
+ROM_IP DW ?
+ROM_CS DW ?
+ENDIF
+
+DESTVARS LABEL BYTE
+DESTISDIR DB ?
+DESTSIZ DB ?
+DESTTAIL DW ?
+DESTINFO DB ?
+DESTBUF DB DIRSTRLEN + 20 DUP (?)
+ENDDESTBUF LABEL BYTE
+
+DESTHAND DW ?
+DESTISDEV DB ?
+FIRSTDEST DB ?
+MELCOPY DB ?
+MELSTART DW ?
+
+SRCVARS LABEL BYTE
+SRCISDIR DB ?
+SRCSIZ DB ?
+SRCTAIL DW ?
+SRCINFO DB ?
+SRCBUF DB DIRSTRLEN + 20 DUP (?)
+
+SRCHAND DW ?
+SRCISDEV DB ?
+
+SCANBUF DB DIRSTRLEN + 20 DUP (?)
+
+SRCPT DW ?
+INEXACT DB ?
+NOWRITE DB ?
+BINARY DB ?
+WRITTEN DW ?
+TERMREAD DB ?
+ASCII DB ?
+PLUS DB ?
+objcnt db ? ; Used in copy
+CPDATE DW ?
+CPTIME DW ?
+
+OFilePtr_Lo DW ? ; original file ptr for COPY when
+OFilePtr_Hi DW ? ; 1st source is also destination
+OCtrlZ DB ? ; original ctrl+Z for COPY when ditto
+
+BATHAND DW ? ; Batch handle
+STARTEL DW ?
+ELCNT DB ?
+ELPOS DB ?
+SKPDEL DB ?
+SOURCE DB 11 DUP(?)
+
+ext_entered db 0 ;AN005;
+
+display_ioctl db 0 ;AN000; info level
+ db 0 ;AN000; reserved
+ dw crt_ioctl_ln ;AN000; length of data
+ dw ? ;AN000; control flags
+display_mode db ? ;AN000; display mode, colors
+ db 0 ;AN000; reserved
+ dw ? ;AN023; colors
+ dw ? ;AN000; display width (PELS)
+ dw ? ;AN000; display length (PELS)
+display_width dw ? ;AN000; display width
+linperpag dw linesperpage ;AN000; display length (default to linesperpage)
+
+vol_ioctl_buf label byte ;AN000; buffer for ioctl volume label/serial call
+ dw 0 ;AN000; info level
+vol_serial dd 0 ;AN000; volume serial number
+vol_label db 11 dup (" ") ;AN000; volume label - init to blanks
+ db 8 dup (" ") ;AN000; file system type
+
+expand_star db ?
+msg_flag db ? ;AN022; flag set if non-utility message issued
+msg_numb dw 0 ;AN022; set with extended error message issued
+append_exec db 0 ;AN041; set if internal append executed
+print_err_flag dw 0 ;AN000; flag set if error during sysdispmsg
+subst_buffer db parm_block_size*2 dup (0);AN061;
+
+;;;; IFDEF DBCS 3/3/KK
+KPARSE DB ?
+;;;; ENDIF 3/3/KK
+
+; Data declarations taken out of parse.asm
+
+arg arg_unit <> ; pointers, arg count, string buffer
+argbufptr DW ? ; index for argv[].argpointer
+tpbuf DB 128 DUP (?) ; temporary buffer
+LAST_ARG DW ? ; point at which to accumulate switch info
+comptr dw ? ; ptr into combuf
+
+; Data declarations taken out of path.asm
+fbuf find_buf <> ; dma buffer for findfirst/findnext
+pathinfo DW 3 DUP (?) ; ES, SI(old), and SI(new) of user path
+psep_char DB ? ; '/' or '\'
+search_best DB (?) ; best code, best filename so far
+fname_max_len equ 13
+search_best_buf DB fname_max_len DUP (?)
+search_curdir_buf DB 64 DUP (?) ; a place for CurDir info, if successful
+search_error DW (?) ; address of error message to be printed
+
+; Data declarations taken out of tbatch.asm
+if_not_count DW ?
+
+zflag db ? ; Used by typefil to indicate ^Z's
+
+ DW 80H DUP(0) ; Init to 0 to make sure the linker is not fooled
+STACK LABEL WORD
+
+INTERNATVARS internat_block <>
+ DB (internat_block_max - ($ - INTERNATVARS)) DUP (?)
+
+; Buffer for DOS function 64h (Get extended country information)
+; subfunctions 2, 4, 6, or 7:
+
+CountryPtrInfo label byte
+CountryPtrId db ?
+CountryPtr dd ?
+ .erre (($ - CountryPtrInfo) GE 5)
+
+OldCtrlCHandler dd ? ; previous int 23 vector
+
+
+BatBufPos DW ? ; integer position in buffer of next byte
+BatBuf DB BatLen DUP (?)
+BatBufEnd DW ?
+
+TypeFilSiz dd ? ;stores size of file to be typed
+
+; *****************************************************
+; EMG 4.00
+; DATA STARTING HERE WAS ADDED BY EMG FOR 4.00
+; FOR IMPLEMENTATION OF COMMON PARSE ROUTINE
+; *****************************************************
+;
+; COMMON PARSE OUTPUT BLOCKS
+;
+
+
+;
+; Common output blocks for PARSE number, complex, or string values.
+;
+
+PARSE1_OUTPUT LABEL BYTE ;AN000;
+PARSE1_TYPE DB 0 ;AN000; type
+PARSE1_CODE DB 0 ;AN000; return value
+PARSE1_SYN DW 0 ;AN000; es offset of synonym
+PARSE1_ADDR DD 0 ;AN000; numeric value / address
+ ; of string value
+
+;
+; Common output block for PARSE date strings.
+;
+
+DATE_OUTPUT LABEL BYTE ;AN000;
+DATE_TYPE DB 0 ;AN000; type
+ DB 0 ;AN000; return value
+ DW 0 ;AN000; es offset of synonym
+DATE_YEAR DW 0 ;AN000; year
+DATE_MONTH DB 0 ;AN000; month
+DATE_DAY DB 0 ;AN000; day
+
+;
+; Common output block for PARSE time strings.
+;
+
+TIME_OUTPUT LABEL BYTE ;AN000;
+TIME_TYPE DB 0 ;AN000; type
+ DB 0 ;AN000; return value
+ DW 0 ;AN000; es offset of synonym
+TIME_HOUR DB 0 ;AN000; hour
+TIME_MINUTES DB 0 ;AN000; minutes
+TIME_SECONDS DB 0 ;AN000; seconds
+TIME_FRACTION DB 0 ;AN000; hundredths
+
+;
+; Common output block for PARSE drive specifier (one based drive number).
+;
+
+DRIVE_OUTPUT LABEL BYTE ;AN000;
+DRIVE_TYPE DB 0 ;AN000; type
+DRIVE_VALUE DB 0 ;AN000; return value
+ DW 0 ;AN000; es offset of synonym
+DRIVE_NUMBER DB 0 ;AN000; drive number
+ DB 0,0,0 ;AN000; reserved
+
+TRANSPACEEND LABEL BYTE
+
+TRANSPACE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/command/tucode.asm b/private/mvdm/dos/v86/cmd/command/tucode.asm
new file mode 100644
index 000000000..eaeb1640d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/tucode.asm
@@ -0,0 +1,590 @@
+ page ,132
+; SCCSID = @(#)tucode.asm 4.2 85/05/31
+; SCCSID = @(#)tucode.asm 4.2 85/05/31
+Title COMMAND Language midifiable Code Transient
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+.xlist
+.xcref
+ include dossym.inc
+ include syscall.inc
+ include comsw.asm
+ include comseg.asm
+ include comequ.asm
+.list
+.cref
+
+
+DATARES SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN ECHOFLAG:BYTE
+DATARES ENDS
+
+TRANDATA SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN BAD_ON_OFF_ptr:word
+ EXTRN ctrlcmes_ptr:word
+ EXTRN DEL_Y_N_PTR:WORD
+ EXTRN ECHOMES_ptr:word
+ EXTRN extend_buf_ptr:word ;AC000;
+ EXTRN offmes_ptr:word
+ EXTRN onmes_ptr:word
+ EXTRN PARSE_BREAK:BYTE ;AN000;
+ EXTRN promptdat_moday:word ;AC000;
+ EXTRN promptdat_ptr:word ;AC000;
+ EXTRN promptdat_yr:word ;AC000;
+ EXTRN string_buf_ptr:word
+ EXTRN SUREMES_ptr:word
+ EXTRN VERIMES_ptr:BYTE
+ EXTRN WeekTab:word
+TRANDATA ENDS
+
+TRANSPACE SEGMENT PUBLIC BYTE ;AC000;
+ EXTRN arg_buf:byte
+ EXTRN BWDBUF:BYTE
+ EXTRN DEST:BYTE
+ EXTRN destdir:byte
+ EXTRN dirchar:byte
+ EXTRN PARSE1_CODE:BYTE ;AN000;
+ EXTRN RESSEG:WORD
+ EXTRN string_ptr_2:word
+
+TRANSPACE ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE
+
+ EXTRN CERROR:NEAR
+ EXTRN CRLF2:NEAR
+ EXTRN extend_setup:near ;AN022;
+
+ PUBLIC CNTRLC
+ PUBLIC ECHO
+ PUBLIC GetDate
+ PUBLIC NOTEST2
+ PUBLIC PRINT_DATE
+ PUBLIC SLASHP_ERASE ;AN000;
+ PUBLIC VERIFY
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:TRANGROUP,SS:NOTHING
+
+; ****************************************************************
+; *
+; * ROUTINE: NOTEST2 - execution of DEL/ERASE command
+; *
+; * FUNCTION: Delete files based on user parsed input. Prompt
+; * user for Y/N if necessary. If an error occurs,
+; * set up an error message and go to CERROR.
+; *
+; * INPUT: FCB at 5ch set up with filename(s) entered
+; * Current directory set to entered directory
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+;
+; ARE YOU SURE prompt when deleting *.*
+
+NOTEST2:
+ MOV CX,11
+ MOV SI,FCB+1
+
+AMBSPEC:
+ LODSB
+ CMP AL,'?'
+ JNZ ALLFIL
+ LOOP AMBSPEC
+
+ALLFIL:
+ CMP CX,0
+ JNZ NOPRMPT
+
+ASKAGN:
+ MOV DX,OFFSET TRANGROUP:SUREMES_ptr ; "Are you sure (Y/N)?"
+ invoke std_printf
+ MOV SI,80H
+ MOV DX,SI
+ MOV WORD PTR [SI],120 ; zero length
+ MOV AX,(STD_CON_INPUT_FLUSH SHL 8) OR STD_CON_STRING_INPUT
+ INT 21H
+ LODSW
+ OR AH,AH
+ JZ ASKAGN
+ INVOKE SCANOFF
+ call char_in_xlat ;G Convert to upper case
+ retc ;AN000; return if function not supported
+ CMP AL,CAPITAL_N ;G
+ retz
+ CMP AL,CAPITAL_Y ;G
+ PUSHF
+ CALL CRLF2
+ POPF
+ JNZ ASKAGN
+
+NOPRMPT:
+ MOV AH,FCB_DELETE
+ MOV DX,FCB
+ INT 21H
+ INC AL
+ jz eraerr
+ invoke RESTUDIR
+ ret ; If no error, return
+
+eraerr:
+ invoke set_ext_error_msg ;AN022; set up the extended error
+ push dx ;AN022; save message
+ invoke RESTUDIR
+ pop dx ;AN022; restore message
+
+ cmp word ptr extend_buf_ptr,error_no_more_files ;AN022; convert no more files to
+ jnz cerrorj2 ;AN022; file not found
+ mov Extend_Buf_ptr,error_file_not_found ;AN000; get message number in control block
+
+cerrorj2:
+ jmp cerror
+
+
+; ****************************************************************
+; *
+; * ROUTINE: SLASHP_ERASE - execution of DEL/ERASE /P
+; *
+; * FUNCTION: Delete files based on user parsed input. Prompt
+; * user for Y/N where necessary. If an error occurs
+; * set up and error message and transfer control
+; * to CERROR.
+; *
+; * INPUT: FCB at 5ch set up with filename(s) entered
+; * Current directory set to entered directory
+; *
+; * OUTPUT: none
+; *
+; ****************************************************************
+
+ASSUME CS:TRANGROUP,DS:TRANGROUP,ES:TRANGROUP,SS:NOTHING
+
+SLASHP_ERASE: ;AN000; entry point
+ invoke build_dir_string ;AN000; set up current directory string for output
+ mov ah,Set_DMA ;AN000; issue set dta int 21h
+ mov dx,offset trangroup:destdir ;AN000; use Destdir for target
+ int 21H ;AN000;
+ mov ah,Dir_Search_First ;AN000; do dir search first int 21h
+ mov dx,FCB ;AN000; use FCB at 5Ch for target
+ int 21H ;AN000;
+ inc al ;AN000; did an error occur
+ jz eraerr ;AN022; go to error exit
+
+delete_prompt_loop: ;AN000;
+ mov si,offset trangroup:destdir+1 ;AN000; set up FCB as source
+ mov di,offset trangroup:dest ;AN000; set up dest as target
+ mov al,dirchar ;AN000; store a "\" in the first char
+ stosb ;AN000; of DEST
+ invoke fcb_to_ascz ;AN000; convert filename from FCB to ASCIIZ string
+
+slashp_askagn: ;AN000;
+ call crlf2 ;AN000; print out carriage return, line feed
+ mov dx,offset trangroup:bwdbuf ;AN000; print out current directory string
+ mov bx,dx ;AN000; get string pointer in bx
+ cmp byte ptr [bx+3],end_of_line_out ;AN000; see if only D:\,0
+ jnz not_del_root ;AN000; no continue
+ mov byte ptr [bx+2],end_of_line_out ;AN000; yes, get rid of \
+
+Not_del_root: ;AN000;
+ mov string_ptr_2,dx ;AN000;
+ mov dx,offset trangroup:string_buf_ptr ;AN000;
+ invoke std_printf ;AN000;
+ mov dx,offset trangroup:dest ;AN000; print out file name string
+ mov string_ptr_2,dx ;AN000;
+ mov dx,offset trangroup:string_buf_ptr ;AN000;
+ invoke std_printf ;AN000;
+ mov dx,offset trangroup:Del_Y_N_Ptr ;AN000; issue ", Delete (Y/N)?" message
+ invoke std_printf ;AN000;
+;;M029 mov si,80H ;AN000; set up buffer for input
+;;M029 mov dx,si ;AN000;
+;;M029 mov word ptr [si],combuflen ;AN000;
+;;M029 mov ax,(std_con_input_flush shl 8) or std_con_string_input ;AN000;
+;;M029 int 21h ;AN000; get input from the user
+;;M029 lodsw ;AN000;
+;;M029 or ah,ah ;AN000; was a character entered?
+;;M029 jz slashp_askagn ;AN000; no - ask again
+;;M029 invoke scanoff ;AN000; scan off leading delimiters
+
+; Get a single character input.
+
+ mov ax,(std_con_input_flush shl 8) or std_con_input ;M029
+ int 21h ;M029
+
+ call char_in_xlat ;AN000; yes - upper case it
+ retc ;AN000; return if function not supported
+ cmp al,capital_n ;AN000; was it no?
+ jz next_del_file ;AN000; yes - don't delete file
+ cmp al,capital_y ;AN000; was it yes?
+ jz delete_this_file ;AN000; yes - delete the file
+ jmp short slashp_askagn ;AN000; it was neither - ask again
+
+delete_this_file: ;AN000;
+ mov ah,fcb_delete ;AN000; delete the file
+ mov dx,offset trangroup:destdir ;AN000; use Destdir for target
+ int 21h ;AN000;
+ inc al ;AN000; did an error occur?
+ jnz next_del_file ;AN000; no - get next file
+;
+;M041; Begin changes
+; We got an error deleting the file. If this is access denied, we can go on
+;to the next file after printing an error message.
+;
+ invoke Get_ext_error_number ;see what error we got
+ cmp ax,error_access_denied ;is it access denied?
+ jne stop_del ;no, some other error
+ invoke CrLf2 ;print a CR-LF
+ invoke set_ext_error_msg ;error message
+ invoke std_eprintf ;"Access denied"
+ jmp short next_del_file ;try next file
+stop_del:
+;
+;M041; End changes
+;
+ jmp eraerr ;AN022; go to error exit - need long jmp
+
+next_del_file: ;AN000;
+;
+; M050 - begin
+; Norton Utilities 5.0 has a bug. DiskMon when invoked
+; with /protect+ and /light+ makes it intercept all
+; deletes. This hook does not save and restore the DTA correctly.
+; They save the DWORD in a WORD by mistake! They save both the
+; segment and the offset in the SAME variable (WORD)!!!
+;
+ mov ah,Set_DMA
+ mov dx,offset trangroup:destdir
+ int 21H
+;
+; M050 - end
+
+ mov ah,dir_search_next ;AN000; search for another file
+ mov dx,FCB ;AN000;
+ int 21h ;AN000;
+ inc al ;AN000; was a file found?
+ jz slash_p_exit ;AN000; no - exit
+ jmp delete_prompt_loop ;AN000; yes - continue (need long jump)
+
+slash_p_exit:
+ invoke get_ext_error_number ;AN022; get the extended error number
+ cmp ax,error_no_more_files ;AN022; was error file not found?
+ jz good_erase_exit ;AN022; yes - clean exit
+ jmp extend_setup ;AN022; go issue error message
+
+good_erase_exit:
+ invoke restudir ;AN000; we're finished - restore user's dir
+ call crlf2 ;AN000; print out carriage return, line feed
+ ret ;AN000; exit
+
+
+;************************************************
+; ECHO, BREAK, and VERIFY commands. Check for "ON" and "OFF"
+
+ break Echo
+
+assume ds:trangroup,es:trangroup
+
+ECHO:
+ CALL ON_OFF
+ JC DOEMES
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ JNZ ECH_OFF
+ OR [ECHOFLAG],1
+ RET
+ECH_OFF:
+ AND [ECHOFLAG],NOT 1
+ RET
+
+
+CERRORJ:
+ JMP CERROR
+
+;
+; There was no discrenable ON or OFF after the ECHO. If there is nothing but
+; delimiters on the command line, we issue the ECHO is ON/OFF message.
+;
+
+ASSUME DS:TRANGROUP
+
+DOEMES:
+ cmp cl,0 ;AC000; was anything on the line?
+ jz PEcho ; just display current state.
+ MOV DX,82H ; Skip one char after "ECHO"
+ invoke CRPRINT
+ JMP CRLF2
+
+PECHO:
+ MOV DS,[RESSEG]
+ASSUME DS:RESGROUP
+ MOV BL,[ECHOFLAG]
+ PUSH CS
+ POP DS
+ASSUME DS:TRANGROUP
+ AND BL,1
+ MOV DX,OFFSET TRANGROUP:ECHOMES_ptr
+ JMP SHORT PYN
+
+ break Break
+assume ds:trangroup,es:trangroup
+
+CNTRLC:
+ CALL ON_OFF
+ MOV AX,(SET_CTRL_C_TRAPPING SHL 8) OR 1
+ JC PCNTRLC
+ JNZ CNTRLC_OFF
+ MOV DL,1
+ INT 21H ; Set ^C
+ RET
+
+CNTRLC_OFF:
+ XOR DL,DL
+ INT 21H ; Turn off ^C check
+ RET
+
+PCNTRLC:
+ CMP CL,0 ;AC000; rest of line blank?
+ JNZ CERRORJ ; no, oops!
+
+pccont:
+ XOR AL,AL
+ INT 21H
+ MOV BL,DL
+ MOV DX,OFFSET TRANGROUP:CTRLCMES_ptr
+
+PYN:
+ mov si,offset trangroup:onmes_ptr ;AC000; get ON pointer
+ OR BL,BL
+ JNZ PRINTVAL
+ mov si,offset trangroup:offmes_ptr ;AC000; get OFF pointer
+
+PRINTVAL:
+ push dx ;AN000; save offset of message block
+ mov bx,dx ;AN000; save offset value
+ lodsw ;AN000; get message number of on or off
+ mov dh,util_msg_class ;AN000; this is a utility message
+ invoke Tsysgetmsg ;AN000; get the address of the message
+ add bx,ptr_off_pos ;AN000; point to offset of ON/OFF
+ mov word ptr [bx],si ;AN000; put the offset in the message block
+ pop dx ;AN000; get message back
+ invoke std_printf ;AC000; go print message
+ mov word ptr [bx],0 ;AN000; zero out message pointer
+
+ ret ;AN000; exit
+
+ break Verify
+assume ds:trangroup,es:trangroup
+
+VERIFY:
+ CALL ON_OFF
+ MOV AX,(SET_VERIFY_ON_WRITE SHL 8) OR 1
+ JC PVERIFY
+ JNZ VER_OFF
+ INT 21H ; Set verify
+ RET
+
+VER_OFF:
+ DEC AL
+ INT 21H ; Turn off verify after write
+ RET
+
+PVERIFY:
+ CMP CL,0 ;AC000; is rest of line blank?
+ JNZ CERRORJ ; nope...
+ MOV AH,GET_VERIFY_ON_WRITE
+ INT 21H
+ MOV BL,AL
+ MOV DX,OFFSET TRANGROUP:VERIMES_ptr
+ JMP PYN
+
+; ****************************************************************
+; *
+; * ROUTINE: ON_OFF
+; *
+; * FUNCTION: Parse the command line for an optional ON or
+; * OFF string for the BREAK, VERIFY, and ECHO
+; * routines.
+; *
+; * INPUT: command line at offset 81H
+; * PARSE_BREAK control block
+; *
+; * OUTPUT: If carry is clear
+; * If ON is found
+; * Zero flag set
+; * If OFF is found
+; * Zero flag clear
+; * If carry set
+; * If nothing on command line
+; * CL set to zero
+; * If error
+; * CL contains error value from parse
+; *
+; ****************************************************************
+
+assume ds:trangroup,es:trangroup
+
+ON_OFF:
+ MOV SI,81h
+
+scan_on_off: ;AN032; scan off leading blanks & equal
+ lodsb ;AN032; get a char
+ cmp al,blank ;AN032; if whitespace
+ jz scan_on_off ;AN032; keep scanning
+ cmp al,tab_chr ;AN032; if tab
+ jz scan_on_off ;AN032; keep scanning
+ cmp al,equal_chr ;AN032; if equal char
+ jz parse_on_off ;AN032; start parsing
+ dec si ;AN032; if none of above - back up
+
+parse_on_off: ;AN032; and start parsing
+ mov di,offset trangroup:parse_break ;AN000; Get adderss of PARSE_BREAK
+ xor cx,cx ;AN000; clear cx,dx
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AC000; call parser
+ cmp ax,end_of_line ;AC000; are we at end of line?
+ jz BADONF ;AC000; yes, return error
+ cmp ax,result_no_error ;AN000; did an error occur
+ jz on_off_there ;AN000; no - continue
+ mov cx,ax ;AN000; yes - set cl to error code
+ jmp short BADONF ;AN000; return error
+
+on_off_there:
+ cmp parse1_code,-1 ;AN014; was a valid positional present?
+ jnz good_on_off ;AN014; yes - continue
+ mov cx,badparm_ptr ;AN014; something other than ON/OFF
+ jmp short BADONF ;AN014; return error
+
+good_on_off: ;AN014;
+ xor ax,ax ;AC000; set up return code for
+ or al,parse1_code ;AC000; ON or OFF in AX
+ pushf ;AN000; save flags
+ mov di,offset trangroup:parse_break ;AN000; Get adderss of PARSE_BREAK
+ xor dx,dx ;AN000;
+ invoke cmd_parse ;AN000; call parser
+ cmp ax,end_of_line ;AN000; are we at end of line?
+ jnz BADONF_flags ;AN000; NO, return error
+ popf ;AN000; restore flags
+ clc ;AC000; no error
+ jmp short on_off_end ;AN000; return to caller
+
+BADONF_flags:
+ mov cx,ax
+ popf
+
+;
+; No discernable ON or OFF has been found. Put an error message pointer in DX
+; and return the error
+;
+BADONF:
+ MOV DX,OFFSET TRANGROUP:BAD_ON_OFF_ptr
+ STC
+
+ON_OFF_END:
+
+ RET
+
+
+
+;*************************************************************************
+; print date
+
+PRINT_DATE:
+ PUSH ES
+ PUSH DI
+ PUSH CS
+ POP ES
+ CALL GetDate ; get date
+ xchg dh,dl ;AN000; switch month & day
+ mov promptDat_yr,cx ;AC000; put year into message control block
+ mov promptDat_moday,dx ;AC000; put month and day into message control block
+ mov dx,offset trangroup:promptDat_ptr ;AC000; set up message for output
+ invoke std_printf
+;AD061; mov promptDat_yr,0 ;AC000; reset year, month and day
+;AD061; mov promptDat_moday,0 ;AC000; pointers in control block
+ POP DI ;AC000; restore di,es
+ POP ES ;AC000;
+ return
+;
+; Do GET DATE system call and set up 3 character day of week in ARG_BUF
+; for output. Date will be returned in CX,DX.
+;
+
+GetDate:
+ mov di,offset trangroup:arg_buf ;AC000; target for day of week
+ MOV AH,GET_DATE ;AC000; get current date
+ INT 21h ;AC000; Get date in CX:DX
+ CBW ;AC000;
+
+ push cx ;AN000; save date returned in
+ push dx ;AN000; CX:DX
+ MOV SI,AX
+IFNDEF DBCS
+ SHL SI,1
+ ADD SI,AX ; SI=AX*3
+ ELSE
+ ifdef JAPAN ; MSKK01 07/14/89
+ shl si,1
+ shl si,1 ; SI=AX*4
+ endif
+ IFDEF TAIWAN
+ SHL SI,1
+ ADD SI,AX
+ SHL SI,1 ; SI=AX*6
+ ENDIF
+ ifdef KOREA
+ shl si,1
+ endif
+ENDIF
+ mov cx,si ;AN000; save si
+ mov ax,weektab ;AN000; get message number of weektab
+ mov dh,util_msg_class ;AN000; this is a utility message
+ push di ;AN000; save argument buffer
+ invoke Tsysgetmsg ;AN000; get the address of the message
+ pop di ;AN000; retrieve argument buffer
+ add si,cx ;AC000; get day of week
+IFNDEF DBCS
+ MOV CX,3
+ ELSE
+ ifdef JAPAN ; MSKK01 07/14/89
+ mov cx,4
+ endif
+ IFDEF TAIWAN
+ MOV CX,6
+ ENDIF
+ ifdef KOREA
+ mov cx,2 ; MSCH 90/9/6
+ endif
+ENDIF
+ REP MOVSB
+ mov al,end_of_line_out ;AC000; terminate the string
+ stosb
+ pop dx ;AN000; get back date
+ pop cx ;AN000;
+
+ return
+;g
+;g This routine determines whether the character in AL is a
+;g Yes or No character. On return, if AL=0, the character is
+;g No, if AL=1, the character is Yes.
+;g
+
+assume ds:trangroup
+
+char_in_xlat proc near
+
+ mov dl,al ;AC000; get character into DX
+ xor dh,dh ;AC000;
+ mov ax,(getextcntry SHL 8) + 35 ;AC000; Yes/No char call
+ int 21h ;AC000;
+
+ ret
+
+char_in_xlat endp
+
+TRANCODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/command/uinit.asm b/private/mvdm/dos/v86/cmd/command/uinit.asm
new file mode 100644
index 000000000..db273d1a3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/uinit.asm
@@ -0,0 +1,352 @@
+ page ,132
+; SCCSID = @(#)uinit.asm 4.5 85/12/04
+; SCCSID = @(#)uinit.asm 4.5 85/12/04
+TITLE COMMAND Initialization messages
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;
+; Revision History
+; ================
+; M003 SR 07/16/90 Added Lh_OffUnlink to the offset
+; patch table (Reloc_Table) for UMB
+; support
+;
+
+.XCREF
+.XLIST
+include comsw.asm
+include comseg.asm
+include ifequ.asm
+.LIST
+.CREF
+
+addr macro sym,name
+ public name
+ ifidn <name>,<>
+
+ dw offset resgroup:sym
+ else
+
+name dw offset resgroup:sym
+ endif
+ endm
+
+CODERES segment
+
+ extrn ContC :near
+ extrn DskErr :near
+ extrn Int_2e :near
+ extrn MsgInt2fHandler :near
+ extrn Exec_Ret :near
+ extrn TRemCheck :far
+ extrn TrnLodCom1 :near
+ extrn MsgRetriever :near
+ extrn LodCom :near
+ extrn THeadFix :far
+ extrn Lh_OffUnlink :far ; M003
+
+CODERES ends
+
+
+;;ENVIRONMENT SEGMENT PUBLIC PARA ;AC000;
+;; EXTRN ECOMSPEC:BYTE
+;;ENVIRONMENT ENDS
+
+TRANCODE SEGMENT PUBLIC BYTE ;AC000;
+ extrn Printf_init:FAR
+ extrn Triage_Init:FAR
+ extrn append_parse:FAR ;AN054;
+TranCode ENDS
+
+INIT SEGMENT PUBLIC PARA ;AC000;
+
+
+ public icondev
+ public BADCSPFL
+ public COMSPECT
+; NTVDM not used public AUTOBAT
+ public space
+ public PRDATTM
+ public INITADD
+ public print_add
+ public CHUCKENV
+ public scswitch
+ public ucasea
+;; public ECOMLOC
+ public equalsign
+ public lcasea
+ public lcasez
+ public comspstring
+ public EnvSiz
+ public EnvMax
+ public initend
+ public trnsize
+ public resetenv ;AC000;
+ public ext_msg ;AC000;
+ public num_positionals
+ public internat_info
+ public parsemes_ptr
+
+ PUBLIC triage_add
+ PUBLIC oldenv
+ PUBLIC usedenv
+; NTVDM not used PUBLIC KAUTOBAT ;AN000; 3/3/KK
+ public eswitch ;AN018;
+ public dswitch ;AN018;
+ public init_parse ;AN054;
+ public old_parse_ptr ;AN057;
+ PUBLIC pars_msg_off ;AN060;
+ PUBLIC pars_msg_seg ;AN060;
+
+ public PathString
+ public Reloc_Table
+ public ResJmpTable
+ public FirstCom
+
+ public DevFlag
+ public PathFlag
+
+
+include resmsg.equ ;AC000;
+
+
+ICONDEV LABEL BYTE
+ DB "/DEV/"
+ DB "CON",0,0,0,0,0,0 ; Room for 8 char device
+BADCSPFL DB 0
+COMSPECT DB "\COMMAND.COM",0,0
+;NTVDM not used AUTOBAT DB 0,":\AUTOEXEC.BAT",0,0DH ;AC027;
+;NTVDM not used KAUTOBAT DB 0,":\KAUTOEXE.BAT",0,0DH ;AC027; 3/3/KK
+
+PRDATTM DB -1 ;Init not to prompt for date time
+INITADD DD ?
+print_add LABEL DWORD
+ DW OFFSET TranGroup:Printf_INIT
+ DW 0
+triage_add LABEL DWORD
+ DW OFFSET TranGroup:Triage_Init
+ DW 0
+CHUCKENV DB 0
+;eg ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC-10H
+;;ECOMLOC DW OFFSET ENVIRONMENT:ECOMSPEC ;eg
+
+PathString db "PATH=",0
+ComspString db "COMSPEC=\COMMAND.COM",0
+
+;;COMSPSTRING DB "COMSPEC="
+
+equalsign db "="
+lcasea db "a"
+lcasez db "z"
+space db " "
+scswitch db "C" ; Single command
+ucasea db "A"
+
+EnvSiz DW 0 ; size user wants to allocate
+EnvMax DW 0 ; maximum size allowed.
+oldenv DW 0 ; envirseg at initialization
+usedenv DW 0 ; amount of envirseg used
+PARS_MSG_OFF DW 0 ;AN060; SAVED PARSE ERROR MESSAGE OFFSET
+PARS_MSG_SEG DW 0 ;AN060; SAVED PARSE ERROR MESSAGE SEGMENT
+
+;Do not separate the following two words. Used to call transient PARSE routine
+
+init_parse label dword ;AN054;
+init_p DW TRANGROUP:APPEND_PARSE ;AN054;
+initend DW 0 ;eg segment address of end of init
+
+;End of data that shouldn't be separated.
+
+trnsize DW 0 ;eg size of transient in paragraphs
+resetenv DB 0 ;eg set if we need to setblck env at endinit
+ext_msg DB 0 ;AN000; set if /MSG switch entered
+eswitch db 0 ;AN018; set if /e was entered
+dswitch db 0 ;AN018; set if /d was entered
+parsemes_ptr dw 0 ;AN000; word to store parse error number
+
+;
+; PARSE BLOCK FOR COMMAND
+;
+PUBLIC PARSE_COMMAND ;AN000;
+PUBLIC COMND1_OUTPUT ;AN000;
+PUBLIC COMND1_TYPE ;AN000;
+PUBLIC COMND1_CODE ;AN000;
+PUBLIC COMND1_SYN ;AN000;
+PUBLIC COMND1_ADDR ;AN000;
+PUBLIC COMMAND_F_SYN ;AN000;
+PUBLIC COMMAND_P_SYN ;AN000;
+PUBLIC COMMAND_C_SYN ;AN000;
+PUBLIC COMMAND_D_SYN ;AN000;
+PUBLIC COMMAND_E_SYN ;AN000;
+PUBLIC COMMAND_M_SYN ;AN000;
+PUBLIC COMMAND_?_SYN
+PUBLIC COMMAND_Z_SYN
+
+;
+; The following parse control block is used for COMMAND. This block is
+; used for parsing during initialization. The sytax for COMMAND is:
+; COMMAND [/?] [d:][path][/P][/F][/D][/E:xxxxx][/MSG][/C executable]
+;
+; Anything on the command line after the /C switch will be passed to the
+; executable command, so if /C is used, it must be specified last. The
+; /MSG switch can only be specified if the /P switch is specified.
+;
+; The /? switch causes help text to be displayed. Any other options
+; on the command line are ignored. Command.com will not load if /?
+; is specified.
+;
+
+ENVBIG EQU 32768 ;AN000; maximum environment size
+ENVSML EQU 160 ;AN000; minimum environment size
+
+INTERNAT_INFO LABEL BYTE ;AN000; used for country info after parsing is completed
+PARSE_COMMAND LABEL BYTE ;AN000;
+ DW RESGROUP:COMMAND_PARMS ;AN000;
+ DB 0 ;AN000; no extra delimiter
+
+COMMAND_PARMS LABEL BYTE ;AN000;
+ DB 0,2 ;AN000; 1 positional parm
+ DW RESGROUP:COMMAND_FILE ;AN000;
+ dw RESGROUP:Command_File
+ DB 8 ;AN000; 8 switches
+ DW RESGROUP:COMMAND_SWITCH1 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH2 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH3 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH4 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH5 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH6 ;AN000;
+ DW RESGROUP:COMMAND_SWITCH7
+ DW RESGROUP:COMMAND_SWITCH8
+ DB 0 ;AN000; no keywords
+
+COMMAND_FILE LABEL BYTE ;AN000;
+ DW 0201H ;AN000; filespec - optional
+ DW 1 ;AN000; capitalize - file table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 0 ;AN000; no keywords
+
+COMMAND_SWITCH1 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_P_SYN DB "/P",0 ;AN000; /P switch
+
+COMMAND_SWITCH2 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_F_SYN DB "/F",0 ;AN000; /F switch
+
+COMMAND_SWITCH3 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_D_SYN DB "/D",0 ;AN000; /D switch
+
+COMMAND_SWITCH4 LABEL BYTE ;AN000;
+ DW 8000H ;AN000; numeric value - required
+ DW 0 ;AN000; no function flags
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:COMMAND_E_VAL ;AN000; pointer to value list
+ DB 1 ;AN000; 1 keyword
+COMMAND_E_SYN DB "/E",0 ;AN000; /E switch
+
+COMMAND_E_VAL LABEL BYTE ;AN000;
+ DB 1 ;AN000;
+ DB 1 ;AN000; 1 range
+ DB 1 ;AN000; returned if result
+ DD ENVSML,ENVBIG ;AN000; minimum & maximum value
+ DB 0 ;AN000; no numeric values
+ DB 0 ;AN000; no string values
+
+COMMAND_SWITCH5 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_C_SYN DB "/C",0 ;AN000; /C switch
+
+COMMAND_SWITCH6 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_M_SYN DB "/MSG",0 ;AN000; /MSG switch
+
+COMMAND_SWITCH7 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_?_SYN DB "/?",0 ;AN000; /? switch
+
+COMMAND_SWITCH8 LABEL BYTE ;AN000;
+ DW 0 ;AN000; no match flags
+ DW 2 ;AN000; capitalize by char table
+ DW RESGROUP:COMND1_OUTPUT ;AN000; result buffer
+ DW RESGROUP:NO_VAL ;AN000;
+ DB 1 ;AN000; 1 keyword
+COMMAND_Z_SYN DB "/Z",0 ;AN000; /Z switch
+
+COMND1_OUTPUT LABEL BYTE ;AN000;
+COMND1_TYPE DB 0 ;AN000; type
+COMND1_CODE DB 0 ;AN000; return value
+COMND1_SYN DW 0 ;AN000; synonym pointer
+COMND1_ADDR DD 0 ;AN000; numeric value / address
+ ; of string value
+
+NO_VAL DB 0 ;AN000; no values
+num_positionals DW 0 ;AN000; counter for positionals
+old_parse_ptr DW 0 ;AN057; SI position before calling parser
+
+
+
+;*** INITIALIZATION MESSAGES
+
+ include comimsg.inc ;M00
+
+
+;SR;
+; This table of offsets is used by the init code to calculate the new offsets
+;for these labels after the resident code has been relocated
+;
+
+Reloc_Table dw offset CODERES:MsgInt2fHandler
+ dw offset CODERES:Int_2e
+ dw offset CODERES:ContC
+ dw offset CODERES:DskErr
+ dw offset CODERES:Exec_Ret
+ dw offset CODERES:TRemCheck
+ dw offset CODERES:TrnLodCom1
+ dw offset CODERES:LodCom
+ dw offset CODERES:MsgRetriever
+ dw offset CODERES:THeadFix
+ dw offset CODERES:Lh_OffUnlink ; M003
+
+NUM_RELOC_ENTRIES equ ($ - Reloc_Table) / 2
+public NUM_RELOC_ENTRIES
+
+ResJmpTable dd ? ;stores prev stub jump table addr
+FirstCom db 0 ;flag set if first command.com
+
+DevFlag db 0
+PathFlag db 0
+
+INIT ends
+
+ end
+
diff --git a/private/mvdm/dos/v86/cmd/command/usa-ms/bldmsg.h b/private/mvdm/dos/v86/cmd/command/usa-ms/bldmsg.h
new file mode 100644
index 000000000..dc09f364e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/command/usa-ms/bldmsg.h
@@ -0,0 +1,8 @@
+/*
+Message file for COMMAND.COM BUILDMSG.EXE
+*/
+
+#define PARSE_STR " DB \"Parse Error %%1\"\x0d\x0a"
+#define EXTENDED_STR " DB \"Extended Error %%1\"\x0d\x0a"
+char *ExtendedErrorText999 = "\"Extended Error %1\""; /* Mar 88, SWN */
+char *ParserErrorText999 = "\"Parse Error %1\""; /* Mar 88, SWN */
diff --git a/private/mvdm/dos/v86/cmd/debug/debasm.asm b/private/mvdm/dos/v86/cmd/debug/debasm.asm
new file mode 100644
index 000000000..672fbdf21
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debasm.asm
@@ -0,0 +1,1447 @@
+ PAGE 80,132 ;
+ TITLE DEBASM.ASM
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; CODE FOR THE ASSEMBLE COMMAND IN THE DEBUGGER
+
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBASM
+ ENDIF
+.XLIST
+.XCREF
+ include version.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+.CREF
+.LIST
+
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+
+ EXTRN DBMN:BYTE,CSSAVE:WORD,REG8:BYTE,REG16:BYTE,SIZ8:BYTE
+ EXTRN SYNERR_PTR:BYTE,OPTAB:BYTE,MAXOP:ABS
+
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+
+ EXTRN HINUM:WORD,LOWNUM:WORD,ASSEM_CNT:BYTE
+ EXTRN ASSEM1:BYTE,ASSEM2:BYTE,ASSEM3:BYTE,ASSEM4:BYTE,ASSEM5:BYTE
+ EXTRN ASSEM6:BYTE,OPBUF:BYTE,OPCODE:WORD,REGMEM:BYTE,INDEX:WORD
+ EXTRN ASMADD:BYTE,ASMSP:WORD,MOVFLG:BYTE,SEGFLG:BYTE,TSTFLG:BYTE
+ EXTRN NUMFLG:BYTE,DIRFLG:BYTE,BYTEBUF:BYTE,F8087:BYTE,DIFLG:BYTE
+ EXTRN SIFLG:BYTE,BXFLG:BYTE,BPFLG:BYTE,NEGFLG:BYTE,MEMFLG:BYTE
+ EXTRN REGFLG:BYTE,AWORD:BYTE,MIDFLD:BYTE,MODE:BYTE
+ EXTRN ARG_BUF:BYTE,HEX_PTR:BYTE
+
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+
+ PUBLIC ASSEM
+ PUBLIC DB_OPER,DW_OPER,ASSEMLOOP,GROUP2,AA_OPER,DCINC_OPER
+ PUBLIC GROUP1,ESC_OPER,FGROUPP,FGROUPX,FDE_OPER,FGROUPZ
+ PUBLIC FD9_OPER,FGROUP,FDB_OPER,FGROUPB,FGROUP3,FGROUP3W
+ PUBLIC FGROUPDS,INT_OPER,IN_OPER,DISP8_OPER,JMP_OPER,NO_OPER
+ PUBLIC OUT_OPER,L_OPER,MOV_OPER,POP_OPER,PUSH_OPER,ROTOP
+ PUBLIC TST_OPER,EX_OPER,GET_DATA16,CALL_OPER, DOORG
+
+ EXTRN INBUF:NEAR,SCANB:NEAR,SCANP:NEAR,GETHX:NEAR,GET_ADDRESS:NEAR
+ EXTRN DEFAULT:NEAR,OUTDI:NEAR,BLANK:NEAR,TAB:NEAR
+ EXTRN STD_PRINTF:NEAR,PRINTF_CRLF:NEAR
+
+; Line by line assembler
+
+MASKMOD EQU 11000000B
+SHMOD EQU 6
+MASKREG EQU 00111000B
+SHREG EQU 3
+MASKRM EQU 00000111B
+SHRM EQU 0
+
+ASSEM:
+ MOV BP,[CSSAVE] ; Default code segment
+ MOV DI,OFFSET DG:ASMADD ; Default address
+ CALL DEFAULT
+ MOV WORD PTR [ASMADD],DX ; Displacement of disassembly
+ MOV WORD PTR [ASMADD+2],AX ; Segment
+ MOV [ASMSP],SP ; Save sp in case of error
+
+ASSEMLOOP:
+ MOV SP,[ASMSP] ; Restore sp in case of error
+ LES DI,DWORD PTR ASMADD ; GET PC
+ CALL OUTDI ; OUTPUT ADDRESS
+ PUSH CS
+ POP ES
+ PUSH DI
+ MOV DI,OFFSET DG:ARG_BUF
+; No spacing is needed. The format string already has one.
+; CALL BLANK ; SKIP A SPACE
+ XOR AL,AL
+ STOSB
+ MOV DX,OFFSET DG:HEX_PTR
+ CALL STD_PRINTF
+ POP DI
+ CALL INBUF ; GET A BUFFER
+ CALL SCANB
+ JNZ OPLOOK
+ RET ; if empty just return
+
+; At this point ds:si points to the opcode mnemonic...
+OPLOOK:
+ XOR CX,CX ; OP-CODE COUNT = 0
+ MOV DI,OFFSET DG:DBMN
+OPSCAN:
+ XOR BX,BX
+OPLOOP:
+ MOV AL,[DI+BX]
+ CMP AL,[SI+BX]
+ JZ OPMATCH
+ INC CX ; INCREMENT OP-CODE COUNT
+ CMP CX,MAXOP ; CHECK FOR END OF LIST
+ JB OP1
+ JMP ASMERR
+OP1:
+ INC DI ; SCAN FOR NEXT OP-CODE...
+ CMP BYTE PTR [DI-1],0
+ JNZ OP1
+ JMP OPSCAN
+
+OPMATCH:
+ INC BX ; COMPARE NEXT CHAR
+ CMP BYTE PTR [DI+BX],0 ; ARE WE DONE?
+ JNZ OPLOOP ; ..IF NOT KEEP COMPARING
+ XCHG BX,CX
+ MOV AX,BX
+ SHL AX,1
+ ADD AX,BX
+ ADD AX,OFFSET DG:OPTAB
+ MOV BX,AX
+
+; CX = COUNT OF CHARS IN OPCODE
+; BX = POINTER INTO OPCODE TABLE
+
+ XOR AX,AX
+ MOV BYTE PTR [AWORD],AL
+ MOV WORD PTR [MOVFLG],AX ; MOVFLG + TSTFLG
+ MOV BYTE PTR [SEGFLG],AL ; ZERO SEGMENT REGISTER FLAG
+ MOV AH,00001010B ; SET UP FOR AA_OPER
+ MOV AL,BYTE PTR [BX]
+ MOV WORD PTR [ASSEM1],AX
+ MOV BYTE PTR [ASSEM_CNT],1
+
+ ADD SI,CX ; SI POINTS TO OPERAND
+ JMP WORD PTR [BX+1]
+
+; 8087 INSTRUCTIONS WITH NO OPERANDS
+
+FDE_OPER:
+ MOV AH,0DEH
+ JMP SHORT FDX_OPER
+FDB_OPER:
+ MOV AH,0DBH
+ JMP SHORT FDX_OPER
+FD9_OPER:
+ MOV AH,0D9H
+FDX_OPER:
+ XCHG AL,AH
+ MOV WORD PTR [ASSEM1],AX
+
+; AAD AND AAM INSTRUCIONS
+
+AA_OPER:
+ INC BYTE PTR [ASSEM_CNT]
+
+; INSTRUCTIONS WITH NO OPERANDS
+
+NO_OPER:
+ CALL STUFF_BYTES
+ CALL SCANP
+ PUSH CS
+ POP ES
+ JNZ OPLOOK
+ JMP ASSEMLOOP
+
+; PUSH INSTRUCTION
+
+PUSH_OPER:
+ MOV AH,11111111B
+ JMP SHORT POP1
+
+; POP INSTRUCTION
+
+POP_OPER:
+ MOV AH,10001111B
+POP1:
+ MOV [ASSEM1],AH
+ MOV [MIDFLD],AL
+ INC BYTE PTR [MOVFLG] ; ALLOW SEGMENT REGISTERS
+ MOV BYTE PTR [AWORD],2 ; MUST BE 16 BITS
+ CALL GETREGMEM
+ CALL BUILDIT
+ MOV AL,[DI+2]
+ CMP AL,11000000B
+ JB DATRET
+ MOV BYTE PTR [DI],1
+ CMP BYTE PTR [MOVFLG],2
+ JNZ POP2
+ AND AL,00011000B
+ OR AL,00000110B
+ CMP BYTE PTR [MIDFLD],0
+ JNZ POP3
+ OR AL,00000001B
+ JMP SHORT POP3
+
+POP2:
+ AND AL,MASKRM
+ OR AL,01010000B
+ CMP BYTE PTR [MIDFLD],0
+ JNZ POP3
+ OR AL,01011000B
+POP3:
+ MOV BYTE PTR [DI+1],AL
+ JMP ASSEM_EXIT
+
+; RET AND RETF INSTRUCTIONS
+
+GET_DATA16:
+ CALL SCANB
+ MOV CX,4
+ CALL GETHX
+ JC DATRET
+ DEC BYTE PTR [ASSEM1] ; CHANGE OP-CODE
+ ADD BYTE PTR [ASSEM_CNT],2 ; UPDATE LENGTH
+ MOV WORD PTR [ASSEM2],DX ; SAVE OFFSET
+DATRET:
+ JMP ASSEM_EXIT
+
+
+; INT INSTRUCTION
+
+INT_OPER:
+ CALL SCANB
+ MOV CX,2
+ CALL GETHX
+ JC ERRV1
+ MOV AL,DL
+ CMP AL,3
+ JZ DATRET
+ INC BYTE PTR [ASSEM1]
+ JMP DISPX
+
+; IN INSTRUCTION
+
+IN_OPER:
+ CALL SCANB
+ LODSW
+ CMP AX,'A'+4C00H ; "AL"
+ JZ IN_1
+ CMP AX,'A'+5800H ; "AX"
+ JZ IN_0
+ERRV1:
+ JMP ASMERR
+IN_0:
+ INC BYTE PTR [ASSEM1]
+IN_1:
+ CALL SCANP
+ CMP WORD PTR [SI],'D'+5800H ; "DX"
+ JZ DATRET
+ MOV CX,2
+ CALL GETHX
+ JC ERRV1
+ AND BYTE PTR [ASSEM1],11110111B
+ MOV AL,DL
+ JMP DISPX
+
+; OUT INSTRUCTION
+
+OUT_OPER:
+ CALL SCANB
+ CMP WORD PTR [SI],'D'+5800H ; "DX"
+ JNZ OUT_0
+ INC SI
+ INC SI
+ JMP SHORT OUT_1
+OUT_0:
+ AND BYTE PTR [ASSEM1],11110111B
+ MOV CX,2
+ CALL GETHX
+ JC ERRV1
+ INC BYTE PTR [ASSEM_CNT]
+ MOV BYTE PTR [ASSEM2],DL
+OUT_1:
+ CALL SCANP
+ LODSW
+ CMP AX,'A'+4C00H ; "AL"
+ JZ DATRET
+ CMP AX,'A'+5800H ; "AX"
+ JNZ ERRV1
+ INC BYTE PTR [ASSEM1]
+ JMP DATRET
+
+
+; JUMP INSTRUCTION
+
+JMP_OPER:
+ INC BYTE PTR [TSTFLG]
+
+; CALL INSTRUCTION
+
+CALL_OPER:
+ MOV BYTE PTR [ASSEM1],11111111B
+ MOV BYTE PTR [MIDFLD],AL
+ CALL GETREGMEM
+ CALL BUILD3
+ CMP BYTE PTR [MEMFLG],0
+ JNZ CALLJ1
+ CMP BYTE PTR [REGMEM],-1
+ JZ CALLJ2
+
+; INDIRECT JUMPS OR CALLS
+
+CALLJ1:
+ CMP BYTE PTR [AWORD],1
+ERRZ4:
+ JZ ERRV1
+ CMP BYTE PTR [AWORD],4
+ JNZ ASMEX4
+ OR BYTE PTR [DI+2],1000B
+ JMP SHORT ASMEX4
+
+; DIRECT JUMPS OR CALLS
+
+CALLJ2:
+ MOV AX,[LOWNUM]
+ MOV DX,[HINUM]
+ MOV BL,[AWORD]
+ CMP BYTE PTR [NUMFLG],0
+ JZ ERRZ4
+
+; BL = NUMBER OF BYTES IN JUMP
+; DX = OFFSET
+; AX = SEGMENT
+
+CALLJ3:
+ MOV BYTE PTR [DI],5
+ MOV [DI+2],AX
+ MOV [DI+4],DX
+
+ MOV AL,10011010B ; SET UP INTER SEGMENT CALL
+ CMP BYTE PTR [TSTFLG],0
+ JZ CALLJ5
+ MOV AL,11101010B ; FIX UP FOR JUMP
+CALLJ5:
+ MOV BYTE PTR [DI+1],AL
+ CMP BL,4 ; FAR SPECIFIED?
+ JZ ASMEX4
+ OR BL,BL
+ JNZ CALLJ6
+ CMP DX,WORD PTR [ASMADD+2] ; DIFFERENT SEGMENT?
+ JNZ ASMEX4
+
+CALLJ6:
+ MOV BYTE PTR [DI],3
+ MOV AL,11101000B ; SET UP FOR INTRASEGMENT
+ OR AL,[TSTFLG]
+ MOV BYTE PTR [DI+1],AL
+
+ MOV AX,[LOWNUM]
+ SUB AX,WORD PTR [ASMADD]
+ SUB AX,3
+ MOV [DI+2],AX
+ CMP BYTE PTR [TSTFLG],0
+ JZ ASMEX4
+ CMP BL,2
+ JZ ASMEX4
+
+ INC AX
+ MOV CX,AX
+ CBW
+ CMP AX,CX
+ JNZ ASMEX3
+ MOV BYTE PTR [DI+1],11101011B
+ MOV [DI+2],AX
+ DEC BYTE PTR [DI]
+ASMEX4:
+ JMP ASSEM_EXIT
+
+; CONDITIONAL JUMPS AND LOOP INSTRUCTIONS
+
+DISP8_OPER:
+ MOV BP,WORD PTR [ASMADD+2] ; GET DEFAULT DISPLACEMENT
+ CALL GET_ADDRESS
+ SUB DX,WORD PTR [ASMADD]
+ DEC DX
+ DEC DX
+ CALL CHKSIZ
+ CMP CL,1
+ JNZ ERRV2
+DISPX:
+ INC [ASSEM_CNT]
+ MOV BYTE PTR [ASSEM2],AL
+ASMEX3:
+ JMP ASSEM_EXIT
+
+; LDS, LES, AND LEA INSTRUCTIONS
+
+L_OPER:
+ CALL SCANB
+ LODSW
+ MOV CX,8
+ MOV DI,OFFSET DG:REG16
+ CALL CHKREG
+ JZ ERRV2 ; CX = 0 MEANS NO REGISTER
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+ MOV BYTE PTR [MIDFLD],AL
+ CALL SCANP
+ CALL GETREGMEM
+ CMP BYTE PTR [AWORD],0
+ JNZ ERRV2
+ CALL BUILD2
+ JMP SHORT ASEXV
+
+; DEC AND INC INSTRUCTIONS
+
+DCINC_OPER:
+ MOV BYTE PTR [ASSEM1],11111110B
+ MOV BYTE PTR [MIDFLD],AL
+ CALL GETREGMEM
+ CALL BUILDIT
+ TEST BYTE PTR [DI+1],1
+ JZ ASEXV
+ MOV AL,[DI+2]
+ CMP AL,MASKMOD
+ JB ASEXV
+ AND AL,1111B
+ OR AL,01000000B
+ MOV [DI+1],AL
+ DEC BYTE PTR [DI]
+ASEXV:
+ JMP ASSEM_EXIT
+
+ERRV2:
+ JMP ASMERR
+
+; ESC INSTRUCTION
+
+ESC_OPER:
+ INC BYTE PTR [AWORD]
+ CALL SCANB
+ MOV CX,2
+ CALL GETHX
+ CMP DX,64
+ JAE ERRV2
+ CALL SCANP
+ MOV AX,DX
+ MOV CL,3
+ SHR DX,CL
+ OR [ASSEM1],DL
+ AND AL,111B
+ SHL AL,CL
+ JMP GROUPE
+
+; 8087 ARITHMETIC INSTUCTIONS
+
+; OPERANDS THAT ALLOW THE REVERSE BIT
+
+FGROUPDS:
+ CALL SETMID
+ CALL GETREGMEM2
+ CALL BUILD3
+ CMP BYTE PTR [MODE],11000000B
+ JNZ FGROUP1
+ MOV AL,[DIRFLG]
+ OR AL,AL
+ JZ FEXIT
+ OR [DI+1],AL ; IF D=1...
+ XOR BYTE PTR [DI+2],00001000B ; ...REVERSE THE SENSE OF R
+ JMP SHORT FEXIT
+
+; HERE WHEN INSTRUCTION COULD HAVE MEMORY OR REGISTER OPERAND
+
+FGROUPX:
+ CALL SETMID ; THIS ENTRY POINT FOR 1 MEM OPER
+ MOV BYTE PTR [DIRFLG],0
+ JMP SHORT FGRP2
+FGROUP:
+ CALL SETMID
+FGRP2:
+ CALL GETREGMEM2
+ CALL BUILD3
+ CMP BYTE PTR [MODE],11000000B
+ JNZ FGROUP1
+ MOV AL,[DIRFLG]
+ OR [DI+1],AL
+ JMP SHORT FEXIT
+FGROUP1:
+ CALL SETMF
+FEXIT:
+ JMP ASSEM_EXIT
+
+; THESE 8087 INSTRUCTIONS REQUIRE A MEMORY OPERAND
+FGROUPB:
+ MOV AH,5 ; MUST BE TBYTE
+ JMP SHORT FGROUP3E
+FGROUP3W:
+ MOV AH,2 ; MUST BE WORD
+ JMP SHORT FGROUP3E
+FGROUP3:
+ MOV AH,-1 ; SIZE CANNOT BE SPECIFIED
+FGROUP3E:
+ MOV [AWORD],AH
+ CALL SETMID
+ CALL GETREGMEM
+ CMP BYTE PTR [MODE],11000000B
+ JZ FGRPERR
+FGRP:
+ CALL BUILD3
+ JMP FEXIT
+
+; THESE 8087 INSTRUCTIONS REQUIRE A REGISTER OPERAND
+FGROUPP: ; 8087 POP OPERANDS
+ MOV BYTE PTR [AWORD],-1
+ CALL SETMID
+ CALL GETREGMEM2
+ CMP BYTE PTR [DIRFLG],0
+ JNZ FGRP
+FGRPERR:
+ JMP ASMERR
+
+FGROUPZ: ; ENTRY POINT WHERE ARG MUST BE MEM
+ CALL SETMID
+ MOV BYTE PTR [DIRFLG],0
+ CALL GETREGMEM
+ CMP BYTE PTR [MODE],11000000B
+ JZ FGRPERR
+ CALL BUILD3
+ CALL SETMF
+ JMP FEXIT
+
+; NOT, NEG, MUL, IMUL, DIV, AND IDIV INSTRUCTIONS
+
+GROUP1:
+ MOV [ASSEM1],11110110B
+GROUPE:
+ MOV BYTE PTR [MIDFLD],AL
+ CALL GETREGMEM
+ CALL BUILDIT
+ JMP FEXIT
+
+; SHIFT AND ROTATE INSTRUCTIONS
+
+ROTOP:
+ MOV [ASSEM1],11010000B
+ MOV BYTE PTR [MIDFLD],AL
+ CALL GETREGMEM
+ CALL BUILDIT
+ CALL SCANP
+ CMP BYTE PTR [SI],'1'
+ JZ ASMEXV1
+ CMP WORD PTR [SI],"LC" ; CL
+ JZ ROTOP1
+ROTERR:
+ JMP ASMERR
+ROTOP1:
+ OR BYTE PTR [ASSEM1],10B
+ASMEXV1:
+ JMP ASSEM_EXIT
+
+; XCHG INSTRUCTION
+
+EX_OPER:
+ INC BYTE PTR [TSTFLG]
+
+; TEST INSTRUCTION
+
+TST_OPER:
+ INC BYTE PTR [TSTFLG]
+ JMP SHORT MOVOP
+
+; MOV INSTRUCTION
+
+MOV_OPER:
+ INC BYTE PTR [MOVFLG]
+MOVOP:
+ XOR AX,AX
+ JMP SHORT GROUPM
+
+; ADD, ADC, SUB, SBB, CMP, AND, OR, XOR instructions
+
+GROUP2:
+ MOV BYTE PTR [ASSEM1],10000000B
+GROUPM:
+ MOV BYTE PTR [MIDFLD],AL
+
+ PUSH AX
+ CALL GETREGMEM
+ CALL BUILD2
+ CALL SCANP ; POINT TO NEXT OPERAND
+ MOV AL,BYTE PTR [ASSEM_CNT]
+ PUSH AX
+ CALL GETREGMEM
+ POP AX
+ MOV BYTE PTR [DI],AL
+ POP AX
+ MOV BL,BYTE PTR [AWORD]
+ OR BL,BL
+ JZ ERRV5
+ DEC BL
+ AND BL,1
+ OR BYTE PTR [DI+1],BL
+
+ CMP BYTE PTR [MEMFLG],0
+ JNZ G21V
+ CMP BYTE PTR [NUMFLG],0 ; TEST FOR IMMEDIATE DATA
+ JZ G21V
+ CMP BYTE PTR [SEGFLG],0
+ JNZ ERRV5
+ CMP BYTE PTR [TSTFLG],2 ; XCHG?
+ JNZ IMMED1
+ERRV5:
+ JMP ASMERR
+G21V:
+ JMP GRP21
+
+; SECOND OPERAND WAS IMMEDIATE
+
+IMMED1:
+ MOV AL,BYTE PTR [DI+2]
+ CMP BYTE PTR [MOVFLG],0
+ JZ NOTMOV1
+ AND AL,11000000B
+ CMP AL,11000000B
+ JNZ GRP23 ; not to a register
+ ; MOVE IMMEDIATE TO REGISTER
+ MOV AL,BYTE PTR [DI+1]
+ AND AL,1 ; SET SIZE
+ PUSHF
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+ OR AL,BYTE PTR [DI+2] ; SET REGISTER
+ AND AL,00001111B
+ OR AL,10110000B
+ MOV BYTE PTR [DI+1],AL
+ MOV AX,WORD PTR [LOWNUM]
+ MOV WORD PTR [DI+2],AX
+ POPF
+ JZ EXVEC
+ INC BYTE PTR [DI]
+EXVEC:
+ JMP GRPEX
+
+NOTMOV1:
+ AND AL,11000111B
+ CMP AL,11000000B
+ JZ IMMACC ; IMMEDIATE TO ACC
+
+ CMP BYTE PTR [TSTFLG],0
+ JNZ GRP23
+ CMP BYTE PTR [MIDFLD],1*8 ; OR?
+ JZ GRP23
+ CMP BYTE PTR [MIDFLD],4*8 ; AND?
+ JZ GRP23
+ CMP BYTE PTR [MIDFLD],6*8 ; XOR?
+ JZ GRP23
+ TEST BYTE PTR [DI+1],1 ; TEST IF BYTE OPCODE
+ JZ GRP23
+
+ MOV AX,[LOWNUM]
+ MOV BX,AX
+ CBW
+ CMP AX,BX
+ JNZ GRP23 ; SMALL ENOUGH?
+
+ MOV BL,[DI]
+ DEC BYTE PTR [DI]
+ OR BYTE PTR [DI+1],10B
+ JMP SHORT GRP23X
+
+IMMACC:
+ MOV AL,BYTE PTR [DI+1]
+ AND AL,1
+ CMP BYTE PTR [TSTFLG],0
+ JZ NOTTST
+ OR AL,10101000B
+ JMP SHORT TEST1
+NOTTST:
+ OR AL,BYTE PTR [MIDFLD]
+ OR AL,100B
+TEST1:
+ MOV BYTE PTR [DI+1],AL
+ DEC BYTE PTR [DI]
+
+GRP23:
+ MOV BL,BYTE PTR [DI]
+GRP23X:
+ XOR BH,BH
+ ADD BX,DI
+ INC BX
+ MOV AX,WORD PTR [LOWNUM]
+ MOV WORD PTR [BX],AX
+ INC BYTE PTR [DI]
+ TEST BYTE PTR [DI+1],1
+ JZ GRPEX1
+ INC BYTE PTR [DI]
+GRPEX1:
+ JMP GRPEX
+
+; SECOND OPERAND WAS MEMORY OR REGISTER
+
+GRP21:
+ CMP BYTE PTR [SEGFLG],0
+ JZ GRP28 ; FIRST OPERAND WAS A SEGMENT REG
+ MOV AL,BYTE PTR [REGMEM]
+ TEST AL,10000B
+ JZ NOTSEG1
+ERRV3:
+ JMP ASMERR
+NOTSEG1:
+ AND AL,111B
+ OR BYTE PTR [DI+2],AL
+ AND BYTE PTR [DI+1],11111110B
+ CMP BYTE PTR [MEMFLG],0
+ JNZ G22V
+ JMP GRPEX
+
+GRP28:
+ AND BYTE PTR [DI+2],11000111B
+ MOV AL,BYTE PTR [DI+1] ; GET FIRST OPCODE
+ AND AL,1B
+ CMP BYTE PTR [MOVFLG],0
+ JZ NOTMOV2
+ OR AL,10001000B
+ JMP SHORT MOV1
+NOTMOV2:
+ CMP BYTE PTR [TSTFLG],0
+ JZ NOTTST2
+ OR AL,10000100B
+ CMP BYTE PTR [TSTFLG],2
+ JNZ NOTTST2
+ OR AL,10B
+NOTTST2:
+ OR AL,BYTE PTR [MIDFLD] ; MIDFLD IS ZERO FOR TST
+MOV1:
+ MOV BYTE PTR [DI+1],AL
+ CMP BYTE PTR [MEMFLG],0
+G22V:
+ JZ NotGRP22
+ JMP GRP22
+NotGRP22:
+
+; SECOND OPERAND WAS A REGISTER
+
+ MOV AL,BYTE PTR [REGMEM]
+ TEST AL,10000B ; SEGMENT REGISTER?
+ JZ NOTSEG
+ CMP BYTE PTR [MOVFLG],0
+ JZ ERRV3
+ MOV BYTE PTR [DI+1],10001100B
+
+NOTSEG:
+ AND AL,111B
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+ OR BYTE PTR [DI+2],AL
+; ARR 2.4
+; In the case of the XCHG reg,reg and TEST reg,reg we have just built the
+; instruction backwards. This is because these two instructions do not have
+; the D bit. We need to switch R/S and REG
+;
+; Good comment Aaron, except that we do NOT switch if a memory operand was
+; present for precisely the reason that the D bit is not present
+;
+ CMP BYTE PTR [TSTFLG],0
+ JZ NOSWITCH ; Not XCHG or TEST
+;
+; See if there is a memory operand specified. If the MOD field is 11, then
+; we do perform the exchange.
+;
+ MOV AH,[DI+2]
+ AND AH,MASKMOD
+ CMP AH,MASKMOD
+ JNZ NOSWITCH
+ MOV AH,BYTE PTR [DI+2]
+ AND AH,MASKRM
+ SHL AH,1 ; Low three bits to middle three
+ SHL AH,1
+ SHL AH,1
+ MOV AL,BYTE PTR [DI+2]
+ AND AL,MASKREG
+ SHR AL,1 ; Middle three to low three
+ SHR AL,1
+ SHR AL,1
+ OR AL,AH ; Re combine
+ AND BYTE PTR [DI+2],MASKMOD ; Zap original
+ OR BYTE PTR [DI+2],AL ; New low 6 bits
+NOSWITCH:
+
+
+; SPECIAL FORM OF THE EXCHANGE COMMAND
+
+ CMP BYTE PTR [TSTFLG],2
+ JNZ GRPEX
+ TEST BYTE PTR [DI+1],1
+ JZ GRPEX
+ PUSH AX
+ MOV AL,BYTE PTR [DI+2]
+ AND AL,MASKMOD
+ CMP AL,MASKMOD ; MUST BE REGISTER TO REGISTER
+ POP AX
+ JB GRPEX
+ OR AL,AL
+ JZ SPECX
+ MOV AL,[DI+2]
+ AND AL,MASKRM
+ JNZ GRPEX
+ MOV CL,3
+ SHR BYTE PTR [DI+2],CL
+SPECX:
+ MOV AL,[DI+2]
+ AND AL,MASKRM
+ OR AL,10010000B
+ MOV BYTE PTR [DI+1],AL
+ DEC BYTE PTR [DI]
+ JMP SHORT GRPEX
+
+; SECOND OPERAND WAS A MEMORY REFERENCE
+
+GRP22:
+ CMP BYTE PTR [TSTFLG],0
+ JNZ TST2
+ OR BYTE PTR [DI+1],10B
+TST2:
+ MOV AL,BYTE PTR [DI+2]
+ CMP AL,MASKMOD ; MUST BE A REGISTER
+ JB ASMERR
+ CMP BYTE PTR [SEGFLG],0
+ JZ GRP223
+ AND AL,00011000B
+ JMP SHORT GRP222
+GRP223:
+ AND AL,MASKRM
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+GRP222:
+ OR AL,BYTE PTR [MODE]
+ OR AL,BYTE PTR [REGMEM]
+ MOV BYTE PTR [DI+2],AL
+ MOV AX,WORD PTR [LOWNUM]
+ MOV WORD PTR [DI+3],AX
+GRPSIZ:
+ MOV BYTE PTR [DI],2
+ MOV AL,BYTE PTR [DI+2]
+ AND AL,11000111B
+ CMP AL,00000110B
+ JZ GRP24
+ AND AL,MASKMOD
+ CMP AL,01000000B
+ JZ GRP25
+ CMP AL,10000000B
+ JNZ GRPEX
+GRP24:
+ INC BYTE PTR [DI]
+GRP25:
+ INC BYTE PTR [DI]
+
+GRPEX:
+ CMP BYTE PTR [MOVFLG],0
+ JZ ASSEM_EXIT
+
+; TEST FOR SPECIAL FORM OF MOV AX,[MEM] OR MOV [MEM],AX
+
+ MOV AL,[DI+1] ; GET OP-CODE
+ AND AL,11111100B
+ CMP AL,10001000B
+ JNZ ASSEM_EXIT
+ CMP BYTE PTR [DI+2],00000110B ; MEM TO AX OR AX TO MEM
+ JNZ ASSEM_EXIT
+ MOV AL,BYTE PTR [DI+1]
+ AND AL,11B
+ XOR AL,10B
+ OR AL,10100000B
+ MOV BYTE PTR [DI+1],AL
+ DEC BYTE PTR [DI]
+ MOV AX,[DI+3]
+ MOV WORD PTR [DI+2],AX
+
+ASSEM_EXIT:
+ CALL STUFF_BYTES
+ JMP ASSEMLOOP
+
+; Assem error. SI points to character in the input buffer
+; which caused error. By subtracting from start of buffer,
+; we will know how far to tab over to appear directly below
+; it on the terminal. Then print "^ Error".
+
+ASMERR:
+ SUB SI,OFFSET DG:(BYTEBUF-10) ; How many char processed so far?
+ MOV CX,SI ; Parameter for TAB in CX
+ MOV DI,OFFSET DG:ARG_BUF
+ CALL TAB ; Directly below bad char
+ MOV BYTE PTR [DI],0
+ MOV DX,OFFSET DG:SYNERR_PTR ; Error message
+ CALL PRINTF_CRLF
+ JMP ASSEMLOOP
+;
+; assemble the different parts into an instruction
+;
+BUILDIT:
+ MOV AL,BYTE PTR [AWORD]
+ OR AL,AL
+ JNZ BUILD1
+BLDERR:
+ JMP ASMERR
+
+BUILD1:
+ DEC AL
+ OR BYTE PTR [DI+1],AL ; SET THE SIZE
+
+BUILD2:
+ CMP BYTE PTR [NUMFLG],0 ; TEST FOR IMMEDIATE DATA
+ JZ BUILD3
+ CMP BYTE PTR [MEMFLG],0
+ JZ BLDERR
+
+BUILD3:
+ MOV AL,BYTE PTR [REGMEM]
+ CMP AL,-1
+ JZ BLD1
+ TEST AL,10000B ; TEST IF SEGMENT REGISTER
+ JZ BLD1
+ CMP BYTE PTR [MOVFLG],0
+ JZ BLDERR
+ MOV WORD PTR [DI+1],10001110B
+ INC BYTE PTR [MOVFLG]
+ INC BYTE PTR [SEGFLG]
+ AND AL,00000011B
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+ OR AL,MASKMOD
+ MOV BYTE PTR [DI+2],AL
+ RET
+
+BLD1:
+ AND AL,00000111B
+BLD4:
+ OR AL,BYTE PTR [MODE]
+ OR AL,BYTE PTR [MIDFLD]
+ MOV BYTE PTR [DI+2],AL
+ MOV AX,WORD PTR [LOWNUM]
+ MOV WORD PTR [DI+3],AX
+ RET
+
+GETREGMEM:
+ MOV BYTE PTR [F8087],0
+GETREGMEM2:
+ CALL SCANP
+ XOR AX,AX
+ MOV WORD PTR [LOWNUM],AX ; OFFSET
+ MOV WORD PTR [DIFLG],AX ; DIFLG+SIFLG
+ MOV WORD PTR [BXFLG],AX ; BXFLG+BPFLG
+ MOV WORD PTR [NEGFLG],AX ; NEGFLG+NUMFLG
+ MOV WORD PTR [MEMFLG],AX ; MEMFLG+REGFLG
+ DEC AL
+ CMP BYTE PTR [F8087],0
+ JZ PUTREG
+ MOV AL,1 ; DEFAULT 8087 REG IS 1
+PUTREG:
+ MOV BYTE PTR [REGMEM],AL
+
+GETLOOP:
+ MOV BYTE PTR [NEGFLG],0
+GETLOOP1:
+ MOV AX,WORD PTR [SI]
+ CMP AL,','
+ JZ GOMODE
+ CMP AL,13
+ JZ GOMODE
+ CMP AL,';'
+ JZ GOMODE
+ CMP AL,9
+ JZ GETTB
+ CMP AL,' '
+ JNZ GOGET
+GETTB:
+ INC SI
+ JMP GETLOOP1
+GOGET:
+ JMP GETINFO
+
+; DETERMINE THE MODE BITS
+
+GOMODE:
+ MOV DI,OFFSET DG:ASSEM_CNT
+ MOV BYTE PTR [MODE],11000000B
+ MOV BYTE PTR [ASSEM_CNT],2
+ CMP BYTE PTR [MEMFLG],0
+ JNZ GOMODE1
+ MOV AL,[NUMFLG]
+ OR AL,[REGFLG]
+ JNZ MORET
+ OR AL,[F8087]
+ JZ ERRET
+ MOV AL,[DI+1]
+ OR AL,[DIRFLG]
+ CMP AL,0DCH ; ARITHMETIC?
+ JNZ MORET
+ MOV BYTE PTR [DI+1],0DEH ; ADD POP TO NULL ARG 8087
+MORET:
+ RET
+ERRET:
+ JMP ASMERR
+
+GOMODE1:
+ MOV BYTE PTR [MODE],0
+ CMP BYTE PTR [NUMFLG],0
+ JZ GOREGMEM
+
+ MOV BYTE PTR [DI],4
+ MOV AX,WORD PTR [DIFLG]
+ OR AX,WORD PTR [BXFLG]
+ JNZ GOMODE2
+ MOV BYTE PTR [REGMEM],00000110B
+ RET
+
+GOMODE2:
+ MOV BYTE PTR [MODE],10000000B
+ CALL CHKSIZ1
+ CMP CL,2
+ JZ GOREGMEM
+ DEC BYTE PTR [DI]
+ MOV BYTE PTR [MODE],01000000B
+
+; DETERMINE THE REG-MEM BITS
+
+GOREGMEM:
+ MOV BX,WORD PTR [BXFLG]
+ MOV CX,WORD PTR [DIFLG]
+ XOR DX,DX
+GOREG0:
+ MOV AL,BL ; BX
+ ADD AL,CH ; SI
+ CMP AL,2
+ JZ GOGO
+ INC DL
+ MOV AL,BL
+ ADD AL,CL
+ CMP AL,2
+ JZ GOGO
+ INC DL
+ MOV AL,BH
+ ADD AL,CH
+ CMP AL,2
+ JZ GOGO
+ INC DL
+ MOV AL,BH
+ ADD AL,CL
+ CMP AL,2
+ JZ GOGO
+ INC DL
+ OR CH,CH
+ JNZ GOGO
+ INC DL
+ OR CL,CL
+ JNZ GOGO
+ INC DL ; BP+DISP
+ OR BH,BH
+ JZ GOREG1
+ CMP BYTE PTR [MODE],0
+ JNZ GOGO
+ MOV BYTE PTR [MODE],01000000B
+ INC BYTE PTR [DI]
+ DEC DL
+GOREG1:
+ INC DL ; BX+DISP
+GOGO:
+ MOV BYTE PTR [REGMEM],DL
+ RET
+
+GETINFO:
+ CMP AX,'EN' ; NEAR
+ JNZ GETREG3
+GETREG0:
+ MOV DL,2
+GETRG01:
+ CALL SETSIZ1
+GETREG1:
+ CALL SCANS
+ MOV AX,WORD PTR [SI]
+ CMP AX,"TP" ; PTR
+ JZ GETREG1
+ JMP GETLOOP
+
+GETREG3:
+ MOV CX,5
+ MOV DI,OFFSET DG:SIZ8
+ CALL CHKREG ; LOOK FOR BYTE, WORD, DWORD, ETC.
+ JZ GETREG41
+ INC AL
+ MOV DL,AL
+ JMP GETRG01
+
+GETREG41:
+ MOV AX,[SI]
+ CMP BYTE PTR [F8087],0
+ JZ GETREG5
+ CMP AX,"TS" ; 8087 STACK OPERAND
+ JNZ GETREG5
+ CMP BYTE PTR [SI+2],','
+ JNZ GETREG5
+ MOV BYTE PTR [DIRFLG],0
+ ADD SI,3
+ JMP GETLOOP
+
+GETREG5:
+ CMP AX,"HS" ; SHORT
+ JZ GETREG1
+
+ CMP AX,"AF" ; FAR
+ JNZ GETRG51
+ CMP BYTE PTR [SI+2],'R'
+ JNZ GETRG51
+ ADD SI,3
+ MOV DL,4
+ JMP GETRG01
+
+GETRG51:
+ CMP AL,'['
+ JNZ GETREG7
+GETREG6:
+ INC BYTE PTR [MEMFLG]
+GETREGADD:
+ INC SI
+ JMP GETLOOP
+
+GETREG7:
+ CMP AL,']'
+ JZ GETREG6
+ CMP AL,'.'
+ JZ GETREG6
+ CMP AL,'+'
+ JZ GETREGAdd
+ CMP AL,'-'
+ JNZ GETREG8
+ INC BYTE PTR [NEGFLG]
+ INC SI
+ JMP GETLOOP1
+
+GETREG8: ; LOOK FOR A REGISTER
+ CMP BYTE PTR [F8087],0
+ JZ GETREGREG
+ CMP AX,"TS"
+ JNZ GETREGREG
+ CMP BYTE PTR [SI+2],'('
+ JNZ GETREGREG
+ CMP BYTE PTR [SI+4],')'
+ JNZ ASMPOP
+ MOV AL,[SI+3]
+ SUB AL,'0'
+ JB ASMPOP
+ CMP AL,7
+ JA ASMPOP
+ MOV [REGMEM],AL
+ INC BYTE PTR [REGFLG]
+ ADD SI,5
+ CMP WORD PTR [SI],"S,"
+ JNZ ZLOOP
+ CMP BYTE PTR [SI+2],'T'
+ JNZ ZLOOP
+ ADD SI,3
+ZLOOP:
+ JMP GETLOOP
+
+GETREGREG:
+ MOV CX,20
+ MOV DI,OFFSET DG:REG8
+ CALL CHKREG
+ JZ GETREG12 ; CX = 0 MEANS NO REGISTER
+ MOV BYTE PTR [REGMEM],AL
+ INC BYTE PTR [REGFLG] ; TELL EVERYONE WE FOUND A REG
+ CMP BYTE PTR [MEMFLG],0
+ JNZ NOSIZE
+ CALL SETSIZ
+INCSI2:
+ ADD SI,2
+ JMP GETLOOP
+
+NOSIZE:
+ CMP AL,11 ; BX REGISTER?
+ JNZ GETREG9
+ CMP WORD PTR [BXFLG],0
+ JZ GETOK
+ASMPOP:
+ JMP ASMERR
+
+GETOK:
+ INC BYTE PTR [BXFLG]
+ JMP INCSI2
+GETREG9:
+ CMP AL,13 ; BP REGISTER?
+ JNZ GETREG10
+ CMP WORD PTR [BXFLG],0
+ JNZ ASMPOP
+ INC BYTE PTR [BPFLG]
+ JMP INCSI2
+GETREG10:
+ CMP AL,14 ; SI REGISTER?
+ JNZ GETREG11
+ CMP WORD PTR [DIFLG],0
+ JNZ ASMPOP
+ INC BYTE PTR [SIFLG]
+ JMP INCSI2
+GETREG11:
+ CMP AL,15 ; DI REGISTER?
+ JNZ ASMPOP ; *** error
+ CMP WORD PTR [DIFLG],0
+ JNZ ASMPOP
+ INC BYTE PTR [DIFLG]
+ JMP INCSI2
+
+GETREG12: ; BETTER BE A NUMBER!
+ MOV BP,WORD PTR [ASMADD+2]
+ CMP BYTE PTR [MEMFLG],0
+ JZ GTRG121
+GTRG119:
+ MOV CX,4
+GTRG120:
+ CALL GETHX
+ JMP SHORT GTRG122
+GTRG121:
+ MOV CX,2
+ CMP BYTE PTR [AWORD],1
+ JZ GTRG120
+ CMP BYTE PTR [AWORD],CL
+ JZ GTRG119
+ CALL GET_ADDRESS
+GTRG122:
+ JC ASMPOP
+ MOV [HINUM],AX
+ CMP BYTE PTR [NEGFLG],0
+ JZ GETREG13
+ NEG DX
+GETREG13:
+ ADD WORD PTR [LOWNUM],DX
+ INC BYTE PTR [NUMFLG]
+GETLOOPV:
+ JMP GETLOOP
+
+CHKREG:
+ PUSH CX
+ INC CX
+ REPNZ SCASW
+ POP AX
+ SUB AX,CX
+ OR CX,CX
+ RET
+
+STUFF_BYTES:
+ PUSH SI
+ LES DI,DWORD PTR ASMADD
+ MOV SI,OFFSET DG:ASSEM_CNT
+ XOR AX,AX
+ LODSB
+ MOV CX,AX
+ JCXZ STUFFRET
+ REP MOVSB
+ MOV WORD PTR [ASMADD],DI
+STUFFRET:
+ POP SI
+ RET
+
+SETSIZ:
+ MOV DL,1
+ TEST AL,11000B ; 16 BIT OR SEGMENT REGISTER?
+ JZ SETSIZ1
+ INC DL
+SETSIZ1:
+ CMP BYTE PTR [AWORD],0
+ JZ SETSIZ2
+ CMP BYTE PTR [AWORD],DL
+ JZ SETSIZ2
+SETERR:
+ POP DX
+ JMP ASMPOP
+SETSIZ2:
+ MOV BYTE PTR [AWORD],DL
+ RET
+
+; DETERMINE IF NUMBER IN AX:DX IS 8 BITS, 16 BITS, OR 32 BITS
+
+CHKSIZ:
+ MOV CL,4
+ CMP AX,BP
+ JNZ RETCHK
+CHKSIZ1:
+ MOV CL,2
+ MOV AX,DX
+ CBW
+ CMP AX,DX
+ JNZ RETCHK
+ DEC CL
+RETCHK:
+ RET
+
+; get first character after first space
+
+SCANS:
+ CMP BYTE PTR [SI],13
+ JZ RETCHK
+ CMP BYTE PTR [SI],'['
+ JZ RETCHK
+ LODSB
+ CMP AL,' '
+ JZ SCANBV
+ CMP AL,9
+ JNZ SCANS
+SCANBV:
+ JMP SCANB
+
+; Set up for 8087 op-codes
+
+SETMID:
+ MOV BYTE PTR [ASSEM1],0D8H
+ MOV AH,AL
+ AND AL,111B ; SET MIDDLE BITS OF SECOND BYTE
+ SHL AL,1
+ SHL AL,1
+ SHL AL,1
+ MOV [MIDFLD],AL
+ MOV AL,AH ; SET LOWER BITS OF FIRST BYTE
+ SHR AL,1
+ SHR AL,1
+ SHR AL,1
+ OR [ASSEM1],AL
+ MOV BYTE PTR [F8087],1 ; INDICATE 8087 OPERAND
+ MOV BYTE PTR [DIRFLG],100B
+ RET
+
+; Set MF bits for 8087 op-codes
+
+SETMF:
+ MOV AL,[AWORD]
+ TEST BYTE PTR [DI+1],10B
+ JNZ SETMFI
+ AND BYTE PTR [DI+1],11111001B ; CLEAR MF BITS
+ CMP AL,3 ; DWORD?
+ JZ SETMFRET
+ CMP AL,4 ; QWORD?
+ JZ SETMFRET2
+ TEST BYTE PTR [DI+1],1
+ JZ SETMFERR
+ CMP AL,5 ; TBYTE?
+ JZ SETMFRET3
+ JMP SHORT SETMFERR
+
+SETMFI:
+ CMP AL,3 ; DWORD?
+ JZ SETMFRET
+ CMP AL,2 ; WORD?
+ JZ SETMFRET2
+ TEST BYTE PTR [DI+1],1
+ JZ SETMFERR
+ CMP AL,4 ; QWORD?
+ JNZ SETMFERR
+ OR BYTE PTR [DI+1],111B
+SETMFRET3:
+ OR BYTE PTR [DI+1],011B
+ OR BYTE PTR [DI+2],101000B
+ JMP SHORT SETMFRET
+SETMFRET2:
+ OR BYTE PTR [DI+1],100B
+SETMFRET:
+ RET
+
+SETMFERR:
+ JMP ASMPOP
+
+
+DW_OPER:
+ MOV BP,1
+ JMP SHORT DBEN
+
+DB_OPER:
+ XOR BP,BP
+DBEN:
+ MOV DI,OFFSET DG:ASSEM_CNT
+ DEC BYTE PTR [DI]
+ INC DI
+DB0:
+ XOR BL,BL
+ CALL SCANP
+ JNZ DB1
+DBEX:
+ JMP ASSEM_EXIT
+DB1:
+ OR BL,BL
+ JNZ DB3
+ MOV BH,BYTE PTR [SI]
+ CMP BH,"'"
+ JZ DB2
+ CMP BH,'"'
+ JNZ DB4
+DB2:
+ INC SI
+ INC BL
+DB3:
+ LODSB
+ CMP AL,13
+ JZ DBEX
+ CMP AL,BH
+ JZ DB0
+ STOSB
+ INC BYTE PTR [ASSEM_CNT]
+ JMP DB3
+DB4:
+ MOV CX,2
+ CMP BP,0
+ JZ DB41
+ MOV CL,4
+DB41:
+ PUSH BX
+ CALL GETHX
+ POP BX
+ JNC DB5
+ JMP ASMERR
+DB5:
+ MOV AX,DX
+ CMP BP,0
+ JZ DB6
+ STOSW
+ INC BYTE PTR [ASSEM_CNT]
+ JMP SHORT DB7
+DB6:
+ STOSB
+DB7:
+ INC BYTE PTR [ASSEM_CNT]
+ JMP DB0
+
+; ORG pseudo op
+
+DOORG:
+ MOV BP,WORD PTR ASMADD+2
+ CALL GET_ADDRESS
+ MOV WORD PTR ASMADD,DX
+ MOV WORD PTR ASMADD+2,AX
+ JMP ASSEMLOOP
+
+CODE ENDS
+ END ASSEM
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debcom1.asm b/private/mvdm/dos/v86/cmd/debug/debcom1.asm
new file mode 100644
index 000000000..32574110a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debcom1.asm
@@ -0,0 +1,1058 @@
+ PAGE 60,132
+ TITLE DEBCOM1.ASM - PART1 DEBUGGER COMMANDS PC DOS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DECOM1.asm
+;
+; DESCRIPTIVE NAME: DEBUGGING TOOL
+;
+; FUNCTION: PROVIDES USERS WITH A TOOL FOR DEBUGGING PROGRAMS.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: DEBCOM2 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBCOM3 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBUASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBMES - CONTAINS ROUTINES CALLED BY DEBUG
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT DBCS HANDLING DMS:6/17/87
+; - IMPLEMENT MESSAGE RETRIEVER DMS:6/17/87
+; - IMPLEMENT > 32MB SUPPORT DMS:6/17/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+; Routines to perform debugger commands except ASSEMble and UASSEMble
+
+ IF1
+ ;%out COMPONENT=DEBUG, MODULE=DEBCOM1
+ ENDIF
+.XLIST
+.XCREF
+ include syscall.inc ; cas -- missing equates
+ include version.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+.CREF
+.LIST
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN SYNERR_PTR:BYTE
+ EXTRN DISPB:WORD,DSIZ:BYTE,DSSAVE:WORD
+ IF SYSVER
+ EXTRN CIN:DWORD,PFLAG:BYTE
+ ENDIF
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN DEFLEN:WORD,BYTEBUF:BYTE,DEFDUMP:BYTE
+ EXTRN ARG_BUF:BYTE,ARG_BUF_PTR:BYTE
+ EXTRN ONE_CHAR_BUF:BYTE,ONE_CHAR_BUF_PTR:WORD
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+ PUBLIC HEXCHK,GETHEX1,PRINT,DSRANGE,ADDRESS,HEXIN,PERROR
+ PUBLIC GETHEX,GET_ADDRESS,GETEOL,GETHX,PERR
+ PUBLIC PERR,MOVE,DUMP,ENTERDATA,FILL,SEARCH,DEFAULT
+ifdef JAPAN
+ public SETDUMPMODE
+ extrn test_lead:near
+endif
+ IF SYSVER
+ PUBLIC IN
+ EXTRN DISPREG:NEAR,DEVIOCALL:NEAR
+ ENDIF
+ EXTRN CRLF:NEAR,OUTDI:NEAR,OUTSI:NEAR,SCANP:NEAR
+ EXTRN SCANB:NEAR,BLANK:NEAR,TAB:NEAR,COMMAND:NEAR
+ EXTRN HEX:NEAR,BACKUP:NEAR
+ EXTRN PRINTF_CRLF:NEAR,HEX_ADDRESS_ONLY:NEAR,HEX_ADDRESS_STR:NEAR
+ EXTRN STD_PRINTF:NEAR
+DEBCOM1:
+; RANGE - Looks for parameters defining an address range.
+; The first parameter is the starting address. The second parameter
+; may specify the ending address, or it may be preceded by
+; "L" and specify a length (4 digits max), or it may be
+; omitted and a length of 128 bytes is assumed. Returns with
+; segment in AX, displacement in DX, and length in CX.
+DSRANGE:
+ MOV BP,[DSSAVE] ; Set default segment to DS
+ MOV [DEFLEN],128 ; And default length to 128 bytes
+RANGE:
+ CALL ADDRESS
+
+ PUSH AX ; Save segment
+ PUSH DX ; Save offset
+ CALL SCANP ; Get to next parameter
+
+ MOV AL,[SI]
+ CMP AL,UPPER_L ; Length indicator?
+ JE GETLEN
+
+ MOV DX,[DEFLEN] ; Default length
+ CALL HEXIN ; Second parameter present?
+
+ JC GETDEF ; If not, use default
+
+ MOV CX,4
+ CALL GETHEX ; Get ending address (same segment)
+
+ MOV CX,DX ; Low 16 bits of ending addr.
+ POP DX ; Low 16 bits of starting addr.
+ SUB CX,DX ; Compute range
+ JAE DSRNG2
+
+DSRNG1:
+ JMP PERROR ; Negative range
+DSRNG2:
+ INC CX ; Include last location
+; JCXZ DSRNG1 ; Wrap around error
+; Removing this instruction allows 0 FFFF to valid range
+ POP AX ; Restore segment
+ RET
+GETDEF:
+ POP CX ; get original offset
+ PUSH CX ; save it
+ NEG CX ; rest of segment
+ JZ RNGRET ; use default
+
+ CMP CX,DX ; more room in segment?
+ JAE RNGRET ; yes, use default
+
+ JMP short RNGRET1 ; no, length is in CX
+
+GETLEN:
+ INC SI ; Skip over "L" to length
+ MOV CX,4 ; Length may have 4 digits
+ CALL GETHEX ; Get the range
+
+RNGRET:
+ MOV CX,DX ; Length
+RNGRET1:
+ POP DX ; Offset
+ MOV AX,CX
+ ADD AX,DX
+ JNC OKRET
+
+ CMP AX,1
+ JAE DSRNG1 ; Look for wrap error
+
+OKRET:
+ POP AX ; Segment
+ RET
+DEFAULT:
+; DI points to default address and CX has default length
+ CALL SCANP
+
+ JZ USEDEF ; Use default if no parameters
+
+ MOV [DEFLEN],CX
+ CALL RANGE
+
+ JMP GETEOL
+
+USEDEF:
+ MOV SI,DI
+ LODSW ; Get default displacement
+ MOV DX,AX
+ LODSW ; Get default segment
+ RET
+
+ifdef JAPAN
+;
+; Set Dump mode to Kanji or Ascii
+;
+dump_mode db 0
+dbcs_flag db 0
+dbcs_adj db 0
+
+SETDUMPMODE:
+ call scanp ; get parameter
+ jz dm_err ; if none
+ lodsb
+ cmp al,'K' ; is it for Kanji mode
+ jnz @f ; no
+ call geteol
+ mov cs:dump_mode,1 ; set Kanji mode
+ jmp short dm_ret
+@@:
+ cmp al,'A' ; is it for Ascii mode
+ jnz @f ; no
+ call geteol
+ mov cs:dump_mode,0 ; set Ascii mode
+ jmp short dm_ret
+@@:
+dm_err:
+ jmp PERR
+dm_ret:
+ ret
+endif
+
+; Dump an area of memory in both hex and ASCII
+DUMP:
+ifdef JAPAN
+ mov cs:dbcs_flag,0
+ mov cs:dbcs_adj,0
+endif
+
+ MOV BP,[DSSAVE]
+ MOV CX,DISPB
+ MOV DI,OFFSET DG:DEFDUMP
+ CALL DEFAULT ; Get range if specified
+
+ MOV DS,AX ; Set segment
+ ASSUME DS:NOTHING
+
+ MOV SI,DX ; SI has displacement in segment
+ PUSH SI ; save SI away
+ MOV AL,DSIZ
+ XOR AH,AH
+ XOR AX,-1
+ AND SI,AX ; convert to para number
+ MOV DI,OFFSET DG:ARG_BUF ; Build the output str in arg_buf
+ CALL OUTSI ; display location
+
+ POP SI ; get SI back
+; Determine where the registers display should begin.
+ MOV AX,SI ; move offset
+ MOV AH,3 ; spaces per byte
+ AND AL,DSIZ ; convert to real offset
+ MUL AH ; 3 char positions per byte of output
+ OR AL,AL ; at beginning?
+ JZ INROW ; if so, then no movement.
+
+ PUSH CX
+ MOV CX,AX
+ CALL TAB
+
+ POP CX
+INROW:
+ PUSH SI ; Save address for ASCII dump
+BYTE0:
+ CALL BLANK ; Space between bytes
+BYTE1:
+ LODSB ; Get byte to dump
+ CALL HEX ; and display it
+
+ POP DX ; DX has start addr. for ASCII dump
+ DEC CX ; Drop loop count
+ JZ ASCII ; If through do ASCII dump
+
+ MOV AX,SI
+ TEST AL,DSIZ ; On row boundary?
+ JZ ENDROW
+
+ PUSH DX ; Didn't need ASCII addr. yet
+ TEST AL,7 ; On 8-byte boundary?
+ JNZ BYTE0
+
+ MOV AL,CHAR_MINUS ; Mark every 8 bytes with "-"
+ STOSB
+ JMP SHORT BYTE1
+
+ENDROW:
+ CALL ASCII ; Show it in ASCII
+
+ MOV DI,OFFSET DG:ARG_BUF ; Build the output str in arg_buf
+ CALL OUTSI ; Get the address at start of line
+
+ JMP INROW ; Loop until count is zero
+
+; Produce a dump of the ascii text characters. We take the current SI which
+; contains the byte after the last one dumped. From this we determine how
+; many spaces we need to output to get to the ascii column. Then we look at
+; the beginning address of the dump to tsee how many spaces we need to indent.
+ASCII:
+ PUSH CX ; Save count of remaining bytes
+; Determine how many spaces to go until the ASCII column.
+ MOV AX,SI ; get offset of next byte
+ DEC AL
+ AND AL,DSIZ
+ INC AL
+; AX now has the number of bytes that we have displayed: 1 to Dsiz+1.
+; Compute characters remaining to be displayed. We *always* put the ASCII
+; dump in column 51 (or whereever)
+ SUB AL,10H ; get negative of number
+ DEC AL ;
+ NEG AL ; convert to positive
+ CBW ; convert to word
+; 3 character positions for each byte displayed.
+ MOV CX,AX
+ SHL AX,1
+ ADD CX,AX
+; Compute indent for ascii dump
+ MOV AX,DX
+ AND AL,DSIZ
+ XOR AH,AH
+ ADD CX,AX
+; Tab over
+ CALL TAB
+
+; Set up for true dump
+ MOV CX,SI
+ MOV SI,DX
+ SUB CX,SI
+ASCDMP:
+ LODSB ; Get ASCII byte to dump
+
+ifdef JAPAN
+ cmp cs:dbcs_flag,1
+ jz set_dbcs ; if it was lead byte
+ cmp cs:dbcs_flag,2
+ jnz @f ; if it was not tail byte
+ mov cs:dbcs_flag,0 ; reset
+@@:
+ call test_lead
+ jnc @f ; if this is not lead byte
+ cmp byte ptr [si],CHAR_BLANK
+ jae set_dbcs ; if tail byte is not control corde
+ mov al,CHAR_PERIOD
+ jmp short @f
+set_dbcs:
+ inc cs:dbcs_flag
+@@:
+ cmp cs:dump_mode,1
+ jnz @f ; if not Kanji mode
+ cmp cs:dbcs_adj,1
+ jnz kanjiprt ; if no need to adjust
+ mov al,' ' ; tail byte is displayed already
+ mov cs:dbcs_adj,0
+ jmp short kanjiprt
+@@:
+endif
+
+ CMP AL,CHAR_RUBOUT
+ JAE NOPRT ; Don't print RUBOUT or above
+
+ifdef JAPAN
+kanjiprt:
+endif
+
+ CMP AL,CHAR_BLANK
+ JAE PRIN ; print space through RUBOUT-1
+
+NOPRT:
+ MOV AL,CHAR_PERIOD ; If unprintable character
+PRIN:
+ STOSB
+ LOOP ASCDMP ; CX times
+
+ifdef JAPAN
+ cmp cs:dump_mode,1
+ jnz @f ; if not Kanji mode
+ cmp cs:dbcs_flag,1
+ jnz @f ; if not ended with lead byte
+ mov al,[si] ; get tail byte
+ stosb
+ mov cs:dbcs_adj,1
+@@:
+endif
+
+ MOV AL,0
+ STOSB
+ PUSH DS
+ PUSH CS
+ POP DS
+ ASSUME DS:DG
+
+ CALL HEX_ADDRESS_STR
+
+ CALL CRLF
+
+ POP DS
+ ASSUME DS:NOTHING
+
+ POP CX ; Restore overall dump len
+ MOV WORD PTR [DEFDUMP],SI
+ MOV WORD PTR [DEFDUMP+WORD],DS ; Save last address as def
+ RET
+
+ ASSUME DS:DG
+; Block move one area of memory to another Overlapping moves are performed
+; correctly, i.e., so that a source byte is not overwritten until after it has
+; been moved.
+MOVE:
+ CALL DSRANGE ; Get range of source area
+
+ PUSH CX ; Save length
+ PUSH AX ; Save segment
+ PUSH DX ; Save source displacement
+ CALL ADDRESS ; Get destination address (sam
+
+ CALL GETEOL ; Check for errors
+
+ POP SI
+ MOV DI,DX ; Set dest. displacement
+ POP BX ; Source segment
+ MOV DS,BX
+ MOV ES,AX ; Destination segment
+ POP CX ; Length
+ CMP DI,SI ; Check direction of move
+ SBB AX,BX ; Extend the CMP to 32 bits
+ JB COPYLIST ; Move forward into lower mem.
+
+; Otherwise, move backward. Figure end of source and destination
+; areas and flip direction flag.
+ DEC CX
+ ADD SI,CX ; End of source area
+ ADD DI,CX ; End of destination area
+ STD ; Reverse direction
+ INC CX
+COPYLIST:
+ MOVSB ; Do at least 1 - Range is 1-1
+ DEC CX
+ REP MOVSB ; Block move
+RET1:
+ RET
+
+; Fill an area of memory with a list values. If the list
+; is bigger than the area, don't use the whole list. If the
+; list is smaller, repeat it as many times as necessary.
+FILL:
+ CALL DSRANGE ; Get range to fill
+
+ PUSH CX ; Save length
+ PUSH AX ; Save segment number
+ PUSH DX ; Save displacement
+ CALL LIST ; Get list of values to fill w
+
+ POP DI ; Displacement in segment
+ POP ES ; Segment
+ POP CX ; Length
+ CMP BX,CX ; BX is length of fill list
+ MOV SI,OFFSET DG:BYTEBUF ; List is in byte buffer
+ JCXZ BIGRNG
+
+ JAE COPYLIST ; If list is big, copy part of
+
+BIGRNG:
+ SUB CX,BX ; How much bigger is area than
+ XCHG CX,BX ; CX=length of list
+ PUSH DI ; Save starting addr. of area
+ REP MOVSB ; Move list into area
+ POP SI
+; The list has been copied into the beginning of the
+; specified area of memory. SI is the first address
+; of that area, DI is the end of the copy of the list
+; plus one, which is where the list will begin to repeat.
+; All we need to do now is copy [SI] to [DI] until the
+; end of the memory area is reached. This will cause the
+; list to repeat as many times as necessary.
+ MOV CX,BX ; Length of area minus list
+ PUSH ES ; Different index register
+ POP DS ; requires different segment r
+ JMP SHORT COPYLIST ; Do the block move
+
+; Search a specified area of memory for given list of bytes.
+; Print address of first byte of each match.
+SEARCH:
+ CALL DSRANGE ; Get area to be searched
+
+ PUSH CX ; Save count
+ PUSH AX ; Save segment number
+ PUSH DX ; Save displacement
+ CALL LIST ; Get search list
+
+ DEC BX ; No. of bytes in list-1
+ POP DI ; Displacement within segment
+ POP ES ; Segment
+ POP CX ; Length to be searched
+ SUB CX,BX ; minus length of list
+SCAN:
+ MOV SI,OFFSET DG:BYTEBUF ; List kept in byte buffer
+ LODSB ; Bring first byte into AL
+DOSCAN:
+ SCASB ; Search for first byte
+ LOOPNE DOSCAN ; Do at least once by using LO
+
+ JNZ RET1 ; Exit if not found
+
+ PUSH BX ; Length of list minus 1
+ XCHG BX,CX
+ PUSH DI ; Will resume search here
+ REPE CMPSB ; Compare rest of string
+ MOV CX,BX ; Area length back in CX
+ POP DI ; Next search location
+ POP BX ; Restore list length
+ JNZ TTEST ; Continue search if no match
+
+ DEC DI ; Match address
+ CALL OUTDI ; Print it
+
+ INC DI ; Restore search address
+ CALL HEX_ADDRESS_ONLY ; Print the addresss
+
+ CALL CRLF
+
+TTEST:
+ JCXZ RET1
+
+ JMP SHORT SCAN ; Look for next occurrence
+
+; Get the next parameter, which must be a hex number.
+; CX is maximum number of digits the number may have.
+
+;=========================================================================
+; GETHX: This routine calculates the binary representation of an address
+; entered in ASCII by a user. GETHX has been modified to provide
+; support for sector addresses > 32mb. To do this the bx register
+; has been added to provide a 32 bit address. BX is the high word
+; and DX is the low word. For routines that rely on DX for a 16
+; bit address, the use of BX will have no effect.
+;
+; Date : 6/16/87
+;=========================================================================
+
+GETHX:
+ CALL SCANP
+GETHX1:
+ XOR DX,DX ; Initialize the number
+ xor bx,bx ;an000;initialize high word for
+ ; sector address
+ CALL HEXIN ; Get a hex digit
+
+ JC HXERR ; Must be one valid digit
+
+ MOV DL,AL ; First 4 bits in position
+GETLP:
+ INC SI ; Next char in buffer
+ DEC CX ; Digit count
+ CALL HEXIN ; Get another hex digit?
+
+ JC RETHX ; All done if no more digits
+
+ STC
+ JCXZ HXERR ; Too many digits?
+
+
+ call ADDRESS_32_BIT ;an000;multiply by 32
+ JMP SHORT GETLP ; Get more digits
+
+GETHEX:
+ CALL GETHX ; Scan to next parameter
+
+ JMP SHORT GETHX2
+
+GETHEX1:
+ CALL GETHX1
+GETHX2:
+ JC PERROR
+RETHX:
+ CLC
+HXERR:
+ RET
+
+; Check if next character in the input buffer is a hex digit
+; and convert it to binary if it is. Carry set if not.
+HEXIN:
+ MOV AL,[SI]
+; Check if AL is a hex digit and convert it to binary if it
+; is. Carry set if not.
+HEXCHK:
+ SUB AL,CHAR_ZERO ; Kill ASCII numeric bias
+ JC RET2
+
+ CMP AL,10
+ CMC
+ JNC RET2 ; OK if 0-9
+
+ AND AL,5FH
+ SUB AL,7 ; Kill A-F bias
+ CMP AL,10
+ JC RET2
+
+ CMP AL,16
+ CMC
+RET2:
+ RET
+
+; Process one parameter when a list of bytes is
+; required. Carry set if parameter bad. Called by LIST.
+LISTITEM:
+ CALL SCANP ; Scan to parameter
+
+ CALL HEXIN ; Is it in hex?
+
+ JC STRINGCHK ; If not, could be a string
+
+ MOV CX,2 ; Only 2 hex digits for bytes
+ push bx ;an000;save it - we stomp it
+ CALL GETHEX ; Get the byte value
+ pop bx ;an000;restore it
+
+ MOV [BX],DL ; Add to list
+ INC BX
+GRET:
+ CLC ; Parameter was OK
+ RET
+
+STRINGCHK:
+ MOV AL,[SI] ; Get first character of param
+ CMP AL,SINGLE_QUOTE ; String?
+ JZ STRING
+
+ CMP AL,DOUBLE_QUOTE ; Either quote is all right
+ JZ STRING
+
+ STC ; Not string, not hex - bad
+ RET
+STRING:
+ MOV AH,AL ; Save for closing quote
+ INC SI
+STRNGLP:
+ LODSB ; Next char of string
+ CMP AL,CR ; Check for end of line
+ JZ PERR ; Must find a close quote
+
+ CMP AL,AH ; Check for close quote
+ JNZ STOSTRG ; Add new character to list
+
+ CMP AH,[SI] ; Two quotes in a row?
+ JNZ GRET ; If not, we're done
+
+ INC SI ; Yes - skip second one
+STOSTRG:
+ MOV [BX],AL ; Put new char in list
+ INC BX
+ JMP SHORT STRNGLP ; Get more characters
+
+; Get a byte list for ENTER, FILL or SEARCH. Accepts any number
+; of 2-digit hex values or character strings in either single
+; (') or double (") quotes.
+LIST:
+ MOV BX,OFFSET DG:BYTEBUF ; Put byte list in the byte buffer
+LISTLP:
+ CALL LISTITEM ; Process a parameter
+
+ JNC LISTLP ; If OK, try for more
+
+ SUB BX,OFFSET DG:BYTEBUF ; BX now has no. of bytes in list
+ JZ PERROR ; List must not be empty
+
+; Make sure there is nothing more on the line except for
+; blanks and carriage return. If there is, it is an
+; unrecognized parameter and an error.
+GETEOL:
+ CALL SCANB ; Skip blanks
+
+ JNZ PERROR ; Better be a RETURN
+RET3:
+ RET
+
+; Command error. SI has been incremented beyond the command letter so it must
+; decremented for the error pointer to work.
+PERR:
+ DEC SI
+; Syntax error. SI points to character in the input buffer which caused
+; error. By subtracting from start of buffer, we will know how far to tab
+; over to appear directly below it on the terminal. Then print "^ Error".
+PERROR:
+ SUB SI,OFFSET DG:(BYTEBUF-1) ; How many char processed so far?
+ MOV CX,SI ; Parameter for TAB in CX
+ MOV DI,OFFSET DG:ARG_BUF ;
+ CALL TAB ; Directly below bad char
+
+ MOV BYTE PTR [DI],0 ; nul terminate the tab
+ MOV DX,OFFSET DG:SYNERR_PTR ; Error message
+; Print error message and abort to command level
+PRINT:
+ CALL PRINTF_CRLF
+
+ JMP COMMAND
+
+; Gets an address in Segment:Displacement format. Segment may be omitted
+; and a default (kept in BP) will be used, or it may be a segment
+; register (DS, ES, SS, CS). Returns with segment in AX, OFFSET in DX.
+ADDRESS:
+ CALL GET_ADDRESS
+
+ JC PERROR
+
+ADRERR:
+ STC
+ RET
+
+GET_ADDRESS:
+ CALL SCANP
+
+ MOV AL,[SI+1]
+ CMP AL,UPPER_S
+ JZ SEGREG
+
+ MOV CX,4
+ CALL GETHX
+
+ JC ADRERR
+
+ MOV AX,BP ; Get default segment
+ CMP BYTE PTR [SI],CHAR_COLON
+ JNZ GETRET
+
+ PUSH DX
+GETDISP:
+ INC SI ; Skip over ":"
+ MOV CX,4
+ CALL GETHX
+
+ POP AX
+ JC ADRERR
+
+GETRET:
+ CLC
+ RET
+
+SEGREG:
+ MOV AL,[SI]
+ MOV DI,OFFSET DG:SEGLET ; SEGLET DB "CSED"
+ MOV CX,4
+ REPNE SCASB
+ JNZ ADRERR
+
+ INC SI
+ INC SI
+ SHL CX,1
+ MOV BX,CX
+ CMP BYTE PTR [SI],CHAR_COLON
+ JNZ ADRERR
+
+ PUSH [BX+DSSAVE]
+ JMP SHORT GETDISP
+
+SEGLET DB "CSED" ; First letter of each of the segregs: CS,SS,ES,DS
+
+; Short form of ENTER command. A list of values from the
+; command line are put into memory without using normal
+; ENTER mode.
+GETLIST:
+ CALL LIST ; Get the bytes to enter
+
+ POP DI ; Displacement within segment
+ POP ES ; Segment to enter into
+ MOV SI,OFFSET DG:BYTEBUF ; List of bytes is in byte buffer
+ MOV CX,BX ; Count of bytes
+ REP MOVSB ; Enter that byte list
+ RET
+
+; Enter values into memory at a specified address. If the line contains
+; nothing but the address we go into "enter mode", where the address and its
+; current value are printed and the user may change it if desired. To change,
+; type in new value in hex. Backspace works to correct errors. If an illegal
+; hex digit or too many digits are typed, the bell is sounded but it is
+; otherwise ignored. To go to the next byte (with or without change), hit
+; space bar. To back CLDto a previous address, type "-". On every 8-byte
+; boundary a new line is started and the address is printed. To terminate
+; command, type carriage return.
+; Alternatively, the list of bytes to be entered may be included on the
+; original command line immediately following the address. This is in regular
+; LIST format so any number of hex values or strings in quotes may be entered.
+ENTERDATA:
+ MOV BP,[DSSAVE] ; Set default segment to DS
+ CALL ADDRESS
+
+ PUSH AX ; Save for later
+ PUSH DX
+ CALL SCANB ; Any more parameters?
+
+ JNZ GETLIST ; If not end-of-line get list
+
+ POP DI ; Displacement of ENTER
+ POP ES ; Segment
+GETROW:
+ CALL OUTDI ; Print address of entry
+
+ PUSH DI
+ PUSH ES
+ PUSH DS
+ POP ES
+ MOV DI,OFFSET DG:ARG_BUF
+ CALL BLANK
+
+ XOR AL,AL
+ STOSB
+ CALL HEX_ADDRESS_STR
+
+ POP ES
+ POP DI
+GETBYTE:
+ MOV AL,ES:[DI] ; Get current value
+ PUSH DI
+ PUSH ES
+ PUSH DS
+ POP ES
+ MOV DI,OFFSET DG:ARG_BUF
+ CALL HEX ; And display it
+
+ MOV AL,CHAR_PERIOD
+ STOSB
+ XOR AL,AL
+ STOSB
+ MOV DX,OFFSET DG:ARG_BUF_PTR
+ CALL STD_PRINTF
+
+ POP ES
+ POP DI
+LOOK_AGAIN:
+ MOV CX,2 ; Max of 2 digits in new value
+ MOV DX,0 ; Intial new value
+GETDIG:
+ CALL INPT ; Get digit from user
+
+ MOV AH,AL ; Save
+ CALL HEXCHK ; Hex digit?
+
+ XCHG AH,AL ; Need original for echo
+ JC NOHEX ; If not, try special command
+
+ MOV DH,DL ; Rotate new value
+ MOV DL,AH ; And include new digit
+ LOOP GETDIG ; At most 2 digits
+
+; We have two digits, so all we will accept now is a command.
+DWAIT:
+ CALL INPT ; Get command character
+NOHEX:
+ CMP AL,CHAR_BACKSPACE ; Backspace
+ JZ BS
+
+ CMP AL,CHAR_RUBOUT ; RUBOUT
+ JZ RUB
+
+ CMP AL,CHAR_MINUS ; Back up to previous address
+ JZ PREV
+
+ CMP AL,CR ; All done with command?
+ JZ EOL
+
+ CMP AL,CHAR_BLANK ; Go to next address
+ JZ NEXT
+
+ MOV AL,CHAR_BACKSPACE
+ CALL OUT_CHAR ; Back up over illegal character
+
+ CALL BACKUP
+
+ JCXZ DWAIT
+
+ JMP SHORT GETDIG
+
+RUB:
+ MOV AL,CHAR_BACKSPACE
+ CALL OUT_char
+BS:
+ CMP CL,2 ; CX=2 means nothing typed yet
+ JZ PUTDOT ; Put back the dot we backed up over
+
+ INC CL ; Accept one more character
+ MOV DL,DH ; Rotate out last digit
+ MOV DH,CH ; Zero this digit
+ CALL BACKUP ; Physical backspace
+
+ JMP SHORT GETDIG ; Get more digits
+
+PUTDOT:
+ MOV AL,CHAR_PERIOD
+ CALL OUT_CHAR
+
+ JMP LOOK_AGAIN
+
+; If new value has been entered, convert it to binary and
+; put into memory. Always bump pointer to next location
+STORE:
+ CMP CL,2 ; CX=2 means nothing typed yet
+ JZ NOSTO ; So no new value to store
+
+; Rotate DH left 4 bits to combine with DL and make a byte value
+ PUSH CX
+ MOV CL,4
+ SHL DH,CL
+ POP CX
+ OR DL,DH ; Hex is now converted to binary
+ MOV ES:[DI],DL ; Store new value
+NOSTO:
+ INC DI ; Prepare for next location
+ RET
+
+NEXT:
+ CALL STORE ; Enter new value
+
+ INC CX ; Leave a space plus two for
+ INC CX ; each digit not entered
+ PUSH DI
+ MOV DI,OFFSET DG:ARG_BUF
+ PUSH ES
+ PUSH DS
+ POP ES
+ CALL TAB
+
+ XOR AL,AL
+ STOSB
+ MOV DX,OFFSET DG:ARG_BUF_PTR
+ CALL STD_PRINTF
+
+ POP ES
+ POP DI
+ MOV AX,DI ; Next memory address
+ AND AL,7 ; Check for 8-byte boundary
+ JZ NEWROW ; Take 8 per line
+
+ JMP GETBYTE
+
+NEWROW:
+ CALL CRLF ; Terminate line
+
+ JMP GETROW ; Print address on new line
+
+PREV:
+ CALL STORE ; Enter the new value
+
+; DI has been bumped to next byte. Drop it 2 to go to previous addr
+ DEC DI
+ DEC DI
+ JMP SHORT NEWROW ; Terminate line after backing CLD
+
+EOL:
+ CALL STORE ; Enter the new value
+
+ JMP CRLF ; CR/LF and terminate
+
+; Console input of single character
+ IF SYSVER
+INPT: ;*** change for build - label to inpt
+ PUSH DS
+ PUSH SI
+ LDS SI,CS:[CIN]
+ MOV AH,4
+ CALL DEVIOCALL
+
+ POP SI
+ POP DS
+ CMP AL,3
+ JNZ NOTCNTC
+
+ INT VEC_CTRL_BREAK ;23H
+
+NOTCNTC:
+ CMP AL,UPPER_P - CHAR_AT_SIGN
+ JZ PRINTON
+
+ CMP AL,UPPER_N - CHAR_AT_SIGN
+ JZ PRINTOFF
+
+ CALL OUT_CHAR
+
+ RET
+
+PRINTOFF:
+PRINTON:
+ NOT [PFLAG]
+ JMP SHORT IN
+
+ ELSE
+INPT: ; Change label for build
+ MOV AH,Std_Con_Input ;OPTION=1, STANDARD CONSOLE INPUT
+ INT 21H
+
+ RET
+
+ ENDIF
+OUT_CHAR:
+ PUSH DI
+ PUSH DX
+ PUSH ES
+ PUSH DS
+ POP ES
+ MOV DI,OFFSET DG:ONE_CHAR_BUF
+ STOSB
+ MOV AL,0
+ STOSB
+ MOV DX,OFFSET DG:ONE_CHAR_BUF_PTR
+ CALL STD_PRINTF
+
+ POP ES
+ POP DX
+ POP DI
+ RET
+
+;=========================================================================
+; ADDRESS_32_BIT: This routine will build an address for 32bit sector
+; addressibility. BX will be the high word, with DX being
+; the low word.
+;
+; Inputs : DX/BX - registers to contain 32bit sector address
+; DX & BX are both initialized to 0 on first call to routine.
+;
+; Outputs: DX/BX - registers to contain 32bit sector address
+;
+; Date : 6/16/87
+;=========================================================================
+
+ADDRESS_32_BIT proc near ;an000;perform 32 bit address
+ ; creation
+ push cx ;an000;save affected regs.
+ mov cx,04h ;an000;initialize to
+ ; nibble shift
+; $do ;an000;while cx not= 0
+$$DO1:
+ cmp cx,00h ;an000;are we done?
+; $leave e ;an000;yes, quit loop
+ JE $$EN1
+ shl bx,1 ;an000;shift bx 1 bit
+ shl dx,1 ;an000;shift dx 1 bit
+; $if c ;an000;did low word carry
+ JNC $$IF3
+ or bx,01h ;an000;set bit 0 of high word
+; $endif ;an000;
+$$IF3:
+ dec cx ;an000;decrease counter
+; $enddo ;an000;end while loop
+ JMP SHORT $$DO1
+$$EN1:
+ or dl, al ;an000;overlay low word
+ ; bits 0-3 with next
+ ; portion of the address
+ pop cx ;an000;restore affected regs.
+
+ ret ;an000;return to caller
+
+ADDRESS_32_BIT endp ;an000;end proc
+
+
+
+CODE ENDS
+ END DEBCOM1
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debcom2.asm b/private/mvdm/dos/v86/cmd/debug/debcom2.asm
new file mode 100644
index 000000000..4b3f8ed48
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debcom2.asm
@@ -0,0 +1,1495 @@
+ PAGE 60,132 ;
+ TITLE DEBCOM2.ASM - PART2 DEBUGGER COMMANDS PC DOS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DECOM2.ASM
+;
+; DESCRIPTIVE NAME: DEBUGGING TOOL
+;
+; FUNCTION: PROVIDES USERS WITH A TOOL FOR DEBUGGING PROGRAMS.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: DEBCOM1 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBCOM3 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBUASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBMES - CONTAINS ROUTINES CALLED BY DEBUG
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+; AC000 VERSION 4.00 -
+;
+; - IMPLEMENT DBCS HANDLING DMS:6/17/87
+; - IMPLEMENT MESSAGE RETRIEVER DMS:6/17/87
+; - IMPLEMENT > 32MB SUPPORT DMS:6/17/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+;======================= END OF SPECIFICATIONS ===========================
+;
+; Change Log:
+;
+; Date WHO # Description
+; -------- --- --- ----------------------------------------------------
+; 04/01/90 DIC C01 Problem fixed - When writing a file to a full disk,
+; file would be deleted if there wasn't enough space.
+; Fix checks to make sure there is enough space.
+; (Compaq STR #1889) (Microsoft Bug #774)
+;
+; 05/25/90 AKM C08 Problem fixed - Added code to limit the file size
+; for the write command. Size check code changed
+; because of divide overflow error.
+; (Microsoft Bug #1157)
+;
+; 07/31/90 AKM C09 Problem fixed - The fix for C08 broke C01. Took out
+; C08 and changed to two divides to a multiply and
+; a divide (divide by BytesPerClust). Also, the
+; volume freee space was not added to the file free
+; space when overwriting a file.
+;
+;===========================================================================
+; Routines to perform debugger commands except ASSEMble and UASSEMble
+
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBCOM2
+ ENDIF
+.XLIST
+.XCREF
+ include syscall.inc ; cas -- missing equates
+ include version.inc ; cas -- missing equates
+ include pdb.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+.CREF
+.LIST
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN NOTFND_PTR:BYTE,NOROOM_PTR:BYTE,DRVLET:BYTE,ERRMES_PTR:BYTE
+ EXTRN NAMBAD_PTR:BYTE,NOSPACE_PTR:BYTE,TOOBIG_PTR:BYTE
+ EXTRN HEXERR_PTR:BYTE,HEXWRT_PTR:BYTE,ACCMES_PTR:BYTE
+ EXTRN EXEBAD_PTR:BYTE,EXEWRT_PTR:BYTE
+ EXTRN EXECEMES_PTR:BYTE,NONAMESPEC_PTR:BYTE
+
+ EXTRN FLAGTAB:WORD,EXEC_BLOCK:BYTE,COM_LINE:DWORD,COM_FCB1:DWORD
+ EXTRN COM_FCB2:DWORD,COM_SSSP:DWORD,COM_CSIP:DWORD,RETSAVE:WORD
+ EXTRN NEWEXEC:BYTE,HEADSAVE:WORD
+ EXTRN REGTAB:BYTE,TOTREG:BYTE,NOREGL:BYTE
+ EXTRN USER_PROC_PDB:WORD,STACK:BYTE,RSTACK:WORD,AXSAVE:WORD
+ EXTRN BXSAVE:WORD,DSSAVE:WORD,ESSAVE:WORD,CSSAVE:WORD,IPSAVE:WORD
+ EXTRN SSSAVE:WORD,CXSAVE:WORD,SPSAVE:WORD,FLSAVE:WORD
+ EXTRN SREG:BYTE,SEGTAB:WORD,REGDIF:ABS,RDFLG:BYTE
+ EXTRN REGTABEND:WORD
+ EXTRN NAMESPEC:BYTE
+
+ EXTRN FileSizeLB:WORD,FileSizeHB:WORD,TempHB:WORD,TempLB:WORD ;C01
+ EXTRN DriveOfFile:WORD ;C01
+
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN DEFDUMP:BYTE,TRANSADD:DWORD,INDEX:WORD,BUFFER:BYTE
+ EXTRN ASMADD:BYTE,DISADD:BYTE,NSEG:WORD
+ EXTRN SWITCHAR:BYTE,XNXCMD:BYTE,XNXOPT:BYTE
+ EXTRN AWORD:BYTE,EXTPTR:WORD,HANDLE:WORD,PARSERR:BYTE
+ EXTRN REG_NAME:WORD,REG_CONTENTS:WORD,REGISTER_PTR:BYTE
+ EXTRN ARG_BUF:BYTE,ARG_BUF_PTR:BYTE,LOC_ADD:WORD,LOC_PTR:BYTE
+ EXTRN BIG_CONTENTS:WORD,BIG_PTR:BYTE,LITTLE_CONTENTS:WORD,LITTLE_PTR:BYTE
+ EXTRN SINGLE_REG_ARG:WORD,CHANGE_FLAG_PTR:BYTE,DF_ERROR:BYTE
+ EXTRN BR_ERROR:BYTE,BF_ERROR:BYTE,SINGLE_REG_PTR:WORD
+ EXTRN WRT_ARG1:WORD,WRT_ARG2:WORD,WRTMES_PTR:BYTE,BEGSEG:WORD
+ EXTRN FILESTRT:WORD,FILEEND:WORD
+ EXTRN ERR_TYPE:BYTE ;ac000;converted to buffer
+
+ extrn rel_read_write_tab:dword ;an000;primitive I/O
+ extrn rel_rw_add:dword ;an000;transfer address
+ extrn rel_low_sec:word ;an000;low sector word
+ extrn rel_high_sec:word ;an000;high sector word
+ extrn rel_sec_num:word ;an000;# of sectors
+
+fnd_dbcs db 0
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+ PUBLIC DEFIO,PREPNAME,DEBUG_FOUND
+ PUBLIC REG,LOAD
+ PUBLIC NAMED,DWRITE
+ PUBLIC DISPREG,ERR,DELIM1,DELIM2,delim0
+ public getchrup,open1,open2,open3,open4,oc_file,opnret ;an001;bgb
+ public delete_a_file, parse_a_file, exec_a_file, open_a_file, create_a_file ;an001;bgb
+ public gcur,ifhex ;an001;bgb
+ public comtail ;an001;bgb
+ extrn test_lead:near ;an001;bgb
+ EXTRN OUTSI:NEAR,OUTDI:NEAR,INBUF:NEAR,SCANB:NEAR,SCANP:NEAR
+ EXTRN COMMAND:NEAR,DISASLN:NEAR,SET_TERMINATE_VECTOR:NEAR
+ EXTRN RESTART:NEAR,TERMINATE:NEAR,DRVERR:NEAR
+ EXTRN GETHEX:NEAR,GETEOL:NEAR,SKIP_FILE:NEAR
+ EXTRN HEXCHK:NEAR,GETHEX1:NEAR,PRINT:NEAR
+ EXTRN CRLF:NEAR,BLANK:NEAR
+ EXTRN HEX:NEAR,DIGIT:NEAR
+ EXTRN FIND_DEBUG:NEAR
+ EXTRN ADDRESS:NEAR,PERROR:NEAR
+ EXTRN STD_PRINTF:NEAR,PRINTF_CRLF:NEAR
+DEBCOM2:
+DISPLAY_LINE:
+ mov ax,word ptr [si] ;an000;move reg name to ax
+ MOV [REG_NAME],ax ;ac000;save it in reg_name
+ ADD SI,3
+ MOV AX,[BX]
+ ADD BX,2
+ MOV [REG_CONTENTS],AX
+ MOV DX,OFFSET DG:REGISTER_PTR
+ CALL STD_PRINTF
+
+ LOOP DISPLAY_LINE
+
+ RETURN
+
+DISPLAY_FLAGS:
+ MOV DI,OFFSET DG:ARG_BUF
+ MOV AL,CHAR_BLANK
+ STOSB
+DISPLAY_FLAGS_2:
+ MOV SI,OFFSET DG:FLAGTAB
+ MOV CX,16
+ MOV DX,[FLSAVE]
+DFLAGS:
+ LODS CS:WORD PTR [SI]
+ SHL DX,1
+ JC FLAGSET
+
+ MOV AX,CS:[SI+30]
+FLAGSET:
+ OR AX,AX
+ JZ NEXT_FLAG
+
+ STOSW
+ MOV AL,CHAR_BLANK
+ STOSB
+NEXT_FLAG:
+ LOOP DFLAGS
+ XOR AL,AL
+ STOSB
+ RETURN
+
+DISPREG:
+ MOV SI,OFFSET DG:REGTAB
+ MOV DI,OFFSET DG:ARG_BUF
+ MOV BX,OFFSET DG:AXSAVE
+ MOV BYTE PTR TOTREG,CR
+ MOV CH,0
+ MOV CL,NOREGL
+SET_DISPLAY:
+REPEAT_DISPLAY:
+ SUB TOTREG,CL
+ CALL DISPLAY_LINE
+
+ CALL CRLF
+
+ XOR CH,CH
+ MOV CL,NOREGL
+ CMP CL,TOTREG
+ JB REPEAT_DISPLAY
+
+ MOV CL,TOTREG
+ CALL DISPLAY_LINE
+
+ CALL DISPLAY_FLAGS
+
+ MOV DX,OFFSET DG:ARG_BUF_PTR
+ CALL PRINTF_CRLF
+
+ MOV AX,[IPSAVE]
+ MOV WORD PTR [DISADD],AX
+ PUSH AX
+ MOV AX,[CSSAVE]
+ MOV WORD PTR [DISADD+WORD],AX
+ PUSH AX
+ MOV [NSEG],-1
+ CALL DISASLN
+
+ POP WORD PTR DISADD+WORD
+ POP WORD PTR DISADD
+ MOV AX,[NSEG]
+ CMP AL,-1
+ JNZ ASSEM_LIN_CONT
+
+ JMP CRLF
+
+ASSEM_LIN_CONT:
+ CMP AH,-1
+ JZ NOOVER
+
+ XCHG AL,AH
+NOOVER:
+ CBW
+ MOV BX,AX
+ SHL BX,1
+ MOV AX,WORD PTR [BX+SREG]
+ MOV DI,OFFSET DG:ARG_BUF
+ STOSB
+ XCHG AL,AH
+ STOSB
+ XOR AL,AL
+ STOSB
+ MOV DX,[INDEX]
+ MOV LOC_ADD,DX
+ MOV DX,OFFSET DG:LOC_PTR
+ CALL STD_PRINTF
+
+ MOV BX,[BX+SEGTAB]
+ PUSH DS
+ MOV DS,[BX]
+ MOV BX,CS:[INDEX]
+
+; M000 -- begin changes.
+;
+; When we're running a '386 CPU, fetching from word [ffff] causes
+; a CPU fault, which causes a fatal fault on Win 3 enhanced or EMM386,
+; and on some machines (like COMPAQs) even in real mode. Therefore,
+; we'll replace the word fetch with a byte fetch. Notice that the
+; new code trashes AL. The subroutines in the vicinity preserve
+; it, it was left zeroed when most recently used, and does not have
+; a guaranteed value on return from this subroutine.
+;
+; Notice that the ACTUAL value we display on word [ffff]
+; references will be the same as an 8088 would use for that
+; operation. If the user goes ahead and executes said
+; instruction on a 386, it will fault!
+;
+; MOV BX,[BX] ; old code used word fetch
+
+ mov al,[bx] ; get low byte
+ mov bh,1[bx] ; get high byte
+ mov bl,al ; get both into bx
+
+; M000 -- end changes.
+
+ POP DS
+ MOV BIG_CONTENTS,BX
+ MOV DX,OFFSET DG:BIG_PTR
+ TEST BYTE PTR [AWORD],-1
+ JNZ SHOW_CHARS
+
+ XOR BH,BH
+ MOV LITTLE_CONTENTS,BX
+ MOV DX,OFFSET DG:LITTLE_PTR
+SHOW_CHARS:
+ CALL PRINTF_CRLF
+
+ RETURN
+
+DISPREGJ:
+ JMP DISPREG
+
+; Perform register dump if no parameters or set register if a
+; register designation is a parameter.
+REG:
+ CALL SCANP
+
+ JZ DISPREGJ
+
+ MOV DL,[SI]
+ INC SI
+ MOV DH,[SI]
+ CMP DH,CR
+ JZ FLAG
+
+ INC SI
+ CALL GETEOL
+
+ CMP DH,CHAR_BLANK
+ JZ FLAG
+
+ MOV DI,OFFSET DG:REGTAB
+ XCHG AX,DX
+ PUSH CS
+ POP ES
+ XOR CX,CX
+CHECK_NEXT_REG:
+ CMP AX,WORD PTR[ DI]
+ JZ REG_FOUND
+
+ ADD DI,3
+ INC CX
+ CMP DI,OFFSET DG:REGTABEND
+ JB CHECK_NEXT_REG
+
+ JMP short BADREG
+
+REG_FOUND:
+ CMP DI,OFFSET DG:REGTABEND
+ JNZ NOTPC
+
+ DEC DI
+ DEC DI
+ DEC DI
+ MOV AX,CS:[DI-WORD]
+NOTPC:
+ PUSH DI
+ MOV DI,OFFSET DG:ARG_BUF
+ STOSB
+ XCHG AL,AH
+ STOSB
+ XOR AL,AL
+ STOSB
+ POP DI
+ PUSH DS
+ POP ES
+ LEA BX,[DI+REGDIF]
+ SUB BX,CX
+ MOV DX,[BX]
+ MOV SINGLE_REG_ARG,DX
+ MOV DX,OFFSET DG:SINGLE_REG_PTR
+ CALL STD_PRINTF
+
+ CALL INBUF
+
+ CALL SCANB
+
+ RETZ
+
+ push bx ;an000;save bx - we stomp it
+ MOV CX,4
+ CALL GETHEX1
+ pop bx ;an000;restore it
+
+ CALL GETEOL
+
+ MOV [BX],DX
+ RETURN
+BADREG:
+ MOV DX,OFFSET DG:BR_ERROR ; BR ERROR
+ JMP short ERR
+
+FLAG:
+ CMP DL,UPPER_F
+ JNZ BADREG
+
+ MOV DI,OFFSET DG:ARG_BUF
+ CALL DISPLAY_FLAGS_2
+
+ MOV DX,OFFSET DG:CHANGE_FLAG_PTR
+ CALL STD_PRINTF
+
+ CALL INBUF
+
+ CALL SCANB
+
+ XOR BX,BX
+ MOV DX,[FLSAVE]
+GETFLG:
+ LODSW
+ CMP AL,CR
+ JZ SAVCHG
+
+ CMP AH,CR
+ JZ FLGERR
+
+ MOV DI,OFFSET DG:FLAGTAB
+ MOV CX,32
+ PUSH CS
+ POP ES
+ REPNE SCASW
+ JNZ FLGERR
+
+ MOV CH,CL
+ AND CL,0FH
+ MOV AX,1
+ ROL AX,CL
+ TEST AX,BX
+ JNZ REPFLG
+
+ OR BX,AX
+ OR DX,AX
+ TEST CH,16
+ JNZ NEXFLG
+
+ XOR DX,AX
+NEXFLG:
+ CALL SCANP
+
+ JMP SHORT GETFLG
+
+REPFLG:
+ MOV DX,OFFSET DG:DF_ERROR ; DF ERROR
+FERR:
+ CALL SAVCHG
+ERR:
+ push si ;an000;save affected registers
+ push di ;an000;
+ push cx ;an000;
+ mov cx,03h ;an000;move only three bytes
+ mov di,offset dg:err_type ;an000;point to buffer
+ mov si,dx ;an000;dx holds the string
+ rep movsb ;an000;fill up the buffer
+ pop cx ;an000;restore registers
+ pop di ;an000;
+ pop si ;an000;
+ MOV DX,OFFSET DG:ERRMES_PTR
+ JMP PRINT
+
+SAVCHG:
+ MOV [FLSAVE],DX
+ RETURN
+
+FLGERR:
+ MOV DX,OFFSET DG:BF_ERROR ; BF ERROR
+ JMP SHORT FERR
+
+PREPNAME:
+ MOV ES,DSSAVE
+ PUSH SI
+ MOV DI,81H
+COMTAIL:
+ LODSB
+ STOSB
+ CMP AL,CR
+ JNZ COMTAIL
+
+ SUB DI,82H
+ XCHG AX,DI
+ MOV ES:(BYTE PTR [80H]),AL
+ POP SI
+ MOV DI,FCB ;05cH
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR SET_DRIVEID_OPTION ;AL=01H
+ INT 21H
+
+ MOV BYTE PTR [AXSAVE],AL ; Indicate analysis of first parm
+ CALL SKIP_FILE
+
+ MOV DI,6CH
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR SET_DRIVEID_OPTION ;AL=01H
+ INT 21H
+
+ MOV BYTE PTR [AXSAVE+1],AL ; Indicate analysis of second parm
+ RETURN
+
+; OPENS A XENIX PATHNAME SPECIFIED IN THE UNFORMATTED PARAMETERS
+; VARIABLE [XNXCMD] SPECIFIES WHICH COMMAND TO OPEN IT WITH
+
+; VARIABLE [HANDLE] CONTAINS THE HANDLE
+; VARIABLE [EXTPTR] POINTS TO THE FILES EXTENSION
+DELETE_A_FILE:
+ MOV BYTE PTR [XNXCMD],UNLINK
+ JMP SHORT OC_FILE
+
+PARSE_A_FILE:
+ MOV BYTE PTR [XNXCMD],0
+ JMP SHORT OC_FILE
+
+EXEC_A_FILE:
+ MOV BYTE PTR CS:[XNXCMD],EXEC
+ MOV BYTE PTR CS:[XNXOPT],1
+ JMP SHORT OC_FILE
+
+OPEN_A_FILE:
+ MOV BYTE PTR [XNXCMD],OPEN
+ MOV BYTE PTR [XNXOPT],2 ; Try read write
+ CALL OC_FILE
+
+ RETNC
+ MOV BYTE PTR [XNXCMD],OPEN
+ MOV BYTE PTR [XNXOPT],0 ; Try read only
+ JMP SHORT OC_FILE
+
+CREATE_A_FILE:
+ MOV BYTE PTR [XNXCMD],CREAT
+OC_FILE:
+ PUSH DS
+ PUSH ES
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH SI
+ XOR AX,AX
+ MOV CS:[EXTPTR],AX ; INITIALIZE POINTER TO EXTENSIONS
+ MOV AH,CHAR_OPER
+ INT 21H
+
+ MOV CS:[SWITCHAR],DL ; GET THE CURRENT SWITCH CHARACTER
+ MOV SI,81H
+
+open1: CALL GETCHRUP ;convert 1 byte to uppercase
+ CALL DELIM2 ; END OF LINE?
+ JZ OPEN4
+
+ CALL DELIM1 ; SKIP LEADING DELIMITERS
+ JZ OPEN1
+
+ MOV DX,SI ; SAVE POINTER TO BEGINNING
+ cmp fnd_dbcs,1
+; $if z
+ JNZ $$IF1
+ dec dx ;dec it twice if dbcs
+; $endif
+$$IF1:
+ DEC DX
+open2: CMP AL,CHAR_PERIOD ; LAST CHAR A "."?
+ JNZ OPEN3
+
+ MOV CS:[EXTPTR],SI ; SAVE POINTER TO THE EXTENSION
+OPEN3:
+ CALL GETCHRUP
+
+ CALL DELIM1 ; LOOK FOR END OF PATHNAME
+
+ JZ OPEN4
+
+ CALL DELIM2
+
+ JNZ OPEN2
+
+OPEN4: DEC SI ; POINT BACK TO LAST CHAR
+ PUSH [SI] ; SAVE TERMINATION CHAR
+ MOV BYTE PTR [SI],0 ; NULL TERMINATE THE STRING
+ MOV AL,CS:[XNXOPT]
+ MOV AH,CS:[XNXCMD] ; OPEN OR CREATE FILE
+ OR AH,AH
+ JZ OPNRET
+
+ MOV CS:[FILESTRT],DX ; Set values for later call on this file
+ MOV CS:[FILEEND],SI
+ PUSH CS
+ POP ES ; Set ES seg for EXEC_BLOCK
+ MOV BX,OFFSET DG:EXEC_BLOCK
+ XOR CX,CX
+ INT 21H
+
+ MOV CS:[HANDLE],AX ; SAVE ERROR CODE OR HANDLE
+OPNRET:
+ POP [SI]
+ POP SI
+ POP DX
+ POP CX
+ POP BX
+ POP AX ; blow away error code...
+ POP ES
+ POP DS
+ RETURN
+
+GETCHRUP: ;an001;bgb
+ lodsb ;get the character from [si] ;an001;bgb
+ call test_lead ;is it a dbcs lead byte? ;an001;bgb
+; $IF C ;yes ;an001;bgb
+ JNC $$IF3
+ inc si ;bump ptr to past 2nd dbcs byte ;an001;bgb
+ mov fnd_dbcs,1 ;found a dbcs char
+ jmp short gcur ;dont capitalize it ;an001;bgb
+; $ENDIF ;an001;bgb
+$$IF3:
+ ; ;an001;bgb
+ mov fnd_dbcs,0 ;did not find a dbcs char
+ cmp al,lower_a ;is it >= "a" ? ;an001;bgb
+ jb gcur ;no - exit ;an001;bgb
+ ;an001;bgb
+ cmp al,lower_z ;is it =< "z" ? ;an001;bgb
+ ja gcur ;no - exit ;an001;bgb
+ ;an001;bgb
+;if we get here, the char is lowercase, so change it ;an001;bgb
+ sub al,32 ;convert to uppercase ;an001;bgb
+ mov [si-1],al ;move it back (si points 1 past) ;an001;bgb
+gcur: return ;an001;bgb
+
+DELIM0:
+ CMP AL,CHAR_LEFT_BRACKET
+ RETZ
+DELIM1:
+ CMP AL,CHAR_BLANK ; SKIP THESE GUYS
+ RETZ
+
+ CMP AL,CHAR_SEMICOLON
+ RETZ
+
+ CMP AL,CHAR_EQUAL
+ RETZ
+
+ CMP AL,CHAR_TAB
+ RETZ
+
+ CMP AL,CHAR_COMMA
+ RETURN
+
+DELIM2:
+ CMP AL,CS:[SWITCHAR] ; STOP ON THESE GUYS
+ RETZ
+
+ CMP AL,CR
+ RETURN
+
+NAMED:
+ OR [NAMESPEC],1 ; Flag a name command executed
+ CALL PREPNAME
+
+ MOV AL,BYTE PTR AXSAVE
+ MOV PARSERR,AL
+ PUSH ES
+ POP DS
+ PUSH CS
+ POP ES
+ MOV SI,FCB ; DS:SI points to user FCB
+ MOV DI,SI ; ES:DI points to DEBUG FCB
+ MOV CX,82
+ REP MOVSW
+ RETURN
+
+BADNAM:
+ MOV DX,OFFSET DG:NAMBAD_PTR
+ JMP RESTART
+
+IFHEX:
+ CMP BYTE PTR [PARSERR],-1 ; Invalid drive specification?
+ JZ BADNAM
+
+ CALL PARSE_A_FILE
+
+ MOV BX,[EXTPTR]
+ CMP WORD PTR DS:[BX],"EH" ; "HE"
+ RETNZ
+
+ CMP BYTE PTR DS:[BX+WORD],UPPER_X
+ RETURN
+
+IFEXE:
+ PUSH BX
+ MOV BX,[EXTPTR]
+ CMP WORD PTR DS:[BX],"XE" ; "EX"
+ JNZ RETIF
+
+ CMP BYTE PTR DS:[BX+WORD],UPPER_E
+RETIF:
+ POP BX
+ RETURN
+
+LOAD:
+ MOV BYTE PTR [RDFLG],READ
+ JMP SHORT DSKIO
+
+DWRITE:
+ MOV BYTE PTR [RDFLG],WRITE
+DSKIO:
+ MOV BP,[CSSAVE]
+ CALL SCANB
+
+ jz DEFIO
+
+ CALL ADDRESS
+
+ CALL SCANB
+
+ jz FILEIO
+
+;=========================================================================
+; PRMIO: This routine builds the necessary table for the new
+; generic IOCtl primitive read/write logical sector function.
+;
+; Inputs : Binary addresses and values converted by GETHEX
+;
+; Outputs: REL_READ_WRITE_TAB - Table needed by IOCtl function to
+; perform 32 bit sector addressing.
+;
+; Date : 6/17/87
+;=========================================================================
+
+ mov word ptr dg:[rel_rw_add],dx ;ac000;save transfer address
+ ; in table
+ mov word ptr dg:[rel_rw_add+2],ax ;ac000;save segment of transfer
+ ; address
+ MOV CX,2
+ CALL GETHEX ; Drive number must be 2 digits or less
+
+ PUSH DX ;save drive number
+ MOV CX,8 ;ac000;allow 32 bit addressibilty
+ CALL GETHEX ; Logical record number
+ mov word ptr dg:[rel_low_sec],dx ;ac000;save low word of logical
+ ; sector address
+ mov word ptr dg:[rel_high_sec],bx ;ac000;save high word of
+ ; logical sector address
+
+ MOV CX,3
+ CALL GETHEX ; Number of records
+ mov word ptr dg:[rel_sec_num],dx ;ac000;save number of sectors
+ ; to read/write
+
+ CALL GETEOL
+
+ POP BX ;ac000;drive number
+ CBW ; Turn off verify after write
+ MOV BYTE PTR DRVLET,bl ;ac000;save drive in case of error
+ PUSH BX
+ MOV DL,bL ;ac000;move drive to dl
+; Clean off the buffer cache for physical I/O
+ push ds
+ MOV AH,DISK_RESET
+ INT 21H
+
+ INC DL
+ MOV AH,GET_DPB
+ INT 21H
+ pop ds
+
+ or al,al ;ac000;see if an error occurred
+ pop ax ;ac000;restore drive
+
+ JNZ DRVERRJ
+
+ CMP CS:BYTE PTR [RDFLG],WRITE
+; $if z ;an000;we will write to sector(s)
+ JNZ $$IF5
+ call ABSWRT ;an000;logical sector write
+; $else ;an000;
+ JMP SHORT $$EN5
+$$IF5:
+ call ABSREAD ;an000;we will read sector(s)
+; $endif ;an000;
+$$EN5:
+
+
+ENDABS:
+ JNC RET0
+
+DRVERRJ:
+ JMP DRVERR
+
+RET0:
+; Clean cache again...
+ MOV AH,DISK_RESET
+ INT 21H
+
+ RETURN
+
+
+;called from debug.asm
+DEFIO:
+ MOV AX,[CSSAVE] ; Default segment
+ MOV DX,100H ; Default file I/O offset
+ CALL IFHEX
+ JNZ EXECHK
+ XOR DX,DX ; If HEX file, default OFFSET is zero
+HEX2BINJ:
+ JMP HEX2BIN
+
+FILEIO:
+; AX and DX have segment and offset of transfer, respectively
+ CALL IFHEX
+ JZ HEX2BINJ
+
+EXECHK:
+ CALL IFEXE
+ JNZ BINFIL
+ CMP BYTE PTR [RDFLG],READ
+ JZ EXELJ
+ MOV DX,OFFSET DG:EXEWRT_PTR
+ JMP RESTART ; Can't write .EXE files
+
+BINFIL:
+ CMP BYTE PTR [RDFLG],WRITE
+ JZ BINLOAD
+ CMP WORD PTR DS:[BX],4F00H + UPPER_C ;"CO"
+ JNZ BINLOAD
+ CMP BYTE PTR DS:[BX+WORD],UPPER_M
+ JNZ BINLOAD
+
+EXELJ:
+ DEC SI
+ CMP DX,100H
+ JNZ PRER
+
+ CMP AX,[CSSAVE]
+ JZ OAF
+
+PRER:
+ JMP PERROR
+
+OAF:
+ CALL OPEN_A_FILE
+
+ JNC GDOPEN
+
+ MOV AX,ERROR_FILE_NOT_FOUND
+ JMP EXECERR
+
+GDOPEN:
+ XOR DX,DX
+ XOR CX,CX
+ MOV BX,[HANDLE]
+ MOV AL,2
+ MOV AH,LSEEK
+ INT 21H
+
+ CALL IFEXE ; SUBTRACT 512 BYTES FOR EXE
+
+ JNZ BIN2 ; FILE LENGTH BECAUSE OF
+
+ SUB AX,512 ; THE HEADER
+ SBB DX,0 ; reflect borrow, if any
+
+BIN2:
+ MOV [BXSAVE],DX ; SET UP FILE SIZE IN DX:AX
+ MOV [CXSAVE],AX
+ MOV AH,CLOSE
+ INT 21H
+
+ JMP EXELOAD
+
+NO_MEM_ERR:
+ MOV DX,OFFSET DG:TOOBIG_PTR
+ CALL PRINTF_CRLF
+
+ JMP COMMAND
+
+WRTFILEJ:
+ JMP WRTFILE
+NOFILEJ:
+ MOV FileSizeLB,0 ;save low value of file size ;C01
+ MOV FileSizeHB,0 ;save high value of file size ;C01
+ JMP NOFILE
+
+BINLOAD:
+ PUSH AX
+ PUSH DX
+ CMP BYTE PTR [RDFLG],WRITE
+ JZ WRTFILEJ
+
+ CALL OPEN_A_FILE
+
+ JC NOFILEJ
+
+ MOV BX,[HANDLE]
+ MOV AX,(LSEEK SHL 8) OR LSEEK_EOF_OPTION
+ XOR DX,DX ;CX:DX=DISTANCE (OFFSET) TO MOVE IN BYTES
+ MOV CX,DX
+ INT 21H ; GET SIZE OF FILE
+
+ MOV FileSizeLB,ax ; save low value of file size ;C01
+ MOV FileSizeHB,dx ; save high value of file size ;C01
+ MOV TempLB,ax ; save low value of file size ;C01
+ MOV TempHB,dx ; save high value of file size ;C01
+
+ MOV SI,DX
+ MOV DI,AX ; SIZE TO SI:DI
+ MOV AX,(LSEEK SHL 8) OR LSEEK_FROM_START
+ XOR DX,DX
+ MOV CX,DX
+ INT 21H ; RESET POINTER BACK TO BEGINNING
+
+ POP AX
+ POP BX
+ PUSH BX
+ PUSH AX ; TRANS ADDR TO BX:AX
+ ADD AX,15
+ RCR AX,1
+ MOV CL,3
+ MOV CL,4
+ SHR AX,CL
+ ADD BX,AX ; Start of transfer rounded up to seg
+ MOV DX,SI
+ MOV AX,DI ; DX:AX is size
+ cmp dx,10h
+ jnc no_mem_err
+ MOV CX,16
+ DIV CX
+ OR DX,DX
+ JZ NOREM
+
+ INC AX
+NOREM: ; AX is number of paras in transfer
+ ADD AX,BX ; AX is first seg that need not exist
+ jc no_mem_err
+ CMP AX,CS:[PDB_BLOCK_LEN]
+ JA NO_MEM_ERR
+
+ MOV CXSAVE,DI
+ MOV BXSAVE,SI
+ POP DX
+ POP AX
+; AX:DX is disk transfer address (segment:offset)
+; SI:DI is length (32-bit number)
+RDWR:
+RDWRLOOP:
+ MOV BX,DX ; Make a copy of the offset
+ AND DX,000FH ; Establish the offset in 0H-FH range
+ MOV CL,4
+ SHR BX,CL ; Shift offset and
+ ADD AX,BX ; Add to segment register to get new Seg:offset
+ PUSH AX
+ PUSH DX ; Save AX,DX register pair
+ MOV WORD PTR [TRANSADD],DX
+ MOV WORD PTR [TRANSADD+WORD],AX
+ MOV CX,0FFF0H ; Keep request in segment
+ OR SI,SI ; Need > 64K?
+ JNZ BIGRDWR
+
+ MOV CX,DI ; Limit to amount requested
+BIGRDWR:
+ PUSH DS
+ PUSH BX
+ MOV BX,[HANDLE]
+ MOV AH,[RDFLG]
+ LDS DX,[TRANSADD]
+ INT 21H ; Perform read or write
+
+ POP BX
+ POP DS
+ JC BADWR
+
+ CMP BYTE PTR [RDFLG],WRITE
+ JNZ GOODR
+
+ CMP CX,AX
+ JZ GOODR
+
+BADWR:
+ MOV CX,AX
+ STC
+ POP DX ; READ OR WRITE BOMBED OUT
+ POP AX
+ RETURN
+
+GOODR:
+ MOV CX,AX
+ SUB DI,CX ; Request minus amount transferred
+ SBB SI,0 ; Ripple carry
+ OR CX,CX ; End-of-file?
+
+ mov ax,TempHB ; new file size value high byte ;C01
+ mov FileSizeHB,ax ; if write was successful ;C01
+ mov ax,TempLB ; new file size value low byte ;C01
+ mov FileSizeLB,ax ; if write was successful ;C01
+
+ POP DX ; Restore DMA address
+ POP AX
+ JZ DOCLOSE
+
+ ADD DX,CX ; Bump DMA address by transfer length
+ MOV BX,SI
+ OR BX,DI ; Finished with request
+ JNZ RDWRLOOP
+
+DOCLOSE:
+ SAVEREG <AX,BX>
+ MOV BX,HANDLE
+ MOV AH,CLOSE
+ INT 21H
+
+ RESTOREREG <BX,AX>
+ RETURN
+
+NOFILE:
+ MOV DX,OFFSET DG:NOTFND_PTR
+ JMP RESTART
+
+NO_NAME_GIVEN:
+ MOV DX,OFFSET DG:NONAMESPEC_PTR
+RESTARTJMP:
+ JMP RESTART
+
+WRTFILE:
+ CMP [NAMESPEC],0
+ JZ NO_NAME_GIVEN ; Hey User, you forgot to specify a name
+
+ CALL ChkFileSz ;C01
+
+ CALL CREATE_A_FILE ; Create file we want to write to
+
+ JC CHECKREADONLY ; ARR 2.4
+
+ MOV SI,BXSAVE ; Get high order number of bytes to transfer
+;C08 CMP SI,000FH
+;C08 JLE WRTSIZE ; Is bx less than or equal to FH
+;C08
+;C08 XOR SI,SI ; Ignore BX if greater than FH - set to zero
+ MOV DI,CXSAVE ;C08
+ CMP SI,7FFFH ;C08
+ JBE WRTSIZE ; Is bx less than or equal to 7FFF;C08
+ ; Limit fsize to 2GB ;C08
+ MOV SI,7FFFH ; Setup maximum file size. ;C08
+ MOV DI,0FFFFH ;C08
+WRTSIZE:
+ MOV WRT_ARG2,SI
+;C08 MOV DI,CXSAVE
+ MOV WRT_ARG1,DI
+ MOV DX,OFFSET DG:WRTMES_PTR
+ CALL PRINTF_CRLF
+
+ POP DX
+ POP AX
+ CALL RDWR
+
+ JNC CLSFLE
+
+ CALL CLSFLE
+
+ CALL DELETE_A_FILE
+
+ MOV DX,OFFSET DG:NOSPACE_PTR
+ JMP RESTARTJMP
+
+ CALL CLSFLE ;is this dead code? - edk
+
+ JMP COMMAND
+
+CHECKREADONLY: ; ARR 2.4
+ MOV DX,[FILESTRT]
+ MOV SI,[FILEEND]
+ PUSH [SI]
+ MOV BYTE PTR [SI],0
+ MOV AX,CHMOD SHL 8 ;AL=0,REQUEST FILE'S CURRENT
+ ; ATTRIBUTE BE RETURNED IN CX
+ INT 21H
+
+ POP [SI]
+ MOV DX,OFFSET DG:NOROOM_PTR ; Creation error - report error
+ JC RESTARTJMP
+
+ TEST CX,ATTR_READ_ONLY+ATTR_HIDDEN+ATTR_SYSTEM
+ JZ RESTARTJMP
+
+ MOV DX,OFFSET DG:ACCMES_PTR ; Write on read only file
+ JMP RESTARTJMP
+
+CLSFLE:
+ MOV AH,CLOSE
+ MOV BX,[HANDLE]
+ INT 21H
+
+ RETURN
+
+EXELOAD:
+ POP [RETSAVE] ; Suck up return addr
+ INC BYTE PTR [NEWEXEC]
+ MOV BX,[USER_PROC_PDB]
+ MOV AX,BEGSEG
+ MOV DS,AX
+ ASSUME DS:NOTHING
+
+ CMP AX,BX
+ JZ DEBUG_CURRENT
+
+ JMP FIND_DEBUG
+
+DEBUG_CURRENT:
+ MOV AX,CS:[DSSAVE]
+DEBUG_FOUND:
+ MOV CS:BYTE PTR [NEWEXEC],0
+ MOV CS:[HEADSAVE],AX
+ PUSH CS:[RETSAVE] ; Get the return address back
+ PUSH AX
+ MOV BX,CS
+ SUB AX,BX
+ PUSH ES
+ MOV ES,CS:BEGSEG
+ ASSUME ES:NOTHING
+
+ MOV BX,AX ; size of debug in para.
+ ADD BX,10H
+ MOV AX,CS ; and the size of printf in para.
+ SUB AX,CS:BEGSEG
+ ADD BX,AX
+ MOV AH,SETBLOCK
+ INT 21H
+
+ POP ES
+ POP AX
+ MOV CS:WORD PTR [COM_LINE+WORD],AX
+ MOV CS:WORD PTR [COM_FCB1+WORD],AX
+ MOV CS:WORD PTR [COM_FCB2+WORD],AX
+ PUSH DS
+ PUSH CS
+ POP DS
+ CALL EXEC_A_FILE
+
+ POP DS
+ MOV AX,CS:[HANDLE]
+ JC EXECERR
+
+ CALL SET_TERMINATE_VECTOR ; Reset int 22
+
+ MOV AH,GET_CURRENT_PDB
+ INT 21H
+
+ MOV CS:[USER_PROC_PDB],BX
+ MOV CS:[DSSAVE],BX
+ MOV CS:[ESSAVE],BX
+ MOV ES,BX
+ MOV WORD PTR ES:[PDB_EXIT],OFFSET DG:TERMINATE
+ MOV WORD PTR ES:[PDB_EXIT+WORD],CS
+ LES DI,CS:[COM_CSIP]
+ MOV CS:[CSSAVE],ES
+ MOV CS:[IPSAVE],DI
+ MOV CS:WORD PTR [DISADD+WORD],ES
+ MOV CS:WORD PTR [DISADD],DI
+ MOV CS:WORD PTR [ASMADD+WORD],ES
+ MOV CS:WORD PTR [ASMADD],DI
+ MOV CS:WORD PTR [DEFDUMP+WORD],ES
+ MOV CS:WORD PTR [DEFDUMP],DI
+ MOV BX,DS
+ MOV AH,SET_CURRENT_PDB
+ INT 21H
+
+ LES DI,CS:[COM_SSSP]
+ MOV AX,ES:[DI]
+ INC DI
+ INC DI
+ MOV CS:[AXSAVE],AX
+ MOV CS:[SSSAVE],ES
+ MOV CS:[SPSAVE],DI
+ RETURN
+
+EXECERR:
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET DG:NOTFND_PTR
+ CMP AX,ERROR_FILE_NOT_FOUND
+ JZ GOTEXECEMES
+
+ MOV DX,OFFSET DG:ACCMES_PTR
+ CMP AX,ERROR_ACCESS_DENIED
+ JZ GOTEXECEMES
+
+ MOV DX,OFFSET DG:TOOBIG_PTR
+ CMP AX,ERROR_NOT_ENOUGH_MEMORY
+ JZ GOTEXECEMES
+
+ MOV DX,OFFSET DG:EXEBAD_PTR
+ CMP AX,ERROR_BAD_FORMAT
+ JZ GOTEXECEMES
+
+ MOV DX,OFFSET DG:EXECEMES_PTR
+GOTEXECEMES:
+ CALL PRINTF_CRLF
+
+ JMP COMMAND
+
+HEX2BIN:
+ MOV [INDEX],DX
+ MOV DX,OFFSET DG:HEXWRT_PTR
+ CMP BYTE PTR [RDFLG],WRITE
+ JNZ RDHEX
+
+ JMP RESTARTJ2
+
+RDHEX:
+ MOV ES,AX
+ CALL OPEN_A_FILE
+
+ MOV DX,OFFSET DG:NOTFND_PTR
+ JNC HEXFND
+
+ JMP RESTART
+
+HEXFND:
+ XOR BP,BP
+ MOV SI,OFFSET DG:(BUFFER+BUFSIZ) ; Flag input buffer as empty
+READHEX:
+ CALL GETCH
+
+ CMP AL,CHAR_COLON ; Search for : to start line
+ JNZ READHEX
+
+ CALL GETBYT ; Get byte count
+
+ MOV CL,AL
+ MOV CH,0
+ JCXZ HEXDONE
+
+ CALL GETBYT ; Get high byte of load address
+
+ MOV BH,AL
+ CALL GETBYT ; Get low byte of load address
+
+ MOV BL,AL
+ ADD BX,[INDEX] ; Add in offset
+ MOV DI,BX
+ CALL GETBYT ; Throw away type byte
+
+READLN:
+ CALL GETBYT ; Get data byte
+
+ STOSB
+ CMP DI,BP ; Check if this is the largest address so far
+ JBE HAVBIG
+
+ MOV BP,DI ; Save new largest
+HAVBIG:
+ LOOP READLN
+
+ JMP SHORT READHEX
+
+GETCH:
+ CMP SI,OFFSET DG:(BUFFER+BUFSIZ)
+ JNZ NOREAD
+
+ MOV DX,OFFSET DG:BUFFER
+ MOV SI,DX
+ MOV AH,READ
+ PUSH BX
+ PUSH CX
+ MOV CX,BUFSIZ
+ MOV BX,cs:[HANDLE]
+ INT 21H
+
+ POP CX
+ POP BX
+ OR AX,AX
+ JZ HEXDONE
+
+NOREAD:
+ LODSB
+ CMP AL,CHAR_EOF
+ JZ HEXDONE
+
+ OR AL,AL
+ RETNZ
+
+HEXDONE:
+ MOV [CXSAVE],BP
+ MOV BXSAVE,0
+ RETURN
+
+HEXDIG:
+ CALL GETCH
+
+ CALL HEXCHK
+
+ RETNC
+
+ MOV DX,OFFSET DG:HEXERR_PTR
+RESTARTJ2:
+ JMP RESTART
+
+GETBYT:
+ CALL HEXDIG
+
+ MOV BL,AL
+ CALL HEXDIG
+
+ SHL BL,1
+ SHL BL,1
+ SHL BL,1
+ SHL BL,1
+ OR AL,BL
+ RETURN
+
+;=========================================================================
+; ABSREAD: This routine performs a primitive logical sector read of
+; the specified drive. This routine replaces the old
+; INT 25h function which only allowed 16 bit addressibility.
+; The new generic IOCtl logical sector read will permit
+; 32 bit addressibility on a disk device.
+;
+; Inputs : REL_READ_WRITE_TAB - Table provides dword sector
+; addressibility.
+;
+; Outputs: Data located at specified transfer address.
+;
+; Error : Carry is set on error.
+;
+; Date : 6/17/87
+;=========================================================================
+
+ABSREAD proc near ;an000;read logical sector(s)
+
+ push ds ;an000;save affected regs
+ push cx ;an000;save affected regs
+ push bx ;an000;
+
+ mov cx,-1 ;an000;extended format
+ mov bx,offset dg:rel_read_write_tab ;an000;point to read/write table
+ int 25h ;an000;invoke relative sector read
+ pop bx ;an000;discard stack word
+
+ pop bx ;an000;restore regs
+ pop cx ;an000;
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+ABSREAD endp ;an000;end proc
+
+
+;=========================================================================
+; ABSWRT: This routine performs a primitive logical sector write of
+; the specified drive. This routine replaces the old
+; INT 26h function which only allowed 16 bit addressibility.
+; The new generic IOCtl logical sector write will permit
+; 32 bit addressibility on a disk device.
+;
+; Inputs : REL_READ_WRITE_TAB - Table provides dword sector
+; addressibility.
+;
+; Outputs: Data moved from transfer address to applicable sector(s).
+;
+; Error : Carry is set on error.
+;
+; Date : 6/17/87
+;=========================================================================
+
+ABSWRT proc near ;an000;write logical sector(s)
+
+ push ds ;an000;save affected regs
+ push cx ;an000;
+ push bx ;an000;
+
+ mov cx,-1 ;an000;extended format
+ mov bx,offset dg:rel_read_write_tab ;an000;point to read/write table
+ int 26h ;an000;invoke relative sector write
+ pop bx ;an000;discard stack word
+
+ pop bx ;an000;restore regs
+ pop cx ;an000;
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+ABSWRT endp ;an000;end proc
+
+;*************************************************************************;C01
+;This function is designed to test the size of any file being written to ;C01
+;disk or diskette. If the file wanting to be written is larger than space;C01
+;available on disk or diskette then the write will not occur. This will ;C01
+;prevent the file from being deleted when "insufficient memory" is present;C01
+ ;C01
+ChkFileSz PROC NEAR ;C01
+ mov bx,DriveOfFile ;get drive number of file ;C01
+ mov dl,bl ; ;C01
+ mov ah,36h ;DOS Function call ;C01
+ int 21h ;get drive allocation information ;C01
+ cmp ax,0FFFFh ;Q: Was there an error? ;C01
+ je RSJMP ; Y: yes ;C01
+ mov cs:AvailClusts,bx ;save # of avail. clusters ;C01
+ mov cs:SectsPerClust,ax ;save sectors per cluster ;C01
+ mov cs:BytesPerSect,cx ;save bytes per sector ;C01
+
+ mul cs:BytesPerSect ;C09
+ mov cs:BytesPerClust,ax ;Compute & save bytes per cluster ;C09
+
+ ;C01
+;Determine how many clusters the new file would have to use. This value ;C01
+;must be less than the number of available clusters, AvailClusts, or ;C01
+;the write will have further tests made before executing. ;C01
+ ;C01
+ mov dx,BXSAVE ;get high order file size ;C01
+ mov TempHB,dx ;C01
+ mov ax,CXSAVE ;get low order file size ;C01
+ mov TempLB,ax ;C01
+
+;C09 mov ax,cs:SectsPerClust ;C08
+;C09 mul cs:BytesPerSect ;dx:ax = max file size available ;C08
+;C09 mul cs:AvailClusts ;C08
+;C09 cmp dx,cs:TempHB ;Q: Is high word of free space ;C08
+;C09 ; > size of file? ;C08
+;C09 ja CONT5 ; Y: yes, do write ;C08
+;C09 je TRY_LOW ;Q: Equal? Y: Try lower word ;C08
+;C09 jmp RSJMP ; must be greater, issue error ;C08
+;C09TRY_LOW: ;C08
+;C09 cmp ax,cs:TempLB ;Q: Is low word of free space ;C08
+;C09 ; > size of file? ;C08
+;C09 jae CONT5 ; Y: yes, don't write ;C08
+;C09RSJMP: ;C08
+;C09 mov dx,OFFSET DG:NOSPACE_PTR ;C08
+;C09 jmp RESTARTJMP ;C08
+;C09cont5 label near ;C08
+;C09 ret ;C08
+
+
+;C09 div cs:BytesPerSect ;compute # of sects. for new file ;C01
+;C09 cmp dx,0 ;Q: Was there a remainder? ;C01
+;C09 je cont1 ; A:no, don't do anything ;C01
+;C09 inc ax ; yes, incr. # of sectors ;C01
+;C09 xor dx,dx ;prepare for next divide ;C01
+;C09cont1 label near ;C01
+;C09 div cs:SectsPerClust ;compute # of clusts for new file ;C01
+
+; if the count is absurdly large (# clusters > 0ffffh), then
+; we have to check for the overflow as a special case before
+; doing the divide. This is actually quite likely when
+; people do this command without knowing that the user bx register
+; contains one of the parameters.
+
+ cmp dx,cs:BytesPerClust ; see if we're going to get an overflow
+ jnb RSJMP ; give error if we would've
+
+ div cs:BytesPerClust ;compute # of clusts for new file ;C09
+ or dx,dx ;Q: Was there a remainder?
+ je cont2 ; A: no, don't do anything ;C01
+ inc ax ; yes, incr. # of clusters ;C01
+ jz RSJMP ; give error if rounded to 0
+cont2 label near ;C01
+ cmp cs:AvailClusts,ax ;Q: Are there enough disk clusts ;C01
+ ; for the write to occur ;C01
+ jae cont5 ; A: yes, write to disk ;C01
+ mov cs:FileSzInClusts,ax ;save # of clusters of new file ;C01
+ ;C01
+;Determine how many clusters the given file now occupies on the disk or ;C01
+;diskette for comparison with the # of clusters of the new file ;C01
+ ;C01
+ mov dx,FileSizeHB ;Set up DX:AX with current file ;C01
+ mov ax,FileSizeLB ; size ;C01
+;C09 div cs:BytesPerSect ;compute # of sects. used by file ;C01
+;C09 cmp dx,0 ;Q: Was there a remainder? ;C01
+;C09 je cont3 ; A:no, don't do anything ;C01
+;C09 inc ax ; yes, incr. # of sectors ;C01
+;C09 xor dx,dx ;prepare for next divide ;C01
+;C09cont3 label near ;C01
+ div cs:BytesPerClust ;compute # of clusts used by file ;C09
+ cmp dx,0 ;Q: Was there a remainder? ;C01
+ je cont4 ; A: no, don't do anything ;C01
+ inc ax ; yes, incr. # of clusters ;C01
+cont4 label near ;C01
+ add ax,cs:AvailClusts ;Get total of file and available ;C09
+ cmp cs:FileSzInClusts,ax ;Q: Is cluster size of new file ;C01
+ ; > cluster size of file? ;C01
+ jna cont5 ; A: no, go ahead and write
+ ;C01
+RSJMP: ;C01
+ mov dx,OFFSET DG:NOSPACE_PTR ;C01
+ jmp RESTARTJMP ;C01
+cont5 label near ;C01
+ ret ;C01
+ ;C01
+; These variables used to determine if the file is larger than the ;C01
+; amount of disk space available whenever a write occurs. ;C01
+ ;C01
+AvailClusts DW ? ;C01
+SectsPerClust DW ? ;C01
+BytesPerSect DW ? ;C01
+FileSzInClusts DW ? ;C01
+MaxBytesInFClust DW ? ;C01
+BytesPerClust DW ? ;C09
+ChkFileSz endp ;C01
+
+CODE ENDS
+ END DEBCOM2
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debcom3.asm b/private/mvdm/dos/v86/cmd/debug/debcom3.asm
new file mode 100644
index 000000000..74f7027d2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debcom3.asm
@@ -0,0 +1,706 @@
+ PAGE 80,132 ;
+ TITLE DEBCOM3.ASM - PART3 DEBUGGER COMMANDS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; ROUTINES TO PERFORM DEBUGGER COMMANDS
+
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBCOM3
+ ENDIF
+.XLIST
+.XCREF
+ include mi.inc ; cas -- missing equates
+ include version.inc ; cas -- missing equates
+ include syscall.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+ INCLUDE DPL.ASM
+.CREF
+.LIST
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN USER_PROC_PDB:WORD,RSTACK:WORD,STACK:BYTE
+ EXTRN DSSAVE:WORD,CSSAVE:WORD,IPSAVE:WORD,axSAVE:WORD,dxSAVE:WORD
+ EXTRN SSSAVE:WORD,SPSAVE:WORD,FLSAVE:WORD
+ EXTRN NEXTCS:WORD,NEXTIP:WORD, RSETFLAG:BYTE
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN BRKCNT:WORD,TCOUNT:WORD,SWITCHAR:BYTE,BPTAB:BYTE
+ EXTRN BP_ERROR:BYTE,COMP_ARG1:WORD,COMP_ARG2:WORD,COMP_ARG3:WORD
+ EXTRN COMP_ARG4:WORD,COMP_ARG5:WORD,COMP_ARG6:WORD,COMP_PTR:BYTE
+ EXTRN ARG_BUF:BYTE,ARG_BUF_PTR:BYTE
+ EXTRN FZTRACE:BYTE, SYNERR_PTR:BYTE
+ EXTRN BEGSEG:WORD
+ IF IBMVER
+ EXTRN cpu_not_8088:byte
+ EXTRN OLD_MASK:BYTE
+ ENDIF
+ EXTRN SAVESTATE:BYTE
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+ PUBLIC COMPARE,INPUT,OUTPUT,GO
+ PUBLIC TRACE,ZTRACE,SKIP_FILE
+ EXTRN GETHEX:NEAR,GETEOL:NEAR,CRLF:NEAR,ERR:NEAR, PERR:NEAR
+ EXTRN HEX:NEAR,DIGIT:NEAR,SCANP:NEAR,DISPREG:NEAR
+ EXTRN COMMAND:NEAR,DABORT:NEAR,DELIM1:NEAR,DELIM2:NEAR
+ EXTRN NMIINT:NEAR,NMIINTEND:NEAR,PRINTF_CRLF:NEAR
+ EXTRN ADDRESS:NEAR,HEXIN:NEAR,DSRANGE:NEAR
+; just like trace except skips OVER next INT or CALL.
+DEBCOM3:
+ZTRACE:
+ MOV FZTRACE,-1
+ CALL SETADD
+ CALL SCANP
+ CALL HEXIN
+ MOV DX,1
+ JC ZSTOCNT
+ MOV CX,4
+ CALL GETHEX
+ CALL CHECKNONE
+ZSTOCNT:
+ MOV [TCOUNT],DX
+ CALL GETEOL
+ MOV DX,NEXTCS
+ MOV CSSAVE,DX
+ MOV DX,NEXTIP
+ MOV IPSAVE,DX
+ZSTEP:
+ MOV ES,[CSSAVE] ; point to instruction to execute
+ MOV DI,[IPSAVE] ; include offset in segment
+ XOR DX,DX ; where to place breakpoint
+get_opcode:
+ MOV AL,ES:[DI] ; get the opcode
+ cmp al,0f0h ; lock
+ je is_override
+ cmp al,26h ; es:
+ je is_override
+ cmp al,2eh ; cs:
+ je is_override
+ cmp al,36h ; ss:
+ je is_override
+ cmp al,3eh ; ds:
+ jne not_override
+Is_override:
+; inc dx ; this seemed to put us in an endless
+ inc di ; loop, try this.
+ jmp get_opcode
+Not_override:
+ CMP AL,11101000B ; direct intra call
+ JZ ZTRACE3 ; yes, 3 bytes
+ CMP AL,10011010B ; direct inter call
+ JZ ZTRACE5 ; yes, 5 bytes
+ CMP AL,11111111B ; indirect?
+ JZ ZTRACEMODRM ; yes, go figure length
+ CMP AL,11001100B ; short interrupt?
+ JZ ZTRACE1 ; yes, 1 byte
+ CMP AL,11001101B ; long interrupt?
+ JZ ZTRACE2 ; yes, 2 bytes
+ CMP AL,11100010B ; loop
+ JZ ZTRACE2 ; 2 byter
+ CMP AL,11100001B ; loopz/loope
+ JZ ZTRACE2 ; 2 byter
+ CMP AL,11100000B ; loopnz/loopne
+ JZ ZTRACE2 ; 2 byter
+ AND AL,11111110B ; check for rep
+ CMP AL,11110010B ; perhaps?
+ JZ FOO1
+ JMP STEP ; can't do anything special, step
+FOO1:
+ MOV AL,ES:[DI+1] ; next instruction
+ AND AL,11111110B ; ignore w bit
+ CMP AL,10100100B ; MOVS
+ JZ ZTRACE2 ; two byte
+ CMP AL,10100110B ; CMPS
+ JZ ZTRACE2 ; two byte
+ CMP AL,10101110B ; SCAS
+ JZ ZTRACE2 ; two byte
+ CMP AL,10101100B ; LODS
+ JZ ZTRACE2 ; two byte
+ CMP AL,10101010B ; STOS
+ JZ ZTRACE2 ; two byte
+ JMP short STEP ; bogus, do single step
+
+ZTRACEMODRM:
+ MOV AL,ES:[DI+1] ; get next byte
+ AND AL,11111000B ; get mod and type
+ CMP AL,01010000B ; indirect intra 8 bit offset?
+ JZ ZTRACE3 ; yes, three byte whammy
+ CMP AL,01011000B ; indirect inter 8 bit offset
+ JZ ZTRACE3 ; yes, three byte guy
+ CMP AL,10010000B ; indirect intra 16 bit offset?
+ JZ ZTRACE4 ; four byte offset
+ CMP AL,10011000B ; indirect inter 16 bit offset?
+ JZ ZTRACE4 ; four bytes
+ CMP AL,11010000B ; indirect through reg?
+ JZ ZTRACE2 ; two byte instruction
+ JMP short STEP ; can't figger out what this is!
+ZTRACE5:
+ INC DX
+ZTRACE4:
+ INC DX
+ZTRACE3:
+ INC DX
+ZTRACE2:
+ INC DX
+ZTRACE1:
+ INC DX
+ ADD DI,DX ; offset to breakpoint instruction
+ MOV WORD PTR [BPTAB],DI ; save offset
+ MOV WORD PTR [BPTAB+2],ES ; save segment
+ MOV AL,ES:[DI] ; get next opcode byte
+ MOV BYTE PTR [BPTAB+4],AL ; save it
+ MOV BYTE PTR ES:[DI],0CCH ; break point it
+ MOV [BRKCNT],1 ; only this breakpoint
+ JMP DEXIT ; start the operation!
+
+; Trace 1 instruction or the number of instruction specified
+; by the parameter using 8086 trace mode. Registers are all
+; set according to values in save area
+TRACE:
+ MOV FZTRACE,0
+ CALL SETADD
+ CALL SCANP
+ CALL HEXIN
+ MOV DX,1
+ JC STOCNT
+ MOV CX,4
+ CALL GETHEX
+ CALL CHECKNONE
+STOCNT:
+ MOV [TCOUNT],DX
+ CALL GETEOL
+ MOV DX,NEXTCS
+ MOV CSSAVE,DX
+ MOV DX,NEXTIP
+ MOV IPSAVE,DX
+STEP:
+ MOV [BRKCNT],0
+; The 286 has a problem with trace mode and software interrupt instructions;
+; it treats them as atomic operations. We simulate the operation in software.
+ MOV ES,[CSSAVE] ; Get next instruction pointer
+ MOV DI,[IPSAVE]
+ MOV AL,ES:[DI] ; get next opcode
+ cmp al,0e4h ; check for 'IN' opcode
+ jne not_inal_op
+ cmp es:byte ptr[di+1],21h
+ jne not_mask_op
+ add [ipsave],2
+ JMP short SETalmask
+
+not_inal_op:
+ cmp al,0ech ; in al,DX ?
+ jne not_mask_op
+ cmp dxsave,21h
+ jne not_mask_op
+ add [ipsave],1
+SETalmask:
+ mov ax,[axsave]
+ in al,21h
+ mov [axsave],ax
+ JMP SETENVIRON
+
+not_mask_op:
+ CMP AL,0CDH ; trace over an interrupt?
+ JZ DOINT ; no, check for other special cases
+ CMP AL,0CEH ; how about int overflow
+ JNZ CHECKCC
+ TEST FLSAVE,F_OVERFLOW ; see it overflow is present
+ JZ CHECKOP
+ MOV BX,4 ; INTO = INT 4
+ DEC IPSAVE ; INTO is a singel byte
+ JMP SHORT DOVAL
+CHECKCC:
+ CMP AL,0CCH
+ JNZ CHECKOP
+ MOV BX,3 ; INT 3 = CC
+ DEC IPSAVE
+ JMP SHORT DOVAL
+DOINT:
+; We have a software interrupt. Get destination vector
+ MOV BL,BYTE PTR ES:[DI+1] ; get vector number
+ XOR BH,BH ; clear out upper
+DOVAL:
+ SHL BX,1 ; word index
+ SHL BX,1 ; dword index
+ XOR DI,DI ; interrupt table
+ MOV ES,DI
+ MOV AX,ES:[BX] ; point to vector
+ MOV BX,ES:[BX+2] ; point to vector
+; AX:BX is the vector. Swap it with currect CS:IP
+ XCHG AX,IPSAVE ; new CS:IP
+ XCHG BX,CSSAVE
+; AX:BX is old CS:IP. We 'PUSH' flags, oldCS and oldIP, reset flags (ifl) and
+; set CS:IP to point to interrupt instruction.
+ MOV ES,SSSAVE ; point to user stack
+ MOV DI,SPSAVE
+; Take old flags and PUSH the flags.
+ MOV CX,FLSAVE ; get flags
+ SUB DI,2 ; PUSHF
+ MOV ES:[DI],CX ; rest of push
+; Push the old CS
+ SUB DI,2 ; PUSH CS
+ MOV ES:[DI],BX ; rest of push
+; Push the old IP
+ SUB DI,2 ; PUSH IP
+ ADD AX,2 ; increment IP
+ MOV ES:[DI],AX ; rest of push
+; Update stack
+ MOV SPSAVE,DI ; store
+; Take flags and turn interrupts off and trace mode off
+ AND CX,NOT F_INTERRUPT ; CLI
+ AND CX,NOT F_TRACE ; no trace
+ MOV FLSAVE,CX ; rest of CLI
+; Set up correct process and go to normal reentry code.
+ IF NOT SYSVER
+ MOV BX,[USER_PROC_PDB]
+ MOV AH,SET_CURRENT_PDB
+ INT 21H
+ ENDIF
+ JMP SETENVIRON
+; We need to special case the following instructions that may push a TRACE bit
+; on the stack: PUSHF (9C)
+
+; Save the opcode in A Special place
+CHECKOP:
+ MOV RSETFLAG,AL ; no bits to turn off
+SETTRACE:
+ OR FLSAVE,F_TRACE ; Turn on trace bit
+ IF IBMVER
+;
+; the following stuff can be inhibited on 286/386/etc CPUs. The
+; designers of the later chips added logic to enhance trace
+; mode operation. The reason why we just don't run it all of
+; the time is that it can cause a system crash if the instruction
+; being traced causes an overflow condition because nobody will
+; turn interrupts back on.
+
+ test cpu_not_8088,1 ; see if 8088/8086
+ jnz no_fix_8088
+
+ CLI
+ IN AL,MASK_PORT ; Get current mask
+ JMP SHORT FOO
+FOO:
+ MOV [OLD_MASK],AL ; Save it
+ MOV AL,INT_MASK ; New mask
+ OUT MASK_PORT,AL ; Set it
+ STI
+
+no_fix_8088:
+
+ ENDIF
+DEXIT:
+ IF NOT SYSVER
+ MOV BX,[USER_PROC_PDB]
+ MOV AH,SET_CURRENT_PDB
+ INT 21H
+ ENDIF
+; Unfortunately, any system call we issue will muck with the current extended
+; errors. Here we must restore the extended error state so that if the user
+; program gets it, we do not interfere.
+ MOV AX,(SERVERCALL SHL 8) + 10
+ MOV DX,OFFSET DG:SAVESTATE
+ INT 21H
+ PUSH DS
+ XOR AX,AX
+ MOV DS,AX
+ MOV WORD PTR DS:[12],OFFSET DG:BREAKFIX ; Set vector 3--breakpoint instruction
+ MOV WORD PTR DS:[14],CS
+ MOV WORD PTR DS:[4],OFFSET DG:REENTER ; Set vector 1--Single step
+ MOV WORD PTR DS:[6],CS
+ CLI
+ IF SETCNTC
+ MOV WORD PTR DS:[8CH],OFFSET DG:CONTC ; Set vector 23H (CTRL-C)
+ MOV WORD PTR DS:[8EH],CS
+ ENDIF
+ POP DS
+ MOV SP,OFFSET DG:STACK
+ POP AX
+ POP BX
+ POP CX
+ POP DX
+ POP BP
+ POP BP
+ POP SI
+ POP DI
+ POP ES
+ POP ES
+ POP SS
+ MOV SP,[SPSAVE]
+ PUSH [FLSAVE]
+ PUSH [CSSAVE]
+ PUSH [IPSAVE]
+ MOV DS,[DSSAVE]
+ IRET
+STEP1:
+ CALL CRLF
+ CALL DISPREG
+ TEST FZTRACE,-1
+ JNZ STEPZ
+ JMP STEP
+STEPZ: JMP ZSTEP
+
+; Re-entry point from CTRL-C. Top of stack has address in 86-DOS for
+; continuing, so we must pop that off.
+CONTC:
+ ADD SP,6
+ JMP SHORT REENTERREAL
+
+; Re-entry point from breakpoint. Need to decrement instruction
+; pointer so it points to location where breakpoint actually
+; occured.
+BREAKFIX:
+ PUSH BP
+ MOV BP,SP
+ DEC WORD PTR [BP].OLDIP
+ POP BP
+ JMP short REENTERREAL
+
+; Re-entry point from trace mode or interrupt during execution. All registers
+; are saved so they can be displayed or modified.
+INTERRUPT_FRAME STRUC
+OLDBP DW ?
+OLDIP DW ?
+OLDCS DW ?
+OLDF DW ?
+OLDERIP DW ?
+OLDERCS DW ?
+OLDERF DW ?
+INTERRUPT_FRAME ENDS
+
+ASSUME CS:DG,DS:NOTHING,ES:NOTHING,SS:NOTHING
+; ReEnter is the main entry point for breakpoint interrupts and for trace mode
+; interrupts. We treat both of these cases identically: save state, display
+; registers and go for another command. If we get NMI's, we skip them or if
+; it turns out that we are debugging ourselves, we skip them.
+
+; Due to bogosities in the 808x chip, Consider tracing over an interrupt and
+; then setting a breakpoint to where the interrupt returns. You get the INT 3
+; and then trace mode gets invoked! This is why we ignore interrupts within
+; ourselves.
+REENTER:
+ PUSH BP
+ MOV BP,SP ; get a frame to address from
+ PUSH AX
+; MOV AX,CS
+; CMP AX,[BP].OLDCS ; Did we interrupt ourselves?
+; JNZ GOREENTER ; no, go reenter
+ IF IBMJAPAN
+ MOV AX,[BP].OLDIP
+ CMP AX,OFFSET DG:NMIINT ; interrupt below NMI interrupt?
+ JB GOREENTER ; yes, go reenter
+ CMP [BP].OLDIP,OFFSET DG:NMIINTEND
+ JAE GOREENTER ; interrupt above NMI interrupt?
+ POP AX ; restore state
+ POP BP
+ SUB SP,6 ; switch TRACE and NMI stack frames
+ PUSH BP
+ MOV BP,SP ; set up frame
+ PUSH AX ; get temp variable
+ MOV AX,[BP].OLDERIP ; get NMI Vector
+ MOV [BP].OLDIP,AX ; stuff in new NMI vector
+ MOV AX,[BP].OLDERCS ; get NMI Vector
+ MOV [BP].OLDCS,AX ; stuff in new NMI vector
+ MOV AX,[BP].OLDERF ; get NMI Vector
+ AND AH,0FEH ; turn off Trace if present
+ MOV [BP].OLDF,AX ; stuff in new NMI vector
+ MOV [BP].OLDERF,AX
+ MOV [BP].OLDERIP,OFFSET DG:REENTER ; offset of routine
+ MOV [BP].OLDERCS,CS ; and CS
+ POP AX
+ POP BP
+ IRET ; go try again
+ ENDIF
+GOREENTER:
+ IF IBMVER
+ test cpu_not_8088,1
+ jnz no_restore_pic_mask
+ MOV AL,CS:[OLD_MASK] ; Recover Old mask
+ OUT MASK_PORT,AL ; Restore it
+no_restore_pic_mask:
+ ENDIF
+
+ MOV AL,CS:[RSETFLAG]
+; Determine, based on the previous instruction, what we are supposed to do
+; to flags on the users stack.
+ CMP AL,09CH ; PUSHF
+ JNZ NOFIX
+; OlderIP = flags. Turn off trace bit
+ AND [BP].OLDERIP,NOT F_TRACE
+NOFIX:
+ POP AX
+ POP BP
+REENTERREAL:
+ MOV CS:[SPSAVE+SEGDIF],SP
+ MOV CS:[SSSAVE+SEGDIF],SS
+ MOV CS:[FLSAVE],CS
+ MOV SS,CS:[FLSAVE]
+ MOV SP,OFFSET DG:RSTACK
+ ASSUME SS:DG
+
+ PUSH ES
+ PUSH DS
+ PUSH DI
+ PUSH SI
+ PUSH BP
+ DEC SP
+ DEC SP
+ PUSH DX
+ PUSH CX
+ PUSH BX
+ PUSH AX
+ PUSH SS
+ POP DS
+ ASSUME DS:DG
+
+ MOV SS,[SSSAVE]
+ MOV SP,[SPSAVE]
+ ASSUME SS:NOTHING
+
+ POP [IPSAVE]
+ POP [CSSAVE]
+ POP AX
+ AND AX,NOT F_TRACE ; TURN OFf trace mode bit
+ MOV [FLSAVE],AX
+ MOV [SPSAVE],SP
+SETENVIRON:
+ PUSH DS
+ POP ES
+ ASSUME ES:DG
+
+ PUSH DS
+ POP SS
+ ASSUME SS:DG
+
+ MOV SP,OFFSET DG:STACK
+ PUSH DS
+ XOR AX,AX
+ MOV DS,AX
+ ASSUME DS:NOTHING
+
+ IF SETCNTC
+ MOV WORD PTR DS:[8CH],OFFSET DG:DABORT ; Set Ctrl-C vector
+ MOV WORD PTR DS:[8EH],CS
+ ENDIF
+ POP DS
+ ASSUME DS:DG
+
+ STI
+ CLD
+; Since we are about to issue system calls, let's grab the current user's
+; extended error info.
+ MOV AH,GETEXTENDEDERROR
+ INT 21H
+ ASSUME DS:NOTHING,ES:NOTHING
+
+ MOV SAVESTATE.DPL_AX,AX
+ MOV SAVESTATE.DPL_BX,BX
+ MOV SAVESTATE.DPL_CX,CX
+ MOV SAVESTATE.DPL_DX,DX
+ MOV SAVESTATE.DPL_SI,SI
+ MOV SAVESTATE.DPL_DI,DI
+ MOV SAVESTATE.DPL_DS,DS
+ MOV SAVESTATE.DPL_ES,ES
+ MOV AX,CS
+ MOV DS,AX
+ MOV ES,AX
+ ASSUME DS:DG,ES:DG
+
+ IF NOT SYSVER
+ MOV AH,GET_CURRENT_PDB
+ INT 21H
+ MOV [USER_PROC_PDB],BX
+ MOV BX,BEGSEG
+ MOV AH,SET_CURRENT_PDB
+ INT 21H
+ ENDIF
+ MOV SI,OFFSET DG:BPTAB
+ MOV CX,[BRKCNT]
+ JCXZ SHOREG
+ PUSH ES
+CLEARBP:
+ LES DI,DWORD PTR [SI]
+ ADD SI,4
+ MOVSB
+ LOOP CLEARBP
+ POP ES
+SHOREG:
+ DEC [TCOUNT]
+ JZ CHECKDISP
+ JMP STEP1
+CHECKDISP:
+ CALL CRLF
+ CALL DISPREG
+ JMP COMMAND
+
+; Input from the specified port and display result
+INPUT:
+ MOV CX,4 ; Port may have 4 digits
+ CALL GETHEX ; Get port number in DX
+ CALL GETEOL
+
+ IN AL,DX ; Variable port input
+
+ PUSH CS
+ POP ES
+ MOV DI,OFFSET DG:ARG_BUF
+ CALL HEX ; And display
+
+ XOR AL,AL
+ STOSB
+ MOV DX,OFFSET DG:ARG_BUF_PTR
+ JMP PRINTF_CRLF
+
+; Output a value to specified port.
+OUTPUT:
+ MOV CX,4 ; Port may have 4 digits
+ CALL GETHEX ; Get port number
+ PUSH DX ; Save while we get data
+ MOV CX,2 ; Byte output only
+ CALL GETHEX ; Get data to output
+ CALL GETEOL
+ XCHG AX,DX ; Output data in AL
+ POP DX ; Port in DX
+
+ OUT DX,AL ; Variable port output
+
+ RETURN
+
+SETADD:
+ MOV DX,CSSAVE ; set up start addresses
+ MOV NEXTCS,DX
+ MOV DX,IPSAVE
+ MOV NEXTIP,DX
+ MOV BP,[CSSAVE]
+ CALL SCANP
+ CMP BYTE PTR [SI],"="
+ RETNZ
+ INC SI
+ CALL ADDRESS
+ MOV NEXTCS,AX
+ MOV NEXTIP,DX
+ RETURN
+
+; Jump to program, setting up registers according to the
+; save area. up to 10 breakpoint addresses may be specified.
+GO:
+ MOV RSETFLAG,0
+ CALL SETADD
+ XOR BX,BX
+ MOV DI,OFFSET DG:BPTAB
+GO1:
+ CALL SCANP
+ JZ DEXEC
+ MOV BP,[CSSAVE]
+ PUSH DI
+ PUSH BX ;AN000; DMS;SAVE BX - ADDRESS KILLS IT
+ CALL ADDRESS
+ POP BX ;AN000; DMS;RESTORE BX
+ POP DI
+ MOV [DI],DX ; Save offset
+ MOV [DI+2],AX ; Save segment
+ ADD DI,5 ; Leave a little room
+ INC BX
+ CMP BX,1+BPMAX
+ JNZ GO1
+ MOV DX,OFFSET DG:BP_ERROR ; BP ERROR
+ JMP ERR
+DEXEC:
+ MOV [BRKCNT],BX
+ MOV CX,BX
+ JCXZ NOBP
+ MOV DI,OFFSET DG:BPTAB
+ PUSH DS
+SETBP:
+ LDS SI,ES:DWORD PTR [DI]
+ ADD DI,4
+ MOVSB
+ MOV BYTE PTR [SI-1],0CCH
+ LOOP SETBP
+ POP DS
+NOBP:
+ MOV DX,NEXTCS
+ MOV CSSAVE,DX
+ MOV DX,NEXTIP
+ MOV IPSAVE,DX
+ MOV [TCOUNT],1
+ JMP DEXIT
+
+SKIP_FILE:
+ MOV AH,CHAR_OPER
+ XOR AL,AL ; Get switch char subfunction
+ INT 21H
+ MOV CS:[SWITCHAR],DL ; GET THE CURRENT SWITCH CHARACTER
+FIND_DELIM:
+ LODSB
+ CALL DELIM1
+ JZ GOTDELIM
+ CALL DELIM2
+ JNZ FIND_DELIM
+GOTDELIM:
+ DEC SI
+ RETURN
+
+COMPARE:
+ CALL DSRANGE
+ PUSH CX
+ PUSH AX
+ PUSH DX
+ CALL ADDRESS ; Same segment
+ CALL GETEOL
+ POP SI
+ MOV DI,DX
+ MOV ES,AX
+ POP DS
+ POP CX ; Length
+ DEC CX
+ CALL COMP ; Do one less than total
+ INC CX ; CX=1 (do last one)
+COMP:
+ REPE CMPSB
+ RETZ
+; Compare error. Print address, value; value, address.
+ DEC SI
+ MOV CS:COMP_ARG1,DS
+ MOV CS:COMP_ARG2,SI
+ XOR AH,AH
+ LODSB
+ MOV CS:COMP_ARG3,AX
+ DEC DI
+ MOV AL,ES:[DI]
+ MOV CS:COMP_ARG4,AX
+ MOV CS:COMP_ARG5,ES
+ MOV CS:COMP_ARG6,DI
+ INC DI
+ PUSH DS
+ PUSH CS
+ POP DS
+ MOV DX,OFFSET DG:COMP_PTR
+ CALL PRINTF_CRLF
+ POP DS
+ XOR AL,AL
+ JMP SHORT COMP
+
+ PROCEDURE CHECKNONE,NEAR
+ OR DX,DX
+ RETNZ
+ MOV DX,OFFSET DG:SYNERR_PTR ; ERROR MESSAGE
+ JMP PERR
+ ENDPROC CHECKNONE
+
+CODE ENDS
+ END DEBCOM3
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debconst.asm b/private/mvdm/dos/v86/cmd/debug/debconst.asm
new file mode 100644
index 000000000..f6788dfe7
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debconst.asm
@@ -0,0 +1,1162 @@
+;**************************************************************************
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; Change Log:
+;
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 04/01/90 DIC C01 These variables are used to determine if enough memory
+; is available to write a file out to disk. (Compaq STR
+; #1889) (MS Bug #774)
+;*****************************************************************************/
+ PAGE 80,132 ;
+ TITLE DEBCONST.ASM
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBCONST
+ ENDIF
+.XLIST
+.XCREF
+include version.inc ; cas -- missing equates
+include syscall.inc ; cas -- missing equates
+INCLUDE DOSSYM.INC
+INCLUDE debug.inc
+.LIST
+.CREF
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+
+ EXTRN ALUFROMREG:NEAR, ALUTOREG:NEAR, ACCIMM:NEAR, SEGOP:NEAR
+ EXTRN ESPRE:NEAR, SSPRE:NEAR, CSPRE:NEAR, DSPRE:NEAR
+ EXTRN REGOP:NEAR, NOOPERANDS:NEAR, SAVHEX:NEAR, SHORTJMP:NEAR
+ EXTRN MOVSEGTO:NEAR, WORDTOALU:NEAR, MOVSEGFROM:NEAR
+ EXTRN GETADDR:NEAR, XCHGAX:NEAR, LONGJMP:NEAR, LOADACC:NEAR
+ EXTRN STOREACC:NEAR, REGIMMB:NEAR, SAV16:NEAR, MEMIMM:NEAR
+ EXTRN INT3:NEAR, SAV8:NEAR, CHK10:NEAR, M8087:NEAR
+ EXTRN M8087_D9:NEAR, M8087_DB:NEAR, M8087_DD:NEAR
+ EXTRN M8087_DF:NEAR, INFIXB:NEAR, INFIXW:NEAR, OUTFIXB:NEAR
+ EXTRN OUTFIXW:NEAR, JMPCALL:NEAR, INVARB:NEAR, INVARW:NEAR
+ EXTRN OUTVARB:NEAR, OUTVARW:NEAR, PREFIX:NEAR, IMMED:NEAR
+ EXTRN SIGNIMM:NEAR, SHIFT:NEAR, SHIFTV:NEAR, GRP1:NEAR
+ EXTRN GRP2:NEAR, REGIMMW:NEAR, DOORG:NEAR
+
+
+ EXTRN DB_OPER:NEAR, DW_OPER:NEAR, ASSEMLOOP:NEAR, GROUP2:NEAR
+ EXTRN NO_OPER:NEAR, GROUP1:NEAR, FGROUPP:NEAR, FGROUPX:NEAR
+ EXTRN FGROUPZ:NEAR, FD9_OPER:NEAR, FGROUPB:NEAR, FGROUP:NEAR
+ EXTRN FGROUPDS:NEAR, DCINC_OPER:NEAR, INT_OPER:NEAR
+ EXTRN IN_OPER:NEAR, DISP8_OPER:NEAR, JMP_OPER:NEAR, L_OPER:NEAR
+ EXTRN MOV_OPER:NEAR, OUT_OPER:NEAR, PUSH_OPER:NEAR
+ EXTRN GET_DATA16:NEAR, FGROUP3:NEAR, FGROUP3W:NEAR
+ EXTRN FDE_OPER:NEAR, ESC_OPER:NEAR, AA_OPER:NEAR
+ EXTRN CALL_OPER:NEAR, FDB_OPER:NEAR, POP_OPER:NEAR, ROTOP:NEAR
+ EXTRN TST_OPER:NEAR, EX_OPER:NEAR
+
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+
+ PUBLIC REG8, REG16, SREG, SIZ8, DISTAB, DBMN, ADDMN, ADCMN, SUBMN
+ PUBLIC SBBMN, XORMN, ORMN, ANDMN, AAAMN, AADMN, AASMN, CALLMN, CBWMN
+ PUBLIC UPMN, DIMN, CMCMN, CMPMN, CWDMN, DAAMN, DASMN, DECMN, DIVMN
+ PUBLIC ESCMN, HLTMN, IDIVMN, IMULMN, INCMN, INTOMN, INTMN, INMN
+ PUBLIC IRETMN, JAMN, JCXZMN, JNCMN, JBEMN, JZMN, JGEMN, JGMN, JLEMN
+ PUBLIC JLMN, JMPMN, JNZMN, JPEMN, JNZMN, JPEMN, JPOMN, JNSMN, JNOMN
+ PUBLIC JOMN, JSMN, LAHFMN, LDSMN, LEAMN, LESMN, LOCKMN, LODBMN
+ PUBLIC LODWMN, LOOPNZMN, LOOPZMN, LOOPMN, MOVBMN, MOVWMN, MOVMN
+ PUBLIC MULMN, NEGMN, NOPMN, NOTMN, OUTMN, POPFMN, POPMN, PUSHFMN
+ PUBLIC PUSHMN, RCLMN, RCRMN, REPZMN, REPNZMN, RETFMN, RETMN, ROLMN
+ PUBLIC RORMN, SAHFMN, SARMN, SCABMN, SCAWMN, SHLMN, SHRMN, STCMN
+ PUBLIC DOWNMN, EIMN, STOBMN, STOWMN, TESTMN, WAITMN, XCHGMN, XLATMN
+ PUBLIC ESSEGMN, CSSEGMN, SSSEGMN, DSSEGMN, BADMN
+
+ PUBLIC M8087_TAB, FI_TAB, SIZE_TAB, MD9_TAB, MD9_TAB2, MDB_TAB
+ PUBLIC MDB_TAB2, MDD_TAB, MDD_TAB2, MDF_TAB, OPTAB, MAXOP, SHFTAB
+ PUBLIC IMMTAB, GRP1TAB, GRP2TAB, SEGTAB, REGTAB, REGTABEND, FLAGTAB
+ PUBLIC STACK
+
+ PUBLIC DriveOfFile,FileSizeHB,FileSizeLB,TempLB,TempHB ;C01
+
+ PUBLIC AXSAVE, BXSAVE, CXSAVE, DXSAVE, BPSAVE, SPSAVE, SISAVE
+ PUBLIC DISAVE, DSSAVE, ESSAVE, SSSAVE, CSSAVE, IPSAVE, FLSAVE, RSTACK
+ PUBLIC REGDIF, RDFLG, TOTREG, DSIZ, NOREGL, DISPB, LBUFSIZ, LBUFFCNT
+ PUBLIC LINEBUF, PFLAG, COLPOS, RSETFLAG
+
+ IF SYSVER
+ PUBLIC CONFCB, POUT, COUT, CIN, IOBUFF, IOADDR, IOCALL, IOCOM
+ PUBLIC IOSTAT, IOCHRET, IOSEG, IOCNT
+ ENDIF
+
+ PUBLIC QFLAG, NEWEXEC, RETSAVE, USER_PROC_PDB, HEADSAVE, EXEC_BLOCK
+ PUBLIC COM_LINE, COM_FCB1, COM_FCB2, COM_SSSP, COM_CSIP, NEXTCS
+ PUBLIC NEXTIP, NAMESPEC
+
+REG8 DB "ALCLDLBLAHCHDHBH"
+REG16 DB "AXCXDXBXSPBPSIDI"
+SREG DB "ESCSSSDS",0,0
+SIZ8 DB "BYWODWQWTB",0,0
+; 0
+DISTAB DW OFFSET DG:ADDMN,ALUFROMREG
+ DW OFFSET DG:ADDMN,ALUFROMREG
+ DW OFFSET DG:ADDMN,ALUTOREG
+ DW OFFSET DG:ADDMN,ALUTOREG
+ DW OFFSET DG:ADDMN,ACCIMM
+ DW OFFSET DG:ADDMN,ACCIMM
+ DW OFFSET DG:PUSHMN,SEGOP
+ DW OFFSET DG:POPMN,SEGOP
+ DW OFFSET DG:ORMN,ALUFROMREG
+ DW OFFSET DG:ORMN,ALUFROMREG
+ DW OFFSET DG:ORMN,ALUTOREG
+ DW OFFSET DG:ORMN,ALUTOREG
+ DW OFFSET DG:ORMN,ACCIMM
+ DW OFFSET DG:ORMN,ACCIMM
+ DW OFFSET DG:PUSHMN,SEGOP
+ DW OFFSET DG:DBMN,SAVHEX ; cas -- this has always been
+; ; disassembled as a POP CS,
+; ; which doesn't really exist.
+; ; It is now a 386 prefix, but
+; ; we don't know about 386
+; ; instructions, so we'll put
+; ; out a DB
+; 10H
+ DW OFFSET DG:ADCMN,ALUFROMREG
+ DW OFFSET DG:ADCMN,ALUFROMREG
+ DW OFFSET DG:ADCMN,ALUTOREG
+ DW OFFSET DG:ADCMN,ALUTOREG
+ DW OFFSET DG:ADCMN,ACCIMM
+ DW OFFSET DG:ADCMN,ACCIMM
+ DW OFFSET DG:PUSHMN,SEGOP
+ DW OFFSET DG:POPMN,SEGOP
+ DW OFFSET DG:SBBMN,ALUFROMREG
+ DW OFFSET DG:SBBMN,ALUFROMREG
+ DW OFFSET DG:SBBMN,ALUTOREG
+ DW OFFSET DG:SBBMN,ALUTOREG
+ DW OFFSET DG:SBBMN,ACCIMM
+ DW OFFSET DG:SBBMN,ACCIMM
+ DW OFFSET DG:PUSHMN,SEGOP
+ DW OFFSET DG:POPMN,SEGOP
+; 20H
+ DW OFFSET DG:ANDMN,ALUFROMREG
+ DW OFFSET DG:ANDMN,ALUFROMREG
+ DW OFFSET DG:ANDMN,ALUTOREG
+ DW OFFSET DG:ANDMN,ALUTOREG
+ DW OFFSET DG:ANDMN,ACCIMM
+ DW OFFSET DG:ANDMN,ACCIMM
+ DW OFFSET DG:ESSEGMN,ESPRE
+ DW OFFSET DG:DAAMN,NOOPERANDS
+ DW OFFSET DG:SUBMN,ALUFROMREG
+ DW OFFSET DG:SUBMN,ALUFROMREG
+ DW OFFSET DG:SUBMN,ALUTOREG
+ DW OFFSET DG:SUBMN,ALUTOREG
+ DW OFFSET DG:SUBMN,ACCIMM
+ DW OFFSET DG:SUBMN,ACCIMM
+ DW OFFSET DG:CSSEGMN,CSPRE
+ DW OFFSET DG:DASMN,NOOPERANDS
+; 30H
+ DW OFFSET DG:XORMN,ALUFROMREG
+ DW OFFSET DG:XORMN,ALUFROMREG
+ DW OFFSET DG:XORMN,ALUTOREG
+ DW OFFSET DG:XORMN,ALUTOREG
+ DW OFFSET DG:XORMN,ACCIMM
+ DW OFFSET DG:XORMN,ACCIMM
+ DW OFFSET DG:SSSEGMN,SSPRE
+ DW OFFSET DG:AAAMN,NOOPERANDS
+ DW OFFSET DG:CMPMN,ALUFROMREG
+ DW OFFSET DG:CMPMN,ALUFROMREG
+ DW OFFSET DG:CMPMN,ALUTOREG
+ DW OFFSET DG:CMPMN,ALUTOREG
+ DW OFFSET DG:CMPMN,ACCIMM
+ DW OFFSET DG:CMPMN,ACCIMM
+ DW OFFSET DG:DSSEGMN,DSPRE
+ DW OFFSET DG:AASMN,NOOPERANDS
+; 40H
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:INCMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+ DW OFFSET DG:DECMN,REGOP
+; 50H
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:PUSHMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+ DW OFFSET DG:POPMN,REGOP
+; 60H
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+; 70H
+ DW OFFSET DG:JOMN,SHORTJMP
+ DW OFFSET DG:JNOMN,SHORTJMP
+ DW OFFSET DG:JCMN,SHORTJMP
+ DW OFFSET DG:JNCMN,SHORTJMP
+ DW OFFSET DG:JZMN,SHORTJMP
+ DW OFFSET DG:JNZMN,SHORTJMP
+ DW OFFSET DG:JBEMN,SHORTJMP
+ DW OFFSET DG:JAMN,SHORTJMP
+ DW OFFSET DG:JSMN,SHORTJMP
+ DW OFFSET DG:JNSMN,SHORTJMP
+ DW OFFSET DG:JPEMN,SHORTJMP
+ DW OFFSET DG:JPOMN,SHORTJMP
+ DW OFFSET DG:JLMN,SHORTJMP
+ DW OFFSET DG:JGEMN,SHORTJMP
+ DW OFFSET DG:JLEMN,SHORTJMP
+ DW OFFSET DG:JGMN,SHORTJMP
+; 80H
+ DW 0,IMMED
+ DW 0,IMMED
+ DW 0,IMMED
+ DW 0,SIGNIMM
+ DW OFFSET DG:TESTMN,ALUTOREG ;ARR 2.4
+ DW OFFSET DG:TESTMN,ALUTOREG ;ARR 2.4
+ DW OFFSET DG:XCHGMN,ALUTOREG ;ARR 2.4
+ DW OFFSET DG:XCHGMN,ALUTOREG ;ARR 2.4
+ DW OFFSET DG:MOVMN,ALUFROMREG
+ DW OFFSET DG:MOVMN,ALUFROMREG
+ DW OFFSET DG:MOVMN,ALUTOREG
+ DW OFFSET DG:MOVMN,ALUTOREG
+ DW OFFSET DG:MOVMN,MOVSEGTO
+ DW OFFSET DG:LEAMN,WORDTOALU
+ DW OFFSET DG:MOVMN,MOVSEGFROM
+ DW OFFSET DG:POPMN,GETADDR
+; 90H
+ DW OFFSET DG:NOPMN,NOOPERANDS
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:XCHGMN,XCHGAX
+ DW OFFSET DG:CBWMN,NOOPERANDS
+ DW OFFSET DG:CWDMN,NOOPERANDS
+ DW OFFSET DG:CALLMN,LONGJMP
+ DW OFFSET DG:WAITMN,NOOPERANDS
+ DW OFFSET DG:PUSHFMN,NOOPERANDS
+ DW OFFSET DG:POPFMN,NOOPERANDS
+ DW OFFSET DG:SAHFMN,NOOPERANDS
+ DW OFFSET DG:LAHFMN,NOOPERANDS
+; A0H
+ DW OFFSET DG:MOVMN,LOADACC
+ DW OFFSET DG:MOVMN,LOADACC
+ DW OFFSET DG:MOVMN,STOREACC
+ DW OFFSET DG:MOVMN,STOREACC
+ DW OFFSET DG:MOVBMN,NOOPERANDS
+ DW OFFSET DG:MOVWMN,NOOPERANDS
+ DW OFFSET DG:CMPBMN,NOOPERANDS
+ DW OFFSET DG:CMPWMN,NOOPERANDS
+ DW OFFSET DG:TESTMN,ACCIMM
+ DW OFFSET DG:TESTMN,ACCIMM
+ DW OFFSET DG:STOBMN,NOOPERANDS
+ DW OFFSET DG:STOWMN,NOOPERANDS
+ DW OFFSET DG:LODBMN,NOOPERANDS
+ DW OFFSET DG:LODWMN,NOOPERANDS
+ DW OFFSET DG:SCABMN,NOOPERANDS
+ DW OFFSET DG:SCAWMN,NOOPERANDS
+; B0H
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMB
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+ DW OFFSET DG:MOVMN,REGIMMW
+; C0H
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:RETMN,SAV16
+ DW OFFSET DG:RETMN,NOOPERANDS
+ DW OFFSET DG:LESMN,WORDTOALU
+ DW OFFSET DG:LDSMN,WORDTOALU
+ DW OFFSET DG:MOVMN,MEMIMM
+ DW OFFSET DG:MOVMN,MEMIMM
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:RETFMN,SAV16
+ DW OFFSET DG:RETFMN,NOOPERANDS
+ DW OFFSET DG:INTMN,INT3
+ DW OFFSET DG:INTMN,SAV8
+ DW OFFSET DG:INTOMN,NOOPERANDS
+ DW OFFSET DG:IRETMN,NOOPERANDS
+; D0H
+ DW 0,SHIFT
+ DW 0,SHIFT
+ DW 0,SHIFTV
+ DW 0,SHIFTV
+ DW OFFSET DG:AAMMN,CHK10
+ DW OFFSET DG:AADMN,CHK10
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:XLATMN,NOOPERANDS
+ DW 0,M8087 ; d8
+ DW 0,M8087_D9 ; d9
+ DW 0,M8087 ; da
+ DW 0,M8087_DB ; db
+ DW 0,M8087 ; dc
+ DW 0,M8087_DD ; dd
+ DW 0,M8087 ; de
+ DW 0,M8087_DF ; df
+; E0H
+ DW OFFSET DG:LOOPNZMN,SHORTJMP
+ DW OFFSET DG:LOOPZMN,SHORTJMP
+ DW OFFSET DG:LOOPMN,SHORTJMP
+ DW OFFSET DG:JCXZMN,SHORTJMP
+ DW OFFSET DG:INMN,INFIXB
+ DW OFFSET DG:INMN,INFIXW
+ DW OFFSET DG:OUTMN,OUTFIXB
+ DW OFFSET DG:OUTMN,OUTFIXW
+ DW OFFSET DG:CALLMN,JMPCALL
+ DW OFFSET DG:JMPMN,JMPCALL
+ DW OFFSET DG:JMPMN,LONGJMP
+ DW OFFSET DG:JMPMN,SHORTJMP
+ DW OFFSET DG:INMN,INVARB
+ DW OFFSET DG:INMN,INVARW
+ DW OFFSET DG:OUTMN,OUTVARB
+ DW OFFSET DG:OUTMN,OUTVARW
+; F0H
+ DW OFFSET DG:LOCKMN,PREFIX
+ DW OFFSET DG:DBMN,SAVHEX
+ DW OFFSET DG:REPNZMN,PREFIX
+ DW OFFSET DG:REPZMN,PREFIX
+ DW OFFSET DG:HLTMN,NOOPERANDS
+ DW OFFSET DG:CMCMN,NOOPERANDS
+ DW 0,GRP1
+ DW 0,GRP1
+ DW OFFSET DG:CLCMN,NOOPERANDS
+ DW OFFSET DG:STCMN,NOOPERANDS
+ DW OFFSET DG:DIMN,NOOPERANDS
+ DW OFFSET DG:EIMN,NOOPERANDS
+ DW OFFSET DG:UPMN,NOOPERANDS
+ DW OFFSET DG:DOWNMN,NOOPERANDS
+ DW 0,GRP2
+ DW 0,GRP2
+
+DBMN DB "DB",0
+ DB "DW",0
+ DB ";",0
+ORGMN DB "ORG",0
+ADDMN DB "ADD",0
+ADCMN DB "ADC",0
+SUBMN DB "SUB",0
+SBBMN DB "SBB",0
+XORMN DB "XOR",0
+ORMN DB "OR",0
+ANDMN DB "AND",0
+AAAMN DB "AAA",0
+AADMN DB "AAD",0
+AAMMN DB "AAM",0
+AASMN DB "AAS",0
+CALLMN DB "CALL",0
+CBWMN DB "CBW",0
+CLCMN DB "CLC",0
+UPMN DB "CLD",0 ; CLD,0
+DIMN DB "CLI",0
+CMCMN DB "CMC",0
+CMPBMN DB "CMPSB",0 ; CMPSB
+CMPWMN DB "CMPSW",0 ; CMPSW,0
+CMPMN DB "CMP",0
+CWDMN DB "CWD",0
+DAAMN DB "DAA",0
+DASMN DB "DAS",0
+DECMN DB "DEC",0
+DIVMN DB "DIV",0
+ESCMN DB "ESC",0
+ DB "FXCH",0
+ DB "FFREE",0
+ DB "FCOMPP",0
+ DB "FCOMP",0
+ DB "FCOM",0
+ DB "FICOMP",0
+ DB "FICOM",0
+ DB "FNOP",0
+ DB "FCHS",0
+ DB "FABS",0
+ DB "FTST",0
+ DB "FXAM",0
+ DB "FLDL2T",0
+ DB "FLDL2E",0
+ DB "FLDLG2",0
+ DB "FLDLN2",0
+ DB "FLDPI",0
+ DB "FLD1",0
+ DB "FLDZ",0
+ DB "F2XM1",0
+ DB "FYL2XP1",0
+ DB "FYL2X",0
+ DB "FPTAN",0
+ DB "FPATAN",0
+ DB "FXTRACT",0
+ DB "FDECSTP",0
+ DB "FINCSTP",0
+ DB "FPREM",0
+ DB "FSQRT",0
+ DB "FRNDINT",0
+ DB "FSCALE",0
+ DB "FINIT",0
+ DB "FDISI",0
+ DB "FENI",0
+ DB "FCLEX",0
+ DB "FBLD",0
+ DB "FBSTP",0
+ DB "FLDCW",0
+ DB "FSTCW",0
+ DB "FSTSW",0
+ DB "FSTENV",0
+ DB "FLDENV",0
+ DB "FSAVE",0
+ DB "FRSTOR",0
+ DB "FADDP",0
+ DB "FADD",0
+ DB "FIADD",0
+ DB "FSUBRP",0
+ DB "FSUBR",0
+ DB "FSUBP",0
+ DB "FSUB",0
+ DB "FISUBR",0
+ DB "FISUB",0
+ DB "FMULP",0
+ DB "FMUL",0
+ DB "FIMUL",0
+ DB "FDIVRP",0
+ DB "FDIVR",0
+ DB "FDIVP",0
+ DB "FDIV",0
+ DB "FIDIVR",0
+ DB "FIDIV",0
+ DB "FWAIT",0
+ DB "FILD",0
+ DB "FLD",0
+ DB "FSTP",0
+ DB "FST",0
+ DB "FISTP",0
+ DB "FIST",0
+HLTMN DB "HLT",0
+IDIVMN DB "IDIV",0
+IMULMN DB "IMUL",0
+INCMN DB "INC",0
+INTOMN DB "INTO",0
+INTMN DB "INT",0
+INMN DB "IN",0 ; IN
+IRETMN DB "IRET",0
+ DB "JNBE",0
+ DB "JAE",0
+JAMN DB "JA",0
+JCXZMN DB "JCXZ",0
+JNCMN DB "JNB",0
+JBEMN DB "JBE",0
+JCMN DB "JB",0
+ DB "JNC",0
+ DB "JC",0
+ DB "JNAE",0
+ DB "JNA",0
+JZMN DB "JZ",0
+ DB "JE",0
+JGEMN DB "JGE",0
+JGMN DB "JG",0
+ DB "JNLE",0
+ DB "JNL",0
+JLEMN DB "JLE",0
+JLMN DB "JL",0
+ DB "JNGE",0
+ DB "JNG",0
+JMPMN DB "JMP",0
+JNZMN DB "JNZ",0
+ DB "JNE",0
+JPEMN DB "JPE",0
+JPOMN DB "JPO",0
+ DB "JNP",0
+JNSMN DB "JNS",0
+JNOMN DB "JNO",0
+JOMN DB "JO",0
+JSMN DB "JS",0
+ DB "JP",0
+LAHFMN DB "LAHF",0
+LDSMN DB "LDS",0
+LEAMN DB "LEA",0
+LESMN DB "LES",0
+LOCKMN DB "LOCK",0
+LODBMN DB "LODSB",0 ; LODSB
+LODWMN DB "LODSW",0 ; LODSW,0
+LOOPNZMN DB "LOOPNZ",0
+LOOPZMN DB "LOOPZ",0
+ DB "LOOPNE",0
+ DB "LOOPE",0
+LOOPMN DB "LOOP",0
+MOVBMN DB "MOVSB",0 ; MOVSB
+MOVWMN DB "MOVSW",0 ; MOVSW,0
+MOVMN DB "MOV",0
+MULMN DB "MUL",0
+NEGMN DB "NEG",0
+NOPMN DB "NOP",0
+NOTMN DB "NOT",0
+OUTMN DB "OUT",0 ; OUT
+POPFMN DB "POPF",0
+POPMN DB "POP",0
+PUSHFMN DB "PUSHF",0
+PUSHMN DB "PUSH",0
+RCLMN DB "RCL",0
+RCRMN DB "RCR",0
+REPZMN DB "REPZ",0
+REPNZMN DB "REPNZ",0
+ DB "REPE",0
+ DB "REPNE",0
+ DB "REP",0
+RETFMN DB "RETF",0
+RETMN DB "RET",0
+ROLMN DB "ROL",0
+RORMN DB "ROR",0
+SAHFMN DB "SAHF",0
+SARMN DB "SAR",0
+SCABMN DB "SCASB",0 ; SCASB
+SCAWMN DB "SCASW",0 ; SCASW,0
+SHLMN DB "SHL",0
+SHRMN DB "SHR",0
+STCMN DB "STC",0
+DOWNMN DB "STD",0 ; STD
+EIMN DB "STI",0 ; STI
+STOBMN DB "STOSB",0 ; STOSB
+STOWMN DB "STOSW",0 ; STOSW,0
+TESTMN DB "TEST",0
+WAITMN DB "WAIT",0
+XCHGMN DB "XCHG",0
+XLATMN DB "XLAT",0
+ESSEGMN DB "ES:",0
+CSSEGMN DB "CS:",0
+SSSEGMN DB "SS:",0
+DSSEGMN DB "DS:",0
+BADMN DB "???",0
+
+M8087_TAB DB "ADD$MUL$COM$COMP$SUB$SUBR$DIV$DIVR$"
+FI_TAB DB "F$FI$F$FI$"
+SIZE_TAB DB "DWORD PTR $DWORD PTR $QWORD PTR $WORD PTR $"
+ DB "BYTE PTR $TBYTE PTR $"
+
+MD9_TAB DB "LD$@$ST$STP$LDENV$LDCW$STENV$STCW$"
+MD9_TAB2 DB "CHS$ABS$@$@$TST$XAM$@$@$LD1$LDL2T$LDL2E$"
+ DB "LDPI$LDLG2$LDLN2$LDZ$@$2XM1$YL2X$PTAN$PATAN$XTRACT$"
+ DB "@$DECSTP$INCSTP$PREM$YL2XP1$SQRT$@$RNDINT$SCALE$@$@$"
+
+MDB_TAB DB "ILD$@$IST$ISTP$@$LD$@$STP$"
+MDB_TAB2 DB "ENI$DISI$CLEX$INIT$"
+
+MDD_TAB DB "LD$@$ST$STP$RSTOR$@$SAVE$STSW$"
+MDD_TAB2 DB "FREE$XCH$ST$STP$"
+
+MDF_TAB DB "ILD$@$IST$ISTP$BLD$ILD$BSTP$ISTP$"
+
+
+OPTAB DB 11111111B ; DB
+ DW DB_OPER
+ DB 11111111B ; DW
+ DW DW_OPER
+ DB 11111111B ; COMMENT
+ DW ASSEMLOOP
+ DB 11111111B ; ORG
+ DW DOORG
+ DB 0 * 8 ; ADD
+ DW GROUP2
+ DB 2 * 8 ; ADC
+ DW GROUP2
+ DB 5 * 8 ; SUB
+ DW GROUP2
+ DB 3 * 8 ; SBB
+ DW GROUP2
+ DB 6 * 8 ; XOR
+ DW GROUP2
+ DB 1 * 8 ; OR
+ DW GROUP2
+ DB 4 * 8 ; AND
+ DW GROUP2
+ DB 00110111B ; AAA
+ DW NO_OPER
+ DB 11010101B ; AAD
+ DW AA_OPER
+ DB 11010100B ; AAM
+ DW AA_OPER
+ DB 00111111B ; AAS
+ DW NO_OPER
+ DB 2 * 8 ; CALL
+ DW CALL_OPER
+ DB 10011000B ; CBW
+ DW NO_OPER
+ DB 11111000B ; CLC
+ DW NO_OPER
+ DB 11111100B ; CLD
+ DW NO_OPER
+ DB 11111010B ; DIM
+ DW NO_OPER
+ DB 11110101B ; CMC
+ DW NO_OPER
+ DB 10100110B ; CMPB
+ DW NO_OPER
+ DB 10100111B ; CMPW
+ DW NO_OPER
+ DB 7 * 8 ; CMP
+ DW GROUP2
+ DB 10011001B ; CWD
+ DW NO_OPER
+ DB 00100111B ; DAA
+ DW NO_OPER
+ DB 00101111B ; DAS
+ DW NO_OPER
+ DB 1 * 8 ; DEC
+ DW DCINC_OPER
+ DB 6 * 8 ; DIV
+ DW GROUP1
+ DB 11011000B ; ESC
+ DW ESC_OPER
+ DB 00001001B ; FXCH
+ DW FGROUPP
+ DB 00101000B ; FFREE
+ DW FGROUPP
+ DB 11011001B ; FCOMPP
+ DW FDE_OPER
+ DB 00000011B ; FCOMP
+ DW FGROUPX ; Exception to normal P instructions
+ DB 00000010B ; FCOM
+ DW FGROUPX
+ DB 00010011B ; FICOMP
+ DW FGROUPZ
+ DB 00010010B ; FICOM
+ DW FGROUPZ
+ DB 11010000B ; FNOP
+ DW FD9_OPER
+ DB 11100000B ; FCHS
+ DW FD9_OPER
+ DB 11100001B ; FABS
+ DW FD9_OPER
+ DB 11100100B ; FTST
+ DW FD9_OPER
+ DB 11100101B ; FXAM
+ DW FD9_OPER
+ DB 11101001B ; FLDL2T
+ DW FD9_OPER
+ DB 11101010B ; FLDL2E
+ DW FD9_OPER
+ DB 11101100B ; FLDLG2
+ DW FD9_OPER
+ DB 11101101B ; FLDLN2
+ DW FD9_OPER
+ DB 11101011B ; FLDPI
+ DW FD9_OPER
+ DB 11101000B ; FLD1
+ DW FD9_OPER
+ DB 11101110B ; FLDZ
+ DW FD9_OPER
+ DB 11110000B ; F2XM1
+ DW FD9_OPER
+ DB 11111001B ; FYL2XP1
+ DW FD9_OPER
+ DB 11110001B ; FYL2X
+ DW FD9_OPER
+ DB 11110010B ; FPTAN
+ DW FD9_OPER
+ DB 11110011B ; FPATAN
+ DW FD9_OPER
+ DB 11110100B ; FXTRACT
+ DW FD9_OPER
+ DB 11110110B ; FDECSTP
+ DW FD9_OPER
+ DB 11110111B ; FINCSTP
+ DW FD9_OPER
+ DB 11111000B ; FPREM
+ DW FD9_OPER
+ DB 11111010B ; FSQRT
+ DW FD9_OPER
+ DB 11111100B ; FRNDINT
+ DW FD9_OPER
+ DB 11111101B ; FSCALE
+ DW FD9_OPER
+ DB 11100011B ; FINIT
+ DW FDB_OPER
+ DB 11100001B ; FDISI
+ DW FDB_OPER
+ DB 11100000B ; FENI
+ DW FDB_OPER
+ DB 11100010B ; FCLEX
+ DW FDB_OPER
+ DB 00111100B ; FBLD
+ DW FGROUPB
+ DB 00111110B ; FBSTP
+ DW FGROUPB
+ DB 00001101B ; FLDCW
+ DW FGROUP3W
+ DB 00001111B ; FSTCW
+ DW FGROUP3W
+ DB 00101111B ; FSTSW
+ DW FGROUP3W
+ DB 00001110B ; FSTENV
+ DW FGROUP3
+ DB 00001100B ; FLDENV
+ DW FGROUP3
+ DB 00101110B ; FSAVE
+ DW FGROUP3
+ DB 00101100B ; FRSTOR
+ DW FGROUP3
+ DB 00110000B ; FADDP
+ DW FGROUPP
+ DB 00000000B ; FADD
+ DW FGROUP
+ DB 00010000B ; FIADD
+ DW FGROUPZ
+ DB 00110100B ; FSUBRP
+ DW FGROUPP
+ DB 00000101B ; FSUBR
+ DW FGROUPDS
+ DB 00110101B ; FSUBP
+ DW FGROUPP
+ DB 00000100B ; FSUB
+ DW FGROUPDS
+ DB 00010101B ; FISUBR
+ DW FGROUPZ
+ DB 00010100B ; FISUB
+ DW FGROUPZ
+ DB 00110001B ; FMULP
+ DW FGROUPP
+ DB 00000001B ; FMUL
+ DW FGROUP
+ DB 00010001B ; FIMUL
+ DW FGROUPZ
+ DB 00110110B ; FDIVRP
+ DW FGROUPP
+ DB 00000111B ; FDIVR
+ DW FGROUPDS
+ DB 00110111B ; FDIVP
+ DW FGROUPP
+ DB 00000110B ; FDIV
+ DW FGROUPDS
+ DB 00010111B ; FIDIVR
+ DW FGROUPZ
+ DB 00010110B ; FIDIV
+ DW FGROUPZ
+ DB 10011011B ; FWAIT
+ DW NO_OPER
+ DB 00011000B ; FILD
+ DW FGROUPZ
+ DB 00001000B ; FLD
+ DW FGROUPX
+ DB 00001011B ; FSTP
+ DW FGROUP ;an000; dms;
+ DB 00101010B ; FST
+ DW FGROUPX
+ DB 00011011B ; FISTP
+ DW FGROUPZ
+ DB 00011010B ; FIST
+ DW FGROUPZ
+ DB 11110100B ; HLT
+ DW NO_OPER
+ DB 7 * 8 ; IDIV
+ DW GROUP1
+ DB 5 * 8 ; IMUL
+ DW GROUP1
+ DB 0 * 8 ; INC
+ DW DCINC_OPER
+ DB 11001110B ; INTO
+ DW NO_OPER
+ DB 11001100B ; INTM
+ DW INT_OPER
+ DB 11101100B ; IN
+ DW IN_OPER
+ DB 11001111B ; IRET
+ DW NO_OPER
+ DB 01110111B ; JNBE
+ DW DISP8_OPER
+ DB 01110011B ; JAE
+ DW DISP8_OPER
+ DB 01110111B ; JA
+ DW DISP8_OPER
+ DB 11100011B ; JCXZ
+ DW DISP8_OPER
+ DB 01110011B ; JNB
+ DW DISP8_OPER
+ DB 01110110B ; JBE
+ DW DISP8_OPER
+ DB 01110010B ; JB
+ DW DISP8_OPER
+ DB 01110011B ; JNC
+ DW DISP8_OPER
+ DB 01110010B ; JC
+ DW DISP8_OPER
+ DB 01110010B ; JNAE
+ DW DISP8_OPER
+ DB 01110110B ; JNA
+ DW DISP8_OPER
+ DB 01110100B ; JZ
+ DW DISP8_OPER
+ DB 01110100B ; JE
+ DW DISP8_OPER
+ DB 01111101B ; JGE
+ DW DISP8_OPER
+ DB 01111111B ; JG
+ DW DISP8_OPER
+ DB 01111111B ; JNLE
+ DW DISP8_OPER
+ DB 01111101B ; JNL
+ DW DISP8_OPER
+ DB 01111110B ; JLE
+ DW DISP8_OPER
+ DB 01111100B ; JL
+ DW DISP8_OPER
+ DB 01111100B ; JNGE
+ DW DISP8_OPER
+ DB 01111110B ; JNG
+ DW DISP8_OPER
+ DB 4 * 8 ; JMP
+ DW JMP_OPER
+ DB 01110101B ; JNZ
+ DW DISP8_OPER
+ DB 01110101B ; JNE
+ DW DISP8_OPER
+ DB 01111010B ; JPE
+ DW DISP8_OPER
+ DB 01111011B ; JPO
+ DW DISP8_OPER
+ DB 01111011B ; JNP
+ DW DISP8_OPER
+ DB 01111001B ; JNS
+ DW DISP8_OPER
+ DB 01110001B ; JNO
+ DW DISP8_OPER
+ DB 01110000B ; JO
+ DW DISP8_OPER
+ DB 01111000B ; JS
+ DW DISP8_OPER
+ DB 01111010B ; JP
+ DW DISP8_OPER
+ DB 10011111B ; LAHF
+ DW NO_OPER
+ DB 11000101B ; LDS
+ DW L_OPER
+ DB 10001101B ; LEA
+ DW L_OPER
+ DB 11000100B ; LES
+ DW L_OPER
+ DB 11110000B ; LOCK
+ DW NO_OPER
+ DB 10101100B ; LODB
+ DW NO_OPER
+ DB 10101101B ; LODW
+ DW NO_OPER
+ DB 11100000B ; LOOPNZ
+ DW DISP8_OPER
+ DB 11100001B ; LOOPZ
+ DW DISP8_OPER
+ DB 11100000B ; LOOPNE
+ DW DISP8_OPER
+ DB 11100001B ; LOOPE
+ DW DISP8_OPER
+ DB 11100010B ; LOOP
+ DW DISP8_OPER
+ DB 10100100B ; MOVB
+ DW NO_OPER
+ DB 10100101B ; MOVW
+ DW NO_OPER
+ DB 11000110B ; MOV
+ DW MOV_OPER
+ DB 4 * 8 ; MUL
+ DW GROUP1
+ DB 3 * 8 ; NEG
+ DW GROUP1
+ DB 10010000B ; NOP
+ DW NO_OPER
+ DB 2 * 8 ; NOT
+ DW GROUP1
+ DB 11101110B ; OUT
+ DW OUT_OPER
+ DB 10011101B ; POPF
+ DW NO_OPER
+ DB 0 * 8 ; POP
+ DW POP_OPER
+ DB 10011100B ; PUSHF
+ DW NO_OPER
+ DB 6 * 8 ; PUSH
+ DW PUSH_OPER
+ DB 2 * 8 ; RCL
+ DW ROTOP
+ DB 3 * 8 ; RCR
+ DW ROTOP
+ DB 11110011B ; REPZ
+ DW NO_OPER
+ DB 11110010B ; REPNZ
+ DW NO_OPER
+ DB 11110011B ; REPE
+ DW NO_OPER
+ DB 11110010B ; REPNE
+ DW NO_OPER
+ DB 11110011B ; REP
+ DW NO_OPER
+ DB 11001011B ; RETF
+ DW GET_DATA16
+ DB 11000011B ; RET
+ DW GET_DATA16
+ DB 0 * 8 ; ROL
+ DW ROTOP
+ DB 1 * 8 ; ROR
+ DW ROTOP
+ DB 10011110B ; SAHF
+ DW NO_OPER
+ DB 7 * 8 ; SAR
+ DW ROTOP
+ DB 10101110B ; SCAB
+ DW NO_OPER
+ DB 10101111B ; SCAW
+ DW NO_OPER
+ DB 4 * 8 ; SHL
+ DW ROTOP
+ DB 5 * 8 ; SHR
+ DW ROTOP
+ DB 11111001B ; STC
+ DW NO_OPER
+ DB 11111101B ; STD
+ DW NO_OPER
+ DB 11111011B ; EI
+ DW NO_OPER
+ DB 10101010B ; STOB
+ DW NO_OPER
+ DB 10101011B ; STOW
+ DW NO_OPER
+ DB 11110110B ; TEST
+ DW TST_OPER
+ DB 10011011B ; WAIT
+ DW NO_OPER
+ DB 10000110B ; XCHG
+ DW EX_OPER
+ DB 11010111B ; XLAT
+ DW NO_OPER
+ DB 00100110B ; ESSEG
+ DW NO_OPER
+ DB 00101110B ; CSSEG
+ DW NO_OPER
+ DB 00110110B ; SSSEG
+ DW NO_OPER
+ DB 00111110B ; DSSEG
+ DW NO_OPER
+
+ZZOPCODE LABEL BYTE
+MAXOP = (ZZOPCODE-OPTAB)/3
+
+SHFTAB DW OFFSET DG:ROLMN,OFFSET DG:RORMN,OFFSET DG:RCLMN
+ DW OFFSET DG:RCRMN,OFFSET DG:SHLMN,OFFSET DG:SHRMN
+ DW OFFSET DG:BADMN,OFFSET DG:SARMN
+
+IMMTAB DW OFFSET DG:ADDMN,OFFSET DG:ORMN,OFFSET DG:ADCMN
+ DW OFFSET DG:SBBMN,OFFSET DG:ANDMN,OFFSET DG:SUBMN
+ DW OFFSET DG:XORMN,OFFSET DG:CMPMN
+
+GRP1TAB DW OFFSET DG:TESTMN,OFFSET DG:BADMN,OFFSET DG:NOTMN
+ DW OFFSET DG:NEGMN,OFFSET DG:MULMN,OFFSET DG:IMULMN
+ DW OFFSET DG:DIVMN,OFFSET DG:IDIVMN
+
+GRP2TAB DW OFFSET DG:INCMN,OFFSET DG:DECMN,OFFSET DG:CALLMN
+ DW OFFSET DG:CALLMN,OFFSET DG:JMPMN,OFFSET DG:JMPMN
+ DW OFFSET DG:PUSHMN,OFFSET DG:BADMN
+
+SEGTAB DW OFFSET DG:ESSAVE,OFFSET DG:CSSAVE,OFFSET DG:SSSAVE
+ DW OFFSET DG:DSSAVE
+
+REGTAB DB "AX",0,"BX",0,"CX",0,"DX",0,"SP",0,"BP",0
+ DB "SI",0,"DI",0,"DS",0,"ES",0,"SS",0,"CS",0,"IP",0,"PC",0
+REGTABEND LABEL WORD
+
+; Flags are ordered to correspond with the bits of the flag
+; register, most significant bit first, zero if bit is not
+; a flag. First 16 entries are for bit set, second 16 for
+; bit reset.
+
+FLAGTAB DW 0
+ DW 0
+ DW 0
+ DW 0
+ DB "OV"
+ DB "DN"
+ DB "EI" ; "STI"
+ DW 0
+ DB "NG"
+ DB "ZR"
+ DW 0
+ DB "AC"
+ DW 0
+ DB "PE"
+ DW 0
+ DB "CY"
+ DW 0
+ DW 0
+ DW 0
+ DW 0
+ DB "NV"
+ DB "UP" ; "CLD"
+ DB "DI"
+ DW 0
+ DB "PL"
+ DB "NZ"
+ DW 0
+ DB "NA"
+ DW 0
+ DB "PO"
+ DW 0
+ DB "NC"
+
+ DW 80H DUP(?)
+STACK LABEL BYTE
+
+
+; Register save area
+
+AXSAVE DW 0
+BXSAVE DW 0
+CXSAVE DW 0
+DXSAVE DW 0
+SPSAVE DW 5AH
+BPSAVE DW 0
+SISAVE DW 0
+DISAVE DW 0
+DSSAVE DW 0
+ESSAVE DW 0
+RSTACK LABEL WORD ; Stack set here so registers can be saved by pushing
+SSSAVE DW 0
+CSSAVE DW 0
+IPSAVE DW 100H
+FLSAVE DW 0F202H
+
+RSETFLAG DB 0
+
+; These variables used to determine if the file is larget than the ;C01
+; amount of disk space available whenever a write occurs. ;C01
+ ;C01
+FileSizeLB DW 0 ;C01
+FileSizeHB DW 0 ;C01
+TempHB DW 0 ;C01
+TempLB DW 0 ;C01
+DriveOfFile DB ? ;C01
+
+REGDIF EQU AXSAVE-REGTAB
+
+; This value is initially 0, it is set to non-zero if a file is specified
+; either at debug invokation, or via the (N)ame command. It is used to
+; control the printing of the NONAMESPEC message for the (W)rite command.
+NAMESPEC DB 0
+
+; RAM area.
+
+RDFLG DB READ
+TOTREG DB 13
+DSIZ DB 0FH ;changed to 7 if screen 40 col mode
+NOREGL DB 8 ;changed to 4 if screen 40 col mode
+DISPB DW 128 ;changed to 64 if screen 40 col mode
+
+LBUFSIZ DB BUFLEN
+LBUFFCNT DB 0
+LINEBUF DB 0DH
+ DB BUFLEN DUP (?)
+PFLAG DB 0
+COLPOS DB 0
+
+ IF SYSVER
+CONFCB DB 0
+ DB "PRN "
+ DB 25 DUP(0)
+
+POUT DD ?
+COUT DD ?
+CIN DD ?
+IOBUFF DB 3 DUP (?)
+IOADDR DD ?
+
+IOCALL DB 22
+ DB 0
+IOCOM DB 0
+IOSTAT DW 0
+ DB 8 DUP (0)
+IOCHRET DB 0
+ DW OFFSET DG:IOBUFF
+IOSEG DW ?
+IOCNT DW 1
+ DW 0
+ ENDIF
+
+QFLAG DB 0
+NEWEXEC DB 0
+RETSAVE DW ?
+
+USER_PROC_PDB DW ?
+NextCS DW ?
+NextIP DW ?
+
+HEADSAVE DW ?
+
+EXEC_BLOCK LABEL BYTE
+ DW 0
+COM_LINE LABEL DWORD
+ DW 80H
+ DW ?
+COM_FCB1 LABEL DWORD
+ DW FCB
+ DW ?
+COM_FCB2 LABEL DWORD
+ DW FCB + 10H
+ DW ?
+COM_SSSP DD ?
+COM_CSIP DD ?
+
+CONST ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debdata.asm b/private/mvdm/dos/v86/cmd/debug/debdata.asm
new file mode 100644
index 000000000..f0d2e6373
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debdata.asm
@@ -0,0 +1,245 @@
+ PAGE 60,132 ;
+ TITLE DEBDATA.ASM
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DEBDATA.ASM
+;
+; DESCRIPTIVE NAME: DATA SEGMENT VALUE DEFINITION
+;
+; FUNCTION: PROVIDES ALL DATA SEGMENT DEFINITIONS.
+;
+; ENTRY POINT: NA
+;
+; INPUT: ANY VALUE IN DATA SEGMENT
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES: NA
+;
+; EXTERNAL REFERENCES: NA
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT DBCS HANDLING DMS:6/17/87
+; - IMPLEMENT MESSAGE RETRIEVER DMS:6/17/87
+; - > 32 MB SUPPORT DMS:6/17/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+;======================= END OF SPECIFICATIONS ===========================
+;
+; Change Log:
+;
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 03/21/90 DIC C04 Fixed Microsoft Bug #744 - A problem involving a
+; limitation on the total number of requested EMS memory
+; pages to 255. This limit is now a 4-digit hexadecimal
+; number.
+;
+;=============================================================================
+
+.XLIST
+.XCREF
+ include version.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+ INCLUDE DPL.ASM
+.LIST
+.CREF
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+DATA SEGMENT PUBLIC BYTE
+DATA ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+DATA SEGMENT PUBLIC BYTE
+ PUBLIC PARITYFLAG,XNXOPT,XNXCMD,SWITCHAR,EXTPTR,HANDLE,TRANSADD
+ PUBLIC PARSERR,ASMADD,DISADD,DISCNT,ASMSP,INDEX,DEFDUMP,DEFLEN
+ PUBLIC REGSAVE,SEGSAVE,OFFSAVE,TEMP,BUFFER,BYTCNT,OPCODE,AWORD
+ PUBLIC REGMEM,MIDFLD,MODE,NSEG,BRKCNT,TCOUNT,ASSEM_CNT
+ PUBLIC ASSEM1,ASSEM2,ASSEM3,ASSEM4,ASSEM5,ASSEM6,BYTEBUF,BPTAB
+ PUBLIC DIFLG,SIFLG,BXFLG,BPFLG,NEGFLG,NUMFLG,MEMFLG,REGFLG
+ PUBLIC MOVFLG,TSTFLG,SEGFLG,LOWNUM,HINUM,F8087,DIRFLG,DATAEND
+ PUBLIC BEGSEG,CREATE_LONG,ARG_BUF_INDEX
+ PUBLIC FILEEND,FILESTRT,SSINTSAV,BPINTSAV
+ PUBLIC FZTRACE, PREV24, FIN24
+
+ public rel_read_write_tab ;an000;relative read/write
+ ; table
+ public rel_low_sec ;an000;sector add. low word
+ public rel_high_sec ;an000;sector add. high word
+ public rel_sec_num ;an000;# of sectors to access
+ public rel_rw_add ;an000;transfer address
+
+ public lbtbl ;an000;lead byte table pointer
+
+ public xm_page ;an000;
+ public xm_log ;an000;
+ public xm_phy ;an000;
+ public xm_handle ;an000;
+ public xm_handle_ret ;an000;
+ public xm_page_cnt ;an000;
+ public xm_handle_pages_buf ;an000;
+ public xm_frame ;an000;
+ public xm_deall_han ;an000;
+ public xm_alloc_pg ;an000;
+ public xm_total_pg ;an000;
+ public xm_han_total ;an000;
+ public xm_han_alloc ;an000;
+
+;=========================================================================
+; REL_READ_WRITE_TAB : This table provides the new generic IOCTL primitive
+; read/write with its values.
+;
+; Date : 6/17/87
+;=========================================================================
+
+REL_READ_WRITE_TAB label dword ;an000;relative read/write
+ ; table
+ rel_low_sec dw ? ;an000;sector add. low word
+ rel_high_sec dw ? ;an000;sector add. high word
+ rel_sec_num dw ? ;an000;# of sectors to write
+ rel_rw_add dd ? ;an000;holds the segment
+ ; & offset of the
+ ; transfer address
+
+;=========================================================================
+
+lbtbl dd ? ;an000;lead byte table pointer
+
+;C04 xm_page db ? ;an000;page count to allocate
+ xm_page dw ? ;page count to allocate - raised to 64K ;C04
+ xm_log db ? ;an000;log. page to map
+ xm_phy db ? ;an000;phy. page to map
+ xm_deall_han dw ? ;an000;handle to deallocate
+ xm_handle dw ? ;an000;handle to map
+ xm_handle_ret dw ? ;an000;handle created
+
+
+ xm_page_cnt dw ? ;an000;current page count
+
+ xm_handle_pages_buf db 1024 dup(0) ;an000;hold handle pages
+
+ xm_frame dw ? ;an000;holds frame segment
+
+ xm_alloc_pg dw ? ;an000;active page count
+
+ xm_total_pg dw ? ;an000;total possible page cnt.
+
+ xm_han_total dw ? ;an000;total possible handles
+
+ xm_han_alloc dw ? ;an000;handles allocated
+
+ IF IBMVER
+ PUBLIC OLD_MASK
+OLD_MASK DB ?
+ public cpu_not_8088
+cpu_not_8088 db ? ; true if not 8088/8086
+ ENDIF
+
+PREV24 DD ? ; prevvious INT 24 handler
+FIN24 DB 0 ; TRUE => in the process of cleaning up
+FZTRACE DB 0 ; TRUE => in a Ztrace
+FILEEND DW ? ; ARR 2.4
+FILESTRT DW ? ; ARR 2.4
+SSINTSAV DD ? ; ARR 2.4
+BPINTSAV DD ? ; ARR 2.4
+
+PARITYFLAG DB 0
+
+PUBLIC SAVESTATE
+SAVESTATE DPL <> ; storage for extended error info
+
+XNXOPT DB ? ; AL OPTION FOR DOS COMMAND
+XNXCMD DB ? ; DOS COMMAND FOR OPEN_A_FILE TO PERFORM
+SWITCHAR DB ? ; CURRENT SWITCH CHARACTER
+EXTPTR DW ? ; POINTER TO FILE EXTENSION
+HANDLE DW ? ; CURRENT HANDLE
+TRANSADD DD ? ; TRANSFER ADDRESS
+
+PARSERR DB ?
+ASMADD DB 4 DUP (?)
+DISADD DB 4 DUP (?)
+DISCNT DW ?
+ASMSP DW ? ; SP AT ENTRY TO ASM
+INDEX DW ?
+DEFDUMP DB 4 DUP (?)
+DEFLEN DW ?
+REGSAVE DW ?
+SEGSAVE DW ?
+OFFSAVE DW ?
+
+;Do NOT move this dword variable - it sets up a long call for
+;a Create_process_data_block call issued in DEBUG
+CREATE_LONG LABEL DWORD
+ DW 100H
+BEGSEG DW ?
+
+; The following data areas are destroyed during hex file read
+TEMP DB 4 DUP(?)
+BUFFER LABEL BYTE
+BYTCNT DB ?
+ARG_BUF_INDEX DW ?
+OPCODE DW ?
+AWORD DB ?
+REGMEM DB ?
+MIDFLD DB ?
+MODE DB ?
+NSEG DW ?
+BRKCNT DW ? ; Number of breakpoints
+TCOUNT DW ? ; Number of steps to trace
+ASSEM_CNT DB ? ; preserve order of assem_cnt and assem1
+ASSEM1 DB ?
+ASSEM2 DB ?
+ASSEM3 DB ?
+ASSEM4 DB ?
+ASSEM5 DB ?
+ASSEM6 DB ? ; preserve order of assemx and bytebuf
+BYTEBUF DB BUFLEN DUP (?) ; Table used by LIST
+BPTAB DB BPLEN DUP (?) ; Breakpoint table
+DIFLG DB ?
+SIFLG DB ?
+BXFLG DB ?
+BPFLG DB ?
+NEGFLG DB ?
+NUMFLG DB ? ; ZERO MEANS NO NUMBER SEEN
+MEMFLG DB ?
+REGFLG DB ?
+MOVFLG DB ?
+TSTFLG DB ?
+SEGFLG DB ?
+LOWNUM DW ?
+HINUM DW ?
+F8087 DB ?
+DIRFLG DB ?
+ DB BUFFER+BUFSIZ-$ DUP (?)
+
+DATAEND LABEL WORD
+
+DATA ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debems.asm b/private/mvdm/dos/v86/cmd/debug/debems.asm
new file mode 100644
index 000000000..970d00c84
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debems.asm
@@ -0,0 +1,1162 @@
+ PAGE 60,132 ;
+ TITLE DEBEMS.ASM - EMS DEBUGGER COMMANDS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DEBEMS.ASM
+;
+; DESCRIPTIVE NAME: DEBUGGING TOOL
+;
+; FUNCTION: PROVIDES USERS WITH ACCESS TO RUDIMENTARY EMS FACILITIES.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: DEBCOM2 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBCOM3 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBUASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBMES - CONTAINS ROUTINES CALLED BY DEBUG
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT EMS FUNCTIONS DSM:6/24/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+;======================= END OF SPECIFICATIONS ===========================
+;
+; Change Log:
+;
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 03/21/90 DIC C04 Fixed Microsoft Bug #744 - A problem involving a
+; limitation on the total number of requested EMS memory
+; pages to 255. This limit is now a 4-digit hexadecimal
+; number.
+; 04/05/90 DIC C05 MSFT #990 - "XS" command in debug always displays the
+; default total handle of "FF" instead of the actual
+; number. This fix uses func-54h, sub-func: 02h via
+; EMS V4.0.
+; 04/30/90 DIC C06 MSFT # 994 - Debug does not use the "approved" means
+; of checking EMS status. This version uses a more
+; traditional method of: (1) Attempting an OPEN on the
+; guaranteed resource name of: EMMXXXX0 and (2) using
+; IOCTL sub-functions (0) and (7) to determine if the
+; name EMMXXXX0 actually represents a file or not.
+;
+;==============================================================================
+INCLUDE DOSSYM.INC
+include version.inc ; cas -- missing equates
+include debug.inc
+
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+
+ extrn xm_page:word ;an000;page count to allocate ;C04
+ ; allow max of 64K pages to allocate. ;C04
+ ; "xm_page" was an 8-bit quantity. ;C04
+
+ extrn xm_log:byte ;an000;log. page to map
+ extrn xm_phy:byte ;an000;phy. page to map
+ extrn xm_handle:word ;an000;handle to map
+ extrn xm_handle_ret:word ;an000;handle created
+
+ extrn xm_page_cnt:word ;an000;page count
+ extrn xm_handle_pages_buf:byte ;an000;holds handles and pages
+ extrn xm_frame:word ;an000;EMS frame value
+ extrn xm_deall_han:word ;an000;handle to deallocate
+ extrn xm_alloc_pg:word ;an000;pages allocated
+ extrn xm_total_pg:word ;an000;total pages possible
+ extrn xm_han_alloc:word ;an000;handles allocated
+ extrn xm_han_total:word ;an000;total handles possible
+
+ extrn xm_han_ret_ptr:word ;an000;prints handle created
+ extrn xm_mapped_ptr:word ;an000;prints log/phy pages
+ extrn xm_page_seg_ptr:word ;an000;Frame seg status
+ extrn xm_deall_ptr:word ;an000;Handle deallocation
+ extrn xm_unall_ptr:word ;an000;prints page status
+ extrn xm_han_alloc_ptr:word ;an000;print handle status
+
+ extrn xm_err80_ptr:word ;an000;ems error message
+ extrn xm_err83_ptr:word ;an000;ems error message
+ extrn xm_err84_ptr:word ;an000;ems error message
+ extrn xm_err85_ptr:word ;an000;ems error message
+ extrn xm_err86_ptr:word ;an000;ems error message
+ extrn xm_err87_ptr:word ;an000;ems error message
+ extrn xm_err88_ptr:word ;an000;ems error message
+ extrn xm_err89_ptr:word ;an000;ems error message
+ extrn xm_err8a_ptr:word ;an000;ems error message
+ extrn xm_err8b_ptr:word ;an000;ems error message
+ extrn xm_err8d_ptr:word ;an000;ems error message
+ extrn xm_err8e_ptr:word ;an000;ems error message
+ extrn xm_errff_ptr:word ;an000;ems error message
+ extrn xm_err_gen_ptr:word ;an000;ems error message
+ extrn xm_parse_err_ptr:word ;an000;input error message
+ extrn xm_status_ptr:word ;an000;prints status of EMS
+
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+
+ public debems ;an000;entry point
+ extrn std_printf:near ;an000;message retriever
+ extrn gethx:near ;an000;ASCII to bin conversion
+ extrn inbuf:near ;an000;input command line
+ extrn scanb:near ;an000;scan off blanks
+ extrn scanp:near ;an000;scan for parm
+ extrn perr:near ;an000;print ^ error
+ extrn geteol:near
+ extrn crlf:near ;an000;prints a cr,lf
+
+ IF SYSVER
+ ENDIF
+
+DEBEMS: ;an000;entry to module
+
+ call SCANP ;an000;scan for M or S parm
+; $if z ;an000;no parms found
+ JNZ $$IF1
+ call XM_PARSE_ERROR ;an000;tell user of error
+; $else ;an000;
+ JMP SHORT $$EN1
+$$IF1:
+ mov al,[si] ;an000;grab parm
+ cmp al,"M" ;an000;is it MAP?
+; $if e ;an000;yes
+ JNE $$IF3
+ inc si ;an000;point to next byte
+ call XM_EMS_MAP ;an000;
+; $else ;an000;
+ JMP SHORT $$EN3
+$$IF3:
+ cmp al,"S" ;an000;is it a status check?
+; $if e ;an000;yes
+ JNE $$IF5
+ inc si ;an000;point to next byte
+ call XM_EMS_STATUS ;an000;
+; $else ;an000;
+ JMP SHORT $$EN5
+$$IF5:
+ cmp al,"D" ;an000;Deallocate pages?
+; $if e ;an000;yes
+ JNE $$IF7
+ inc si ;an000;point to next byte
+ call XM_EMS_DEALL ;an000;
+; $else ;an000;
+ JMP SHORT $$EN7
+$$IF7:
+ cmp al,"A" ;an000;Allocate pages?
+; $if e ;an000;yes
+ JNE $$IF9
+ inc si ;an000;point to next byte
+ call XM_EMS_ALLOC ;an000;
+; $else ;an000;
+ JMP SHORT $$EN9
+$$IF9:
+ call GETEOL ;an000;check out parm
+; $endif ;an000;
+$$EN9:
+; $endif ;an000;
+$$EN7:
+; $endif ;an000;
+$$EN5:
+; $endif ;an000;
+$$EN3:
+; $endif ;an000;
+$$EN1:
+
+ ret ;an000;return to caller
+
+
+
+;=========================================================================
+; XM_EMS_ALLOC : This function will provide the user the
+; capability to set and change EMS logical and
+; physical pages within page frame 0.
+;
+; Inputs: none
+;
+; Outputs: EMS page frames set or altered
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_EMS_ALLOC proc near ;an000;XM functions
+
+ call XM_GET_MAN_STATUS ;an000;see if EMS active
+; $if nc ;an000;EMS active
+ JC $$IF16
+ call XM_PAGE_PROMPT ;an000;get pages to allocate
+ call XM_GET_HAN_ALLOC ;an000;allocate pages
+ mov dg:XM_HANDLE_RET,dx ;an000;save handle returned
+; $if z ;an000;good return
+ JNZ $$IF17
+ pushf ;an000;save our flags
+ call XM_DISP1 ;an000;tell user results
+ popf ;an000;restore our flags
+; $else ;an000;
+ JMP SHORT $$EN17
+$$IF17:
+ call XM_ERROR ;an000;print error message
+; $endif ;an000;
+$$EN17:
+; $else ;an000;EMS not active
+ JMP SHORT $$EN16
+$$IF16:
+ call XM_ERROR ;an000;say why not active
+; $endif ;an000;
+$$EN16:
+
+ ret ;an000;return to caller
+
+XM_EMS_ALLOC endp ;an000;
+
+
+;=========================================================================
+; XM_EMS_MAP : This function will provide the user the
+; capability to set and change EMS logical and
+; physical pages within page frame 0.
+;
+; Inputs: none
+;
+; Outputs: EMS page frames set or altered
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_EMS_MAP proc near ;an000;XM functions
+
+ call XM_GET_MAN_STATUS ;an000;see if EMS active
+; $if nc ;an000;EMS active
+ JC $$IF22
+ call XM_LOG_PROMPT ;an000;get logical page
+ call XM_PHY_PROMPT ;an000;get physical page
+ call XM_HAN_PROMPT ;an000;get handle
+ call XM_MAP_MEMORY ;an000;map the page
+; $if z ;an000;good return
+ JNZ $$IF23
+ pushf ;an000;save our flags
+ call XM_DISP2 ;an000;tell user results
+ popf ;an000;restore our flags
+; $else ;an000;
+ JMP SHORT $$EN23
+$$IF23:
+ call XM_ERROR ;an000;tell error
+; $endif ;an000;
+$$EN23:
+; $else ;an000;EMS not active
+ JMP SHORT $$EN22
+$$IF22:
+ call XM_ERROR ;an000;say why not active
+; $endif ;an000;
+$$EN22:
+
+ ret ;an000;return to caller
+
+XM_EMS_MAP endp ;an000;
+
+;=========================================================================
+; XM_GET_MAN_STATUS : This routine will determine if EMS is active for
+; this session.
+;
+; Called Procs: none
+;
+; Inputs: none
+;
+; Outputs: Z - no error
+; NZ - error
+; AH - error message number
+;
+; Date: 6/24/87
+; C06 - DIC 4/30/90 This routine has been updated in order to employ
+; a slightly more traditional method to determine the
+; existence or absence of EMS.
+;=========================================================================
+
+std_emm_name db "EMMXXXX0",0 ; C06 - Standard device name for the
+ ; C06 - Expanded Memory Manager.
+
+XM_GET_MAN_STATUS proc near ;an000;see if EMS active
+
+; C06 push ds ;an000;save ds - we stomp it
+; C06 mov ax,00h ;an000;set ax to 0
+; C06 mov ds,ax ;an000;set ds to 0
+; C06 cmp ds:word ptr[067h*4+0],0 ;an000;see if int 67h is there
+; C06 pop ds ;an000;restore ds
+; C06 ; $if e ;an000;EMS not installed
+; C06 JNE $$IF28
+; C06 stc ;an000;flag no ems
+; C06 mov ah,XM_NOT_INST ;an000;signal EMS not installed
+; C06 ; $else ;an000;
+; C06 JMP SHORT $$EN28
+; C06 $$IF28:
+; C06 call XM_INSTALL_CHECK ;an000;see if EMS installed
+; C06 ; $if z ;AN000;IS EMS INSTALLED
+; C06 JNZ $$IF30
+; C06 clc ;AN000;EMS INSTALLED - FLAG IT
+; C06 ; $else ;an000;
+; C06 JMP SHORT $$EN30
+; C06 $$IF30:
+; C06 stc ;AN000;FLAG EMS NOT INSTALLED
+; C06 mov ah,XM_NOT_INST ;an000;signal EMS not installed
+; C06 ; $endif ;an000;
+; C06 $$EN30:
+; C06 ; $endif ;an000;
+; C06 $$EN28:
+; C06
+; C06 RET ;AN000;RETURN TO CALLER
+
+ push ds ; C06
+ push cs ; C06
+ pop ds ; C06
+ mov dx,offset std_emm_name ; C06 - Attempt to OPEN the
+ mov ax,3d00h ; C06 - Standard (guaranteed) EMM driver
+ int 21h ; C06 - name. It might actually be a file.
+ jc emm_not_present ; C06 - If EMM driver is not present.
+
+ ; Otherwise, the name: EMMXXXX0 does exist, but it might turn out C06
+ ; to be a file instead of the name of a device driver. C06
+
+ mov bx,ax ; C06 - Handle from the OPEN operation.
+ mov ax,4400h ; C06 - Get device information
+ int 21h ; C06 - using traditional MSDOS method.
+ jc emm_not_present ; C06 - If error, then assume EMM does not exist.
+ and dx,80h ; C06 - Is it a character device ?
+ jz emm_not_present ; C06 - NO--> Assume EMM is not present
+ mov ax,4407h ; C06 - Request OUTPUT status
+ int 21h ; C06 - via traditional MSDOS method.
+ jc emm_not_present ; C06 - interpret as EMM-not-present.
+ or al,al ; C06 - Device status ?
+ jz emm_not_present ; C06 - if EMM is not available
+
+ ; since these tests have been passed, we can assume C06
+ ; that the EMMXXXX0 drive does indeed exist. C06
+
+ mov ah,03eh ; C06 - Close out the EMM device handle
+ int 21h ; C06
+ jc emm_not_present ; C06 - Failure here is interpreted as:
+ ; C06 - EMM not available.
+ call XM_INSTALL_CHECK ; C06 - Do std EMS installation check.
+ jnz emm_not_present ; C06 - If EMS does not exist.
+ clc ; C06 - Successful return
+ pop ds ; C06 - He gets restored.
+ ret ; C06
+
+emm_not_present:
+
+ stc ; C06
+ mov ah,XM_NOT_INST ; C06 - error number
+ pop ds ; C06
+ ret ; C06
+
+XM_GET_MAN_STATUS endp ;an000;
+
+;=========================================================================
+; XM_PAGE_PROMPT : This routine prompts the user for the number of
+; pages to be allocated, if he desires a new handle.
+; This routine will determine whether or not the other
+; prompt messages will be displayed.
+;
+; Called Procs: STD_PRINTF
+; XM_PARSE
+;
+; Inputs: none
+;
+; Outputs: XM_PAGE_FLAG
+; XM_PAGE_BUF
+; XM_PAGE
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_PAGE_PROMPT proc near ;an000;prompt user for number
+ ; of pages to allocate
+ call SCANB ;an000;see if parm entered
+; $if nz ;an000;if parm found
+ JZ $$IF34
+;C04 mov cx,02 ;an000;bytes to parse
+ mov cx,04 ;an000;bytes to parse ;C04
+ ; (maximum entry of 64K) ;C04
+ call GETHX ;an000;get hex value
+; $if c ;an000;no an error occurred
+ JNC $$IF35
+ call PERR ;an000;display ^ error
+; $else ;an000;
+ JMP SHORT $$EN35
+$$IF35:
+;C04 mov dg:XM_PAGE,dl ;an000;save page count
+ mov word ptr dg:XM_PAGE,dx ;save page cnt (max=64K) ;C04
+; $endif ;an000;
+$$EN35:
+; $else ;an000;
+ JMP SHORT $$EN34
+$$IF34:
+ call PERR ;an000;display ^ error
+; $endif ;an000;
+$$EN34:
+
+ ret ;an000;return to caller
+
+XM_PAGE_PROMPT endp ;an000;
+
+
+;=========================================================================
+; XM_LOG_PROMPT : This routine prompts the user for the number of the
+; logical page that is to be mapped in EMS. This
+; routine will not be performed if a page count
+; was specified.
+;
+; Called Procs: STD_PRINTF
+; XM_PARSE
+;
+; Inputs: none
+;
+; Outputs: XM_LOG_BUF
+; XM_LOG
+;
+; Date: 6/24/87
+;=========================================================================
+
+
+XM_LOG_PROMPT proc near ;an000;prompt user for the
+ ; logical page to be
+ ; mapped
+ call SCANB ;an000;see if parm entered
+; $if nz ;an000;parm entered
+ JZ $$IF40
+ mov cx,02 ;an000;bytes to parse
+ call GETHX ;an000;get hex value
+; $if c ;an000;no an error occurred
+ JNC $$IF41
+ call PERR ;an000;display ^ error
+; $else ;an000;
+ JMP SHORT $$EN41
+$$IF41:
+ mov dg:XM_LOG,dl ;an000;save logical page
+; $endif ;an000;
+$$EN41:
+; $else ;an000;
+ JMP SHORT $$EN40
+$$IF40:
+ call PERR ;an000;display ^ error
+; $endif ;an000;
+$$EN40:
+
+ ret ;an000;return to caller
+
+XM_LOG_PROMPT endp ;an000;
+
+
+;=========================================================================
+; XM_PHY_PROMPT : This routine prompts the user for the number of the
+; physical page that is to be mapped in EMS. This
+; routine will not be performed if a page count
+; was specified.
+;
+; Called Procs: STD_PRINTF
+; XM_PARSE
+;
+; Inputs: none
+;
+; Outputs: XM_PHY_BUF
+; XM_PHY
+;
+; Date: 6/24/87
+;=========================================================================
+
+
+XM_PHY_PROMPT proc near ;an000;prompt user for the
+ ; physical page to be
+ ; mapped
+ call SCANB ;an000;see if parm entered
+; $if nz ;an000;parm found
+ JZ $$IF46
+ mov cx,02 ;an000;bytes to parse
+ call GETHX ;an000;get hex value
+; $if c ;an000;no an error occurred
+ JNC $$IF47
+ call PERR ;an000;display ^ error
+; $else ;an000;
+ JMP SHORT $$EN47
+$$IF47:
+ mov dg:XM_PHY,dl ;an000;save logical page
+; $endif ;an000;
+$$EN47:
+; $else ;an000;
+ JMP SHORT $$EN46
+$$IF46:
+ call PERR ;an000;
+; $endif ;an000;
+$$EN46:
+
+ ret ;an000;return to caller
+
+XM_PHY_PROMPT endp ;an000;
+
+
+;=========================================================================
+; XM_HAN_PROMPT : This routine prompts the user for the number of the
+; handle that the mapping is to occur on. This
+; routine will not be performed if a page count
+; was specified.
+;
+; Called Procs: STD_PRINTF
+; XM_PARSE
+;
+; Inputs: none
+;
+; Outputs: XM_HAN_BUF
+; XM_HAN
+;
+; Date: 6/24/87
+;=========================================================================
+
+
+XM_HAN_PROMPT proc near ;an000;prompt user for the
+ ; handle to be mapped
+ call SCANB ;an000;see if parm entered
+; $if nz ;an000;prompt found
+ JZ $$IF52
+ mov cx,04 ;an000;bytes to parse
+ call GETHX ;an000;get hex value
+; $if c ;an000;no an error occurred
+ JNC $$IF53
+ call PERR ;an000;display ^ error
+; $else ;an000;
+ JMP SHORT $$EN53
+$$IF53:
+ mov dg:XM_HANDLE,dx ;an000;save logical page
+; $endif ;an000;
+$$EN53:
+; $else ;an000;
+ JMP SHORT $$EN52
+$$IF52:
+ call PERR ;an000;display ^ error
+; $endif ;an000;
+$$EN52:
+
+ ret ;an000;return to caller
+
+XM_HAN_PROMPT endp ;an000;
+
+
+
+;=========================================================================
+; XM_GET_HAN_ALLOC : This routine will get a handle and allocate the
+; requested number of pages to that handle.
+;
+; Called Procs: none
+;
+; Inputs: XM_PAGE - number of pages to allocate to handle
+;
+; Outputs: Z - no error
+; NZ - error
+; DX - handle allocated
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_GET_HAN_ALLOC proc near ;an000;create handle and alloc.
+ ; requested pages.
+ push bx ;an000;save regs.
+ mov ah,EMS_HAN_ALLOC ;an000;function 43h
+;C04 xor bh,bh ;an000;clear byte
+;C04 mov bl,dg:XM_PAGE ;an000;number of pages to
+ mov bx,word ptr dg:XM_PAGE ;num of pages (64K limit) to;C04
+ ; allocate
+ int 67h ;an000;call EMS
+ or ah,ah ;an000;was there an error
+ pop bx ;an000;restore regs.
+
+ ret ;an000;return to caller
+
+XM_GET_HAN_ALLOC endp ;an000;
+
+;=========================================================================
+; XM_MAP_MEMORY : This routine will map the requested logical page
+; to the requested physical page in EMS.
+;
+; Called Procs: none
+;
+; Inputs: XM_PHY - physical page to map to
+; XM_HAN - logical page to map
+;
+; Outputs: Z - no error
+; NZ - error
+; page mapped
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_MAP_MEMORY proc near ;an000;map a logical page to
+ ; a physical page in
+ ; EMS
+ push bx ;an000;save regs.
+ push dx ;an000;
+ mov ah,EMS_MAP_MEMORY ;an000;function 44h
+ mov al,dg:XM_PHY ;an000;physical page to map
+ xor bh,bh ;an000;zero byte
+ mov bl,dg:XM_LOG ;an000;logical page to map
+ mov dx,dg:XM_HANDLE ;an000;handle to map page to
+ int 67h ;an000;call EMS
+ or ah,ah ;an000;was there an error
+ pop dx ;an000;restore regs.
+ pop bx ;an000;
+
+ ret ;an000;return to caller
+
+XM_MAP_MEMORY endp ;an000;
+
+
+;=========================================================================
+; XM_DISP1 : This routine displays the current page frame and
+; the handle created as a result of the allocate pages.
+;
+; Called Procs: STD_PRINTF
+;
+; Inputs: XM_FRAME_SEG - page frame segment
+; XM_HANDLE_RET - created handle
+; XM_PG_FRAME_PTR - pointer to message
+; XM_HAN_RET_PTR - pointer to message
+;
+; Outputs: "Page Frame Segment : %1",0d,0a
+; "Handle Created : %1",0d,0a
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_DISP1 proc near ;an000;display messages
+
+ mov dx,offset dg:XM_HAN_RET_PTR ;an000;"Handle Created : "
+ call STD_PRINTF ;an000;call message ret.
+
+ ret ;an000;return to caller
+
+XM_DISP1 endp ;an000;
+
+
+;=========================================================================
+; XM_DISP2 : This routine displays the logical page mapped and
+; the physical page it was mapped to.
+;
+; Called Procs: STD_PRINTF
+;
+; Inputs: XM_MAPPED_PTR - pointer to message
+; XM_LOG - logical page mapped
+; XM_PHY - physical page mapped
+;
+; Outputs: "Logical page %1 mapped to physical page %2",0d0a
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_DISP2 proc near ;an000;display messages
+
+ mov dx,offset dg:XM_MAPPED_PTR ;an000;"Logical page %1 mapped
+ ; to physical page %2"
+ call STD_PRINTF ;an000;call message ret.
+
+ ret ;an000;return to caller
+
+XM_DISP2 endp ;an000;
+
+;=========================================================================
+; XM_ERROR: This routine will determine what error we have by
+; querying the result in the AH register. It will then
+; report the error to the user through STD_PRINTF
+;
+; Called Procs: STD_PRINTF
+;
+; Inputs: AH - error code
+;
+; Outputs: error message
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_ERROR proc near ;an000;error message printer
+
+ mov dx,offset dg:XM_ERR80_PTR ;an000;point to message
+ cmp ah,XM_ERR80 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR83_PTR ;an000;point to message
+ cmp ah,XM_ERR83 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR84_PTR ;an000;point to message
+ cmp ah,XM_ERR84 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR85_PTR ;an000;point to message
+ cmp ah,XM_ERR85 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+
+ mov dx,offset dg:XM_ERR86_PTR ;an000;point to message
+ cmp ah,XM_ERR86 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR87_PTR ;an000;point to message
+ cmp ah,XM_ERR87 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR88_PTR ;an000;point to message
+ cmp ah,XM_ERR88 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR89_PTR ;an000;point to message
+ cmp ah,XM_ERR89 ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR8A_PTR ;an000;point to message
+ cmp ah,XM_ERR8A ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR8B_PTR ;an000;point to message
+ cmp ah,XM_ERR8B ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR8D_PTR ;an000;point to message
+ cmp ah,XM_ERR8D ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR8E_PTR ;an000;point to message
+ cmp ah,XM_ERR8E ;an000;error message
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERRFF_PTR ;an000;point to message
+ cmp ah,XM_NOT_INST ;an000;EMS not installed
+ je XM_ERROR_CONT ; print error
+
+ mov dx,offset dg:XM_ERR_GEN_PTR ;an000;general error message
+
+XM_ERROR_CONT:
+
+ jmp STD_PRINTF ;an000;call message ret.
+
+
+XM_ERROR endp ;an000;
+
+;=========================================================================
+; XM_PARSE_ERROR : This routine will display that an error has occurred
+; on the input of the requested data.
+;
+; Called Procs: STD_PRINTF
+;
+; Inputs: XM_PARSE_ERR_PTR - error message
+;
+; Outputs: "Invalid value for parameter",0d,0a
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_PARSE_ERROR proc near ;an000;input error message
+
+ mov dx,offset dg:XM_PARSE_ERR_PTR ;an000;error message
+ call STD_PRINTF ;an000;call message ret.
+ ret ;an000;return to caller
+
+XM_PARSE_ERROR endp ;an000;
+
+
+
+;=========================================================================
+; XM_EMS_STATUS : This function will provide the user with
+; a report the the current status of EMS.
+;
+; Inputs: none
+;
+; Outputs: EMS page frames set or altered
+;
+; Date: 6/24/87
+;=========================================================================
+
+XM_EMS_STATUS proc near ;an000;XM functions
+
+ call XM_GET_MAN_STATUS ;an000;see if EMS active
+; $if nc ;an000;EMS active
+ JC $$IF84
+ call XM_CURR_STATUS ;an000;current status of EMS
+; $else ;an000;EMS not active
+ JMP SHORT $$EN84
+$$IF84:
+ call XM_ERROR ;an000;say why not active
+; $endif ;an000;
+$$EN84:
+
+ ret ;an000;return to caller
+
+XM_EMS_STATUS endp ;an000;
+
+
+;=========================================================================
+; XM_CURR_STATUS : This routine will display the current status of
+; all active EMS handles.
+;
+; Inputs : none
+;
+; Outputs : Current status of all active EMS handles
+; "Handle %1 has %2 pages allocated"
+;
+; Physical page with it associated frame segment
+; "Physical page %1 = Frame segment %2"
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_CURR_STATUS proc near ;an000;current EMS status
+
+ mov ah,EMS_HANDLE_PAGES ;an000;get handle pages
+ mov di,offset dg:XM_HANDLE_PAGES_BUF ;an000;point to the buffer
+ int 67h ;an000;
+
+ or ah,ah ;an000;see if an error occurred
+; $if z ;an000;no error
+ JNZ $$IF87
+; $do ;an000;do while data in buffer
+$$DO88:
+ cmp bx,0 ;an000;end of buffer?
+; $leave e ;an000;yes
+ JE $$EN88
+ mov ax,word ptr es:[di] ;an000;page handle
+ mov dg:XM_HANDLE_RET,ax ;an000;save in var
+ mov ax,word ptr es:[di+02];an000;page count
+ mov dg:XM_PAGE_CNT,ax ;an000;save in var
+ mov dx,offset dg:XM_STATUS_PTR ;an000;point to message
+ call STD_PRINTF ;an000;print it
+ add di,04h ;an000;next record
+ dec bx ;an000;decrement counter
+; $enddo ;an000;
+ JMP SHORT $$DO88
+$$EN88:
+
+ call CRLF ;an000;place a blank line
+ ; between reports
+
+ call XM_FRAME_BUFFER ;an000;get frame buffer
+ ;ES:DI points to frame buffer
+; $do ;an000;while cx not = 0
+$$DO91:
+ cmp cx,00 ;an000;at end?
+; $leave e ;an000;yes
+ JE $$EN91
+ call XM_GET_FRAME_SEG ;an000;obtain page and seg
+ mov dx,offset dg:XM_PAGE_SEG_PTR ;an000;message
+ call STD_PRINTF ;an000;print it
+ dec cx ;an000;decrease counter
+ add di,04 ;an000;adjust pointer
+; $enddo ;an000;
+ JMP SHORT $$DO91
+$$EN91:
+
+ call XM_UNALL_COUNT ;an000;display page status
+ call XM_HANDLE_COUNT ;an000;display handle status
+
+; $else
+ JMP SHORT $$EN87
+$$IF87:
+ call XM_ERROR ;an000;display the error
+; $endif ;an000;
+$$EN87:
+ ret ;an000;
+
+XM_CURR_STATUS endp ;an000;
+
+;=========================================================================
+; XM_UNALL_COUNT : This routine generates a line of the status report
+; displaying the number of pages allocated out of
+; the total possible
+;
+; Inputs : none
+;
+; Outputs : Current status of allocated pages
+; "%1 of a total %2 EMS pages have been allocated"
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_UNALL_COUNT proc near ;an000;
+
+ mov ah,EMS_UNALL_PG_CNT ;an000;see how many pages
+ ; remaining
+ int 67h ;an000;
+ or ah,ah ;an000;see if error
+
+; $if z ;an000;no error
+ JNZ $$IF96
+ push bx ;an000;save bx
+ push dx ;an000;save dx
+ call CRLF ;an000;
+ pop dx ;an000;restore dx
+ pop bx ;an000;restore bx
+ mov ax,dx ;an000;total page count
+ sub ax,bx ;an000;get pages allocated
+ mov dg:XM_ALLOC_PG,ax ;an000;save allocated pages
+ mov dg:XM_TOTAL_PG,dx ;an000;save total page count
+ mov dx,offset dg:XM_UNALL_PTR ;an000;"%1 of a total %2 EMS
+ ; pages have been allocated",cr,lf
+ call STD_PRINTF ;an000;print it
+; $endif ;an000;
+$$IF96:
+
+ ret ;an000;
+
+XM_UNALL_COUNT endp ;an000;
+
+
+;=========================================================================
+; XM_HANDLE_COUNT: This routine generates a line of the status report
+; displaying the number of handles allocated out of
+; the total possible.
+;
+; Inputs : none
+;
+; Outputs : Current status of allocated pages
+; "%1 of a total %2 EMS handles have been allocated"
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_HANDLE_COUNT proc near ;an000;
+
+ mov ah,EMS_HANDLE_CNT ;an000;see how many handles
+ ; possible
+ int 67h ; C05 - Request total currently allocated.
+ or ah,ah ; C05 -
+ jnz $$IF98 ; C05 - If error
+ mov word ptr dg:XM_HAN_ALLOC,bx ; C05 - save total number of active handles.
+ mov ax,EMS_TOT_HANDLES ; C05 - Request total handles possible for
+ ; C05 - EMS 4.0
+ int 67h ;an000;
+ or ah,ah ;an000;see if error
+
+; $if z ;an000;no error
+ JNZ $$IF98
+;C05 mov ax,EMS_HANDLE_TOTAL ;an000;total possible handles
+ mov ax,bx ;C05 - Total possible handles for EMS 4.0
+
+ mov dg:XM_HAN_TOTAL,ax ;an000;save total page count
+;C05 mov dg:XM_HAN_ALLOC,bx ;an000;save allocated pages
+ mov bx,dg:XM_HAN_ALLOC ; C05 - This may not be needed.
+ mov dx,offset dg:XM_HAN_ALLOC_PTR
+ ;an000;"%1 of a total %2 EMS
+ ; handles have been allocated",cr,lf
+ call STD_PRINTF ;an000;print it
+; $endif ;an000;
+$$IF98:
+
+ ret ;an000;
+
+XM_HANDLE_COUNT endp ;an000;
+
+
+;=========================================================================
+; XM_FRAME_SEG : This routine accesses the vector created by
+; function 58h, int 67h. It obtains a physical
+; page of EMS and its segment from this vector
+;
+; Inputs : ES:DI - points to frame buffer
+;
+; Outputs : XM_PHY - a physical page in EMS
+; XM_FRAME - segment corresponding to the physical page
+;
+; Date: 8/05/86
+;=========================================================================
+
+
+XM_GET_FRAME_SEG proc near ;an000;find the frame segment
+
+ mov al,byte ptr es:[di+2] ;an000;get physical page
+ mov dg:XM_PHY,al ;an000;place in print var
+ mov ax,word ptr es:[di] ;an000;get frame segment
+ mov dg:XM_FRAME,ax ;an000;place in print var
+
+ ret ;an000;
+
+XM_GET_FRAME_SEG endp ;an000;
+
+;=========================================================================
+; XM_INSTALL_CHECK: This routine performs function 51h, int 67h to
+; determine if EMS is indeed active.
+;
+; Inputs : XM_FRAME_BUFFER - used to receive physical page
+; and segment data for EMS.
+;
+; Outputs : XM_FRAME_BUFFER - buffer holds physical page
+; and segment data for EMS.
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_INSTALL_CHECK proc near ;an000;see if EMS installed
+
+ MOV AH,EMS_GET_MAN_STAT ;AN000;GET EMS STATUS
+ XOR AL,AL ;an000;clear low byte
+ INT 67h ;an000;
+ OR AH,AH ;an000;check for error
+; $IF Z ;an000;no error
+ JNZ $$IF100
+ MOV AH,EMS_VERSION ;an000;get version number
+ INT 67h ;an000;
+ CMP AL,EMS_LIM_40 ;an000;LIM 4.0 ?
+; $IF AE ;an000;4.0 or greater
+ JNAE $$IF101
+ MOV AH,00h ;an000;set up for flag pass
+ OR AH,AH ;an000;set flag to ZR
+; $ELSE ;an000;below 4.0
+ JMP SHORT $$EN101
+$$IF101:
+ MOV AH,01h ;an000;set up for flag pass
+ OR AH,AH ;an000;set flag to NZ
+; $ENDIF ;an000;
+$$EN101:
+; $ENDIF ;an000;
+$$IF100:
+
+ ret ;an000;
+
+XM_INSTALL_CHECK endp ;an000;
+
+
+
+
+;=========================================================================
+; XM_EMS_DEALL : This routine deallocates handles from EMS.
+;
+; Inputs : DX - Handle supplied by XM_DEALL_PROMPT
+;
+; Outputs : Good return - "Handle %1 deallocated"
+; Bad return - message describing error
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_EMS_DEALL proc near ;an000;deallocate EMS pages
+
+ call XM_GET_MAN_STATUS ;an000;see if EMS installed
+; $if nc ;an000;error?
+ JC $$IF105
+ call XM_DEALL_PROMPT ;an000;prompt user for handle
+ mov ah,EMS_PAGE_DEALL ;an000;function 45h, int 67h
+ int 67h ;an000;
+
+ or ah,ah ;an000;error?
+; $if nz ;an000;yes
+ JZ $$IF106
+ call XM_ERROR ;an000;say why
+; $else ;an000;
+ JMP SHORT $$EN106
+$$IF106:
+ mov dx,offset dg:XM_DEALL_PTR;an000;"Handle %1 deallocated"
+ call STD_PRINTF ;an000;print message
+; $endif ;an000;
+$$EN106:
+; $else ;an000;
+ JMP SHORT $$EN105
+$$IF105:
+ call XM_ERROR ;an000;print type of error
+; $endif ;an000;
+$$EN105:
+
+ ret ;an000;
+
+XM_EMS_DEALL endp ;an000;
+
+;=========================================================================
+; XM_DEALL_PROMPT : This routine prompts the user for the handle to be
+; deallocated. It converts the handle entered to
+; binary and passes it back to the caller in DX.
+;
+; Inputs : none
+;
+; Outputs : DX - Handle to be deallocated.
+;
+; Date: 8/05/86
+;=========================================================================
+
+XM_DEALL_PROMPT proc near ;an000;prompt user for handle
+ ; to deallocate
+ call SCANB ;an000;see if parm entered
+; $if nz ;an000;parm found
+ JZ $$IF111
+ mov cx,04 ;an000;bytes to parse
+ call GETHX ;an000;get hex value
+; $if c ;an000;no an error occurred
+ JNC $$IF112
+ call PERR ;an000;display ^ error
+; $else ;an000;
+ JMP SHORT $$EN112
+$$IF112:
+ mov dg:XM_DEALL_HAN,dx ;an000;save handle to deallocate
+; $endif ;an000;
+$$EN112:
+; $else ;an000;
+ JMP SHORT $$EN111
+$$IF111:
+ call PERR ;an000;display ^ error
+; $endif ;an000;
+$$EN111:
+
+ ret ;an000;return to caller
+
+XM_DEALL_PROMPT endp ;an000;
+
+
+;=========================================================================
+; XM_FRAME_BUFFER : This routine obtains the frame buffer
+; of EMS pages.
+;
+; Inputs : none
+;
+; Outputs : ES:DI - Pointer to frame array
+; CX - Number of elements in array
+;=========================================================================
+
+XM_FRAME_BUFFER proc near ;an000;
+
+ mov ax,EMS_PG_FRAME ;an000;get frame buffer
+ int 67h ;an000;
+
+ ret ;an000;
+
+XM_FRAME_BUFFER endp ;an000;
+
+
+CODE ENDS
+ END DEBEMS
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/deberr.asm b/private/mvdm/dos/v86/cmd/debug/deberr.asm
new file mode 100644
index 000000000..d5673e26c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/deberr.asm
@@ -0,0 +1,196 @@
+ PAGE 80,132 ;
+ TITLE DEBERR.ASM - DEBUGGER DISK ERROR HANDLER
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;******************* START OF SPECIFICATIONS *****************************
+;
+; MODULE NAME:DEBERR.ASM
+;
+; DESCRIPTIVE NAME: DISK ERROR HANDLER
+;
+; FUNCTION: THIS ROUTINE IS A CATCHALL ERROR HANDLER. IT PRIMARILY
+; HANDLES DISK ERROR.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; INPUT: NA
+;
+; EXIT-NORMAL: NA
+;
+; EXIT-ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+;
+; EXTERNAL REFERENCES:
+;
+; NOTES: THIS MODULE SHOULD BE PROCESSED WITH THE SALUT PRE-PROCESSOR
+; WITH OPTIONS "PR".
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+DEBCONST+
+; DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION DOS 4.0 - MESSAGE RETRIEVER IMPLEMENTED. DMS:6/17/87
+;
+;
+; COPYRIGHT: "MS DOS DEBUG Utility"
+; "Version 4.00 (C) Copyright 1988 Microsoft"
+; "Licensed Material - Property of Microsoft "
+;
+;******************** END OF SPECIFICATIONS ******************************
+;
+; Change Log:
+;
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 03/27/90 DIC C03 MSFT # 696 - DEBUG seemed to be reporting the wrong
+; error after attempting to reading logical sector zero
+; on an SCO-XENIX boot diskette. The message "Write
+; Protect Error Reading drive A." was displayed.
+;*****************************************************************************
+
+.XLIST
+.XCREF
+ include version.inc ; cas -- missing equates
+ include syscall.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+.CREF
+.LIST
+
+ INCLUDE debug.inc
+
+FIRSTDRV EQU "A"
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN RDFLG:BYTE
+ EXTRN DRVLET:BYTE
+ EXTRN dr1_ptr:word,dr2_ptr:word,dr3_ptr:word,dr4_ptr:word ;ac000
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN PARITYFLAG:BYTE
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+
+ EXTRN RESTART:NEAR
+ PUBLIC DRVERR, TRAPPARITY, RELEASEPARITY, NMIINT, NMIINTEND
+
+TRAPPARITY:
+ IF IBMJAPAN
+ PUSH BX
+ PUSH ES
+ PUSH DX ; save location of new offset
+ MOV DX,OFFSET DG:NMIINT ; DS:DX has new interrupt vector
+ CALL SWAPINT ; diddle interrupts
+ ASSUME ES:NOTHING
+
+ MOV WORD PTR [NMIPTR],BX ; save old offset
+ MOV WORD PTR [NMIPTR+2],ES ; save old segment
+ POP DX ; get old regs back
+ POP ES ; restore old values
+ ASSUME ES:DG
+
+ POP BX
+ MOV BYTE PTR [PARITYFLAG],0 ; no interrupts detected yet!
+ RET
+
+SWAPINT:
+ PUSH AX
+ MOV AX,(GET_INTERRUPT_VECTOR SHL 8) + 2
+ INT 21H ; Get old NMI Vector
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) + 2
+ INT 21h ; let OS set new vector
+ POP AX
+ ENDIF
+ RET
+
+RELEASEPARITY:
+ IF IBMJAPAN
+ PUSH DX
+ PUSH DS
+ PUSH BX
+ PUSH ES
+ LDS DX,DWORD PTR [NMIPtr] ; get old vector
+ CALL SwapInt ; diddle back to original
+ POP ES
+ POP BX
+ POP DS
+ POP DX
+ MOV [PARITYFLAG],0 ; no interrupts possible!
+ ENDIF
+ RET
+
+NMIInt:
+ IF IBMJAPAN
+ PUSH AX ; save AX
+ IN AL,0A0H ; get status register
+ OR AL,1 ; was there parity check?
+ POP AX ; get old AX back
+ JZ NMICHAIN ; no, go chain interrupt
+ OUT 0A2H,AL ; reset NMI detector
+ MOV CS:[PARITYFLAG],1 ; signal detection
+ IRET
+NMICHAIN:
+ JMP DWORD PTR CS:[NMIPTR] ; chain the vectors
+NMIPTR DD ? ; where old NMI gets stashed
+ ENDIF
+NMIINTEND:
+
+DRVERR:
+
+ or al,al ;ac000;see if drive specified
+; $if nz ;an000;drive specified
+ JZ $$IF1
+ add byte ptr drvlet,firstdrv;ac000;determine drive letter
+ cmp byte ptr rdflg,write ;ac000;see if it is read/write
+; $if z ;an000;it is write
+ JNZ $$IF2
+ mov dx,offset dg:dr2_ptr ;an000;message
+; $else ;an000;it is read
+ JMP SHORT $$EN2
+$$IF2:
+ mov dx,offset dg:dr1_ptr ;an000;message
+; $endif ;an000;
+$$EN2:
+; $else ;an000;write protect error
+ JMP SHORT $$EN1
+$$IF1:
+ add byte ptr drvlet,firstdrv;ac000;determine drive letter
+ cmp byte ptr rdflg,write ;ac000;see if it is read/write
+; $if z ;an000;it is write
+ JNZ $$IF6
+ mov dx,offset dg:dr4_ptr ;an000;message
+; $else ;an000;it is read
+ JMP SHORT $$EN6
+$$IF6:
+ mov dx,offset dg:dr1_ptr ;an000;message ;C03
+; $endif ;an000;
+$$EN6:
+; $endif ;an000;
+$$EN1:
+
+; CLEAN OUT THE DISK...
+ MOV AH,DISK_RESET
+ INT 21H
+
+ JMP RESTART
+CODEEND:
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debmes.asm b/private/mvdm/dos/v86/cmd/debug/debmes.asm
new file mode 100644
index 000000000..2578213d0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debmes.asm
@@ -0,0 +1,1662 @@
+PAGE 60,132 ;
+ TITLE DEBMES.ASM - DEBUGGER MESSAGES PC DOS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBMES
+ ENDIF
+
+;******************* START OF SPECIFICATIONS *****************************
+;
+; MODULE NAME:DEBMES.ASM
+;
+; DESCRIPTIVE NAME: SUPPLIES APPLICABLE MESSAGES TO DEBUG.ASM
+;
+; FUNCTION: THIS ROUTINE PROVIDES A MEANS BY WHICH MESSAGES MAY BE
+; OUTPUT FOR DEBUG. THIS IS HANDLED THROUGH THE MESSAGE
+; RETRIEVER FUNCTION SYSDISPMSG. TO
+; FACILITATE MIGRATION AWAY FROM THE PRINTF UTILITY
+; THE INTERFACE FOR INVOKING MESSAGES HAS REMAINED THE SAME.
+; THIS IS ACCOMPLISHED THROUGH THE USE OF MACROS AND TABLES.
+; EACH MESSAGE HAS A TABLE OF VALUES REQUIRED BY THE MESSAGE
+; RETRIEVER UTILITIES. THE MACROS OPERATE ON THESE TABLES
+; TO SUPPLY SYSDISPMSG WITH THE VALUES NECESSARY
+; TO PRINT A MESSAGE.
+;
+; ENTRY POINT: PRINTF
+;
+; INPUT: PRINTF IS INVOKED AS IT HAS ALWAYS BEEN INVOKED. DX MUST
+; POINT TO THE OFFSET OF A MESSAGE TABLE. THE TABLE POINTED TO
+; BY DX CONTAINS ALL THE NECESSARY INFORMATION FOR THAT MESSAGE
+; TO BE PRINTED.
+;
+; EXIT-NORMAL: NO CARRY
+;
+; EXIT-ERROR: CARRY SET - EITHER MESSAGE NOT FOUND OR UNABLE TO BE DISPLAYED
+;
+; INTERNAL REFERENCES:
+;
+; ROUTINE:DISP_MESSAGE - THIS MACRO IS USED TO DIPLAY A MESSAGE
+; VIA SYSDISPMSG. IT TAKES AS INPUT A POINTER
+; IN DX. THIS POINTER POINTS TO A TABLE OF
+; VALUES FOR THE REQUESTED MESSAGE.
+; DISP_MESSAGE OBTAINS THE VALUES IT NEEDS TO
+; TO INVOKE SYSDISPMSG FROM THIS TABLE.
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: SYSMSG.INC - THIS ROUTINE IS SUPPLIED TO INTERFACE THE
+; MESSAGE RETRIEVER SERVICES.
+;
+; NOTES: THIS MODULE SHOULD BE PROCESSED WITH THE SALUT PRE-PROCESSOR
+; WITH OPTIONS "PR".
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+DEBCONST+
+; DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION DOS 4.0 - MESSAGE RETRIEVER IMPLEMENTED. DMS:6/17/87
+;
+;
+; COPYRIGHT: "MS DOS DEBUG Utility"
+; "Version 4.00 (C) Copyright 1988 Microsoft"
+; "Licensed Material - Property of Microsoft "
+;
+;******************** END OF SPECIFICATIONS ******************************
+;
+; CHANGE LOG:
+;
+; DATE WHO # DESCRIPTION
+; -------- --- --- ---------------------------------------------------
+; 04/01/90 DIC C02 Message was only printing first parameter, not
+; first and second. I made the BX:CX message print
+; 1 byte for BX and left CX at 4 bytes. Corresponding
+; change in message file, DEBUG line 38. (Compaq STR
+; #1804) (MS Bug #338)
+;
+; 05/25/90 AKM C07 Problem fixed - Number of bytes writtem message
+; was being printed with the wrong alignment &
+; precision.
+; (Microsoft Bug #1156)
+;
+;============================================================================
+.xlist
+
+ include sysmsg.inc ;an000;message retriever
+
+.list
+
+msg_utilname <DEBUG> ;an000;DEBUG messages
+
+;=========================================================================
+;revised debmes.asm
+;=========================================================================
+
+fatal_error equ 45 ;fatal message handler error
+unlim_width equ 00h ;unlimited output width
+pad_blank equ 20h ;blank pad
+pre_load equ 00h ;an000;normal pre-load
+pad_zero equ 30h ;an000;zero pad
+
+
+FALSE EQU 0
+TRUE EQU NOT FALSE
+
+;SYSVER EQU FALSE ;if true, i/o direct to bios
+ INCLUDE SYSVER.INC
+
+;=========================================================================
+; macro disp_message: the macro takes the message obtained in get_message
+; and displays it to the applicable screen device.
+;=========================================================================
+
+disp_message macro tbl ;an000;display message macro
+
+ push si ;an000;save affected reg
+ push di ;an000;
+ push ax ;an000;
+ push bx ;an000;
+ push cx ;an000;
+ push dx ;an000;
+
+ push tbl ;an000;exchange tbl with si
+ pop si ;an000;
+
+ mov ax,[si] ;an000;move message number to ax
+ mov bx,[si+3] ;an000;display handle
+ mov cx,[si+7] ;an000;number of subs
+ mov dl,[si+9] ;an000;function type
+ mov di,[si+10] ;an000;input buffer if appl.
+ mov dh,[si+2] ;an000;message type
+ mov si,[si+5] ;an000;sublist
+
+ call sysdispmsg ;an000;display the message
+
+ pop dx ;an000;restore affected reg
+ pop cx ;an000;
+ pop bx ;an000;
+ pop ax ;an000;
+ pop di ;an000;
+ pop si ;an000;
+
+
+endm ;an000;end macro disp_message
+
+;=========================================================================
+; macro disp_message: end macro
+;=========================================================================
+
+
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+
+code segment public byte ;an000;code segment
+ assume cs:dg,ds:dg,ss:dg,es:dg ;an000;
+
+ public printf ;an000;share printf
+;; public disp_fatal ;an000;fatal error display
+ public pre_load_message ;an000;message pre load
+
+.xlist
+
+msg_services <MSGDATA>
+
+.list
+
+;=========================================================================
+; include sysmsg.inc - message retriever services
+;options selected:
+; NEARmsg
+; DISPLAYmsg
+; LOADmsg
+; INPUTmsg
+; CHARmsg
+; NUMmsg
+; CLSAmsg
+; CLSBmsg
+; CLSCmsg
+; CLSDmsg
+;=========================================================================
+
+.xlist
+
+msg_services <LOADmsg> ;an000;load the messages
+msg_services <DISPLAYmsg,CHARmsg,NUMmsg>;an000;get and display messages
+msg_services <INPUTmsg> ;an000;input from keyboard
+msg_services <DEBUG.CLA,DEBUG.CLB> ;an000;message types
+msg_services <DEBUG.CLC,DEBUG.CLD> ;an000;
+msg_services <DEBUG.CL1,DEBUG.CL2> ;an000;
+
+.list
+
+;=========================================================================
+; printf: printf is a replacement of the printf procedure used in DOS
+; releases prior 4.00. printf invokes the macros get_message and
+; disp_message to invoke the new message handler. the interface
+; into printf will continue to be a pointer to a message passed
+; in DX. the pointer is pointing to more than a message now. it
+; is pointing to a table for that message containing all relevant
+; information for retieving and printing the message. the macros
+; get_message and disp_message operate on these tables.
+;=========================================================================
+
+printf proc near ;an000;printf procedure
+
+ disp_message dx ;an000;display a message
+;; $if c ;an000;if an error occurred
+;; call disp_fatal ;an000;display the fatal error
+;; $endif ;an000;
+
+ ret ;an000;return to caller
+
+printf endp ;an000;end printf
+
+
+;=========================================================================
+; disp_fatal: this routine displays a fatal error message in the event
+; an error occurred in disp_message.
+;=========================================================================
+
+;;disp_fatal proc near ;an000;fatal error message
+;;
+;; mov ax,fatal_error ;an000;fatal_error number
+;; mov bx,stdout ;an000;print to console
+;; mov cx,0 ;an000;no parameters
+;; mov dl,no_input ;an000;no input will be coming
+;; mov dh,UTILITY_MSG_CLASS ;an000;utility messages
+;; call sysdispmsg ;an000;dispaly fatal error
+;; ret ;an000;return to caller
+;;
+;;disp_fatal endp ;an000;end disp_fatal
+
+
+;=========================================================================
+; PRE_LOAD_MESSAGE : This routine provides access to the messages required
+; by DEBUG. This routine will report if the load was
+; successful. An unsuccessful load will cause DEBUG
+; to terminate with an appropriate error message.
+;
+; Date : 6/15/87
+;=========================================================================
+
+PRE_LOAD_MESSAGE proc near ;an000;pre-load messages
+
+ call SYSLOADMSG ;an000;invoke loader
+
+; $if c ;an000;if an error
+ JNC $$IF1
+ pushf ;an000;save flags
+ call SYSDISPMSG ;an000;let him say why
+ popf ;an000;restore flags
+; $endif ;an000;
+$$IF1:
+
+ ret ;an000;return to caller
+
+PRE_LOAD_MESSAGE endp ;an000;end proc
+
+include msgdcl.inc
+
+code ends ;an000;end code segment
+
+
+CONST SEGMENT PUBLIC BYTE
+
+ PUBLIC ENDMES_PTR,CRLF_PTR,NAMBAD_PTR
+ PUBLIC NOTFND_PTR,NOROOM_PTR,BADVER
+ PUBLIC NOSPACE_PTR,DRVLET
+ PUBLIC ACCMES_PTR,PROMPT_PTR
+ PUBLIC TOOBIG_PTR,SYNERR_PTR,BACMES_PTR
+ PUBLIC HEXERR_PTR,HEXWRT_PTR,WRTMES_PTR,EXEBAD_PTR,EXEWRT_PTR
+ PUBLIC EXECEMES_PTR, PARITYMES_PTR, NONAMESPEC_PTR
+ PUBLIC dr1_ptr,dr2_ptr,dr3_ptr,dr4_ptr ;ac000;new messages
+ PUBLIC CHANGE_FLAG_PTR,DF_ERROR,BF_ERROR,BR_ERROR,BP_ERROR
+ PUBLIC CONSTEND
+
+;======================= TABLE STRUCTURE =================================
+;
+; byte 1 - message number of message to be displayed
+; byte 2 - message type to be used, i.e.;class 1, utility, etc.
+; byte 3 - display handle, i.e.; console, printer, etc.
+; byte 4 - pointer to substitution list, if any.
+; byte 6 - number of replaceable parameters, if any.
+; byte 7 - type of input from keyboard, if any.
+; byte 8 - pointer to buffer for keyboard input, if any.
+;
+;=========================================================================
+
+ IF SYSVER
+
+ PUBLIC BADDEV_PTR,BADLSTMES_PTR
+
+
+baddev_ptr label word ;an000;"Bad device name",0
+ dw 0006 ;an000;message number 6
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+badlstmes_ptr label word ;an000;"Couldn't open list device
+ ; PRN","Enter name of list
+ ; device?"
+ dw 0007 ;an000;message number 7
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db DOS_KEYB_INP ;an000;keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+ ENDIF
+
+;================= REPLACEABLE PARAMETER SUBLIST STRUCTURE ===============
+;
+; byte 1 - substitution list size, always 11
+; byte 2 - reserved for use by message handler
+; byte 3 - pointer to parameter to be used as a substitution
+; byte 7 - which parameter is this to replace, %1, %2, etc.
+; byte 8 - determines how the parameter is to be output
+; byte 9 - determines the maximum width of the parameter string
+; byte 10 - determines the minimum width of the parameter string
+; byte 11 - define what is to be used as a pad character
+;
+;=========================================================================
+
+
+;=========================================================================
+; replaceable parameter sublists
+;=========================================================================
+
+db_synerr_sub label dword ;an000;synerr parameters
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width
+ db pad_blank ;an000;blank pad
+
+db_change_sub label dword ;an000;synerr parameters
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width
+ db pad_blank ;an000;blank pad
+
+db_drive_error label dword ;an000;drive error parameters
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:drvlet ;an000;point to drive letter
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db 01 ;an000;1 byte
+ db 01 ;an000;1 byte
+ db pad_blank ;an000;blank pad
+
+
+
+;=========================================================================
+; end replaceable parameter sublists
+;=========================================================================
+
+
+crlf_ptr label word ;an000;13,10,0
+ dw 0008 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+bacmes_ptr label word ;an000;32,8,0
+ dw 0044 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+badver label word ;an000;"Incorrect DOS version"
+ dw 0001 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+endmes_ptr label word ;an000;13,10,"Program terminated
+ ; normally",0
+ dw 0009 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+nambad_ptr label word ;an000;"Invalid drive specification",0
+ dw 0010 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+notfnd_ptr label word ;an000;"File not found",0
+ dw 0002 ;an000;message number
+ db Ext_Err_Class ;an000;extended error
+ dw stderr ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+noroom_ptr label word ;an000;"File creation error",0
+ dw 0012 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+nospace_ptr label word ;an000;"Insufficient space on disk",0
+ dw 0013 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+dr1_ptr label word ;an000;"Disk error reading drive %1"
+ dw 0014 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_drive_error ;an000;sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+dr2_ptr label word ;an000;"Disk error writing drive %1"
+ dw 0015 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_drive_error ;an000;sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+dr3_ptr label word ;an000;"Write protect error reading
+ ; drive %1"
+ dw 0016 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_drive_error ;an000;sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+dr4_ptr label word ;an000;"Write protect error writing
+ ; drive %1"
+ dw 0017 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_drive_error ;an000;sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+toobig_ptr label word ;an000;"Insufficient memory",0
+ dw 0008 ;an000;message number
+ db Ext_Err_Class ;an000;utility message
+ dw stderr ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+synerr_ptr label word ;an000;"%1^Error",0
+ dw 0019 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_synerr_sub ;an000;sublist
+ dw 01 ;an000;1 sub - leading spaces
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+hexerr_ptr label word ;an000;"Error in EXE or HEX file",0
+ dw 0020 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+exebad_ptr label word ;an000;"Error in EXE or HEX file",0
+ dw 0020 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+hexwrt_ptr label word ;an000;"EXE and HEX files cannot be
+ ; written",0
+ dw 0021 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+exewrt_ptr label word ;an000;"EXE and HEX files cannot be
+ ; written",0
+ dw 0021 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+execemes_ptr label word ;an000;"EXEC failure",0
+ dw 0022 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+nonamespec_ptr label word ;an000;"(W)rite error, no destination
+ ; defined",0
+ dw 0023 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+accmes_ptr label word ;an000;Access denied",0
+ dw 0024 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+paritymes_ptr label word ;an000;"Parity error or nonexistant
+ ; memory error detected",0
+ dw 0025 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+prompt_ptr label word ;an000;"-",0
+ dw 0026 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+change_flag_ptr label word ;an000;"%1 -",0
+ dw 0027 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_change_sub ;an000;sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+df_error db "df",0
+bf_error db "bf",0
+br_error db "br",0
+bp_error db "bp",0
+drvlet db "A",0
+
+CONSTEND LABEL BYTE
+
+CONST ENDS
+
+DATA SEGMENT PUBLIC BYTE
+
+ PUBLIC HEX_ARG1,HEX_ARG2,HEX_PTR,ARG_BUF
+ PUBLIC ARG_BUF_PTR,ADD_PTR,ERR_TYPE
+ PUBLIC CRLF_PTR,ADD_ARG,SUB_ARG,PROMPT_PTR
+ PUBLIC REGISTER_PTR,REG_NAME,REG_CONTENTS
+ PUBLIC SINGLE_REG_PTR,SINGLE_REG_ARG
+ PUBLIC ERRMES_PTR,LOC_PTR,LOC_ADD
+ PUBLIC LITTLE_PTR,BIG_PTR,LITTLE_CONTENTS
+ PUBLIC BIG_CONTENTS,COMP_PTR,COMP_ARG1,COMP_ARG2
+ PUBLIC COMP_ARG3,COMP_ARG4,COMP_ARG5,COMP_ARG6
+ PUBLIC WRTMES_PTR,WRT_ARG1,WRT_ARG2
+ PUBLIC IOTYP,MESTYP
+ PUBLIC ONE_CHAR_BUF,ONE_CHAR_BUF_PTR
+ PUBLIC OPBUF,UNASSEM_LN_PTR
+ PUBLIC QMES_1
+ PUBLIC QMES_2
+ PUBLIC QMES_3
+ PUBLIC QMES_4
+ PUBLIC QMES_5
+ PUBLIC HELP_TEXT1
+ PUBLIC HELP_TEXT2
+ PUBLIC HELP_TEXT3
+ PUBLIC HELP_TEXT4
+ PUBLIC HELP_TEXT5
+ PUBLIC HELP_TEXT6
+
+ PUBLIC xm_han_ret_ptr
+ PUBLIC xm_mapped_ptr
+ PUBLIC xm_err80_ptr
+ PUBLIC xm_err83_ptr
+ PUBLIC xm_err84_ptr
+ PUBLIC xm_err85_ptr
+ PUBLIC xm_err86_ptr
+ PUBLIC xm_err87_ptr
+ PUBLIC xm_err88_ptr
+ PUBLIC xm_err89_ptr
+ PUBLIC xm_err8a_ptr
+ PUBLIC xm_err8b_ptr
+ PUBLIC xm_err8d_ptr
+ PUBLIC xm_err8e_ptr
+ PUBLIC xm_err_gen_ptr
+ PUBLIC xm_parse_err_ptr
+ PUBLIC xm_status_ptr
+ PUBLIC xm_page_seg_ptr
+ PUBLIC xm_deall_ptr
+ PUBLIC xm_errff_ptr
+ PUBLIC xm_unall_ptr
+ PUBLIC xm_han_alloc_ptr
+
+ EXTRN XM_HANDLE_RET:word
+ EXTRN XM_LOG:byte
+ EXTRN XM_PHY:byte
+ EXTRN XM_PAGE_CNT:word
+ EXTRN XM_FRAME:word
+ EXTRN XM_DEALL_HAN:word
+ EXTRN XM_ALLOC_PG:word
+ EXTRN XM_TOTAL_PG:word
+ EXTRN XM_HAN_ALLOC:word
+ EXTRN XM_HAN_TOTAL:word
+
+;=========================================================================
+; begin parameter sublists
+;=========================================================================
+
+;======================= unassemble parameter sublists ===================
+
+db_unassem_sb1 label dword ;an000;unassemble parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width
+ db pad_blank ;an000;blank pad
+
+db_unassem_sb2 label dword ;an000;unassemble parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:opbuf ;an000;point to argument buffer
+ db 02 ;an000;parameter two
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width
+ db pad_blank ;an000;blank pad
+
+
+;================== hex argument parameter sublists ======================
+
+db_hexarg_sb1 label dword ;an000;hex argument parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:hex_arg1 ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_word
+ ;an000;right align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_hexarg_sb2 label dword ;an000;hex argument parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:hex_arg2 ;an000;point to argument buffer
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_hexarg_sb3 label dword ;an000;hex argument parameter 3
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 03 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width
+ db pad_blank ;an000;blank pad
+
+
+;================== hex add parameter sublists ===========================
+
+db_hexadd_sb1 label dword ;an000;hex add parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:add_arg ;an000;point to add_arg
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_hexadd_sb2 label dword ;an000;hex argument parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:sub_arg ;an000;point to sub_arg
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;================== end hex add parameter sublists =======================
+
+;================== single register parameter sublists ===================
+;string: "%1 %2",13,10,":",0
+
+db_singrg_sb1 label dword ;an000;single register parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+db_singrg_sb2 label dword ;an000;single register parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:single_reg_arg ;an000;point single_reg_arg
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;================== register parameter sublists ==========================
+;string: "%1=%2 ",0
+
+db_regist_sb1 label dword ;an000;register parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:reg_name ;an000;point to reg_name
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db 02 ;an000;unlimited width
+ db 02 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+db_regist_sb2 label dword ;an000;register parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:reg_contents ;an000;point to reg_contents
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;================== error message parameter sublists =====================
+;string: "%1 Error",0
+
+db_error_sb1 label dword ;an000;error message parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:err_type ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+;================== writing message parameter sublists ===================
+;string: "Writing %1%2 bytes",0
+
+db_wrtmes_sb1 label dword ;an000;wrtmes parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:wrt_arg1 ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_word
+ ;an000;right align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_wrtmes_sb2 label dword ;an000;wrtmes parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:wrt_arg2 ;an000;point to argument buffer
+ db 02 ;an000;parameter two
+;C07 db left_align+bin_hex_word
+ db right_align+bin_hex_word ;C07
+ ;an000;left align/word/hexadecimal
+;C02 db 04 ;an000;maximum of 4 bytes
+;C02 db 04 ;an000;minimum of 4 bytes
+;C07 db 01 ;an000;maximum of 4 bytes ;C02
+;C07 db 00 ;an000;minimum of 4 bytes ;C02
+ db 04 ;an000;maximum of 4 bytes ;C07
+ db 01 ;an000;minimum of 4 bytes ;C07
+ db pad_zero ;an000;blank pad
+
+;================== loc address parameter sublists =======================
+;string: "%1:%2=",0
+
+db_locadd_sb1 label dword ;an000;loc address parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db right_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIZZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+db_locadd_sb2 label dword ;an000;loc address parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:loc_add ;an000;point to loc_add
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;================== little contents parameter sublists ===================
+;string "%1",0
+
+db_little_sb1 label dword ;an000;one byte output parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:little_contents ;an000;point to little_contents
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_byte
+ ;an000;left align/byte/hexadecimal
+ db 02 ;an000;maximum of 2 bytes
+ db 02 ;an000;minimum of 2 bytes
+ db pad_zero ;an000;blank pad
+
+;================== big argument parameter sublists ======================
+;string: "%1",0
+
+db_big_sb1 label dword ;an000;word argument parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:big_contents ;an000;point to big_contents
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;======================= comp argument parameter sublists ================
+;string "%1:%2 %3 %4 %5:%6",0
+
+db_comp_sb1 label dword ;an000;comp argument parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg1 ;an000;point to comp_arg1
+ db 01 ;an000;parameter one
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_comp_sb2 label dword ;an000;comp argument parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg2 ;an000;point to comp_arg2
+ db 02 ;an000;parameter two
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_comp_sb3 label dword ;an000;comp argument parameter 3
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg3 ;an000;point to comp_arg3
+ db 03 ;an000;parameter three
+ db right_align+bin_hex_byte
+ ;an000;left align/byte/hexadecimal
+ db 02 ;an000;maximum of 2 bytes
+ db 02 ;an000;minimum of 2 bytes
+ db pad_zero ;an000;blank pad
+
+db_comp_sb4 label dword ;an000;comp argument parameter 4
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg4 ;an000;point to comp_arg4
+ db 04 ;an000;parameter four
+ db right_align+bin_hex_byte
+ ;an000;left align/byte/hexadecimal
+ db 02 ;an000;maximum of 2 bytes
+ db 02 ;an000;minimum of 2 bytes
+ db pad_zero ;an000;blank pad
+
+db_comp_sb5 label dword ;an000;comp argument parameter 5
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg5 ;an000;point to comp_arg5
+ db 05 ;an000;parameter five
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+db_comp_sb6 label dword ;an000;comp argument parameter 6
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:comp_arg6 ;an000;
+ db 06 ;an000;parameter 6
+ db right_align+bin_hex_word
+ ;an000;left align/word/hexadecimal
+ db 04 ;an000;maximum of 4 bytes
+ db 04 ;an000;minimum of 4 bytes
+ db pad_zero ;an000;blank pad
+
+;======================= disk error parameter sublists ===================
+;string: "%1 error %2 drive %3",0
+
+db_disk_sb1 label dword ;an000;disk argument parameter 1
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:mestyp ;an000;point to mestyp
+ db 01 ;an000;parameter one
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+db_disk_sb2 label dword ;an000;disk argument parameter 2
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:iotyp ;an000;point to iotyp
+ db 02 ;an000;parameter two
+ db left_align+Char_field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+db_disk_sb3 label dword ;an000;disk argument parameter 3
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:drive ;an000;point to drive
+ db 03 ;an000;parameter three
+ db left_align+char_field_char
+ ;an000;left align/character/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+arg_buf_sb1 label dword ;an000;argument sublist
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:arg_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_Field_ASCIIZ
+ ;an000;left align/ASCIIZ/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+one_char_sb1 label dword ;an000;character buffer sublist
+ db Sublist_Length ;an000;sublist size
+ db reserved ;an000;reserved
+ dd dg:one_char_buf ;an000;point to argument buffer
+ db 01 ;an000;parameter one
+ db left_align+Char_Field_Char
+ ;an000;left align/character/character
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum of 0 bytes
+ db pad_blank ;an000;blank pad
+
+xm_han_sub label dword ;an000;sublist for handles
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_HANDLE_RET ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+xm_map_sub label dword ;an000;sublist for mappings
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_LOG ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Byte;an000;
+ db 02 ;an000;maximum width
+ db 02 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_PHY ;an000;parameter 2
+ db 02 ;an000;parameter 2
+ db right_align+Bin_Hex_Byte;an000;
+ db 02 ;an000;maximum width
+ db 02 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+xm_sta_sub label word ;an000;sublist for status
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_HANDLE_RET ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_PAGE_CNT ;an000;parameter 2
+ db 02 ;an000;parameter 2
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+xm_page_seg_sub label word ;an000;sublist for frame seg status
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_PHY ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Byte;an000;
+ db 02 ;an000;maximum width
+ db 02 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_FRAME ;an000;parameter 2
+ db 02 ;an000;parameter 2
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+xm_deall_sub label word ;an000;sublist for handle deallocation
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_DEALL_HAN ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Byte;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 30h ;an000;pad with zeros
+
+xm_unall_sub label word ;an000;sublist unallocated page report
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_ALLOC_PG ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 20h ;an000;pad with blanks
+
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_TOTAL_PG ;an000;parameter 1
+ db 02 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 20h ;an000;pad with zeros
+
+
+xm_han_alloc_sub label word ;an000;sublist unallocated page report
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_HAN_ALLOC ;an000;parameter 1
+ db 01 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 20h ;an000;pad with blanks
+
+ db Sublist_Length ;an000;11 bytes
+ db Reserved ;an000;reserved field
+ dd dg:XM_HAN_TOTAL ;an000;parameter 1
+ db 02 ;an000;parameter 1
+ db right_align+Bin_Hex_Word;an000;
+ db 04 ;an000;maximum width
+ db 04 ;an000;minimum width
+ db 20h ;an000;pad with zeros
+;=========================================================================
+; end parameter sublists
+;=========================================================================
+
+
+unassem_ln_ptr label word ;an000;"%1%2",0
+ dw 0032 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_unassem_sb1 ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+hex_ptr label word ;an000;"%1:%2 %3",0
+ dw 0033 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_hexarg_sb1 ;an000;sublist
+ dw 03 ;an000;3 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+add_ptr label word ;an000;"%1 %2",0
+ dw 0034 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_hexadd_sb1 ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+
+single_reg_ptr label word ;an000;"%1 %2",13,10,":",0
+ dw 0035 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_singrg_sb1 ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+
+register_ptr label word ;an000;"%1=%2 ",0 ex: AX=FFFF
+ dw 0036 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_regist_sb1 ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+errmes_ptr label word ;an000;"%1 Error",0
+ dw 0037 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_error_sb1 ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+wrtmes_ptr label word ;an000;"Writing %1 bytes",0
+ dw 0038 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_wrtmes_sb1 ;an000;sublist
+;C02 dw 01 ;an000;1 sub
+ dw 02 ;an000;1 sub ;C02
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+loc_ptr label word ;an000:"%1;%2=",0 ex:CX:0000
+ dw 0039 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_locadd_sb1 ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+little_ptr label word ;an000;"%1",0 ex:FF
+ dw 0040 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_little_sb1 ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+big_ptr label word ;an000;"%1",0
+ dw 0041 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_big_sb1 ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+comp_ptr label word ;an000;"%1:%2 %3 %4 %5:%6",0
+ dw 0042 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:db_comp_sb1 ;an000;sublist
+ dw 06 ;an000;6 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+arg_buf_ptr label word ;an000;"%1"
+ dw 0046 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:arg_buf_sb1 ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+
+one_char_buf_ptr label word ;an000;"%1"
+ dw 0047 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:one_char_sb1 ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_unall_ptr label word ;an000;unallocated message report
+ dw 0050 ;an000;"%1 of a total %2 EMS pages
+ ; have been allocated",cr,lf
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_UNALL_SUB ;an000;sublist
+ dw 02 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_han_alloc_ptr label word ;an000;unallocated message report
+ dw 0051 ;an000;"%1 of a total %2 EMS handles
+ ; have been allocated",cr,lf
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_HAN_ALLOC_SUB ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_han_ret_ptr label word ;an000;prints handle created
+ dw 0055 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_HAN_SUB ;an000;sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_mapped_ptr label word ;an000;prints log/phy pages
+ dw 0056 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_MAP_SUB ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err80_ptr label word ;an000;ems error message
+ dw 0057 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err83_ptr label word ;an000;ems error message
+ dw 0058 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err84_ptr label word ;an000;ems error message
+ dw 0059 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err85_ptr label word ;an000;ems error message
+ dw 0060 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err86_ptr label word ;an000;ems error message
+ dw 0061 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err87_ptr label word ;an000;ems error message
+ dw 0062 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err88_ptr label word ;an000;ems error message
+ dw 0063 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err89_ptr label word ;an000;ems error message
+ dw 0064 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err8a_ptr label word ;an000;ems error message
+ dw 0065 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err8b_ptr label word ;an000;ems error message
+ dw 0066 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err8d_ptr label word ;an000;ems error message
+ dw 0067 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err8e_ptr label word ;an000;ems error message
+ dw 0068 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_err_gen_ptr label word ;an000;ems error message
+ dw 0070 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_parse_err_ptr label word ;an000;input error message
+ dw 0071 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_status_ptr label word ;an000;prints status of EMS
+ dw 0072 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_STA_SUB ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_page_seg_ptr label word ;an000;"Physical page %1 = Frame
+ ; segment %2"
+ dw 0075 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_PAGE_SEG_SUB ;an000;sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_deall_ptr label word ;an000;"Handle %1 deallocated"
+
+ dw 0076 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw dg:XM_DEALL_SUB ;an000;sublist
+ dw 01 ;an000;1 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+xm_errff_ptr label word ;an000;"EMS not installed"
+
+ dw 0078 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility messages
+ dw stdout ;an000;display handle
+ dw 00 ;an000;sublist
+ dw 00 ;an000;0 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+qmes_1 label word ;
+ dw 0090 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+qmes_2 label word ;
+ dw 0091 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+qmes_3 label word ;
+ dw 0092 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00
+ ;an000;no keyboard buffer
+qmes_4 label word ;
+ dw 0093 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+qmes_5 label word ;
+ dw 0094 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text1 label word
+ dw 0100 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text2 label word
+ dw 0101 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text3 label word
+ dw 0102 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text4 label word
+ dw 0103 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text5 label word
+ dw 0104 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+help_text6 label word
+ dw 0105 ;message number
+ db UTILITY_MSG_CLASS ;utility message
+ dw stdout ;an000;display handle
+ dw 00
+ dw 00
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+arg_buf db 80 dup (?) ;an000;argument buffer
+one_char_buf db ? ;an000;character buffer
+
+opbuf db 51h dup (?)
+
+hex_arg1 dw ?
+hex_arg2 dw ?
+
+add_arg dw ?
+sub_arg dw ?
+
+single_reg_arg dw ?
+
+reg_name dw ?
+reg_contents dw ?
+
+err_type db 3 dup(0) ;ac000;changed to hold bf,bp,etc.
+
+wrt_arg1 dw ?
+wrt_arg2 dw ?
+
+loc_add dw ?
+
+little_contents dw ?
+big_contents dw ?
+
+comp_arg1 dw ?
+comp_arg2 dw ?
+comp_arg3 dw ?
+comp_arg4 dw ?
+comp_arg5 dw ?
+comp_arg6 dw ?
+
+mestyp dw ?
+iotyp dw ?
+drive db ?
+
+
+DATA ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debuasm.asm b/private/mvdm/dos/v86/cmd/debug/debuasm.asm
new file mode 100644
index 000000000..2386e3bb5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debuasm.asm
@@ -0,0 +1,961 @@
+ PAGE 80,132 ;
+ TITLE DEBUASM.ASM
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; Code for the UASSEMble command in the debugger
+
+ IF1
+ %OUT COMPONENT=DEBUG, MODULE=DEBUASM
+ ENDIF
+.XLIST
+.XCREF
+ include version.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC
+ INCLUDE debug.inc
+.CREF
+.LIST
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN SYNERR_PTR:BYTE,UNASSEM_LN_PTR:WORD
+ EXTRN NSEG:WORD,SISAVE:WORD,BPSAVE:WORD,DISAVE:WORD
+ EXTRN BXSAVE:WORD,DSSAVE:WORD,ESSAVE:WORD,CSSAVE:WORD,IPSAVE:WORD
+ EXTRN SSSAVE:WORD,CXSAVE:WORD,SPSAVE:WORD,FLSAVE:WORD
+ EXTRN DISTAB:WORD,SHFTAB:WORD,IMMTAB:WORD,GRP1TAB:WORD,GRP2TAB:WORD
+ EXTRN DBMN:BYTE,ESCMN:BYTE,DISPB:WORD,STACK:BYTE,REG8:BYTE
+ EXTRN REG16:BYTE,SREG:BYTE,SIZ8:BYTE,SEGTAB:WORD,M8087_TAB:BYTE
+ EXTRN FI_TAB:BYTE,SIZE_TAB:BYTE,MD9_TAB:BYTE,MD9_TAB2:BYTE
+ EXTRN MDB_TAB:BYTE,MDB_TAB2:BYTE,MDD_TAB:BYTE,MDD_TAB2:BYTE
+ EXTRN MDF_TAB:BYTE
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN DISADD:BYTE,DISCNT:WORD,BYTCNT:BYTE,TEMP:BYTE,AWORD:BYTE
+ EXTRN MIDFLD:BYTE,MODE:BYTE,REGMEM:BYTE,OPCODE:WORD,OPBUF:BYTE
+ EXTRN INDEX:WORD,ARG_BUF:BYTE,ARG_BUF_PTR:BYTE,ARG_BUF_INDEX:WORD
+ EXTRN OPBUF:BYTE,OPCODE:WORD
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CODE SEGMENT PUBLIC BYTE
+ ASSUME CS:DG,DS:DG,ES:DG,SS:DG
+
+ PUBLIC UNASSEM
+ PUBLIC DISASLN,MEMIMM,JMPCALL,SIGNIMM,ALUFROMREG,WORDTOALU
+ PUBLIC GRP2,PREFIX,OUTVARW,GRP1,SSPRE,MOVSEGTO,DSPRE,SHIFT
+ PUBLIC ESPRE,IMMED,CSPRE,OUTVARB,CHK10,ACCIMM,INT3,INVARB
+ PUBLIC MOVSEGFROM,LOADACC,OUTFIXB,XCHGAX,REGIMMW,SHORTJMP
+ PUBLIC SAV8,M8087,M8087_DB,M8087_DF,M8087_D9,M8087_DD
+ PUBLIC SAV16,SAVHEX,INFIXW,REGIMMB,OUTFIXW,SHIFTV,LONGJMP
+ PUBLIC INVARW,STOREACC,INFIXB,NOOPERANDS,ALUTOREG
+ PUBLIC SEGOP,REGOP,GETADDR
+
+ EXTRN CRLF:NEAR,BLANK:NEAR,TAB:NEAR,STD_PRINTF:NEAR
+ EXTRN HEX:NEAR,DEFAULT:NEAR,OUTSI:NEAR,OUTDI:NEAR
+ EXTRN HEX_ADDRESS_ONLY:NEAR
+
+UNASSEM:
+ MOV BP,[CSSAVE] ; Default code segment
+ MOV DI,OFFSET DG:DISADD ; Default address
+ MOV CX,DISPB ; Default length
+ SHR CX,1
+ SHR CX,1
+ CALL DEFAULT
+ MOV WORD PTR [DISADD],DX ; Displacement of disassembly
+ MOV WORD PTR [DISADD+2],AX ; Segment
+ MOV WORD PTR [DISCNT],CX ; No. of bytes (but whole instructions)
+DISLP:
+ CALL DISASLN ; Disassemble one line
+ CALL CRLF
+ TEST [DISCNT],-1 ; See if we've used up the range
+ JNZ DISLP
+ RET
+
+GOTDIS:
+ PUSH DS ; RE-GET LAST BYTE
+ PUSH SI
+ LDS SI,DWORD PTR [DISADD]
+ MOV AL,[SI-1]
+ POP SI
+ POP DS
+ RET
+
+GETDIS:
+ PUSH DS
+ LDS SI,DWORD PTR [DISADD]
+ LODSB ; Get the next byte of code
+ POP DS
+ MOV WORD PTR [DISADD],SI ; Update pointer
+ PUSH AX
+ PUSH DI
+ MOV DI,[ARG_BUF_INDEX]
+ CALL HEX ; Display each code byte
+ MOV [ARG_BUF_INDEX],DI
+ POP DI
+ MOV SI,[DISCNT]
+ OR SI,SI ; Check if range exhausted
+ JZ ENDRNG ; If so, don't wrap around
+ DEC SI ; Count off the bytes
+ MOV [DISCNT],SI
+ENDRNG:
+ INC BYTE PTR[BYTCNT] ; Keep track of no. of bytes per line
+ POP AX
+ RET
+
+DSPRE:
+ INC BYTE PTR [NSEG+1]
+SSPRE:
+ INC BYTE PTR [NSEG+1]
+CSPRE:
+ INC BYTE PTR [NSEG+1]
+ESPRE:
+ INC BYTE PTR [NSEG+1]
+
+PREFIX:
+ POP BX ; Dump off return address
+ CALL FINLN
+ CALL CRLF
+DISASLN:
+ PUSH DS
+ LDS SI,DWORD PTR [DISADD]
+ CALL OUTSI ; Show disassembly address
+ POP DS
+ CALL HEX_ADDRESS_ONLY
+DISASLN1:
+ MOV BYTE PTR [BYTCNT],0 ; Count of code bytes per line
+; Fill overflow area with zeros
+ MOV DI,OFFSET DG:OPBUF
+ MOV CX,50
+ MOV AL,0
+ REP STOSB
+; fill buffer with spaces
+ MOV DI,OFFSET DG:OPBUF
+ MOV CX,OPBUFLEN
+ MOV AL," "
+ REP STOSB
+ MOV DI,OFFSET DG:ARG_BUF
+ MOV [ARG_BUF_INDEX],DI
+ CALL GETDIS ; Get opcode
+ MOV DI,[ARG_BUF_INDEX]
+ MOV AH,0
+ MOV BX,AX
+ AND AL,1 ; Mask to "W" bit
+ MOV [AWORD],AL
+ MOV AL,BL ; Restore opcode
+ SHL BX,1
+ SHL BX,1 ; Multiply opcode by 4
+ ADD BX,OFFSET DG:DISTAB
+ MOV DX,[BX] ; Get pointer to mnemonic from table
+ MOV [OPCODE],DX
+ MOV [ARG_BUF_INDEX],DI
+ MOV DI,OFFSET DG:OPBUF
+ CALL WORD PTR [BX+2]
+FINLN:
+ MOV AH,[BYTCNT] ; See how many bytes in this instruction
+ ADD AH,AH ; Each uses two characters
+ MOV AL,14 ; Amount of space we want to use
+ SUB AL,AH ; See how many fill characters needed
+ CBW
+ XCHG CX,AX ; Parameter for TAB needed in CX
+ MOV DI,[ARG_BUF_INDEX]
+ CALL TAB
+ MOV SI,[OPCODE]
+ OR SI,SI
+ JZ GET_TAB
+GET_OPCODE:
+ LODSB
+ OR AL,AL
+ JZ GET_TAB
+ STOSB
+ JMP GET_OPCODE
+
+GET_TAB:
+ MOV AL,9
+ STOSB
+ MOV BYTE PTR [DI],0 ; nul terminate address buffer
+ MOV DX,OFFSET DG:UNASSEM_LN_PTR
+ CALL STD_PRINTF
+ RET
+
+GETMODE:
+ CALL GETDIS ; Get the address mode byte
+ MOV AH,AL
+ AND AL,7 ; Mask to "r/m" field
+ MOV [REGMEM],AL
+ SHR AH,1
+ SHR AH,1
+ SHR AH,1
+ MOV AL,AH
+ AND AL,7 ; Mask to center 3-bit field
+ MOV [MIDFLD],AL
+ SHR AH,1
+ SHR AH,1
+ SHR AH,1
+ MOV [MODE],AH ; Leaving 2-bit "MOD" field
+ RET
+
+IMMED:
+ MOV BX,OFFSET DG:IMMTAB
+ CALL GETMNE
+FINIMM:
+ CALL TESTREG
+ JMP SHORT IMM
+
+MEMIMM:
+ CALL GETMODE
+ JMP SHORT FINIMM
+
+ACCIMM:
+ XOR AL,AL
+IMM1:
+ CALL SAVREG
+IMM:
+ MOV AL,","
+ STOSB
+ TEST BYTE PTR [AWORD],-1
+ JNZ SAV16
+SAV8:
+ CALL GETDIS
+ JMP SHORT SAVHEX
+
+LONGJMP:
+ PUSH DI
+ MOV DI,OFFSET DG:TEMP
+ CALL SAV16
+ POP DI
+ CALL SAV16
+ MOV AL,":"
+ STOSB
+ MOV SI,OFFSET DG:TEMP
+ MOV CX,4
+MOVDIG:
+ LODSB
+ STOSB
+ LOOP MOVDIG
+ RET
+
+SAV16:
+ CALL GETDIS ; Get low byte
+ MOV DL,AL
+ CALL GETDIS ; Get high byte
+ MOV DH,AL
+ CALL SAVHEX ; Convert and store high byte
+ MOV AL,DL
+SAVHEX:
+ MOV AH,AL
+ SHR AL,1
+ SHR AL,1
+ SHR AL,1
+ SHR AL,1
+ CALL SAVDIG
+ MOV AL,AH
+SAVDIG:
+ AND AL,0FH
+ ADD AL,90H
+ DAA
+ ADC AL,40H
+ DAA
+ STOSB
+ RET
+
+CHK10:
+ CALL GETDIS
+ CMP AL,10
+ JNZ SAVHEX
+ RET
+
+SIGNIMM:
+ MOV BX,OFFSET DG:IMMTAB
+ CALL GETMNE
+ CALL TESTREG
+ MOV AL,","
+ STOSB
+SAVD8:
+ CALL GETDIS ; Get signed 8-bit number
+ CBW
+ MOV DX,AX ; Save true 16-bit value in DX
+ MOV AH,AL
+ MOV AL,"+"
+ OR AH,AH
+; JZ NOSIGN
+ JNS POSITIV ; OK if positive
+ MOV AL,"-"
+ NEG AH ; Get magnitude if negative
+POSITIV:
+ STOSB
+; NOSIGN:
+ MOV AL,AH
+ JMP SHORT SAVHEX
+
+ALUFROMREG:
+ CALL GETADDR
+ MOV AL,","
+ STOSB
+REGFLD:
+ MOV AL,[MIDFLD]
+SAVREG:
+ MOV SI,OFFSET DG:REG8
+ CMP BYTE PTR [AWORD],1
+ JNE FNDREG
+SAVREG16:
+ MOV SI,OFFSET DG:REG16
+FNDREG:
+ CBW
+ ADD SI,AX
+ ADD SI,AX
+ MOVSW
+ RET
+
+SEGOP:
+ SHR AL,1
+ SHR AL,1
+ SHR AL,1
+SAVSEG:
+ AND AL,3
+ MOV SI,OFFSET DG:SREG
+ JMP SHORT FNDREG
+
+REGOP:
+ AND AL,7
+ JMP SHORT SAVREG16
+
+MOVSEGTO:
+ MOV BYTE PTR [AWORD],1
+ CALL GETADDR
+ MOV AL,","
+ STOSB
+ MOV AL,[MIDFLD]
+ JMP SHORT SAVSEG
+
+MOVSEGFROM:
+ CALL GETMODE
+ CALL SAVSEG
+ MOV BYTE PTR [AWORD],1
+ JMP SHORT MEMOP2
+
+GETADDR:
+ CALL GETMODE
+ JMP SHORT ADDRMOD
+
+WORDTOALU:
+ MOV BYTE PTR [AWORD],1
+ALUTOREG:
+ CALL GETMODE
+ CALL REGFLD
+MEMOP2:
+ MOV AL,","
+ STOSB
+ADDRMOD:
+ CMP BYTE PTR [MODE],3
+ MOV AL,[REGMEM]
+ JE SAVREG
+ XOR BX,BX
+ MOV BYTE PTR [NSEG],3
+ MOV BYTE PTR [DI],"["
+ INC DI
+ CMP AL,6
+ JNE NODRCT
+ CMP BYTE PTR [MODE],0
+ JE DIRECT ; Mode=0 and R/M=6 means direct addr.
+NODRCT:
+ MOV DL,AL
+ CMP AL,1
+ JBE USEBX
+ CMP AL,7
+ JE USEBX
+ CMP AL,3
+ JBE USEBP
+ CMP AL,6
+ JNE CHKPLS
+USEBP:
+ MOV BX,[BPSAVE]
+ MOV BYTE PTR [NSEG],2 ; Change default to Stack Segment
+ MOV AX,BPREG
+SAVBASE:
+ STOSW
+CHKPLS:
+ CMP DL,4
+ JAE NOPLUS
+ MOV AL,"+"
+ STOSB
+NOPLUS:
+ CMP DL,6
+ JAE DOMODE ; No index register
+ AND DL,1 ; Even for SI, odd for DI
+ JZ USESI
+ ADD BX,[DISAVE]
+ MOV AX,DIREG
+SAVINDX:
+ STOSW
+DOMODE:
+ MOV AL,[MODE]
+ OR AL,AL
+ JZ CLOSADD ; If no displacement, then done
+ CMP AL,2
+ JZ ADDDIR
+ CALL SAVD8 ; Signed 8-bit displacement
+ADDCLOS:
+ ADD BX,DX
+CLOSADD:
+ MOV AL,"]"
+ STOSB
+ MOV [INDEX],BX
+NOOPERANDS:
+ RET
+
+ADDDIR:
+ MOV AL,"+"
+ STOSB
+DIRECT:
+ CALL SAV16
+ JMP SHORT ADDCLOS
+
+USEBX:
+ MOV BX,[BXSAVE]
+ MOV AX,BXREG
+ JMP SHORT SAVBASE
+
+USESI:
+ ADD BX,[SISAVE]
+ MOV AX,SIREG
+ JMP SHORT SAVINDX
+
+SHORTJMP:
+ CALL GETDIS
+ CBW
+ ADD AX,WORD PTR [DISADD]
+ XCHG DX,AX
+SAVJMP:
+ MOV AL,DH
+ CALL SAVHEX
+ MOV AL,DL
+ JMP SAVHEX
+
+JMPCALL:
+ CALL GETDIS
+ MOV DL,AL
+ CALL GETDIS
+ MOV DH,AL
+ ADD DX,WORD PTR [DISADD]
+ JMP SHORT SAVJMP
+
+XCHGAX:
+ AND AL,7
+ CALL SAVREG16
+ MOV AL,","
+ STOSB
+ XOR AL,AL
+ JMP SAVREG16
+
+LOADACC:
+ XOR AL,AL
+ CALL SAVREG
+ MOV AL,","
+ STOSB
+MEMDIR:
+ MOV AL,"["
+ STOSB
+ XOR BX,BX
+ MOV BYTE PTR [NSEG],3
+ JMP DIRECT
+
+STOREACC:
+ CALL MEMDIR
+ MOV AL,","
+ STOSB
+ XOR AL,AL
+ JMP SAVREG
+
+REGIMMB:
+ MOV BYTE PTR [AWORD],0
+ JMP SHORT REGIMM
+
+REGIMMW:
+ MOV BYTE PTR [AWORD],1
+REGIMM:
+ AND AL,7
+ JMP IMM1
+
+INT3:
+ MOV BYTE PTR [DI],"3"
+ INC DI
+ RET
+
+; 8087 instructions whose first byte is 0dfh
+M8087_DF:
+ CALL GET64F
+ JZ ISDD3
+ MOV SI,OFFSET DG:MDF_TAB
+ JMP short NODB3
+
+; 8087 instructions whose first byte is 0ddh
+M8087_DD:
+ CALL GET64F
+ JZ ISDD3
+ MOV SI,OFFSET DG:MDD_TAB
+ JMP short NOD93
+
+ISDD3:
+ MOV AL,DL
+ TEST AL,100B
+ JZ ISSTI
+ JMP ESC0
+
+ISSTI:
+ AND AL,11B
+ MOV SI,OFFSET DG:MDD_TAB2
+ MOV CL,AL
+ CALL MOVBYT
+ JMP short PUTRST
+
+; 8087 instructions whose first byte is 0dbh
+M8087_DB:
+ CALL GET64F
+ JZ ISDB3
+ MOV SI,OFFSET DG:MDB_TAB
+NODB3:
+ CALL PUTOP
+ CALL PUTSIZE
+ JMP ADDRMOD
+
+ISDB3:
+ MOV AL,DL
+ TEST AL,100B
+ JNZ ISDBIG
+ESC0V:
+ JMP ESC0
+
+ISDBIG:
+ CALL GOTDIS
+ AND AL,11111B
+ CMP AL,4
+ JAE ESC0V
+ MOV SI,OFFSET DG:MDB_TAB2
+ JMP short DOBIG
+
+; 8087 instructions whose first byte is 0d9h
+M8087_D9:
+ CALL GET64F
+ JZ ISD93
+
+ MOV SI,OFFSET DG:MD9_TAB
+NOD93:
+ CALL PUTOP
+ AND AL,111B
+ CMP AL,3
+ JA NOSHO
+ MOV AL,DL
+ CALL PUTSIZE
+NOSHO:
+ JMP ADDRMOD
+
+ISD93:
+ MOV AL,DL
+ TEST AL,100B
+ JNZ ISD9BIG
+ AND AL,111B
+ OR AL,AL
+ JNZ NOTFLD
+ MOV AX,"DL"
+ STOSW
+ JMP SHORT PUTRST
+
+NOTFLD:
+ CMP AL,1
+ JNZ NOTFXCH
+ MOV AX,"CX"
+ STOSW
+ MOV AL,"H"
+ JMP SHORT PUTRST1
+
+NOTFXCH:
+ CMP AL,3
+ JNZ NOTFSTP
+ MOV AX,"TS"
+ STOSW
+ MOV AL,"P"
+PUTRST1:
+ STOSB
+PUTRST:
+ MOV AL,9
+ STOSB
+ JMP short PUTST0
+
+NOTFSTP:
+ CALL GOTDIS
+ CMP AL,11010000B ; CHECK FOR FNOP
+ JZ GOTFNOP
+ JMP ESC0
+
+GOTFNOP:
+ MOV AX,"ON"
+ STOSW
+ MOV AL,"P"
+ STOSB
+ RET
+
+ISD9BIG:
+ CALL GOTDIS ; GET THE MODE BYTE
+ MOV SI,OFFSET DG:MD9_TAB2
+DOBIG:
+ AND AL,11111B
+ MOV CL,AL
+ JMP MOVBYT
+
+; entry point for the remaining 8087 instructions
+M8087:
+ CALL GET64
+ CALL PUTFI ; PUT FIRST PART OF OPCODE
+ MOV AL,DL
+ CMP BYTE PTR [MODE],11B ; CHECK FOR REGISTER MODE
+ JZ MODEIS3
+ CALL PUTMN ; PUT MIDDLE PART OF OPCODE
+NO3:
+ MOV AL,9 ; OUTPUT A TAB
+ STOSB
+ MOV AL,DL
+ CALL PUTSIZE ; OUTPUT THE OPERAND SIZE
+ JMP ADDRMOD
+
+MODEIS3:
+ TEST AL,100000B ; D BIT SET?
+ JZ MPUT ; NOPE...
+ TEST AL,000100B ; FDIV OR FSUB?
+ JZ MPUT ; NOPE...
+ XOR AL,1 ; REVERSE SENSE OF R
+ MOV DL,AL ; SAVE CHANGE
+MPUT:
+ CALL PUTMN ; PUT MIDDLE PART OF OPCODE
+ MOV AL,DL
+ TEST AL,010000B
+ JZ NOPSH
+ MOV AL,"P"
+ STOSB
+NOPSH:
+ MOV AL,9
+ STOSB
+ MOV AL,DL
+ AND AL,00000111B
+ CMP AL,2 ; FCOM
+ JZ PUTST0
+ CMP AL,3 ; FCOMP
+ JZ PUTST0
+ MOV AL,DL
+ TEST AL,100000B
+ JZ PUTSTST0
+
+; output 8087 registers in the form st(n),st
+PUTST0ST:
+ CALL PUTST0
+ MOV AL,','
+ISCOMP:
+ STOSB
+
+PUTST:
+ MOV AX,"TS"
+ STOSW
+ RET
+
+; output 8087 registers in the form st,st(n)
+PUTSTST0:
+ CALL PUTST
+ MOV AL,','
+ STOSB
+
+PUTST0:
+ CALL PUTST
+ MOV AL,"("
+ STOSB
+ MOV AL,[REGMEM]
+ ADD AL,"0"
+ STOSB
+ MOV AL,")"
+ STOSB
+ RET
+
+; output an 8087 mnemonic
+PUTMN:
+ MOV SI,OFFSET DG:M8087_TAB
+ MOV CL,AL
+ AND CL,00000111B
+ JMP SHORT MOVBYT
+
+; output either 'FI' or 'F' for first byte of opcode
+PUTFI:
+ MOV SI,OFFSET DG:FI_TAB
+ JMP SHORT PUTFI2
+
+; output size (dword, tbyte, etc.)
+PUTSIZE:
+ MOV SI,OFFSET DG:SIZE_TAB
+PUTFI2:
+ CMP BYTE PTR [MODE],11B ; check if 8087 register
+ JNZ PUTFI3
+ AND AL,111000B ; LOOK FOR INVALID FORM OF 0DAH OPERANDS
+ CMP AL,010000B
+ JZ ESC0PJ
+ MOV AL,DL
+ CMP AL,110011B ; FCOMPP
+ JNZ GOFI
+ CMP BYTE PTR [REGMEM],1
+ JZ GOFI
+ESC0PJ:
+ jmp short ESC0P ; we could've reached without a
+; ; double branch here, but we needed
+; ; a bridge for ESC0PJ
+GOFI:
+ XOR CL,CL
+ JMP SHORT MOVBYT
+
+; Look for qword
+PUTFI3:
+ CMP AL,111101B
+ JZ GOTQU
+ CMP AL,111111B
+ JNZ NOTQU
+GOTQU:
+ MOV CL,2
+ JMP SHORT MOVBYT
+
+; look for tbyte
+NOTQU:
+ CMP AL,011101B
+ JZ GOTTB
+ CMP AL,111100B
+ JZ GOTTB
+ CMP AL,111110B
+ JZ GOTTB
+ CMP AL,011111B
+ JNZ NOTTB
+GOTTB:
+ MOV CL,5
+ JMP SHORT MOVBYT
+
+NOTTB:
+ MOV CL,4
+ SHR AL,CL
+ MOV CL,AL
+; SI POINTS TO A TABLE OF TEXT SEPARATED BY "$"
+; CL = WHICH ELEMENT IN THE TABLE YOU WISH TO COPY TO [DI]
+MOVBYT:
+ PUSH AX
+ INC CL
+MOVBYT1:
+ DEC CL
+ JZ MOVBYT3
+MOVBYT2:
+ LODSB
+ CMP AL,"$"
+ JZ MOVBYT1
+ JMP MOVBYT2
+
+MOVBYT3:
+ LODSB
+ CMP AL,'$'
+ JZ MOVBYT5
+ CMP AL,'@' ; THIS MEANS RESVERED OP-CODE
+ JNZ MOVBYT4
+ POP AX
+ JMP SHORT ESC0P ; GO DO AN ESCAPE COMMAND
+
+MOVBYT4:
+ STOSB
+ JMP MOVBYT3
+
+MOVBYT5:
+ POP AX
+ RET
+
+PUTOP:
+ AND AL,111B
+ MOV CL,AL
+ CALL MOVBYT
+ MOV AL,9
+ STOSB
+ MOV AL,DL
+ RET
+
+GET64F:
+ CALL GET64
+ MOV AL,"F"
+ STOSB
+ CMP BYTE PTR [MODE],3
+ MOV AL,DL
+ RET
+
+GET64:
+ AND AL,7
+ MOV DL,AL
+ CALL GETMODE
+ SHL DL,1
+ SHL DL,1
+ SHL DL,1
+ OR AL,DL
+ MOV DL,AL ; SAVE RESULT
+ RET
+
+ESC0P:
+ POP DI ; CLEAN UP STACK
+ESC0:
+ MOV WORD PTR [OPCODE],OFFSET DG:ESCMN
+ MOV AL,DL
+ MOV DI,OFFSET DG:OPBUF
+ JMP SHORT ESC1
+
+ESCP:
+ CALL GET64
+ESC1:
+ CALL SAVHEX
+ CMP BYTE PTR [MODE],3
+ JZ SHRTESC
+ MOV BYTE PTR [AWORD],1
+ JMP MEMOP2
+
+SHRTESC:
+ MOV AL,","
+ STOSB
+ MOV AL,[REGMEM]
+ AND AL,7
+ JMP SAVREG
+
+INVARW:
+ CALL PUTAX
+ JMP SHORT INVAR
+
+INVARB:
+ CALL PUTAL
+INVAR:
+ MOV AL,','
+ STOSB
+ JMP short PUTDX
+
+INFIXW:
+ CALL PUTAX
+ JMP SHORT INFIX
+
+INFIXB:
+ CALL PUTAL
+INFIX:
+ MOV AL,','
+ STOSB
+ JMP SAV8
+
+ STOSW ;IS THIS DEAD CODE? EMK
+ RET
+
+OUTVARB:
+ MOV BX,"LA"
+ JMP SHORT OUTVAR
+
+OUTVARW:
+ MOV BX,"XA"
+OUTVAR:
+ CALL PUTDX
+OUTFV:
+ MOV AL,','
+ STOSB
+ MOV AX,BX
+ STOSW
+ RET
+
+OUTFIXB:
+ MOV BX,"LA"
+ JMP SHORT OUTFIX
+
+OUTFIXW:
+ MOV BX,"XA"
+OUTFIX:
+ CALL SAV8
+ JMP OUTFV
+
+PUTAL:
+ MOV AX,"A"+4C00H ; "AL"
+ JMP SHORT PUTX
+
+PUTAX:
+ MOV AX,"A"+5800H ; "AX"
+ JMP SHORT PUTX
+
+PUTDX:
+ MOV AX,"D"+5800H ; "DX"
+PUTX:
+ STOSW
+ RET
+
+SHFT:
+ MOV BX,OFFSET DG:SHFTAB
+ CALL GETMNE
+TESTREG:
+ CMP BYTE PTR [MODE],3
+ JZ NOFLG
+ MOV SI,OFFSET DG:SIZE_TAB
+ MOV CL,3
+ TEST BYTE PTR [AWORD],-1
+ JNZ TEST_1
+ INC CL
+TEST_1:
+ CALL MOVBYT
+NOFLG:
+ JMP ADDRMOD
+
+SHIFTV:
+ CALL SHFT
+ MOV AL,","
+ STOSB
+ MOV WORD PTR [DI],"C"+4C00H ; "CL"
+ ADD DI,2
+ RET
+
+SHIFT:
+ CALL SHFT
+ MOV AX,"1,"
+ STOSW
+ RET
+
+GETMNE:
+ CALL GETMODE
+ MOV DL,AL
+ CBW
+ SHL AX,1
+ ADD BX,AX
+ MOV AX,[BX]
+ MOV [OPCODE],AX
+ MOV AL,DL
+ RET
+
+GRP1:
+ MOV BX,OFFSET DG:GRP1TAB
+ CALL GETMNE
+ OR AL,AL
+ JZ FINIMMJ
+ JMP TESTREG
+FINIMMJ:
+ JMP FINIMM
+
+GRP2:
+ MOV BX,OFFSET DG:GRP2TAB
+ CALL GETMNE
+ CMP AL,2
+ JB TESTREG
+ CMP AL,6
+ JAE INDIRECT
+ TEST AL,1
+ JZ INDIRECT
+ MOV AX,"AF" ; "FAR"
+ STOSW
+ MOV AX," R"
+ STOSW
+INDIRECT:
+ JMP ADDRMOD
+
+CODE ENDS
+ END UNASSEM
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debug.asm b/private/mvdm/dos/v86/cmd/debug/debug.asm
new file mode 100644
index 000000000..096b6ccda
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debug.asm
@@ -0,0 +1,1340 @@
+ PAGE 60,132 ;
+ TITLE DEBUG.ASM - DEBUGger for MS-DOS
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DEBUG.ASM
+;
+; DESCRIPTIVE NAME: DEBUGGING TOOL
+;
+; FUNCTION: PROVIDES USERS WITH A TOOL FOR DEBUGGING PROGRAMS.
+;
+; ENTRY POINT: START
+;
+; INPUT: DOS COMMAND LINE
+; DEBUG COMMANDS
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: DEBCOM1 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBCOM2 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBCOM3 - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBUASM - CONTAINS ROUTINES CALLED BY DEBUG
+; DEBMES - CONTAINS MESSAGE RETRIEVER ROUTINES
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT DBCS HANDLING DMS:6/17/87
+; - IMPLEMENT DBCS HANDLING bgb:5/03/88 ;an001;bgb
+; - IMPLEMENT MESSAGE RETRIEVER DMS:6/17/87
+; - > 32 MB SUPPORT DMS:6/17/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+; MICROSOFT REVISION HISTORY:
+;
+; Modified 5/4/82 by AaronR to do all I/O direct to devices
+; Runs on MS-DOS 1.28 and above
+;
+; REV 1.20
+; Tab expansion
+; New device interface (1.29 and above)
+; REV 2.0
+; line by line assembler added by C. P.
+; REV 2.1
+; Uses EXEC system call
+; REV 2.2
+; Ztrace mode by zibo.
+; Fix dump display to indent properly
+; Parity nonsense by zibo
+;
+; REV 2.3 NP
+; Use Printf for all standard output.
+; Change to EXE file
+; REV 2.4 ARR
+; Bug fixes. TEST, XCHG instructions reg order reversed.
+; Single step, break point interrupts saved and restored.
+; Access denied given on W to read only file.
+;======================= END OF SPECIFICATIONS ===========================
+; Change Log:
+;
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 04/01/90 DIC C01 This information on the drive containing the file is
+; used within DEBCOM2.ASM for determining if enough
+; memory is available to write a file out to disk.
+; (Compaq STR #1889) (MS Bug #774)
+;
+; 09/xx/90 CAS Fixed divide overflow problem when trying to
+; write ridiculously large files
+;
+; 10/18/90 CAS Changed "POP CS" to DB 0F
+; Added code to override 8086/8088 Trace PIC mask
+; stuff on later CPUs to avoid crashing after
+; tracing through divide overflows.
+; Eliminated most Long Branch warnings
+;
+;=============================================================================
+
+.XLIST
+.XCREF
+ include version.inc ; cas -- missing equates
+ include syscall.inc ; cas -- missing equates
+ INCLUDE DOSSYM.INC ; ALSO VERSION NUMBER
+.CREF
+.LIST
+ INCLUDE debug.inc
+ IF SYSVER
+; Structure for system call 72
+SYSINITVAR STRUC
+DPBHEAD DD ? ; Pointer to head of DPB-FAT list
+SFT_ADDR DD ? ; Pointer to first FCB table
+; The following address points to the CLOCK device
+BCLOCK DD ?
+; The following address is used by DISKSTATCHK it is always
+; points to the console input device header
+BCON DD ? ; Console device entry points
+MAXSEC DW 0 ; Maximum allowed sector size
+BUFFHEAD DD ?
+CDS DD ?
+SFTFCB DD ?
+KEEP DW ?
+NUMIO DB 0 ; Number of disk tables
+NCDS DB ?
+DEVHEAD DD ?
+SYSINITVAR ENDS
+
+ ENDIF
+
+
+;======================= macro equates ===================================
+
+dbcs_delim equ 81h ;an000;delimits dbcs char
+asian_blk equ 40h ;an000;asian blank
+amer_blk equ 20h ;an000;american blank
+quote_char equ 22h ;an000;quote delim "
+
+;======================= end macro equates ===============================
+
+
+;This segment must be the first loaded since we are using it to make
+;a CREATE_PROCESS_DATA_BLOCK system call a la 1.0 and .COM files.
+;For this system call CS must point to the Program Prefix Header, so
+;by setting up a seperate segment just after the header we can issue
+;an INT 21H via a long call. So don't move this guy around!
+
+A_CREATE_BLOCK SEGMENT
+
+ PUBLIC CREATE_CALL
+
+;The other arguements to this system call have been set up
+;by the caller.
+
+CREATE_CALL PROC FAR
+ MOV AH,CREATE_PROCESS_DATA_BLOCK
+ INT 21H
+ RET
+
+CREATE_CALL ENDP
+
+A_CREATE_BLOCK ENDS
+
+
+CODE SEGMENT PUBLIC
+CODE ENDS
+
+CONST SEGMENT PUBLIC
+CONST ENDS
+
+CSTACK SEGMENT STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC
+DATA ENDS
+
+DG GROUP CODE,CONST,CSTACK,DATA
+
+CONST SEGMENT PUBLIC BYTE
+ EXTRN BADVER:BYTE,ENDMES_PTR:BYTE,CRLF_PTR:BYTE
+ IF IBMJAPAN
+ EXTRN PARITYMES_PTR:BYTE
+ ENDIF
+ EXTRN PROMPT_PTR:BYTE,ADD_PTR:BYTE,HEX_PTR:BYTE
+ EXTRN USER_PROC_PDB:WORD,CSSAVE:WORD,DSSAVE:WORD
+ EXTRN SPSAVE:WORD,IPSAVE:WORD,LINEBUF:BYTE,QFLAG:BYTE
+ EXTRN NEWEXEC:BYTE,HEADSAVE:WORD,LBUFSIZ:BYTE,BACMES_PTR:WORD
+ EXTRN QMES_1:BYTE
+ EXTRN QMES_2:BYTE
+ EXTRN QMES_3:BYTE
+ EXTRN QMES_4:BYTE
+ EXTRN QMES_5:BYTE
+ EXTRN HELP_TEXT1:BYTE
+ EXTRN HELP_TEXT2:BYTE
+ EXTRN HELP_TEXT3:BYTE
+ EXTRN HELP_TEXT4:BYTE
+ EXTRN HELP_TEXT5:BYTE
+ EXTRN HELP_TEXT6:BYTE
+
+ IF IBMVER
+ EXTRN DSIZ:BYTE,NOREGL:BYTE,DISPB:WORD
+ ENDIF
+
+ IF SYSVER
+ EXTRN CONFCB:BYTE,POUT:DWORD,COUT:DWORD,CIN:DWORD,IOBUFF:BYTE
+ EXTRN IOADDR:DWORD,IOCALL:BYTE,IOCOM:BYTE,IOSTAT:WORD,IOCNT:WORD
+ EXTRN IOSEG:WORD,COLPOS:BYTE,BADDEV_PTR:BYTE,BADLSTMES_PTR:BYTE
+ EXTRN LBUFFCNT:BYTE,PFLAG:BYTE
+ ENDIF
+
+ EXTRN NAMESPEC:BYTE
+ EXTRN DriveOfFile:WORD ; save default drive of file ;C01
+
+CONST ENDS
+
+CSTACK SEGMENT STACK
+ DB (362 - 80H) + 80H DUP(?) ; (362 - 80H) == IBM'S ROM REQUIREMENTS
+ ; (NEW - OLD) == SIZE TO GROW STACK
+CSTACK ENDS
+
+DATA SEGMENT PUBLIC BYTE
+ EXTRN ARG_BUF:BYTE,ADD_ARG:WORD,SUB_ARG:WORD,HEX_ARG1:WORD
+ EXTRN HEX_ARG2:WORD,STACK:BYTE, PREV24:DWORD, FIN24:BYTE
+ EXTRN PARSERR:BYTE,DATAEND:WORD,PARITYFLAG:BYTE,DISADD:BYTE
+ EXTRN ASMADD:BYTE,DEFDUMP:BYTE,BYTEBUF:BYTE,BEGSEG:WORD
+ EXTRN BPINTSAV:DWORD,SSINTSAV:DWORD ;ARR 2.4
+ EXTRN CREATE_LONG:DWORD
+
+ extrn lbtbl:dword ;an000;lead byte table pointer
+
+DATA ENDS
+
+ EXTRN PRINTF:NEAR ;ac000;changed to NEAR call
+
+CODE SEGMENT PUBLIC
+ ASSUME CS:DG,DS:NOTHING,ES:NOTHING,SS:CSTACK
+
+ PUBLIC RESTART
+ PUBLIC STD_PRINTF,PRINTF_CRLF
+ PUBLIC HEX_ADDRESS_ONLY,HEX_ADDRESS_STR
+ PUBLIC RESTART,SET_TERMINATE_VECTOR,DABORT,TERMINATE,COMMAND
+ PUBLIC FIND_DEBUG,CRLF,BLANK,TAB,INBUF,SCANB,SCANP
+ PUBLIC HEX,OUTSI,OUTDI,DIGIT,BACKUP,RBUFIN
+ public test_lead ;an001;bgb
+ public test1 ;an001;bgb
+
+ IF SYSVER
+; PUBLIC SETUDEV,DEVIOCALL ; kwc 12/10/86
+ PUBLIC SETUDEV ; kwc 12/10/86
+ EXTRN DISPREG:NEAR,INPT:NEAR
+ ENDIF
+
+ EXTRN PERR:NEAR,COMPARE:NEAR,DUMP:NEAR,ENTERDATA:NEAR,FILL:NEAR
+ EXTRN GO:NEAR,INPUT:NEAR,LOAD:NEAR,MOVE:NEAR,NAMED:NEAR
+ EXTRN REG:NEAR,SEARCH:NEAR,DWRITE:NEAR,UNASSEM:NEAR,ASSEM:NEAR
+ EXTRN OUTPUT:NEAR,ZTRACE:NEAR,TRACE:NEAR,GETHEX:NEAR,GETEOL:NEAR
+ EXTRN PREPNAME:NEAR,DEFIO:NEAR,SKIP_FILE:NEAR,DEBUG_FOUND:NEAR
+ EXTRN TRAPPARITY:NEAR,RELEASEPARITY:NEAR
+ extrn pre_load_message:near ;an000;load messages
+ extrn debems:near ;an000;ems support
+ifdef JAPAN
+ extrn SETDUMPMODE:near
+endif
+
+
+ DB 100H DUP (?)
+
+START:
+ JMP SHORT DSTRT
+
+HEADER DB "Vers 2.40"
+
+DSTRT:
+;=========================================================================
+; invoke PRE_LOAD_MESSAGE here. If the messages were not loaded we will
+; exit with an appropriate error message.
+;
+; Date : 6/14/87
+;=========================================================================
+
+ push ds ;an000;save regs
+ push es ;an000;save resg
+
+ push cs ;an000;transfer cs
+ pop ds ;an000; to ds
+
+ push cs ;an000;transfer cs
+ pop es ;an000; to es
+ assume ds:dg,es:dg ;an000;assume them
+ call PRE_LOAD_MESSAGE ;an000;invoke SYSLOADMSG
+; $if c ;an000;if the load was unsuccessful
+ JNC $$IF1
+ mov ax,(exit shl 8) ;an000;exit EDLIN. PRE_LOAD_MESSAGE
+ ; has already said why
+ int 21h ;an000;exit
+; $endif ;an000;
+$$IF1:
+
+ pop es ;an000;restore regs.
+ pop ds ;an000;
+ assume ds:nothing,es:nothing ;an000;back to original
+
+ MOV AX,(GET_INTERRUPT_VECTOR SHL 8) OR VEC_BREAKPOINT ;get original contents
+ INT 21H ; of the BREAKPOINT vector
+
+ MOV WORD PTR [BPINTSAV],BX ; and save that vector for later
+ MOV WORD PTR [BPINTSAV+WORD],ES ; restoration
+
+ MOV AX,(GET_INTERRUPT_VECTOR SHL 8) OR VEC_SING_STEP ;get original contents
+ INT 21H ; of the SINGLE STEP vector
+
+ MOV WORD PTR [SSINTSAV],BX ; and save that vector for later
+ MOV WORD PTR [SSINTSAV+WORD],ES ; restoration
+
+ MOV BEGSEG,DS ; save beginning DS
+ PUSH CS ; repair damaged ES to be
+ POP ES ; back to just like CS
+ XOR SI,SI ; set source and destination
+ XOR DI,DI ; indices both to zero
+ MOV CX,256 ; set count to size of PSP
+ REP MOVSB ; move to es:[di] from ds:[si]
+ PUSH CS ; set up DS to be just like CS
+ POP DS ; to match .COM rules of addressability
+ ASSUME DS:DG,ES:DG ; like CS, also have DS and DS as bases
+
+ if IBMVER
+
+; on IBM compatibles, we need to know whether we have a pre-286, so
+; we can invoke special PIC mask code during tracing.
+
+ extrn cpu_not_8088:byte
+ pushf ; save flags
+ pushf ; copy to ax
+ pop ax
+ and ax,0fffh ; try to reset first 4 to zero
+ push ax
+ popf
+ pushf ; write it to flags and get it back
+ pop ax ; and back into ax
+ cmp ah,0f0h ; if all 4 are ones, then 8088/8086
+; ; otherwise, set carry (later cpu)
+ sbb al,al ; propagate carry across al
+ mov cpu_not_8088,al ; and save it for future reference
+ popf ; restore flags
+ endif
+
+ CALL TRAPPARITY ; scarf up those parity guys
+ MOV AH,GET_CURRENT_PDB ;(undocumented function call - 51h)
+ INT 21H
+
+ MOV [USER_PROC_PDB],BX ; Initially set to DEBUG
+
+ IF SYSVER
+ MOV [IOSEG],CS
+ ENDIF
+
+ MOV [PARSERR],0
+
+
+ IF SYSVER
+ MOV AH,GET_IN_VARS ;(undocumented function call - 52h)
+ INT 21H
+
+ LDS SI,ES:[BX.BCON] ; get system console device
+ ASSUME DS:NOTHING
+
+ MOV WORD PTR CS:[CIN+WORD],DS ;save vector to console input device
+ MOV WORD PTR CS:[CIN],SI
+ MOV WORD PTR CS:[COUT+WORD],DS ;save vector to console output device
+ MOV WORD PTR CS:[COUT],SI
+ PUSH CS ; restore DS to be
+ POP DS ; just like CS, as before
+ ASSUME DS:DG
+
+ MOV DX,OFFSET DG:CONFCB ; get system printer device
+ MOV AH,FCB_OPEN ; open system printer "PRN"
+ INT 21H
+
+ OR AL,AL ; open ok?
+ JZ GOTLIST ; yes, it was there
+
+ MOV DX,OFFSET DG:BADLSTMES_ptr ; no list file found...
+ CALL STD_PRINTF ; tell user
+
+ CALL RBUFIN ; ask for a new one
+
+ CALL CRLF
+
+ MOV CL,[LBUFFCNT]
+ OR CL,CL
+ JZ NOLIST1 ; User didn't specify one
+
+ XOR CH,CH
+ MOV DI,OFFSET DG:(CONFCB + BYTE)
+ MOV SI,OFFSET DG:LINEBUF ; get one from input line
+ REP MOVSB
+ MOV DX,OFFSET DG:CONFCB
+ MOV AH,FCB_OPEN ; try to open it
+ INT 21H
+
+ OR AL,AL
+ JZ GOTLIST ; yep, use it...
+
+ MOV DX,OFFSET DG:BADDEV_Ptr ; complain again
+ CALL STD_PRINTF
+NOLIST1: ; kwc 12/10/86
+ MOV WORD PTR [POUT+WORD],CS ; use null device for printer
+ MOV WORD PTR [POUT],OFFSET DG:LONGRET
+ JMP NOLIST
+
+XXX PROC FAR
+LONGRET:
+ RET
+XXX ENDP
+ ENDIF
+
+GOTLIST:
+;DX = OFFSET OF 'CONFCB', WHICH HAS JUST BEEN OPENED OK
+ IF SYSVER
+ MOV SI,DX
+; LDS SI,DWORD PTR DS:[SI.FCB_FIRCLUS] ; KWC 12/10/86
+ LDS SI,DWORD PTR DS:[SI.FCB_NSLD_DRVPTR] ; KWC 12/10/86
+ ASSUME DS:NOTHING
+
+ MOV WORD PTR CS:[POUT+WORD],DS
+ MOV WORD PTR CS:[POUT],SI
+ ENDIF
+NOLIST:
+ MOV AX,CS ;restore the DS and ES segregs
+ MOV DS,AX ; to become once again just like CS
+ MOV ES,AX
+ ASSUME DS:DG,ES:DG
+
+; Code to print header
+; MOV DX,OFFSET DG:HEADER_PTR
+; CALL STD_PRINTF
+
+ CALL SET_TERMINATE_VECTOR
+
+; Save the current INT 24 vector. We will need this to link to the previous
+; handler for handling of int 24 output.
+ PUSH ES ; save it, about to clobber it...
+ MOV AX,(GET_INTERRUPT_VECTOR SHL 8) + VEC_CRIT_ERR ; get original contents
+ INT 21H ; of the int 24h vector
+
+ MOV WORD PTR PREV24,BX ; remember what int 24h used to
+ MOV WORD PTR PREV24+WORD,ES ; point to
+ POP ES ; restore ES to be like CS and DS
+
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) + VEC_CRIT_ERR ; change int 24h to
+ MOV DX,OFFSET DG:MY24 ; point to my own int 24h handler
+ INT 21H
+
+ IF SETCNTC
+ MOV AL,VEC_CTRL_BREAK ; Set vector 23H
+ MOV DX,OFFSET DG:DABORT
+ INT 21H
+ ENDIF
+
+ MOV DX,CS ;get para of where this pgm starts
+ MOV AX,OFFSET DG:DATAEND+15 ;get offset of end of this program
+ MOV CL,4 ; (plus 15 padding for rounding)
+ SHR AX,CL ; adjusted to number of paragraphs
+ ADD DX,AX ;get para of where this pgm ends
+ MOV AX,CS
+ SUB AX,BEGSEG ; add in size of printf
+ ADD DX,AX ; create program segment here
+ CALL [CREATE_LONG] ; and call special routine
+
+ MOV AX,DX
+; Initialize the segments
+ MOV DI,OFFSET DG:DSSAVE
+ CLD
+ STOSW
+ STOSW
+ STOSW
+ STOSW
+ MOV WORD PTR [DISADD+WORD],AX
+ MOV WORD PTR [ASMADD+WORD],AX
+ MOV WORD PTR [DEFDUMP+WORD],AX
+
+ MOV AX,100H
+ MOV WORD PTR[DISADD],AX
+ MOV WORD PTR[ASMADD],AX
+ MOV WORD PTR [DEFDUMP],AX
+
+ MOV DS,DX
+ MOV ES,DX
+ ASSUME DS:NOTHING,ES:NOTHING
+
+ MOV DX,80H
+ MOV AH,SET_DMA
+ INT 21H ; Set default DMA address to 80H
+; Set up initial stack. We already have a 'good' stack set up already. DS:6
+; has the number of bytes remaining in the segment. We should take this
+; value, add 100h and use it as the Stack pointer.
+ MOV AX,WORD PTR DS:[6] ; get bytes remaining
+ MOV BX,AX
+ ADD AX,100h
+
+; MOV BX,AX
+; CMP AX,0FFF0H
+; PUSH CS
+; POP DS
+; JAE SAVSTK
+; MOV AX,WORD PTR DS:[6]
+; PUSH BX
+; MOV BX,OFFSET DG:DATAEND + 15
+; AND BX,0FFF0H ; Size of DEBUG in bytes (rounded up to PARA)
+; SUB AX,BX
+; POP BX
+;SAVSTK:
+ PUSH CS
+ POP DS
+ ASSUME DS:DG
+ PUSH BX ; bx is no. bytes remaining from PSP+6
+ DEC AX ; ax was no. bytes remaining +100h
+ DEC AX ; back up one word from end of new stack
+ MOV BX,AX ; set base to point to last word in new stack
+ MOV WORD PTR ES:[BX],0 ; set final word in new stack to zero
+ POP BX ; back to beginning of new stack area
+ MOV SPSAVE,AX ; remember where new stack is
+ DEC AH
+ MOV ES:WORD PTR [6],AX ; change PSP to show usage of
+ SUB BX,AX ; new stack area
+ MOV CL,4
+ SHR BX,CL
+ ADD ES:WORD PTR [8],BX
+
+ IF IBMVER
+; Get screen size and initialize display related variables
+ MOV AH,15 ;function = "request current video state"
+ INT 10H ;set al=screen mode
+ ; ah=no. char cols on screen
+ ; bh=current active display page
+ CMP AH,40 ;is screen in 40 col mode?
+ JNZ PARSCHK ; no, skip
+ ; yes, 40 col, continue
+ ;next fields defined in 'debconst.asm'
+ MOV BYTE PTR DSIZ,7 ; originally assembled as 0fh
+ MOV BYTE PTR NOREGL,4 ; originally assembled as 8
+ MOV DISPB,64 ; originally assembled as 128
+ ENDIF
+
+PARSCHK:
+
+
+ call DEBUG_LEAD_BYTE ;an000;build the dbcs env. table
+ ; of valid dbcs lead bytes
+
+;=========================================================================
+; prep_command_line requires the use of ds:si. ds is left intact for
+; the call. si is initialized to point to the command line input buffer.
+; ds and si are saved since we stomp all over them in prep_command_line.
+;=========================================================================
+
+ push si ;an000;save si
+
+ mov si,81h ;an000;point to command line
+ call prep_command_line ;an000;invoke command line conversion
+
+ pop si ;an000;restore si
+
+;=========================================================================
+; we have prepped the command line for dbcs. we can now enter the old
+; routines.
+;=========================================================================
+
+; Copy rest of command line to test program's parameter area
+ MOV DI,FCB ;es[di]=to be filled with unopened FCB
+ MOV SI,80H ;ds[si]=command line to parse
+
+; see if /? is the first argument in the command tail
+NCHAR: INC SI
+ CMP BYTE PTR [SI], CHAR_BLANK
+ JE NCHAR
+ CMP BYTE PTR [SI], FOR_SLASH ; are we looking at an '/'
+ JNE NOQST ; if not, get out
+ CMP BYTE PTR [SI+1], Q_MARK ; else is the next char a '?'
+ JNE NOQST
+
+;print out /? help text
+ MOV DX, OFFSET DG:QMES_1
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:QMES_2
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:QMES_3
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:QMES_4
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:QMES_5
+ CALL STD_PRINTF
+ JMP QUITING
+
+NOQST: MOV SI, 81H ; restore SI to what it should be
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR SET_DRIVEID_OPTION
+ ;func=29H, option al=1, which
+ ; says, drive id byte in fcb is set
+ ; only if drive specified in command
+ ; line being parsed.
+ INT 21H ;parse filename from command to fcb
+ ; ds:si=points to first char AFTER parsed filename
+ ; es:di=points to first byte of formatted FCB
+
+ mov di,FCB ; get addr of FCB1 ;C01
+ mov bx,[di] ; get default drive of file ;C01
+ xor bh,bh ; zero out high byte ;C01
+ mov DriveOfFile,bx ; save drive letter ;C01
+
+ CALL SKIP_FILE ; Make sure si points to delimiter
+test1: ;for testing only - u can remove this
+ CALL PREPNAME
+
+ PUSH CS ;restore ES to point to the
+ POP ES ; common group
+FILECHK:
+ MOV DI,80H ;point to byte in PSP defining parm length
+ CMP BYTE PTR ES:[DI],0 ; ANY STUFF FOUND?
+ JZ COMMAND ; no parms, skip
+ ; yes parms, continue
+FILOOP:
+ INC DI ;set index to first/next char in parm text
+ CMP BYTE PTR ES:[DI],CR ; carriage return? (at end of parms)
+ JZ COMMAND ; yes, at end of parms
+ ; no, not at end of parms yet, continue
+ CMP BYTE PTR ES:[DI],CHAR_BLANK ; is this parm text char a blank?
+ JZ FILOOP ; yes, a blank, skip
+ ; no, not a blank, continue
+ CMP BYTE PTR ES:[DI],CHAR_TAB ; is this parm text char a tab?
+ JZ FILOOP ; yes, a tab, skip
+ ; no, not a tab, continue
+ OR [NAMESPEC],1 ; set flag to indicate
+ ; we have a specified file
+ ; (this could be set by "N" command also)
+ CALL DEFIO ; READ in the specified file
+
+ PUSH CS ;restore DS to point to the
+ POP DS ; common group
+
+ ;perform self-relocation on some internal vectors:
+ MOV AX,CSSAVE ; pick up the seg id to go to vectors
+ MOV WORD PTR DISADD+WORD,AX ; shove it into the segid portion
+ MOV WORD PTR ASMADD+WORD,AX ; of these two vectors
+ MOV AX,IPSAVE ; pick up the offset to go to vectors
+ MOV WORD PTR DISADD,AX ; shove it into the offset portion
+ MOV WORD PTR ASMADD,AX ; of these two vectors
+COMMAND:
+ CLD
+ MOV AX,CS
+ MOV DS,AX
+ MOV ES,AX
+ cli ;disable before setting up the stack - EMK
+ MOV SS,AX ;now everything points to the same group
+ ASSUME SS:DG
+
+ MOV SP,OFFSET DG:STACK
+ STI ;re-enable
+ CMP [PARITYFLAG],0 ; did we detect a parity error?
+ JZ GOPROMPT ; no, go prompt
+ ; yes, parity error, continue
+ MOV [PARITYFLAG],0 ; reset flag
+ IF IBMJAPAN
+ MOV DX,OFFSET DG:PARITYMES_PTR
+ CALL STD_PRINTF ;display msg about parity error
+ ENDIF
+GOPROMPT:
+ MOV DX,OFFSET DG:PROMPT_PTR ;display the user prompt request
+ CALL STD_PRINTF
+
+ CALL INBUF ; Get command line
+; From now and throughout command line processing, DI points
+; to next character in command line to be processed.
+ CALL SCANB ; Scan off leading blanks
+
+ JZ COMMAND ; if zero, Null command, go get another
+ ; nonzero, got something in response
+ LODSB ; AL=first non-blank character
+; Prepare command letter for table lookup
+; converts the first non-blank (assumed to be the command letter)
+; to in index in the "comtab" array.
+ SUB AL,'?' ; Low end range check
+ JB ERR1
+
+ CMP AL,'Z'-'?' ; Upper end range check
+ JA ERR1
+
+ SHL AL,1 ; Times two
+ CBW ; Now a 16-bit quantity
+ XCHG BX,AX ; In BX we can address with it
+ CALL CS:[BX+COMTAB] ; Execute command
+
+ JMP SHORT COMMAND ; Get next command
+ERR1:
+ JMP PERR
+
+SET_TERMINATE_VECTOR:
+ PUSH DS
+ PUSH CS
+ POP DS
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR VEC_TERM_ADDR ; Set vector 22H
+ MOV DX,OFFSET DG:TERMINATE
+ INT 21H
+
+ POP DS
+ RET
+
+RESTORE_DEB_VECT:
+ PUSH DS
+ PUSH DX
+ PUSH AX
+ LDS DX,CS:[BPINTSAV]
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR VEC_BREAKPOINT ;Vector 3
+ INT 21H
+
+ LDS DX,CS:[SSINTSAV]
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR VEC_SING_STEP ;Vector 1
+ INT 21H
+
+ POP AX
+ POP DX
+ POP DS
+ RET
+
+; Internal INT 24 handler. We allow our parent's handler to decide what to do
+; and how to prompt. When our parent returns, we note the return in AL. If
+; he said ABORT, we need to see if we are aborting ourselves. If so, we
+; cannot turn it into fail; we may get a cascade of errors due to the original
+; cause. Instead, we do the ol' disk-reset hack to clean up. This involves
+; issuing a disk-reset, ignoring all errors, and then returning to the caller.
+MY24:
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+; If we are already inside an INT 24, just ignore this error
+ TEST FIN24,-1
+ JZ DO24
+
+ MOV AL,0 ; signal ignore
+ IRET
+
+; Let the user decide what to do
+DO24:
+ PUSHF
+ CALL PREV24 ; simulate INT 24 to him
+
+ CMP AL,2 ; was it ABORT?
+ JNZ DOIRET ; no, let it happen
+
+ PUSH AX
+ PUSH BX
+ MOV AH,GET_CURRENT_PDB ; find out who's terminating
+ INT 21H
+
+ CMP BX,BEGSEG ; is it us?
+ POP BX
+ POP AX
+ JZ DORESET ; no, let it happen
+
+DOIRET:
+ IRET
+
+; We have been instructed to abort ourselves. Since we can't do this, we will
+; perform a disk reset to flush out all buffers and then ignore the errors we
+; get.
+DORESET:
+ MOV FIN24,-1 ; signal that we ignore errors
+ MOV AH,DISK_RESET
+ INT 21H ; clean out cache
+
+ MOV FIN24,0 ; reset flag
+ JMP COMMAND
+
+TERMINATE:
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ CMP QFLAG,0
+ JNZ QUITING
+
+ MOV AX,BEGSEG
+ MOV USER_PROC_PDB,AX
+ CMP NEWEXEC,0
+ JZ NORMTERM
+
+ MOV AX,CS
+ MOV DS,AX
+ ASSUME DS:DG
+ ;is CLI/STI needed here ? - emk
+ CLI
+ MOV SS,AX
+ ASSUME SS:DG
+
+ MOV SP,OFFSET DG:STACK
+ STI
+ MOV AX,HEADSAVE
+ JMP DEBUG_FOUND
+
+NORMTERM:
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ PUSH CS
+ POP DS
+ ASSUME DS:DG
+
+ MOV DX,OFFSET DG:ENDMES_PTR
+ JMP SHORT RESTART
+
+QUITING:
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ CALL RESTORE_DEB_VECT
+
+ MOV AX,(EXIT SHL 8)
+ INT 21H
+
+RESTART:
+ CALL STD_PRINTF
+DABORT:
+ MOV AX,CS
+ MOV DS,AX
+ ASSUME DS:DG
+
+ ;is CLI\STI needed here? - emk
+ CLI
+ MOV SS,AX
+ ASSUME SS:DG
+
+ MOV SP,OFFSET DG:STACK
+ STI
+;;;;;; CALL CRLF
+
+ JMP COMMAND
+
+ IF SYSVER
+SETUDEV:
+ MOV DI,OFFSET DG:CONFCB
+ MOV AX,(PARSE_FILE_DESCRIPTOR SHL 8) OR SET_DRIVEID_OPTION
+ INT 21H
+
+ CALL USERDEV
+
+ JMP DISPREG
+
+USERDEV:
+ MOV DX,OFFSET DG:CONFCB
+ MOV AH,FCB_OPEN
+ INT 21H
+
+ OR AL,AL
+ JNZ OPENERR
+
+ MOV SI,DX
+; TEST BYTE PTR [SI.FCB_DEVID],080H ; Device? ; KWC 12/10/86
+; JZ OPENERR ; NO ; KWC 12/10/86
+ MOV AL,BYTE PTR [SI.FCB_NSL_DRIVE] ; KWC 12/10/86
+ AND AL,NOT FCBMASK ; KWC 12/10/86
+ CMP AL,0C0H ; KWC 12/10/86
+ JNE OPENERR ; KWC 12/10/86
+ XOR AL,AL ; KWC 12/10/86
+
+; LDS SI,DWORD PTR [CONFCB.FCB_FIRCLUS] ; KWC 12/10/86
+ LDS SI,DWORD PTR [CONFCB.FCB_NSLD_DRVPTR] ; KWC 12/10/86
+ MOV WORD PTR CS:[CIN],SI
+ MOV WORD PTR CS:[CIN+WORD],DS
+
+ MOV WORD PTR CS:[COUT],SI
+ MOV WORD PTR CS:[COUT+WORD],DS
+ PUSH CS
+ POP DS
+ RET
+
+OPENERR:
+ MOV DX,OFFSET DG:BADDEV_PTR
+ CALL STD_PRINTF
+
+ RET
+ ENDIF
+; Get input line. Convert all characters NOT in quotes to upper case.
+INBUF:
+ CALL RBUFIN
+
+;=========================================================================
+; prep_command_line requires the use of ds:si. ds is left intact for
+; the call. si is initialized to point to the command line input buffer.
+; ds and si are saved since we stomp all over them in prep_command_line.
+;=========================================================================
+
+ push si ;an000;save si
+
+ mov si,offset dg:linebuf ;an000;point to command line
+ call prep_command_line ;an000;invoke command line conversion
+
+ pop si ;an000;restore si
+
+;=========================================================================
+; we have prepped the command line for dbcs. we can now enter the old
+; routines.
+;=========================================================================
+
+ MOV SI,OFFSET DG:LINEBUF
+ MOV DI,OFFSET DG:BYTEBUF
+
+CASECHK:
+
+ LODSB
+
+ call Test_Lead ;DBCS lead byte ;an000; dms;
+; $if c ;yes - ignore 2nd. byte ;an000; dms;
+ JNC $$IF3
+ stosb ;save the byte ;an000; dms;
+ lodsb ;pick up the 2nd. character ;an000; dms;
+ stosb ;save it also ;an000; dms;
+ jmp CaseChk ;read next character ;an000; dms;
+; $endif ; ;an000; dms;
+$$IF3:
+
+ CMP AL,LOWER_A
+ JB NOCONV
+
+ CMP AL,LOWER_Z
+ JA NOCONV
+
+ ADD AL,UPPER_A - LOWER_A ; Convert to upper case
+NOCONV:
+ STOSB
+ CMP AL,CR
+ JZ INDONE
+
+ CMP AL,DOUBLE_QUOTE
+ JZ QUOTSCAN
+
+ CMP AL,SINGLE_QUOTE
+ JNZ CASECHK
+
+QUOTSCAN:
+ MOV AH,AL
+KILLSTR:
+ LODSB
+ STOSB
+ CMP AL,CR ;CARRIAGE RETURN?
+ JZ INDONE
+
+ CMP AL,AH
+ JNZ KILLSTR
+
+ JMP SHORT CASECHK
+
+INDONE:
+ MOV SI,OFFSET DG:BYTEBUF
+ CALL CRLF
+
+ RET
+
+; Physical backspace - blank, backspace, blank
+BACKUP:
+ PUSH DX
+ MOV DX,OFFSET DG:BACMES_PTR
+ CALL STD_PRINTF
+
+ POP DX
+ RET
+
+; Scan for parameters of a command
+SCANP:
+ CALL SCANB ; Get first non-blank
+
+ CMP BYTE PTR [SI],CHAR_COMMA ; One comma between params OK
+ JNE EOLCHK ; If not comma, we found param
+
+ INC SI ; Skip over comma
+; Scan command line for next non-blank character
+SCANB:
+ PUSH AX
+SCANNEXT:
+ LODSB
+ CMP AL,CHAR_BLANK ;is this char a "blank"?
+ JZ SCANNEXT
+
+ CMP AL,CHAR_TAB ;is this char a "tab"?
+ JZ SCANNEXT
+
+ DEC SI ; Back to first non-blank
+ POP AX
+EOLCHK:
+ CMP BYTE PTR [SI],CR ;CARRIAGE RETURN
+ RET
+
+; Hex addition and subtraction
+HEXADD:
+ MOV CX,4
+ CALL GETHEX
+
+ MOV DI,DX
+ MOV CX,4
+ CALL GETHEX
+
+ CALL GETEOL
+
+ PUSH DX
+ ADD DX,DI
+ MOV [ADD_ARG],DX
+ POP DX
+ SUB DI,DX
+ MOV [SUB_ARG],DI
+ MOV DX,OFFSET DG:ADD_PTR
+ CALL PRINTF_CRLF
+
+ RET
+
+; Put the hex address in DS:SI in the argument list for a call to printf
+OUTSI:
+ MOV CS:[HEX_ARG1],DS
+ MOV CS:[HEX_ARG2],SI
+ RET
+
+;Put the hex address in ES:DI in the argument list for a call to printf
+OUTDI:
+ MOV [HEX_ARG1],ES
+ MOV [HEX_ARG2],DI
+ RET
+
+HEX_ADDRESS_ONLY:
+ MOV BYTE PTR [ARG_BUF],0
+HEX_ADDRESS_STR:
+ MOV DX,OFFSET DG:HEX_PTR
+STD_PRINTF:
+ PUSH DX
+ CALL PRINTF
+ POP DX ;ac000;restore dx
+
+ RET
+
+PRINTF_CRLF:
+ PUSH DX
+ CALL PRINTF
+ POP DX ;ac000;restore dx
+CRLF:
+ MOV DX,OFFSET DG:CRLF_PTR
+ PUSH DX
+ CALL PRINTF
+ POP DX ;ac000;restore dx
+
+ RET
+
+HEX:
+ MOV AH,AL ; Save for second digit
+ PUSH CX
+ MOV CL,4
+ SHR AL,CL
+ POP CX
+
+ CALL DIGIT ; First digit
+
+ MOV AL,AH ; Now do digit saved in AH
+DIGIT:
+ AND AL,0FH ; Mask to 4 bits
+ ADD AL,90H
+ DAA
+ ADC AL,40H
+ DAA
+ AND AL,7FH
+ STOSB
+ RET
+
+RBUFIN:
+ PUSH AX
+ PUSH DX
+ MOV AH,STD_CON_STRING_INPUT
+ MOV DX,OFFSET DG:LBUFSIZ
+ INT 21H
+
+ POP DX
+ POP AX
+ RET
+
+; Put one space in the printf output uffer
+BLANK:
+ MOV AL,CHAR_BLANK
+ STOSB
+ RET
+
+; Put CX spaces in the printf output buffer
+TAB:
+ JCXZ TAB_RET
+
+ CALL BLANK
+
+ LOOP TAB
+TAB_RET:
+ RET
+
+; Command Table. Command letter indexes into table to get
+; address of command. PERR prints error for no such command.
+
+COMTAB DW QUESTION_HELP ; ?
+ DW PERR ; @
+ DW ASSEM ; A
+ DW PERR ; B
+ DW COMPARE ; C
+ DW DUMP ; D
+ DW ENTERDATA ; E
+ DW FILL ; F
+ DW GO ; G
+ DW HEXADD ; H
+ DW INPUT ; I
+ DW PERR ; J
+ifdef JAPAN
+ DW SETDUMPMODE ; K
+else
+ DW PERR ; K
+endif
+ DW LOAD ; L
+ DW MOVE ; M
+ DW NAMED ; N
+ DW OUTPUT ; O
+ DW ZTRACE ; P
+ DW QUIT ; Q (QUIT)
+ DW REG ; R
+ DW SEARCH ; S
+ DW TRACE ; T
+ DW UNASSEM ; U
+ DW PERR ; V
+ DW DWRITE ; W
+ IF SYSVER
+ DW SETUDEV ; X
+ ELSE
+ DW DEBEMS
+ ENDIF
+ DW PERR ; Y
+ DW PERR ; Z
+
+QUESTION_HELP:
+ MOV DX, OFFSET DG:HELP_TEXT1
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:HELP_TEXT2
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:HELP_TEXT3
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:HELP_TEXT4
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:HELP_TEXT5
+ CALL STD_PRINTF
+ MOV DX, OFFSET DG:HELP_TEXT6
+ JMP STD_PRINTF
+
+
+QUIT:
+ INC BYTE PTR [QFLAG]
+ MOV BX,[USER_PROC_PDB]
+FIND_DEBUG:
+ IF NOT SYSVER
+ MOV AH,SET_CURRENT_PDB
+ INT 21H
+ ENDIF
+ CALL RELEASEPARITY ; let system do normal parity stuff
+
+ CALL RESTORE_DEB_VECT
+
+ MOV AX,(EXIT SHL 8)
+ INT 21H
+
+;======================= proc prep_command_line =========================
+; prep_command_line: This proc converts a Asian DBCS space delimiter (DB_SPACE)
+; into 2 20h values. In this way we can pass command
+; lines throughout DEBUG without major modification
+; to the source code. This proc is invoked anywhere
+; a command line is initially accessed. In the case
+; of DEBUG it is used in PARSCHK and INBUF.
+; Any quoted string, a string delimited by ("), will
+; be ignored.
+;
+; input: ds - segment of command line
+; si - offset of command line
+;
+; output: command line with Asian blanks (DB_SPACE) converted to
+; 2020h.
+;
+;=========================================================================
+
+prep_command_line proc near ;command line conversion
+ push ax ;save affected regs.
+ push bx ;
+ push si ;
+
+ mov bl,00h ;initialize flag
+ ;bl is used to signal
+ ; a quote delimiter
+; $DO ;do while not CR
+$$DO5:
+ mov al,[si] ;move char from cmd line for compare
+ cmp al,CR ;is it a CR ?
+; $LEAVE E ;if CR exit
+ JE $$EN5
+
+ cmp al,quote_char ;is it a quote ?
+; $IF Z ;if it is a quote
+ JNZ $$IF7
+ xor bl,01h ;set or reset the flag
+; $ENDIF
+$$IF7:
+
+ cmp bl,01h ;is 1st quote set ?
+; $IF NZ ;if not continue
+ JZ $$IF9
+ call TEST_LEAD ;test for dbcs lead byte
+; $IF C ;we have a lead byte
+ JNC $$IF10
+ cmp al,DB_SP_HI ;is it a dbcs char?
+; $IF Z ;if a dbcs char
+ JNZ $$IF11
+ mov al,[si+1] ;move next char al
+ cmp al,DB_SP_LO ;is it an Asian blank?
+; $IF Z ;if an Asian blank
+ JNZ $$IF12
+ mov al,amer_blk ;set up moves
+ mov [si],al ; to replace
+ mov [si+1],al ; Asian blank w/20h
+ inc si ;point to si+1
+; $ELSE ;if not an asian blank
+ JMP SHORT $$EN12
+$$IF12:
+ inc si ;point to dbcs char
+; $ENDIF ;
+$$EN12:
+; $ENDIF ;
+$$IF11:
+; $ENDIF ;end lead byte test
+$$IF10:
+; $ENDIF ;
+$$IF9:
+ inc si ;point to si+1
+; $ENDDO ;end do while
+ JMP SHORT $$DO5
+$$EN5:
+ pop si ;restore affected regs.
+ pop bx ;
+ pop ax ;
+ ret ;return to caller
+prep_command_line endp ;end proc
+
+
+;=========================================================================
+; DEBUG_LEAD_BYTE - This routine sets the lead-byte-pointers to point
+; to the dbcs environmental vector table of lead bytes.
+; This table will be used to determine if we have a
+; dbcs lead byte.
+;
+; Inputs - none
+;
+; Outputs- pointer to dbcs environmental vector table of lead bytes
+; LBTBL DD ?
+;
+; Date : 6/16/87
+;=========================================================================
+
+DEBUG_LEAD_BYTE proc near ;an000;get lead byte vector
+
+ push ds ;an000;save affected regs
+ push es ;an000;
+ push si ;an000;
+
+ mov ax,(ECS_call shl 8) or 00h ;an000;get dbcs env. vector
+ int 21h ;an000;invoke function
+
+ assume ds:nothing
+
+ mov word ptr cs:lbtbl[0],si ;an000;move offset of table
+ mov word ptr cs:lbtbl[2],ds ;an000;move segment of table
+
+ pop si ;an000;restore affected regs
+ pop es ;an000;
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+DEBUG_LEAD_BYTE endp ;an000;end proc
+
+;=========================================================================
+; TEST_LEAD - This routine will determine whether or not we have a valid
+; lead byte for a DBCS character.
+;
+; Inputs : AL - Holds the byte to compare. Passed by POP. ;an001;bgb
+;
+; Outputs: Carry set if lead byte
+; No carry if not lead byte
+;
+; Date : 6/16/87
+;=========================================================================
+
+TEST_LEAD proc near ;an000;check for dbcs lead byte
+
+ push ds ;an000;save affected regs
+ push si ;an000;
+ push ax ;an000;
+
+ xchg ah,al ;an000;ah used for compare
+ mov si,word ptr cs:lbtbl[2] ;an000;get segment of table
+ mov ds,si ;an000;
+ mov si,word ptr cs:lbtbl[0] ;an000;get offset of table
+
+ck_next:
+
+ lodsb ;an000;load al with byte table
+ or al,al ;an000;end of table?
+; $IF z ;an000;yes, end of table
+ jz lead_exit ; exit with clear carry
+ cmp al,ah ;an000;start > character?
+; $IF a ;an000;it is above
+ JNA $$IF21
+ clc ;an000;clear carry flag
+ jmp short lead_exit ;an000;exit with clear carry
+; $ELSE ;an000;
+ JMP SHORT $$EN21
+$$IF21:
+ lodsb ;an000;load al with byte table
+ cmp ah,al ;an000;character > end range
+; $IF a ;an000;not a lead
+ JNA $$IF23
+ jmp ck_next ;an000;check next range
+; $ELSE ;an000;lead byte found
+ JMP SHORT $$EN23
+$$IF23:
+ stc ;an000;set carry flag
+; $ENDIF ;an000;
+$$EN23:
+; $ENDIF ;an000;
+$$EN21:
+; $ENDIF ;an000;
+
+lead_exit: ;an000;exit from check
+
+ pop ax ;an000;
+ pop si ;an000;restore affected regs.
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+TEST_LEAD endp ;an000;end proc
+
+
+
+CODE ENDS
+ END START
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debug.inc b/private/mvdm/dos/v86/cmd/debug/debug.inc
new file mode 100644
index 000000000..427f47ae8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debug.inc
@@ -0,0 +1,179 @@
+;**************************************************************************
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;* *
+;* Change History: *
+;* *
+;* DATE ID MSFT# STR# Descripton *
+;* ------ ---- ----- ----- -------------------------------------------- *
+;* 05APR90 C05 990 ???? The XS command always returned a value of *
+;* (FF) for the total number of handles that *
+;* are supported. Now, for EMS V4.0, the *
+;* actual # of total handles will be displayed. *
+;* See also: DEBEMS.SAL module. *
+;**************************************************************************
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DEBEQU.SAL
+;
+; DESCRIPTIVE NAME: EQUATES NEEDED BY DEBUG
+;
+; FUNCTION: PROVIDES EQUATES NEEDED BY DEBUG
+;
+; ENTRY POINT: NA
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES: NA
+;
+; EXTERNAL REFERENCES: NA
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK DEBUG+DEBCOM1+DEBCOM2+DEBCOM3+DEBASM+DEBUASM+DEBERR+
+; DEBCONST+DEBDATA+DEBMES
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT DBCS HANDLING DMS:6/17/87
+; - IMPLEMENT MESSAGE RETRIEVER DMS:6/17/87
+; - > 32 MB SUPPORT DMS:6/17/87
+;
+; COPYRIGHT: "MS DOS DEBUG UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+
+; Version control switches moved to VERSION.INC
+
+ INCLUDE SYSVER.INC
+
+SETCNTC EQU TRUE ; If this is FALSE, DEBUG will not set
+ ; the Control C int vector
+
+PROMPT EQU "-"
+FCB EQU 5CH
+EXEFCB EQU FCB
+BUFLEN EQU 80 ; Maximum length of line input buffer
+BPMAX EQU 10 ; Maximum number of breakpoints
+BPLEN EQU 5*BPMAX ; Length of breakpoint table
+REGTABLEN EQU 14 ; Number of registers
+SEGDIF EQU 0
+BUFSIZ EQU 512
+
+BXREG EQU "B"+5800H ; "BX"
+BPREG EQU "B"+5000H ; "BP"
+SIREG EQU "S"+4900H ; "SI"
+DIREG EQU "D"+4900H ; "DI"
+COMMA EQU 2C00H
+OPBUFLEN EQU 35
+
+ IF IBMVER
+MASK_PORT EQU 21H ; 8259 interrupt control register
+INT_MASK EQU 11111111B ; Disable ALL interrupts
+ ENDIF
+
+CR EQU 13 ;CARRIAGE RETURN
+LF EQU 10 ;LINE FEED
+CHAR_TAB EQU 9 ;TAB
+CHAR_BACKSPACE EQU 8 ;BACKSPACE CHARACTER
+CHAR_EOF EQU 1AH ;END OF FILE CHARACTER
+CHAR_RUBOUT EQU 7FH ;RUBOUT CHARACTER
+
+CHAR_EQUAL EQU "=" ;CHARACTER EQUAL
+CHAR_MINUS EQU "-" ;MINUS CHARACTER
+CHAR_BLANK EQU " " ;BLANK CHARACTER
+DOUBLE_QUOTE EQU '"' ;DOUBLE QUOTE CHARACTER
+SINGLE_QUOTE EQU "'" ;SINGLE QUOTE CHARACTER
+CHAR_COMMA EQU "," ;CHARACTER COMMA
+CHAR_PERIOD EQU "." ;CHARACTER PERIOD
+CHAR_COLON EQU ":" ;CHARACTER COLON
+CHAR_SEMICOLON EQU ";" ;CHARACTER SEMICOLON
+CHAR_LEFT_BRACKET EQU "[" ;CHARACTER LEFT BRACKET
+CHAR_AT_SIGN EQU "@" ;CHARACTER "AT" SIGN
+CHAR_ZERO EQU "0" ;CHARACTER ZERO
+
+LOWER_A EQU "a" ;LOWER CASE CHARACTER "a"
+LOWER_Z EQU "z" ;LOWER CASE CHARACTER "z"
+
+UPPER_A EQU "A" ;UPPER CASE CHARACTER "A"
+UPPER_C EQU "C" ;UPPER CASE CHARACTER "C"
+UPPER_E EQU "E" ;UPPER CASE CHARACTER "E"
+UPPER_F EQU "F" ;UPPER CASE CHARACTER "F"
+UPPER_L EQU "L" ;UPPER CASE CHARACTER "L"
+UPPER_M EQU "M" ;UPPER CASE CHARACTER "M"
+UPPER_N EQU "N" ;UPPER CASE CHARACTER "N"
+UPPER_P EQU "P" ;UPPER CASE CHARACTER "P"
+UPPER_S EQU "S" ;UPPER CASE CHARACTER "S"
+UPPER_X EQU "X" ;UPPER CASE CHARACTER "X"
+UPPER_Z EQU "Z" ;UPPER CASE CHARACTER "Z"
+FOR_SLASH EQU '/'
+Q_MARK EQU '?'
+
+VEC_SING_STEP EQU 1 ;ID OF THE SINGLE STEP VECTOR
+VEC_BREAKPOINT EQU 3 ;ID OF THE BREAKPOINT VECTOR
+VEC_TERM_ADDR EQU 22H ;ID OF THE TERMINATE ADDRESS VECTOR
+VEC_CTRL_BREAK EQU 23H ;ID OF THE CTRL BREAK EXIT ADDRESS VECTOR
+VEC_CRIT_ERR EQU 24H ;ID OF THE CRITICAL ERROR HANDLER VECTOR
+VEC_PRIMITIVE_DISK_READ EQU 25H ;ID OF THE PRIMITAVE DISK READ VECTOR
+VEC_PRIMITIVE_DISK_WRITE EQU 26H ;ID OF THE PRIMITAVE DISK WRITE VECTOR
+GENERIC_IOCTL EQU 440DH ;an000;Generic IOCtl function
+READ_WRITE EQU 08H ;an000;read/write relative sectors
+READ_SECTOR EQU 00H ;an000;currently unknown value
+WRITE_SECTOR EQU 00H ;an000;currently unknown value
+
+SET_DRIVEID_OPTION EQU 1 ;AL VALUE FOR "PARSE FILENAME" FUNCTION
+LSEEK_FROM_START EQU 0 ;AL VALUE FOR "LSEEK" FUNCTION
+LSEEK_EOF_OPTION EQU 2 ;AL VALUE FOR "LSEEK" FUNCTION
+
+;======================= EMS Equates Begin ===============================
+
+EMS_GET_MAN_STAT equ 40h ;an000;function 40h, int 67h
+EMS_UNALL_PG_CNT equ 42h ;an000;funciton 42h, int 67h
+EMS_HAN_ALLOC equ 43h ;an000;function 43h, int 67h
+EMS_MAP_MEMORY equ 44h ;an000;function 44h, int 67h
+EMS_PAGE_DEALL equ 45h ;an000;function 45h, int 67h
+EMS_VERSION equ 46h ;an000;function 46h, int 67h
+EMS_SAVE_PAGE_MAP equ 47h ;an000;function 47h, int 67h
+EMS_REST_PAGE_MAP equ 48h ;an000;function 48h, int 67h
+EMS_HANDLE_CNT equ 4bh ;an000;function 4bh, int 67h
+EMS_HANDLE_PAGES equ 4dh ;an000;function 4dh, int 67h
+EMS_GET_SET_PG_MP equ 4eh ;an000;function 4eh, int 67h
+EMS_TOT_HANDLES equ 5402h ; Function 54h, sub-func:02 Get total handles ; C05
+EMS_GET_PAGE_MAP equ 00h ;an000;sub function 00h of
+EMS_PG_FRAME equ 5800h ;an000;function 58h, int 67h
+ ; function 4eh, int 67h
+EMS_SET_PAGE_MAP equ 01h ;an000;sub function 01h of
+ ; function 4eh, int 67h
+EMS_HANDLE_TOTAL equ 0ffh ;an000;total possible handles
+
+EMS_LIM_40 equ 040h ;an000;LIM 4.0 I.D.
+
+XM_ERR80 equ 80h ;an000;error message type
+XM_ERR83 equ 83h ;an000;error message type
+XM_ERR84 equ 84h ;an000;error message type
+XM_ERR85 equ 85h ;an000;error message type
+XM_ERR86 equ 86h ;an000;error message type
+XM_ERR87 equ 87h ;an000;error message type
+XM_ERR88 equ 88h ;an000;error message type
+XM_ERR89 equ 89h ;an000;error message type
+XM_ERR8A equ 8Ah ;an000;error message type
+XM_ERR8B equ 8Bh ;an000;error message type
+XM_ERR8D equ 8Dh ;an000;error message type
+XM_ERR8E equ 8Eh ;an000;error message type
+XM_ERR8F equ 8Fh ;an000;error message type
+XM_NOT_INST equ 0ffh ;an000;EMS not inst
+
+;======================= EMS Equates End =================================
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debug.lnk b/private/mvdm/dos/v86/cmd/debug/debug.lnk
new file mode 100644
index 000000000..e9163c0a8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debug.lnk
@@ -0,0 +1,13 @@
+DEBUG+
+DEBCOM1+
+DEBCOM2+
+DEBCOM3+
+DEBASM+
+DEBUASM+
+DEBERR+
+DEBCONST+
+DEBMES+
+DEBEMS+
+DEBDATA
+DEBUG.EXE;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debug.skl b/private/mvdm/dos/v86/cmd/debug/debug.skl
new file mode 100644
index 000000000..d923cf7a3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debug.skl
@@ -0,0 +1,134 @@
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: DEBMES.FIL
+;
+; DESCRIPTIVE NAME: MESSAGES USED BY DEBUG
+;
+; FUNCTION: PROVIDES FASTBLD.EXE THE MESSAGES THAT ARE TO BE USED BY DEBUG.
+;
+; ENTRY POINT: NA
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES: NA
+;
+; EXTERNAL REFERENCES: NA
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY FASTBLD.EXE.
+;
+; FASTBLD.EXE CREATES: DEBUG.CLA
+; DEBUG.CLB
+; DEBUG.CLC
+; DEBUG.CLD
+; DEBUG.CL1
+; DEBUG.CL2
+;
+; REVISION HISTORY: NA
+;
+; COPYRIGHT: "MS DOS DEBUG Utility"
+; "Version 5.00 (C) Copyright 1991 Microsoft"
+; "Licensed Material - Property of Microsoft "
+; "All rights reserved"
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+;=========================================================================
+;debug utility message file
+;=========================================================================
+
+:util DEBUG ;utility name
+
+:class 1 ;extended errors
+
+:class A ;system messages
+:use 1 COMMON1 ;"Incorrect DOS version"
+:use 2 COMMON2 ;"Insufficient memory"
+:use 3 COMMON3 ;"Error loading messages"
+:def 4 "Allocation failed or specified buffer too small",CR,LF
+:def 90 "Starts Debug, a program testing and editing tool.",cr,lf,cr,lf
+:def 91 "DEBUG [pathname [arglist]]",cr,lf,cr,lf
+:def 92 " pathname Program or other file to debug.", cr,lf
+:def 93 " arglist Arguments to pass to the program when it is loaded",cr,lf,cr,lf
+:def 94 "Once Debug is started, enter ? to display a list of debugging commands.",cr,lf
+:def 100 "A (assemble), ...."
+:def 101 "...."
+:def 102 "...."
+:def 103 "...."
+:def 104 "...."
+:def 105 "...."
+
+:class B ;utility messages
+:def 6 "Bad device name" ;baddev_ptr
+:def 7 "Couldn't open list device PRN",CR,LF
+"Enter name of list device? " ;badlstmes_ptr
+:def 8 CR,LF ;crlf_ptr
+:def 9 CR,LF,"Program terminated normally",CR,LF ;endmes_ptr
+:def 10 "Invalid drive specification",CR,LF ;nambad_ptr
+:def 12 "File creation error",CR,LF ;noroom_ptr
+:def 13 "Insufficient space on disk",CR,LF ;nospace_ptr
+:def 14 "Disk error reading drive %1",CR,LF ;dr1_ptr
+:def 15 "Disk error writing drive %1",CR,LF ;dr2_ptr
+:def 16 "Write protect error reading drive %1",CR,LF ;dr3_ptr
+:def 17 "Write protect error writing drive %1",CR,LF ;dr4_ptr
+:def 19 "%1^ Error" ;synerr
+:def 20 "Error in EXE or HEX file",CR,LF ;exebad_ptr/hexerr_ptr
+
+:class C
+:def 21 "EXE and HEX files cannot be written",CR,LF ;exewrt_ptr/hexwrt_ptr
+:def 22 "EXEC failure" ;execemes_ptr
+:def 23 "(W)rite error, no destination defined",CR,LF ;nonamespec_ptr
+:def 24 "Access denied",CR,LF ;accmes_ptr
+:def 25 "Parity error or nonexistant memory error detected" ;paritymes_ptr
+:def 26 "-" ;prompt_ptr
+:def 27 "%1 -" ;change_flag_ptr
+:def 32 "%1%2" ;unassem_ln_ptr
+:def 33 "%1:%2 %3" ;hex_ptr
+:def 34 "%1 %2" ;add_ptr
+:def 35 "%1 %2",CR,LF,":" ;single_reg_ptr
+:def 36 "%1=%2 " ;register_ptr
+:def 37 "%1 Error" ;errmes_ptr
+:def 38 "Writing %1 bytes" ;wrtmes_ptr
+:def 39 "%1:%2=" ;loc_ptr
+:def 40 "%1" ;little_ptr
+
+:class D
+:def 41 "%1" ;big_ptr
+:def 42 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+:def 44 32,8 ;bacmes_ptr
+ ; :def 45 "Unable to allocate message handler",CR,LF
+ ;fatal_error
+:def 46 "%1" ;arg_buf_ptr
+:def 47 "%1" ;one_char_buf_ptr
+
+:def 50 "%1 of a total %2 EMS pages have been allocated",cr,lf
+:def 51 "%1 of a total %2 EMS handles have been allocated",cr,lf
+:def 55 "Handle created = %1 ",cr,lf
+:def 56 "Logical page %1 mapped to physical page %2 ",cr,lf
+:def 57 "EMS hardward/software failure",cr,lf
+:def 58 "Handle not found",cr,lf
+:def 59 "Invalid function code",cr,lf
+:def 60 "No free handles",cr,lf
+:def 61 "Save/Restore error",cr,lf
+:def 62 "Total pages exceeded",cr,lf
+:def 63 "Free pages exceeded",cr,lf
+:def 64 "Parameter error",cr,lf
+:def 65 "Logical Page out of range",cr,lf
+:def 66 "Physical Page out of range",cr,lf
+:def 67 "Save area already in use",cr,lf
+:def 68 "Save area not in use",cr,lf
+:def 70 "General EMS error",cr,lf
+:def 71 "Missing or invalid EMS parameter",cr,lf
+:def 72 "Handle %1 has %2 pages allocated",cr,lf
+:def 75 "Physical page %1 = Frame segment %2",cr,lf
+:def 76 "Handle %1 deallocated",cr,lf
+:def 78 "EMS not installed",cr,lf
+
+:end
+
+;=========================================================================
+;=========================================================================
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/debug.tag b/private/mvdm/dos/v86/cmd/debug/debug.tag
new file mode 100644
index 000000000..0bc95235f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/debug.tag
@@ -0,0 +1,2 @@
+M000 1/15/91 CAS debcom2.asm Bug 5082 - "r" display at word [ffff]
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/dosdebug/debug.arf b/private/mvdm/dos/v86/cmd/debug/dosdebug/debug.arf
new file mode 100644
index 000000000..183bcfcb8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/dosdebug/debug.arf
@@ -0,0 +1,13 @@
+DEBUG+
+DEBCOM1+
+DEBCOM2+
+DEBCOM3+
+DEBASM+
+DEBUASM+
+DEBERR+
+DEBCONST+
+DEBDATA+
+DEBMES+
+\LIB\PRINTF
+DEBUG.EXE;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/makefile b/private/mvdm/dos/v86/cmd/debug/makefile
new file mode 100644
index 000000000..701d993f6
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/makefile
@@ -0,0 +1,225 @@
+# Makefile for debug.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =debug.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+debug.ctl: debug.skl \
+ $(msg)\$(COUNTRY).msg \
+
+debug.obj: debug.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debcom1.obj: debcom1.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debcom2.obj: debcom2.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debcom3.obj: debcom3.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\mi.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debasm.obj: debasm.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debuasm.obj: debuasm.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+deberr.obj: deberr.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debconst.obj: debconst.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debdata.obj: debdata.asm \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\version.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ debug.inc
+
+debems.obj: debems.asm \
+ $(inc)\version.inc \
+ debug.inc
+
+debmes.obj: debmes.asm \
+ $(inc)\msgserv.asm \
+ $(inc)\sysmsg.inc \
+ debug.ctl
+
+$(dest): debug.obj \
+ debcom1.obj \
+ debcom2.obj \
+ debcom3.obj \
+ debems.obj \
+ debasm.obj \
+ debuasm.obj \
+ deberr.obj \
+ debconst.obj \
+ debdata.obj \
+ debmes.obj \
+ debug.lnk
+ link16 $(exelink) /MAP @debug.lnk
diff --git a/private/mvdm/dos/v86/cmd/debug/sysver.fal b/private/mvdm/dos/v86/cmd/debug/sysver.fal
new file mode 100644
index 000000000..18ecbd6e8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/sysver.fal
@@ -0,0 +1,10 @@
+
+
+ IF1
+ %OUT Including ..SYSVER.FAL..
+ ENDIF
+
+SYSVER EQU FALSE ; if true, i/o direct to bios
+ ; so DOS can be debugged
+
+
diff --git a/private/mvdm/dos/v86/cmd/debug/sysver.inc b/private/mvdm/dos/v86/cmd/debug/sysver.inc
new file mode 100644
index 000000000..07915dbf0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/sysver.inc
@@ -0,0 +1,15 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+ IF1
+ %OUT Including ..SYSVER.FAL..
+ ENDIF
+
+SYSVER EQU FALSE ; if true, i/o direct to bios
+ ; so DOS can be debugged
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/debug/sysver.tru b/private/mvdm/dos/v86/cmd/debug/sysver.tru
new file mode 100644
index 000000000..59cc3fd9e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/debug/sysver.tru
@@ -0,0 +1,10 @@
+
+
+ IF1
+ %OUT Including ..SYSVER.TRU..
+ ENDIF
+
+SYSVER EQU TRUE ; if true, i/o direct to bios
+ ; so DOS can be debugged
+
+
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlcmd1.asm b/private/mvdm/dos/v86/cmd/edlin/edlcmd1.asm
new file mode 100644
index 000000000..a3ad15740
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlcmd1.asm
@@ -0,0 +1,679 @@
+ PAGE 60,132;
+ TITLE EDLCMD1.ASM
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLCMD1.SAL
+;
+; DESCRIPTIVE NAME: EDLIN ROUTINES
+;
+; FUNCTION: THIS MODULE PROVIDES ROUTINES NEEDED FOR EDLIN'S EXECUTION.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR : NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: EDLCMD2 - ROUTINES MAY BE CALLED FROM EDLCMD2
+; EDLMES - ROUTINES MAY BE CALLED FROM EDLMES
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION DOS 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT SYSPARSE
+; - IMPLEMENT MESSAGE RETRIEVER
+; - IMPLEMENT DBCS ENABLING
+; - ENHANCED VIDEO SUPPORT
+; - EXTENDED OPENS
+; - SCROLLING ERROR
+;
+; COPYRIGHT: "MS DOS EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+include syscall.inc
+include edlequ.asm
+
+SUBTTL Contants and Data areas
+PAGE
+
+
+CODE SEGMENT PUBLIC
+CODE ENDS
+
+CONST SEGMENT PUBLIC WORD
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC WORD
+DATA ENDS
+
+DG GROUP CODE,CONST,cstack,DATA
+
+CONST SEGMENT PUBLIC WORD
+ EXTRN DSKFUL:abs,READ_ERR_PTR:word
+ EXTRN NOSUCH:abs,TOOLNG:abs,EOF:abs
+ extrn txt1:byte,txt2:byte
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC WORD
+ extrn ParamCt:WORD
+ extrn current:word,pointer:word,start:word,endtxt:word
+ extrn wrt_handle:word,editbuf:byte,path_name:byte,fname_len:word
+ extrn arg_buf:byte,arg_buf_ptr:word
+ extrn olddat:byte,oldlen:word,newlen:word,param1:word,param2:word
+ extrn srchflg:byte,srchmod:byte,comline:word,lstfnd:word,numpos:word
+ extrn lstnum:word,srchcnt:word,amnt_req:word,delflg:byte,lastlin:word
+ extrn three4th:word,one4th:word,last_mem:word,rd_handle:word,ending:byte
+ extrn haveof:byte
+ extrn Disp_Len:Byte
+
+DATA ENDS
+
+CODE SEGMENT PUBLIC
+ASSUME CS:DG,DS:DG,SS:CStack,ES:DG
+
+ extrn findlin:near,shownum:near,loadbuf:near
+ extrn delbak:near,unquote:near,lf:near
+ extrn dispone:near,display:near,query:near
+ extrn quit:near,scanln:near,scaneof:near
+ extrn fndfirst:near,fndnext:near,replace:near,memerr:near
+ extrn std_printf:near,chkrange:near,comerr:near
+ extrn display_message:near
+
+ public zerror
+ public xerror,bad_read,append,nocom,pager,list
+ public delete,replac_from_curr,search_from_curr,ewrite,wrt
+
+NOMOREJ:JMP NOMORE
+
+APPEND:
+ CMP ParamCt,1
+ JZ AppendOK
+ JMP ComErr
+AppendOK:
+ TEST BYTE PTR [HAVEOF],-1
+ JNZ NOMOREJ
+ MOV DX,[ENDTXT]
+ CMP [PARAM1],0 ;See if parameter is missing
+ JNZ PARMAPP
+ CMP DX,[THREE4TH] ;See if already 3/4ths full
+ jb parmapp
+ return ;If so, then done already
+PARMAPP:
+ MOV DI,DX
+ MOV CX,[LAST_MEM]
+ SUB CX,DX ;Amount of memory available
+ jnz sj53
+ jmp memerr
+sj53:
+ MOV DX,[ENDTXT]
+ MOV BX,[RD_HANDLE]
+ mov [amnt_req],cx ;Save number of chars requested
+ MOV AH,READ
+ INT 21H ;Fill memory with file data
+ CMP CX,AX ;Did we read less than we asked for?
+ JZ SJ55
+; Make sure this is an end-of-file by trying to read more
+ PUSH AX ;Save old byte count
+ ADD DX,AX ;Point to next open space in buffer
+ MOV CX,1 ;Just one character past EOF
+ MOV AH,READ
+ INT 21H
+ CMP AX,0 ;Is it EOF?
+ POP AX
+ JNZ SJ54 ;No -- we have one more character
+ MOV BYTE PTR [HAVEOF],1 ;Yes - set old style system call flag
+ JMP SHORT SJ55
+SJ54:
+ INC AX ;Include one more char in byte count
+sj55:
+ MOV CX,AX ;Want byte count in CX
+ PUSH CX ;Save actual byte count
+ CALL SCANEOF
+ JNZ NOTEND
+ MOV BYTE PTR [HAVEOF],1 ;Set flag if 1AH found in file
+NOTEND:
+ XOR DX,DX
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ COUNTLN
+ MOV AX,DI
+ ADD AX,CX ;First byte after loaded text
+ CMP AX,[THREE4TH] ;See if we made 3/4 full
+ JBE COUNTLN
+ MOV DI,[THREE4TH]
+ MOV CX,AX
+ SUB CX,DI ;Length remaining over 3/4
+ MOV BX,1 ;Look for one more line
+COUNTLN:
+ CALL SCANLN ;Look for BX lines
+ CMP [DI-1],AL ;Check for full line
+ JZ FULLN
+ CMP HavEof,1
+ JNZ DoBackScan
+;
+; We have an incomplete line in the buffer at end of file. Fix it up to be
+; pretty.
+;
+ MOV BYTE PTR [DI],13 ; CR
+ MOV BYTE PTR [DI+1],10 ; LF
+ ADD DI,2 ; length is 2 greater
+ POP CX
+ ADD CX,2
+ PUSH CX
+ JMP SHORT FULLN
+
+DoBackScan:
+ DEC DI
+ MOV CX,[LAST_MEM]
+ STD
+ REPNE SCASB ;Scan backwards for last line
+ CLD
+ INC DI
+ INC DI
+ DEC DX
+FULLN:
+ POP CX ;Actual amount read
+ MOV WORD PTR [DI],1AH ;Place EOF after last line
+ SUB CX,DI
+ XCHG DI,[ENDTXT]
+ ADD DI,CX ;Amount of file read but not used
+; Must seek for old partial line
+ OR DI,DI
+ JZ FULLN1
+ PUSH DX
+ PUSH BX
+ MOV BX,[RD_HANDLE]
+ MOV DX,DI
+ NEG DX
+ MOV CX,-1
+ MOV AL,1
+ MOV AH,LSEEK
+ INT 21H
+ POP BX
+ POP DX
+ JC BAD_READ
+FULLN1:
+ CMP BX,DX
+ JNZ EOFCHK
+ MOV BYTE PTR [HAVEOF],0
+ return
+NOMORE:
+ mov ax,EOF
+ call display_message
+ret3: return
+
+BAD_READ:
+ MOV DX,OFFSET DG:READ_ERR_ptr
+ MOV DI,offset dg:path_name
+ ADD DI,[FNAME_LEN]
+ MOV AL,0
+ STOSB
+ JMP XERROR
+
+EOFCHK:
+ TEST BYTE PTR [HAVEOF],-1
+ JNZ NOMORE
+ TEST BYTE PTR [ENDING],-1
+ retnz ;Suppress memory error during End
+ JMP MEMERR
+
+EWRITE:
+ CMP ParamCt,1
+ JBE EWriteOK
+ JMP ComErr
+EWriteOK:
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ WRT
+ MOV CX,[ONE4TH]
+ MOV DI,[ENDTXT]
+ SUB DI,CX ;Write everything in front of here
+ JBE RET3
+ CMP DI,OFFSET DG:START ;See if there's anything to write
+ JBE RET3
+ XOR DX,DX
+ MOV BX,1 ;Look for one more line
+ CALL SCANLN
+ JMP SHORT WRTADD
+WRT:
+ INC BX
+ CALL FINDLIN
+WRTADD:
+ CMP BYTE PTR [DELFLG],0
+ JNZ WRTADD1
+ PUSH DI
+ CALL DELBAK ;Want to delete the .BAK file
+ ;as soon as the first write occurs
+ POP DI
+WRTADD1:
+ MOV CX,DI
+ MOV DX,OFFSET DG:START
+ SUB CX,DX ;Amount to write
+ retz
+ MOV BX,[WRT_HANDLE]
+ MOV AH,WRITE
+ INT 21H
+ JC WRTERR
+ CMP AX,CX ; MZ correct full disk detection
+ JNZ WRTERR ; MZ correct full disk detection
+ MOV SI,DI
+ MOV DI,OFFSET DG:START
+ MOV [POINTER],DI
+ MOV CX,[ENDTXT]
+ SUB CX,SI
+ INC CX ;Amount of text remaining
+ CLD
+ REP MOVSB
+ DEC DI ;Point to EOF
+ MOV [ENDTXT],DI
+ MOV [CURRENT],1
+ return
+
+WRTERR:
+ MOV BX,[WRT_HANDLE]
+ MOV AH,CLOSE
+ INT 21H
+ mov ax,DSKFUL
+zerror:
+ push cs
+ pop ds
+ call display_message
+xerror1111:
+ mov al,0ffh
+ mov ah,exit
+ int 21h
+
+xERROR:
+ push cs
+ pop ds
+ call std_printf
+ jmp xerror1111
+
+NOTFNDJ:JMP NOTFND
+
+replac_from_curr:
+ CMP ParamCt,2
+ JBE Replace1
+ JMP ComErr
+Replace1:
+ mov byte ptr [srchmod],1 ;search from curr+1 line
+ jmp short sj6
+
+REPLAC:
+ mov byte ptr [srchmod],0 ;search from beg of buffer
+sj6:
+ MOV BYTE PTR [SRCHFLG],0
+ CALL FNDFIRST
+ JNZ NOTFNDJ
+REPLP:
+ MOV SI,[NUMPOS]
+ CALL LOADBUF ;Count length of line
+ SUB DX,[OLDLEN]
+ MOV CX,[NEWLEN]
+ ADD DX,CX ;Length of new line
+ CMP DX,254
+; jbe len_ok
+; Jmp TOOLONG
+ ja toolong
+len_ok:
+ MOV BX,[LSTNUM]
+ PUSH DX
+ CALL SHOWNUM
+ POP DX
+ MOV CX,[LSTFND]
+ MOV SI,[NUMPOS]
+ SUB CX,SI ;Get no. of char on line before change
+ DEC CX
+ mov di,offset dg:arg_buf ;Initialize the output string buffer
+ CALL OUTCNT ;Output first part of line
+ PUSH SI
+ MOV SI,1+ OFFSET DG:TXT2
+ MOV CX,[NEWLEN]
+ CALL OUTCNT ;Output change
+ POP SI
+ ADD SI,[OLDLEN] ;Skip over old stuff in line
+ MOV CX,DX ;DX=no. of char left in line
+ ADD CX,2 ;Include CR/LF
+ CALL OUTCNT ;Output last part of line
+ xor al,al
+ stosb
+ mov dx,offset dg:arg_buf_ptr
+ call std_printf
+ CALL QUERY ;Check if change OK
+ JNZ REPNXT
+ CALL PUTCURS
+ MOV DI,[LSTFND]
+ DEC DI
+ MOV SI,1+ OFFSET DG:TXT2
+ MOV DX,[OLDLEN]
+ MOV CX,[NEWLEN]
+ DEC CX
+ ADD [LSTFND],CX ;Bump pointer beyond new text
+ INC CX
+ DEC DX
+ SUB [SRCHCNT],DX ;Old text will not be searched
+ JAE SOMELEFT
+ MOV [SRCHCNT],0
+SOMELEFT:
+ INC DX
+ CALL REPLACE
+REPNXT:
+ CALL FNDNEXT
+ retnz
+ JMP REPLP
+
+OUTCNT:
+ JCXZ RET8
+OUTLP:
+ LODSB
+ stosb
+ DEC DX
+ LOOP OUTLP
+RET8: return
+
+TOOLONG:
+ mov ax,TOOLNG
+ JMP SHORT PERR
+
+search_from_curr:
+ CMP ParamCt,2
+ JBE Search1
+ JMP ComErr
+Search1:
+ mov byte ptr [srchmod],1 ;search from curr+1 line
+ jmp short sj7
+
+SEARCH:
+ mov byte ptr [srchmod],0 ;search from beg of buffer
+sj7:
+ MOV BYTE PTR [SRCHFLG],1
+ CALL FNDFIRST
+ JNZ NOTFND
+SRCH:
+ MOV BX,[LSTNUM]
+ MOV SI,[NUMPOS]
+ CALL DISPONE
+ MOV DI,[LSTFND]
+ MOV CX,[SRCHCNT]
+ MOV AL,10
+ CLD
+ REPNE SCASB
+ JNZ NOTFND
+ MOV [LSTFND],DI
+ MOV [NUMPOS],DI
+ MOV [SRCHCNT],CX
+ INC [LSTNUM]
+ CALL QUERY
+ JZ PUTCURS1
+ CALL FNDNEXT
+ JZ SRCH
+NOTFND:
+ mov ax,NOSUCH
+PERR:
+ jmp display_message
+
+;
+; Replace enters here with LSTNUM pointing to the correct line.
+;
+PUTCURS:
+ MOV BX,[LSTNUM]
+ jmp short putcursor
+;
+; Search enters here with LSTNUM pointing AFTER the correct line
+;
+putcurs1:
+ MOV BX,[LSTNUM]
+ DEC BX ;Current <= Last matched line
+
+putcursor:
+ CALL FINDLIN
+ MOV [CURRENT],DX
+ MOV [POINTER],DI
+ return
+
+;
+; n,mD deletes a range of lines. Allowable values for n are:
+; 1 ... LAST_MEM. Allowable values for m are:
+; 1 ... LAST_MEM.
+; nD deletes a single line
+; D deletes the current line
+;
+DELETE:
+ CMP ParamCt,2 ; at most two parameters specified.
+ JA ComErrJ
+ MOV BX,Param1
+ OR BX,BX ; default first arg?
+ JNZ DelParm2
+ MOV BX,Current ; use current as default
+ MOV Param1,BX
+DelParm2:
+ MOV BX,Param2 ; did we default second arg?
+ OR BX,BX
+ JNZ DelCheck ; no, use it.
+ MOV BX,Param1 ; use param1 as default
+ MOV Param2,BX
+DelCheck:
+ MOV BX,Param1
+ CALL ChkRange ; returns by itself if bad range
+;
+; BX is first line of range to be deleted. Param2 is last line in range to
+; be deleted. Get pointer to beginning of block. Save location
+;
+ CALL FINDLIN ; Grab line
+ retnz ; If not found => return
+ PUSH BX
+ PUSH DI
+;
+; Get pointer past end of block (Param2+1).
+;
+ MOV BX,Param2
+ INC BX
+ CALL FINDLIN
+;
+; Set up pointers. Compute number of chars to move.
+;
+ MOV SI,DI ; move from second line+1
+ POP DI ; restore destination (first line)
+ POP Current ; Current line is first param
+ MOV Pointer,DI ; internal current line
+ MOV CX,EndTxt ; compute count
+ SUB CX,SI
+ JB ComErrJ ; should never occur: ChkRange
+ INC CX ; remember ^Z at end
+ CLD
+ REP MOVSB ; move data
+ DEC DI
+ MOV EndTxt,DI ; reset end pointer
+ return
+
+COMERRJ:
+ JMP COMERR
+
+PAGER:
+ CMP ParamCt,2
+ JA ComErrJ
+ xor bx,bx ;get last line in the buffer
+ call findlin
+ mov [lastlin],dx
+
+ mov bx,[param1]
+ or bx,bx ;was it specified?
+ jnz frstok ;yes, use it
+ mov bx,[current]
+ cmp bx,1 ;if current line =1 start from there
+ je frstok
+ inc bx ;start from current+1 line
+frstok:
+ cmp bx,[lastlin] ;check that we are in the buffer
+ jbe frstok1
+ return ;if not just quit
+frstok1:
+ mov dx,[param2]
+ or dx,dx ;was param2 specified?
+ jnz scndok ;yes,....
+ mov dx,bx ;no, take the end line to be the
+ ; start line + length of active display
+
+;=========================================================================
+; This modification is to provide support for screens larger than
+; 24 lines.
+;
+; Date : 6/10/87
+;=========================================================================
+
+ push ax ;an000;save affected registers
+
+ mov ah,00h ;an000;zero out high byte
+ mov al,dg:disp_len ;an000;set ax to active display length
+ sub ax,2 ;an000;adjust for length of screen & current
+ ; line
+ add dx,ax ;an000;this gives us the last line to be
+ ; printed
+ pop ax ;an000;restore affected registers
+
+;=========================================================================
+
+scndok:
+ inc dx
+ cmp dx,[lastlin] ;check that we are in the buffer
+ jbe infile
+ mov dx,[lastlin] ;we are not, take the last line as end
+infile:
+ cmp dx,bx ;is param1 < param2 ?
+ retz
+ ja sj33
+ jmp comerr ;yes, no backwards listing, print error
+sj33:
+ push dx ;save the end line
+ push bx ;save start line
+ mov bx,dx ;set the current line
+ dec bx
+ call findlin
+ mov [pointer],di
+ mov [current],dx
+ pop bx ;restore start line
+ call findlin ;get pointer to start line
+ mov si,di ;save pointer
+ pop di ;get end line
+ sub di,bx ;number of lines
+ jmp short display_lines
+
+
+LIST:
+ CMP ParamCt,2
+ JBE ListOK
+ JMP ComERR
+ListOK:
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ CHKP2
+ MOV BX,[CURRENT]
+ SUB BX,11
+ JA CHKP2
+ MOV BX,1
+CHKP2:
+ CALL FINDLIN
+ retnz
+ MOV SI,DI
+ MOV DI,[PARAM2]
+ INC DI
+ SUB DI,BX
+ JA DISPLAY_lines
+
+;=========================================================================
+; This modification is to provide support for screens larger than
+; 24 lines.
+;
+; Date : 6/10/87
+;=========================================================================
+
+ push ax ;an000;save affected registers
+
+ mov ah,00h ;an000;zero out high byte
+ mov al,dg:disp_len ;an000;set ax to active display length dec ax ;an000;allow room at bottom for
+ ; messages
+ mov di,ax ;an000;number of lines to print an
+ ; entire screen less 1.
+ pop ax ;an000;restore affected registers
+
+;=========================================================================
+
+display_lines:
+ call DISPLAY
+ return
+
+Break <NOCOM - edit a single line>
+
+;
+; NOCOM is called when there is a single line being edited. This occurs when
+; the command letter is CR or is ;.
+;
+NOCOM:
+ CMP ParamCt,2
+ JB NoComOK
+ JMP ComErr
+NoComOK:
+ DEC [COMLINE]
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ HAVLIN
+ MOV BX,[CURRENT]
+ INC BX ;Default is current line plus one
+ CALL CHKRANGE
+HAVLIN:
+ CALL FINDLIN
+ MOV SI,DI
+ MOV [CURRENT],DX
+ MOV [POINTER],SI
+ jz sj12
+ret12: return
+sj12:
+ CMP SI,[ENDTXT]
+ retz
+ CALL LOADBUF
+ MOV [OLDLEN],DX
+ MOV SI,[POINTER]
+ CALL DISPONE
+ CALL SHOWNUM
+ MOV AH,STD_CON_STRING_INPUT ;Get input buffer
+ MOV DX,OFFSET DG:EDITBUF
+ INT 21H
+ CALL lf
+ MOV CL,[EDITBUF+1]
+ MOV CH,0
+ JCXZ RET12
+ MOV DX,[OLDLEN]
+ MOV SI,2 + OFFSET DG:EDITBUF
+;-----------------------------------------------------------------------
+ call unquote ;scan for quote chars if any
+;-----------------------------------------------------------------------
+ mov cl,[EditBuf+1] ;an000; dms;get new line length
+ mov ch,0 ;an000; dms;clear high byte
+ MOV DI,[POINTER]
+ JMP Replace ; MZ 11/30
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlcmd2.asm b/private/mvdm/dos/v86/cmd/edlin/edlcmd2.asm
new file mode 100644
index 000000000..6ab68fb36
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlcmd2.asm
@@ -0,0 +1,1203 @@
+ PAGE 60,132
+TITLE Edlcmd2 - PART2 procedures called from EDLIN
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLCMD2.SAL
+;
+; DESCRIPTIVE NAME: EDLIN ROUTINES
+;
+; FUNCTION: THIS MODULE PROVIDES ROUTINES NEEDED FOR EDLIN'S EXECUTION.
+;
+; ENTRY POINT: ANY CALLED ROUTINE
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR : NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: EDLCMD1 - ROUTINES MAY BE CALLED FROM EDLCMD1
+; EDLMES - ROUTINES MAY BE CALLED FROM EDLMES
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION DOS 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT SYSPARSE
+; - IMPLEMENT MESSAGE RETRIEVER
+; - IMPLEMENT DBCS ENABLING
+; - ENHANCED VIDEO SUPPORT
+; - EXTENDED OPENS
+; - SCROLLING ERROR
+;
+; COPYRIGHT: "MS DOS EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+include edlequ.asm
+include syscall.inc
+
+CODE SEGMENT PUBLIC
+CODE ENDS
+
+CONST SEGMENT PUBLIC WORD
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC WORD
+DATA ENDS
+
+
+DG GROUP CODE,CONST,cstack,DATA
+
+CONST SEGMENT PUBLIC WORD
+ extrn msg_crlf:abs,msg_lf:abs,qmes_ptr:byte,ask_ptr:byte
+ extrn bak:byte,$$$file:byte,delflg:byte,loadmod:byte,txt1:byte
+ extrn txt2:byte,memful_ptr:word
+
+ extrn Del_Bak_Ptr:byte ;an000;dms;
+ extrn cont_ptr:byte ;an000;dms:6/10/87
+
+CONST ENDS
+
+DATA SEGMENT PUBLIC WORD
+ extrn ParamCt:WORD
+ extrn current:word,pointer:word,start:word,endtxt:word
+ extrn wrt_handle:word,editbuf:byte,ext_ptr:word,qflg:byte
+ extrn temp_path:byte,line_num:word,line_flag:byte
+ extrn line_num_buf_ptr:byte,arg_buf:byte,arg_buf_ptr:word
+ extrn olddat:byte,oldlen:word,newlen:word,param1:word,param2:word
+ extrn srchflg:byte,srchmod:byte,comline:word,lstfnd:word,numpos:word
+ extrn lstnum:word,last_mem:word,srchcnt:word,amnt_req:word
+
+ extrn lc_adj:byte ;an000;dms:6/10/87
+ extrn continue:byte ;an000;dms:6/10/87
+ extrn pg_count:byte ;an000;dms:6/10/87
+ extrn Disp_Len:byte ;an000;dms;
+ extrn Disp_Width:byte ;an000;dms;
+ extrn lc_flag:byte ;an000;dms:6/10/87
+
+ ifdef DBCS
+ extrn lbtbl:dword
+ endif
+
+DATA ENDS
+
+CODE SEGMENT PUBLIC
+
+ASSUME CS:DG,DS:DG,SS:CStack,ES:DG
+
+ public findlin,shownum,loadbuf,crlf,lf,abortcom,unquote
+ public kill_bl,make_caps,display,dispone,make_cntrl
+ public query,quit,scanln,delbak,scaneof,memerr
+ public fndfirst,fndnext,replace
+ ifdef DBCS
+ public testkanj
+ endif
+ extrn std_printf:near,command:near,chkrange:near,ComErr:NEAR
+ extrn Xerror:near
+ extrn display_message:near
+
+
+FINDLIN:
+
+; Inputs
+; BX = Line number to be located in buffer (0 means last line+1)
+; Outputs:
+; DX = Actual line found
+; DI = Pointer to start of line DX
+; Zero set if BX = DX (if specified line found)
+; AL,CX destroyed. No other registers affected.
+
+ MOV DX,[CURRENT]
+ MOV DI,[POINTER]
+ CMP BX,DX ; fast find. Current = requested
+ retz
+ JA FINDIT ; start scanning at current?
+ OR BX,BX ; special case of EOF?
+ JZ FINDIT ; yes
+ MOV DX,1 ; set up for scan at beginning
+ MOV DI,OFFSET DG:START
+ CMP BX,DX ; at beginning?
+ retz
+FINDIT:
+ MOV CX,[ENDTXT] ; count of bytes in buffer
+ SUB CX,DI ; for scan
+SCANLN:
+ MOV AL,10 ; LF is what we look for.
+ OR AL,AL ; Clear zero flag for JCXZ
+FINLIN:
+ JCXZ RET4 ; at end? Yes, no skip.
+ REPNE SCASB ; find EOL
+ INC DX ; increment count
+ CMP BX,DX ; find correct line?
+ JNZ FINLIN ; no, try again.
+RET4: return
+
+; Inputs:
+; BX = Line number to be displayed
+; Function:
+; Displays line number on terminal in 8-character
+; format, suppressing leading zeros.
+; AX, CX, DX destroyed. No other registers affected.
+
+SHOWNUM:
+ mov dx,offset dg:line_num_buf_ptr
+ mov line_num,bx
+ MOV line_flag,"*"
+ CMP BX,[CURRENT]
+ JZ STARLIN
+ MOV line_flag," "
+STARLIN:
+ call std_printf
+ret5: return
+
+
+DISPONE:
+ MOV DI,1
+
+DISPLAY:
+
+; Inputs:
+; BX = Line number
+; SI = Pointer to text buffer
+; DI = No. of lines
+; Function:
+; Ouputs specified no. of line to terminal, each
+; with leading line number.
+; Outputs:
+; BX = Last line output.
+; All registers destroyed.
+
+ MOV CX,[ENDTXT]
+ SUB CX,SI
+ retz ; no lines to display
+;=========================================================================
+; Initialize screen size and line counts for use by display.
+;
+; Date : 6/10/87
+;=========================================================================
+
+ push ax ;an000;save affected regs
+
+ mov al,dg:disp_len ;an000;length of video display
+ mov pg_count,al ;an000;init. screen size ctr.
+
+ pop ax ;an000;restore affected regs
+
+;=========================================================================
+
+ mov dx,di ;number of lines to print
+;
+; CX is the number of bytes in the buffer
+; dx is the number of lines to be output
+;
+DISPLN:
+ SaveReg <CX,DX>
+ CALL SHOWNUM
+ RestoreReg <DX,CX>
+ mov di,offset dg:arg_buf
+;
+; Copy chars until CR/LF or end of line hit
+;
+OUTLN:
+ LODSB
+ CMP DI,254+offset dg:arg_buf ; are we at end of buffer?
+ JAE StoreDone ; Yes, do NOT store
+ CMP AL," "
+ JAE SEND
+ CMP AL,10
+ JZ SEND
+ CMP AL,13
+ JZ SEND
+ CMP AL,9
+ JZ SEND
+ MOV AH,"^"
+ OR AL,40h
+ XCHG AL,AH
+ STOSW
+ JMP short StoreDone
+SEND:
+ stosb
+StoreDone:
+ CMP AL,10 ; perform copy until LF is seen
+ LOOPNZ OUTLN
+;
+; Make sure buffer ends with CRLF
+;
+ cmp byte ptr [di-1],10
+ jz Terminate
+;
+; No LF seen. See if CR
+;
+ cmp byte ptr [di-1],CR
+ jz StoreLF
+ mov al,CR
+ stosb
+StoreLF:
+ mov al,10
+ stosb
+Terminate:
+ mov byte ptr [di],0
+
+ call EDLIN_DISP_COUNT ;an000;determine lines printed
+ ; DMS:6/10/87
+ push dx
+ mov dx,offset dg:arg_buf_ptr
+ call std_printf
+ pop dx
+ JCXZ ret7
+ INC BX
+
+ call EDLIN_PG_COUNT ;an000;adjust screen line count
+ ; DMS:6/10/87
+ cmp lc_flag,false ;an000;continue DISPLAY?
+ ; DMS:6/10/87
+ JNZ DISPLN
+ DEC BX
+ret7: return
+
+FNDFIRST:
+ MOV DI,1+OFFSET DG:TXT1
+ mov byte ptr[olddat],1 ;replace with old value if none new
+ CALL GETTEXT
+ OR AL,AL ;Reset zero flag in case CX is zero
+ JCXZ RET7
+ cmp al,1ah ;terminated with a ^Z ?
+ jne sj8
+ mov byte ptr[olddat],0 ;do not replace with old value
+sj8:
+ MOV [OLDLEN],CX
+ XOR CX,CX
+ CMP AL,0DH
+ JZ SETBUF
+ CMP BYTE PTR [SRCHFLG],0
+ JZ NXTBUF
+SETBUF:
+ DEC SI
+NXTBUF:
+ MOV [COMLINE],SI
+ MOV DI,1+OFFSET DG:TXT2
+ CALL GETTEXT
+ CMP BYTE PTR [SRCHFLG],0
+ JNZ NOTREPL
+ CMP AL,0DH
+ JNZ HAVCHR
+ DEC SI
+HAVCHR:
+ MOV [COMLINE],SI
+NOTREPL:
+ MOV [NEWLEN],CX
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ CALLER
+ cmp byte ptr[srchmod],0
+ jne sj9
+ mov bx,1 ;start from line number 1
+ jmp short sj9a
+sj9:
+ MOV BX,[CURRENT]
+ INC BX ;Default search and replace to current+1
+sj9a:
+ CALL CHKRANGE
+CALLER:
+ CALL FINDLIN
+ MOV [LSTFND],DI
+ MOV [NUMPOS],DI
+ MOV [LSTNUM],DX
+ MOV BX,[PARAM2]
+ CMP BX,1
+ SBB BX,-1 ;Decrement everything except zero
+ CALL FINDLIN
+ MOV CX,DI
+ SUB CX,[LSTFND]
+ OR AL,-1
+ JCXZ aret
+ CMP CX,[OLDLEN]
+ jae sj10
+aret: return
+sj10:
+ MOV [SRCHCNT],CX
+
+FNDNEXT:
+
+; Inputs:
+; [TXT1+1] has string to search for
+; [OLDLEN] has length of the string
+; [LSTFND] has starting position of search in text buffer
+; [LSTNUM] has line number which has [LSTFND]
+; [SRCHCNT] has length to be searched
+; [NUMPOS] has beginning of line which has [LSTFND]
+; Outputs:
+; Zero flag set if match found
+; [LSTFND],[LSTNUM],[SRCHCNT] updated for continuing the search
+; [NUMPOS] has beginning of line in which match was made
+
+ MOV AL,[TXT1+1]
+ MOV CX,[SRCHCNT]
+ MOV DI,[LSTFND]
+SCAN:
+ OR DI,DI ;Clear zero flag in case CX=0
+ REPNE SCASB ;look for first byte of string
+
+ retnz ;return if you don't find
+ifdef DBCS
+ call kanji_check ;see if the found byte is on a character boundary
+ jnz scan
+endif
+ MOV DX,CX
+ MOV BX,DI ;Save search position
+ MOV CX,[OLDLEN]
+ DEC CX
+ MOV SI,2 + OFFSET DG:TXT1
+ CMP AL,AL ;Set zero flag in case CX=0
+ REPE CMPSB
+ MOV CX,DX
+ MOV DI,BX
+ JNZ SCAN
+ MOV [SRCHCNT],CX
+ MOV CX,DI
+ MOV [LSTFND],DI
+ MOV DI,[NUMPOS]
+ SUB CX,DI
+ MOV AL,10
+ MOV DX,[LSTNUM]
+;Determine line number of match
+GETLIN:
+ INC DX
+ MOV BX,DI
+ REPNE SCASB
+ JZ GETLIN
+ DEC DX
+ MOV [LSTNUM],DX
+ MOV [NUMPOS],BX
+ XOR AL,AL
+ return
+
+ifdef DBCS
+
+;Kanji_check idea is to scan backwards to the first
+; character which can't be a kanji or part of one
+; (.lt. DB_SP_LO) then scan forward to see if the
+; current byte is on character boundary
+;
+;Output ZR <==> we're on a character boundary
+; NZ <==> we're not on character boundary i.e. No Match
+kanji_check:
+ push ax ;save search character
+ push di
+ dec di ;point to the character we found
+ mov si,di ;start searching bakwards from there
+ std
+srch_loop:
+ lodsb
+ cmp al,DB_SP_LO
+ jae srch_loop
+ inc si ;point to first non-kanji
+ cld ;forward search
+kan_loop:
+ cmp si,di ;are we at current byte?
+ jae passed_char ;if we are, or are passed it, exit
+ call next_char ;otherwise advance si to next char
+ jmp short kan_loop ;and loop
+passed_char:
+ pop di
+ pop ax
+ ret
+
+;Next_char si points to a character boundary
+; advance si to point to the beginning of the next char
+;
+;
+next_char:
+ push ax
+ lodsb
+ call testkanj
+ jz not_kanj
+ inc si
+not_kanj:
+ pop ax
+ ret
+
+;--------------------------------------------------------------------;
+; TESTKANJ ~ FIND OUT IS THE BYTE IS A KANJI PREFIX ;
+; ;
+; entry: AL byte to test ;
+; ;
+; exit: NZ if lead byte ortherwise ZR ;
+; ;
+; modifies: AX ;
+; ;
+;--------------------------------------------------------------------;
+
+testkanj:
+ push ax
+ xchg ah,al ;put byte in ah
+ push ds
+ push si
+ lds si,cs:[lbtbl] ;get pointer to lead byte table
+ktlop:
+ lodsb ;direction flag should be OK
+ or al,al ;are we at the end of table?
+ jz notlead ;brif so
+ cmp al,ah ;is START RANGE > CHARACTER?
+ ja notlead ;brif so, not a lead character (carry clear)
+ lodsb ;get second range byte
+ cmp ah,al ;is CHARACTER > END RANGE
+ ja ktlop ;brif so, not a lead character (check next range)
+ or al,al ;make NZ
+notl_exit:
+ pop si
+ pop ds
+ pop ax
+ ret
+notlead:
+ cmp al,al
+ jmp notl_exit
+
+endif
+
+GETTEXT:
+
+; Inputs:
+; SI points into command line buffer
+; DI points to result buffer
+; Function:
+; Moves [SI] to [DI] until ctrl-Z (1AH) or
+; RETURN (0DH) is found. Termination char not moved.
+; Outputs:
+; AL = Termination character
+; CX = No of characters moved.
+; SI points one past termination character
+; DI points to next free location
+
+ XOR CX,CX
+
+GETIT:
+ LODSB
+;-----------------------------------------------------------------------
+ cmp al,quote_char ;a quote character?
+ jne sj101 ;no, skip....
+ lodsb ;yes, get quoted character
+ call make_cntrl
+ jmp short sj102
+;-----------------------------------------------------------------------
+sj101:
+ CMP AL,1AH
+ JZ DEFCHK
+sj102:
+ CMP AL,0DH
+ JZ DEFCHK
+ STOSB
+ INC CX
+ JMP SHORT GETIT
+
+DEFCHK:
+ OR CX,CX
+ JZ OLDTXT
+ PUSH DI
+ SUB DI,CX
+ MOV BYTE PTR [DI-1],cl
+ POP DI
+ return
+
+OLDTXT:
+ cmp byte ptr[olddat],1 ;replace with old text?
+ je sj11 ;yes...
+ mov byte ptr[di-1],cl ;zero text buffer char count
+ return
+
+sj11:
+ MOV CL,BYTE PTR [DI-1]
+ ADD DI,CX
+ return
+
+REPLACE:
+
+; Inputs:
+; CX = Length of new text
+; DX = Length of original text
+; SI = Pointer to new text
+; DI = Pointer to old text in buffer
+; Function:
+; New text replaces old text in buffer and buffer
+; size is adjusted. CX or DX may be zero.
+; CX, SI, DI all destroyed. No other registers affected.
+
+ CMP CX,DX
+ JZ COPYIN
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ MOV SI,DI
+ ADD SI,DX
+ ADD DI,CX
+ MOV AX,[ENDTXT]
+ SUB AX,DX
+ ADD AX,CX
+ CMP AX,[LAST_MEM]
+ JAE MEMERR
+ XCHG AX,[ENDTXT]
+ MOV CX,AX
+ SUB CX,SI
+ CMP SI,DI
+ JA DOMOV
+ ADD SI,CX
+ ADD DI,CX
+ STD
+DOMOV:
+ INC CX
+
+ REP MOVSB
+ CLD
+ POP CX
+ POP DI
+ POP SI
+COPYIN:
+ REP MOVSB
+ return
+
+MEMERR:
+ MOV DX,OFFSET DG:MEMFUL_ptr
+ call std_printf
+ JMP COMMAND
+
+
+LOADBUF:
+ MOV DI,2 + OFFSET DG:EDITBUF
+ MOV CX,255
+ MOV DX,-1
+LOADLP:
+ LODSB
+ STOSB
+ INC DX
+ CMP AL,13
+ LOOPNZ LOADLP
+ MOV [EDITBUF+1],DL
+ retz
+TRUNCLP:
+ LODSB
+ INC DX
+ CMP AL,13
+ JNZ TRUNCLP
+ DEC DI
+ STOSB
+ return
+
+SCANEOF:
+ cmp [loadmod],0
+ je sj52
+
+;----- Load till physical end of file
+
+ cmp cx,word ptr[amnt_req]
+ jb sj51
+ xor al,al
+ inc al ;reset zero flag
+ return
+sj51:
+ jcxz sj51b
+ push di ;get rid of any ^Z at the end of the file
+ add di,cx
+ dec di ;points to last char
+ cmp byte ptr [di],1ah
+ pop di
+ jne sj51b
+ dec cx
+sj51b:
+ xor al,al ;set zero flag
+ call check_end ;check that we have a CRLF pair at the end
+ return
+
+;----- Load till first ^Z is found
+
+sj52:
+ PUSH DI
+ PUSH CX
+ MOV AL,1AH
+ or cx,cx
+ jz not_found ;skip with zero flag set
+ REPNE SCASB ;Scan for end of file mark
+ jnz not_found
+ LAHF ;Save flags momentarily
+ inc cx ;include the ^Z
+ SAHF ;Restore flags
+not_found:
+ mov di,cx ;not found at the end
+ POP CX
+ LAHF ;Save flags momentarily
+ SUB CX,DI ;Reduce byte count if EOF found
+ SAHF ;Restore flags
+ POP DI
+ call check_end ;check that we have a CRLF pair at the end
+
+ return
+
+
+;-----------------------------------------------------------------------
+; If the end of file was found, then check that the last character
+; in the file is a LF. If not put a CRLF pair in.
+
+check_end:
+ jnz not_end ;end was not reached
+ pushf ;save return flag
+ push di ;save pointer to buffer
+ add di,cx ;points to one past end on text
+ dec di ;points to last character
+ cmp di,offset dg:start
+ je check_no
+ cmp byte ptr[di],0ah ;is a LF the last character?
+ je check_done ;yes, exit
+check_no:
+ mov byte ptr[di+1],0dh ;no, put a CR
+ inc cx ;one more char in text
+ mov byte ptr[di+2],0ah ;put a LF
+ inc cx ;another character at the end
+check_done:
+ pop di
+ popf
+not_end:
+ return
+
+CRLF:
+ push dx
+ mov ax,msg_crlf
+ call display_message
+ pop dx
+ return
+LF:
+ mov ax,msg_lf
+ jmp display_message
+
+ABORTCOM:
+ MOV AX,CS
+ MOV DS,AX
+ MOV ES,AX
+ MOV AX,cstack
+ MOV SS,AX
+ MOV SP,STACK
+ STI
+ CALL CRLF
+ JMP COMMAND
+
+DELBAK:
+ ;Delete old backup file (.BAK)
+
+ MOV BYTE PTR [DELFLG],1
+ MOV DI,[EXT_PTR]
+ MOV SI,OFFSET DG:BAK
+ MOVSW
+ MOVSW
+ MOVSB
+ MOV AH,UNLINK
+ MOV DX,OFFSET DG:TEMP_PATH
+ INT 21H
+; $if c ;error ? ;an000; dms;
+ JNC $$IF1
+ cmp ax,Access_Denied ;file read only? ;an000; dms;
+; $if e ;yes ;an000; dms;
+ JNE $$IF2
+ mov bx,[Wrt_Handle] ;close .$$$ file ;an000; dms;
+ mov ah,Close ;close function ;an000; dms;
+ int 21h ;close it ;an000; dms;
+
+ mov di,[Ext_Ptr] ;point to extension ;an000; dms;
+ mov si,offset dg:$$$File ;point to .$$$ extension;an000; dms;
+ movsw ;get .$$$ extension ;an000; dms;
+ movsw ; ;an000; dms;
+ movsb ; ;an000; dms;
+ mov dx,offset dg:Temp_Path ;point to .$$$ file ;an000; dms;
+ mov ah,Unlink ;delete it ;an000; dms;
+ int 21h ; ;an000; dms;
+
+ mov di,[Ext_Ptr] ;point to extension ;an000; dms;
+ mov si,offset dg:BAK ;point to .BAK extension;an000; dms;
+ movsw ;get .BAK extension ;an000; dms;
+ movsw ; ;an000; dms;
+ movsb ; ;an000; dms;
+ mov dx,offset dg:Del_Bak_Ptr;point to error message ;an000; dms;
+ jmp Xerror ;display message & exit ;an000; dms;
+; $endif
+$$IF2:
+; $endif
+$$IF1:
+
+ MOV DI,[EXT_PTR]
+ MOV SI,OFFSET DG:$$$FILE
+ MOVSW
+ MOVSW
+ MOVSB
+ return
+
+
+;-----------------------------------------------------------------------;
+; Will scan buffer given pointed to by SI and get rid of quote
+;characters, compressing the line and adjusting the length at the
+;begining of the line.
+; Preserves al registers except flags and AX .
+
+unquote:
+ push cx
+ push di
+ push si
+ mov di,si
+ mov cl,[si-1] ;length of buffer
+ xor ch,ch
+ mov al,quote_char
+ cld
+unq_loop:
+ jcxz unq_done ;no more chars in the buffer, exit
+ repnz scasb ;search for quote character
+ jnz unq_done ;none found, exit
+ push cx ;save chars left in buffer
+ push di ;save pointer to quoted character
+ push ax ;save quote character
+ mov al,byte ptr[di] ;get quoted character
+ call make_cntrl
+ mov byte ptr[di],al
+ pop ax ;restore quote character
+ mov si,di
+ dec di ;points to the quote character
+ inc cx ;include the carriage return also
+ rep movsb ;compact line
+ pop di ;now points to after quoted character
+ pop cx
+ jcxz sj13 ;if quote char was last of line do not adjust
+ dec cx ;one less char left in the buffer
+sj13: pop si
+ dec byte ptr[si-1] ;one less character in total buffer count also
+ push si
+ jmp short unq_loop
+
+unq_done:
+ pop si
+ pop di
+ pop cx
+ return
+
+
+;-----------------------------------------------------------------------;
+; Convert the character in AL to the corresponding control
+; character. AL has to be between @ and _ to be converted. That is,
+; it has to be a capital letter. All other letters are left unchanged.
+
+make_cntrl:
+ push ax
+ and ax,11100000b
+ cmp ax,01000000b
+ pop ax
+ jne sj14
+ and ax,00011111b
+sj14:
+ return
+
+
+;---- Kill spaces in buffer --------------------------------------------;
+;=========================================================================
+; kill_bl : Parses over spaces in a buffer.
+;
+; Date : 6/10/86
+;=========================================================================
+kill_bl:
+
+ push bx ;an000;save affected reg.
+kill_bl_cont:
+
+ lodsb ;get rid of blanks
+ cmp al,9
+ je kill_bl_cont ;an000;it is a tab
+
+ cmp al,10
+ je kill_bl_cont ;an000;if LF
+
+ cmp al,' '
+ je kill_bl_cont ;an000;we have a space
+
+ ifdef DBCS ;an000;is this a kanji assembly
+ call testkanj ;an000;do we have a dbcs lead byte
+; $if nz ;an000;yes, we have a lead byte
+ JZ $$IF5
+ cmp al,DB_SP_HI ;an000;is it DB_SP_HI
+; $if z ;an000;it is DB_SP_HI
+ JNZ $$IF6
+ mov bl,ds:[si] ;an000;set up for compare
+ cmp bl,DB_SP_LO ;an000;is it DB_SP_LO
+; $if z ;an000;we have an asian blank
+ JNZ $$IF7
+ lodsb ;an000;skip byte containing 81h
+ jmp kill_bl_cont
+; $endif ;an000;
+$$IF7:
+; $endif ;an000;fall through no delim
+$$IF6:
+ ; found
+; $endif ;an000;end test for dbcs lead byte
+$$IF5:
+ endif ;an000;end conditional assembly
+
+ pop bx ;an000;restore affected reg.
+ return
+
+;----- Capitalize the character in AL ----------------------------------;
+; ;
+; Input: ;
+; ;
+; AL contains a character to capitalize ;
+; ;
+; Output: ;
+; ;
+; AL contains a capitalized character ;
+; ;
+;-----------------------------------------------------------------------;
+
+MAKE_CAPS:
+ CMP AL,"a"
+ JB CAPS1
+ CMP AL,"z"
+ifdef DBCS
+ JA CAPS1 ; M003 MSKK TAR 476, kana chars
+else
+ JG CAPS1
+endif
+ AND AL,0DFH
+CAPS1:
+ return
+
+QUIT:
+ CMP ParamCt,1
+ JZ Quit1
+CERR: JMP ComErr
+Quit1: CMP Param1,0
+ JNZ CERR
+ MOV DX,OFFSET DG:QMES_ptr
+ call std_printf
+
+IFDEF DBCS
+ CALL TESTKANJ
+ JZ ASCII
+ MOV AX, (STD_CON_INPUT_FLUSH SHL 8) + 0
+ INT 21H ; Eat the trailing byte.
+ JMP CRLF
+ASCII:
+ENDIF
+;=========================================================================
+; We are invoking the VAL_YN proc here. This will replace the
+; method of Y/N validation used prior to DOS 4.00.
+;
+; Date : 6/10/87
+;=========================================================================
+
+ call val_yn ;an000;pass Y/N byte in AL to macro
+ cmp ax,yes ;an000;did we return a Y
+ jz NoCRLF ;an000; dms; close the file
+ cmp ax,no ;an000; dms; return N?
+; $if ne ;an000; dms; neither N or Y - reprompt
+ JE $$IF11
+ call crlf ; spit out crlf
+ jmp Quit1 ;an000; dms; reprompt
+; $endif ;an000; dms;
+$$IF11:
+ call crlf ; spit out CRLF
+ return ;an000; dms;
+
+;=========================================================================
+; End of Y/N validation check for qmes_ptr
+;=========================================================================
+
+NOCRLF:
+ MOV BX,[WRT_HANDLE]
+ MOV AH,CLOSE
+ INT 21H
+ MOV DX,OFFSET DG:TEMP_PATH
+ MOV AH,UNLINK
+ INT 21H
+ mov ah,exit
+ xor al,al
+ INT 21H
+
+QUERY:
+ TEST BYTE PTR [QFLG],-1
+ retz
+ MOV DX,OFFSET DG:ASK_ptr
+ call std_printf
+ PUSH AX
+ CALL CRLF
+ POP AX
+IFDEF DBCS
+ CALL TESTKANJ
+ JZ ASCII1
+ PUSH AX
+ MOV AX,(STD_CON_INPUT_FLUSH SHL 8) + 0
+ INT 21H ;Eat the trailing byte
+ XOR AX,AX
+ INC AX ; non zero flag
+ POP AX
+ return
+ASCII1:
+ENDIF
+ CMP AL,13 ;Carriage return means yes
+ retz
+;=========================================================================
+; We are invoking the VAL_YN proc here. This will replace the
+; method of Y/N validation used prior to DOS 4.00.
+; This invocation of val_yn will return ZR if Y is found, otherwise
+; it will return NZ.
+;
+; Date : 6/10/87
+;=========================================================================
+
+ call val_yn ;an000;pass Y/N byte in AL to macro
+ cmp ax,yes ;an000;did we return a Y
+ je Query_Exit ;an000; dms; exit Y/N validation
+ cmp ax,no ;an000; dms; N response?
+ jne Query ;an000; dms; no - reprompt user
+ cmp ax,yes ;an000; dms; must have N response - force
+ ; NZ flag
+Query_Exit:
+
+
+;=========================================================================
+; End of Y/N validation check for ask_ptr
+;=========================================================================
+
+ return
+
+;=========================================================================
+; EDLIN_DISP_COUNT: This routine will determine the number of lines
+; actually displayed to the screen. Lines displayed to
+; the screen for one EDLIN line printed will be calculated
+; by the following formula:
+;
+; LINES_PRINTED = (LINE_LEN + 10) / SCREEN_WIDTH
+;
+; LINES_PRINTED - Actual number of lines printed on screen
+; for one EDLIN line. If LINES_PRINTED has
+; a remainder, it will be rounded up.
+;
+; LINE_LEN - The length, in bytes, of the EDLIN line
+; printed.
+;
+; SCREEN_WIDTH - The width in bytes of the current display.
+;
+; Inputs : DI - offset into buffer containing line printed
+; DISP_WIDTH - width of current video output
+;
+; Outputs: LC_ADJ - factor to adjust line counter by
+;
+; Date : 6/10/87
+;=========================================================================
+
+EDLIN_DISP_COUNT proc near ;an000;lines printed
+
+ push dx ;an000;save affected regs
+ push di ;an000;
+ push ax ;an000;
+ push bx ;an000;
+ push cx ;an000;
+
+ mov bx,offset dg:arg_buf ;an000;arg_buf holds line
+ ; printed
+ mov ax,di ;an000;where print line ends
+ sub ax,bx ;an000;diff = line's length
+ add ax,10 ;an000;adjust for leading blks
+ mov cl,dg:disp_width ;an000;set up for division
+ div cl ;an000;divide AX by the
+ ; width of the console
+ cmp ah,0 ;an000;see if a remainder
+; $if nz ;an000;if a remainder
+ JZ $$IF13
+ add al,1 ;an000;increment AL 1
+ ; to round upward
+; $endif ;an000;
+$$IF13:
+
+ mov lc_adj,al ;an000;number of lines printed
+ ; on console
+ pop cx ;an000;restore affected regs
+ pop bx ;an000;
+ pop ax ;an000;
+ pop di ;an000;
+ pop dx ;an000;
+
+ ret ;an000;return to caller
+
+EDLIN_DISP_COUNT endp ;an000;end proc
+
+;=========================================================================
+; EDLIN_PG_COUNT : This routine determines whether or not we will continue
+; displaying text lines based on the count of lines that
+; can be output to the current video screen.
+;
+; Inputs : LC_ADJ - adjustment factor for number of lines printed
+; PG_COUNT - number of lines remaining on current video
+; display
+; DX - holds the total number of lines to print
+; CONTINUE - signals if the user wants to continue
+; printing lines.
+;
+; Outputs: LC_FLAG - used to signal completion of print
+;
+; Date : 6/10/87
+;=========================================================================
+
+EDLIN_PG_COUNT proc near ;an000;track remaining lines
+
+ push ax ;an000;save affected regs
+
+ mov lc_flag,true ;an000;init. flag to signal
+ ; continue printing
+
+ mov al,pg_count ;an000;set up for page adj.
+ cmp al,lc_adj ;an000;see if we are at end
+; $if be ;an000
+ JNBE $$IF15
+ mov pg_count,0 ;an000;set pg_count to 0
+; $else
+ JMP SHORT $$EN15
+$$IF15:
+ sub al,lc_adj ;an000;adjust number of lines
+ mov pg_count,al ;an000;save remaining line ct.
+; $endif ;an000;
+$$EN15:
+
+ dec dx ;an000;decrease total number
+ ; of lines to print by 1
+; $if nz ;an000;more lines to print
+ JZ $$IF18
+ cmp pg_count,0 ;an000;have we printed screen
+; $if be ;an000;we have printed screen
+ JNBE $$IF19
+ call EDLIN_PG_PROMPT ;an000;prompt the user to
+ ; "Continue(Y/N)?"
+ cmp continue,true ;an000;did user say continue
+; $if z ;an000;continue
+ JNZ $$IF20
+ mov al,dg:disp_len ;an000;begin init of screen
+; dec al ;an000; length
+ mov pg_count,al ;an000;
+; $else ;an000;do not continue
+ JMP SHORT $$EN20
+$$IF20:
+ mov lc_flag,false ;an000;signal no more to print
+; $endif ;an000;
+$$EN20:
+; $endif ;an000;
+$$IF19:
+; $else ;an000;total lines printed
+ JMP SHORT $$EN18
+$$IF18:
+ mov lc_flag,false ;an000;signal no more to print
+; $endif ;an000;
+$$EN18:
+
+ pop ax ;an000;restore affected regs
+
+ ret ;an000;return to caller
+
+EDLIN_PG_COUNT endp ;an000;end procedure
+
+;=========================================================================
+; EDLIN_PG_PROMPT : This routine prompts the user as to whether or not to
+; continue printing lines to the video display, if lines
+; are still present for printing.
+;
+; Inputs : none
+;
+; Outputs: CONTINUE - flag that signals other routines whether or
+; not to continue printing.
+;
+; Date : 6/10/87
+;=========================================================================
+
+EDLIN_PG_PROMPT proc near ;an000;ask user to continue?
+
+ push dx ;an000;save affected regs.
+ push ax ;an000;
+
+EPP_Reprompt:
+
+ mov dx,offset dg:cont_ptr ;an000;point to Continue msg.
+ call std_printf ;an000;invoke message ret.
+
+ push ax ;an000;save affected regs.
+ call crlf ;an000;send crlf
+ pop ax ;an000;restore affected regs.
+
+ call val_yn ;an000;Y/N validation
+
+ cmp ax,yes ;an000;did we have a Y
+ jz EPP_True_Exit ;an000;we had a Y
+ cmp ax,no ;an000;did we have a N
+ jz EPP_False_Exit ;an000;yes
+ jmp EPP_Reprompt ;an000;neither Y or N - reprompt
+
+EPP_True_Exit:
+
+ mov Continue,True ;an000;flag Y found
+ jmp short EPP_Exit ;an000;exit routine
+
+EPP_False_Exit:
+
+ mov Continue,False ;an000;flag N found
+
+EPP_Exit:
+
+ pop ax ;an000;restore affected regs.
+ pop dx ;an000;
+
+ ret ;an000;return to caller
+
+EDLIN_PG_PROMPT endp ;an000;end procedure
+
+;=========================================================================
+; val_yn: This proc validates a Y/N response entered by the user. The
+; routine uses the new functionality of "GET EXTENDED COUNTRY
+; INFORMATION" being implemented in DOS 4.00.
+;
+; Inputs : AL - character to be validated for Y/N response
+;
+; Outputs: AX - 00h = "N"o
+; - 01h = "Y"es
+;=========================================================================
+
+val_yn proc near ;an000;validate Y/N response
+
+ push dx ;an000;save affected registers
+ push cx ;an000;
+ push bx ;an000;
+
+ mov dl,al ;an000;character to be checked for Y/N
+ mov ah,GetExtCntry ;an000;get extended country information
+ mov al,yn_chk ;an000;perform Y/N checking
+ mov cx,max_len ;an000;max. len. of Y/N char.
+ int 21h ;an000;invoke function
+
+ pop bx ;an000;restore affected registers
+ pop cx ;an000;
+ pop dx ;an000;
+
+ ret ;an000;return to caller
+
+val_yn endp ;an000;end proc
+
+
+
+code ends
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlequ.asm b/private/mvdm/dos/v86/cmd/edlin/edlequ.asm
new file mode 100644
index 000000000..ba00919b0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlequ.asm
@@ -0,0 +1,164 @@
+ page 60,132 ;
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+ .xlist
+ include version.inc
+ include DOSSYM.INC
+ include EDLSTDSW.INC
+ .list
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLEQU.SAL
+;
+; DESCRIPTIVE NAME: EQUATES FOR EDLIN
+;
+; FUNCTION: PROVIDES EQUATES FOR EDLIN. IT ALSO PROVIDES THE MACRO
+; VAL_YN.
+;
+; ENTRY POINT: NA
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; ROUTINE: VAL_YN - VALIDATES Y/N RESPONSES FROM THE KEYBOARD
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: NA
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT SYSPARSE
+; - IMPLEMENT MESSAGE RETRIEVER
+; - IMPLEMENT DBCS ENABLING
+; - ENHANCED VIDEO SUPPORT
+; - EXTENDED OPENS
+; - SCROLLING ERROR
+;
+; COPYRIGHT: "MS DOS EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+
+
+
+
+
+COMAND_LINE_LENGTH EQU 128
+QUOTE_CHAR EQU 16H ;Quote character = ^V
+CR EQU 13
+STKSIZ EQU 200h
+STACK equ stksiz
+
+asian_blk equ DB_SP_LO ;an000;asian blank 2nd. byte
+dbcs_lead_byte equ DB_SP_HI ;an000;asian blank lead byte
+nul equ 00h ;an000;nul character
+Access_Denied equ 0005h ;an000;extended error code for access denied
+
+;======== Y/N validation equates =========================================
+
+yn_chk equ 23h ;an000;check for Y/N response
+max_len equ 01h ;an000;max. len. for Y/N char.
+yes equ 01h ;an000;boolean yes value
+no equ 00h ;an000;boolean no value
+
+;======== text display values for initialization =========================
+
+video_get equ 0fh ;an000;int 10 get video attributes
+video_set equ 00h ;an000;int 10 set video attributes
+video_text equ 03h ;an000;80 X 25 color monitor
+
+;======== code page values for functions =================================
+
+get_set_cp equ 66h ;an000;get or set code page
+get_cp equ 01h ;an000;get active code page
+set_cp equ 02h ;an000;set active code page
+
+;======== screen length & width defaults =================================
+
+std_out equ 01h ;an000;console output
+display_attr equ 03h ;an000;display for IOCTL
+Get_Display equ 7fh ;an000;Get display for IOCTL
+ifndef JAPAN
+Def_Disp_Len equ 25 ;an000;default display length
+else ; if JAPAN
+Def_Disp_Len equ 24
+endif
+Def_Disp_Width equ 80 ;an000;default display width
+
+;======== extended open equates ==========================================
+
+rw equ 0082h ;an000;read/write
+ ; compatibility
+ ; noinherit
+ ; int 24h handler
+ ; no commit
+
+ext_read equ 0080h ;an000;read
+ ; compatibility
+ ; noinherit
+ ; int 24h handler
+ ; no commit
+
+rw_flag equ 0101h ;an000;fail if file not exist
+ ; open if file exists
+ ; don't validate code page
+
+creat_flag equ 0110h ;an000;create if file does not exist
+ ; fail if file exists
+ ; don't validate code page
+
+open_flag equ 0101h ;an000;fail if file not exist
+ ; open if file exists
+ ; don't validate code page
+
+creat_open_flag equ 0112h ;an000;create if file does not exist
+ ; open/replace if file exists
+ ; don't validate code page
+
+attr equ 00h ;an000;attributes set to 0
+
+;======== parse value equates ============================================
+
+nrm_parse_exit equ 0ffffh ;an000;normal exit from sysparse
+too_many equ 01h ;an000;too many parms entered
+op_missing equ 02h ;an000;required operand missing
+sw_missing equ 03h ;an000;not a valid switch
+
+
+;======== Strucs =========================================================
+
+Display_Buffer_Struc Struc ;an000;dms;
+
+ Display_Info_Level db ? ;an000;dms;
+ Display_Reserved db ? ;an000;dms;
+ Display_Buffer_Size dw ? ;an000;dms;
+ Display_Flags dw ? ;an000;dms;
+ Display_Mode db ? ;an000;dms;
+ ; TEXT=01
+ ; APA =02
+ Display_Mode_Reserved db ? ;an000;dms;
+ Display_Colors dw ? ;an000;dms;# of colors
+ Display_Width_Pixels dw ? ;an000;dms;# of pixels in width
+ Display_Length_Pixels dw ? ;an000;dms;# of pixels in len.
+ Display_Width_Char dw ? ;an000;dms;# of chars in width
+ Display_Length_Char dw ? ;an000;dms;# of chars in length
+
+Display_Buffer_Struc ends ;an000;dms;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlin.asm b/private/mvdm/dos/v86/cmd/edlin/edlin.asm
new file mode 100644
index 000000000..a7f2d5cf1
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlin.asm
@@ -0,0 +1,1885 @@
+ PAGE 60,132;
+ TITLE EDLIN
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLIN.SAL
+;
+; DESCRIPTIVE NAME: LINE TEXT EDITOR
+;
+; FUNCTION: EDLIN IS A SIMPLE, LINE ORIENTED TEXT EDITOR. IT PROVIDES
+; USERS OF DOS THE ABILITY TO CREATE AND EDIT TEXT FILES.
+;
+; ENTRY POINT: EDLIN
+;
+; INPUT: DOS COMMAND LINE
+; EDLIN COMMANDS
+; TEXT
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES:
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: EDLCMD1 - CONTAINS ROUTINES CALLED BY EDLIN
+; EDLCMD1 - CONTAINS ROUTINES CALLED BY EDLIN
+; EDLMES - CONTAINS ROUTINES CALLED BY EDLIN
+;
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - REVISIONS MADE RELATE TO THE FOLLOWING:
+;
+; - IMPLEMENT SYSPARSE
+; - IMPLEMENT MESSAGE RETRIEVER
+; - IMPLEMENT DBCS ENABLING
+; - ENHANCED VIDEO SUPPORT
+; - EXTENDED OPENS
+; - SCROLLING ERROR
+;
+; COPYRIGHT: "MS DOS EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft"
+;
+;
+; MICROSOFT REVISION HISTORY:
+; ;
+; V1.02 ;
+; ;
+; V2.00 9/13/82 M.A.U ;
+; ;
+; 2/23/82 Rev. 13 N. P ;
+; Changed to 2.0 system calls. ;
+; Added an error message for READ-ONLY files ;
+; ;
+; 11/7/83 Rev. 14 N. P ;
+; Changed to .EXE format and added Printf ;
+; ;
+; V2.50 11/15/83 Rev. 1 M.A. U ;
+; Official dos 2.50 version. Some random bug ;
+; fixes and message changes. ;
+; ;
+; 11/30/83 Rev. 2 MZ ;
+; Close input file before rename. ;
+; Jmp to replace after line edit ;
+; ;
+; 02/01/84 Rev. 3 M.A. U ;
+; Now it is called 3.00 dos. Repaired problem ;
+; with using printf and having %'s as data. ;
+; ;
+; 02/15/84 MZ make out of space a fatal error with output;
+; ;
+; 03/28/84 MZ fixes bogus (totally) code in MOVE/COPY ;
+; ;
+; 04/02/84 MZ fixes DELETE and changes MOVE/COPY/EDIT ;
+; ;
+; V3.20 08/29/86 Rev. 1 S.M. G ;
+; ;
+; 08/29/86 M001 MSKK TAR 593, TAB MOVEMENT ;
+; ;
+; 08/29/86 M002 MSKK TAR 157, BLKMOVE 1,1,1m, 1,3,1m ;
+; ;
+; 08/29/86 M003 MSKK TAR 476, EDLCMD2,MAKECAPS,kana char ;
+; ;
+; 08/29/86 M004 MSKK TAR 191, Append load size ;
+; ;
+; 08/29/86 M005 IBMJ TAR Transfer Load command ;
+; ;
+; 04/17/90 c-PaulB ;
+; Added /? switch to display options ;
+; Files changed: edlin.asm, edlparse.asm, edlmes.asm, ;
+; edlin.skl. ;
+; ;
+;======================= END OF SPECIFICATIONS =========================== ;
+
+include version.inc
+include intnat.inc
+include syscall.inc
+include edlequ.asm
+
+
+SUBTTL Contants and Data areas
+PAGE
+ extrn parser_command:near ;an000;SYSPARSE
+
+CODE SEGMENT PUBLIC
+CODE ENDS
+
+CONST SEGMENT PUBLIC WORD
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC WORD
+DATA ENDS
+
+DG GROUP CODE,CONST,cstack,DATA
+
+CONST SEGMENT PUBLIC WORD
+
+ public bak,$$$file,delflg,loadmod,txt1,txt2
+
+ EXTRN BADDRV:abs,NDNAME:abs
+ EXTRN opt_err_ptr:word,NOBAK:abs,BADCOM:abs
+ EXTRN NEWFIL:abs,DEST:abs,MRGERR:abs
+ EXTRN NODIR:abs,FILENM_ptr:word,ro_err:abs
+ EXTRN bcreat:abs,msg_too_many:abs,msg_lf:abs
+ EXTRN prompt:abs,MemFul_Ptr:word,simple_msg:word
+ extrn dsp_options:abs
+ extrn dsp_help:abs,num_help_msgs:abs
+
+BAK DB ".BAK",0
+
+$$$FILE DB ".$$$",0
+
+fourth db 0 ;fourth parameter flag
+
+loadmod db 0 ;Load mode flag, 0 = ^Z marks the
+ ; end of a file, 1 = viceversa.
+optchar db "-"
+
+TXT1 DB 0,80H DUP (?)
+TXT2 DB 0,80H DUP (?)
+DELFLG DB 0
+fNew DB 0 ; old file
+HAVEOF DB 0
+
+CONST ENDS
+
+cstack segment stack
+ db stksiz dup (?)
+cstack ends
+
+DATA SEGMENT PUBLIC WORD
+
+ extrn arg_buf_ptr:word ;an000;
+ extrn line_num_buf_ptr:word ;an000;
+
+ public path_name,ext_ptr,start,line_num,line_flag
+ public arg_buf,wrt_handle,temp_path
+ public current,pointer,qflg,editbuf,amnt_req,fname_len,delflg,lastlin
+ public olddat,oldlen,newlen,srchflg,srchmod
+ public comline,lstfnd,numpos,lstnum,last_mem,srchcnt
+ public rd_handle,haveof,ending,three4th,one4th
+
+ public lc_adj ;an000;page length adj. factor
+ public lc_flag ;an000;display cont. flag
+ public pg_count ;an000;lines left on screen
+ public Disp_Len ;an000;display length
+ public Disp_Width ;an000;display width
+ public continue ;an000;boolean T/F
+ public temp_path ;an000;pointer to filespec buf
+
+Video_Buffer label word ;an000;buffer for video attr
+ db 0 ;an000;dms;
+ db 0 ;an000;dms;
+ dw 14 ;an000;dms;
+ dw 0 ;an000;dms;
+ db ? ;an000;dms;
+ db 0 ;an000;dms;
+ dw ? ;an000;dms;# of colors
+ dw ? ;an000;dms;# of pixels in width
+ dw ? ;an000;dms;# of pixels in len.
+ dw ? ;an000;dms;# of chars in width
+ dw ? ;an000;dms;# of chars in length
+
+
+video_org db ? ;an000;original video mode on
+ ; entry to EDLIN.
+lc_adj db ? ;an000;page length adj. factor
+lc_flag db ? ;an000;display cont. flag
+pg_count db ? ;an000;lines left on screen
+Disp_Len db ? ;an000;display length
+Disp_Width db ? ;an000;display width
+continue db ? ;an000;boolean T/F
+
+
+;-----------------------------------------------------------------------;
+; This is a table that is sequentially filled via GetNum. Any additions to it
+; must be placed in the correct position. Currently Param4 is known to be a
+; count and thus is treated specially.
+
+ public param1,param2,Param3,param4,ParamCt
+PARAM1 DW ?
+PARAM2 DW ?
+PARAM3 DW ?
+PARAM4 DW ?
+ParamCt DW ? ; count of passed parameters
+ ifdef DBCS ; Used in TESTKANJ:
+LBTbl dd ? ; long pointer to lead byte table
+ endif ; in the dos (from syscall 63H)
+
+;-----------------------------------------------------------------------;
+
+PUBLIC PTR_1, PTR_2, PTR_3, OLDLEN, NEWLEN, LSTFND, LSTNUM, NUMPOS, SRCHCNT
+PUBLIC CURRENT, POINTER, ONE4TH, THREE4TH, LAST_MEM, ENDTXT, COPYSIZ
+PUBLIC COMLINE, LASTLIN, COMBUF, EDITBUF, EOL, QFLG, ENDING, SRCHFLG
+PUBLIC PATH_NAME, FNAME_LEN, RD_HANDLE, TEMP_PATH, WRT_HANDLE, EXT_PTR
+PUBLIC MRG_PATH_NAME, MRG_HANDLE, amnt_req, olddat, srchmod, MOVFLG, org_ds
+ifdef DBCS
+public lbtbl
+endif
+
+;
+; These comprise the known state of the internal buffer. All editing
+; functions must preserve these values.
+;
+CURRENT DW ? ; the 1-based index of the current line
+POINTER DW ? ; pointer to the current line
+ENDTXT DW ? ; pointer to end of buffer. (at ^Z)
+LAST_MEM DW ? ; offset of last byte of memory
+;
+; The label Start is the beginning of the in-core buffer.
+;
+
+;
+; Internal temporary pointers
+;
+PTR_1 DW ?
+PTR_2 DW ?
+PTR_3 DW ?
+
+QFLG DB ? ; TRUE => query for replacement
+OLDLEN DW ?
+NEWLEN DW ?
+LSTFND DW ?
+LSTNUM DW ?
+NUMPOS DW ?
+SRCHCNT DW ?
+ONE4TH DW ?
+THREE4TH DW ?
+COPYSIZ DW ? ; total length to copy
+COPYLEN DW ? ; single copy length
+COMLINE DW ?
+LASTLIN DW ?
+COMBUF DB 82H DUP (?)
+EDITBUF DB 258 DUP (?)
+EOL DB ?
+ENDING DB ?
+SRCHFLG DB ?
+PATH_NAME DB 128 DUP(0)
+FNAME_LEN DW ?
+RD_HANDLE DW ?
+TEMP_PATH DB 128 DUP(?)
+WRT_HANDLE DW ?
+EXT_PTR DW ?
+MRG_PATH_NAME DB 128 DUP(?)
+MRG_HANDLE DW ?
+amnt_req dw ? ; amount of bytes requested to read
+olddat db ? ; Used in replace and search, replace
+ ; by old data flag (1=yes)
+srchmod db ? ; Search mode: 1=from current+1 to
+ ; end of buffer, 0=from beg. of
+ ; buffer to the end (old way).
+MOVFLG DB ?
+org_ds dw ? ;Orginal ds points to header block
+
+arg_buf db 258 dup (?)
+
+EA_Flag db False ;an000; dms;set to false
+
+EA_Buffer_Size dw ? ;an000; dms;EA buffer's size
+
+EA_Parm_List label word ;an000; dms;EA parms
+ dd dg:Start ;an000; dms;ptr to EA's
+ dw 0001h ;an000; dms;additional parms
+ db 06h ;an000; dms;
+ dw 0002h ;an000; dms;iomode
+
+
+line_num dw ?
+
+line_flag db ?,0
+ EVEN ;align on word boundaries
+;
+; Byte before start of data buffer must be < 40H !!!!!!
+;
+ dw 0 ;we scan backwards looking for
+ ;a character which can't be part
+ ;of a two-byte seqence. This
+ ;double byte sequence will cause the back
+ ;scan to stop here.
+START LABEL WORD
+
+DATA ENDS
+
+
+CODE SEGMENT PUBLIC
+
+ASSUME CS:DG,DS:NOTHING,ES:NOTHING,SS:CStack
+
+
+
+ extrn pre_load_message:near ;an000;message loader
+ extrn disp_fatal:near ;an000;fatal message
+ extrn printf:near ;an000;new PRINTF routine
+
+ extrn findlin:near,shownum:near,loadbuf:near,crlf:near,lf:near
+ extrn abortcom:near,delbak:near,unquote:near,kill_bl:near
+ extrn make_caps:near,dispone:near,display:near,query:near
+ extrn quit:near,make_cntrl:near,scanln:near,scaneof:near
+ extrn fndfirst:near,fndnext:near,replace:near,memerr:near
+ extrn xerror:near
+ extrn zerror:near
+ extrn bad_read:near,append:near
+ extrn nocom:near,pager:near,list:near,search_from_curr:near
+ extrn replac_from_curr:near,ewrite:near,wrt:near,delete:near
+
+
+ extrn filespec:byte ;an000;parser's filespec
+ extrn parse_switch_b:byte ;an000;result of switch scan
+ extrn parse_switch_?:byte ; result of switch scan
+
+ public std_printf,command,chkrange,comerr
+ public display_message
+ ; exit from EDLIN
+
+ IFDEF DBCS
+ extrn testkanj:near
+ ENDIF
+
+EDLIN:
+ JMP SHORT SIMPED
+
+std_printf proc near ;ac000;convert to proc
+
+ push dx
+ call printf
+ pop dx ;an000;balance the push
+ ret
+
+std_printf endp ;ac000;end proc
+
+Break <Dispatch Table>
+
+;-----------------------------------------------------------------------;
+; Careful changing the order of the next two tables. They are linked and
+; changes should be be to both.
+
+COMTAB DB 13,";ACDEILMPQRSTW"
+NUMCOM EQU $-COMTAB
+
+TABLE DW BLANKLINE ; Blank line
+ DW NOCOM ; ;
+ DW APPEND ; A(ppend)
+ DW COPY ; C(opy)
+ DW DELETE ; D(elete)
+ DW ENDED ; E(xit)
+ DW INSERT ; I(nsert)
+ DW LIST ; L(ist)
+ DW MOVE ; M(ove)
+ DW PAGER ; P(age)
+ DW QUIT ; Q(uit)
+ dw replac_from_curr ; R(eplace)
+ dw search_from_curr ; S(earch)
+ DW MERGE ; T(merge)
+ DW EWRITE ; W(rite)
+
+Break <Initialization Code>
+
+NONAME:
+ mov ax,NDNAME
+ jmp zerror
+
+SIMPED:
+ mov org_ds,DS
+ push ax ;ac000;save for drive compare
+
+ push cs ;an000;exchange cs/es
+ pop es ;an000;
+
+ push cs ;an000;exchange cs/ds
+ pop ds ;an000;
+ assume ds:dg,es:dg ;an000;establish addressibility
+
+ MOV dg:ENDING,0
+ mov sp,stack
+ call EDLIN_DISP_GET ;an000;get current video
+ ; mode & set it to
+ ; text
+
+;=========================================================================
+; invoke PRE_LOAD_MESSAGE here. If the messages were not loaded we will
+; exit with an appropriate error message.
+;
+; Date : 6/14/87
+;=========================================================================
+
+ call PRE_LOAD_MESSAGE ;an000;invoke SYSLOADMSG
+; $if c ;an000;if the load was unsuccessful
+ JNC $$IF1
+ mov ah,exit ;an000;exit EDLIN. PRE_LOAD_MESSAGE
+ ; has said why we are exiting
+ mov al,00h ;an000
+ int 21h ;an000;exit
+; $endif ;an000;
+$$IF1:
+
+
+
+VERS_OK:
+;----- Check for valid drive specifier --------------------------------;
+
+ pop ax
+ OR AL,AL
+ JZ get_switch_char
+ mov ax,BADDRV
+ jmp zerror
+get_switch_char:
+ MOV AX,(CHAR_OPER SHL 8) ;GET SWITCH CHARACTER
+ INT 21H
+ CMP DL,"/"
+ JNZ CMD_LINE ;IF NOT / , THEN NOT PC
+ MOV OPTCHAR,"/" ;IN PC, OPTION CHAR = /
+
+ IFDEF DBCS
+ push ds ; SAVE! all regs destroyed on this
+ push es
+ push si ; call !!
+ mov ax,(ECS_call shl 8) or 00h ; get kanji lead tbl
+ int 21h
+assume ds:nothing
+assume es:nothing
+ mov word ptr [LBTbl],si
+ mov word ptr [LBTbl+2],ds
+ pop si
+ pop es
+ pop ds
+assume ds:dg
+assume es:dg
+ ENDIF
+
+
+CMD_LINE:
+ push cs
+ pop es
+ ASSUME ES:DG
+
+;----- Process any options ------------------------------------------;
+
+;=========================================================================
+; The system parser, called through PARSER_COMMAND, parses external
+; command lines. In the case of EDLIN we are looking for two parameters
+; on the command line.
+;
+; Parameter 1 - Filespec (REQUIRED)
+; Parameter 2 - \B switch (OPTIONAL)
+;
+; PARSER_COMMAND - exit_normal : ffffh
+; exit_error : not = ffffh
+;=========================================================================
+
+
+ call PARSER_COMMAND ;an000;invoke sysparse
+ ; DMS:6/11/87
+
+ ; Check for /? switch.
+ ; If so, display the options
+ ; and exit.
+ ;
+ ; This is done first so that if the user typed
+ ; /? along with unknown commands, they can get
+ ; a coherent message without being over-errored.
+ ;
+ ; 4/17/90 c-PaulB
+
+ cmp [parse_switch_?], true ; is the /? switch on?
+ jne CheckOptionsDone ; skip the rest of this if not
+
+ mov ax,dsp_options
+ call display_message
+
+ mov al, 0 ; get an okay exit code
+ mov ah, exit ; and
+ int 21h ; bail out.
+
+CheckOptionsDone:
+
+ cmp ax,nrm_parse_exit ;an000;was it a good parse
+; $if z ;an000;it was a good parse
+ JNZ $$IF3
+ call EDLIN_COMMAND ;an000;interface results
+ ; into EDLIN
+; $else ;an000;
+ JMP SHORT $$EN3
+$$IF3:
+ cmp ax,too_many ;an000;too many operands
+; $if z ;an000;we have too many
+ JNZ $$IF5
+ jmp short badopt ;an000;say why and exit
+; $endif
+$$IF5:
+
+ cmp ax,op_missing ;an000;required parm missing
+; $if z ;an000;missing parm
+ JNZ $$IF7
+ifdef DBCS
+ jmp noname ;an000;say why and exit
+else
+ jmp short noname ;an000;say why and exit
+endif
+; $endif ;an000;
+$$IF7:
+
+ cmp ax,sw_missing ;an000;is it an invalid switch
+; $if z ;an000;invalid switch
+ JNZ $$IF9
+ jmp short badopt ;an000;say why and exit
+; $endif ;an000;
+$$IF9:
+
+; $endif ;an000;
+$$EN3:
+
+;=========================================================================
+;======================= begin .BAK check ================================
+; Check for .BAK extension on the filename
+
+ push ds ;an000;save reg.
+ push cs ;an000;set up addressibility
+ pop ds ;an000;
+ assume ds:dg ;an000;
+
+ push ax ;an000;save reg.
+ mov ax,offset dg:path_name ;an000;point to path_name
+ add ax,[fname_len] ;an000;calculate end of path_name
+ mov si,ax ;an000;point to end of path_name
+ pop ax ;an000;restore reg.
+
+ MOV CX,4 ;compare 4 bytes
+ SUB SI,4 ;Point 4th to last char
+ MOV DI,OFFSET DG:BAK ;Point to string ".BAK"
+ REPE CMPSB ;Compare the two strings
+ pop ds
+ ASSUME DS:NOTHING
+ JNZ NOTBAK
+ JMP HAVBAK
+
+;======================= end .BAK check ==================================
+
+;======================= begin NOTBAK ====================================
+; we have a file without a .BAK extension, try to open it
+
+NOTBAK:
+ push ds
+ push cs
+ pop ds
+ ASSUME DS:DG
+
+;=========================================================================
+; implement EXTENDED OPEN
+;=========================================================================
+
+ push es ;an000;save reg.
+ mov bx,RW ;an000;open for read/write
+ mov cx,ATTR ;an000;file attributes
+ mov dx,RW_FLAG ;an000;action to take on open
+ mov di,0ffffh ;an000;nul parm list
+
+ call EXT_OPEN1 ;an000;open for R/W;DMS:6/10/87
+ pop es ;an000;restore reg.
+
+;=========================================================================
+ pop ds
+ ASSUME DS:NOTHING
+ JC CHK_OPEN_ERR ;an open error occurred
+ MOV RD_HANDLE,AX ;Save the handle
+
+ Jmp HavFil ;work with the opened file
+
+;======================= end NOTBAK ======================================
+
+Badopt:
+ MOV DX,OFFSET DG:OPT_ERR_ptr;Bad option specified
+ JMP XERROR
+
+;=========================================================================
+;
+; The open of the file failed. We need to figure out why and report the
+; correct message. The circumstances we can handle are:
+;
+; open returns pathnotfound => bad drive or file name
+; open returns toomanyopenfiles => too many open files
+; open returns access denied =>
+; chmod indicates read-only => cannot edit read only file
+; else => file creation error
+; open returns filenotfound =>
+; creat ok => close, delete, new file
+; creat fails => file creation error
+; else => file cre
+;
+
+CHK_OPEN_ERR:
+ cmp ax,error_path_not_found
+ jz BadDriveError
+ cmp ax,error_too_many_open_files
+ jz TooManyError
+ cmp ax,error_access_denied
+ jnz CheckFNF
+ push ds
+ push cs
+ pop ds
+ assume ds:dg
+ mov ax,(chmod shl 8)
+ MOV DX,OFFSET DG:PATH_NAME
+ int 21h
+ jc FileCreationError
+ test cx,attr_read_only
+ jz FileCreationError
+ jmp short ReadOnlyError
+
+CheckFNF:
+ cmp ax,error_file_not_found
+ jnz FileCreationError
+;
+; Try to create the file to see if it is OK.
+;
+ push ds
+ push cs
+ pop ds
+ assume ds:dg
+;=========================================================================
+; implement EXTENDED OPEN
+;=========================================================================
+
+ mov bx,RW ;an000;open for read/write
+ mov cx,ATTR ;an000;file attributes
+ mov dx,CREAT_FLAG ;an000;action to take on open
+ mov di,0ffffh ;an000;null parm list
+ call EXT_OPEN1 ;an000;create file;DMS:6/10/87
+
+;=========================================================================
+
+ pop ds
+ assume ds:nothing
+ jc CreateCheck
+ mov bx,ax
+ mov ah,close
+ int 21h
+ push ds
+ push cs
+ pop ds
+ assume ds:dg
+ mov ah,unlink
+ MOV DX,OFFSET DG:PATH_NAME
+ int 21h
+ pop ds
+ assume ds:nothing
+ jc FileCreationError ; This should NEVER be taken!!!
+ MOV HAVEOF,0FFH ; Flag from a system 1.xx call
+ MOV fNew,-1
+ JMP short HAVFIL
+
+CreateCheck:
+ cmp ax,error_access_denied
+ jnz BadDriveError
+DiskFull:
+ mov ax,NODIR
+ jmp zerror
+
+FileCreationError:
+ mov ax,bcreat
+ jmp zerror
+
+ReadOnlyError:
+ mov ax,RO_ERR
+ jmp zerror
+
+BadDriveError:
+ mov ax,BADDRV
+ jmp zerror
+
+TooManyError:
+ mov ax,msg_too_many
+ jmp zerror
+
+
+CREAT_ERR:
+ CMP DELFLG,0
+ JNZ DiskFull
+ push cs
+ pop ds
+ CALL DELBAK
+ JMP short MAKFIL
+
+HAVBAK:
+ mov ax,NOBAK
+ jmp zerror
+
+HAVFIL:
+ push cs
+ pop ds
+ ASSUME DS:DG
+ CMP fNew,0
+ JZ MakeBak
+ mov ax,newfil
+ call display_message
+MakeBak:
+ MOV SI,OFFSET DG:PATH_NAME
+ MOV CX,[FNAME_LEN]
+ PUSH CX
+ MOV DI,OFFSET DG:TEMP_PATH
+ REP MOVSB
+ DEC DI
+ MOV DX,DI
+ POP CX
+ MOV AL,"."
+ STD
+ REPNE SCASB
+ JZ FOUND_EXT
+ MOV DI,DX ;Point to last char in filename
+FOUND_EXT:
+ CLD
+ INC DI
+ MOV [EXT_PTR],DI
+ MOV SI,OFFSET DG:$$$FILE
+ MOV CX,5
+ REP MOVSB
+
+;Create .$$$ file to make sure directory has room
+MAKFIL:
+
+;=========================================================================
+; implement EXTENDED OPEN
+;=========================================================================
+
+ mov bx,RW ;an000;open for read/write
+ mov cx,ATTR ;an000;file attributes
+ mov dx,Creat_Open_Flag ;an000;action to take on open
+ cmp EA_Flag,True ;an000;EA_Buffer used?
+; $if e ;an000;yes
+ JNE $$IF12
+ mov di,offset dg:EA_Parm_List ;an000; point to buffer
+; $else ;an000;
+ JMP SHORT $$EN12
+$$IF12:
+ mov di,0ffffh ;an000;nul parm list
+; $endif ;an000;
+$$EN12:
+ call EXT_OPEN2 ;an000;create file;DMS:6/10/87
+
+;=========================================================================
+
+ JC CREAT_ERR
+ MOV [WRT_HANDLE],AX
+;
+; We determine the size of the available memory. Use the word in the PDB at
+; [2] to determine the number of paragraphs. Then truncate this to 64K at
+; most.
+;
+ push ds ;save ds for size calc
+ mov ds,[org_ds]
+ MOV CX,DS:[2]
+ MOV DI,CS
+ SUB CX,DI
+ CMP CX,1000h
+ JBE GotSize
+ MOV CX,0FFFh
+GotSize:
+ SHL CX,1
+ SHL CX,1
+ SHL CX,1
+ SHL CX,1
+ pop ds ;restore ds after size calc
+ DEC CX
+ MOV [LAST_MEM],CX
+ MOV DI,OFFSET DG:START
+ TEST fNew,-1
+ JNZ SAVEND
+ SUB CX,OFFSET DG:START ;Available memory
+ SHR CX,1 ;1/2 of available memory
+ MOV AX,CX
+ SHR CX,1 ;1/4 of available memory
+ MOV [ONE4TH],CX ;Save amount of 1/4 full
+ ADD CX,AX ;3/4 of available memory
+ MOV DX,CX
+ ADD DX,OFFSET DG:START
+ MOV [THREE4TH],DX ;Save pointer to 3/4 full
+ MOV DX,OFFSET DG:START
+SAVEND:
+ CLD
+ MOV BYTE PTR [DI],1AH
+ MOV [ENDTXT],DI
+ MOV BYTE PTR [COMBUF],128
+ MOV BYTE PTR [EDITBUF],255
+ MOV BYTE PTR [EOL],10
+ MOV [POINTER],OFFSET DG:START
+ MOV [CURRENT],1
+ MOV ParamCt,1
+ MOV [PARAM1],0 ;M004 Leave room in memory, was -1
+ TEST fNew,-1
+ JNZ COMMAND
+;
+; The above setting of PARAM1 to -1 causes this call to APPEND to try to read
+; in as many lines that will fit, BUT.... What we are doing is simulating
+; the user issuing an APPEND command, and if the user asks for more lines
+; than we get then an "Insufficient memory" error occurs. In this case we
+; DO NOT want this error, we just want as many lines as possible read in.
+; The twiddle of ENDING suppresses the memory error
+;
+ MOV BYTE PTR [ENDING],1 ;Suppress memory errors
+ CALL APPEND
+ MOV ENDING,0 ; restore correct initial value
+
+Break <Main command loop>
+
+;
+; Main read/parse/execute loop. We reset the stack all the time as there
+; are routines that JMP back here. Don't blame me; Tim Paterson write this.
+;
+COMMAND:
+ push cs ;an000;set up addressibility
+ pop ds ;an000;
+ push cs ;an000;
+ pop es ;an000;
+ assume ds:dg,es:dg ;an000;
+
+ MOV SP, STACK
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
+ MOV DX,OFFSET DG:ABORTCOM
+ INT 21H
+ mov ax,prompt
+ call display_message
+
+ MOV DX,OFFSET DG:COMBUF
+ MOV AH,STD_CON_STRING_INPUT
+ INT 21H
+ MOV [COMLINE],OFFSET DG:COMBUF + 2
+
+ mov ax,msg_lf
+ call display_message
+
+PARSE:
+ MOV [PARAM2],0
+ MOV [PARAM3],0
+ MOV [PARAM4],0
+ mov [fourth],0 ;reset the fourth parameter flag
+ MOV QFLG,0
+ MOV SI,[COMLINE]
+ MOV BP,OFFSET DG:PARAM1
+ XOR DI,DI
+CHKLP:
+ CALL GETNUM
+;
+; AL has first char after arg
+;
+ MOV ds:[BP+DI],DX
+ ADD DI,2
+
+ MOV ParamCt,DI ; set up count of parameters
+ SHR ParamCt,1 ; convert to index (1-based)
+
+ CALL SKIP1 ; skip to next parameter
+ CMP AL,"," ; is there a comma?
+ jnz NOT_COMMA ; if not, then done with arguments
+
+ cmp di,8 ; **** maximum size of PARAM array!
+ jb CHKLP ; continue scanning if <4 PARAMS
+ jmp short COMERR
+
+NOT_COMMA:
+ DEC SI ; point at char next
+ CALL Kill_BL ; skip all blanks
+ CMP AL,"?" ; is there a ?
+ JNZ DISPATCH ; no, got command letter
+ MOV QFLG,-1 ; signal query
+ CALL Kill_BL
+DISPATCH:
+ CMP AL,5FH
+ JBE UPCASE
+ cmp al,"z"
+ ja upcase
+ AND AL,5FH
+UPCASE:
+ MOV DI,OFFSET DG:COMTAB
+ mov cx,NUMCOM
+ REPNE SCASB
+ JNZ COMERR
+
+ SUB DI,1+OFFSET DG:COMTAB ; convert to index
+ MOV BX,DI
+ MOV AX,[PARAM2]
+ OR AX,AX
+ JZ PARMOK
+ CMP AX,[PARAM1]
+ JB COMERR ; Param. 2 must be >= param 1
+PARMOK:
+ MOV [COMLINE],SI
+ SHL BX,1
+ CALL [BX+TABLE]
+COMOVER:
+ MOV SI,[COMLINE]
+ CALL Kill_BL
+ CMP AL,0DH
+ JZ COMMANDJ
+ CMP AL,1AH
+ JZ DELIM
+ CMP AL,";"
+ JNZ NODELIM
+DELIM:
+ INC SI
+NODELIM:
+ DEC SI
+ MOV [COMLINE],SI
+ JMP PARSE
+
+COMMANDJ:
+ JMP COMMAND
+
+SKIP1:
+ DEC SI
+ CALL Kill_BL
+ret1: return
+
+Break <Range Checking and argument parsing>
+
+;
+; People call here. we need to reset the stack.
+; Inputs: BX has param1
+; Outputs: Returns if BX <= Param2
+;
+
+CHKRANGE:
+ CMP [PARAM2],0
+ retz
+ CMP BX,[PARAM2]
+ JBE RET1
+ POP DX ; clean up return address
+COMERR:
+ mov ax,BADCOM
+zcomerr1:
+ call display_message
+ jmp command
+
+COMERR1:
+ call std_printf
+ JMP COMMAND
+
+;
+; GetNum parses off 1 argument from the command line. Argument forms are:
+; nnn a number < 65536
+; +nnn current line + number
+; -nnn current line - number
+; . current line
+; # lastline + 1
+;
+;
+
+GETNUM:
+ CALL Kill_BL
+ cmp di,6 ;Is this the fourth parameter?
+ jne sk1
+ mov [fourth],1 ;yes, set the flag
+sk1:
+ CMP AL,"."
+ JZ CURLIN
+ CMP AL,"#"
+ JZ MAXLIN
+ CMP AL,"+"
+ JZ FORLIN
+ CMP AL,"-"
+ JZ BACKLIN
+ MOV DX,0
+ MOV CL,0 ;Flag no parameter seen yet
+NUMLP:
+ CMP AL,"0"
+ JB NUMCHK
+ CMP AL,"9"
+ JA NUMCHK
+ CMP DX,6553 ;Max line/10
+ JAE COMERR ;Ten times this is too big
+ MOV CL,1 ;Parameter digit has been found
+ SUB AL,"0"
+ MOV BX,DX
+ SHL DX,1
+ SHL DX,1
+ ADD DX,BX
+ SHL DX,1
+ CBW
+ ADD DX,AX
+ LODSB
+ JMP SHORT NUMLP
+NUMCHK:
+ CMP CL,0
+ retz
+ OR DX,DX
+ JZ COMERR ;Don't allow zero as a parameter
+ return
+
+CURLIN:
+ cmp [fourth],1 ;the fourth parameter?
+ je comerra ;yes, an error
+ MOV DX,[CURRENT]
+ LODSB
+ return
+MAXLIN:
+ cmp [fourth],1 ;the fourth parameter?
+ je comerra ;yes, an error
+ MOV DX,1
+ MOV AL,0Ah
+ PUSH DI
+ MOV DI,OFFSET DG:START
+ MOV CX,EndTxt
+ SUB CX,DI
+MLoop:
+ JCXZ MDone
+ REPNZ SCASB
+ JNZ MDone
+ INC DX
+ JMP MLoop
+MDone:
+ POP DI
+ LODSB
+ return
+FORLIN:
+ cmp [fourth],1 ;the fourth parameter?
+ je comerra ;yes, an error
+ CALL GETNUM
+ ADD DX,[CURRENT]
+ return
+BACKLIN:
+ cmp [fourth],1 ;the fourth parameter?
+ je comerra ;yes, an error
+ CALL GETNUM
+ MOV BX,[CURRENT]
+ SUB BX,DX
+ JA OkLin ; if negative or zero
+ MOV BX,1 ; use first line
+OkLin:
+ MOV DX,BX
+ return
+
+comerra:
+ jmp comerr
+
+
+ERRORJ:
+ JMP COMERR
+ERROR1J:
+ JMP zcomerr1
+
+BLANKLINE:
+ cmp QFLG,0
+ jnz SHOWHELP ; if ? at front of blank line, do HELP
+ jmp NOCOM ; ignore blank line otherwise
+
+SHOWHELP:
+ dec [COMLINE] ; point back to <cr>
+ mov cx,num_help_msgs-1
+ mov ax,dsp_help
+SHOWHELP1:
+ call display_message
+ inc ax
+ loop SHOWHELP1
+
+; fall into display_message for last message and return
+
+;=========================================================================
+; display_message : Displays a simple common message through the
+; ; message retriever, using a common parameter
+; ; block.
+
+; Inputs : ax = message number to display
+;
+;=========================================================================
+
+display_message proc near
+
+ mov dg:[simple_msg],ax
+ mov dx,offset dg:simple_msg
+ jmp printf ; display it
+
+display_message endp
+
+
+
+Break <Move and Copy commands>
+
+PUBLIC MOVE
+MOVE:
+ CMP ParamCt,3
+ JNZ ERRORJ
+ MOV BYTE PTR [MOVFLG],1
+ JMP SHORT BLKMOVE
+
+PUBLIC COPY
+COPY:
+ CMP ParamCt,3
+ JB ERRORJ
+ MOV BYTE PTR [MOVFLG],0
+;
+; We are to move/copy a number of lines from one range to another.
+;
+; Memory looks like this:
+;
+; START: line 1
+; ...
+; pointer-> line n Current has n in it
+; ...
+; line m
+; endtxt-> ^Z
+;
+; The algoritm is:
+;
+; Bounds check on args.
+; set ptr1 and ptr2 to range before move
+; set copysiz to number to move
+; open up copysize * count for destination
+; if destination is before ptr1 then
+; add copysize * count to both ptrs
+; while count > 0 do
+; move from ptr1 to destination for copysize bytes
+; count --
+; if moving then
+; move from ptr2 through end to ptr1
+; set endtxt to last byte moved.
+; set current, pointer to original destination
+;
+
+BLKMOVE:
+;
+; Make sure that all correct arguments are specified.
+;
+ MOV BX,[PARAM3] ; get destination of move/copy
+ OR BX,BX ; must be specified (non-0)
+ mov ax,DEST
+ JZ ERROR1J ; is 0 => error
+;
+; get arg 1 (defaulting if necessary) and range check it.
+;
+ MOV BX,[PARAM1] ; get first argument
+ OR BX,BX ; do we default it?
+ JNZ NXTARG ; no, assume it is OK.
+ MOV BX,[CURRENT] ; Defaults to the current line
+ CALL CHKRANGE ; Make sure it is good.
+ MOV [PARAM1],BX ; set it
+NXTARG:
+ CALL FINDLIN ; find first argument line
+ JNZ ErrorJ ; line not found
+ MOV [PTR_1],DI
+;
+; get arg 2 (defaulting if necessary) and range check it.
+;
+ MOV BX,[PARAM2] ; Get the second parameter
+ OR BX,BX ; do we default it too?
+ JNZ HAVARGS ; Nope.
+ MOV BX,[CURRENT] ; Defaults to the current line
+ MOV [PARAM2],BX ; Stash it away
+HAVARGS:
+ CALL FindLin
+ JNZ ErrorJ ; line not found
+ MOV BX,Param2
+ INC BX ;Get pointer to line Param2+1
+ CALL FINDLIN
+ MOV [PTR_2],DI ;Save it
+;
+; We now have true line number arguments and pointers to the relevant places.
+; ptr_1 points to beginning of region and ptr_2 points to first byte beyond
+; that region.
+;
+; Check args for correct ordering of first two arguments
+;
+ mov dx,[param1]
+ cmp dx,[param2]
+ jbe havargs1 ; first must be <= second
+ jmp comerr
+havargs1:
+;
+; make sure that the third argument is not contained in the first range
+;
+ MOV DX,[PARAM3]
+ CMP DX,[PARAM1] ; third must be <= first or
+ JBE NOERROR
+ CMP DX,[PARAM2]
+ JA NoError ; third must be > last
+ JMP ComErr
+NOERROR:
+;
+; Determine number to move
+;
+ MOV CX,Ptr_2
+ SUB CX,Ptr_1 ; Calculate number of bytes to copy
+ MOV CopySiz,CX
+ MOV CopyLen,CX ; Save for individual move.
+ MOV AX,[PARAM4] ; Was count defaulted?
+ OR AX,AX
+ JZ SizeOk ; yes, CX has correct value
+ MUL [COPYSIZ] ; convert to true size
+ MOV CX,AX ; move to count register
+ OR DX,DX ; overflow?
+ JZ SizeOK ; no
+ JMP MEMERR ; yes, bomb.
+SizeOK:
+ MOV [COPYSIZ],CX
+;
+; Check to see that we have room to grow by copysiz
+;
+ MOV AX,[ENDTXT] ; get pointer to last byte
+ MOV DI,[LAST_MEM] ; get offset of last location in memory
+ SUB DI,AX ; remainder of space
+ CMP DI,CX ; is there at least copysiz room?
+ JAE HAV_ROOM ; yes
+ JMP MEMERR
+HAV_ROOM:
+;
+; Find destination of move/copy
+;
+ MOV BX,[PARAM3]
+ CALL FINDLIN
+ MOV [PTR_3],DI
+;
+; open up copysiz bytes of space at destination
+;
+; move (p3, p3+copysiz, endtxt-p3);
+;
+ MOV SI,EndTxt ; get source pointer to end
+ MOV CX,SI
+ SUB CX,DI ; number of bytes from here to end
+ INC CX ; remember ^Z at end
+ MOV DI,SI ; destination starts at end
+ ADD DI,[COPYSIZ] ; plus size we are opening
+ MOV [ENDTXT],DI ; new end point
+ STD ; go backwards
+ REP MOVSB ; and store everything
+ CLD ; go forward
+;
+; relocate ptr_1 and ptr_2 if we moved them
+;
+ MOV BX,Ptr_3
+ CMP BX,Ptr_1 ; was dest before source?
+ JA NoReloc ; no, above. no relocation
+ MOV BX,CopySiz
+ ADD Ptr_1,BX
+ ADD Ptr_2,BX ; relocate pointers
+NoReloc:
+;
+; Now we copy for count times copylen bytes from ptr_1 to ptr_3
+;
+; move (ptr_1, ptr_3, copylen);
+;
+ MOV BX,Param4 ; count (0 and 1 are both 1)
+ MOV DI,Ptr_3 ; destination
+CopyText:
+ MOV CX,CopyLen ; number to move
+ MOV SI,Ptr_1 ; start point
+ REP MOVSB ; move the bytes
+ SUB BX,1 ; exhaust count?
+ JG CopyText ; no, go for more
+;
+; If we are moving
+;
+ CMP BYTE PTR MovFlg,0
+ JZ CopyDone
+;
+; Delete the source text between ptr_1 and ptr_2
+;
+; move (ptr_2, ptr_1, endtxt-ptr_2);
+;
+ MOV DI,Ptr_1 ; destination
+ MOV SI,Ptr_2 ; source
+ MOV CX,EndTxt ; pointer to end
+ SUB CX,SI ; number of bytes to move
+ CLD ; forwards
+ REP MOVSB
+ MOV BYTE PTR ES:[DI],1Ah ; remember ^Z terminate
+ MOV EndTxt,DI ; new end of file
+;
+; May need to relocate current line (parameter 3).
+;
+ MOV BX,Param3 ; get new current line
+ CMP BX,Param1 ; do we need to relocate
+ JBE CopyDone ; no, current line is before removed M002
+ ADD BX,Param1 ; add in first
+ SUB BX,Param2 ; current += first-last - 1;
+ DEC BX
+ MOV Param3,BX
+CopyDone:
+;
+; we are done. Make current line the destination
+;
+ MOV BX,Param3 ; set parameter 3 to be current
+ CALL FINDLIN
+ MOV [POINTER],DI
+ MOV [CURRENT],BX
+ return
+
+Break <MoveFile - open up a hole in the internal file>
+
+;
+; MoveFile moves the text in the buffer to create a hole
+;
+; Inputs: DX is spot in buffer for destination
+; DI is spot in buffer for source
+MOVEFILE:
+ MOV CX,[ENDTXT] ;Get End-of-text marker
+ MOV SI,CX
+ SUB CX,DI ;Calculate number of bytes to copy
+ INC CX ; remember ^Z
+ MOV DI,DX
+ STD
+ REP MOVSB ;Copy CX bytes
+ XCHG SI,DI
+ CLD
+ INC DI
+ MOV BP,SI
+SETPTS:
+ MOV [POINTER],DI ;Current line is first free loc
+ MOV [CURRENT],BX ; in the file
+ MOV [ENDTXT],BP ;End-of-text is last free loc before
+ return
+
+NAMERR:
+ cmp ax,error_file_not_found
+ jne otherMergeErr
+ MOV DX,OFFSET DG:FILENM_ptr
+ JMP COMERR1
+
+otherMergeErr:
+ mov ax,BADDRV
+ jmp zcomerr1
+
+PUBLIC MERGE
+MERGE:
+ CMP ParamCt,1
+ JZ MergeOK
+ JMP Comerr
+MergeOK:
+ CALL KILL_BL
+ DEC SI
+ MOV DI,OFFSET DG:MRG_PATH_NAME
+ XOR CX,CX
+ CLD
+MRG1:
+ LODSB
+ CMP AL," "
+ JE MRG2
+ CMP AL,9
+ JE MRG2
+ CMP AL,CR
+ JE MRG2
+ CMP AL,";"
+ JE MRG2
+ STOSB
+ JMP SHORT MRG1
+MRG2:
+ MOV BYTE PTR[DI],0
+ DEC SI
+ MOV [COMLINE],SI
+
+;=========================================================================
+; implement EXTENDED OPEN
+;=========================================================================
+
+ push es ;an000;save reg.
+ mov bx,ext_read ;an000;open for read
+ mov cx,ATTR ;an000;file attributes
+ mov dx,OPEN_FLAG ;an000;action to take on open
+ mov di,0ffffh ;an000;null parm list
+ call EXT_OPEN3 ;an000;create file;DMS:6/10/87
+ pop es ;an000;restore reg.
+
+;=========================================================================
+
+ JC NAMERR
+
+ MOV [MRG_HANDLE],AX
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
+ MOV DX,OFFSET DG:ABORTMERGE
+ INT 21H
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ MRG
+ MOV BX,[CURRENT]
+ CALL CHKRANGE
+MRG:
+ CALL FINDLIN
+ MOV BX,DX
+ MOV DX,[LAST_MEM]
+ CALL MOVEFILE
+ MOV DX,[POINTER]
+ MOV CX,[ENDTXT]
+ SUB CX,[POINTER]
+ PUSH CX
+ MOV BX,[MRG_HANDLE]
+ MOV AH,READ
+ INT 21H
+ POP DX
+ MOV CX,AX
+ CMP DX,CX
+ JA FILEMRG ; M005
+ mov ax,mrgerr
+ call display_message
+ MOV CX,[POINTER]
+ JMP SHORT RESTORE_Z
+FILEMRG:
+ ADD CX,[POINTER]
+ MOV SI,CX
+ dec si
+ LODSB
+ CMP AL,1AH
+ JNZ RESTORE_Z
+ dec cx
+RESTORE_Z:
+ MOV DI,CX
+ MOV SI,[ENDTXT]
+ INC SI
+ MOV CX,[LAST_MEM]
+ SUB CX,SI
+ inc cx ; remember ^Z
+ REP MOVSB
+ dec di ; unremember ^Z
+ MOV [ENDTXT],DI
+ MOV BX,[MRG_HANDLE]
+ MOV AH,CLOSE
+ INT 21H
+ return
+
+PUBLIC INSERT
+INSERT:
+ CMP ParamCt,1
+ JBE OKIns
+ JMP ComErr
+OKIns:
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H ;Set vector 23H
+ MOV DX,OFFSET DG:ABORTINS
+ INT 21H
+ MOV BX,[PARAM1]
+ OR BX,BX
+ JNZ INS
+ MOV BX,[CURRENT]
+ CALL CHKRANGE
+INS:
+ CALL FINDLIN
+ MOV BX,DX
+ MOV DX,[LAST_MEM]
+ CALL MOVEFILE
+INLP:
+ CALL SETPTS ;Update the pointers into file
+ CALL SHOWNUM
+ MOV DX,OFFSET DG:EDITBUF
+ MOV AH,STD_CON_STRING_INPUT
+ INT 21H
+ CALL LF
+ MOV SI,2 + OFFSET DG:EDITBUF
+ CMP BYTE PTR [SI],1AH
+ JZ ENDINS
+;-----------------------------------------------------------------------
+ call unquote ;scan for quote chars if any
+;-----------------------------------------------------------------------
+ MOV CL,[SI-1]
+ MOV CH,0
+ MOV DX,DI
+ INC CX
+ ADD DX,CX
+ JC MEMERRJ1
+ JZ MEMERRJ1
+ CMP DX,BP
+ JB MEMOK
+MEMERRJ1:
+ CALL END_INS
+ JMP MEMERR
+MEMOK:
+ REP MOVSB
+ MOV AL,10
+ STOSB
+ INC BX
+ JMP SHORT INLP
+
+ABORTMERGE:
+ MOV DX,OFFSET DG:START
+ MOV AH,SET_DMA
+ INT 21H
+
+ABORTINS:
+ MOV AX,CS ;Restore segment registers
+ MOV DS,AX
+ MOV ES,AX
+ MOV AX,CSTACK
+ MOV SS,AX
+ MOV SP,STACK
+ STI
+ CALL CRLF
+ CALL ENDINS
+ JMP COMOVER
+
+ENDINS:
+ CALL END_INS
+ return
+
+END_INS:
+ MOV BP,[ENDTXT]
+ MOV DI,[POINTER]
+ MOV SI,BP
+ INC SI
+ MOV CX,[LAST_MEM]
+ SUB CX,BP
+ REP MOVSB
+ DEC DI
+ MOV [ENDTXT],DI
+ MOV AX,(SET_INTERRUPT_VECTOR SHL 8) OR 23H
+ MOV DX,OFFSET DG:ABORTCOM
+ INT 21H
+ return
+
+
+FILLBUF:
+ MOV [PARAM1],-1 ;Read in max. no of lines
+ MOV ParamCt,1
+ CALL APPEND
+ MOV Param1,0
+PUBLIC ENDED
+ENDED:
+
+;Write text out to .$$$ file
+
+ CMP ParamCt,1
+ JZ ENDED1
+CERR: JMP ComErr
+Ended1:
+ CMP Param1,0
+ JNZ Cerr
+ MOV BYTE PTR [ENDING],1 ;Suppress memory errors
+ MOV BX,-1 ;Write max. no of lines
+ CALL WRT
+ TEST BYTE PTR [HAVEOF],-1
+ JZ FILLBUF
+ MOV DX,[ENDTXT]
+ MOV CX,1
+ MOV BX,[WRT_HANDLE]
+ MOV AH,WRITE
+ INT 21H ;Write end-of-file byte
+
+;Close input file ; MZ 11/30
+ ; MZ 11/30
+ MOV BX,[RD_HANDLE] ; MZ 11/30
+ MOV AH,CLOSE ; MZ 11/30
+ INT 21H ; MZ 11/30
+
+;Close .$$$ file
+
+ MOV BX,[WRT_HANDLE]
+ MOV AH,CLOSE
+ INT 21H
+
+;Rename original file .BAK
+
+ MOV DI,[EXT_PTR]
+ MOV SI,OFFSET DG:BAK
+ MOVSW
+ MOVSW
+ MOVSB
+ MOV DX,OFFSET DG:PATH_NAME
+ MOV DI,OFFSET DG:TEMP_PATH
+ MOV AH,RENAME
+ INT 21H
+ MOV DI,[EXT_PTR]
+ MOV SI,OFFSET DG:$$$FILE
+ MOVSW
+ MOVSW
+ MOVSB
+
+;Rename .$$$ file to original name
+
+ MOV DX,OFFSET DG:TEMP_PATH
+ MOV DI,OFFSET DG:PATH_NAME
+ MOV AH,RENAME
+ INT 21H
+ ; mode
+ mov ah,exit
+ xor al,al
+ int 21h
+
+;=========================================================================
+; EDLIN_DISP_GET: This routine will give us the attributes of the
+; current display, which are to be used to restore the screen
+; back to its original state on exit from EDLIN. We also
+; set the screen to a text mode here with an 80 X 25 color
+; format.
+;
+; Inputs : VIDEO_GET - 0fH (get current video mode)
+; VIDEO_SET - 00h (set video mode)
+; VIDEO_TEXT- 03h (80 X 25 color mode)
+;
+; Outputs : VIDEO_ORG - Original video attributes on entry to EDLIN
+;
+;=========================================================================
+
+EDLIN_DISP_GET proc near ;an000;video attributes
+
+ push ax ;an000;save affected regs.
+ push bx ;an000;
+ push cx ;an000;
+ push dx ;an000;
+ push si ;an000;
+ push ds ;an000;
+
+ push cs ;an000;exchange cs/ds
+ pop ds ;an000;
+
+ mov ax,440Ch ;an000;generic ioctl
+ mov bx,Std_Out ;an000;Console
+ mov cx,(Display_Attr shl 8) or Get_Display ;an000;get display
+ mov dx,offset dg:Video_Buffer ;an000;buffer for video attr.
+ int 21h ;an000;
+; $if nc ;an000;function returned a
+ JC $$IF15
+ ; buffer
+ mov si,dx ;an000;get pointer
+ mov ax,word ptr dg:[si].Display_Length_Char ;an000;get video len.
+ dec ax ;an000;allow room for message
+ mov dg:Disp_Len,al ;an000;put it into var.
+ mov ax,word ptr dg:[si].Display_Width_Char ;an000;get video width
+ mov dg:Disp_Width,al ;an000;put it into var.
+; $else ;an000;function failed use
+ JMP SHORT $$EN15
+$$IF15:
+ ; default values
+ mov al,Def_Disp_Len ;an000;get default length
+ dec al ;an000;leave room for messages
+ mov dg:Disp_Len,al ;an000;use default length
+ mov dg:Disp_Width,Def_Disp_Width;an000;use default width
+; $endif ;an000;
+$$EN15:
+
+ pop ds ;an000;restore affected regs.
+ pop si ;an000;
+ pop dx ;an000;
+ pop cx ;an000;
+ pop bx ;an000;
+ pop ax ;an000;
+
+ ret ;an000;return to caller
+
+EDLIN_DISP_GET endp ;an000;end proc.
+
+
+;=========================================================================
+; EXT_OPEN1 : This routine opens a file for read/write access. If the file
+; if not present for opening the open will fail and return with a
+; carry set.
+;
+; Inputs : BX - Open mode
+; CX - File attributes
+; DX - Open action
+;
+; Outputs: CY - If error
+;
+; Date : 6/10/87
+;=========================================================================
+
+EXT_OPEN1 proc near ;an000;open for R/W
+
+ assume ds:dg
+ push ds ;an000;save regs
+ push si ;an000;
+
+ mov ah,ExtOpen ;an000;extended open
+ mov al,0 ;an000;reserved by system
+ mov si,offset dg:path_name ;an000;point to PATH_NAME
+
+ int 21h ;an000;invoke function
+ pop si ;an000;restore regs
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+EXT_OPEN1 endp ;an000;end proc.
+
+;=========================================================================
+; EXT_OPEN2 : This routine will attempt to create a file for read/write
+; access. If the files exists the create will fail and return
+; with the carry set.
+;
+; Inputs : BX - Open mode
+; CX - File attributes
+; DX - Open action
+;
+; Outputs: CY - If error
+;
+; Date : 6/10/87
+;=========================================================================
+
+EXT_OPEN2 proc near ;an000;create a file
+
+ assume ds:dg
+ push ds ;an000;save regs
+ push si ;an000;
+
+ mov ah,ExtOpen ;an000;extended open
+ mov al,0 ;an000;reserved by system
+ mov si,offset dg:temp_path ;an000;point to TEMP_PATH
+
+ int 21h ;an000;invoke function
+
+ pop si ;an000;restore regs
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+EXT_OPEN2 endp ;an000;end proc.
+
+;=========================================================================
+; EXT_OPEN3 : This routine will attempt to create a file for read
+; access. If the files exists the create will fail and return
+; with the carry set.
+;
+; Inputs : BX - Open mode
+; CX - File attributes
+; DX - Open action
+;
+; Outputs: CY - If error
+;
+; Date : 6/10/87
+;=========================================================================
+
+EXT_OPEN3 proc near ;an000;create a file
+
+ assume ds:dg
+ push ds ;an000;save regs
+ push si ;an000;
+
+ mov ah,ExtOpen ;an000;extended open
+ mov al,0 ;an000;reserved by system
+ mov si,offset dg:mrg_path_name ;an000;point to mrg_path_name
+
+ int 21h ;an000;invoke function
+
+ pop si ;an000;restore regs
+ pop ds ;an000;
+
+ ret ;an000;return to caller
+
+EXT_OPEN3 endp ;an000;end proc.
+
+
+;=========================================================================
+; EDLIN_COMMAND : This routine provides an interface between the new
+; parser and the existing logic of EDLIN. We will be
+; interfacing the parser with three existing variables.
+;
+; Inputs : FILESPEC - Filespec entered by the user and passed by
+; the parser.
+;
+; PARSE_SWITCH_B - Contains the result of the parse for the
+; /B switch. This is passed by the parser.
+;
+; Outputs: PATH_NAME - Filespec
+; LOADMOD - Flag for /B switch
+; FNAME_LEN - Length of filespec
+;
+; Date : 6/11/87
+;=========================================================================
+
+EDLIN_COMMAND proc near ;an000;interface parser
+
+ push ax ;an000;save regs.
+ push cx ;an000;
+ push di ;an000
+ push si ;an000;
+
+ mov si,offset dg:filespec ;an000;get its offset
+ mov di,offset dg:path_name ;an000;get its offset
+
+ mov cx,00h ;an000;cx will count filespec
+ ; length
+ cmp parse_switch_b,true ;an000;do we have /B switch
+; $if z ;an000;we have the switch
+ JNZ $$IF18
+ mov [LOADMOD],01h ;an000;signal switch found
+; $endif ;an000
+$$IF18:
+
+; $do ;an000;while we have filespec
+$$DO20:
+ lodsb ;an000;move byte to al
+ cmp al,nul ;an000;see if we are at
+ ; the end of the
+ ; filespec
+; $leave e ;an000;exit while loop
+ JE $$EN20
+ stosb ;an000;move byte to path_name
+ inc cx ;an000;increment the length
+ ; of the filespec
+; $enddo ;an000;end do while
+ JMP SHORT $$DO20
+$$EN20:
+
+ mov [FNAME_LEN],cx ;an000;save filespec's length
+
+ pop si ;an000; restore regs
+ pop di ;an000;
+ pop cx ;an000;
+ pop ax ;an000;
+
+ ret ;an000;return to caller
+
+EDLIN_COMMAND endp ;an000;end proc
+
+
+;=========================================================================
+; Calc_Memory_Avail : This routine will calculate the memory
+; available for use by EDLIN.
+;
+; Inputs : ORG_DS - DS of PSP
+;
+; Outputs : DX - paras available
+;=========================================================================
+
+Calc_Memory_Avail proc near ;an000; dms;
+
+ push ds ;save ds for size calc
+ push cx ;an000; dms;
+ push di ;an000; dms;
+
+ mov ds,cs:[org_ds]
+ MOV CX,DS:[2]
+ MOV DI,CS
+ SUB CX,DI
+ mov dx,cx ;an000; dms;put paras in DX
+
+ pop di ;an000; dms;
+ pop cx ;an000; dms;
+ pop ds ;an000; dms;
+
+ ret ;an000; dms;
+
+Calc_Memory_Avail endp ;an000; dms;
+
+;=========================================================================
+; EA_Fail_Exit : This routine tells the user that there was
+; Insufficient memory and exits EDLIN.
+;
+; Inputs : MemFul_Ptr - "Insufficient memory"
+;
+; Outputs : message
+;=========================================================================
+
+EA_Fail_Exit proc near ;an000; dms;
+
+ mov dx,offset dg:MemFul_Ptr ;an000; dms;"Insufficient
+
+ push cs ;an000; dms;xchange ds/cs
+ pop ds ;an000; dms;
+ ; memory"
+ call Std_Printf ;an000; dms;print message
+ mov ah,exit ;an000; dms;exit
+ xor al,al ;an000; dms;clear al
+ int 21h ;an000; dms;
+ ret ;an000; dms;
+
+EA_Fail_Exit endp ;an000; dms;
+
+CODE ENDS
+ END EDLIN
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlin.lnk b/private/mvdm/dos/v86/cmd/edlin/edlin.lnk
new file mode 100644
index 000000000..8b90da55a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlin.lnk
@@ -0,0 +1,7 @@
+EDLIN+
+EDLCMD1+
+EDLCMD2+
+EDLMES+
+EDLPARSE
+EDLIN.EXE;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlin.skl b/private/mvdm/dos/v86/cmd/edlin/edlin.skl
new file mode 100644
index 000000000..2659831f2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlin.skl
@@ -0,0 +1,85 @@
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLMES.FIL
+;
+; DESCRIPTIVE NAME: EDLIN MESSAGES
+;
+; FUNCTION: PROVIDES A SET OF MESSAGES FOR EDLIN.
+;
+; ENTRY POINT: NA
+;
+; INPUT: NA
+;
+; EXIT NORMAL: NA
+;
+; EXIT ERROR: NA
+;
+; INTERNAL REFERENCES: NA
+;
+; EXTERNAL REFERENCES: NA
+;
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY FASTBLD.EXE.
+;
+; REVISION HISTORY:
+;
+; VERSION 4.00 - CREATED FOR DOS 4.00
+;
+;======================= END OF SPECIFICATIONS ===========================
+
+;=========================================================================
+; edlin utility message file
+;=========================================================================
+
+:util EDLIN ;utility name
+:class 1
+
+:class A ;system messages
+:use 1 COMMON1 ;"Incorrect DOS version",CR,LF
+:use 2 COMMON2 ;"Insufficient memory",CR,LF
+:use 3 COMMON3 ;"Error loading messages",CR,LF
+
+:def 300 "edlin /? help",cr,lf
+:def 301 "edlin ? help",cr,lf
+:def 302 "edlin ? help",cr,lf
+:def 303 "edlin ? help",cr,lf
+:def 304 "edlin ? help",cr,lf
+:def 305 "edlin ? help",cr,lf
+:def 306 "edlin ? help",cr,lf
+:def 307 "edlin ? help",cr,lf
+
+:class B ;utility messages
+:def 6 "*" ;prompt_ptr
+:def 7 "Invalid drive or file name",CR,LF ;baddrv_ptr
+:def 8 "File name must be specified",CR,LF ;ndname_ptr
+:def 10 "File is READ-ONLY",CR,LF ;ro_err_ptr
+:def 11 "File Creation Error",CR,LF ;bcreat_ptr
+:def 12 "Too many files open",CR,LF ;too_many_ptr
+:def 13 "Read error in:",CR,LF,"%1",CR,LF ;read_err_ptr
+:def 14 "Cannot edit .BAK file--rename file",CR,LF ;nobak_ptr
+:def 15 "No room in directory for file",CR,LF ;nodir_ptr
+:def 16 "Disk full. Edits lost.",CR,LF ;dskful_ptr
+:def 18 "Entry error",CR,LF ;badcom_ptr
+:def 19 "New file",CR,LF ;newfil_ptr
+:def 20 "Not found",CR,LF ;nosuch_ptr
+
+:class C ;utility messages
+:def 21 "O.K.? " ;ask_ptr
+:def 22 "Line too long",CR,LF ;toolng_ptr
+:def 23 "End of input file",CR,LF ;eof_ptr
+:def 24 "Abort edit (Y/N)? " ;qmes_ptr
+:def 25 "Must specify destination line number",CR,LF ;dest_ptr
+:def 26 "Not enough room to merge the entire file",CR,LF ;mrgerr_ptr
+:def 27 CR,LF ;crlf_ptr
+:def 28 LF ;lf_ptr
+:def 29 "Continue (Y/N)?" ;cont_ptr
+:def 30 "Unable to print message",CR,LF ;fatal_error
+:def 31 "%1" ;arg_buf_ptr
+:def 32 "%1:%2" ;line_num_buf_ptr
+:def 33 "Cannot merge - Code page mismatch",CR,LF ;cp_err_ptr
+
+:end
+
+;=========================================================================
+;=========================================================================
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlmes.asm b/private/mvdm/dos/v86/cmd/edlin/edlmes.asm
new file mode 100644
index 000000000..a4cc7edf9
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlmes.asm
@@ -0,0 +1,526 @@
+ PAGE 60,132;
+ title EDLIN Messages
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;======================= START OF SPECIFICATIONS =========================
+;
+; MODULE NAME: EDLMES.SAL
+;
+; DESCRIPTIVE NAME: MESSAGE RETRIEVER INTERFACE MODULE
+;
+; FUNCTION: THIS MODULE PROVIDES AN INTERFACE FOR THE MODULES THAT ARE
+; NEEDED TO INVOKE THE MESSAGE RETRIEVER.
+;
+; ENTRY POINT: PRINTF
+;
+; INPUT: OFFSET CARRIED IN DX TO APPLICABLE MESSAGE TABLE
+;
+; EXIT NORMAL: NO CARRY
+;
+; EXIT ERROR : CARRY
+;
+; INTERNAL REFERENCES:
+;
+; ROUTINE: PRINTF - PROVIDES THE ORIGINAL INTERFACE FOR THE ORIGINAL
+; PRINTF USED PRIOR TO VERSION 4.00. PRINTS MESSAGES.
+;
+; DISP_MESSAGE - BUILDS THE REGISTERS NECESSARY FOR INVOCATION
+; OF THE MESSAGE RETRIEVER, BASED ON THE TABLE
+; POINTED TO BY DX.
+;
+; DISP_FATAL - INVOKED IF AN ERROR OCCURS (CARRY) IN THE
+; MESSAGE RETRIEVER. IT DISPLAYS THE APPROPRIATE
+; MESSAGE.
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: SYSLOADMSG - LOAD MESSAGES FOR THE MESSAGE RETRIEVER
+; SYSDISPMSG - DISPLAYS THE REQUESTED MESSAGE
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION DOS 4.00 - IMPLEMENTATION OF MESSAGE RETRIEVER
+;
+; COPYRIGHT: "MS DOS EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988 Microsoft"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft "
+;
+; MICROSOFT REVISION HISTORY
+;
+; MODIFIED BY: AARON R
+; M.A. U
+; N. P
+;======================= END OF SPECIFICATIONS ===========================
+
+.xlist
+
+include sysmsg.inc ;an000;message retriever
+
+msg_utilname <EDLIN> ;an000;EDLIN messages
+.list
+;-----------------------------------------------------------------------;
+; ;
+; Done for Vers 2.00 (rev 9) by Aaron R ;
+; Update for rev. 11 by M.A. U ;
+; Printf for 2.5 by Nancy P ;
+; ;
+;-----------------------------------------------------------------------;
+
+;=========================================================================
+; revised edlmes.asm
+;=========================================================================
+
+fatal_error equ 30 ;an000;fatal message handler
+unlim_width equ 00h ;an000;unlimited output width
+pad_blank equ 20h ;an000;blank pad
+pre_load equ 00h ;an000;normal pre-load
+
+
+
+
+message_table struc ;an000;struc for message table
+
+ entry1 dw 0 ;an000;message number
+ entry2 db 0 ;an000;message type
+ entry3 dw 0 ;an000;display handle
+ entry4 dw 0 ;an000;pointer to sublist
+ entry5 dw 0 ;an000;substitution count
+ entry6 db 0 ;an000;use keyb input?
+ entry7 dw 0 ;an000;keyb buffer to use
+
+message_table ends ;an000;end struc
+
+;=========================================================================
+; macro disp_message: this macro takes a pointer to a message table
+; and displays the applicable message based on
+; the table's contents.
+; this is to provide an interface into the module
+; of the message retriever, SYSDISPMSG.
+;
+; Date : 6/11/87
+;=========================================================================
+
+disp_message macro tbl ;an000;display message macro
+
+ push bx ;an000;
+ push cx ;an000;
+ push dx ;an000;
+ push di ;an000;
+ push si ;an000;
+
+ push tbl ;an000;exchange tbl with si
+ pop si ;an000;exchanged
+
+ mov ax,[si].entry1 ;an000;move message number
+ mov bx,[si].entry3 ;an000;display handle
+ mov cx,[si].entry5 ;an000;number of subs
+ mov dl,[si].entry6 ;an000;function type
+ mov di,[si].entry7 ;an000;input buffer if appl.
+ mov dh,[si].entry2 ;an000;message type
+ mov si,[si].entry4 ;an000;sublist
+
+ call sysdispmsg ;an000;display the message
+
+ pop si ;an000;restore affected regs
+ pop di ;an000;
+ pop dx ;an000;
+ pop cx ;an000;
+ pop bx ;an000;
+
+endm ;an000;end macro disp_message
+
+;=========================================================================
+; macro disp_message: end macro
+;=========================================================================
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC BYTE
+
+ extrn path_name:byte
+
+DATA ENDS
+
+DG GROUP CODE,CONST,cstack,DATA
+
+code segment public byte ;an000;code segment
+ assume cs:dg,ds:dg,es:dg,ss:CStack ;an000;
+
+ public printf ;an000;share printf
+ public disp_fatal ;an000;fatal error display
+ public pre_load_message ;an000;message loader
+
+.xlist
+msg_services <MSGDATA> ;an000;
+.list
+
+;======================= sysmsg.inc invocation ===========================
+;
+; include sysmsg.inc - message retriever services
+;
+;
+; options selected:
+; NEARmsg
+; DISPLAYmsg
+; LOADmsg
+; CHARmsg
+; NUMmsg
+; CLSAmsg
+; CLSBmsg
+; CLSCmsg
+;
+;=========================================================================
+
+.xlist
+
+ msg_services <LOADmsg> ;an000;no version check
+ msg_services <DISPLAYmsg,CHARmsg,NUMmsg,INPUTmsg> ;an000;display messages
+ msg_services <EDLIN.CLA,EDLIN.CLB,EDLIN.CLC> ;an000;message types
+ msg_services <EDLIN.CL1,EDLIN.CL2> ;an000;message types
+ msg_services <EDLIN.CTL> ;an000;
+
+.list
+
+;=========================================================================
+; printf: printf is a replacement of the printf procedure used in DOS
+; releases prior to 4.00. printf invokes the macro disp_message
+; to display a message through the new message handler. the
+; interface into printf will continue to be a pointer to a message
+; passed in DX. the pointer is pointing to more than a message
+; now. it is pointing to a table for that message containing
+; all relevant information for printing the message. the macro
+; disp_message operates on these tables.
+;
+; Date : 6/11/87
+;=========================================================================
+
+printf proc near ;an000;printf procedure
+
+ disp_message dx ;an000;display a message
+; $if c ;an000;if an error occurred
+ JNC $$IF1
+ call disp_fatal ;an000;display the fatal error
+; $endif ;an000;
+$$IF1:
+
+ ret ;an000;return to caller
+
+printf endp ;an000;end printf proc
+
+
+;=========================================================================
+; disp_fatal: this routine displays a fatal error message in the event
+; an error occurred in disp_message.
+;
+; Date : 6/11/87
+;=========================================================================
+
+disp_fatal proc near ;an000;fatal error message
+
+ mov ax,fatal_error ;an000;fatal_error number
+ mov bx,stdout ;an000;print to console
+ mov cx,0 ;an000;no parameters
+ mov dl,no_input ;an000;no keyboard input
+ mov dh,UTILITY_MSG_CLASS ;an000;utility messages
+
+ call sysdispmsg ;an000;display fatal error
+
+ ret ;an000;return to caller
+
+disp_fatal endp ;an000;end disp_fatal proc
+
+;=========================================================================
+; PRE_LOAD_MESSAGE : This routine provides access to the messages required
+; by EDLIN. This routine will report if the load was
+; successful. An unsuccessful load will cause EDLIN
+; to terminate with an appropriate error message.
+;
+; Date : 6/11/87
+;=========================================================================
+
+PRE_LOAD_MESSAGE proc near ;an000;pre-load messages
+
+
+ call SYSLOADMSG ;an000;invoke loader
+
+; $if c ;an000;if an error
+ JNC $$IF3
+ pushf ;an000;save flags
+ call SYSDISPMSG ;an000;let him say why
+ popf ;an000;restore flags
+; $endif ;an000;
+$$IF3:
+
+ ret ;an000;return to caller
+
+PRE_LOAD_MESSAGE endp ;an000;end proc
+
+include msgdcl.inc
+
+code ends ;an000;end code segment
+
+
+
+
+CONST SEGMENT PUBLIC BYTE
+
+ extrn arg_buf:byte ;an000;
+ extrn line_num:byte ;an000;
+ extrn line_flag:byte ;an000;
+ extrn Temp_Path:byte ;an000;
+
+ public baddrv,opt_err_ptr,nobak
+ public simple_msg
+ public msg_too_many,dskful,memful_ptr,badcom
+ public nodir,filenm_ptr,newfil,read_err_ptr
+ public nosuch,toolng,eof,dest
+ public mrgerr,ro_err,bcreat,ndname
+ public dsp_options,dsp_help,num_help_msgs
+ public ask_ptr,qmes_ptr,msg_crlf,msg_lf
+ public prompt
+ public line_num_buf_ptr ;an000;DMS:6/15/87
+ public arg_buf_ptr ;an000;DMS:6/15/87
+ public cont_ptr ;an000;DMS:6/18/87
+ public cp_err ;an000;DMS:6/22/87
+ public Del_Bak_Ptr ;an000;dms;
+
+;============== REPLACEABLE PARAMETER SUBLIST STRUCTURE ==================
+;
+; byte 1 - substitution list size, always 11
+; byte 2 - reserved for use by message handler
+; byte 3 - pointer to parameter to be used as a substitution
+; byte 7 - which parameter is this to replace, %1, %2, etc.
+; byte 8 - determines how the parameter is to be output
+; byte 9 - determines the maximum width of the parameter string
+; byte 10 - determines the minimum width of the parameter string
+; byte 11 - define what is to be used as a pad character
+;
+;=========================================================================
+
+;=========================================================================
+; replaceable parameter sublists
+;=========================================================================
+
+ed_read_sub label dword ;an000;a read error occurred
+
+ db 11 ;an000;sublist size
+ db 00 ;an000;reserved
+ dd dg:path_name ;an000;pointer to parameter
+ db 01 ;an000;parm 1
+ db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width of 0
+ db pad_blank ;an000;pad with blanks
+
+arg_sub label dword ;an000;line output buffer
+
+ db 11 ;an000;sublist size
+ db 00 ;an000;reserved
+ dd dg:arg_buf ;an000;pointer to parameter
+ db 01 ;an000;parm 1
+ db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width of 0
+ db pad_blank ;an000;pad with blank
+
+num_sub label dword ;an000;line number
+
+ db 11 ;an000;sublist size
+ db 00 ;an000;reserved
+ dd dg:line_num ;an000;pointer to parameter
+ db 01 ;an000;parm 1
+ db Right_Align+Unsgn_Bin_Word ;an000;right align/decimal
+ db 08 ;an000;maximum width
+ db 08 ;an000;minimum width of 0
+ db pad_blank ;an000;pad with blank
+
+ db 11 ;an000;optional flag
+ db 00 ;an000;reserved
+ dd dg:line_flag ;an000;pointer to parameter
+ db 02 ;an000;parm 2
+ db Char_Field_Char ;an000;character
+ db 01 ;an000;minimum width of 1
+ db 01 ;an000;maximum width of 1
+ db pad_blank ;an000;pad with blank
+
+BAK_Sub label dword ;an000;line output buffer
+
+ db 11 ;an000;sublist size
+ db 00 ;an000;reserved
+ dd dg:Temp_Path ;an000;pointer to parameter
+ db 00 ;an000;parm 0
+ db Char_Field_ASCIIZ ;an000;left align/asciiz/char.
+ db unlim_width ;an000;unlimited width
+ db 00 ;an000;minimum width of 0
+ db pad_blank ;an000;pad with blank
+
+
+;=========================================================================
+; end replaceable parameter sublists
+;=========================================================================
+
+;======================= TABLE STRUCTURE =================================
+;
+; bute 1-2 : message number of message to be displayed
+; byte 3 : message type to be used, i.e.;class 1, utility, etc.
+; byte 4-5 : display handle, i.e.; console, printer, etc.
+; byte 6-7 : pointer to substitution list, if any.
+; byte 8-9 : number of replaceable parameters, if any.
+; byte 10 : type of input from keyboard, if any.
+; byte 11-12: pointer to buffer for keyboard input, if any.
+;
+;=========================================================================
+
+; a bunch of common messages (class=UTILITY_MSG_CLASS, dest=stdout,
+; no inputs or sublists) are passed
+; through absolute message numbers rather
+; than duplicating the data structure for
+; each one.
+
+prompt = 0006 ; "*"
+baddrv = 0007 ; "Invalid drive or file name"
+ndname = 0008 ;"File name must be
+ ;specified",0d,0a,0
+ro_err = 0010 ;"File is READ-ONLY",0d,0a,0
+bcreat = 0011 ;"File Creation Error",0d,0a,0
+msg_too_many = 0012 ;"Too many files open",0d,0a,0
+nobak = 0014 ;"Cannot edit .BAK file
+ ;--rename file",0d,0a,0
+nodir = 0015 ;"No room in directory
+ ;for file",0d,0d,0
+dskful = 0016 ;"Disk full. Edits lost.",0d,0a,0
+badcom = 0018 ;"Entry error",0d,0a,0
+newfil = 0019 ;"New file",0d,0a,0
+nosuch = 0020 ;"Not found",0d,0a,0
+toolng = 0022 ;"Line too long",0d,0a,0
+eof = 0023 ;"End of input file",0d,0a,0
+dest = 0025 ;"Must specify destination
+ ;line number",0d,0a,0
+mrgerr = 0026 ;"Not enough room to
+ ;merge the entire file",0d,0a,0
+msg_crlf = 0027 ;0d,0a,0
+msg_lf = 0028 ;0a,0
+cp_err = 0033 ;"Cannot merge - Code page
+ ; mismatch",0d,0a
+dsp_options = 0300 ; display options
+dsp_help = 0301 ; display help
+num_help_msgs = 7
+
+simple_msg label word
+ dw 0000 ; message number (supplied as used)
+ db UTILITY_MSG_CLASS ; utility message
+ dw stdout ; display handle
+ dw 00 ; no sublist
+ dw 00 ; no sub
+ db no_input ; no keyboard input
+ dw 00 ; no keyboard buffer
+
+
+opt_err_ptr label word ;an000;"Invalid parameter",0d,0a,0
+ dw 0010 ;an000;message number
+ db Parse_Err_Class ;an000;utility message
+ dw StdErr ;an000;display handle
+ dw 00 ;an000;no sublist
+ dw 00 ;an000;no sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+read_err_ptr label word ;an000;"Read error in:",
+ ;an000;0d,0a,"%1",0d,0a,0
+ dw 0013 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:ed_read_sub ;an000;point to sublist
+ dw 0001 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+memful_ptr label word ;an000;"Insufficient memory",0d,0a,0
+ dw 0008 ;an000;message number
+ db Ext_Err_Class ;an000;extended error
+ dw stderr ;an000;display handle
+ dw 00 ;an000;no sublist
+ dw 00 ;an000;no sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+filenm_ptr label word ;an000;"File not found",0d,0a
+ dw 0002 ;an000;message number
+ db Ext_Err_Class ;an000;utility message
+ dw stderr ;an000;display handle
+ dw 00 ;an000;no sublist
+ dw 00 ;an000;no sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+ask_ptr label word ;an000;"O.K.? ",0
+ dw 0021 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;no sub
+ dw 00 ; no sublist
+ db DOS_KEYB_INP ;an000;keyboard input - AX
+ dw 00 ;an000;no keyboard buffer
+
+qmes_ptr label word ;an000;"Abort edit (Y/N)? ",0
+ dw 0024 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;no sublist
+ dw 00 ;an000;no sub
+ db DOS_KEYB_INP ;an000;keyboard input - AX
+ dw 00 ;an000;no keyboard buffer
+
+cont_ptr label word ;an000;"Continue (Y/N)?"
+ dw 0029 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw 00 ;an000;no sublist
+ dw 00 ;an000;no sub
+ db DOS_KEYB_INP ;an000;keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+arg_buf_ptr label word ;an000;argument buffer for
+ ; line output
+ dw 0031 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:arg_sub ;an000;argument sublist
+ dw 01 ;an000;1 sub
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+line_num_buf_ptr label word ;an000;holds line numbers
+ dw 0032 ;an000;message number
+ db UTILITY_MSG_CLASS ;an000;utility message
+ dw stdout ;an000;display handle
+ dw dg:num_sub ;an000;argument sublist
+ dw 02 ;an000;2 subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+del_bak_ptr label word ;an000;"Access Denied - xxxxxxxx.BAK"
+ dw 0005 ;an000;message number
+ db Ext_Err_Class ;an000;utility message
+ dw stderr ;an000;display handle
+ dw dg:BAK_Sub ;an000;no sublist
+ dw 01 ;an000;no subs
+ db no_input ;an000;no keyboard input
+ dw 00 ;an000;no keyboard buffer
+
+CONST ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlparse.asm b/private/mvdm/dos/v86/cmd/edlin/edlparse.asm
new file mode 100644
index 000000000..2624aa561
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlparse.asm
@@ -0,0 +1,303 @@
+ page 60,132;
+ title EDLPARSE for EDLIN
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+;******************* START OF SPECIFICATIONS *****************************
+;
+; MODULE NAME: EDLPARSE.SAL
+;
+; DESCRIPTIVE NAME: PARSES THE EXTERNAL COMMAND LINE FOR EDLIN
+;
+; FUNCTION: THIS ROUTINE PROVIDES PARSING CAPABILITIES FOR THE
+; EXTERNAL COMMAND LINE OF EDLIN. IT PARSES FOR THE PRESENCE
+; OF A REQUIRED FILESPEC AND AN OPTIONAL SWITCH (/B).
+;
+; ENTRY POINT: PARSER_COMMAND
+;
+; INPUT: DOS COMMAND LINE
+;
+; EXIT NORMAL: AX = 0FFH - VALID SWITCH AND FILESPEC SPECIFIED
+;
+; EXIT ERROR: AX NOT= 0FFH - INVALID SWITCH OR NO FILESPEC SPECIFIED
+;
+; INTERNAL REFERENCES
+;
+; ROUTINE: PARSER_COMMAND - THIS ROUTINE PARSES FOR THE PRESENCE
+; OF THE /B SWITCH AND A FILESPEC. THE
+; FILEPSEC IS REQUIRED, WHILE THE SWITCH
+; IS OPTIONAL.
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINE: PARSE.ASM - THIS IS THE PARSER CODE.
+;
+; NOTES: THIS MODULE IS TO BE PREPPED BY SALUT WITH THE "PR" OPTIONS.
+; LINK EDLIN+EDLCMD1+EDLCMD2+EDLMES+EDLPARSE
+;
+; REVISION HISTORY:
+;
+; AN000 VERSION 4.00 - IMPLEMENTS THE SYSTEM PARSER (SYSPARSE)
+;
+; COPYRIGHT: "THE IBM PERSONAL COMPUTER EDLIN UTILITY"
+; "VERSION 4.00 (C) COPYRIGHT 1988"
+; "LICENSED MATERIAL - PROPERTY OF Microsoft"
+;
+;
+;******************** END OF SPECIFICATIONS ******************************
+
+
+;======================= equates for edlparse ============================
+
+parse_ok equ 0 ;an000;good parse return
+parse_command equ 081h ;an000;offset of command line
+nul equ 0 ;an000;nul
+fs_flag equ 05h ;an000;filespec found
+sw_flag equ 03h ;an000;switch found
+true equ 0ffffh ;an000;true
+false equ 00h ;an000;false
+too_many equ 01h ;an000;too many parms
+
+;======================= end equates =====================================
+
+
+CODE SEGMENT PUBLIC BYTE
+CODE ENDS
+
+CONST SEGMENT PUBLIC BYTE
+CONST ENDS
+
+cstack segment stack
+cstack ends
+
+DATA SEGMENT PUBLIC BYTE
+
+ extrn path_name:byte
+ extrn org_ds:word ;an000; dms;
+
+ public parse_switch_b ;an000;parse switch result
+ public parse_switch_? ; parse switch result
+ public filespec ;an000;actual filespec
+
+;======================= input parameters control blocks =================
+; these control blocks are used by sysparse and must be pointed to by
+; es:di on invocation.
+
+ public parms ;an000;share parms
+parms label byte ;an000;parms control block
+ dw dg:parmsx ;an000;point to parms structure
+ db 00h ;an000;no additional delims.
+
+parmsx label byte ;an000;parameter types
+ db 1,1 ;an000;must have filespec
+ dw dg:fs_pos ;an000;filespec control block
+ db 2 ;an000;max. number of switches
+ dw dg:sw_b ;an000;/b switch control block
+ dw dg:sw_? ;an000;/? switch control block
+ db 00h ;an000;no keywords
+
+;======================= filespec positional tables ======================
+
+fs_pos label byte ;an000;filespec positional
+ dw 0200h ;an000;filespec/not optional
+ dw 0001h ;an000;cap
+ dw dg:filespec_res ;an000;filespec result table
+ dw dg:noval ;an000;value list/none
+ db 0 ;an000;no keyword/switch syns.
+
+filespec_res label byte ;an000;filespec result table
+parse_fs_res db ? ;an000;must be filespec (05)
+parse_fs_tag db ? ;an000;item tag
+parse_fs_syn dw ? ;an000;synonym pointer
+parse_fs_off dw ? ;an000;offset to filespec
+parse_fs_seg dw ? ;an000;segment of filespec
+
+;======================= switch tables /b ================================
+
+sw_b label byte ;an000;/b switch
+ dw 0000h ;an000;no match flags
+ dw 0000h ;an000;no cap
+ dw dg:switch_res ;an000;result buffer
+ dw dg:noval ;an000;value list/none
+ db 1 ;an000;1 switch
+sw_b_switch db "/B",0 ;an000;/B means ignore CTL-Z
+
+sw_? label byte ;an000;/b switch
+ dw 0000h ;an000;no match flags
+ dw 0000h ;an000;no cap
+ dw dg:switch_res ;an000;result buffer
+ dw dg:noval ;an000;value list/none
+ db 1 ;an000;1 switch
+sw_?_switch db "/?",0 ;an000;/B means ignore CTL-Z
+ PUBLIC sw_?_switch
+switch_res label byte ;an000;switch result table
+parse_sw_res db ? ;an000;must be string (03)
+parse_sw_tag db ? ;an000;item tag
+parse_sw_syn dw ? ;an000;synonym pointer
+parse_sw_ptr dd ? ;an000;pointer to result
+
+noval label byte ;an000;value table
+ db 0 ;an000;no values
+
+
+;======================= end input parameter control blocks ==============
+
+filespec db 128 dup (0) ;an000;holds filespec
+parse_switch_b db false ;an000;hold boolean result
+ ; of /b parse
+parse_switch_? db false ; true if /? found
+parse_sw_b db "/B" ;an000;comparison switch
+
+DATA ENDS
+
+DG GROUP CODE,CONST,cstack,DATA
+
+code segment public byte ;an000;code segment
+ assume cs:dg,ds:dg,es:dg,ss:CStack ;an000;
+
+ public parser_command ;an000;share this routine
+
+
+
+;======================= begin main routine ==============================
+.xlist
+
+include version.inc ; parse.asm include psdata.inc which needs defs from here
+include parse.asm ;an000;parser
+
+.list
+
+parser_command proc near ;an000;parse routine
+
+ push es ;an000;save registers
+ push ds ;an000;
+ push di ;an000;
+ push si ;an000;
+
+ mov dg:parse_switch_b,false ;an000;init. to false
+ xor cx,cx ;an000;set cx to 0
+ xor dx,dx ;an000;set dx to 0
+ mov di,offset dg:parms ;an000;point to parms
+ mov si,parse_command ;an000;point to ds:81h
+ mov ds,dg:org_ds ;an000;get ds at entry
+ assume ds:nothing ;an000;
+
+parse_continue: ;an000;loop return point
+
+ call sysparse ;an000;invoke parser
+ cmp ax,parse_ok ;an000;is it a good parse
+ jne parse_end ;an000;continue on good parse
+ push si
+ mov si,dx
+ cmp byte ptr es:[si],fs_flag ;an000;do we have a filespec
+; $if e ;an000;yes we do
+ JNE $$IF1
+ call build_fs ;an000;save filespec
+; $else ;an000;
+ JMP SHORT $$EN1
+$$IF1:
+ ; A switch was found.
+ ; See which one it was.
+
+ call val_sw ;an000;see which switch
+
+; $endif ;an000;
+$$EN1:
+
+ pop si
+ jmp parse_continue ;an000;continue parsing
+
+parse_end: ;an000;end parse routine
+
+ pop si ;an000;restore registers
+ pop di ;an000; for return to caller
+ pop ds ;an000;
+ assume ds:dg ;an000;
+ pop es ;an000;
+
+ ret ;an000;return to caller
+
+parser_command endp ;an000;end parser_command
+
+
+;======================= subroutine area =================================
+
+
+;=========================================================================
+; build_fs: This routine saves the filespec for use by the calling program.
+;=========================================================================
+
+build_fs proc near ;an000;save filespec
+
+ push ax ;an000;save affected regs.
+ push di ;an000;
+ push si ;an000;
+ push ds ;an000;
+ push es ;an000;
+
+ mov di,offset dg:filespec ;an000;point to filespec buffer
+ lds si,dword ptr es:parse_fs_off ;an000;get offset
+
+build_cont: ;an000;continue routine
+
+ lodsb ;an000;mov ds:si to al
+ cmp al,nul ;an000;is it end of filespec
+; $if nz ;an000;if not
+ JZ $$IF7
+ stosb ;an000;move byte to filespec
+ jmp build_cont ;an000;continue buffer fill
+; $endif ;an000;
+$$IF7:
+ stosb ;an000;save nul
+
+ pop es ;an000;restore regs
+ pop ds ;an000;
+ pop si ;an000;
+ pop di ;an000;
+ pop ax ;an000;
+
+ ret ;an000;return to caller
+
+build_fs endp ;an000;end proc
+
+;=========================================================================
+; val_sw : determines which switch we have.
+;=========================================================================
+
+val_sw proc near ;an000;switch determination
+
+ ; Check for /B
+
+ cmp es:[parse_sw_syn], offset es:sw_b_switch
+ jne ValSwitchBDone
+ cmp es:[parse_switch_b], true ; see if already given
+ jne ValSwitchBOkay ; jump if not
+ mov ax, too_many ; set error level
+ jmp parse_end ; and exit parser
+ValSwitchBOkay:
+ mov es:[parse_switch_b], true ; set the flag on
+ jmp short ValSwitchExit ; and done
+ValSwitchBDone:
+
+ ; Check for /?
+
+ cmp es:[parse_sw_syn], offset es:sw_?_switch
+ jne ValSwitch?Done
+ mov es:[parse_switch_?], true ; set the flag on
+ jmp short ValSwitchExit ; and done
+ValSwitch?Done:
+
+ValSwitchExit:
+
+ ret ;an000;return to caller
+
+val_sw endp ;an000;end proc
+
+
+code ends ;an000;end segment
+ end ;an000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/edlstdsw.inc b/private/mvdm/dos/v86/cmd/edlin/edlstdsw.inc
new file mode 100644
index 000000000..89605e4de
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/edlstdsw.inc
@@ -0,0 +1,38 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+; SCCSID = @(#)stdsw.asm 1.1 85/04/10
+; Use the switches below to produce the standard Microsoft version or the IBM
+; version of the operating system
+
+
+;include EDLVERS.INC ;IBM/MSVER/JAPVER switches
+
+
+WANG EQU FALSE
+Rainbow EQU FALSE
+
+
+; Set this switch to cause DOS to move itself to the end of memory
+HIGHMEM EQU FALSE
+
+ IF IBM
+ESCCH EQU 0 ; character to begin escape seq.
+CANCEL EQU 27 ;Cancel with ESCAPE
+TOGLPRN EQU TRUE ;One key toggles printer echo
+ZEROEXT EQU TRUE
+ ELSE
+ IF WANG ;Are we assembling for WANG?
+ESCCH EQU 1FH ;Yes. Use 1FH for escape character
+ ELSE
+ESCCH EQU 1BH
+ ENDIF
+CANCEL EQU "X"-"@" ;Cancel with Ctrl-X
+TOGLPRN EQU FALSE ;Separate keys for printer echo on
+ ;and off
+ZEROEXT EQU TRUE
+ ENDIF
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/edlin/makefile b/private/mvdm/dos/v86/cmd/edlin/makefile
new file mode 100644
index 000000000..bdf3d63e2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/edlin/makefile
@@ -0,0 +1,104 @@
+# Makefile for edlin.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =edlin.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+edlin.ctl: edlin.skl \
+ $(msg)\$(COUNTRY).msg
+
+
+edlin.obj: edlin.asm \
+ edlequ.asm \
+ edlstdsw.inc \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc
+
+edlcmd1.obj: edlcmd1.asm \
+ edlequ.asm \
+ edlstdsw.inc \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc
+
+edlcmd2.obj: edlcmd2.asm \
+ edlequ.asm \
+ edlstdsw.inc \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc
+
+edlmes.obj: edlmes.asm \
+ $(inc)\sysmsg.inc \
+ edlin.ctl
+
+edlparse.obj: edlparse.asm \
+ $(inc)\parse.asm
+
+$(dest): edlin.obj \
+ edlcmd1.obj \
+ edlcmd2.obj \
+ edlmes.obj \
+ edlparse.obj \
+ edlin.lnk \
+ makefile
+ link16 $(exelink) /MAP @edlin.lnk
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/display.asm b/private/mvdm/dos/v86/cmd/exe2bin/display.asm
new file mode 100644
index 000000000..ac5ee75ad
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/display.asm
@@ -0,0 +1,115 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+CODE SEGMENT PARA PUBLIC 'CODE'
+CODE ENDS
+DATA SEGMENT PARA PUBLIC 'DATA'
+DATA ENDS
+STACK SEGMENT PARA STACK 'STACK'
+STACK ENDS
+ZLOAD SEGMENT PARA PUBLIC 'ZLOAD'
+ZLOAD ENDS
+
+CODE SEGMENT PARA PUBLIC 'CODE'
+ assume cs:code,ds:data
+;
+;*****************************************************************************
+; External Declarations
+;*****************************************************************************
+;
+
+ extrn SysDispMsg:near
+
+;
+;***************************************************************************
+; Message Structures
+;***************************************************************************
+;
+
+
+Message_Table struc ; ;AN000;
+ ;
+Entry1 dw 0 ; ;AN000;
+Entry2 dw 0 ; ;AN000;
+Entry3 dw 0 ; ;AN000;
+Entry4 dw 0 ; ;AN000;
+Entry5 db 0 ; ;AN000;
+Entry6 db 0 ; ;AN000;
+Entry7 dw 0 ; ;AN000;
+ ;
+Message_Table ends ; ;AN000;
+
+
+
+;*****************************************************************************
+;Routine name&gml Display_Interface
+;*****************************************************************************
+;
+;DescriptioN&gml Save all registers, set up registers required for SysDispMsg
+; routine. This information is contained in a message description
+; table pointed to by the DX register. Call SysDispMsg, then
+; restore registers. This routine assumes that the only time an
+; error will be returned is if an extended error message was
+; requested, so it will ignore error returns
+;
+;Called Procedures: Message (macro)
+;
+;Change History&gml Created 4/22/87 MT
+;
+;Input&gml ES&gmlDX = pointer to message description
+;
+;Output&gml None
+;
+;Psuedocode
+;----------
+;
+; Save all registers
+; Setup registers for SysDispMsg from Message Description Tables
+; CALL SysDispMsg
+; Restore registers
+; ret
+;*****************************************************************************
+
+Public Display_Interface
+Display_Interface proc ; ;AN000;
+
+ push ds ; ;AN000;
+ push es ; ;AN000;
+ push ax ;Save registers ;AN000;
+ push bx ; " " " " ;AN000;
+ push cx ; " " " " ;AN000;
+ push dx ; " " " " ;AN000;
+ push si ; " " " " ;AN000;
+ push di ; " " " " ;AN000;
+ mov di,dx ;Change pointer to table ;AN000;
+ mov dx,SEG data ;Point to data segment
+ mov ds,dx ;
+ mov es,dx
+ mov ax,[di].Entry1 ;Message number ;AN000;
+ mov bx,[di].Entry2 ;Handle ;AN000;
+ mov si,[di].Entry3 ;Sublist ;AN000;
+ mov cx,[di].Entry4 ;Count ;AN000;
+ mov dh,[di].Entry5 ;Class ;AN000;
+ mov dl,[di].Entry6 ;Function ;AN000;
+ mov di,[di].Entry7 ;Input ;AN000;
+ call SysDispMsg ;Display the message ;AN000;
+ pop di ;Restore registers ;AN000;
+ pop si ; " " " " ;AN000;
+ pop dx ; " " " " ;AN000;
+ pop cx ; " " " " ;AN000;
+ pop bx ; " " " " ;AN000;
+ pop ax ; " " " " ;AN000;
+ pop es ; ;AN000;
+ pop ds ; ;AN000;
+ ret ;All done ;AN000;
+
+Display_Interface endp ; ;AN000;
+code ends
+
+
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2bchng.inc b/private/mvdm/dos/v86/cmd/exe2bin/e2bchng.inc
new file mode 100644
index 000000000..45a3ca0ee
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2bchng.inc
@@ -0,0 +1,27 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+.xlist
+;
+;
+;*****************************************************************************
+;* *
+;* Change list to EXE2BIN modules *
+;* *
+;* Lines are tagged ANxxx for new, ACxxx for changed *
+;* --------------------------------------------------------------------------*
+;* 000 - DOS 4.00 Spec additions and DCR's thru unit/function test *
+;* Date: 12/31/87 Developer: Dennis M *
+;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
+;* 001 - DOS 4.00 PTM P3964 Pass invalid parameter to message retriever for *
+;* replacement in error message. *
+;* Date: 03/24/88 Developer: Dennis M *
+;* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - *
+;*****************************************************************************
+;* Note: This is file E2BCHNG.INC for updating purposes *
+;*****************************************************************************
+.list
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2bequ.inc b/private/mvdm/dos/v86/cmd/exe2bin/e2bequ.inc
new file mode 100644
index 000000000..1edda849e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2bequ.inc
@@ -0,0 +1,55 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+ ; ; ;
+
+NO equ 0
+YES equ not NO
+
+
+DOS_Found equ 0
+
+INIT equ 0
+
+
+Net_Check equ 1200h
+Assign_Check equ 8000h
+
+Found_Yes equ 1
+Found_No equ 0
+
+Asciiz_End equ 0
+;DBCS_Blank_hi equ 81h
+DBCS_Blank equ DB_SP_LO
+DBCS_Vector_Size equ 2
+End_Of_Vector equ 0
+
+
+Blank equ " "
+
+Label_Length equ 11
+CR equ 13
+
+DBCS_VECTOR equ NO
+
+;-------------------------------------------------------------------------------
+
+
+
+
+
+DRNUM EQU 5CH
+
+
+
+; Exit status defines
+ExitOK equ 0
+
+
+;-------------------------------------------------------------------------------
+; These are the data structures which we will need
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2binit.asm b/private/mvdm/dos/v86/cmd/exe2bin/e2binit.asm
new file mode 100644
index 000000000..7cbac91b3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2binit.asm
@@ -0,0 +1,1180 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+Title E2BINIT(EXE2BIN)
+
+;*****************************************************************************
+; Loader for EXE files under 86-DOS
+; VER 1.5
+; 05/21/82 Added rev number
+; VER 1.6
+; 07/01/82 A little less choosy about size matches
+; VER 2.0 M.A.U
+; 10/08/82 Modified to use new 2.0 system calls for file i/o
+; Ver 2.1 M.A.U
+; 10/27/82 Added the DOS version check
+; Ver 2.2 MZ
+; 8/30/83 Fixed command line parsing
+; Ver 2.3 EE
+; 10-12-83 More fixes to command line parsing
+; Ver 2.4 NP
+; 10/17/83 Use Printf for messages
+; Ver 2.5 MZ Fix LOCATE sss D: problem
+; 04/09/87 Add PARSER and MESSAGE RETRIEVER
+; Ver 4.00 DRM
+;
+; M001 MD 12/27/90 Removed special checks for ambiguous
+; file names
+;*****************************************************************************
+
+
+INCLUDE SYSMSG.INC
+MSG_UTILNAME <EXE2BIN> ;AN000;
+
+ subttl Main Code Area ;AN000;
+ page
+
+
+; The following switch allows use with the "old linker", which put a version
+; number where the new linker puts the number of bytes used in the last page.
+; If enabled, this will cause a test for 0004 at this location (the old linker
+; version number), and if equal, change it to 200H so all of the last page
+; will be used.
+
+OLDLINK EQU 0 ;1 to enable, 0 to disable
+
+CODE SEGMENT PARA PUBLIC 'CODE' ;AN000;
+CODE ENDS ;AN000;
+DATA SEGMENT PARA PUBLIC 'DATA' ;AN000;
+DATA ENDS ;AN000;
+STACK SEGMENT PARA PUBLIC 'STACK' ;AN000;
+STACK ENDS ;AN000;
+ZLOAD SEGMENT PARA PUBLIC 'ZLOAD' ;AN000;
+ZLOAD ENDS ;AN000;
+
+DATA SEGMENT PARA PUBLIC 'DATA' ;AN000;
+
+MSG_SERVICES <MSGDATA> ;AN000;
+
+Command_Line_Buffer db 128 dup(0) ;AN000;
+Command_Line_Length equ $ - Command_Line_Buffer ;AN000;
+
+Fatal_Error db 0 ;AN000;
+
+Command_Line db NO
+
+
+
+rev db "2.4"
+
+
+file1_ext db ".EXE",00h
+file2_ext db ".BIN",00h
+
+per11 db 0 ;AN000;
+per2 db 0
+per22 db 0 ;AN000;
+
+update equ 0 ;AN000;
+noupdate equ -1 ;AN000;
+
+file1 db (64+13) dup(?)
+fnptr dw offset file1 ; Ptr to filename in file1
+handle1 dw 1 dup(?)
+
+file2 db (64+13) dup(?)
+f2cspot dw offset file2 ; Ptr to spot in file2, file1 maybe added
+
+name2_given db 1 ;1-> atleast the file2 name is present
+ext2_given db 0 ;1-> full file2 spec given
+file2_given db 0 ; is TRUE if user specified atleast a
+ ; drive, or path (or full name)
+handle2 dw 1 dup(?)
+
+dma_buf db 80h dup(0) ; DMA transfer buffer
+
+INBUF DB 5,0
+ DB 5 DUP(?)
+
+;The following locations must be defined for storing the header:
+
+RUNVAR LABEL BYTE ;Start of RUN variables
+RELPT DW ?
+LASTP LABEL WORD
+RELSEG DW ?
+SIZ LABEL WORD ;Share these locations
+PAGES DW ?
+RELCNT DW ?
+HEADSIZ DW ?
+ DW ?
+LOADLOW DW ?
+INITSS DW ?
+INITSP DW ?
+ DW ?
+INITIP DW ?
+INITCS DW ?
+RELTAB DW ?
+RUNVARSIZ EQU $-RUNVAR
+
+DBCS_Vector_Off dw 0 ;AN000;
+DBCS_Vector_Seg dw 0 ;AN000;
+
+parse_ptr DW ?
+
+DATA ENDS
+
+
+STACK SEGMENT PARA PUBLIC 'STACK'
+ DB (362 - 80h) + 80H DUP (?) ; (362 - 80h) is IBMs ROM requirement
+ ; (New - Old) == size of growth
+STACK ENDS
+;
+
+
+
+ZLOAD SEGMENT PARA PUBLIC 'ZLOAD'
+ db ?
+ZLOAD ENDS
+LOAD EQU ZLOAD
+;
+
+
+
+;
+;*****************************************************************************
+; Include files
+;*****************************************************************************
+;
+
+.xlist
+INCLUDE DOSSYM.INC ; also versiona.inc ;AN000;
+INCLUDE SYSCALL.INC ;AN000;
+INCLUDE E2BMACRO.INC ;AN000;
+INCLUDE E2BEQU.INC ;AN000;
+INCLUDE E2BTABLE.INC ;AN000;
+INCLUDE E2BPARSE.INC ;AN000;
+include version.inc
+.list
+
+
+
+CODE SEGMENT PARA PUBLIC 'CODE'
+ assume cs:CODE,ds:DATA,es:NOTHING,SS:STACK ;AN000;
+
+psp_ptr dw 1 dup(?) ;AN000;
+;
+;*****************************************************************************
+; SysDisplayMsg Declarations
+;*****************************************************************************
+;
+.xlist
+MSG_SERVICES <LOADmsg> ;AN000;
+MSG_SERVICES <DISPLAYmsg,CHARmsg> ;AN000;
+MSG_SERVICES <EXE2BIN.CLA,EXE2BIN.CLB> ;AN000;
+MSG_SERVICES <EXE2BIN.CL1,EXE2BIN.CL2> ;AN000;
+MSG_SERVICES <EXE2BIN.CTL> ;AN000;
+
+
+.list
+
+;
+;*****************************************************************************
+; External Routine Declarations
+;*****************************************************************************
+;
+
+ public SysDispMsg ;AN000;
+ public SysLoadMsg ;AN000;
+
+
+;*****************************************************************************
+;Routine name: Main_Init
+;*****************************************************************************
+;
+;Description: Main control routine for init section
+;
+;Called Procedures: Message (macro)
+; Check_DOS_Version
+; Init_Input_Output
+; Validate_Target_Drive
+; Hook_CNTRL_C
+;
+;Input: None
+;
+;Output: None
+;
+;Change History: Created 6/22/87 DM
+;
+;*****************************************************************************
+
+procedure Main_Init near ; ;AN000;
+
+ ASSUME DS:NOTHING ; THIS IS WHAT dos GIVES YOU ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+
+ PUSH DS ;AN000;
+ mov psp_ptr,ds ;AN000;
+ XOR AX,AX ;AN000;
+ PUSH AX ;Push return address to DS:0 ;AN000;
+
+ MOV AX,SEG DATA ;SET UP ADDRESSABILITY TO ;AN000;
+ MOV DS,AX ; THE DATA SEGMENT ;AN000;
+ ASSUME DS:DATA ;TELL ASSEMBLER WHAT I JUST DID ;AN000;
+
+ mov Fatal_Error,No ;Init the error flag ;AN000;
+ call Init_Input_Output ;Setup messages and parse ;AN000;
+ cmp Fatal_Error,Yes ;Error occur? ;AN000;
+; $IF NE ;Nope, keep going ;AN000;
+ JE $$IF1
+ call LOCATE ;Go do the real program ;AN000;
+; $ENDIF ;AN000;
+$$IF1:
+ xor al,al ;AN000;
+ Dos_call Exit ;AN000;
+ int 20h ;If other exit fails ;AN000;
+
+Main_Init endp ;AN000;
+
+;*****************************************************************************
+;Routine name: Init_Input_Output
+;*****************************************************************************
+;
+;Description: Initialize messages, Parse command line, allocate memory as
+; needed. If there is a /FS switch, go handle it first as
+; syntax of IFS format may be different from FAT format.
+;
+;Called Procedures: Preload_Messages
+; Parse_For_FS_Switch
+; Parse_Command_Line
+; Interpret_Parse
+;
+;Change History: Created 6/22/87 DM
+;
+;Input: PSP command line at 81h and length at 80h
+; Fatal_Error = No
+;
+;Output: Fatal_Error = YES/NO
+;
+;*****************************************************************************
+
+procedure Init_Input_Output near ;AN000;
+
+ call Preload_Messages ;Load up message retriever ;AN000;
+ cmp Fatal_Error,YES ;Quit? ;AN000;
+; $IF NE ;Nope, keep going ;AN000;
+ JE $$IF3
+ call Parse_Command_Line ;Parse in command line input ;AN000;
+; $ENDIF ;AN000;
+$$IF3:
+ ret ;AN000;
+
+Init_Input_Output endp ;AN000;
+
+;*****************************************************************************
+;Routine name: Preload_Messages
+;*****************************************************************************
+;
+;Description: Preload messages using common message retriever routines.
+;
+;Called Procedures: SysLoadMsg
+;
+;
+;Change History: Created 6/22/87 DM
+;
+;Input: Fatal_Error = NO
+;
+;Output: Fatal_Error = YES/NO
+;
+;*****************************************************************************
+
+procedure Preload_Messages near ;AN000;
+
+ call SYSLOADMSG ;Preload the messages ;AN000;
+; $IF C ;Error? ;AN000;
+ JNC $$IF5
+ call SYSDISPMSG ;AN000;
+ mov fatal_error, YES ;AN000;
+; $ENDIF ;AN000;
+$$IF5:
+ ret ;AN000;
+Preload_Messages endp ;AN000;
+
+
+;*****************************************************************************
+;Routine name: Parse_Command_Line
+;*****************************************************************************
+;
+;Description: Parses command line.
+;
+;Called Procedures: Message (macro)
+; Sysparse
+;
+;Change History: Created 6/22/87 DM
+;
+;Input: Fatal_Error = NO
+;
+;Output: Fatal_Error = YES/NO
+;
+;*****************************************************************************
+
+
+Procedure Parse_Command_Line ;AN000;
+
+ push ds ;AN000;
+ mov ds,psp_ptr ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ mov si,Command_Line_Parms ;AN000;
+ mov ax,seg command_line_table ;AN000;
+ push es ;AN000;
+ mov es,ax ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+ mov di,offset Command_Line_Table ;AN000;
+ xor cx,cx ;AN000;
+
+ PUBLIC MainParseLoop
+MainParseLoop:
+
+; $DO ;AN000;
+$$DO7:
+ xor dx,dx ;AN000;
+ mov es:parse_ptr,si
+ call Sysparse ;AN000;
+ cmp ax,No_Error ;AN000;
+
+; $IF E ;AN000;
+ JNE $$IF8
+
+ ; Check if /? switch entered.
+ ; If so, display the options help message
+ ; and set for exit.
+ ;
+ ; This gives the user the info they want,
+ ; without all the other possible error messages.
+ ;
+ ; 4/18/90 c-PaulB
+
+ cmp es:[sw_synonym1], offset sw1_s1 ; /?
+ jne CheckSW1Done ; skip this if not
+ call DisplayOptions ; else display msg
+ mov es:[Fatal_Error], YES ; set flag to stop
+ jmp ParseCLExit ; and bail out now
+CheckSW1Done:
+
+ push ax ;AN000;
+ push bx ;AN000;
+ push ds ;AN000;
+ push es ;AN000;
+ push si ;AN000;
+ push di ;AN000;
+
+ cmp cx,1 ;AN000;
+
+; $IF E ;AN000;
+ JNE $$IF9
+
+ mov ax,seg rb_string1_off ;AN000;
+ mov ds,ax ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ mov si,offset rb_string1_off ;AN000;
+ mov ax,ds:[si] ;AN000;
+ mov bx,ax ;AN000;
+
+
+ mov ax,ds:[si+2] ;AN000;
+ mov ds,ax ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ mov si,bx ;AN000;
+
+ mov ax,seg file1 ;AN000;
+ mov es,ax ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+ mov di,offset file1 ;AN000;
+ call copyfs ;AN000;
+
+; $ELSE ;AN000;
+ JMP SHORT $$EN9
+$$IF9:
+
+ mov ax,seg rb_string2_off ;AN000;
+ mov ds,ax ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ mov si,offset rb_string2_off ;AN000;
+ mov ax,ds:[si] ;AN000;
+ mov bx,ax ;AN000;
+
+
+ mov ax,ds:[si+2] ;AN000;
+ mov ds,ax ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ mov si,bx ;AN000;
+
+ mov ax,seg file2 ;AN000;
+ mov es,ax ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+ mov di,offset file2 ;AN000;
+ call copyfs ;AN000;
+
+; $ENDIF ;AN000;
+$$EN9:
+
+ pop di ;AN000;
+ pop si ;AN000;
+ pop es ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+ pop ds ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+ pop bx ;AN000;
+ pop ax ;AN000;
+
+; $ENDIF ;AN000;
+$$IF8:
+
+ cmp ax,No_Error ;AN000;
+
+; $ENDDO NE ;AN000;
+ JE $$DO7
+
+ cmp ax,End_of_Parse ;Check for parse error ;AN000;
+; $IF NE ;AN000;
+ JE $$IF14
+ push ax ;AN001;
+ mov ax,es:parse_ptr ;AN001;
+ mov es:parsoff,ax ;AN001;
+ mov es:parseg,ds ;AN001;
+ mov byte ptr ds:[si],0 ;AN001;
+ pop ax ;AN001;
+ parse_message ;Must enter file name ;AN000;
+ mov es:Fatal_Error,YES ;Indicate death! ;AN000;
+; $ENDIF ;AN000;
+$$IF14:
+ParseCLExit:
+ pop es ;AN000;
+ ASSUME ES:NOTHING ;AN000;
+ pop ds ;AN000;
+ ASSUME DS:DATA ;AN000;
+
+ ret ;AN000;
+
+Parse_Command_Line endp ;AN000;
+
+;*****************************************************************************
+;Routine name: Parse_Command_Line
+;*****************************************************************************
+;
+;Description: Displays options help message lines.
+;
+;Called Procedures: Display_Interface
+;
+;Change History: Created 5/2/90 c-PaulB
+;
+;Input: No value passed.
+;
+;Output: No value returned.
+;
+;*****************************************************************************
+
+
+Procedure DisplayOptions
+
+ mov dx, offset msgOptions ; get options msg
+DO_Loop:
+ call Display_Interface ; and show it
+ cmp word ptr es:[msgOptions], MSG_OPTIONS_LAST ; last msg?
+ je DO_Done ; done if so
+ inc word ptr es:[msgOptions] ; else get next msg
+ jmp short DO_Loop ; and go do it
+DO_Done:
+ ret
+
+DisplayOptions endp
+
+;*****************************************************************************
+
+INCLUDE PARSE.ASM
+
+;*****************************************************************************
+
+
+procedure LOCATE near
+
+ push ds ;AN000;
+ ASSUME ES:NOTHING ; THIS IS THE WAY IT GETS HERE! ;AN000;
+ mov ax,es ; ES -> PSP ;AN000;
+ mov ds,ax ; DS -> PSP ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+
+ MOV SI,offset file1
+ MOV BX,SEG DATA
+ MOV ES,BX
+ assume es:data ;AN000;
+
+ MOV BX,WORD PTR DS:[2] ;Get size of memory
+
+
+;-----------------------------------------------------------------------;
+
+;
+; The rules for the arguments are:
+; File 1:
+; If no extention is present, .EXE is used.
+; File 2:
+; If no drive is present in file2, use the one from file1
+; If no path is specified, then use current dir
+; If no filename is specified, use the filename from file1
+; If no extention is present in file2, .BIN is used
+;
+
+
+;----- Get the first file name
+ push ds ;AN000;
+ push es ;AN000;
+ ASSUME ES:DATA ;AN000;
+ pop ds ;AN000;
+ ASSUME DS:DATA ;AN000;
+
+sj01:
+ mov si,offset file1 ; d = file1;
+ mov per11,0 ; assume no extension on file1;AC000;
+
+;******************************************************************************
+
+sj0:
+ lodsb ; while (!IsBlank(c=*p++)) {
+ cmp al,0
+ JE SJ2
+ call dbcs_check ; see if a dbcs character ;AN000;
+ jc dbcs_1 ; dbcs character, go load another char ;AN000;
+ cmp al,'\' ; if (c == '\\' || c == ':') {
+ jnz sj05
+ mov per11,update ;AC000;
+ mov fnptr,si ; fnptr = ptr to slash
+sj05:
+ cmp al,':' ; if (c == '\\' || c == ':') {
+ jnz checkper1
+ mov per11,update ;AC000;
+ mov fnptr,si ; fnptr = ptr to slash
+checkper1:
+ cmp al,'.' ; if (c == '.')
+ jne sj0 ; ;M001
+ mov per11,noupdate ; set file1 to have extension ;AN000;
+ jmp short sj0 ; ;M001
+ ;M001 - code removed
+dbcs_1: ; ;AN000;
+ lodsb ; load another character and got to ;AN000;
+ jmp short sj0 ; the start again. ;AN000;
+
+;******************************************************************************
+
+sj2:
+get_second:
+;----- Get the second file name
+; Initially we assume that user has not given any file2 spec. Then if we find
+; that user has entered something, then file2_given is made to TRUE;
+; Once file2_given is TRUE, then we assume that user has given atleast a name
+; i.e. name2_given = 1 but ext2_given = 0;
+; if we find that user has given just a drive: then name2_given is made to FALSE
+; The logic then simplifies to :
+; if (!file2_given)
+; copy file1 and add .BIN ext and try to open
+; else { /* file2 given */
+; if (!name2_given)
+; copy name from file1 and .BIN as extn ; try to open
+; else { /* name2 also given */
+; do find_first
+; if (file_not_found)
+; add extn .BIN if needed and try to open
+; else if (it is subdir) {
+; add '\' to it;
+; add the file1 name and .BIN
+; go for file open
+; }
+; } /* else name2 given*/
+; } /* else file2 given */
+
+ MOV SI,offset file1
+ mov di,offset file2 ; d = file2
+
+;******************************************************************************
+
+sj3:
+ cmp word ptr [di],00 ; check to see if first character of
+ je sj32 ; file2 is a null. ;AN000;
+ mov file2_given,1 ; user has given atleast a partial
+ ; spec for file2
+ mov si,offset file2 ; set pointer to file2
+
+;******************************************************************************
+
+sj31:
+ lodsb ; If file2 first character is not a
+ mov f2cspot,si
+ cmp al,0 ; null, this loop will check to see
+ JZ maycopy ; the file has an extension assigned;AN000;
+ call dbcs_check ; to it. If not it will set per2 to ;AN000;
+ jc dbcs_2 ; go load another byte ;AN000;
+ cmp al,'\'
+ jnz checkper6
+ cmp byte ptr [si],0 ; end of file2 spec ?
+ jne sj31 ; no, go get next char
+ mov name2_given,0 ; copy from file1
+checkper6:
+ cmp al,':' ; if (c == '\\' || c == ':') {
+ jnz checkper4
+ cmp byte ptr [si],0 ; end of file2 spec ?
+ jne sj31 ; no, go get next char
+ mov name2_given,0 ; no name; copy from file1
+checkper4: ; there is an extension already.
+ cmp al,'.' ;
+ jne sj31 ; M001
+ mov ext2_given,1 ; M001 - code removed
+ jmp short sj31 ; M001
+ ; M001 - code removed
+dbcs_2: ;
+ lodsb ;load another character and got to ;AN000;
+ jmp short sj31 ;the start again. ;AN000;
+
+;******************************************************************************
+
+; we get here only if user specified something - a drive, just a name or
+; even the full spec
+; check if we have to copy the name
+
+maycopy:
+ cmp name2_given,1 ; did the user give a name
+ je sj5 ; yes, go check for the existence
+
+ dec f2cspot
+ mov di,f2cspot
+
+sj32:
+ ; There is no second filename so
+ mov si,fnptr ;AN000;
+
+;******************************************************************************
+
+copy1to2: ;AN000;
+ lodsb ; This loop is executed when there is ;AN000;
+ cmp al,0 ; no file2 specified on the command ;AN000;
+ JZ SJ5 ; line. It will copy the file1 name ;AN000;
+ call dbcs_check ; check for dbcs character ;AN000;
+ jc dbcs_3 ; got a dbcs character, go copy. ;AN000;
+ cmp al,'.' ; extension. The defult extension ;AN000;
+ je sj5 ; of .BIN will be added in check_ext. ;AN000;
+ stosb ;AN000;
+ jmp short copy1to2 ;AN000;
+dbcs_3:
+ stosb ; Got a dbcs character. Copy ;AN000;
+ lodsb ; two characters and then go to ;AN000;
+ stosb ; next character in filename. ;AN000;
+ jmp short copy1to2 ;AN000; ;AN000;
+
+;******************************************************************************
+
+sj5:
+; mov byte ptr es:[di],00h ; *d = 0;
+ cmp file2_given,1 ; if the user specified some path
+ jne check_ext ; we need to check it; else
+ cmp name2_given,1 ; add .BIN and try to open file2
+ jne check_ext ; (at this point we have the name)
+ mov ah,Set_DMA ; Use find_first to see if file2 is
+ mov dx,offset dma_buf ; a directory. If it isn't, go to
+ int 21h ; set f2cspot to point to the spot
+ mov ah,Find_First ; right after the backslash, and
+ mov dx,offset file2 ; fall through to no_second so that
+ mov cx,-1 ; file1's name will be added to file2.
+ int 21h
+ jc check_ext
+ test dma_buf+21,00010000b
+ jNZ DoDirectory
+ jmp short Check_Ext
+DoDirectory:
+ mov AL,'\'
+ mov di,f2cspot
+ dec di
+ stosb
+ inc f2cspot
+ mov name2_given,0 ; so that we will copy file1.ext to
+ mov ext2_given,0 ; file2; we also have to copy ext
+ jmp maycopy ;
+
+
+;----- Check that files have an extension, otherwise set default
+check_ext:
+ cmp per11,noupdate ; if (ext2_given == NULL) { ;AC000;
+ jz file1_ok
+ mov di,offset file1 ; d = file1;
+ mov si,offset file1_ext ; s = ".EXE";
+ call strcat ; strcat (d, s);
+file1_ok: ; }
+ cmp ext2_given,1 ; if (ext2_given == NULL) { ;AC000;
+ je file2_ok
+ mov di,offset file2 ; d = file2;
+ mov si,offset file2_ext ; s = ".BIN";
+ call strcat ; strcat (d, s);
+ jmp short file2_ok ; }
+
+;-----------------------------------------------------------------------;
+file2_ok:
+ mov dx,offset file1
+ mov ax,(open SHL 8) + 0 ;for reading only
+ INT 21H ;Open input file
+ jc bad_file
+ mov [handle1],ax
+ jmp short exeload
+
+bad_file:
+ jmp DosError
+
+BADEXE:
+ pop ds
+ ASSUME DS:nothing ;AN000;
+ MESSAGE msgNoConvert ;AC000;
+ jmp getout ;AN000;
+
+ReadError:
+ jmp DosError
+
+EXELOAD:
+ ASSUME DS:DATA ;AN000;
+ MOV DX,OFFSET RUNVAR ;Read header in here
+ MOV CX,RUNVARSIZ ;Amount of header info we need
+ push bx
+ mov bx,[handle1]
+ MOV AH,read
+ INT 21H ;Read in header
+ pop bx
+ jc ReadError
+ CMP [RELPT],5A4DH ;Check signature word
+ JNZ BADEXE
+ MOV AX,[HEADSIZ] ;size of header in paragraphs
+ ADD AX,31 ;Round up first
+ CMP AX,1000H ;Must not be >=64K
+ JAE TOOBIG
+ AND AX,NOT 31
+ MOV CL,4
+ SHL AX,CL ;Header size in bytes
+
+ push dx
+ push cx
+ push ax
+ push bx
+ mov dx,ax
+ xor cx,cx
+ mov al,0
+ mov bx,[handle1]
+ mov ah,lseek
+ int 21h
+ jc LseekError
+ pop bx
+ pop ax
+ pop cx
+ pop dx
+
+ XCHG AL,AH
+ SHR AX,1 ;Convert to pages
+ MOV DX,[PAGES] ;Total size of file in 512-byte pages
+ SUB DX,AX ;Size of program in pages
+ CMP DX,80H ;Fit in 64K? (128 * 512 = 64k)
+ JAE TOOBIG
+ XCHG DH,DL
+ SHL DX,1 ;Convert pages to bytes
+ MOV AX,[LASTP] ;Get count of bytes in last page
+ OR AX,AX ;If zero, use all of last page
+ JZ WHOLEP
+
+ IF OLDLINK
+ CMP AX,4 ;Produced by old linker?
+ JZ WHOLEP ;If so, use all of last page too
+ ENDIF
+
+ SUB DX,200H ;Subtract last page
+ ADD DX,AX ;Add in byte count for last page
+WHOLEP:
+ MOV [SIZ],DX
+ ADD DX,15
+ SHR DX,CL ;Convert bytes to paragraphs
+ MOV BP,SEG LOAD
+ ADD DX,BP ;Size + start = minimum memory (paragr.)
+ CMP DX,BX ;Enough memory?
+ JA TOOBIG
+ MOV AX,[INITSS]
+ OR AX,[INITSP]
+ OR AX,[INITCS]
+ JMP short ERRORNZ
+
+TOOBIG:
+ pop ds
+ ASSUME DS:NOTHING ;AN000;
+ MESSAGE msgOutOfMemory ;AN000;
+ jmp getout ;AN000;
+
+LseekError:
+ jmp DosError
+
+
+ERRORNZ:
+ ASSUME DS:DATA ;AN000;
+ jz xj
+ JMP BADEXE ;AC000; For ptm P475;
+xj: MOV AX,[INITIP]
+ OR AX,AX ;If IP=0, do binary fix
+ JZ BINFIX
+ CMP AX,100H ;COM file must be set up for CS:100
+ JNZ ERRORNZ
+
+ push dx
+ push cx
+ push ax
+ push bx
+ mov dx,100h ;chop off first 100h
+ xor cx,cx
+ mov al,1 ;seek from current position
+ mov bx,[handle1]
+ mov ah,lseek
+ int 21h
+ jc LseekError
+ pop bx
+ pop ax
+ pop cx
+ pop dx
+
+ SUB [SIZ],AX ;And count decreased size
+ CMP [RELCNT],0 ;Must have no fixups
+ JNZ ERRORNZ
+BINFIX:
+ XOR BX,BX ;Initialize fixup segment
+;See if segment fixups needed
+ CMP [RELCNT],0
+ JZ LOADEXE
+GETSEG:
+ pop ds
+ ASSUME DS:NOTHING ;AN000;
+ MESSAGE msgFixUp ;AN000;
+ PUSH DS
+ PUSH ES
+ POP DS
+ ASSUME DS:DATA ;AN000;
+ MOV AH,STD_CON_STRING_INPUT
+ MOV DX,OFFSET INBUF
+ INT 21H ;Get user response
+ MOV SI,OFFSET INBUF+2
+;;dcl;; MOV BYTE PTR [SI-1],0 ;Any digits?
+ cmp BYTE PTR [SI-1],0 ;Any digits? ;AC000;
+ JZ GETSEG
+DIGLP:
+ LODSB
+ SUB AL,"0"
+ JC DIGERR
+ CMP AL,10
+ JB HAVDIG
+ AND AL,5FH ;Convert to upper case
+ SUB AL,7
+ CMP AL,10
+ JB DIGERR
+ CMP AL,10H
+ JAE DIGERR
+HAVDIG:
+ SHL BX,1
+ SHL BX,1
+ SHL BX,1
+ SHL BX,1
+ OR BL,AL
+ JMP DIGLP
+
+DIGERR:
+ CMP BYTE PTR [SI-1],0DH ;Is last char. a CR?
+ JNZ GETSEG
+LOADEXE:
+ XCHG BX,BP ;BX has LOAD, BP has fixup
+
+ MOV CX,[SIZ]
+ MOV AH,read
+ push di
+ mov di,[handle1]
+ PUSH DS
+ MOV DS,BX
+ ASSUME DS:NOTHING ;AN000;
+ XOR DX,DX
+ push bx
+ mov bx,di
+ INT 21H ;Read in up to 64K
+ pop bx
+ POP DS
+ ASSUME DS:DATA ;AN000;
+ pop di
+ Jnc HAVEXE ;Did we get it all?
+
+ jmp DosError
+
+LseekError2:
+ jmp DosError
+
+HAVEXE:
+ ASSUME DS:DATA ;AN000;
+ CMP [RELCNT],0 ;Any fixups to do?
+ JZ STORE
+ MOV AX,[RELTAB] ;Get position of table
+
+ push dx
+ push cx
+ push ax
+ push bx
+ mov dx,ax
+ xor cx,cx
+ mov al,0
+ mov bx,[handle1]
+ mov ah,lseek
+ int 21h
+ jc LseekError2
+ pop bx
+ pop ax
+ pop cx
+ pop dx
+
+ MOV DX,OFFSET RELPT ;4-byte buffer for relocation address
+RELOC:
+ MOV DX,OFFSET RELPT ;4-byte buffer for relocation address
+ MOV CX,4
+ MOV AH,read
+ push bx
+ mov bx,[handle1]
+ INT 21H ;Read in one relocation pointer
+ pop bx
+ Jnc RDCMP
+ jmp short DosError
+RDCMP:
+ MOV DI,[RELPT] ;Get offset of relocation pointer
+ MOV AX,[RELSEG] ;Get segment
+ ADD AX,BX ;Bias segment with actual load segment
+ MOV ES,AX
+ ASSUME ES:NOTHING ;AN000;
+ ADD ES:[DI],BP ;Relocate
+ DEC [RELCNT] ;Count off
+ JNZ RELOC
+STORE:
+ MOV AH,CREAT
+ MOV DX,OFFSET file2
+ xor cx,cx
+ INT 21H
+ Jc MKERR
+ mov [handle2],ax
+ MOV CX,[SIZ]
+ MOV AH,write
+ push di
+ mov di,[handle2]
+ PUSH DS
+ MOV DS,BX
+ ASSUME DS:NOTHING ;AN000;
+ XOR DX,DX ;Address 0 in segment
+ push bx
+ mov bx,di
+ INT 21H
+ pop bx
+ POP DS
+ ASSUME DS:DATA ;AN000;
+ pop di
+ Jc WRTERR ;Must be zero if more to come
+ cmp AX,CX
+ jnz NOROOM
+ MOV AH,CLOSE
+ push bx
+ mov bx,[handle2]
+ INT 21H
+ jc CloseError
+ pop bx
+ pop ds
+ pop ds
+ ASSUME DS:NOTHING ;AN000;
+
+ RET
+
+;*******************************************************************************
+
+NOROOM: ; ;AN000;
+ ASSUME DS:DATA ;AN000;
+ MOV AH,CLOSE ; Close the file here ;AN000;
+ push bx ; ;AN000;
+ mov bx,[handle2] ; ;AN000;
+ INT 21H ; ;AN000;
+ jc CloseError ; If error let extend messages get it;AN000;
+ pop bx ; ;AN000;
+ mov ah,UNLINK ; Delete the file because it did ;AN000;
+ MOV DX,OFFSET file2 ; not get written correctly. ;AN000;
+ INT 21H ; ;AN000;
+ jc CloseError ; If error let extend messages get it;AN000;
+ pop ds ; ;AN000;
+ ASSUME DS:NOTHING ; ;AN000;
+ message msgNoDiskSpace ; Put out insufficient disk space ;AN000;
+ jmp short getout ; message ;AN000;
+ RET ; return to main_init ;AN000;
+
+;*******************************************************************************
+
+WRTERR: ;AN000;
+MKERR: ;AN000;
+CloseError: ;AN000;
+
+ public DosError ;AN000;
+DosError: ;AN000;
+ mov es:FileNameSegment,ds ; save for opens, creates, ;AN000;
+ mov es:FileNameOffset,dx ;AN000;
+
+ mov bx,0 ; get the extended error code ;AN000;
+ mov ah,059h ;AN000;
+ int 21h ;AN000;
+
+ mov si,offset ds:Sublist_msg_exterror ;AC001;
+ extend_message ;AN001;
+ pop ds ;AN001;
+
+getout: ;AN000;
+ pop ds ;AN000;
+ ASSUME DS:NOTHING ;AN000;
+
+ ret ;AN000;
+
+
+LOCATE ENDP
+
+;----- concatenate two strings
+strcat proc near ; while (*d)
+ cmp byte ptr [di],0
+ jz atend
+ inc di ; d++;
+ jmp strcat
+atend: ; while (*d++ = *s++)
+ lodsb
+ stosb
+ or al,al ; ;
+ jnz atend
+ ret
+strcat endp
+
+;----- Find the first non-ignorable char, return carry if CR found
+kill_bl proc near
+ cld
+sj10: ; while ( *p != 13 &&
+ lodsb
+ CMP AL,13 ; IsBlank (*p++))
+ JZ BreakOut
+ CALL IsBlank
+ JZ SJ10 ; ;
+BreakOut:
+ dec si ; p--;
+ cmp al,0dh ; return *p == 13;
+ clc
+ jne sj11
+ stc
+sj11:
+ ret
+kill_bl endp
+
+IsBlank proc near
+ cmp al,00 ;AN000;
+ retz ;AN000;
+ cmp al,13
+ retz
+ cmp al,' ' ; space
+ retz
+ cmp al,9 ; tab
+ retz
+ cmp al,',' ; comma
+ retz
+ cmp al,';' ; semicolon
+ retz
+ cmp al,'+' ; plus
+ retz
+ cmp al,10 ; line feed
+ retz
+ cmp al,'=' ; equal sign
+ return
+IsBlank Endp
+
+
+procedure copyfs near
+
+ push ax ;AN000;
+
+; $do ; while we have filespec ;AN000;
+$$DO16:
+ lodsb ; move byte to al ;AN000;
+ cmp al,0 ; see if we are at ;AN000;
+ ; the end of the
+ ; filespec
+; $leave e ; exit while loop ;AN000;
+ JE $$EN16
+ stosb ; move byte to path_name ;AN000;
+; $enddo ; end do while ;AN000;
+ JMP SHORT $$DO16
+$$EN16:
+ stosb ;AN000;
+ pop ax ;AN000;
+
+ ret ;AN000;
+copyfs endp ;AN000;
+
+
+procedure dbcs_check near
+
+ push ds ;Save registers ;AC000;
+ push si ; " " " " ;AC000;
+ push ax ; " " " " ;AC000;
+ push ds ; " " " " ;AC000;
+ pop es ;Establish addressability;AC000;
+ cmp byte ptr es:DBCS_VECTOR,Yes ;Have we set this yet? ;AC000;
+ push ax ;Save input character ;AC000;
+; $IF NE ;Nope ;AN000;
+ JE $$IF19
+ mov al,0 ;Get DBCS environment vectors;AC000;
+ DOS_Call Hongeul ; " " " " ;AC000;
+ mov byte ptr es:DBCS_VECTOR,YES ;Indicate we've got vector;AC000;
+ mov es:DBCS_Vector_Off,si ;Save the vector ;AC000;
+ mov ax,ds ; ;AC000;
+ mov es:DBCS_Vector_Seg,ax ; ;AC000;
+; $ENDIF ; for next time in ;AC000;
+$$IF19:
+ pop ax ;Restore input character;AC000;
+ mov si,es:DBCS_Vector_Seg ;Get saved vector pointer;AC000;
+ mov ds,si ; ;AC000;
+ mov si,es:DBCS_Vector_Off ; ;AC000;
+; $SEARCH ;Check all the vectors ;AC000;
+$$DO21:
+ cmp word ptr ds:[si],End_Of_Vector ;End of vector table? ;AC000;
+; $LEAVE E ;Yes, done ;AC000;
+ JE $$EN21
+ cmp al,ds:[si] ;See if char is in vector;AC000;
+; $EXITIF AE,AND ;If >= to lower, and ;AC000;
+ JNAE $$IF21
+ cmp al,ds:[si+1] ; =< than higher range ;AC000;
+; $EXITIF BE ; then DBCS character ;AC000;
+ JNBE $$IF21
+ stc ;Set CY to indicate DBCS;AC000;
+; $ORELSE ;Not in range, check next;AC000;
+ JMP SHORT $$SR21
+$$IF21:
+ add si,DBCS_Vector_Size ;Get next DBCS vector ;AC000;
+; $ENDLOOP ;We didn't find DBCS chaR;AC000;
+ JMP SHORT $$DO21
+$$EN21:
+ clc ;Clear CY for exit ;AC000;
+; $ENDSRCH ; ;AC000;
+$$SR21:
+ pop ax ;Restore registers ;AC000;
+ pop si ; " " " " ;AC000;
+ pop ds ;Restore data segment ;AC000;
+ ret ; ;AC000;
+
+ ret ;AN000;
+dbcs_check endp ;AN000;
+
+
+
+CODE ends
+
+
+ end main_init ;AC000;
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2bmacro.inc b/private/mvdm/dos/v86/cmd/exe2bin/e2bmacro.inc
new file mode 100644
index 000000000..c08358d3a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2bmacro.inc
@@ -0,0 +1,113 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+
+;
+;******************************************************************************
+; Message Macro Definitions
+;******************************************************************************
+;
+
+ EXTRN Display_Interface:near
+
+
+;-----------------------------------------------------------------------------
+
+MESSAGE macro Message_Name ; ;AN000;
+ ;
+ mov dx,offset Message_Name ; ;AN000;
+ call Display_Interface ; ;AN000;
+ ;
+ endm ; ;AN000;
+
+
+;
+;*****************************************************************************
+; General Macro's
+;*****************************************************************************
+;
+
+Procedure macro Proc_Name
+
+Public Proc_Name
+Proc_Name proc
+
+ endm
+;-----------------------------------------------------------------------------
+
+DOS_Call macro Function
+
+ mov ah,Function
+ int 21h
+
+ endm
+;-----------------------------------------------------------------------------
+
+Parse_Message macro ;AN000;
+
+
+ push ds ;AN000;
+ mov dx,SEG parse_ptr ;AN000;
+ mov ds,dx ;AN000;
+ ASSUME DS:DATA ;AN000;
+ ASSUME ES:DATA ;AN000;
+ mov word ptr Parse_Error_Msg,ax ;AN000;
+ mov dx,offset Parse_Error_Msg ; ;AN000;
+ call Display_Interface ; ;AN000;
+ pop ds
+ endm ; ;AN000;
+
+;-----------------------------------------------------------------------------
+
+Extend_Message macro ; ;AN001;
+
+ ;
+ push ds ;AN001;
+ mov dx,SEG parse_ptr ;AN001;
+ mov ds,dx ;AN001;
+ ASSUME DS:DATA ;AN001;
+ ASSUME ES:DATA ;AN001;
+ mov word ptr Extend_Error_Msg,ax ; ;AN001;
+ mov dx,offset Extend_Error_Msg ; ;AN001;
+ call Display_Interface ; ;AN001;
+ pop ds ;AN001;
+ endm ; ;AN001;
+
+;-----------------------------------------------------------------------------
+
+; macros to declare messages
+
+addr macro sym,name
+ public name
+ ifidn <name>,<>
+ dw offset sym
+ else
+ public name
+name dw offset sym
+ endif
+endm
+
+
+defmsg macro sym, name, str1, str2, str3, str4, str5
+ sym db str1
+ ifnb <str2>
+ db str2
+ endif
+ ifnb <str3>
+ db str3
+ endif
+ ifnb <str4>
+ db str4
+ endif
+ ifnb <str5>
+ db str5
+ endif
+ ifnb <name>
+ addr sym, name
+ endif
+endm
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2bparse.inc b/private/mvdm/dos/v86/cmd/exe2bin/e2bparse.inc
new file mode 100644
index 000000000..088d744ea
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2bparse.inc
@@ -0,0 +1,199 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+data segment public 'DATA'
+
+
+
+;
+;***************************************************************************
+; Equates
+;***************************************************************************
+;
+
+;Match Flags
+
+Numeric_Value equ 8000h ; ;AN000;
+Signed_Numeric_Value equ 4000h ; ;AN000;
+Simple_String equ 2000h ; ;AN000;
+Date_String equ 1000h ; ;AN000;
+Time_String equ 0800h ; ;AN000;
+Complex_List equ 0400h ; ;AN000;
+Filespec equ 0200h ; ;AN000;
+Drive_Only equ 0100h ; ;AN000;
+Quoted_String equ 0080h ; ;AN000;
+Ignore_Colon equ 0010h ; ;AN000;
+Repeats_Allowed equ 0002h ; ;AN000;
+Optional equ 0001h ; ;AN000;
+
+;Function_Flags
+
+File_Table_Capitalize equ 1 ; ;AN000;
+
+;Result buffer type returned
+rb_Number equ 1
+rb_List_Index equ 2
+rb_String equ 3
+rb_Complex equ 4
+rb_Filespec equ 5
+rb_Drive equ 6
+rb_Date equ 7
+rb_Time equ 8
+rb_Quoted_String equ 9
+
+
+;Extra delimeters and EOL
+
+Delimiters_Only equ 1 ; ;AN000;
+EOL_Or_Delimiters equ 2 ; ;AN000;
+
+Semi_Colon equ ";" ; ;AN000;
+Tab equ 09h ; ;AN000;
+Colon1 equ ":" ; ;AN000;
+NUL equ "0"
+
+;Parse Errors
+
+No_Error equ 0 ; ;AN000;
+Too_Many_Operands equ 1 ; ;AN000;
+Operand_Missing equ 2 ; ;AN000;
+Not_In_Switch_List equ 3 ; ;AN000;
+Not_In_Keyword_List equ 4 ; ;AN000;
+Out_Of_Range equ 6 ; ;AN000;
+Not_In_Value_List equ 7 ; ;AN000;
+Not_In_String_List equ 8 ; ;AN000;
+Syntax_Error equ 9 ; ;AN000;
+End_Of_Parse equ -1 ; ;AN000;
+
+;Other
+
+None equ 0 ; ;AN000;
+No_Error equ 0 ; ;AN000;
+Switch_Found equ 0FFFFh ; ;AN000;
+Range_Ok equ 1 ; ;AN000;
+Command_Line_Parms equ 81h ; ;AN000;
+
+;
+;*****************************************************************************
+; Parse Structures
+;*****************************************************************************
+;
+
+Control struc
+
+Match_Flags dw ?
+Function_Flags dw ?
+Result dw ?
+Values dw ?
+Num_Keywords db ?
+Keyword db ?
+
+Control ends
+
+File_Name_Return struc ; ;AN000;
+
+Drive_Type db 0 ; ;AN000;
+Drive_Item_Tag db 0 ; ;AN000;
+Synonym dw 0 ; ;AN000;
+String_Value_ptr db 0 ;File Name ;AN000;
+
+File_Name_Return ends ; ;AN000;
+
+
+;
+;**************************************************************************
+; Parse tables
+;**************************************************************************
+;
+
+Command_Line_Table label byte ; ;AN000;
+
+ dw Command_Control ;Point to next level ;AN000;
+ db Delimiters_Only ; ;AN000;
+ db 1 ; ;AN000;
+ db Semi_Colon ; ;AN000;
+
+
+;
+;**************************************************************************
+; Define Positionals, Switches and Keywords
+;**************************************************************************
+;
+
+Command_Control label byte ; ;AN000;
+
+ db 1,2 ;File names Positional (1 required) ;AN000;
+ dw Positional_Control1 ;Pointer to control table ;AN000;
+ dw Positional_Control2 ;Pointer to control table ;AN000;
+ db 1 ; 1 switch
+ dw Switch_Control1 ; Pointer to control table
+ db None ;No Keywords (maxk) ;AN000;
+
+;
+;**************************************************************************
+;Control Tables
+;**************************************************************************
+;
+
+Positional_Control1 label byte ; ;AN000;
+
+ dw Filespec ;Match_Flag ;AN000;
+ dw File_Table_Capitalize ;No function flags ;AN000;
+ dw File_Name_Buffer1 ;Where it will be returned ;AN000;
+ dw No_Value ;No value ranges defined ;AN000;
+ db None ;No defined switches/keywords ;AN000;
+
+Positional_Control2 label byte ; ;AN000;
+
+ dw Filespec+Optional ;Match_Flag ;AN000;
+
+ dw File_Table_Capitalize ;No function flags ;AN000;
+ dw File_Name_Buffer2 ;Where it will be returned ;AN000;
+ dw No_Value ;No value ranges defined ;AN000;
+ db None ;No defined switches/keywords ;AN000;
+
+Switch_Control1 label byte ; used by /?
+
+ dw 0 ; Match Mask
+ dw 0 ; Func Mask
+ dw Switch_Buffer1 ; ptr to Results
+ dw No_Value ; ptr to Value
+ db 1 ; # of synonyms
+sw1_s1 db "/?",0 ; 1st synonym
+
+No_Value label byte ; ;AN000;
+ db 0 ; ;AN000;
+
+;
+;************************************************************************
+; PARSE Return Buffers
+;************************************************************************
+;
+File_name_Buffer1 label byte ; ;AN000;
+
+rb_type1 db 0 ;type returned ;AN000;
+rb_item_tag1 db 0 ;matched item tag ;AN000;
+rb_synonym1 dw 0 ;found synonyms ;AN000;
+rb_string1_off dw 0 ;Offset of string ;AN000;
+rb_string1_seg dw 0 ;Offset of string ;AN000;
+
+File_name_Buffer2 label byte ; ;AN000;
+
+rb_type2 db 0 ;type returned ;AN000;
+rb_item_tag2 db 0 ;matched item tag ;AN000;
+rb_synonym2 dw 0 ;found synonyms ;AN000;
+rb_string2_off dw 0 ;Offset of string ;AN000;
+rb_string2_seg dw 0 ;Offset of string ;AN000;
+
+Switch_Buffer1 label byte ; used by /?
+
+sw_type1 db 0 ; type returned
+sw_tag1 db 0 ; matched item tag
+sw_synonym1 dw 0 ; found synonym
+sw_padding1 dd 0 ; pad it out
+
+data ends
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/e2btable.inc b/private/mvdm/dos/v86/cmd/exe2bin/e2btable.inc
new file mode 100644
index 000000000..e7965b41e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/e2btable.inc
@@ -0,0 +1,208 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+data segment
+
+;
+;*****************************************************************************
+; Macro's
+;*****************************************************************************
+;
+
+
+Define_Msg macro Message_Name ; ;AN000;
+ ;
+Create_Msg Message_Name,Message_Number,Handle,Sublist,Count,Class,Function,Input;AN000;
+ ;
+ endm ; ;AN000;
+
+;-----------------------------------------------------------------------------
+
+Create_Msg macro Parm1,Parm2,Parm3,Parm4,Parm5,Parm6,Parm7,Parm8; ;AN000;
+
+Parm1 label word ; ;AN000;
+ dw Parm2 ; ;AN000;
+ dw Parm3 ; ;AN000;
+ dw Parm4 ; ;AN000;
+ dw Parm5 ; ;AN000;
+ db Parm6 ; ;AN000;
+ db Parm7 ; ;AN000;
+ dw Parm8 ; ;AN000;
+ endm ; ;AN000;
+
+
+;--------------------------- ; ;AN001;
+Sublist_msg_parserr label dword ; ;AN001;
+ ;AN001;
+ db Sublist_Length ;11 ;AN001;
+ db Reserved ;0 ;AN001;
+parsoff dw ? ;off ;AN001;
+parseg dw ? ; ;AN001;
+ db 0 ;USE PERCENT ZERO ;AN001;
+ db Left_Align+Char_Field_ASCIIZ ;type of data ;AN001;
+ db 128 ;max width ;AN001;
+ db 1 ;min width ;AN001;
+ db Blank ;pad char ;AN001;
+;--------------------------- ; ;AN001;
+
+Sublist_msg_exterror label word ;AN001;
+
+ db Sublist_Length ;AN001;
+ db Reserved ;AN001;
+FileNamePointer label dword ;AN001;
+FileNameOffset dw ? ;AN001;
+FileNameSegment dw ? ;AN001;
+ db 0 ; SPECIAL %0 - Extended Errors only ;AN001;
+ db Left_Align+Char_Field_ASCIIZ ;AN001;
+ db 132 ;AN001;
+ db 0 ;AN001;
+ db Blank ;AN001;
+;-----------------------------------------------------------------------------
+;
+;*****************************************************************************
+; Message Retriever equates
+;*****************************************************************************
+;
+
+Format_Msg equ 'C'
+
+N_A equ 0
+
+Blank equ " "
+No_Function equ 0
+
+No_Input equ 0
+
+
+;
+;*****************************************************************************
+; Message Description Tables
+;*****************************************************************************
+;
+
+MSG_OPTIONS_FIRST equ 300
+MSG_OPTIONS_LAST equ 303
+
+;---------------------- ;
+Message_Number = 1 ; ;AN000;
+Handle = No_Handle ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgBadDOSVersion ; ;AN000;
+;---------------------- ;
+Message_Number = 2 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgOutOfMemory ; ;AN000;
+;---------------------- ;
+Message_Number = 3 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgLoadFailure ; ;AN000;
+;---------------------- ;
+Message_Number = 4 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgNoAccess ; ;AN000;
+;---------------------- ;
+Message_Number = 5 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgNoConvert ; ;AN000;
+;---------------------- ;
+Message_Number = 6 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgNoFile ; ;AN000;
+;---------------------- ;
+Message_Number = 7 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgFileCreateError ; ;AN000;
+;---------------------- ;
+Message_Number = 8 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = DOS_BUF_KEYB_INP ; ;AN000;
+Input = INBUF ; ;AN000;
+ Define_Msg msgFixUp ; ;AN000;
+;---------------------- ;
+Message_Number = 0 ; ;AN001;
+Handle = STDERR ; ;AN001;
+Sublist = ds:sublist_msg_parserr ; ;AN001;
+Count = 1 ; ;AN001;
+Class = Parse_Err_Class ; ;AN001;
+Function = No_Input ; ;AN001;
+Input = N_A ; ;AN001;
+ Define_Msg parse_error_msg ; ;AN001;
+;---------------------- ;
+Message_Number = 0 ; ;AN001;
+Handle = STDERR ; ;AN001;
+Sublist = ds:sublist_msg_exterror ; ;AN001;
+Count = 1 ; ;AN001;
+Class = ext_Err_Class ; ;AN001;
+Function = No_Input ; ;AN001;
+Input = N_A ; ;AN001;
+ Define_Msg extend_error_msg ; ;AN001;
+;---------------------- ;
+Message_Number = 10 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgNoDiskSpace ; ;AN000;
+;---------------------- ;
+Message_Number = 12 ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgNoFileName ; ;AN000;
+;---------------------- ;
+Message_Number = MSG_OPTIONS_FIRST ; ;AN000;
+Handle = STDOUT ; ;AN000;
+Sublist = No_Replace ; ;AN000;
+Count = N_A ; ;AN000;
+Class = Utility_Msg_Class ; ;AN000;
+Function = No_Input ; ;AN000;
+Input = N_A ; ;AN000;
+ Define_Msg msgOptions ; ;AN000;
+;---------------------- ;
+
+data ends
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.lnk b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.lnk
new file mode 100644
index 000000000..a038f9bb0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.lnk
@@ -0,0 +1,5 @@
+/DOSSEG /MAP+
+E2BINIT.obj+
+DISPLAY.obj
+EXE2BIN.EXE, EXE2BIN.MAP;
+
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.skl b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.skl
new file mode 100644
index 000000000..d90575cf5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.skl
@@ -0,0 +1,71 @@
+
+:util EXE2BIN
+
+:class 1
+:use EXTEND2
+:use EXTEND3
+:use EXTEND4
+:use EXTEND5
+:use EXTEND6
+:use EXTEND15
+:use EXTEND18
+
+:class 2
+
+:class A
+;msgBadDosVersion
+;"Incorrect DOS version",CR,LF,"$"
+:use 1 COMMON1
+
+;msgOutOfMemory
+;"Insufficient memory",CR,LF
+:def 2 "Insufficient memory",CR,LF
+
+;msgLoadFailure
+;"Can't find messages"
+:def 3 "Can't find messages",CR,LF
+
+; 300 - 399 reserved for options help messages
+;msgOptions
+:def 300 EXE2BIN /?
+:def 301 EXE2BIN /?
+:def 302 EXE2BIN /?
+:def 303 EXE2BIN /?
+
+:CLASS B
+
+;msgNoAccess
+;"Access denied ", CR, LF
+:def 4 "Access denied",CR,LF
+
+;msgNoConvert
+;"File cannot be converted", CR, LF
+:def 5 "File cannot be converted",CR,LF
+
+;msgNoFile
+;"File not found ", CR, LF
+:def 6 "File not found",CR,LF
+
+;msgFileCreateError
+;"File creation error", CR, LF
+:def 7 "File creation error",CR,LF
+
+;msgFixUp
+;"Fix-ups needed - base segment (hex):"
+:def 8 "Fix-ups needed - base segment (hex):"
+
+;msgBadParameter
+;"Invalid parameter",CR,LF,0
+:use 9 EXTEND87
+
+;msgNoDiskSpace
+;"Insufficient disk space", CR, LF
+;def 10 "Insufficient disk space",CR,LF
+:use 10 COMMON20
+
+;msgNoFileName
+;"File name must be specified ", CR, LF
+:def 12 "File name must be specified",CR,LF
+
+:end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.tag b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.tag
new file mode 100644
index 000000000..0366c4aad
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/exe2bin.tag
@@ -0,0 +1,8 @@
+; tag file for EXE2BIN
+
+M001 MD 12/27/90 E2BINIT.ASM Removal of code to check
+ for ambiguous file names.
+ Code was unneeded since
+ these names are caught later
+ anyway.
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/exe2bin/makefile b/private/mvdm/dos/v86/cmd/exe2bin/makefile
new file mode 100644
index 000000000..41e64ad57
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/exe2bin/makefile
@@ -0,0 +1,65 @@
+# Makefile for exe2bin.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =exe2bin.exe
+
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+exe2bin.ctl: exe2bin.skl makefile \
+ $(msg)\$(COUNTRY).msg
+
+e2binit.obj: e2binit.asm \
+ $(inc)\syscall.inc \
+ e2bparse.inc \
+ e2bmacro.inc \
+ e2bequ.inc \
+ $(inc)\sysmsg.inc \
+ e2btable.inc \
+ exe2bin.ctl \
+ $(inc)\dossym.inc \
+ $(inc)\dosmac.inc \
+ $(inc)\bpb.inc \
+ $(inc)\buffer.inc \
+ $(inc)\sysvar.inc \
+ $(inc)\mult.inc \
+ $(inc)\dirent.inc \
+ $(inc)\cpmfcb.inc \
+ $(inc)\find.inc \
+ $(inc)\pdb.inc \
+ $(inc)\sf.inc \
+ $(inc)\arena.inc \
+ $(inc)\intnat.inc \
+ $(inc)\error.inc \
+ $(inc)\syscall.inc \
+ $(inc)\parse.asm \
+ $(inc)\psdata.inc \
+
+display.obj: display.asm \
+
+$(dest): display.obj \
+ e2binit.obj \
+ exe2bin.ctl \
+ exe2bin.lnk
+ link16 $(exelink) /MAP @exe2bin.lnk
diff --git a/private/mvdm/dos/v86/cmd/fastopen/fastopen.asm b/private/mvdm/dos/v86/cmd/fastopen/fastopen.asm
new file mode 100644
index 000000000..5eff529c5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/fastopen/fastopen.asm
@@ -0,0 +1,24 @@
+; fastopen.asm
+;
+; Copyright (c) 1991, Microsoft Corporation
+;
+; History:
+; 13-Apr-1992 Sudeep Bharati (sudeepb)
+; Created.
+;
+; On NT this utility is just a stub which does nothing.
+;
+
+code segment byte public 'CODE'
+ assume cs:code, ds:code, es:code
+
+ org 100h
+public start
+start:
+ mov ah,4ch
+ xor al,al
+ int 21h
+ ret
+
+code ends
+ end start
diff --git a/private/mvdm/dos/v86/cmd/fastopen/fastopen.lnk b/private/mvdm/dos/v86/cmd/fastopen/fastopen.lnk
new file mode 100644
index 000000000..542121a10
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/fastopen/fastopen.lnk
@@ -0,0 +1,2 @@
+FASTOPEN.OBJ
+FASTOPEN.EXE,/LI/MAP;
diff --git a/private/mvdm/dos/v86/cmd/fastopen/makefile b/private/mvdm/dos/v86/cmd/fastopen/makefile
new file mode 100644
index 000000000..fff987b80
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/fastopen/makefile
@@ -0,0 +1,33 @@
+# Makefile for fastopen.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =fastopen.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+fastopen.obj: fastopen.asm $(inc)\fastopen.inc \
+ makefile
+
+$(dest): fastopen.obj
+ link16 $(exelink) @fastopen.lnk
diff --git a/private/mvdm/dos/v86/cmd/graphics/graphics.asm b/private/mvdm/dos/v86/cmd/graphics/graphics.asm
new file mode 100644
index 000000000..4d79a6f1f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/graphics.asm
@@ -0,0 +1,82 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS GRAPHICS Command - Command Entry Point
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; MS DOS GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRAPHICS.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the GRAPHICS command entry point. ;AN000;
+;; A jump is made to the GRAPHICS_INSTALL procedure ;AN000;
+;; in file GRINST.ASM to begin installation processing. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; GRINST.EXT - Externals for GRINST.ASM ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRINST.ASM: ;AN000;
+;; GRAPHICS_INSTALL - Main module for installation. ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; LINK GRAPHICS GRINT2FH GRPATTRN GRCTRL GRCPSD GRCOLPRT GRBWPRT ;AN000;
+;; GRINST GRPARSE grparms GRLOAD GRLOAD2 GRLOAD3; ;AN000;
+;; EXE2BIN GRAPHICS.EXE GRAPHICS.COM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; A000 - Denotes 4.00 level source. ;AN000;
+;; A001 - PTM1779 - invalid parm msg followed by garbage ;AN001;
+;; Module affected: GRPARMS.ASM ;AN001;
+;; A002 - PTM2666 - Release environment string before terminating. ;AN002;
+;; Module affected: GRINST.ASM ;AN002;
+;; A003 - PTM3915 - Change to include common copyright file.
+;; Module affected: GRAPHICS.ASM
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ORG 100H ;; required for .COM ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
+ ;; for transient command processing ;AN000;
+START: ;; ;AN000;
+ ;; ;AN000;
+ JMP GRAPHICS_INSTALL ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;;
+; INCLUDE COPYRIGH.INC ;; included in message services ;AN003;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+CODE ENDS ;AN000;
+ END START ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/graphics.lnk b/private/mvdm/dos/v86/cmd/graphics/graphics.lnk
new file mode 100644
index 000000000..b266f1987
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/graphics.lnk
@@ -0,0 +1,15 @@
+GRAPHICS+
+GRINT2FH+
+GRPATTRN+
+GRCTRL+
+GRCPSD+
+GRCOLPRT+
+GRBWPRT+
+GRINST+
+GRPARSE+
+grparms+
+GRLOAD+
+GRLOAD2+
+GRLOAD3
+GRAPHICS.EXC;
+
diff --git a/private/mvdm/dos/v86/cmd/graphics/graphics.pro b/private/mvdm/dos/v86/cmd/graphics/graphics.pro
new file mode 100644
index 000000000..77d74e2b8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/graphics.pro
@@ -0,0 +1,572 @@
+;----------------------------------------------------------------------------
+; GRAPHICS.PRO File for Microsoft MS-DOS
+;----------------------------------------------------------------------------
+ ; (C)Copyright 1988-1991 Microsoft
+ ;Licensed Material - Program Property of Microsoft
+;----------------------------------------------------------------------------
+PRINTER HPDEFAULT
+;
+; SETUP
+; esc*rA start graphics at current cursor position
+; using current graphics resolution.
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200
+ SETUP 27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 6,14 ; 640x200
+ SETUP 27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1,ROTATE
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 15,16 ; 640x350
+ SETUP 27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 17,18 ; 640x480
+ SETUP 27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+;----------------------------------------------------------------------------
+PRINTER DESKJET,LASERJETII
+;
+; SETUP
+; esc*t75R select 75dpi
+; esc*t150R select 150dpi
+; esc*t300R select 300dpi
+; esc&a#h#V move cursor position, in decipoints
+; esc*r1A start graphics at current cursor position
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 100dpi
+ SETUP 27,42,116,49,48,48,82,27,38,97,48,104,48,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,66,12
+
+ DISPLAYMODE 6,14 ; 640x200 150dpi
+ SETUP 27,42,116,49,53,48,82,27,38,97,57,55,53,104,52,57,56,86,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,2,ROTATE
+ RESTORE 27,42,114,66,12
+
+
+ DISPLAYMODE 15,16 ; 640x350 150dpi
+ SETUP 27,42,116,49,53,48,82,27,38,97,49,50,49,53,104,54,48,55,86,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,66,12
+
+ DISPLAYMODE 17,18 ; 640x480 150dpi
+ SETUP 27,42,116,49,53,48,82,27,38,97,53,56,56,104,54,57,55,86,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,66,12
+;----------------------------------------------------------------------------
+PRINTER LASERJET
+;
+; SETUP
+; esc*t75R select 75dpi
+; esc&a#h#V move cursor position in decipoints
+; esc*r1A start graphics at current cursor position
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 75dpi
+ SETUP 27,42,116,55,53,82,27,38,97,49,48,50,48,104,53,52,51,86,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,66,12
+
+ DISPLAYMODE 6,14 ; 640x200 75dpi
+ SETUP 27,42,116,55,53,82,27,38,97,49,48,50,48,104,53,52,51,86,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1,ROTATE
+ RESTORE 27,42,114,66,12
+
+ DISPLAYMODE 15,16 ; 640x350 75dpi
+ SETUP 27,42,116,55,53,82,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1 ROTATE
+ RESTORE 27,42,114,66,12
+
+ DISPLAYMODE 17,18 ; 640x480 75dpi
+ SETUP 27,42,116,55,53,82,27,42,114,48,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1,ROTATE
+ RESTORE 27,42,114,66,12
+;----------------------------------------------------------------------------
+PRINTER PAINTJET
+;
+; Treats the Paintjet as a B&W device for both text and color. Specifying
+; one color plane uses just black and white as the two available colors.
+;
+; SETUP
+; esc*t90R select 90dpi
+; esc*t180R select 180dpi
+; esc*r1U select 1 color plane and reset color palette.
+; esc&a#H move curser position, in decipoints.
+; esc*r1A start graphics at current cursor position.
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 180dpi
+ SETUP 27,42,116,49,56,48,82,27,42,114,49,85,27,38,97,49,50,54,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 6,14 ; 640x200 180dpi
+ SETUP 27,42,116,49,56,48,82,27,42,114,49,85,27,38,97,49,50,54,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,2,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 15,16 ; 640x350 180dpi
+ SETUP 27,42,116,49,56,48,82,27,42,114,49,85,27,38,97,52,53,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 17,18 ; 640x480 180dpi
+ SETUP 27,42,116,49,56,48,82,27,42,114,49,85,27,38,97,57,53,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,066
+;----------------------------------------------------------------------------
+PRINTER QUIETJET
+;
+; SETUP
+; esc*t96R select 96x96dpi
+; esc*t192R select 192x192dpi
+; esc*t1280S select 192x96dpi
+; esc*rA start graphics at current cursor position
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 96x96dpi
+ SETUP 27,42,116,57,54,82,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 6,14 ; 640x200 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 15,16 ; 640x350 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 17,18 ; 640x480 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+;----------------------------------------------------------------------------
+PRINTER QUIETJETPLUS
+;
+; SETUP
+; esc*t96R select 96x96dpi
+; esc*t192R select 192x192dpi
+; esc*t1280S select 192x96dpi
+; esc*rA start graphics at current cursor position
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 96x96dpi
+ SETUP 27,42,116,57,54,82,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 6,14 ; 640x200 96x96dpi
+ SETUP 27,42,116,57,54,82,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,1,ROTATE
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 15,16 ; 640x350 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 17,18 ; 640x480 96x96dpi
+ SETUP 27,42,116,57,54,82,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2
+ RESTORE 27,42,114,66
+;----------------------------------------------------------------------------
+PRINTER RUGGEDWRITER
+;
+; SETUP
+; esc*t90R select 90dpi
+; esc*t180R select 180dpi
+; esc&a#H move curser position, in decipoints.
+; esc*r1A start graphics at current cursor position.
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 180dpi
+ SETUP 27,42,116,49,56,48,82,27,38,97,49,50,54,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 6,14 ; 640x200 180dpi
+ SETUP 27,42,116,49,56,48,82,27,38,97,49,50,54,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,2,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 15,16 ; 640x350 90dpi
+ SETUP 27,42,116,57,48,82,27,38,97,49,51,53,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 17,18 ; 640x480 180dpi
+ SETUP 27,42,116,49,56,48,82,27,38,97,57,53,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,066
+;----------------------------------------------------------------------------
+PRINTER RUGGEDWRITERWIDE
+;
+; SETUP
+; esc*t90R select 90dpi
+; esc*t180R select 180dpi
+; esc&a#H move curser position, in decipoints.
+; esc*r1A start graphics at current cursor position.
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 90dpi
+ SETUP 27,42,116,57,48,82,27,38,97,49,55,49,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,3,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 6,14 ; 640x200 90dpi
+ SETUP 27,42,116,57,48,82,27,38,97,49,55,49,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,1,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 15,16 ; 640x350 90dpi
+ SETUP 27,42,116,57,48,82,27,38,97,50,48,55,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1,ROTATE
+ RESTORE 27,42,114,066
+
+ DISPLAYMODE 17,18 ; 640x480 180dpi
+ SETUP 27,42,116,49,56,48,82,27,38,97,50,57,55,48,72,27,42,114,49,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2,ROTATE
+ RESTORE 27,42,114,066
+;----------------------------------------------------------------------------
+PRINTER THINKJET
+;
+; SETUP
+; esc*r640S select 96dpi
+; esc*r1280S select 192dpi
+; esc*rA start graphics at current cursor position.
+; GRAPHICS
+; esc*b COUNT W DATA
+; RESTORE
+; esc*rB end graphics
+;----------------------------------------------------------------------------
+ DEFINE DATA,ROW
+
+ DISPLAYMODE 4,5,13,19 ; 320x200 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,4,2
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 6,14 ; 640x200 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,2
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 15,16 ; 640x350 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+
+ DISPLAYMODE 17,18 ; 640x480 192x96dpi
+ SETUP 27,42,114,49,50,56,48,83,27,42,114,65
+ GRAPHICS 27,42,98,COUNT,87,DATA
+ PRINTBOX STD,2,1
+ RESTORE 27,42,114,66
+;----------------------------------------------------------------------------
+PRINTER GRAPHICS,THERMAL ;; 5152, 4201, 4202(8"), 5201-002(8"), 5202, 3812
+ ;; 4207, 4208, 5140
+
+ ; Maximum Print width: 8"
+ ; Horizontal BPI: 120 Vertical BPI: 72
+ ; SETUP Statements contain the following escape sequences:
+ ; 27,51,24 = set line spacing to 24/216
+ ; GRAPHICS Statements use ESC "L" with the last two bytes being
+ ; the data count (low,high)
+
+ DISPLAYMODE 4,5,13,19 ;; 320x200 > 6.7"x8.9" rotated
+ SETup 27,51,24
+ GRAPHICS 32,32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,2,ROTATE
+ PRINTBOX LCD,2,2,ROTATE
+
+ DISPLAYMODE 6,14 ;; 640x200 > 6.7"x8.9" rotated
+ SETup 27,51,24
+ GRAPHICS 32,32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,1,ROTATE
+ PRINTBOX LCD,2,1,ROTATE
+
+ DISPLAYMODE 15,16 ;; 640x350 > 5.8"x8.9" rotated
+ SETup 27,51,24
+ GRAPHICS 32,32,32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,2,1,ROTATE
+ PRINTBOX LCD ;; PC/Convertible doesn't support these modes
+
+ DISPLAYMODE 17,18 ;; 640x480 > 8"x8.9" rotated
+ SETup 27,51,24
+ GRAPHICS 27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,2,1,ROTATE
+ PRINTBOX LCD ;; PC/Convertible doesn't support these modes
+;---------------------------------------------------------------------------
+PRINTER COLOR8 ;; 5182 CMY Ribbon
+
+ ; Maximum Print width: 8"
+ ; Horizontal BPI: 168 in 1:1 aspect ratio, 140 in 5:6 aspect ratio
+ ; Vertical BPI: 84
+ ; SETUP Statements contain the following escape sequences:
+ ; 27,51,14 = set line spacing to 14/144
+ ; 27,110,[0|1] = 0 sets aspect ratio to 5:6, 1 sets it to 1:1
+ ; GRAPHICS Statements use ESC "L" with the last two bytes being
+ ; the data count (low,high)
+
+ COLORSELECT Y,27,121 ;; yellow band
+ COLORSELECT M,27,109 ;; magenta band
+ COLORSELECT C,27,99 ;; cyan band
+ COLORSELECT B,27,98 ;; black band
+ ;;
+ ;; Following RGB's represent the first 16
+ ;; screen colors.
+ ;; SCREEN COLOR PRINT COLOR
+ ;; ------------ -----------
+ COLORPRINT 0,0,0,B ;; BLACK BLACK
+ COLORPRINT 0,0,42,C ;; BLUE CYAN
+ COLORPRINT 0,42,0,Y,C ;; GREEN GREEN
+ COLORPRINT 0,42,42,C ;; CYAN CYAN
+ COLORPRINT 42,0,0,Y,M ;; RED RED
+ COLORPRINT 42,0,42,C,M ;; PURPLE PURPLE
+ COLORPRINT 42,21,0,Y,C,M ;; BROWN BROWN
+ COLORPRINT 42,42,42 ;; LOW WHITE WHITE (NOTHING)
+ COLORPRINT 21,21,21,B ;; GREY BLACK
+ COLORPRINT 21,21,63,C ;; HIGH BLUE CYAN
+ COLORPRINT 21,63,21,Y,C ;; HIGH GREEN GREEN
+ COLORPRINT 21,63,63,C ;; HIGH CYAN CYAN
+ COLORPRINT 63,21,21,Y,M ;; HIGH RED RED
+ COLORPRINT 63,21,63,M ;; MAGENTA MAGENTA
+ COLORPRINT 63,63,21,Y ;; YELLOW YELLOW
+ COLORPRINT 63,63,63 ;; HIGH WHITE WHITE (NOTHING)
+
+ COLORPRINT 42,42,0,Y ;; This statement maps the "yellow" in CGA
+ ;; palette 0 to yellow
+ ;;
+ DISPLAYMODE 4,5,13,19 ;; 320x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,2,ROTATE
+ DISPLAYMODE 6,14 ;; 640x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,1,ROTATE
+ DISPLAYMODE 15,16 ;; 640x350
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,3,1,ROTATE
+ DISPLAYMODE 17,18 ;; 640x480
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,2,1
+;---------------------------------------------------------------------------
+PRINTER COLOR4 ;; 5182 RGB Ribbon
+
+ ; Maximum Print width: 8"
+ ; Horizontal BPI: 168 in 1:1 aspect ratio, 140 in 5:6 aspect ratio
+ ; Vertical BPI: 84
+ ; SETUP Statements contain the following escape sequences:
+ ; 27,51,14 = set line spacing to 14/144
+ ; 27,110,[0|1] = 0 sets aspect ratio to 5:6, 1 sets it to 1:1
+ ; GRAPHICS Statements use ESC "L" with the last two bytes being
+ ; the data count (low,high)
+
+ COLORSELECT R,27,121 ;; red band
+ COLORSELECT G,27,109 ;; green band
+ COLORSELECT B,27,99 ;; blue band
+ COLORSELECT X,27,98 ;; black band
+ ;;
+ ;; Following RGB's represent the first 16
+ ;; screen colors.
+ ;; SCREEN COLOR PRINT COLOR
+ ;; ------------ -----------
+ COLORPRINT 0,0,0,X ;; BLACK BLACK
+ COLORPRINT 0,0,42,B ;; BLUE BLUE
+ COLORPRINT 0,42,0,G ;; GREEN GREEN
+ COLORPRINT 0,42,42,B ;; CYAN BLUE
+ COLORPRINT 42,0,0,R ;; RED RED
+ COLORPRINT 42,0,42,R ;; PURPLE RED
+ COLORPRINT 42,21,0,X ;; BROWN BLACK
+ COLORPRINT 42,42,42 ;; LOW WHITE WHITE (NOTHING)
+ COLORPRINT 21,21,21,X ;; GREY BLACK
+ COLORPRINT 21,21,63,B ;; HIGH BLUE BLUE
+ COLORPRINT 21,63,21,G ;; HIGH GREEN GREEN
+ COLORPRINT 21,63,63,B ;; HIGH CYAN BLUE
+ COLORPRINT 63,21,21,R ;; HIGH RED RED
+ COLORPRINT 63,21,63,R ;; MAGENTA RED
+ COLORPRINT 63,63,21 ;; YELLOW WHITE (NOTHING)
+ COLORPRINT 63,63,63 ;; HIGH WHITE WHITE (NOTHING)
+
+ COLORPRINT 42,42,0,B ;; This statement maps the "yellow" in CGA
+ ;; palette 0 to blue as was done in
+ ;; versions of GRAPHICS
+ ;;
+ DISPLAYMODE 4,5,13,19 ;; 320x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,2,ROTATE
+ DISPLAYMODE 6,14 ;; 640x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,1,ROTATE
+ DISPLAYMODE 15,16 ;; 640x350
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,3,1,ROTATE
+ DISPLAYMODE 17,18 ;; 640x480
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,2,1
+;---------------------------------------------------------------------------
+PRINTER GRAPHICSWIDE ;; 4202(13.5"), 5201-002(13.5")
+
+ ; Maximum Print width: 13.5"
+ ; Horizontal BPI: 120 Vertical BPI: 72
+ ; SETUP Statements contain the following escape sequences:
+ ; 27,88,1,255 = enable 13.5" printing
+ ; 27,51,24 = set line spacing to 24/216
+ ; 27,51,18 = set line spacing to 18/216 (320x200 MODES ONLY!!)
+ ; GRAPHICS Statements use ESC "L" with the last two bytes being
+ ; the data count (low,high)
+
+ DISPLAYMODE 4,5,13,19 ;; 320x200 > 10.7"x8.3" non-rotated
+ SETup 27,88,1,255,27,51,18
+ GRAPHICS 27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,3
+
+ DISPLAYMODE 6,14 ;; 640x200 - same as for 8" printing
+ SETup 27,88,1,255,27,51,24
+ GRAPHICS 27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,1,ROTATE
+
+ DISPLAYMODE 15,16 ;; 640x350 > 11.7"x17.8" rotated
+ SETup 27,88,1,255,27,51,24
+ GRAPHICS 27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,2,ROTATE
+
+ DISPLAYMODE 17,18 ;; 640x480 > 12"x17.8" rotated
+ SETup 27,88,1,255,27,51,24
+ GRAPHICS 27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,3,2,ROTATE
+;---------------------------------------------------------------------------
+PRINTER COLOR1 ;; 5182 with black ribbon
+
+ ; Maximum Print width: 8"
+ ; Horizontal BPI: 168 in 1:1 aspect ratio, 140 in 5:6 aspect ratio
+ ; Vertical BPI: 84
+ ; SETUP Statements contain the following escape sequences:
+ ; 27,51,14 = set line spacing to 14/144
+ ; 27,110,[0|1] = 0 sets aspect ratio to 5:6, 1 sets it to 1:1
+ ; GRAPHICS Statements use ESC "L" with the last two bytes being
+ ; the data count (low,high)
+
+ DARKADJUST 0 ; Code a positive number to lighten
+ ; printing. Suggested value = 10
+
+ DISPLAYMODE 4,5,13,19 ;; 320x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,2,ROTATE
+ PRINTBOX LCD,2,2,ROTATE
+
+ DISPLAYMODE 6,14 ;; 640x200
+ SETUP 27,51,14,27,110,0 ;; aspect ratio = 5:6
+ GRAPHICS 32,32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,4,1,ROTATE
+ PRINTBOX LCD,2,1,ROTATE
+
+ DISPLAYMODE 15,16 ;; 640x350
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,3,1,ROTATE
+ PRINTBOX LCD ;; PC/Convertible doesn't support these modes
+
+ DISPLAYMODE 17,18 ;; 640x480
+ SETUP 27,51,14,27,110,1 ;; aspect ratio = 1:1
+ GRAPHICS 32,32,32,32,27,76,LOWCOUNT,HIGHCOUNT
+ PRINTBOX STD,2,1
+ PRINTBOX LCD ;; PC/Convertible doesn't support these modes
+;===========================================================================
+; End of Profile
+;===========================================================================
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/graphics.skl b/private/mvdm/dos/v86/cmd/graphics/graphics.skl
new file mode 100644
index 000000000..8ecb68000
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/graphics.skl
@@ -0,0 +1,81 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; MS DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRAPHICS.MSG ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; DOS GRAPHICS Command - Message skeleton file
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the skeleton file for using the DOS message ;AN000;
+;; retriever with GRAPHICS.COM ;AN000;
+;; ;AN000;
+;; This skeleton file is processed by "FASTBLD" in order to create ;AN000;
+;; the following message files wich are included from GRINST.ASM: ;AN000;
+;; ;AN000;
+;; GRAPHICS.CL1 ; Class 1 messages ;AN000;
+;; GRAPHICS.CL2 ; Class 2 messages ;AN000;
+;; GRAPHICS.CLA ; Class A messages ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; DOS 3.3 Message Retriever Interface Supplement. ;AN000;
+;; DOS 3.3 Approved Functional Specification Message Supplement. ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRINST.ASM: ;AN000;
+;; GRAPHICS_INSTALL - Main module for GRAPHICS install. ;AN000;
+;; (NOTE: Reference is made to the include file generated from this ;AN000;
+;; skeleton file). ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AC001 - Changed message 15 to match D307 request ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+:util GRAPHICS ; Utility name ;AN000;
+ ;AN000;
+ ;AN000;
+:class A ; Class A messages (General messages) ;AN000;
+:use 1 COMMON1 ; 'Incorrect DOS version' ;AN000;
+:use 2 EXTEND8 ; 'Insufficient memory' ;AN000;
+
+; 300 - 399 reserved for options help messages
+:def 300 GRAPHICS /?
+:def 301 GRAPHICS /?
+:def 302 GRAPHICS /?
+:def 303 GRAPHICS /?
+:def 304 GRAPHICS /?
+:def 305 GRAPHICS /?
+:def 306 GRAPHICS /?
+:def 307 GRAPHICS /?
+ ;AN000;
+:class B ; Class B messages: (Profile loading) ;AN000;
+:def 9 'Cannot find GRAPHICS profile',CR,LF ;AN000;
+:def 10 'Required profile statement missing before line %1',CR,LF ;AN000;
+:def 11 'Invalid profile statement on line %1',CR,LF ;AN000;
+:def 12 'Profile statement out of sequence on line %1',CR,LF ;AN000;
+:def 13 'Error reading GRAPHICS profile',CR,LF ;AN000;
+:def 14 'Syntax errors in GRAPHICS profile',CR,LF ;AN000;
+:def 15 'Printbox ID not in GRAPHICS profile',CR,LF ;AC001;
+:def 16 'Printer type not in GRAPHICS profile',CR,LF ;AN000;
+ ;AN000;
+:class C ; Class C messages: (Command line parsing) ;AN000;
+:use 3 PARSE1 ; 'Too many parameters' ;AN000;
+:use 4 PARSE6 ; 'Parameter value not allowed' ;AN000;
+:def 5 'Invalid parameter: %1',CR,LF ;AN000;
+:use 6 PARSE11 ; 'Invalid parameter combination' ;AN000;
+:def 7 'Duplicate parameters not allowed',CR,LF ;AN000;
+:use 8 PARSE8 ; 'Parameter format not correct' ;AN000;
+:def 17 '/B invalid with a black and white printer',CR,LF ;AN000;
+:def 18 'Unable to reload with profile supplied',CR,LF ;AN000;
+:end ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/graphics.tag b/private/mvdm/dos/v86/cmd/graphics/graphics.tag
new file mode 100644
index 000000000..71448bf78
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/graphics.tag
@@ -0,0 +1,19 @@
+M000 SR 12/28/90 Added memory check into graphics. Now, it
+ checks with the PSP top of memory to see
+ amount of free memory.
+
+M001 NSM 1/30/91 P5260: Ansi.sys changes the int5 vector to
+ alt-prt-sc routine in video ram for each mode
+ change through MODE. This results in problems
+ for HP LASERJETII. To avoid this, catch int 10
+ alt-prt-sc call, and after calling the prev. int
+ 10 vector, reinstall our int 5 vector.
+
+ grint2fh.asm : New int 10 handler and
+ grint2fh.ext : reinstall-int5 proc.
+
+ grinst.asm : install our Int10 handler at
+ install time
+
+ grctrl.asm : def. for old int 10 vector
+ grctrl.ext :
diff --git a/private/mvdm/dos/v86/cmd/graphics/grbwprt.asm b/private/mvdm/dos/v86/cmd/graphics/grbwprt.asm
new file mode 100644
index 000000000..f0b6e60d0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grbwprt.asm
@@ -0,0 +1,848 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I added code to the procedures PRINT_BW_PRT and FILL_BUFFER
+;** to handle the support of HP PCL printers. I used the algorithm
+;** below for PRINT_BW_PRT.
+;**
+;** if data_type = data_row
+;** if cur_scan_lne_length = 0 goto next_coordinates
+;** for i:=1 to box_h
+;** call new_prt_line
+;** save regs.
+;** save cur_row & cur_column
+;** for j:=1 to cur_scan_lne_lenght/nb_boxes_per_prt_buf
+;** (+1 if remainder)
+;** call fill_buffer
+;** call print_buffer
+;** end_for
+;** call end_prt_line
+;** restore cur_column & cur_row
+;** restore regs.
+;** end_for
+;** restore regs.
+;** next_coordinates: if rotate_sw = on
+;** inc cur_column
+;** else
+;** inc cur_row
+;** endif
+;** else
+;** .
+;** .
+;** .
+;** call end_prt_line ; Print CR & LF
+;** .
+;** .
+;** .
+;** endif
+;**
+;** DOCUMENTATION NOTES: This version of GRBWPRT.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132 ;AN000;
+ TITLE DOS GRAPHICS Command - Black and White printing modules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRBWPRT.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the code for printing a GRAPHICS screen on a ;AN000;
+;; BLACK and WHITE printer. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; ;AN000;
+;; PRINT_BW_APA ;AN000;
+;; FILL_BUFFER ;AN000;
+;; INT2PAT ;AN000;
+;; PAT2BOX ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; GRCTRL.EXT - Externals for print screen control ;AN000;
+;; GRCTRL.STR - Structures and equates for print screen control ;AN000;
+;; GRPATTRN.STR - Structures for the printer patterns. ;AN000;
+;; ;AN000;
+;; GRSHAR.STR - Shared Data Area Structure ;AN000;
+;; ;AN000;
+;; STRUC.INC - Macros for using structured assembly language ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRCTRL.ASM: ;AN000;
+;; PRT_SCR - Main module for printing the screen. ;AN000;
+;; TO FILE GRCOMMON.ASM ;AN000;
+;; Common modules - tools for printing a screen. ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; This file is included by GRCTRL.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+PAGE ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;AN000;
+ ASSUME CS:CODE,DS:CODE ;AN000;
+ ;AN000;
+ PUBLIC PRINT_BW_APA ;AN000;
+ PUBLIC LEN_OF_BW_MODULES ;AN000;
+ ;AN000;
+.XLIST ;AN000;
+INCLUDE GRCTRL.STR ; Stuctures needed ;AN000;
+INCLUDE GRSHAR.STR ; for both set of print modules ;AN000;
+INCLUDE GRPATTRN.STR ; ;AN000;
+INCLUDE GRCTRL.EXT ; Externals from PRT_SCR control module ;AN000;
+INCLUDE STRUC.INC ; ;AN000;
+ ;AN000;
+ PUBLIC PRINT_BW_APA ; Black and white modules, ;AN000;
+.LIST ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PRINT_BW_APA : PRINT A GRAPHIC MODE SCREEN ON A BLACK AND WHITE PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BP = Offset of the shared data area ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; BIOS_INT_5H = Pointer to BIOS int 5h ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: This procedure maps each pixel of the screen to a box ;AN000;
+; of dots on the printer. The box size depends on the screen resolution ;AN000;
+; and the number of bytes per printer line. It is chosen in order to ;AN000;
+; respect the screen ratio and is documented in each printer profile. ;AN000;
+; ;AN000;
+; For efficiency and space considerations, the print buffer does not ;AN000;
+; hold a full print line. Bytes representing pixels are printed as soon ;AN000;
+; as they are ready to be printed. However, the print buffer is wide ;AN000;
+; enough to hold complete boxes. ;AN000;
+; ;AN000;
+; The order for reading pixels off the screen is driven by the ;AN000;
+; order bytes are expected by the printer. To print the screen in its ;AN000;
+; original orientation we must begin reading it from the top left corner ;AN000;
+; and send the pixels line by line; to print it sideways, reading will ;AN000;
+; start from the bottom left corner and a "LINE" will now be a vertical ;AN000;
+; screen column read from bottom to top. ;AN000;
+; ;AN000;
+; There is more to it however, the printer head is printing a ;AN000;
+; vertical column of 8 dots at a time and each pixel read is mapped to ;AN000;
+; a box of dots that is less than 8 dots high (e.g., 2 cols x 1 row) ;AN000;
+; therefore, many boxes must be stored in the bytes sent to the printer. ;AN000;
+; ;AN000;
+; These boxes represent pixels that are one above each other on the ;AN000;
+; screen. We must read enough pixels on one column of the screen to use ;AN000;
+; all 8 bits of the vertical printer head (e.g., if the box size is 2x1 ;AN000;
+; then 8 pixels must be read and 2 bytes of the print buffer will be ;AN000;
+; filled). ;AN000;
+; ;AN000;
+; The PRINT BUFFER for any box size will be 8 bits high by "BOX ;AN000;
+; WIDTH" bits wide. ;AN000;
+; ;AN000;
+; After the buffer is filled, it is printed and the next "column" ;AN000;
+; of 8 pixels is read. Therefore, the screen is read "line by line" ;AN000;
+; where a line is 8 pixels high for a 2x1 box (4 pixels high for a 3x2 ;AN000;
+; box). ONE SUCH LINE IS CALLED A SCAN LINE. ;AN000;
+; ;AN000;
+PAGE ;AN000;
+; ;AN000;
+; A 350X200 screen mapping to a 3x2 box is read in the following order: ;AN000;
+; ;AN000;
+; SCREEN: ;AN000;
+; ;AN000;
+; column column . . . column ;AN000;
+; no. 0 no. 1 no. 349 ;AN000;
+; ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ;AN000;
+; scan º1(0,0) 5(0,1) 1397(0,349)º ;AN000;
+; line º2(1,0) 6(1,1) . . . . . . . 1398(1,349)º ;AN000;
+; no. 1 º3(2,0) 7(2,1) 1399(2,349)º ;AN000;
+; º4(3,0) 8(3,1) 1400(3,349)º ;AN000;
+; º º ;AN000;
+; scan º1401(4,0) 1405(4,1) º LEGEND: n(X,Y) ;AN000;
+; line º1402(5,0) etc, º ;AN000;
+; no. 2 º1403(6,0) . . . . . º n = READ RANK ;AN000;
+; º1404(7,0) º X = ROW NUMBER ;AN000;
+; º . º Y = COLUMN NUMBER ;AN000;
+; etc, º . º ;AN000;
+; º . 70000(199,349)º ;AN000;
+; ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC : ;AN000;
+; ;AN000;
+; Initialize printer and local variables. ;AN000;
+; CALL LOC_MODE_PRT_INFO ; Get printer info related to current mode. ;AN000;
+; CALL GET_SCREEN_INFO ; Get info. about how to read the screen ;AN000;
+; CALL SETUP_PRT ; Set up the printer (Line spacing, etc) ;AN000;
+; ;AN000;
+; FOR each scan line on the screen (NB_SCAN_LINES) ;AN000;
+; (Note: One scan line maps to one print line) ;AN000;
+; BEGIN ;AN000;
+; CALL DET_CUR_SCAN_LNE_LENGTH ; Determine length in pels of the current ;AN000;
+; ; scan line. ;AN000;
+; IF CUR_SCAN_LNE_LENGTH NE 0 THEN ;AN000;
+; CALL NEW_PRT_LINE ; Initialize a new printer line ;AN000;
+; DO CUR_SCAN_LNE_LENGTH times ; For each column ;AN000;
+; BEGIN ;AN000;
+; CALL FILL_BUFFER ; Read top-down enough pels to fill the buffer ;AN000;
+; CALL PRINT_BUFFER ; Print the buffer ;AN000;
+; IF printing sideways THEN INC CUR_ROW ; Get coordinates of next ;AN000;
+; ELSE INC CUR_COLUMN ; "column" (vertical chunk of ;AN000;
+; END (for each column) ; a scan line). ;AN000;
+; PRINT_BYTE CR ; Print a CR and a LF ;AN000;
+; PRINT_BYTE LF ;AN000;
+; ; Get coordinates of next scan line: ;AN000;
+; IF printing sideways THEN ;AN000;
+; ADD CUR_COLUMN,NB_BOXES_PER_PRT_BUF ;AN000;
+; MOV CUR_ROW,SCREEN_HEIGHT - 1 ;AN000;
+; ELSE ;AN000;
+; ADD CUR_ROW,NB_BOXES_PER_PRT_BUF ;AN000;
+; MOV CUR_COLUMN,0 ;AN000;
+; END (for each scan line) ;AN000;
+; ;AN000;
+PRINT_BW_APA PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INITIALIZATION: ;AN000;
+; ;AN000;
+; 1) Locate and extract printer DISPLAYMODE information from ;AN000;
+; the shared data area, calculate the number of boxes fitting ;AN000;
+; in the printer buffer. ;AN000;
+; 2) Determine where to start reading the screen: ;AN000;
+; If printing sideways, start in LOW LEFT corner. ;AN000;
+; If normal printing, start in TOP LEFT corner. ;AN000;
+; Determine the maximum length for a scan line: ;AN000;
+; If printing sideways, it is the height of the screen. ;AN000;
+; For normal printing, it is the width of the screen. ;AN000;
+; Determine the number of scan lines on the screen. ;AN000;
+; 3) Set up the Printer for printing Graphics. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL LOC_MODE_PRT_INFO ; Get printer info related to curr. mode;AN000;
+; ;AN000;
+;-------Test if DISPLAYMODE info record was found: ;AN000;
+ .IF <ERROR_CODE EQ DISPLAYMODE_INFO_NOT_FOUND> ;AN000;
+ .THEN ;AN000;
+ MOV ERROR_CODE,UNABLE_TO_PRINT ; IF no record found, ;AN000;
+ JMP PRINT_BW_APA_END ; then, return error code ;AN000;
+ .ENDIF ; and quit procedure ;AN000;
+; ;AN000;
+;-------Get the box size from the DISPLAYMODE info record: ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Offset current DISPLAYMODE info.;AN000;
+ MOV AH,[BX].BOX_WIDTH ; Take local copy of the box size. ;AN000;
+ MOV BOX_W,AH ; in BOX_W and BOX_H ;AN000;
+ MOV AL,[BX].BOX_HEIGHT ;AN000;
+ MOV BOX_H,AL ;AN000;
+; ;AN000;
+;-------Verify if the box size obtained from DISPLAYMODE info. is valid ;AN000;
+ .IF <ZERO AL> OR ; IF height of the box is 0 ;AN000;
+ .IF <ZERO AH> ; OR width of the box is 0 ;AN000;
+ .THEN ; THEN we can't print: ;AN000;
+ MOV ERROR_CODE,UNABLE_TO_PRINT ; return error code ;AN000;
+ JMP PRINT_BW_APA_END ; and quit ;AN000;
+ .ENDIF ;AN000;
+; ;AN000;
+;-------Get the Print Orientation from the DISPLAYMODE info record ;AN000;
+ .IF <[BX].PRINT_OPTIONS EQ ROTATE>; If printing sideways ;AN000;
+ .THEN ; then: ;AN000;
+ MOV ROTATE_SW,ON ; Rotate switch := "ON" ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+; ;AN000;
+;-------Initialize print variables and the printer: ;AN000;
+ CALL GET_SCREEN_INFO ; Get info. about how to read the screen;AN000;
+ CALL SETUP_PRT ; Set up the printer (Line spacing, etc);AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: quit ;AN000;
+ JMP PRINT_BW_APA_END ; ;AN000;
+ .ENDIF ;AN000;
+
+ MOV CX,NB_SCAN_LINES ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Added the following modification to support printers with
+; vertical print heads, such as HP PCL printers.
+;
+; ; .IF <DS:[BP].DATA_TYPE EQ DATA_ROW>
+CMP DS:[BP].DATA_TYPE,DATA_ROW ;
+JNE GOTO_ITS_DATA_COLUMN ;
+;-------------------------------------------------------------------------------
+;
+; FOR EACH SCAN LINE ON THE SCREEN, WHICH REALLY IS JUST ONE LINE:
+;
+;-------------------------------------------------------------------------------
+PRINT_1_LINE_OF_BOXES: ;
+ CALL DET_CUR_SCAN_LNE_LENGTH ; Determine how many non-blanks on line
+ CMP CUR_SCAN_LNE_LENGTH,0 ; .IF <CUR_SCAN_LNE_LENGTH NE 0>
+ JE GOTO_NEXT_COORDINATES ; If line is not empty then,
+ ;
+ PUSH CX ; Save scan line counter
+ XOR CH,CH ; Clear register
+ MOV CL,BOX_H ; CX is the # of times we need to read
+ ; a line to print complete boxes.
+ MOV DS:[BP].ROW_TO_EXTRACT,CL ; Determines what row to extract
+ DEC DS:[BP].ROW_TO_EXTRACT ; zero based
+READ_LINE: ;
+ CALL NEW_PRT_LINE ; Send escape sequence to the printer
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ; for starting a new line.
+ .THEN ; If a printer error occurred:
+ POP CX ; Restore counter for how many times we
+ JMP PRINT_BW_APA_END; need to read line and quit!
+ .ENDIF ;
+ PUSH DX ;
+ PUSH CX ; Save counter for how many times we
+ ; need to read line.
+ PUSH CUR_ROW ; Save coordinates where start reading
+ PUSH CUR_COLUMN ; line.
+ MOV AX,CUR_SCAN_LNE_LENGTH ; DX:AX = counter for how many pixels need to
+ CWD ; be read per line
+ XOR BH,BH ;
+ MOV BL,NB_BOXES_PER_PRT_BUF ;
+
+ DIV BX ;
+ .IF <DX NE 0> ; So don't lose data when
+ INC AX ; have a remainder.
+ .ENDIF ;
+ MOV CX,AX ; loop CX times to read all
+ ; pixels on scan line.
+ JMP SHORT PRINT_1_LINE ; Jumps were out of range
+GOTO_NEXT_COORDINATES: ;
+ JMP SHORT NEXT_COORDINATES ;
+GOTO_PRINT_1_LINE_OF_BOXES: ;
+ JMP PRINT_1_LINE_OF_BOXES ;
+GOTO_ITS_DATA_COLUMN: ;
+ JMP SHORT ITS_DATA_COLUMN ;
+PRINT_1_LINE: ;
+ CALL FILL_BUFFER ; Read enough pixels to fill the buffer
+ ; convert each to a printer box,
+ ; extract a row from each box,
+ ; store it in the print buffer
+ CALL PRINT_BUFFER ; Print it
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;
+ .THEN ; A printer error occurred:
+ POP CUR_COLUMN ;
+ POP CUR_ROW ;
+ POP CX ; Restore counter for how many pixels
+ ; needed to read per line
+ POP DX ;
+ POP CX ; Save scan line counter
+ JMP PRINT_BW_APA_END ; and quit
+ .ENDIF ;
+ LOOP PRINT_1_LINE ; Continue reading, converting, extracting
+ ; storing and printing.
+ CALL END_PRT_LINE ; Send escape sequence to the printer
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ; for ending a line.
+ .THEN ; If a printer error occurred:
+ POP CUR_COLUMN ;
+ POP CUR_ROW ;
+ POP CX ; Restore counter for how many times we
+ ; needed to read per line
+ POP DX ;
+ POP CX ; Save scan line counter
+ JMP PRINT_BW_APA_END; need to read line and quit!
+ .ENDIF ;
+ DEC DS:[BP].ROW_TO_EXTRACT ; Extract next row. Note:zero based
+ POP CUR_COLUMN ; Restore coordinates of beginning
+ POP CUR_ROW ; of "scan" line.
+ POP CX ; Restore counter for how many times we
+ ; needed to read per line
+ POP DX ;
+ LOOP READ_LINE ; Read the line again so we can extract
+ ; the other rows out of the printer boxes
+ POP CX ; Save scan line counter
+
+NEXT_COORDINATES: ; End of, if line is not empty
+ .IF <CUR_SCAN_LNE_LENGTH EQ 0> ;
+ CALL NEW_PRT_LINE ; Send esc. seq. to printer
+ .ENDIF ;
+ .IF <ROTATE_SW EQ ON> ; Get coordinates of next "scan" line
+ .THEN ;
+ INC CUR_COLUMN ;
+ .ELSE ;
+ INC CUR_ROW ;
+ .ENDIF ;
+ DEC CX ; Loop was out of range. Read another
+ CMP CX,0 ; "scan" line and print the corresponding
+ JNE GOTO_PRINT_1_LINE_OF_BOXES; printer boxes.
+ JMP SHORT DONE_WITH_PRINTING ;
+
+ITS_DATA_COLUMN: ; .ELSE
+
+; /\ ~~mda(001) -----------------------------------------------------------------------
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; FOR EACH SCAN LINE ON THE SCREEN: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PRINT_1_SCAN_LINE: ;AN000;
+ CALL DET_CUR_SCAN_LNE_LENGTH ; Determine how many non-blanks on line ;AN000;
+ .IF <CUR_SCAN_LNE_LENGTH NE 0> ; If line is not empty ;AN000;
+ .THEN ; then, ;AN000;
+ CALL NEW_PRT_LINE ; Send escape sequence to the printer ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ; for starting a new line.;AN000;
+ .THEN ; If a printer error occurred: ;AN000;
+ JMP SHORT PRINT_BW_APA_END ; Quit ! ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+ PUSH CX ; Save scan line counter ;AN000;
+ MOV CX,CUR_SCAN_LNE_LENGTH ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; FOR each column on the current scan line (up to the last non-blank): ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PRINT_1_SCAN_COLUMN: ;AN000;
+ CALL FILL_BUFFER ; Read all pixels on this column, ;AN000;
+ ; convert each to a printer box, ;AN000;
+ ; store boxes in the print buffer ;AN000;
+ ; (a buffer contains one "column";AN000;
+ ; of pixels). ;AN000;
+ CALL PRINT_BUFFER ; Print the buffer. ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: ;AN000;
+ POP CX ; Restore scan line counter and quit ;AN000;
+ JMP SHORT PRINT_BW_APA_END ; ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+ ;AN000;
+;-------Get coordinates of next "column": ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ DEC CUR_ROW ; then, get row above on screen ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_COLUMN ; else, get column next right ;AN000;
+ .ENDIF ; ;AN000;
+ ;AN000;
+ LOOP PRINT_1_SCAN_COLUMN ; Print next column ;AN000;
+ ;AN000;
+ POP CX ; Restore scan line counter ;AN000;
+ .ENDIF ; Endif line is not empty ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Print a carriage return and a line feed: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Commented out the following and replaced it with the procedure
+; END_PRT_LINE because this procedure takes care of this as well
+; as sending the esc. seq. that comes after the keyword DATA.
+;
+; MOV AL,CR ;AN000;
+; CALL PRINT_BYTE ; Send CR ;AN000;
+; JC PRINT_BW_APA_END ; If printer error, leave;AN000;
+; MOV AL,LF ; ;AN000;
+; CALL PRINT_BYTE ; Send LF ;AN000;
+; JC PRINT_BW_APA_END ; If printer error, leave;AN000;
+; ;
+ CALL END_PRT_LINE ; Send escape sequence to the printer ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ; for ending a line, and for ;AN000;
+ ; doing a CR and LF.
+ .THEN ; If a printer error occurred: ;AN000;
+ JMP SHORT PRINT_BW_APA_END ; Quit ! ;AN000;
+ .ENDIF ; ;AN000;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+
+ JMP SHORT GET_NEXT_SCAN_LINE ;~~mda(001) Used this to replace a
+GOTO_PRINT_1_SCAN_LINE: ; loop that was out or range.
+ JMP PRINT_1_SCAN_LINE ;
+GET_NEXT_SCAN_LINE: ;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Get coordinates of next scan line: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; then: ;AN000;
+ MOV AL,NB_BOXES_PER_PRT_BUF ; AX := Numbers of pels read on row ;AN000;
+ CBW ; ;AN000;
+ ADD CUR_COLUMN,AX ; CUR_COLUMN + Number of pels read ;AN000;
+ MOV AX,SCREEN_HEIGHT ; CUR_ROW := SCREEN_HEIGHT - 1;AN000;
+ DEC AX ; ;AN000;
+ MOV CUR_ROW,AX ; ;AN000;
+ .ELSE ; else, printing NOT rotated: ;AN000;
+ MOV AL,NB_BOXES_PER_PRT_BUF ; AX := Number of pels read on colum;AN000;
+ CBW ; ;AN000;
+ ADD CUR_ROW,AX ; CUR_ROW + Number of pels read;AN000;
+ MOV CUR_COLUMN,0 ; CUR_COLUMN := 0 ;AN000;
+ .ENDIF ; ;AN000;
+;; LOOP PRINT_1_SCAN_LINE ;~~mda(001) Commented it out cause loop is ;AN000;
+ ; out of range.
+ DEC CX ;~~mda(001) Used this instead of the LOOP
+ OR CX,CX
+ JNZ GOTO_PRINT_1_SCAN_LINE ;
+DONE_WITH_PRINTING: ;~~mda(001) Label for endif. ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Restore the printer. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL RESTORE_PRT ;AN000;
+PRINT_BW_APA_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+PRINT_BW_APA ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; FILL_BUFFER : READS ENOUGH PIXELS TO FILL UP THE PRINT BUFFER. ;AN000;
+; THESE PIXELS ARE MAPPED TO A PRINTER DOT BOX. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_COLUMN, ;AN000;
+; CUR_ROW = Coordinates of the first pixel to be read ;AN000;
+; BOXES_PER_PRT_BUF = Number of boxes fitting in the print ;AN000;
+; buffer ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; ;AN000;
+; OUTPUT: PRT_BUF = PRINT BUFFER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: ;AN000;
+; ;AN000;
+; 1) Pixels are read one by one vertically from top to bottom in ;AN000;
+; the current column of the screen scan line. ;AN000;
+; NOTE: What is called here a 'column' can actually be a line ;AN000;
+; on the physical display. ;AN000;
+; 2) Each pixel is mapped to a printer dot box. ;AN000;
+; 3) Each Dot box is stored in the printer buffer. ;AN000;
+; 4) The coordinates in input are those of the "top" pixel ;AN000;
+; and restored when leaving this procedure. ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; Save coordinates of the current "column" (slice of a screen scan line) ;AN000;
+; DO for BOXES_PER_PRT_BUF (8 / BOX_H) ;AN000;
+; BEGIN ;AN000;
+; CALL READ_DOT ; Read a pixel, get index in XLT_TAB ;AN000;
+; Get pixel intensity from XLT_TAB ;AN000;
+; CALL INT2PAT ; Locate pattern corresponding to int. ;AN000;
+; CALL PAT2BOX ; Extract box from pattern ;AN000;
+; CALL STORE_BOX ; Store the box in the printer buffer ;AN000;
+; ; Get coordinates of next pixel below: ;AN000;
+; IF printing is sideways THEN INC CUR_COLUMN ;AN000;
+; ELSE INC CUR_ROW ;AN000;
+; END ;AN000;
+; Restore initial coordinates. ;AN000;
+; ;AN000;
+FILL_BUFFER PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Save initial coordinates: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; If DATA_TYPE is equal to DATA_ROW then we have a horizontal
+; print head so we SHOULDN'T save CUR_ROW and CUR_COLUMN because
+; we are moving down the "scan" line from left to right a little
+; at a time, that is we don't finish reading the scan line until
+; we have made repeated calls to this procedure. Remember since
+; we're dealing with horizontal print heads one scan line is
+; really just one line.
+; ;
+ .IF <DS:[BP].DATA_TYPE NE DATA_ROW> ;
+ ;
+ PUSH CUR_ROW ;
+ PUSH CUR_COLUMN ;
+ .ENDIF ;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+;-------Clear the print buffer: ;AN000;
+ XOR BX,BX ; For each byte in the PRT_BUF: ;AN000;
+CLEAR_PRT_BUF: ;AN000;
+ MOV PRT_BUF[BX],0 ; Initialize byte to blanks ;AN000;
+ INC BX ; Get next byte ;AN000;
+ CMP BL,BOX_W ; All bytes cleared ? ;AN000;
+ JL CLEAR_PRT_BUF ; No, clear next one. ;AN000;
+ ;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of XLT_TAB ;AN000;
+ ;AN000;
+;-------Fill the print buffer with one box for each pixel read: ;AN000;
+ XOR CX,CX ; CL := Number of pixels to read ;AN000;
+ MOV CL,NB_BOXES_PER_PRT_BUF ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; For each pixel within the current column of the scan line: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+READ_AND_STORE_1_PIXEL: ;AN000;
+ CALL READ_DOT ; AL := Index into translation table ;AN000;
+ XLAT XLT_TAB ; AL := Intensity ;AN000;
+ CALL INT2PAT ; SI := Offset of matching Pattern ;AN000;
+ CALL PAT2BOX ; Extract CUR_BOX from the pattern. ;AN000;
+ MOV SI,OFFSET CUR_BOX ; Store it in the PRT_BUF ;AN000;
+ CALL STORE_BOX ;AN000;
+ ;AN000;
+;-------Get coordinates of next pixel: ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; If DATA_TYPE is DATA_ROW then we have a horizontal print head
+; so we need to read the next pixel on the scan line. Remember
+; since we're dealing with horizontal print heads one scan line
+; is really just one line. For every pixel read we need to store
+; one row of the corresponding box in the print buffer.
+;
+ .IF <DS:[BP].DATA_TYPE EQ DATA_ROW> ;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways
+ .THEN ;
+ DEC CUR_ROW ; then, decrement row number
+ .ELSE ;
+ INC CUR_COLUMN ; else, increment column number
+ .ENDIF ;
+ .ELSE ;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ INC CUR_COLUMN ; then, increment column number ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_ROW ; else, increment row number ;AN000;
+ .ENDIF ; ;AN000;
+ .ENDIF ; ~~mda(001) Close IF stmt.
+ LOOP READ_AND_STORE_1_PIXEL ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Restore initial coordinates: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; If DATA_TYPE = DATA_ROW then we don't restore initial coordinates.
+;
+ .IF <DS:[BP].DATA_TYPE NE DATA_ROW> ;
+ POP CUR_COLUMN ;
+ POP CUR_ROW ;
+ .ENDIF ;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+FILL_BUFFER ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; INT2PAT : MAP AN INTENSITY TO A PATTERN. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: AL = GREY INTENSITY (0 - 63 = BLACK to WHITE) ;AN000;
+; BOX_W = Number of columns in a box ;AN000;
+; CUR_MODE_PTR = Offset of current DISPLAYMODE info record ;AN000;
+; ;AN000;
+; OUTPUT: SI = OFFSET OF THE PATTERN MATCHING THE INTENSITY ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Performs a sequential search in the table of patterns ;AN000;
+; until the proper pattern is found. ;AN000;
+; ;AN000;
+; ;AN000;
+; SI = 0 ; FOUND = FALSE ;AN000;
+; DO UNTIL FOUND = TRUE ;AN000;
+; BEGIN ;AN000;
+; IF AL <= Maximum intensity of the current pattern in the table ;AN000;
+; THEN ;AN000;
+; FOUND = TRUE ;AN000;
+; ELSE ;AN000;
+; SI = SI + (BOX_W * 2) ;AN000;
+; END ;AN000;
+; ;AN000;
+INT2PAT PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH DX ;AN000;
+ ;AN000;
+;-------Calculate the size in bytes of one pattern STRUCTURE: (see GRPATTRN.STR);AN000;
+ MOV DL,BOX_W ; DX := Number of columns in the box ;AN000;
+ XOR DH,DH ;AN000;
+ SHL DL,1 ; (DX * 2) = Number of columns in the pattern ;AN000;
+ INC DL ; DL := Size in bytes of one pattern ;AN000;
+ ; (includes intensity field) ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Offset of current mode ;AN000;
+ ; SI := Offset of the first pattern ;AN000;
+ MOV SI,[BX].PATTERN_TAB_PTR ;AN000;
+ ADD SI,BP ;AN000;
+ ;AN000;
+COMPARE_INTENSITY: ;AN000;
+ CMP AL,[SI] ; Within the range of this pattern ? ;AN000;
+ JLE FOUND_PATTERN ; Yes, use this pattern. ;AN000;
+ ; No, look at next pattern: ;AN000;
+ ADD SI,DX ; SI := SI + Number columns in pattern) ;AN000;
+ JMP SHORT COMPARE_INTENSITY ;AN000;
+ ;AN000;
+FOUND_PATTERN: ;AN000;
+ ;AN000;
+ POP DX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+ ;AN000;
+INT2PAT ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PAT2BOX : SELECT AND EXTRACT THE PROPER BOX FROM THE PATTERN ACCORDING ;AN000;
+; TO THE COORDINATES OF THE PIXEL. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: SI = OFFSET OF CURRENT PATTERN ;AN000;
+; CUR_COLUMN, ;AN000;
+; CUR_ROW = COORDINATES OF THE CURRENT PIXEL ;AN000;
+; ;AN000;
+; OUTPUT: CUR_BOX = PORTION OF THE PATTERN TO BE PRINTED ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: If the pixel is on even-even coordinates, then the ;AN000;
+; top-left box of the pattern is extracted. ;AN000;
+; If its Even-odd --> extract the top-right box. ;AN000;
+; Odd-even --> low-left box, and Odd-odd --> low-right box. ;AN000;
+; ;AN000;
+PAGE ;AN000;
+; For example., (with a 3x2 box): ;AN000;
+; ;AN000;
+; PATTERN (over 6 bytes): ;AN000;
+; ;AN000;
+; ;AN000;
+; byte1 byte2 byte3 byte4 byte5 byte6 ;AN000;
+; ;AN000;
+; 0 0 0 0 0 0 ;AN000;
+; 0 0 0 0 0 0 ;AN000;
+; 0 0 0 0 0 0 ;AN000;
+; 0 0 0 0 0 0 ;AN000;
+; even-even --> dot1 dot2 dot3 | dot1 dot2 dot3 <-- even-odd ;AN000;
+; (row-column) dot4 dot5 dot6 | dot4 dot5 dot6 box ;AN000;
+; box. ------------------------------------------------ ;AN000;
+; odd-even --> dot1 dot2 dot3 | dot1 dot2 dot3 <-- odd-odd ;AN000;
+; box dot4 dot5 dot6 | dot4 dot5 dot6 box ;AN000;
+; ;AN000;
+; ;AN000;
+; The selected box is then stored as follow: ;AN000;
+; ;AN000;
+; CUR_BOX: ;AN000;
+; byte1 byte2 byte3 ;AN000;
+; MSB ------> 0 0 0 ;AN000;
+; (bit7) 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; dot1 dot2 dot3 <-- box ;AN000;
+; LSB ------>dot4 dot5 dot6 ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; IF CUR_ROW is odd ;AN000;
+; THEN SI := SI + BOX_W ; Access right portion of pattern ;AN000;
+; Build a bit mask in BL of BOX_H bits, right justified. ;AN000;
+; FOR each column in the box (BOX_W) ;AN000;
+; Get the pattern column in AL ;AN000;
+; IF CUR_COLUMN is even ;AN000;
+; THEN ;AN000;
+; Move down the column of the top box. ;AN000;
+; AND BL,AL ; BL <-- Column of the desired box ;AN000;
+; ;AN000;
+; ;AN000;
+PAT2BOX PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH SI ;AN000;
+ ;AN000;
+ ; SI := Offset of current pattern ;AN000;
+ INC SI ; Skip the MAX INTENSITY field ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Set SI to either the left or right set of 2 boxes in the pattern: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ TEST CUR_ROW,1 ; Odd row ? ;AN000;
+ JZ EXTRACT_BOX ; No, access left portion of pattern ;AN000;
+ MOV AL,BOX_W ; ;AN000;
+ CBW ; ;AN000;
+ ADD SI,AX ; Yes, access right portion of pattern;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Extract the box: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+EXTRACT_BOX: ;AN000;
+;-------Build a bit mask that will be used to keep only BOX_H bits ;AN000;
+;-------of the bytes where CUR_BOX is stored. ;AN000;
+ XOR AH,AH ; AH := Box column bit mask ;AN000;
+ MOV AL,BOX_H ; For each row of the box: ;AN000;
+INIT_MASK: ; ;AN000;
+ SHL AH,1 ; ;AN000;
+ OR AH,1 ; Insert one bit in the mask. ;AN000;
+ DEC AL ; ;AN000;
+ CMP AL,0 ; ;AN000;
+ JG INIT_MASK ;AN000;
+ ;AN000;
+ XOR BX,BX ; BL := Column number within the box ;AN000;
+; ;AN000;
+;-------For each column of the box: ;AN000;
+EXTRACT_1_BOX_COLUMN: ;AN000;
+ MOV AL,[SI] ; AL := Current column of pattern ;AN000;
+ TEST CUR_COLUMN,1 ; If the pixel is on ODD column ;AN000;
+ JNZ BOTTOM_BOX ; Then, need bottom box portion ;AN000;
+ MOV CL,BOX_H ; Else, need top box portion ;AN000;
+TOP_BOX: ; Need top box: ;AN000;
+ SHR AL,CL ; Shift top box over bottom box ;AN000;
+BOTTOM_BOX: ; The box we want is now at bottom ;AN000;
+ AND AL,AH ; Keep only bits from the box ;AN000;
+ MOV CUR_BOX[BX],AL ; Store this box column ;AN000;
+ INC SI ; Access next column of the pattern ;AN000;
+ INC BX ; One more column stored. ;AN000;
+ CMP BL,BOX_W ; All stored ? ;AN000;
+ JL EXTRACT_1_BOX_COLUMN ; No, continue ;AN000;
+ ;AN000;
+ POP SI ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+PAT2BOX ENDP ;AN000;
+INCLUDE GRCOMMON.ASM ;AN000;
+LEN_OF_BW_MODULES EQU $-PRINT_BW_APA ;AN000;
+CODE ENDS ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grbwprt.ext b/private/mvdm/dos/v86/cmd/graphics/grbwprt.ext
new file mode 100644
index 000000000..2acbed952
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grbwprt.ext
@@ -0,0 +1,30 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+PAGE ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRBWPRT.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing external declarations for ;AN000;
+;; the code and data defined in GRBWPRT.ASM. ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ EXTRN PRINT_BW_APA:NEAR ;AN000;
+ EXTRN LEN_OF_BW_MODULES:ABS ;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcolprt.asm b/private/mvdm/dos/v86/cmd/graphics/grcolprt.asm
new file mode 100644
index 000000000..ab05b815a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcolprt.asm
@@ -0,0 +1,1128 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS GRAPHICS Command - Color printing modules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCOLPRT.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the code for printing a screen (text and graphics) ;AN000;
+;; on a COLOR printer. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; ;AN000;
+;; PRINT_COLOR ;AN000;
+;; SCAN_FOR_BANDS_APA ;AN000;
+;; SCAN_FOR_BANDS_TXT ;AN000;
+;; PRINT_BAND_APA ;AN000;
+;; PRINT_BAND_TXT ;AN000;
+;; SET_CURSOR ;AN000;
+;; SET_COLOR_BAND ;AN000;
+;; INIT_BLACK_BOX ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ;AN000;
+;; GRCTRL.EXT - Externals for print screen control ;AN000;
+;; GRCTRL.STR - Structures and equates for print screen control ;AN000;
+;; GRPATTRN.STR - Structures for the printer patterns. ;AN000;
+;; ;AN000;
+;; GRSHAR.STR - Shared Data Area Structure ;AN000;
+;; ;AN000;
+;; STRUC.INC - Macros for using structured assembly language ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRCTRL.ASM: ;AN000;
+;; PRT_SCR - Main module for printing the screen. ;AN000;
+;; TO FILE GRCOMMON.ASM ;AN000;
+;; Common modules - tools for printing a screen. ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; Date last updated 5/26/87. ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+PAGE ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;AN000;
+ ASSUME CS:CODE,DS:CODE ;AN000;
+ ;AN000;
+ PUBLIC PRINT_MODULE_START ;; Color modules public ;AN000;
+ PUBLIC PRINT_COLOR ;; procedures ;AN000;
+ PUBLIC LEN_OF_COLOR_MODULES ;; ;AN000;
+ ;; ;AN000;
+.XLIST ; ;AN000;
+INCLUDE GRCTRL.STR ; Stuctures needed ;AN000;
+INCLUDE GRSHAR.STR ; for both set of print modules ;AN000;
+INCLUDE GRPATTRN.STR ; ;AN000;
+ ; ;AN000;
+INCLUDE GRCTRL.EXT ; Externals from PRT_SCR control module ;AN000;
+INCLUDE STRUC.INC ; ;AN000;
+.LIST ; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
+;; ;AN000;
+;; ;AN000;
+;; PRINT_COLOR : PRINT TEXT AND APA MODE SCREEN ON A COLOR PRINTER ;AN000;
+;; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BP = Offset of the shared data area ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Main control module for printing of text and graphics ;AN000;
+;; on color printers. ;AN000;
+;; ;AN000;
+;; Calls either the text or graphics mode routine. ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; PRINT_SCREEN ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; LOC_MODE_PRT_INFO, PRINT_COLOR_APA, PRINT_COLOR_TXT ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; IF MODE_TYPE = TXT ;AN000;
+;; THEN CALL PRINT_COLOR_TXT ;AN000;
+;; ELSE (MODE_TYPE = APA) ;AN000;
+;; CALL LOC_MODE_PRT_INFO ; Get DISPLAYMODE record from the SHARED AREA ;AN000;
+;; CALL PRINT_COLOR_APA ;AN000;
+;; RETURN ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+PRINT_MODULE_START LABEL BYTE ;AN000;
+PRINT_COLOR PROC NEAR ;AN000;
+ JMP SHORT PRINT_COLOR_BEGIN ;AN000;
+WHITE_BOX DB 0,0,0,0 ; Print boxes for APA mode ;AN000;
+BLACK_BOX DB ?,?,?,? ; NOTE: 1 print box = 1 screen pixel ;AN000;
+ ; only BOX_W bytes are used out of these 2 ;AN000;
+ ; boxes. ;AN000;
+ ;AN000;
+REQ_BAND_MASK DB ? ; Mask = "All color bands needed for the current;AN000;
+ ; print line". ;AN000;
+ ;AN000;
+PRINT_COLOR_BEGIN: ;AN000;
+.IF <MODE_TYPE EQ TXT> ;AN000;
+.THEN ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; The screen is in a text mode: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL PRINT_COLOR_TXT ; Print a text screen on a color printer;AN000;
+.ELSE ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; The screen is in All Points Addressable mode: ;AN000;
+; Locate and extract printer DISPLAYMODE information from ;AN000;
+; the shared data area. ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL LOC_MODE_PRT_INFO ; Get printer info related to curr. mode;AN000;
+; ;AN000;
+;-------Test if DISPLAYMODE info record was found: ;AN000;
+ .IF <ERROR_CODE EQ DISPLAYMODE_INFO_NOT_FOUND> ;AN000;
+ .THEN ;AN000;
+ MOV ERROR_CODE,UNABLE_TO_PRINT ; IF no record found, ;AN000;
+ JMP SHORT PRINT_COLOR_END ; then, return error code ;AN000;
+ .ENDIF ; and quit procedure ;AN000;
+; ;AN000;
+;-------Get the box size from the DISPLAYMODE info record: ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Offset current DISPLAYMODE info.;AN000;
+ MOV AH,[BX].BOX_WIDTH ; Take local copy of the box size. ;AN000;
+ MOV BOX_W,AH ; in BOX_W and BOX_H ;AN000;
+ MOV AL,[BX].BOX_HEIGHT ;AN000;
+ MOV BOX_H,AL ;AN000;
+; ;AN000;
+;-------Verify if the box size obtained from DISPLAYMODE info. is valid ;AN000;
+ .IF <ZERO AL> OR ; IF height of the box is 0 ;AN000;
+ .IF <ZERO AH> ; OR width of the box is 0 ;AN000;
+ .THEN ; THEN we can't print: ;AN000;
+ MOV ERROR_CODE,UNABLE_TO_PRINT ; return error code ;AN000;
+ JMP SHORT PRINT_COLOR_END ; and quit ;AN000;
+ .ENDIF ;AN000;
+; ;AN000;
+;-------Get the Print Orientation from the DISPLAYMODE info record ;AN000;
+ .IF <[BX].PRINT_OPTIONS EQ ROTATE>; If printing sideways ;AN000;
+ .THEN ; then: ;AN000;
+ MOV ROTATE_SW,ON ; Rotate switch := "ON" ;AN000;
+ .ENDIF ;AN000;
+ CALL PRINT_COLOR_APA ; Print APA screen on a color printer ;AN000;
+.ENDIF ;AN000;
+PRINT_COLOR_END: ;AN000;
+ RET ;AN000;
+PRINT_COLOR ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PRINT_COLOR_TXT: PRINT A TEXT MODE SCREEN ON A COLOR PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BP = Offset of the shared data area ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; SCREEN_WIDTH = Maximum length of Screen scan line. ;AN000;
+; SCREEN_HEIGHT = Number of SCAN LINES on the screen ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: The screen is read and printed line by line; character by ;AN000;
+; character. ;AN000;
+; Each line is first scanned in order to determine what colors are present on ;AN000;
+; it and what printer bands will be needed to approximate these colors. ;AN000;
+; ;AN000;
+; For each printer color band needed for the current line, this screen line ;AN000;
+; is READ AGAIN character by character; If the color of the ;AN000;
+; current character must use the current color band to be ;AN000;
+; approximated; then, the character is printed. ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC : ;AN000;
+; ;AN000;
+; Save current coordinates of the cursor. ;AN000;
+; Initialize the cursor to the first character to be read (Top-left of screen) ;AN000;
+; FOR each row on the screen (SCREEN_HEIGHT) ;AN000;
+; BEGIN ;AN000;
+; CALL SCAN_FOR_BANDS_TXT(CUR_ROW,CUR_COLUMN,REQ_BAND_MASK) ;AN000;
+; CUR_BAND_MASK := 01H ;AN000;
+; IF REQ_BAND_MASK <> 0 THEN ;AN000;
+; DO 8 TIMES ;AN000;
+; IF (REQ_BAND_MASK AND CUR_BAND_MASK)=1 THEN ;AN000;
+; CALL PRINT_BAND_TXT(CUR_ROW,CUR_COLUMN,CUR_BAND_MASK) ;AN000;
+; CALL PRINT_BYTE(CARRIAGE_RETURN) ;AN000;
+; ENDIF ;AN000;
+; Shift CUR_BAND_MASK one bit left ;AN000;
+; ENDDO ;AN000;
+; CALL PRINT_BYTE(LINE_FEED) ;AN000;
+; ENDIF ;AN000;
+; CUR_COLUMN := 0 ; Get next row coordinates ;AN000;
+; CUR_ROW := CUR_ROW + 1 ;AN000;
+; END ; FOR each row on the screen ;AN000;
+; Restore initial coordinates of the cursor ;AN000;
+; ;AN000;
+PRINT_COLOR_TXT PROC ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+; ;AN000;
+;-------Save coordinates of the cursor on the stack: ;AN000;
+ MOV AH,READ_CURSOR_CALL ; Read position of the cursor on the screen;AN000;
+ MOV BH,CUR_PAGE ; for the current page ;AN000;
+ INT 10H ; Call BIOS ;AN000;
+ PUSH DX ; DH := Row number, DL := Column number ;AN000;
+ ; CX := Top line and bottom line for cursor;AN000;
+ ; (not needed) ;AN000;
+; ;AN000;
+;-------Initialize the cursor to the first character to be read ;AN000;
+ MOV CUR_ROW,0 ; cursor = position (0,0) on the screen ;AN000;
+ MOV CUR_COLUMN,0 ; (top-left corner) ;AN000;
+ CALL SET_CURSOR ;AN000;
+ ;AN000;
+ MOV CX,SCREEN_HEIGHT ; CX := Number of rows on the screen ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; FOR EACH ROW ON THE SCREEN: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PRINT_1_TEXT_LINE: ;AN000;
+ CALL SCAN_FOR_BANDS_TXT ; REQ_BAND_MASK := Print bands needed ;AN000;
+ ; for this line ;AN000;
+ MOV DL,01H ; DL :="Current Band printed" mask ;AN000;
+ ;AN000;
+ ; NOTE: The COLORSELECT records are stored sequentially in the ;AN000;
+ ; Shared Data area. The band mask 00000001 corresponds to the first ;AN000;
+ ; record, 00000010 to the second, etc. ;AN000;
+ ; The COLORSELECT record indicates: "How to select the color band" ;AN000;
+ ; on the printer (It contains the bytes that must be sent to the printer;AN000;
+ ;AN000;
+ MOV BX,DS:[BP].COLORSELECT_PTR; BX := relative offset of COLORSELECT;AN000;
+ ADD BX,BP ; BX := absolute offset of COLORSELECT ;AN000;
+ PUSH CX ; Save row counter ;AN000;
+ MOV CX,8 ; For up to the maximum number of print ;AN000;
+ ; bands with this printer ;AN000;
+ ;-----------------------------------------------------------------------;AN000;
+ ; ;AN000;
+ ; FOR each Color Band available with the ribbon installed on the printer;AN000;
+ ; ;AN000;
+ ;-----------------------------------------------------------------------;AN000;
+ PRINT_1_COLOR_BAND_TXT: ; Do one pass of the printer head: ;AN000;
+ .IF <BIT REQ_BAND_MASK AND DL> ; IF this color band is needed ;AN000;
+ .THEN ; by any character on the line ;AN000;
+ CALL SET_COLOR_BAND ; then, select the color band ;AN000;
+ CALL PRINT_BAND_TXT ; and do one Print Pass for it. ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: ;AN000;
+ POP CX ; Restore the line counter ;AN000;
+ JMP SHORT PRINT_COLOR_TXT_END ; and quit. ;AN000;
+ .ENDIF ;AN000;
+ MOV AL,CR ; Print a carriage return ;AN000;
+ CALL PRINT_BYTE ;AN000;
+ .IF C ;AN000;
+ .THEN ; A printer error occurred: ;AN000;
+ POP CX ; Restore the line counter ;AN000;
+ JMP SHORT PRINT_COLOR_TXT_END ; and quit. ;AN000;
+ .ENDIF ; ENDIF printer error ;AN000;
+ .ENDIF ; ENDIF this color band is needed ;AN000;
+ SHL DL,1 ; Get next Color Band mask ;AN000;
+ ; [BX] := Next COLORSELECT record: ;AN000;
+ MOV AL,[BX].NUM_SELECT_ESC ; skip the escape bytes ;AN000;
+ XOR AH,AH ; ;AN000;
+ ADD BX,AX ; ;AN000;
+ INC BX ; skip the NUM_SELECT_ESC field ;AN000;
+ LOOP PRINT_1_COLOR_BAND_TXT ;AN000;
+ POP CX ; Restore row counter ;AN000;
+; ;AN000;
+;-----Print a line feed: ;AN000;
+ MOV AL,LF ;AN000;
+ CALL PRINT_BYTE ; Send the LF ;AN000;
+ JC PRINT_COLOR_TXT_END ; If printer error, quit ;AN000;
+; ;AN000;
+;-------Get coordinates of the first character in the next scan line: ;AN000;
+ INC CUR_ROW ; CUR_ROW + 1 ;AN000;
+ MOV CUR_COLUMN,0 ; CUR_COLUMN := 0 ;AN000;
+; ;AN000;
+;-------Point CURSOR to first character in the next scan line: ;AN000;
+ CALL SET_CURSOR ;AN000;
+ ;AN000;
+ LOOP PRINT_1_TEXT_LINE ; Print next scan line ;AN000;
+ ;AN000;
+; ;AN000;
+;-------Restore CURSOR to its original location (saved on the stack) ;AN000;
+PRINT_COLOR_TXT_END: ;AN000;
+ POP DX ; DH := Row number, DL := Column number ;AN000;
+ MOV CL,DH ;AN000;
+ MOV CUR_ROW,CX ; CUR_ROW := Original row number ;AN000;
+ MOV CL,DL ;AN000;
+ MOV CUR_COLUMN,CX ; CUR_COLUMN := Original column number ;AN000;
+ CALL SET_CURSOR ; Set the cursor back there ;AN000;
+ ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ RET ;AN000;
+PRINT_COLOR_TXT ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; SCAN_FOR_BANDS_TEXT: DETERMINE WHAT PRINTER COLOR BANDS ARE NEEDED FOR ;AN000;
+; PRINTING THE COLORS ON THE CURRENT SCREEN LINE. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW = row to start scanning ;AN000;
+; CUR_COLUMN = column to start scanning ;AN000;
+; ROTATE_SW = ON if printing is sideways ;AN000;
+; ;AN000;
+; OUTPUT: REQ_BAND_MASK ;AN000;
+; ;AN000;
+; ;AN000;
+; DATA STRUCTURE REFERENCED: ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Read all characters on the current line from left to right. ;AN000;
+; For each character, extract its band mask from the color translation table. ;AN000;
+; Add the band mask required for this character to the "Required Bands" mask. ;AN000;
+; ;AN000;
+; LOGIC : ;AN000;
+; Save current coordinates ;AN000;
+; DO (SCREEN_WIDTH) TIMES ;AN000;
+; Read a character ;AN000;
+; Get its Band Mask from the color translation table in AL ;AN000;
+; OR REQ_BAND_MASK,AL ; Add its band mask to the "Required bands" mask;AN000;
+; ; Get coordinates of the next character: ;AN000;
+; INC CUR_COLUMN ;AN000;
+; Restore initial coordinates ;AN000;
+; ;AN000;
+SCAN_FOR_BANDS_TXT PROC NEAR ;AN000;
+ PUSH CUR_ROW ; Save coordinates ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+ MOV REQ_BAND_MASK,0 ; No Color bands needed so far... ;AN000;
+ MOV CX,SCREEN_WIDTH ; For each character on the screen row ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; FOR each character on the current scan line: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+SCAN_1_CHAR: ;AN000;
+; ;AN000;
+;-------Read the character at the current cursor position ;AN000;
+ CALL SET_CURSOR ; Set cursor at character to be read ;AN000;
+ MOV AH,READ_CHAR_CALL ; Read one character ;AN000;
+ MOV BH,CUR_PAGE ; at CUR_PAGE, CUR_COLUMN and CUR_ROW ;AN000;
+ INT 10H ; Call BIOS ;AN000;
+ ; AL:=Character read, AH:=Byte attribute;AN000;
+ AND AH,00001111B ; AH := Foreground color attribute ;AN000;
+ XCHG AL,AH ; AL := AH, used as index in the XLT_TAB;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of translation table ;AN000;
+ XLAT XLT_TAB ; AL = Band mask ;AN000;
+; ;AN000;
+;-------Obtain what Print bands are required to print the color of this char: ;AN000;
+ OR REQ_BAND_MASK,AL ;AN000;
+ ;AN000;
+ INC CUR_COLUMN ; Get coordinates of next character ;AN000;
+ LOOP SCAN_1_CHAR ; Scan next character ;AN000;
+ ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ POP CUR_COLUMN ; Restore initial coordinates ;AN000;
+ POP CUR_ROW ;AN000;
+ RET ;AN000;
+SCAN_FOR_BANDS_TXT ENDP ;AN000;
+PAGE ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
+;; ;AN000;
+;; PRINT_BAND_TXT: PRINT ALL CHARACTERS ON THE CURRENT LINE THAT ARE THE SAME ;AN000;
+;; COLOR AS THE CURRENT PRINT BAND. ;AN000;
+;; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW, ;AN000;
+; CUR_COLUMN : Coordinates of the first character to be read in ;AN000;
+; the current scan line. ;AN000;
+; DL : Band mask indicating what print band to use ;AN000;
+; for this print pass. ;AN000;
+; SCAN_LINE_LENGTH: Length of the current scan line. ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; LOGIC: ;AN000;
+; DO (SCAN_LINE_LENGTH) TIMES ;AN000;
+; CALL BIOS INT 10H Read Character - returns CHAR, COLOR_NUM ;AN000;
+; IF (CUR_BAND_MASK AND XLAT_TAB[COLOR_NUM])=1 ;AN000;
+; THEN IF Background color is same as Foreground color ;AN000;
+; THEN ;AN000;
+; CALL PRINT_BYTE(SOLID_BOX) ;AN000;
+; ELSE ;AN000;
+; CALL PRINT_BYTE(CHAR) ;AN000;
+; ELSE ;AN000;
+; CALL PRINT_BYTE(blank) ;AN000;
+; Get coordinates of the next character ;AN000;
+; ;AN000;
+PRINT_BAND_TXT PROC ;AN000;
+SOLID_BOX EQU 219 ; ASCII Code for printing a solid box ;AN000;
+BLANK EQU 32 ; ASCII code for printing a space ;AN000;
+ PUSH CUR_COLUMN ; Save column number ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ MOV CX,SCREEN_WIDTH ; CX := Number of character on one screen row ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; FOR each character on the current row: ;AN000;
+; ;AN000;
+;===============================================================================;AN000;
+PRINT_1_CHAR: ;AN000;
+; ;AN000;
+;-------Read the character at the current cursor position ;AN000;
+ CALL SET_CURSOR ; Set cursor at character to be read ;AN000;
+ MOV AH,READ_CHAR_CALL ; Read one character ;AN000;
+ MOV BH,CUR_PAGE ; at CUR_PAGE, CUR_COLUMN and CUR_ROW ;AN000;
+ INT 10H ; Call BIOS ;AN000;
+ ; AL:=Character read, AH:=Byte attribute;AN000;
+ MOV CUR_CHAR,AL ;AN000;
+ MOV DH,AH ; DH := Byte attribute ;AN000;
+ AND DH,11110000B ; DH := Background color ;AN000;
+ SHR DH,1 ; DH := Background color right justified;AN000;
+ SHR DH,1 ;AN000;
+ SHR DH,1 ;AN000;
+ SHR DH,1 ;AN000;
+ AND AH,00001111B ; AH := Foreground color right justified;AN000;
+; ;AN000;
+;-------Test if this character should be printed (need color of the current band;AN000;
+ MOV AL,AH ; AL:=color used as index in the XLT_TAB;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of translation table ;AN000;
+ XLAT XLT_TAB ; AL := Band mask (DL=current band mask);AN000;
+ .IF <BIT AL AND DL> ;If needs this band to print the color ;AN000;
+ .THEN ; of this character ;AN000;
+ .IF <AH EQ DH> ; then: when foreground = background ;AN000;
+ .THEN ; send a solid box ;AN000;
+ MOV AL,SOLID_BOX ; ;AN000;
+ .ELSE ; when foreground <> background ;AN000;
+ MOV AL,CUR_CHAR ; send the character ;AN000;
+ .ENDIF ; Endif foreground = background ;AN000;
+ .ELSE ; else: send a blank ;AN000;
+ MOV AL,BLANK ; ;AN000;
+ .ENDIF ; Endif color band needed ;AN000;
+ CALL PRINT_BYTE ; Print the byte ;AN000;
+ JC PRINT_BAND_TXT_END ; If printer error occurred: QUIT ;AN000;
+ INC CUR_COLUMN ; Else, Get next column; keep going ;AN000;
+ LOOP PRINT_1_CHAR ;AN000;
+ ;AN000;
+PRINT_BAND_TXT_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ POP CUR_COLUMN ; Restore column number ;AN000;
+ RET ;AN000;
+CUR_CHAR DB ? ;AN000;
+PRINT_BAND_TXT ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PRINT_COLOR_APA: PRINT AN APA MODE SCREEN ON A COLOR PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BP = Offset of the shared data area ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; CUR_MODE_PTR = Coordinates of current DISPLAYMODE info. ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Each pixel on the screen is printed as a "box" of dots on the ;AN000;
+; printer. For a screen pixel of a given color, the best color approximation ;AN000;
+; is chosen among the color available on the printer. ;AN000;
+; ;AN000;
+; The printer colors are obtained by selecting a print band. A few more printer ;AN000;
+; color are obtained by printing twice (or more times) with different color ;AN000;
+; bands. ;AN000;
+; ;AN000;
+; For example, let's say we have a ribbon on the printer with a YELLOW CYAN ;AN000;
+; MAGENTA ribbon and we read a GREEN pixel on the screen. ;AN000;
+; ;AN000;
+; We first determine what "box" size will be used to represent this pixel. ;AN000;
+; Let's say it's a 3x2 box (this is obtained from the DISPLAYMODE record) ;AN000;
+; In all cases, we will print this pixel as a 3x2 box of printer dots. ;AN000;
+; That is, we will print 6 dots on the printer for one on the screen. ;AN000;
+; We do not use any kind of patterns (e,g,. printing only 2 dots out of 6) ;AN000;
+; for printing on the color printer. A screen pixel is either printed ;AN000;
+; as a "full" box of printer dots or not printed at all (e,g,. if it's white).;AN000;
+; ;AN000;
+; Now, from the COLORPRINT records, we know all the colors availables on the ;AN000;
+; printer, and what print bands must be used (or overlaid) in order to ;AN000;
+; obtain them. ;AN000;
+; ;AN000;
+; So, we consult these COLORPRINT records one by one comparing how close ;AN000;
+; the color of each of them is to our GREEN pixel. (the colors for our pixel ;AN000;
+; AND for the printer color are both indicated in terms of RGB values) ;AN000;
+; WE PICK THE CLOSEST PRINTER COLOR. ;AN000;
+; ;AN000;
+; To conclude, our GREEN pixel will be printed by first selecting the YELLOW ;AN000;
+; band, then sending to the printer a "box". Then, the BLUE band is selected ;AN000;
+; and the "box" is sent again. ;AN000;
+; ;AN000;
+; This process is carried line by line. ;AN000;
+; ;AN000;
+; For each line, we first read each pixel to see what color bands are going ;AN000;
+; to be needed for this line. ;AN000;
+; ;AN000;
+; Then, we loop for each band available on the printer. ;AN000;
+; ;AN000;
+; IF the current line needs the current printer band (i.e.,if any pixel on ;AN000;
+; the line needs this color band in order to achieve its color. ;AN000;
+; THEN, we select this color band (we know how to do it from the COLORSELECT ;AN000;
+; record in the Shared Data area) ;AN000;
+; AND we must read the line again; for each pixel that needs the current ;AN000;
+; band a "box" is sent to the printer. ;AN000;
+; ;AN000;
+; LOGIC : ;AN000;
+; CALL INIT_BLACK_BOX ; Initialize a print box ;AN000;
+; CALL GET_SCREEN_INFO ;AN000;
+; CALL SETUP_PRT ;AN000;
+; DO (NB_SCAN_LINES) TIMES ;AN000;
+; CALL DET_CUR_SCAN_LNE_LENGTH ;AN000;
+; IF CUR_SCAN_LNE_LENGTH NE 0 THEN ;AN000;
+; CALL SCAN_FOR_BANDS_APA(CUR_ROW,CUR_COLUMN,REQ_BAND_MASK) ;AN000;
+; CUR_BAND_MASK := 01H ;AN000;
+; IF REQ_BAND_MASK <> 0 THEN ;AN000;
+; DO 8 TIMES ;AN000;
+; IF (REQ_BAND_MASK AND CUR_BAND_MASK)=1 THEN ;AN000;
+; CALL NEW_PRT_LINE ;AN000;
+; CALL PRINT_BAND_APA(CUR_ROW,CUR_COLUMN,CUR_BAND_MASK) ;AN000;
+; CALL PRINT_BYTE(CARRIAGE_RETURN) ;AN000;
+; ENDIF ;AN000;
+; Shift CUR_BAND_MASK one bit left ;AN000;
+; ENDDO ;AN000;
+; ENDIF ; Should make a print pass for this color band ;AN000;
+; CALL PRINT_BYTE(LINE_FEED) ;AN000;
+; ENDIF ; Current scan line is not empty ;AN000;
+; IF rotated print THEN ;AN000;
+; CUR_COLUMN := CUR_COLUMN - BOXES_PER_PRT_BUF ;AN000;
+; CUR_ROW := SAVE_START_ROW ;AN000;
+; ELSE ;AN000;
+; CUR_ROW := CUR_ROW + BOXES_PER_PRT_BUF ;AN000;
+; CUR_COLUMN := SAVE_START_COLUMN ;AN000;
+; ENDIF ;AN000;
+; ENDDO ; Number of Scan lines ;AN000;
+; CALL RESTORE_PRT ;AN000;
+; ;AN000;
+PRINT_COLOR_APA PROC ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ ;AN000;
+ ;AN000;
+;-------Initialize print box (A "box" represents one screen pel on the printer) ;AN000;
+ CALL INIT_BLACK_BOX ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Determine where to start reading the screen: ;AN000;
+; If printing sideways, start in LOW LEFT corner. ;AN000;
+; If normal printing, start in TOP LEFT corner. ;AN000;
+; Determine the maximum length for a scan line: ;AN000;
+; If printing sideways, it is the height of the screen. ;AN000;
+; For normal printing, it is the width of the screen. ;AN000;
+; Determine the number of scan lines on the screen. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL GET_SCREEN_INFO ; Get info. about how to read the screen;AN000;
+ CALL SETUP_PRT ; Set up the printer (Line spacing, etc);AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: quit ;AN000;
+ JMP SHORT PRINT_COLOR_APA_END ; ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+ MOV CX,NB_SCAN_LINES ;AN000;
+;---------------------------------------------------------------------------- ;AN000;
+; ;AN000;
+; FOR EACH SCAN LINE ON THE SCREEN (and each print line): ;AN000;
+; ;AN000;
+;---------------------------------------------------------------------------- ;AN000;
+PRINT_SCAN_LINE: ;AN000;
+ CALL DET_CUR_SCAN_LNE_LENGTH ; Determine length of the scan line ;AN000;
+ .IF <CUR_SCAN_LNE_LENGTH NE 0> ; If line is not empty ;AN000;
+ .THEN ;AN000;
+ CALL SCAN_FOR_BANDS_APA ; REQ_BAND_MASK := Mask for what print;AN000;
+ ; bands are needed. ;AN000;
+ MOV DL,01H ; DL := "Current Band to be printed" ;AN000;
+ MOV BX,DS:[BP].COLORSELECT_PTR; BX := Offset of COLORSELECT record;AN000;
+ ADD BX,BP ; ("How to select the color band");AN000;
+ PUSH CX ; Save scan line counter ;AN000;
+ MOV CX,8 ; For up to the maximum number of prin;AN000;
+ ; bands with this printer ;AN000;
+ ;---------------------------------------------------------------------;AN000;
+ ; ;AN000;
+ ; FOR each Color Band needed: ;AN000;
+ ; ;AN000;
+ ;---------------------------------------------------------------------;AN000;
+ PRINT_1_COLOR_BAND_APA: ; Only if this color band is needed: ;AN000;
+ .IF <BIT REQ_BAND_MASK AND DL> ; Do one pass of the printer head ;AN000;
+ .THEN ; ;AN000;
+ CALL SET_COLOR_BAND ; Select the color band on the printer;AN000;
+ CALL NEW_PRT_LINE ; Send escape sequence to the printer ;AN000;
+ ; for starting a new graphics line ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: ;AN000;
+ POP CX ; Restore the line counter and ;AN000;
+ JMP SHORT PRINT_COLOR_APA_END ; return ;AN000;
+ .ENDIF ; Endif printer error occurred ;AN000;
+ ;AN000;
+ CALL PRINT_BAND_APA ; Do one Print Pass for current band ;AN000;
+ MOV AL,CR ; Print a carriage return ;AN000;
+ CALL PRINT_BYTE ;AN000;
+ .IF C ; If a printer error occurred ;AN000;
+ .THEN ;AN000;
+ POP CX ; Restore the line counter and ;AN000;
+ JMP SHORT PRINT_COLOR_APA_END ; return ;AN000;
+ .ENDIF ; End if printer error occurred ;AN000;
+ .ENDIF ; End if this color band is needed ;AN000;
+ SHL DL,1 ; Get next Color Band mask ;AN000;
+ ; Locate next COLORSELECT record: ;AN000;
+ MOV AL,[BX].NUM_SELECT_ESC; skip the escape bytes ;AN000;
+ XOR AH,AH ;AN000;
+ ADD BX,AX ;AN000;
+ INC BX ; skip the NUM_SELECT_ESC field ;AN000;
+ LOOP PRINT_1_COLOR_BAND_APA ;AN000;
+ POP CX ; Restore scan line counter ;AN000;
+ .ENDIF ; Scan line length <> 0 ;AN000;
+; ;AN000;
+;-----Print a line feed: ;AN000;
+ MOV AL,LF ;AN000;
+ CALL PRINT_BYTE ;AN000;
+ JC PRINT_COLOR_APA_END ; If a printer error occurred: quit ;AN000;
+; ;AN000;
+;-------Get coordinates of next scan line: ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; then: ;AN000;
+ MOV AL,NB_BOXES_PER_PRT_BUF; AX := Numbers of pels read on row ;AN000;
+ CBW ; ;AN000;
+ ADD CUR_COLUMN,AX ; CUR_COLUMN + Number of pels read ;AN000;
+ MOV AX,SCREEN_HEIGHT ; CUR_ROW := SCREEN_HEIGHT - 1 ;AN000;
+ DEC AX ; ;AN000;
+ MOV CUR_ROW,AX ; ;AN000;
+ .ELSE ; else, printing NOT rotated: ;AN000;
+ MOV AL,NB_BOXES_PER_PRT_BUF ; AX := Number of pels read on column ;AN000;
+ CBW ; ;AN000;
+ ADD CUR_ROW,AX ; CUR_ROW + Number of pels read ;AN000;
+ MOV CUR_COLUMN,0 ; CUR_COLUMN := 0 ;AN000;
+ .ENDIF ; End if printing sideways ;AN000;
+ LOOP PRINT_SCAN_LINE ; ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Restore the printer (send a Page Eject, etc.) ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL RESTORE_PRT ;AN000;
+PRINT_COLOR_APA_END: ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+PRINT_COLOR_APA ENDP ;AN000;
+PAGE ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
+;; ;AN000;
+;; ;AN000;
+;; SCAN_FOR_BANDS_APA : DETERMINE WHAT PRINT BANDS ARE NEEDED FOR THE CURRENT ;AN000;
+;; PRINT PASS. ;AN000;
+;; ;AN000;
+;;------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW : row to start scanning (word) ;AN000;
+; CUR_COLUMN : column to start scanning (word) ;AN000;
+; CUR_SCAN_LNE_LENGTH : length of the current scan line (word) ;AN000;
+; ROTATE_SW = ON if printing is sideways ;AN000;
+; ;AN000;
+; OUTPUT: REQ_BAND_MASK : band mask for required bands (byte) ;AN000;
+; ;AN000;
+;;------------------------------------------------------------------------------;AN000;
+;; ;AN000;
+;; Data Structures Referenced: ;AN000;
+;; Shared Data Area ;AN000;
+;; Print Info ;AN000;
+;; Color Translate Table ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Read all the dots required for one print line to determine ;AN000;
+;; the print bands required. The print line corresponds to several ;AN000;
+;; screen rows (or columns if rotated printing). The number of ;AN000;
+;; rows / columns per print line is stored in NB_BOXES_PER_PRT_BUF. ;AN000;
+;; The band information is obtained from the Color Translate Table. ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; PRINT_COLOR_APA ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; READ_DOT, BIOS INT 10H ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; Save initial coordinates ;AN000;
+;; SAVE_START_COLUMN := CUR_COLUMN ;AN000;
+;; REQ_BAND_MASK := 00H ;AN000;
+;; DO (SCAN_LINE_LENGTH) TIMES ;AN000;
+;; Save coordinates of the "column" ;AN000;
+;; DO (BOXES_PER_PRT_BUF) TIMES ;AN000;
+;; CALL READ_DOT(IN CUR_ROW,CUR_COLUMN; OUT COLOR_NUM) ;AN000;
+;; REQ_BAND_MASK := REQ_BAND_MASK OR COLOR_XLAT_TAB[BX] ;AN000;
+;; IF rotated print THEN ;AN000;
+;; Increment CUR_COLUMN ;AN000;
+;; ELSE ;AN000;
+;; Increment CUR_ROW ;AN000;
+;; ENDIF ;AN000;
+;; Restore coordinates of the "column" ;AN000;
+;; ENDDO ;AN000;
+;; IF rotated print THEN ;AN000;
+;; Decrement CUR_ROW ;AN000;
+;; ELSE ;AN000;
+;; Increment CUR_COLUMN ;AN000;
+;; ENDIF ;AN000;
+;; ENDDO ;AN000;
+;; Restore initial coordinates ;AN000;
+;; RETURN ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+SCAN_FOR_BANDS_APA PROC NEAR ;AN000;
+ PUSH CUR_ROW ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+ MOV REQ_BAND_MASK,0 ; No Color bands needed so far... ;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of translation table ;AN000;
+ MOV CX,CUR_SCAN_LNE_LENGTH ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; FOR each column on the current scan line (up to the last non=blank): ;AN000;
+; ;AN000;
+;===============================================================================;AN000;
+SCAN_1_COLUMN: ;AN000;
+ PUSH CX ; Save column counter ;AN000;
+ PUSH CUR_ROW ; Save coordinates of the "column" ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; For each pixel within the current column of the scan line: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ XOR CX,CX ; CX := Number of pixels to read ;AN000;
+ MOV CL,NB_BOXES_PER_PRT_BUF ; within the current "column" ;AN000;
+SCAN_1_PIXEL: ;AN000;
+ CALL READ_DOT ; AL := Index into translation table ;AN000;
+ XLAT XLT_TAB ; AL := Band mask ;AN000;
+ OR REQ_BAND_MASK,AL ; Add bands required for this pixel ;AN000;
+ ;AN000;
+;-------Get coordinates of next pixel: ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ INC CUR_COLUMN ; then, increment column number ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_ROW ; else, increment row number ;AN000;
+ .ENDIF ; ;AN000;
+ LOOP SCAN_1_PIXEL ;AN000;
+ POP CUR_COLUMN ; Restore coordinates of the "column" ;AN000;
+ POP CUR_ROW ; ;AN000;
+ POP CX ; Restore column counter ;AN000;
+ ;AN000;
+ ;AN000;
+;-------Get coordinates of next "column": ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ DEC CUR_ROW ; then, get row above on screen ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_COLUMN ; else, get column next right ;AN000;
+ .ENDIF ; ;AN000;
+ LOOP SCAN_1_COLUMN ;AN000;
+ ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ POP CUR_COLUMN ;AN000;
+ POP CUR_ROW ;AN000;
+ RET ;AN000;
+SCAN_FOR_BANDS_APA ENDP ;AN000;
+PAGE ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
+;; ;AN000;
+;; PRINT_BAND_APA : PRINT ALL DOTS ON CURRENT LINE THAT NEED THE CURRENT BAND ;AN000;
+;; TO APPROXIMATE THEIR COLOR. ;AN000;
+;; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW, ;AN000;
+; CUR_COLUMN : Coordinates of the first pixel to be read in the ;AN000;
+; current scan line. ;AN000;
+; DL : Band mask indicating what print band to use ;AN000;
+; for this print pass. ;AN000;
+; CUR_SCAN_LNE_LENGTH: Length of the current scan line. ;AN000;
+; ROTATE_SW = ON if printing is sideways ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;; ;AN000;
+;; Data Structures Referenced: ;AN000;
+;; Shared Data Area ;AN000;
+;; Print Info ;AN000;
+;; Color Translate Table ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Print all dots on this print line which need the current ;AN000;
+;; band. The print line corresponds to several ;AN000;
+;; screen rows (or columns if rotated printing). The number of ;AN000;
+;; rows / columns per print line is stored in NB_BOXES_PER_PRT_BUF. ;AN000;
+;; The band information is obtained from the Color Translate Table. ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; PRINT_COLOR_APA ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; READ_DOT, BIOS INT 10H, STORE_BOX, PRT_BUFFER, PRINT_BYTE ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; SAVE_START_ROW := CUR_ROW ;AN000;
+;; SAVE_START_COLUMN := CUR_COLUMN ;AN000;
+;; ;AN000;
+;; CALL SET_COLOR_BAND ; Select the color for this print pass ;AN000;
+;; DO (SCAN_LINE_LENGTH) TIMES ;AN000;
+;; Save coordinates of the "column" ;AN000;
+;; Clear the print buffer ;AN000;
+;; DO (BOXES_PER_PRT_BUF) TIMES ;AN000;
+;; CALL READ_DOT(CUR_ROW,CUR_COLUMN,COLOR_NUM) ;AN000;
+;; IF (CUR_BAND_MASK AND XLAT_TAB[COLOR_NUM])=1 THEN ;AN000;
+;; CALL STORE_BOX(black box) ;AN000;
+;; ELSE ;AN000;
+;; CALL STORE_BOX(white box) ;AN000;
+;; ENDIF ;AN000;
+;; IF rotated print THEN ;AN000;
+;; Decrement CUR_COLUMN ;AN000;
+;; ELSE ;AN000;
+;; Increment CUR_ROW ;AN000;
+;; ENDIF ;AN000;
+;; ENDDO ;AN000;
+;; CALL PRINT_BUFFER ;AN000;
+;; Restore coordinates of the "column" ;AN000;
+;; ; Get coordinates of the next "column"; ;AN000;
+;; IF rotated print THEN ;AN000;
+;; Decrement CUR_ROW ;AN000;
+;; CUR_COLUMN := SAVE_START_COLUMN ;AN000;
+;; ELSE ;AN000;
+;; Increment CUR_COLUMN ;AN000;
+;; CUR_ROW := SAVE_START_ROW ;AN000;
+;; ENDIF ;AN000;
+;; ENDDO ;AN000;
+;; RETURN ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AN000;
+PRINT_BAND_APA PROC NEAR ;AN000;
+ PUSH CUR_ROW ; Save coordinates ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of translation table ;AN000;
+ MOV CX,CUR_SCAN_LNE_LENGTH ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; FOR each column on the current scan line (up to the last non=blank): ;AN000;
+; (One "column" contains the number of pixels required to fill the Print buffer);AN000;
+; ;AN000;
+;===============================================================================;AN000;
+PRINT_1_COLUMN: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Clear the print buffer "PRT_BUF" ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ XOR DI,DI ; DI := Number of bytes cleared in the buffer ;AN000;
+ XOR AX,AX ;AN000;
+ MOV AL,BOX_W ; AX := Number of bytes in the print buffer ;AN000;
+CLEAR_BUF: ; For each byte in the PRT_BUF: ;AN000;
+ MOV PRT_BUF[DI],0 ; Initialize byte to blanks ;AN000;
+ INC DI ; One more has been cleared ;AN000;
+ CMP DI,AX ; All bytes cleared ? ;AN000;
+ JL CLEAR_BUF ; No, clear next one. ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Fill up the print buffer "PRT_BUF" ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ PUSH CX ; Save column counter ;AN000;
+ XOR CX,CX ; CX := Number of pixels to read ;AN000;
+ MOV CL,NB_BOXES_PER_PRT_BUF ; within the current "column" ;AN000;
+ ; of the scan line ;AN000;
+ PUSH CUR_ROW ; Save coordinates of the "column" ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+; ;AN000;
+; For each pixel within the current column of the scan line: ;AN000;
+STORE_1_PIXEL: ;AN000;
+ CALL READ_DOT ; AL := Index into translation table ;AN000;
+ XLAT XLT_TAB ; AL := Band mask ;AN000;
+ .IF <BIT AL AND DL> ; If color of the current pixel needs ;AN000;
+ .THEN ; the current printer band ;AN000;
+ MOV SI,OFFSET BLACK_BOX ; then, store a box in the ;AN000;
+ CALL STORE_BOX ; PRT_BUF ;AN000;
+ .ELSE ; ;AN000;
+ MOV SI,OFFSET WHITE_BOX ; else, store an empty box ;AN000;
+ CALL STORE_BOX ; in the PRT_BUF ;AN000;
+ .ENDIF ;AN000;
+; ;AN000;
+;-------Get coordinates of next pixel: ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ INC CUR_COLUMN ; then, increment column number ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_ROW ; else, increment row number ;AN000;
+ .ENDIF ; ;AN000;
+ LOOP STORE_1_PIXEL ;AN000;
+ ;AN000;
+ POP CUR_COLUMN ; Restore coordinates of the "column" ;AN000;
+ POP CUR_ROW ; ;AN000;
+ POP CX ; Restore column counter ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Print the PRT_BUF: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ CALL PRINT_BUFFER ;AN000;
+ .IF <BIT ERROR_CODE NZ PRINTER_ERROR> ;AN000;
+ .THEN ; A printer error occurred: QUIT ;AN000;
+ JMP SHORT PRINT_BAND_APA_END ; ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Get coordinates of next "column": ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ DEC CUR_ROW ; then, get row above on screen ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_COLUMN ; else, get column next right ;AN000;
+ .ENDIF ; ;AN000;
+ LOOP PRINT_1_COLUMN ;AN000;
+ ;AN000;
+PRINT_BAND_APA_END: ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ POP CUR_COLUMN ; Restore initial coordinates ;AN000;
+ POP CUR_ROW ;AN000;
+ RET ;AN000;
+PRINT_BAND_APA ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; SET_CURSOR : SET THE CURSOR TO CUR_ROW, CUR_COLUMN AND CUR_PAGE ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW, ;AN000;
+; CUR_COLUMN = Coordinates for the cursor (word) ;AN000;
+; CUR_PAGE = Page for which to set the cursor (byte) ;AN000;
+; ;AN000;
+; OUTPUT: SCREEN ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+SET_CURSOR PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH DX ;AN000;
+ MOV DH,BYTE PTR CUR_ROW ;AN000;
+ MOV DL,BYTE PTR CUR_COLUMN ;AN000;
+ MOV BH,CUR_PAGE ;AN000;
+ MOV AH,SET_CURSOR_CALL ; Set cursor request ;AN000;
+ INT 10H ; Call BIOS ;AN000;
+ POP DX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+SET_CURSOR ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; SET_COLOR_BAND : SET THE PRINTER TO THE CURRENT COLOR BAND ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BX = Offset of current COLORSELECT record in the ;AN000;
+; Shared data area. ;AN000;
+; DS:[BP] = Offset of shared data area ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+SET_COLOR_BAND PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+;-------Send the escape sequence for selecting this color band to the printer: ;AN000;
+ XOR CX,CX ;AN000;
+ MOV CL,[BX].NUM_SELECT_ESC ; CX := Number of bytes to send ;AN000;
+ ADD BX,OFFSET SELECT_ESC ; BX := Offset of bytes to send ;AN000;
+SEND_1_COLORSELECT_BYTE: ;AN000;
+ MOV AL,[BX] ; AL := Byte to send to printer ;AN000;
+ CALL PRINT_BYTE ; Send it ;AN000;
+ JC SET_COLOR_BAND_END ; If printer error: return ;AN000;
+ INC BX ; Get next byte ;AN000;
+ LOOP SEND_1_COLORSELECT_BYTE ;AN000;
+ ;AN000;
+SET_COLOR_BAND_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+SET_COLOR_BAND ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; INIT_BLACK_BOX: INIT. THE BOX FOR PRINTING APA MODE DOTS ON A COLOR PRINTER. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BOX_W, ;AN000;
+; BOX_H = Size of the print box for one pixel. ;AN000;
+; ;AN000;
+; OUTPUT: BLACK_BOX = A box for which all dots are on. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Initialize the print box used to print a screen pixel. ;AN000;
+; ;AN000;
+; For example, ;AN000;
+; with a size of 3x2 the BLACK_BOX will use 3 bytes: ;AN000;
+; ;AN000;
+; ;AN000;
+; byte1 byte2 byte3 ;AN000;
+; (column1) (column2) (column3) ;AN000;
+; bit 7 -->0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 1 1 1 ;AN000;
+; bit 0 -->1 1 1 ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+INIT_BLACK_BOX PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+;-------Build one box column: ;AN000;
+ XOR CX,CX ;AN000;
+ MOV CL,BOX_H ; CX := Height in bits of the print box ;AN000;
+ XOR AL,AL ; AX := Bit mask for creating box column ;AN000;
+ .REPEAT ; For height of the box: ;AN000;
+ SHL AL,1 ; ;AN000;
+ OR AL,1 ; Insert one bit in the box column ;AN000;
+ .LOOP ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; AL now contains one box column. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+;-------Replicate this column over all columns of the box. ;AN000;
+ XOR BX,BX ; BX := Index into the BOX ;AN000;
+INIT_1_BLACK_COLUMN: ;AN000;
+ MOV BLACK_BOX[BX],AL; Init current column to black box column ;AN000;
+ INC BX ; Get next column ;AN000;
+ CMP BL,BOX_W ;AN000;
+ JL INIT_1_BLACK_COLUMN ;AN000;
+ ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+INIT_BLACK_BOX ENDP ;AN000;
+INCLUDE GRCOMMON.ASM ;AN000;
+LEN_OF_COLOR_MODULES EQU $-PRINT_COLOR ;AN000;
+CODE ENDS ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcolprt.ext b/private/mvdm/dos/v86/cmd/graphics/grcolprt.ext
new file mode 100644
index 000000000..d5357856c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcolprt.ext
@@ -0,0 +1,31 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCOLPRT.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing external declarations for ;AN000;
+;; the code and data defined in GRCOLPRT.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ EXTRN PRINT_MODULE_START:NEAR ;; ;AN000;
+ EXTRN PRINT_COLOR:NEAR ;AN000;
+ EXTRN LEN_OF_COLOR_MODULES:ABS ;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcommon.asm b/private/mvdm/dos/v86/cmd/graphics/grcommon.asm
new file mode 100644
index 000000000..bbe2aeebd
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcommon.asm
@@ -0,0 +1,1362 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I modified the procedures STORE_BOX, PRINT_BUFFER,
+;** GET_SCREEN_INFO, DET_CUR_SCAN_LNE_LENGTH, and NEW_PRT_LINE
+;** as follows.
+;**
+;** For STORE_BOX:
+;** if data_type = data_row, then store printbox in print buffer
+;** in row format - not column format.
+;**
+;** For PRINT_BUFFER:
+;** if data_type = data_row, then print one byte at a time.
+;**
+;** For GET_SCREEN_INFO:
+;** if data_type = data_row
+;** nb_boxes_per_prt_buf = 8/box_height
+;** if print_options = rotate
+;** nb_scan_lines = screen_width
+;** else
+;** nb_scan_lines = screen_height
+;** endif
+;** endif
+;**
+;** For DET_CUR_SCAN_LNE_LENGTH:
+;** if data_type = data_row
+;** don't go down the columns to determine the scan_line_length
+;** endif
+;**
+;** For NEW_PRT_LINE:
+;** Altered it so send escape number sequence, COUNT or LOWCOUNT and
+;** HIGHCOUNT, if they are specified before the new keyword DATA.
+;**
+;**
+;** I added the the procedures END_PRT_LINE and GET_COUNT, which
+;** are described below.
+;**
+;** END_PRT_LINE sends escape number sequence, COUNT or LOWCOUNT and
+;** HIGHCOUNT, if they are specified after the new keyword DATA
+;** in the GRAPHICS statement of the profile. It also sends a
+;** CR & LF for IBM type printers if needed.
+;**
+;** GET_COUNT gets the number of bytes that are going to be sent to the
+;** printer and converts the number to ASCII if DATA_TYPE = DATA_ROW.
+;**
+;** BUG NOTES: The following bug was fixed for the pre-release
+;** version Q.01.02.
+;**
+;** BUG (mda003)
+;** ------------
+;**
+;** NAME: GRAPHICS prints a CR & LF after each scan line unless it is
+;** loaded twice.
+;**
+;** FILES & PROCEDURES AFFECTED: GRLOAD3.ASM - PARSE_GRAPHICS
+;** GRCOMMON.ASM - END_PRT_LINE
+;** GRSHAR.STR - N/A
+;**
+;** CAUSES: The local variables LOWCOUNT_FOUND, HIGHCOUNT_FOUND CR_FOUND and
+;** LF_FOUND used for loading, were incorrectly being used as global
+;** variables during printing.
+;**
+;** FIX: Created a new variable Printer_Needs_CR_LF in GRSHAR.STR, which
+;** is used to determine in GRCOMMON.ASM if it's necessary to
+;** manually send a CR & LF to the printer at print time. The
+;** variable is set at load time in GRLOAD3.ASM, if the variables
+;** Data_Found and Build_State are set.
+;**
+;** DOCUMENTATION NOTES: This version of GRCOMMON.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;************************************************************
+ PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCOMMON.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; ;AN000;
+;; This file contains the modules common to the Print Screen ;AN000;
+;; process of GRAPHICS.COM. ;AN000;
+;; This file is included by both set of Print modules. ;AN000;
+;; ;AN000;
+;; This file MUST BE COMPILED WITH EACH SET OF MODULES since, ;AN000;
+;; one set is relocated in memory at installation time; all ;AN000;
+;; references to the common procedures must be resolved from ;AN000;
+;; within each set of print modules. ;AN000;
+;; ;AN000;
+;; The set of common modules is relocated in memory along with ;AN000;
+;; the selected set of print modules. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; READ_DOT ;AN000;
+;; LOC_MODE_PRT_INFO ;AN000;
+;; STORE_BOX ;AN000;
+;; PRINT_BUFFER ;AN000;
+;; GET_SCREEN_INFO ;AN000;
+;; SETUP_PRT ;AN000;
+;; RESTORE_PRT ;AN000;
+;; NEW_PRT_LINE ;AN000;
+;; PRINT_BYTE ;AN000;
+;; DET_CUR_SCAN_LNE_LENGTH ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+;; Added the following procedures to support printers with horizontal
+;; printer heads, such as an HP PCL printers.
+;; GET_COUNT
+;; END_PRT_LINE
+; /\ ~~mda(001) -----------------------------------------------------------------------
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRCTRL.ASM: ;AN000;
+;; PRT_SCR - Main module for printing the screen. ;AN000;
+;; FROM FILE GRBWPRT.ASM: ;AN000;
+;; PRT_BW_APA - Main module for printing on BW printer. ;AN000;
+;; FROM FILE GRCOLPRT.ASM: ;AN000;
+;; PRINT_COLOR - Main module for printing on COLOR printer. ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; ;AN000;
+;; This file is included by both GRBWPRT.ASM and GRCOLPRT.ASM and is ;AN000;
+;; compiled with each of them. However, only one copy is made resident. ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; LOC_MODE_PRT_INFO: LOCATE DISPLAYMODE PRINTER INFO. FOR THE CURRENT ;AN000;
+; MODE ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: BP = Offset of the shared data area ;AN000;
+; CUR_MODE = Current video mode ;AN000;
+; ;AN000;
+; OUTPUT: CUR_MODE_PTR = Absolute Offset of the ;AN000;
+; current DISPLAYMODE INFO record. ;AN000;
+; ;AN000;
+; ERROR_CODE = DISPLAYMODE_INFO_NOT_FOUND if not found. ;AN000;
+; ;AN000;
+; CALLED BY: PRINT_COLOR ;AN000;
+; PRINT_BW_APA ;AN000;
+; ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: DISPLAYMODE_PTR is pointing to the first DISPLAYMODE ;AN000;
+; INFO record within the Shared Data Area. ;AN000;
+; ;AN000;
+; This (chained) list of DISPLAYMODE records is scanned until the record ;AN000;
+; for the current mode is found. ;AN000;
+; ;AN000;
+; Note: All pointers in the DISPLAYMODE records are relative to the beginning ;AN000;
+; of the shared data area. Therefore, we must add the offset of the ;AN000;
+; shared data area (in BP) in order to access the data these pointers ;AN000;
+; are referencing. ;AN000;
+; ;AN000;
+; The CUR_MODE_PTR is relative to the segment and references the ;AN000;
+; DISPLAYMODE record for the video mode currently set at print screen ;AN000;
+; time. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; FOUND := FALSE ;AN000;
+; DO UNTIL FOUND OR END_OF_LIST ;AN000;
+; Get a display mode information record ;AN000;
+; IF record.DISP_MODE = CUR_MODE ;AN000;
+; THEN FOUND := TRUE ;AN000;
+; ELSE ;AN000;
+; CUR_MODE_PTR := record.NEXT_DISP_MODE ;AN000;
+; ;AN000;
+; ;AN000;
+ ;AN000;
+LOC_MODE_PRT_INFO PROC NEAR ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ PUSH SI ;AN000;
+ ;AN000;
+ MOV BX,DS:[BP].DISPLAYMODE_PTR ; [BX] := Current DISPLAYMODE ;AN000;
+ ADD BX,BP ; record ;AN000;
+ MOV DL,CUR_MODE ; DL := Current mode ;AN000;
+ ;AN000;
+SCAN_1_DISPLAYMODE_RECORD: ;AN000;
+ MOV SI,[BX].DISP_MODE_LIST_PTR ; [SI] : First mode covered ;AN000;
+ ADD SI,BP ; by this DISPLAYMODE record ;AN000;
+ MOV CL,[BX].NUM_DISP_MODE ; Scan each mode in the list ;AN000;
+ XOR CH,CH ;AN000;
+SCAN_LIST_OF_MODES: ;AN000;
+ CMP CS:[SI],DL ; FOUND ? ;AN000;
+ JE FOUND ;AN000;
+ INC SI ; NO, get next mode in ;AN000;
+ LOOP SCAN_LIST_OF_MODES ; DISPLAYMODE record ;AN000;
+ ;AN000;
+ CMP [BX].NEXT_DISP_MODE,-1 ; END OF DISPLAYMODE LIST ? ;AN000;
+ JE NOT_FOUND ; Yes, this mode not supported ;AN000;
+NEXT_RECORD: ; No, ;AN000;
+ MOV BX,[BX].NEXT_DISP_MODE ; [BX] := Next record ;AN000;
+ ADD BX,BP ; ;AN000;
+ JMP SHORT SCAN_1_DISPLAYMODE_RECORD ;AN000;
+ ;AN000;
+FOUND: ; Found: ;AN000;
+ MOV CUR_MODE_PTR,BX ; Update pointer to current ;AN000;
+ JMP SHORT LOC_MODE_PRT_INFO_END ; DISPLAYMODE record. ;AN000;
+ ;AN000;
+NOT_FOUND: ; Not found: ;AN000;
+ MOV ERROR_CODE,DISPLAYMODE_INFO_NOT_FOUND ; Return error condition ;AN000;
+ ;AN000;
+LOC_MODE_PRT_INFO_END: ;AN000;
+ POP SI ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ RET ;AN000;
+LOC_MODE_PRT_INFO ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; STORE_BOX : STORE ONE BOX IN THE PRINT BUFFER. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: SI = OFFSET OF THE BOX TO BE PRINTED ;AN000;
+; BOX_W = BOX WIDTH IN BITS ;AN000;
+; BOX_H = BOX HEIGHT IN BITS ;AN000;
+; ;AN000;
+; OUTPUT: PRT_BUF = THE PRINT BUFFER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: The print buffer is first shifted left in order to make ;AN000;
+; room for the new box (Note: the MSB's are lost; they are assumed to ;AN000;
+; have been printed), then the box is inserted in the low-order bits of ;AN000;
+; the printer buffer. ;AN000;
+; ;AN000;
+PAGE ;AN000;
+; EXAMPLE ;AN000;
+; ------- ;AN000;
+; BEFORE: AFTER: ;AN000;
+; ;AN000;
+; BOX: 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; 0 0 0 ;AN000;
+; b1 b2 b3 ;AN000;
+; b4 b5 b6 ;AN000;
+; ;AN000;
+; PRT_BUF: byte1 byte2 byte3 PRT_BUF: byte1 byte2 byte3 ;AN000;
+; 0 1 0 1 1 1 ;AN000;
+; 1 0 1 1 1 1 ;AN000;
+; 1 1 1 1 1 1 ;AN000;
+; 1 1 1 1 1 1 ;AN000;
+; 1 1 1 1 1 1 ;AN000;
+; 1 1 1 1 1 1 ;AN000;
+; 1 1 1 b1 b2 b3 ;AN000;
+; LSB --> 1 1 1 b4 b5 b6 ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; FOR each byte of the buffer (BOX_W) ;AN000;
+; BEGIN ;AN000;
+; Make room for the box to be inserted ;AN000;
+; Insert the box ;AN000;
+; END ;AN000;
+; ;AN000;
+STORE_BOX PROC NEAR ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+ MOV DI,OFFSET PRT_BUF ; DI := Offset of the Print buffer ;AN000;
+ XOR BX,BX ; BX := Byte index number ;AN000;
+
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Added the following modification to support printers with
+; vertical print heads, such as HP PCL printers. The code
+; as is does not work for these printers because the data
+; is being stored in the print buffer with the assumption
+; that the print head is vertical.
+;
+ .IF <DS:[BP].DATA_TYPE EQ DATA_ROW>
+ PUSH AX ;
+ PUSH DX ;
+ PUSH BP ;
+ MOV CL,BOX_W ; Make room for the bits to be inserted.
+ SHL BYTE PTR [BX][DI],CL ;
+ MOV CL,DS:[BP].ROW_TO_EXTRACT ; CL determines which row we're extracting
+ XOR BP,BP ; Point to first column.
+ XOR DX,DX ; Clear counter
+ XOR AX,AX ; Clear register
+ ;
+EXTRACT_NEXT_BIT: ;
+ ;
+ SHL AH,1 ; Make room for next bit
+ MOV AL,DS:[SI][BP] ; Read column
+ SHR AL,CL ; Get bit from row we're extracting
+ AND AL,1 ; Isolate bit we got from row we're extracting
+ OR AH,AL ; Place it in AH
+ INC BP ; Advance to next column
+ INC DL ; Inc. counter
+ CMP DL,BOX_W ; Check if have more bits to extract from the row
+ JL EXTRACT_NEXT_BIT; We do
+ OR DS:[DI][BX],AH ; We don't so place the row we extracted in the
+ ; print buffer.
+ POP BP ;
+ POP DX ;
+ POP AX ;
+ .ELSE ;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+ ;AN000;
+ MOV CL,BOX_H ; CL := Number of BITS to be shifted ;AN000;
+; FOR each column (byte) of the box to be stored in the buffer: ;AN000;
+STORE_1_BYTE: ;AN000;
+ SHL BYTE PTR [BX][DI],CL ; Make room for the bits to be inserted ;AN000;
+ MOV CH,[BX][SI] ; CH := column of the box to be inserted;AN000;
+ OR [BX][DI],CH ; Insert the box column in the buffer ;AN000;
+ INC BL ; Get next column (byte) of the box ;AN000;
+ CMP BL,BOX_W ; All columns (bytes) of box stored ? ;AN000;
+ JL STORE_1_BYTE ; No, store next one. ;AN000;
+ .ENDIF ; ~~mda(001) Close the IF stmt ;AN000;
+STORE_BOX_END: ;AN000;
+ POP DI ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ RET ;AN000;
+STORE_BOX ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PRINT_BUFFER : PRINT THE BUFFER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: PRT_BUF = BYTES TO BE PRINTED ;AN000;
+; BOW_W = BOX WIDTH ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Prints BOX_W bytes. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; DO for each column in one pattern ;AN000;
+; BEGIN ;AN000;
+; Print one byte from the buffer ;AN000;
+; END ;AN000;
+; ;AN000;
+PRINT_BUFFER PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+ MOV BX,OFFSET PRT_BUF ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; If DATA_TYPE = DATA_ROW then the most we store in the print
+; buffer at one time is one byte.
+.IF <DS:[BP].DATA_TYPE EQ DATA_ROW> ;
+ MOV AL,[BX] ; Print one byte
+ CALL PRINT_BYTE ;
+ JC PRINT_BUFFER_END ; If printer error, quit the loop
+.ELSE
+; /\ ~~mda(001) -----------------------------------------------------------------------
+ XOR CX,CX ;AN000;
+ MOV CL,BOX_W ;AN000;
+PRINT_1_BUF_COLUMN: ;AN000;
+ MOV AL,[BX] ; Print one byte ;AN000;
+ CALL PRINT_BYTE ;AN000;
+ JC PRINT_BUFFER_END; If printer error, quit the loop ;AN000;
+ INC BX ; Get next byte ;AN000;
+ LOOP PRINT_1_BUF_COLUMN ;AN000;
+.ENDIF ;~~mda(001) close IF stmt
+PRINT_BUFFER_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+PRINT_BUFFER ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; GET_SCREEN_INFO : GET INFORMATION ABOUT HOW TO READ THE SCREEN. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: SCREEN_HEIGHT = Number of pixel rows on the screen ;AN000;
+; SCREEN_WIDTH = Number of pixel columns on screen ;AN000;
+; CUR_MODE_PTR = Offset of the current DISPLAYMODE info rec. ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; SCAN_LINE_MAX_LENGTH = Maximum length of Screen scan line. ;AN000;
+; NB_SCAN_LINES = Number of SCAN LINES on the screen ;AN000;
+; CUR_ROW,CUR_COLUMN = Coordinates of the first pixel to be ;AN000;
+; read on the screen ;AN000;
+; NB_BOXES_PER_PRT_BUF = Number of boxes fitting in the Print ;AN000;
+; buffer ;AN000;
+; ;AN000;
+; CALLED BY: PRINT_COLOR ;AN000;
+; PRT_BW_APA ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: ;AN000;
+; ;AN000;
+; 1) Determine where to start reading the screen. ;AN000;
+; For non-rotated printing, it should start with the top-left ;AN000;
+; corner pixel. ;AN000;
+; For rotated printing, it should start with the low-left corner ;AN000;
+; pixel. ;AN000;
+; ;AN000;
+; 2) Determine the length of a scan line. ;AN000;
+; For non-rotated printing, it is the WIDTH of the screen. ;AN000;
+; For rotated printing, it is the HEIGHT of the screen. ;AN000;
+; ;AN000;
+; 3) Determine the number of scan lines on the screen. ;AN000;
+; For non-rotated printing, it is the HEIGHT of the screen divided ;AN000;
+; by the number of boxes fitting in the print buffer. ;AN000;
+; For rotated printing, it is the WIDTH of the screen divided by ;AN000;
+; the number of boxes fitting in the print buffer. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; CUR_COLUMN := 0 ;AN000;
+; IF printing is sideways ;AN000;
+; THEN ;AN000;
+; CUR_ROW := SCREEN_HEIGHT - 1 ; Low-left pixel ;AN000;
+; SCAN_LINE_MAX_LENGTH := SCREEN_HEIGHT ;AN000;
+; NB_SCAN_LINES := SCREEN_WIDTH / NB_BOXES_PER_PRT_BUF ;AN000;
+; ELSE ;AN000;
+; CUR_ROW := 0 ; Top-left pixel ;AN000;
+; SCAN_LINE_MAX_LENGTH := SCREEN_WIDTH ;AN000;
+; NB_SCAN_LINES := SCREEN_HEIGHT / NB_BOXES_PER_PRT_BUF ;AN000;
+; ;AN000;
+; ;AN000;
+GET_SCREEN_INFO PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ; Used for DIV ;AN000;
+ PUSH DX ; Used for DIV ;AN000;
+ ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Offset DISPLAYMODE info record ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Calculate how many printer boxes fit in the print buffer: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; The NB_BOXES_PER_PRT_BUF depends on if the printer head is
+; vertical, as in IBM's case, or if it's horizontal, as in
+; HP's case. If DATA_TYPE is DATA_COL, then we have a vertical
+; print head. If DATA_TYPE is DATA_ROW, then we have a
+; horizontal print head.
+ .IF <DS:[BP].DATA_TYPE EQ DATA_ROW> ; Print head is horizontal
+ MOV AX,8 ; Num := 8 bits / Box width
+ MOV DL,[BX].BOX_WIDTH ;
+ DIV DL ;
+ MOV NB_BOXES_PER_PRT_BUF,AL ;
+ .ELSE ;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+ MOV AX,8 ; Num := 8 bits / Box heigth ;AN000;
+ MOV DL,[BX].BOX_HEIGHT ;AN000;
+ DIV DL ;AN000;
+ MOV NB_BOXES_PER_PRT_BUF,AL ;AN000;
+ .ENDIF ; ~~mda(001) Close IF stmt.
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Determine where to start reading the screen: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV CUR_COLUMN,0 ; Reading always start from left of scr ;AN000;
+.IF <[BX].PRINT_OPTIONS EQ ROTATE> ;AN000;
+.THEN ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Printing is sideways; screen must be read starting in low-left corner. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV AX,SCREEN_HEIGHT ;AN000;
+ MOV SCAN_LINE_MAX_LENGTH,AX ; Scan line length := screen height ;AN000;
+ DEC AX ;AN000;
+ MOV CUR_ROW,AX ; First row := screen height - 1 ;AN000;
+ ;AN000;
+;-------Calculate the number of scan lines: ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; The NB_SCAN_LINES depends on if the printer head is
+; vertical, as in IBM's case, or if it's horizontal, as in
+; HP's case. If the printer head is horizontal, then we can't
+; make use of the concept of scan lines. However, we can still
+; use the symbol NB_SCAN_LINES by just stuffing into it the
+; screen width.
+;
+ .IF <DS:[BP].DATA_TYPE EQ DATA_ROW> ; Print head is horizontal
+ MOV AX,SCREEN_WIDTH ; DX AX = Screen width
+ CWD ;
+ MOV NB_SCAN_LINES,AX;
+ .ELSE
+; /\ ~~mda(001) -----------------------------------------------------------------------
+ MOV AX,SCREEN_WIDTH ; DX AX = Screen width ;AN000;
+ CWD ; ;AN000;
+ XOR BX,BX ; BX = Number of boxes per print buf ;AN000;
+ MOV BL,NB_BOXES_PER_PRT_BUF ; ;AN000;
+ DIV BX ; Screen width / number boxes per buff ;AN000;
+ MOV NB_SCAN_LINES,AX ; Number of scan lines := result ;AN000;
+ .ENDIF ; ~~mda(001) Close IF stmt.
+
+.ELSE ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Printing is not sideways; screen must be read starting in top-left corner ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV AX,SCREEN_WIDTH ;AN000;
+ MOV SCAN_LINE_MAX_LENGTH,AX ; Scan line length := screen width ;AN000;
+ MOV CUR_ROW,0 ; First row := 0 ;AN000;
+ ;AN000;
+;-------Calculate the number of scan lines: ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; The NB_SCAN_LINES depends on if the printer head is
+; vertical, as in IBM's case, or if it's horizontal, as in
+; HP's case. If the printer head is horizontal, then we can't
+; make use of the concept of scan lines. However, we can still
+; use the symbol NB_SCAN_LINES by just stuffing into it the
+; screen height.
+;
+ .IF <DS:[BP].DATA_TYPE EQ DATA_ROW> ; Print head is vertical
+ MOV AX,SCREEN_HEIGHT; DX AX = Screen height
+ CWD ;
+ MOV NB_SCAN_LINES,AX;
+ .ELSE
+; /\ ~~mda(001) -----------------------------------------------------------------------
+
+ MOV AX,SCREEN_HEIGHT ; DX AX = Screen height ;AN000;
+ CWD ; ;AN000;
+ XOR BX,BX ; BX = Number of boxes per print buff ;AN000;
+ MOV BL,NB_BOXES_PER_PRT_BUF ; ;AN000;
+ DIV BX ; Screen height/number boxes per buff. ;AN000;
+ MOV NB_SCAN_LINES,AX ; Number of scan lines := result ;AN000;
+ .ENDIF ; ~~mda(001) Close IF stmt.
+
+.ENDIF ;AN000;
+ POP DX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+GET_SCREEN_INFO ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; DET_CUR_SCAN_LNE_LENGTH : Determine where is the last non-blank "scan line ;AN000;
+; column" on the current scan line. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_ROW, ;AN000;
+; CUR_COLUMN = Coordinates of the top pixel of the current ;AN000;
+; scan line. ;AN000;
+; XLT_TAB = Color translation table ;AN000;
+; ;AN000;
+; OUTPUT: CUR_SCAN_LNE_LENGTH = Number of "columns" of pixels from the ;AN000;
+; beginning of the scan line up to ;AN000;
+; the last non-blank pixel. ;AN000;
+; ;AN000;
+; DATA SCREEN_WIDTH, ;AN000;
+; REFERENCED: SCREEN_HEIGHT = Dimensions of the screen in pels ;AN000;
+; SCAN_LINE_MAX_LENGTH= Maximum length of the scan line ;AN000;
+; ROTATE_SW = ON if printing is sideways ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Determine where is the last non-blank "column" by reading ;AN000;
+; the scan line backwards, one column at a time. ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; ; Obtain coordinates for the top pixel of the last column on the current ;AN000;
+; ; scan line: ;AN000;
+; IF printing is sideways ;AN000;
+; THEN ;AN000;
+; CUR_ROW := 0 ;AN000;
+; ELSE ;AN000;
+; CUR_COLUMN := SCREEN_WIDTH - 1 ;AN000;
+; ;AN000;
+; CUR_SCAN_LNE_LENGTH := SCAN_LINE_MAX_LENGTH ;AN000;
+; ; Read a column of pixels on the scan line until a non-blank is found: ;AN000;
+; For each column on the screen ;AN000;
+; CALL FILL_BUFF ;AN000;
+; ; Check if PRT_BUF is empty ;AN000;
+; IF buffer is empty ;AN000;
+; THEN DEC CUR_SCAN_LNE_LENGTH ;AN000;
+; ; Get next column ;AN000;
+; IF printing sideways THEN DEC CUR_ROW ;AN000;
+; ELSE DEC CUR_COLUMN ;AN000;
+; ELSE quit the loop ;AN000;
+; ;AN000;
+DET_CUR_SCAN_LNE_LENGTH PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ PUSH CUR_COLUMN ;AN000;
+ PUSH CUR_ROW ;AN000;
+ ;AN000;
+ MOV BX,OFFSET XLT_TAB ; BX := Offset of XLT_TAB ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Obtain coordinates of the top pixel for the last column of the current ;AN000;
+; scan line: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; then, ;AN000;
+ MOV CUR_ROW,0 ; CUR_ROW := 0 ;AN000;
+ .ELSE ; else, ;AN000;
+ MOV CX,SCREEN_WIDTH ; CUR_COLUMN := SCREEN_WIDTH - 1 ;AN000;
+ DEC CX ; ;AN000;
+ MOV CUR_COLUMN,CX ; ;AN000;
+ .ENDIF ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Read the scan line backwards "column" by "column" until a non-blank is found: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV CX,SCAN_LINE_MAX_LENGTH ; CX := current length ;AN000;
+; ;AN000;
+;-------For each "column" ;AN000;
+CHECK_1_COLUMN: ;AN000;
+ MOV SI,CUR_ROW ; Save coordinates of the column ;AN000;
+ MOV DI,CUR_COLUMN ; in SI, DI ;AN000;
+ XOR DL,DL ; DL := Number of pixels verified in ;AN000;
+ ; one "column" ;AN000;
+; ;AN000;
+;-------For each pixel within that "column" ;AN000;
+CHECK_1_PIXEL: ;AN000;
+ CALL READ_DOT ; AL := Index into translation table ;AN000;
+ XLAT XLT_TAB ; AL := Band mask or Intensity ;AN000;
+ ;AN000;
+;-------Check if pixel will map to an empty box: ;AN000;
+ .IF <DS:[BP].PRINTER_TYPE EQ BLACK_WHITE> ; If BLACK AND WHITE printer ;AN000;
+ .THEN ; then, check for intensity of white ;AN000;
+ CMP AL,WHITE_INT ; If curent pixel not blank ;AN000;
+ JNE DET_LENGTH_END ; THEN, LEAVE THE LOOP ;AN000;
+ .ELSE ; else, COLOR printer ;AN000;
+ OR AL,AL ; IF Band mask not blank ;AN000;
+ JNZ DET_LENGTH_END ; THEN, LEAVE THE LOOP ;AN000;
+ .ENDIF ;AN000;
+ ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Only if DATA_TYPE is DATA_COL do we have "columns",
+; so skip this section otherwise.
+ .IF <DS:[BP].DATA_TYPE EQ DATA_COL> ; Print head is vertical
+; /\ ~~mda(001) -----------------------------------------------------------------------
+;-------All pixels so far on this "column" are blank, get next pixel: ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; ;AN000;
+ INC CUR_COLUMN ; then, increment column number ;AN000;
+ .ELSE ; ;AN000;
+ INC CUR_ROW ; else, increment row number ;AN000;
+ .ENDIF ; ;AN000;
+ INC DL ; One more pixel checked ;AN000;
+ CMP DL,NB_BOXES_PER_PRT_BUF ; All pixels for that column done ? ;AN000;
+ JL CHECK_1_PIXEL ; No, check next one. ;AN000;
+ .ENDIF ;~~mda(001) Close IF stmt.
+ ;AN000;
+;-------Nothing to print for this column, get next column ;AN000;
+ .IF <ROTATE_SW EQ ON> ; If printing sideways ;AN000;
+ .THEN ; then, ;AN000;
+ MOV CUR_COLUMN,DI ; Restore column number ;AN000;
+ INC CUR_ROW ; Get next row ;AN000;
+ .ELSE ; else, ;AN000;
+ MOV CUR_ROW,SI ; Restore row number ;AN000;
+ DEC CUR_COLUMN ; Get next column ;AN000;
+ .ENDIF ; ;AN000;
+ LOOP CHECK_1_COLUMN ; CX (length) := CX - 1 ;AN000;
+ ;AN000;
+DET_LENGTH_END: ;AN000;
+ MOV CUR_SCAN_LNE_LENGTH,CX ; Get current length ;AN000;
+ ;AN000;
+ POP CUR_ROW ;AN000;
+ POP CUR_COLUMN ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+DET_CUR_SCAN_LNE_LENGTH ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; SETUP_PRT : SET UP THE PRINTER FOR PRINTING IN GRAPHIC MODE ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information ;AN000;
+; record for the current mode ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+; CALLED BY: PRINT_COLOR ;AN000;
+; PRT_BW_APA ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Extract the SETUP escape sequence from the DISPLAYMODE ;AN000;
+; information record; Send this escape sequence to the printer. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; Number of bytes to print := CUR_MODE_PTR.NUM_SETUP_ESC ;AN000;
+; ;AN000;
+; Get the escape sequence: ;AN000;
+; SI := CUR_MODE_PTR.SETUP_ESC_PTR ;AN000;
+; ;AN000;
+; FOR each byte to be printed ;AN000;
+; PRINT_BYTE [SI] ; Send the byte to the printer ;AN000;
+; INC SI ; Get the next byte ;AN000;
+; ;AN000;
+SETUP_PRT PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Displaymode info record. ;AN000;
+ ;AN000;
+ XOR CX,CX ; CX := Number of bytes to print ;AN000;
+ MOV CL,[BX].NUM_SETUP_ESC ; ;AN000;
+.IF <CL G 0> ; If there is at least one ;AN000;
+.THEN ; byte to be printed: ;AN000;
+ MOV BX,[BX].SETUP_ESC_PTR ; BX := Offset sequence to send ;AN000;
+ ADD BX,BP ;AN000;
+ ;AN000;
+SEND_1_SETUP_BYTE: ;AN000;
+ MOV AL,[BX] ; AL := byte to print ;AN000;
+ CALL PRINT_BYTE ; Send it to the printer ;AN000;
+ JC SETUP_PRT_END ; If printer error, quit the loop ;AN000;
+ INC BX ; Get next byte ;AN000;
+ LOOP SEND_1_SETUP_BYTE ;AN000;
+.ENDIF ;AN000;
+SETUP_PRT_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+SETUP_PRT ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; RESTORE_PRT : RESTORE THE PRINTER TO ITS INITIAL STATUS ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information ;AN000;
+; record for the current mode ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+; CALLED BY: PRINT_COLOR ;AN000;
+; PRT_BW_APA ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Extract the RESTORE escape sequence from the DISPLAYMODE ;AN000;
+; information record; Send this escape sequence to the printer. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; Number of bytes to print := CUR_MODE_PTR.NUM_RESTORE_ESC ;AN000;
+; ;AN000;
+; Get the escape sequence: ;AN000;
+; SI := CUR_MODE_PTR.RESTORE_ESC_PTR ;AN000;
+; FOR each byte to be printed ;AN000;
+; PRINT_BYTE [SI] ; Send the byte to the printer ;AN000;
+; INC SI ; Get the next byte ;AN000;
+; ;AN000;
+RESTORE_PRT PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Displaymode info record. ;AN000;
+ ;AN000;
+ XOR CX,CX ; CX := Number of bytes to print ;AN000;
+ MOV CL,[BX].NUM_RESTORE_ESC ;AN000;
+.IF <CL G 0> ; If there is at least one ;AN000;
+.THEN ; byte to be printed: ;AN000;
+ MOV BX,[BX].RESTORE_ESC_PTR ; BX := Offset sequence to send ;AN000;
+ ADD BX,BP ;AN000;
+ ;AN000;
+SEND_1_RESTORE_BYTE: ;AN000;
+ MOV AL,[BX] ; AL := byte to print ;AN000;
+ CALL PRINT_BYTE ; Send it to the printer ;AN000;
+ JC RESTORE_PRT_END ; If printer error, quit the loop ;AN000;
+ INC BX ; Get next byte ;AN000;
+ LOOP SEND_1_RESTORE_BYTE ;AN000;
+.ENDIF ;AN000;
+RESTORE_PRT_END: ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+RESTORE_PRT ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; NEW_PRT_LINE : INITIALIZE THE PRINTER FOR A GRAPHIC LINE ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information ;AN000;
+; record for the current mode ;AN000;
+; CUR_SCAN_LNE_LENGTH = Number of bytes to send to the printer. ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ;AN000;
+; CALLED BY: PRINT_BAND ;AN000;
+; PRT_BW_APA ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Extract the GRAPHICS escape sequence from the DISPLAYMODE ;AN000;
+; information record; Send this escape sequence to the printer. ;AN000;
+; Then, send the number of bytes that will follow. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; Number of bytes to print := CUR_MODE_PTR.NUM_GRAPHICS_ESC ;AN000;
+; ;AN000;
+; Get the escape sequence: ;AN000;
+; Set up the 2 bytes containing the number of bytes to send in this sequence. ;AN000;
+; SI := CUR_MODE_PTR.GRAPHICS_ESC_PTR ;AN000;
+; ;AN000;
+; FOR each byte to be printed ;AN000;
+; PRINT_BYTE [SI] ; Send the byte to the printer ;AN000;
+; INC SI ; Get the next byte ;AN000;
+; ;AN000;
+; Send the byte count ;AN000;
+; ;AN000;
+ ;AN000;
+NEW_PRT_LINE PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+ MOV BX,CUR_MODE_PTR ; BX := Displaymode info record. ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set up the 2 bytes containing the number of bytes to send in the GRAPHICS seq.;AN000;
+; NOTE: number of bytes to send is "CUR_SCAN_LNE_LENGTH * BOX_W" ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV AL,BOX_W ; cur_scan_lne_length * ;AN000;
+ CBW ; printer box width = nb bytes to send;AN000;
+ MUL CUR_SCAN_LNE_LENGTH ; (result in DX AX) ;AN000;
+;-------AX := Number of bytes to print ;AN000;
+
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Since we have added the key words DATA and COUNT to the
+; list of allowable words for the GRAPHICS statement
+; we have to take into consideration if the esc. sequence
+; numbers come before of after the word DATA. Also we have
+; to take into consideration if the printer is expecting
+; to receive the COUNT in binary form or in ASCII form.
+; Note this section of code replaces the section of code
+; which follows it.
+ MOV DI,[BX].GRAPHICS_ESC_PTR ; DI := offset seq. to send
+ XOR CX,CX ; CX := Length of the escape seq
+ MOV CL,[BX].NUM_GRAPHICS_ESC ; before the word DATA
+
+ .WHILE <CX NE 0> ; Doing while loop just in case DATA is the
+ ; first word after GRAPHICS. In that case
+ ; skip this and send the actual data.
+ MOV BL,BYTE PTR DS:[BP+DI] ; Get code.
+ ;
+ .SELECT ; Case statement
+ .WHEN <BL EQ ESC_NUM_CODE> ; We have an esc. number
+ PUSH AX ; Save count
+ INC DI ; Point to esc. number
+ MOV AL,DS:[BP+DI] ;
+ CALL PRINT_BYTE ; Send esc. number
+ JC NEW_PRT_LINE_ENDP_1 ; If printer error then quit
+ ; the loop and restore registers
+ INC DI ; Point to next tag
+ POP AX ; Restore the count
+ DEC CX ;
+ .WHEN <BL EQ COUNT_CODE> ; Need to send count in ascii form
+ PUSH AX ; Save count
+ PUSH SI ;
+ CALL GET_COUNT ; Get # bytes to send to printer
+ PUSH CX ; Save counter for outside loop
+ XOR CH,CH ;
+ MOV CL,DS:[BP].NUM_BYTES_FOR_COUNT ;
+ LEA SI,DS:[BP].COUNT ; Get ptr. to count
+ SUB SI,CX ; Need to send MSB first
+ INC SI ;
+ CLD ;
+SEND_ASCII_COUNT: ;
+ LODSB ;
+ CALL PRINT_BYTE ; Print it
+ JC NEW_PRT_LINE_ENDP_2 ; If printer error then quit
+ ; the loop and restore registers
+ LOOP SEND_ASCII_COUNT ;
+ POP CX ; Restore outside loop counter
+ ADD DI,2 ; Point to next tag
+ POP SI ;
+ POP AX ; Restore COUNT
+ DEC CX ;
+ .WHEN <BL EQ LOWCOUNT_CODE> ; Sending lowbyte of COUNT
+ CALL PRINT_BYTE ; Print it
+ JC NEW_PRT_LINE_ENDP ; If printer error then quit
+ ADD DI,2 ; Point to next tag
+ DEC CX ;
+ .WHEN <BL EQ HIGHCOUNT_CODE> ; Sending highbyte of COUNT
+ PUSH AX ; Save count
+ CWD ;
+ MOV BX,100h ;
+ DIV BX ; Put highbyte in AL
+ CALL PRINT_BYTE ; Print it
+ JC NEW_PRT_LINE_ENDP_1 ; If printer error then quit
+ ; the loop and restore registers
+ ADD DI,2 ; Point to next tag
+ ; the loop.
+ POP AX ; Restore count
+ DEC CX ;
+ .ENDSELECT ;
+ .ENDWHILE ;
+ ADD DI,2 ; Skip over DATA tag and byte
+ ; so pointing to correct place when
+ ; get to END_PRT_LINE proc.
+; /\ ~~mda(001) -----------------------------------------------------------------------
+
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; The following piece of code is replaced by the above piece
+; of code.
+;
+;;;; MOV DI,[BX].LOW_BYT_COUNT_PTR; DI := Offset of LOW byte of ;AN000;
+;;;; ADD DI,BP ; byte count ;AN000;
+;;;; MOV [DI],AL ; Store low byte ;AN000;
+;;;; MOV DI,[BX].HGH_BYT_COUNT_PTR; DI := Offset of HIGH byte of ;AN000;
+;;;; ADD DI,BP ; byte count ;AN000;
+;;;; MOV [DI],AH ; Store high byte ;AN000;
+;;;; ;AN000;
+;;;;;-------------------------------------------------------------------------------;AN000;
+;;;;; Send the GRAPHICS escape sequence to the printer: ;AN000;
+;;;;;-------------------------------------------------------------------------------;AN000;
+;;;; XOR CX,CX ; CX := Length of the escape seq;AN000;
+;;;; MOV CL,[BX].NUM_GRAPHICS_ESC ;AN000;
+;;;; MOV BX,[BX].GRAPHICS_ESC_PTR ; BX := Offset sequence to send ;AN000;
+;;;; ADD BX,BP ;AN000;
+;;;; ;AN000;
+;;;;SEND_1_GRAPHICS_BYTE: ;AN000;
+;;;; MOV AL,[BX] ; AL := byte to print ;AN000;
+;;;; CALL PRINT_BYTE ; Send it to the printer ;AN000;
+;;;; JC NEW_PRT_LINE_ENDP ; If printer error, quit the loop ;AN000;
+;;;; INC BX ; Get next byte ;AN000;
+;;;; LOOP SEND_1_GRAPHICS_BYTE ;AN000;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+JMP SHORT NEW_PRT_LINE_ENDP ; ~~mda(001) Restore registers
+ JMP SHORT NEW_PRT_LINE_ENDP ;
+NEW_PRT_LINE_ENDP_2: ; ~~mda(001)
+ POP SI
+NEW_PRT_LINE_ENDP_1: ; ~~mda(001)
+ POP AX
+NEW_PRT_LINE_ENDP: ;AN000;
+ POP DI ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+NEW_PRT_LINE ENDP ;AN000;
+PAGE ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Since we have the keyword DATA, and we allow it to be anywhere
+; on the GRAPHICS line, then it is possible to have an
+; esc. sequence to send to the printer after the data has been
+; sent. Therefore we need this new procedure.
+;===============================================================================
+;
+; END_PRT_LINE : SEND THE REST OF THE GRAPHICS LINE
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: CUR_MODE_PTR = Offset of the DISPLAYMODE information
+; record for the current mode
+; DI = Points to the section of the esc. seq that
+; comes after the keyword DATA.
+;
+; OUTPUT: PRINTER
+;
+; CALLED BY: PRT_BW_APA
+;
+;-------------------------------------------------------------------------------
+;
+; DESCRIPTION: Extract the GRAPHICS escape sequence that comes after the keyword
+; DATA from the DISPLAYMODE information record; Send this escape sequence to the
+; printer.
+;
+;
+
+CR_FOUND DB ? ; So we know if a carriage return has been sent
+LF_FOUND DB ? ; So we know if a line feed has been sent
+
+END_PRT_LINE PROC NEAR
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH DI
+
+ MOV CR_FOUND,NO ; Initialize
+ MOV LF_FOUND,NO ;
+ MOV BX,CUR_MODE_PTR ; BX := Displaymode info record.
+
+;-------------------------------------------------------------------------------
+; Set up the 2 bytes containing the number of bytes to send in the GRAPHICS seq.
+; NOTE: number of bytes to send is "CUR_SCAN_LNE_LENGTH * BOX_W"
+;-------------------------------------------------------------------------------
+ MOV AL,BOX_W ; cur_scan_lne_length *
+ CBW ; printer box width = nb bytes to send
+ MUL CUR_SCAN_LNE_LENGTH ; (result in DX AX)
+;-------AX := Number of bytes to print
+
+ XOR CX,CX ; CX := Length of the escape seq
+ MOV CL,[BX].NUM_GRAPHICS_ESC_AFTER_DATA ;after the word DATA
+
+
+ .WHILE <CX NE 0> ; Doing a while loop just in case DATA is the
+ ; last word on the GRAPHICS line. In that case
+ ; skip this and send a CR or LF if needed.
+ MOV BL,BYTE PTR DS:[BP+DI] ; Get code.
+
+ .SELECT ; Case statement
+ .WHEN <BL EQ ESC_NUM_CODE> ; We have an esc. number
+ PUSH AX ; Save count
+ INC DI ; Point to esc. number
+ MOV AL,DS:[BP+DI] ;
+ .IF <AL EQ CR> ; Check if a CR is
+ MOV CR_FOUND,YES ; explicitly stated
+ .ENDIF
+ .IF <AL EQ LF> ; Check if a LF is
+ MOV LF_FOUND,YES ; explicitly stated
+ .ENDIF
+ CALL PRINT_BYTE ; Send esc. number
+ JC GOTO_END_PRT_LINE_ENDP_1; If printer error then quit
+ ; the loop and restore registers
+ INC DI ; Point to next tag
+ POP AX ; Restore the count
+ DEC CX ;
+ .WHEN <BL EQ COUNT_CODE> ; Need to send count in ascii form
+ PUSH AX ; Save count
+ PUSH SI ;
+ CALL GET_COUNT ; Get # of bytes to send to printer
+ PUSH CX ; Save counter for outside loop
+ XOR CH,CH ;
+ MOV CL,DS:[BP].NUM_BYTES_FOR_COUNT ;
+ LEA SI,DS:[BP].COUNT ; Get ptr. to count
+ SUB SI,CX ; Need to send MSB first
+ INC SI ;
+ CLD ;
+SEND_THE_ASCII_COUNT: ;
+ LODSB ;
+ CALL PRINT_BYTE ; Print it
+ JC GOTO_END_PRT_LINE_ENDP_2 ; If printer error then quit
+ ; the loop and restore registers.
+ LOOP SEND_THE_ASCII_COUNT ;
+ POP CX ; Restore outside loop counter
+ ADD DI,2 ; Point to next tag
+ POP SI ;
+ POP AX ; Restore COUNT
+ DEC CX ;
+ .WHEN <BL EQ LOWCOUNT_CODE> ; Sending lowbyte of COUNT
+ CALL PRINT_BYTE ; Print it
+ JC END_PRT_LINE_ENDP ; If printer error then quit
+ ADD DI,2 ; Point to next tag
+ DEC CX ;
+ .WHEN <BL EQ HIGHCOUNT_CODE> ; Sending highbyte of COUNT
+ PUSH AX ; Save count
+ CWD ;
+ MOV BX,100h ;
+ DIV BX ; Put highbyte in AL
+ CALL PRINT_BYTE ; Print it
+ JC END_PRT_LINE_ENDP_1 ; If printer error then quit
+ ; the loop and restore registers
+ ADD DI,2 ; Point to next tag
+ ; the loop.
+ POP AX ; Restore count
+ DEC CX ;
+ .ENDSELECT ;
+ .ENDWHILE ;
+ JMP SHORT CR_LF ;
+GOTO_END_PRT_LINE_ENDP_2: ; Conditional jump was out of range
+ JMP SHORT END_PRT_LINE_ENDP_2 ;
+GOTO_END_PRT_LINE_ENDP_1: ; Conditional jump was out of range
+ JMP SHORT END_PRT_LINE_ENDP_1 ;
+CR_LF: ;
+ .IF <DS:[BP].PRINTER_NEEDS_CR_LF EQ YES> ; ~~mda(003) We have an IBM type printer
+ ; so we need to do a CR and LF if it
+ ; already hasn't been done.
+ .IF <CR_FOUND EQ NO> ; It hasn't been done.
+ MOV AL,CR ;
+ CALL PRINT_BYTE ;
+ JC END_PRT_LINE_ENDP ; If printer error then quit
+ .ENDIF ;
+ .IF <LF_FOUND EQ NO> ; It hasn't been done.
+ MOV AL,LF ;
+ CALL PRINT_BYTE ;
+ JC END_PRT_LINE_ENDP ; If printer error then quit
+ .ENDIF ;
+ ;
+ .ENDIF ;
+JMP NEW_PRT_LINE_ENDP ; Restore registers
+ JMP SHORT END_PRT_LINE_ENDP ;
+END_PRT_LINE_ENDP_2: ; Restore registers
+ POP SI ;
+END_PRT_LINE_ENDP_1: ; Restore registers
+ POP AX ;
+END_PRT_LINE_ENDP: ;
+ POP DI ;
+ POP DX ;
+ POP CX ;
+ POP BX ;
+ POP AX ;
+ RET ;
+END_PRT_LINE ENDP ;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+PAGE ;AN000;
+; \/ ~~mda(001) -----------------------------------------------------------------------
+; Since we now can do HP PCL, we have to get the number of
+; bytes that are going to be sent to the printer and convert
+; the number to ASCII if DATA_TYPE = DATA_ROW.
+;===============================================================================;AN000;
+; ;AN000;
+; GET_COUNT : GET THE NUMBER OF BYTES TO SEND TO THE PRINTER
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_SCAN_LNE_LENGTH
+; NB_BOXES_PER_PRT_BUF ;AN000;
+; ;AN000;
+; output : si pointer to ascii string
+;
+; si --> len=4 (hex = 4d2h)
+; 1
+; 2
+; 3
+; 4
+;
+; count (from shared_data_area)
+;
+; ;AN000;
+; CALLED BY: NEW_PRT_LINE
+; END_PRT_LINE
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_COUNT proc near
+ push ax ;
+ push bx ;
+ push cx ;
+ push dx ;
+ push si ;
+
+ mov ax,cur_scan_lne_length ; Get # bytes to send to
+ cwd ; the printer
+ xor bh,bh ;
+ mov bl,nb_boxes_per_prt_buf ;
+ div bx ;
+ .IF <DX NE 0> ; So don't lose data when
+ INC AX ; have a remainder.
+ .ENDIF ;
+
+ ;
+;--------- AX is the # bytes to send to the printer. Now convert it to ascii.
+ ;
+ xor dx,dx ;clear upper 16 bits
+ lea si,ds:[bp].count ;get pointer
+ PUSH SI ; Save ptr.
+ MOV CX,5 ; Init. COUNT
+INIT_COUNT: ;
+ MOV BYTE PTR [SI],0 ;
+ DEC SI ;
+ LOOP INIT_COUNT ;
+ POP SI ;
+ ;
+ mov bx,10 ; mod 10, div 10
+ xor cx,cx ;length counter = 0
+hx_asc: ;
+ div bx ;div, mod
+ add dl,'0' ;add 48 for ASCII
+ mov [si],dl ;store it
+ dec si ;point to next string element
+ inc cx ;inc length counter
+ xor dx,dx ;consider only div part for next loop
+ cmp ax,0 ;end of loops ? (div=0)
+ jnz hx_asc ;no
+ mov ds:[bp].num_bytes_for_count,cl ;save the length
+ ;
+ pop si ;
+ pop dx ;
+ pop cx ;
+ pop bx ;
+ pop ax ;
+ ret ;
+GET_COUNT endp ;
+; /\ ~~mda(001) -----------------------------------------------------------------------
+PAGE
+;
+;===============================================================================;AN000;
+; ;AN000;
+; PRINT_BYTE : SEND A BYTE TO THE PRINTER AT LPT1 ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: AL = Byte to be printed ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER ;AN000;
+; ERROR_CODE = PRINTER_ERROR if an error is detected. ;AN000;
+; Carry flag is set in case of error. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PRINT_BYTE PROC NEAR ;AN000;
+ PUSH AX ;AN000;
+ PUSH DX ;AN000;
+ ;AN000;
+ MOV DX,0000 ; PRINTER NUMBER ;AN000;
+ MOV AH,00 ; REQUEST PRINT ;AN000;
+ INT 17H ; CALL BIOS : SEND THE CHARACTER ;AN000;
+ ;AN000;
+ AND AH,00101001B ; Test error code returned in AH for ;AN000;
+ ; "Out of paper", "I/O error" and "Time-out". ;AN000;
+ JNZ PRINT_BYTE_ERROR; Set the error code if error ;AN000;
+ JMP SHORT PRINT_BYTE_END ; else, return normally ;AN000;
+PRINT_BYTE_ERROR: ;AN000;
+ MOV ERROR_CODE,PRINTER_ERROR ;AN000;
+ STC ; Set the carry flag to indicate ERROR ;AN000;
+PRINT_BYTE_END: ;AN000;
+ POP DX ;AN000;
+ POP AX ;AN000;
+ RET ;AN000;
+PRINT_BYTE ENDP ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; READ_DOT: READ A PIXEL - RETURN A COLOR TRANSLATION TABLE INDEX ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: CUR_MODE = Current video mode. ;AN000;
+; CUR_ROW, ;AN000;
+; CUR_COLUMN = Coordinates of the pixel to be read. ;AN000;
+; CUR_PAGE = Active page number ;AN000;
+; ;AN000;
+; OUTPUT: AL = Index into COLOR TRANSLATION TABLE. ;AN000;
+; ;AN000;
+; DEPENDENCIES : COLOR TRANSLATION TABLE entries must be bytes ;AN000;
+; ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Use VIDEO BIOS INTERRUPT 10H "READ DOT CALL". ;AN000;
+; ;AN000;
+; Depending on the video hardware, the dot returned by BIOS has ;AN000;
+; different meanings. ;AN000;
+; With an EGA it is an index into the Palette registers, ;AN000;
+; With a CGA it is a number from 0 to 3, mapping to a specific color ;AN000;
+; depending on the background color and the color palette currently ;AN000;
+; selected. ;AN000;
+; ;AN000;
+; The Color Translation table has been set up to hold the correct color ;AN000;
+; mapping for any "dot" in any mode. Therefore, the dot number returned ;AN000;
+; by INT 10H can be used with any mode as a direct index within that ;AN000;
+; table. ;AN000;
+; ;AN000;
+; With APA Monochrome mode 0FH there are 4 different dots: white, ;AN000;
+; blinking white, high-intensity white, and black. ;AN000;
+; ;AN000;
+; For mode 0FH, the dot returned by interrupt 10 "read dot" call is a byte ;AN000;
+; where only bits 0 and 2 are significant. These 2 bits must be appended ;AN000;
+; together in order to obtain a binary number (from 0 to 3) that will be used ;AN000;
+; as an index in the Color Translation table. ;AN000;
+; ;AN000;
+; For mode 11H, the dot is either 0 (for background color) or 7 (for the ;AN000;
+; foreground color) only the LSB is returned. That is, we return either ;AN000;
+; 0 or 1. ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; ;AN000;
+; Call VIDEO BIOS "READ DOT" ;AN000;
+; IF CUR_MODE = 0FH ;AN000;
+; THEN ;AN000;
+; Append bits 1 and 3. ;AN000;
+; IF CUR_MODE = 11H ;AN000;
+; THEN ;AN000;
+; Wipe out bits 1 and 2. ;AN000;
+; ;AN000;
+READ_DOT PROC NEAR ;AN000;
+ PUSH BX ; Save registers ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ ;AN000;
+ MOV BH,CUR_PAGE ;AN000;
+ MOV DX,CUR_ROW ;AN000;
+ MOV CX,CUR_COLUMN ;AN000;
+ MOV AH,READ_DOT_CALL ;AN000;
+ INT 10H ; Call BIOS: AL <-- Dot read ;AN000;
+ ;AN000;
+ CMP CUR_MODE,0FH ; Is it Mode 0fH ? ;AN000;
+ JNE MODE_11H? ; No, look for mode 11h. ;AN000;
+;-------Mode 0Fh is the current mode: ;AN000;
+;-------Convert bits 2 and 0 into a 2 bit number: ;AN000;
+ MOV BL,AL ; BL := AL = "Pixel read" ;AN000;
+ AND BL,00000100B ; Wipe off all bits but bit 2 in BL ;AN000;
+ AND AL,00000001B ; Wipe off all bits but bit 0 in AL ;AN000;
+ SHR BL,1 ; Move bit 2 to bit 1 in BL ;AN000;
+ OR AL,BL ; Append bit 1 and bit 0 ;AN000;
+ JMP SHORT READ_DOT_END ; Quit. ;AN000;
+ ;AN000;
+MODE_11H?: ;AN000;
+ CMP CUR_MODE,11H ; Is it Mode 0fH ? ;AN000;
+ JNE READ_DOT_END ; No, quit ;AN000;
+ ;AN000;
+;-------Mode 11H is the current mode: ;AN000;
+ AND AL,00000001B ; Keep only the Least significant bit ;AN000;
+ ;AN000;
+READ_DOT_END: ;AN000;
+ POP DX ; Restore registers ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ RET ;AN000;
+READ_DOT ENDP ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcommon.ext b/private/mvdm/dos/v86/cmd/graphics/grcommon.ext
new file mode 100644
index 000000000..034e98acc
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcommon.ext
@@ -0,0 +1,38 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCOMMON.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing external declarations for ;AN000;
+;; the code and data defined in GRCOMMON.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+EXTRN READ_DOT:NEAR ;AN000;
+EXTRN LOC_MODE_PRT_INFO:NEAR ;AN000;
+EXTRN STORE_BOX:NEAR ;AN000;
+EXTRN PRINT_BUFFER:NEAR ;AN000;
+EXTRN GET_SCREEN_INFO:NEAR ;AN000;
+EXTRN SETUP_PRT:NEAR ;AN000;
+EXTRN RESTORE_PRT:NEAR ;AN000;
+EXTRN NEW_PRT_LINE:NEAR ;AN000;
+EXTRN PRINT_BYTE:NEAR ;AN000;
+EXTRN DET_CUR_SCAN_LNE_LENGTH:NEAR ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcpsd.asm b/private/mvdm/dos/v86/cmd/graphics/grcpsd.asm
new file mode 100644
index 000000000..fdf1a6ddf
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcpsd.asm
@@ -0,0 +1,115 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS GRAPHICS Command - Copy Shared Data
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCPSD.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the COPY_SHARED_DATA module. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; PLACID Functional Specifications ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; COPY_SHARED_DATA - Copy the Shared Data Area from temporary ;AN000;
+;; build area to resident memory & exit to DOS ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; --------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ INCLUDE GRCTRL.EXT ;; Bring in external declarations ;AN000;
+ INCLUDE GRCTRL.STR ;; for transient command processing ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Public Symbols ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ PUBLIC COPY_SHARED_DATA ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; COPY_SHARED_DATA ;AN000;
+;; ;AN000;
+;; Input Parameters: ;AN000;
+;; DS : SI - points to the Temporary Shared Data Area ;AN000;
+;; ES : DI - destination for resident Shared Data Area ;AN000;
+;; BP - offset for new Shared Data Area (same as DI) ;AN000;
+;; AH - Function code for exiting to DOS: ;AN000;
+;; 31H : Terminate & Stay Resident - if first time ;AN000;
+;; 4CH : Terminate - if already installed ;AN000;
+;; DX - resident data segment size in paragraphs ;AN000;
+;; ;AN000;
+;; Output Parameters: ;AN000;
+;; NONE ;AN000;
+;; ;AN000;
+;; Data Structures Referenced: ;AN000;
+;; Control Variables ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Copy the Temporary Shared Data area over the installation modules ;AN000;
+;; and terminate (stay resident). The data is copied immediately ;AN000;
+;; following this module. ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; GRAPHICS_INSTALL ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; NONE ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; Copy Temporary Shared Data Area ;AN000;
+;; Set PRINT_SCREEN_ALLOWED to YES ;AN000;
+;; Exit to DOS (Function Code 31 or 4C setup by caller) ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+COPY_SHARED_DATA PROC NEAR ;; ;AN000;
+ ;; ;AN000;
+ REP MOVSB ;; Copy Shared Data from temporary ;AN000;
+ ;; build area to resident memory ;AN000;
+ ;; Allow print screens now ;AN000;
+ MOV ES:PRINT_SCREEN_ALLOWED,YES ;AN000;
+ ;; ;AN000;
+ INT 21H ;; Exit ;AN000;
+ ;; ;AN000;
+COPY_SHARED_DATA ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+CODE ENDS ;AN000;
+ END COPY_SHARED_DATA ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grcpsd.ext b/private/mvdm/dos/v86/cmd/graphics/grcpsd.ext
new file mode 100644
index 000000000..54cba041f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grcpsd.ext
@@ -0,0 +1,30 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCPSD.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRCPSD.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN COPY_SHARED_DATA:NEAR ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grctrl.asm b/private/mvdm/dos/v86/cmd/graphics/grctrl.asm
new file mode 100644
index 000000000..e171a2ac7
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grctrl.asm
@@ -0,0 +1,2230 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I fixed a MS bug. MS did not initialize the variable
+;** ROTATE_SW. Consequently, if you do a non-rotate after doing
+;** a rotate, the picture would be printed incorrectly as a
+;** rotated picture. Note this bug was in Q.01.01 and fixed for
+;** Q.01.02.
+;**
+;** NOTES: The following bug was fixed for the pre-release version
+;** Q.01.02.
+;**
+;** BUG (mda004)
+;** ------------
+;**
+;** NAME: After GRAPHICS prints a rotated picture it will print pictures
+;** which are not supposed to be rotated as rotated junk.
+;**
+;** FILES AFFECTED: GRCTRL.ASM
+;**
+;** CAUSE: MicroSoft was failing to initialize the variable ROTATE_SW to
+;** OFF. Consequently, if you printed a picture whose corresponding
+;** printbox did NOT specify a rotate after printing a picture whose
+;** corresponding printbox did specify a rotate, the picture would
+;** print as rotated junk.
+;**
+;** FIX: Initialize the variable ROTATE_SW to OFF right before going into
+;** the print procedure Print_Color or Print_BW_APA.
+;**
+;** DOCUMENTATION NOTES: This version of GRCTRL.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132
+
+ TITLE DOS GRAPHICS Command - Print screen Control module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - GRAPHICS Command
+;;
+;;
+;; File Name: GRCTRL.ASM
+;; ----------
+;;
+;; Description:
+;; ------------
+;; This file contains the code for the Print Screen control module.
+;;
+;; Documentation Reference:
+;; ------------------------
+;; OASIS High Level Design
+;; OASIS GRAPHICS I1 Overview
+;;
+;; Procedures Contained in This File:
+;; ----------------------------------
+;; PRT_SCR
+;; DET_HW_CONFIG
+;; DET_MODE_STATE
+;; GET_MODE_ATTR
+;; SET_UP_XLT_TAB
+;; SET_CGA_XLT_TAB
+;; CGA_COL2RGB
+;; RGB2XLT_TAB
+;; SET_EGA_XLT_TAB
+;; EGA_COL2RGB
+;; SET_MODE_F_XLT_TAB
+;; SET_MODE_13H_XLT_TAB
+;; SET_ROUNDUP_XLT_TAB
+;; SET_BACKG_IN_XLT_TAB
+;; RGB2BAND
+;; RGB2INT
+;;
+;;
+;; Include Files Required:
+;; -----------------------
+;; GRINST.EXT - Externals for GRINST.ASM
+;;
+;;
+;; External Procedure References:
+;; ------------------------------
+;; FROM FILE GRINST.ASM:
+;; GRAPHICS_INSTALL - Main module for installation.
+;;
+;; Linkage Instructions:
+;; --------------------
+;; Refer to GRAPHICS.ASM
+;;
+;; Change History:
+;; ---------------
+;; M001 NSM 1/30/91 New var to store the old int 10 handler
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+CODE SEGMENT PUBLIC 'CODE'
+ ASSUME CS:CODE,DS:CODE
+
+.XLIST
+INCLUDE GRINT2FH.EXT
+INCLUDE GRBWPRT.EXT
+INCLUDE GRCOLPRT.EXT
+INCLUDE GRSHAR.STR
+INCLUDE GRPATTRN.STR
+INCLUDE GRPATTRN.EXT
+INCLUDE STRUC.INC
+.LIST
+PRT_SCR PROC NEAR
+ JMP PRT_SCR_BEGIN
+PAGE
+;===============================================================================
+;
+; GRAPHICS INTERRUPT DRIVER'S DATA:
+;
+;===============================================================================
+.xlist
+PUBLIC PRT_SCR,ERROR_CODE,XLT_TAB,MODE_TYPE
+PUBLIC CUR_MODE_PTR,CUR_MODE,NB_COLORS,SCREEN_HEIGHT,SCREEN_WIDTH
+PUBLIC CUR_PAGE,CUR_COLUMN,CUR_ROW,NB_SCAN_LINES,SCAN_LINE_MAX_LENGTH
+PUBLIC CUR_SCAN_LNE_LENGTH
+PUBLIC PRT_BUF,NB_BOXES_PER_PRT_BUF,CUR_BOX,BOX_H,BOX_W
+PUBLIC PRINT_SCREEN_ALLOWED,RGB
+PUBLIC BIOS_INT_5H
+PUBLIC OLD_INT_10H ; /* M001 */
+PUBLIC ROTATE_SW
+PUBLIC DET_HW_CONFIG
+PUBLIC NB_CHAR_COLUMNS
+PUBLIC RGB2INT
+PUBLIC RGB2BAND
+.list
+INCLUDE GRCTRL.STR
+;-------------------------------------------------------------------------------
+;
+; ENTRY POINT TO BIOS HARDWARE INTERRUPT 5 HANDLER
+;
+;-------------------------------------------------------------------------------
+BIOS_INT_5H DW ? ; Pointer to BIOS int 5h
+ DW ?
+
+;/* M001 BEGIN */ --------------------------------------------------------------
+;
+; ENTRY POINT TO BIOS HARDWARE INTERRUPT 10 HANDLER
+;
+;-------------------------------------------------------------------------------
+OLD_INT_10H DW ? ; Pointer to BIOS int 10h
+ DW ?
+; /* M001 END */
+;-------------------------------------------------------------------------------
+;
+; PRINT SCREEN ERROR CODE (Used at print screen time, see GRCTRL.STR for
+; error codes allowed)
+;
+;-------------------------------------------------------------------------------
+ERROR_CODE DB 0 ; ERROR CODE 0 = NO ERROR
+
+;-------------------------------------------------------------------------------
+;
+; SCREEN PIXEL: INTERNAL REPRESENTATION
+;
+;-------------------------------------------------------------------------------
+RGB PIXEL_STR < , , > ; PIXEL := RED, GREEN, BLUE Values
+
+;-------------------------------------------------------------------------------
+;
+; COLOR TRANSLATION TABLE:
+;
+; This table is used to translate the color numbers returned by
+; Interrupt 10H Read Dot and Read Character calls into print
+; information. The table consists of 256 entries, one byte each,
+; indexed by color number.
+; In the case of black and white printing, the table
+; entries are grey scale intensities from 0 to 63. In the case
+; of color printing each table entry contains a "band mask" indicating
+; which color print bands are required to generate the required color.
+; The band masks are simply bit masks where each bit corresponds to one
+; of the printer bands.
+;
+; The table is set up at the beginning of the print screen processing,
+; before any data is read from the screen. From then on, translating
+; from screen information into print information is done quickly by
+; accessing this table. Not all 256 entries are initialized for each
+; screen print. The number of entries used is equal to the number
+; of colors available concurrently with the given display mode.
+;-------------------------------------------------------------------------------
+XLT_TAB DB 256 DUP(32) ; COLOR TRANSLATION TABLE
+ ; This table is used to translate the Color Dot
+ ; or Byte Attribute to a Band Mask for color
+ ; printing or to a Grey Intensity for Mono-
+ ; chrome printing.
+
+;-------------------------------------------------------------------------------
+;
+; CURRENT VIDEO MODE ATTRIBUTES
+;
+;-------------------------------------------------------------------------------
+MODE_TYPE DB ? ; Mode types (bit mask) APA or TXT
+
+CUR_MODE_PTR DW ? ; DISPLAYMODE INFO RECORD for the current
+ ; mode (defined in the shared data area).
+CUR_MODE DB ? ; Current video mode number
+NB_COLORS DW ? ; Number of colors supported by this mode
+SCREEN_HEIGHT DW ? ; Number of rows on the screen (chars or pixels)
+SCREEN_WIDTH DW ? ; Number of columns on the screen (chars/pixels)
+ ; (for text modes is equal to NB_CHAR_COLUMNS)
+NB_CHAR_COLUMNS DB ? ; Number of columns on the screen if in txt mode
+CUR_PAGE DB ? ; Active page number
+ROTATE_SW DB ? ; Switch: if "ON" then, must print sideways
+
+;-------------------------------------------------------------------------------
+;
+; ACTIVE SCREEN ATTRIBUTES
+;
+;-------------------------------------------------------------------------------
+CUR_COLUMN DW ? ; Current pixel/char column number
+CUR_ROW DW ? ; Current pixel/char row number
+NB_SCAN_LINES DW ? ; Number of screen scan lines
+SCAN_LINE_MAX_LENGTH DW ? ; Maximum number of dots/chars per scan line
+CUR_SCAN_LNE_LENGTH DW ? ; Length in pels/chars of the current scan line
+
+;-------------------------------------------------------------------------------
+;
+; PRINTER VARIABLES
+;
+;-------------------------------------------------------------------------------
+PRT_BUF DB ?,?,?,? ; PRINT BUFFER
+NB_BOXES_PER_PRT_BUF DB ? ; Number of boxes fitting in the print buffer
+CUR_BOX DB ?,?,?,? ; BOX = PRINTER REPRESENTATION OF 1 PIXEL
+BOX_H DB ? ; HEIGHT OF THE BOX
+BOX_W DB ? ; WIDTH OF THE BOX
+
+;-------------------------------------------------------------------------------
+;
+; CONTROL VARIABLES:
+;
+; This data is used to communicate between the Installation Modules
+; and the Resident Print Screen Modules.
+;-------------------------------------------------------------------------------
+PRINT_SCREEN_ALLOWED DB YES; Used to avoid print screens
+ ; while the GRAPHICS installation
+ ; (or re-install) is in progress
+ ; Set by GRAPHICS_INSTALL module.
+
+
+PAGE
+;===============================================================================
+;
+; INTERRUPT 5 DRIVER'S CODE:
+;
+;-------------------------------------------------------------------------------
+;===============================================================================
+;
+; PRT_SCR : PRINT THE ACTIVE SCREEN
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: SHARED_DATA_AREA_PTR = Offset of the data area used for
+; passing data between the
+; Installation process and the Print
+; Screen process.
+; PRINT_SCREEN_ALLOWED = Switch. Set to "No" if currently
+; installing GRAPHICS.COM
+;
+; NOTE: These 2 variables are declared within
+; PRT_SCR but initialized by the
+; Installation process GRAPHICS_INIT
+; OUTPUT: PRINTER
+;
+; CALLED BY: INTERRUPT 5
+;
+;
+;-------------------------------------------------------------------------------
+;
+; DESCRIPTION:
+;
+; PRINT THE ACTIVE SCREEN for all TEXT and All Points Addressable (APA)
+; display modes available with either a MONO, CGA, EGA, or VGA video
+; adapter on a Black and White or Color printer.
+;
+; INITIALIZATION:
+;
+; Each pixel or character on the screen has a color attribute. These
+; colors must be translated into different internal representations:
+;
+; For printing in colors, each color is translated to a BAND MASK.
+; The Band Mask indicates how to obtain this color on the printer.
+;
+; For printing in Black and White, each color is translated to a
+; GREY INTENSITY number between 0 (black) and 63 (white).
+;
+; The BAND MASK or the GREY INTENSITIES are found in the COLOR
+; TRANSLATION TABLE. This table is initialized before calling any of
+; the print screen modules.
+;
+; PRINT SCREEN TIME:
+;
+; When a pixel or character is read off the screen by one of the print
+; screen modules, its color is used as an index into the translation
+; table.
+;
+;
+; LOGIC:
+;
+; IF SCREEN_PRINTS_ALLOWED=NO ; Block print screens until Installation
+; THEN IRET ; Process (or re-install!) is finished.
+; ELSE
+;
+; CALL DET_HW_CONFIG ; Determine hardware configuration
+; CALL DET_MODE_STATE ; Determine video mode and active page
+; CALL GET_MODE_ATTR ; Get video attributes (TXT or APA, etc)
+;
+; IF MODE_TYPE = TXT AND Number of colors = 0
+; THEN Invoke BIOS INTERRUPT 5
+; ELSE
+; IF PRINTER_TYPE = BLACK_WHITE
+; THEN
+; IF MODE_TYPE = TXT
+; THEN Invoke BIOS INTERRUPT 5
+; ELSE ; Mode is APA
+; CALL SET_UP_XLT_TAB ; Set up the color translation table
+; CALL PRINT_BW_APA ; Print the active screen on a B&W printer
+; ELSE ; Color printer attached
+; CALL SET_UP_XLT_TAB ; Set up the color translation table
+; CALL PRINT_COLOR ; Print the active screen on a Color prt.
+; IRET
+;
+PRT_SCR_BEGIN:
+ PUSH AX ; Save Registers
+ PUSH BX ;
+ PUSH CX ;
+ PUSH DX ;
+ PUSH SI ;
+ PUSH DI ;
+ PUSH BP ;
+ PUSH DS ;
+ PUSH ES ;
+ ;
+ CLD ; Clear direction flag
+ PUSH CS ; DS := CS
+ POP DS
+
+;-------------------------------------------------------------------------------
+; Verify if we are allowed to print (not allowed if currently installing
+; GRAPHICS or printing a screen):
+;-------------------------------------------------------------------------------
+ CMP PRINT_SCREEN_ALLOWED,NO ; IF not allowed to print
+ JE PRT_SCR_RETURN ; THEN quit
+ ; ELSE print the screen:
+;-------------------------------------------------------------------------------
+; INITIALIZATION:
+;-------------------------------------------------------------------------------
+PRT_SCR_INIT: ; Disable print screen while
+ MOV PRINT_SCREEN_ALLOWED,NO ; we are printing the current
+ ; screen.
+ MOV BP,SHARED_DATA_AREA_PTR ; BP := Offset Shared Data Area
+ MOV ERROR_CODE,NO_ERROR ; No error so far.
+ CALL DET_HW_CONFIG ; Determine the type of display adapter
+ CALL DET_MODE_STATE ; Init CUR_PAGE, CUR_MODE
+ CALL GET_MODE_ATTR ; Determine if APA or TXT, nb. of colors,
+ ; and screen dimensions in pels or characters.
+ ;
+ ; Test the error code returned by GET_MODE_ATTR:
+ ;
+ TEST ERROR_CODE,MODE_NOT_SUPPORTED ;If mode not supported then,
+ JNZ DO_BEEP ; let BIOS give it a try.
+
+ ;------------------------------------------------------------------------------
+ ; Check the printer type:
+ ;------------------------------------------------------------------------------
+ .IF <DS:[BP].PRINTER_TYPE EQ BLACK_WHITE> ; Is a black and white printer
+ .THEN ; attached ?
+ ;------------------------------------------------------------------------------
+ ; A Black and White printer is attached
+ ;------------------------------------------------------------------------------
+ CMP MODE_TYPE,TXT ; Is the screen in text mode ?
+ JNE INVOKE_PRINT_ROUTINE ; No, call GRAPHICS B&W routine
+ JMP SHORT EXIT_TO_BIOS ; Yes, give control to BIOS INTERRUPT 5
+ .ELSE
+ ;------------------------------------------------------------------------------
+ ; A Color printer is attached
+ ;------------------------------------------------------------------------------
+ CMP NB_COLORS,0 ; Is the screen in a Monochrome
+ JNE INVOKE_PRINT_ROUTINE
+ TEST MODE_TYPE,TXT ; text mode ?
+ JNZ INVOKE_PRINT_ROUTINE
+ JMP SHORT EXIT_TO_BIOS ; Yes, let BIOS INTERRUPT 5 handle it
+ ; No, we handle it.
+.ENDIF ; ENDIF black and white or color printer
+;-------------------------------------------------------------------------------
+;
+; Call the print routine (which is either PRINT_COLOR or PRINT_BW_APA)
+;
+;-------------------------------------------------------------------------------
+INVOKE_PRINT_ROUTINE:
+ CALL SET_UP_XLT_TAB ; Set up the color translation table
+; \/ ~~mda(004) ----------------------------------------------------------------
+; The following fixes a MS bug. MS was failing to initialize
+; the variable ROTATE_SW to off. Consequently, if you printed a
+; picture whose corresponding printbox did NOT specify a rotate
+; after printing a picture whose corresponding printbox did
+; specify a rotate, the picture would print rotated.
+ MOV ROTATE_SW,OFF ; Set printing to standard unless otherwise
+ ; set to rotate via PRINT_OPTIONS.
+; /\ ~~mda(004) ----------------------------------------------------------------
+ CALL PRINT_MODULE_START ; Call the print modules that were
+ ; made resident at Install time.
+ MOV PRINT_SCREEN_ALLOWED,YES; Enable PrtScr for next calls
+ ;-----------------------------------------------------------------------------
+ ; Test the error code returned by either PRINT_COLOR or PRT_BW_APA
+ ;-----------------------------------------------------------------------------
+ TEST ERROR_CODE,UNABLE_TO_PRINT ; If unable to print the screen
+ JNZ SHORT EXIT_TO_BIOS ; then, let BIOS give it a try
+
+PRT_SCR_RETURN:
+ ; Restore registers
+ POP ES ;
+ POP DS ;
+ POP BP ;
+ POP DI ;
+ POP SI ;
+ POP DX ;
+ POP CX ;
+ POP BX ;
+ POP AX ;
+ ;
+ IRET ; Return control to interrupted
+ ; process
+
+; give a beep for modes not supported by graphics
+
+DO_BEEP:
+ mov ah,2 ; console output
+ mov dx,7 ; ^G - beep for modes not supported
+ int 21h
+
+EXIT_TO_BIOS:
+ ; Restore registers
+ POP ES ;
+ POP DS ;
+ POP BP ;
+ POP DI ;
+ POP SI ;
+ POP DX ;
+ POP CX ;
+ POP BX ;
+ POP AX ;
+ CLI ; Disable interrupts
+ MOV CS:PRINT_SCREEN_ALLOWED,YES ; Enable PrtScr for next calls
+ JMP DWORD PTR CS:BIOS_INT_5H ; Exit to BIOS INTERRUPT 5
+
+PRT_SCR ENDP
+
+
+;===============================================================================
+;
+; PRT_SCR MODULES:
+;
+;-------------------------------------------------------------------------------
+PAGE
+;===============================================================================
+;
+; DET_HW_CONFIG : DETERMINE WHAT TYPE OF VIDEO HARDWARE IS PRESENT
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: BP = Offset of the shared data area
+;
+; OUTPUT: HARDWARE_CONFIG is updated in the shared data area
+;
+; CALLED BY: PRT_SCR
+;
+; EXTERNAL CALLS: BIOS INT 10H
+;
+;-------------------------------------------------------------------------------
+;
+; LOGIC:
+; Issue BIOS INT10H Get Display Configuration Code (AX=1A00H)
+; IF AL = 1AH THEN /* VGA (PS/2 OR BRECON-B) */
+; /* BL = active DCC */
+; /* BH = alternate DCC */
+; /* Display Code: */
+; /* 1 - Mono Adapter */
+; /* 2 - CGA */
+; /* 4 - EGA with Mono Display */
+; /* 5 - EGA with Color Display */
+; /* 7 - PS/2 Mod 50,60,80 OR BRECON-B with Mono Display */
+; /* 8 - PS/2 Mod 50,60,80 OR BRECON-B with Color Display */
+; /* B - PS/2 Mod 30 with Mono Display */
+; /* C - PS/2 Mod 30 with Color Display */
+; IF AL = 1AH THEN /* Call is supported */
+; Set HARDWARE_CONFIG byte based on DCC returned in DL
+; ELSE
+; Issue INT 10H EGA Info (AH=12H BL=10H)
+; IF BL <> 10H THEN /* EGA */
+; Set EGA bit in HARDWARE_CONFIG
+; ELSE /* CGA or */
+; Issue INT 10H PC CONVERTIBLE Physical display description param.
+; request. (AH=15H)
+; IF ES:[DI] = 5140H
+; THEN
+; Set PC_CONVERTIBLE bit in HARDWARE_CONFIG
+; ELSE
+; Set OLD_ADAPTER bit in HARDWARE_CONFIG
+; ENDIF
+; ENDIF
+; ENDIF
+; RETURN
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+DET_HW_CONFIG PROC NEAR
+
+;-------------------------------------------------------------------------------
+;
+; Try to read display combination code (PS/2 call):
+;
+;-------------------------------------------------------------------------------
+ MOV AX,READ_CONFIG_CALL
+ INT 10H ; Call video BIOS
+
+ .IF <AL EQ 1AH> ; If call is supported
+ .THEN
+;-------------------------------------------------------------------------------
+;
+; Call is supported, PS/2 BIOS is present (Model 39,50,60,80 or BRECON-B card),
+; Determine what is the primary video adapter:
+;
+;-------------------------------------------------------------------------------
+ .SELECT
+ .WHEN <BL EQ 1> OR ; MONO or
+ .WHEN <BL EQ 2> ; CGA
+ MOV DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER
+ .WHEN <BL EQ 4> OR ; EGA with Mono or
+ .WHEN <BL EQ 5> ; EGA with Color
+ MOV DS:[BP].HARDWARE_CONFIG,EGA
+ .WHEN <BL EQ 7> OR ; BRECON-B with Mono or
+ .WHEN <BL EQ 8> ; BRECON-B with Color
+ MOV DS:[BP].HARDWARE_CONFIG,ROUNDUP
+ .WHEN <BL EQ 0Bh> OR ; PS/2 Model 30 with Mono or
+ .WHEN <BL EQ 0Ch> ; PS/2 Model 30 with Color
+ MOV DS:[BP].HARDWARE_CONFIG,PALACE
+ .ENDSELECT
+;-------------------------------------------------------------------------------
+;
+; PS/2 call is not supported, try the EGA info call:
+;
+;-------------------------------------------------------------------------------
+ .ELSE
+ MOV AH,ALT_SELECT_CALL ; Request Alternate select's
+ MOV BL,EGA_INFO_CALL ; "return EGA information call"
+ INT 10H ; Call video BIOS
+ .IF <BL NE EGA_INFO_CALL> ; If a memory value is returned
+ .THEN ; then, there is an EGA
+ MOV DS:[BP].HARDWARE_CONFIG,EGA
+ .ELSE ; else, call is not supported:
+;-------------------------------------------------------------------------------
+;
+; EGA call is not supported, try the PC CONVERTIBLE display description call:
+;
+;-------------------------------------------------------------------------------
+ MOV AH,DISP_DESC_CALL
+ INT 10H ; Call BIOS, ES:DI :=Offset of parms
+ .IF <ES:[DI] EQ 5140H> ; If LCD display type,
+ .THEN ; set LCD bit in Shared Data area
+ MOV DS:[BP].HARDWARE_CONFIG,PC_CONVERTIBLE
+ .ELSE ; else, we have an old adapter.
+ MOV DS:[BP].HARDWARE_CONFIG,OLD_ADAPTER ; (either MONO or CGA)
+ .ENDIF ; Display type is LCD
+ .ENDIF ; EGA BIOS is present
+ .ENDIF ; PS/2 BIOS is present
+ RET
+DET_HW_CONFIG ENDP
+PAGE
+;=======================================================================
+;
+; DET_MODE_STATE : Determine the current video mode and the active page.
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: HARDWARE_CONFIG = Type of video hardware attached
+;
+; OUTPUT: CUR_MODE = Video mode number (0-13H)
+; CUR_PAGE = Video page number (0-8)
+; NB_CHAR_COLUMNS = Number of columns if in a text mode.
+;
+;
+; CALLED BY: PRT_SCR
+;
+;
+;-------------------------------------------------------------------------------
+;
+; DESCRIPTION: Use the BIOS interface to
+; obtain the current mode and active page.
+;
+; LOGIC:
+;
+; Call BIOS INTERRUPT 10H: "Return current video state" (AH = 0fh)
+;
+DET_MODE_STATE PROC NEAR
+ PUSH AX
+ PUSH BX
+ MOV AH,GET_STATE_CALL
+ INT 10H ; CALL BIOS
+ MOV CUR_MODE,AL
+ MOV NB_CHAR_COLUMNS,AH
+ MOV CUR_PAGE,BH
+
+ POP BX
+ POP AX
+ RET
+DET_MODE_STATE ENDP
+
+PAGE
+;=======================================================================
+;
+; GET_MODE_ATTR: Obtain attributes of current video mode.
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: CUR_MODE = Current video mode (1 BYTE)
+;
+; OUTPUT: MODE_TYPE = Video mode type (TXT or APA)
+; NB_COLORS = Maximum number of colors (0-256) (0=B&W)
+; ERROR_CODE = Error code if error occurred.
+; SCREEN_HEIGHT= Number of rows (in pixels if APA or char if TEXT)
+; SCREEN_WIDTH = Number of columns (in pixels/char)
+;
+; CALLED BY: PRT_SCR
+;
+;
+;-----------------------------------------------------------------------
+;
+; DESCRIPTION: Scan the 2 local video mode attribute tables until the
+; current mode is located. Return the attributes.
+; For APA modes SCREEN_HEIGHT and SCREEN_WIDTH are in pixels,
+; for TEXT modes they are in characters.
+;
+;
+; LOGIC:
+;
+; Scan the APA_ATTR_TABLE
+; IF FOUND
+; MODE_TYPE := APA
+; NB_COLORS := mode.MAX_COLORS
+; SCREEN_HEIGHT := mode.NB_L
+; SCREEN_WIDTH := mode.NB_C
+; ELSE
+; Scan the TXT_ATTR_TABLE
+; When FOUND
+; MODE_TYPE := TXT
+; NB_COLORS := mode.NUM_COLORS
+; SCREEN_WIDTH := NB_CHAR_COLUMNS
+; SCREEN_HEIGHT := Byte in ROM BIOS at 40:84
+;
+;-----------------------------------------------------------------------
+GET_MODE_ATTR PROC NEAR
+ JMP SHORT GET_MODE_ATTR_BEGIN
+;-----------------------------------------------------------------------
+;
+; LOCAL DATA
+;
+;-----------------------------------------------------------------------
+
+APA_ATTR STRUC ; ATTRIBUTES FOR APA MODES:
+ APA_MODE DB ? ; Mode number
+ NB_C DW ? ; Number of columns
+ NB_L DW ? ; Number of lines
+ MAX_COLORS DW ? ; Maximum number of colors available (0=B&W)
+APA_ATTR ENDS
+
+TXT_ATTR STRUC ; ATTRIBUTES FOR TXT MODES:
+ TXT_MODE DB ? ; Mode number
+ NUM_COLORS DB ? ; Number of colors
+TXT_ATTR ENDS
+
+;-----------------------------------------------------------------------
+;
+; APA MODE ATTRIBUTES:
+;
+;-----------------------------------------------------------------------
+NB_APA_MODES DW 10
+APA_ATTR_TABLE LABEL WORD
+MODE04 APA_ATTR < 4,320,200, 4>
+MODE05 APA_ATTR < 5,320,200, 4>
+MODE06 APA_ATTR < 6,640,200, 2>
+MODE0D APA_ATTR <0DH,320,200, 16>
+MODE0E APA_ATTR <0EH,640,200, 16>
+MODE0F APA_ATTR <0FH,640,350, 4>
+MODE10H APA_ATTR <10H,640,350, 16>
+MODE11H APA_ATTR <11H,640,480, 2>
+MODE12H APA_ATTR <12H,640,480, 16>
+MODE13H APA_ATTR <13H,320,200,256>
+
+;-----------------------------------------------------------------------
+;
+; TXT MODE ATTRIBUTES:
+;
+;-----------------------------------------------------------------------
+NB_TXT_MODES DW 5
+TXT_ATTR_TABLE LABEL WORD
+MODE00 TXT_ATTR < 0, 16>
+MODE01 TXT_ATTR < 1, 16>
+MODE02 TXT_ATTR < 2, 16>
+MODE03 TXT_ATTR < 3, 16>
+MODE07 TXT_ATTR < 7, 0>
+
+;-----------------------------------------------------------------------
+;
+; BEGIN OF GET_MODE_ATTR
+;
+;-----------------------------------------------------------------------
+GET_MODE_ATTR_BEGIN:
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ MOV DL,CUR_MODE ; DL = CURRENT MODE
+;
+; Scan the APA_ATTR_TABLE
+;
+ MOV CX,NB_APA_MODES ; CS <-- Number of APA modes
+ MOV BX,OFFSET APA_ATTR_TABLE; BX <-- Offset of APA mode table
+ SCAN_APA:
+ CMP DL,[BX].APA_MODE ; IF mode found
+ JE SHORT ITS_APA ; THEN get its attributes
+ ADD BX,SIZE APA_ATTR
+ LOOP SCAN_APA ; ELSE keep scanning
+ JMP SHORT SCAN_TXT_INIT ; NOT in this table: scan txt modes
+ITS_APA:
+ MOV MODE_TYPE,APA ; MODE = APA
+ MOV AX,[BX].MAX_COLORS
+ MOV NB_COLORS,AX ; Get number of colors
+ MOV AX,[BX].NB_L
+ MOV SCREEN_HEIGHT,AX ; Get number of lines
+ MOV AX,[BX].NB_C
+ MOV SCREEN_WIDTH,AX ; Get number of columns
+ JMP SHORT GET_MODE_ATTR_END
+
+;
+; Scan the TXT_ATTR_TABLE
+;
+SCAN_TXT_INIT:
+ MOV CX,NB_TXT_MODES ; CX <-- Number of TXT modes
+ MOV BX,OFFSET TXT_ATTR_TABLE; BX <-- Offset of TXT mode table
+ SCAN_TXT:
+ CMP DL,[BX].TXT_MODE ; IF mode found
+ JE SHORT ITS_TXT ; THEN get its attributes
+ ADD BX,SIZE TXT_ATTR
+ LOOP SCAN_TXT ; ELSE keep scanning
+ITS_TXT:
+ MOV MODE_TYPE,TXT ; MODE = TXT
+ MOV AL,[BX].NUM_COLORS
+ CBW
+ MOV NB_COLORS,AX ; Get number of colors
+ MOV AL,NB_CHAR_COLUMNS ; Get number of columns
+ CBW
+ MOV SCREEN_WIDTH,AX
+ .IF <DS:[BP].HARDWARE_CONFIG EQ OLD_ADAPTER>; If an old adapter is there
+ .THEN ; The number of lines is 25
+ MOV SCREEN_HEIGHT,25
+ .ELSE
+ MOV AX,BIOS_SEG ; Get number of rows
+ MOV ES,AX ; from BIOS Data Area
+ MOV BX,NB_ROWS_OFFSET ; at 0040:0084
+ MOV AL,ES:[BX]
+ CBW
+ INC AX
+ MOV SCREEN_HEIGHT,AX
+ .ENDIF
+ JMP SHORT GET_MODE_ATTR_END
+
+;
+; The current mode was not found in any of the tables
+;
+ MOV ERROR_CODE,MODE_NOT_SUPPORTED
+
+GET_MODE_ATTR_END:
+ POP AX
+ POP BX
+ POP CX
+ POP DX
+ RET
+GET_MODE_ATTR ENDP
+PAGE
+;=======================================================================
+;
+; SET_UP_XLT_TABLE : SET UP A COLOR MAPPING FOR EACH COLOR AVAILABLE
+; WITH THE CURRENT MODE
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: CUR_MODE = Current video mode.
+; HARDWARE_CONFIG = Type of display adapter.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; XLT_TAB = Color translation table.
+; CUR_PAGE = Active page number
+; BP = Offset of the shared data area
+;
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: PRT_SCR
+;
+;-----------------------------------------------------------------------
+;
+; DESCRIPTION: The table is updated to hold a mapping for each color
+; available in the current video mode either TEXT or APA.
+;
+; For example, if the current mode supports 16 colors then the first
+; sixteen bytes of the table will hold the corresponding Color printer
+; or Black and White printer mappings for these colors.
+;
+;
+; LOGIC:
+;
+; IF HARDWARE_CONFIG = CGA OR HARDWARE_CONFIG = PC_CONVERTIBLE
+; THEN
+; CALL SET_CGA_XLT_TAB
+;
+; ELSE IF HARDWARE_CONFIG = EGA
+; THEN
+; CALL SET_EGA_XLT_TAB
+;
+; ELSE IF CUR_MODE = 0FH
+; THEN
+; CALL SET_MODE_F_XLT_TAB
+;
+; ELSE IF CUR_MODE = 19
+; THEN
+; CALL SET_MODE_13H_XLT_TAB
+;
+; ELSE
+; CALL SET_ROUNDUP_XLT_TAB
+;
+; CALL SET_BACKG_IN_XLT_TAB ; Update the background in the translation table
+;
+SET_UP_XLT_TAB PROC NEAR
+;-------------------------------------------------------------------------------
+; For old display modes: set up translation table as for a Color Graphics Adapt.
+; Either 4 or 16 colors are set up depending if the mode is an APA or text mode.
+;
+; NOTE: SET_UP_XLT_TAB cannot be invoked if the display adater is a Monochrome
+; display adater. (When a Mono. adapter is attached, a jump is made to
+; the ROM BIOS for printing the screen, and no translation table is set).
+;-------------------------------------------------------------------------------
+.IF <BIT DS:[BP].HARDWARE_CONFIG NZ OLD_ADAPTER> OR ; IF it is a CGA
+.IF <BIT DS:[BP].HARDWARE_CONFIG NZ PC_CONVERTIBLE> ; or a PC convertible
+.THEN ; THEN set up CGA colors
+ CALL SET_CGA_XLT_TAB ;
+.ELSEIF <BIT DS:[BP].HARDWARE_CONFIG NZ EGA> ; ELSEIF it is an EGA
+ CALL SET_EGA_XLT_TAB ; set up EGA colors.
+.ELSEIF <CUR_MODE EQ 0FH> ; ELSEIF we are in mode 15
+ CALL SET_MODE_F_XLT_TAB ; set up its 4 shades
+;-------------------------------------------------------------------------------
+; A PS/2 system is attached: (we either have a PALACE [Model 30] or a ROUNDUP)
+;-------------------------------------------------------------------------------
+.ELSEIF <CUR_MODE EQ 13H> ; ELSEIF current mode is 13h
+ CALL SET_MODE_13H_XLT_TAB ; set up 256 colors
+.ELSEIF <BIT DS:[BP].HARDWARE_CONFIG NZ PALACE> ; ELSEIF PS/2 Model 30(MCGA)
+ CALL SET_CGA_XLT_TAB ; handle it like a CGA
+.ELSE ; ELSE we have a ROUNDUP
+;-------------------------------------------------------------------------------
+; A PS/2 model 50, 60 or 80 or an ADA 'B' card is attached (in 16 color mode):
+;-------------------------------------------------------------------------------
+ CALL SET_ROUNDUP_XLT_TAB ; set up 16 colors
+.ENDIF
+;-------------------------------------------------------------------------------
+; Finish setting up the translation table:
+;-------------------------------------------------------------------------------
+
+CALL SET_BACKG_IN_XLT_TAB ; Update the background in the translation table
+ ; according to the command line switch setting
+ ; (i.e.,/R /B)
+ RET
+SET_UP_XLT_TAB ENDP
+PAGE
+;===============================================================================
+;
+; SET_BACKG_IN_XLT_TAB : ADJUST THE MAPPING FOR THE BACKGROUND COLOR IN THE
+; XLT_TAB ACCORDING TO PRINTER TYPE AND /R /B.
+;
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: BP = Offset of shared data area (SWITCHES)
+; XLT_TAB = The color translation table.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+;-------------------------------------------------------------------------------
+;
+; DESCRIPTION: If there is a black and white printer and /R is NOT specified
+; then the background color should not be printed and it is replaced in the
+; translation table by the Intensity for white (will print nothing).
+;
+; If a color printer is attached and /B is not specified then the background
+; color is replaced by the Print Band mask for white.
+;
+; LOGIC:
+; IF (a black and white printer is attached) AND (/R is OFF)
+; THEN
+; MOV XLT_TAB, WHITE_INT ; Store white in translation table
+; ELSE (a color printer is attached)
+; IF (/B is ON)
+; THEN
+; RGB.R := MAX_INT
+; RGB.G := MAX_INT
+; RGB.B := MAX_INT
+; CALL RGB2BAND ; Convert RGB for white to a Band Mask
+; MOV XLT_TAB,AL ; Store the band mask in the xlt table
+;
+;
+;-------------------------------------------------------------------------------
+SET_BACKG_IN_XLT_TAB PROC NEAR
+;-------------------------------------------------------------------------------
+;
+; Test if a black and white printer is attached.
+;
+;-------------------------------------------------------------------------------
+.IF <BIT DS:[BP].PRINTER_TYPE NZ BLACK_WHITE> AND ; IF black and white
+.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW> ; printer and not /R
+.THEN ; then, map background
+ MOV XLT_TAB,WHITE_INT ; to white.
+;-------------------------------------------------------------------------------
+;
+; A Color printer is attached:
+;
+;-------------------------------------------------------------------------------
+.ELSEIF <BIT DS:[BP].PRINTER_TYPE NZ COLOR> AND ; else, if color printer
+.IF <BIT DS:[BP].SWITCHES Z BACKGROUND_SW> ; and /B if OFF
+.THEN ;
+ ; Store a null band mask
+ MOV XLT_TAB,0 ; the translation table.
+.ENDIF
+ RET
+SET_BACKG_IN_XLT_TAB ENDP
+PAGE
+;=======================================================================
+;
+; SET_EGA_XLT_TAB : SET UP COLOR TRANSLATION TABLE FOR ENHANCED GRAPHIC
+; ADAPTER
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: XLT_TAB = Color translation table.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; SWITCHES = GRAPHICS command line parameters.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: SET_UP_XLT_TABLE
+;
+;-----------------------------------------------------------------------
+;
+; NOTES: With the EGA, "VIDEO BIOS READ DOT call" returns an index into
+; the 16 EGA palette registers.
+;
+; These registers contain the actual colors stored as rgbRGB components
+; (see EGA_COL2RGB for details) for mode hex 10. Under mode hex E these
+; registers contain the actual colors as I0RGB components (see CGA_COL2RGB
+; for details).
+;
+; These registers can be Revised by the user but, are 'WRITE ONLY'.
+; However, it is possible to define a SAVE AREA where BIOS will maintain
+; a copy of the palette registers.
+;
+; This area is called the "DYNAMIC SAVE AREA" and is defined via the
+; BIOS EGA SAVE_PTR AREA. Whenever the palette registers are changed by
+; the user, BIOS updates the EGA_SAVE_AREA.
+;
+; The 16 palette registers are the first 16 bytes of the DYNAMIC SAVE AREA.
+;
+; This program takes advantage of this feature and consults the EGA DYNAMIC
+; SAVE AREA in order to obtain the colors used in the active screen.
+;
+;
+; DESCRIPTION: Obtain each color available with an EGA by reading its
+; palette register in the EGA_SAVE_AREA:
+;
+; Calculate the mapping for this color, either a BAND_MASK or a
+; GREY INTENSITY and store it in the color translation table.
+;
+;
+; LOGIC:
+;
+; Obtain the DYNAMIC EGA SAVE AREA offset from the BIOS SAVE_PTR_AREA.
+;
+; If current mode is either 4,5 or 6
+; Then,
+; CALL SET_CGA_XLT_TAB
+; Get the background color by reading palette register number 0
+; Else,
+; For each register number (0 to 15):
+; Get the register contents (rgbRGB values) from the EGA SAVE AREA
+; CALL EGA_COL2RGB ; Obtain the Red, Green, Blue values
+; CALL RGB2XLT_TAB ; Obtain a Band Mask or a Grey Intensity
+; ; and store the result in the XLT_TAB
+;
+SET_EGA_XLT_TAB PROC NEAR
+ PUSH AX ; Save the registers used
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH DI
+
+;-------------------------------------------------------------------------------
+;
+; Obtain the pointer to the DYNAMIC SAVE AREA from the SAVE AREA POINTER TABLE:
+;
+;-------------------------------------------------------------------------------
+EGA_SAVE_PTR EQU 4A8H ; EGA BIOS pointer to table of
+ ; pointer to save areas.
+ XOR AX,AX ; ES segment := paragraph 0
+ MOV ES,AX
+
+ LES BX,ES:DWORD PTR EGA_SAVE_PTR ; ES:BX := Pointer to ptr table
+ LES BX,ES:[BX]+4 ; ES:BX := Pointer to dynamic save area
+ ; (NOTE: It is the second pointer in
+ ; the table)
+
+;-------------------------------------------------------------------------------
+;
+; Set up one entry in the translation table for each color available.
+;
+;-------------------------------------------------------------------------------
+.IF <CUR_MODE EQ 4> OR ; If the current mode is an old CGA
+.IF <CUR_MODE EQ 5> OR ; GRAPHICS mode:
+.IF <CUR_MODE EQ 6>
+.THEN
+;-------------------------------------------------------------------------------
+; Current mode is either mode 4, 5 or 6;
+; Store each color of the old CGA All Points Addressable mode:
+;-------------------------------------------------------------------------------
+ CALL SET_CGA_XLT_TAB ; Set up colors in the translation
+ ; table, NOTE: The background color
+ ; will not be set properly since the
+ ; EGA BIOS does not update memory
+ ; location 40:66 with the value
+ ; of the background color as CGA
+ ; does.
+;------Adjust the background color in the translation table:
+;------The background color is obtained from the EGA DYNAMIC SAVE AREA
+;------ES:BX = Address of the EGA DYNAMIC SAVE AREA
+;------NOTE : For CGA compatible modes EGA BIOS stores the color in the
+;------DYNAMIC SAVE AREA as a I0RGB value.
+ XOR DI,DI ; DI:=register number = index in XLT_TAB
+ MOV AL,ES:[BX][DI] ; AL:=Palette register 0 = Back. color
+ MOV AH,AL ; Convert I0RGB to IRGB (CGA color)
+ AND AL,111B ; Isolate RGB bits
+ AND AH,10000B ; Isolate I bit
+ SHR AH,1 ; Move I bit from position 5 to 4
+ OR AL,AH ; Get IRGB byte.
+ CALL CGA_COL2RGB ; Convert IRGB to R,G,B values
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+
+.ELSE ; ELSE, we have an EGA graphics mode:
+;-------------------------------------------------------------------------------
+; The current mode is a either a text mode or one of the EGA enhanced mode;
+; Store in the translation table each color available (these modes have 16 col.)
+;-------------------------------------------------------------------------------
+ MOV CX,16 ; CX := Number of palette registers
+ ; to read
+ XOR DI,DI ; DI := Palette register number
+ ; and index in the translation table
+STORE_1_EGA_COLOR:
+ MOV AL,ES:[BX][DI] ; AL := Palette register
+ .IF <CUR_MODE EQ 14> OR ; If mode E (hex) OR mode D (hex)
+ .IF <CUR_MODE EQ 13> ; the colors are
+ .THEN ; stored as I0CGA colors
+ MOV AH,AL ; Convert I0RGB to IRGB (CGA color)
+ AND AL,111B ; Isolate RGB bits
+ AND AH,10000B ; Isolate I bit
+ SHR AH,1 ; Move I bit from position 5 to 4
+ OR AL,AH ; Get IRGB byte.
+ CALL CGA_COL2RGB ; Convert IRGB to R,G,B values
+ .ELSE ; Else, they are stored as (rgbRGB);
+ CALL EGA_COL2RGB ; Convert register to R,G,B values
+ .ENDIF
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+ INC DI ; Get next palette register number
+ LOOP STORE_1_EGA_COLOR
+.ENDIF ; ENDIF 4 colors or 16 colors
+
+ POP DI ; Restore the registers
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+ RET
+SET_EGA_XLT_TAB ENDP
+PAGE
+;=======================================================================
+;
+; SET_CGA_XLT_TAB : SET UP COLOR TRANSLATION TABLE FOR COLOR GRAPHIC
+; ADAPTER
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: XLT_TAB = Color translation table.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; SWITCHES = GRAPHICS command line parameters.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: SET_UP_XLT_TABLE
+;
+;-----------------------------------------------------------------------
+;
+; NOTES: With the CGA, the "VIDEO BIOS READ DOT call" returns a number
+; from 0 to 3. A dot of value 0 is of the background color.
+;
+; The actual value of the background color is stored in BIOS VIDEO
+; DISPLAY DATA AREA as a PIIRGB value (see CGA_COL2RGB for details) and
+; can be any of 16 colors.
+;
+; A dot of value 1,2, or 3 represents any of 2 specific colors depending
+; on the current color palette.
+;
+; The palette number is obtained from the BIOS VIDEO DISPLAY DATA AREA
+; (It is the "P" bit or bit number 5)
+;
+; The dot values 1,2,3 expressed in binary actually represent the RG
+; (Red, Green) components of the color.
+;
+; The palette number represents the B (Blue) component therefore, when
+; the palette number is appended to the color number we obtain the RGB
+; components for that color.
+;
+; (E.G., COLOR = 010 ; COLOR # 2
+; PALETTE= 0 ; PALETTE # 0
+;
+; IRGB = 0100 ; Intensity = 0 Ä¿
+; ; Red = 1 ÃÄÄÄ> color = Red
+; ; Green = 0 ³
+; ; Blue = 0 ÄÙ
+;
+;
+; DESCRIPTION:
+;
+; For each color available with a CGA:
+; Calculate the color mapping, either a BAND_MASK or a GREY
+; INTENSITY and store it in the color translation table.
+;
+; LOGIC:
+;
+; ; Obtain the background color from VIDEO BIOS DATA AREA
+; ; and the paletter number
+;
+; ; Store the Background color:
+; CALL CGA_COL2RGB ; Convert IRGB components to RGB values
+; CALL RGB2XLT_TAB ; Convert RGB to an entry in the translation
+; ; table
+; ; Store all other colors:
+; FOR IRG := 1 TO 3 ; Obtain the color number
+; Append palette number (B) to IRG
+; CALL CGA_COL2RGB ; Convert color to RGB values
+; CALL RGB2XLT_TAB ; Convert RGB to an entry in the translation
+; ; table
+;
+SET_CGA_XLT_TAB PROC NEAR
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DI
+ PUSH ES
+
+.IF <CUR_MODE EQ 4> OR
+.IF <CUR_MODE EQ 5>
+;===============================================================================
+;
+; THE CURRENT MODE IS MODE 4 OR 5
+;
+;-------------------------------------------------------------------------------
+.THEN
+;-------------------------------------------------------------------------------
+; Read the CRT palette from the BIOS ROM to obtain the background color and
+; the current palette number; store the palette number in BL
+;-------------------------------------------------------------------------------
+ROM_BIOS_SEG EQU 40H ; CGA BIOS SEGMENT
+CRT_PALETTE_OFF EQU 66H ; BIOS Current palette setting
+P_BIT_MASK EQU 100000B ; bit 5 = Current palette
+I_BIT_MASK EQU 1000B ; bit 4 = Intensity bit
+R_BIT_MASK EQU 100B ; bit 2 = Red bit
+G_BIT_MASK EQU 10B ; bit 1 = Green bit
+B_BIT_MASK EQU 1B ; bit 0 = Blue bit
+
+ MOV AX,ROM_BIOS_SEG ; ES := ROM BIOS SEGMENT
+ PUSH AX
+ POP ES
+
+ MOV AL,ES:CRT_PALETTE_OFF; AL := CRT Palette (00PIIRGB)
+ MOV BL,P_BIT_MASK ; LOW NIBBLE = BACKGROUND COLOR
+ AND BL,AL ; BL := Palette number
+ MOV CL,5
+ SHR BL,CL
+
+ XOR DI,DI ; DI := Index in the XLT_TAB
+;-------------------------------------------------------------------------------
+; Store the background color, (obtained from low 4 bits of the byte at 40:66)
+;-------------------------------------------------------------------------------
+ CALL CGA_COL2RGB ; Convert color (in AL) to R, G, B values
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+;-------------------------------------------------------------------------------
+; Store the 3 foreground colors for mode 4 and 5
+;-------------------------------------------------------------------------------
+ MOV CX,3 ; For each color, but the background:
+STORE_1_CGA_MODE4_COLOR:
+ INC DI ; Increment index in the translation table
+ MOV AX,DI ; AL := IRG
+ SHL AL,1
+ OR AL,BL ; AL := IRGB
+ CALL CGA_COL2RGB ; Convert color (in AL) to R, G, B values
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+ LOOP STORE_1_CGA_MODE4_COLOR
+.ELSEIF <CUR_MODE EQ 6>
+;===============================================================================
+;
+; THE CURRENT MODE IS MODE 6
+;
+;-------------------------------------------------------------------------------
+.THEN
+;-------------------------------------------------------------------------------
+; Store background color for mode 6 (mode 6 is a 2 colors, APA mode)
+; Background is stored as BLACK
+;-------------------------------------------------------------------------------
+ XOR DI,DI ; DI := Index of color in translation table
+ MOV RGB.R,BLACK_INT ; Foreground color is white
+ MOV RGB.G,BLACK_INT ; RGB := RGB of white
+ MOV RGB.B,BLACK_INT ;
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+;-------------------------------------------------------------------------------
+; Store foreground color for mode 6 (mode 6 is a 2 colors, APA mode)
+;-------------------------------------------------------------------------------
+ INC DI ; DI := Index of color in translation table
+ MOV RGB.R,WHITE_INT ; Background color is BLACK
+ MOV RGB.G,WHITE_INT ; RGB := RGB of BLACK
+ MOV RGB.B,WHITE_INT ;
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+.ELSE
+;===============================================================================
+;
+; THE CURRENT MODE IS A TEXT MODE:
+;
+;-------------------------------------------------------------------------------
+ XOR DI,DI ; DI := Index in the translation table
+ MOV CX,16 ; For each of the 16 colors:
+STORE_1_CGA_TEXT_COLOR:
+ MOV AX,DI ; AL := IRGB
+ CALL CGA_COL2RGB ; Convert color (in AL) to R, G, B values
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+ INC DI ; Increment index in the translation table
+ LOOP STORE_1_CGA_TEXT_COLOR
+.ENDIF ;
+
+ POP ES
+ POP DI
+ POP CX
+ POP BX
+ POP AX
+
+ RET
+SET_CGA_XLT_TAB ENDP
+PAGE
+;===============================================================================
+;
+; RGB2XLT_TAB: CONVERT R,G,B VALUES TO EITHER A BAND MASK OR AN INTENSITY
+; STORE THE RESULT IN THE TRANSLATION TABLE
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: DI = Index in the translation table
+; RGB = Red Green Blue values of the color to be stored.
+;
+; OUTPUT: XLT_TAB is updated
+;
+;-------------------------------------------------------------------------------
+; DESCRIPTION: Convert the RGB values to either a Band mask or an intensity
+; depending on the printer type; store the result in the translation table.
+;
+; LOGIC:
+; IF PRINTER_TYPE = COLOR
+; THEN
+; CALL RGB2BAND ; Obtain a Band Mask
+; ELSE ; Printer is Monochrome
+; CALL RGB2INT ; Obtain a Grey Intensity
+; Store the result in the XLT_TAB
+;
+RGB2XLT_TAB PROC NEAR
+ .IF <DS:[BP].PRINTER_TYPE EQ COLOR>; Color printer ?
+ .THEN
+;-------A color printer is attached:
+ CALL RGB2BAND ; Yes, convert RGB to color band (in AL)
+ .ELSE
+;-------A black and white printer is attached:
+ CALL RGB2INT ; No, RGB to an intensity in AL
+ .ENDIF
+;-------Store the result
+ MOV XLT_TAB[DI],AL
+ RET
+RGB2XLT_TAB ENDP
+PAGE
+;===============================================================================
+;
+; CGA_COL2RGB : CONVERT A COLOR FROM THE CGA TO RED GREEN BLUE VALUES
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: AL = 0000IRGB ONE BYTE WHERE BIT:
+;
+; I = Intensity bit
+; R = Red component
+; G = Green component
+; B = Blue component
+;
+;
+; OUTPUT: RGB.R = RED component (0-63)
+; RGB.G = GREEN component (0-63)
+; RGB.B = BLUE component (0-63)
+;
+; CALLED BY: SET_UP_CGA_XLT_TABLE
+;
+;-----------------------------------------------------------------------
+;
+; DESCRIPTION: If either the RED, GREEN, or BLUE bit is on (in an IRGB
+; byte) then, the corresponding color gun on the display is firing 2/3
+; of its capacity, giving a color intensity of "2/3".
+;
+; If the INTENSITY bit is on, then 1/3 is added to EACH color.
+;
+; (E.G., IRGB R G B
+; BLACK = 00000000 ( 0, 0, 0)
+; WHITE = 00001111 (3/3, 3/3, 3/3)
+; RED = 00000100 (2/3, 0, 0)
+; HIGH INT. RED = 00001100 (3/3, 1/3, 1/3)
+;
+; Since we want an intensity from 0 to 63,
+; "2/3" of RED means:
+; 2/3 * 63 = 42
+;
+;
+; LOGIC:
+; Get the intensity.
+; Get the red component
+; Get the green component
+; Get the blue component
+;
+CGA_COL2RGB PROC NEAR
+;-----------------------------------------------------------------------
+;
+; Init the R,G,B values:
+;
+;-----------------------------------------------------------------------
+ MOV RGB.R,0
+ MOV RGB.G,0
+ MOV RGB.B,0
+;-----------------------------------------------------------------------
+;
+; Test the Intensity bit:
+;
+;-----------------------------------------------------------------------
+ .IF <BIT AL AND I_BIT_MASK> ; IF, I is on
+ .THEN
+ ADD RGB.R,ONE_THIRD ; Then, add one third to each
+ ADD RGB.G,ONE_THIRD ; color.
+ ADD RGB.B,ONE_THIRD
+ .ENDIF
+;-----------------------------------------------------------------------
+;
+; Test the RGB bits:
+;
+;-----------------------------------------------------------------------
+ .IF <BIT AL AND R_BIT_MASK> ; If, Red is on
+ .THEN
+ ADD RGB.R,TWO_THIRD ; then, add two third RED
+ .ENDIF
+
+ .IF <BIT AL AND G_BIT_MASK> ; If, Green is on
+ .THEN
+ ADD RGB.G,TWO_THIRD ; then, add two third GREEN
+ .ENDIF
+
+ .IF <BIT AL AND B_BIT_MASK> ; If, Blue is on
+ .THEN
+ ADD RGB.B,TWO_THIRD ; then, add two third BLUE
+ .ENDIF
+
+ RET
+CGA_COL2RGB ENDP
+PAGE
+;=======================================================================
+;
+; SET_MODE_F_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR MONOCHROME
+; MODE "F"
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: XLT_TAB = Color translation table.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; SWITCHES = GRAPHICS command line parameters.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: SET_UP_XLT_TABLE
+;
+;-------------------------------------------------------------------------------
+;
+; NOTES: In mode F the "VIDEO BIOS READ DOT call" returns a byte where
+; bit 1 and 3 represent the value of plane 1 and 3.
+; The following colors are available using this mode:
+;
+; plane 2: plane 0: color:
+; 0 0 black
+; 0 1 white
+; 1 0 blinking white
+; 1 1 high-intensity white
+;
+;
+; DESCRIPTION: A local table holds the Red, Green, Blue values for each of
+; the 4 Mono colors available in Mode Fh.
+; Each color is stored as either a Grey intensity if printing in Monochrome
+; or as a Band Mask if printing in color.
+; Black is stored as black.
+; White is stored as a light gray
+; High-intensity white and blinking white are stored as white.
+;
+;
+; LOGIC:
+; FOR EACH "COLOR" AVAILABLE WITH MODE F
+; GET ITS R,G,B VALUES
+; CALL RGB2XLT_TAB ; Convert RGB to an entry in the translation
+; ; table
+;
+SET_MODE_F_XLT_TAB PROC NEAR
+ PUSH AX
+ PUSH SI
+ PUSH DI
+ JMP SHORT SET_MODE_F_BEGIN
+;-------------------------------------------------------------------------------
+;
+; TABLE OF R,G,B VALUES WE ASSIGN TO THE 4 COLORS AVAILABLE IN MODE F:
+;
+;-------------------------------------------------------------------------------
+MODE_F_RGB LABEL BYTE
+ DB BLACK_INT,BLACK_INT,BLACK_INT ; Black is mapped to black.
+ DB TWO_THIRD,TWO_THIRD,TWO_THIRD ; White --> light grey
+ DB WHITE_INT,WHITE_INT,WHITE_INT ; Blinking --> white
+ DB WHITE_INT,WHITE_INT,WHITE_INT ; High-int. White --> white
+;-------------------------------------------------------------------------------
+;
+; STORE THE COLORS AVAILABLE WITH MODE F
+;
+;-------------------------------------------------------------------------------
+SET_MODE_F_BEGIN:
+ MOV SI,OFFSET MODE_F_RGB ; SI <-- Offset of RGB table
+ XOR DI,DI ; DI <-- Index into translation table
+
+;-------For each color available in mode F:
+STORE_1_MODE_F_COLOR:
+ MOV AL,[SI] ; Get the Red component
+ MOV RGB.R,AL
+ MOV AL,[SI]+1 ; Get the Green component
+ MOV RGB.G,AL
+ MOV AL,[SI]+2 ; Get the Blue component
+ MOV RGB.B,AL
+
+;-------Convert pixel to either a Color band or an Intensity:
+ CALL RGB2XLT_TAB ; Convert and store in the xlt table
+
+ ADD SI,3 ; Get next R,G,B values
+ INC DI ; One more color has been stored
+ CMP DI,NB_COLORS ; All stored ?
+ JL STORE_1_MODE_F_COLOR
+
+ POP DI
+ POP SI
+ POP AX
+ RET
+SET_MODE_F_XLT_TAB ENDP
+PAGE
+;=======================================================================
+;
+; SET_MODE_13H_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR PALACE VIDEO
+; ADAPTER IN MODE 13H
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: XLT_TAB = Color translation table.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; SWITCHES = GRAPHICS command line parameters.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: SET_UP_XLT_TABLE
+;
+;-----------------------------------------------------------------------
+;
+; NOTES: With the PALACE the "VIDEO BIOS READ DOT call" returns a direct
+; index to the 256 COLOR REGISTERS.
+;
+; These COLORS REGISTERS hold the R,G,B (Red, Green, Blue) values for
+; each of the 256 colors available at the same time on the screen.
+; Color register number 0 holds the background color.
+;
+; DESCRIPTION: Store a color mapping for each color register.
+; If the REVERSE_SW is off, exchange white and black.
+;
+; LOGIC:
+;
+; For each color (0 to 255)
+; Read the color register ; get the RGB values for this color num.
+; Store the result in the XLT_TAB
+;
+SET_MODE_13H_XLT_TAB PROC NEAR
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH DI
+
+ MOV NB_COLORS_TO_READ,256 ; Read 256 color registers
+
+;-------------------------------------------------------------------------------
+;
+; Store in the translation table each color available for mode 13h:
+;
+;-------------------------------------------------------------------------------
+ XOR DI,DI ; DI := Palette register number
+ ; and index in the translation table
+STORE_1_M13H_COLOR:
+ MOV BX,DI ; BX := Color register to be read
+ MOV AX,GET_C_REG_CALL ; AX := BIOS Get color register call
+ INT 10H ; Call BIOS
+ MOV RGB.R,DH ; Get Red value
+ MOV RGB.G,CH ; Get Green value
+ MOV RGB.B,CL ; Get Blue value
+ CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+ INC DI ; Get next palette register number
+ CMP DI,NB_COLORS_TO_READ ; All colors stored ?
+ JL STORE_1_M13H_COLOR ; No, get next one
+
+
+ POP DI
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+ RET
+NB_COLORS_TO_READ DW ? ; Number of colors registers to read with a PS/2
+SET_MODE_13H_XLT_TAB ENDP
+PAGE
+;===============================================================================
+;
+; SET_ROUNDUP_XLT_TAB: SET UP COLOR TRANSLATION TABLE FOR ROUNDUP VIDEO
+; ADAPTER
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: XLT_TAB = Color translation table.
+; PRINTER_TYPE = Type of printer attached (Color or B&W)
+; SWITCHES = GRAPHICS command line parameters.
+;
+; OUTPUT: XLT_TAB IS UPDATED
+;
+; CALLED BY: SET_UP_XLT_TABLE
+;
+;-------------------------------------------------------------------------------
+;
+; NOTES: With the ROUNDUP the "VIDEO BIOS READ DOT call" returns an
+; index into the 16 PALETTE REGISTERS.
+;
+; Each palette register holds an index into the current "color page"
+; within the 256 COLOR REGISTERS.
+;
+; These "color pages" represent all the colors from WHICH TO CHOOSE the
+; screen colors for an active page; 16 colors can be displayed at the
+; same time on the screen.
+;
+; There are 2 paging modes: either 64 color pages or 16 color pages:
+;
+; In 64 color mode, there are 4 color pages available (the 256 palette
+; registers are partitioned in 4 blocks of 64 colors).
+;
+; The 16 screen colors for the active page are selected from these 64
+; color registers.
+;
+; This scheme allows for quickly changing the contents of the screen by
+; changing the active page.
+;
+; The COLOR REGISTERS contains the color information stored as RGB (Red,
+; Green, Blue) components. There is one byte for each of these 3
+; components. The value for each component ranges from 0 to 63 (where
+; 0 = color not present).
+;
+;
+; DESCRIPTION: Determine the paging mode and the active color page.
+; For each color available with the current mode, get the palette
+; register and then, read the corresponding color register in order to
+; obtain its RGB components.
+;
+; For mode 11h, 2 colors only are available. These colors are obtained from
+; palette register 0 (background) and 7 (foreground color). The contents
+; of these 2 palette registers is also used as an index within the color
+; registers.
+;
+; If printing is Monochrome, map the RGB to a Grey Intensity.
+; If printing is in colors, map the RGB to a Band Mask.
+; Store the result in the translation table
+;
+; LOGIC:
+;
+; Read color page state (BIOS INT 10H - AL = 1AH)
+;
+; If mode 4,5 or 6
+; Then
+; CALL SET_CGA_XLT_TAB
+; Adjust the background color.
+; else
+; If mode 11h
+; then
+; For PALETTE_INDEX := 0 to 15
+; IF PAGE_MODE = PAGE_64_REGISTERS
+; THEN
+; Read the palette register number "PALETTE_INDEX"
+; COLOR_INDEX := Palette register contents
+; COLOR_INDEX := (CUR_PAGE_NUM * 64) + COLOR_INDEX
+; Read color register number "COLOR_INDEX" ; Obtain R,G,B values.
+; CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+;
+; ELSE IF PAGE_MODE = PAGE_16_REGISTERS
+; COLOR_INDEX := (CUR_PAGE_NUM * 16) + PALETTE_INDEX
+; Read color register number "COLOR_INDEX"
+; CALL RGB2XLT_TAB ; Convert RGB to an entry in XLT_TAB
+;
+;
+SET_ROUNDUP_XLT_TAB PROC NEAR
+PAGING_MODE_64 EQU 0
+
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DI
+
+;-------------------------------------------------------------------------------
+; Obtain the color page state
+;-------------------------------------------------------------------------------
+ MOV AX,PAGE_STATE_CALL ; Call BIOS
+ INT 10H ; BL := Paging mode
+ ; BH := Current page
+
+;-------------------------------------------------------------------------------
+; Check the video mode:
+;-------------------------------------------------------------------------------
+.SELECT
+.WHEN <CUR_MODE EQ 4> OR ; If the current mode is an old CGA
+.WHEN <CUR_MODE EQ 5> OR ; mode:
+.WHEN <CUR_MODE EQ 6> ;
+;-------------------------------------------------------------------------------
+;
+; Old CGA graphics mode (mode 4, 5 or 6)
+;
+;-------------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; Store colors of the old CGA modes:
+;-------------------------------------------------------------------------------
+ CALL SET_CGA_XLT_TAB ; Set up colors in the translation
+ ; table, NOTE: The background color
+ ; will not be set properly since the
+ ; PS/2 BIOS does not update memory
+ ; location 40:66 with the value
+ ; of the background color as CGA
+ ; does for modes 4 and 5. However
+ ; 40:66 holds the current palette
+ ; selected.
+;-------------------------------------------------------------------------------
+; Adjust the background color for modes 4,5 or 6
+;-------------------------------------------------------------------------------
+ MOV PAL_REGISTER_NB,0 ; Read the palette register number 0
+ CALL GET_PALETTE_RGB ; this register points to the color
+ ; register that contains the RGB
+ ; values of the BACKGROUND color.
+ MOV DI,0 ; DI := Index in the translation table
+ CALL RGB2XLT_TAB ; Store mapping in the translation table
+
+.WHEN <CUR_MODE EQ 11H>
+;-------------------------------------------------------------------------------
+;
+; Mode 11h (2 colors out of 256,000 colors)
+;
+;-------------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; Get the background color:
+;-------------------------------------------------------------------------------
+ MOV PAL_REGISTER_NB,0 ; Read the palette register number 0
+ CALL GET_PALETTE_RGB ; Get the RGB values for this color
+ MOV DI,0 ; DI := Index in translation table
+ CALL RGB2XLT_TAB ; Store mapping in the translation table
+;-------------------------------------------------------------------------------
+; Get the foreground color:
+;-------------------------------------------------------------------------------
+ MOV PAL_REGISTER_NB,7 ; Read the palette register for the
+ ; FOREGROUND color (palette register 7)
+ CALL GET_PALETTE_RGB ; Get the RGB values for this color
+ MOV DI,1 ; DI := Index in translation table
+ CALL RGB2XLT_TAB ; Store mapping in the translation table
+.OTHERWISE
+;-------------------------------------------------------------------------------
+;
+; The current mode is a 16 color mode
+;
+;-------------------------------------------------------------------------------
+ XOR DI,DI ; DI := Index in translation table
+ MOV CX,16 ; 16 colors to read and store
+ MOV PAL_REGISTER_NB,0 ; Palette register to read
+STORE_1_PS2_COLOR:
+ CALL GET_PALETTE_RGB ; Get the RGB values for this color
+;
+;-------Convert the RGB values to band mask or intensity and store in XLT_TAB:
+
+ CALL RGB2XLT_TAB ; Store mapping in the translation table
+ INC DI ; Get next palette register number
+ INC PAL_REGISTER_NB ;
+ LOOP STORE_1_PS2_COLOR ; Read it.
+.ENDSELECT
+
+ POP DI
+ POP CX
+ POP BX
+ POP AX
+ RET
+PAL_REGISTER_NB DB ? ; Number of the palette register to read
+SET_ROUNDUP_XLT_TAB ENDP
+
+PAGE
+;===============================================================================
+;
+; GET_PALETTE_RGB: ON THE PS/2 MODEL 50, 60 AND 80, GET THE RGB VALUES FOR A
+; PALETTE REGISTER BY READING THE CORRESPONDING COLOR REGISTER
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: PAL_REGISTER_NB = Palette register number
+; BH = Current page number
+; BL = Current paging mode
+;
+; OUTPUT: RGB.R = The RGB values obtained from the color register
+; RGB.G corresponding to the palette register specified
+; RGB.B
+;
+; CALLED BY: SET_ROUNDUP_XLT_TAB
+;
+;-------------------------------------------------------------------------------
+GET_PALETTE_RGB PROC
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH SI
+
+ MOV AL,BH ; SI := Current page number
+ CBW ;
+ MOV SI,AX ;
+;-------------------------------------------------------------------------------
+;
+; Calculte the absolute number of the first Color Register for the current page:
+; (calculated in SI)
+;
+;-------------------------------------------------------------------------------
+.IF <BL EQ PAGING_MODE_64> ; If mode is 64 Color page
+.THEN ; then
+ MOV CL,6 ; SI := Current page num * 64
+ SHL SI,CL ;
+.ELSE ; else, Mode is 16 Color page
+ MOV CL,4 ; SI := Current page num * 16
+ SHL SI,CL ;
+.ENDIF
+
+;
+;-------Read the PALETTE REGISTER
+ MOV BL,PAL_REGISTER_NB ; BL := Palette register to be read
+ MOV AX,GET_P_REG_CALL ; Read palette register call
+ INT 10H ; Call BIOS,
+ ; BH := Color register index
+ ; WITHIN the current page and is
+ ; either (0-15) or (0-63)
+ ; NOTE: SI = Absolute index (0-255) to
+ ; the first color register of the
+ ; current page and is a multiple of
+ ; either 16 or 64
+ MOV BL,BH ; BX := Index within current color page
+ XOR BH,BH ;
+
+;
+;-------Read the Color register:
+ OR BX,SI ; BX := Index of Color register to read
+ MOV AX,GET_C_REG_CALL ; Read the color register
+ INT 10H ; Call BIOS,
+ MOV RGB.R,DH ; DH := Red value read
+ MOV RGB.G,CH ; CH := Green value read
+ MOV RGB.B,CL ; CL := Blue value read
+
+ POP SI
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+ RET
+GET_PALETTE_RGB ENDP
+PAGE
+;=======================================================================
+;
+; EGA_COL2RGB : CONVERT A COLOR FROM THE EGA TO RED GREEN BLUE VALUES
+;
+;-----------------------------------------------------------------------
+;
+; INPUT: AL = 00rgbRGB ONE BYTE WHERE BIT:
+;
+; r = 1/3 of Red component
+; g = 1/3 of Green component
+; b = 1/3 of Blue component
+; R = 2/3 of Red component
+; G = 2/3 of Green component
+; B = 3/3 of Blue component
+;
+;
+; OUTPUT: RGB.R = RED component (0-63)
+; RGB.G = GREEN component (0-63)
+; RGB.B = BLUE component (0-63)
+;
+; CALLED BY: SET_UP_EGA_XLT_TABLE
+;
+;-----------------------------------------------------------------------
+;
+; DESCRIPTION: Sums up the values for each color component.
+; "2/3 of RED" means that the red gun in the display attached to the EGA
+; is firing at 2/3 of full intensity.
+;
+; Since the color intensities range from 0 to 63, "1/3" means an
+; intensity of:
+; 1/3 * 63 = 21
+;
+; LOGIC:
+;
+; Get the red component
+; Get the green component
+; Get the blue component
+;
+EGA_COL2RGB PROC NEAR
+;
+;-------Get the RED component (bit 5 and 2)
+;
+;-------Check bit 2
+ MOV RGB.R,0
+ TEST AL,100B ; "R" is on ?
+ JZ CHECK_BIT_5 ; No, check "r"
+ ADD RGB.R,TWO_THIRD ; Yes, add 2/3 RED
+CHECK_BIT_5:
+ TEST AL,100000B ; "r" is on ?
+ JZ CHECK_BIT_1 ; No, check Green
+ ADD RGB.R,ONE_THIRD ; Yes, add 1/3 RED
+;
+;-------Get the GREEN component (bit 4 and 1)
+;
+CHECK_BIT_1:
+ MOV RGB.G,0
+ TEST AL,10B ; "G" is on ?
+ JZ CHECK_BIT_4 ; No, check "g"
+ ADD RGB.G,TWO_THIRD ; Yes, add 2/3 GREEN
+CHECK_BIT_4:
+ TEST AL,10000B ; "g" is on ?
+ JZ CHECK_BIT_0 ; No, check for Blue
+ ADD RGB.G,ONE_THIRD ; Yes, add 1/3 GREEN
+;
+;-------Get the BLUE component (bit 3 and 0)
+;
+CHECK_BIT_0:
+ MOV RGB.B,0
+ TEST AL,1B ; "B" is on ?
+ JZ CHECK_BIT_3 ; No, check "b"
+ ADD RGB.B,TWO_THIRD ; Yes, add 2/3 BLUE
+CHECK_BIT_3:
+ TEST AL,1000B ; "b" is on ?
+ JZ EGA_COL2RGB_RETURN ; No, return
+ ADD RGB.B,ONE_THIRD ; Yes, add 1/3 BLUE
+EGA_COL2RGB_RETURN:
+ RET
+EGA_COL2RGB ENDP
+
+PAGE
+;===============================================================================
+;
+; RGB2INT : MAP RED GREEN BLUE VALUES TO AN INTENSITY.
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: RGB.R = A RED value (0-63)
+; RGB.G = A GREEN value (0-63)
+; RGB.B = A BLUE value (0-63)
+; DARKADJUST_VALUE= THE DARKNESS VALUE (In shared data area).
+; SWITCHES = Command line switches
+;
+; OUTPUT: AL = THE INTENSITY (0-63) NOTE: 0 = BLACK
+; 63 = BRIGHT WHITE
+;
+; WARNING: AH IS LOST
+;
+;-------------------------------------------------------------------------------
+;
+; DESCRIPTION: When the RGB values for a pixel are at their maximum
+; value, what we obtain is a bright white pixel on the screen; this is
+; the brightest color achievable and therefore, its intensity is 63.
+;
+; When no color gun is firing on the display: RGB values are 0,0,0 this
+; is no color at all and therefore maps to intensity 0.
+;
+; For intermediate colors, experimentation has shown that the eye will
+; see blue as darker than red and red as darker than green.
+;
+; On a grey rainbow from 0 - 10 where 0 is black and 10 is white:
+;
+; Blue corresponds to a grey of intensity 1
+; Red corresponds to a grey of intensity 3
+; Green corresponds to a grey of intensity 6
+;
+; Therefore, if we mix all 3 colors we obtain a grey of
+; intensity 1 + 3 + 6 = 10 (i.e.,white).
+;
+;
+; LOGIC:
+;
+; Calculate the intensity
+;
+; AL = (.6 * G) + (.3 * R) + (.1 * B)
+;
+; Adjust Darkness
+;
+; AL = AL + DARKADJUST_VALUE
+;
+RGB2INT PROC NEAR
+ PUSH BX
+ PUSH CX
+ PUSH DX
+
+ XOR AX,AX ; AL := Current component intensity
+ XOR BX,BX ; BX is used for calculations
+ XOR DX,DX ; DL := Running sum for grey intensity
+
+;-------Process /R (Reverse black and white)
+.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW> ; IF reverse is OFF
+.THEN ; THEN REVERSE BLACK AND WHITE:
+;-------Test if the color is BLACK
+ .IF <RGB.R EQ BLACK_INT> AND ; If black
+ .IF <RGB.G EQ BLACK_INT> AND ;
+ .IF <RGB.B EQ BLACK_INT> ;
+ .THEN ; then, replace it with white
+ MOV AL,WHITE_INT
+ JMP SHORT RGB2INT_END
+ .ELSEIF <RGB.R EQ WHITE_INT> AND ; else if, high-intensity white
+ .IF <RGB.G EQ WHITE_INT> AND ;
+ .IF <RGB.B EQ WHITE_INT> ;
+ .THEN ; then, replace it with black
+ MOV AL,BLACK_INT
+ JMP SHORT RGB2INT_END
+ .ELSEIF <RGB.R EQ TWO_THIRD> AND ; else if, white
+ .IF <RGB.G EQ TWO_THIRD> AND ;
+ .IF <RGB.B EQ TWO_THIRD> ;
+ .THEN ; then, replace it with black
+ MOV AL,BLACK_INT
+ JMP SHORT RGB2INT_END
+ .ENDIF
+.ENDIF
+
+;-------Calculate Green component
+ MOV AL,RGB.G ; AL := Green component
+ MOV BH,6 ;
+ MUL BH ; AX := Green * 6
+ MOV BH,10 ;
+ DIV BH ; AL := (GREEN * 6) / 10
+ ADD DL,AL ; DL := Cumulative intensity
+ MOV CH,AH ; CH := Cumulative remainder
+
+;-------Calculate Red component
+ MOV AL,RGB.R ; AL := Red component
+ MOV BH,3 ;
+ MUL BH ; AX := Red * 3
+ MOV BH,10 ;
+ DIV BH ; AL := (RED * 3) / 10
+ ADD DL,AL ; DL := Cumulative intensity
+ ADD CH,AH ; CH := Cumulative remainder
+
+;-------Calculate Blue component
+ MOV AL,RGB.B ; AX := Blue component
+ XOR AH,AH ;
+ DIV BH ; AL := BLUE / 10
+ ADD DL,AL ; DL := Cumulative intensity
+ ADD CH,AH ; CH := Cumulative remainder
+
+;-------Adjust intensity with cumulative remainder
+ XOR AX,AX
+ MOV AL,CH ; AX := Cumulative remainder
+ MOV BH,10 ; BH := 10
+ DIV BH ; AL := Total remainder / 10
+ ADD DL,AL ; DL := Cumulative intensity
+ .IF <AH GT 4> ; If remainder > 4
+ .THEN ; Then, add 1
+ INC DL ; to the intensity
+ .ENDIF
+
+;-------Adjust darkness
+ ADD DL,DS:[BP].DARKADJUST_VALUE
+
+;-------Return result
+ MOV AL,DL ; AL := sum of R,G,B intensities
+
+RGB2INT_END:
+ POP DX
+ POP CX
+ POP BX
+ RET
+RGB2INT ENDP
+
+PAGE
+;==============================================================================
+;
+; RGB2BAND: MAP RED GREEN BLUE VALUES TO A "SELECT COLOR BAND" MASK FOR
+; THE COLOR PRINTER.
+;
+;------------------------------------------------------------------------------
+;
+; INPUT: RGB.R = A RED value (0-63)
+; RGB.G = A GREEN value (0-63)
+; RGB.B = A BLUE value (0-63)
+; BP = Offset of the Shared Data Area.
+;
+; OUTPUT: AL = The Band Mask, one byte where:
+;
+; bit 0 = Color Band 1 is needed
+; bit 1 = Color Band 2 is needed
+; bit 2 = Color Band 3 is needed
+; bit 3 = Color Band 4 is needed
+;
+;
+; CALLED BY: SET_CGA_XLT_TAB
+; SET_EGA_XLT_TAB
+; SET_ROUNDUP_XLT_TAB
+; SET_MODE_13H_XLT_TAB
+; SET_MODE_F_XLT_TAB
+;
+;------------------------------------------------------------------------------
+;
+; NOTES: The RGB values in input describe a color from the screen.
+; Up to 256K different colors can be described with these RGB values.
+;
+; On the color printer, the print ribbon is composed of 4 color bands,
+; each of a different color. By overlapping these 4 bands when
+; printing, more colors can be obtained. However, the number of colors
+; that can be achieved by overlapping print bands is very limited (4 or
+; 8 colors).
+;
+; THIS MODULE SELECT THE PRINTER COLOR THAT IS THE CLOSEST TO THE
+; DESIRED SCREEN COLOR.
+;
+; The Band Mask specifies which color bands have to be overlapped to
+; obtain a color on the printer.
+;
+;
+; DESCRIPTION: Go through the list of printer colors in the SHARED DATA
+; AREA, for each of these colors, compare its RGB values with those in
+; input.
+; Get the BAND_MASK of the closest printer color.
+;
+; LOGIC:
+;
+; Locate the printer colors info structure in the shared data area:
+; COLORPRINT_PTR := BP + COLORPRINT_PTR
+;
+; Get the number of printer colors from the COLORPRINT info in the Shared
+; data area:
+; Number of colors := COLORPRINT_PTR.NUM_PRT_COLOR
+;
+; CURRENT_COLOR_PTR : First record in the COLORPRINT info structure
+; BEST_CHOICE := CURRENT_RECORD_PTR.BAND_MASK
+; MIN_DIFF := Maximum positive value
+;
+; FOR each printer color:
+; CUR_DIFF := 0
+; (* Calculate the geometric distance between the RGB values from the *)
+; (* input and those of the printer color. *)
+; Red difference := (R - CURRENT_COLOR_PTR.RED)
+; Red difference := Red difference * Red difference
+; CUR_DIFF := CUR_DIFF + Red difference
+;
+; Green difference := (G - CURRENT_COLOR_PTR.GREEN)
+; Green difference := Green difference * Green difference
+; CUR_DIFF := CUR_DIFF + Green difference
+;
+; Blue difference := (B - CURRENT_COLOR_PTR.BLUE)
+; Blue difference := Blue difference * Blue difference
+; CUR_DIFF := CUR_DIFF + Blue difference
+;
+; IF CUR_DIFF < MIN_DIFF
+; THEN BEGIN
+; MIN_DIFF := CUR_DIFF
+; BEST_CHOICE := printer color.BAND_MASK
+; END
+;
+; CURRENT_COLOR_PTR := Offset of next color
+; END (For each printer color)
+;
+; Return BEST_CHOICE
+;
+;
+RGB2BAND PROC NEAR
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+
+;-------Process /R (Reverse black and white)
+.IF <BIT DS:[BP].SWITCHES Z REVERSE_SW> ; IF reverse is OFF
+.THEN ; THEN REVERSE BLACK AND WHITE:
+;------------------------------------------------------------------------------
+;
+; REVERSE BLACK AND WHITE:
+;
+;------------------------------------------------------------------------------
+;-------Test if the color is BLACK
+ .IF <RGB.R EQ BLACK_INT> AND ; If black
+ .IF <RGB.G EQ BLACK_INT> AND ;
+ .IF <RGB.B EQ BLACK_INT> ;
+ .THEN ; then, replace it with the
+ MOV BEST_CHOICE,0 ; band mask for white
+ JMP RGB2BAND_END ; return this band mask
+ .ELSEIF <RGB.R EQ WHITE_INT> AND ; else if, high-intensity white
+ .IF <RGB.G EQ WHITE_INT> AND ;
+ .IF <RGB.B EQ WHITE_INT> ;
+ .THEN ; then, replace it with the
+ MOV RGB.R,BLACK_INT ; RGB values of black
+ MOV RGB.G,BLACK_INT
+ MOV RGB.B,BLACK_INT
+ .ELSEIF <RGB.R EQ TWO_THIRD> AND ; else if, white
+ .IF <RGB.G EQ TWO_THIRD> AND ;
+ .IF <RGB.B EQ TWO_THIRD> ;
+ .THEN ; then, replace it with the
+ MOV RGB.R,BLACK_INT ; RGB values of black
+ MOV RGB.G,BLACK_INT
+ MOV RGB.B,BLACK_INT
+ .ENDIF
+.ENDIF
+;------------------------------------------------------------------------------
+;
+; CALCULATE THE GEOMETRIC DISTANCE BETWEEN THE COLORS OF THE PIXEL AND THOSE OF
+; THE PRINTER:
+;
+;------------------------------------------------------------------------------
+ MOV BX,DS:[BP].COLORPRINT_PTR ; BX := OFFSET of COLORPRINT
+ ADD BX,BP
+ MOV MIN_DIFF,7FFFh ; No match yet, minimum diff.
+ ; is maximum POSITIVE value.
+ XOR CX,CX
+ MOV CL,DS:[BP].NUM_PRT_COLOR ; CX := Number of print colors
+
+
+INSPECT_1_PRINT_COLOR:
+ MOV CUR_DIFF,0 ; Current difference := 0
+;------------------------------------------------------------------------------
+; Calculate the Red difference:
+;------------------------------------------------------------------------------
+ MOV AL,RGB.R
+ SUB AL,[BX].RED
+;-------Elevate at the power of two
+ MOV DL,AL ; DX := Red difference
+ IMUL DL ; AX := Red diff. square
+ ADD CUR_DIFF,AX ; CURR_DIF + Red diff.
+
+;------------------------------------------------------------------------------
+; Calculate the Green difference:
+;------------------------------------------------------------------------------
+ MOV AL,RGB.G
+ SUB AL,[BX].GREEN
+;-------Elevate at the power of two
+ MOV DL,AL ; DX := Red difference
+ IMUL DL ; AX := Red diff. square
+ ADD CUR_DIFF,AX ; CURR_DIF + Green diff.
+
+;------------------------------------------------------------------------------
+; Calculate the Blue difference:
+;------------------------------------------------------------------------------
+ MOV AL,RGB.B
+ SUB AL,[BX].BLUE
+;-------Elevate at the power of two
+ MOV DL,AL ; DX := Red difference
+ IMUL DL ; AX := Red diff. square
+ ADD CUR_DIFF,AX ; CURR_DIF + Blue diff.
+
+;------------------------------------------------------------------------------
+; Check how close is this print color to the screen color:
+;------------------------------------------------------------------------------
+ MOV AX,CUR_DIFF ; If this color is better than what we
+ .IF <AX L MIN_DIFF> ; had before.
+ .THEN ;
+ MOV MIN_DIFF,AX ; then, new minimum distance;
+ MOV AL,[BX].SELECT_MASK ; get its band mask.
+ MOV BEST_CHOICE,AL ;
+ .ENDIF ;
+
+;------------------------------------------------------------------------------
+; Get offset of next COLORPRINT info record:
+;------------------------------------------------------------------------------
+ ADD BX,SIZE COLORPRINT_STR
+ LOOP INSPECT_1_PRINT_COLOR
+
+;------------------------------------------------------------------------------
+; BEST_CHOICE contains the print color with the closest RGB values
+;------------------------------------------------------------------------------
+RGB2BAND_END:
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+ MOV AL,BEST_CHOICE
+ RET
+BEST_CHOICE DB ?
+MIN_DIFF DW ?
+CUR_DIFF DW ?
+RGB2BAND ENDP
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grctrl.ext b/private/mvdm/dos/v86/cmd/graphics/grctrl.ext
new file mode 100644
index 000000000..aaa0108b7
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grctrl.ext
@@ -0,0 +1,61 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+PAGE ,132
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCTRL.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing external declarations for ;AN000;
+;; the code and data defined in GRCTRL.ASM ;AN000;
+;; ;AN000;
+;; Change History:
+;; ---------------
+;; M001 NSM 1/30/91 extern decl for old_int_10 vector
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+EXTRN DET_HW_CONFIG:NEAR ;AN000;
+EXTRN RGB:BYTE ;AN000;
+EXTRN BIOS_INT_5H:WORD ;AN000;
+
+EXTRN OLD_INT_10H:WORD ; /* M001 */
+
+EXTRN PRT_SCR:NEAR ;AN000;
+EXTRN PRINT_SCREEN_ALLOWED:BYTE ;AN000;
+EXTRN XLT_TAB:BYTE ;AN000;
+EXTRN MODE_TYPE:BYTE ;AN000;
+EXTRN CUR_MODE_PTR:WORD ;AN000;
+EXTRN CUR_MODE:BYTE ;AN000;
+EXTRN MODE_TYPE:BYTE ;AN000;
+EXTRN NB_COLORS:WORD ;AN000;
+EXTRN SCREEN_HEIGHT:WORD ;AN000;
+EXTRN SCREEN_WIDTH:WORD ;AN000;
+EXTRN NB_CHAR_COLUMNS:BYTE ;AN000;
+EXTRN CUR_PAGE:BYTE ;AN000;
+EXTRN CUR_COLUMN:WORD ;AN000;
+EXTRN CUR_ROW:WORD ;AN000;
+EXTRN NB_SCAN_LINES:WORD ;AN000;
+EXTRN SCAN_LINE_MAX_LENGTH:WORD ;AN000;
+EXTRN CUR_SCAN_LNE_LENGTH:WORD ;AN000;
+EXTRN PRT_BUF:BYTE ;AN000;
+EXTRN NB_BOXES_PER_PRT_BUF:BYTE ;AN000;
+EXTRN CUR_BOX:BYTE ;AN000;
+EXTRN BOX_H:BYTE ;AN000;
+EXTRN BOX_W:BYTE ;AN000;
+EXTRN ERROR_CODE:BYTE ;AN000;
+EXTRN ROTATE_SW:BYTE ;AN000;
+
+; EQUATES USED BY INT 10 HANDLER
+
+ALTERNATE_SELECT equ 12h ; int 10 function code
+ALT_PRT_SC_SELECT equ 20h ; sub function code
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grctrl.str b/private/mvdm/dos/v86/cmd/graphics/grctrl.str
new file mode 100644
index 000000000..7b659399e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grctrl.str
@@ -0,0 +1,112 @@
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRCTRL.STR ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing structures and equates for ;AN000;
+;; the Print Screen process. ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; PRINT SCREEN INTERNAL ERROR CODES ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+NO_ERROR EQU 0 ;AN000;
+UNABLE_TO_PRINT EQU 1 ; The procedure was unable to print the ;AN000;
+ ; screen ;AN000;
+DISPLAYMODE_INFO_NOT_FOUND EQU 2 ; There was no DISPLAYMODE info record ;AN000;
+ ; in the Shared Area for the current mode ;AN000;
+MODE_NOT_SUPPORTED EQU 4 ; This mode is not supported by this version ;AN000;
+ ; of GRAHICS. ;AN000;
+PRINTER_ERROR EQU 8 ; An error occurred while printing a byte ;AN000;
+ ; (i.e., Out of paper, etc) ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; PIXEL INTERNAL REPRESENTATION ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PIXEL_STR STRUC ;AN000;
+ R DB ? ; RED component (0 to MAX_INT) ;AN000;
+ G DB ? ; GREEN component (0 to MAX_INT) ;AN000;
+ B DB ? ; BLUE component (0 to MAX_INT) ;AN000;
+PIXEL_STR ENDS ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; VIDEO MODE TYPES ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+TXT EQU 0 ; Text ;AN000;
+APA EQU 1 ; All Points Addressable ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; BIOS INTERRUPT 10H CALL EQUATES ;AN000;
+; Note: Either AX or AH must be initialized, depending if the call is ;AN000;
+; a sub-call or not. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+READ_DOT_CALL EQU 0DH ; Read dot ;AN000;
+SET_CURSOR_CALL EQU 02H ; Set cursor on the screen ;AN000;
+READ_CURSOR_CALL EQU 03H ; Read position of the cursor on the screen ;AN000;
+READ_CHAR_CALL EQU 08H ; Read attribute/character ;AN000;
+GET_STATE_CALL EQU 0FH ; Return current video state ;AN000;
+GET_P_REG_CALL EQU 1007H ; Read a palette register (EGA, VGA) ;AN000;
+GET_C_REG_CALL EQU 1015H ; Read a color register (VGA) ;AN000;
+READ_CONFIG_CALL EQU 1A00H ; Read display adapter configuration (PS/2) ;AN000;
+PAGE_STATE_CALL EQU 101AH ; Read color page state call (PS/2) ;AN000;
+ALT_SELECT_CALL EQU 12H ; Alternate select call (AH = 12h) ;AN000;
+EGA_INFO_CALL EQU 10H ; Return EGA information (AH=12H,BH = 10H) ;AN000;
+DISP_DESC_CALL EQU 15H ; PC CONVERTIBLE display description call ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; BIOS DATA AREA EQUATES ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+BIOS_SEG EQU 40H ; BIOS segment ;AN000;
+NB_ROWS_OFFSET EQU 84H ; Number of rows displayed when in a text mode ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; CONSTANT DEFINITIONS ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+NO EQU 0 ;AN000;
+YES EQU 1 ;AN000;
+OFF EQU 0 ;AN000;
+ON EQU 1 ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; TRANSLATION TABLE DEFINITIONS ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+WHITE_INT EQU 63 ; Intensity for WHITE on the printer ;AN000;
+BLACK_INT EQU 0 ; Intensity for BLACK on the printer ;AN000;
+MAX_INT EQU WHITE_INT ; Maximum intensity for a RGB value, ;AN000;
+ ; (Red, Green, or Blue). ;AN000;
+ONE_THIRD EQU MAX_INT*1/3 ; Used to calculate Red, Green, Blue intensity ;AN000;
+TWO_THIRD EQU MAX_INT*2/3 ; values. ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; PRINTER CONTROL ASCII CODES ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+CR EQU 0DH ; Carriage return ;AN000;
+LF EQU 0AH ; Line feed ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grinst.asm b/private/mvdm/dos/v86/cmd/graphics/grinst.asm
new file mode 100644
index 000000000..a755c317f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grinst.asm
@@ -0,0 +1,1055 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I changed the default printer type from GRAPHICS to HPDEFAULT
+;** because we have a section in the profile under 'HPDEFAULT' that
+;** will satisfactorily handle all of our printers. I also changed
+;** the number of bytes for the printer type from 9 to 16 because
+;** of the RUGGEDWRITERWIDE.
+;**
+;** DOCUMENTATION NOTES: This version of GRINST.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132
+ TITLE DOS - GRAPHICS Command - Installation Modules
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - GRAPHICS Command
+;;
+;;
+;; File Name: GRINST.ASM
+;; ----------
+;;
+;; Description:
+;; ------------
+;; This file contains the installation modules for the
+;; GRAPHICS command.
+;;
+;; GRAPHICS_INSTALL is the main module.
+;;
+;; GRAPHICS_INSTALL calls modules in GRLOAD.ASM to load
+;; the GRAPHICS profile and GRPARMS.ASM to parse the command line.
+;;
+;;
+;; Documentation Reference:
+;; ------------------------
+;; OASIS High Level Design
+;; OASIS GRAPHICS I1 Overview
+;; DOS 3.3 Message Retriever Interface Supplement.
+;; TUPPER I0 Document - PARSER HIGH LEVEL DESIGN REVIEW
+;;
+;; Procedures Contained in This File:
+;; ----------------------------------
+;; GRAPHICS_INSTALL - Main installation module
+;; CHAIN_INTERRUPTS - Chain interrupts 5, 2F, EGA Save Pointers
+;; COPY_PRINT_MODULES - Throw away one set of print modules
+;;
+;;
+;; Include Files Required:
+;; -----------------------
+;; GRLOAD.EXT - Externals for profile load
+;; GRLOAD2.EXT - Externals for profile load
+;; GRCTRL.EXT - Externals for print screen control
+;; GRPRINT.EXT - Externals for print modules
+;; GRCPSD.EXT - Externals for COPY_SHARED_DATA module
+;; GRPARMS.EXT - External for GRAPHICS command line parsing
+;; GRPARSE.EXT - External for DOS parser
+;; GRBWPRT.EXT - Externals for Black and white printing modules
+;; GRCOLPRT.EXT - Externals for color printing modules
+;; GRINT2FH.EXT - Externals for Interrupt 2Fh driver.
+;;
+;; GRMSG.EQU - Equates for the GRAPHICS error messages
+;; SYSMSG.INC - DOS message retriever
+;;
+;; GRSHAR.STR - Shared Data Area Structure
+;;
+;; STRUC.INC - Macros for using structured assembly language
+;;
+;; External Procedure References:
+;; ------------------------------
+;; FROM FILE GRLOAD.ASM:
+;; LOAD_PROFILE - Main module for profile loading
+;; SYSPARSE - DOS system parser
+;; SYSDISPMSG - DOS message retriever
+;;
+;; Linkage Instructions:
+;; --------------------
+;; Refer to GRAPHICS.ASM
+;;
+;; Change History:
+;; ---------------
+;; M001 NSM 1/30/91 Install our int 10 handler also along with
+;; int 2f and int 5 handlers to take care of alt
+;; prt-sc select calls made by ANSI.SYS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE SEGMENT PUBLIC 'CODE' ;;
+ ASSUME CS:CODE,DS:CODE ;;
+ ;;
+.XLIST ;;
+ INCLUDE GRSHAR.STR ;; Include the Shared data area structure
+ INCLUDE SYSMSG.INC ;; Include DOS message retriever
+ INCLUDE STRUC.INC ;; Include macros - Structured Assembler
+ INCLUDE GRLOAD.EXT ;; Bring in external declarations
+ INCLUDE GRLOAD2.EXT ;;
+ INCLUDE GRLOAD3.EXT ;;
+ INCLUDE GRCTRL.EXT ;;
+ INCLUDE GRBWPRT.EXT ;;
+ INCLUDE GRCOLPRT.EXT ;;
+ INCLUDE GRCPSD.EXT ;;
+ INCLUDE GRINT2FH.EXT ;;
+ INCLUDE GRCTRL.EXT ;;
+ INCLUDE GRPARSE.EXT ;;
+ INCLUDE GRPARMS.EXT ;;
+ INCLUDE GRMSG.EQU ;;
+ ;;
+MSG_UTILNAME <GRAPHICS> ;; Identify ourself to Message retriever.
+ ;; Include messages
+MSG_SERVICES <MSGDATA> ;;
+MSG_SERVICES <LOADmsg,DISPLAYmsg,CHARmsg,NUMmsg> ;;
+MSG_SERVICES <GRAPHICS.CL1,GRAPHICS.CL2,GRAPHICS.CLA,GRAPHICS.CLB,GRAPHICS.CLC>
+.LIST ;;
+ ;;
+PUBLIC GRAPHICS_INSTALL ;;
+PUBLIC CHAIN_INTERRUPTS
+PUBLIC TEMP_SHARED_DATA_PTR ;;
+PUBLIC PRINTER_TYPE_PARM ;;
+PUBLIC PRINTER_TYPE_LENGTH ;;
+PUBLIC PROFILE_PATH ;;
+PUBLIC PRINTBOX_ID_PTR ;;
+PUBLIC PRINTBOX_ID_LENGTH ;;
+PUBLIC DEFAULT_BOX ;;
+PUBLIC LCD_BOX ;;
+PUBLIC NB_FREE_BYTES ;;
+PUBLIC SYSDISPMSG ;;
+PUBLIC DISP_ERROR ;;
+PUBLIC INSTALLED ;;
+PUBLIC ERROR_DEVICE ;;
+PUBLIC STDERR ;;
+PUBLIC STDOUT ;;
+PUBLIC RESIDENT_SHARED_DATA_SIZE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Install Variables
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+NO EQU 0 ;;
+YES EQU 1 ;;
+INSTALLED DB NO ;; YES if GRAPHICS already installed
+ ;;
+ ;;
+BYTES_AVAIL_PSP_OFF EQU 6 ;; Word number 6 of the PSP is the
+ ;; number of bytes available in the
+ ;; current segment
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; GRLOAD (PROFILE LOADING) INPUT PARMS:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;\/ ~~mda ----------------------------------------------------------------------------
+; Changed the default printer type from GRAPHICS to HPDEFAULT,
+; which really isn't a printer type. In the GRAPHICS.PRO
+; file there is a section that starts 'PRINTER HPDEFAULT'
+; that has all the necessary parms to support all HP printers
+; satisfactorily. Also changed the number of bytes for the
+; printer type from 9 to 16 because of the RUGGEDWRITERWIDE.
+;
+; MD 6/4/90 - this is a backwards compatibility problem. Changed default
+; back to Graphics
+
+PRINTER_TYPE_PARM DB "GRAPHICS",9 DUP(0) ; Printer type
+ ;; (default=Graphics)
+;/\ ~~mda -----------------------------------------------------------------------------
+PRINTER_TYPE_LENGTH DB 17 ;; Printer type maximum length of ASCIIZ
+PROFILE_PATH DB 128 DUP(0) ;; Profile name with full path
+ ;; (Max size for ASCIIZ is 128)
+PRINTBOX_ID_PTR DW DEFAULT_BOX ;; Offset of ASCIIZ string containing
+DEFAULT_BOX DB "STD",14 DUP(0); the printbox id. (DEFAULT = STD)
+LCD_BOX DB "LCD",14 DUP(0); ASCIIZ string for the LCD printboxID
+PRINTBOX_ID_LENGTH DB 17 ;; Max. length for the printbox id.
+ ;; ASCIIZ string
+NB_FREE_BYTES DW ? ;; Number of bytes available in our
+ ;; resident segment
+RESIDENT_SHARED_DATA_SIZE DW ? ;; Size in bytes of the RESIDENT Shared
+ ;; data area (if GRAPHICS already
+ ;; installed).
+END_OF_RESIDENT_CODE DW ? ;; Offset of the end of the code that
+ ;; has to be made resident.
+TEMP_SHARED_DATA_PTR DW ? ;; Offset of the temporary Shared area
+ ;;
+ERROR_DEVICE DW STDERR ;; Device DISP_ERROR will output
+ ;; messages to (STDERR or STDOUT)
+PAGE
+;===============================================================================
+;
+; GRAPHICS_INSTALL : INSTALL GRAPHICS.COM
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: Command line parameters
+; GRAPHICS profile - A file describing printer characteristics and
+; attributes.
+;
+; OUTPUT: If first time invoked:
+; INT 5 VECTOR and INT 2FH VECTOR are replaced; only the required
+; code for printing the screen is made resident.
+; else,
+; The resident code is updated to reflect changes in printing
+; options.
+;
+;-------------------------------------------------------------------------------
+;;
+;; DESCRIPTION:
+;;
+;; This module intalls GRAPHICS code and data.
+;;
+;; An INT 2FH driver is also installed.
+;;
+;; If this driver is already present then, we assume GRAPHICS was installed
+;; and do not install it again but, simply update the resident code.
+;;
+;; The resident code contains ONLY the code and data needed for Printing
+;; the screen. The code needed is determined according to the command line
+;; parameters and the information extracted from the printer profile.
+;;
+;; The printer profile is parsed according to the current hardware setting
+;; and also to the command line options. The information extracted from
+;; the profile is stored in a Data area shared between the installation
+;; process and the Print Screen process.
+;;
+;; A temporary Shared Data Area is FIRST built at the end of the .COM file
+;; Before building it, we verify that there is
+;; enough memory left in the current segment. If not, the installation
+;; process is aborted.
+;;
+;; This temporary Data area when completed will be copied over the
+;; installation code. Therefore, the file comprising GRAPHICS must be
+;; linked in a specific order with the installation modules being last.
+;;
+;; These modules will be overwritten by the Shared Data area and the EGA
+;; dynamic save area before we exit and stay resident.
+;;
+;; The end of the resident code is the end of the Shared Data area, anything
+;; else beyond that is not made resident.
+;;
+;; The pointer to the resident Shared Data area is declared within the
+;; Interrupt 2Fh driver. This pointer is initialized by the installation
+;; process and points to the shared data area at Print Screen time.
+;;
+;; Depending on the type of printer attached (i.e., Black and white or Color)
+;; only one set of modules is made resident during the installation.
+;;
+;; The set of print modules required is copied over the previous one at
+;; location "PRINT_MODULE_START". This location is declared within
+;; GRCOLPRT which must be linked before GRBWPRT
+;;
+;; When copying one of the 2 sets of print modules we reserve enough space
+;; for the larger of them. Therefore, if GRAPHICS is already installed but
+;; is reinvoked with a different printer type which needs a bigger set of
+;; modules: this new set of modules is simply recopied over the existing
+;; one in the resident code.
+;;
+;; The Shared Data area is copied rigth after the set of modules that we keep
+;; that is, over the unused set of modules.
+;;
+;;
+;-------------------------------------------------------------------------------
+;;
+;; Register Conventions:
+;; BP - points to start of Temp Shared Data (Transiant code)
+;;
+;; Called By:
+;; Entry point for GRAPHICS command processing.
+;;
+;; External Calls:
+;; INT 2FH, LOAD_MESSAGES, LOAD_PROFILE, PARSE_PARMS
+;; CHAIN_INTERRUPTS, COPY_SHARED_DATA, DISPLAY_MESSAGE
+;; COPY_PRINT_MODULES
+;;
+;-------------------------------------------------------------------------------
+;;
+;; LOGIC:
+;; Load the message retriever
+;; IF carry flag is set (incorrect DOS version) THEN
+;; Issue message (COMMON1)
+;; Exit
+;; ENDIF
+;;
+;; Get number of bytes available in the segment from PSP (word 6)
+;; /* This is needed since we construct a temporary Shared data area at the
+;; of the .COM file */
+;;
+;; /* Build Shared Data in temporary area */
+;; END_OF_RESIDENT_CODE := (end of .COM file)
+;; NB_FREE_BYTES := Number of bytes availables
+;;
+;; CALL PARSE_PARMS
+;; IF error THEN /* PARSE_PARMS will issue messages */
+;; Exit
+;; ENDIF
+;;
+;; CALL LOAD_PROFILE
+;; IF profile errors THEN
+;; Exit /* LOAD_PROFILE will issue messages */
+;; ENDIF
+;;
+;; Issue INT 2FH Install Check call (AX=AC00H)
+;; /* INT 2FH returns ES:[DI] pointing to the shared data area */
+;; IF already installed THEN
+;; THEN
+;; Move NO to PRINT_SCREEN_ALLOWED in resident Shared Data
+;; SHARED_DATA_AREA_PTR := DI
+;; ELSE
+;; MOV PRINT_SCREEN_ALLOWED,NO
+;; CALL CHAIN_INTERRUPTS /* Install INT 5 and INT 2FH vectors */
+;; ES := Our segment
+;; ENDIF
+;; /* Keep only Print Black and White or Print Color: */
+;; CALL COPY_PRINT_MODULES
+;; /* COPY_SHARED_DATA will terminate & stay resident */
+;; Set up registers for copy & terminate call
+;; /* reserve enough memory to handle any printer in the profile*/
+;; jump to COPY_SHARED_DATA module
+;; ELSE
+;; /* Shared Data has been built in place */
+;; move YES to PRINT_SCREEN_ALLOWED
+;; Return to DOS
+;; ENDIF
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+GRAPHICS_INSTALL PROC NEAR ;
+
+;-------------------------------------------------------------------------------
+; Load the error messages
+;-------------------------------------------------------------------------------
+ CALL SYSLOADMSG ; Load messages
+ .IF C ; If error when loading messages
+ .THEN ; then,
+ MOV CX,0 ; CX := No substitution in message
+ MOV AX,1 ; AX := msg nb. for "Invalid DOS version"
+ CALL DISP_ERROR ; Display error message
+ JMP ERROR_EXIT ; and quit
+ .ENDIF
+
+;-------------------------------------------------------------------------------
+; Get offset of where to build the TEMPORARY Shared Data area (always built)
+;-------------------------------------------------------------------------------
+ MOV BP,OFFSET LIMIT ; Build it at the end of this .COM file
+ ; (LIMIT = the offset of the last byte
+ ; of the last .OBJ file linked with
+ ; GRAPHICS)
+ MOV TEMP_SHARED_DATA_PTR,BP ;
+
+;-------------------------------------------------------------------------------
+; Determine if GRAPHICS is already installed; get the resident segment value
+;-------------------------------------------------------------------------------
+ MOV AH,PRT_SCR_2FH_NUMBER ; Call INT 2FH (the Multiplex interrupt)
+ XOR AL,AL ; for Print Screen handler
+ INT 2FH ;
+
+ .IF <AH EQ 0FFH> ; IF already installed
+ .THEN ; then,
+ ;----------------------------------------------------------------------------
+ ; GRAPHICS is already installed: Get pointer to the EXISTING Shared Data area
+ ;----------------------------------------------------------------------------
+ MOV INSTALLED,YES ; Say it's installed
+ MOV AX,ES ; Get the segment and offset of the
+ MOV SHARED_DATA_AREA_PTR,DI; resident Shared Data area.
+ MOV RESIDENT_CODE_SEG,AX ; (returned in ES:DI)
+
+ MOV AX,ES:[DI].SD_TOTAL_SIZE ; CX := Size of the existing Shared area
+ MOV MAX_BLOCK_END, AX
+
+ ; Disable print screen because we will
+ MOV ES:PRINT_SCREEN_ALLOWED,NO ; be updating the resident code.
+ .ELSE ; ELSE, not installed:
+ ;------------------------------------------------------------------------
+ ; GRAPHICS is NOT installed: RESIDENT shared data area is in OUR segment
+ ;------------------------------------------------------------------------
+ PUSH CS ; The Shared Data area will be in our
+ POP RESIDENT_CODE_SEG ; segment.
+ .ENDIF
+;-------------------------------------------------------------------------------
+; Determine in AX how many bytes are available for building the TEMPORARY SHARED
+; DATA AREA:
+;-------------------------------------------------------------------------------
+
+; MOV AX,ES:BYTES_AVAIL_PSP_OFF;AX := Number of bytes availables in
+ ; the current segment (as indicated in PSP)
+;M000; mov ax,0FFFFh ; Assume available to top of seg
+;M000;
+;Check for amount of memory that is free without assuming 64K. This causes
+;crashes if it is loaded into UMBs.
+;
+ push cx
+ mov ax,offset Limit
+ add ax,15
+ mov cl,4
+ shr ax,cl ;round up to nearest para
+ mov cx,es ;get our PSP seg
+ add ax,cx ;end of load image
+ sub ax,es:[2] ;es:[2] = top of our memory block
+ neg ax ;ax = # of paras free
+ test ax,0f000h ;greater than 64K bytes?
+ jz lt64K ;no
+ mov ax,0ffffh ;stop at 64K
+ jmp short gotfree
+lt64K:
+ mov cl,4
+ shl ax,cl ;ax = # of bytes free above us
+gotfree:
+ pop cx
+;
+;M000; End changes;
+;
+
+;;; .IF <AX B <OFFSET LIMIT>> ; If there is no bytes available past
+;;; .THEN ; the end of our .COM file
+;;; XOR AX,AX ; then, AX := 0 bytes available
+;;; .ELSE ;
+;;; SUB AX,OFFSET LIMIT ; else, AX := Number of FREE bytes
+;;; .ENDIF ; in this segment
+
+;---AX = Number of bytes in our segment available for building the Temp Shared
+;---data area.
+;---IF ALREADY INSTALLED: Get the size of the existing Shared data area.
+;---Since the temporary shared data area will be copied over the resident
+;---shared data area, we do not want to build it any bigger than the one
+;---it will overwrite. Therefore we do not give to LOAD_PROFILE more space
+;---than the size of the existing Shared data area.
+ .IF <INSTALLED EQ YES> ; If already installed then,
+ .THEN
+ PUSH CS:RESIDENT_CODE_SEG ; ES:[DI] := Resident Shared data area
+ POP ES ;
+ MOV DI,SHARED_DATA_AREA_PTR ;
+ MOV CX,ES:[DI].SD_TOTAL_SIZE ; CX := Size of the existing Shared area
+ MOV RESIDENT_SHARED_DATA_SIZE,CX ; Save size for LOAD_PROFILE
+ .IF <AX A CX> ; If AX > size of existing SDA
+ MOV AX,CX ; then, AX := Size of existing Shared area
+ .ENDIF ;
+ .ENDIF
+ ; NB_FREE_BYTES := Number of bytes
+ MOV NB_FREE_BYTES,AX ; available for
+ ; building the TEMPORARY shared area
+;-------------------------------------------------------------------------------
+; Parse the command line parameters
+;-------------------------------------------------------------------------------
+ MOV BYTE PTR CS:[BP].SWITCHES,0 ; Init. the command line switches
+ PUSH CS ; Set ES to segment containing the PSP
+ POP ES
+ CALL PARSE_PARMS ; Set switches in the Temp. Shared Area
+ .IF C ; If error when parsing the command
+ .THEN ; line then, EXIT
+ JMP ERROR_EXIT
+ .ENDIF
+;-------------------------------------------------------------------------------
+; Parse the printer profile - Build the temporary Shared data area
+;-------------------------------------------------------------------------------
+ CALL LOAD_PROFILE ; Builds profile info in Temporary Shared
+ ; Data
+ .IF C ; If error when loading the profile
+ .THEN ; then, EXIT
+ JMP ERROR_EXIT
+ .ENDIF
+
+;-------------------------------------------------------------------------------
+; Check if /B was specified with a BLACK and WHITE printer:(invalid combination)
+;-------------------------------------------------------------------------------
+ .IF <CS:[BP].PRINTER_TYPE EQ BLACK_WHITE> AND
+ .IF <BIT CS:[BP].SWITCHES NZ BACKGROUND_SW>
+ .THEN
+ MOV AX,INVALID_B_SWITCH ; Error := /B invalid with B&W prt.
+ MOV CX,0 ; No substitution
+ CALL DISP_ERROR ; Display error message
+ JMP SHORT ERROR_EXIT ; and quit
+ .ENDIF
+
+;-------------------------------------------------------------------------------
+;
+; RELOCATE THE TEMPORARY SHARED DATA AREA AND THE SET OF REQUIRED PRINT MODULES
+;
+; (Discard the set of print modules not needed with the printer attached and
+; discard all the code not used at print screen time).
+;
+; If GRAPHICS is already installed then, we copy the
+; Shared Data area and the print modules over the previous ones installed in
+; resident memory.
+;
+; If we are installed for the first time then, we copy those over the
+; installation modules before we exit and stay resident.
+;
+; A temporaty Shared Data area is always created even if a resident one
+; already exist (it is then, copied over), a set of print modules is recopied
+; only if needed.
+;
+; NOTE: END_OF_RESIDENT_CODE points to the first location over which code
+; may be relocated. After data or code is relocated, END_OF_RESIDENT_CODE
+; is updated and points to the next available location for copying code
+; that will stay resident.
+;-------------------------------------------------------------------------------
+;-------------------------------------------------------------------------------
+; Initialize the pointer to the next available location for resident code:
+;-------------------------------------------------------------------------------
+ .IF <INSTALLED EQ NO> ; If not installed
+ .THEN ; then,
+ MOV END_OF_RESIDENT_CODE,OFFSET PRINT_MODULE_START
+ .ENDIF ; we make everything up to the print
+ ; modules resident code.
+;-------------------------------------------------------------------------------
+; Keep only the set of print modules that is needed:
+;-------------------------------------------------------------------------------
+ CALL COPY_PRINT_MODULES ; Updates END_OF_RESIDENT_CODE
+;-------------------------------------------------------------------------------
+; Replace the interrupt vectors and install the EGA dynamic area (if needed)
+;-------------------------------------------------------------------------------
+ .IF <INSTALLED EQ NO> ; If not already installed
+ .THEN ; then,
+;------Release evironment vector ;AN002;
+ CALL RELEASE_ENVIRONMENT ; release unneeded environment vector ;AN002;
+;------Replace the interrupt vectors
+ MOV PRINT_SCREEN_ALLOWED,NO ; Disable Print Screen
+ CALL CHAIN_INTERRUPTS ; Replace the interrupt vectors
+ ; (END_OF_RESIDENT_CODE is updated)
+ CALL DET_HW_CONFIG ; Find what display adapter we got
+ .IF <CS:[BP].HARDWARE_CONFIG EQ EGA>;If EGA is present
+ .THEN ; then,
+ CALL INST_EGA_SAVE_AREA ; Install the EGA dynamic save area
+ .ENDIF ; (END_OF_RESIDENT_CODE is updated)
+;------Calculate the size of the resident code
+ MOV DX,END_OF_RESIDENT_CODE ; DX := End of resident code
+ ADD DX,CS:[BP].SD_TOTAL_SIZE; Add size of Shared Data area
+ MOV CL,4 ;
+ SHR DX,CL ; convert to paragraphs
+ INC DX ; and add 1
+;------Set AX to DOS exit function call - (COPY_SHARED_DATA will exit to DOS)
+ MOV AH,31H ; Function call to terminate but stay
+ XOR AL,AL ; resident
+ .ELSE
+ MOV AH,4CH ; Function call to terminate
+ XOR AL,AL ; (EXIT to calling process)
+ .ENDIF
+
+;-------------------------------------------------------------------------------
+; Copy the temporary shared data area in the resident code
+;-------------------------------------------------------------------------------
+ MOV CX,CS:[BP].SD_TOTAL_SIZE; CX := MOVSB count for COPY_SHARED_DATA
+ MOV SI,BP ; DS:SI := Temporary Shared data area
+ PUSH RESIDENT_CODE_SEG ; ES:DI := Resident Shared data area:
+ POP ES ;
+ .IF <INSTALLED EQ NO> ; If not installed
+ .THEN ; then,
+ MOV DI,END_OF_RESIDENT_CODE; DI := End of resident code
+ MOV BP,DI ; BP := New resident Shared data area
+ MOV SHARED_DATA_AREA_PTR,DI; Update pointer to resident Shar. area
+ .ELSE ; else,
+ MOV DI,SHARED_DATA_AREA_PTR ; DI := Existing Shared data area
+ MOV BP,DI ; BP = DI:= Existing Shared data area
+ .ENDIF
+ JMP COPY_SHARED_DATA ; Jump to proc that copies area in new
+ ; part of memory and exits to DOS
+ERROR_EXIT:
+ .IF <INSTALLED EQ YES> ; If we are already installed, re-enable
+ MOV ES,RESIDENT_CODE_SEG ; print screens
+ MOV ES:PRINT_SCREEN_ALLOWED,YES
+ .ENDIF ;
+ ;
+ MOV AH,4CH ; Function call to terminate
+ MOV AL,1 ; (EXIT to calling process)
+ INT 21H
+GRAPHICS_INSTALL ENDP
+
+PAGE
+;===============================================================================
+;
+; INST_EGA_SAVE_AREA : INSTALL A DYNAMIC SAVE AREA FOR THE EGA PALETTE REGISTERS
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: DS = Data segment for our code
+; END_OF_RESIDENT_CODE = Offset of the end of the resident code
+;
+; OUTPUT: END_OF_RESIDENT_CODE is updated to point to the end of the code
+; that will stay resident.
+; SAVE_AREA_PTR in BIOS segment is updated.
+;
+;-------------------------------------------------------------------------------
+;;
+;; Data Structures Referenced:
+;; Shared Data Area
+;;
+;; Description:
+;; ************* The EGA Dynamic Save Area will be built over top
+;; ** NOTE ** of the profile loading modules (file GRLOAD.ASM)
+;; ************* to avoid having to relocate this area just before
+;; terminating. This is safe since the maximum memory used is
+;; 288 bytes and the profile loading modules are MUCH larger than
+;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after
+;; GRPRINT.ASM.
+;;
+;; BIOS will update the dynamic save area whenener it's aware the palette
+;; registers have been updated.
+;;
+;; BIOS 4A8H BIOS SAVE EGA DYNAMIC
+;; POINTER: POINTER TABLE SAVE AREA
+;; ÚÄÄÄÄÄÄÄÄ¿ ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ (16 first bytes are the 16
+;; ³ *ÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄ>³ ³ EGA palette registers)
+;; ÀÄÄÄÄÄÄÄÄÙ ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÚÄÄÄÄÄÄÄÄÄÄÄ¿
+;; ³ *ÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄ>ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ .
+;; ³ ³ .
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ . 256 bytes
+;; ³ ³ .
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ .
+;; ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ÃÄÄÄÄÄÄÄÄÄÄÄÄ´ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄ´
+;; ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÙ
+;;
+;; Called By:
+;; GRAPHICS_INSTALL
+;;
+;; External Calls:
+;;
+;; Logic:
+;; IF EGA Dynamic Save Area NOT established THEN
+;; /* Required since default table is in ROM */
+;; IF Save Table is in ROM
+;; Replicate all the Save Area Table in resident RAM just before
+;; the Shared Data Area
+;; ENDIF
+;; Allocate 256 bytes for EGA Dynamic Save Area just before the
+;; Shared Data Area
+;; Update END_OF_RESIDENT_CODE
+;; ENDIF
+;; RETURN
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BIOS_SAVE_PTR EQU 4A8H ;; Offset of the BIOS Save Ptr area
+SAVE_AREA_LEN EQU 8*4 ;; There are 8 pointers in the Save area
+EGA_DYNAMIC_LEN EQU 256 ;; Length of the EGA dynamic save area
+; Standard default colours for the Enhanced Graphics Adapter: (rgbRGB values)
+; The following table is necessary in order to initialize the EGA DYNAMIC
+; SAVE AREA when creating it.
+EGA_DEFAULT_COLORS DB 00h ;; Black
+ DB 01h ;; Blue
+ DB 02h ;; Green
+ DB 03h ;; Cyan
+ DB 04h ;; Red
+ DB 05h ;; Magenta
+ DB 14h ;; Brown
+ DB 07h ;; White
+ DB 38h ;; Dark Grey
+ DB 39h ;; Light Blue
+ DB 3Ah ;; Light Green
+ DB 3Bh ;; Light Cyan
+ DB 3Ch ;; Light Red
+ DB 3Dh ;; Light Magenta
+ DB 3Eh ;; Yellow
+ DB 3Fh ;; Bright white
+ DB 00h ;; OVERSCAN register
+
+INST_EGA_SAVE_AREA PROC NEAR
+PUSH AX
+PUSH CX
+PUSH DX
+PUSH SI
+PUSH DI
+PUSH ES
+;-------------------------------------------------------------------------------
+; Get the BIOS save pointer table
+;-------------------------------------------------------------------------------
+XOR AX,AX ; ES := segment 0
+MOV ES,AX
+LES SI,ES:DWORD PTR BIOS_SAVE_PTR ; ES:[SI] =Current BIOS save table
+.IF <<WORD PTR ES:[SI]+4> EQ 0> AND ; IF the dynamic save are pointer is
+.IF <<WORD PTR ES:[SI]+6> EQ 0> ; null then, it's not defined
+.THEN ; and we have to define it:
+ ;---------------------------------------------------------------------------
+ ; The Dynamic EGA save area is NOT DEFINED:
+ ;---------------------------------------------------------------------------
+ MOV BYTE PTR ES:[SI]+4,0FFH ; Try to write a byte in the table
+ PUSH AX ; (PUSH AX, POP AX used to create a
+ POP AX ; small delay)
+ .IF <<WORD PTR ES:[SI]+4> NE 0FFH>;If we can't read our byte back then,
+ .THEN ; the Save Ptrs table is in ROM
+ ;------------------------------------------------------------------------
+ ; The Save pointer table is in ROM;
+ ; Copy the BIOS save pointer table from ROM to within our .COM file
+ ;------------------------------------------------------------------------
+ PUSH ES ; DS:SI := Offset of BIOS save ptrs table
+ POP DS ;
+ PUSH CS ; ES:DI := The next available location
+ POP ES ; for installing resident code
+ MOV DI,CS:END_OF_RESIDENT_CODE ; within our .COM file
+ MOV CS:OUR_SAVE_TAB_OFF,DI ;
+ MOV CX,SAVE_AREA_LEN ; CX := Length of the table to copy
+ REP MOVSB ; Replicate the Save Table
+ PUSH CS
+ POP DS ; Reestablish our data segment
+ ;------------------------------------------------------------------------
+ ; Adjust END_OF_RESIDENT_CODE to the next offset available for copying
+ ; resident code and data.
+ ;------------------------------------------------------------------------
+ ADD END_OF_RESIDENT_CODE,SAVE_AREA_LEN
+ ;------------------------------------------------------------------------
+ ; Set the pointer in OUR Save ptr table to our EGA dynamic save area
+ ; which we create right after the Save pointer table.
+ ;------------------------------------------------------------------------
+ MOV DI,OUR_SAVE_TAB_OFF ; DS:[DI] := Our BIOS save ptr tab
+ MOV AX,END_OF_RESIDENT_CODE; Store its offset
+ MOV DS:[DI]+4,AX ;
+ MOV WORD PTR DS:[DI]+6,DS ; Store its segment
+ ;------------------------------------------------------------------------
+ ; Initialize our DYNAMIC SAVE AREA with the 16 standard EGA colors
+ ;------------------------------------------------------------------------
+
+ LEA SI,EGA_DEFAULT_COLORS ; DS:[SI] := EGA 16 Default colors
+ MOV DI,END_OF_RESIDENT_CODE ; ES:[DI] := DYNAMIC SAVE AREA
+ MOV CX,17 ; CX := Number of colors
+ REP MOVSB ; Initialize the Dynamic save area
+ ;------------------------------------------------------------------------
+ ; Set the BIOS Save Pointer to our table of Save pointers:
+ ;------------------------------------------------------------------------
+ CLI
+ XOR AX,AX ; ES:BIOS_SAVE_PTR := Our save table:
+ MOV ES,AX
+ MOV AX,OUR_SAVE_TAB_OFF
+ MOV ES:BIOS_SAVE_PTR,AX
+ MOV ES:BIOS_SAVE_PTR+2,DS
+ STI
+ .ELSE ; ELSE save pointer table is in RAM
+ ;------------------------------------------------------------------------
+ ; ELSE, the BIOS save pointer table is in RAM:
+ ;------------------------------------------------------------------------
+ ;------------------------------------------------------------------------
+ ; Set the pointer in THEIR Save ptr table to OUR EGA dynamic save area
+ ;------------------------------------------------------------------------
+ MOV WORD PTR ES:[SI]+6,DS ; ES:[SI] = The existing table in RAM
+ MOV AX,END_OF_RESIDENT_CODE
+ MOV ES:[SI]+4,AX
+ .ENDIF ; ENDIF save pointer table is in ROM
+ ;-----------------------------------------------------------------------------
+ ; Adjust END_OF_RESIDENT_CODE to the next offset available for copying
+ ; resident code and data.
+ ;-----------------------------------------------------------------------------
+ ADD END_OF_RESIDENT_CODE,EGA_DYNAMIC_LEN
+.ENDIF
+POP ES
+POP DI
+POP SI
+POP DX
+POP CX
+POP AX
+
+RET
+OUR_SAVE_TAB_OFF DW ?
+INST_EGA_SAVE_AREA ENDP
+PAGE
+;===============================================================================
+;
+; CHAIN_INTERRUPTS : INSTALL INT 5 ,INT 10 AND INT 2FH VECTORS
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: DS = Data segment for our code
+; END_OF_RESIDENT_CODE = Offset of the end of the resident code
+;
+; OUTPUT: OLD_INT_2FH (within INT_2FH_DRIVER)
+; BIOS_INT_5H (within PRT_SCR module)
+; OLD_INT_10H
+; END_OF_RESIDENT_CODE is updated to point to the end of the code
+; that will stay resident.
+; SAVE_AREA_PTR in BIOS segment is updated if an EGA adapter is found
+;
+;-------------------------------------------------------------------------------
+;;
+;; Data Structures Referenced:
+;; Shared Data Area
+;;
+;; Description:
+;; Install Interrupts 5 ,10 and 2FH. The old vectors are saved.
+;;
+;; Called By:
+;; GRAPHICS_INSTALL
+;;
+;; External Calls:
+;; DOS INT 21H Replace vector AH=25h
+;; DOS INT 21H Get vector AH=35h
+;;
+;; Logic:
+;; Save interrupt 5 vector in BIOS_INT_5H
+;; Point interrupt 5 to PRT_SCR module
+;; Save interrupt 2FH vector in BIOS_INT_2FH
+;; Point interrupt 2FH to INT_2FH_DRIVER module
+;; Save interrupt 10h vector in OLD_INT_10h
+;; point interrupt 10h to INT_10H_DRIVER
+;; RETURN
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CHAIN_INTERRUPTS PROC NEAR ;;
+ PUSH ES
+ PUSH BX
+
+;-------------------------------------------------------------------------------
+; Replace INTERRUPT 5 vector
+;-------------------------------------------------------------------------------
+ MOV AX,3505H ; Get vector for int 5 request
+ INT 21H ; Call DOS
+
+ MOV CS:BIOS_INT_5H,BX ; Save the old vector
+ MOV CS:BIOS_INT_5H+2,ES
+
+ MOV DX,OFFSET PRT_SCR ; DS:DX := Offset of our Print Screen
+
+ MOV AX,2505H ; Replace vector for int 5 request
+ INT 21H ; Call DOS
+
+;-------------------------------------------------------------------------------
+; Replace INTERRUPT 2FH vector
+;-------------------------------------------------------------------------------
+ MOV AX,352FH ; Get vector for int 2FH request
+ INT 21H ; Call DOS
+
+ MOV WORD PTR OLD_INT_2FH,BX ; Save the old vector
+ MOV WORD PTR OLD_INT_2FH+2,ES
+
+ MOV DX,OFFSET INT_2FH_DRIVER; DS:DX := Offset of our 2FH handler
+
+ MOV AX,252FH ; Replace vector for int 2FH request
+ INT 21H ; Call DOS
+; /* M001 BEGIN */
+;------------------------------------------------------------------------------
+; Replace INTERRUPT 10 vector
+;------------------------------------------------------------------------------
+ MOV AX,3510H ; Get vector for int10h request
+ INT 21H ; Call DOS
+
+ MOV WORD PTR OLD_INT_10H,BX ; Save the old vector
+ MOV WORD PTR OLD_INT_10H+2,ES
+
+ MOV DX,OFFSET INT_10H_DRIVER; DS:DX := Offset of our 2FH handler
+
+ MOV AX,2510H ; Replace vector for int10H request
+ INT 21H ; Call DOS
+; /* M001 END */
+
+ POP BX
+ POP ES
+ RET
+
+CHAIN_INTERRUPTS ENDP
+;===============================================================================
+;
+; COPY_PRINT_MODULES: COPY THE SET OF PRINT MODULES NEEDED OVER THE PREVIOUS ONE
+;
+;-------------------------------------------------------------------------------
+;
+; INPUT: BP = Offset of the temporary Shared Data area
+; END_OF_RESIDENT_CODE = Location of the set of COLOR modules
+; (if first time installed)
+; CS:[BP].PRINTER_TYPE = Printer type NEEDED
+; RESIDENT_CODE_SEG = Segment containing the resident code
+;
+; OUTPUT: END_OF_RESIDENT_CODE = End of the print modules IS UPDATED
+; (If first time installed)
+;
+;-------------------------------------------------------------------------------
+;;
+;; Data Structures Referenced:
+;; Control Variables
+;; Shared Data Area
+;;
+;; Description:
+;; This module trashes one set of print modules (Color or Black & White)
+;; depending on the type of printer attached. Since the Shared Data
+;; (resident version) will reside immediately after the print modules,
+;; END_OF_RESIDENT_CODE will be set by this modules.
+;;
+;; The set of COLOR modules is already at the rigth located when installing
+;; GRAPHICS for the first time. This is true since, the color modules are
+;; linked before the black and white modules.
+;;
+;; Therefore, if we are installing GRAPHICS for the first time and we need
+;; the color modules then, we do not need to relocate any print modules.
+;;
+;; When installing GRAPHICS again we first check what is the resident set,
+;; we recopy a new set only if needed.
+;;
+;; Called By:
+;; GRAPHICS_INSTALL
+;;
+;; Logic:
+;; IF color printer THEN
+;; SI := Offset of BW_PRINT_MODULES
+;; ELSE
+;; SI := Offset of COLOR_PRINT_MODULES
+;; ENDIF
+;; REP MOVSB ; Copy the set of modules
+;; END_OF_RESIDENT_CODE := end of the set of modules
+;; RETURN
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+COPY_PRINT_MODULES PROC NEAR
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH SI
+ PUSH DI
+ PUSH ES
+
+;-------------------------------------------------------------------------------
+; Determine if we need to relocate the set of print modules, if so, set the
+; source address (DS:SI), the destination address (ES:DI) and the number of
+; bytes to copy (CX).
+;-------------------------------------------------------------------------------
+ PUSH CS:RESIDENT_CODE_SEG ; ES := Segment containing the resident
+ POP ES ; code (Where to copy modules)
+ MOV DI,OFFSET PRINT_MODULE_START ; ES:[DI] := Resident print modules
+
+ .IF <INSTALLED EQ NO> ; IF not installed
+ .THEN ; THEN,
+ ; We relocate the print modules
+ ; at the end of the resident code:
+ ; (this is where the color set is)
+ .IF <CS:[BP].PRINTER_TYPE EQ BLACK_WHITE> ; IF we don't want the color set
+ .THEN ; THEN,
+ MOV NEED_NEW_PRINT_MODULES,YES ; Say we need new modules
+ MOV SI,OFFSET PRINT_BW_APA ; DS:[SI] := Black and white modules
+ MOV CX,LEN_OF_BW_MODULES ; CX := Length of B&W modules
+ .ENDIF ;
+
+ .ELSE ; ELSE, (We are already installed)
+ MOV BX,SHARED_DATA_AREA_PTR ; BX := Offset of Shared Data area
+ MOV AL,ES:[BX].PRINTER_TYPE ; AL := Type of the resident set
+ .IF <AL NE CS:[BP].PRINTER_TYPE> ; IF resident set is not the one
+ .THEN ; we need THEN,
+ MOV NEED_NEW_PRINT_MODULES,YES ; Say we need a new set.
+ .IF <CS:[BP].PRINTER_TYPE EQ COLOR>; IF its color we need then,
+ MOV SI,OFFSET PRINT_COLOR ; DS:[SI] := Color set
+ MOV CX,LEN_OF_COLOR_MODULES ; CX := Length of color mod.
+ .ELSE ; ELSE
+ MOV SI,OFFSET PRINT_BW_APA ; DS:[SI] := B&W set
+ MOV CX,LEN_OF_BW_MODULES ; CX := Length of B&W mod.
+ .ENDIF ; ENDIF we need the color set
+ .ENDIF ; ENDIF we need a new set
+ .ENDIF ; ENDIF we are not installed
+
+
+;-------------------------------------------------------------------------------
+; If needed: Copy the required set of print modules
+;-------------------------------------------------------------------------------
+ .IF <NEED_NEW_PRINT_MODULES EQ YES>
+ .THEN
+ CLD ; Clear the direction flag
+ REP MOVSB ; Copy the set of print modules
+ .ENDIF ; ENDIF needs to copy the print modules
+
+;-------------------------------------------------------------------------------
+; Set END_OF_RESIDENT_CODE pointer to the end of the print modules:
+; (Reserve enough space to store the larger set of modules on a
+; subsequent install)
+;-------------------------------------------------------------------------------
+ .IF <INSTALLED EQ NO> ; IF first time installed
+ .THEN ; THEN,
+ MOV CX,LEN_OF_COLOR_MODULES ; Adjust END_OF_RESIDENT_CODE to
+ .IF <CX G LEN_OF_BW_MODULES> ; contains the larger set of modules.
+ .THEN ;
+ ADD END_OF_RESIDENT_CODE,LEN_OF_COLOR_MODULES
+ .ELSE
+ ADD END_OF_RESIDENT_CODE,LEN_OF_BW_MODULES
+ .ENDIF ;
+ .ENDIF
+
+ POP ES
+ POP DI
+ POP SI
+ POP CX
+ POP BX
+ POP AX
+ RET
+NEED_NEW_PRINT_MODULES DB NO ; True if print modules needed must be
+ ; copied over the other set of print
+ ; modules
+COPY_PRINT_MODULES ENDP
+ ;AN002;
+PAGE ;AN002;
+;===============================================================================;AN002;
+; ;AN002;
+; PROCEDURE_NAME: RELEASE_ENVIRONMENT ;AN002;
+; ;AN002;
+; INPUT: None. ;AN002;
+; ;AN002;
+; OUTPUT: Environment vector released. ;AN002;
+; ;AN002;
+;-------------------------------------------------------------------------------;AN002;
+RELEASE_ENVIRONMENT PROC NEAR ;AN002;
+ PUSH AX ; save regs ;AN002;
+ PUSH BX ;AN002;
+ PUSH ES ;AN002;
+ MOV AH,62H ; function for get the PSP segment ;AN002;
+ INT 21H ; invoke INT 21h ;AN002;
+ MOV ES,BX ; BX contains PSP segment - put in ES ;AN002;
+ MOV BX,WORD PTR ES:[2CH] ; get segment of environmental vector ;AN002;
+ MOV ES,BX ; place segment in ES for Free Memory ;AN002;
+ MOV AH,49H ; Free Allocated Memory function call ;AN002;
+ INT 21H ; invoke INT 21h ;AN002;
+ POP ES ; restore regs ;AN002;
+ POP BX ;AN002;
+ POP AX ;AN002;
+ RET ;AN002;
+RELEASE_ENVIRONMENT ENDP ;AN002;
+
+PAGE
+;===============================================================================
+;
+; PROCEDURE_NAME: DISP_ERROR
+;
+; INPUT: AX := GRAPHICS message number (documented in GRMSG.EQU)
+; CX := Number of substitutions (Needed by SYSDISPMSG)
+; DS:[SI] := Substitution list (needed only if CX <> 0)
+;
+; OUTPUT: Error message is displayed on STANDARD ERROR OUTPUT (STDERR)
+;
+;-------------------------------------------------------------------------------
+DISP_ERROR PROC NEAR
+ PUSH BX
+ PUSH DI
+ PUSH SI
+ PUSH BP
+
+ MOV BX,ERROR_DEVICE ; Issue message to standard error
+ XOR DL,DL ; No input
+ MOV DH,UTILITY_MSG_CLASS;It's one of our messages
+ CALL SYSDISPMSG ; display error message
+
+ POP BP
+ POP SI
+ POP DI
+ POP BX
+ RET
+DISP_ERROR ENDP
+
+include msgdcl.inc
+
+CODE ENDS
+ END
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grinst.ext b/private/mvdm/dos/v86/cmd/graphics/grinst.ext
new file mode 100644
index 000000000..4fd1ddf1b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grinst.ext
@@ -0,0 +1,49 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINST.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRINIT.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN GRAPHICS_INSTALL:NEAR ;; ;AN000;
+ EXTRN SYSDISPMSG:NEAR ;; ;AN000;
+ EXTRN DISP_ERROR:NEAR ;; ;AN000;
+ EXTRN TEMP_SHARED_DATA_PTR:WORD ;; ;AN000;
+ ;; ;AN000;
+ EXTRN PRINTER_TYPE_PARM:BYTE ;; ;AN000;
+ EXTRN PRINTER_TYPE_LENGTH:BYTE ;; ;AN000;
+ EXTRN INSTALLED:BYTE ;; ;AN000;
+ EXTRN PROFILE_PATH:BYTE ;; ;AN000;
+ EXTRN PRINTBOX_ID_PTR:WORD ;; ;AN000;
+ EXTRN PRINTBOX_ID_LENGTH:BYTE ;; ;AN000;
+ EXTRN DEFAULT_BOX:BYTE ;; ;AN000;
+ EXTRN LCD_BOX:BYTE ;; ;AN000;
+ EXTRN ERROR_DEVICE:WORD ;; ;AN000;
+ ;; ;AN000;
+ EXTRN STDERR:ABS ;; ;AN000;
+ EXTRN STDOUT:ABS ;; ;AN000;
+ ;; ;AN000;
+ EXTRN NB_FREE_BYTES:WORD ;; ;AN000;
+ EXTRN RESIDENT_SHARED_DATA_SIZE:WORD;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grint2fh.asm b/private/mvdm/dos/v86/cmd/graphics/grint2fh.asm
new file mode 100644
index 000000000..0340ba347
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grint2fh.asm
@@ -0,0 +1,227 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Interrupt 2FH Driver ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINT2FH.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the Interrupt 2FH driver. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; INT_2FH_DRIVER - Interrupt 2FH driver ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; GRLOAD.EXT - Externals for profile load ;AN000;
+;; GRCTRL.EXT - Externals for print screen control ;AN000;
+;; GRPRINT.EXT - Externals for print modules ;AN000;
+;; GRCPSD.EXT - Externals for COPY_SHARED_DATA module ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; Calls next Int 2FH handler in the chain. ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History:
+;; ---------------
+;; M001 NSM 1/30/91 New int 10 handler to trap alt-prt-sc select
+;; calls made by ANSI.SYS. For these calls, we
+;; we need to reinstall our int 5 handler again
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ;; ;AN000;
+ PUBLIC OLD_INT_2FH ;; ;AN000;
+ PUBLIC INT_2FH_DRIVER ;; ;AN000;
+ PUBLIC INT_10H_DRIVER ;; ;AN000;
+ PUBLIC PRT_SCR_2FH_NUMBER ;; ;AN000;
+ PUBLIC RESIDENT_CODE_SEG ;; ;AN000;
+ PUBLIC SHARED_DATA_AREA_PTR ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+.XLIST ;AN000;
+INCLUDE STRUC.INC ;AN000;
+INCLUDE GRINST.EXT ;AN000;
+INCLUDE GRCTRL.EXT ;AN000;
+INCLUDE GRCPSD.EXT ;AN000;
+.LIST ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module: INT_2FH_DRIVER ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Respond to GRAPHICS Int 2FH calls. ;AN000;
+;; The following calls are handled: ;AN000;
+;; ;AN000;
+;; AL = 0 ù Install Check ;AN000;
+;; ;AN000;
+;; Invoked By: ;AN000;
+;; INT 2FH instruction. ;AN000;
+;; ;AN000;
+;; Modules Called: ;AN000;
+;; Lower level INT 2FH handlers. ;AN000;
+;; ;AN000;
+;; Input Registers: ;AN000;
+;; Install Check - AH=ACH AL=0 ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Output Registers: ;AN000;
+;; Install Check: IF GRAPHICS installed ;AN000;
+;; AH=FFH AL=FFH ;AN000;
+;; ES : DI points to Shared Data Area ;AN000;
+;; ELSE ;AN000;
+;; AH=ACH AL=0 ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; IF AH=ACH THEN ;AN000;
+;; IF AL=0 THEN ;AN000;
+;; AH,AL := -1 ;AN000;
+;; ES : DI := SHARED_DATA_AREA_PTR ;AN000;
+;; ENDIF ;AN000;
+;; IRET ;AN000;
+;; ELSE ;AN000;
+;; IF OLD_INT_2FH is a valid pointer THEN ;AN000;
+;; Jump to Old Int 2FH ;AN000;
+;; ELSE ;AN000;
+;; IRET ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+INT_2FH_DRIVER PROC NEAR ;AN000;
+ JMP SHORT INT_2FH ;AN000;
+PRT_SCR_2FH_NUMBER EQU 0ACH ; 2FH Multiplex interrupt number ;AN000;
+ ; assigned to Print Screen. ;AN000;
+OLD_INT_2FH DD ? ; Pointer to next 2FH interrupt handler ;AN000;
+RESIDENT_CODE_SEG DW ? ; Segment for installed stuff ;AN000;
+SHARED_DATA_AREA_PTR DW ? ; Offset of the start of the ;AN000;
+ ; Shared Data Area ;AN000;
+ ;AN000;
+INT_2FH: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Verify if the 2FH Interrupt call is for our interrupt handler: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .IF <AH EQ PRT_SCR_2FH_NUMBER> AND;If 2FH call is for us ;AN000;
+ .IF <ZERO AL> ; and request is "Get install state" ;AN000;
+ .THEN ; then, ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Yes: return results ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV DI,CS:SHARED_DATA_AREA_PTR ; ES:DI := Pointer to shared ;AN000;
+ PUSH CS:RESIDENT_CODE_SEG ; data area ;AN000;
+ POP ES ; ;AN000;
+ MOV AH,0FFH ; AL and AH := "We are installed" ;AN000;
+ MOV AL,AH ; ;AN000;
+ IRET ; Return to interrupted process ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; No, pass control to next 2FH interrupt handler: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .ELSE ; else, this call is not for us: ;AN000;
+ .IF <<WORD PTR CS:OLD_INT_2FH> NE 0> AND ;if there is another ;AN000;
+ .IF <<WORD PTR CS:OLD_INT_2FH+2> NE 0> ; 2FH driver ;AN000;
+ .THEN ; below us then, ;AN000;
+ JMP CS:OLD_INT_2FH ; pass control to it ;AN000;
+ .ELSE ; else, there is nobody to pass ;AN000;
+ IRET ; control to, just return. ;AN000;
+ .ENDIF ; END If there is a driver below us.;AN000;
+ .ENDIF ; END If this call is for us. ;AN000;
+INT_2FH_DRIVER ENDP ;AN000;
+ ;AN000;
+
+;/*M001 BEGIN */
+;========================================================================
+; INT_10h_Driver :
+; int 10 handler to check for alt-prt-sc-select calls (ah=12,bl=20h)
+; Other int 10 calls are passed on. For alt-prt-sc-select calls,
+; old int 10 is called and after return, we reinstall our int 5 (prt_sc)
+; vector back again ( if it was changed by ANSI.SYS).
+;=======================================================================
+INT_10H_DRIVER PROC NEAR
+
+ sti ; restore interrupts
+ cmp ah,ALTERNATE_SELECT ; see if the call is for
+ jnz go_old_int10 ; alt_prt_sc; if so
+ cmp bl,ALT_PRT_SC_SELECT ; call int 10 and then
+ jz Set_Our_Int5_handler ; restore out PRT_SC vector
+go_old_int10: ; other int 10 calls
+ jmp DWORD PTR cs:OLD_INT_10H ; ...pass it on.
+
+; the call is for alternate prt Screen int 10
+; call the old int 10 handler and then restore our int 5 vector back again
+
+Set_Our_Int5_handler:
+ pushf
+ call DWORD PTR cs:OLD_INT_10H ; call the prev.int 10 handler
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push ds
+ xor ax,ax
+ mov ds,ax ; ds-> 0 to get at int.vector table
+ mov si,5 * 4 ; ds:si -> ptr to int 5 vector
+ mov cx,cs
+ mov dx,offset PRT_SCR
+
+ cli
+ mov ax,ds:[si+2] ; segment for current int 5 vector
+ cmp ax,cx ; is it changed by ROM BIOS
+ je no_int5_chg
+ mov bx,ds:[si]
+ cmp bx, dx ;further sanity check for offset
+ je no_int5_chg
+
+; cx:dx = our int 5 handler
+; ax:bx = current int 5 handler
+; store the current int 5 handler as the old handler and install ourselves
+; again
+
+ mov ds:[si],dx ; store offset
+ mov ds:[si+2],cx ; store segment
+ mov CS:[BIOS_INT_5H],bx ; store old int5 vector
+ mov CS:[BIOS_INT_5H +2],ax
+
+no_int5_chg:
+ sti
+ pop ds
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+
+ iret
+
+INT_10H_DRIVER ENDP
+
+; /* M001 END */
+
+CODE ENDS ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grint2fh.ext b/private/mvdm/dos/v86/cmd/graphics/grint2fh.ext
new file mode 100644
index 000000000..7c23534c8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grint2fh.ext
@@ -0,0 +1,35 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINT2FH.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRINT2FH.ASM ;AN000;
+;; ;AN000;
+;; Change History:
+;; ---------------
+;; M001 NSM 1/30/91 decl. for new int 10 handler
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN OLD_INT_2FH:DWORD ;; ;AN000;
+ EXTRN INT_2FH_DRIVER:NEAR ;; ;AN000;
+
+ EXTRN INT_10H_DRIVER:NEAR ;; /* M001 */
+
+ EXTRN PRT_SCR_2FH_NUMBER:ABS ;; ;AN000;
+ EXTRN SHARED_DATA_AREA_PTR:WORD ;AN000;
+ EXTRN RESIDENT_CODE_SEG:WORD ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload.asm b/private/mvdm/dos/v86/cmd/graphics/grload.asm
new file mode 100644
index 000000000..0a73ed64f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload.asm
@@ -0,0 +1,876 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I added an entry in the VERB_JMP_TAB and the equate DEF to
+;** handle the new statement DEFINE. I also made the new variable
+;** DATA_TYPE have the default of DATA_COL in the procedure
+;** LOAD_PROFILE, so the default assumes IBM type printers.
+;**
+;** DOCUMENTATION NOTES: This version of GRLOAD.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Profile Load Modules ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRLOAD.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the modules used to load the ;AN000;
+;; GRAPHICS profile into resident memory. ;AN000;
+;; ;AN000;
+;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
+;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
+;; ************* modules to avoid having to relocate this save just before ;AN000;
+;; terminating. This is safe since the maximum memory used is ;AN000;
+;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
+;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
+;; GRPRINT.ASM. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; PLACID Functional Specifications ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; LOAD_PROFILE - Main module for profile loading ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ?????????? - Externals for profile loading modules ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; --------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
+ ;; ;AN000;
+ INCLUDE STRUC.INC ;; ;AN000;
+ INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
+ ;; for transient command processing ;AN000;
+ INCLUDE GRSHAR.STR ;; ;AN000;
+ INCLUDE GRPARSE.EXT ;; ;AN000;
+ INCLUDE GRLOAD2.EXT ;; ;AN000;
+ INCLUDE GRLOAD3.EXT ;; ;AN000;
+ INCLUDE GRMSG.EQU ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Public Symbols ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ PUBLIC LOAD_PROFILE ;AN000;
+ PUBLIC GROW_SHARED_DATA ;AN000;
+ PUBLIC BLOCK_START ;AN000;
+ PUBLIC BLOCK_END ;AN000;
+ PUBLIC FIRST_BLOCK ;AN000;
+ PUBLIC MAX_BLOCK_END ;AN000;
+ PUBLIC GROUPS_DONE ;AN000;
+ PUBLIC STMTS_DONE ;AN000;
+ PUBLIC STMTS_DONE ;AN000;
+ PUBLIC PTD_FOUND ;AN000;
+ PUBLIC BUILD_STATE ;AN000;
+ PUBLIC STMT_ERROR ;AN000;
+ PUBLIC FILE_ERROR ;AN000;
+ PUBLIC PARSE_ERROR ;AN000;
+ PUBLIC END_OF_FILE ;AN000;
+ PUBLIC MEM_OVERFLOW ;AN000;
+ PUBLIC STMT_BUFFER ;AN000;
+ PUBLIC CUR_STMT ;AN000;
+ PUBLIC PREV_STMT ;AN000;
+ PUBLIC PRT_BOX_ERROR ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Profile Load Variables ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+NO EQU 0 ;; ;AN000;
+YES EQU 1 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; LOAD_PROFILE ;AN000;
+;; ;AN000;
+;; Input Parameters: ;AN000;
+;; DS,ES,SS - points to our transient segment ;AN000;
+;; ;AN000;
+;; Output Parameters: ;AN000;
+;; Temporary Shared Data Area ;AN000;
+;; Carry flag set if errors in profile. ;AN000;
+;; ;AN000;
+;; Data Structures Referenced: ;AN000;
+;; Shared Data Area ;AN000;
+;; Profile Load Variables ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Build the profile information in the Temporary Shared Data Area. ;AN000;
+;; The information will be built for the printer type parsed off ;AN000;
+;; the command line. ALL Printer Type Descriptions will be ;AN000;
+;; parsed to issue error messages and determine the maximum ;AN000;
+;; amount of resident memory required for initial load. ;AN000;
+;; The Shared Data Area begins with a fixed length section ;AN000;
+;; and then has several variable length sections. PROFILE_BUILD_PTR ;AN000;
+;; is used to build the variable length sections by serving ;AN000;
+;; as a running pointer to the sections as they are built. ;AN000;
+;; ;AN000;
+;; Register Usage: ;AN000;
+;; BP - points to beginning of Temp Shared Data ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; GRAPHICS_INSTALL ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; PARSE_PRINTER, PARSE_DISPLAYMODE, PARSE_SETUP, PARSE_RESTORE ;AN000;
+;; PARSE_PRINTBOX, PARSE_GRAPHICS, PARSE_COLORSELECT, ;AN000;
+;; PARSE_COLORPRINT, GET_STATEMENT ;AN000;
+;; SYSPARSE ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; IF profile path not specified THEN ;AN000;
+;; PROFILE_PATH := "GRAPHICS.PRO" /* Current directory */ ;AN000;
+;; Open profile using PROFILE_PATH ;AN000;
+;; IF error during open THEN ;AN000;
+;; PROFILE_PATH := ARG(V0) with "GRAPHICS.COM" replaced ;AN000;
+;; by "GRAPHICS.PRO" ;AN000;
+;; Open profile using PROFILE_PATH ;AN000;
+;; IF error during open THEN ;AN000;
+;; Issue "Cannot find profile" msg ;AN000;
+;; Set carry flag ;AN000;
+;; RETURN ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ELSE ;AN000;
+;; Open profile using specified path ;AN000;
+;; IF error during open THEN ;AN000;
+;; Issue "Cannot find profile" msg ;AN000;
+;; Set carry flag ;AN000;
+;; RETURN ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; /* don't start building until we find our printer type*/ ;AN000;
+;; PARSE_MODE := NOBUILD ;AN000;
+;; MAX_BUILD_PTR := 0 ;AN000;
+;; CALL GROW_SHARED_DATA(PROFILE-BUILD_PTR,size of FIXED PART ;AN000;
+;; of Shared Data Area) ;AN000;
+;; WHILE (not end of file) AND (no I/O error) DO ;AN000;
+;; CALL GET_STATEMENT ;AN000;
+;; IF I/O error THEN ;AN000;
+;; Issue error message ;AN000;
+;; ELSE ;AN000;
+;; CALL SYSPARSE to parse the statement verb ;AN000;
+;; IF verb found THEN ;AN000;
+;; IF invalid verb THEN ;AN000;
+;; Issue error message ;AN000;
+;; PARSE_MODE := ERROR ;AN000;
+;; ELSE ;AN000;
+;; CASE statement verb ;AN000;
+;; PRINTER: ;AN000;
+;; CALL PARSE_PRINTER ;AN000;
+;; DISPLAYMODE: ;AN000;
+;; CALL PARSE_DISPLAYMODE ;AN000;
+;; PRINTBOX: ;AN000;
+;; CALL PARSE_PRINTBOX ;AN000;
+;; SETUP: ;AN000;
+;; CALL PARSE_SETUP ;AN000;
+;; RESTORE: ;AN000;
+;; CALL PARSE_RESTORE ;AN000;
+;; GRAPHICS: ;AN000;
+;; CALL PARSE_GRAPHICS ;AN000;
+;; COLORPRINT: ;AN000;
+;; CALL PARSE_COLORPRINT ;AN000;
+;; COLORSELECT: ;AN000;
+;; CALL PARSE_COLORSELECT ;AN000;
+;; ENDCASE ;AN000;
+;; IF error on statement THEN ;AN000;
+;; IF OVERFLOW bit set in RETURN_CODE THEN ;AN000;
+;; Issue "Insufficient memory" message ;AN000;
+;; RETURN to caller ;AN000;
+;; ELSE ;AN000;
+;; IF MISSING bit set in RETURN_CODE THEN ;AN000;
+;; Issue "required statement missing" message ;AN000;
+;; ENDIF ;AN000;
+;; IF INVALID bit set in RETURN_CODE THEN ;AN000;
+;; Issue "statement invalid" message ;AN000;
+;; ENDIF ;AN000;
+;; IF SEQUENCE bit set in RETURN_CODE THEN ;AN000;
+;; Issue "out of sequence" message ;AN000;
+;; ENDIF ;AN000;
+;; display the statement in error ;AN000;
+;; ENDIF ;AN000;
+;; PARSE_MODE := ERROR ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ENDWHILE ;AN000;
+;; ;AN000;
+;; /* Check length of last PTD */ ;AN000;
+;; IF PROFILE_BUILD_PTR > MAX_BUILD_PTR THEN ;AN000;
+;; MAX_BUILD_PTR := PROFILE_BUILD_PTR ;AN000;
+;; ENDIF ;AN000;
+;; ;AN000;
+;; /* Make sure all required statements were in previous */ ;AN000;
+;; /* Printer Type Description */ ;AN000;
+;; /* Must have completed PRINTER, DISPLAYMODE, PRINTBOX and */ ;AN000;
+;; /* GRAPHICS statements */ ;AN000;
+;; IF PRT+DISP+BOX+GR bits not all set in STMTS_DONE THEN ;AN000;
+;; Issue "required statement missing" message ;AN000;
+;; Display "END OF FILE." ;AN000;
+;; ENDIF ;AN000;
+;; ;AN000;
+;; IF errors during build THEN ;AN000;
+;; set carry flag ;AN000;
+;; ELSE ;AN000;
+;; SD_TOTAL_SIZE := MAX_BUILD_PTR - TEMP_SHARED_DATA_PTR ;AN000;
+;; ENDIF ;AN000;
+;; RETURN ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+FILE_NOT_FOUND EQU 2 ;; DOS Int21H error codes ;AN000;
+PATH_NOT_FOUND EQU 3 ;; ;AN000;
+ ;; ;AN000;
+SUBLIST LABEL BYTE ;; Message substituion list for stmt # ;AN000;
+ DB 11 ;; sublist size ;AN000;
+ DB 0 ;; ;AN000;
+ DW STMT_NUM ;; \ Dword pointer to item ;AN000;
+SUBLIST_SEG DW ? ;; / ;AN000;
+ DB 1 ;; Substitution # ;AN000;
+;; Flag format a0sstttt ;; ;AN000;
+ DB 00100001B ;; Unsigned binary word - left align ;AN000;
+;;;; DB 00000000B ;; charcater ;AN000;
+ DB 0 ;; max field width ;AN000;
+ DB 1 ;; min width width ;AN000;
+ DB ' ' ;; pad characeter ;AN000;
+ ;; ;AN000;
+STMT_NUM DW 0 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+FILE_ERROR DB 0 ;; Error opening or reading PROFILE ;AN000;
+PARSE_ERROR DB 0 ;; Syntax errors in PROFILE ;AN000;
+END_OF_FILE DB 0 ;; 1 if end of file ;AN000;
+MEM_OVERFLOW DB 0 ;; 1 if insufficient memory ;AN000;
+ ;; ;AN000;
+STMT_ERROR DB 0 ;; Error flag for individual stmt errors ;AN000;
+MISSING EQU 1 ;; Required statement missing ;AN000;
+INVALID EQU 2 ;; Invalid statement format ;AN000;
+SEQUENCE EQU 4 ;; Statement out of sequence ;AN000;
+ ;; ;AN000;
+DEFAULT_PATH DB "GRAPHICS.PRO",0 ;; ;AN000;
+BUFFER DB 64 DUP("$") ;; ;AN000;
+ ;; ;AN000;
+HANDLE DW 0 ;; Profile handle ;AN000;
+ ;; ;AN000;
+BUILD_STATE DB 0 ;; 1 if we are currently building ;AN000;
+ ;; data. 0 means syntax checking ;AN000;
+ ;; only ;AN000;
+ ;; ;AN000;
+ ;; Keep track of whether this PTD ;AN000;
+ ;; matches the type requested ;AN000;
+PTD_FOUND DB 0 ;; Values are NO (0), YES (1) and ;AN000;
+PROCESSED EQU 2 ;; PROCESSED (2) ;AN000;
+ ;; ;AN000;
+VERB DB 0 ;; PTR into VERB_JMP_TAB ;AN000;
+ ;; ;AN000;
+VERB_JMP_TAB LABEL WORD ;; ;AN000;
+ DW OFFSET PARSE_PRINTER ;; ;AN000;
+ DW OFFSET PARSE_DISPLAYMODE ;; ;AN000;
+ DW OFFSET PARSE_PRINTBOX ;; ;AN000;
+ DW OFFSET PARSE_SETUP ;; ;AN000;
+ DW OFFSET PARSE_RESTORE ;; ;AN000;
+ DW OFFSET PARSE_GRAPHICS ;; ;AN000;
+ DW OFFSET PARSE_COLORPRINT ;; ;AN000;
+ DW OFFSET PARSE_COLORSELECT ;; ;AN000;
+ DW OFFSET PARSE_DARKADJUST ;; ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the following so that LOAD_PROFILE will parse the
+; DEFINE statement.
+;
+ DW OFFSET PARSE_DEFINE ;
+;/\ ~~mda(001) ----------------------------------------------------------
+ ;; ;AN000;
+STMTS_DONE DW 0 ;; ;AN000;
+GROUPS_DONE DW 0 ;; ;AN000;
+PREV_STMT DW 0 ;; ;AN000;
+CUR_STMT DW 0 ;; ;AN000;
+ ;; ;AN000;
+PRT EQU 1 ;; Bit masks for STMTS_DONE and ;AN000;
+DISP EQU 2 ;; GROUPS_DONE. There is one ;AN000;
+BOX EQU 4 ;; bit for each statement except ;AN000;
+GR EQU 8 ;; DARKADJUST ;AN000;
+SET EQU 10H ;; ;AN000;
+REST EQU 20H ;; ;AN000;
+COLS EQU 40H ;; ;AN000;
+COLP EQU 80H ;; ;AN000;
+DARK EQU 100H ;; ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the following for the DEFINE statement.
+;
+DEF EQU 200H
+;/\ ~~mda(001) ----------------------------------------------------------
+ ;; ;AN000;
+BLOCK_START DW ? ;; Extents of the variable size block ;AN000;
+BLOCK_END DW ? ;; currently being built ;AN000;
+ ;; These are relative to the ;AN000;
+ ;; start of the Shared Data Area ;AN000;
+ ;; so the area can be relocated ;AN000;
+MAX_BLOCK_END DW 0 ;; End of largest PTD contained ;AN000;
+ ;; in profile ;AN000;
+FIRST_BLOCK DW ? ;; Pointer to first variable block ;AN000;
+ ;; (end of fixed part) ;AN000;
+PRT_BOX_ERROR DB 0 ;; ;AN000;
+ ;; ;AN000;
+LOAD_PROFILE PROC NEAR ;; ;AN000;
+ ;; ;AN000;
+ PUSH CS ;; ;AN000;
+ POP SUBLIST_SEG ;; setup segment for message sublist ;AN000;
+ ;; ;AN000;
+ CALL OPEN_FILE ;; ;AN000;
+ .IF <FILE_ERROR EQ YES> ;; Check for error during open ;AN000;
+ STC ;; ;AN000;
+ RET ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV BP,TEMP_SHARED_DATA_PTR ;; BP points to START of Shared Data ;AN000;
+ MOV AX,SIZE SHARED_DATA_AREA_STR ;; size of fixed part of Shared Data ;AN000;
+ MOV BLOCK_END,0 ;; Initialize BLOCK_START,BLOCK_END ;AN000;
+ MOV [BP].DARKADJUST_VALUE,0 ;; Init some values in the fixed ;AN000;
+ MOV [BP].NUM_PRT_COLOR,0 ;; area ;AN000;
+ MOV [BP].COLORPRINT_PTR,-1 ;; ;AN000;
+ MOV [BP].NUM_PRT_BANDS,0 ;; ;AN000;
+ MOV [BP].COLORSELECT_PTR,-1 ;; ;AN000;
+ MOV [BP].PRINTER_TYPE,BLACK_WHITE ;; ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Make the default DATA_TYPE be DATA_COL for the IBM printers.
+;
+ MOV [BP].DATA_TYPE,DATA_COL ;
+;/\ ~~mda(001) ----------------------------------------------------------
+ CALL GROW_SHARED_DATA ;; to the first byte after the ;AN000;
+ ;; fixed part of Shared Data ;AN000;
+ MOV AX,BLOCK_END ;; Variable size data will be built ;AN000;
+ MOV BLOCK_START,AX ;; starting at BLOCK_START ;AN000;
+ MOV FIRST_BLOCK,AX ;; Save start of variable data ;AN000;
+ ;; ;AN000;
+ MOV SI,BUFFER_PTR ;; Set up SI for GET_BYTE ;AN000;
+ CALL GET_BYTE ;; Get first byte from file ;AN000;
+ MOV NEXT_BYTE,AL ;; and store it ;AN000;
+ MOV BUFFER_PTR,SI ;; Save SI for next GET_BYTE ;AN000;
+ .WHILE <END_OF_FILE EQ NO> AND ;; Keep parsing until end of file or ;AN000;
+ .WHILE <FILE_ERROR EQ NO> ;; file error occurs ;AN000;
+ MOV STMT_ERROR,0 ;; Clear parse error flags ;AN000;
+ CALL GET_STATEMENT ;; Get next profile statement ;AN000;
+ INC STMT_NUM ;; ;AN000;
+ .IF NC ;; Carry flag set if get unsuccessful ;AN000;
+ CALL PARSE_VERB ;; Index into verb jump table returned ;AN000;
+ ;; in BX ;AN000;
+ .IF <AX EQ 0> THEN ;; AX=0 if there is a recognized ;AN000;
+ MOV AX,CUR_STMT ;; ;AN000;
+ MOV PREV_STMT,AX ;; Save last statement verb ;AN000;
+ CALL VERB_JMP_TAB[BX] ;; statement to parse ;AN000;
+ .ELSEIF <AX NE -1> THEN ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .IF <STMT_ERROR NE 0> ;; An error was detected ;AN000;
+ CALL SHOW_PARSE_ERROR ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV STMT_ERROR,0 ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDWHILE ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE AND PRT> ;; Must have at least one PRINTER ;AN000;
+ CALL TERMINATE_DISPLAYMODE ;; Terminate the last PRINTER and ;AN000;
+ CALL TERMINATE_PRINTER ;; DISPLAYMODE sections ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .IF <STMT_ERROR NE 0> ;; ;AN000;
+ CALL SHOW_PARSE_ERROR ;; Issue Profile syntax messages ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,3E00H ;; Close the file ;AN000;
+ MOV BX,HANDLE ;; ;AN000;
+ INT 21H ;; ;AN000;
+ ;; ;AN000;
+ .IF <PARSE_ERROR EQ YES> ;; ;AN000;
+ MOV AX,SYNTAX_ERRORS ;; Issue "Syntax errors found in ;AN000;
+ MOV CX,0 ;; profile" message. ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <PTD_FOUND EQ NO> ;; Did we find the requested printer ;AN000;
+ MOV AX,INVALID_PRT ;; type? If not issue error ;AN000;
+ MOV CX,0 ;; message. ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <PARSE_ERROR EQ YES> OR ;; ;AN000;
+ .IF <PRT_BOX_ERROR EQ YES> OR ;; ;AN000;
+ .IF <FILE_ERROR EQ YES> ;; Set carry flag if profile load ;AN000;
+ STC ;; was unsuccessful ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <MEM_OVERFLOW EQ YES> ;; Everthing else was OK BUT we ran ;AN000;
+ .IF <INSTALLED EQ YES> ;; out of memory!!! ;AN000;
+ MOV AX,NB_FREE_BYTES ;; ;AN000;
+ .IF <AX LT RESIDENT_SHARED_DATA_SIZE> ;AN000;
+ MOV AX,NO_MEMORY ;; We ran out of physical memory! ;AN000;
+ .ELSE ;; ;AN000;
+ MOV AX,UNABLE_RELOAD ;; Allocated shared data is too small ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV AX,NO_MEMORY ;; We ran out of physical memory ;AN000;
+ .ENDIF ;; ;AN000;
+ MOV CX,0 ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ STC ;; Indicate unsuccessful ;AN000;
+ .ELSE ;; ;AN000;
+ MOV AX,MAX_BLOCK_END ;; Extent of largest PRINTER section ;AN000;
+ MOV [BP].SD_TOTAL_SIZE,AX ;; we parsed. ;AN000;
+ CLC ;; SUCCESSFUL LOAD!!!! ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+LOAD_PROFILE ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; SHOW_PARSE_ERROR ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+CARRAIGE_RET EQU 13 ;; ;AN000;
+LINE_FEED EQU 10 ;; ;AN000;
+ ;; ;AN000;
+SHOW_PARSE_ERROR PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV ERROR_DEVICE,STDOUT ;; profile syntax messages to STDOUT ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMT_ERROR AND MISSING> ;AN000;
+ PUSH SI ;; ;AN000;
+ MOV AX,MISSING_STMT ;; ;AN000;
+ MOV CX,1 ;; ;AN000;
+ MOV SI,OFFSET SUBLIST ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ POP SI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .IF <BIT STMT_ERROR AND INVALID> ;AN000;
+ PUSH SI ;; ;AN000;
+ MOV AX,INVALID_STMT ;; ;AN000;
+ MOV CX,1 ;AN000;
+ MOV SI,OFFSET SUBLIST ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ POP SI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .IF <BIT STMT_ERROR AND SEQUENCE> ;AN000;
+ PUSH SI ;; ;AN000;
+ MOV AX,OUT_SEQ_STMT ;; ;AN000;
+ MOV CX,1 ;AN000;
+ MOV SI,OFFSET SUBLIST ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ POP SI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,STMT_END_INDEX ;; ;AN000;
+ MOV STMT_BUFFER[DI],'$' ;; For display ;AN000;
+ MOV AH,9 ;; ;AN000;
+ MOV DX,OFFSET STMT_BUFFER ;AN000;
+ INT 21H ;; ;AN000;
+ MOV DL,CARRIAGE_RET ;; ;AN000;
+ MOV AH,2 ;; ;AN000;
+ INT 21H ;; ;AN000;
+ MOV DL,LINE_FEED ;; ;AN000;
+ MOV AH,2 ;; ;AN000;
+ INT 21H ;; ;AN000;
+ ;; ;AN000;
+ MOV ERROR_DEVICE,STDERR ;; reset to STDERR ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+SHOW_PARSE_ERROR ENDP ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; OPEN_FILE ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+OPEN_FILE PROC NEAR ;; ;AN000;
+ ;; ;AN000;
+ .IF <PROFILE_PATH NE 0> ;; If a path was specified then ;AN000;
+ MOV DX,OFFSET PROFILE_PATH ;; try and open it ;AN000;
+ MOV AX,3D00H ;; ;AN000;
+ INT 21H ;; Open it ;AN000;
+ .IF C ;; Open error if carry flag set ;AN000;
+ .IF <AX EQ FILE_NOT_FOUND> OR ;; Check for error other than ;AN000;
+ .IF <AX EQ PATH_NOT_FOUND> ;; file not found ;AN000;
+ MOV AX,PROFILE_NOT_FOUND ;; ;AN000;
+ MOV CX,0 ;; ;AN000;
+ CALL DISP_ERROR ;; Issue "File not found" common msg ;AN000;
+ MOV FILE_ERROR,YES ;; ;AN000;
+ .ELSE ;; ;AN000;
+ CALL FILE_ERROR_PROC ;; Issue "Open error" ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV HANDLE,AX ;; ;AN000;
+ .ENDIF ;; File opened OK ;AN000;
+ .ELSE ;; No path parameter ;AN000;
+ MOV DX,OFFSET DEFAULT_PATH ;; Try and open "GRAPHICS.PRO" ;AN000;
+ MOV AX,3D00H ;; ;AN000;
+ INT 21H ;; Open it ;AN000;
+ .IF C ;; Open error if carry flag set ;AN000;
+ .IF <AX EQ FILE_NOT_FOUND> OR ;; Check for file not found error ;AN000;
+ .IF <AX EQ PATH_NOT_FOUND> ;; ;AN000;
+ CALL COPY_ARGV0 ;; ;AN000;
+ MOV DX,OFFSET PROFILE_PATH ;; Try and open "GRAPHICS.PRO" in ;AN000;
+ MOV AX,3D00H ;; ARGV0 directory ;AN000;
+ INT 21H ;; ;AN000;
+ .IF C ;; Issue "File not found" common msg ;AN000;
+ .IF <AX EQ FILE_NOT_FOUND> OR ;AN000;
+ .IF <AX EQ PATH_NOT_FOUND> ;AN000;
+ MOV AX,PROFILE_NOT_FOUND ;; ;AN000;
+ MOV CX,0 ;; ;AN000;
+ CALL DISP_ERROR ;; Issue "File not found"common MSG;AN000;
+ MOV FILE_ERROR,YES ;; ;AN000;
+ .ELSE ;; ;AN000;
+ CALL FILE_ERROR_PROC ;; Issue "Open error" ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV HANDLE,AX ;; ;AN000;
+ .ENDIF ;; File opened OK ;AN000;
+ .ELSE ;; ;AN000;
+ CALL FILE_ERROR_PROC ;; Issue "Open error" ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV HANDLE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+OPEN_FILE ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; COPY_ARGV0 ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+COPY_ARGV0 PROC ;; ;AN000;
+ ;; ;AN000;
+ PUSH ES ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ PUSH SI ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,2CH ;; Locate environment string ;AN000;
+ MOV ES,[DI] ;; ;AN000;
+ XOR SI,SI ;; ;AN000;
+ .WHILE <<WORD PTR ES:[SI]> NE 0> ;; ;AN000;
+ INC SI ;; ;AN000;
+ .ENDWHILE ;; ;AN000;
+ ADD SI,4 ;; ;AN000;
+ LEA DI,PROFILE_PATH ;; Move string to work area ;AN000;
+ .REPEAT ;; ;AN000;
+ MOV AL,ES:[SI] ;; ;AN000;
+ MOV [DI],AL ;; ;AN000;
+ INC SI ;; ;AN000;
+ INC DI ;; ;AN000;
+ .UNTIL <<BYTE PTR ES:[SI]> EQ 0> ;; ;AN000;
+ MOV BYTE PTR [DI],0 ;; ;AN000;
+ MOV BYTE PTR [DI]-3,"P" ;; Change COM to PRO ;AN000;
+ MOV BYTE PTR [DI]-2,"R" ;; ;AN000;
+ MOV BYTE PTR [DI]-1,"O" ;; ;AN000;
+ ;; ;AN000;
+ POP SI ;; ;AN000;
+ POP DI ;; ;AN000;
+ POP ES ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+COPY_ARGV0 ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; FILE_ERROR_PROC ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+FILE_ERROR_PROC PROC ;; ;AN000;
+ MOV AX,FILE_ERRORS ;; ;AN000;
+ MOV CX,0 ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ MOV FILE_ERROR,YES ;; ;AN000;
+ RET ;; ;AN000;
+FILE_ERROR_PROC ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; GET_STATEMENT ;AN000;
+;; ;AN000;
+;; Input Parameters: ;AN000;
+;; NONE ;AN000;
+;; ;AN000;
+;; Output Parameters: ;AN000;
+;; PROFILE_LINE ;AN000;
+;; RETURN CODE : 0 - successfull read ;AN000;
+;; : 1 - end of file ;AN000;
+;; : 2 - error during read ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Data Structures Referenced: ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; Get a statement from the profile. ;AN000;
+;; The file read in 512 byte buffers and parsed into ;AN000;
+;; lines by the presence of a carriage return at the end of each line. ;AN000;
+;; ;AN000;
+;; Called By: ;AN000;
+;; LOAD_PROFILE ;AN000;
+;; ;AN000;
+;; External Calls: ;AN000;
+;; NONE ;AN000;
+;; ;AN000;
+;; Logic: ;AN000;
+;; FOUND := FALSE ;AN000;
+;; RETURN_CODE := 0 ;AN000;
+;; WHILE NOT FOUND DO ;AN000;
+;; IF end of buffer THEN ;AN000;
+;; Read next profile record into buffer ;AN000;
+;; IF successful read THEN ;AN000;
+;; point to first byte in buffer ;AN000;
+;; ELSE ;AN000;
+;; IF end of file THEN ;AN000;
+;; Close profile ;AN000;
+;; RETURN_CODE := 1 ;AN000;
+;; FOUND := TRUE ;AN000;
+;; ELSE ;AN000;
+;; RETURN_CODE := 2 ;AN000;
+;; FOUND := TRUE ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; ENDIF ;AN000;
+;; copy byte to PROFILE_LINE ;AN000;
+;; IF byte in buffer is a CR THEN ;AN000;
+;; FOUND := TRUE ;AN000;
+;; ENDIF ;AN000;
+;; ENDWHILE ;AN000;
+;; RETURN ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+FOUND DB 0 ;; ;AN000;
+ ;; ;AN000;
+CARRIAGE_RET EQU 13 ;; ;AN000;
+LINE_FEED EQU 10 ;; ;AN000;
+NEXT_BYTE DB 0 ;; Save area for byte just read ;AN000;
+BUFFER_SIZE EQU 512 ;; ;AN000;
+FILE_BUFFER DB 512 DUP(0) ;; ;AN000;
+BUFFER_PTR DW 512 ;; ;AN000;
+BUFFER_END DW 512 ;; ;AN000;
+STMT_BUFFER DB 255 DUP(0) ;; ;AN000;
+ DB ? ;; In case we have to insert a CR ;AN000;
+ DB ? ;; and a LF ;AN000;
+ DB ? ;; Too put the "$" for displaying the ;AN000;
+ ;; line. ;AN000;
+ ;; ;AN000;
+STMT_END_INDEX DW ? ;; ;AN000;
+MAX_STMT_LEN EQU 255 ;; ;AN000;
+CR_FOUND DB 0 ;; 1 if we found a line terminator ;AN000;
+ ;; ;AN000;
+GET_STATEMENT PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV FOUND,NO ;; ;AN000;
+ MOV STMT_ERROR,0 ;; Clear error flags ;AN000;
+ XOR DI,DI ;; Index for extracted statement ;AN000;
+ MOV SI,BUFFER_PTR ;; Init file buffer ptr ;AN000;
+ ;; ;AN000;
+ MOV AL,NEXT_BYTE ;; Restore current byte ;AN000;
+ MOV CR_FOUND,NO ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ .WHILE <FOUND EQ NO> AND ;; Keep parsing until we find a stmt ;AN000;
+ .WHILE <FILE_ERROR EQ NO> AND ;; or a file error occurs ;AN000;
+ .WHILE <END_OF_FILE EQ NO> ;; or we reach end of file ;AN000;
+ .IF <CR_FOUND EQ YES> ;; ;AN000;
+ .IF <AL EQ LINE_FEED> ;; Return the line feed as well ;AN000;
+ .IF <DI NA MAX_STMT_LEN> ;; Truncate lines longer than MAX ;AN000;
+ MOV STMT_BUFFER[DI],AL ;; MOVE TO statement buffer ;AN000;
+ INC DI ;; Point to next byte in file buffr ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; Line has been truncated > ERROR ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ CALL GET_BYTE ;; Get the first byte of next statement ;AN000;
+ .ENDIF ;; ;AN000;
+ MOV FOUND,YES ;; Time to leave this WHILE ;AN000;
+ MOV NEXT_BYTE,AL ;; Save the byte we just read ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <DI NA MAX_STMT_LEN> ;; Truncate lines longer than MAX ;AN000;
+ MOV STMT_BUFFER[DI],AL ;; move byte to statement buffer ;AN000;
+ INC DI ;; Point to next byte in file buffer ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; Line has been truncated > ERROR ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .IF <AL EQ CARRIAGE_RET> ;; Found a line terminator ;AN000;
+ MOV CR_FOUND,YES ;; Indicate carriage return found ;AN000;
+ .ENDIF ;; and go through once more to ;AN000;
+ CALL GET_BYTE ;; check for a line feed ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDWHILE ;; ;AN000;
+ ;; ;AN000;
+ .IF <STMT_BUFFER[DI-1] NE CARRIAGE_RET> AND ;; ;AN000;
+ .IF <STMT_BUFFER[DI-1] NE LINE_FEED> ;; ;AN000;
+ MOV STMT_BUFFER[DI],CARRIAGE_RET ;; ;AN000;
+ MOV STMT_BUFFER[DI+1],LINE_FEED ;; ;AN000;
+ INC DI ;; ;AN000;
+ INC DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ MOV STMT_END_INDEX,DI ;; ;AN000;
+ MOV BUFFER_PTR,SI ;; Save buffer ptr for next time ;AN000;
+ ;; ;AN000;
+ .IF <END_OF_FILE EQ YES> ;; ;AN000;
+ .IF <DI EQ 0> ;; Clear carry if we read something ;AN000;
+ STC ;; and no file error occured otherwise ;AN000;
+ .ELSE ;; set carry indicating unsuccessful ;AN000;
+ CLC ;; get. ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <FILE_ERROR EQ YES> ;; ;AN000;
+ STC ;; ;AN000;
+ .ELSE ;; ;AN000;
+ CLC ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+GET_STATEMENT ENDP ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; GET_BYTE ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+GET_BYTE PROC ;; ;AN000;
+ ;; ;AN000;
+ .IF <SI EQ BUFFER_END> ;; If buffer empty do another read ;AN000;
+ MOV AH,3FH ;; ;AN000;
+ MOV DX,OFFSET FILE_BUFFER ;; ;AN000;
+ MOV CX,BUFFER_SIZE ;; ;AN000;
+ MOV BX,HANDLE ;; ;AN000;
+ INT 21H ;; ;AN000;
+ .IF C ;; Carry set by DOS if file error ;AN000;
+ CALL FILE_ERROR_PROC ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX EQ 0> ;; End of file if AX=0 ;AN000;
+ MOV END_OF_FILE,YES ;; ;AN000;
+ MOV AH,3EH ;; Close the file ;AN000;
+ MOV BX,HANDLE ;; ;AN000;
+ INT 21H ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV BUFFER_END,AX ;; Number of bytes read ;AN000;
+ XOR SI,SI ;; Buffer pointer := 0 ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <FILE_ERROR EQ YES> OR ;; ;AN000;
+ .IF <END_OF_FILE EQ YES> ;; ;AN000;
+ STC ;; Unsuccessful get ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <<FILE_BUFFER[SI]> EQ 1AH> ;; cHECK for EOF marker ;AN000;
+ MOV END_OF_FILE,YES ;; ;AN000;
+ STC ;; ;AN000;
+ .ELSE ;; ;AN000;
+ MOV AL,FILE_BUFFER[SI] ;; Return byte in AL ;AN000;
+ INC SI ;; ;AN000;
+ CLC ;; Successful get ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+GET_BYTE ENDP ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; GROW_SHARED_DATA ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+GROW_SHARED_DATA PROC ;; ;AN000;
+ PUSH BX ;; ;AN000;
+ ADD BLOCK_END,AX ;; Grow the current block by AX ;AN000;
+ MOV BX,BLOCK_END ;; ;AN000;
+ .IF <BX A NB_FREE_BYTES> ;; Check for overflow ;AN000;
+ MOV BUILD_STATE,NO ;; Stop building shared data ;AN000;
+ MOV MEM_OVERFLOW,YES ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP BX ;; ;AN000;
+ RET ;; ;AN000;
+GROW_SHARED_DATA ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+CODE ENDS ;; ;AN000;
+ END ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload.ext b/private/mvdm/dos/v86/cmd/graphics/grload.ext
new file mode 100644
index 000000000..16ffb2081
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload.ext
@@ -0,0 +1,66 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRLOAD.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRLOAD.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN LOAD_PROFILE:NEAR ;; ;AN000;
+ EXTRN GROW_SHARED_DATA:NEAR ;; ;AN000;
+ EXTRN BLOCK_START:WORD ;AN000;
+ EXTRN BLOCK_END:WORD ;AN000;
+ EXTRN FIRST_BLOCK:WORD ;AN000;
+ EXTRN MAX_BLOCK_END:WORD ;AN000;
+ EXTRN GROUPS_DONE:WORD ;AN000;
+ EXTRN STMTS_DONE:WORD ;AN000;
+PRT EQU 1 ;; ;AN000;
+DISP EQU 2 ;; ;AN000;
+BOX EQU 4 ;; ;AN000;
+GR EQU 8 ;; ;AN000;
+SET EQU 10H ;; ;AN000;
+REST EQU 20H ;; ;AN000;
+COLS EQU 40H ;; ;AN000;
+COLP EQU 80H ;; ;AN000;
+DARK EQU 100H ;; ;AN000;
+; ~~mda(001) --------------------------------------------------------
+; Added the following for the new DEFINE statement.
+;
+DEF EQU 200H ;
+; ~~mda(001) --------------------------------------------------------
+ EXTRN PTD_FOUND:BYTE ;AN000;
+ PROCESSED EQU 2 ;; ;AN000;
+ EXTRN BUILD_STATE:BYTE ;AN000;
+ EXTRN STMT_ERROR:BYTE ;AN000;
+MISSING EQU 1 ;; Required statement missing ;AN000;
+INVALID EQU 2 ;; Invalid statement format ;AN000;
+SEQUENCE EQU 4 ;; Statement out of sequence ;AN000;
+ EXTRN FILE_ERROR:BYTE ;AN000;
+ EXTRN PARSE_ERROR:BYTE ;AN000;
+ EXTRN END_OF_FILE:BYTE ;AN000;
+ EXTRN MEM_OVERFLOW:BYTE ;AN000;
+ EXTRN STMT_BUFFER:BYTE ;AN000;
+ EXTRN CUR_STMT:WORD ;AN000;
+ EXTRN PREV_STMT:WORD ;AN000;
+ EXTRN PRT_BOX_ERROR:BYTE ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload2.asm b/private/mvdm/dos/v86/cmd/graphics/grload2.asm
new file mode 100644
index 000000000..d0bb66010
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload2.asm
@@ -0,0 +1,1218 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I altered the procedure PARSE_VERB and added the new
+;** procedure PARSE_DEFINE and made it public in order to handle
+;** the new statement DEFINE. I also made the new variable
+;** DATA_TYPE have the default of DATA_COL, so the default
+;** assumes IBM type printers.
+;**
+;** BUG NOTES: Bug mda002 was completely fixed for the pre-release
+;** version Q.01.02, whereas bug mda005 was only partially
+;** fixed. In other words, part of bug mda005 is in the
+;** released versions D.01.01 & D.01.02.
+;**
+;** BUG (mda002)
+;** ------------
+;**
+;** NAME: GRAPHICS prints garbage on PCL printers if IBM printers are
+;** listed after HP printers in the GRAPHICS profile.
+;**
+;** FILES & PROCEDURES AFFECTED: GRLOAD2.ASM - PARSE_PRINTER
+;** GRLOAD2.ASM - PARSE_DEFINE
+;**
+;** CAUSES: 1) In the procedure Parse_Define I was moving values in the
+;** variable DATA_TYPE for every DEFINE statement, instead of
+;** just for the DEFINE statement that corresponded to the
+;** printer we were using.
+;**
+;** 2) In the procedure Parse_Printer I was resetting DATA_TYPE to
+;** DATA_COL if BUILD_STATE = YES, but I was doing it in a
+;** section of code where BUILD_STATE would never be YES.
+;**
+;** FIXES: 1) Made a couple of changes in the procedure Parse_Define so
+;** that values are moved into the variable DATA_TYPE just for
+;** the DEFINE statement that corresponds to the printer
+;** currently being used.
+;**
+;** 2) I moved a section of code from the procedure Parse_Printer
+;** to the end of the procedure, because this is where it is
+;** possible for BUILD_STATE to equal YES.
+;**
+;** BUG (mda005)
+;** ------------
+;**
+;** NAME: If a picture is printed using a 3,1 printbox, the picture has
+;** blank lines throughout the picture, which has the wrong aspect
+;** ratio.
+;**
+;** FILES & PROCEDURES AFFECTED: GRLOAD2.ASM - PARSE_PRINTBOX
+;**
+;** CAUSE: The print buffer was being filled as follows,
+;**
+;** --------------------------
+;** | o o o o o o o o |
+;** --------------------------
+;** |_____| | |_____| |
+;** | | | |
+;** | | | |
+;** FROM: pixel 1 | pixel 2 |
+;** | |
+;** |___________|
+;** |
+;** |
+;** |
+;** Always left blank
+;**
+;** instead of as follows,
+;**
+;** --------------------------
+;** | o o o o o o o o |
+;** --------------------------
+;** |_____| |_____| |__|
+;** | | |
+;** | | |
+;** FROM: pixel 1 pixel 2 pixel 3
+;**
+;** Note that this not only resulted in a strange picture, but a
+;** picture with the incorrect aspect ratio. Because in essence the
+;** picture was printed indirectly with a 4,1 printbox because for
+;** every pixel read four bits were sent to the printer.
+;**
+;** FIX: Because of time constraints it was decided to print the picture
+;** directly with a 4,1 printbox. So even though the picture still
+;** has the wrong aspect ratio, it at least does not have funny blank
+;** lines throughout the entire picture. This fix was implemented by
+;** changing a 3,1 printbox to a 4,1 printbox.
+;**
+;** DOCUMENTATION NOTES: This version of GRLOAD2.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Profile Load Modules #2 ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRLOAD.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the modules used to load the ;AN000;
+;; GRAPHICS profile into resident memory. ;AN000;
+;; ;AN000;
+;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
+;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
+;; ************* modules to avoid having to relocate this save just before ;AN000;
+;; terminating. This is safe since the maximum memory used is ;AN000;
+;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
+;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
+;; GRPRINT.ASM. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; PLACID Functional Specifications ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; LOAD_PROFILE - Main module for profile loading ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ?????????? - Externals for profile loading modules ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; --------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
+ ;; ;AN000;
+ INCLUDE STRUC.INC ;; ;AN000;
+ INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
+ ;; for transient command processing ;AN000;
+ INCLUDE GRSHAR.STR ;; ;AN000;
+ INCLUDE GRMSG.EQU ;; ;AN000;
+ INCLUDE GRINST.EXT ;; ;AN000;
+ INCLUDE GRLOAD.EXT ;; ;AN000;
+ INCLUDE GRPARSE.EXT ;; ;AN000;
+ INCLUDE GRPATTRN.STR ;; ;AN000;
+ INCLUDE GRPATTRN.EXT ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Public Symbols ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ PUBLIC PARSE_VERB ;; ;AN000;
+ PUBLIC PARSE_PRINTER ;; ;AN000;
+; \/ ~~mda(001) ---------------------------------
+; Added procedure PARSE_DEFINE
+;
+ PUBLIC PARSE_DEFINE ;
+; /\ ~~mda(001) ---------------------------------
+ PUBLIC PARSE_DISPLAYMODE ;; ;AN000;
+ PUBLIC PARSE_PRINTBOX ;; ;AN000;
+ PUBLIC PARSE_SETUP ;; ;AN000;
+ PUBLIC PARSE_RESTORE ;; ;AN000;
+ PUBLIC TERMINATE_DISPLAYMODE ;; ;AN000;
+ PUBLIC TERMINATE_PRINTER ;; ;AN000;
+ PUBLIC CUR_PRINTER_TYPE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Profile Load Variables ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+NO EQU 0 ;; ;AN000;
+YES EQU 1 ;; ;AN000;
+ ;; ;AN000;
+RESULT_BUFFER LABEL BYTE ;; general purpose result buffer ;AN000;
+ DB ? ;; operand type ;AN000;
+RESULT_TAG DB 0 ;; operand tag ;AN000;
+ DW ? ;; pointer to synonym/keyword ;AN000;
+RESULT_VAL DB ?,?,?,? ;; returned numeric value ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; TERMINATE_DISPLAYMODE ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+TERMINATE_DISPLAYMODE PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,STMTS_DONE ;; ;AN000;
+ .IF <PTD_FOUND EQ YES> AND ;; For the matched PTD ;AN000;
+ .IF <BIT AX NAND BOX> AND ;; issue "Invalid parm value" ;AN000;
+ .IF <PRT_BOX_ERROR EQ NO> ;; message if PRINTBOX ID not ;AN000;
+ ;; matched in each DISPLAYMODE section ;AN000;
+ PUSH AX ;; Save STMT_DONE flags ;AN000;
+ MOV AX,INVALID_PB ;; ;AN000;
+ MOV CX,0 ;; ;AN000;
+ CALL DISP_ERROR ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ MOV PRT_BOX_ERROR,YES ;; Issue this message only once ;AN000;
+ POP AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ AND AX,GR ;; Check for missing statements is last ;AN000;
+ .IF <AX NE GR> ;; DISPLAYMODE section: ;AN000;
+ OR STMT_ERROR,MISSING ;; GRAPHICS stmt is required ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+TERMINATE_DISPLAYMODE ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; TERMINATE_PRINTER ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+TERMINATE_PRINTER PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ .IF <AX A MAX_BLOCK_END> ;; Keep track of the largest PRINTER ;AN000;
+ MOV MAX_BLOCK_END,AX ;; section so we can allow space for ;AN000;
+ .ENDIF ;; reload with a different printer ;AN000;
+ ;; type. ;AN000;
+ ;; ;AN000;
+ ;; Check for missing statements ;AN000;
+ MOV AX,STMTS_DONE ;; ;AN000;
+ AND AX,DISP ;; At least one DISPLAYMODE ;AN000;
+ .IF <AX NE DISP> ;; must have been found in last ;AN000;
+ OR STMT_ERROR,MISSING ;; PRINTER section ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+TERMINATE_PRINTER ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_PRINTER ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+PRINTER_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW PRINTER_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+PRINTER_P DB 0,1 ;; Required, max parms ;AN000;
+ DW PRINTER_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+PRINTER_P1 DW 2000H ;; simple string ;AN000;
+ DW 0002H ;; Capitalize using character table ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW PRINTER_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+PRINTER_P1V DB 3 ;; # of value lists ;AN000;
+ DB 0 ;; # of range numerics ;AN000;
+ DB 0 ;; # of discrete numerics ;AN000;
+ DB 1 ;; # of strings ;AN000;
+ DB 1 ;; tag: index into verb jump table ;AN000;
+PRINTER_P1V1 DW ? ;; string offset ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CUR_PRINTER_TYPE DB 0 ;; Type of printer currently being ;AN000;
+ ;; parsed: 1-color 2-b&w ;AN000;
+ ;; ;AN000;
+PARSE_PRINTER PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,PRT ;; ;AN000;
+ MOV CUR_PRINTER_TYPE,BLACK_WHITE ;; Assume black & white until we hit ;AN000;
+ ;; a COLORPRINT ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE AND PRT> ;; If not the first PRINTER section ;AN000;
+ CALL TERMINATE_DISPLAYMODE ;; then clean up the last one and ;AN000;
+ CALL TERMINATE_PRINTER ;; the last DISPLAYMODE section. ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,FIRST_BLOCK ;; ;AN000;
+ MOV BLOCK_START,AX ;; Reset block pointers to start ;AN000;
+ MOV BLOCK_END,AX ;; of variable area ;AN000;
+ ;; ;AN000;
+ MOV STMTS_DONE,PRT ;; Clear all bits except for PRT ;AN000;
+ MOV GROUPS_DONE,0 ;; Clear ;AN000;
+ ;; ;AN000;
+ .IF <PTD_FOUND EQ YES> ;; PRINTER statement marks the end of ;AN000;
+ MOV PTD_FOUND,PROCESSED ;; the previous PTD ;AN000;
+ MOV BUILD_STATE,NO ;; Stop building shared data ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV CL,TAB_DIR_NB_ENTRIES ;; Reset the pattern table copy ;AN000;
+ XOR CH,CH ;; pointers. These pointers ;AN000;
+ MOV BX,OFFSET TAB_DIRECTORY ;; are established when a pattern ;AN000;
+ .REPEAT ;; table is copied to the shared ;AN000;
+ MOV [BX].TAB_COPY,-1 ;; data area. Initially they ;AN000;
+ ADD BX,SIZE TAB_ENTRY ;; are -1. ;AN000;
+ .LOOP ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,OFFSET PRINTER_TYPE_PARM ;; Store printer type from command ;AN000;
+ MOV PRINTER_P1V1,AX ;; line in value list ;AN000;
+ MOV DI,OFFSET PRINTER_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ ;; ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; Don't worry about number of operands ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 9> ;; Syntax error is the only thing ;AN000;
+ OR STMT_ERROR,INVALID ;; which can go wrong ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ 0> OR ;; ;AN000;
+ .UNTIL <AX EQ -1> ;; ;AN000;
+ ;; Printer type parm matched one coded ;AN000;
+ ;; on the PRINTER statement ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ .IF <PTD_FOUND EQ NO> ;; ;AN000;
+ MOV PTD_FOUND,YES ;; If the printer type matches and ;AN000;
+ .IF <PARSE_ERROR EQ NO> AND ;; no errors have been found yet ;AN000;
+ .IF <PRT_BOX_ERROR EQ NO> AND ;; ;AN000;
+ .IF <MEM_OVERFLOW EQ NO> ;; ;AN000;
+ MOV BUILD_STATE,YES ;; then start building the shared ;AN000;
+ .ENDIF ;; data ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; No match ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .IF <AX NE -1> ;; Error during parse ;AN000;
+ OR STMT_ERROR,INVALID ;; set error flag for caller ;AN000;
+ MOV PARSE_ERROR,YES ;; set error flag for caller ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+; \/ ~~mda(002) -----------------------------------------------------------------------
+ .IF <BUILD_STATE EQ YES> ;;
+ MOV [BP].DATA_TYPE,DATA_COL;; Set DATA_TYPE back to default of DATA_COL
+ .ENDIF ;; for new PTD.
+; /\ ~~mda(002) -----------------------------------------------------------------------
+ ;; ;AN000;
+ RET ;AN000;
+ ;; ;AN000;
+PARSE_PRINTER ENDP ;AN000;
+ ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+
+
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_DISPLAYMODE ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+DISPMODE_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW DISPMODE_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+DISPMODE_P DB 0,1 ;; Required, max parms ;AN000;
+ DW DISPMODE_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+DISPMODE_P1 DW 8000H ;; Numeric ;AN000;
+ DW 0 ;; No Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW DISPMODE_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+DISPMODE_P1V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 0,19 ;; range 0..19 ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_DISPLAYMODE PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,DISP ;; ;AN000;
+ ;; Check for a preceeding PRINTER ;AN000;
+ .IF <BIT STMTS_DONE NAND PRT> ;; ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND DISP> ;; If first DISPLAYMODE... ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ MOV [BP].DISPLAYMODE_PTR,AX ;; Set pointer to first DISPLAYMODE ;AN000;
+ MOV BLOCK_START,AX ;; New block starts after last one ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ CALL TERMINATE_DISPLAYMODE ;; If not the first DISPLAYMODE then ;AN000;
+ ;; clean up the last one. ;AN000;
+ MOV DI,BLOCK_START ;; DI=pointer to DISPLAYMODE block just ;AN000;
+ MOV AX,BLOCK_END ;; built ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV [BP+DI].NEXT_DISP_MODE,AX ;; Add new block to DISPLAYMODE chain ;AN000;
+ .ENDIF ;; ;AN000;
+ MOV BLOCK_START,AX ;; New block starts after last one ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,SIZE DISPLAYMODE_STR ;; Allocate space for new DISPLAYMODE ;AN000;
+ CALL GROW_SHARED_DATA ;; block ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV DI,BLOCK_START ;; Start of new block ;AN000;
+ MOV [BP+DI].NUM_SETUP_ESC,0 ;; SETUP, RESTORE are optional so set ;AN000;
+ MOV [BP+DI].NUM_RESTORE_ESC,0 ;; to defaults ;AN000;
+ MOV [BP+DI].SETUP_ESC_PTR,-1 ;; ;AN000;
+ MOV [BP+DI].RESTORE_ESC_PTR,-1 ;; ;AN000;
+ MOV [BP+DI].BOX_WIDTH,0 ;; ;AN000;
+ MOV [BP+DI].BOX_HEIGHT,0 ;; ;AN000;
+ MOV [BP+DI].PRINT_OPTIONS,0 ;; Default to NO print options ;AN000;
+ MOV [BP+DI].NUM_DISP_MODE,0 ;; Get ready to INC this sucker ;AN000;
+ MOV [BP+DI].NEXT_DISP_MODE,-1 ;; This is the last DISPLAYMODE for now! ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ MOV [BP+DI].DISP_MODE_LIST_PTR,AX;; Start mode list at end of new block ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,DISP ;; Indicate DISPLAYMODE found ;AN000;
+ AND STMTS_DONE,NOT (BOX+GR+SET+REST) ;; Reset flags for PRINTBOX, GRAPHICS ;AN000;
+ ;; stmts found ;AN000;
+ AND GROUPS_DONE,NOT (GR+SET+REST) ;; Reset flags for GRAPHICS, SETUP, ;AN000;
+ ;; RESTORE groups processed ;AN000;
+ MOV DI,OFFSET DISPMODE_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 0> ;; If mode is valid ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,1 ;; Add a mode to the list ;AN000;
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ INC [BP+DI].NUM_DISP_MODE ;; Bump number of modes in list ;AN000;
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Get mode from result buffer ;AN000;
+ MOV [BP+DI-1],AL ;; Store the mode at end of list ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; Mode is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ -1> ;; ;AN000;
+ ;; ;AN000;
+ RET ;AN000;
+ ;; ;AN000;
+PARSE_DISPLAYMODE ENDP ;AN000;
+ ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_SETUP ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+SETUP_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW SETUP_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+SETUP_P DB 0,1 ;; Required, max parms ;AN000;
+ DW SETUP_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+SETUP_P1 DW 08000H ;; Numeric ;AN000;
+ DW 0 ;; nO Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW SETUP_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+SETUP_P1V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 0,255 ;; range 0..255 ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_SETUP PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,SET ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed this ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT GROUPS_DONE AND SET> ;; Check for previous group of SETUP ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; stmts ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND SET> ;; If first SETUP... ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ MOV [BP+DI].SETUP_ESC_PTR,AX ;; Set pointer to SETUP seq ;AN000;
+ MOV [BP+DI].NUM_SETUP_ESC,0 ;; Init sequence size ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,SET ;; Indicate SETUP found ;AN000;
+ .IF <PREV_STMT NE SET> THEN ;; Terminate any preceeding groups ;AN000;
+ MOV AX,PREV_STMT ;; except for SETUP group ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET SETUP_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,1 ;; Add a byte to the sequence ;AN000;
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ INC [BP+DI].NUM_SETUP_ESC ;; Bump number of bytes in sequence ;AN000;
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
+ MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ -1> NEAR ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_SETUP ENDP ;; ;AN000;
+ ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_RESTORE ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+RESTORE_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW RESTORE_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+RESTORE_P DB 0,1 ;; Required, max parms ;AN000;
+ DW RESTORE_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+RESTORE_P1 DW 08000H ;; Numeric ;AN000;
+ DW 0 ;; nO Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW RESTORE_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+RESTORE_P1V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 0,255 ;; range 0..255 ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_RESTORE PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,SET ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed this ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT GROUPS_DONE AND REST> ;; Check for previous group of RESTORE ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; stmts ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND REST> ;; If first RESTORE... ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ MOV [BP+DI].RESTORE_ESC_PTR,AX ;; Set pointer to RESTORE seq ;AN000;
+ MOV [BP+DI].NUM_RESTORE_ESC,0 ;; Init sequence size ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,REST ;; Indicate RESTORE found ;AN000;
+ .IF <PREV_STMT NE REST> THEN ;; Terminate any preceeding groups ;AN000;
+ MOV AX,PREV_STMT ;; except for RESTORE group ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET RESTORE_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,1 ;; Add a byte to the sequence ;AN000;
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ INC [BP+DI].NUM_RESTORE_ESC ;; Bump number of bytes in sequence ;AN000;
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
+ MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ -1> NEAR ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_RESTORE ENDP ;; ;AN000;
+ ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_PRINTBOX ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+PRINTBOX_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW PRINTBOX_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+PRINTBOX_P DB 1,4 ;; Required, max parms ;AN000;
+ DW PRINTBOX_P0 ;; LCD/STD ;AN000;
+ DW PRINTBOX_P1 ;; width ;AN000;
+ DW PRINTBOX_P1 ;; height ;AN000;
+ DW PRINTBOX_P2 ;; rotate ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+PRINTBOX_P0 DW 2000H ;; sTRING - display type ;AN000;
+ DW 2 ;; Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW PRINTBOX_P0V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+PRINTBOX_P0V DB 3 ;; # of value lists ;AN000;
+ DB 0 ;; # of range numerics ;AN000;
+ DB 0 ;; # of discrete numerics ;AN000;
+ DB 1 ;; # of strings ;AN000;
+ DB 1 ;; tag ;AN000;
+PRINTBOX_P0V1 DW ? ;; string ;AN000;
+ ;; ;AN000;
+PRINTBOX_P1 DW 8001H ;; Numeric - BOX DIMENSIONS ;AN000;
+ DW 0 ;; No Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW PRINTBOX_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+PRINTBOX_P1V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 1,9 ;; range 1..9 ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PRINTBOX_P2 DW 2001H ;; sTRING - ROTATE PARM ;AN000;
+ DW 2 ;; Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW PRINTBOX_P2V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+PRINTBOX_P2V DB 3 ;; # of value lists ;AN000;
+ DB 0 ;; # of range numerics ;AN000;
+ DB 0 ;; # of discrete numerics ;AN000;
+ DB 1 ;; # of strings ;AN000;
+ DB 1 ;; tag ;AN000;
+ DW ROTATE_STR ;; string ;AN000;
+ROTATE_STR DB 'ROTATE',0 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PROF_BOX_W DB 0 ;; Box width and height extracted from ;AN000;
+PROF_BOX_H DB 0 ;; the profile ;AN000;
+PRINTBOX_MATCH DB 0 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_PRINTBOX PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV PRINTBOX_MATCH,NO ;; Start out assuming the PRINTBOX ID ;AN000;
+ MOV PROF_BOX_W,0 ;; does not match the one requested ;AN000;
+ MOV PROF_BOX_H,0 ;; ;AN000;
+ MOV CUR_STMT,BOX ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND DISP> ;; DISPLAYMODE must preceed PRINTBOX ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; Multiple PRINTBOX stmts may be coded ;AN000;
+ ;; We must decide if this one ;AN000;
+ ;; matches the requested display type ;AN000;
+ ;; If not, ignore the statement ;AN000;
+ MOV DI,OFFSET PRINTBOX_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,PRINTBOX_ID_PTR ;; Insert requested display type in ;AN000;
+ MOV PRINTBOX_P0V1,AX ;; parser value list ;AN000;
+ CALL SYSPARSE ;; PARSE display type ;AN000;
+ .IF <AX EQ 0> ;; If ID matches then set this flag. ;AN000;
+ MOV PRINTBOX_MATCH,YES ;; ;AN000;
+ OR STMTS_DONE,BOX ;; Indicate PRINTBOX found ;AN000;
+ MOV AX,PREV_STMT ;; Terminate any preceeding groups ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE horizontal dimension ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ MOV BL,RESULT_VAL ;; ;AN000;
+
+; \/ ~~mda(005) -----------------------------------------------------------------------
+; Presently a 3,1 printbox is not supported for HP PCL printers, but
+; a 4,1 printbox is supported. The reason for this is that one byte
+; is printed at a time and only two 3,1 print boxes are placed in
+; the one byte print buffer, leaving two blank bits. This causes
+; the picture to have blank lines running through it and results in
+; a 4,1 printbox. Instead of placing only two 3,1 print boxes in
+; the print buffer, two 3,1 print boxes plus a partial 3,1 printbox
+; should be placed in the print buffer. Another solution is to
+; make the print buffer be three bytes long, and place eight 3,1
+; print boxes in the three byte long print buffer. Since the present
+; implementation results in a faulty 4,1 printbox, we change the 3,1
+; printbox to a 4,1 printbox up front. So even though we still
+; have a 4,1 printbox, at least we will have an accurate picture.
+ .IF <[BP].DATA_TYPE EQ DATA_ROW> AND
+ .IF <BL EQ 3>
+ MOV BL,4
+ .ENDIF
+; /\ ~~mda(005) -----------------------------------------------------------------------
+
+ MOV PROF_BOX_W,BL ;; Save in local var ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX EQ -1> ;; ;AN000;
+ JMP PRINTBOX_DONE ;; ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE vertical dimension ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ MOV BL,RESULT_VAL ;; ;AN000;
+ MOV PROF_BOX_H,BL ;; Save in local var ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX EQ -1> ;; ;AN000;
+ JMP SHORT PRINTBOX_DONE ;; ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; Parse ROTATE parm ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> AND ;; ;AN000;
+ .IF <PRINTBOX_MATCH EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ OR [BP+DI].PRINT_OPTIONS,ROTATE ;; ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX EQ -1> ;; ;AN000;
+ JMP SHORT PRINTBOX_DONE ;; ;AN000;
+ .ELSE ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; CHECK FOR EXTRA PARMS ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PRINTBOX_DONE: ;; ;AN000;
+ ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> AND ;; Store the PRINTBOX dimensions ;AN000;
+ .IF <PRINTBOX_MATCH EQ YES> ;; ;AN000;
+ PUSH DI ;; in the DISPLAYMODE block ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,PROF_BOX_W ;; ;AN000;
+ MOV [BP+DI].BOX_WIDTH,AL ;; ;AN000;
+ MOV AL,PROF_BOX_H ;; ;AN000;
+ MOV [BP+DI].BOX_HEIGHT,AL ;; ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; If we have a B&W printer then ;AN000;
+ ;; load the grey patterns for the ;AN000;
+ ;; requested print box size. ;AN000;
+ .IF <CUR_PRINTER_TYPE EQ BLACK_WHITE> NEAR ;AN000;
+ ;; ;AN000;
+ .IF <PROF_BOX_W NE 0> AND NEAR ;; Dimensions could also be 0 if the ;AN000;
+ .IF <PROF_BOX_H NE 0> NEAR ;; printbox ID does not apply to this;AN000;
+ ;; displaymode, so don't try for ;AN000;
+ ;; a pattern! ;AN000;
+ MOV BX,OFFSET TAB_DIRECTORY ;; ;AN000;
+ MOV CL,TAB_DIR_NB_ENTRIES ;; ;AN000;
+ XOR CH,CH ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,PROF_BOX_W ;; Requested box width ;AN000;
+ MOV AH,PROF_BOX_H ;; Requested box height ;AN000;
+ .REPEAT ;; ;AN000;
+ .IF <[BX].BOX_W_PAT EQ AL> AND ;; ;AN000;
+ .IF <[BX].BOX_H_PAT EQ AH> ;; ;AN000;
+ .LEAVE ;; ;AN000;
+ .ELSE ;; ;AN000;
+ ADD BX,SIZE TAB_ENTRY ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .LOOP ;; ;AN000;
+ .IF <ZERO CX> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; Unsupported box size ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE NEAR ;; Box size OK - pattern tab found ;AN000;
+ .IF <[BX].TAB_COPY NE -1> ;; Pointer is NOT null if the table ;AN000;
+ MOV AX,[BX].TAB_COPY ;; has already been copied to ;AN000;
+ ;; the shared data area. ;AN000;
+ .IF <BUILD_STATE EQ YES> AND ;; Point to the copy. ;AN000;
+ .IF <PRINTBOX_MATCH EQ YES> ;; Establish pointer to table ONLY ;AN000;
+ MOV [BP+DI].PATTERN_TAB_PTR,AX ;; if the PB ID matched. ;AN000;
+ MOV AL,[BX].NB_INT ;; Number of table entries (intensitie;AN000;
+ MOV [BP+DI].NUM_PATTERNS,AL ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; Otherwise we have to copy it. ;AN000;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; Copy the table even if the printbox ID didn't match! ;AN000;
+ ;; This is a simple way to reserve enough space to allow reloading ;AN000;
+ ;; with a different PRINTBOX ID specified on the command line. ;AN000;
+ ;; This scheme avoids storing ;AN000;
+ ;; duplicate tables but may reserve slightly more space ;AN000;
+ ;; (probably only a hundred bytes or so) than ;AN000;
+ ;; could ever be required. The optimal solution (too ;AN000;
+ ;; complicated!) would involve keeping running totals for each ;AN000;
+ ;; PRINTBOX ID coded. ;AN000;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ MOV DI,BLOCK_END ;; Copy it onto the end of the ;AN000;
+ ;; current block ;AN000;
+ MOV DX,DI ;; Save start addr of the copy ;AN000;
+ MOV [BX].TAB_COPY,DX ;; Store ptr to copy in the directory ;AN000;
+ MOV AX,[BX].TAB_SIZE ;; ;AN000;
+ CALL GROW_SHARED_DATA ;; Allocate room for the table ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV CX,AX ;; Number of bytes to copy ;AN000;
+ PUSH SI ;; Save parse pointer ;AN000;
+ MOV SI,[BX].TAB_OFFSET ;; Source pointer ;AN000;
+ ADD DI,BP ;; make DI an absolute pointer (dest) ;AN000;
+ REP MOVSB ;; Move it! ;AN000;
+ POP SI ;; ;AN000;
+ .IF <PRINTBOX_MATCH EQ YES> ;; Establish pointer to table ONLY ;AN000;
+ MOV DI,BLOCK_START ;; Establish pointer in DISPLAYMODE;AN000;
+ MOV [BP+DI].PATTERN_TAB_PTR,DX ;; info ;AN000;
+ MOV AL,[BX].NB_INT ;; Number of table entries (intens);AN000;
+ MOV [BP+DI].NUM_PATTERNS,AL ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_PRINTBOX ENDP ;AN000;
+ ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_VERB ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+VERB_PARSE_PARMS LABEL WORD ;; Parser control blocks to parse verb ;AN000;
+ DW VERB_P ;; Parser control blocks to parse verb ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+VERB_P DB 0,1 ;; Required, max parms ;AN000;
+ DW VERB_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+VERB_P1 DW 2000H ;; simple string ;AN000;
+ DW 0002H ;; Capitalize using character table ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW VERB_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+VERB_P1V DB 3 ;; # of value lists ;AN000;
+ DB 0 ;; # of range numerics ;AN000;
+ DB 0 ;; # of discrete numerics ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Changed the number of strings from 9 to 10 because of the
+; new DEFINE statement.
+ DB 10 ;; # of strings ;AN000;
+;/\ ~~mda(001) ----------------------------------------------------------
+ DB 0 ;; tag: index into verb jump table ;AN000;
+ DW PRINTER_STRING ;; string offset ;AN000;
+ DB 2 ;; tag ;AN000;
+ DW DISPLAYMODE_STRING ;; string offset ;AN000;
+ DB 4 ;; tag ;AN000;
+ DW PRINTBOX_STRING ;; string offset ;AN000;
+ DB 6 ;; tag ;AN000;
+ DW SETUP_STRING ;; string offset ;AN000;
+ DB 8 ;; tag ;AN000;
+ DW RESTORE_STRING ;; string offset ;AN000;
+ DB 10 ;; tag ;AN000;
+ DW GRAPHICS_STRING ;; string offset ;AN000;
+ DB 12 ;; tag ;AN000;
+ DW COLORPRINT_STRING ;; string offset ;AN000;
+ DB 14 ;; tag ;AN000;
+ DW COLORSELECT_STRING ;; string offset ;AN000;
+ DB 16 ;; tag ;AN000;
+ DW DARKADJUST_STRING ;; string offset ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added DEFINE_STRING to the value list.
+;
+ DB 18 ;; tag
+ DW DEFINE_STRING ;; string offset
+;/\ ~~mda(001) ----------------------------------------------------------
+PRINTER_STRING DB 'PRINTER',0 ;; ;AN000;
+DISPLAYMODE_STRING DB 'DISPLAYMODE',0 ;; ;AN000;
+PRINTBOX_STRING DB 'PRINTBOX',0 ;; ;AN000;
+SETUP_STRING DB 'SETUP',0 ;; ;AN000;
+RESTORE_STRING DB 'RESTORE',0 ;; ;AN000;
+GRAPHICS_STRING DB 'GRAPHICS',0 ;; ;AN000;
+COLORPRINT_STRING DB 'COLORPRINT',0 ;; ;AN000;
+COLORSELECT_STRING DB 'COLORSELECT',0 ;; ;AN000;
+DARKADJUST_STRING DB 'DARKADJUST',0 ;; ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the DEFINE_STRING.
+;
+DEFINE_STRING DB 'DEFINE',0 ;;
+;/\ ~~mda(001) ----------------------------------------------------------
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_VERB PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET VERB_PARSE_PARMS ;; parse parms ;AN000;
+ MOV SI,OFFSET STMT_BUFFER ;; the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ MOV BL,RESULT_TAG ;; ;AN000;
+ XOR BH,BH ;; return tag in BX ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; syntax error ;AN000;
+ OR STMT_ERROR,INVALID ;; set error flag for caller ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ RET ;AN000;
+PARSE_VERB ENDP ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; This procedure parses the new statement DEFINE in the
+; graphics profile. The reason for this new statement
+; is to be able to define the new keyword, DATA, as DATA_ROW
+; or DATA_COL. This is necessary in order to support HP PCL
+; printers since they print in row format and IBM printers
+; print in column format.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Module Name:
+;; PARSE_DEFINE
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DEFINE_PARSE_PARMS LABEL WORD ;; Parser control blocks
+ DW DEFINE_P ;;
+ DB 2 ;; # of lists
+ DB 0 ;; # items in delimeter list
+ DB 1 ;; # items in end-of-line list
+ DB ';' ;; ';' used for comments
+ ;;
+DEFINE_P DB 0,1 ;; Required, max parms. If have DEFINE
+ ;; then must have DEFINE DATA,ROW or
+ ;; DEFINE DATA,COLUMN
+ DW DEFINE_P1 ;;
+ DB 0 ;; # Switches
+ DB 0 ;; # keywords
+ ;;
+DEFINE_P1 DW 2000H ;; simple string
+ DW 2 ;; Capitalize
+ DW RESULT_BUFFER ;; Result buffer
+ DW DEFINE_P1V ;; Value list
+ DB 0 ;; Synomyms
+ ;;
+ ;;
+DEFINE_P1V DB 3 ;; # of value lists
+ DB 0 ;; # of range numerics
+ DB 0 ;; # of discrete numerics
+ DB 3 ;; 3 STRING VALUES
+ DB 1 ;; tag
+ DW DATA_STR ;; ptr
+ DB 2 ;; tag
+ DW ROW_STR ;; ptr
+ DB 3 ;; tag
+ DW COL_STR ;; ptr
+ ;;
+DATA_STR DB 'DATA',0 ;;
+ROW_STR DB 'ROW',0 ;;
+COL_STR DB 'COLUMN',0 ;;
+ ;;
+ ;;
+ROW_FOUND DB NO ;;
+COL_FOUND DB NO ;; Assume column until told otherwise
+DATA_FOUND DB NO ;;
+ ;;
+ ;;
+PARSE_DEFINE PROC ;;
+ ;;
+ MOV CUR_STMT,DEF ;;
+ .IF <BIT STMTS_DONE NAND PRT> ;; If no preceeding PRT stmt
+ OR STMT_ERROR,MISSING ;; then issue error
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ .IF <BIT STMTS_DONE AND DISP> ;; DISPLAYMODE stmts
+ OR STMT_ERROR,SEQUENCE ;; should NOT have been processed
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ .IF <BIT STMTS_DONE AND DEF> ;; If another DEF stmt within in this
+ OR STMT_ERROR,INVALID ;; PTD then issue error
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ ;;
+ MOV ROW_FOUND,NO ;; Flags to indicate whether the ROW,
+ MOV COL_FOUND,NO ;; COLUMN, or DATA parms were found.
+ MOV DATA_FOUND,NO ;;
+ ;;
+ OR STMTS_DONE,DEF ;; Indicate DEFINE found
+ ;;
+ MOV DI,OFFSET DEFINE_PARSE_PARMS ;; parse parms
+ ;; SI => the line to parse
+ XOR DX,DX ;;
+ .REPEAT ;;
+ XOR CX,CX ;;
+ CALL SYSPARSE ;;
+ ;;
+ .IF <AX EQ 0> NEAR ;; If PARM is valid
+ MOV BL,RESULT_TAG ;;
+ .SELECT ;;
+ .WHEN <BL EQ 1> ;; DATA string
+ CMP DATA_FOUND,NO ;; .IF <DATA_FOUND EQ NO> ... .ELSE ...
+ JNE DATA_ERROR ;; Not using .IF macro because jump is
+ MOV DATA_FOUND,YES ;; out of range.
+ JMP CONT_PARSE ;;
+DATA_ERROR: ;;
+ OR STMT_ERROR,INVALID ;; Duplicate DATA parms
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ ;;
+ .WHEN <BL EQ 2> ;; ROW
+ .IF <ROW_FOUND EQ NO> AND ;;
+ .IF <COL_FOUND EQ NO> ;;
+ MOV ROW_FOUND,YES ;;
+ .IF <BUILD_STATE EQ YES> ;; ~~mda(002) If this is the DEFINE stmt we're using
+ MOV [BP].DATA_TYPE,DATA_ROW ;; Set DATA_TYPE to DATA_ROW.
+ .ENDIF
+ .ELSE ;;
+ OR STMT_ERROR,INVALID ;; Duplicate ROW parms or combo of
+ ;; parms ROW and COLUMN
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ .WHEN <BL EQ 3> ;; COLUMN
+ .IF <COL_FOUND EQ NO> AND ;;
+ .IF <ROW_FOUND EQ NO> ;;
+ MOV COL_FOUND,YES ;;
+ .IF <BUILD_STATE EQ YES> ;; ~~mda(002) If this is the DEFINE stmt we're using
+ MOV [BP].DATA_TYPE,DATA_COL ;; Set DATA_TYPE to DATA_COL.
+ .ENDIF ;;
+ .ELSE ;;
+ OR STMT_ERROR,INVALID ;; Duplicate COLUMN parms or combo of
+ ;; parms COLUMN and ROW
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ .ENDSELECT ;;
+ .ELSE NEAR ;;
+ .IF <AX NE -1> ;;
+ OR STMT_ERROR,INVALID ;; parm is invalid
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ .ENDIF ;;
+CONT_PARSE: ;;
+ .UNTIL <AX EQ -1> NEAR ;;
+ ;;
+ .IF <DATA_FOUND EQ NO> ;; Missing DATA parm
+ OR STMT_ERROR,INVALID ;;
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ ;;
+ .IF <ROW_FOUND EQ NO> AND ;; Missing ROW or COLUMN parm
+ .IF <COL_FOUND EQ NO> ;;
+ OR STMT_ERROR,INVALID ;;
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+ ;;
+ RET ;;
+ ;;
+PARSE_DEFINE ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ ;AN000;
+LIMIT LABEL NEAR ;; ;AN000;
+CODE ENDS ;; ;AN000;
+ END ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload2.ext b/private/mvdm/dos/v86/cmd/graphics/grload2.ext
new file mode 100644
index 000000000..5cdbccd2a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload2.ext
@@ -0,0 +1,45 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINST.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRLOAD.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN PARSE_VERB:NEAR ;; ;AN000;
+ EXTRN PARSE_PRINTER:NEAR ;; ;AN000;
+; ~~mda(001) ----------------------------------------------------------------
+; Added new procedure PARSE_DEFINE to support both IBM and HP
+; printers.
+;
+ EXTRN PARSE_DEFINE:NEAR ;
+
+; ~~mda(001) ----------------------------------------------------------------
+ EXTRN PARSE_DISPLAYMODE:NEAR ;; ;AN000;
+ EXTRN PARSE_PRINTBOX:NEAR ;; ;AN000;
+ EXTRN PARSE_SETUP:NEAR ;; ;AN000;
+ EXTRN PARSE_RESTORE:NEAR ;; ;AN000;
+ EXTRN TERMINATE_PRINTER:NEAR ;; ;AN000;
+ EXTRN TERMINATE_DISPLAYMODE:NEAR ;; ;AN000;
+ EXTRN CUR_PRINTER_TYPE:BYTE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload3.asm b/private/mvdm/dos/v86/cmd/graphics/grload3.asm
new file mode 100644
index 000000000..42b05c570
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload3.asm
@@ -0,0 +1,922 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;************************************************************
+;**
+;** NAME: Support for HP PCL printers added to GRAPHICS.
+;**
+;** DESCRIPTION: I restructured the procedure PARSE_GRAPHICS so it can handle
+;** the keywords LOWCOUNT, HIGHCOUNT, the new keywords COUNT and
+;** DATA, and the escape sequence bytes in any order.
+;**
+;** BUG NOTES: The following bug was fixed for the pre-release
+;** version Q.01.02.
+;**
+;** BUG (mda003)
+;** ------------
+;**
+;** NAME: GRAPHICS prints a CR & LF after each scan line unless it is
+;** loaded twice.
+;**
+;** FILES & PROCEDURES AFFECTED: GRLOAD3.ASM - PARSE_GRAPHICS
+;** GRCOMMON.ASM - END_PRT_LINE
+;** GRSHAR.STR - N/A
+;**
+;** CAUSES: The local variables LOWCOUNT_FOUND, HIGHCOUNT_FOUND CR_FOUND and
+;** LF_FOUND used for loading, were incorrectly being used as global
+;** variables during printing.
+;**
+;** FIX: Created a new variable Printer_Needs_CR_LF in GRSHAR.STR, which
+;** is used to determine in GRCOMMON.ASM if it's necessary to
+;** manually send a CR & LF to the printer at print time. The
+;** variable is set at load time in GRLOAD3.ASM, if the variables
+;** Data_Found and Build_State are set.
+;**
+;** DOCUMENTATION NOTES: This version of GRLOAD3.ASM differs from the previous
+;** version only in terms of documentation.
+;**
+;**
+;************************************************************
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Profile Load Modules #2 ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRLOAD.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the modules used to load the ;AN000;
+;; GRAPHICS profile into resident memory. ;AN000;
+;; ;AN000;
+;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
+;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
+;; ************* modules to avoid having to relocate this save just before ;AN000;
+;; terminating. This is safe since the maximum memory used is ;AN000;
+;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
+;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
+;; GRPRINT.ASM. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; PLACID Functional Specifications ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; LOAD_PROFILE - Main module for profile loading ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ?????????? - Externals for profile loading modules ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; --------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' BYTE ;; ;AN000;
+ ;; ;AN000;
+ INCLUDE STRUC.INC ;; ;AN000;
+ INCLUDE GRINST.EXT ;; Bring in external declarations ;AN000;
+ ;; for transient command processing ;AN000;
+ INCLUDE GRSHAR.STR ;; ;AN000;
+ INCLUDE GRMSG.EQU ;; ;AN000;
+ INCLUDE GRINST.EXT ;; ;AN000;
+ INCLUDE GRLOAD.EXT ;; ;AN000;
+ INCLUDE GRLOAD2.EXT ;; ;AN000;
+ INCLUDE GRPARSE.EXT ;; ;AN000;
+ INCLUDE GRPATTRN.STR ;; ;AN000;
+ INCLUDE GRPATTRN.EXT ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Public Symbols ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ PUBLIC PARSE_GRAPHICS ;; ;AN000;
+ PUBLIC PARSE_COLORSELECT ;; ;AN000;
+ PUBLIC PARSE_COLORPRINT ;; ;AN000;
+ PUBLIC PARSE_DARKADJUST ;; ;AN000;
+ PUBLIC LIMIT ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Profile Load Variables ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+NO EQU 0 ;; ;AN000;
+YES EQU 1 ;; ;AN000;
+ ;; ;AN000;
+RESULT_BUFFER LABEL BYTE ;; general purpose result buffer ;AN000;
+ DB ? ;; operand type ;AN000;
+RESULT_TAG DB 0 ;; operand tag ;AN000;
+ DW ? ;; pointer to synonym/keyword ;AN000;
+RESULT_VAL DB ?,?,?,? ;; returned numeric value ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_GRAPHICS ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+GRAPHICS_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW GRAPHICS_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+GRAPHICS_P DB 0,1 ;; Required, max parms ;AN000;
+ DW GRAPHICS_P1 ;; ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+GRAPHICS_P1 DW 0A000H ;; Numeric OR string ;AN000;
+ DW 2 ;; Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW GRAPHICS_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+GRAPHICS_P1V DB 3 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 0,255 ;; range 0..255 ;AN000;
+ DB 0 ;; 0 - no actual numerics ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; Changed the # of string values from 2 to 4 because of the new
+; keywords COUNT and DATA.
+ DB 4 ;; 4 STRING VALUES ;AN000;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ DB 2 ;; tag ;AN000;
+ DW LOWCOUNT_STR ;; ptr ;AN000;
+ DB 3 ;; tag ;AN000;
+ DW HIGHCOUNT_STR ;; ptr ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; Added the following valid string values because of the new
+; keywords COUNT and DATA.
+ DB 4 ; tag
+ DW COUNT_STR ; ptr
+ DB 5 ; tag
+ DW DATA_STR ; ptr
+
+COUNT_STR DB 'COUNT',0 ;
+DATA_STR DB 'DATA',0 ;
+;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ ;; ;AN000;
+lowcount_str db 'LOWCOUNT',0 ;; ;AN000;
+HIGHcount_str db 'HIGHCOUNT',0 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+LOWCOUNT_FOUND DB NO ;; ;AN000;
+HIGHCOUNT_FOUND DB NO ;; ;AN000;
+
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; Added the following so know when get COUNT and DATA.
+COUNT_FOUND DB NO ;
+DATA_FOUND DB NO ;
+;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_GRAPHICS PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,GR ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND DISP> ;; ;AN000;
+ OR STMT_ERROR,MISSING ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AX,BLOCK_END ;; ;AN000;
+ MOV [BP+DI].GRAPHICS_ESC_PTR,AX ;; Set pointer to GRAPHICS seq ;AN000;
+ MOV [BP+DI].NUM_GRAPHICS_ESC,0 ;; Init sequence size ;AN000;
+ MOV [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA,0 ;;~~mda(001) Init sequence size ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV LOWCOUNT_FOUND,NO ;; Flags to indicate whether the LOW ;AN000;
+ MOV HIGHCOUNT_FOUND,NO ;; and HIGHCOUNT parms were found ;AN000;
+ MOV COUNT_FOUND,NO ;;~~mda(001) Flags to indicate the COUNT
+ MOV DATA_FOUND,NO ;;~~mda(001) and DATA parms were found ;AN000;
+ ;;
+ OR STMTS_DONE,GR ;; Indicate GRAPHICS found ;AN000;
+ ;; ;AN000;
+ MOV AX,PREV_STMT ;; Terminate any preceeding groups ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET GRAPHICS_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ ;; ;AN000;
+ .IF <AX EQ 0> NEAR ;; If PARM is valid ;AN000;
+ MOV BL,RESULT_TAG ;; ;AN000;
+ .SELECT ;; ;AN000;
+ .WHEN <BL EQ 1> ;; Escape byte ;AN000;
+ PUSH AX ;; ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; Changed the 1 to a 2 in the following instruction cause
+; need an extra byte in the sequence to hold the tag that
+; corresponds to esc seq., so during printing we know what to
+; send and in what order.
+
+ MOV AX,2 ;; Add a byte to the sequence ;AN000;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; During printing we need to know how many things (things being
+; esc #s, count, lowcount, or highcount) come before
+; the data and how many things go after the data, - not just
+; how many bytes are in the sequence. So check if dealing with
+; things that come before the data.
+
+ .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
+ .ELSE ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
+ .ENDIF
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV BYTE PTR [BP+DI-2],ESC_NUM_CODE;
+ MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
+ MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ .WHEN <BL EQ 2> ;; LOWCOUNT ;AN000;
+ CMP LOWCOUNT_FOUND,NO ;; ~~mda(001) If no LOWCOUNT or COUNT ;AN000;
+ JNE LOWCNT_ERROR ; ~~mda(001) then proceed. Not using
+ CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
+ JNE LOWCNT_ERROR ; ~~mda(001) out of range
+ MOV LOWCOUNT_FOUND,YES ;; ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
+ ; ~~mda(001) need extra byte for tag
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+ .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
+ .ELSE ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
+ .ENDIF
+;/\ ~~mda(001) -----------------------------------------------------------------------
+
+ MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX.;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; No longer need following 3 instruction cause will have COUNT
+; at a known fixed location in the SHARED_DATA_AREA.
+;
+;; DEC AX ;; Save pointer to low byte ;AN000;
+;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
+;; MOV DI,AX ;; ;AN000;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ MOV BYTE PTR [BP+DI-2],LOWCOUNT_CODE;
+ MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
+ POP DI ;; in place of count ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
+ LOWCNT_ERROR: ;;~~mda(001) Added label since can't use .IF macro
+ OR STMT_ERROR,INVALID ;; Duplicate LOWCOUNT parms ;AN000;
+ MOV PARSE_ERROR,YES ;;~~mda(001) or combo of LOWCOUNT & COUNT;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .WHEN <BL EQ 3> ;; HIGHCOUNT ;AN000;
+ CMP HIGHCOUNT_FOUND,NO ;; ~~mda(001) If no HIGHCOUNT or COUNT ;AN000;
+ JNE HIGHCNT_ERROR ; ~~mda(001) then proceed. Not using
+ CMP COUNT_FOUND,NO ; ~~mda(001) .IF macro cause jump is
+ JNE HIGHCNT_ERROR ; ~~mda(001) out of range
+ MOV HIGHCOUNT_FOUND,YES ;; ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,2 ;; ~~mda(001) Changed a 1 to a 2 cause ;AN000;
+ ; ~~mda(001) need extra byte for tag
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+ .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
+ .ELSE ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
+ .ENDIF
+;/\ ~~mda(001) -----------------------------------------------------------------------
+
+ MOV DI,BLOCK_END ;; ~~mda(001) Put BLOCK_END in DI not AX. ;AN000;
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; No longer need following 3 instructions cause will have COUNT
+; at a known fixed location in the SHARED_DATA_AREA.
+;
+;; DEC AX ;; Save pointer to low byte ;AN000;
+;; MOV [BP+DI].LOW_BYT_COUNT_PTR,AX ;AN000;
+;; MOV DI,AX ;; ;AN000;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+ MOV BYTE PTR [BP+DI-2],HIGHCOUNT_CODE;
+ MOV BYTE PTR[BP+DI-1],0 ;; ~~mda(001) Added the -1. Store 0 in ;AN000;
+ POP DI ;; place of count ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ JMP CK_NEXT_PARM ;~~mda(001) Added jump since can't use .IF macro
+
+ HIGHCNT_ERROR: ;;~~mda(001) Added label cause can't use .IF macro. ;AN000;
+ OR STMT_ERROR,INVALID ;; Duplicate HIGHCOUNT parms
+ MOV PARSE_ERROR,YES ;; ~~mda(001) or combo of HIGHCOUNT and ;AN000;
+ MOV BUILD_STATE,NO ;; ~~mda(001) COUNT parms ;AN000;
+
+;\/ ~~mda(001) -----------------------------------------------------------------------
+; Added the following two cases for when have COUNT or DATA on
+; GRAPHICS line.
+
+ .WHEN <BL EQ 4> ;; COUNT
+ .IF <COUNT_FOUND EQ NO> AND ; If haven't found a type of count
+ .IF <LOWCOUNT_FOUND EQ NO> AND;;then proceed.
+ .IF <HIGHCOUNT_FOUND EQ NO> ;
+ ;
+ MOV COUNT_FOUND,YES ;;
+ PUSH AX ;;
+ MOV AX,2 ;; Add 2 bytes to the seq. cause
+ ; need extra byte for tag
+ CALL GROW_SHARED_DATA ;; Update block end
+ .IF <BUILD_STATE EQ YES> ;;
+ PUSH DI ;;
+ MOV DI,BLOCK_START ;;
+ .IF <DATA_FOUND EQ NO> ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC ;; come before data.
+ .ELSE ; Bump # of things in seq. that
+ INC [BP+DI].NUM_GRAPHICS_ESC_AFTER_DATA ; go after data
+ .ENDIF
+ MOV DI,BLOCK_END ;;
+ MOV BYTE PTR [BP+DI-2],COUNT_CODE;
+ MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of count
+ POP DI ;;
+ .ENDIF ;;
+ POP AX ;;
+ .ELSE ;;
+ OR STMT_ERROR,INVALID ;; Duplicate COUNT parms or combo of
+ MOV PARSE_ERROR,YES ;; COUNT, LOWCOUNT or HIGHCOUNT parms
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+
+ .WHEN <BL EQ 5> ;; DATA
+ .IF <DATA_FOUND EQ NO> ; If haven't found data then proceed
+ MOV DATA_FOUND,YES ;;
+ PUSH AX ;;
+ MOV AX,2 ;; Add 2 bytes to the seq. cause
+ ; need extra byte for tag
+ CALL GROW_SHARED_DATA ;; Update block end
+ .IF <BUILD_STATE EQ YES> ;;
+ PUSH DI ;;
+ MOV DI,BLOCK_END ;;
+ MOV BYTE PTR [BP+DI-2],DATA_CODE;
+ MOV BYTE PTR[BP+DI-1],0 ;; Store 0 in place of data
+ POP DI ;;
+ .ENDIF ;;
+ POP AX ;;
+ .ELSE ;;
+ OR STMT_ERROR,INVALID ;; Duplicate DATA parms
+ MOV PARSE_ERROR,YES ;;
+ MOV BUILD_STATE,NO ;;
+ .ENDIF ;;
+;/\ ~~mda(001) -----------------------------------------------------------------------
+
+ .ENDSELECT ;; ;AN000;
+ .ELSE NEAR ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+
+CK_NEXT_PARM: ;~~mda(001) Added label since can't use
+ ;~~mda(001) .IF macro.
+ .UNTIL <AX EQ -1> NEAR ;; ;AN000;
+
+;\/ ~~mda(003) -----------------------------------------------------------------------
+ .IF <DATA_FOUND EQ NO> ;; We have a printer that requires a ;AN000;
+ .IF <BUILD_STATE EQ YES> ;;
+ MOV [BP].PRINTER_NEEDS_CR_LF,YES; CR, LF to be sent to it
+ .ENDIF ;;
+ .ENDIF ;;
+;/\ ~~mda(003) -----------------------------------------------------------------------
+
+ ;; ;AN000;
+ .IF <LOWCOUNT_FOUND EQ NO> OR ;; ;AN000;
+ .IF <HIGHCOUNT_FOUND EQ NO> ;; Missing LOWCOUNT/HIGHCOUNT parms ;AN000;
+ .IF <COUNT_FOUND EQ NO> ;; ~~mda(001) or missing COUNT parm
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF
+ .ENDIF ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_GRAPHICS ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_COLORSELECT ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+COLORSELECT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW COLORSELECT_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+COLORSELECT_P LABEL BYTE ;; ;AN000;
+CS_NUM_REQ DB 1,1 ;; Required, max parms ;AN000;
+COLORSELECT_PARM LABEL WORD ;; ;AN000;
+CS_POSITIONAL DW ? ;; Pointer to our positional ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+COLORSELECT_P0 DW 2000H ;; sTRING - display type ;AN000;
+ DW 2 ;; Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW COLORSELECT_P0V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+COLORSELECT_P0V DB 0 ;; # of value lists ;AN000;
+; DB 0 ;; # of range numerics ;AN000;
+; DB 0 ;; # of discrete numerics ;AN000;
+; DB 1 ;; # of strings ;AN000;
+; DB 1 ;; tag ;AN000;
+;COLORSELECT_P0V1 DW ? ;; string ;AN000;
+ ;; ;AN000;
+COLORSELECT_P1 DW 8001H ;; Numeric - escape sequence byte ;AN000;
+ DW 0 ;; No Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW COLORSELECT_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+COLORSELECT_P1V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 1,255 ;; range 1..255 ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+SEQ_LENGTH_PTR DW 0 ;; Number of colorselect statements ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_COLORSELECT PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,COLS ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
+ OR STMT_ERROR,MISSING ;; processed ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE AND DISP+COLP> ;; DISDPLAYMODE and COLORPRINT stmts ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT GROUPS_DONE AND COLS> ;; Check for a previous group of ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; COLORSELECTS within this PTD ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND COLS> ;; If first COLORSELECT... ;AN000;
+ MOV NUM_BANDS,0 ;; Init number of COLORSELECT bands ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
+ MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
+ MOV [BP].COLORSELECT_PTR,AX ;; Set pointer to COLORSELECT info ;AN000;
+ MOV [BP].NUM_PRT_BANDS,0 ;; Init NUMBER OF COLORSELECTS ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,COLS ;; Indicate found ;AN000;
+ .IF <PREV_STMT NE COLS> THEN ;; Terminate any preceeding groups ;AN000;
+ MOV AX,PREV_STMT ;; except for COLORSELECT ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,1 ;; Make room for sequence length field ;AN000;
+ CALL GROW_SHARED_DATA ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ INC [BP].NUM_PRT_BANDS ;; Inc number of selects ;AN000;
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV BYTE PTR [BP+DI-1],0 ;; Init sequence length field ;AN000;
+ LEA AX,[DI-1] ;; ;AN000;
+ MOV SEQ_LENGTH_PTR,AX ;; Save pointer to length of sequence ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET COLORSELECT_PARSE_PARMS ;; parse parms ;AN000;
+ MOV CS_NUM_REQ,1 ;; Change to 1 required parameters ;AN000;
+ MOV AX,OFFSET COLORSELECT_P0 ;; Point to control block for the band ;AN000;
+ MOV CS_POSITIONAL,AX ;; ID. (Dealing with only 1 positional ;AN000;
+ ;; parameter at a time was the only way ;AN000;
+ ;; I could get SYSPARSE to handle ;AN000;
+ ;; the COLORSELECT syntax!) ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE the band ID ;AN000;
+ .IF <AX NE 0> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ RET ;; statement. ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ PUSH ES ;; We got a band id........ ;AN000;
+ PUSH DI ;; ;AN000;
+ ;; ;AN000;
+ LES DI,DWORD PTR RESULT_VAL ;; Get pointer to the parsed band id ;AN000;
+ .IF <<BYTE PTR ES:[DI+1]> NE 0> ;; Make sure the band id is only ;AN000;
+ OR STMT_ERROR,INVALID ;; one byte long ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV BL,NUM_BANDS ;; ;AN000;
+ XOR BH,BH ;; ;AN000;
+ .IF <BX EQ MAX_BANDS> THEN ;; Watch out for too many COLORSELECTs ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE ;; ;AN000;
+ SHL BX,1 ;; calc index to store band in value list;AN000;
+ MOV AL,ES:[DI] ;; get BAND ID FROM PARSEr ;AN000;
+ MOV BAND_VAL_LIST[BX],AL ;; ;AN000;
+ INC NUM_BANDS ;; bump number of bands ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ POP DI ;; ;AN000;
+ POP ES ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,OFFSET COLORSELECT_P1 ;; Switch to numeric positional parm!!! ;AN000;
+ MOV CS_POSITIONAL,AX ;; ;AN000;
+ MOV CS_NUM_REQ,0 ;; Change to 0 required parameters ;AN000;
+ XOR DX,DX ;; PARSE the sequence of escape bytes ;AN000;
+ .REPEAT ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ CALL SYSPARSE ;; ;AN000;
+ .IF <AX EQ 0> ;; If esc byte is valid ;AN000;
+ PUSH AX ;; ;AN000;
+ MOV AX,1 ;; Add a byte to the sequence ;AN000;
+ CALL GROW_SHARED_DATA ;; Update block end ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,SEQ_LENGTH_PTR ;; ;AN000;
+ INC byte ptr [BP+DI] ;; Bump number of bytes in sequence ;AN000;
+ MOV DI,BLOCK_END ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Get esc byte from result buffer ;AN000;
+ MOV [BP+DI-1],AL ;; Store at end of sequence ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ POP AX ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ -1> NEAR ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_COLORSELECT ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_COLORPRINT ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+COLORPRINT_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW COLORPRINT_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+COLORPRINT_P LABEL BYTE ;; ;AN000;
+ DB 3,4 ;; Required,MAX ;AN000;
+ DW COLORPRINT_P0 ;; Numeric: Red value ;AN000;
+ DW COLORPRINT_P0 ;; Green value ;AN000;
+ DW COLORPRINT_P0 ;; Blue value ;AN000;
+ DW COLORPRINT_P1 ;; Band ID ... REPEATING ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+COLORPRINT_P0 DW 8000H ;; Numeric - RGB value ;AN000;
+ DW 0 ;; No Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW COLORPRINT_P0V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+COLORPRINT_P0V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD 0,63 ;; range 0..63 ;AN000;
+ ;; ;AN000;
+COLORPRINT_P1 DW 2001H ;; sTRING - Band ID ;AN000;
+ DW 2 ;; Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW COLORPRINT_P1V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+COLORPRINT_P1V DB 3 ;; # of value lists ;AN000;
+ DB 0 ;; 0 - no range numerics ;AN000;
+ DB 0 ;; 0 - no actual numerics ;AN000;
+NUM_BANDS DB 0 ;; number of band values ;AN000;
+ DB 01H ;; tag: TAGS ARE BAND MASKS ;AN000;
+ DW BAND_PTR_1 ;; ptr ;AN000;
+ DB 02H ;; tag ;AN000;
+ DW BAND_PTR_2 ;; ptr ;AN000;
+ DB 04H ;; tag ;AN000;
+ DW BAND_PTR_3 ;; ptr ;AN000;
+ DB 08H ;; tag ;AN000;
+ DW BAND_PTR_4 ;; ptr ;AN000;
+ DB 10H ;; tag ;AN000;
+ DW BAND_PTR_5 ;; ptr ;AN000;
+ DB 20H ;; tag ;AN000;
+ DW BAND_PTR_6 ;; ptr ;AN000;
+ DB 40H ;; tag ;AN000;
+ DW BAND_PTR_7 ;; ptr ;AN000;
+ DB 80H ;; tag ;AN000;
+ DW BAND_PTR_8 ;; ptr ;AN000;
+ ;; ;AN000;
+MAX_BANDS EQU 8 ;; ;AN000;
+ ;; ;AN000;
+BAND_VAL_LIST LABEL BYTE ;; ;AN000;
+BAND_PTR_1 DB ?,0 ;; ;AN000;
+BAND_PTR_2 DB ?,0 ;; ;AN000;
+BAND_PTR_3 DB ?,0 ;; ;AN000;
+BAND_PTR_4 DB ?,0 ;; ;AN000;
+BAND_PTR_5 DB ?,0 ;; ;AN000;
+BAND_PTR_6 DB ?,0 ;; ;AN000;
+BAND_PTR_7 DB ?,0 ;; ;AN000;
+BAND_PTR_8 DB ?,0 ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+PARSE_COLORPRINT PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,COLP ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
+ OR STMT_ERROR,MISSING ;; processed ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE AND DISP> ;; DISPLAYMODE stmts ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; should NOT have been processed ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT GROUPS_DONE AND COLP> ;; Check for a previous group of ;AN000;
+ OR STMT_ERROR,SEQUENCE ;; COLORPRINTS within this PTD ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_PRINTER_TYPE,COLOR ;; ;AN000;
+ ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND COLP> ;; If first COLORPRINT... ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; Update count and pointer in the ;AN000;
+ MOV AX,BLOCK_END ;; Shared Data Area header ;AN000;
+ MOV [BP].COLORPRINT_PTR,AX ;; Set pointer to COLORPRINT info ;AN000;
+ MOV [BP].PRINTER_TYPE,COLOR ;; ;AN000;
+ MOV [BP].NUM_PRT_COLOR,0 ;; Init NUMBER OF COLORPRINTS ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ INC [BP].NUM_PRT_COLOR ;; Inc number of selects ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,COLP ;; Indicate found ;AN000;
+ .IF <PREV_STMT NE COLP> THEN ;; Terminate any preceeding groups ;AN000;
+ MOV AX,PREV_STMT ;; except for COLORPRINT ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ MOV AX,BLOCK_END ;; Start a new block ;AN000;
+ MOV BLOCK_START,AX ;; ;AN000;
+ MOV AX,SIZE COLORPRINT_STR ;; Make room for COLORPRINT info ;AN000;
+ CALL GROW_SHARED_DATA ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET COLORPRINT_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE the RED value ;AN000;
+ .IF <AX NE 0> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Store RED value in COLORPRINT info ;AN000;
+ MOV [BP+DI].RED,AL ;; ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE the GREEN value ;AN000;
+ .IF <AX NE 0> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Store GREEN value in COLORPRINT info ;AN000;
+ MOV [BP+DI].GREEN,AL ;; ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE the BLUE value ;AN000;
+ .IF <AX NE 0> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,RESULT_VAL ;; Store BLUE value in COLORPRINT info ;AN000;
+ MOV [BP+DI].BLUE,AL ;; ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV [BP+DI].SELECT_MASK,0 ;; Initialize band select mask ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ XOR DX,DX ;; For each band found "OR" the item ;AN000;
+ .REPEAT ;; tag into the select mask ;AN000;
+ MOV CX,3 ;; Avoid getting too many parms error ;AN000;
+ CALL SYSPARSE ;; from parser ;AN000;
+ .IF <AX EQ 0> ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ PUSH DI ;; ;AN000;
+ MOV DI,BLOCK_START ;; ;AN000;
+ MOV AL,RESULT_TAG ;; ;AN000;
+ OR [BP+DI].SELECT_MASK,AL ;; OR the mask for this band into the ;AN000;
+ ;; select mask for this color ;AN000;
+ POP DI ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; parm is invalid ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .UNTIL <AX EQ -1> NEAR ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_COLORPRINT ENDP ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Module Name: ;AN000;
+;; PARSE_DARKADJUST ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+DARKADJUST_PARSE_PARMS LABEL WORD ;; Parser control blocks ;AN000;
+ DW DARKADJUST_P ;; ;AN000;
+ DB 2 ;; # of lists ;AN000;
+ DB 0 ;; # items in delimeter list ;AN000;
+ DB 1 ;; # items in end-of-line list ;AN000;
+ DB ';' ;; ';' used for comments ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+DARKADJUST_P LABEL BYTE ;; ;AN000;
+ DB 1,1 ;; Required,MAX ;AN000;
+ DW DARKADJUST_P0 ;; Numeric: adjust value ;AN000;
+ DB 0 ;; # Switches ;AN000;
+ DB 0 ;; # keywords ;AN000;
+ ;; ;AN000;
+DARKADJUST_P0 DW 4000H ;; Signed Numeric - adjust value ;AN000;
+ DW 0 ;; No Capitalize ;AN000;
+ DW RESULT_BUFFER ;; Result buffer ;AN000;
+ DW DARKADJUST_P0V ;; Value list ;AN000;
+ DB 0 ;; Synomyms ;AN000;
+ ;; ;AN000;
+DARKADJUST_P0V DB 1 ;; # of value lists ;AN000;
+ DB 1 ;; # of range numerics ;AN000;
+ DB 1 ;; tag ;AN000;
+ DD -63,63 ;; range -63,63 ;AN000;
+;;;;***********************************;; ;AN000;
+ ;; ;AN000;
+ ;AN000;
+PARSE_DARKADJUST PROC ;; ;AN000;
+ ;; ;AN000;
+ MOV CUR_STMT,DARK ;; ;AN000;
+ .IF <BIT STMTS_DONE NAND PRT> ;; PRINTER statemnet must have been ;AN000;
+ OR STMT_ERROR,MISSING ;; processed ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+ OR STMTS_DONE,DARK ;; Indicate found ;AN000;
+ ;; Terminate any preceeding groups ;AN000;
+ MOV AX,PREV_STMT ;; ;AN000;
+ OR GROUPS_DONE,AX ;; ;AN000;
+ ;; ;AN000;
+ MOV DI,OFFSET DARKADJUST_PARSE_PARMS ;; parse parms ;AN000;
+ ;; SI => the line to parse ;AN000;
+ XOR DX,DX ;; ;AN000;
+ XOR CX,CX ;; ;AN000;
+ ;; ;AN000;
+ CALL SYSPARSE ;; PARSE the ADJUST VALUE ;AN000;
+ .IF <AX NE 0> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ELSE ;; ;AN000;
+ .IF <BUILD_STATE EQ YES> ;; ;AN000;
+ MOV AL,RESULT_VAL ;; ;AN000;
+ MOV [BP].DARKADJUST_VALUE,AL ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ CALL SYSPARSE ;; CHECK FOR EXTRA PARMS ;AN000;
+ .IF <AX NE -1> ;; ;AN000;
+ OR STMT_ERROR,INVALID ;; ;AN000;
+ MOV PARSE_ERROR,YES ;; ;AN000;
+ MOV BUILD_STATE,NO ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ .ENDIF ;; ;AN000;
+ ;; ;AN000;
+ RET ;; ;AN000;
+ ;; ;AN000;
+PARSE_DARKADJUST ENDP ;; ;AN000;
+ ;AN000;
+LIMIT LABEL NEAR ;; ;AN000;
+CODE ENDS ;; ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grload3.ext b/private/mvdm/dos/v86/cmd/graphics/grload3.ext
new file mode 100644
index 000000000..7f9b7de68
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grload3.ext
@@ -0,0 +1,34 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINST.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRLOAD.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN PARSE_GRAPHICS:NEAR ;; ;AN000;
+ EXTRN PARSE_COLORSELECT:NEAR ;; ;AN000;
+ EXTRN PARSE_COLORPRINT:NEAR ;; ;AN000;
+ EXTRN PARSE_DARKADJUST:NEAR ;; ;AN000;
+ EXTRN LIMIT:NEAR ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grmsg.equ b/private/mvdm/dos/v86/cmd/graphics/grmsg.equ
new file mode 100644
index 000000000..bf14a3f6f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grmsg.equ
@@ -0,0 +1,93 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRMSG.EQU ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; DOS GRAPHICS Command - Message number AN000;equates
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the numbers assigned to the error messages ;AN000;
+;; issued by GRAPHICS.COM ;AN000;
+;; ;AN000;
+;; These messages are defined in GRAPHICS.MSG ;AN000;
+;; (The message skeleton file for GRAPHICS.COM) ;AN000;
+;; ;AN000;
+;; This file also contains equates for the error codes returned by ;AN000;
+;; the DOS parser. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; ;AN000;
+;; DOS 3.3 Message Retriever Interface Supplement. ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRINST.ASM: ;AN000;
+;; GRAPHICS_INSTALL - Main module for GRAPHICS install. ;AN000;
+;; PARSE_PARMS - Parse the command line parameters. ;AN000;
+;; FROM FILE GRLOAD.ASM AND GRLOAD2.ASM ;AN000;
+;; All modules ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; GRAPHICS MESSAGE NUMBERS ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+; Class A messages: ;AN000;
+INCORRECT_DOS EQU 1 ; 'Incorrect DOS version' ;AN000;
+NO_MEMORY EQU 2 ; 'Insufficient memory' ;AN000;
+ ;AN000;
+; Class B messages: (Profile loading) ;AN000;
+PROFILE_NOT_FOUND EQU 9 ; 'Cannot find GRAPHICS profile' ;AN000;
+MISSING_STMT EQU 10 ; 'Required profile statement missing ;AN000;
+ ; before line %1' ;AN000;
+INVALID_STMT EQU 11 ; 'Invalid profile statement on line %1' ;AN000;
+OUT_SEQ_STMT EQU 12 ; 'Profile statement out of sequence on line %1';AN000;
+FILE_ERRORS EQU 13 ; 'Error reading GRAPHICS profile' ;AN000;
+SYNTAX_ERRORS EQU 14 ; 'Syntax errors in GRAPHICS profile' ;AN000;
+INVALID_PB EQU 15 ; 'PRINTBOX id not in GRAPHICS profile' ;AN000;
+INVALID_PRT EQU 16 ; 'Printer type not in GRAPHICS profile' ;AN000;
+ ;AN000;
+; Class C messages: (Command line parsing) ;AN000;
+TOO_MANY_PARMS EQU 3 ; 'Too many parameters' ;AN000;
+VALUE_NOT_ALLOWED EQU 4 ; 'Parameter value not allowed' ;AN000;
+INVALID_PARM EQU 5 ; 'Invalid parameter %1' ;AN000;
+INVALID_COMBINATION EQU 6 ; 'Invalid parameter combination' ;AN000;
+DUPLICATE_PARM EQU 7 ; 'Duplicate parameters not allowed' ;AN000;
+FORMAT_NOT_CORRECT EQU 8 ; 'Parameter format not correct' ;AN000;
+INVALID_B_SWITCH EQU 17 ; '/B invalid with a Black and White printer' ;AN000;
+UNABLE_RELOAD EQU 18 ; 'Unable to reload with profile supplied' ;AN000;
+
+MSG_OPTIONS_FIRST equ 300 ; first options help msg nbr
+MSG_OPTIONS_LAST equ 307 ; and last
+ ;AN000;
+ ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; PARSER ERROR CODES AND OUR OWN PARSING ERROR CODES ;AN000;
+; *** ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+RC_NO_ERROR EQU 0 ;AN000;
+RC_EOL EQU -1 ;AN000;
+RC_TOO_MANY EQU 1 ;AN000;
+RC_NOT_IN_SW EQU 3 ;AN000;
+RC_NOT_IN_VAL EQU 7 ;AN000;
+RC_NOT_IN_STR EQU 8 ;AN000;
+ ;AN000;
+RC_INVLD_COMBINATION EQU 99 ;AN000;
+RC_DUPLICATE_PARMS EQU 100 ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grparms.asm b/private/mvdm/dos/v86/cmd/graphics/grparms.asm
new file mode 100644
index 000000000..188ff9027
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grparms.asm
@@ -0,0 +1,766 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Command line parsing module ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPARMS.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; ;AN000;
+;; This file contains modules for parsing the GRAPHICS.COM ;AN000;
+;; command line; using the DOS PARSER. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; DOS 3.3 Message Retriever Interface Supplement. ;AN000;
+;; TUPPER I0 Document - PARSER HIGH LEVEL DESIGN REVIEW ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; PARSE_PARMS - Parse the command line ;AN000;
+;; GET_R - Get /R ;AN000;
+;; GET_B - Get /B ;AN000;
+;; GET_LCD - Get /LCD ;AN000;
+;; GET_PRINTBOX - Get /PRINTBOX ;AN000;
+;; GET_PROFILE - Get the profile path and file name ;AN000;
+;; GET_TYPE - Get the printer type ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; GRINST.EXT - Externals for installation modules ;AN000;
+;; GRPARSE.EXT - Externals for the DOS parser code ;AN000;
+;; GRSHAR.STR - Shared Data Area Structure ;AN000;
+;; GRMSG.EQU - Equates for GRAPHICS.COM error messages ;AN000;
+;; STRUC.INC - Macros for using structured assembly language ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; FROM FILE GRINST.ASM: ;AN000;
+;; GRAPHICS_INSTALL - Main module for the installation of GRAPHICS ;AN000;
+;; SYSPARSE - DOS system parser ;AN000;
+;; SYSDISPMSG - DOS message retriever ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;AN000;
+ ASSUME CS:CODE,DS:CODE ;AN000;
+
+PARSE_PARMS PROC NEAR ;AN000;
+ jmp PARSE_PARMS_START ;AN000;
+PUBLIC PARSE_PARMS ;AN000;
+
+ EXTRN ERROR_DEVICE: WORD ; grinst.asm
+
+.XLIST ;AN000;
+INCLUDE GRMSG.EQU ; Include GRAPHICS error messages equates ;AN000;
+INCLUDE GRSHAR.STR ; Include the Shared data area structure ;AN000;
+INCLUDE GRINST.EXT ; Include externals for the installation module ;AN000;
+INCLUDE GRPARSE.EXT ; Include externals for the DOS parse code ;AN000;
+INCLUDE STRUC.INC ; Include macros for using STRUCTURES ;AN000;
+.LIST ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PARSE_PARMS : PARSE THE COMMAND LINE PARAMETERS. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; INPUT: DS,ES = SEGMENT CONTAINING THE PROGRAM PREFIX SEGMENT ;AN000;(PSP)
+; ;AN000;
+; OUTPUT: SWITCHES = A bit mask in the shared data area indicating ;AN000;
+; which command line switches are set. ;AN000;
+; PROFILE_PATH = The profile file name and path (ASCIIZ string);AN000;
+; PRINTBOX_ID_PTR = Offset of the printbox id (ASCIIZ string) ;AN000;
+; PRINTER_TYPE_PARM = printer type (ASCIIZ string) ;AN000;
+; CARRY FLAG IS SET if an error occurred ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; DESCRIPTION: Call the DOS parser to parse the command line parameters ;AN000;
+; of the GRAPHICS command line which is obtained from the PSP (Program Segment ;AN000;
+; Prefix). ;AN000;
+; ;AN000;
+; The format of the command line is: ;AN000;
+; ;AN000;
+; ;AN000;
+; GRAPHICS {prt_type {profile}} {/R} {/B} {[/LCD | /PRINTBOX:id]} ;AN000;
+; ;AN000;
+; (All arguments are optional, /PRINTBOX can be spelled /PB.) ;AN000;
+; ;AN000;
+; If no printer type is specified then, a null pointer is returned. ;AN000;
+; If no profile name is supplied then, a null string is returned. ;AN000;
+; If "/LCD" is specified then, a pointer to the printbox id: "LCD" is returned. ;AN000;
+; ;AN000;
+; ;AN000;
+; LOGIC: ;AN000;
+; Set addressibility to the command line parameters in the PSP ;AN000;
+; CALL SYSPARSE ; Call the system parser ;AN000;
+; While not (End Of Line) AND no error ;AN000;
+; IF argument is the profile name ;AN000;
+; THEN Get the profile name ;AN000;
+; IF argument is the printbox switch ;AN000;
+; THEN Get the printbox id ;AN000;
+; IF argument is a /r ;AN000;
+; THEN Get /r ;AN000;
+; IF argument is /b ;AN000;
+; THEN Get /b ;AN000;
+; IF argument /lcd ;AN000;
+; THEN Get /lcd ;AN000;
+; CALL SYSPARSE ;AN000;
+; If error ;AN000;
+; Then display the appropriate error message ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; BIT MASK INDICATING THE COMMAND LINE SWITCHES PARSED SO FAR: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+SWITCH_PARSED DB 0 ;AN000;
+GOT_R EQU 1 ; Found /R ;AN000;
+GOT_B EQU 2 ; Found /B ;AN000;
+GOT_LCD EQU 4 ; Found /LCD ;AN000;
+GOT_PRINTBOX EQU 8 ; Found /PB:id or /PRINTBOX:id ;AN000;
+ ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; CONTROL BLOCK DEFINITIONS FOR THE PARSER: ;AN000;
+; ;AN000;
+;===============================================================================;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; PARMS INPUT BLOCK ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PARMS LABEL WORD ;AN000;
+ DW PARMSX ; Offset of parms extension block ;AN000;
+ DB 0 ; No delimiters to define ;AN000;
+ ; or end of line markers. ;AN000;
+ ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; PARMS EXTENSION BLOCK : Describe what's on the command line ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PARMSX LABEL BYTE ;AN000;
+ DB 0,2 ; Max. 2 positional parameters ;AN000;
+ DW TYPE_CTL ; Offset of type control block ;AN000;
+ DW PROF_CTL ; Offset of profile control block ;AN000;
+ ;AN000;
+ DB 5 ; Max. 4 switch types ;AN000;
+ DW PRINTBOX_CTL ; Offset of control for Printbox ;AN000;
+ DW R_CTL ; Offset of control for /R ;AN000;
+ DW B_CTL ; Offset of control for /B ;AN000;
+ DW LCD_CTL ; Offset of control for /LCD ;AN000;
+ DW ?_CTL ; offset of control for /?
+ ;AN000;
+ DB 0 ; No keywords ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the printer type parameter: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+TYPE_CTL LABEL WORD ;AN000;
+ DW 2001H ; Optional simple string ;AN000;
+ DW 0002H ; Capitalize it ;AN000;
+ DW TYPE_RESULT ; Offset of result buffer for printer type ;AN000;
+ DW NO_VALUES ; No values (NOTE: The type returned is checked;AN000;
+ DB 0 ; for validity by LOAD_PROFILE);AN000;
+ ;AN000;
+NO_VALUES DB 0 ;AN000;
+ ;AN000;
+TYPE_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Pointer to string found ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the format of the PROFILE parameter: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+PROF_CTL LABEL WORD ;AN000;
+ DW 0201H ; File spec. - Optional ;AN000;
+ DW 0001h ; Capitalize ;AN000;
+ DW PROFILE_RESULT ; Offset of result buffer for Profile ;AN000;
+ DW NO_VALUES ; No values needed ;AN000;
+ DB 0 ;AN000;
+ ;AN000;
+ ;AN000;
+PROFILE_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of string ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the format of /R ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+R_CTL LABEL WORD ;AN000;
+ DW 0 ; ;AN000;
+ DW 0 ; ;AN000;
+ DW R_RESULT ; Offset of result buffer for a simple switch ;AN000;
+ DW NO_VALUES ; No values can be given with these switches. ;AN000;
+ DB 1 ; 1 name for this switch ;AN000;
+ DB "/R",0 ; Reverse ;AN000;
+ ;AN000;
+R_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of value ;AN000;
+
+;----------------------------------------------------------------------------
+;
+; Describe the format of /?
+;
+;----------------------------------------------------------------------------
+?_CTL LABEL WORD ;AN000;
+ DW 0 ; ;AN000;
+ DW 0 ; ;AN000;
+ DW ?_RESULT ; Offset of result buffer for a simple switch
+ DW NO_VALUES ; No values can be given with these switches.
+ DB 1 ; 1 name for this switch
+ DB "/?",0
+ ;AN000;
+?_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of value ;AN000;
+
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the format of /B ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+B_CTL LABEL WORD ;AN000;
+ DW 0 ; ;AN000;
+ DW 0 ; ;AN000;
+ DW B_RESULT ; Offset of result buffer for a simple switch ;AN000;
+ DW NO_VALUES ; No values can be given with these switches. ;AN000;
+ DB 1 ; 1 name allowed for this switch ;AN000;
+ DB "/B",0 ; Background ;AN000;
+ ;AN000;
+B_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of value ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the format of /LCD ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+LCD_CTL LABEL WORD ;AN000;
+ DW 0 ; ;AN000;
+ DW 0 ; ;AN000;
+ DW LCD_RESULT ; Offset of result buffer for a /LCD ;AN000;
+ DW NO_VALUES ; No values can be given with these switches. ;AN000;
+ DB 1 ; 1 name: ;AN000;
+ DB "/LCD",0 ; /LCD ;AN000;
+ ;AN000;
+LCD_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of value ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; Describe the format of the PRINTBOX switch: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PRINTBOX_CTL LABEL WORD ;AN000;
+ DW 2001H ; Optional simple string ;AN000;
+ DW 0001H ; Capitalize ;AN000;
+ DW PRINTBOX_RESULT ; Offset of result buffer for Printbox ;AN000;
+ DW NO_VALUES ; Values will be validated when loading profile ;AN000;
+ DB 2 ; 2 synomym for this switch: ;AN000;
+ DB "/PRINTBOX",0 ; ;AN000;
+ DB "/PB",0 ;AN000;
+ ;AN000;
+PRINTBOX_RESULT LABEL BYTE ;AN000;
+ DB ? ; Type ;AN000;
+ DB ? ; Item tag ;AN000;
+ DW ? ; Offset of synomym ;AN000;
+ DD ? ; Offset of value ;AN000;
+ ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; DOS "MESSAGE RETRIEVER" Substitution list control block: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+SUBLIST LABEL DWORD ; List for substitution: ;AN000;
+ DB 11 ; Size of this list ;AN000;
+ DB 0 ; Reserved ;AN000;
+SAVE_SI DD ? ; Ptr to data item ;AN001;
+ DB 1 ; Variable to be substitued: %1 ;AN000;
+ DB 00010000B ; %1 is an ASCIIZ string left justifi;AN000;ed
+ DB 0 ; Unlimited size for %1 ;AN000;
+ DB 1 ; Minimum size is 1 character ;AN000;
+ DB " " ; Delimiter is "space" ;AN000;
+ ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; START OF EXECUTABLE CODE: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+PARSE_PARMS_START: ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ PUSH ES ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set up addressibility for the parser ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV SI,81H ; DS:SI := Command line parameters ;AN000;
+ ; to be parsed ;AN000;
+ PUSH CS ;AN000;
+ POP ES ;AN000;
+ LEA DI,PARMS ; ES:DI := Parms control block ;AN000;
+;(deleted ;AN001;) XOR DX,DX ; CX,DX must be zero for the ;AN000;
+ XOR CX,CX ; Initially, CX should be zero ;AN001;
+ MOV AX,0 ; No error yet ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Parse FIRST argument ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;(deleted ;AN001;) CALL SYSPARSE ; Get one argument from the command line;AN000;
+ CALL CALL_SYSPARSE ; Get one argument from the command line;AN001;
+;(deleted ;AN001;) MOV BX,DX ; BX := Offset of result block ;AN000;
+.WHILE <AX EQ RC_NO_ERROR> ; While there is no error ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Get the argument: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ .SELECT ;AN000;
+ .WHEN <BX EQ <OFFSET ?_RESULT>>
+ MOV [ERROR_DEVICE], STDOUT ; output to stdout
+ MOV AX, MSG_OPTIONS_FIRST ; number of first 'option' msg
+ XOR CX, CX ; specify no subst
+PRMORE: CALL DISP_ERROR ; DISP_ERROR is a mistaken name
+; in this case. I use it because it is the existing routine for printing out
+; messages, and it is named so because the only messages graphics would
+; display are error messages. Hence disp_error writes out to STDERR. I
+; could write another message-display interface to sysdispmsg, but this one
+; works fine, I just wanted to note that the name disp_error gives the wrong
+; impression here.
+ INC AX
+ CMP AX, MSG_OPTIONS_LAST + 1 ; another msg to do
+ JB PRMORE
+ MOV [ERROR_DEVICE], STDERR ; set output back to stderr
+ STC ; pretend to have an error so
+; that graphics now cleans up and goes home without further action
+ JMP PPST
+ .WHEN <BX EQ <OFFSET TYPE_RESULT>> ;AN000;
+ CALL GET_TYPE ;AN000;
+ .WHEN <BX EQ <OFFSET PROFILE_RESULT>> ;AN000;
+ CALL GET_PROFILE_NAME ;AN000;
+ .WHEN <BX EQ <OFFSET LCD_RESULT >> ;AN000;
+ CALL GET_LCD ;AN000;
+ .WHEN <BX EQ <OFFSET R_RESULT>> ;AN000;
+ CALL GET_REVERSE ;AN000;
+ .WHEN <BX EQ <OFFSET B_RESULT>> ;AN000;
+ CALL GET_BACKGROUND ;AN000;
+ .WHEN <BX EQ <OFFSET PRINTBOX_RESULT>> ;AN000;
+ CALL GET_PRINTBOX_ID ;AN000;
+ .OTHERWISE ;AN000;
+;-------No result block was returned by the parser ;AN000;
+ STC ; Set error ;AN000;
+ .ENDSELECT ;AN000;
+ .LEAVE C ; IF error occurred while parsing the ;AN000;
+ ; previous argument, exit the loop: ;AN000;
+ ; stop parsing the command line. ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Parse next argument: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+;(deleted ;AN001;) XOR DX,DX ; ;AN000;
+;(deleted ;AN001;) CALL SYSPARSE ; Get one argument from the command line;AN000;
+ CALL CALL_SYSPARSE ; Get one argument from the command line;AN001;
+;(deleted ;AN001;) MOV BX,DX ; ES:BX := Offset of result block ;AN000;
+.ENDWHILE ;AN000;
+
+;-------------------------------------------------------------------------------;AN000;
+; Check for error, select and display an error message ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+.IF <AL NE RC_EOL> ; IF an error occurred ;AN000;
+.THEN ; then, display error message ;AN000;
+ MOV CX,0 ; Assume no substitutions ;AN000;
+ .SELECT ; (CX := Number of substitutions ;AN000;
+ .WHEN <AL EQ RC_TOO_MANY> ; When RC = Too many parameters ;AN000;
+ MOV AX,TOO_MANY_PARMS ; (AL = Message number to display) ;AN000;
+ .WHEN <AL EQ RC_Not_In_Val> ; When RC = Not in value list provided ;AN000;
+ MOV AX,VALUE_NOT_ALLOWED ; (AL = Message number to display) ;AN000;
+ .WHEN <AL EQ RC_Not_In_Sw> ; When RC = Not in switch list provided ;AN000;
+ MOV CX,1 ; 1 substitution in this message ;AN000;
+ MOV BYTE PTR [SI],0 ; PUT NUL AT END OF THIS PARM ;AN001;
+ LEA SI,SUBLIST ; DS:[SI]:="Invalid parm" Substitution;AN000; list
+;(deleted ;AN001;) LES DX,ES:[BX+4] ; ES:DX := Offset of offending parm. ;AN000;
+;(deleted ;AN001;) MOV [SI]+2,DX ; Store offset to this offender in the;AN000;
+ MOV [SI]+4,ES ; substitution list control block ;AN000;
+ MOV AX,INVALID_PARM ; AL := 'Invalid parameter' msg number;AN000;
+ .WHEN <AL EQ RC_INVLD_COMBINATION> ; When RC = Invalid combination of parms;AN000;
+ MOV AX,INVALID_COMBINATION ; (AL = Message number to display) ;AN000;
+ .WHEN <AL EQ RC_DUPLICATE_PARMS> ; When RC = Invalid combination of parms;AN000;
+ MOV AX,DUPLICATE_PARM ; (AL = Message number to display) ;AN000;
+ .OTHERWISE ; ;AN000;
+ MOV AX,FORMAT_NOT_CORRECT ; RC = Anything else, tell the user ;AN000;
+ ; something is wrong with his ;AN000;
+ .ENDSELECT ; command line. ;AN000;
+ CALL DISP_ERROR ; Display the selected error message ;AN000;
+ STC ; Indicate parse error occurred ;AN000;
+.ENDIF ;AN000;
+ ;AN000;
+PPST: POP ES ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ RET ; Return to GRAPHICS_INSTALL ;AN000;
+ ;AN000;
+PARSE_PARMS ENDP ;AN000;
+CALL_SYSPARSE PROC NEAR ;COMMON INVOCATION OF SYSPARSE ;AN001;
+;INPUT: - CX=ORDINAL VALUE ;AN001;
+; DS:SI=WHERE COMMAND LINE IS, SAVED IN "SAVE_SI" ;AN001;
+; ES:DI=WHERE PARMS DESCRIPTOR BLOCK IS ;AN001;
+;OUTPUT: CX=NEW ORDINAL VALUE ;AN001;
+; BX=OFFSET OF RESULT BLOCK, IF ONE IS RETURNED ;AN001;
+; SI=OFFSET OF CHAR BEYOND PARSED PARM IN COMMAND LINE ;AN001;
+ ;AN001;
+ XOR DX,DX ;CLEAR DX FOR PARSER ;AN001;
+ MOV WORD PTR SAVE_SI,SI ;REMEMBER WHERE TO START LOOKING ;AN001;
+ CALL SYSPARSE ;GO PARSE THE NEXT PARM ;AN001;
+ ;AN001;
+ MOV BX,DX ; BX := Offset of result block ;AN001;
+ RET ;RETURN TO CALLER ;AN001;
+CALL_SYSPARSE ENDP ;AN001;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_PROFILE ;AN000;
+; ;AN000;
+; INPUT: ES:[BX] := Result block ;AN000;
+; ;AN000;
+; OUTPUT: PROFILE_PATH = The profile file name and path (ASCIIZ string) ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_PROFILE_NAME PROC ;AN000;
+ PUSH AX ;AN000;
+ PUSH BX ;AN000;
+ PUSH DX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Get the name of the profile path found on the command line: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV DI,ES:[BX+4] ; DI := Offset of filename found ;AN000;
+ XOR BX,BX ; BX := Byte index ;AN000;
+ MOV SI,OFFSET PROFILE_PATH ; [BX][SI] := Where to store it ;AN000;
+ ;AN000;
+.IF <<BYTE PTR [DI]> NE 0> ; Don't copy a NULL parm ;AN000;
+ .REPEAT ; While not end of path name (NULL terminated) ;AN000;
+ MOV AL,[BX][DI] ; Copy the byte (including the NULL) ;AN000;
+ MOV [BX][SI],AL ;AN000;
+ INC BX ; Get next one ;AN000;
+ .UNTIL <<BYTE PTR [BX-1][DI]> EQ 0> ; ;AN000;
+.ENDIF ;AN000;
+ ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP DX ;AN000;
+ POP BX ;AN000;
+ POP AX ;AN000;
+ CLC ;AN000;
+ RET ;AN000;
+GET_PROFILE_NAME ENDP ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_TYPE ;AN000;
+; ;AN000;
+; INPUT: ES:[BX] := Result block ;AN000;
+; PRINTER_TYPE_LENGTH := Maximum length for the printer type string ;AN000;
+; ;AN000;
+; OUTPUT: PRINTER_TYPE_PARM = ASCIIZ string containing ;AN000;
+; the Printer type. ;AN000;
+; AX = Error code ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_TYPE PROC ;AN000;
+ PUSH BX ;AN000;
+ PUSH CX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+;---------------------------------------------------------------------- ;AN000;
+; Overwrite the DEFAULT TYPE with the type found on the command line ;AN000;
+;---------------------------------------------------------------------- ;AN000;
+ MOV SI,ES:[BX+4] ; DS:SI := Offset of printer type found ;AN000;
+ .IF <<BYTE PTR [SI]> NE 0> ; Do not copy an empty string ;AN000;
+ .THEN ; ;AN000;
+ MOV CL,PRINTER_TYPE_LENGTH ; CX := Maximum number of bytes ;AN000;
+ XOR CH,CH ; to copy ;AN000;
+ MOV DI,OFFSET PRINTER_TYPE_PARM; ES:DI := Where to store it ;AN000;
+ REP MOVSB ; Copy the string ;AN000;
+ ;---------------------------------------------------------------------- ;AN000;
+ ; Verify that the string supplied is not too long: ;AN000;
+ ;---------------------------------------------------------------------- ;AN000;
+ .IF <<BYTE PTR [DI-1]> EQ 0> ; If the last byte is a null ;AN000;
+ .THEN ; then, the string was not longer ;AN000;
+ ; than the maximum ;AN000;
+ CLC ; Clear the carry flag = No error ;AN000;
+ .ELSE ; else, string provided is too long ;AN000;
+ MOV AX,RC_Not_In_Sw ; Error := RC for Invalid parm ;AN000;
+ STC ; Set error ;AN000;
+ .ENDIF ; ENDIF string too long ;AN000;
+ .ENDIF ; ENDIF string provided ;AN000;
+ ;AN000;
+GET_TYPE_END: ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP CX ;AN000;
+ POP BX ;AN000;
+ RET ;AN000;
+GET_TYPE ENDP ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_REVERSE ;AN000;
+; ;AN000;
+; INPUT: ES:[BX] := Result block ;AN000;
+; SWITCH_PARSED := The command line switches parsed so far (bit mask) ;AN000;
+; ;AN000;
+; OUTPUT: CS:[BP].SWITCHES (Bit mask in the Shared data area) is updated ;AN000;
+; with the value of the switch found. ;AN000;
+; GOT_R is set in SWITCH_PARSED ;AN000;
+; AX := Error message number. ;AN000;
+; CARRY FLAG IS SET IF ERROR FOUND ;AN000;
+; ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_REVERSE PROC ;AN000;
+ ;AN000;
+ TEST SWITCH_PARSED,GOT_R ; If already parsed this switch ;AN000;
+ JNZ DUPLICATE_R ; then, error ;AN000;
+ OR SWITCH_PARSED,GOT_R ; else, say we parsed it. ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set the Reverse switch in the Shared data area ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ OR CS:[BP].SWITCHES,REVERSE_SW ; Set the command line switch ;AN000;
+ CLC ; Clear the error flag ;AN000;
+ JMP SHORT GET_REVERSE_END ; Return ;AN000;
+ ;AN000;
+DUPLICATE_R: ; Already got this switch ;AN000;
+ MOV AX,RC_DUPLICATE_PARMS ; AX := error message number ;AN000;
+ STC ; SET ERROR ;AN000;
+GET_REVERSE_END: ;AN000;
+ ;AN000;
+ RET ;AN000;
+GET_REVERSE ENDP ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_BACKGROUND ;AN000;
+; ;AN000;
+; INPUT: ES:[BX] := Result block ;AN000;
+; SWITCH_PARSED := The command line switches parsed so far (bit mask) ;AN000;
+; ;AN000;
+; OUTPUT: CS:[BP].SWITCHES (Bit mask in the Shared data area) is updated ;AN000;
+; with the value of the switch found. ;AN000;
+; ;AN000;
+; GOT_B is set in SWITCH_PARSED ;AN000;
+; AX := Error message number. ;AN000;
+; CARRY FLAG IS SET IF ERROR FOUND ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_BACKGROUND PROC ;AN000;
+ ;AN000;
+ TEST SWITCH_PARSED,GOT_B ; If already parsed this switch ;AN000;
+ JNZ DUPLICATE_B ; then, error ;AN000;
+ OR SWITCH_PARSED,GOT_B ; else, say we parsed it. ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set the switch in the Shared data area ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ OR CS:[BP].SWITCHES,BACKGROUND_SW ; Set the command line switch ;AN000;
+ CLC ; Clear the error flag ;AN000;
+ JMP SHORT GET_BACKGROUND_END ; Return ;AN000;
+ ;AN000;
+DUPLICATE_B: ; Already got this switch ;AN000;
+ MOV AX,RC_DUPLICATE_PARMS ; AX := error message number ;AN000;
+ STC ; SET ERROR ;AN000;
+ ;AN000;
+GET_BACKGROUND_END: ;AN000;
+ RET ;AN000;
+GET_BACKGROUND ENDP ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_LCD ;AN000;
+; ;AN000;
+; INPUT: SWITCH_PARSED := The command line switches parsed so far (bit mask) ;AN000;
+; ;AN000;
+; OUTPUT: PRINTBOX_ID_PTR := Point to /LCD ASCIIZ string. ;AN000;
+; GOT_B is set in SWITCH_PARSED ;AN000;
+; AX := Error message number. ;AN000;
+; CARRY FLAG IS SET IF ERROR FOUND ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Data Referenced: ;AN000;
+; ;AN000;
+; LCD_BOX = An ASCIIZ string representing the LCD printbox id. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_LCD PROC ;AN000;
+ ;AN000;
+ TEST SWITCH_PARSED,GOT_LCD ; If already parsed this switch ;AN000;
+ JNZ DUPLICATE_LCD ; then, error: Duplicate switch ;AN000;
+ TEST SWITCH_PARSED,GOT_PRINTBOX ; If printbox already mentioned ;AN000;
+ JNZ BAD_COMBINATION ; then, error: Invalid combination ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set the pointer to the print box id to "LCD" ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ MOV AX,OFFSET LCD_BOX ; PRINTBOX id := LCD ;AN000;
+ MOV PRINTBOX_ID_PTR,AX ; Save pointer to this printbox id. ;AN000;
+ OR SWITCH_PARSED,GOT_LCD ; Say we found this switch ;AN000;
+ CLC ; Clear the error flag ;AN000;
+ JMP SHORT GET_LCD_END ; Return ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; /LCD was already parsed: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+DUPLICATE_LCD: ; Already got this switch ;AN000;
+ MOV AX,RC_DUPLICATE_PARMS ; AX := error message number ;AN000;
+ STC ; SET ERROR ;AN000;
+ JMP SHORT GET_LCD_END ; Return ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; /PRINTBOX was already parsed: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+BAD_COMBINATION: ; /LCD and /PRINTBOX invalid at same ;AN000;
+ MOV AX,RC_INVLD_COMBINATION ; time, Set the error flag ;AN000;
+ STC ; AX := Error code ;AN000;
+ ;AN000;
+GET_LCD_END: ;AN000;
+ RET ;AN000;
+GET_LCD ENDP ;AN000;
+ ;AN000;
+PAGE ;AN000;
+;===============================================================================;AN000;
+; ;AN000;
+; PROCEDURE_NAME: GET_PRINTBOX ;AN000;
+; ;AN000;
+; INPUT: ES:[BX] := Result block ;AN000;
+; SWITCH_PARSED := The command line switches parsed so far (bit mask) ;AN000;
+; ;AN000;
+; OUTPUT: DEFAULT_BOX := Is overwritten to contain the printbox id. found on ;AN000;
+; the command line. ;AN000;
+; GOT_PRINTBOX is set in SWITCH_PARSED ;AN000;
+; AX := Error message number. ;AN000;
+; CARRY FLAG IS SET IF ERROR FOUND ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+GET_PRINTBOX_ID PROC ;AN000;
+ ;AN000;
+ PUSH CX ;AN000;
+ PUSH SI ;AN000;
+ PUSH DI ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Test for error in the printbox statement: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ TEST SWITCH_PARSED,GOT_LCD ; If /LCD already mentioned ;AN000;
+ JNZ BAD_COMBINATION2 ; then, error: Invalid combination ;AN000;
+ TEST SWITCH_PARSED,GOT_PRINTBOX ; If already parsed this switch ;AN000;
+ JNZ DUPLICATE_PRINTBOX ; then, error: Duplicate switch ;AN000;
+ ;AN000;
+ MOV DI,ES:[BX+4] ; DI := Offset of switch VALUE found;AN000;
+ ;AN000;
+ .IF <<BYTE PTR [DI]> EQ 0> ; IF no printbox id ;AN000;
+ .THEN ; then, ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ ; No printbox id. was found: ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ MOV AX,FORMAT_NOT_CORRECT ; AX := Error code ;AN000;
+ STC ; Set the error flag ;AN000;
+ .ELSE ; else, ;AN000;
+ OR SWITCH_PARSED,GOT_PRINTBOX; Say we found this switch ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ ; Overwrite DEFAULT_BOX with the Printbox id. found ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ MOV CL,PRINTBOX_ID_LENGTH ; CX := Maximum number of bytes ;AN000;
+ XOR CH,CH ; to copy ;AN000;
+ MOV SI,DI ; [DS][SI] := Value found ;AN000;
+ MOV DI,OFFSET DEFAULT_BOX ; [ES][DI] := Default value ;AN000;
+ REP MOVSB ; Copy the string ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ ; Verify that the Printbox id. string is not too long: ;AN000;
+ ;----------------------------------------------------------------------;AN000;
+ .IF <<BYTE PTR [DI-1]> EQ 0> ; If the last byte is a null ;AN000;
+ .THEN ; then, the string was not longer ;AN000;
+ ; than the maximum ;AN000;
+ CLC ; Clear the carry flag = No error ;AN000;
+ .ELSE ; else, string provided is too long ;AN000;
+ MOV AX,RC_Not_In_Sw ; Error := RC for Invalid parm ;AN000;
+ STC ; Set error ;AN000;
+ .ENDIF ; ENDIF printbox id. too long ;AN000;
+ .ENDIF ; ENDIF printbox id. provided ;AN000;
+ ;AN000;
+ JMP SHORT GET_PRINTBOX_END ; Return ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; /PRINTBOX was already parsed: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+DUPLICATE_PRINTBOX: ; Already got this switch ;AN000;
+ MOV AX,RC_DUPLICATE_PARMS ; AX := error message number ;AN000;
+ STC ; SET ERROR ;AN000;
+ JMP SHORT GET_PRINTBOX_END ; Return ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; /LCD was already parsed: ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+BAD_COMBINATION2: ; /LCD and /PRINTBOX invalid at same;AN000;
+ MOV AX,RC_INVLD_COMBINATION ; time, Set the error flag ;AN000;
+ STC ; AX := Error code ;AN000;
+ ;AN000;
+GET_PRINTBOX_END: ;AN000;
+ POP DI ;AN000;
+ POP SI ;AN000;
+ POP CX ;AN000;
+ RET ;AN000;
+GET_PRINTBOX_ID ENDP ;AN000;
+ ;AN000;
+CODE ENDS ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grparms.ext b/private/mvdm/dos/v86/cmd/graphics/grparms.ext
new file mode 100644
index 000000000..5ea1ce798
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grparms.ext
@@ -0,0 +1,30 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPARMS.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRPARMS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN PARSE_PARMS:NEAR ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grparse.asm b/private/mvdm/dos/v86/cmd/graphics/grparse.asm
new file mode 100644
index 000000000..e56a2b7d8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grparse.asm
@@ -0,0 +1,94 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS GRAPHICS Command - Profile Load Modules #2
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRLOAD.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the modules used to load the ;AN000;
+;; GRAPHICS profile into resident memory. ;AN000;
+;; ;AN000;
+;; ************* The EGA Dynamic Save Area will be built (by ;AN000;
+;; ** NOTE ** CHAIN_INTERRUPTS in file GRINST.ASM) over top of these ;AN000;
+;; ************* modules to avoid having to relocate this save just before ;AN000;
+;; terminating. This is safe since the maximum memory used is ;AN000;
+;; 288 bytes and the profile loading modules are MUCH larger than ;AN000;
+;; this. So GRLOAD.ASM MUST be linked before GRINST.ASM and after ;AN000;
+;; GRPRINT.ASM. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; PLACID Functional Specifications ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; LOAD_PROFILE - Main module for profile loading ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; ?????????? - Externals for profile loading modules ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; None ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; --------------------- ;AN000;
+;; Refer to GRAPHICS.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;; ;AN000;
+ ;; ;AN000;
+ INCLUDE STRUC.INC ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; Public Symbols ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ ASSUME CS:CODE,DS:CODE ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; Set assemble switches for parse code that is not required!! ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+DateSW EQU 0 ;AN000;
+TimeSW EQU 0 ;AN000;
+CmpxSW EQU 0 ;AN000;
+DrvSW EQU 0 ;AN000;
+QusSW EQU 0 ;AN000;
+KeySW EQU 0 ;AN000;
+;Val1SW EQU 0 ;AN000;
+;Val2SW EQU 0 ;AN000;
+
+ include version.inc ;AN000;
+ PUBLIC SYSPARSE ;; ;AN000;
+ INCLUDE PARSE.ASM ;; parser code ;AN000;
+ ;; ;AN000;
+CODE ENDS ;; ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grparse.ext b/private/mvdm/dos/v86/cmd/graphics/grparse.ext
new file mode 100644
index 000000000..ce721004a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grparse.ext
@@ -0,0 +1,30 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+.XLIST ;AN000;
+ ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRINST.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRLOAD.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN SYSPARSE:NEAR ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grpattrn.asm b/private/mvdm/dos/v86/cmd/graphics/grpattrn.asm
new file mode 100644
index 000000000..c468d11a5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grpattrn.asm
@@ -0,0 +1,223 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ PAGE ,132 ;AN000;
+ TITLE DOS - GRAPHICS Command - Common modules ;AN000;
+.xlist ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPATTRN.ASM ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; This file contains the grey patterns used by PRT_BW_APA for printing ;AN000;
+;; on a Black and White printer. ;AN000;
+;; ;AN000;
+;; Documentation Reference: ;AN000;
+;; ------------------------ ;AN000;
+;; OASIS High Level Design ;AN000;
+;; OASIS GRAPHICS I1 Overview ;AN000;
+;; ;AN000;
+;; Procedures Contained in This File: ;AN000;
+;; ---------------------------------- ;AN000;
+;; none ;AN000;
+;; ;AN000;
+;; Include Files Required: ;AN000;
+;; ----------------------- ;AN000;
+;; GRPATTRN.STR - Structures for patterns. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; External Procedure References: ;AN000;
+;; ------------------------------ ;AN000;
+;; ;AN000;
+;; Called by PRT_BW_APA from file GRBWPRT.ASM ;AN000;
+;; ;AN000;
+;; Linkage Instructions: ;AN000;
+;; -------------------- ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.list ;AN000;
+CODE SEGMENT PUBLIC 'CODE' ;AN000;
+ ASSUME CS:CODE,DS:CODE ;AN000;
+INCLUDE GRPATTRN.STR ;AN000;
+ ;AN000;
+PUBLIC TAB_DIRECTORY ;AN000;
+PUBLIC TAB_DIR_NB_ENTRIES ;AN000;
+PUBLIC PAT_4X2 ;AN000;
+PUBLIC PAT_4X4 ;AN000;
+PUBLIC PAT_6X2 ;AN000;
+PUBLIC PAT_8X2 ;AN000;
+PUBLIC PAT_6X4 ;AN000;
+PUBLIC PAT_8X4 ;AN000;
+PUBLIC PAT_8X6 ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; PATTERN DIRECTORY: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+TAB_DIR_NB_ENTRIES DB 7 ;AN000;
+TAB_DIRECTORY LABEL BYTE ;AN000;
+; ENTRY = <OFFSET PATTERN TABLE, TABLE SIZE, BOX_W, BOX_H, ;AN000;
+; NUNBER OF PATTERNS(INTENSITIES) > ;AN000;
+ TAB_ENTRY <OFFSET PAT_4X2,-1,40,2,1,8 > ;AN000;
+ TAB_ENTRY <OFFSET PAT_4X4,-1,40,2,2,8 > ;AN000;
+ TAB_ENTRY <OFFSET PAT_6X2,-1,70,3,1,10> ;AN000;
+ TAB_ENTRY <OFFSET PAT_8X2,-1,108,4,1,12> ;AN000;
+ TAB_ENTRY <OFFSET PAT_6X4,-1,119,3,2,17> ;AN000;
+ TAB_ENTRY <OFFSET PAT_8X4,-1,162,4,2,18> ;AN000;
+ TAB_ENTRY <OFFSET PAT_8X6,-1,171,4,3,19> ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 4X2 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_4X2 LABEL BYTE ;AN000;
+; PATTERN=<MAXIMUM INTENSITY, 1ST COLUMN (top is left bit), 2ND, 3RD, 4TH > ;AN000;
+ PAT_4X2_STR < 5,11B,11B,11B,11B> ;AN000;
+ PAT_4X2_STR <13,11B,10B,01B,11B> ;AN000;
+ PAT_4X2_STR <20,10B,11B,01B,10B> ;AN000;
+ PAT_4X2_STR <28,10B,01B,01B,10B> ;AN000;
+ PAT_4X2_STR <36,10B,00B,01B,10B> ;AN000;
+ PAT_4X2_STR <47,10B,00B,01B,00B> ;AN000;
+ PAT_4X2_STR <58,10B,00B,00B,00B> ;AN000;
+ PAT_4X2_STR <63,00B,00B,00B,00B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 4X4 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_4X4 LABEL BYTE ;AN000;
+; PATTERN=<MAXIMUM INTENSITY, 1ST COLUMN (top is left bit), 2ND, 3RD, 4TH > ;AN000;
+ PAT_4X4_STR < 5,1111B,1111B,1111B,1111B> ;AN000;
+ PAT_4X4_STR <13,1111B,1010B,0101B,1111B> ;AN000;
+ PAT_4X4_STR <20,1010B,1111B,0101B,1010B> ;AN000;
+ PAT_4X4_STR <28,1010B,0101B,0101B,1010B> ;AN000;
+ PAT_4X4_STR <36,1010B,0000B,0101B,1010B> ;AN000;
+ PAT_4X4_STR <47,1010B,0000B,0101B,0000B> ;AN000;
+ PAT_4X4_STR <58,1010B,0000B,0000B,0000B> ;AN000;
+ PAT_4X4_STR <63,0000B,0000B,0000B,0000B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 6X2 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_6X2 LABEL BYTE ;AN000;
+ PAT_6X2_STR < 3,11B,11B,11B,11B,11B,11B> ;AN000;
+ PAT_6X2_STR < 8,11B,11B,10B,11B,11B,01B> ;AN000;
+ PAT_6X2_STR <15,10B,01B,10B,11B,10B,01B> ;AN000;
+ PAT_6X2_STR <21,01B,10B,10B,01B,10B,10B> ;AN000;
+ PAT_6X2_STR <28,01B,10B,10B,01B,10B,00B> ;AN000;
+ PAT_6X2_STR <36,10B,01B,00B,10B,01B,00B> ;AN000;
+ PAT_6X2_STR <45,00B,10B,00B,01B,00B,10B> ;AN000;
+ PAT_6X2_STR <53,10B,00B,00B,01B,00B,00B> ;AN000;
+ PAT_6X2_STR <60,10B,00B,00B,00B,00B,00B> ;AN000;
+ PAT_6X2_STR <63,00B,00B,00B,00B,00B,00B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 8X2 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_8X2 LABEL BYTE ;AN000;
+ PAT_8X2_STR < 3,11B,11B,11B,11B,11B,11B,11B,11B> ;AN000;
+ PAT_8X2_STR < 9,11B,11B,10B,11B,11B,10B,11B,01B> ;AN000;
+ PAT_8X2_STR <15,10B,11B,01B,11B,10B,11B,00B,11B> ;AN000;
+ PAT_8X2_STR <21,10B,01B,11B,10B,01B,10B,01B,10B> ;AN000;
+ PAT_8X2_STR <27,10B,01B,01B,10B,10B,01B,01B,10B> ;AN000;
+ PAT_8X2_STR <33,00B,10B,01B,10B,00B,01B,10B,01B> ;AN000;
+ PAT_8X2_STR <39,10B,00B,10B,01B,00B,10B,00B,01B> ;AN000;
+ PAT_8X2_STR <45,10B,00B,01B,00B,10B,00B,01B,00B> ;AN000;
+ PAT_8X2_STR <51,10B,00B,00B,01B,00B,00B,10B,00B> ;AN000;
+ PAT_8X2_STR <56,10B,00B,00B,00B,01B,00B,00B,00B> ;AN000;
+ PAT_8X2_STR <61,10B,00B,00B,00B,00B,00B,00B,00B> ;AN000;
+ PAT_8X2_STR <63,00B,00B,00B,00B,00B,00B,00B,00B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 6X4 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_6X4 LABEL BYTE ;AN000;
+ PAT_6X4_STR < 3,1111B,1111B,1111B,1111B,1111B,1111B> ;AN000;
+ PAT_6X4_STR < 8,1111B,1111B,1101B,1111B,1111B,1011B> ;AN000;
+ PAT_6X4_STR <13,1111B,1111B,0101B,1011B,1111B,1010B> ;AN000;
+ PAT_6X4_STR <16,0101B,1111B,0101B,1010B,0101B,1010B> ;AN000;
+ PAT_6X4_STR <20,0101B,1110B,0101B,1010B,0101B,1010B> ;AN000;
+ PAT_6X4_STR <24,1010B,0101B,1010B,0101B,0010B,0101B> ;AN000;
+ PAT_6X4_STR <28,1010B,0101B,1000B,0101B,0010B,0101B> ;AN000;
+ PAT_6X4_STR <32,1010B,0101B,1000B,1001B,0010B,0100B> ;AN000;
+ PAT_6X4_STR <37,1010B,0000B,1010B,0101B,0000B,0101B> ;AN000;
+ PAT_6X4_STR <40,0100B,0001B,1000B,0010B,1000B,0101B> ;AN000;
+ PAT_6X4_STR <45,0100B,0010B,1000B,0010B,0100B,0001B> ;AN000;
+ PAT_6X4_STR <49,1010B,0000B,1000B,0101B,0000B,0000B> ;AN000;
+ PAT_6X4_STR <52,1010B,0000B,0000B,0101B,0000B,0000B> ;AN000;
+ PAT_6X4_STR <55,0000B,1000B,0000B,0010B,0000B,0100B> ;AN000;
+ PAT_6X4_STR <58,1000B,0000B,0000B,0010B,0000B,0000B> ;AN000;
+ PAT_6X4_STR <61,1000B,0000B,0000B,0000B,0000B,0000B> ;AN000;
+ PAT_6X4_STR <63,0000B,0000B,0000B,0000B,0000B,0000B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 8X4 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_8X4 LABEL BYTE ;AN000;
+ PAT_8X4_STR < 1,1111B,1111B,1111B,1111B,1111B,1111B,1111B,1111B> ;AN000;
+ PAT_8X4_STR < 4,1010B,1111B,1111B,1111B,1010B,1111B,1111B,1111B> ;AN000;
+ PAT_8X4_STR < 7,1010B,1111B,1101B,1111B,1010B,1111B,0111B,1111B> ;AN000;
+ PAT_8X4_STR <10,1010B,0111B,1110B,0101B,1010B,1101B,1011B,0101B> ;AN000;
+ PAT_8X4_STR <13,1001B,1110B,0110B,1001B,0110B,1011B,1001B,0110B> ;AN000;
+ PAT_8X4_STR <18,1010B,0101B,1110B,0101B,1010B,0101B,1010B,0101B> ;AN000;
+ PAT_8X4_STR <24,1010B,0101B,0101B,1010B,1010B,0101B,0101B,1010B> ;AN000;
+ PAT_8X4_STR <30,1010B,0101B,1010B,0000B,0101B,1010B,0101B,0000B> ;AN000;
+ PAT_8X4_STR <36,1010B,0000B,1010B,0101B,0000B,1010B,0000B,0101B> ;AN000;
+ PAT_8X4_STR <42,1010B,0000B,0101B,0000B,1010B,0000B,0101B,0000B> ;AN000;
+ PAT_8X4_STR <46,0010B,1000B,0000B,0010B,1000B,0001B,0100B,0001B> ;AN000;
+ PAT_8X4_STR <48,1010B,0000B,0101B,0000B,0000B,1010B,0000B,0000B> ;AN000;
+ PAT_8X4_STR <50,0010B,0000B,1000B,0010B,0000B,0100B,0001B,0000B> ;AN000;
+ PAT_8X4_STR <53,1010B,0000B,0000B,0000B,0101B,0000B,0000B,0000B> ;AN000;
+ PAT_8X4_STR <56,0000B,1000B,0000B,0000B,0100B,0000B,0000B,0010B> ;AN000;
+ PAT_8X4_STR <59,1000B,0000B,0000B,0000B,0010B,0000B,0000B,0000B> ;AN000;
+ PAT_8X4_STR <62,1000B,0000B,0000B,0000B,0000B,0000B,0000B,0000B> ;AN000;
+ PAT_8X4_STR <63,0000B,0000B,0000B,0000B,0000B,0000B,0000B,0000B> ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; ;AN000;
+; 8X6 GREY PATTERNS: ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+PAT_8X6 LABEL BYTE ;AN000;
+ PAT_8X6_STR < 1,111111B,111111B,111111B,111111B,111111B,111111B,111111B,111111B>;AN000;
+ PAT_8X6_STR < 4,011011B,111111B,111111B,111111B,110110B,111111B,111111B,111111B>;AN000;
+ PAT_8X6_STR < 7,101010B,011111B,111111B,110101B,101010B,011111B,111111B,110101B>;AN000;
+ PAT_8X6_STR <10,101010B,010101B,111111B,101010B,010101B,101010B,111111B,010101B>;AN000;
+ PAT_8X6_STR <13,011011B,100100B,111011B,100100B,011011B,100100B,011111B,100100B>;AN000;
+ PAT_8X6_STR <17,101010B,010101B,101010B,010101B,101010B,010101B,101010B,010101B>;AN000;
+ PAT_8X6_STR <21,101010B,010101B,101010B,010101B,001010B,010101B,101010B,010101B>;AN000;
+ PAT_8X6_STR <25,010100B,101010B,010101B,001010B,100100B,010001B,101110B,000001B>;AN000;
+ PAT_8X6_STR <29,000000B,010101B,101010B,010101B,000000B,101010B,010101B,101010B>;AN000;
+ PAT_8X6_STR <33,010010B,100101B,011000B,100010B,001101B,100000B,001010B,100100B>;AN000;
+ PAT_8X6_STR <37,100100B,001010B,010000B,001001B,100010B,001101B,010000B,001010B>;AN000;
+ PAT_8X6_STR <41,100000B,010010B,100100B,000010B,101000B,000101B,010000B,001010B>;AN000;
+ PAT_8X6_STR <45,100010B,001000B,000010B,100000B,010100B,000001B,100100B,000000B>;AN000;
+ PAT_8X6_STR <49,101000B,000001B,000100B,010000B,000010B,100000B,001000B,000101B>;AN000;
+ PAT_8X6_STR <53,101010B,000000B,000000B,000000B,010101B,000000B,000000B,000000B>;AN000;
+ PAT_8X6_STR <57,000000B,010000B,000000B,000100B,000000B,100000B,000000B,000010B>;AN000;
+ PAT_8X6_STR <60,100000B,000000B,000000B,000000B,000100B,000000B,000000B,000000B>;AN000;
+ PAT_8X6_STR <62,100000B,000000B,000000B,000000B,000000B,000000B,000000B,000000B>;AN000;
+ PAT_8X6_STR <63,000000B,000000B,000000B,000000B,000000B,000000B,000000B,000000B>;AN000;
+CODE ENDS ;AN000;
+ END ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grpattrn.ext b/private/mvdm/dos/v86/cmd/graphics/grpattrn.ext
new file mode 100644
index 000000000..74a2ac5f8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grpattrn.ext
@@ -0,0 +1,37 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+PAGE ,132 ;AN000;
+.XLIST ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPATTRN.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing external declarations for ;AN000;
+;; the data defined in GRPATTRN.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+EXTRN PAT_4X2:BYTE ;AN000;
+EXTRN PAT_4X4:BYTE ;AN000;
+EXTRN PAT_6X2:BYTE ;AN000;
+EXTRN PAT_8X2:BYTE ;AN000;
+EXTRN PAT_6X4:BYTE ;AN000;
+EXTRN PAT_8X4:BYTE ;AN000;
+EXTRN PAT_8X6:BYTE ;AN000;
+EXTRN TAB_DIRECTORY:NEAR ;AN000;
+EXTRN TAB_DIR_NB_ENTRIES:BYTE ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grpattrn.str b/private/mvdm/dos/v86/cmd/graphics/grpattrn.str
new file mode 100644
index 000000000..ccde7ee7b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grpattrn.str
@@ -0,0 +1,126 @@
+.XLIST ;AN000;
+PAGE ,132 ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPATTRN.STR ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing structures for ;AN000;
+;; the Printer grey patterns. ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ ;AN000;
+TAB_ENTRY STRUC ; TABLE DIRECTORY ENTRY USED TO LOCATED ;AN000;
+ ; WHAT TABLE OF PATTERNS TO USE ;AN000;
+ TAB_OFFSET DW ? ; ADDRESS OF THE PATTERN TABLE ;AN000;
+ TAB_COPY DW ? ; ADDRESS OF PATTERN TABLE COPY IN SHARED DATA ;AN000;
+ TAB_SIZE DW ? ; SIZE OF THE PATTERN TABLE ;AN000;
+ BOX_W_PAT DB ? ; BOX WIDTH FOR PATTERNS IN THIS TABLE ;AN000;
+ BOX_H_PAT DB ? ; BOX HEIGHT FOR PATTERNS IN THIS TABLE ;AN000;
+ NB_INT DB ? ; NUMBER OF INTENSITIES IN THIS TABLE ;AN000;
+TAB_ENTRY ENDS ;AN000;
+ ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+; PATTERN TYPES: ;AN000;
+; ;AN000;
+; The maximum intensity field represents the upper bound for using ;AN000;
+; a pattern (e.g., the acual intensity of a specific pattern may be ;AN000;
+; 25 but, it will be used for printing intensities of up to 32). ;AN000;
+; Intensities range from 0 = Black to 63 = White. ;AN000;
+; ;AN000;
+; For example, a 4x2 structure represents the following pattern: ;AN000;
+; --- ;AN000;
+; ;AN000;
+; BYTES: C1_4X2 C2_4X2 C3_4X2 C4_4X2 ;AN000;
+; ;AN000;
+; Top dot to print ------> 0 0 0 0 ;AN000;
+; ;AN000;
+; Least significatnt bit ------> 0 0 0 0 ;AN000;
+; of the byte is the dot ;AN000;
+; printed below. ;AN000;
+; ;AN000;
+;-------------------------------------------------------------------------------;AN000;
+ ;AN000;
+PAT_4X2_STR STRUC ; PATTERN MADE OF 2X1 BOXES ;AN000;
+ MAX_4X2 DB ? ; Maximum intensity ;AN000;
+ C1_4X2 DB 00B ; Column 1 (Leftmost column) ;AN000;
+ C2_4X2 DB 00B ; Column 2 ;AN000;
+ C3_4X2 DB 00B ; Column 3 ;AN000;
+ C4_4X2 DB 00B ; Column 4 (Rightmost column) ;AN000;
+PAT_4X2_STR ENDS ;AN000;
+ ;AN000;
+PAT_4X4_STR STRUC ; PATTERN MADE OF 2X2 BOXES ;AN000;
+ MAX_4X4 DB ? ; Maximum intensity ;AN000;
+ C1_4X4 DB 0000B ; Column 1 (Leftmost column) ;AN000;
+ C2_4X4 DB 0000B ; Column 2 ;AN000;
+ C3_4X4 DB 0000B ; Column 3 ;AN000;
+ C4_4X4 DB 0000B ; Column 4 (Rightmost column) ;AN000;
+PAT_4X4_STR ENDS ;AN000;
+ ;AN000;
+PAT_6X2_STR STRUC ; PATTERN MADE OF 3X1 BOXES ;AN000;
+ MAX_6X2 DB ? ; Maximum intensity ;AN000;
+ C1_6X2 DB 00B ; Column 1 (Leftmost column) ;AN000;
+ C2_6X2 DB 00B ; Column 2 ;AN000;
+ C3_6X2 DB 00B ; Column 3 ;AN000;
+ C4_6X2 DB 00B ; Column 4 ;AN000;
+ C5_6X2 DB 00B ; Column 5 ;AN000;
+ C6_6X2 DB 00B ; Column 6 (Rightmost column) ;AN000;
+PAT_6X2_STR ENDS ;AN000;
+ ;AN000;
+PAT_8X2_STR STRUC ; PATTERN MADE OF 4X1 BOXES ;AN000;
+ MAX_8X2 DB ? ; Maximum intensity ;AN000;
+ C1_8X2 DB 00B ; Column 1 (Leftmost column) ;AN000;
+ C2_8X2 DB 00B ; Column 2 ;AN000;
+ C3_8X2 DB 00B ; Column 3 ;AN000;
+ C4_8X2 DB 00B ; Column 4 ;AN000;
+ C5_8X2 DB 00B ; Column 5 ;AN000;
+ C6_8X2 DB 00B ; Column 6 ;AN000;
+ C7_8X2 DB 00B ; Column 7 ;AN000;
+ C8_8X2 DB 00B ; Column 8 (Rightmost column) ;AN000;
+PAT_8X2_STR ENDS ;AN000;
+ ;AN000;
+PAT_8X4_STR STRUC ; PATTERN MADE OF 4X2 BOXES ;AN000;
+ MAX_8X4 DB ? ; Maximum intensity ;AN000;
+ C1_8X4 DB 0000B ; Column 1 (Leftmost column) ;AN000;
+ C2_8X4 DB 0000B ; Column 2 ;AN000;
+ C3_8X4 DB 0000B ; Column 3 ;AN000;
+ C4_8X4 DB 0000B ; Column 4 ;AN000;
+ C5_8X4 DB 0000B ; Column 5 ;AN000;
+ C6_8X4 DB 0000B ; Column 6 ;AN000;
+ C7_8X4 DB 0000B ; Column 7 ;AN000;
+ C8_8X4 DB 0000B ; Column 8 (Rightmost column) ;AN000;
+PAT_8X4_STR ENDS ;AN000;
+ ;AN000;
+PAT_6X4_STR STRUC ; PATTERN MADE OF 3X2 BOXES ;AN000;
+ MAX_6X4 DB ? ; Maximum intensity ;AN000;
+ C1_6X4 DB 0000B ; Column 1 (Leftmost column) ;AN000;
+ C2_6X4 DB 0000B ; Column 2 ;AN000;
+ C3_6X4 DB 0000B ; Column 3 ;AN000;
+ C4_6X4 DB 0000B ; Column 4 ;AN000;
+ C5_6X4 DB 0000B ; Column 5 ;AN000;
+ C6_6X4 DB 0000B ; Column 6 (Rightmost column) ;AN000;
+PAT_6X4_STR ENDS ;AN000;
+ ;AN000;
+PAT_8X6_STR STRUC ; PATTERN MADE OF 4X3 BOXES ;AN000;
+ MAX_8X6 DB ? ; Maximum intensity ;AN000;
+ C1_8X6 DB 000000B ; Column 1 (Leftmost column) ;AN000;
+ C2_8X6 DB 000000B ; Column 2 ;AN000;
+ C3_8X6 DB 000000B ; Column 3 ;AN000;
+ C4_8X6 DB 000000B ; Column 4 ;AN000;
+ C5_8X6 DB 000000B ; Column 5 ;AN000;
+ C6_8X6 DB 000000B ; Column 6 ;AN000;
+ C7_8X6 DB 000000B ; Column 7 ;AN000;
+ C8_8X6 DB 000000B ; Column 8 (Rightmost column) ;AN000;
+PAT_8X6_STR ENDS ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grprint.ext b/private/mvdm/dos/v86/cmd/graphics/grprint.ext
new file mode 100644
index 000000000..9ae28014e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grprint.ext
@@ -0,0 +1,35 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRPRINT.EXT ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; External declarations for code and data defined in ;AN000;
+;; GRPRINT.ASM ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+ EXTRN PRINT_MODULE_START:NEAR ;; ;AN000;
+ EXTRN LEN_OF_BW_MODULES:ABS ;; ;AN000;
+ EXTRN LEN_OF_COLOR_MODULES:ABS ;; ;AN000;
+ EXTRN COLOR_PRINT_MODULES:NEAR ;; ;AN000;
+ EXTRN BW_PRINT_MODULES:NEAR ;; ;AN000;
+ EXTRN PRINT_COLOR:NEAR ;; ;AN000;
+ EXTRN RGB2BAND:NEAR ;; ;AN000;
+ EXTRN PRINT_BW_APA:NEAR ;; ;AN000;
+ EXTRN RGB2INT:NEAR ;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/grshar.str b/private/mvdm/dos/v86/cmd/graphics/grshar.str
new file mode 100644
index 000000000..722fb1f7d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/grshar.str
@@ -0,0 +1,190 @@
+.XLIST ;AN000;
+PAGE ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; DOS - GRAPHICS Command
+;;
+;; ;AN000;
+;; File Name: GRSHAR.STR ;AN000;
+;; ---------- ;AN000;
+;; ;AN000;
+;; Description: ;AN000;
+;; ------------ ;AN000;
+;; Include file containing structures and equates for ;AN000;
+;; Shared Data Area. ;AN000;
+;; ;AN000;
+;; This area is used for communication between the installation process ;AN000;
+;; and the Print Screen process; it contains all the information ;AN000;
+;; extracted from the printer profile. ;AN000;
+;; ;AN000;
+;; ;AN000;
+;; Change History: ;AN000;
+;; --------------- ;AN000;
+;; ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+.LIST ;AN000;
+ ; ;AN000;
+SHARED_DATA_AREA_STR STRUC ; ;AN000;
+ SD_TOTAL_SIZE DW ? ; Total # bytes ALLOCATED to the ;AN000;
+ ; the Shared Data Area. ;AN000;
+ ;;;;;;;;;;;; Environment ;;;;;;;;;;;;;; ;AN000;
+ SWITCHES DB 0 ; Command line switches ;AN000;
+ HARDWARE_CONFIG DB ? ; Type of video hardware ;AN000;
+ PRINTER_TYPE DB ? ; Type of printer attached ;AN000;
+ ; ;AN000;
+ ;;;;;;;;;;;; Profile Data ;;;;;;;;;;;;; ;AN000;
+ DARKADJUST_VALUE DB 0 ; Darkness adjustment value ;AN000;
+ ; ;AN000;
+ NUM_PRT_COLOR DB ? ; Number of print colors ;AN000;
+ COLORPRINT_PTR DW ? ; Pointer to COLORPRINT info ;AN000;
+ ; ;AN000;
+ NUM_PRT_BANDS DB ? ; Number of selectable print bands ;AN000;
+ COLORSELECT_PTR DW ? ; Pointer to COLORSELECT info ;AN000;
+ ; bands ;AN000;
+ DISPLAYMODE_PTR DW ? ; Pointer to start of DISPLAYMODE ;AN000;
+ ; info ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added DATA_TYPE, which can be either DATA_ROW or DATA_COL.
+; Needed so know if should send info to the printer in row
+; or column format. IBM and EPSON use column format and HP
+; PCL uses row format.
+
+ DATA_TYPE DB ?
+;/\ ~~mda(001) ----------------------------------------------------------
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added ROW_TO_EXTRACT which is set in PRINT_BW_APA and
+; used in STORE_BOX so we know what row to extract from the
+; printer box.
+ ROW_TO_EXTRACT DB ?
+;/\ ~~mda(001) ----------------------------------------------------------
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added COUNT which is used to store either the ASCII
+; or the binary representation of the count. This is used
+; instead of LOW_BYT_COUNT_PTR and HIGH_BYT_COUNT_PTR in
+; the DISPLAYMODE structure. Also added NUM_BYTES_FOR_COUNT
+; which is the length of the ascii number in COUNT.
+ DB ? ; COUNT grows up
+ DB ? ; ^
+ DB ? ; ^
+ DB ? ; ^
+ COUNT DB ? ; ^
+ NUM_BYTES_FOR_COUNT DB ? ; Number of bytes needed to store ascii #
+;/\ ~~mda(001) ----------------------------------------------------------
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the following variable (which is set in PARSE_GRAPHICS
+; and used in END_PRT_LINE) so we know if we have a printer,
+; such as an IBM printer, that needs a CR & LF to be sent after
+; each scan line is printed. Note: HP PCL printers don't
+; need a CR, LF to be sent.
+ PRINTER_NEEDS_CR_LF DB ?
+;/\ ~~mda(001) ----------------------------------------------------------
+;
+SHARED_DATA_AREA_STR ENDS ;; ;AN000;
+ ;AN000;
+ ;AN000;
+;;;;;;;;; COLORSELECT info structure ;;;; ;AN000;
+ ; ;AN000;
+COLORSELECT_STR STRUC ; ;AN000;
+ NUM_SELECT_ESC DB ? ; number of escape bytes to ;AN000;
+ ; select this band ;AN000;
+ SELECT_ESC DB ? ; Escape bytes to select band ;AN000;
+COLORSELECT_STR ENDS ;; ;AN000;
+ ;AN000;
+ ;AN000;
+ ;AN000;
+;;;;;;;;; COLORPRINT info structure ;;;;; ;AN000;
+ ; ;AN000;
+COLORPRINT_STR STRUC ; ;AN000;
+ RED DB ? ; RGB value ;AN000;
+ GREEN DB ? ; ;AN000;
+ BLUE DB ? ; ;AN000;
+ ; Bit mask indicating color ;AN000;
+ SELECT_MASK DB ? ; bands required: ;AN000;
+ ; Bit 0: first band in table ;AN000;
+COLORPRINT_STR ENDS ;; Bit 1: second band... ;AN000;
+ ;AN000;
+ ;AN000;
+;;;;;;;;; DISPLAYMODE info structure ;;;; ;AN000;
+ ; A new block is built when a ;AN000;
+DISPLAYMODE_STR STRUC ; DISPLAYMODE statement is ;AN000;
+ ; found ;AN000;
+ NEXT_DISP_MODE DW ? ; Pointer to info for next ;AN000;
+ ; display mode; -1 if last ;AN000;
+ NUM_DISP_MODE DB ? ; Number of display modes for ;AN000;
+ DISP_MODE_LIST_PTR DW ? ; this record - list of them ;AN000;
+ ; ;AN000;
+ BOX_WIDTH DB ? ; Print box size - horizontal ;AN000;
+ BOX_HEIGHT DB ? ; Print box size - vertical ;AN000;
+ ; ;AN000;
+ NUM_PATTERNS DB ? ; Number of grey patterns for ;AN000;
+ ; this box size ;AN000;
+ PATTERN_TAB_PTR DW ? ; pointer to grey pattern table ;AN000;
+ ; for this display mode ;AN000;
+ NUM_GRAPHICS_ESC DB ? ; # of escape byte for GRAPHICS ;AN000;
+ GRAPHICS_ESC_PTR DW ? ; pointer to GRAPHICS escape ;AN000;
+ LOW_BYT_COUNT_PTR DW ? ; pointers to number of bytes sent ;AN000;
+ HGH_BYT_COUNT_PTR DW ? ; to the printer (1 word holds this ;AN000;
+ ; number but, must be send 1 byte ;AN000;
+ ; at a time). ;AN000;
+ NUM_SETUP_ESC DB ? ; # of escape byte for SETUP ;AN000;
+ SETUP_ESC_PTR DW ? ; pointer to SETUP escape seq ;AN000;
+ ; for this display mode ;AN000;
+ NUM_RESTORE_ESC DB ? ; # of escape byte for RESTORE ;AN000;
+ RESTORE_ESC_PTR DW ? ; pointer to RESTORE escape ;AN000;
+ ; seq for this display mode ;AN000;
+ PRINT_OPTIONS DB ? ; ;AN000;
+ ; ;AN000;
+;\/ ~~mda(001) ----------------------------------------------------------
+; The following is the # of esc bytes after the word DATA
+; in the GRAPHICS statement.
+ NUM_GRAPHICS_ESC_AFTER_DATA DB ? ;
+;/\ ~~mda(001) ----------------------------------------------------------
+DISPLAYMODE_STR ENDS ;; ;AN000;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+;; ;AN000;
+;; SHARED DATA AREA - EQUATES ;AN000;
+;; ;AN000;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;AN000;
+ ;AN000;
+; SWITCHES DB <bit mask> ; Command line switches: ;AN000;
+ REVERSE_SW EQU 1 ; /R ;AN000;
+ BACKGROUND_SW EQU 2 ; /B ;AN000;
+ ; ;AN000;
+; HARDWARE_CONFIG DB <bit mask> ; Type of video hardware ;AN000;
+ PALACE EQU 1 ; attached ;AN000;
+ ROUNDUP EQU 2 ; PS 2 MODEL 50 60 AND 80 ;AN000;
+ EGA EQU 4 ; Enhance Graphics Adapter ;AN000;
+ PC_CONVERTIBLE EQU 8 ; PC Convertible LCD ;AN000;
+ OLD_ADAPTER EQU 16 ; Color Graph. Adater or MONO ;AN000;
+ ; ;AN000;
+; PRINTER_TYPE DB <bit mask> ; Type of printer attached ;AN000;
+ COLOR EQU 1 ; ;AN000;
+ BLACK_WHITE EQU 2 ; ;AN000;
+ ; ;AN000;
+; PRINT_OPTIONS DB <bit mask> ; ;AN000;
+ ROTATE EQU 1 ; ;AN000;
+
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the following equates, which are used for the
+; DATA_TYPE.
+;
+ DATA_COL EQU 0
+ DATA_ROW EQU 1
+;
+;/\ ~~mda(001) ----------------------------------------------------------
+
+;\/ ~~mda(001) ----------------------------------------------------------
+; Added the following equates, which are used during parsing
+; and printing, to distinguish between esc seq., types of
+; counts, and data.
+ ESC_NUM_CODE EQU 0E0H
+ COUNT_CODE EQU 0C0H
+ LOWCOUNT_CODE EQU 0C1H
+ HIGHCOUNT_CODE EQU 0C2H
+ DATA_CODE EQU 0DDH
+;
+;/\ ~~mda(001) ----------------------------------------------------------
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/graphics/makefile b/private/mvdm/dos/v86/cmd/graphics/makefile
new file mode 100644
index 000000000..e3d94990a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/graphics/makefile
@@ -0,0 +1,78 @@
+# Makefile for debug.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest1 =graphics.com
+dest2 =graphics.pro
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest1)
+ binplace $(dest1)
+ binplace $(dest2)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+ if exist *.com del *.com
+
+graphics.ctl: graphics.skl $(msg)\$(COUNTRY).msg
+
+graphics.obj: graphics.asm grinst.ext makefile
+
+grinst.obj: grinst.asm grload.ext grload2.ext grctrl.ext grprint.ext \
+ grcpsd.ext grparms.ext grparse.ext grbwprt.ext grcolprt.ext \
+ grint2fh.ext grmsg.equ graphics.ctl \
+ $(inc)\sysmsg.inc $(inc)\struc.inc grshar.str makefile
+
+grcpsd.obj: grparse.asm makefile $(inc)\parse.asm
+
+grparse.obj: grcpsd.asm makefile
+
+grpattrn.obj: grpattrn.asm grpattrn.str makefile
+
+grbwprt.obj: grbwprt.asm grcommon.ext grctrl.str grshar.str makefile \
+ grpattrn.str $(inc)\struc.inc makefile
+
+grint2fh.obj: grint2fh.asm grload.ext grctrl.ext grprint.ext \
+ grcpsd.ext makefile
+
+grctrl.obj: grctrl.asm grint2fh.ext grbwprt.ext grcolprt.ext grshar.str \
+ grpattrn.str grpattrn.ext grctrl.str $(inc)\struc.inc \
+ makefile
+
+grcolprt.obj: grctrl.str grshar.str grpattrn.str grctrl.ext \
+ $(inc)\struc.inc grcommon.asm makefile
+
+grload.obj: grload.asm $(inc)\struc.inc grinst.ext grshar.str grparse.ext \
+ grload2.ext grload3.ext grmsg.equ makefile
+
+grload2.obj: grload2.asm $(inc)\struc.inc grinst.ext grshar.str grmsg.equ \
+ grinst.ext grload.ext grparse.ext grpattrn.str grpattrn.ext \
+ makefile
+
+grload3.obj: grload3.asm $(inc)\struc.inc grinst.ext grshar.str grmsg.equ \
+ grinst.ext grload.ext grload2.ext grparse.ext grpattrn.str \
+ grpattrn.ext makefile
+
+grparms.obj: grparms.asm grmsg.equ grshar.str grinst.ext grparse.ext \
+ $(inc)\struc.inc makefile
+
+graphics.exc: graphics.obj grint2fh.obj grpattrn.obj grctrl.obj grcpsd.obj \
+ grcolprt.obj grbwprt.obj grinst.obj grparse.obj grparms.obj \
+ grload.obj grload2.obj grload3.obj graphics.lnk
+ link16 @graphics.lnk
+
+$(dest1): graphics.exc
diff --git a/private/mvdm/dos/v86/cmd/keyb/commsubs.asm b/private/mvdm/dos/v86/cmd/keyb/commsubs.asm
new file mode 100644
index 000000000..d72dd75de
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/commsubs.asm
@@ -0,0 +1,648 @@
+ PAGE ,132
+ TITLE MS DOS 5.0 - NLS Support - KEYB Command
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; MS DOS 5.0 - NLS Support - KEYB Command
+; (C) Copyright Microsoft Corp 1987-1991
+;
+; File Name: COMMSUBS.ASM
+; ----------
+;
+; Description:
+; ------------
+; Common subroutines used by NLS support
+;
+; Documentation Reference:
+; ------------------------
+; None
+;
+; Procedures Contained in This File:
+; ----------------------------------
+;
+; FIND_HW_TYPE - Determine the keyboard and system unit types and
+; set the corresponding flags.
+;
+; Include Files Required:
+; -----------------------
+; None
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE ????????.ASM:
+; ????????? - ???????
+;
+; Change History:
+; ---------------
+; Sept 1989 For 4.02.
+; Add required JMP $+2 between OUT/IN in KEYB_SECURE,
+; remove unnecessary code and re-document routine.
+; Remove unnecessary PUSH/POP's around call to KEYB_SECURE.
+; Fix bug in FIND_KEYB_TYPE of READ ID flags not being
+; cleared on PS/2's when keyboard is security locked.
+; Clean up BIOS DATA & Extended DATA area access, use ES:.
+; Arrange KB type checks into special case group and 8042.
+; Fix delay loop timeout bug at WT_ID with REFRESH BIT type
+; fixed timeout delay of 15ms. When the KBX flag is set
+; by BIOS, the READ_ID is done and PORT 60h is ID_2 byte.
+; AT (FCh) type machines all have the Refresh Bit at 61h.
+; Change SND_DATA_AT proc to a general send command routine
+; with REFRESH BIT timout logic and move the P-Layout test
+; into FIND_KEYB_TYPE. Allows P-kb on all 8042 systems.
+; Add untranslated ID_2 byte to P-layout support for newer
+; PS/2's with hardware logic instead of 8042 if AT type.
+;
+; Feb 1990 For 4.03.
+; PTM 6660 Add default to PC_386 type for new/unsupported system.
+; Move determination code from KEYBI9C.ASM for original PC.
+; Add Patriot/Sebring determination code for HOT Replug
+; so that INT 9 handler can alter keyboard Scan Code set.
+; Unknown system default= PC_386 with Patriot/Sebring test.
+; Add EXT_122 check for 122 key keyboard to SYSTEM_FLAG.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ PUBLIC FIND_SYS_TYPE
+ PUBLIC FIND_KEYB_TYPE
+ PUBLIC HW_TYPE
+ PUBLIC SECURE_FL
+
+ INCLUDE KEYBEQU.INC
+ INCLUDE KEYBCPSD.INC
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBI9C.INC
+ INCLUDE KEYBCMD.INC
+ INCLUDE DSEG.INC
+ INCLUDE POSTEQU.INC
+
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ ASSUME CS:CODE,DS:CODE
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: FIND_SYS_TYPE
+;
+; Description:
+; Determine the type of system we are running on.
+; SYSTEM_FLAG (in active SHARED_DATA) are set to
+; indicate the system type.
+; This routine is only called the first time KEYB is being installed.
+;
+;
+; Input Registers:
+; DS - points to our data segment
+;
+; Output Registers:
+; NONE
+;
+; Logic:
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ROM SEGMENT AT 0F000H
+ ORG 0FFFBH
+SYSROM_DATE DW ? ; OFFSET OF ROM YEAR DIGIT
+
+PC1DATE_ID EQU 03138H ; YEAR ROM WAS RELEASED IN ASCII
+
+ ORG 0FFFEH
+ROMID DB ?
+ ; SEGMENT F000. (F000:FFFE)
+
+ROMPC1 EQU 0FFH ; ID OF PC1 hardware
+ROMXT EQU 0FEH ; ID OF PC-XT/PORTABLE hardware
+ROMAT EQU 0FCH ; ID OF PCAT
+ROMXT_ENHAN EQU 0FBH ; ID OF ENHANCED PCXT
+ROMPAL EQU 0FAH ; ID FOR PALACE
+ROMLAP EQU 0F9H ; ID FOR PC LAP (P-14)
+ROM_RU_386 EQU 0F8H ; ID FOR ROUNDUP-386
+
+ROM ENDS
+
+ROMEXT SEGMENT AT 00000H ; ADDRESS SHOULD NOT BE FIXED AT 09FC0H
+ ; This just a dummy segment value, as
+ ORG 0003BH ; INT 15h - function C1 call will load
+KEYBID1 DB ? ; ES: dynamically depending on where
+ ; the ROMEXT segment is located.
+ ; (9FC0 was only for old 640K systems)
+ROMEXT ENDS ; ( ES:003B )
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FIND_SYS_TYPE PROC NEAR
+
+ MOV AX,ROM ; Set segmant to look at ROM
+ MOV DS,AX ; using the data segment
+ ASSUME DS:ROM
+
+ MOV AX,SYSROM_DATE ; Get BIOS year date
+ PUSH AX ; save it on stack
+ MOV AL,ROMID ; Get hardware ID
+ PUSH AX ; save it
+
+ PUSH CS ; Set data seg back to code
+ POP DS
+ ASSUME DS:CODE
+
+ MOV AH,092H ; SET INVALID CALL FOR INT16 83 KEYS
+ INT 16H ; CALL BIOS
+ CMP AH,80H ; IS EXTENDED INTERFACE THERE? 101/102
+ JA CHECK_PC_NET ; NO, SKIP FLAG
+
+ OR SD.SYSTEM_FLAG,EXT_16 ; Default is extended INT 16 support
+
+ MOV AH,0A2H ; SET INVALID CALL FOR INT16 101 KEYS
+ INT 16H ; CALL BIOS
+ CMP AH,80H ; IS EXTENDED INTERFACE THERE? 122/
+ JA CHECK_PC_NET ; NO, SKIP FLAG
+
+ OR SD.SYSTEM_FLAG,EXT_122 ; Also extended 122 keyboard support
+
+CHECK_PC_NET:
+ MOV AH,30H ; GET DOS VERSION NUMBER
+ INT 21H ; MAJOR # IN AL, MINOR # IN AH
+ CMP AX,0A03H ; SENSITIVE TO 3.10 OR >
+ JB CHECK_SYSTEM ; EARLIER VERSION OF DOS NOTHING
+ ; WAS ESTABLISHED FOR THIS SITUATION
+ PUSH ES ; Save ES just in case
+ MOV AX,3509H ; GET INT VECTOR 9 CONTENTS
+ INT 21H ; ES:BX WILL = CURRENT INT9 VECTOR
+ ; SEE IF WE ARE THE 1ST ONES LOADED
+ MOV CX,ES ; INTO THE INT 9. WITH DOS 3.1 WE CAN
+ POP ES ; HANDSHAKE WITH THE PC NETWORK BUT
+ CMP CX,0F000H ; BUT NO ONE ELSE CAN BE HOOK IN FIRST
+ JE CHECK_SYSTEM ; INT VECTOR 9 POINTS TO ROM, OK
+
+ MOV AX,0B800H ; ASK IF PC NETWORK IS INSTALLED
+ INT 2FH
+ or al,al ; not installed if al=0
+ JE CHECK_SYSTEM ; SOMEBODY HAS LINKED THE INT VECTOR 9
+ ; & I'M GOING TO DROP RIGHT IN AS USUAL
+ OR SD.SYSTEM_FLAG,PC_NET ; INDICATE PC NET IS RUNNING
+
+CHECK_SYSTEM:
+ POP AX ; get code back
+ POP BX ; get date back off of stack
+ ; Is the hardware a PCjr
+ ; Is the hardware a PC1 or XT ?
+ CMP AL,ROMXT
+ JAE ITS_AN_XT ; IF (FE) OR (FF) THEN ITS AN XT
+ CMP AL,ROMXT_ENHAN ; IF (FB) IT IS ALSO AN XT
+ JNE TEST_PC_AT ; IF not then check for next type
+
+ITS_AN_XT:
+ OR SD.SYSTEM_FLAG,PC_XT ; system type
+ ; Check the ROM level in the system
+ CMP BX,PC1DATE_ID ; Is it the ORIGINAL PC1 version?
+ JNE SHORT FIND_SYS_END ; Done if not
+
+ OR SD.SYSTEM_FLAG,PC_81 ; Else set the Original PC1 flag
+ JMP SHORT FIND_SYS_END
+
+TEST_PC_AT:
+ ; Is the hardware an AT ?
+ CMP AL,ROMAT ; (FC)
+ JNE TEST_P12 ; IF not then check for next type
+
+ OR SD.SYSTEM_FLAG,PC_AT ; system type with 8042 V2 interface
+
+ JMP SHORT FIND_SYS_END
+
+TEST_P12:
+ CMP AL,ROMLAP ; IS this a Convertible (F9) (P12)?
+ JNE TEST_PAL ; IF not then check for next type
+ OR SD.SYSTEM_FLAG,PC_LAP ; system type
+ JMP SHORT FIND_SYS_END
+
+TEST_PAL:
+ CMP AL,ROMPAL ; IS this a Model 30 (FA) (PALACE)?
+ JNE TEST_RU_386 ; IF not then check for next type
+ OR SD.SYSTEM_FLAG,PC_PAL ; system type
+ JMP SHORT FIND_SYS_END
+
+TEST_RU_386:
+ CMP AL,ROM_RU_386 ; IS this a PS/2 with a 386 (F8)?
+ JNE TEST_SYS_NEW ; IF not then check for next type
+ OR SD.SYSTEM_FLAG,PC_386 ; System type with 8042 V3
+ CALL SP_8042 ; Determine if 8042 is Patriot/Sebring
+ JMP SHORT FIND_SYS_END
+
+TEST_SYS_NEW:
+ ; ASSUME 8042 TYPE IF UNKNOWN
+ OR SD.SYSTEM_FLAG,PC_386 ; Default system type with 8042 V3
+ CALL SP_8042 ; Determine if 8042 is Patriot/Sebring
+
+
+FIND_SYS_END:
+
+ RET
+
+FIND_SYS_TYPE ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: FIND_KEYB_TYPE
+;
+; Description:
+; Determine the type of keyboard we are running on.
+; KEYB_TYPE (in SHARED_DATA) is set to indicate the keyboard type.
+; This routine is only called the first time KEYB is being installed.
+; It is called after the new Interrupt 9 handler is installed.
+;
+; Input Registers:
+; DS - points to our data segment
+;
+; Output Registers:
+; NONE
+;
+; Logic:
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+HW_TYPE DW 0
+SECURE_FL DB 0
+
+;RESERVED ADDRESS 013h BITS 1 & 2
+
+PASS_MODE equ 00000001B
+SERVER_MODE equ 00000010B
+SECRET_ADD equ 13h
+PORT_70 equ 70h ; CMOS ADDRESS PORT
+PORT_71 equ 71h ; CMOS DATA PORT
+
+ID_1 EQU 0ABh ; Keyboard ID_1 for FERRARI
+TID_2 EQU 041h ;;AB41 ; Keyboard ID_2 for FERRARI_G
+ID_2U EQU 083h ;;AB83 ; Keyboard ID_2 for FERRARI_G
+TID_2A EQU 054h ;;AB54 ; Keyboard ID_2 for FERRARI_P
+ID_2AU EQU 084h ;;AB84 ; Keyboard ID_2 for FERRARI_P
+ID_2JG EQU 090h ;;AB90 ; Keyboard ID_2 for JPN G
+ID_2JP EQU 091h ;;AB91 ; Keyboard ID_2 for JPN P
+ID_2JA EQU 092h ;;AB92 ; Keyboard ID_2 for JPN A
+
+P_KB_ID DB 08
+
+ extrn pswitches:byte
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FIND_KEYB_TYPE PROC NEAR
+
+ifdef NOT_NTVDM
+
+ PUSH ES
+ PUSH DS
+
+ MOV AX,DATA
+ MOV ES,AX ; ES points to BIOS data
+ ASSUME ES:DATA
+
+ MOV AX,ROM ; Set segmant to look at ROM
+ MOV DS,AX ; using the data segment
+ ASSUME DS:ROM
+
+ MOV AL,ROMID ; Get hardware ID
+
+ PUSH CS ; Set data segment to CODE
+ POP DS
+ ASSUME DS:CODE
+
+ test pswitches,2 ; /e switch true?
+ jz no_force_enh
+ or es:KB_FLAG_3,KBX ; force enhanced kbd support on
+no_force_enh:
+
+ MOV HW_TYPE,G_KB ; Default keyboard is G_KB
+
+ CMP AL,ROMLAP ; IS this a P12? (CONVERTABLE)
+ JNE TEST_PC_XT_2 ; IF not then check for next type
+
+ MOV HW_TYPE,P12_KB ; IF yes then set flag
+ JMP FIND_KEYB_END ; Done
+
+TEST_PC_XT_2:
+ ; Is the hardware a PC1 or XT ?
+ CMP AL,ROMXT
+ JAE ITS_AN_XT_2 ; IF FE OR FF THEN ITS AN XT
+ CMP AL,ROMXT_ENHAN ; IF FB IT IS ALSO AN XT
+ JNE TEST_PS_30_2 ; IF not then check for next type
+
+ITS_AN_XT_2:
+ TEST ES:KB_FLAG_3,KBX ; IS THE ENHANCED KEYBOARD INSTALLED?
+ JZ ITS_AN_XT_3
+ JMP SHORT FIND_KEYB_END ; Yes, exit
+
+ITS_AN_XT_3:
+ MOV HW_TYPE,XT_KB ; NO, normal XT keyboard
+ JMP SHORT FIND_KEYB_END
+
+TEST_PS_30_2:
+ CMP AL,ROMPAL ; IS this a PS/2 MODEL 30 or 25
+ JNE TEST_PC_AT_2 ; IF not then check for next type
+
+ MOV AH,0C1H ; Make extended bios data area call to
+ INT 15H ; get the segment address for accessing
+ JNC ITS_AN_PS2_30 ; the PALACE (only) keyboard byte area.
+ JMP SHORT FIND_KEYB_END ; JC Assume Keyboard type G if error,
+ ; Otherwise EXTENDED BIOS DATA RETURNED
+ ; in the ES: and ES:003Bh is keyboard
+
+ITS_AN_PS2_30: ; ID byte reserved for PALACE.
+ ; Set segment to look at extended ROM
+ ASSUME ES:ROMEXT ; using the ES: segment
+ ; SEG ES: value returned by INT15h - C1
+ MOV AL,KEYBID1 ; Get keyboard ID
+
+ ASSUME ES:NOTHING ; Don't use ES: for anything else
+
+ AND AL,0FH ; Remove high nibble
+ CMP AL,P_KB_ID ; IF keyboard is a FERRARI P THEN
+ JNE ITS_AN_PS2_30G
+ OR HW_TYPE,P_KB ; Set the HW_TYPE flag to P keyboard
+
+ITS_AN_PS2_30G:
+ JMP SHORT FIND_KEYB_END ; Done
+
+ ; (Insert any more special cases here.)
+
+; At this point, all special case or older keyboard/system
+; types have been determined and HW_TYPE correctly set.
+; (PC, XT, XT Enhansed, CONVERTABLE, Model 30/25)
+;
+; Assume now that the system has an 8042 type keyboard
+; interface and can be sent a READ ID command to determine
+; the type of keyboard installed. The old AT keyboard is
+; handled as a special case of no security bits set and no
+; response to a READ ID command. If security bits are set
+; and no KBX flag is set as a result of the READ ID, then
+; the interface is assumed to be locked and the default of
+; G-keyboard is taken as the keyboard ID can not be read.
+
+TEST_PC_AT_2:
+
+ ASSUME ES:DATA ; READ ID COMMAND TO TEST FOR A KBX
+
+ MOV ES:KB_FLAG_3,RD_ID ; INDICATE THAT A READ ID IS BEING DONE
+ ; and clear KBX flag if set
+ MOV AL,0F2H ; SEND THE READ ID COMMAND
+ CALL SND_DATA_AT
+ ; Wait 40ms for READ ID to complete
+ MOV CX,DLY_15ms ; Load count for 15ms (15,000/15.086)
+
+WT_ID: ; Fixed time wait loop on AT's
+ TEST ES:KB_FLAG_3,KBX ; TEST FOR KBX SET by BIOS interrupt 9h
+ JNZ DONE_AT_2 ; Exit wait loop if/when flag gets set
+
+ IN AL,PORT_B ; Read current system status port
+ AND AL,REFRESH_BIT ; Mask all but refresh bit
+ CMP AL,AH ; Did it change? (or first pass thru)
+ JZ WT_ID ; No, wait for change, else continue
+
+ MOV AH,AL ; Save new refresh bit state
+ LOOP WT_ID ; WAIT OTHERWISE
+
+ ; BE SURE READ ID FLAGS GOT RESET
+ AND ES:KB_FLAG_3,NOT RD_ID+LC_AB ; Clear READ ID state flags
+ ; As no KBX flag set
+ CALL KEYB_SECURE ; SEE IF THE KEYBOARD SECURITY IS
+ ; ACTIVATED AT THIS POINT
+ JNC ASSUME_AT ; SECURITY UNAVAILABLE OR AN AT KB
+
+ MOV SECURE_FL,1 ; SECURITY IS ACTIVE
+ JMP SHORT FIND_KEYB_END ; ASSUME IT IS A G_KB WITH
+ ; NUM LOCK OFF
+ASSUME_AT:
+ MOV HW_TYPE,AT_KB ; NO, AT KBD if no KBX and no security
+ JMP SHORT FIND_KEYB_END ; EXIT
+
+DONE_AT_2: ; LAST PORT 60h VALUE IS ID_2 BYTE
+ IN AL,PORT_A ; Re-read last byte from keyboard input
+ CMP AL,TID_2A ; Was it the P-layout keyboard
+ JE DONE_AT_3 ; Go set P type keyboard
+
+ CMP AL,ID_2AU ; Was it the P-layout untranslated
+ JNE DONE_AT_4 ; Continue if not
+
+DONE_AT_3:
+ OR HW_TYPE,P_KB ; Set HW_TYPE for P-layout keyboard
+DONE_AT_4:
+ ; EXIT
+
+
+FIND_KEYB_END: ; EXIT POINT
+ MOV AX,HW_TYPE ; Get default or determined type
+ MOV SD.KEYB_TYPE,AX ; Place into shared data area
+
+ POP DS
+ POP ES
+else
+;; BUGBUG
+;; don't do the read id under nt because the keyboard h/w interrupt is
+;; disabled at this moment. We should be able to get the keyboard type
+;; from GetKeyboardType API after beta.
+;; We simply pretend the keyboard is a 101/102 keyboard whithout checking
+;; -- softpc only support 101/102 keys keyboard.
+
+ PUSH ES
+ push ds
+ mov ax, cs
+ mov ds, ax
+ assume ds:CODE
+
+ MOV AX,DATA
+ MOV ES,AX ; ES points to BIOS data
+ assume es:DATA
+ or es:KB_FLAG_3,KBX ; force enhanced kbd support on
+;;Set this to one will turn on the NUM lock when we are going to exit and keep
+;; resident. This is not necessary because ntvdm host code controls num lock
+;; states and the rest of system.
+;; mov SECURE_FL, 1
+;;
+ mov ax, G_KB ; enhanced keyboard
+ mov HW_TYPE, ax
+ mov SD.KEYB_TYPE, ax
+ pop ds
+ POP ES
+ assume ES:nothing
+endif
+
+ RET
+
+FIND_KEYB_TYPE ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: SND_DATA_AT
+;
+; Description:
+; THIS ROUTINE HANDLES TRANSMISSION OF PC/AT COMMAND AND DATA BYTES
+; TO THE KEYBOARD AND RECEIPT OF ACKNOWLEDGEMENTS. IT ALSO
+; HANDLES ANY RETRIES IF REQUIRED
+;
+;
+; Input Registers:
+; DS - points to our data segment
+; ES - points to the BIOS data segment
+;
+; Output Registers:
+;
+; Logic:
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SND_DATA_AT PROC NEAR
+ PUSH AX ; SAVE REGISTERS
+ PUSH BX ; *
+ PUSH CX
+ MOV BH,AL ; SAVE TRANSMITTED BYTE FOR RETRIES
+ MOV BL,3 ; LOAD RETRY COUNT
+
+;---- WAIT FOR 8042 INTERFACE NOT BUSY
+
+SD0: ; RETRY entry
+ CALL CHK_IBF ; Wait for command to be accepted
+
+ CLI ; DISABLE INTERRUPTS
+ AND ES:KB_FLAG_2,NOT (KB_FE+KB_FA+KB_ERR) ; CLEAR ACK, RESEND AND
+ ; ERROR FLAGS
+ MOV AL,BH ; REESTABLISH BYTE TO TRANSMIT
+ OUT PORT_A,AL ; SEND BYTE
+
+ JMP $+2 ; Delay for 8042 to accept command
+ STI ; ENABLE INTERRUPTS
+
+;----- WAIT FOR COMMAND TO BE ACCEPTED BY KEYBOARD
+
+ MOV CX,DLY_15ms ; Timout for 15 ms (15,000/15.086)
+
+SD1: ; Fixed timout wait loop on AT's
+ TEST ES:KB_FLAG_2,KB_FE+KB_FA; SEE IF EITHER BIT SET
+ JNZ SD3 ; IF SET, SOMETHING RECEIVED GO PROCESS
+
+ IN AL,PORT_B ; Read current system status port
+ AND AL,REFRESH_BIT ; Mask all but refresh bit
+ CMP AL,AH ; Did it change? (or first pass thru)
+ JE SD1 ; No, wait for change, else continue
+
+ MOV AH,AL ; Save new refresh bit state
+ LOOP SD1 ; OTHERWISE WAIT
+
+SD2:
+ DEC BL ; DECREMENT RETRY COUNT
+ JNZ SD0 ; RETRY TRANSMISSION
+
+ OR ES:KB_FLAG_2,KB_ERR ; TURN ON TRANSMIT ERROR FLAG
+ JMP SHORT SD4 ; RETRIES EXHAUSTED FORGET TRANSMISSION
+
+SD3:
+ TEST ES:KB_FLAG_2,KB_FA ; SEE IF THIS IS AN ACKNOWLEDGE
+ JZ SD2 ; IF NOT, GO RESEND
+
+SD4:
+ POP CX ; RESTORE REGISTERS
+ POP BX
+ POP AX ; *
+ RET ; RETURN, GOOD TRANSMISSION
+
+SND_DATA_AT ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; KEYBOARD SECURITY LOGIC
+;
+; CHECK THE CMOS RAM BYTE AT CMOS LOCATION HEX 013H
+; CHECK TO SEE IF EITHER BITS 1 (PASSWORD) OR 2 (SERVER MODE) ARE SET ON
+; IF EITHER BIT IS SET ON THE SYSTEM IS A MOD 50 on up
+; RETurn CARRY FLAG ON indicating keyboard interface may be disabled.
+; OTHERWISE NO SECURITY ENABLED OR THE SYSTEM IS AN OLD AT.
+; RETurn CARRY FLAG OFF indicating keyboard interface not disabled.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+KEYB_SECURE PROC NEAR
+
+ CLI ; DISABLE INTERRUPTS WHILE DOING
+ ; ADDRESS WRITE AND CMOS READ
+ MOV AL,SECRET_ADD ; WRITE ADDRESS OF CMOS BYTE WITH
+ OUT PORT_70,AL ; BITS FOR THE PASSWORD AND SERVER
+ ; MODE STATE TO PORT 70H
+ JMP $+2 ; I/O Delay required
+ IN AL,PORT_71 ; READ CMOS DATA BYTE WITH THE
+ ; PASSWORD AND SERVER SECURITY
+ STI ; ENABLE THE INTERRUPTS
+ TEST AL,PASS_MODE+SERVER_MODE; CHECK & SEE IF THE BITS ARE ON
+ ; TEST clears CARRY flag
+ JZ SECURE_RET ; EXIT NO CARRY if neither set
+
+ STC ; SET THE SECURITY FLAG ON
+ ; System is NOT an AT but the
+SECURE_RET: ; keyboard interface maybe locked
+
+ RET
+
+KEYB_SECURE ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; 8042 TYPE DETERMINATION
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SP_8042 PROC NEAR ; Determine if 8042 is Patriot/Sebring
+ PUSH AX ; Save work register
+ PUSH CX ; Save count register
+ MOV CX,24 ; Limit AUX inputs if they are playing
+ ; with the mouse while loading KEYB
+
+SP__2:
+ MOV AL,DIS_KBD ; Disable command to clear 8042 output
+ OUT STATUS_PORT,AL ; Sending allows receive to complete
+ STI ; Allow any pending AUX interrupt
+ CALL CHK_IBF ; Wait for command to be accepted
+
+ CLI ; Block interrupts until password set
+ IN AL,STATUS_PORT ; Read 8042 status byte
+ TEST AL,MOUSE_OBF ; Check for AUX data pending at output
+ LOOPNZ SP__2 ; Loop till AUX inputs are cleared
+
+ IN AL,PORT_A ; Read to clear int's on SX ;PTR660243
+ MOV AL,20h ; Read 8042 controller's command byte
+ OUT STATUS_PORT,AL ; Send command to 8042 interface
+ CALL CHK_IBF ; Wait for command to be accepted
+ MOV CX,DLY_15ms ; Timeout 15 milliseconds (15000/15.086
+
+SP__5:
+ IN AL,PORT_B ; Read current refresh output bit
+ AND AL,REFRESH_BIT ; Mask all but refresh bit
+ CMP AL,AH ; Did it change? (or first pass thru)
+ JZ SHORT SP__5 ; No?, wait for change, else continue
+
+ MOV AH,AL ; Save new refresh bit state
+ IN AL,STATUS_PORT ; Read status (command) port
+ TEST AL,OUT_BUF_FULL ; Check for output buffer empty
+ LOOPZ SP__5 ; Loop until OBF is on or timeout
+
+ IN AL,PORT_A ; Get the command byte
+ TEST AL,01000000b ; Check for translate bit on
+ JNZ SP_EXIT ; Done if it is on to begin with
+
+ OR SD.SYSTEM_FLAG,PS_8042 ; Set PATRIOT/SEBRING type 8042
+ ; with Translate scan codes set OFF
+SP_EXIT:
+ MOV AL,ENA_KBD ; Enable command for keyboard
+ OUT STATUS_PORT,AL ; Send to 8042
+ CALL CHK_IBF ; Wait for command to be accepted
+ IN AL,PORT_A ; Read to clear int's on SX ;PTR660243
+ POP CX ; Recover user register
+ POP AX ; Recover user register
+ STI ; Enable inteerutps again
+ RET ; Return to caller
+
+SP_8042 ENDP
+
+CODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/keyb/commsubs.inc b/private/mvdm/dos/v86/cmd/keyb/commsubs.inc
new file mode 100644
index 000000000..58c5e39d4
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/commsubs.inc
@@ -0,0 +1,35 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;;
+;; File Name: CONVERT.INC
+;; ----------
+;;
+;; Root File Name: KEYBCMD.ASM
+;; ---------------
+;;
+;;
+;; Description:
+;; ------------
+;; External declarations for procedures in file KEYBCMD.ASM.
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN FIND_SYS_TYPE :NEAR ;;
+ EXTRN FIND_KEYB_TYPE :NEAR ;;
+ ;;
+ EXTRN HW_TYPE :WORD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/kbmsg.inc b/private/mvdm/dos/v86/cmd/keyb/kbmsg.inc
new file mode 100644
index 000000000..fd67e9e99
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/kbmsg.inc
@@ -0,0 +1,26 @@
+ ;;
+
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+
+ACT_KEYB DB 'Current keyboard code: ','$' ;;
+ACT_KEYB_CP DB ' code page: ','$' ;;
+ACT_CON_CP DB 'Current CON code page: ','$' ;;
+INV_L DB 'Invalid keyboard code specified',10,13,'$' ;;
+INV_I DB 'Invalid keyboard ID specified',10,13,'$' ;;
+INV_CP DB 'Invalid code page specified',10,13,'$' ;;
+INV_S DB 'Invalid syntax',10,13,'$' ;;
+INV_FN DB 'Bad or missing Keyboard Definition File',10,13,'$' ;;
+INV_KEYB_Q DB 'KEYB has not been installed',10,13,'$' ;;
+INV_CON_Q DB 'Active code page not available from CON device',10,13,'$' ;;
+NOT_DESIG DB 'Code page specified has not been prepared',10,13,'$' ;;
+NOT_SUPP DB 'One or more CON code pages invalid for given keyboard code',10,13,'$' ;;
+NOT_VALID1 DB 'Code page requested (','$' ;;
+NOT_VALID2 DB ') is not valid for given keyboard code',10,13,'$' ;;
+WARNING_1 DB 'Code page specified is inconsistent with the selected code page',10,13,'$' ;;
+INV_COMBO DB 'ID code specified is inconsistent with the selected keyboard code',13,'$' ;;
+MEMORY_OVERF DB 'Unable to create KEYB table in resident memory',10,13,'$' ;;
+CR_LF DB 10,13,'$' ;;
+ ;;
diff --git a/private/mvdm/dos/v86/cmd/keyb/keyb.asm b/private/mvdm/dos/v86/cmd/keyb/keyb.asm
new file mode 100644
index 000000000..e271c9532
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keyb.asm
@@ -0,0 +1,68 @@
+ PAGE ,132
+ TITLE MS-DOS 5.0 KEYB Command - Root Module
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; MS-DOS 5.0 - NLS Support - KEYB Command
+; (c) Copyright Microsoft Corp 1987-1991
+;
+; File Name: KEYB.ASM
+; ----------
+;
+;
+; Description:
+; ------------
+; Contains root module for KEYB command. This module is the
+; KEYB command entry point. KEYB is an external command included
+; with MS DOS 5.0 to provide keyboard support for 14 languages.
+; KEYB will jump immediately into the command processing in
+; file KEYBCMD. All resident code is included before KEYBCMD
+; in the linkage list.
+;
+;
+; Procedures Contained in This File:
+; ----------------------------------
+;
+;
+; Include Files Required:
+; -----------------------
+; KEYBCMD.INC - External declarations for transient command
+; processing routines
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE KEYCMD.ASM:
+; KEYB_COMMAND - Main routine for transient command processing.
+;
+; Linkage Instructions:
+; --------------------
+; Link in .COM format. Resident code/data is in files KEYB thru
+; KEYBCPSD.
+;
+; LINK KEYB+KEYBI9+KEYBI9C+KEYBI2F+KEYBCPSD+KEYBMSG+
+; COMMSUBS+KEYBTBBL+KEYBCMD;
+; EXE2BIN KEYB.EXE KEYB.COM
+;
+; Change History:
+; ---------------
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+CODE SEGMENT PUBLIC 'CODE' BYTE
+
+ INCLUDE KEYBCMD.INC ; Bring in external declarations
+ ; for transient command processing
+ ASSUME CS:CODE,DS:CODE
+ ORG 100H ; required for .COM
+
+
+START:
+
+ JMP KEYB_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+CODE ENDS
+ END START
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keyb.lnk b/private/mvdm/dos/v86/cmd/keyb/keyb.lnk
new file mode 100644
index 000000000..7da3c17a2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keyb.lnk
@@ -0,0 +1,3 @@
+/map /li Keyb+keybi9+KEYBI9C+keybi2f+
+keybcpsd+commsubs+keybtbbl+parser+KEYBCMD,kb16.exc;
+
diff --git a/private/mvdm/dos/v86/cmd/keyb/keyb.skl b/private/mvdm/dos/v86/cmd/keyb/keyb.skl
new file mode 100644
index 000000000..d8f026af2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keyb.skl
@@ -0,0 +1,47 @@
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Message Skeleton file for KEYB.COM
+;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+:util KEYB ;AN000;ty name
+:class 2
+:use PARSE1 ;AN000;
+:use PARSE2 ;AN000;
+:use PARSE3 ;AN000;
+:use PARSE4 ;AN000;
+:use PARSE6 ;AN000;
+:use PARSE7 ;AN000;
+:use PARSE10 ;AN003;
+:class A
+:use 1 COMMON1 ;AN000;rrect DOS version'
+:def 2 "Current keyboard code: %1" ;AN000;
+:def 3 "Current keyboard ID: %1" ;AN000;
+:def 4 " code page: %1",CR,LF ;AN000;
+:def 5 "Current CON code page: %1",CR,LF ;AN000;
+:def 6 "Invalid keyboard code specified",CR,LF ;AN000;
+:def 7 "Invalid keyboard ID specified",CR,LF ;AN000;
+:def 8 "Invalid code page specified",CR,LF ;AN000;
+:def 9 "Bad or missing Keyboard Definition File",CR,LF ;AN000;
+:def 10 "KEYB has not been installed",CR,LF ;AN000;
+:def 11 "Active code page not available from CON device",CR,LF ;AN000;
+:def 12 "Code page specified has not been prepared",CR,LF ;AN000;
+:def 13 "One or more CON code pages invalid for given keyboard code",CR,LF ;AN000;
+:def 14 "Code page requested (%1) is not valid for given keyboard code",CR,LF ;AN000;
+:def 15 "Code page specified is inconsistent with the selected code page",CR,LF ;AN000;
+:def 16 "ID code specified is inconsistent with the selected keyboard code",CR,LF ;AN000;
+:def 17 "Unable to create KEYB table in resident memory",CR,LF ;AN000;
+:use 18 PARSE8 ; 'Parameter format not correct' ;AN000;
+:def 300 "Loads a keyboard program.",CR,LF,CR,LF
+:def 301 "KEYB [xx[,[yyy],[pathname]]] [/ID:nnn] [/E]",CR,LF,CR,LF
+:def 302 " xx A two-letter country code.",CR,LF
+:def 303 " yyy The code page for the desired character set.",CR,LF
+:def 304 " pathname The keyboard definition file.",CR,LF
+:def 305 " /ID:nnn Specifies the keyboard in use.",CR,LF
+:def 306 " /E Assumes an enhanced keyboard is installed.",CR,LF
+:end ;AN000;
diff --git a/private/mvdm/dos/v86/cmd/keyb/keyb.tag b/private/mvdm/dos/v86/cmd/keyb/keyb.tag
new file mode 100644
index 000000000..853ac7cfd
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keyb.tag
@@ -0,0 +1,23 @@
+M000 1/15/91 CAS B#4856, ctrl-alt <sp, tab, keypad-, keypad+>
+
+M001 1/25/91 CAS B#5412, ctrl-alt-f1/f2 broken
+
+M002 2/11/91 CAS keybtbbl.asm B#5598, LH KEYB crash when UMB too small
+
+M003 2/14/91 CAS keybi2f.asm Added external query of COUNTRY_FLAG
+
+M004 2/20/91 CAS keybi2f.asm Removed dead reference to keybmac.inc and
+ keybmac.inc deleted keybmac.inc, changed over to
+ makefile common keybshar.inc
+
+M005 2/20/91 CAS keybi9c.asm Kermit merge (JP)
+ commsubs.asm
+
+M006 2/28/91 CAS keybtbbl.asm B#6116: rejecting KEYBOARD.SYS from DOS 3.3
+
+M007 3/10/91 MD keybi9c.asm B#6314: use ROM BIOS variables correctly
+
+M008 3/13/91 MD keybi9c.asm B#6414: require Ctrl+Alt+F1/2 to toggle
+ keyboard mapping. Corrects bug introduced
+ by changes M000 & M001
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybcmd.asm b/private/mvdm/dos/v86/cmd/keyb/keybcmd.asm
new file mode 100644
index 000000000..5deb3d2ce
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybcmd.asm
@@ -0,0 +1,2105 @@
+ PAGE ,132
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+;
+; File Name: KEYBCMD.ASM
+; ----------
+;
+;
+; Description:
+; ------------
+; Contains transient command processing modules for KEYB command.
+;
+; Procedures contained in this file:
+; ----------------------------------
+; KEYB_COMMAND: Main routine for command processing.
+; PARSE_PARAMETERS: Validate syntax of parameters included
+; on command line.
+; BUILD_PATH: Find KEYBOARD.SYS file and validate language and/or
+; code page.
+; INSTALL_INT_VECTORS: Install our INT 9, INT 2F Drivers
+; NUMLK_ON: Turn on the NUM LOCK LED
+; FIND_FIRST_CP: Determine first code page for given language in the
+; Keyboard Definition file.
+;
+; Include Files Required:
+; -----------------------
+; KEYBMSG.INC
+; KEYBEQU.INC
+; KEYBSYS.INC
+; KEYBI9C.INC
+; KEYBI9.INC
+; KEYBI2F.INC
+; KEYBSHAR.INC
+; KEYBDCL.INC
+; KEYBTBBL.INC
+; COMMSUBS.INC
+; KEYBCPSD.INC
+; POSTEQU.SRC
+; DSEG.SRC
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE KEYBTBBL.ASM:
+; TABLE_BUILD - Create the shared area containing all keyboard tables.
+; STATE_BUILD - Build all states within the table area
+; FROM FILE KEYBMSG.ASM:
+; KEYB_MESSAGES - All messages
+;
+; Change History:
+;
+; Modified for DOS 3.40 - Nick Savage , IBM Corporation
+; Wilf Russell, IBM Canada Laboratory
+; DCR ???? -KEYBAORD SECURITY LOCK - CNS
+;
+;
+; PTM 3906 - KEYB messages do not conform
+; to spec. Error message does
+; 3/24/88 not pass back the bogus command
+; line argument. - CNS
+;
+; PTMP3955 ;KEYB component to free environment and close handles 0 - 4
+;
+; 3/24/88
+;
+; 9/26/89 jwg Moved code from resident module and reduce code size.
+;
+;;;;;;;;;;;;;
+
+ PUBLIC KEYB_COMMAND
+
+;*****************CNS********************
+ PUBLIC ID_TAB_OFFSET
+;*****************CNS********************
+
+ PUBLIC CP_TAB_OFFSET
+ PUBLIC STATE_LOGIC_OFFSET
+ PUBLIC SYS_CODE_PAGE
+ PUBLIC KEYBCMD_LANG_ENTRY_PTR
+ PUBLIC DESIG_CP_BUFFER
+ PUBLIC DESIG_CP_OFFSET
+ PUBLIC KEYBSYS_FILE_HANDLE
+ PUBLIC NUM_DESIG_CP
+ PUBLIC TB_RETURN_CODE
+ PUBLIC FILE_BUFFER
+ PUBLIC FB
+
+;*****************CNS********************
+ PUBLIC ID_PTR_SIZE
+ PUBLIC LANG_PTR_SIZE
+ PUBLIC CP_PTR_SIZE
+ PUBLIC NUM_ID
+ PUBLIC NUM_LANG
+ PUBLIC NUM_CP
+ PUBLIC SHARED_AREA_PTR
+;*****************CNS********************
+
+ PUBLIC SD_SOURCE_PTR
+ PUBLIC TEMP_SHARED_DATA
+
+ PUBLIC FOURTH_PARM
+ PUBLIC ONE_PARMID
+ PUBLIC FTH_PARMID
+ PUBLIC ID_FOUND
+ PUBLIC BAD_ID
+ PUBLIC ALPHA
+ EXTRN PARSE_PARAMETERS:NEAR
+ extrn pswitches:byte
+
+;***CNS
+ EXTRN SECURE_FL:BYTE
+ EXTRN CUR_PTR:WORD
+ EXTRN OLD_PTR:WORD
+ EXTRN ERR_PART:WORD
+;***CNS
+
+ .xlist
+ INCLUDE SYSMSG.INC ; message retriever
+ .list
+
+MSG_UTILNAME <KEYB> ; identify to message retriever
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ .xlist
+ INCLUDE KEYBEQU.INC
+ INCLUDE KEYBSYS.INC
+ INCLUDE KEYBI9.INC
+ INCLUDE KEYBI9C.INC
+ INCLUDE KEYBI2F.INC
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBDCL.INC
+ INCLUDE KEYBTBBL.INC
+ INCLUDE COMMSUBS.INC
+ INCLUDE KEYBCPSD.INC
+ .xlist
+ INCLUDE POSTEQU.INC
+ INCLUDE DSEG.INC
+
+ .list
+ ASSUME CS:CODE,DS:CODE
+
+;;;;;;;;;;;;;
+;
+; Module: KEYB_COMMAND
+;
+; Description:
+; Main routine for transient command processing.
+;
+; Input Registers:
+; DS - points to our data segment
+;
+; Output Registers:
+; Upon termination, if an error has occurred in which a keyboard table
+; was not loaded, the AL register will contain the a error flag. This
+; flag is defined as follows:
+; AL:= 1 - Invalid language, code page, or syntax
+; 2 - Bad or missing Keyboard Definition File
+; 3 - KEYB could not create a table in resident memory
+; 4 - An error condition was received when communicating
+; with the CON device
+; 5 - Code page requested has not been designated
+; 6 - The keyboard table for the requested code page cannot
+; be found in resident keyboard table.
+;
+; Logic:
+; IF KEYB has NOT been previously loaded THEN
+; Set SHARED_AREA_PTR to TEMP_SHARED_AREA
+; INSTALLED_KEYB := 0
+; Get HW_TYPE (set local variable)
+; ELSE
+; Set SHARED_AREA_PTR to ES:SHARED_AREA
+; Get HW_TYPE (set local variable)
+; Set TABLE_OK := 0
+; INSTALLED_KEYB := 1
+;
+; IF CPS-CON has been loaded THEN
+; INSTALLED_CON := 1
+;
+;*********************************** CNS *************************************
+; Call PARSE_PARAMETERS := Edit ID or language, code page,
+; and path parameters,ID on command line
+;*********************************** CNS *************************************
+; Check all return codes:
+; IF any parameters are invalid THEN
+; Display ERROR message
+; ELSE
+; IF no language parm specified
+; AND code page is not invalid
+; AND syntax is valid THEN
+; Process QUERY:
+; IF KEYB is installed THEN
+; Get and display active language from SHARED_DATA_AREA
+; Get invoked code page from SHARED_DATA_AREA
+; Convert to ASCII
+; Display ASCII representation of code page, CR/LF
+;*********************************** CNS *************************************
+; IF ALTERNATE FLAG SET
+; Get and display active ID from SHARED_DATA_AREA
+; Convert to ASCII
+; Display ASCII representation of ID, CR/LF
+;*********************************** CNS *************************************
+; IF CPS-CON is installed THEN
+; Get selected code page info from CON
+; Convert to ASCII
+; Display ASCII representation of code page, CR/LF
+; EXIT without staying resident
+;
+; ELSE
+; Call BUILD_PATH := Determine location of Keyboard definition file
+; Open the file
+; IF error in opening file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Save handle
+; Set address of buffer
+; READ header of Keyboard definition file
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Check signature for correct file
+; IF file signature is correct THEN
+; READ language table
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Use table to verify language parm
+; Set pointer values
+; IF code page was specified
+; READ language entry
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; READ Code page table
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Use table to verify code page parm
+; Set pointer values
+; IF CPS-CON is not installed THEN
+; Set number of code pages = 1
+; IF CODE_PAGE_PARM was specified THEN
+; Copy CODE_PAGE_PARM into table of code pages to build
+; ELSE
+; Call FIND_FIRST_CP := Define the system code page (1st in Keyb Def file)
+; Copy SYSTEM_CP into table of code pages to build
+; ELSE
+; Issue INT 2F ; 0AD03H to get table of Designated code pages
+; Set number of designated code pages (HWCP + Desig CP)
+; Issue INT 2F ; 0AD02H to get invoked code page
+; IF CODE_PAGE_PARM was specified THEN
+; Check that CODE_PAGE_PARM is in the list of designated code pages
+; IF CODE_PAGE_PARM is in the list of designated code pages THEN
+; Copy specified CP into table of code pages to build
+; IF a CP has been selected AND is inconsistent with specified CP
+; Issue WARNING message
+; ELSE
+; Display ERROR message
+; ELSE
+; IF a code page has been invoked THEN
+; Copy invoked code page into table of code pages to build
+; ELSE
+; Call FIND_FIRST_CP := Define the system code page (1st in Keyb Def file)
+; Copy SYSTEM_CP into table of code pages to build
+;
+; IF KEYB has not been previously installed THEN
+; Call FIND_SYS_TYPE := Determine system type
+; Call INSTALL_INT_9 := Install INT 9 handler
+; Call FIND_KEYB_TYPE := Determine the keyboard type
+;
+; Call TABLE_BUILD := Build the TEMP_SHARED_DATA_AREA
+;
+; IF return codes from TABLE_BUILD are INVALID THEN
+; IF KEYB_INSTALLED := 0 THEN
+; Call REMOVE_INT_9
+; Display corresponding ERROR message
+; EXIT without staying resident
+; ELSE
+; IF any of the designated CPs were invalid in the build THEN
+; Issue WARNING message
+; Close the Keyboard definition file
+; IF KEYB had NOT already been installed THEN
+; IF keyboard is a Ferrari_G AND system is not an XT THEN
+; Call NUMLK_ON := Turn the NUM LOCK LED on
+; IF extended INT 16 support required THEN
+; Install extended INT 16 support
+; Call INSTALL_INT_9_NET := Let network know about INT 9
+; Call INSTALL_INT_2F := Install the INT 2F driver
+; Activate language
+; Get resident end and copy TEMP_SHARED_DATA_AREA into SHARED_DATA_AREA
+; EXIT but stay resident
+; ELSE
+; IF this was not a query call AND exit code was valid THEN
+; Activate language
+; Get resident end and copy TEMP_SHARED_DATA_AREA into SHARED_DATA_AREA
+; EXIT without staying resident
+; END
+;
+;;;;;;;;;;;;;
+
+INVALID_PARMS EQU 1 ; EXIT return codes
+BAD_KEYB_DEF_FILE EQU 2
+MEMORY_OVERFLOW EQU 3
+CONSOLE_ERROR EQU 4
+CP_NOT_DESIGNATED EQU 5
+KEYB_TABLE_NOT_LOAD EQU 6
+BAD_DOS_VER EQU 7
+EXIT_RET_CODE DB 0
+
+;******************** CNS ***********
+ID_VALID EQU 0
+ID_INVALID EQU 1
+NO_ID EQU 2
+LANGUAGE_VALID EQU 0
+LANGUAGE_INVALID EQU 1 ; Return Codes
+NO_LANGUAGE EQU 2 ; from
+NO_IDLANG EQU 3
+;******************** CNS ***********
+
+CODE_PAGE_VALID EQU 0 ; EDIT_LANGUAGE_CODE
+CODE_PAGE_INVALID EQU 1
+NO_CODE_PAGE EQU 2
+VALID_SYNTAX EQU 0
+INVALID_SYNTAX EQU 1
+
+ACT_KEYB EQU 2
+ACT_ID EQU 3
+ACT_KEYB_CP EQU 4
+ACT_CON_CP EQU 5
+INV_L EQU 6 ; message numbers...
+INV_I EQU 7
+INV_CP EQU 8
+INV_S EQU 18
+INV_FN EQU 9
+INV_KEYB_Q EQU 10
+INV_CON_Q EQU 11
+NOT_DESIG EQU 12
+NOT_SUPP EQU 13
+NOT_VALID EQU 14
+WARNING_1 EQU 15
+INV_COMBO EQU 16
+MEMORY_OVERF EQU 17
+help_1st equ 300
+help_last equ 306
+CR_LF DB 10,13,'$'
+
+FOURTH_PARM DB 0 ; switch was specified
+ONE_PARMID DB 0 ; id given as positional
+FTH_PARMID DB 0 ; id given as switch
+ID_FOUND DB 0 ; id was good (in k.d. file)
+BAD_ID DB 0 ; id was bad (from parse)
+ALPHA DB 0 ; first parm a language id
+
+ID_DISPLAYED DB 0 ; Indicating ID already displayed
+
+SUBLIST_NUMBER LABEL BYTE ; sublist for numbers
+ DB 11 ; size
+ DB 0
+PTR_TO_NUMBER DW ? ; offset ptr
+SEG_OF_NUMBER DW ? ; segment
+ DB 1
+ DB 10100001B ; flag
+ DB 4 ; max width (YST)
+ DB 1 ; min width
+ DB " " ; filler
+
+
+SUBLIST_ASCIIZ LABEL BYTE ; sublist for asciiz
+ DB 11 ; size
+ DB 0
+PTR_TO_ASCIIZ DW ? ; offset ptr
+SEG_OF_ASCIIZ DW ? ; segment
+ DB 1
+ DB 00010000B ; flag
+ DB 2 ; max width
+ DB 2 ; min width
+ DB " " ; filler
+
+NUMBER_HOLDER DW ? ; used for message retriever
+
+;***CNS
+SUBLIST_COMLIN LABEL BYTE ; sublist for asciiz
+ DB 11 ; size
+ DB 0
+PTR_TO_COMLIN DW ? ; offset ptr
+SEG_OF_COMLIN DW ?
+ DB 0
+ DB LEFT_ALIGN+CHAR_FIELD_ASCIIZ ; flag
+
+ DB 0 ; max width
+ DB 1 ; min width
+ DB " " ; filler
+
+
+STRING_HOLDER DB 64 DUP(0)
+;***CNS
+
+FILE_BUFFER DB FILE_BUFFER_SIZE dup (0); Buffer for Keyboard Def file
+FB EQU FILE_BUFFER ;m for 32 language entries)
+DESIG_CP_BUFFER DW 28 DUP(?) ; (Room for 25 code pages)
+DESIG_CP_BUF_LEN DW $-DESIG_CP_BUFFER ; Length of code page buffer
+NUM_DESIG_CP DW 0
+CP_TAB_OFFSET DD ?
+
+;****************** CNS ******************
+TOTAL_SIZE DW 0
+PASS_LANG DW 0
+ID_TAB_OFFSET DD ?
+;****************** CNS ******************
+
+STATE_LOGIC_OFFSET DD -1
+KEYBSYS_FILE_HANDLE DW ?
+TB_RETURN_CODE DW 1
+DESIG_CP_OFFSET DW OFFSET DESIG_CP_BUFFER
+SYS_CODE_PAGE DW 0
+DESIG_LIST DW 0
+QUERY_CALL DB 0
+
+KB_MASK EQU 02h
+
+SIGNATURE DB 0FFh,'KEYB '
+SIGNATURE_LENGTH DW 8
+
+;****************** CNS ***************************
+NUM_ID DW 0
+ERR4ID DB 0
+NUM_LANG DW 0
+NUM_CP DW 0
+ID_PTR_SIZE DW SIZE KEYBSYS_ID_PTRS
+;****************** CNS ***************************
+
+LANG_PTR_SIZE DW SIZE KEYBSYS_LANG_PTRS
+CP_PTR_SIZE DW SIZE KEYBSYS_CP_PTRS
+KEYBCMD_LANG_ENTRY_PTR DD ?
+
+KEYB_INSTALLED DW 0
+CON_INSTALLED DW 0
+SHARED_AREA_PTR DD 0
+GOOD_MATCH DW 0
+
+;****************** CNS ***************************;
+LANGUAGE_ASCII DB '??',0
+
+CMD_PARM_LIST PARM_LIST <>
+
+;---------- TABLES FOR EXTENDED KEYBOARD SUPPORT CTRL CASE ---------
+
+
+RPL_K8 LABEL BYTE ;-------- CHARACTERS ---------
+ DB 27,-1,00,-1,-1,-1 ; Esc, 1, 2, 3, 4, 5
+ DB 30,-1,-1,-1,-1,31 ; 6, 7, 8, 9, 0, -
+ DB -1,127,148,17,23,5 ; =, Bksp, Tab, Q, W, E
+ DB 18,20,25,21,09,15 ; R, T, Y, U, I, O
+ DB 16,27,29,10,-1,01 ; P, [, ], Enter, Ctrl, A
+ DB 19,04,06,07,08,10 ; S, D, F, G, H, J
+ DB 11,12,-1,-1,-1,-1 ; K, L, ;, ', `, LShift
+ DB 28,26,24,03,22,02 ; \, Z, X, C, V, B
+ DB 14,13,-1,-1,-1,-1 ; N, M, ,, ., /, RShift
+ DB 150,-1,' ',-1 ; *, Alt, Space, CL
+ ;--------- FUNCTIONS ---------
+ DB 94,95,96,97,98,99 ; F1 - F6
+ DB 100,101,102,103,-1,-1 ; F7 - F10, NL, SL
+ DB 119,141,132,142,115,143 ; Home, Up, PgUp, -, Left, Pad5
+ DB 116,144,117,145,118,146 ; Right, +, End, Down, PgDn, Ins
+ DB 147,-1,-1,-1,137,138 ; Del, SysReq, Undef, WT, F11, F12
+L_CTRL_TAB EQU $-RPL_K8
+
+;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;
+
+KEYB_COMMAND PROC NEAR
+
+ CALL SYSLOADMSG ;load messages
+ JNC VERSION_OK ;if no carry then version ok
+
+ CALL SYSDISPMSG ;error..display version error
+ MOV AL,BAD_DOS_VER ;bad DOS version
+ MOV EXIT_RET_CODE,AL
+ JMP KEYB_EXIT_NOT_RESIDENT ;exit..non resident
+
+VERSION_OK:
+ MOV SEG_OF_NUMBER,CS ;initialize..
+ MOV SEG_OF_ASCIIZ,CS ; ..sublists
+ MOV BP,OFFSET CMD_PARM_LIST ;pointer for parm list
+ MOV WORD PTR SHARED_AREA_PTR,ES ; ES segment
+
+KEYB_INSTALL_CHECK:
+ MOV AX,0AD80H ; KEYB install check
+ INT 2FH
+ CMP AL,-1 ; If flag is not 0FFh THEN
+ JE INSTALLED_KEYB
+
+ MOV WORD PTR SHARED_AREA_PTR+2,OFFSET TSD
+ JMP short CON_INSTALL_CHECK
+
+INSTALLED_KEYB:
+ MOV KEYB_INSTALLED,1 ; Set KEYB_INSTALLED flag = YES
+ MOV WORD PTR SHARED_AREA_PTR,ES ; Save segment of SHARED_DATA_AREA
+ MOV WORD PTR SHARED_AREA_PTR+2,DI ;Save offset of SHARED_DATA_AREA
+
+ MOV AX,ES:[DI].KEYB_TYPE
+ MOV HW_TYPE,AX
+ MOV ES:[DI].TABLE_OK,0 ; Do not allow processing
+ PUSH CS ; while building table
+ POP ES ; Reset ES until required
+
+CON_INSTALL_CHECK:
+ MOV AX,0AD00H ; CONSOLE install check
+ INT 2FH
+ CMP AL,-1 ; If flag is not 0FFh THEN
+ jnz call_first_stage
+
+ MOV CON_INSTALLED,1 ; Set CON_INSTALLED flag = YES
+
+CALL_FIRST_STAGE:
+ PUSH CS
+ POP ES
+ CALL PARSE_PARAMETERS ; Validate parameter list
+
+ test pswitches,1 ; /? option?
+ jz no_help ; brif not
+
+ mov ax,help_1st ; first help msg
+help_loop:
+ push ax
+ MOV BX,STDOUT ; to standard out
+ xor cx,cx ; no replacements
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_ASCIIZ ; ptr to sublist
+ CALL SYSDISPMSG
+ pop ax
+ inc ax
+ cmp ax,help_last
+ jbe help_loop
+
+ mov exit_ret_code,invalid_parms ; return "invalid parms"
+ jmp KEYB_EXIT_NOT_RESIDENT
+
+
+
+no_help:
+
+BEGIN_PARM_CHECK: ; CHECK ALL RETURN CODES
+ MOV DL,[BP].RET_CODE_3
+ CMP DL,1 ; Check for invalid syntax
+ JNE VALID1
+ JMP ERROR3
+
+VALID1:
+ MOV DL,[BP].RET_CODE_1 ; Check for invalid language parm
+ CMP DL,1
+ JNE VALID2
+ JMP ERROR1
+
+VALID2:
+ MOV DL,[BP].RET_CODE_2 ; Check for invalid code page parm
+ CMP DL,1
+ JNE VALID3
+ JMP ERROR2
+
+VALID3:
+ MOV DL,[BP].RET_CODE_1 ; Check for query command
+ CMP DL,2
+ JE QUERY
+
+
+;******************************* CNS **
+ CMP DL,3 ; Get a status of the codepage
+ JE QUERY ; language, and possible ID code
+;******************************* CNS **
+
+ JMP NOT_QUERY
+ ; IF QUERY is requested THEN
+QUERY:
+ MOV QUERY_CALL,DL
+ MOV AX,KEYB_INSTALLED ; If KEYB is installed THEN
+ or ax,ax
+ JE QUERY_CONTINUE1
+
+ MOV DI,WORD PTR SHARED_AREA_PTR+2 ; Get offset of
+ MOV ES,WORD PTR SHARED_AREA_PTR ; shared area
+ MOV BX,WORD PTR ES:[DI].ACTIVE_LANGUAGE ; Get active language
+ or bx,bx ; if no language...
+ JE I_MESSAGE ; then id was specified
+
+
+L_MESSAGE:
+ MOV WORD PTR LANGUAGE_ASCII,BX ; Display Language
+ LEA SI,LANGUAGE_ASCII ; sublist points to...
+ MOV PTR_TO_ASCIIZ,SI ; language code asciiz string
+ MOV AX,ACT_KEYB ; display 'Current keyboard code'
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_ASCIIZ ; ptr to sublist
+ CALL SYSDISPMSG
+ JMP short KEYB_L_FINISHED
+
+I_MESSAGE:
+ MOV BX,WORD PTR ES:[DI].INVOKED_KBD_ID ; get id code.
+ MOV NUMBER_HOLDER,BX ; transfer number to temp loc.
+ LEA SI,NUMBER_HOLDER ; sublist points to...
+ MOV PTR_TO_NUMBER,SI ; code page word
+ MOV AX,ACT_ID ; display 'Current ID: '
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_NUMBER ; ptr to sublist
+ CALL SYSDISPMSG
+ MOV ID_DISPLAYED,1 ; ID was displayed.
+ JMP short KEYB_L_FINISHED
+
+QUERY_CONTINUE1:
+ MOV AX,INV_KEYB_Q
+ MOV BX,STDOUT ; Else
+ XOR CX,CX ; Display message that KEYB
+ MOV DH,UTILITY_MSG_CLASS ; has not been installed
+ XOR DL,DL
+ CALL SYSDISPMSG
+ JMP short KEYB_CP_FINISHED
+
+KEYB_L_FINISHED:
+ MOV BX,ES:[DI].INVOKED_CP_TABLE ; Get invoked code page
+
+ MOV NUMBER_HOLDER,BX ; transfer number to temp loc.
+ LEA SI,NUMBER_HOLDER ; sublist points to...
+ MOV PTR_TO_NUMBER,SI ; code page word
+ MOV AX,ACT_KEYB_CP ; display ' code page: '
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_NUMBER ; ptr to sublist
+ CALL SYSDISPMSG
+ CMP ID_DISPLAYED,1 ; was id displayed?
+ JE KEYB_CP_FINISHED ; yes..continue.
+
+ MOV BX,WORD PTR ES:[DI].INVOKED_KBD_ID ; get id code.
+ or bx,bx ; no id given
+ JE KEYB_CP_FINISHED
+
+ MOV NUMBER_HOLDER,BX ; transfer number to temp loc.
+ LEA SI,NUMBER_HOLDER ; sublist points to...
+ MOV PTR_TO_NUMBER,SI ; code page word
+ MOV AX,ACT_ID ; display 'Current ID: '
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_NUMBER ; ptr to sublist
+ CALL SYSDISPMSG
+
+ MOV AH,09H ; need a CR_LF here.
+ MOV DX,OFFSET CR_LF
+ INT 21H
+
+KEYB_CP_FINISHED:
+ MOV AX,CON_INSTALLED ; If CON has been installed THEN
+ or ax,ax
+ JNE GET_ACTIVE_CP
+ JMP short CON_NOT_INSTALLED
+
+GET_ACTIVE_CP:
+ MOV AX,0AD02H ; Get active code page
+ INT 2FH ; information from the console
+ JNC DISPLAY_ACTIVE_CP
+ JMP ERROR5
+
+DISPLAY_ACTIVE_CP:
+ MOV NUMBER_HOLDER,BX ; transfer number to temp loc.
+ LEA SI,NUMBER_HOLDER ; sublist points to...
+ MOV PTR_TO_NUMBER,SI ; code page word
+ MOV AX,ACT_CON_CP ; display 'Current CON code page: '
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_NUMBER ; ptr to sublist
+ CALL SYSDISPMSG
+
+ JMP KEYB_EXIT_NOT_RESIDENT ; Exit from Proc
+
+CON_NOT_INSTALLED: ; ELSE
+ MOV AX,INV_CON_Q
+ MOV BX,STDOUT ; Else
+ XOR CX,CX ; Display message that CON does
+ MOV DH,UTILITY_MSG_CLASS ; not have active code page
+ XOR DL,DL
+ CALL SYSDISPMSG
+ JMP KEYB_EXIT_NOT_RESIDENT ; Exit from Proc
+
+NOT_QUERY: ; IF not a query function requested
+ CALL BUILD_PATH ; Determine location of KEYBOARD.SYS
+ ; ...and open file.
+
+ JNC VALID4 ; If no error in opening file then
+ JMP ERROR4
+
+VALID4:
+ MOV KEYBSYS_FILE_HANDLE,AX ; Save handle
+ MOV BP,OFFSET CMD_PARM_LIST ; Set base pointer for structures
+ MOV BX,KEYBSYS_FILE_HANDLE ; Retrieve the file handle
+ MOV DX,OFFSET FILE_BUFFER ; Set address of buffer
+
+;************************* CNS ********;
+ cmp [BP].RET_CODE_4,ID_VALID ; CNS is there an ID available
+ je ID_TYPED ; if so go find out if it is
+ jmp short GET_LANG ; a 1st or 4th parm, if not must
+ ; must be a language
+ID_TYPED:
+
+ call SCAN_ID ; scan the table for the ID
+ cmp ID_FOUND,1 ; if a legal ID check and see if
+ jne LOST_ID ; it is a first or fourth parm
+
+ cmp FTH_PARMID,1 ; if it is a fourth parm go
+ je GET_ID ; check for language compatibility
+ jmp short Language_found ; otherwise it must be a first
+ ; parm id value
+
+LOST_ID: ; otherwise must be a bogus match
+ ; between language and ID codes
+ ; or the ID code does not exist
+ jmp ERR1ID ; in the table
+;************************* CNS ***********;
+
+GET_LANG: ; Must be a language/or a 1st parm ID
+
+
+ XOR DI,DI ; Set number
+ LEA CX,[DI].KH_NUM_LANG+2 ; bytes to read header
+
+ MOV AH,3FH ; Read header of the Keyb Def file
+ INT 21H
+ JNC VALID5 ; If no error in opening file then
+ JMP ERROR4
+
+VALID5:
+ CLD ; all moves/scans forward
+ MOV CX,SIGNATURE_LENGTH
+ MOV DI,OFFSET SIGNATURE ; Verify matching
+ MOV SI,OFFSET FB.KH_SIGNATURE ; signatures
+ REPE CMPSB
+ JE LANGUAGE_SPECIFIED
+ JMP ERROR4
+ ; READ the language table
+LANGUAGE_SPECIFIED:
+ MOV AX,FB.KH_NUM_LANG
+ MOV NUM_LANG,AX ; Save the number of languages
+ MUL LANG_PTR_SIZE ; Determine # of bytes to read
+ MOV DX,OFFSET FILE_BUFFER ; Establish beginning of buffer
+ MOV CX,AX
+ CMP CX,SIZE FILE_BUFFER ; Make sure buffer is not to small
+ JBE READ_LANG_TAB
+ JMP ERROR4
+
+READ_LANG_TAB:
+ MOV AH,3FH ; Read language table from
+ INT 21H ; Keyb Def file
+ JNC READ_VALID ; If no error in opening file then
+ JMP ERROR4 ; Else display ERROR message
+
+READ_VALID:
+ MOV CX,NUM_LANG ; Number of valid codes
+ MOV DI,OFFSET FILE_BUFFER ; Point to correct word in table
+
+SCAN_LANG_TABLE: ; FOR language parm
+ MOV AX,[BP].LANGUAGE_PARM ; Get parameter
+ CMP [DI].KP_LANG_CODE,AX ; Valid Code ??
+ JE LANGUAGE_FOUND ; If not found AND more entries THEN
+
+ ADD DI,LANG_PTR_SIZE ; Check next entry
+ DEC CX ; Decrement count of entries
+ JNE SCAN_LANG_TABLE ; Else
+ JMP ERROR1 ; Display error message
+
+;**************************** CNS ****
+GET_ID: ; CNS - Must be an ID value
+ mov cx,1 ; initialize ctr value for # of ids
+
+SEARCH_ID: ; minimum per country
+; ; There is atleast 1 ID for each country
+ or cx,cx ; check for any more IDs left to check
+ jne FINDID ; Country has more than one ID check
+ jmp END_IDCHK ; Country & ID has been found or value
+ ; is zero
+FINDID:
+
+ push di ; save the current language entry ptr
+ push cx ; save the minimum # of ids before
+ ; reading the table data from the disk
+;**************************** CNS ***********
+
+LANGUAGE_FOUND:
+ MOV CX,WORD PTR [DI].KP_ENTRY_PTR+2 ; Get offset of lang entry
+ MOV DX,WORD PTR [DI].KP_ENTRY_PTR ; in the Keyb Def file
+ MOV WORD PTR KEYBCMD_LANG_ENTRY_PTR,DX ; Save
+ MOV WORD PTR KEYBCMD_LANG_ENTRY_PTR+2,CX ; offset
+ MOV AH,42H ; Move file pointer to
+ MOV AL,0 ; location of language
+ INT 21H ; entry
+ JNC LSEEK_VALID
+ JMP ERROR4
+
+LSEEK_VALID:
+ MOV DI,AX
+ MOV CX,SIZE KEYBSYS_LANG_ENTRY-1 ; Set number
+ ; bytes to read header
+ MOV DX,OFFSET FILE_BUFFER
+ MOV AH,3FH ; Read language entry in
+ INT 21H ; Keyb Def file
+ JNC VALID6a ; If no error in file then
+ JMP ERROR4
+
+;**************************** CNS **********************************************
+
+
+valid6a:
+ cmp FOURTH_PARM,1 ; Is the ID a 4th Parm
+ jne VALID6 ; if not get out of routine, otherwise
+ pop cx ; restore # of ids for the country
+ ; Check to see if this is the first
+ ; time checking the primary ID
+ cmp cx,1 ; if there is just one ID check to make
+ jne CHK4PARM ; sure both flags are not set
+ ; this should not be necessary w/ new parser
+
+ cmp FTH_PARMID,1 ; is the ID flag for switch set
+ jne CHK1N4 ; is the flag set only for the 4th
+ cmp FOURTH_PARM,1 ; if set only for the switch proceed
+ jne CHK1N4 ; if not must be a positional
+ mov cl,fb.kl_num_id ; get the number of IDs available from the table
+ mov FTH_PARMID,0 ; turn switch flag off so the table
+ ; counter will not be reset
+
+ ;ids available for the
+CHK1N4: ;country
+ cmp ONE_PARMID,1 ; this was to be done if
+ jne CHK4PARM ; two the positional
+ cmp FOURTH_PARM,0 ; and switch was specified
+ jne CHK4PARM ; this should never happen
+
+ pop di ; if the parser is intact
+ jmp error3 ; report error & exit
+
+CHK4PARM: ; check on the first ID
+ cmp FOURTH_PARM,1 ; ID was a switch
+ jne ABORT_LOOP ; otherwise get out of routine
+ call IDLANG_CHK ; check the ID
+ jmp short ADVANCE_PTR ; advance to the next position
+
+ABORT_LOOP:
+ xor cx,cx ; end loop
+
+ADVANCE_PTR:
+ pop di ;restore entry value
+
+ dec cx ; # of ids left to check
+ je NO_ADVANCE ; if 0, don't advance table position
+ cmp GOOD_MATCH,1 ; check to see if ID matched language
+ je NO_ADVANCE ; if equal do not advance
+
+ add di,LANG_PTR_SIZE ; step to the next entry
+ ; in the table
+
+NO_ADVANCE:
+
+ jmp SEARCH_ID ; for the country
+
+; ; end of ID check for country
+
+END_IDCHK:
+
+ cmp FOURTH_PARM,1 ; see if id was found
+ jne VALID6
+ cmp GOOD_MATCH,0 ; none found
+ jne VALID6 ; report error
+
+ mov [bp].ret_code_4,1 ; incompatible lang code
+ mov al,[bp].ret_code_4 ; id combo
+ jmp err2id
+
+ ; otherwise found it
+ ; continue to build tbl
+;**************************** CNS **********************************************
+
+VALID6:
+ MOV AX,WORD PTR FB.KL_LOGIC_PTR ; Save the offset of the state
+ MOV WORD PTR STATE_LOGIC_OFFSET,AX ; logic section
+ MOV AX,WORD PTR FB.KL_LOGIC_PTR+2 ; Save the offset of the state
+ MOV WORD PTR STATE_LOGIC_OFFSET+2,AX ; logic section
+
+ MOV DL,[BP].RET_CODE_2 ; IF code page was specified
+ CMP DL,2
+ JNE CODE_PAGE_SPECIFIED
+ JMP short DONE
+
+CODE_PAGE_SPECIFIED: ; Then
+
+;************************** CNS ***************************************
+ xor ah,ah
+ MOV Al,FB.KL_NUM_CP
+;************************** CNS ***************************************
+
+ MOV NUM_CP,AX ; Save the number of code pages
+ MUL CP_PTR_SIZE ; Determine # of bytes to read
+ MOV DX,OFFSET FILE_BUFFER ; Establish beginning of buffer
+ MOV CX,AX
+ CMP CX,SIZE FILE_BUFFER ; Make sure buffer is not to small
+ JBE VALID7
+ JMP ERROR4
+
+VALID7:
+ MOV AH,3FH ; Read code page table from
+ INT 21H ; Keyb Def file
+ JNC VALID8 ; If no error in opening file then
+ JMP ERROR4
+
+VALID8:
+ MOV CX,NUM_CP ; Number of valid codes
+ MOV DI,OFFSET FILE_BUFFER ; Point to correct word in table
+
+SCAN_CP_TABLE: ; FOR code page parm
+ MOV AX,[BP].CODE_PAGE_PARM ; Get parameter
+ CMP [DI].KC_CODE_PAGE,AX ; Valid Code ??
+ JE CODE_PAGE_FOUND ; If not found AND more entries THEN
+
+ ADD DI,CP_PTR_SIZE ; Check next entry
+ DEC CX ; Decrement count of entries
+ JNE SCAN_CP_TABLE ; Else
+;;; if we can not find the CP, simply use the first one available for
+;;; the language. This was done for NT because users can not really specified
+;;; the code page id via KEYB.COM. By using the first CP, we maintain the
+;;; compatibility with dos(keyb gr will succeed even the currnt code page is
+;;; invalid for German layout
+;;;
+ifdef NOT_NTVDM
+ JMP ERROR2 ; Display error message
+else
+ mov cx, 1
+ mov NUM_DESIG_CP, cx
+ mov [si].NUM_DESIGNATES, cx
+ jmp short SET_TO_SYSTEM_CP
+
+endif
+
+CODE_PAGE_FOUND:
+ MOV AX,WORD PTR [DI].KC_ENTRY_PTR
+ MOV WORD PTR CP_TAB_OFFSET,AX
+ MOV AX,WORD PTR [DI].KC_ENTRY_PTR+2
+ MOV WORD PTR CP_TAB_OFFSET+2,AX
+
+DONE:
+ MOV SI,OFFSET DESIG_CP_BUFFER
+
+ MOV AX,CON_INSTALLED ; If CON is NOT installed THEN
+ or ax,ax
+ JE SYSTEM_CP
+ JMP short GET_DESIG_CPS
+
+SYSTEM_CP:
+ MOV CX,1
+ MOV NUM_DESIG_CP,CX ; Set number of CPs = 1
+ MOV [SI].NUM_DESIGNATES,CX
+
+ MOV DL,[BP].RET_CODE_2 ; Check if code page parm
+ or dl,dl ; was specified
+ JNE SET_TO_SYSTEM_CP
+
+ MOV DX,[BP].CODE_PAGE_PARM
+ MOV [SI].DESIG_CP_ENTRY,DX ; Load specified code page into
+ JMP READY_TO_BUILD_TABLE ; designated code page list
+
+SET_TO_SYSTEM_CP:
+ CALL FIND_FIRST_CP ; Call routine that sets the first
+ or ax,ax ; table found in the Keyb Def file
+ JE SET_TO_SYSTEM_CP2 ; to the system code page
+ JMP ERROR4
+
+SET_TO_SYSTEM_CP2:
+ MOV SYS_CODE_PAGE,BX
+ MOV [BP].CODE_PAGE_PARM,BX
+ MOV [SI].DESIG_CP_ENTRY,BX ; Move sys CP into desig list
+ JMP READY_TO_BUILD_TABLE
+
+GET_DESIG_CPS: ; ELSE
+ MOV AX,0AD03H
+ PUSH CS ; Make sure ES is set
+ POP ES
+ LEA DI,DESIG_CP_BUFFER
+ MOV CX,DESIG_CP_BUF_LEN
+ INT 2FH ; Get all designated code pages
+ JNC SET_DESIG_VARIABLES ; from console
+ JMP ERROR5
+
+SET_DESIG_VARIABLES:
+ MOV CX,[SI].NUM_DESIGNATES
+ ADD CX,[SI].NUM_HW_CPS
+ MOV NUM_DESIG_CP,CX ; Set number of Designated CPs
+
+BUFFER_CREATED:
+ MOV AX,0AD02H
+ INT 2FH ; Get invoked code page
+
+SET_TO_CP_INVOKED:
+ MOV DL,[BP].RET_CODE_2 ; IF code page parm was specified
+ or dl,dl
+ JNE SET_TO_INVOKED_CP
+
+ MOV CX,NUM_DESIG_CP
+ MOV DESIG_LIST,SI
+ JMP short TEST_IF_DESIGNATED
+
+SET_TO_INVOKED_CP:
+ CMP AX,1 ; IF a code page has been invoked
+ JNE SET_TO_INVOKED_CP3
+
+ CALL FIND_FIRST_CP ; Call the routine that sets the
+ or ax,ax ; first code page in the Keyb Def
+ JE SET_TO_INVOKED_CP2 ; file to the system code page
+ JMP ERROR4
+
+SET_TO_INVOKED_CP2:
+ MOV [BP].CODE_PAGE_PARM,BX
+ MOV SYS_CODE_PAGE,BX
+
+ JMP short TEST_IF_DESIGNATED
+
+SET_TO_INVOKED_CP3:
+ MOV [BP].CODE_PAGE_PARM,BX
+
+TEST_IF_DESIGNATED:
+ MOV DX,[BP].CODE_PAGE_PARM
+ CMP [SI].DESIG_CP_ENTRY,DX ; Is Code page specified in the list
+ JE CODE_PAGE_DESIGNATED ; of designated code pages ?
+
+NEXT_DESIG_CP:
+ ADD SI,2 ; Check next code page
+ DEC CX ; If all designated code pages have
+ JNZ TEST_IF_DESIGNATED ; been checked Then ERROR
+ JMP ERROR6
+
+CODE_PAGE_DESIGNATED:
+ CMP SYS_CODE_PAGE,0
+ JNE READY_TO_BUILD_TABLE
+ CMP AX,1 ; IF a code page has been invoked
+ JE READY_TO_BUILD_TABLE
+ CMP [BP].CODE_PAGE_PARM,BX ; IF Invoked CP <> Specified CP
+ JE READY_TO_BUILD_TABLE ; Issue warning
+
+;***************************************************************************
+ PUSH BX
+ PUSH CX
+ MOV AX,WARNING_1
+ MOV BX,STDOUT
+ XOR CX,CX
+ MOV DH,UTILITY_MSG_CLASS
+ XOR DL,DL
+ CALL SYSDISPMSG
+ POP CX
+ POP BX
+;***************************************************************************
+
+
+READY_TO_BUILD_TABLE:
+
+ MOV AX,KEYB_INSTALLED
+ or ax,ax ; Else if KEYB has not been installed
+ JNE BUILD_THE_TABLE
+
+ CALL FIND_SYS_TYPE ; Determine system type for INT 9 use
+
+;------ LOAD IN SPECIAL INT 9 HANDLER AND SPECIAL TABLES
+
+ CALL INSTALL_INT_9 ; Install INT 9
+
+ CALL FIND_KEYB_TYPE ; Determine keyboard type table use
+
+BUILD_THE_TABLE:
+ CALL TABLE_BUILD ; Build the TEMP_SHARED_DATA_AREA
+
+CHECK_ERRORS:
+ ; Take appropriate action considering
+ MOV CX,TB_RETURN_CODE ; return codes from TABLE_BUILD
+ jcxz CHECK_FOR_INV_CP ; If return code is not 0
+
+ MOV AX,KEYB_INSTALLED ; If KEYB has not been installed,
+ or ax,ax
+ JNE CHECK_ERROR_CONTINUE
+
+ CALL REMOVE_INT_9 ; remove installed vector
+
+CHECK_ERROR_CONTINUE:
+ CMP CX,1 ; If return code = 1
+ JNE CHECK_ERROR2
+ JMP ERROR1 ; display error message
+
+CHECK_ERROR2:
+ CMP CX,2 ; If return code = 2
+ JNE CHECK_ERROR3
+ JMP ERROR2
+
+CHECK_ERROR3:
+ CMP CX,3 ; If return code = 3
+ JNE CHECK_ERROR4
+ JMP ERROR3 ; display error message
+
+CHECK_ERROR4:
+ CMP CX,4 ; If return code = 4
+ JNE CHECK_ERROR5A
+ JMP ERROR4 ; display error message
+
+CHECK_ERROR5A:
+ CMP CX,5 ; If return code = 5
+ JNE CHECK_ERROR6A
+ JMP ERROR5A ; display error message
+
+CHECK_ERROR6A:
+ JMP ERROR6A ; If return code not 0,1,2,3,4 then
+ ; display error message
+CHECK_FOR_INV_CP:
+ MOV CX,CPN_INVALID ; Check if any CPs were not loaded
+ jcxz TERMINATE ; If some were invalid, issue
+ ; warning message
+
+;***************************************************************************
+ PUSH BX
+ PUSH CX
+ MOV AX,NOT_SUPP
+ MOV BX,STDOUT ; WARNING
+ XOR CX,CX ; MESSAGE
+ MOV DH,UTILITY_MSG_CLASS
+ XOR DL,DL
+ CALL SYSDISPMSG
+ POP CX
+ POP BX
+;***************************************************************************
+
+TERMINATE:
+ MOV AH,3EH ; Close the KEYBOARD.SYS file
+ MOV BX,KEYBSYS_FILE_HANDLE ; if open
+ or bx,bx
+ JE KEYB_EXIT
+ INT 21H
+
+ MOV AX,KEYB_INSTALLED
+ or ax,ax
+ JE KEYB_EXIT
+ JMP KEYB_EXIT_NOT_RESIDENT
+
+KEYB_EXIT:
+ TEST SD.KEYB_TYPE,G_KB ; Q..FERRARI G??
+ JZ NO_FERRARI_G ; N..LEAVE NUMLK ALONE
+ TEST SD.SYSTEM_FLAG,PC_XT ; Q..PC/XT?
+ JNZ NO_FERRARI_G ; Y..LEAVE NUMLK ALONE
+ TEST SD.KEYB_TYPE,P_KB ; Q..FERRARI P??
+ JNZ NO_FERRARI_G ; Y..LEAVE NUMLK ALONE
+
+;***CNS
+ CMP SECURE_FL,1 ; IF SECURITY FLAG SET
+ JNE NO_FERRARI_G ; DON'T TURN ON NUM_LK
+
+;***CNS
+ CALL NUMLK_ON ; N..TURN NUMLK ON
+
+NO_FERRARI_G:
+ TEST SD.SYSTEM_FLAG,EXT_16 ; extended INT 16 support?
+ JZ SKIP_CTRL_COPY
+ ; Yes, load extened CTRL case table
+
+ MOV CX,L_CTRL_TAB ; CX = LENGTH OF EXTENDED TABLE
+ MOV SI,OFFSET CS:RPL_K8 ; POINT TO EXT. CTRL TABLES
+ MOV DI,OFFSET CS:K8 ; POINT TO REGULAR CTRL TABLE
+ CLD
+ REP MOVSB ; OVERLAY WITH EXT. CTRL TABLE
+
+SKIP_CTRL_COPY:
+ CALL INSTALL_INT_9_NET ; Let the network know about INT 9
+ ; (if the network is installed)
+ CALL INSTALL_INT_2F ; Install INT 2F
+
+ MOV AX,0AD82H ; Activate language
+ MOV BL,-1
+ INT 2FH
+
+ MOV AH,31H ; Function call to terminate but stay
+ XOR AL,AL ; resident
+ MOV DI,OFFSET SD_DEST_PTR ; Initialize destination ptr
+
+ MOV DX,ES:TSD.RESIDENT_END ; Get resident end
+
+ CALL COPY_SDA_SETUP ; Set up move common code
+
+ JMP COPY_SD_AREA ; Jump to proc that copies area in new
+ ; part of memory
+
+;***************************** CNS **************************************
+ERR1ID:
+;************************************************************************
+
+ MOV AX,INV_I ; invalid ID message
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,INVALID_PARMS
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP KEYB_EXIT_NOT_RESIDENT
+ERR2ID:
+;***************************************************************************
+
+ MOV AX,INV_COMBO ; invalid combination message
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,INVALID_PARMS
+ MOV EXIT_RET_CODE,AL
+
+;**************************************************************************
+ JMP KEYB_EXIT_NOT_RESIDENT
+;***************************** CNS ****************************************
+
+ERROR1:
+;***************************************************************************
+ MOV AX,INV_L ; invalid language code
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+
+ MOV AL,INVALID_PARMS
+ MOV EXIT_RET_CODE,AL
+;***************************************************************************
+
+ JMP KEYB_EXIT_NOT_RESIDENT
+ERROR2:
+;***************************************************************************
+ MOV AX,INV_CP ; invalid code page message
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+
+ MOV AL,INVALID_PARMS
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP KEYB_EXIT_NOT_RESIDENT
+ERROR3:
+;***************************************************************************
+
+ MOV AX,INV_S ; invalid syntax message
+ MOV BX,STDOUT ; to standard out
+;***CNS
+
+ LEA DI,STRING_HOLDER ;Set PTR to look at the STRING
+ PUSH SI ;Save current SI index
+ PUSH AX
+ MOV AX,OLD_PTR ;Last locale of the end of a PARAM
+ SUB CUR_PTR,AX ;Get the length via the PSP
+ MOV SI,CUR_PTR
+ MOV CX,SI ;Save it in CX to move in the chars
+ POP AX ;Restore the PTR to the command line position
+
+ MOV SI,OLD_PTR ;Last locale of the end of a PARAM
+ REP MOVSB ;Move in the chars until no more
+
+ LEA DI,STRING_HOLDER ;Set PTR to look at the STRING
+
+
+ POP SI ;Restore the PTR to the command line position
+
+ MOV CX,1 ;One replacement
+ MOV PTR_TO_COMLIN,DI ; language code asciiz string
+
+
+ PUSH AX
+ MOV AX,DS ; language code asciiz string
+ MOV SEG_OF_COMLIN,AX
+ POP AX
+
+ MOV AX,ERR_PART
+ LEA SI,SUBLIST_COMLIN
+ MOV DH,PARSE_ERR_CLASS ; parse error message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,INVALID_PARMS
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP short KEYB_EXIT_NOT_RESIDENT
+ERROR4:
+;***************************************************************************
+
+ MOV AX,INV_FN ; bad or missing file message
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,BAD_KEYB_DEF_FILE
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP short KEYB_EXIT_NOT_RESIDENT
+ERROR5:
+;***************************************************************************
+
+ MOV AX,INV_CON_Q ; CON code page not available.
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,CONSOLE_ERROR
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP short KEYB_EXIT_NOT_RESIDENT
+ERROR5A:
+;***************************************************************************
+
+ MOV AX,MEMORY_OVERF ; not enough resident memory.
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,MEMORY_OVERFLOW
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP short KEYB_EXIT_NOT_RESIDENT
+ERROR6:
+;***************************************************************************
+
+ MOV AX,NOT_DESIG ; code page not prepared.
+ MOV BX,STDOUT ; to standard out
+ XOR CX,CX ; no substitutions
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ CALL SYSDISPMSG ; display message
+ MOV AL,CP_NOT_DESIGNATED
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+ JMP short KEYB_EXIT_NOT_RESIDENT
+ERROR6A:
+;***************************************************************************
+
+ MOV NUMBER_HOLDER,BX ; transfer number to temp loc.
+ LEA SI,NUMBER_HOLDER ; sublist points to...
+ MOV PTR_TO_NUMBER,SI ; code page word
+ MOV AX,NOT_VALID ; display 'Code page requested....'
+ MOV BX,STDOUT ; to standard out
+ MOV CX,1 ; one replacement
+ MOV DH,UTILITY_MSG_CLASS ; utility message
+ XOR DL,DL ; no input
+ LEA SI,SUBLIST_NUMBER ; ptr to sublist
+ CALL SYSDISPMSG
+
+ MOV AL,KEYB_TABLE_NOT_LOAD
+ MOV EXIT_RET_CODE,AL
+
+;***************************************************************************
+
+KEYB_EXIT_NOT_RESIDENT:
+ MOV AH,04CH
+ MOV AL,QUERY_CALL ; Check if this was a query call
+ or al,al
+ JNE KEYB_EXIT3 ; IF yes then EXIT
+
+ MOV AL,EXIT_RET_CODE ; Check if return code was valid
+ or al,al
+ JNE KEYB_EXIT3 ; IF not then EXIT
+
+COPY_INTO_SDA:
+ MOV AX,0AD82H ; Activate language
+ MOV BL,-1
+ INT 2FH
+
+ MOV AH,04CH
+ MOV AL,EXIT_RET_CODE
+ MOV DI,WORD PTR SHARED_AREA_PTR+2 ; Initialize destination ptr
+ MOV ES,WORD PTR SHARED_AREA_PTR
+ MOV DX,[BP].RESIDENT_END
+
+ CALL COPY_SDA_SETUP ; Set up move common code
+
+ JMP COPY_SD_AREA ; Jump to proc that copies area in new
+
+KEYB_EXIT3:
+ MOV AL,EXIT_RET_CODE
+ MOV DI,WORD PTR SHARED_AREA_PTR+2 ; Initialize destination ptr
+ MOV ES,WORD PTR SHARED_AREA_PTR
+ MOV ES:[DI].TABLE_OK,1
+ INT 21H
+
+KEYB_COMMAND ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: COPY_SDA_SETUP
+;
+; Description:
+; Common setup logic for exit
+;
+; Input Registers:
+; N/A
+;
+; Output Registers:
+; N/A
+;
+; Logic:
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+COPY_SDA_SETUP PROC NEAR
+
+ push ax ;save existing values
+ push es
+ mov ax,cs:[2ch] ;check offset for address containin environ.
+ or ax,ax
+ je NO_FREEDOM
+
+ mov es,ax
+ mov ax,4900H ;make the free allocate mem func
+ int 21h
+
+NO_FREEDOM:
+ pop es ;restore existing values
+ push bx
+ ;Terminate and stay resident
+ mov bx,4 ;1st close file handles
+ ;STDIN,STDOUT,STDERR
+closeall:
+ mov ah,3eh
+ int 21h
+ dec bx
+ jnz closeall
+
+ pop bx
+ pop ax
+
+ MOV CL,4 ; Convert into paragrahs
+ SHR DX,CL
+ INC DX
+
+ MOV SI,OFFSET SD_SOURCE_PTR ; Initialize source ptr
+ XOR BP,BP
+ LEA BX,[BP].ACTIVE_LANGUAGE
+ ADD DI,BX ; Adjust for portion not copied
+ ADD SI,BX ; Adjust for portion not copied
+
+ MOV CX,SD_LENGTH ; Set length of SHARED_DATA_AREA
+ SUB CX,BX ; Adjust for portion not copied
+
+ RET
+
+COPY_SDA_SETUP ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: NUMLK_ON
+;
+; Description:
+; Turn Num Lock On.
+;
+; Input Registers:
+; N/A
+;
+; Output Registers:
+; N/A
+;
+; Logic:
+; Set Num Lock bit in BIOS KB_FLAG
+; Issue Int 16 to update lights
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+NUMLK_ON PROC
+
+ PUSH ES
+ PUSH AX
+
+ MOV AX,DATA
+ MOV ES,AX
+
+ OR ES:KB_FLAG,NUM_STATE ; Num Lock state active
+ MOV AH,1 ; Issue keyboard query call to
+ INT 16H ; have BIOS update the lights
+
+ POP AX
+ POP ES
+ RET
+
+NUMLK_ON ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: INSTALL_INT_9
+;
+; Description:
+; Install our INT 9 driver.
+;
+; Input Registers:
+; DS - points to our data segment
+; BP - points to ES to find SHARED_DATA_AREA
+;
+; Output Registers:
+; DS - points to our data segment
+; AX, BX, DX, ES Trashed
+;
+; Logic:
+; Get existing vector
+; Install our vector
+; Return
+;
+
+INSTALL_INT_9 PROC
+
+ PUSH ES
+
+ MOV AH,35H ; Get int 9 vector
+ MOV AL,9
+ INT 21H ; Vector in ES:BX
+
+ PUSH ES ; Save segment ES:
+ PUSH CS
+ POP ES
+ MOV WORD PTR ES:SD.OLD_INT_9,BX ; Offset
+ POP AX ; Recover ES: segment
+ MOV WORD PTR ES:SD.OLD_INT_9+2,AX ; Segment
+
+ MOV AH,25H
+ MOV AL,9
+ MOV DX,OFFSET KEYB_INT_9 ; Let DOS know about our handler
+ INT 21H
+
+ POP ES
+ RET
+
+INSTALL_INT_9 ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: INSTALL_INT_9_NET
+;
+; Description:
+;
+;
+; Input Registers:
+; DS - points to our data segment
+; BP - points to ES to find SHARED_DATA_AREA
+;
+; Output Registers:
+; DS - points to our data segment
+; AX, BX, DX, ES Trashed
+;
+; Logic:
+; IF network is installed THEN
+; Let it know about our INT 9
+; Return
+;
+
+INSTALL_INT_9_NET PROC
+
+ PUSH ES
+
+ TEST SD.SYSTEM_FLAG,PC_NET ; TEST FOR PC_NETWORK
+ ; IF NOT THE NETWORK INSTALLED
+ JZ INSTALL_9_DONE_NET ; SKIP THE PC NETWORK HANDSHAKE
+
+ ; ES:BX TO CONTAIN INT 9 ADDR
+ MOV BX,OFFSET KEYB_INT_9
+ MOV AX,0B808H ; FUNCTION FOR PC NETWORK TO INSTALL
+ ; THIS ADDRESS FOR THEIR JUMP TABLE
+ INT 2FH ; TELL PC_NET TO USE MY ADDR TO CHAIN TO
+
+INSTALL_9_DONE_NET:
+ POP ES
+ RET
+
+INSTALL_INT_9_NET ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: INSTALL_INT_2F
+;
+; Description:
+; Install our INT 2F drivers.
+;
+; Input Registers:
+; DS - points to our data segment
+; BP - points to ES to find SHARED_DATA_AREA
+;
+; Output Registers:
+; DS - points to our data segment
+; AX, BX, DX, ES Trashed
+;
+; Logic:
+; Get existing vectors
+; Install our vectors
+; Return
+;
+;
+INSTALL_INT_2F PROC
+
+ MOV AH,35H ; Get int 2f vector
+ MOV AL,2FH
+ INT 21H ; Vector in ES:BX
+
+ PUSH ES ; Save segment ES:
+ PUSH CS
+ POP ES
+ MOV WORD PTR ES:SD.OLD_INT_2F,BX ; Offset
+ POP AX ; Recover ES: segment
+ MOV WORD PTR ES:SD.OLD_INT_2F+2,AX ; Segment
+
+ MOV AH,25H ; Set int 9 vector
+ MOV AL,2FH
+ MOV DX,OFFSET KEYB_INT_2F ; Vector in DS:DX
+ INT 21H
+
+
+ RET
+
+INSTALL_INT_2F ENDP
+
+;
+;
+; Module: REMOVE_INT_9
+;
+; Description:
+; Remove our INT 9 driver.
+;
+; Input Registers:
+; DS - points to our data segment
+; BP - points to ES to find SHARED_DATA_AREA
+;
+; Output Registers:
+; DS - points to our data segment
+; AX, BX, DX, ES Trashed
+;
+; Logic:
+; Get old vector
+; Install old vector
+; Return
+;
+
+REMOVE_INT_9 PROC
+
+ PUSH DS
+ PUSH ES
+ MOV ES,WORD PTR SHARED_AREA_PTR
+ MOV AX,WORD PTR ES:SD.OLD_INT_9+2 ; int 9 vector - segment
+ MOV DS,AX
+ MOV DX,WORD PTR ES:SD.OLD_INT_9 ; int 9 vector - offset
+
+ MOV AH,25H ; Set int 9 vector
+ MOV AL,9
+ INT 21H
+
+REMOVE_9_DONE:
+ POP ES
+ POP DS
+ RET
+
+REMOVE_INT_9 ENDP
+
+
+
+IDLANG_CHK PROC NEAR
+
+ mov ax,fb.kl_id_code ;get the id code from the table
+ cmp ax,[bp].id_parm ;compare it to value taken
+ jne end_match ;from the switch-- if found
+ cmp ALPHA,0 ;a keyboard code was specified
+ je a_match ;no lang & a match
+
+ mov ax,fb.kl_lang_code ;compare lang codes
+ cmp ax,[BP].LANGUAGE_PARM ;they are equal
+ je a_match
+
+ jmp short end_match ;if not found go check next
+ ;id for the same country
+
+a_match:
+ mov good_match,1 ;report the ids match
+
+end_match:
+ ret
+
+ IDLANG_CHK ENDP
+;*********************** CNS *******************;
+
+;**********************************SCAN_ID***********************;
+; New variables defined - NUM_ID,ADRSS_LANG,ID_PTR_SIZE,ID_FOUND
+;****************************************************************;
+
+
+SCAN_ID PROC NEAR
+
+ xor di,di ;clear di to set at the
+ ;beginning of KEYBSYS STRUCTURE
+
+
+ lea cx,[di].kh_num_ID+4 ; set number of bytes to read header
+
+ mov ah,3fh
+ int 21h
+ jnc VAL5ID
+ jmp short BAD_TAB ;bad table message
+
+ VAL5ID:
+
+ mov cx,SIGNATURE_LENGTH
+ mov di,offset SIGNATURE
+ mov si,offset FB.KH_SIGNATURE
+ repe CMPSB
+ je ID_SPECIFIED
+ jmp short BAD_TAB
+
+
+
+ ID_SPECIFIED:
+
+ mov ax,FB.KH_NUM_ID
+ mov NUM_ID,ax ; save # of IDs
+ mul ID_PTR_SIZE ; determine # of bytes to read
+ push ax ; save current # of bytes to read for
+ ; ID values only
+ mov ax,FB.KH_NUM_LANG ; add on lang data in table
+ mul LANG_PTR_SIZE ; data that comes before the ID data
+ mov cx,ax ; save that value for the size compare
+ mov PASS_LANG,cx
+ pop ax ; restore the info for # of ID bytes to read
+
+ add cx,ax ; add that value to get total in CX
+ mov TOTAL_SIZE,cx ; save the total size
+ cmp cx,size FILE_BUFFER
+ jbe READ_ID_TAB
+ jmp short BAD_TAB
+
+
+READ_ID_TAB:
+ mov dx,offset FILE_BUFFER
+ mov ah,3fh ;read language table from
+ int 21h ;keyb defn file
+ jnc READ_IDVAL
+ jmp short BAD_TAB
+
+READ_IDVAL:
+
+ mov cx,NUM_ID
+ mov di,offset FILE_BUFFER
+ add di,PASS_LANG
+
+SCAN_ID_TAB:
+
+ mov ax,[bp].ID_PARM
+ cmp [di].KP_ID_CODE,ax
+ je ID_HERE
+
+ add di,ID_PTR_SIZE
+ dec cx
+ jne SCAN_ID_TAB
+
+ jmp short FINALE
+
+BAD_TAB:
+ mov ERR4ID,1
+ jmp short FINALE
+
+ID_HERE:
+ mov ID_FOUND,1 ;reset ptr for
+ ;current country
+FINALE:
+ ret
+
+SCAN_ID ENDP
+
+;*******************************SCAN_ID END******;
+;
+; Module: BUILD_PATH
+;
+; Description:
+; Build the complete filename of the Keyboard Definition File
+;*************************************WGR*********************
+; and open the file.
+;+++++++++++++++++++++++++++++++++++++WGR+++++++++++++++++++++
+;
+; Input Registers:
+; DS - points to our data segment
+; ES - points to our data segment
+; BP - offset of parmeter list
+;
+; Output Registers:
+;************************************WGR**********************
+; CARRY CLEAR
+; AX = HANDLE
+; CARRY SET (ERROR)
+; NONE
+;++++++++++++++++++++++++++++++++++++WGR++++++++++++++++++++++
+; The complete filename will be available in FILE_NAME
+;
+; Logic:
+;
+; Determine whether path parameter was specified
+; IF length is zero THEN
+;****************************************WGR******************
+; Try to open file in ACTIVE directory
+; IF failed THEN
+; Try to open file in ARGV(0) directory
+; IF failed THEN
+; Try to open file in ROOT directory (for DOS 3.3 compatibility)
+; ENDIF
+; ENDIF
+; ENDIF
+; ELSE
+; Copy path from PSP to FILE_NAME memory area
+; Try to open USER SPECIFIED file
+;++++++++++++++++++++++++++++++++++++++++WGR++++++++++++++++++
+;
+;
+
+KEYBOARD_SYS DB '\KEYBOARD.SYS',00
+KEYB_SYS_ACTIVE DB 'KEYBOARD.SYS',00
+KEYB_SYS_LENG EQU 14
+KEYB_SYS_A_LENG EQU 13
+
+FILE_NAME DB 128 DUP(0)
+
+FILE_NOT_FOUND EQU 2
+PATH_NOT_FOUND EQU 3
+;
+; Program Code
+;
+
+BUILD_PATH PROC NEAR
+
+ CLD
+ MOV DI,OFFSET FILE_NAME ; Get the offset of the filename
+ MOV CX,[BP].PATH_LENGTH ; If path is specified then
+ jcxz APPEND_KEYB_SYS
+
+ MOV SI,[BP].PATH_OFFSET ; Get the offset of the path
+
+ REPE MOVSB ; Copy each char of the specified
+
+ MOV AX,3D00H ; Open the KEYBOARD.SYS file
+ MOV DX,OFFSET FILE_NAME
+ INT 21H
+ RET ; path into the filename location
+
+APPEND_KEYB_SYS:
+ MOV SI,OFFSET KEYB_SYS_ACTIVE ; copy name for active directory
+ MOV CX,KEYB_SYS_A_LENG ; to file name variable.
+ REPE MOVSB
+
+ MOV AX,3D00H ; try to open it.
+ MOV DX,OFFSET FILE_NAME
+ INT 21H
+
+ jnc opened_ok ; brif no error opening
+
+ cmp ax,PATH_NOT_FOUND ; was it path?
+ jz open_err_1
+ cmp ax,FILE_NOT_FOUND ; or file not found?
+ jnz open_err_2
+
+open_err_1:
+ CALL COPY_ARGV0 ; yes....try ARGV(0) directory.
+ MOV AX,3D00H
+ MOV DX,OFFSET FILE_NAME
+ INT 21H
+
+ jnc opened_ok ; done if open ok
+
+ cmp ax,PATH_NOT_FOUND ; if path or file not found, try root
+ jz open_err_3
+ cmp ax,FILE_NOT_FOUND
+ jnz open_err_2
+
+open_err_3:
+ MOV SI,OFFSET KEYBOARD_SYS ; try ROOT directory.
+ MOV DI,OFFSET FILE_NAME
+ MOV CX,KEYB_SYS_LENG
+ REPE MOVSB
+
+ MOV AX,3D00H
+ MOV DX,OFFSET FILE_NAME
+ INT 21H
+
+ jmp short opened_ok
+
+open_err_2:
+ stc ; some other error, set error flag
+
+opened_ok:
+
+ RET
+
+BUILD_PATH ENDP
+
+
+COPY_ARGV0 PROC
+
+ PUSH ES
+ PUSH DI
+ PUSH SI
+ PUSH CX
+
+ MOV DI,2CH ; Locate environment string
+ MOV ES,[DI]
+ XOR SI,SI
+
+carv0_loop:
+ cmp word ptr es:[si],0 ; find ARGV(0) string
+ jz carv0_loop_exit
+ inc si
+ jmp carv0_loop
+
+carv0_loop_exit:
+ ADD SI,4
+ LEA DI,FILE_NAME ; move string to work area
+
+carv0_loop1:
+ MOV AL,ES:[SI]
+ MOV [DI],AL
+ INC SI
+ INC DI
+ cmp byte ptr es:[si],0
+ jnz carv0_loop1
+
+carv0_loop2:
+ dec di
+ cmp byte ptr [di],'\' ; scan back to first character after "\"
+ jz carv0_loop2_exit
+ cmp byte ptr [di],0
+ jnz carv0_loop2
+
+carv0_loop2_exit:
+ INC DI
+ PUSH CS
+ POP ES
+ LEA SI,KEYB_SYS_ACTIVE ; copy in "KEYBOARD.SYS"
+ MOV CX,KEYB_SYS_A_LENG
+ REPE MOVSB
+
+ POP CX
+ POP SI
+ POP DI
+ POP ES
+ RET
+
+COPY_ARGV0 ENDP
+
+;
+;
+; Module: FIND_FIRST_CP
+;
+; Description:
+; Check the keyboard definition file for the first code page
+;
+; Input Registers:
+; DS - points to our data segment
+; ES - points to our data segment
+; BP - offset of parmeter list
+;
+; Output Registers:
+; NONE
+;
+; Logic:
+; Open the file
+; IF error in opening file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Save handle
+; Set address of buffer
+; READ header of Keyboard definition file
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Check signature for correct file
+; IF file signature is correct THEN
+; READ language table
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Use table to verify language parm
+; Set pointer values
+; IF code page was specified
+; READ language entry
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; READ first code page
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; RET
+;
+;
+
+FIND_FIRST_CP PROC NEAR
+
+ PUSH CX ; Save everything that
+ PUSH DX ; that will be changed
+ PUSH SI
+ PUSH DI
+
+ MOV BX,KEYBSYS_FILE_HANDLE ; Get handle
+ MOV DX,WORD PTR KEYBCMD_LANG_ENTRY_PTR ; LSEEK file pointer
+ MOV CX,WORD PTR KEYBCMD_LANG_ENTRY_PTR+2 ; to top of language entry
+ MOV AH,42H
+ MOV AL,0 ; If no problem with
+ INT 21H ; Keyb Def file Then
+ JNC FIND_FIRST_BEGIN
+ JMP short FIND_FIRST_CP_ERROR4
+
+FIND_FIRST_BEGIN:
+ MOV DI,AX
+ MOV CX,SIZE KEYBSYS_LANG_ENTRY-1 ; Set number
+ ; bytes to read header
+ MOV DX,OFFSET FILE_BUFFER
+ MOV AH,3FH ; Read language entry in
+ INT 21H ; keyboard definition file
+ JNC FIND_FIRST_VALID4 ; If no error in opening file then
+ JMP short FIND_FIRST_CP_ERROR4
+
+FIND_FIRST_VALID4:
+
+;************************** CNS *******;
+ xor ah,ah
+ MOV Al,FB.KL_NUM_CP
+;************************** CNS *******;
+
+ MUL CP_PTR_SIZE ; Determine # of bytes to read
+ MOV DX,OFFSET FILE_BUFFER ; Establish beginning of buffer
+ MOV CX,AX
+ CMP CX,SIZE FILE_BUFFER ; Make sure buffer is not to small
+ JBE FIND_FIRST_VALID5
+
+ JMP short FIND_FIRST_CP_ERROR4
+
+FIND_FIRST_VALID5:
+ MOV AH,3FH ; Read code page table from
+ INT 21H ; keyboard definition file
+ JNC FIND_FIRST_VALID6 ; If no error in opening file then
+ JMP short FIND_FIRST_CP_ERROR4
+
+FIND_FIRST_VALID6:
+ MOV CX,NUM_CP ; Number of valid codes
+ MOV DI,OFFSET FILE_BUFFER ; Point to correct word in table
+
+ MOV BX,[DI].KC_CODE_PAGE ; Get parameter
+ XOR AX,AX
+ JMP short FIND_FIRST_RETURN
+
+FIND_FIRST_CP_ERROR4:
+ MOV AX,4
+
+FIND_FIRST_RETURN:
+ POP DI
+ POP SI
+ POP DX
+ POP CX
+
+ RET
+
+FIND_FIRST_CP ENDP
+
+ .xlist
+MSG_SERVICES <MSGDATA>
+MSG_SERVICES <LOADmsg,DISPLAYmsg,CHARmsg,NUMmsg>
+MSG_SERVICES <KEYB.CL1>
+MSG_SERVICES <KEYB.CL2>
+MSG_SERVICES <KEYB.CLA>
+ .list
+;
+; Temp Shared Data Area
+; Contains data which is required by
+; both the resident and transient KEYB code.
+; All keyboard tables are stored in this area
+; Structures for this area are in file KEYBSHAR.INC
+;
+ db 'TEMP SHARED DATA'
+SD_SOURCE_PTR LABEL BYTE
+TEMP_SHARED_DATA SHARED_DATA_STR <>
+
+CODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybcmd.inc b/private/mvdm/dos/v86/cmd/keyb/keybcmd.inc
new file mode 100644
index 000000000..12d9a8f96
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybcmd.inc
@@ -0,0 +1,56 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBCMD.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;;
+;; Description:
+;; ------------
+;; External declarations for procedures in file KEYCMD.ASM.
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN KEYB_COMMAND :NEAR ;;
+ ;;
+ EXTRN KEYBSYS_FILE_HANDLE:WORD ;;
+ EXTRN CP_TAB_OFFSET:DWORD ;;
+ EXTRN STATE_LOGIC_OFFSET:DWORD ;;
+ EXTRN SYS_CODE_PAGE:WORD ;;
+ EXTRN KEYBCMD_LANG_ENTRY_PTR:DWORD ;;
+ EXTRN DESIG_CP_BUFFER:WORD ;;
+ EXTRN DESIG_CP_OFFSET:WORD ;;
+ EXTRN NUM_DESIG_CP:WORD ;;
+ EXTRN TB_RETURN_CODE:WORD ;;
+ EXTRN FILE_BUFFER:BYTE ;;
+;****************CNS****************************
+ EXTRN ID_PTR_SIZE:WORD ;;
+;****************CNS****************************
+ EXTRN LANG_PTR_SIZE:WORD ;;
+ EXTRN CP_PTR_SIZE:WORD ;;
+;****************CNS****************************
+ EXTRN NUM_ID:WORD ;;
+;****************CNS****************************
+ EXTRN NUM_LANG:WORD ;;
+ EXTRN NUM_CP:WORD ;;
+ EXTRN SHARED_AREA_PTR:DWORD ;;
+ EXTRN SD_SOURCE_PTR:BYTE ;;
+ EXTRN TEMP_SHARED_DATA:BYTE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+.LIST
+
+
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybcpsd.asm b/private/mvdm/dos/v86/cmd/keyb/keybcpsd.asm
new file mode 100644
index 000000000..c51eb50cd
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybcpsd.asm
@@ -0,0 +1,98 @@
+
+ PAGE ,132
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+;
+; File Name: KEYBCPSD.ASM
+; ----------
+;
+;
+; Description:
+; ------------
+; Copies the SHARED_DATA_AREA into a part of memory that
+; can be left resident. All relative pointers must already
+; be recalculated to this new position.
+; THIS FILE MUST BE THE LAST OF THE RESIDENT FILES WHEN KEYB IS LINKED.
+;
+;
+; Procedures Contained in This File:
+; ----------------------------------
+;
+; Include Files Required:
+; -----------------------
+; INCLUDE KEYBSHAR.INC
+; INCLUDE KEYBCMD.INC
+; INCLUDE KEYBTBBL.INC
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE ????????.ASM:
+; procedure - description???
+;
+; Linkage Information: Refer to file KEYB.ASM
+; --------------------
+;
+; Change History:
+; ---------------
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ PUBLIC SD_DEST_PTR
+ PUBLIC COPY_SD_AREA
+ PUBLIC SHARED_DATA
+
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBCMD.INC
+ INCLUDE KEYBTBBL.INC
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ ASSUME CS:CODE,DS:CODE
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: COPY_SD_AREA
+;
+; Description:
+;
+; Input Registers:
+;
+; Output Registers:
+; N/A
+;
+; Logic:
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SD EQU SHARED_DATA
+TSD EQU TEMP_SHARED_DATA
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+COPY_SD_AREA PROC NEAR
+
+ REP MOVS ES:BYTE PTR [DI],DS:[SI] ; Copy SHARED_DATA_AREA to
+ ; new part of memory
+
+ MOV BYTE PTR ES:SD.TABLE_OK,1 ; Activate processing flag
+ INT 21H ; Exit
+
+
+COPY_SD_AREA ENDP
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ db 'SHARED DATA'
+SD_DEST_PTR LABEL BYTE
+
+SHARED_DATA SHARED_DATA_STR <>
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybcpsd.inc b/private/mvdm/dos/v86/cmd/keyb/keybcpsd.inc
new file mode 100644
index 000000000..5ed88a21f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybcpsd.inc
@@ -0,0 +1,32 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBCPSD.INC
+;; ----------
+;;
+;;
+;; Description:
+;; ------------
+;; External declarations and equates for procedures in file
+;; KEYBCPSD.ASM
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN COPY_SD_AREA:NEAR ;;
+ ;;
+ EXTRN SD_DEST_PTR :BYTE ;;
+ EXTRN SHARED_DATA :BYTE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybdcl.inc b/private/mvdm/dos/v86/cmd/keyb/keybdcl.inc
new file mode 100644
index 000000000..c6b65fa04
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybdcl.inc
@@ -0,0 +1,52 @@
+
+
+
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBDCL.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; Common declarations for structures in procedures for KEYB.COM
+;;
+;; Change History:
+;; ---------------
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+PARM_LIST STRUC ;;
+;*******************CNS******************
+;*******************CNS******************
+ RET_CODE_1 DB 0 ;; \
+ RET_CODE_2 DB 0 ;; |
+ RET_CODE_3 DB 0 ;; |
+;*******************CNS******************
+ RET_CODE_4 DB 0 ;; |;AN000;
+;*******************CNS******************
+ LANGUAGE_PARM DW ? ;; } PARAMETER
+ CODE_PAGE_PARM DW ? ;; | LIST
+ PATH_OFFSET DW ? ;; |
+ PATH_LENGTH DW 0 ;; /
+;*******************CNS******************
+ ID_PARM DW ? ;AN000;
+;*******************CNS******************
+PARM_LIST ENDS ;;
+ ;;
+DESIG_CP_STRUC STRUC ;;
+ NUM_DESIGNATES DW ? ;;
+ NUM_FONTS DW ? ;;
+ NUM_HW_CPS DW ? ;;
+ DESIG_CP_ENTRY DW ? ;;
+DESIG_CP_STRUC ENDS ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybequ.inc b/private/mvdm/dos/v86/cmd/keyb/keybequ.inc
new file mode 100644
index 000000000..f00b4aef2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybequ.inc
@@ -0,0 +1,42 @@
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBEQU.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; Include file containing equates used by all KEYB modules.
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YES EQU 1 ;;
+NO EQU 0 ;;
+ ;;
+INT_2F_SUB_FUNC EQU 0ADH ;; our subfunction code for int 2f
+SD EQU SHARED_DATA ;;
+TSD EQU TEMP_SHARED_DATA;;
+ ;;
+DLY_15ms EQU 995 ;; 15mS DELAY = (15000/15.086)
+MOUSE_OBF EQU 00100000b ;; AUX DATA PRESENT BIT AT STATUS_PORT
+SCAN_CODE_CMD EQU 0F0h ;; SELECT SCAN CODE SET COMMAND TO KB
+ ;;
+ifdef NOT_NTVDM
+FILE_BUFFER_SIZE equ 300 ;; buffer used for reading keyboard.sys
+else
+FILE_BUFFER_SIZE equ 40 * 2 * 6 ;;
+endif
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi2f.asm b/private/mvdm/dos/v86/cmd/keyb/keybi2f.asm
new file mode 100644
index 000000000..f0dd06930
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi2f.asm
@@ -0,0 +1,238 @@
+ PAGE ,132
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+; File Name: KEYBI2F.ASM
+; ----------
+;
+; Description:
+; ------------
+; Contains Interrupt 2F handler.
+;
+; Procedures Contained in This File:
+; ----------------------------------
+; KEYB_INT_2F - Interupt 2F handler
+;
+; Include Files Required:
+; -----------------------
+; INCLUDE KEYBEQU.INC
+; INCLUDE KEYBSHAR.INC
+; INCLUDE KEYBMAC.INC
+; INCLUDE KEYBCMD.INC
+; INCLUDE KEYBCPSD.INC
+; INCLUDE KEYBI9C.INC
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE ????????.ASM:
+; procedure - description????????????????????????????????
+;
+; Linkage Information: Refer to file KEYB.ASM
+; --------------------
+;
+; Change History:
+; ---------------
+
+ INCLUDE KEYBEQU.INC
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBMAC.INC
+ INCLUDE KEYBCMD.INC
+ INCLUDE KEYBCPSD.INC
+ INCLUDE KEYBI9C.INC
+
+ PUBLIC KEYB_INT_2F
+
+ EXTRN ERROR_BEEP:NEAR
+
+
+ EXTRN NLS_FLAG_1:BYTE ;; (YST)
+
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ ASSUME CS:CODE,DS:nothing
+
+; Module: KEYB_INT_2F
+;
+; Description:
+;
+; Input Registers:
+; AH = 0ADH
+; AL = 80,81,82
+;
+; Output Registers:
+; N/A
+;
+; Logic:
+; IF AH = 0ADh THEN (this call is for us)
+; Set carry flag to 0
+; IF AL = 80 THEN
+; Get major and minor
+; Get SEG:OFFSET of SHARED_DATA_AREA
+;
+; IF AL = 81 THEN
+; Get FIRST_XLAT_PTR
+; FOR each table
+; IF code page requested = code page value at pointer THEN
+; Set INVOKED_CODE_PAGE
+; Set ACTIVE_XLAT_PTR
+; EXIT
+; ELSE
+; Get NEXT_SECT_PTR
+; NEXT table
+; IF no corresponding code page found THEN
+; Set carry flag
+;
+; IF AL = 82 THEN
+; IF BL = 00 THEN
+; Set COUNTRY_FLAG = 00
+; ELSE IF BL = 0FFH THEN
+; Set COUNTRY_FLAG = 0FFH
+; ELSE
+; Set carry flag
+; JMP to previous INT 2FH handler
+
+CP_QUERY EQU 80H
+CP_INVOKE EQU 81H
+CP_LANGUAGE EQU 82H
+
+
+GET_KB_MODE EQU 83H ;; ONLY FOR RUSSIAN (YST)
+SET_KB_MODE EQU 84H ;; ONLY FOR RUSSIAN
+
+
+VERSION_MAJOR EQU 01H
+VERSION_MINOR EQU 00H
+
+CARRY_FLAG EQU 01H
+
+KEYB_INT_2F PROC
+
+ cmp ah,INT_2F_SUB_FUNC ; is it for us?
+ jz our_i2f_interrupt
+
+i2f_chain:
+
+; Under DOS 5, it is always safe for us to assume that there was
+; an existing Int2f vector for us to continue to.
+
+ jmp cs:sd.old_int_2f
+
+our_i2f_interrupt:
+
+ push bp
+ mov bp,sp
+ and word ptr [bp]+6,not carry_flag ; pre-clear carry
+ call do_our_i2f ; pass bp.6 -> flags to functions
+
+ pop bp
+ jmp i2f_chain
+
+do_our_i2f:
+ CMP AL,CP_QUERY ; Q..query CP?
+ JNE INT_2F_CP_INVOKE ; N..next
+
+ MOV AX,-1 ; Y..process query
+ mov bx,(version_major shl 8) + version_minor
+ MOV DI,OFFSET SD
+ PUSH CS
+ POP ES
+ ret
+
+INT_2F_CP_INVOKE:
+ CMP AL,CP_INVOKE ; Q..invoke CP?
+ JNE INT_2F_CP_LANGUAGE ; N..next
+
+ MOV SI,cs:SD.FIRST_XLAT_PTR ; Get FIRST_XLAT_PTR
+
+INT_2F_NEXT_SECTION:
+ CMP SI,-1
+ JE INT_2F_ERROR_FLAG
+
+ cmp bx,cs:[SI].XS_CP_ID ; is this the code page we want?
+ JNE INT_2F_CP_INVOKE_CONT1
+
+ MOV cs:SD.ACTIVE_XLAT_PTR,SI ; IF Yes, Set the ACTIVE_XLAT_PTR
+ MOV cs:SD.INVOKED_CP_TABLE,BX ; record new code page
+ ret
+
+INT_2F_CP_INVOKE_CONT1:
+ MOV SI,cs:[SI].XS_NEXT_SECT_PTR ; Chain to NEXT_SECT_PTR
+ JMP INT_2F_NEXT_SECTION ; NEXT_SECTION
+
+INT_2F_ERROR_FLAG:
+ mov ax,1 ; ***??? why do we return error code
+; ; only in this case?????
+i2f_reterror:
+ or word ptr [bp]+6,carry_flag ; set carry to int2f caller
+ ret
+
+INT_2F_CP_LANGUAGE:
+ CMP AL,CP_LANGUAGE ; Q..Set default language??
+
+
+ jnz int2f_ret ; don't handle undefined functions
+
+; Now, if BL=0 or 0ffh, we'll set COUNTRY_FLAG to that value.
+
+ inc bl
+ cmp bl,2 ; set carry if bl is legal
+ dec bl ; restore old value, preserve carry
+ jnc i2f_reterror ; done if error
+
+ MOV cs:COUNTRY_FLAG,BL ; Set COUNTRY_FLAG to 0 or 0ffh
+;; ============================================================
+;; ONLY FOR RUSSIAN KEYBOARD !!!!!
+;; ============================================================
+ jmp short int2f_ret
+
+INT_2F_KB_MODE_ERROR_FLAG: ;; ==== (YST) === ;;
+INT_2F_GET_KB_MODE: ;; (YST)-----------------------------
+ CMP AL,GET_KB_MODE ;; Q..Get keyboard mode? |
+ JNE INT_2F_SET_KB_MODE ;; N..next |
+; PUSH DS ;;
+; PUSH BX ;;
+; PUSH CX ;;
+; PUSH SI ;;
+; push cs
+; pop ds
+ XOR AX,AX ;; |
+ OR AL,cs:COUNTRY_FLAG ;; Q..CTRL+ALT+F1 was pressed? |
+ JZ INT_2F_GET_KB_MODE_DONE ;; Y..return AX = 0 |
+ ;; Q..is current driver switchable? |
+ TEST WORD PTR CS:SD.SPECIAL_FEATURES,SWITCHABLE ;; |
+ JZ INT_2F_GET_KB_MODE_DONE ;; N..return AX = 0FFH |
+ MOV AL,cs:NLS_FLAG_1 ;; Y..return <keyb NL mode+1> |------------------\
+ AND AL,1 ;; | if RUS_MODE = 1 | > S
+ INC AX ;; |------------------/ A
+ ;; |
+INT_2F_GET_KB_MODE_DONE: ;; For DOS 5 normal exit |
+ RET ;; |
+ ;; |
+INT_2F_SET_KB_MODE: ;; |
+ CMP AL,SET_KB_MODE ;; Q..Set keyboard mode? |
+ JNE int2f_ret ;; N..next |
+ ;; |
+ MOV BH,cs:NLS_FLAG_1 ;; |
+ ;; |
+ TEST BL,0FEH ;; Q..BL equ 0 or 1? |---------------------
+ JNZ INT_2F_KB_MODE_ERROR_FLAG;; N..Set CARRY flag | |
+ AND BH,0FEH ;; Y..Set NL mode | if RUS_MODE = 1 |
+ OR BH,BL ;; | |
+ ;; |---------------------
+ ;; |
+ MOV cs:NLS_FLAG_1,BH ;; Store this value |
+ ;; |
+ ;; |
+ ;; |
+ ;; (YST)-----------------------------
+
+int2f_ret:
+ ret
+KEYB_INT_2F ENDP
+
+CODE ENDS
+ END
+
+;; ========================================
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi2f.inc b/private/mvdm/dos/v86/cmd/keyb/keybi2f.inc
new file mode 100644
index 000000000..26ba0071e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi2f.inc
@@ -0,0 +1,28 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBI2F.INC
+;; ----------
+;;
+;; Description:
+;; ------------
+;; External declarations and equates for procedures in file
+;; KEYBI2F.ASM
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN KEYB_INT_2F:NEAR ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi9.asm b/private/mvdm/dos/v86/cmd/keyb/keybi9.asm
new file mode 100644
index 000000000..83f152886
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi9.asm
@@ -0,0 +1,694 @@
+ PAGE ,132
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+; File Name: KEYBI9.ASM
+; ----------
+;
+; Description:
+; ------------
+; Converts scan codes to ASCII for non-US keyboards.
+; This orutine uses the tables loaded into the SHARED_DATA_AREA
+; from KEYBOARD.SYS by the KEYB_COMMAND module.
+;
+;
+; Procedures Contained in This File:
+; ----------------------------------
+; KEYB_STATE_PROCESSOR - Scan to ASCII translator.
+;
+; External Procedure References:
+; ------------------------------
+; None.
+;
+; Linkage Information: Refer to file KEYB.ASM
+; --------------------
+;
+; Change History:
+; ---------------
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ INCLUDE KEYBEQU.INC
+ INCLUDE DSEG.INC ; System data segments
+ INCLUDE POSTEQU.INC ; System equates
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBI2F.INC
+ INCLUDE KEYBI9C.INC
+ INCLUDE KEYBCPSD.INC
+ INCLUDE KEYBCMD.INC
+
+ PUBLIC KEYB_STATE_PROCESSOR
+
+
+ PUBLIC FLAGS_TO_TEST ;; (YST)
+ PUBLIC NLS_FLAG_1 ;; (YST)
+
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ ASSUME CS:CODE,DS:CODE
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: KEYB_STATE_PROCESSOR
+;
+; Description:
+; Convert scan to ASCII using the tables loaded into the
+; SHARED_DATA_AREA. Conversion is directed by the STATE LOGIC
+; commands contained in the SHARED_DATA_AREA. This routine
+; interprets those commands.
+;
+; Input Registers:
+; N/A
+;
+; Output Registers:
+; N/A
+;
+; Logic:
+; Enable interrupts
+; Save registers
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+BREAK_CODE EQU 80H
+
+HOT_KEY_ACTIVE DB 0 ; 1 if hot key is active
+
+
+ ; These are copies of the BIOS FLAGS
+FLAGS_TO_TEST LABEL BYTE ; KB_FLAG, KB_FLAG_1,2,3
+KB_SHADOW_FLAGS DB NUM_BIOS_FLAGS DUP(0)
+EXT_KB_FLAG DB 0 ; Extended KB Flag for shift states
+NLS_FLAG_1 DB 0 ; NLS Flags for dead key etc
+NLS_FLAG_2 DB 0 ; .
+
+SAVED_NLS_FLAGS DB 0,0 ; Saved copy of the NLS flags
+
+OPTION_BYTE DB 0 ; Set by OPTION command
+
+KB_FLAG_PTRS DW OFFSET KB_FLAG ; These are pointers to the BIOS flags
+ DW OFFSET KB_FLAG_1 ; we must test
+ DW OFFSET KB_FLAG_2
+ DW OFFSET KB_FLAG_3
+
+XLAT_TAB_PTR DW 0 ; pointer to xlat tables for cur state
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+NEST_LEVEL DB 0
+PROCESS_LEVEL DB 0
+TAKE_ELSE DB 0
+BUSY_FLAG DB 0 ; Flag to prevent re-entry
+
+CMD_JUMP_TABLE LABEL WORD
+ DW OFFSET IFF_PROC ; CODE 0
+ DW OFFSET ANDF_PROC ; 1
+ DW OFFSET ELSEF_PROC ; 2
+ DW OFFSET ENDIFF_PROC ; 3
+ DW OFFSET XLATT_PROC ; 4
+ DW OFFSET OPTION_PROC ; 5
+ DW OFFSET SET_FLAG_PROC ; 6
+ DW OFFSET PUT_ERROR_PROC ; 7
+ DW OFFSET IFKBD_PROC ; 8
+ DW OFFSET GOTO_PROC ; 9
+ DW OFFSET BEEP_PROC ; A
+ DW OFFSET RESET_NLS_PROC ; B
+ DW OFFSET RESET_NLS1_PROC ; C
+ DW OFFSET UNKNOWN_COMMAND ; D
+ DW OFFSET UNKNOWN_COMMAND ; E
+ DW OFFSET UNKNOWN_COMMAND ; F
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+KEYB_STATE_PROCESSOR PROC NEAR
+
+ TEST byte ptr CS:SD.TABLE_OK,1
+ JNZ WE_HAVE_A_TABLE
+ CLC ; BACK TO US INT 9
+ RET
+WE_HAVE_A_TABLE:
+
+ PUSH DS ; save DS
+ PUSH ES ; save ES
+ PUSH AX ; save scan code for caller
+ PUSH BX ; save shift states for caller
+
+ PUSH CS
+ POP DS ; DS = our seg
+ MOV BX,DATA
+ MOV ES,BX ; addressability to BIOS data
+
+
+ CMP COUNTRY_FLAG,0FFH ; Q..country mode?
+ JE INIT_STATE_PROCESSING ; Y..continue
+ JMP GOTO_BIOS ; N..exit
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; -------STATE SECTION PROCESSING-------
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+INIT_STATE_PROCESSING:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Set NLS shift flags EITHER_SHIFT, EITHER_ALT, EITHER_CTRL
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ ; Q..in shift state?
+ TEST ES:KB_FLAG,RIGHT_SHIFT+LEFT_SHIFT
+ JNZ IN_SHIFT_STATE ; Y..go set bit
+ AND EXT_KB_FLAG,NOT EITHER_SHIFT ; N..clear bit
+ JMP SHORT TEST_CTL
+IN_SHIFT_STATE:
+ OR EXT_KB_FLAG,EITHER_SHIFT
+TEST_CTL:
+ TEST ES:KB_FLAG,CTL_SHIFT ; Q..in control state?
+ JNZ IN_CTL_STATE ; Y..go set bit
+ TEST ES:KB_FLAG_3,R_CTL_SHIFT ; Q..how bout the right ctl?
+ JNZ IN_CTL_STATE ; Y..go set the bit
+ AND EXT_KB_FLAG,NOT EITHER_CTL ; N..clear the bit
+ JMP SHORT TEST_ALT
+IN_CTL_STATE:
+ OR EXT_KB_FLAG,EITHER_CTL
+TEST_ALT:
+ TEST ES:KB_FLAG,ALT_SHIFT ; Q..in alt state?
+ JNZ IN_ALT_STATE ; Y..go set bit
+ TEST ES:KB_FLAG_3,R_ALT_SHIFT ; Q..how bout the right alt?
+ JNZ IN_ALT_STATE ; Y..go set the bit
+ AND EXT_KB_FLAG,NOT EITHER_ALT ; N..clear the bit
+ JMP SHORT COPY_FLAGS
+IN_ALT_STATE:
+ OR EXT_KB_FLAG,EITHER_ALT
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Copy BIOS KB flags from BIOS data seg into the
+; FLAGS_TO_TEST structure.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+COPY_FLAGS:
+ MOV CX,NUM_BIOS_FLAGS
+ xor si,si ; pointers to the BIOS flags
+ xor di,di ; create shadow copies
+MOVE_NEXT_FLAG:
+ MOV BX,KB_FLAG_PTRS[SI] ; pointer to next flag
+ MOV AL,ES:[BX] ; flag in AL
+ MOV KB_SHADOW_FLAGS[DI],AL ; save it in the shadow table
+ INC DI
+ INC SI
+ INC SI
+ LOOP MOVE_NEXT_FLAG
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Interpret State Logic Commands
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PROCESS_STATES:
+ MOV OPTION_BYTE,0 ; clear options
+ MOV SI,SD.LOGIC_PTR
+ LEA SI,[SI].SL_LOGIC_CMDS
+NEXT_COMMAND:
+ XOR BH,BH ; ????
+ MOV BL,[SI] ; command byte in BL
+ SHR BL,1
+ SHR BL,1
+ SHR BL,1
+ SHR BL,1 ; ISOLATE COMMAND CODE
+ SHL BL,1 ; command code * 2
+ JMP CMD_JUMP_TABLE[BX] ; go process command
+UNKNOWN_COMMAND:
+ JMP FATAL_ERROR ; bad news
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+IFKBD_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE IFKBD_DONE ; N..don't process
+
+ MOV AX,[SI+1] ; Keyboard Type Flag
+
+ TEST SD.KEYB_TYPE,AX ; Q..are we the right system?
+ JNZ IFKBD_TEST_OK ; Y..
+IFKBD_TEST_FAILED:
+ MOV TAKE_ELSE,YES ; test failed - take ELSE
+ JMP SHORT IFKBD_DONE
+IFKBD_TEST_OK:
+ INC PROCESS_LEVEL ; process commands within IF
+ MOV TAKE_ELSE,NO
+IFKBD_DONE:
+ INC NEST_LEVEL ; IFKBD increments nest level
+ INC SI ; bump past IFKBD
+ INC SI
+ INC SI
+ JMP NEXT_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PUT_ERROR_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE PUT_ERROR_DONE ; N..don't process
+ MOV DI,SD.ACTIVE_XLAT_PTR ; pointer to active Xlat Section
+ MOV AL,[SI+1] ; state id in AL
+ CALL PUT_ERROR ; check active section
+ JC PUT_ERROR_DONE ; carry set if translation found
+ MOV DI,SD.COMMON_XLAT_PTR ; check common Xlat Section
+ MOV AL,[SI+1] ; state id for XLATT in AL
+ CALL PUT_ERROR
+
+PUT_ERROR_DONE:
+ INC SI
+ INC SI
+ JMP NEXT_COMMAND
+
+PUT_ERROR PROC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Search for a state whose ID matches the ID
+; on the PUT_ERROR command
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ CLC
+ LEA DI,[DI].XS_FIRST_STATE ; point to first state in section
+PE_NEXT_STATE:
+ CMP [DI].XS_STATE_LEN,0 ; Q..out of states?
+ JE PE_EXIT ; Y..exit
+ CMP AL,[DI].XS_STATE_ID ; Q..is this the requested state?
+ JE PE_STATE_MATCH
+ ADD DI,[DI].XS_STATE_LEN ; N..check next state
+ JMP SHORT PE_NEXT_STATE
+
+PE_STATE_MATCH:
+ MOV AX,[DI].XS_ERROR_CHAR ; get error char in AX
+ CALL BUFFER_FILL
+ STC ; indicate that we found the state
+PE_EXIT:
+ RET
+
+PUT_ERROR ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+GOTO_BIOS:
+ CLC ; clear carry flag indicating
+ POP BX ; we should continue INT 9
+ POP AX ; processing
+ POP ES
+ POP DS
+ RET
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+IFF_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE IFF_DONE ; N..don't process IFF
+ MOV BL,[SI] ; command byte
+ AND BL,FLAG_ID_BITS ; isolate flag id
+ XOR BH,BH
+ MOV AL,FLAGS_TO_TEST[BX] ; flag in AL
+ TEST BYTE PTR[SI],NOT_TEST ; Q..is this a NOT test?
+ JNZ ITS_A_NOT
+ TEST AL,[SI]+1 ; Y..check for bit set
+ JNZ IFF_MATCH
+ JZ IFF_NO_MATCH
+ITS_A_NOT:
+ TEST AL,[SI]+1 ; Y..check for bit clear
+ JZ IFF_MATCH
+IFF_NO_MATCH:
+ MOV TAKE_ELSE,YES ; flag test failed - take ELSE
+ JMP SHORT IFF_DONE
+IFF_MATCH:
+ INC PROCESS_LEVEL ; process commands within IF
+ MOV TAKE_ELSE,NO
+
+IFF_DONE:
+ INC NEST_LEVEL ; IFF increments nest level
+ INC SI ; bump past IFF
+ INC SI
+ JMP NEXT_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ELSEF_PROC:
+ MOV AL,PROCESS_LEVEL
+ CMP AL,NEST_LEVEL ; Q..nest level = process level?
+ JNE CHECK_TAKE_ELSEF ; N..check for take_else
+ DEC PROCESS_LEVEL ; Y..we just finished the "IF" block
+ JMP short ELSEF_DONE ; so we are finished with IFF/ELSEF
+CHECK_TAKE_ELSEF:
+ CMP TAKE_ELSE,YES ; Q..are we scanning for ELSE?
+ JNE ELSEF_DONE ; N..done
+ DEC NEST_LEVEL ; ELSEF itself is back a level
+ CMP AL,NEST_LEVEL ; Q..nest level = process level?
+ JNE NOT_THIS_ELSEF ; N..this else is not the one
+ INC PROCESS_LEVEL ; Y..process ELSEF block
+ MOV TAKE_ELSE,NO ; reset
+NOT_THIS_ELSEF:
+ INC NEST_LEVEL ; stuff within the ELSEF is up a level
+
+ELSEF_DONE:
+ INC SI ; bump past ELSEF
+ JMP NEXT_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ENDIFF_PROC:
+ MOV AL,PROCESS_LEVEL
+ CMP AL,NEST_LEVEL ; Q..nest level = process level?
+ JNE ENDIFF_DONE ; N..don't adjust process level
+ DEC PROCESS_LEVEL ; Y..we just finished the IF/ELSE
+ENDIFF_DONE:
+ DEC NEST_LEVEL ; ENDIF decrements nest level
+ INC SI ; bump past ENDIF
+ JMP NEXT_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Translations may be in the Common or Specific
+; Sections. Search the Specific section first
+; then the common section.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+XLATT_PROC:
+ MOV AL,PROCESS_LEVEL
+ CMP AL,NEST_LEVEL ; Q..nest level = process level?
+ JNE XLATT_DONE ; N..next command
+ MOV DI,SD.ACTIVE_XLAT_PTR ; pointer to active Xlat Section
+ MOV AL,[SI+1] ; state id for XLATT in AL
+ CALL TRANSLATE ; check active section
+ JC XLATT_FOUND ; carry set if translation found
+ MOV DI,SD.COMMON_XLAT_PTR ; check common Xlat Section
+ MOV AL,[SI+1] ; state id for XLATT in AL
+ CALL TRANSLATE
+ JNC XLATT_DONE
+XLATT_FOUND:
+ OR EXT_KB_FLAG,SCAN_MATCH ; set flag indicating scan matched
+ TEST OPTION_BYTE,EXIT_IF_FOUND ; Q..exit
+ JZ XLATT_DONE
+ JMP EXIT ; Y..BYE
+
+XLATT_DONE:
+ INC SI
+ INC SI
+ JMP NEXT_COMMAND
+
+TRANSLATE PROC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Search for a state whose ID matches the ID
+; on the XLATT command
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ CLC
+ LEA DI,[DI].XS_FIRST_STATE ; point to first state in section
+TP_NEXT_STATE:
+ CMP [DI].XS_STATE_LEN,0 ; Q..out of states?
+ JE TP_EXIT ; Y..exit
+ CMP AL,[DI].XS_STATE_ID ; Q..is this the requested state?
+ JE TP_STATE_MATCH
+ ADD DI,[DI].XS_STATE_LEN ; N..check next state
+ JMP SHORT TP_NEXT_STATE
+
+TP_STATE_MATCH:
+ AND EXT_KB_FLAG,NOT SCAN_MATCH ; reset flag before search
+ PUSH SI ; save pointer to next command
+ LEA SI,[DI].XS_FIRST_TAB ; point to first xlat table
+ MOV XLAT_TAB_PTR,SI ; start of XLAT tables
+ MOV AL,SCAN_CODE ; restore incoming scan code
+ JMP SHORT NEXT_XLAT_TAB
+TP_DONE: ; return here from XLAT
+ POP SI
+TP_EXIT:
+ RET
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Check xlate tables for matching scan code
+; 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+NEXT_XLAT_TAB:
+ MOV SI,XLAT_TAB_PTR ; pointer to xlat tables
+ CMP [SI].XLAT_TAB_SIZE,0 ; Q..any more xlat tables?
+ JNE PROCESS_XLAT_TAB ; Y..check um
+ JMP TP_DONE ; N..done
+PROCESS_XLAT_TAB:
+ MOV DL,[SI].XLAT_OPTIONS ; save translate options IN DL
+ MOV BX,[SI].XLAT_TAB_SIZE ; Y..calc pointer to next xlat tab
+ ADD BX,SI
+ MOV XLAT_TAB_PTR,BX ; pointer to next xlat tab
+ TEST DL,TYPE_2_TAB ; Q..is this a type 2 table?
+ JZ TYPE_1_LOOKUP ; N..go do table lookup
+TYPE_2_SEARCH: ; Y..search table
+ XOR CH,CH
+ MOV CL,[SI].XLAT_NUM ; number of xlat entries
+ MOV BX,DEFAULT_TAB_2_ENT_SZ ; default entry size
+ TEST DL,ASCII_ONLY+ZERO_SCAN ; Q..are buffer entries ASCII only?
+ JZ NEXT_TAB_2_ENTRY ; N..continue
+ MOV BX,ASC_ONLY_TAB_2_ENT_SZ ; Y..set size in BX
+NEXT_TAB_2_ENTRY: ; entry size is in BX
+ jcxz next_xlat_tab ; brif last entry
+ CMP AL,[SI].XLAT_SCAN ; Q..scan match?
+ JE FOUND_TAB_2_ENTRY ; Y..go create buffer entry
+ ADD SI,BX ; point to next entry
+ LOOP NEXT_TAB_2_ENTRY
+ JMP SHORT NEXT_XLAT_TAB
+FOUND_TAB_2_ENTRY: ; Q..set scan code to 0?
+ MOV AH,AL ; default scan code in AH
+ MOV AL,[SI].XLAT_2_BUF_ENTRY ; ASCII code from table in AL
+ TEST DL,ASCII_ONLY+ZERO_SCAN ; Q..are buffer entries ASCII only?
+ JNZ BUFFER_ENTRY_READY ; Y..buffer entry is ready
+ MOV AH,[SI].XLAT_2_BUF_ENTRY+1 ; N..scan code from table as well
+ JMP SHORT BUFFER_ENTRY_READY ; go put entry in buffer
+
+TYPE_1_LOOKUP:
+ CMP AL,[SI].XLAT_SCAN_LO ; Q..is scan in range of this table?
+ JB NEXT_XLAT_TAB ; N..next table
+ CMP AL,[SI].XLAT_SCAN_HI ; Q..is scan in range of this table?
+ JA NEXT_XLAT_TAB ; N..next table
+ SUB AL,[SI].XLAT_SCAN_LO ; convert scan code to xlat index
+ TEST DL,ASCII_ONLY+ZERO_SCAN ; Q..ASCII only in xlat ?
+ JZ TWO_BYTE_LOOKUP ; N..go do 2-byte lookup
+ LEA BX,[SI].XLAT_1_BUF_ENTRY ; Y..do 1-byte lookup
+ XLAT [SI].XLAT_1_BUF_ENTRY ; ASCII code in AL
+ MOV AH,SCAN_CODE ; SCAN in AH
+ JMP SHORT BUFFER_ENTRY_READY ; go put entry in buffer
+TWO_BYTE_LOOKUP:
+ MOV BL,2 ; multiply scan index
+ MUL BL ; by two
+ MOV BX,AX ; real index in BX
+ MOV AX,WORD PTR [SI].XLAT_1_BUF_ENTRY[BX] ; get 2-byte buffer entry
+ ; AL=ASCII AH=SCAN
+BUFFER_ENTRY_READY:
+ TEST DL,ZERO_SCAN ; Q..set scan part to zero?
+ JZ NO_ZERO_SCAN ; N..
+ XOR AH,AH ; scan = 0
+NO_ZERO_SCAN:
+ CALL BUFFER_FILL ; go put entry in buffer
+ STC ; indicate translation found
+ JMP TP_DONE
+
+TRANSLATE ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+OPTION_PROC:
+ MOV AL,PROCESS_LEVEL
+ CMP AL,NEST_LEVEL ; Q..nest level = process level?
+ JNE DONE_OPTION ; N..done
+ MOV AL,[SI]+1 ; mask in AL
+ TEST BYTE PTR[SI],NOT_TEST ; Q..is this a NOT?
+ JNZ AND_MASK
+ OR OPTION_BYTE,AL ; N..OR in the mask bits
+ JMP short DONE_OPTION
+AND_MASK:
+ NOT AL
+ AND OPTION_BYTE,AL ; Y..AND out the mask bits
+DONE_OPTION:
+ INC SI
+ INC SI
+ JMP NEXT_COMMAND
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+RESET_NLS_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE RN_DONE ; N..don't process
+ MOV NLS_FLAG_1,0
+ MOV NLS_FLAG_2,0
+
+
+ MOV COPY_NLS1_FLAG,0 ;; (YST)
+
+
+RN_DONE:
+ INC SI
+ JMP NEXT_COMMAND
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; This PROC only for Yugoslavian (Cyrillic)
+;; keyboard from CRAZY IBM (YST)
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+RESET_NLS1_PROC: ;;
+ MOV AL,NEST_LEVEL ;;
+ CMP AL,PROCESS_LEVEL ;; Q..nest level = process level?
+ JNE RN1_DONE ;; N..don't process
+ MOV NLS_FLAG_1, 1 ;;
+ MOV NLS_FLAG_2,0 ;;
+ MOV COPY_NLS1_FLAG, 1 ;; (YST)
+RN1_DONE: ;;
+ INC SI ;;
+ JMP NEXT_COMMAND ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+BEEP_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE BP_DONE ; N..don't process
+ MOV BEEP_PENDING,YES ; set beep pending flag. the beep
+ ; will be done just before iret
+BP_DONE:
+ INC SI
+ JMP NEXT_COMMAND
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+GOTO_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE GOTO_DONE ; N..don't process
+ MOV BL,[SI] ; command byte in BL
+ AND BL,NOT COMMAND_BITS ; remove command code
+ OR BL,BL ; Q..goto label?
+ JZ GOTO_LABEL ; Y..go jump
+ CMP BL,EXIT_INT_9_FLAG ; Q..SPECIAL - Exit Int 9?
+ JNE NOT_EXIT_INT_9 ; N..
+ JMP EXIT ; Y..bye bye
+NOT_EXIT_INT_9:
+ CMP BL,EXIT_STATE_LOGIC_FLAG ; Q..SPECIAL - Exit State Logic?
+ JNE NOT_EXIT_S_L ; N..
+ JMP GOTO_BIOS ; Y..goto bios
+NOT_EXIT_S_L:
+ JMP FATAL_ERROR ; garbage in that command
+GOTO_LABEL:
+ ADD SI,[SI]+1 ; bump by relative offset
+ MOV PROCESS_LEVEL,0 ; reset process and nest level
+ MOV NEST_LEVEL,0
+GOTO_DONE:
+ ADD SI,3 ; bump to next command
+ JMP NEXT_COMMAND
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ANDF_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE ANDF_DONE ; N..don't process ANDF
+ MOV BL,[SI] ; command byte
+ AND BL,FLAG_ID_BITS ; isolate flag id
+ XOR BH,BH
+ MOV AL,FLAGS_TO_TEST[BX] ; flag in AL
+ TEST BYTE PTR[SI],NOT_TEST ; Q..is this a NOT test?
+ JNZ ANDF_NOT
+ TEST AL,[SI]+1 ; Y..check for bit set
+ JNZ ANDF_DONE ; if set then remain in IFF
+ JZ ANDF_NO_MATCH
+ANDF_NOT:
+ TEST AL,[SI]+1 ; Y..check for bit clear
+ JZ ANDF_DONE ; if clear then remain in IFF
+ANDF_NO_MATCH:
+ MOV TAKE_ELSE,YES ; flag test failed - take ELSE
+ DEC PROCESS_LEVEL ; IFF would have inc'd - so dec
+ANDF_DONE:
+ INC SI ; bump past ANDF
+ INC SI
+ JMP NEXT_COMMAND
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; SET_FLAG Command.
+; Flag Table must be in the Common Section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SET_FLAG_PROC:
+ MOV AL,NEST_LEVEL
+ CMP AL,PROCESS_LEVEL ; Q..nest level = process level?
+ JNE SF_DONE ; N..don't process
+
+ MOV DI,SD.COMMON_XLAT_PTR ; check common Xlat Section
+ MOV AL,[SI+1] ; state id in AL
+ LEA DI,[DI].XS_FIRST_STATE ; point to first state in section
+SF_NEXT_STATE:
+ CMP [DI].XS_STATE_LEN,0 ; Q..out of states?
+ JE SF_DONE ; Y..exit
+ CMP AL,[DI].XS_STATE_ID ; Q..is this the requested state?
+ JE SF_STATE_MATCH
+ ADD DI,[DI].XS_STATE_LEN ; N..check next state
+ JMP SHORT SF_NEXT_STATE
+
+SF_STATE_MATCH:
+ AND EXT_KB_FLAG,NOT SCAN_MATCH ; reset flag before search
+ PUSH SI ; save pointer to next command
+ LEA SI,[DI].XS_FIRST_TAB ; point to table
+ MOV AL,SCAN_CODE ; restore incoming scan code
+ MOV CX,[SI] ; number of entries
+ jcxz sf_restore ; done if no entries
+ INC SI ; Y..Bump to first entry
+ INC SI
+NEXT_SF_ENTRY:
+ CMP AL,[SI] ; Q..scan match?
+ JE FOUND_SF_ENTRY ; Y..go set flag
+ ADD SI,3 ; point to next entry
+ LOOP NEXT_SF_ENTRY
+ JMP SHORT SF_RESTORE ; no match found
+FOUND_SF_ENTRY:
+ MOV NLS_FLAG_1,0 ; clear all NLS bits
+ MOV NLS_FLAG_2,0
+ MOV BL,[SI]+1 ; flag id in BX
+ XOR BH,BH
+ MOV AL,[SI]+2 ; mask in AL
+ OR FLAGS_TO_TEST[BX],AL ; set the bit
+ OR EXT_KB_FLAG,SCAN_MATCH ; set flag indicating scan matched
+
+
+ MOV AL,NLS_FLAG_1 ;; copy NLS_FLAG_1 to the (YST)
+ MOV COPY_NLS1_FLAG,AL ;; public place (YST)
+
+
+ TEST OPTION_BYTE,EXIT_IF_FOUND ; Q..exit
+ JZ SF_RESTORE
+ POP SI
+ JMP short EXIT
+SF_RESTORE:
+ POP SI
+SF_DONE:
+ INC SI ; bump past command
+ INC SI
+ JMP NEXT_COMMAND
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Fatal Error routine. Come here when
+; we have a critical error such as an
+; invalid State Logic Command.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FATAL_ERROR:
+ JMP SHORT EXIT ; end the int 9 processing
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Exit point.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+EXIT:
+ MOV BUSY_FLAG,NO
+ STC ; indicate we should end INT 9
+ POP BX ; processing
+ POP AX
+ POP ES
+ POP DS
+ RET
+
+KEYB_STATE_PROCESSOR ENDP
+
+
+
+CODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi9.inc b/private/mvdm/dos/v86/cmd/keyb/keybi9.inc
new file mode 100644
index 000000000..e709f9927
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi9.inc
@@ -0,0 +1,34 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBI9.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; External declarations and equates for procedures in file
+;; KEYBI9.ASM
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN KEYB_STATE_PROCESSOR:NEAR
+
+ EXTRN FLAGS_TO_TEST:BYTE ;; (YST)
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi9c.asm b/private/mvdm/dos/v86/cmd/keyb/keybi9c.asm
new file mode 100644
index 000000000..a30c30082
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi9c.asm
@@ -0,0 +1,1768 @@
+PAGE ,132
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+; File Name: KEYBI9C.ASM
+; ----------
+;
+;
+; Description:
+; ------------
+; Interrupt 9 mainline.
+; This routine handles all US keyboard support for the following
+; system units: PC, PC-XT, PC-AT, PC Convertible, PC-XT/286
+; Models 25 and 30 (PALACE),
+; PS/2's - all 8042 based 80286, 80386 and 80486.
+; - all PATRIOT and SEBRING based systems.
+; KEYB_STATE_PROCESSOR is called for non-US keyboard support.
+;
+;
+;
+; Procedures Contained in This File:
+; ----------------------------------
+; KEYB_INT_9 - Interrupt 9
+;
+; External Procedure References:
+; ------------------------------
+; FROM FILE KEYBI9.ASM:
+; KEYB_STATE_PROCESSOR - Non US keyboard support.
+;
+; Linkage Information: Refer to file KEYB.ASM
+; --------------------
+;
+; Change History:
+; ---------------
+; ; - DCR 478 - KEYBOARD INT SPLICING Nick Savage ;deleted by AN005
+; ; - PTM 3090 ENABLING RIGHT CTL FOR RE-BOOTING
+; ; - PTM 60XX PICK UP ALL KEYBOARD BIOS PTR's AND DCR's TO BRING
+; INT 9h UP TO THE TOPHAT (80486) SUPPORT LEVEL. '89 jwg
+; PTR 6600736 Keep INT's disabled till after PORT 60h read.
+; PTR 6600756 EXTRA EOI ISSUED IF INTERRUPTS SATURATED **********
+; NOTE: This is a fix for a BIOS bug that goes all
+; the way back to the first AT. The rationale for
+; the fix is as follows:
+; (deleted AN005) A stack frame is created upon entry (BP) and
+; CHK_EOI is called to check the frame. If no
+; EOI has been issued, CHK_EOI does it and
+; resets the frame, preventing any additinal
+; EOI's from being issued on subsequent calls
+; to CHK_EOI. All direct EOI's in the code
+; have been replaced with calls to CHK_EOI.
+;
+; ;Ax004; - PTM 2555 KEYB command locks keyboard. 10/5/89;cja
+; ; jwg 11/09/98 Updates - Wild Mouse, etc workaround.....
+; ; - PTM 5802 Restructure Interrupt Splicing to correct lost Mouse
+; interrupt when LED's are updated. Make it apply to
+; all systems. Essentially remove all code added by AN001.
+; Remove stack frame logic of AN003 and PTR 6600756 and do
+; an early EOI. Requires a CLI at K38B and other places.
+; Remove Chk_ibf before 60h.
+; Re-write ERROR_BEEP to make processor speed independent
+; for AT and PS/2 systems and right tone if interrupts.
+; Make SHIP_IT handle call on PC machines.
+; Use BP to hold system flags during interrupt processing.
+; PTR 6602049 Fix problem with Pause Key hanging system if Mouse
+; driver is using polled mode. (Port 60h hangs.)
+; PTR 6602247 Change JMP at K40 to stop extra Enable Keyboard cmd.
+; PTR 6602319 Fix interrupt window on System Request key allowing
+; following scan code(s) to be processed out of sequence.
+; PTR 6602355 Fix Print Screen clearing E0 state flags too late.
+; ; - ;deleted Add code the clear "Wild Mouse" condition at PAUSE wait.
+; ; - PTM 6660 Move determination code for original PC1 to COMMSUBS.ASM
+; - ;jwg 2/90 Add Patriot/Sebring HOT REPLUG code so keyboard can be
+; switched back to Scan Code Set 1 if repluged. LIB LITE
+; ; - PTM 6680 Remove code attempting to re-sync BIOS flags with reset
+; Keyboard. Test case simulators can/are sending invalid
+; sequence of AA,AA. Must leave BIOS flags alone on POR.
+; ; - PTM 6716 MicroSoft WORKS (German version) reentrancy problem with
+; - ;jwg 3/90 NLS state processor and save scan code. LED update ACK
+; overlays memory before NLS processing of scan code.
+; Remove AN006 "Wild Mouse" reset code, field tests done.
+; ; - PTM ???? Fix read ID logic to recognize 122 keyboards and set the
+; ;jwg 8/90 KBX flag on any enhansed keyboard.
+; ; - PTM ???? Add 122 Keyboard key support tables.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ INCLUDE KEYBEQU.INC
+ INCLUDE DSEG.INC ; System data segments
+ INCLUDE POSTEQU.INC ; System equates
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBI2F.INC
+ INCLUDE KEYBI9.INC
+ INCLUDE KEYBCPSD.INC
+ INCLUDE KEYBCMD.INC
+
+include bop.inc
+include vint.inc
+
+ PUBLIC KEYB_INT_9
+ PUBLIC K8 ; CTRL case tables
+ PUBLIC SCAN_CODE
+ PUBLIC BUFFER_FILL
+ PUBLIC COUNTRY_FLAG
+
+
+ PUBLIC COPY_NLS1_FLAG ;; (YST)
+
+
+ PUBLIC BEEP_PENDING
+ PUBLIC ERROR_BEEP
+ PUBLIC CHK_IBF
+
+
+
+ID_1 EQU 0ABH ; 1ST ID CHARACTER FOR KBX
+TID_2 EQU 041H ; US G-LAYOUT
+TID_2A EQU 054H ; US P-LAYOUT
+
+;UNTRANSLATED 2ND ID CHAR FOR KBDX
+ID_2U EQU 083H ; US G-LAYOUT (PATRIOT)
+ID_2AU EQU 084H ; US P-LAYOUT (PATRIOT)
+ID_122 EQU 086H ; 2ND ID CHARACTER FOR 122-KEYBOARD
+ID_2JG EQU 090H ; JPN G-LAYOUT
+ID_2JP EQU 091H ; JPN P-LAYOUT
+ID_2JA EQU 092H ; JPN A-LAYOUT
+
+
+DIAGS SEGMENT AT 0FFFFH
+ ORG 0
+RESET LABEL FAR
+DIAGS ENDS
+
+
+CODE SEGMENT PUBLIC 'CODE'
+ ASSUME CS:CODE,DS:DATA
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; TABLE OF SHIFT KEYS AND MASK VALUES
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+;------ KEY_TABLE
+K6 LABEL BYTE
+ DB INS_KEY ; INSERT KEY
+ DB CAPS_KEY,NUM_KEY,SCROLL_KEY,ALT_KEY,CTL_KEY
+ DB LEFT_KEY,RIGHT_KEY
+K6L EQU $-K6
+
+;------ MASK_TABLE
+K7 LABEL BYTE
+ DB INS_SHIFT ; INSERT MODE SHIFT
+ DB CAPS_SHIFT,NUM_SHIFT,SCROLL_SHIFT,ALT_SHIFT,CTL_SHIFT
+ DB LEFT_SHIFT,RIGHT_SHIFT
+
+;---------- TABLES FOR ALT CASE -----
+;------ ALT-INPUT-TABLE
+K30 LABEL BYTE
+ DB 82,79,80,81,75
+ DB 76,77,71,72,73 ; 10 NUMBERS ON KEYPAD
+;------ SUPER-SHIFT-TABLE
+ DB 16,17,18,19,20,21 ; A-Z TYPEWRITER CHARS
+ DB 22,23,24,25,30,31
+ DB 32,33,34,35,36,37
+ DB 38,44,45,46,47,48
+ DB 49,50
+K30_LEN EQU $-K30-10
+
+;------ ALT-INPUT-FUNCTION-TABLE 53H - 7EH
+K30A LABEL BYTE
+ DB -1,-1,-1,-1,139,140 ; Del, SysReq, Undef, WT, F11, F12
+ DB -1,235,218,219,220 ; Undef, PA1, F13, F14, F15
+ DB -1,-1,-1,-1,-1 ; Pause, Undef 5F-62
+ DB 221,222,223,226,227 ; F16, F17, F18, F19, F20,
+ DB 228,229,230,231 ; F21, F22, F23, F24,
+ DB -1,243,-1,-1 ; K#69, ErEOF, Break, Play,
+ DB -1,-1,-1,-1,-1 ; Undef, Attn, CrSel, K#56, ExSel
+ DB -1,253 ; K#74, Clear,
+ifdef NOT_NTVDM
+;;* DB -1,-1,-1 ; Undef, K#109, Undef
+;;* DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, Undef
+else
+ DB -1,-1,-1 ; Undef, K#109, Undef
+ DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, K#107
+endif
+
+H_LAST_SCAN EQU $-K30A+52h ; Largest valid scan code in table
+ ; K30A K8 K15 K14 must have same ends
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; K8 is overlaid by K8_RPL (from module KEYB_COMMAND)
+; if extended INT 16 support is available
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+K8 LABEL BYTE ;-------- CHARACTERS ---------
+ DB 27,-1,00,-1,-1,-1 ; Esc, 1, 2, 3, 4, 5
+ DB 30,-1,-1,-1,-1,31 ; 6, 7, 8, 9, 0, -
+ DB -1,127,-1,17,23,5 ; =, Bksp, Tab, Q, W, E
+ DB 18,20,25,21,09,15 ; R, T, Y, U, I, O
+ DB 16,27,29,10,-1,01 ; P, [, ], Enter, Ctrl, A
+ DB 19,04,06,07,08,10 ; S, D, F, G, H, J
+ DB 11,12,-1,-1,-1,-1 ; K, L, ;, ', `, LShift
+ DB 28,26,24,03,22,02 ; \, Z, X, C, V, B
+ DB 14,13,-1,-1,-1,-1 ; N, M, ,, ., /, RShift
+ DB '*',-1,' ',-1 ; *, Alt, Space, CL
+ ;--------- FUNCTIONS ---------
+ DB 94,95,96,97,98,99 ; F1 - F6
+ DB 100,101,102,103,-1,-1 ; F7 - F10, NL, SL
+ DB 119,-1,132,-1,115,-1 ; Home, Up, PgUp, -, Left, Pad5
+ DB 116,-1,117,-1,118,-1 ; Right, +, End, Down, PgDn, Ins
+ DB -1,-1,-1,-1,137,138 ; Del, SysReq, Undef, WT, F11, F12
+ ;---------- 122 KEYBOARD not overlaid
+ DB -1,234,206,207,208 ; Undef, PA1, F13, F14, F15
+ DB -1,-1,-1,-1,-1 ; Pause, Undef 5F-62
+ DB 209,210,211,212,213 ; F16, F17, F18, F19, F20,
+ DB 214,215,216,217 ; F21, F22, F23, F24,
+ DB -1,242,-1,-1 ; K#69, ErEOF, Break, Play,
+ DB -1,-1,-1,-1,-1 ; Undef, Attn, CrSel, K#56, ExSel
+ DB -1,252 ; K#74, Clear,
+ifdef NOT_NTVDM
+;;* DB -1,-1,-1 ; Undef, K#109, Undef
+;;* DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, Undef
+else
+ DB -1,-1,-1 ; Undef, K#109, Undef
+ DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, K#107
+endif
+
+;----- TABLES FOR LOWER CASE (USA) --
+
+K10 LABEL BYTE
+ DB 27,'12345'
+ DB '67890-'
+ DB '=',08,09,'qwe'
+ DB 'rtyuio'
+ DB 'p[]',0DH,-1,'a' ; LETTERS, Return, Ctrl
+ DB 'sdfghj'
+ DB "kl;'`",-1 ; LETTERS, L Shift
+ DB '\zxcvb'
+ DB 'nm,./'
+ DB -1,'*',-1,' \' ; R Shift, *, Alt, Sp, CL (REALLY WT KEY)
+
+;------ LC TABLE SCAN
+ DB 59,60,61,62,63 ; BASE STATE OF F1 - F10
+ DB 64,65,66,67,68
+ DB -1,-1 ; NL, SL
+
+;------ KEYPAD TABLE
+K15 LABEL BYTE
+ DB 71,72,73,-1,75,-1 ; Home, Up, PgUp, -1, Left, -1
+ DB 77,-1,79,80,81,82 ; Right, -1, End, Down, PgDn, Ins
+ DB 83 ; Del
+ DB -1,-1,'\',133,134 ; SysRq, Undef, WT, F11, F12
+ DB -1,232,182,183,184 ; Undef, PA1, F13, F14, F15
+ DB -1,-1,-1,-1,-1 ; Pause, Undef 5F-62
+ DB 185,186,187,188,189 ; F16, F17, F18, F19, F20,
+ DB 190,191,192,193 ; F21, F22, F23, F24,
+ DB -1,240,-1,-1 ; K#69, ErEOF, Break, Play,
+ DB -1,-1,-1,-1,-1 ; Undef, Attn, CrSel, K#56, ExSel
+ DB -1,251 ; K#74, Clear,
+ifdef NOT_NTVDM
+;;* DB -1,-1,-1 ; Undef, K#109, Undef
+;;* DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, Undef
+else
+ DB -1,-1,-1 ; Undef, K#109, Undef
+ DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, K#107
+endif
+
+;------- TABLES FOR UPPER CASE (USA)
+
+K11 LABEL BYTE
+ DB 27,'!@#$%'
+ DB '^&*()_'
+ DB '+',08,00,'QWE'
+ DB 'RTYUIO'
+ DB 'P{}',0DH,-1,'A' ; LETTERS, Return, Ctrl
+ DB 'SDFGHJ'
+ DB 'KL:"~',-1 ; LETTERS, L Shift
+ DB '|ZXCVB'
+ DB 'NM<>?'
+ DB -1,'*',-1,' |' ; R Shift, *, Alt, Sp, CL (REALLY WT KEY)
+
+;------ UC TABLE SCAN
+K12 LABEL BYTE
+ DB 84,85,86,87,88 ; SHIFTED STATE OF F1 - F10
+ DB 89,90,91,92,93
+ DB -1,-1 ; NL, SL
+
+;------ NUM STATE TABLE
+K14 LABEL BYTE
+ DB '789-456+1230.' ; NUMLOCK STATE OF KEYPAD KEYS
+ DB -1,-1,'|',135,136 ; SysRq, Undef, WT, F11, F12
+ DB -1,233,194,195,196 ; Undef, PA1, F13, F14, F15
+ DB -1,-1,-1,-1,-1 ; Pause, Undef 5F-62
+ DB 197,198,199,200,201 ; F16, F17, F18, F19, F20,
+ DB 202,203,204,205 ; F21, F22, F23, F24,
+ DB -1,241,-1,-1 ; K#69, ErEOF, Break, Play,
+ DB -1,-1,-1,-1,-1 ; Undef, Attn, CrSel, K#56, ExSel
+ DB -1,251 ; K#74, Clear,
+ifdef NOT_NTVDM
+;;* DB -1,-1,-1 ; Undef, K#109, Undef
+;;* DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, Undef
+else
+ DB -1,-1,-1 ; Undef, K#109, Undef
+ DB -1,-1,-1,-1,-1 ; Undef, Undef, K#94, K#14, K#107
+endif
+PAGE
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: KEYB_INT_9
+;
+; Description:
+; Entry point for interrupt 9 processing.
+;
+; Input Registers:
+; None
+;
+; Output Registers:
+; None
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ EVEN ; Keep KEYB_INT_9 entry on even boundry
+BEEP_PENDING DB NO ; YES if a beep is needed
+SCAN_CODE DB 0 ; Last SCAN code read
+
+KEYB_INT_9 PROC NEAR
+
+ JMP SHORT KB_INT_1 ;; (YST)
+COPY_NLS1_FLAG DB 0 ;; (YST)
+COUNTRY_FLAG DB -1 ; WHERE THE INT9 VECTOR POINTS
+
+KB_INT_1:
+
+ ; Do NOT enable interrupts untill after
+ ; PORT 60h has been read. INT 15h has
+ ; interrupt window, do EOI, fast pass.
+ PUSH BP ; Reserved in KEYBi9c for SD.SYSTEM_FLAG
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH SI
+ PUSH DI
+ PUSH DS
+ PUSH ES
+ CLD ; FORWARD DIRECTION
+ MOV BX,DATA ; SET UP ADDRESSING
+ MOV DS,BX ; DS POINTS AT THE ROM BIOS DATA AREA
+ MOV BP,CS:SD.SYSTEM_FLAG ; GET CS:SD.SYSTEM_FLAG, AND USE BP
+
+
+ifdef NOT_NTVDM
+;/* -- WAIT TILL KEYBOARD DISABLE COMMAND CAN BE ACCEPTED
+ MOV AL,DIS_KBD ; DISABLE THE KEYBOARD COMMAND
+ CALL SHIP_IT ; EXECUTE DISABLE
+else
+ mov ah, 1 ; notify I9 entry to softpc
+ BOP 09h
+ nop ; Carbon copy traces for
+ nop ; "in al,PORT_A"
+endif ; keep it traceable
+
+ IN AL,PORT_A ; READ IN THE CHARACTER
+
+
+;/* -- SYSTEM HOOK INT 15H - FUNCTION 4FH (ON HARDWARE INTERRUPT LEVEL 9H)
+
+ MOV AH,04FH ; SYSTEM INTERCEPT - KEY CODE FUNCTION
+ STC ; SET CY= 1 (IN CASE OF IRET)
+ INT 15H ; CASSETTE CALL (AL)= KEY SCAN CODE
+ ; RETURNS CY= 1 FOR INVALID FUNCTION
+
+ifdef NOT_NTVDM
+ ; EARLY EOI for all interrupts done
+ ; after INT 15h to prevent re-entrancy
+ XCHG BX,AX ; SAVE SCAN CODE
+ MOV AL,EOI ; END OF INTERRUPT COMMAND (EARLY EOI)
+ OUT INTA00,AL ; SEND EOI TO INTERRUPT CONTROL PORT
+ XCHG BX,AX ; RECOVER SCAN CODE
+endif
+
+ JC KB_INT_02 ; CONTINUE IF CARRY FLAG SET ((AL)=CODE)
+ JMP K26 ; EXIT IF SYSTEM HANDLED SCAN CODE
+ ; EXIT HANDLES ENABLE
+
+;/* --- CHECK FOR A POSSIBLE HOT REPLUG AND A POR COMPLETE CODE
+KB_INT_02: ; (AL)= SCAN CODE
+
+ifdef NOT_NTVDM
+; ntvdm we don't do keyboard resets\power on stuff
+;
+ ; CHECK FOR POR
+ CMP AL,KB_OK ; CHECK FOR POSSIBLE KEYBOARD POR CHAR
+ JNE KB_INT_03 ; CONTINUE NOT A POR OF AA
+ ; CHECK FOR ENHANSED KEYB
+ TEST KB_FLAG_3,LC_E0 ; WAS E0h LAST SCAN CODE? DCR467
+ JNZ KB_INT_03 ; SKIP KB POR IF IT WAS
+ ; CHECK FOR LEFT SHIFT BREAK
+ TEST KB_FLAG,LEFT_SHIFT ; IS LEFT SHIFT ACTIVE?
+ JNZ KB_INT_03 ; SKIP KB POR IF IT WAS
+ ; KEYBOARD POWER ON DETECTED
+ MOV CS:BEEP_PENDING,YES ; INDICATE WE NEED A BEEP
+ MOV KB_FLAG_2,0 ; CLEAR ALL LED FLAGS TO FORCE UPDATE
+ ; LEAVE OTHERS SO KB SIMULATORS WORK
+
+ TEST BP,PS_8042 ; SYSTEM USING 8042 & SCAN CODE SET 01?
+ JZ KB_INT_03 ; SKIP IF SYSTEM USES DEFAULT SCS 02
+ ; PATRIOT/SEBRING 8042 GATE ARRAY
+ MOV AL,SCAN_CODE_CMD ; SELECT SCAN CODE SET COMMAND
+ CALL SND_DATA ; SEND IT DIRECTLY TO THE KEYBOARD
+ MOV AL,01h ; SELECT SCAN CODE SET 01
+ CALL SND_DATA ; SEND IT TO THE KEYBOARD
+ MOV AL,KB_OK ; RESTORE POR SCAN CODE IN (AL)
+endif
+
+KB_INT_03:
+
+;/* --- CHECK FOR A RESEND COMMAND TO KEYBOARD
+
+ ;; NTVDM STI ; ENABLE INTERRUPTS AGAIN
+ CMP AL,KB_RESEND ; IS THE INPUT A RESEND
+ JE KB_INT_4 ; GO IF RESEND
+
+;/* --- CHECK FOR RESPONSE TO A COMMAND TO KEYBOARD
+
+ CMP AL,KB_ACK ; IS THE INPUT AN ACKNOWLEDGE
+ JNZ KB_INT_2 ; GO IF NOT
+
+;/* --- A COMMAND TO THE KEYBOARD WAS ISSUED
+
+ ;; NTVDM CLI ; DISABLE INTERRUPTS
+ OR KB_FLAG_2,KB_FA ; INDICATE ACK RECEIVED
+ JMP K26 ; RETURN IF NOT (ACK RETURNED FOR DATA)
+
+;/* --- RESEND THE LAST BYTE
+
+KB_INT_4:
+ ;; NTVDM CLI ; DISABLE INTERRUPTS
+ OR KB_FLAG_2,KB_FE ; INDICATE RESEND RECEIVED
+ JMP K26 ; RETURN IF NOT (ACK RETURNED FOR DATA)
+
+
+;/* --- UPDATE MODE INDICATORS IF CHANGE IN STATE
+
+KB_INT_2:
+ PUSH AX ; SAVE DATA IN
+ CALL MAKE_LED ; GO GET MODE INDICATOR DATA BYTE
+ MOV BL, KB_FLAG_2 ; GET PREVIOUS BITS
+ XOR BL,AL ; SEE IF ANY DIFFERENT
+ AND BL,KB_LEDS ; ISOLATE INDICATOR BITS
+ JZ UP0 ; IF NO CHANGE BYPASS UPDATE
+ CALL SND_LED ; GO TURN ON MODE INDICATORS
+UP0: POP AX ; RESTORE DATA IN
+
+;---------------------------------------------------------------------
+; START OF KEY PROCESSING -
+;---------------------------------------------------------------------
+
+ MOV AH,AL ; SAVE SCAN CODE IN AH ALSO
+ ; END OF RE-ENTRANT CODE PATHS
+ MOV CS:SCAN_CODE,AL ; SAVE SCAN CODE TO BE PROCESSED BY KEYB
+
+;------ TEST FOR OVERRUN SCAN CODE FROM KEYBOARD
+
+ CMP AL,KB_OVER_RUN ; IS THIS AN OVERRUN CHAR?
+ JNZ K16 ; NO, TEST FOR SHIFT KEY
+
+ MOV CS:BEEP_PENDING,YES
+ JMP K26 ; BUFFER_FULL_BEEP, EXIT
+
+K16:
+
+ PUSH CS
+ POP ES ; ESTABLISH ADDRESS OF TABLES
+ MOV BH, KB_FLAG_3 ; LOAD FLAGS FOR TESTING
+
+;------ TEST TO SEE IF A READ_ID IS IN PROGRESS
+
+ TEST BH,RD_ID+LC_AB ; ARE WE DOING A READ ID?
+ JZ NOT_ID ; CONTINUE IF NOT
+ JNS TST_ID_2 ; IS THE RD_ID FLAG ON?
+ CMP AL,ID_1 ; IS THIS THE 1ST ID CHARACTER?
+ JNE RST_RD_ID
+ OR KB_FLAG_3,LC_AB ; INDICATE 1ST ID WAS OK
+RST_RD_ID:
+ AND KB_FLAG_3,NOT RD_ID ; RESET THE READ ID FLAG
+ JMP SHORT ID_EX ; AND EXIT
+
+
+;------ CHECK 2ND US KBD ID - FOR SETTING NUM LOCK ON
+TST_ID_2:
+ AND KB_FLAG_3,NOT LC_AB ; RESET FLAG
+ OR KB_FLAG_3,KBX ; INDICATE ENHANCED KEYBOARD WAS FOUND
+ CMP AL,TID_2 ; IS THIS US G-LAYOUT KBD w 8042
+ JE NUM_LOCK_000 ; JUMP IF SO
+ CMP AL,ID_2U ; IS THIS US G-LAYOUT KBD w/o 8042
+ JE NUM_LOCK_000 ; JUMP IF SO
+ CMP AL,ID_122 ; IS THIS THE 122 KEY ENHANCED KEYBOARD
+ JE NUM_LOCK_000 ; JUMP IF SO
+
+;------ CHECK 2ND JAPANESE KBD ID ;DCR355
+
+ CMP AL,ID_2JG ; IS THIS JPN KBD - G ?
+ JE NUM_LOCK_000 ; JUMP IF SO
+ CMP AL,ID_2JA ; IS THIS JPN KBD - A ?
+ JNE ID_EX ; EXIT IF NUM LOCK NOT REQUIRED
+ ; These ID's do not set NUM LOCK ON
+ ; ID_2AU = US P-LAYOUT KBD w/o 8042
+ ; TID_2A = US P-LAYOUT KBD w 8042
+ ; ID_2JP = JPN KBD - P
+
+;------ A READ ID SAID THAT IT WAS ENHANCED KEYBOARD
+
+NUM_LOCK_000:
+ TEST BH,SET_NUM_LK ; SHOULD WE SET NUM LOCK?
+ JZ ID_EX ; EXIT IF NOT
+ OR KB_FLAG,NUM_STATE ; FORCE NUM LOCK ON
+ CALL SND_LED ; GO SET THE NUM LOCK INDICATOR
+ID_EX:
+ JMP K26 ; EXIT
+PAGE
+NOT_ID:
+ CMP AL,MC_E0 ; IS THIS THE GENERAL MARKER CODE?
+ JNE TEST_E1
+ OR KB_FLAG_3,LC_E0+KBX ; SET FLAG BIT, SET KBX, AND
+ JMP SHORT EXIT ; THROW AWAY THIS CODE
+
+TEST_E1:
+ CMP AL,MC_E1 ; IS THIS THE PAUSE KEY?
+ JNE NOT_HC
+ OR KB_FLAG_3,LC_E1+KBX ; SET FLAG, PAUSE KEY MARKER CODE
+EXIT: JMP K26A ; THROW AWAY THIS CODE
+
+NOT_HC:
+ AND AL,07FH ; TURN OFF THE BREAK BIT
+ TEST BH,LC_E0 ; LAST CODE THE E0 MARKER CODE?
+ JZ NOT_LC_E0 ; JUMP IF NOT
+
+ MOV CX,2 ; LENGTH OF SEARCH
+ MOV DI,OFFSET K6+6 ; IS THIS A SHIFT KEY?
+ REPNE SCASB ; CHECK IT
+ JNE K16A ; NO, CONTINUE KEY PROCESSING
+ JMP SHORT K16B ; YES, THROW AWAY & RESET FLAG
+
+NOT_LC_E0:
+ TEST BH,LC_E1 ; LAST CODE THE E1 MARKER CODE?
+ JZ T_SYS_KEY ; JUMP IF NOT
+
+ MOV CX,4 ; LENGTH OF SEARCH
+ MOV DI,OFFSET K6+4 ; IS THIS AN ALT, CTL, OR SHIFT?
+ REPNE SCASB ; CHECK IT
+ JE EXIT ; THROW AWAY IF SO
+
+ CMP AL,NUM_KEY ; IS IT THE PAUSE KEY?
+ JNE K16B ; NO, THROW AWAY & RESET FLAG
+ TEST AH,80H ; YES, IS IT THE BREAK OF THE KEY?
+ JNZ K16B ; YES, THROW THIS AWAY, TOO
+ TEST KB_FLAG_1,HOLD_STATE ; NO, ARE WE PAUSED ALREADY?
+ JNZ K16B ; YES, THROW AWAY
+ JMP K39P ; NO, THIS IS THE REAL PAUSE STATE
+PAGE
+;------ TEST FOR SYSTEM KEY
+
+T_SYS_KEY:
+ CMP AL,SYS_KEY ; IS IT THE SYSTEM KEY?
+ JNE K16A ; CONTINUE IF NOT
+
+ TEST AH,080H ; CHECK IF THIS A BREAK CODE
+ ;; NTVDM CLI ; DISABLE INTERRUPTS PTR 6602319
+ JNZ K16C ; DON'T TOUCH SYSTEM INDICATOR IF TRUE
+
+ TEST KB_FLAG_1,SYS_SHIFT ; SEE IF IN SYSTEM KEY HELD DOWN
+ JNZ K16B ; IF YES, DON'T PROCESS SYSTEM INDICATOR
+
+ OR KB_FLAG_1,SYS_SHIFT ; INDICATE SYSTEM KEY DEPRESSED
+
+ifdef NOT_NTVDM
+ MOV AL,ENA_KBD ; INSURE KEYBOARD IS ENABLED
+ CALL SHIP_IT ; EXECUTE ENABLE
+else
+ mov ah, 3 ; K27A exit notify
+ BOP 09h
+endif
+ MOV AX,08500H ; FUNCTION VALUE FOR MAKE OF SYSTEM KEY
+ INT 15H ; USER INTERRUPT
+ JMP K27A ; END PROCESSING
+
+K16B: JMP K26 ; IGNORE SYSTEM KEY
+
+K16C: AND KB_FLAG_1,NOT SYS_SHIFT; TURN OFF SHIFT KEY HELD DOWN
+
+ifdef NOT_NTVDM
+ MOV AL,ENA_KBD ; INSURE KEYBOARD IS ENABLED
+ CALL SHIP_IT ; EXECUTE ENABLE
+else
+ mov ah, 3 ; K27A exit notify
+ BOP 09h
+endif
+
+ MOV AX,08501H ; FUNCTION VALUE FOR BREAK OF SYSTEM KEY
+ INT 15H ; USER INTERRUPT
+ JMP K27A ; IGNORE SYSTEM KEY
+PAGE
+;------ TEST FOR SHIFT KEYS
+;
+; HERE IS WHERE KB_FLAGS ARE SET. WHAT HAPPENS IS, THE SYSTEM SEARCHES TABLE
+; 'K6' FOR THE KEY. IF FOUND, IT GETS THE APPROPRIATE BIT FROM TABLE 'K7'
+; AND SETS IT ON. (TABLES ARE ALL AT THE TOP OF THIS ROUTINE) FLAGS FOR THE
+; SECOND ALT AND CTRL ARE SET IN KB_FLAG_3 AND HAVE THE SAME BIT POSITIONS AS
+; THEIR ORIGINAL COUNTERPARTS IN KB_FLAG
+
+K16A: MOV BL, KB_FLAG ; PUT STATE FLAGS IN BL
+ MOV DI,OFFSET K6 ; SHIFT KEY TABLE
+ MOV CX,K6L ; LENGTH
+ REPNE SCASB ; LOOK THROUGH THE TABLE FOR A MATCH
+ MOV AL,AH ; RECOVER SCAN CODE
+ JE K17 ; JUMP IF MATCH FOUND
+ JMP K25 ; IF NO MATCH, THEN SHIFT NOT FOUND
+
+;------ SHIFT KEY FOUND
+
+K17: SUB DI,OFFSET K6+1 ; ADJUST PTR TO SCAN CODE MTCH
+ MOV AH,CS:K7[DI] ; GET MASK INTO AH
+ MOV CL,2 ; SET UP COUNT FOR FLAG SHIFTS
+ TEST AL,80H ; TEST FOR BREAK KEY
+ JZ K17C
+ JMP K23 ; JUMP IF BREAK
+
+;------ SHIFT MAKE FOUND, DETERMINE SET OR TOGGLE
+
+K17C: CMP AH,SCROLL_SHIFT
+ JAE K18 ; IF SCROLL SHIFT OR ABOVE, TOGGLE KEY
+
+;------ PLAIN SHIFT KEY, SET SHIFT ON
+
+ CMP COUNTRY_FLAG,0FFh ; ARE WE IN FOREIGN LANG MODE?
+ JNE K17C1 ; NO, US MODE, JUMP
+ CMP AL,ALT_KEY ; IS THIS THE ALT KEY?
+ JNE K17C1 ; NO, NORMAL KEY
+ ;**CNS
+
+K17C1: OR KB_FLAG,AH ; TURN ON SHIFT BIT
+K17C2: TEST AH,CTL_SHIFT+ALT_SHIFT ; IS IT ALT OR CTRL?
+ JZ K17F ; NO, JUMP
+K17D: TEST BH,LC_E0 ; IS THIS ONE OF THE NEW KEYS?
+ JZ K17E ; NO, JUMP
+ OR KB_FLAG_3,AH ; SET BITS FOR RIGHT CTRL, ALT
+; JMP K26 ; INTERRUPT_RETURN
+ jmp short K17G ; (YST)
+
+K17E: SHR AH,CL ; MOVE FLAG BITS TWO POSITIONS
+ OR KB_FLAG_1,AH ; SET BITS FOR LEFT CTRL, ALT
+; JMP K26 ; INTERRUPT RETURN
+ jmp short K17G ; (YST)
+
+K17F:
+ TEST CS:SD.SPECIAL_FEATURES,TYPEWRITER_CAPS_LK
+ JZ K17G ; N..all done
+ CMP COUNTRY_FLAG,0FFh ; ARE WE IN LANG MODE?
+ JNE K17G ; NO, ALL DONE WITH SHIFT KEY
+
+;------ If keyboard is P12 then we still need to release caps_lk
+
+ TEST BP,PC_LAP ; IS THIS A P12 KEYBOARD?
+ JNZ REMOVE_CAPS_SHIFT
+
+ TEST BH,KBX ; THIS THE ENHANCED KEYBOARD?
+ JZ K17G ; NO, ALL DONE WITH SHIFT KEY
+REMOVE_CAPS_SHIFT:
+ AND KB_FLAG,NOT CAPS_SHIFT ; YES, TAKE KB OUT OF C_L STATE
+ CALL SND_LED ; AND UPDATE THE LED INDICATORS
+K17G:
+
+
+; ===========================================
+; Russian Keyboard (YST)
+; ===========================================
+ CMP COUNTRY_FLAG,0FFh ; ARE WE IN FOREIGN LANG MODE? (YST)
+ JNE K17H ; NO, US MODE, RETURN (YST)
+ TEST CS:SD.SPECIAL_FEATURES,SHIFTS_TO_LOGIC; CAN OUR STATE (YST)
+ ; LOGIC SUPPORT THIS CALL? (YST)
+ JZ K17H ; NO, RETURN (YST)
+ OR CS:FLAGS_TO_TEST[EXT_KB_FLAG_ID],SHIFTS_PRESSED; (YST)
+ ; SET FLAG FOR STATE LOGIC (YST)
+ CALL KEYB_STATE_PROCESSOR ; ******** (YST)
+ AND CS:FLAGS_TO_TEST[EXT_KB_FLAG_ID],NOT SHIFTS_PRESSED; (YST)
+ ; CLEAR FLAG AFTER USE (YST)
+; ===========================================
+; End of Russian Keyboard (YST)
+; ===========================================
+
+
+K17H: JMP K26 ; RETURN
+
+;------ TOGGLED SHIFT KEY, TEST FOR 1ST MAKE OR NOT
+
+K18: ; SHIFT-TOGGLE
+ TEST BL,CTL_SHIFT ; CHECK CTL SHIFT STATE
+ JZ K18A ; JUMP IF NOT CTL STATE
+ JMP K25 ; JUMP IF CTL STATE
+K18A: CMP AL,INS_KEY ; CHECK FOR INSERT KEY
+ JNE K22 ; JUMP IF NOT INSERT KEY
+ TEST BL,ALT_SHIFT ; CHECK FOR ALTERNATE SHIFT
+ JZ K18B ; JUMP IF NOT ALTERNATE SHIFT
+ JMP K25 ; JUMP IF ALTERNATE SHIFT
+K18B: TEST BH,LC_E0 ; IS THIS THE NEW INSERT KEY?
+ JNZ K22 ; YES, THIS ONE'S NEVER A "0"
+K19: TEST BL,NUM_STATE ; CHECK FOR BASE STATE
+ JNZ K21 ; JUMP IF NUM LOCK IS ON
+ TEST BL,LEFT_SHIFT+RIGHT_SHIFT ; TEST FOR SHIFT STATE
+ JZ K22 ; JUMP IF BASE STATE
+K20: MOV AH,AL ; PUT SCAN CODE BACK IN AH
+ JMP K25 ; NUMERAL "0", STNDRD. PROCESSING
+
+K21: TEST BL,LEFT_SHIFT+RIGHT_SHIFT ; MIGHT BE NUMERIC
+ JZ K20 ; IS NUMERIC, STD. PROC.
+
+K22: ; SHIFT TOGGLE KEY HIT; PROCESS IT
+ TEST AH, KB_FLAG_1 ; IS KEY ALREADY DEPRESSED?
+ JZ K22A
+ JMP K26 ; JUMP IF KEY ALREADY DEPRESSED
+K22A: OR KB_FLAG_1,AH ; INDICATE THAT THE KEY IS DEPRESSED
+ XOR KB_FLAG,AH ; TOGGLE THE SHIFT STATE
+
+ TEST CS:SD.SPECIAL_FEATURES,TYPEWRITER_CAPS_LK
+ JZ K22C ; N..all done
+
+;------ If keyboard is P12 then we do not toggle
+
+ TEST BP,PC_LAP ; IS THIS A P12 KEYBOARD?
+ JNZ LAP_SO_DONT_TOGGLE
+
+ TEST BH,KBX ; THIS THE ENHANCED KEYBOARD?
+ JZ K22C ; NO, ALL DONE WITH TOGGLE KEYS
+
+LAP_SO_DONT_TOGGLE:
+ CMP CS:COUNTRY_FLAG,0FFh ; ARE WE IN FOREIGN LANG MODE?
+ JNE K22C ; NO, NO SPECIAL STUFF FOR U.S.
+ TEST AH,CAPS_SHIFT ; IS IT THE CAPS_LOCK KEY?
+ JZ K22C ; NO, NOTHING ELSE TO DO
+ OR KB_FLAG,AH ; YES, SET CAPS_LOCK (NOT TOGGLE)
+
+K22C:
+
+;------ TOGGLE LED IF CAPS, NUM, OR SCROLL KEY DEPRESSED
+
+ TEST AH,CAPS_SHIFT+NUM_SHIFT+SCROLL_SHIFT ; SHIFT TOGGLE?
+ JZ K22B ; GO IF NOT
+ PUSH AX ; SAVE SCAN CODE AND SHIFT MASK
+ CALL SND_LED ; GO TURN MODE INDICATORS ON
+ POP AX ; RESTORE SCAN CODE
+
+K22B: CMP AL,INS_KEY ; TEST FOR 1ST MAKE OF INSERT KEY
+ JNE K26 ; JUMP IF NOT INSERT KEY
+ MOV AH,AL ; SCAN CODE IN BOTH HALVES OF AX
+ JMP K28 ; FLAGS UPDATED, PROC. FOR BUFFER
+
+;------ BREAK SHIFT FOUND
+
+K23: ; BREAK-SHIFT-FOUND
+ CMP AH,SCROLL_SHIFT ; IS THIS A TOGGLE KEY?
+ NOT AH ; INVERT MASK
+ JAE K24 ; YES, HANDLE BREAK TOGGLE
+ AND KB_FLAG,AH ; TURN OFF SHIFT BIT
+ CMP AH,NOT CTL_SHIFT ; IS THIS ALT OR CTL?
+ JA K23D ; NO, ALL DONE
+
+ TEST BH,LC_E0 ; 2ND ALT OR CTL?
+ JZ K23A ; NO, HANDLE NORMALLY
+ AND KB_FLAG_3,AH ; RESET BIT FOR RIGHT ALT OR CTL
+ JMP SHORT K23B ; CONTINUE
+K23A: SAR AH,CL ; MOVE THE MASK BIT TWO POSITIONS
+ AND KB_FLAG_1,AH ; RESET BIT FOR LEFT ALT OR CTL
+K23B: MOV AH,AL ; SAVE SCAN CODE
+ MOV AL, KB_FLAG_3 ; GET RIGHT ALT & CTRL FLAGS
+ CMP COUNTRY_FLAG,0FFH ; ARE WE IN LANGUAGE MODE?
+ JNE K23C ; NO, LEAVE RIGHT FLAGS AS IS
+;**CNS
+ AND AL,NOT GRAPH_ON ; YES, FILTER OUT THE ALT_GR KEY
+;**CNS
+K23C: SHR AL,CL ; MOVE TO BITS 1 & 0
+ OR AL, KB_FLAG_1 ; PUT IN LEFT ALT & CTL FLAGS
+ SHL AL,CL ; MOVE BACK TO BITS 3 & 2
+ AND AL,ALT_SHIFT+CTL_SHIFT ; FILTER OUT OTHER GARBAGE
+ OR KB_FLAG,AL ; PUT RESULT IN THE REAL FLAGS
+ MOV AL,AH ; RECOVER SAVED SCAN CODE
+
+K23D: CMP AL,ALT_KEY+80H ; IS THIS ALTERNATE SHIFT RELEASE
+ JNE K26 ; INTERRUPT_RETURN
+
+;------ ALTERNATE SHIFT KEY RELEASED, GET THE VALUE INTO BUFFER
+
+ MOV AL, ALT_INPUT
+ xor ah,ah ; scan code of 0
+ MOV ALT_INPUT,AH ; ZERO OUT THE FIELD
+ or al,al ; was the input = 0?
+ JE K26 ; INTERRUPT_RETURN
+ CALL BUFFER_FILL_ANY_CHAR ; Put in buffer, but use this
+ ; entry point to avoid trashing
+ ; an ASCII code of 255
+ JMP SHORT K26 ; INTERRUPT_RETURN
+
+K24: ; BREAK-TOGGLE
+ AND KB_FLAG_1,AH ; INDICATE NO LONGER DEPRESSED
+ JMP SHORT K26 ; INTERRUPT_RETURN
+
+;------ TEST FOR HOLD STATE
+ ; AL, AH = SCAN CODE
+K25: ; NO-SHIFT-FOUND
+ CMP AL,80H ; TEST FOR BREAK KEY
+ JAE K26 ; NOTHING FOR BREAK CHARS FROM HERE ON
+ TEST KB_FLAG_1,HOLD_STATE ; ARE WE IN HOLD STATE
+ JZ K28 ; BRANCH AROUND TEST IF NOT
+ CMP AL,NUM_KEY
+ JE K26 ; CAN'T END HOLD ON NUM_LOCK
+ AND KB_FLAG_1,NOT HOLD_STATE ; TURN OFF THE HOLD STATE BIT
+
+K26:
+ AND KB_FLAG_3,NOT LC_E0+LC_E1 ; RESET LAST CHAR H.C. FLAG
+
+K26A: ; INTERRUPT-RETURN
+ifdef NOT_NTVDM
+ ;; NTVDM CLI ; TURN OFF INTERRUPTS
+ CALL ERROR_BEEP ; CHECK FOR ERROR BEEP PENDING
+
+ CMP CS:BUFFER_ENTRY_OK,YES ; HAS A CHARACTER BEEN PLACED IN BUFFER
+ JNE K27 ; NO, SKIP POST
+
+ MOV byte ptr CS:BUFFER_ENTRY_OK,NO ; CLEAR POST CHARACTER IN BUFFER FLAG
+ MOV AX,09102H ; MOVE IN POST CODE & TYPE
+ INT 15H ; PERFORM OTHER FUNCTION
+K27:
+ MOV AL,ENA_KBD ; ENSURE KEYBOARD IS ENABLED (AT PS/2)
+ CALL SHIP_IT ; EXECUTE ENABLE
+else
+
+ mov ah, 2
+ mov bh, CS:BEEP_PENDING
+ mov bl, CS:BUFFER_ENTRY_OK
+ MOV byte ptr CS:BUFFER_ENTRY_OK,NO
+ MOV byte ptr CS:BEEP_PENDING,NO
+ BOP 09h
+endif
+
+
+K27A: ;; NTVDM CLI ; DISABLE INTERRUPTS
+ POP ES ; RESTORE REGISTERS
+ POP DS ; *
+ POP DI ; *
+ POP SI ; *
+ POP DX ; *
+ POP CX ; *
+ POP BX ; *
+ POP AX ; *
+ POP BP ; *
+
+ jmp DOIRET ; RETURN
+PAGE
+;------ NOT IN HOLD STATE
+ ; AL, AH = SCAN CODE (ALL MAKES)
+K28: ; NO-HOLD-STATE
+ CMP AL,H_LAST_SCAN ; TEST FOR OUT-OF-RANGE SCAN CODES
+ JA SHORT K26 ; IGNORE IF OUT-OF-RANGE
+
+ TEST BP,EXT_122 ; IS EXTENDED 122 KEYBOARD SUPPORT OK
+ JNZ K28_122 ; SKIP NON-122 OUT-OF-RANGE CHECK
+
+ifdef NOT_NTVDM
+ CMP AL,88 ; TEST FOR OUT-OF-RANGE SCAN CODES
+else
+ CMP AL,7Eh ; MAX SCANCODE ON BRAZILIAN ABNT KBD
+endif
+ JA K26 ; IGNORE IF OUT-OF-RANGE
+
+K28_122:
+ TEST BL,ALT_SHIFT ; ARE WE IN ALTERNATE SHIFT?
+ JZ K28A ; JUMP IF NOT ALTERNATE
+
+ TEST BH,KBX ; IS THIS THE ENHANCED KEYBOARD?
+ JZ K29 ; NO, ALT STATE IS REAL
+
+ TEST KB_FLAG_1,SYS_SHIFT ; YES, IS SYSREQ KEY DOWN?
+ JZ K29 ; NO, ALT STATE IS REAL
+;**CNS
+ TEST AH,LC_E0 ; IS IT THE ALT_GR KEY?
+ JZ K28A ; YES, DON'T SET KB_FLAG
+
+ TEST AL,R_ALT_SHIFT ; TURN ON SHIFT BIT
+ JNZ K29 ; TURN ON SHIFT BIT
+;**CNS
+
+K28A: JMP K38 ; YES, THIS IS PHONY ALT STATE
+ ; DUE TO PRESSING SYSREQ
+
+;------ TEST FOR RESET KEY SEQUENCE (CTL ALT DEL) OR HOT KEY DEPRESSED
+
+K29: ; TEST-RESET
+ TEST BL,CTL_SHIFT ; ARE WE IN CONTROL SHIFT ALSO?
+ JZ K31 ; NO_RESET
+ CMP AL,DEL_KEY ; SHIFT STATE IS THERE, TEST KEY
+ JNE K31A ; NO_RESET, TRANSLATE TABLE SWAP
+
+;------ CTL-ALT-DEL HAS BEEN FOUND, DO I/O CLEANUP
+
+ MOV RESET_FLAG,1234H ; SET FLAG FOR RESET FUNCTION
+ AND WORD PTR KB_FLAG_3,KBX ; CLEAR ALL FLAG BITS EXCEPT KBX PED 6-25-86
+ JMP RESET ; JUMP TO POWER ON DIAGNOSTICS
+
+;------ IN ALTERNATE SHIFT, RESET NOT FOUND
+
+K31: ; NO-RESET
+ CALL KEYB_STATE_PROCESSOR
+ JC K26 ; TRANSLATIONS FOUND - EXIT
+
+ CMP AL,57 ; TEST FOR SPACE KEY
+ JNE K311 ; NOT THERE
+ MOV AL,' ' ; SET SPACE CHAR
+ JMP K57 ; BUFFER_FILL
+K311:
+ TEST BP,EXT_16 ; IS EXTENDED INT 16 LOADED?
+ JZ K32 ; NO, SKIP THIS EXTENDED STUFF
+ CMP AL,15 ; TEST FOR TAB KEY
+ JNE K312 ; NOT THERE
+ MOV AX,0A500h ; SET SPECIAL CODE FOR ALT-TAB
+ JMP K57 ; BUFFER_FILL
+K312:
+ CMP AL,74 ; TEST FOR KEYPAD -
+ JE K312A ; GO PROCESS
+ CMP AL,78 ; TEST FOR KEYPAD +
+ JNE K32 ; SKIP TEST FOR LANG SWAP & CONT.
+K312A: JMP K37B ; GO PROCESS
+
+;------ SET COUNTRY FLAG TO INDICATE WHICH TABLE WE'RE USING, FOREIGN OR DOMESTIC
+
+K31A: CMP AL,CS:SD.HOT_KEY_ON_SCAN ; TEST FOR HOT KEY TO US
+ JNE K31B
+ MOV CS:COUNTRY_FLAG,00 ; SET FLAG FOR DOMESTIC KEY'S
+ JMP K26 ; INTERRUPT RETURN
+
+K31B: CMP AL,CS:SD.HOT_KEY_OFF_SCAN ; TEST FOR HOT KEY TO FOREIGN
+ JNE K31C ; IF NOT TEST FOR FRONT ENGRAV
+ MOV CS:COUNTRY_FLAG,0FFH ; SET FLAGS FOR FOREIGN KEY'S
+ JMP K26 ; INTERRUPT RETURN
+
+
+;------ ALT, CTRL DOWN ; NO HOT KEY
+
+K31C: CMP CS:COUNTRY_FLAG,0FFH
+ JNE K32 ; TRY ALT_KEY_PAD
+ CALL KEYB_STATE_PROCESSOR
+ JC K32A ;K26 ; TRANSLATIONS FOUND - EXIT
+
+
+;------ LOOK FOR KEY PAD ENTRY
+
+K32: ; ALT-KEY-PAD
+ MOV DI,OFFSET K30 ; ALT-INPUT-TABLE
+ MOV CX,10 ; LOOK FOR ENTRY USING KEYPAD
+ REPNE SCASB ; LOOK FOR MATCH
+ JNE K33 ; NO_ALT_KEYPAD
+ TEST BH,LC_E0 ; IS THIS ONE OF THE NEW KEYS?
+ JNZ K37C ; YES, JUMP, NOT NUMPAD KEY
+ SUB DI,OFFSET K30+1 ; DI NOW HAS ENTRY VALUE
+ MOV AL, ALT_INPUT ; GET THE CURRENT BYTE
+ MOV AH,10 ; MULTIPLY BY 10
+ MUL AH
+ ADD AX,DI ; ADD IN THE LATEST ENTRY
+ MOV ALT_INPUT,AL ; STORE IT AWAY
+K32A: JMP K26 ; THROW AWAY THAT KEYSTROKE
+
+;------ LOOK FOR SUPERSHIFT ENTRY
+
+K33: ; NO-ALT-KEYPAD
+ MOV ALT_INPUT,0 ; ZERO ANY PREVIOUS ENTRY INTO INPUT
+ ; DI,ES ALREADY POINTING
+ MOV CX,K30_LEN ; NORMALLY 26, BUT 27 FOR FR, DUE
+ ; TO THE ";" KEY BEING "M"
+ REPNE SCASB ; LOOK FOR MATCH IN ALPHABET
+ JE K37A ; MATCH FOUND, GO FILL THE BUFFER
+
+;------ LOOK FOR TOP ROW OF ALTERNATE SHIFT
+
+K34: ; ALT-TOP-ROW
+ CMP AL,2 ; KEY WITH '1' ON IT
+ JB K37B ; MUST BE ESCAPE
+ CMP AL,13 ; IS IT IN THE REGION
+ JA K35 ; NO, ALT-SOMETHING ELSE
+ ADD AH,118 ; CONVERT PSEUDO SCAN CODE TO RANGE
+ JMP SHORT K37A ; GO FILL THE BUFFER
+
+;------ TRANSLATE ALTERNATE SHIFT PSEUDO SCAN CODES
+
+K35: ; ALT-FUNCTION
+ CMP AL,F11_M ; IS IT F11 or GREATER ?
+ JB K35A ; NO, BRANCH
+ SUB AL,52h ; SET UP TO SEARCH ALT-FUNCTION-TABLE
+ MOV BX,OFFSET K30A ; BASE CASE TABLE
+ JMP K64 ; CONVERT TO PSEUDO SCAN
+
+K35A: TEST BH,LC_E0 ; DO WE HAVE ONE OF THE NEW KEYS?
+ JZ K37 ; NO, JUMP
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 LOADED?
+ JZ K37 ; NO, DO COMPATIBLE OUTPUT
+ CMP AL,28 ; TEST FOR KEYPAD ENTER
+ JNE K35B ; NOT THERE
+ MOV AX,0A600h ; SPECIAL CODE
+ JMP K57 ; BUFFER FILL
+K35B: CMP AL,83 ; TEST FOR DELETE KEY
+ JE K37C ; HANDLE WITH OTHER EDIT KEYS
+ CMP AL,53 ; TEST FOR KEYPAD /
+ JNE K32A ; NOT THERE, NO OTHER E0 SPECIALS
+ MOV AX,0A400h ; SPECIAL CODE
+ JMP K57 ; BUFFER FILL
+
+K37: CMP AL,59 ; TEST FOR FUNCTION KEYS (F1)
+ JB K37B ; NO FN, HANDLE W/OTHER EXTENDED
+ CMP AL,68 ; IN KEYPAD REGION?
+ ; OR NUMLOCK, SCROLLOCK?
+ JA K32A ; IF SO, IGNORE
+ ADD AH,45 ; CONVERT TO PSEUDO SCAN CODE
+
+K37A: xor al,al ; ASCII CODE OF ZERO
+ JMP K57 ; PUT IT IN THE BUFFER
+
+K37B:
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 LOADED?
+ JZ K32A ;K26 ; NO, IGNORE THIS ONE
+ MOV AL,0F0h ; USE SPECIAL ASCII CODE
+ JMP K57 ; PUT IT IN THE BUFFER
+
+K37C:
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 LOADED?
+ JZ K37A ; NO, DO COMPATIBLE OUTPUT
+ ADD AL,80 ; CONVERT SCAN CODE (EDIT KEYS)
+ MOV AH,AL ; (SCAN CODE NOT IN AH FOR INSERT)
+ JMP K37A ; PUT IT IN THE BUFFER
+PAGE
+;------ NOT IN ALTERNATE SHIFT
+
+K38: ; NOT-ALT-SHIFT
+ ; BL STILL HAS SHIFT FLAGS
+ TEST BL,CTL_SHIFT ; ARE WE IN CONTROL SHIFT?
+ JNZ K38A ; YES, START PROCESSING
+ JMP K44 ; NOT-CTL-SHIFT
+
+;------ CONTROL SHIFT, TEST SPECIAL CHARACTERS
+
+;------ TEST FOR BREAK
+
+K38A: CMP AL,SCROLL_KEY ; TEST FOR BREAK
+ JNE K39 ; JUMP, NO-BREAK
+ TEST BP,PC_LAP ; IS THIS THE LAP COMPUTER?
+ JNZ K38B ; YES, THIS IS CTRL-BREAK
+ TEST BH,KBX ; IS THIS THE ENHANCED KEYBOARD?
+ JZ K38B ; NO, BREAK IS VALID
+ TEST BH,LC_E0 ; YES, WAS LAST CODE AN E0?
+ JZ K39 ; NO-BREAK, TEST FOR PAUSE
+
+K38B:
+ ;; NTVDM CLI ; Disable interrupts because EOI issued
+ MOV BX, BUFFER_HEAD ; RESET BUFFER TAIL TO BUFFER HEAD
+ MOV BUFFER_TAIL,BX
+ MOV BIOS_BREAK,80H ; TURN ON BIOS_BREAK BIT
+
+;-------- ENABLE KEYBOARD
+
+ifdef NOT_NTVDM
+ MOV AL,ENA_KBD ; ENABLE KEYBOARD
+ CALL SHIP_IT ; EXECUTE ENABLE
+else
+ mov ah, 4
+ BOP 09h
+endif
+ INT 1BH ; BREAK INTERRUPT VECTOR
+ SUB AX,AX ; PUT OUT DUMMY CHARACTER
+ JMP K57 ; BUFFER_FILL
+
+;-------- TEST FOR PAUSE
+
+K39: ; NO-BREAK
+ CMP AL,NUM_KEY ; LOOK FOR PAUSE KEY
+ JNE K41 ; NO-PAUSE
+ TEST BH,KBX ; IS THIS THE ENHANCED KEYBOARD?
+ JZ K39P ; NO, THIS IS A VALID PAUSE
+ TEST BP,PC_LAP ; IS THIS THE LAP COMPUTER?
+ JZ K41 ; NO, IT'S NOT PAUSE THIS TIME
+K39P: OR KB_FLAG_1,HOLD_STATE ; TURN ON THE HOLD FLAG
+
+;-------- ENABLE KEYBOARD
+
+ MOV AL,ENA_KBD ; ENABLE KEYBOARD
+ CALL SHIP_IT ; EXECUTE ENABLE
+
+ifdef NOT_NTVDM
+
+;------ DURING PAUSE INTERVAL, TURN CRT BACK ON
+
+ CMP CRT_MODE,7 ; IS THIS BLACK AND WHITE CARD
+ JAE K40 ; YES, NOT CGA MODES NOTHING TO DO
+ MOV DX,03D8H ; PORT FOR COLOR CARD
+ MOV AL,CRT_MODE_SET ; GET THE VALUE OF THE CURRENT MODE
+ OUT DX,AL ; SET THE CRT MODE, SO THAT CRT IS ON
+K40: ; PAUSE-LOOP
+ TEST BP,PC_LAP ; IS THIS THE LAP COMPUTER?
+ JZ K40A ; NO, SKIP THE BATTERY LIFE STUFF
+ MOV AX,4104H ; FUNCTION 41, AL=04=RETURN IF 0
+ MOV BX,HOLD_STATE*100H ; BH=HOLD_STATE, BL=0=NO TIME OUT
+ PUSH DS ; MAKE ES:DI POINT TO KB_FLAG_1
+ POP ES
+ MOV DI,OFFSET KB_FLAG_1
+ INT 15H ; SLEEP UNTIL OUT OF HOLD
+
+;------ CHECK FOR AUX ADAPTER INPUT PENDING
+K40A:
+ MOV CX,100 ; COUNT FOR WAIT LOOP
+else
+ mov ah, 3 ; K27A exit notify
+ BOP 09h
+ call DOSTI
+K40A:
+ mov cx, 16
+ xor ax, ax
+ BOP BOP_WAITIFIDLE ; idle bop
+endif
+K40B:
+ TEST KB_FLAG_1,HOLD_STATE ; ARE WE IN HOLD STATE
+ JZ K40E ; EXIT IF NOT
+
+ifdef NOT_NTVDM
+ TEST BP,PC_XT+PC_LAP ; Check for systems without AUX BIOS
+ JNZ K40B ; For them, just loop on hold flag
+
+ IN AL,STATUS_PORT ; READ CURRENT STATUS
+ AND AL,MOUSE_OBF+OUT_BUF_FULL ; MASK OFF ALL BUT MOUSE DATA BITS
+ CMP AL,MOUSE_OBF+OUT_BUF_FULL ; IS THERE STILL MOUSE DATA PENDING?
+endif
+ LOOPE K40B ; WAIT FOR MOUSE DATA TO GO
+ JNE K40A ; CONTINUE IF PAUSE STATE ;an005
+K40E:
+ifndef NOT_NTVDM
+ call DOCLI
+endif
+ AND KB_FLAG_1,NOT HOLD_STATE ; CLEAR HOLD STATE FLAG
+ JMP K27A ; INTERRUPT_RETURN_NO_EOI PTR 2247
+
+;------ TEST SPECIAL CASE KEY 55
+
+K41: ; NO-PAUSE
+ CMP AL,55 ; TEST FOR */PRTSC KEY
+ JNE K42 ; NOT-KEY-55
+ TEST BP,PC_LAP ; IS THIS THE LAP COMPUTER?
+ JZ K41B ; NO, JUMP
+ TEST BH,LC_E0 ; YES, WAS LAST CODE AN E0?
+ JZ K41A ; NO, THIS IS THE PRTSC KEY
+ JMP SHORT K42B ; YES, E0 MEANS THE "*" KEY
+
+K41B: TEST BH,KBX ; IS THIS THE ENHANCED KEYBOARD?
+ JZ K41A ; NO, CTL-PRTSC IS VALID
+ TEST BH,LC_E0 ; YES, WAS LAST CODE AN E0?
+ JZ K42B ; NO, TRANSLATE TO A FUNCTION
+K41A: MOV AX,114*256 ; START/STOP PRINTING SWITCH
+ JMP K57 ; BUFFER_FILL
+
+;------ SET UP TO TRANSLATE CONTROL SHIFT
+
+K42: ; NOT-KEY-55
+ CALL KEYB_STATE_PROCESSOR
+ JC K449 ;K26 ; TRANSLATIONS FOUND - EXIT
+
+ CMP AL,15 ; IS IT THE TAB KEY?
+ JE K42B ; YES, XLATE TO FUNCTION CODE
+ CMP AL,53 ; IS IT THE / KEY?
+ JNE K42A ; NO, NO MORE SPECIAL CASES
+ TEST BH,LC_E0 ; YES, IS IT FROM THE KEYPAD?
+ JZ K42A ; NO, JUST TRANSLATE
+ MOV AX,9500h ; YES, SPECIAL CODE FOR THIS ONE
+ JMP K57 ; BUFFER FILL
+
+K42A: MOV BX,OFFSET K8 ; SET UP TO TRANSLATE CTL
+ CMP AL,59 ; IS IT IN CHARACTER TABLE?
+ JB K45F ; YES, GO TRANSLATE CHAR
+K42B: MOV BX,OFFSET K8 ; SET UP TO TRANSLATE CTL
+ JMP K64 ; NO, GO TRANSLATE_SCAN
+PAGE
+;------ NOT IN CONTROL SHIFT
+
+K44:
+ CALL KEYB_STATE_PROCESSOR
+ JC K449 ;K26 ; TRANSLATIONS FOUND - EXIT
+
+ CMP AL,55 ; PRINT SCREEN KEY?
+ JNE K45 ; NOT-PRINT-SCREEN
+ TEST BP,PC_LAP ; IS THIS THE LAP COMPUTER?
+ JZ K441 ; NO, JUMP
+ TEST BH,LC_E0 ; YES, WAS LAST CODE THE MARKER?
+ JZ K44A ; NO, TEST THE SHIFT STATE
+ JMP SHORT K45C ; YES, XLATE TO "*" CHAR
+K441: TEST BH,KBX ; IS THIS ENHANCED KEYBOARD?
+ JZ K44A ; NO, TEST FOR SHIFT STATE
+ TEST BH,LC_E0 ; YES, LAST CODE A MARKER?
+ JNZ K44B ; YES, IS PRINT SCREEN
+ JMP SHORT K45C ; NO, XLATE TO "*" CHARACTER
+K44A: TEST BL,LEFT_SHIFT+RIGHT_SHIFT ;NOT 101 KBD, SHIFT KEY DOWN?
+ JZ K45C ; NO, XLATE TO "*" CHARACTER
+
+;------ ISSUE INTERRUPT TO PERFORM PRINT SCREEN FUNCTION
+K44B:
+ ;; NTVDM CLI ; DISABLE INTERRUPTS PTR 2355
+ AND KB_FLAG_3,NOT LC_E0+LC_E1 ;ZERO OUT THESE FLAGS
+
+ifdef NOT_NTVDM
+ MOV AL,ENA_KBD ; INSURE KEYBOARD IS ENABLED
+ CALL SHIP_IT ; EXECUTE ENABLE
+else
+ mov ah, 3 ; K27A exit notify
+ BOP 09h
+endif
+ PUSH BP ; SAVE POINTER (compatibility)
+ INT 5H ; ISSUE PRINT SCREEN INTERRUPT
+ POP BP ; RESTORE POINTER
+ JMP K27A ; EXIT WITHOUT EXTRA EOI OR ENABLE
+
+K449:
+ JMP K26 ; EXIT
+
+;------ HANDLE THE IN-CORE KEYS
+K45: ; NOT-PRINT-SCREEN
+ CMP AL,58 ; TEST FOR IN-CORE AREA
+ JA K46 ; JUMP IF NOT
+
+ TEST BH,GRAPH_ON ; IS ALT GRAPHICS ON? AEV
+ JNZ K449 ;K26 ; YES, TRASH KEYSTROKE
+
+ CMP AL,53 ; IS THIS THE "/" KEY?
+ JNE K45A ; NO, JUMP
+ TEST BH,LC_E0 ; WAS LAST CODE THE MARKER?
+ JNZ K45C ; YES, TRANSLATE TO CHARACTER
+
+K45A: MOV CX,K30_LEN ; LENGTH OF SEARCH
+ MOV DI,OFFSET K30+10 ; POINT TO TABLE OF A-Z CHARS
+ REPNE SCASB ; IS THIS A LETTER KEY?
+ JNE K45B ; NO, SYMBOL KEY
+
+ TEST BL,CAPS_STATE ; ARE WE IN CAPS_LOCK?
+ JNZ K45D ; TEST FOR SURE
+K45B: TEST BL,LEFT_SHIFT+RIGHT_SHIFT ; ARE WE IN SHIFT STATE?
+ JNZ K45E ; YES, UPPERCASE
+ ; NO, LOWERCASE
+K45C: MOV BX,OFFSET K10 ; TRANSLATE TO LOWERCASE LETTERS
+ JMP SHORT K56
+K45D: ; ALMOST-CAPS-STATE
+ TEST BL,LEFT_SHIFT+RIGHT_SHIFT ; CL ON. IS SHIFT ON, TOO?
+ JNZ K45C ; SHIFTED TEMP OUT OF CAPS STATE
+K45E: MOV BX,OFFSET K11 ; TRANSLATE TO UPPERCASE LETTERS
+K45F: JMP SHORT K56
+
+
+;------ TEST FOR KEYS F1 - F10
+K46: ; NOT IN-CORE AREA
+ CMP AL,68 ; TEST FOR F1 - F10
+ JA K47 ; JUMP IF NOT
+ JMP SHORT K53A ; YES, GO DO FN KEY PROCESS
+
+
+;------ HANDLE THE NUMERIC PAD KEYS
+
+K47: ; NOT F1 - F10
+ CMP AL,83 ; TEST FOR NUMPAD KEYS
+ JA K52 ; JUMP IF NOT
+
+;------ KEYPAD KEYS, MUST TEST NUM LOCK FOR DETERMINATION
+K48: CMP AL,74 ; SPECIAL CASE FOR MINUS
+ JE K45E ; GO TRANSLATE (US & WT ARE SAME)
+ CMP AL,78 ; SPECIAL CASE FOR PLUS
+ JE K45E ; GO TRANSLATE (US & WT ARE SAME)
+ TEST BH,LC_E0 ; IS THIS ONE OF THE NEW KEYS?
+ JNZ K49 ; YES, TRANSLATE TO BASE STATE
+
+ TEST BL,NUM_STATE ; ARE WE IN NUM_LOCK?
+ JNZ K50 ; TEST FOR SURE
+ TEST BL,LEFT_SHIFT+RIGHT_SHIFT ; ARE WE IN SHIFT STATE?
+ JNZ K51 ; IF SHIFTED, REALLY NUM STATE
+
+;------ BASE CASE FOR KEYPAD
+K49: CMP AL,76 ; SPECIAL CASE FOR BASE STATE 5
+ JNE K49A ; CONTINUE IF NOT KEYPAD 5
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 LOADED?
+ JZ K59 ;K26 ; NO, INGORE
+
+ MOV AL,0F0h ; SPECIAL ASCII CODE
+ JMP SHORT K57 ; BUFFER FILL
+K49A: MOV BX,OFFSET K10 ; BASE CASE TABLE
+ JMP SHORT K64 ; CONVERT TO PSEUDO SCAN
+
+;------ MIGHT BE NUM LOCK, TEST SHIFT STATUS
+K50: TEST BL,LEFT_SHIFT+RIGHT_SHIFT ;ALMOST-NUM-STATE
+ JNZ K49 ; SHIFTED TEMP OUT OF NUM STATE
+K51: JMP SHORT K45E ; REALLY_NUM_STATE
+ ; (US & WT ARE SAME)
+
+;------ TEST FOR THE NEW KEY ON WT KEYBOARDS
+
+K52: ; NOT A NUMPAD KEY
+ CMP AL,86 ; IS IT THE NEW WT KEY?
+ JNE K53 ; JUMP IF NOT
+ MOV AL,58 ; WE'RE GOING TO PULL A SNEAKY
+ JMP K45 ; TRICK HERE. WT TABLES ARE TOO SHORT TO
+ ; XLATE 86, SO WE'LL CHANGE IT TO CAPS_LOCK
+ ; AND PUT THE CHAR IN THE TABLES IN THE C_L
+ ; POSITION, SINCE C_L SCAN CODES NEVER GET
+ ; HERE ANYWAY.
+
+;------ MUST BE F11 OR F12
+
+K53: TEST BP,EXT_16 ; IS THE EXTENDED INT 16 THERE?
+ JZ K59 ; NO, INGORE F11 & F12 (NEAR RET)
+ ; F1 - F10 COME HERE, TOO
+K53A: TEST BL,LEFT_SHIFT+RIGHT_SHIFT ;TEST SHIFT STATE
+ JZ K49 ; JUMP, LOWERCASE PSEUDO SC'S
+
+ MOV BX,OFFSET K11 ; UPPER CASE PSEUDO SCAN CODES
+ JMP SHORT K64 ; TRANSLATE_SCAN
+PAGE
+;------ TRANSLATE THE CHARACTER
+
+K56: ; TRANSLATE-CHAR
+ DEC AL ; CONVERT ORIGIN
+ XLAT CS:K11 ; CONVERT THE SCAN CODE TO ASCII
+ TEST KB_FLAG_3,LC_E0 ; IS THIS A NEW KEY?
+ JZ K57 ; NO, GO FILL BUFFER
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 THERE?
+ JZ K57 ; NO, DO COMPATIBLE OUTPUT
+ MOV AH,MC_E0 ; YES, PUT SPECIAL MARKER IN AH
+ JMP SHORT K57 ; PUT IT INTO THE BUFFER
+
+;------ TRANSLATE SCAN FOR PSEUDO SCAN CODES
+
+K64: ; TRANSLATE-SCAN-ORGD
+ DEC AL ; CONVERT ORIGIN
+ XLAT CS:K8 ; CTL TABLE SCAN
+ MOV AH,AL ; PUT VALUE INTO AH
+ xor al,al ; ZERO ASCII CODE
+ TEST KB_FLAG_3,LC_E0 ; IS THIS A NEW KEY?
+ JZ K57 ; NO, GO FILL BUFFER
+ TEST BP,EXT_16 ; IS THE EXTENDED INT 16 THERE?
+ JZ K57 ; NO, DO COMPATIBLE OUTPUT
+ MOV AL,MC_E0 ; YES, PUT SPECIAL MARKER IN AL
+
+;------ PUT CHARACTER INTO BUFFER
+
+K57: ; BUFFER-FILL
+ CALL BUFFER_FILL
+K59:
+ JMP K26 ;-- THAT'S ALL FOLKS --
+
+KEYB_INT_9 ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: BUFFER_FILL
+;
+; Description:
+; Generate keyboard buffer entry
+;
+; Input Registers:
+; AX - the buffer entry
+; DS - BIOS data segment
+;
+; Output Registers:
+; None
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+BUFFER_ENTRY_OK DB NO ; YES if character put into buffer
+
+BUFFER_FILL PROC NEAR
+
+; CMP AL,-1 ; IS THIS AN IGNORE CHAR
+; JE K61B ; YES, EXIT (commented YST)
+ CMP AH,-1 ; LOOK FOR -1 PSEUDO SCAN
+ JE K61B ; EXIT
+;
+; BUFFER_FILL_ANY_CHAR is an alternate entry point to this PROC.
+; Entry at this point will avoid trashing ASCII values of 255.
+;
+BUFFER_FILL_ANY_CHAR LABEL NEAR
+
+ PUSH SI
+ PUSH BX
+ PUSH DS ; This routine may be called
+ ; externally so make sure DS points
+ MOV BX,DATA ; to BIOS data
+ MOV DS,BX
+
+ ;; NTVDM cli ; disable interrupts P724
+ MOV BX, BUFFER_TAIL ; GET THE END POINTER TO THE BUFFER
+ MOV SI,BX ; SAVE THE VALUE
+ INC BX ; MOVE TO NEXT WORD IN LIST
+ INC BX
+
+;; VERIFY IF THE CURRENT ROM LEVEL IN THE SYSTEM IS FOR THE ORIGINAL PC1
+
+ TEST BP,PC_81 ; CHECK FOR '81 DATE FLAG SET
+ JNE NOT_PC1 ; IF IT'S A LATER ROM RELEASE, BRANCH
+
+ CMP BX,OFFSET KB_BUFFER_END ; AT END OF BUFFER?
+ JNE K5 ; NO, CONTINUE
+ MOV BX,OFFSET KB_BUFFER ; YES, RESET TO BUFFER BEGINNING
+ JMP SHORT K5
+NOT_PC1:
+ CMP BX, BUFFER_END ; AT END OF BUFFER?
+ JNE K5 ; NO, CONTINUE
+ MOV BX, BUFFER_START ; YES, RESET TO BUFFER BEGINNING
+K5:
+ CMP BX,BUFFER_HEAD ; HAS THE BUFFER WRAPPED AROUND
+ JE K62 ; BUFFER_FULL_BEEP
+ MOV [SI],AX ; STORE THE VALUE
+ MOV BUFFER_TAIL,BX ; MOVE THE POINTER UP
+ MOV CS:BUFFER_ENTRY_OK,YES ; INDICATE WE PUT SOMETHING IN BUFFER
+ JMP SHORT K61A
+K62:
+ MOV CS:BEEP_PENDING,YES ; INDICATE WE NEED A BEEP
+K61A:
+ POP DS
+ POP BX
+ POP SI
+ ;; NTVDM sti ; enable interrupts P724
+K61B:
+ RET
+BUFFER_FILL ENDP
+
+PAGE
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Procedure: ERROR_BEEP
+;
+; Description:
+; General routine to generate beep tones
+;
+; Input Registers:
+; None
+;
+; Output Registers:
+; None
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+
+ERROR_BEEP PROC NEAR
+
+ CMP CS:BEEP_PENDING,YES ; Q..SHOULD WE BEEP?
+ JNE NO_BEEP
+
+ MOV CS:BEEP_PENDING,NO ; Reset BEEP required
+ifndef NOT_NTVDM
+ mov ah, 0eh
+ mov al, 07h
+ int 10h
+
+else
+ MOV CX,216-32 ; NUMBER OF CYCLES FOR 1/8 SECOND TONE
+ IN AL,PORT_B ; Get control info
+ PUSH AX
+LOOP01:
+ AND AL,0FCH ; Turn off timer gate and speaker
+ OUT PORT_B,AL ; output to control - speaker off
+ CALL WAITFB ; half cycle time for tone
+ OR AL,2 ; turn on speaker
+ CLI ; Disable interrupts for 1/2 cycle, 300u
+ OUT PORT_B,AL ; output to control
+ CALL WAITFB ; another half cycle
+ STI ; Enable interrupts between 1/2 cycle
+ LOOP LOOP01
+
+ POP AX
+ OUT PORT_B,AL ; Restore control
+ MOV CX,32*2 ; Short delay count of 32 cycles
+LOOP02:
+ CALL WAITFB ; Add a short delay to complete 1/8 sec
+ LOOP LOOP02 ; Repeat
+ CLI ; Disable interrupts
+endif
+
+NO_BEEP:
+ RET ; RETURN
+ERROR_BEEP ENDP
+
+
+ifdef NOT_NTVDM
+WAITFB PROC NEAR ; DELAY FOR (CX)*15.085737 US
+ PUSH AX ; SAVE WORK REGISTER (AH)
+ PUSH CX ; SAVE COUNT
+ MOV CX,19 ; The half cycle time for 1745 hz
+ TEST BP,PC_AT+PC_386 ; IF THE SYSTEM IS AN 80x86
+ JNZ WAITF1 ; SKIP TO REFRESH BIT DELAY
+
+WAITF0:
+ NOP ; Force two fetch cycles on Model 30
+ LOOP WAITF0 ; SOFTWARE DELAY LOOP ON 808x MACHINES
+
+ JMP SHORT WAITFE ; EXIT
+
+WAITF1: ; USE TIMER 1 OUTPUT BITS
+ IN AL,PORT_B ; READ CURRENT COUNTER OUTPUT STATUS
+ AND AL,REFRESH_BIT ; MASK FOR REFRESH DETERMINE BIT
+ CMP AL,AH ; DID IT JUST CHANGE
+ JE WAITF1 ; WAIT FOR A CHANGE IN OUTPUT LINE
+
+ MOV AH,AL ; SAVE NEW FLAG STATE
+ LOOP WAITF1 ; DECREMENT HALF CYCLES TILL COUNT END
+WAITFE:
+
+ POP CX ; RESTORE COUNT
+ POP AX ; RESTORE (AH)
+ RET ; RETURN (CX)= 0
+
+WAITFB ENDP
+endif
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; SHIP_IT
+;
+; THIS ROUTINE HANDLES TRANSMISSION OF COMMAND AND DATA BYTES
+; TO THE KEYBOARD CONTROLLER.
+;
+; On entry the AL contains the command byte.
+; On Enable keyboard commands, the reset keyboard input latch is done
+; if the system is the old PC type.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SHIP_IT PROC NEAR
+
+ifdef NOT_NTVDM
+;------- TEST SYSTEM TYPE
+ PUSHF ; SAVE FLAGS P725
+ CLI ; DISABLE INTERRUPTS TILL DATA SENT
+
+ TEST BP,PC_XT+PC_LAP
+ JZ SI5 ; USE AT 8042 COMMAND IF NOT PC TYPE
+
+ CMP AL,ENA_KBD ; CHECK FOR ENABLE KEYBOARD COMMAND
+ JNE SI9 ; SKIP ENABLE RESET
+ ; FOR PC, XT, P12: RESET THE KEYBOARD
+ PUSH AX ; SAVE AX
+ IN AL,KB_CTL ; GET THE CONTROL PORT
+ MOV AH,AL ; SAVE VALUE
+ OR AL,80H ; RESET BIT FOR KEYBOARD ON PC/PC-XT
+ OUT KB_CTL,AL
+ XCHG AH,AL ; GET BACK ORIGINAL CONTROL
+ OUT KB_CTL,AL ; KB HAS BEEN RESET
+ POP AX ; RESTORE AX
+ ; EXIT as NOT next system
+SI5:
+ TEST BP,PC_AT+PC_386 ; IF THE SYSTEM IS NOT AN 80x86
+ JZ SI9 ; MACHINE, EXIT THIS PROC.
+
+;------- WAIT FOR COMMAND TO BE ACCEPTED;
+
+ CALL chk_ibf ; GO READ KEYBOARD CONTROLLER STATUS
+endif
+
+ OUT STATUS_PORT,AL ; SEND TO KEYBOARD CONTROLLER
+
+ifdef NOT_NTVDM
+SI9: ; ENABLE INTERRUPTS AGAIN
+ POPF ; RESTORE FLAGS P725
+endif
+ RET ; RETURN TO CALLER
+SHIP_IT ENDP
+
+ifdef NOT_NTVDM
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; SND_DATA
+;
+; THIS ROUTINE HANDLES TRANSMISSION OF COMMAND AND DATA BYTES
+; TO THE KEYBOARD AND RECEIPT OF ACKNOWLEDGEMENTS. IT ALSO
+; HANDLES ANY RETRIES IF REQUIRED
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SND_DATA PROC NEAR
+ PUSH AX ; SAVE REGISTERS
+ PUSH BX ; *
+ PUSH CX
+ MOV BH,AL ; SAVE TRANSMITTED BYTE FOR RETRIES
+
+ MOV BL,3 ; LOAD RETRY COUNT
+SD0:
+ CLI ; DISABLE INTERRUPTS
+ AND KB_FLAG_2,NOT (KB_FE+KB_FA+kb_err) ; CLEAR ACK, RESEND and
+ ; error flags
+
+ CALL CHK_IBF ; Wait for command accepted
+
+ MOV AL,BH ; REESTABLISH BYTE TO TRANSMIT
+ OUT PORT_A,AL ; SEND BYTE
+ STI ; ENABLE INTERRUPTS
+ MOV CX,DLY_15MS ; DELAY FOR 15 ms TIMEOUT
+SD1: TEST KB_FLAG_2,KB_FE+KB_FA ; SEE IF EITHER BIT SET
+ JNZ SD3 ; IF SET, SOMETHING RECEIVED GO PROCESS
+ IN AL,PORT_B ; WAIT LOOP USING REFRESH BIT
+ AND AL,REFRESH_BIT
+ CMP AL,AH
+ JE SD1 ; KEEP TESTING
+ MOV AH,AL ; DEC CX ON REFRESH TIC
+ LOOP SD1 ; KEEP TESTING
+ ; !! TIMEOUT !!
+
+SD2: DEC BL ; DECREMENT RETRY COUNT
+ JNZ SD0 ; RETRY TRANSMISSION
+ OR KB_FLAG_2,KB_ERR ; TURN ON TRANSMIT ERROR FLAG
+ JMP SHORT SD4 ; RETRIES EXHAUSTED FORGET TRANSMISSION
+
+SD3: TEST KB_FLAG_2,KB_FA ; SEE IF THIS IS AN ACKNOWLEDGE
+ JZ SD2 ; IF NOT, GO RESEND
+
+SD4: POP CX ; RESTORE REGISTERS
+ POP BX
+ POP AX ; *
+ RET ; RETURN, GOOD TRANSMISSION
+SND_DATA ENDP
+endif
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; SND_LED
+;
+; THIS ROUTINE TURNS ON THE MODE INDICATORS.
+;
+; NTVDM - we do not need to update led's as this is controlled
+; by the host\system. We also assume that interrupts are
+; off upon entry
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SND_LED PROC NEAR
+ifdef NOT_NTVDM
+ CLI ; TURN OFF INTERRUPTS
+
+ TEST BP,PC_AT+PC_386 ; IF THE SYSTEM IS NOT A 80x86
+ JZ SL1 ; MACHINE, EXIT THIS PROC
+endif
+
+ TEST KB_FLAG_2,KB_PR_LED ; CHECK FOR MODE INDICATOR UPDATE
+ JNZ SL1 ; DONT UPDATE AGAIN IF UPDATE UNDERWAY
+ OR KB_FLAG_2,KB_PR_LED ; TURN ON UPDATE IN PROCESS
+ifdef NOT_NTVDM
+ MOV AL,LED_CMD ; LED CMD BYTE
+ CALL SND_DATA ; SEND DATA TO KEYBOARD
+ CLI
+endif
+ CALL MAKE_LED ; GO FORM INDICATOR DATA BYTE
+ AND KB_FLAG_2,0F8H ; CLEAR MODE INDICATOR BITS
+ OR KB_FLAG_2,AL ; SAVE PRESENT INDICATORS FOR NEXT TIME
+
+ mov ah, 3 ; inform softpc to set lights
+ BOP 16h
+
+
+ifdef NOT_NTVDM
+ TEST KB_FLAG_2,KB_ERR ; TRANSMIT ERROR DETECTED
+ JNZ SL2 ; YES, BYPASS SECOND BYTE TRANSMISSION
+ CALL SND_DATA ; SEND DATA TO KEYBOARD
+ CLI ; TURN OFF INTERRUPTS
+ TEST KB_FLAG_2,KB_ERR ; TRANSMIT ERROR DETECTED
+ JZ SL3 ; IF NOT, DONT SEND AN ENABLE COMMAND
+SL2: MOV AL,KB_ENABLE ; GET KEYBOARD CSA ENABLE COMMAND
+ CALL SND_DATA ; SEND DATA TO KEYBOARD
+ CLI ; TURN OFF INTERRUPTS
+endif
+
+SL3: AND KB_FLAG_2,NOT(KB_PR_LED+KB_ERR) ; TURN OFF MODE INDICATOR
+ ; UPDATE AND TRANSMIT ERROR FLAG
+SL1:
+ifdef NOT_NTVDM
+ STI ; ENABLE INTERRUPTS
+endif
+ RET ; RETURN TO CALLER
+SND_LED ENDP
+PAGE
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; MAKE_LED
+;
+; THIS ROUTINE FORMS THE DATA BYTE NECESSARY TO TURN ON/OFF
+; THE MODE INDICATORS
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+MAKE_LED PROC NEAR
+ PUSH CX ; SAVE CX
+ MOV AL, KB_FLAG ; GET CAPS & NUM LOCK INDICATORS
+ AND AL,CAPS_STATE+NUM_STATE+SCROLL_STATE ; ISOLATE INDICATORS
+ MOV CL,4 ; SHIFT COUNT
+ ROL AL,CL ; SHIFT BITS OVER TO TURN ON INDICATORS
+ AND AL,07H ; MAKE SURE ONLY MODE BITS ON
+ POP CX
+ RET ; RETURN TO CALLER
+MAKE_LED ENDP
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; CHK_IBF
+;
+; Description:
+; Waits for a keyboard command to be accepted
+; wait until ibf = 0 (empty)
+;
+; Input Registers:
+; None
+;
+; Output Registers:
+; ZF=0 time out & IBF still full
+; ZF=1 IBF is empty
+;
+; ---------------------------------------------------------------
+; This procedure replaces the previous one which used a software
+; timing loop. (For 80286, 80386 and 80486 based machines.)
+; ---------------------------------------------------------------
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+chk_ibf proc near
+
+ push ax ; Save register used
+ push cx
+ mov cx,DLY_15MS ; Timeout 15 milleseconds (15000/15.086;
+chk_ibfl:
+ in al,PORT_B ; Read current refresh output bit
+ and al,refresh_bit ; Mask all but refresh bit
+ cmp al,ah ; Did it change? (or first pass thru)
+ jz short chk_ibfl ; No, wait for change, else continue
+
+ mov ah,al ; Save new refresh bit state
+ in al,status_port ; Read status port
+ test al,inpt_buf_full ; Check for input buffer empty
+ loopnz chk_ibfl ; Loop until input buf empty or timeout;
+
+ pop cx
+ pop ax ; Restore register used
+ ret ; Return to caller
+
+chk_ibf endp
+
+
+
+DOSTI proc near
+ FSTI
+ ret
+DOSTI endp
+
+DOCLI proc near
+ FCLI
+ ret
+DOCLI endp
+
+DOIRET:
+ FIRET
+
+CODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybi9c.inc b/private/mvdm/dos/v86/cmd/keyb/keybi9c.inc
new file mode 100644
index 000000000..2aee5530b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybi9c.inc
@@ -0,0 +1,38 @@
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBI9C.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; External declarations and equates for procedures in file
+;; KEYBI9C.ASM
+;;
+;; Change History:
+;; ---------------
+;; Delete unused externs
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN KEYB_INT_9:NEAR ;;
+ EXTRN K8:BYTE ;;
+ EXTRN BUFFER_FILL:NEAR ;;
+ EXTRN COUNTRY_FLAG:BYTE ;;
+ EXTRN COPY_NLS1_FLAG:BYTE ;; (YST)
+ EXTRN BEEP_PENDING:BYTE ;;
+ EXTRN SCAN_CODE:BYTE ;;
+ EXTRN CHK_IBF:NEAR ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
+
+
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybmac.inc b/private/mvdm/dos/v86/cmd/keyb/keybmac.inc
new file mode 100644
index 000000000..1d7b37919
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybmac.inc
@@ -0,0 +1,420 @@
+.XLIST
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (C) Copyright IBM Corp 198?,...
+;;
+;; File Name: KEYBMAC.INC
+;; ----------
+;;
+;; Author: Bill Devlin - IBM Canada Laboratory - May 1986
+;; ------- ???????????
+;;
+;; 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 ;;
+RUS_MODE EQU 01H ;; Added YST for Cyrillic keyboard
+LAT_MODE EQU 00H ;; 1/21/91
+ ;; NLS_FLAG_2 : nothing defined yet
+CARON EQU 80H
+BREVE EQU 40H
+OVERCIRCLE EQU 20H
+OGONEK EQU 10H
+OVERDOT EQU 08H
+DOUBLEACUTE EQU 04H
+
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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 ;;
+TILDE_TILDE EQU 34 ;;
+ALT_CASE EQU 35 ;;
+CTRL_CASE EQU 36 ;;
+NUMERIC_PAD EQU 37 ;;
+DIVIDE_SIGN EQU 38 ;;
+BOTLH_CAPS EQU 39 ;;
+BOTRH_CAPS EQU 40 ;;
+BOTLH_F_CAPS EQU 41 ;;
+BOTRH_F_CAPS EQU 42 ;;
+RUS_MODE_SET EQU 43 ;; Added YST for Cyrillic keyboard
+ ;;
+;************************************************
+; Mihindu 11/30/90 - Added Eastern Europe support
+;************************************************
+CARON_SPACE EQU 43
+CARON_LOWER EQU 44
+CARON_UPPER EQU 45
+BREVE_SPACE EQU 46
+BREVE_LOWER EQU 47
+BREVE_UPPER EQU 48
+OVERCIRCLE_SPACE EQU 49
+OVERCIRCLE_LOWER EQU 50
+OVERCIRCLE_UPPER EQU 51
+OGONEK_SPACE EQU 52
+OGONEK_LOWER EQU 53
+OGONEK_UPPER EQU 54
+OVERDOT_SPACE EQU 55
+OVERDOT_LOWER EQU 56
+OVERDOT_UPPER EQU 57
+DOUBLEACUTE_SPACE EQU 58
+DOUBLEACUTE_LOWER EQU 59
+DOUBLEACUTE_UPPER EQU 60
+
+;******************************************************
+; M000 --- new state for KDFJP.ASM (Kermit) *******
+;******************************************************
+
+DBCS_OLD_A EQU 61 ; M000 (JP9009)
+
+NON_ALPHA_LOWER_LAT EQU 62
+NON_ALPHA_UPPER_LAT EQU 63
+ALPHA_LOWER_LAT EQU 64
+ALPHA_UPPER_LAT EQU 65
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Logic Macros
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+
+UNKNOWN = 255
+
+FIND_FLAG MACRO FLAG_MASK
+ IFIDN <FLAG_MASK>,<SCAN_MATCH>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_SHIFT>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CAPS_STATE>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<NUM_STATE>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_CTL>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_ALT>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LEFT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<RIGHT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ALT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CTL_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<R_ALT_SHIFT>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<R_CTL_SHIFT>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<TILDE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ACUTE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<GRAVE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<DIARESIS>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CEDILLA>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CIRCUMFLEX>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CARON>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<BREVE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OVERCIRCLE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OGONEK>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OVERDOT>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<DOUBLEACUTE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LC_E0>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+;; ============================================================
+;; For Cyrillic keyboards (YST)
+;; ============================================================
+ IFIDN <FLAG_MASK>,<SHIFTS_PRESSED>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<RUS_MODE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LAT_MODE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+;; ============================================================
+;; End of Cyrillic keyboards (YST)
+;; ============================================================
+ FLAG_ID = UNKNOWN
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+RESET_NLS1 MACRO
+ DB RESET_NLS1_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
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybmsg.inc b/private/mvdm/dos/v86/cmd/keyb/keybmsg.inc
new file mode 100644
index 000000000..25ba696af
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybmsg.inc
@@ -0,0 +1,47 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBMSG.INC
+;; ----------
+;;
+;; Root File Name: KEYBCMD.ASM (KEYB.ASM)
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; External declarations for procedures in file KEYBCMD.ASM.
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN ACT_KEYB_CP :BYTE ;;
+ EXTRN ACT_CON_CP :BYTE ;;
+ EXTRN ACT_KEYB :BYTE ;;
+ EXTRN INV_L :BYTE ;;
+ EXTRN INV_I :BYTE ;;
+ EXTRN INV_CP :BYTE ;;
+ EXTRN INV_S :BYTE ;;
+ EXTRN INV_FN :BYTE ;;
+ EXTRN INV_KEYB_Q :BYTE ;;
+ EXTRN INV_CON_Q :BYTE ;;
+ EXTRN NOT_DESIG :BYTE ;;
+ EXTRN NOT_SUPP :BYTE ;;
+ EXTRN NOT_VALID1 :BYTE ;;
+ EXTRN NOT_VALID2 :BYTE ;;
+ EXTRN WARNING_1 :BYTE ;;
+ EXTRN INV_COMBO :BYTE ;;
+ EXTRN CR_LF :BYTE ;;
+ EXTRN MEMORY_OVERF :BYTE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybshar.inc b/private/mvdm/dos/v86/cmd/keyb/keybshar.inc
new file mode 100644
index 000000000..05191195c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybshar.inc
@@ -0,0 +1,337 @@
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1991
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; 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:
+;; ---------------
+;;
+;; ;jwg ; - Feb 1990 For 4.03.
+;; ;AN007; - Add Patriot/Sebring determination code for HOT Replug
+;; so that INT 9 handler can alter keyboard Scan Code set.
+;; ;M030 Merged IBM (Kermit - JP), KEYBOARD.SYS and KEYB.COM
+;; versions of this file into one.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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 ;; M030 Merged back for kdfcf.asm
+;;========================================
+;; Added YST for Cyrillic keyboards
+;; 1/21/90
+;;========================================
+SHIFTS_TO_LOGIC EQU 2000H ;; - transfer CTRL, SHIFT, ALT keys
+ ;; to LOGIC section
+ ;;
+SWITCHABLE EQU 1000H ;; - Driver can use NLS/Def mode
+ ;; switching (like Rus/Lat mode)
+ ;; Used for Int 2Fh, function 0AD83h answer
+;;========================================
+;; End of YST
+;;========================================
+JR_KB equ 8000h ;; M030 Merged back for kdfcf.asm
+ ;; Some useful scan codes:
+F1_SCAN EQU 59 ;; F1
+F2_SCAN EQU 60 ;; F2
+ ;;
+ ;; SYSTEM_FLAG / Hardware equates:
+ ;; INT 16h and remote support
+EXT_16 EQU 8000H ;; extended INT 16h support is there
+EXT_122 EQU 4000H ;; extended INT 16h for 122 is there
+; EQU 2000H ;; unused
+PC_NET EQU 1000H ;; flag PC Net is installed
+ ;; System type/hardware support flags
+PC_81 EQU 0800H ;; flag for Original PC
+PC_XT EQU 0400H ;; code for PC, PC/XT, PORTABLE
+PC_LAP EQU 0200H ;; code for Convertiable (p-12)
+PC_PAL EQU 0080H ;; code for Model 30 (PALACE)
+PC_AT EQU 0040H ;; code for PC-AT with 8042
+PC_386 EQU 0020H ;; code for PS/2's with 8042 (WRANGLER)
+PS_8042 EQU 0010H ;; 8042 is a Patriot/Sebring type array;AN007;jwg
+ ;; or system set translate OFF (SCS=01)
+SECURITY_ACTIVE EQU 0008h ; M030 ;; Server password mode is active
+; ; M030 ;; This bit becomes off from on when
+; ; M030 ;; correct password is entered JP9010
+ ;;
+ ;; 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
+ dd 0 ;; reserved
+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
+ db 5 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
+INVOKED_KBD_ID DW 0 ;; WGR invoked keyboard id. ;AN000
+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
+ ;;
+SHIFTS_PRESSED EQU 04H ;; set if any SHIFT, ALT, CTRL key
+ ;; pressed (added YST for Cyrillic keyb.)
+ ;;
+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 ;;
+XT_KB EQU 4000H ;;
+AT_KB EQU 2000H ;;
+G_KB EQU 1000H ;;
+P_KB EQU 0800H ;;
+P12_KB EQU 0400H ;;
+DBCS_OLD_A_KB EQU 0080H ; M030 ;; JP9009
+DBCS_OLD_P_KB EQU 0040H ; M030 ;; JP9009
+DBCS_OLD_G_KB EQU 0020H ; M030 ;; JP9009
+DBCS_OLD_KB EQU 00C0H ; M030 ;; JP9009
+DBCS_KB EQU 0020H ; M030 ;; JP9009
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybsys.inc b/private/mvdm/dos/v86/cmd/keyb/keybsys.inc
new file mode 100644
index 000000000..25993d6b5
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybsys.inc
@@ -0,0 +1,139 @@
+.XLIST
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; File Name: KEYBSYS.INC
+;; ----------
+;;
+;; Root File Name: KEYB.ASM
+;; ---------------
+;;
+;; Description:
+;; ------------
+;; Include file containing structure definitions and equates
+;; for the KEYBOARD.SYS file.
+;;
+;; Change History:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; File header - contains pointers to keyboard tables for each language
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+KEYBSYS_HEADER STRUC ;;
+ ;;
+KH_SIGNATURE DB 0FFh,'KEYB ' ;; signature
+KH_RESV_1 DB 8 DUP(0) ;; reserved
+KH_MAX_COM_SZ DW 0 ;AN000;**chg ;; maximum size of Common Xlat Sect
+KH_MAX_SPEC_SZ DW 0 ;AN000;;**chg ;; max size of Specific Xlat Sect
+KH_MAX_LOGIC_SZ DW 0 ;AN000;;**chg ;; max size of State Logic
+KH_RESV_2 Dw 0 ;AN000;;**chg ;; reserved CNS
+KH_NUM_ID Dw 0 ;AN000;;; ************* CNS
+KH_NUM_LANG DW 0 ;; number of languages
+KH_LANG_PTRS DB 0 ;; language pointers start here
+;********************* CNS **********************
+;KH_NUM_ID DW 0 ;; number of languages
+;KH_ID_PTRS DB 0 ;; id pointers start here
+;********************* CNS **********************
+KEYBSYS_HEADER ENDS ;;
+;******************CNS*******************
+KEYBSYS_ID_PTRS STRUC
+
+KP_ID_CODE DW 0 ;AN000;
+KP_LANG_PTR DD 0 ;AN000;
+
+KEYBSYS_ID_PTRS ENDS
+ ;;
+;*****************CNS********************
+KEYBSYS_LANG_PTRS STRUC ;;
+ ;; Next two entries repeat:
+KP_LANG_CODE DW 0 ;; language code
+KP_ENTRY_PTR DD 0 ;; language entry pointer
+ ;;
+KEYBSYS_LANG_PTRS ENDS ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Language Entry - pointed to by KH_ENTRY_PTR in KEYBSYS_HEADER
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+KEYBSYS_LANG_ENTRY STRUC ;;
+ ;;
+KL_LANG_CODE DW 'XX' ;; language code
+KL_ID_CODE DW 0 ;; reserved (ID CODE)
+KL_LOGIC_PTR DD 0 ;AC000;;**chg ;; State Logic pointer
+KL_NUM_ID DB 0 ;AN000;;CNS ;; number of valid IDs for this lang
+KL_NUM_CP DB 0 ;; number of valid CPs for this lang
+KL_CP_PTRS DB 0 ;; CP table pointers start here
+ ;;
+KEYBSYS_LANG_ENTRY ENDS ;;
+ ;;
+KEYBSYS_CP_PTRS STRUC ;;
+ ;; Next two entries repeat:
+KC_CODE_PAGE DW 0 ;; code page
+KC_ENTRY_PTR DD 0 ;; ptr to Specific Translate Section
+ ;;
+KEYBSYS_CP_PTRS ENDS ;;
+ ;;
+ ;;
+;; Everything from here down is new
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; State Logic - pointed to by KL_LOGIC_PTR in KEYBSYS_LANG_ENTRY
+;; Common Translate Section follows immediately after the State Logic.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+KEYBSYS_STATE_LOGIC STRUC ;;
+ ;;
+KT_LOGIC_LEN DW ? ;; length of state logic
+KT_SPECIAL_FEATURES DW ? ;; Special Features (see KEYBSHAR.INC)
+KT_LOGIC_CMDS DB 0 ;; state logic commands begin here
+ ;;
+KEYBSYS_STATE_LOGIC ENDS ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Translate Section - Common and Specific Translate Sections
+;; are both in this form.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+KEYBSYS_XLAT_SECT STRUC ;;
+ ;;
+KX_SECTION_LEN DW ? ;; Length of this section
+KX_CP_ID DW ? ;; code page id
+KX_FIRST_STATE DB ? ;;
+ ;;
+KEYBSYS_XLAT_SECT ENDS ;;
+ ;;
+ ;;
+KEYBSYS_STATE STRUC ;;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; Translate Sections contains multiple States.
+ ;; A State contains the translate tables for a single
+ ;; shift state (IE lower case, upper case ....)
+ ;; The last State is a null State containing only the
+ ;; KX_STATE_LEN field with a value of 0.
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+KX_STATE_LEN DW ? ;; length of state section
+KX_STATE_ID DB ? ;; State ID
+KX_KBD_TYPE DW ? ;; Keyboard Type
+KX_ERROR_CHAR DW ? ;; Buffer entry for error character
+KX_FIRST_XLAT DB ? ;; XLAT tables begin here
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;; Each State consists of multiple translate tables.
+ ;; The last translate table within a state is a null
+ ;; table containing only the
+ ;; KX_XLAT_LEN field with a value of 0.
+ ;; Refer to KEYBSHAR.INC for translate table format.
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+KEYBSYS_STATE ENDS ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybtbbl.asm b/private/mvdm/dos/v86/cmd/keyb/keybtbbl.asm
new file mode 100644
index 000000000..4649b0a7b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybtbbl.asm
@@ -0,0 +1,838 @@
+ PAGE ,132
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+; File Name: KEYBTBBL.ASM
+; ----------
+;
+; Description:
+; ------------
+; Build SHARED_DATA_AREA with parameters specified
+; in KEYBCMD.ASM
+;
+; Documentation Reference:
+; ------------------------
+; None
+;
+; Procedures Contained in This File:
+; ----------------------------------
+; TABLE_BUILD: Build the header sections of the SHARED_DATA_AREA
+; STATE_BUILD: Build the state sections in the table area
+; FIND_CP_TABLE: Given the language and code page parm, determine the
+; offset of the code page table in KEYBOARD.SYS
+;
+; Include Files Required:
+; -----------------------
+; KEYBSHAR.INC
+; KEYBSYS.INC
+; KEYBDCL.INC
+; KEYBI2F.INC
+;
+; External Procedure References:
+; ------------------------------
+; None
+;
+; Change History:
+; ---------------
+;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ PUBLIC TABLE_BUILD
+ PUBLIC FIND_CP_TABLE
+ PUBLIC CPN_INVALID
+ PUBLIC SD_LENGTH
+
+CODE SEGMENT PUBLIC 'CODE'
+
+ INCLUDE KEYBEQU.INC
+ INCLUDE KEYBSHAR.INC
+ INCLUDE KEYBSYS.INC
+ INCLUDE KEYBCMD.INC
+ INCLUDE KEYBDCL.INC
+ INCLUDE COMMSUBS.INC
+ INCLUDE KEYBCPSD.INC
+
+ ASSUME cs:CODE,ds:CODE
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: TABLE_BUILD
+;
+; Description:
+; Create the table area within the shared data structure. Each
+; table is made up of a descriptor plus the state sections.
+; Translate tables are found in the Keyboard definition file and are
+; copied into the shared data area by means of the STATE_BUILD
+; routine.
+;
+; Input Registers:
+; ds - points to our data segment
+; es - points to our data segment
+; bp - points at beginning of CMD_PARM_LIST
+;
+; SHARED_DATA_STR must be allocated in memory
+;
+; The following variables must also be passed from KEYB_COMMAND
+; KEYBSYS_FILE_HANDLE is set to file handle after opening file
+; CP_TAB_OFFSET is the offset of the CP table in the SHARED_DATA_AREA
+; STATE_LOGIC_OFFSET is the offset of the state section in the SHARED_DATA_AREA
+; SYS_CODE_PAGE is the binary representation of the system CP
+; KEYBCMD_LANG_ENTRY_PTR is a pointer to the lang entry in KEY DEF file
+; DESIG_CP_BUFFER is the buffer which holds a list of designated CPs
+; DESIG_CP_OFFSET:WORD is the offset of that list
+; NUM_DESIG_CP is the number of CPs designated
+; FILE_BUFFER is the buffer to read in the KEY DEF file
+;**********CNS ***************************************
+; ID_PTR_SIZE is the size of the ID ptr structure
+;**********CNS ***************************************
+; LANG_PTR_SIZE is the size of the lang ptr structure
+; CP_PTR_SIZE is the size of the CP ptr structure
+; NUM_CP is the number of CPs in the KEYB DEF file for that lang
+; SHARED_AREA_PTR segment and offset of the SHARED_DATA_AREA
+;
+;
+; Output Registers:
+; cx - RETURN_CODE := 0 - Table build successful
+; 1 - Table build unsuccessful - ERROR 1
+; (Invalid language parm)
+; 2 - Table build unsuccessful - ERROR 2
+; (Invalid Code Page parm)
+; 3 - Table build unsuccessful - ERROR 3
+; (Machine type unavaliable)
+; 4 - Table build unsuccessful - ERROR 4
+; (Bad or missing keyboard def file)
+; 5 - Table build unsuccessful - ERROR 5
+; (Memory overflow occurred)
+; Logic:
+; Calculate Offset difference between TEMP and SHARED_DATA_AREAs
+; Get LANGUAGE_PARM and CODE_PAGE_PARM from parm list
+; Call FIND_CP_TABLE := Determine whether CP is valid for given language
+; IF CP is valid THEN
+; Store them in the SHARED_DATA_AREA
+; Prepare to read Keyboard definition file by LSEEKing to the top
+; READ the header
+; Store maximum table values for calculation of RES_END
+; Set di to point at TABLE_AREA within SHARED_DATA_AREA
+; FOR the state logic section of the specified language:
+; IF STATE_LOGIC_PTR is not -1 THEN
+; LSEEK to state logic section in keyboard definition file
+; READ the state logic section into the TABLE_AREA
+; Set the hot keyb scan codes
+; Set the LOGIC_PTR in the header
+; FOR the common translate section:
+; IF Length parameter is not 0 THEN
+; Build state
+; Set the COMMON_XLAT_PTR in the header
+; FOR the specific translate sections:
+; Establish addressibility to list of designated code pages
+; FOR each code page
+; IF CP_ENTRY_PTR is not -1 THEN
+; Determine offset of CP table in Keyb Def file
+; IF CP table not avaliable THEN
+; Set CPN_INVALID flag
+; ELSE
+; LSEEK to CPn state section in keyboard definition file
+; IF this is the invoked code page THEN
+; Set ACTIVE_XLAT_PTR in SHARED_DATA_AREA
+; Update RESIDENT_END ptr
+; Build state
+; Update RESIDENT_END ptr
+; End
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FB EQU FILE_BUFFER
+KB_MASK EQU 02H
+
+FIRST_XLAT_TAB DW 0
+NEXT_SECT_PTR DW -1
+
+MAX_COM_SIZE DW ?
+MAX_SPEC_SIZE DW ?
+MAX_LOGIC_SIZE DW ?
+
+RESIDENT_END_ACC DW 0
+SA_HEADER_SIZE DW SIZE SHARED_DATA_STR;
+PARM_LIST_OFFSET DW ?
+;********************CNS*************************
+TB_ID_PARM DW 0
+;********************CNS*************************
+TB_LANGUAGE_PARM DW 0
+TB_CODE_PAGE_PARM DW 0
+
+CPN_INVALID DW 0
+
+KEYB_INSTALLED DW 0
+SD_AREA_DIFFERENCE DW 0
+SD_LENGTH DW 2000
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+TABLE_BUILD PROC NEAR
+
+ mov ax,OFFSET SD_SOURCE_PTR ; Setup the difference
+ sub ax,OFFSET SD_DesT_PTR ; value used to calculate
+ mov SD_AREA_DIFFERENCE,ax ; new ptr values for
+ ; SHARED_DATA_AREA
+ mov ax,[bp].ID_PARM ; Get id parameter
+ mov TB_ID_PARM,ax
+ mov ax,[bp].LANGUAGE_PARM ; Get language parameter
+ mov TB_LANGUAGE_PARM,ax
+ mov bx,[bp].CODE_PAGE_PARM ; Get code page parameter
+ mov TB_CODE_PAGE_PARM,bx
+ ; Make sure code page is
+ call FIND_CP_TABLE ; valid for the language
+ jcxz TB_CHECK_CONTINUE1 ; IF code page is found
+ jmp TB_ERROR6 ; for language THEN
+
+TB_CHECK_CONTINUE1:
+ mov bp,OFFSET SD_SOURCE_PTR ; Put language parm and
+ mov ax,TB_ID_PARM ; id parm and..
+ mov es:[bp].INVOKED_KBD_ID,ax
+ mov bx,TB_CODE_PAGE_PARM
+ mov es:[bp].INVOKED_CP_TABLE,bx ; code page parm into the
+ mov ax,TB_LANGUAGE_PARM ; SHARED_DATA_AREA
+ mov word ptr es:[bp].ACTIVE_LANGUAGE,ax
+
+ mov bx,KEYBSYS_FILE_HANDLE ; Get handle
+ xor dx,dx ; LSEEK file pointer
+ xor cx,cx ; back to top of file
+ mov ax,4200h ; If no problem with
+ int 21H ; Keyboard Def file THEN
+ jnc TB_START
+ jmp TB_ERROR4
+
+TB_START: ; Else
+ xor di,di ; Set number
+ LEA cx,[di].KH_MAX_LOGIC_SZ+2 ; bytes to read header
+ mov dx,OFFSET FILE_BUFFER ; Move contents into file buffer
+ mov ah,3FH ; READ
+ push cs
+ pop ds
+ int 21H ; File
+ jnc TB_CONTINUE1
+ jmp TB_ERROR4
+
+TB_CONTINUE1:
+ cmp cx,ax
+ je TB_ERROR_CHECK1
+ mov cx,4
+ jmp TB_CPN_INVALID
+
+TB_ERROR_CHECK1:
+ mov cx,FB.KH_MAX_COM_SZ ; Save values for RESIDENT_END
+ mov MAX_COM_SIZE,cx ; calculation
+ mov cx,FB.KH_MAX_SPEC_SZ
+ mov MAX_SPEC_SIZE,cx
+ mov cx,FB.KH_MAX_LOGIC_SZ
+ mov MAX_LOGIC_SIZE,cx
+
+ LEA di,[bp].TABLE_AREA ; Point at beginning of table area
+ ; di ---> TABLE_AREA
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ** FOR STATE LOGIC SECTION FOR LANG **
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+TB_STATE_BEGIN:
+ mov bx,KEYBSYS_FILE_HANDLE ; Get handle
+ mov cx,word ptr STATE_LOGIC_OFFSET+2
+ mov dx,word ptr STATE_LOGIC_OFFSET ; Get LSEEK file pointer
+
+ cmp dx,-1 ; If no language table then
+ jnz TB_STATE_CONTINUE1 ; jump to code page begin
+ jmp TB_CP_BEGIN
+
+TB_STATE_CONTINUE1: ; Else
+ mov ax,4200h ; LSEEK to begin of state logic sect
+ int 21H ; Keyboard Def file THEN
+ jnc TB_STATE_CONTINUE2
+ jmp TB_ERROR4
+
+TB_STATE_CONTINUE2:
+ mov dx,ax
+ mov word ptr SB_STATE_OFFSET+2,cx ; Save the offset of the
+ mov word ptr SB_STATE_OFFSET,dx ; states in Keyb Def file
+
+ sub di,SD_AREA_DIFFERENCE ; Adjust for relocation
+ mov es:[bp].LOGIC_PTR,di ; Set because this is state
+ add di,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+ mov cx,4 ; Set number bytes to read length and
+ ; special features
+ mov dx,OFFSET FILE_BUFFER ; Set the buffer address
+ mov ah,3FH ; Read from the Keyb Def file
+ int 21H
+ jnc TB_STATE_CONTINUE3
+ jmp TB_ERROR4
+
+TB_STATE_CONTINUE3:
+ cmp cx,ax
+ je TB_ERROR_CHECK2
+ mov cx,4
+ jmp TB_CPN_INVALID
+
+TB_ERROR_CHECK2:
+ mov ax,FB.KT_SPECIAL_FEATURES ; Save the special features in the
+ mov es:[bp].SPECIAL_FEATURES,ax ; SHARED_DATA_AREA
+
+
+ mov es:[bp].HOT_KEY_ON_SCAN,F1_SCAN
+ mov es:[bp].HOT_KEY_OFF_SCAN,F2_SCAN
+
+HOT_KEY_SET:
+ mov cx,FB.KT_LOGIC_LEN ; Set length of section to read
+ or cx,cx
+ jnz TB_STATE_CONTINUE4
+
+ dec cx ; cx = -1
+ mov es:[bp].LOGIC_PTR,cx
+ jmp short SB_COMM_BEGIN
+
+TB_STATE_CONTINUE4:
+ mov es:[di],cx ; Store length parameter in
+ add di,2 ; SHARED_DATA_AREA
+ mov cx,FB.KT_SPECIAL_FEATURES ; Save the special features
+ mov es:[di],cx
+ add di,2
+ mov cx,FB.KT_LOGIC_LEN ; Set length of section to read
+ sub cx,4 ; Adjust for what we have already read
+ mov dx,di ; Set the address of SHARED_DATA_AREA
+ push es
+ pop ds
+ mov ah,3FH ; Read logic section from the
+ int 21H ; Keyb Def file
+ push cs
+ pop ds
+ jnc TB_STATE_CONTINUE5
+ jmp TB_ERROR4
+
+TB_STATE_CONTINUE5:
+ cmp cx,ax
+ je TB_ERROR_CHECK3
+ mov cx,4
+ jmp TB_CPN_INVALID
+
+TB_ERROR_CHECK3:
+ add di,cx ; Set di at new beginning of area
+ ; TABLE_AREA
+ ; STATE_LOGIC
+ mov cx,RESIDENT_END_ACC ; di --->
+ add cx,SA_HEADER_SIZE
+ add cx,MAX_LOGIC_SIZE
+ mov RESIDENT_END_ACC,cx ; Refresh Resident end size
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ** FOR COMMON TRANSLATE SECTION FOR LANG **
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+SB_COMM_BEGIN:
+ mov cx,SIZE KEYBSYS_XLAT_SECT-1 ; Set number bytes to read header
+ mov dx,di ; Set the SHARED_DATA_AREA address
+ push es
+ pop ds
+ mov ah,3FH ; Read from the Keyb Def file
+ int 21H
+ push cs
+ pop ds
+ jnc TB_STATE_CONTINUE6
+ jmp TB_ERROR4
+
+TB_STATE_CONTINUE6:
+ mov cx,es:[di].KX_SECTION_LEN; Set length of section to read
+ jcxz TB_CP_BEGIN
+
+ mov cx,word ptr SB_STATE_OFFSET ; Save the offset of the
+ add cx,FB.KT_LOGIC_LEN
+ mov word ptr SB_STATE_OFFSET,cx ; Save the offset of the
+ sub di,SD_AREA_DIFFERENCE ; Adjust for relocation
+ mov es:[bp].COMMON_XLAT_PTR,di
+ add di,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+ call STATE_BUILD
+ ; di set at new beginning of area
+ ; TABLE_AREA
+ ; STATE_LOGIC
+ ; COMMON_XLAT_SECTION
+ mov cx,RESIDENT_END_ACC
+ add cx,MAX_COM_SIZE
+ mov RESIDENT_END_ACC,cx ; Refresh resident end size
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; FOR alL DESIGNATED OR INVOKED CODE PAGES
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+TB_CP_BEGIN: ; Get the offset to
+ mov cx,OFFSET DESIG_CP_BUFFER.DESIG_CP_ENTRY ; the beginning of the
+ mov DESIG_CP_OFFSET,cx ; table of designated
+ ; code pages
+TB_CPN_BEGIN:
+ mov ax,word ptr es:[bp].ACTIVE_LANGUAGE ; Get the active language
+ mov cx,NUM_DESIG_CP ; Get the number of CPs
+ or cx,cx ; IF we have done all requested CPs
+ jnz TB_CPN_VALID1
+ jmp TB_DONE ; Then done
+
+TB_CPN_VALID1:
+ mov si,[DESIG_CP_OFFSET]
+ mov bx,[si] ; Get the CP
+ cmp bx,-1
+ jnz TB_CPN_CONTINUE1
+ jmp short TB_CPN_REPEAT
+
+TB_CPN_CONTINUE1: ; ELSE
+ push di
+ call FIND_CP_TABLE ; Find offset of code page table
+ pop di
+
+ jcxz TB_CPN_VALID ; brif valid code page for language
+ mov CPN_INVALID,cx ; Set flag and go to next CP
+ jmp short TB_CPN_REPEAT ; Else
+
+TB_CPN_VALID:
+ mov bx,KEYBSYS_FILE_HANDLE ; Get handle
+ mov cx,word ptr CP_TAB_OFFSET+2 ; Get offset of the code page
+ mov dx,word ptr CP_TAB_OFFSET ; in the Keyb Def file
+
+ cmp dx,-1 ; Test if code page is blank
+ jnz TB_CPN_CONTINUE2
+ jmp short TB_CPN_REPEAT ; If it is then go get next CP
+
+TB_CPN_CONTINUE2:
+ mov ax,4200h ; LSEEK to table in Keyb Def file
+ int 21H ; Keyb Def file Then
+ jnc TB_CPN_CONTINUE3
+ jmp TB_ERROR4
+
+TB_CPN_CONTINUE3:
+ mov dx,ax
+ mov word ptr SB_STATE_OFFSET+2,cx ; Save the offset of the
+ mov word ptr SB_STATE_OFFSET,dx ; states in Keyb Def file
+
+ mov cx,TB_CODE_PAGE_PARM ; If this code page is the
+ mov si,[DESIG_CP_OFFSET] ; invoked code page
+ cmp cx,[si]
+ jnz TB_CPN_CONTINUE4 ; Then
+
+ sub di,SD_AREA_DIFFERENCE ; Adjust for relocation
+ mov es:[bp].ACTIVE_XLAT_PTR,di ; Set active xlat section
+ add di,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+TB_CPN_CONTINUE4:
+ sub di,SD_AREA_DIFFERENCE ; Adjust for relocation
+ mov es:[bp].FIRST_XLAT_PTR,di ; Set flag
+ add di,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+TB_CPN_CONTINUE5:
+ CALL STATE_BUILD ; Build state
+ ; TABLE_AREA
+ jcxz TB_CPN_REPEAT ; COMMON_XLAT_SECTION,SPECIFIC...
+ jmp TB_ERROR4 ; di --->
+
+TB_CPN_REPEAT:
+ mov cx,RESIDENT_END_ACC
+ add cx,MAX_SPEC_SIZE ; Refresh resident end size
+ mov RESIDENT_END_ACC,cx
+
+ mov cx,DESIG_CP_OFFSET
+ add cx,2 ; Adjust offset to find next code page
+ mov DESIG_CP_OFFSET,cx
+
+ mov cx,NUM_DESIG_CP ; Adjust the number of code pages left
+ dec cx
+ mov NUM_DESIG_CP,cx
+
+ jmp TB_CPN_BEGIN
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+TB_DONE:
+ mov cx,RESIDENT_END_ACC ; Set final calculated value
+ add cx,bp
+ sub cx,SD_AREA_DIFFERENCE ; Adjust for relocation
+ mov es,word ptr SHARED_AREA_PTR ; Set segment
+ mov bp,word ptr SHARED_AREA_PTR+2
+ cmp cx,es:[bp].RESIDENT_END
+ JNA TB_DONE_CONTINUE1
+ jmp short TB_ERROR5
+
+TB_DONE_CONTINUE1:
+ cmp es:[bp].RESIDENT_END,-1
+ jnz DONT_REPLACE
+ push cs
+ pop es
+ mov bp,OFFSET SD_SOURCE_PTR
+ mov es:[bp].RESIDENT_END,cx ; Save resident end
+ jmp short CONTINUE_2_END
+
+DONT_REPLACE:
+ push cs
+ pop es
+ mov bp,OFFSET SD_SOURCE_PTR
+
+CONTINUE_2_END:
+ sub cx,OFFSET SD_DesT_PTR ; Calculate # of bytes to copy
+ mov SD_LENGTH,cx
+
+ xor cx,cx ; Set valid completion return code
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_CPN_INVALID:
+ cmp cx,1 ; Set error 1 return code
+ jnz TB_ERROR2
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_ERROR2:
+ cmp cx,2 ; Set error 2 return code
+ jnz TB_ERROR3
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_ERROR3:
+ cmp cx,3 ; Set error 3 return code
+ jnz TB_ERROR4
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_ERROR4:
+ cmp cx,4 ; Set error 4 return code
+ jnz TB_ERROR5
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_ERROR5:
+ mov cx,5 ; Set error 5 return code
+ mov TB_RETURN_CODE,cx
+ ret
+
+TB_ERROR6:
+ mov bx,TB_CODE_PAGE_PARM
+ mov cx,6
+ mov TB_RETURN_CODE,cx ; Set error 6 return code
+ ret
+
+TABLE_BUILD ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: STATE_BUILD
+;
+; Description:
+; Create the state/xlat section within the specific translate section.
+;
+; Input Registers:
+; ds - points to our data segment
+; es - points to our data segment
+; SB_STATE_OFFSET - offset to the beginning of the info in Keyb Def SYS
+; di - offset of the beginning of the area used to build states
+;
+; KEYBSYS_FILE_HANDLE - handle of the KEYBOARD.SYS file
+;
+; Output Registers:
+; di - offset of the end of the area used by STATE_BUILD
+;
+; cx - Return Code := 0 - State build successful
+; 4 - State build unsuccessful
+; (Bad or missing Keyboard Def file)
+;
+; Logic:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+END_OF_AREA_PTR DW 0
+SB_FIRST_STATE DW 0
+SB_STATE_LENGTH DW 0
+SB_STATE_OFFSET DD 0
+STATE_LENGTH DW 0
+RESTORE_BP DW ?
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+STATE_BUILD PROC NEAR
+
+ mov si,di ; Get the tally pointer
+ mov END_OF_AREA_PTR,di ; Save pointer
+
+ mov RESTORE_bp,bp ; Save the base pointer
+
+ mov bx,KEYBSYS_FILE_HANDLE ; Get handle
+ mov dx,word ptr SB_STATE_OFFSET ; LSEEK file pointer
+ mov cx,word ptr SB_STATE_OFFSET+2 ; back to top of XLAT table
+ mov ax,4200h ; If no problem with
+ int 21H ; Keyboard Def file THEN
+ jnc SB_FIRST_HEADER
+ jmp SB_ERROR4
+
+SB_FIRST_HEADER:
+ xor bp,bp
+ LEA cx,[bp].KX_FIRST_STATE ; Set number of bytes to read header
+ mov dx,di
+ push es
+ pop ds
+ mov ah,3FH ; read in the header
+ int 21H
+ push cs
+ pop ds
+ jnc SB_HEAD_CONTINUE1
+ jmp SB_ERROR4
+
+SB_HEAD_CONTINUE1:
+ mov dx,NEXT_SECT_PTR
+ cmp dx,-1
+ je SB_HEAD_CONTINUE2
+ sub dx,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+SB_HEAD_CONTINUE2:
+ mov es:[di].XS_NEXT_SECT_PTR,dx
+ cmp dx,-1
+ je SB_HEAD_CONTINUE3
+ add dx,SD_AREA_DIFFERENCE ; Adjust for relocation
+
+SB_HEAD_CONTINUE3:
+ add di,cx ; Update the di pointer
+
+SB_NEXT_STATE:
+ xor bp,bp ; Set number
+ LEA cx,[bp].KX_STATE_ID ; bytes to read state length
+ mov dx,di ; Read the header into the
+ mov bx,KEYBSYS_FILE_HANDLE ; SHARED_DATA_AREA
+ push es
+ pop ds
+ mov ah,3FH
+ int 21H
+
+SB_CONTINUE1:
+ push cs ; Reset the data segment
+ pop ds
+ mov cx,es:[di].KX_STATE_LEN ; If the length of the state section
+ mov STATE_LENGTH,cx
+ add di,2 ; is zero then done
+ jcxz SB_DONE
+
+ xor bp,bp ; Set number
+ LEA cx,[bp].KX_FIRST_XLAT-2 ; bytes to read state length
+ mov dx,di ; Read the header into the
+ mov bx,KEYBSYS_FILE_HANDLE ; SHARED_DATA_AREA
+ push es
+ pop ds
+ mov ah,3FH
+ int 21H
+
+SB_CONTINUE1A:
+ push cs ; Reset the data segment
+ pop ds
+ sub di,2
+ mov ax,es:[di].XS_KBD_TYPE ; Get the keyboard type def
+ test ax,HW_TYPE ; Does it match our hardware?
+ JNZ SB_CONTINUE2
+ mov dx,es:[di].XS_STATE_LEN ; No, then
+ LEA cx,[bp].KX_FIRST_XLAT
+ sub dx,cx
+ xor cx,cx
+ mov ah,42H ; LSEEK past this state
+ mov al,01H
+ int 21H
+ jmp SB_NEXT_STATE
+
+SB_CONTINUE2: ; Yes, then
+ mov ax,SIZE STATE_STR-1
+ add di,ax ; Set PTR and end of header
+
+SB_XLAT_TAB_BEGIN: ; Begin getting xlat tables
+ mov bx,KEYBSYS_FILE_HANDLE
+ LEA dx,[bp].KX_FIRST_XLAT ; Adjust for what we have already read
+ mov cx,STATE_LENGTH
+ sub cx,dx
+ mov dx,di
+ push es
+ pop ds
+ mov ah,3FH ; Read in the xlat tables
+ int 21H
+ push cs
+ pop ds
+ jnc SB_CONTINUE4
+ jmp short SB_ERROR4
+
+SB_CONTINUE4:
+ cmp cx,ax
+ je SB_ERROR_CHECK1
+ jmp short SB_ERROR4
+
+SB_ERROR_CHECK1:
+ add di,cx ; Update the end of area ptr
+
+ mov si,di
+ jmp SB_NEXT_STATE
+
+SB_DONE:
+ mov ax,-1
+ mov si,END_OF_AREA_PTR
+ mov NEXT_SECT_PTR,si
+
+ mov bp,RESTORE_bp
+ ret
+
+SB_ERROR1:
+ mov cx,1
+ ret
+
+SB_ERROR2:
+ mov cx,2
+ ret
+
+SB_ERROR3:
+ mov cx,3
+ ret
+
+SB_ERROR4:
+ mov cx,4
+ ret
+
+
+STATE_BUILD ENDP
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; Module: FIND_CP_TABLE
+;
+; Description:
+; Determine the offset of the specified code page table in KEYBOARD.SYS
+;
+; Input Registers:
+; ds - points to our data segment
+; es - points to our data segment
+; ax - ASCII representation of the language parm
+; bx - binary representation of the code page
+;
+; KEYBSYS_FILE_HANDLE - handle of the KEYBOARD.SYS file
+;
+; Output Registers:
+; CP_TAB_OFFSET - offset of the CP table in KEYBOARD.SYS
+;
+; cx - Return Code := 0 - State build successful
+; 2 - Invalid Code page for language
+; 4 - Bad or missing Keyboard Def file
+; Logic:
+;
+; READ language table
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Use table to verify language parm
+; Set pointer values
+; IF code page was specified
+; READ language entry
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; READ Code page table
+; IF error in reading file THEN
+; Display ERROR message and EXIT
+; ELSE
+; Use table to get the offset of the code page parm
+; ret
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FIND_CP_PARM DW ?
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; Program Code
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+FIND_CP_TABLE PROC NEAR
+
+
+ mov FIND_CP_PARM,bx ; Save Code page
+
+ mov bx,KEYBSYS_FILE_HANDLE ; Get handle
+ mov dx,word ptr KEYBCMD_LANG_ENTRY_PTR ; LSEEK file pointer
+ mov cx,word ptr KEYBCMD_LANG_ENTRY_PTR+2 ; to top of language entry
+ mov ax,4200h ; If no problem with
+ int 21H ; Keyb Def file Then
+ jnc FIND_BEGIN
+ jmp short FIND_CP_ERROR4
+
+FIND_BEGIN:
+ mov di,ax
+ mov cx,SIZE KEYBSYS_LANG_ENTRY-1 ; Set number
+ ; bytes to read header
+ mov dx,OFFSET FILE_BUFFER
+ mov ah,3FH ; Read language entry in
+ int 21H ; KEYBOARD.SYS file
+ jnc FIND_VALID4 ; If no error in opening file then
+ jmp short FIND_CP_ERROR4
+
+FIND_VALID4:
+
+;****************************** CNS ****************************************
+ xor ah,ah
+ mov al,FB.KL_NUM_CP
+;****************************** CNS ****************************************
+
+ mov NUM_CP,ax ; Save the number of code pages
+ MUL CP_PTR_SIZE ; Determine # of bytes to read
+ mov dx,OFFSET FILE_BUFFER ; Establish beginning of buffer
+ mov cx,ax
+ cmp cx,FILE_BUFFER_SIZE ; Make sure buffer is not to small
+ jbe FIND_VALID5
+ jmp short FIND_CP_ERROR4
+
+FIND_VALID5:
+ mov ah,3FH ; Read code page table from
+ int 21H ; KEYBOARD.SYS file
+ jnc FIND_VALID6 ; If no error in opening file then
+ jmp short FIND_CP_ERROR4
+
+FIND_VALID6:
+ mov cx,NUM_CP ; Number of valid codes
+ mov di,OFFSET FILE_BUFFER ; Point to correct word in table
+
+F_SCAN_CP_TABLE: ; FOR code page parm
+ mov ax,FIND_CP_PARM ; Get parameter
+ cmp [di].KC_CODE_PAGE,ax ; Valid Code ??
+ je F_CODE_PAGE_FOUND ; If not found AND more entries THEN
+ add di,LANG_PTR_SIZE ; Check next entry
+ loop F_SCAN_CP_TABLE ; Decrement count & loop
+
+
+ jmp short FIND_CP_ERROR2 ; Display error message
+
+F_CODE_PAGE_FOUND:
+ mov ax,word ptr [di].KC_ENTRY_PTR
+ mov word ptr CP_TAB_OFFSET,ax
+ mov ax,word ptr [di].KC_ENTRY_PTR+2
+ mov word ptr CP_TAB_OFFSET+2,ax
+
+ xor cx,cx
+ ret
+
+FIND_CP_ERROR1:
+ mov cx,1
+ ret
+
+FIND_CP_ERROR2:
+ mov cx,2
+ ret
+
+FIND_CP_ERROR3:
+ mov cx,3
+ ret
+
+FIND_CP_ERROR4:
+ mov cx,4
+ ret
+
+FIND_CP_TABLE ENDP
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+CODE ENDS
+ END TABLE_BUILD
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/keyb/keybtbbl.inc b/private/mvdm/dos/v86/cmd/keyb/keybtbbl.inc
new file mode 100644
index 000000000..c5fd3e207
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/keybtbbl.inc
@@ -0,0 +1,37 @@
+
+
+
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1990
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;;
+;; File Name: KEYBTBBL.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:
+;; ---------------
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ EXTRN TABLE_BUILD :NEAR ;;
+ EXTRN FIND_CP_TABLE :NEAR ;;
+ ;;
+ EXTRN CPN_INVALID :WORD ;;
+ EXTRN SD_LENGTH :WORD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+.LIST
diff --git a/private/mvdm/dos/v86/cmd/keyb/makefile b/private/mvdm/dos/v86/cmd/keyb/makefile
new file mode 100644
index 000000000..4633f3739
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/makefile
@@ -0,0 +1,89 @@
+# Makefile for keyb.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 30-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+com =..\..\inc
+include ..\..\make.inc
+dest =kb16.com
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.com del *.com
+ if exist *.exc del *.exc
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+KEYB.CTL: KEYB.SKL $(msg)\$(COUNTRY).MSG
+
+KEYBCMD.OBJ: KEYBCMD.ASM \
+ $(com)\STRUC.INC \
+ $(com)\SYSMSG.INC \
+ $(com)\VERSIONA.INC \
+ KEYBEQU.INC \
+ KEYBSYS.INC \
+ KEYBI9.INC \
+ KEYBI9C.INC \
+ KEYBI2F.INC \
+ $(com)\KEYBSHAR.INC \
+ KEYB.CTL \
+ KEYBDCL.INC \
+ KEYBTBBL.INC \
+ COMMSUBS.INC \
+ KEYBCPSD.INC \
+ $(com)\postequ.inc \
+ $(com)\dseg.inc \
+ $(com)\MSGSERV.ASM \
+ $(com)\COPYRIGH.INC
+
+
+
+KEYBTBBL.OBJ: KEYBTBBL.ASM \
+ $(com)\KEYBSHAR.INC \
+ KEYBCMD.INC
+
+COMMSUBS.OBJ: COMMSUBS.ASM \
+ $(com)\KEYBSHAR.INC
+
+KEYBI2F.OBJ: KEYBI2F.ASM \
+ $(com)\KEYBSHAR.INC
+
+KEYB.OBJ: KEYB.ASM
+
+KEYBCPSD.OBJ: KEYBCPSD.ASM \
+ $(com)\KEYBSHAR.INC
+
+KEYBI9.OBJ: KEYBI9.ASM \
+ $(com)\KEYBSHAR.INC
+
+KEYBI9C.OBJ: KEYBI9C.ASM \
+ $(com)\KEYBSHAR.INC
+
+PARSER.OBJ: parser.asm \
+ $(com)\parse.asm \
+ $(com)\struc.inc \
+ KEYBDCL.INC \
+ $(com)\PSDATA.INC
+
+KB16.exc: keyb.obj \
+ parser.obj \
+ KEYBCMD.OBJ \
+ KEYBTBBL.OBJ \
+ COMMSUBS.OBJ \
+ KEYBI2F.OBJ \
+ KEYBCPSD.OBJ \
+ KEYBI9.OBJ \
+ keyb.lnk \
+ KEYBI9C.OBJ
+ link16 @keyb.lnk
+
+$(dest): kb16.exc
diff --git a/private/mvdm/dos/v86/cmd/keyb/parser.asm b/private/mvdm/dos/v86/cmd/keyb/parser.asm
new file mode 100644
index 000000000..30e8e40a9
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/keyb/parser.asm
@@ -0,0 +1,655 @@
+PAGE ,132
+TITLE PARSE CODE AND CONTROL BLOCKS FOR KEYB.COM
+
+;****************** START OF SPECIFICATIONS **************************
+;
+; MODULE NAME: PARSER.ASM
+;
+; DESCRIPTIVE NAME: PARSES THE COMMAND LINE PARAMETERS FOR KEYB.COM
+;
+; FUNCTION: THE COMMAND LINE IN THE PSP IS PARSED FOR PARAMETERS.
+;
+; ENTRY POINT: PARSE_PARAMETERS
+;
+; INPUT: BP POINTS TO PARAMETER LIST
+; DS & ES POINT TO PSP
+;
+; AT EXIT:
+; PARAMETER LIST FILLED IN AS REQUIRED.
+;
+; INTERNAL REFERENCES:
+;
+; ROUTINES: SYSPARSE - PARSING CODE
+;
+; DATA AREAS: PARMS - PARSE CONTROL BLOCK FOR SYSPARSE
+;
+; EXTERNAL REFERENCES:
+;
+; ROUTINES: N/A
+;
+; DATA AREAS: PARAMETER LIST BLOCK TO BE FILLED.
+;
+; NOTES:
+;
+; REVISION HISTORY:
+; A000 - DOS Version 3.40
+; 3/24/88 AN003 - P3906 PARSER changes to return "bogus" parameter on the
+; "Parameter value not allowed " message - CNS
+; 5/12/88 AN004 - P4867 /ID:NON-Numeric hangs the sytem as a 1st positional
+;
+;
+; (C) Copyright Microsoft Corp. 1987-1990
+; MS-DOS 5.00 - NLS Support - KEYB Command
+;
+;
+;****************** END OF SPECIFICATIONS ****************************
+
+INCLUDE KEYBDCL.INC
+
+ID_VALID EQU 0
+ID_INVALID EQU 1
+NO_ID EQU 2
+
+LANGUAGE_VALID EQU 0
+LANGUAGE_INVALID EQU 1
+NO_LANGUAGE EQU 2
+
+NO_IDLANG EQU 3
+
+CODE_PAGE_VALID EQU 0
+CODE_PAGE_INVALID EQU 1
+NO_CODE_PAGE EQU 2
+VALID_SYNTAX EQU 0
+INVALID_SYNTAX EQU 1
+
+COMMAND_LINE_START EQU 81H
+RC_EOL EQU -1
+RC_NO_ERROR EQU 0
+RC_OP_MISSING EQU 2
+RC_NOT_IN_SW EQU 3
+
+;***CNS P4867 1st CHECK for /ID:ALPHA
+
+RC_SW_FIRST EQU 9
+
+;***CNS P4867 1st CHECK for /ID:ALPHA
+
+ERROR_COND EQU -1
+NUMBER EQU 1
+STRING EQU 3
+FILE_SPEC EQU 5
+MAX_ID EQU 999
+LANG_LENGTH EQU 2
+
+INVALID_SWITCH EQU 3
+TOO_MANY EQU 1
+INVALID_PARAM EQU 10
+VALUE_DISALLOW EQU 8
+
+
+ PUBLIC PARSE_PARAMETERS ; near procedure for parsing command line
+ PUBLIC CUR_PTR ; near procedure for parsing command line
+ PUBLIC OLD_PTR ; near procedure for parsing command line
+ PUBLIC ERR_PART ; near procedure for parsing command line
+
+ EXTRN BAD_ID:BYTE ; WGR to match old code
+ EXTRN FOURTH_PARM:BYTE ; WGR to match old code
+ EXTRN ONE_PARMID:BYTE ; WGR to match old code
+ EXTRN FTH_PARMID:BYTE ; WGR to match old code
+ EXTRN ALPHA:BYTE ; WGR to match old code
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; Set assemble switches for parse code that is not required!!
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+DateSW EQU 0
+TimeSW EQU 0
+CmpxSW EQU 0
+DrvSW EQU 0
+QusSW EQU 0
+KeySW EQU 0
+Val1SW EQU 0
+Val2SW EQU 0
+Val3SW EQU 0
+
+
+CODE SEGMENT PUBLIC 'CODE' BYTE
+ ASSUME CS:CODE,DS:CODE
+
+ .XLIST
+ INCLUDE PARSE.ASM ; Parsing code
+ .LIST
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; PARM control blocks for KEYB
+; Parsing command line as follows:
+;
+; KEYB [lang],[cp],[[d:][path]KEYBOARD.SYS][/ID:id][/e][/?]
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PARMS LABEL WORD
+ DW PARMSX
+ DB 0 ; no extra delimeters or EOLs.
+
+PARMSX LABEL BYTE
+ DB 0,3 ; min,max positional operands
+ DW LANG ; pointer to control block
+ DW CP ; pointer to control block
+ DW FILE_NAME ; pointer to control block
+ DB 3 ; 3 switches
+ DW ID_VALUE ; pointer to control block
+ dw help_value ; pointer to control block
+ dw ext_value ; pointer to control block
+ DB 0 ; no keywords
+
+LANG LABEL WORD
+ DW 0A001H ; sstring or numeric value (optional)
+ DW 0002H ; cap result by char table (sstring)
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 0 ; no keyword/switch synonyms
+
+CP LABEL WORD
+ DW 8001H ; numeric
+ DW 0 ; no functions
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 0 ; no keyword/switch synonyms
+
+FILE_NAME LABEL WORD
+ DW 0201H ; file spec
+ DW 0001H ; cap by file table
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 0 ; no keyword/switch synonyms
+
+ID_VALUE LABEL WORD
+ DW 8010H ; numeric
+ DW 0 ; no functions
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 1 ; 1 switch synonym
+id_name:
+ DB "/ID",0 ; ID switch
+
+help_value label word
+ dw 0 ; no values
+ dw 0 ; no functions
+ dw RESULT_BUF ; result
+ dw novals ; no value checking done
+ db 1 ; 1 switch synonym
+help_name:
+ db "/?",0 ; /? switch
+
+ext_value label word
+ dw 0 ; no values
+ dw 0 ; no functions
+ dw result_buf ; result
+ dw novals ; no value checking done
+ db 1 ; 1 switch synonym
+ext_name:
+ db "/E",0 ; /e switch
+
+
+NOVALS LABEL BYTE
+ DB 0 ; no value checking done
+
+RESULT_BUF LABEL BYTE
+RESULT_TYPE DB 0 ; type returned (number, string, etc.)
+ DB ? ; matched item tag (if applicable)
+RESULT_SYN_PTR DW ? ; synonym ptr (if applicable)
+RESULT_VAL DD ? ; value
+
+LOOP_COUNT DB 0 ; keeps track of parameter position
+
+;***CNS
+CUR_PTR DW 0 ; keeps track of parameter position
+OLD_PTR DW 0 ; keeps track of parameter position
+ERR_PART DW 0 ; keeps track of parameter position
+;***CNS
+ ;..and reports an error condition
+
+ public pswitches
+pswitches db 0 ; bit 0, /?, bit 1 /e
+
+TEMP_FILE_NAME DB 128 DUP(0) ; place for file name
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PROCEDURE_NAME: PARSE_PARAMETERS
+;
+; FUNCTION:
+; THIS PROCEDURE PARSES THE COMMAND LINE PARAMETERS IN THE PSP FOR
+; KEYB.COM. THE PARAMETER LIST BLOCK IS FILLED IN ACCORDINGLY.
+;
+; AT ENTRY: AS ABOVE.
+;
+; AT EXIT:
+; AS ABOVE.
+;
+; AUTHOR: WGR
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PARSE_PARAMETERS PROC NEAR
+
+ XOR AX,AX ; setup default parameters.
+ MOV [BP].RET_CODE_1,NO_IDLANG
+ MOV [BP].RET_CODE_2,NO_CODE_PAGE
+ MOV [BP].RET_CODE_3,VALID_SYNTAX
+ MOV [BP].RET_CODE_4,NO_ID
+ MOV [BP].PATH_LENGTH,AX
+ LEA DI,PARMS ; setup parse blocks
+ MOV SI,COMMAND_LINE_START
+
+ call save_curptr
+
+ XOR CX,CX
+ XOR DX,DX
+ CALL SYSPARSE
+
+kbs_10:
+ cmp ax,RC_EOL ; while not end of line and...
+ jnz kbs_11
+ jmp kbs_12
+kbs_11:
+ cmp LOOP_COUNT,ERROR_COND ; parameters valid, do...
+ jnz kbs_13
+ jmp kbs_12
+
+kbs_13:
+ cmp ax,RC_NOT_IN_SW ; invalid switch?
+ jz kbs_08
+ cmp ax,RC_SW_FIRST
+ jnz kbs_09
+
+kbs_08:
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; set invalid syntax flag.
+ MOV LOOP_COUNT,ERROR_COND ; set error flag to exit parse.
+
+;***CNS
+ MOV ERR_PART,INVALID_SWITCH
+ call save_curptr
+;***CNS
+
+ jmp kbs_10
+
+kbs_09:
+
+ cmp RESULT_SYN_PTR,offset id_name ; was /id:xxx switch found?
+ jnz not_id_switch
+
+
+ MOV AX,WORD PTR RESULT_VAL+2 ; is it valid?
+ OR AX,AX
+ jnz kbs_01
+
+ mov ax,word ptr RESULT_VAL
+ cmp ax,MAX_ID
+ jna kbs_02
+
+kbs_01:
+
+ MOV [BP].RET_CODE_1,ID_INVALID ; no...invalid id.
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error.
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse
+ mov bad_id,1
+
+ MOV [ERR_PART],VALUE_DISALLOW ; SET ERROR TYPE FOR DISPLAY
+ call save_curptr
+
+ jmp short kbs_03
+
+kbs_02:
+ MOV [BP].RET_CODE_4,ID_VALID ; yes...set return code 4.
+ MOV [BP].ID_PARM,AX
+ mov fourth_parm,1
+ mov fth_parmid,1
+
+ jmp short kbs_03
+
+
+not_id_switch:
+ cmp RESULT_SYN_PTR,offset help_name ; was /? switch found?
+ jnz not_help_switch
+
+ or pswitches,1 ; set flag for /?
+ jmp short kbs_03
+
+not_help_switch:
+ cmp RESULT_SYN_PTR,offset ext_name
+ jnz kbs_07
+
+ or pswitches,2 ; set flag for /e
+ jmp short kbs_03
+
+
+kbs_07:
+ INC LOOP_COUNT ; positional encountered...
+ cmp LOOP_COUNT,1 ; check for language
+ jnz kbs_04
+
+ CALL PROCESS_1ST_PARM
+
+ call save_curptr
+
+ jmp short kbs_03
+
+kbs_04:
+ cmp LOOP_COUNT,2 ; check for code page
+ jnz kbs_05
+
+ CALL PROCESS_2ND_PARM
+
+ call save_curptr
+
+ jmp short kbs_03
+
+kbs_05:
+ cmp LOOP_COUNT,3 ; check for file name
+ jnz kbs_06
+
+ CALL PROCESS_3RD_PARM
+
+ call save_curptr
+
+ jmp short kbs_03
+
+; all other cases
+
+kbs_06:
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; too many parms
+
+ call save_curptr
+
+ MOV ERR_PART,TOO_MANY
+ MOV LOOP_COUNT,ERROR_COND ; set error flag to exit parse.
+kbs_03:
+ MOV RESULT_TYPE,0 ; reset result block.
+ CALL SYSPARSE ; parse next parameter.
+
+ jmp kbs_10
+
+kbs_12:
+ cmp [bp].RET_CODE_4,ID_VALID
+ jnz kbs_14 ; ensure that if switch was
+ cmp [bp].RET_CODE_1,LANGUAGE_VALID ; used, it was valid keyword
+ jz kbs_14
+
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; code was used..
+
+;***CNS
+ call save_curptr
+ MOV ERR_PART,VALUE_DISALLOW
+;***CNS
+
+kbs_14:
+ RET
+
+PARSE_PARAMETERS ENDP
+
+save_curptr proc near
+
+ PUSH AX ;Save environment
+ MOV AX,CUR_PTR ;Set advancing ptr to end of argument
+ MOV OLD_PTR,AX ;after saving the beginning the string
+ MOV CUR_PTR,SI
+ POP AX ;Restore the environment
+ ret
+
+save_curptr endp
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PROCEDURE_NAME: PROCESS_1ST_PARM
+;
+; FUNCTION:
+; THIS PROCEDURE PROCESSES THE FIRST POSITIONAL PARAMETER. THIS SHOULD
+; BE THE LANGUAGE ID OR THE KEYBOARD ID.
+;
+; AT ENTRY: PARSE RESULT BLOCK CONTAINS VALUES IF AX HAS NO ERROR.
+;
+; AT EXIT:
+; PARAMETER CONTROL BLOCK UPDATED FOR LANGUAGE ID.
+;
+; AUTHOR: WGR
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PROCESS_1ST_PARM PROC NEAR
+
+ cmp ax,RC_NO_ERROR ; error on parse?
+ jng kbs_23
+
+ MOV [BP].RET_CODE_1,LANGUAGE_INVALID ; yes...set invalid language
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; and syntax error..
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse.
+ MOV ERR_PART,AX
+
+ jmp kbs_18
+
+kbs_23:
+ cmp RESULT_TYPE,NUMBER ; was this a number (id?)
+ jnz kbs_24
+
+ MOV AX,WORD PTR RESULT_VAL+2 ; yes...check to see if
+ OR AX,AX ; within range.
+ jnz kbs_19
+
+ MOV AX,WORD PTR RESULT_VAL
+ cmp ax,max_id
+ jna kbs_17
+
+kbs_19:
+ MOV [BP].RET_CODE_1,ID_INVALID ; no...invalid id.
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error.
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse
+ mov bad_id,1
+
+ jmp short kbs_18
+
+kbs_17:
+ MOV [BP].RET_CODE_1,ID_VALID ; valid id...set
+ MOV [BP].RET_CODE_4,ID_VALID ; valid id...set
+ MOV [BP].ID_PARM,AX ; and value moved into block
+ MOV LOOP_COUNT,4 ; there should be no more parms
+ mov one_parmid,1
+
+ jmp short kbs_18
+
+kbs_24:
+ cmp RESULT_TYPE,STRING ; must be a string then???
+ jnz kbs_26
+
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ PUSH DS
+ LDS SI,RESULT_VAL ; get ptr to string
+ MOV DI,BP
+ ADD DI,LANGUAGE_PARM ; point to block for copy.
+ MOV CX,LANG_LENGTH ; maximum length = 2
+ LODSB ; load AL with 1st char..
+
+kbs_16:
+ jcxz kbs_15 ; do twice, unless only 1 char
+ or al,al
+ jz kbs_15
+
+ STOSB ; store
+ DEC CX ; dec count
+ LODSB ; load
+
+ jmp kbs_16
+
+kbs_15:
+
+ or cx,cx ; if there was less than 2 or..
+ jnz kbs_20
+ or al,al ; greater than 2 chars, then..
+ jz kbs_21
+
+kbs_20:
+ MOV [BP].RET_CODE_1,LANGUAGE_INVALID ; invalid.
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error
+ MOV ERR_PART,INVALID_PARAM
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse.
+
+ jmp short kbs_22
+
+kbs_21:
+ MOV [BP].RET_CODE_1,LANGUAGE_VALID ; valid language has been copied
+ MOV ALPHA,1 ; language found
+
+kbs_22:
+ POP DS
+ POP CX
+ POP DI
+ POP SI
+ jmp short kbs_18
+
+; omitted parameter...
+
+kbs_26:
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; invalid since further parameters.
+kbs_18:
+ RET
+
+PROCESS_1ST_PARM ENDP
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PROCEDURE_NAME: PROCESS_2ND_PARM
+;
+; FUNCTION:
+; THIS PROCEDURE PROCESSES THE 2ND POSITIONAL PARAMETER. THIS SHOULD
+; BE THE CODE PAGE, IF REQUESTED.
+;
+; AT ENTRY: PARSE RESULT BLOCK CONTAINS VALUES IF AX HAS NO ERROR.
+;
+; AT EXIT:
+; PARAMETER CONTROL BLOCK UPDATED FOR CODE PAGE.
+;
+; AUTHOR: WGR
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PROCESS_2ND_PARM PROC NEAR
+
+ cmp ax,RC_NO_ERROR ; if parse error
+ jle kbs_32
+
+ MOV [BP].RET_CODE_2,CODE_PAGE_INVALID ; mark invalid..
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse
+ MOV ERR_PART,AX
+
+ jmp short kbs_31
+
+kbs_32:
+
+ cmp RESULT_TYPE,NUMBER ; was parameter specified?
+ jnz kbs_30
+
+ MOV AX,WORD PTR RESULT_VAL+2 ; yes..if code page not..
+ OR AX,AX
+
+ jnz kbs_27
+
+ MOV AX,WORD PTR RESULT_VAL ; valid..then
+
+ cmp ax,MAX_ID
+ jna kbs_28
+
+kbs_27:
+ MOV [BP].RET_CODE_2,CODE_PAGE_INVALID ; mark invalid..
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse
+
+ jmp short kbs_31
+
+kbs_28:
+ MOV [BP].RET_CODE_2,CODE_PAGE_VALID ; else...valid code page
+ MOV [BP].CODE_PAGE_PARM,AX ; move into parm
+
+ jmp short kbs_31
+
+kbs_30:
+ MOV [BP].RET_CODE_2,NO_CODE_PAGE ; mark as not specified.
+kbs_31:
+ RET
+
+PROCESS_2ND_PARM ENDP
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PROCEDURE_NAME: PROCESS_3RD_PARM
+;
+; FUNCTION:
+; THIS PROCEDURE PROCESSES THE 3RD POSITIONAL PARAMETER. THIS SHOULD
+; BE THE KEYBOARD DEFINITION FILE PATH, IF SPECIFIED.
+;
+; AT ENTRY: PARSE RESULT BLOCK CONTAINS VALUES IF AX HAS NO ERROR.
+;
+; AT EXIT:
+; PARAMETER CONTROL BLOCK UPDATED FOR FILE NAME.
+;
+; AUTHOR: WGR
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+PROCESS_3RD_PARM PROC NEAR
+
+ cmp ax,RC_NO_ERROR ; if parse error, then...
+ jle kbs_33
+
+ MOV [BP].RET_CODE_3,INVALID_SYNTAX ; syntax error.
+ MOV LOOP_COUNT,ERROR_COND ; set flag to exit parse
+ MOV ERR_PART,AX
+
+ jmp short kbs_34
+
+kbs_33:
+
+ cmp RESULT_TYPE,FILE_SPEC
+ jnz kbs_34
+
+ PUSH DS
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ LDS SI,RESULT_VAL ; load offset of file name
+ LEA DI,TEMP_FILE_NAME
+ MOV [BP].PATH_OFFSET,DI ; copy to parameter block
+ XOR CX,CX
+ LODSB ; count the length of the path.
+
+kbs_35:
+ or al,al
+ jz kbs_36
+
+ STOSB
+ LODSB
+ INC CX
+ jmp short kbs_35
+
+kbs_36:
+ MOV [BP].PATH_LENGTH,CX ; copy to parameter block
+ POP CX
+ POP DI
+ POP SI
+ POP DS
+kbs_34:
+ RET
+
+PROCESS_3RD_PARM ENDP
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/loadfix/loadfix.asm b/private/mvdm/dos/v86/cmd/loadfix/loadfix.asm
new file mode 100644
index 000000000..0cf33fa3c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/loadfix/loadfix.asm
@@ -0,0 +1,375 @@
+FindStruc struc
+
+ db 21 dup (?) ;reserved area
+Attr db ? ;attribute of file
+Time dw ? ;time of last write
+Date dw ? ;date of last write
+Fsize dd ? ;filesize
+Fname db 13 dup (?) ;filename
+
+FindStruc ends
+
+CMDSIZE equ 94h ;current resident size of
+ ;command.com is 94h paras
+
+code segment byte public 'CODE'
+ assume cs:code, ds:code, es:code
+
+ org 100h
+public start
+start:
+ mov sp,offset MyStack ;set ss:sp to our stack
+
+ mov ax,offset EndProg
+ add ax,15
+ mov cl,4
+ shr ax,cl ;para size of this program
+ mov bx,ax ;bx = this program's size
+ mov cx,es
+ add ax,cx ;ax = top of this program
+ sub ax,1000h - CMDSIZE ;are we below the first 64K?
+ jae no_mem ;no, dont reserve memory
+ neg ax ;additional memory to be reserved
+ add bx,ax
+no_mem: ;bx = #paras needed
+ mov ah,4ah
+ int 21h ;resize to desired size
+;
+;Prepare to execute the desired program
+;
+ call Exec_prepare
+ jnc do_exec
+
+ mov al,1 ;return error
+ jmp short exit
+do_exec:
+ cmp helpflg,1
+ je do_help
+ mov ah,4bh
+ mov dx,offset ExecPath
+ mov bx,offset ExecBlk
+ int 21h ;do the Exec
+ jc exec_err ;error while executing
+;
+;No error on execution. Get the return code of the program we executed and
+;return that as our return code.
+;
+ mov ah,4dh
+ int 21h ;al = return code now
+exit:
+ mov ah,4ch
+ int 21h ;terminate ourselves
+exec_err:
+ mov dx,offset ErrMsg ;Error executing command.com
+ mov al,1
+ call dispmsg
+ jmp short exit
+do_help:
+ mov dx,offset HelpMsg ;Display help for loadfix
+ call dispmsg
+ xor al,al
+ jmp short exit
+
+;***
+;Dispmsg -- Displays messages that are terminated by '$'
+;
+;Input: ds:dx = pointer to message
+;
+;Output: None
+;
+;Registers: ax
+;***
+
+dispmsg proc near
+
+ mov ah,9
+ int 21h
+ ret
+
+dispmsg endp
+
+;***
+;Exec_prepare -- Searches the environment for the COMSPEC and sets up the
+;command line and FCBs for the Exec call
+;
+;Input: None
+;
+;Output: Carry set => error. Error message is displayed here
+; Carry clear => all parameters set successfully
+;
+;Registers: ax, cx, dx, si, di
+;***
+
+Exec_prepare proc near
+
+ push ds
+ push es
+
+ mov si,81h ;ds:si points at our command line
+ call skip_white ;skip all leading whitespace
+
+ cmp byte ptr [si],0dh ;Did we hit a CR?
+ je no_parms ;yes, no parameters given
+;
+;Check if we have a /? here
+;
+ cmp byte ptr [si],'/'
+ jne no_help
+ cmp byte ptr [si+1],'?'
+ jne no_help
+
+ inc helpflg ;/? given -- print help
+ jmp short exefnd
+
+no_help:
+ mov dx,si ;ds:dx now points at the program
+
+ mov si,offset CmdOpt
+ mov di,offset CmdParms
+ inc di
+ mov cl,CmdOptLen
+ xor ch,ch
+ rep movsb
+
+ mov si,dx
+ xor cx,cx
+st_lp:
+ lodsb
+ stosb
+ inc cx
+ cmp al,0dh
+ jne st_lp
+
+ dec cx
+ add cl,CmdOptLen ;command line cannot be >128
+ mov CmdParms,cl
+
+ mov si,offset CmdParms
+
+ mov word ptr CmdPtr,si
+ mov word ptr CmdPtr+2,cs ;store command line pointer
+
+ mov word ptr Fcb1+2,cs
+ mov word ptr Fcb2+2,cs
+
+ call find_comspec
+ jc no_comspec
+
+ mov si,offset ExecPath
+ xchg si,di
+ push ds
+ push es
+ pop ds
+ pop es
+comspec_lp:
+ lodsb
+ stosb
+ or al,al
+ jnz comspec_lp
+
+exefnd:
+ clc
+execp_ret:
+ pop es
+ pop ds
+ ret
+no_parms:
+ mov dx,offset NoParms
+ call dispmsg
+ stc
+ jmp short execp_ret
+no_comspec:
+ mov dx,offset NoComspec
+ call dispmsg
+ stc
+ jmp short execp_ret
+
+Exec_prepare endp
+
+;***
+;skip_white -- Skips all whitespace characters until it hits a non-whitespace
+;
+;Input: ds:si = string to be looked at
+;
+;Output: ds:si points at the first non-whitespace char in the string
+;
+;Registers: ax, si
+;***
+
+skip_white proc near
+
+ lodsb
+ cmp al,20h ;Blank?
+ je skip_white ;yes, skip
+ cmp al,9 ;Tab?
+ je skip_white ;yes, skip
+
+ dec si ;point at the first non-white
+
+ ret
+
+skip_white endp
+
+;***
+;find_comspec -- searches in the environment for the COMSPEC variable
+;
+;Input: None
+;
+;Output: es:di points at the arguments of the COMSPEC= variable
+;
+;Registers: si
+;***
+
+find_comspec proc near
+
+ mov si,offset Comspec_Text
+
+;
+; input: ds:si points to a "=" terminated string
+; output: es:di points to the arguments in the environment
+; zero is set if name not found
+; carry flag is set if name not valid format
+;
+ call find ; find the name
+ jc done_findp ; carry means not found
+ call scasb1 ; scan for = sign
+done_findp:
+ ret
+
+find_comspec endp
+
+;***
+;find -- scans the environment for the variable whose name is passed in
+;
+;Input: ds:si points at the environment variable to be scanned for
+;
+;Output: es:di points at the environment variable
+;
+;Registers: ax, di
+;***
+
+find proc near
+
+ cld
+ call count0 ; cx = length of name
+ mov es,es:[2ch] ; get environment segment
+;
+;Bugbug: What if the environment segment here is 0?
+;
+ xor di,di
+
+find1:
+ push cx
+ push si
+ push di
+
+find11:
+ lodsb
+ inc di
+ cmp al,es:[di-1]
+ jnz find12
+ loop find11
+
+find12:
+ pop di
+ pop si
+ pop cx
+ jz end_find
+ push cx
+ call scasb2 ; scan for a nul
+ pop cx
+ cmp byte ptr es:[di],0
+ jnz find1
+ stc ; indicate not found
+end_find:
+ ret
+
+find endp
+
+;***
+;count0 -- returns length of string until the first '=' char
+;
+;Input: ds:si points at the string
+;
+;Output: cx = length until '='
+;
+;Registers: di
+;***
+
+count0 proc near
+
+ mov di,si ;ds = es = cs
+
+ push di ; count number of chars until "="
+ call scasb1
+ pop cx
+ sub di,cx
+ xchg di,cx
+ ret
+
+count0 endp
+
+;***
+;scasb1 -- scans string for the first '='
+;scasb2 -- scans string for the first null
+;
+;Input: es:di = string
+;
+;Output: es:di points after the desired char
+;
+;Registers: ax, cx
+;***
+
+scasb1 proc near
+
+ mov al,'=' ; scan for an =
+ jmp short scasbx
+scasb2:
+ xor al,al ; scan for a nul
+scasbx:
+ mov cx,100h
+ repnz scasb
+ ret
+
+scasb1 endp
+
+;**************************
+;Data
+;**************************
+
+ExecBlk label word
+ dw 0
+CmdPtr dd ?
+Fcb1 dw offset MyFcb1
+ dw ?
+Fcb2 dw offset MyFcb2
+ dw ?
+
+ dw 128 dup (1)
+MyStack label word
+
+CmdOpt db '/C '
+CmdOptLen db $ - CmdOpt
+
+CmdParms db 128 dup (?) ;buffer to hold prog to be Exec'ed
+
+ExecPath db 67 dup (?) ;holds path to COMMAND.COM
+
+ComSpec_Text db 'COMSPEC=',0
+
+MyFcb1 db 0
+ db 11 dup (' ')
+
+MyFcb2 db 0
+ db 11 dup (' ')
+
+Helpflg db 0 ;default is no help
+
+include loadmsg.msg
+
+EndProg label byte
+
+code ends
+ end start
+
+
diff --git a/private/mvdm/dos/v86/cmd/loadfix/makefile b/private/mvdm/dos/v86/cmd/loadfix/makefile
new file mode 100644
index 000000000..24b2a5601
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/loadfix/makefile
@@ -0,0 +1,35 @@
+# Makefile for loadfix.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =loadfix.com
+
+
+exelink=/MAP
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+ if exist loadifx.com del loadfix.com
+
+
+
+$(dest): loadfix.exc
+
+loadfix.exc: loadfix.obj
+ link16 $(exelink) $(exelink) loadfix,loadfix.exc;
+
+loadfix.obj: loadfix.asm $(msg)\loadmsg.msg
diff --git a/private/mvdm/dos/v86/cmd/makefile b/private/mvdm/dos/v86/cmd/makefile
new file mode 100644
index 000000000..aa12db872
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/makefile
@@ -0,0 +1,76 @@
+# 16 bit utilities makefile
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 10-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+# 13-Apr-1992 Sudeepb Bharati (sudeepb)
+# Added DOS5.0 utilities which are not supported in NT.
+#
+
+all:
+ cd command
+ $(MAKE)
+ cd ..\append
+ $(MAKE)
+ cd ..\backup
+ $(MAKE)
+ cd ..\edlin
+ $(MAKE)
+ cd ..\exe2bin
+ $(MAKE)
+ cd ..\debug
+ $(MAKE)
+ cd ..\qbasic
+ $(MAKE)
+ cd ..\setver
+ $(MAKE)
+ cd ..\mem
+ $(MAKE)
+ cd ..\loadfix
+ $(MAKE)
+ cd ..\nlsfunc
+ $(MAKE)
+ cd ..\keyb
+ $(MAKE)
+ cd ..\graphics
+ $(MAKE)
+ cd ..\fastopen
+ $(MAKE)
+ cd ..\share
+ $(MAKE)
+ cd ..
+
+clean:
+ cd command
+ $(MAKE) clean
+ cd ..\append
+ $(MAKE) clean
+ cd ..\backup
+ $(MAKE) clean
+ cd ..\edlin
+ $(MAKE) clean
+ cd ..\exe2bin
+ $(MAKE) clean
+ cd ..\debug
+ $(MAKE) clean
+ cd ..\qbasic
+ $(MAKE) clean
+ cd ..\setver
+ $(MAKE) clean
+ cd ..\mem
+ $(MAKE) clean
+ cd ..\loadfix
+ $(MAKE) clean
+ cd ..\nlsfunc
+ $(MAKE) clean
+ cd ..\keyb
+ $(MAKE) clean
+ cd ..\graphics
+ $(MAKE) clean
+ cd ..\fastopen
+ $(MAKE) clean
+ cd ..\share
+ $(MAKE) clean
+ cd ..
diff --git a/private/mvdm/dos/v86/cmd/mem/_msgret.asm b/private/mvdm/dos/v86/cmd/mem/_msgret.asm
new file mode 100644
index 000000000..5061ffce4
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/_msgret.asm
@@ -0,0 +1,269 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+page 60,132
+name _msgret
+title C to Message Retriever
+;-------------------------------------------------------------------
+;
+; MODULE: _msgret
+;
+; PURPOSE: Supplies an interface between C programs and
+; the DOS 3.3 message retriever
+;
+; CALLING FORMAT:
+; msgret(&inregs,&outregs);
+;
+; DATE: 5-21-87
+;
+;-------------------------------------------------------------------
+
+ INCLUDE SYSMSG.INC ;PERMIT SYSTEM MESSAGE HANDLER DEFINITION ;AN000;
+
+ MSG_UTILNAME <MEM> ;IDENTIFY THE COMPONENT ;AN000;
+
+;-------------------------------------------------------------------
+;-------------------------------------------------------------------
+
+
+_TEXT SEGMENT BYTE PUBLIC 'CODE'
+_TEXT ENDS
+_DATA SEGMENT WORD PUBLIC 'DATA'
+_DATA ENDS
+CONST SEGMENT WORD PUBLIC 'CONST'
+CONST ENDS
+_BSS SEGMENT WORD PUBLIC 'BSS'
+_BSS ENDS
+
+DGROUP GROUP CONST, _BSS, _DATA
+ ASSUME CS: DGROUP, DS: DGROUP, SS: DGROUP, ES: NOTHING
+
+ public data_sysloadmsg
+ public data_sysdispmsg
+ public data_sysgetmsg
+
+_DATA SEGMENT
+
+ MSG_SERVICES <MSGDATA>
+ MSG_SERVICES <LOADmsg,FARmsg>
+ MSG_SERVICES <DISPLAYmsg,GETmsg,CHARmsg,NUMmsg>
+ MSG_SERVICES <MEM.CLA,MEM.CLB,MEM.CL1,MEM.CL2,MEM.CTL> ;AN000;
+
+
+data_sysloadmsg proc far
+
+ push bp ; save user's base pointer
+ mov bp,sp ; set bp to current sp
+ push di ; save some registers
+ push si
+
+; copy C inregs into proper registers
+
+ mov di,[bp+4+4] ; fix di (arg 0)
+
+;-------------------------------------------------------------------
+
+ mov ax,[di+0ah] ; load di
+ push ax ; the di value from inregs is now on stack
+
+ mov ax,[di+00] ; get inregs.x.ax
+ mov bx,[di+02] ; get inregs.x.bx
+ mov cx,[di+04] ; get inregs.x.cx
+ mov dx,[di+06] ; get inregs.x.dx
+ mov si,[di+08] ; get inregs.x.si
+ pop di ; get inregs.x.di from stack
+
+ push bp ; save base pointer
+
+;-------------------------------------------------------------------
+
+ call sysloadmsg ; call the message retriever
+
+;-------------------------------------------------------------------
+
+ pop bp ; restore base pointer
+ push di ; the di value from call is now on stack
+ mov di,[bp+6+4] ; fix di (arg 1)
+
+ mov [di+00],ax ; load outregs.x.ax
+ mov [di+02],bx ; load outregs.x.bx
+ mov [di+04],cx ; load outregs.x.cx
+ mov [di+06],dx ; load outregs.x.dx
+ mov [di+08],si ; load outregs.x.si
+
+ lahf ; get flags into ax
+ mov al,ah ; move into low byte
+ mov [di+0ch],ax ; load outregs.x.cflag
+
+ pop ax ; get di from stack
+ mov [di+0ah],ax ; load outregs.x.di
+
+;-------------------------------------------------------------------
+
+ pop si ; restore registers
+ pop di
+ mov sp,bp ; restore sp
+ pop bp ; restore user's bp
+ ret
+
+data_sysloadmsg endp
+
+
+data_sysdispmsg proc far
+
+ push bp ; save user's base pointer
+ mov bp,sp ; set bp to current sp
+ push di ; save some registers
+ push si
+
+; copy C inregs into proper registers
+
+ mov di,[bp+4+4] ; fix di (arg 0)
+
+;-------------------------------------------------------------------
+
+ mov ax,[di+0ah] ; load di
+ push ax ; the di value from inregs is now on stack
+
+ mov ax,[di+00] ; get inregs.x.ax
+ mov bx,[di+02] ; get inregs.x.bx
+ mov cx,[di+04] ; get inregs.x.cx
+ mov dx,[di+06] ; get inregs.x.dx
+ mov si,[di+08] ; get inregs.x.si
+ pop di ; get inregs.x.di from stack
+
+ push bp ; save base pointer
+
+;-------------------------------------------------------------------
+
+ call sysdispmsg
+
+;-------------------------------------------------------------------
+
+ pop bp ; restore base pointer
+ push di ; the di value from call is now on stack
+ mov di,[bp+6+4] ; fix di (arg 1)
+
+ mov [di+00],ax ; load outregs.x.ax
+ mov [di+02],bx ; load outregs.x.bx
+ mov [di+04],cx ; load outregs.x.cx
+ mov [di+06],dx ; load outregs.x.dx
+ mov [di+08],si ; load outregs.x.si
+
+ lahf ; get flags into ax
+ mov al,ah ; move into low byte
+ mov [di+0ch],ax ; load outregs.x.cflag
+
+ pop ax ; get di from stack
+ mov [di+0ah],ax ; load outregs.x.di
+
+;-------------------------------------------------------------------
+
+ pop si ; restore registers
+ pop di
+ mov sp,bp ; restore sp
+ pop bp ; restore user's bp
+ ret
+
+data_sysdispmsg endp
+
+
+data_sysgetmsg proc far
+
+ push bp ; save user's base pointer
+ mov bp,sp ; set bp to current sp
+ push di ; save some registers
+ push si
+
+; copy C inregs into proper registers
+
+ mov di,[bp+4+4] ; fix di (arg 0)
+
+;-------------------------------------------------------------------
+
+ mov ax,[di+0ah] ; load di
+ push ax ; the di value from inregs is now on stack
+
+ mov ax,[di+00] ; get inregs.x.ax
+ mov bx,[di+02] ; get inregs.x.bx
+ mov cx,[di+04] ; get inregs.x.cx
+ mov dx,[di+06] ; get inregs.x.dx
+ mov si,[di+08] ; get inregs.x.si
+ pop di ; get inregs.x.di from stack
+
+ push bp ; save base pointer
+
+;-------------------------------------------------------------------
+
+ call sysgetmsg ; call the message retriever
+
+;-------------------------------------------------------------------
+
+ pop bp ; restore base pointer
+ push di ; the di value from call is now on stack
+ mov di,[bp+6+4] ; fix di (arg 1)
+
+ push ax ; save ax
+ mov [di+00],es ; load segregs.es
+ mov [di+06],ds ; load outregs.ds
+ pop ax ; restore ax
+
+ pop di ; restore di
+ push di ; save it
+ mov di,[bp+8+4] ; fix di (arg 2)
+ mov [di+00],ax ; load outregs.x.ax
+ mov [di+02],bx ; load outregs.x.bx
+ mov [di+04],cx ; load outregs.x.cx
+ mov [di+06],dx ; load outregs.x.dx
+ mov [di+08],si ; load outregs.x.si
+
+ lahf ; get flags into ax
+ mov al,ah ; move into low byte
+ mov [di+0ch],ax ; load outregs.x.cflag
+
+ pop ax ; get di from stack
+ mov [di+0ah],ax ; load outregs.x.di
+
+;-------------------------------------------------------------------
+
+ pop si ; restore registers
+ pop di
+ mov sp,bp ; restore sp
+ pop bp ; restore user's bp
+ ret
+
+data_sysgetmsg endp
+
+include msgdcl.inc
+
+_DATA ends ; end code segment
+
+_TEXT SEGMENT
+
+ assume cs:_TEXT
+
+ public _sysdispmsg
+ public _sysloadmsg
+ public _sysgetmsg
+
+_sysdispmsg proc near
+ call data_sysdispmsg
+ ret
+_sysdispmsg endp
+
+_sysloadmsg proc near
+ call data_sysloadmsg
+ ret
+_sysloadmsg endp
+
+_sysgetmsg proc near
+ call data_sysgetmsg
+ ret
+_sysgetmsg endp
+
+_TEXT ENDS
+ end
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/mem/_parse.asm b/private/mvdm/dos/v86/cmd/mem/_parse.asm
new file mode 100644
index 000000000..9adf530fd
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/_parse.asm
@@ -0,0 +1,171 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+page 60,132
+name _parse
+title C to PARSER interface
+;-------------------------------------------------------------------
+;
+; MODULE: _parse
+;
+; PURPOSE: Supplies an interface between C programs and
+; the DOS 3.3 parser
+;
+; CALLING FORMAT:
+; parse(&inregs,&outregs);
+;
+; DATE: 5-21-87
+;
+;-------------------------------------------------------------------
+
+; extrn sysparse:far
+
+ public _parse
+
+;-------------------------------------------------------------------
+;FarSW equ 0 ; make sysparse be a NEAR proc
+;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
+;-------------------------------------------------------------------
+
+
+
+
+_TEXT SEGMENT BYTE PUBLIC 'CODE'
+_TEXT ENDS
+_DATA SEGMENT WORD PUBLIC 'DATA'
+_DATA ENDS
+CONST SEGMENT WORD PUBLIC 'CONST'
+CONST ENDS
+_BSS SEGMENT WORD PUBLIC 'BSS'
+_BSS ENDS
+
+
+DGROUP GROUP CONST, _BSS, _DATA
+
+
+_DATA segment word public 'DATA'
+
+ assume cs:DGROUP
+ assume ss:dgroup
+
+ public SysParse
+
+;-------------------------------------------------------------------
+.xlist
+include version.inc
+include parse.asm ; include the parser
+.list
+;-------------------------------------------------------------------
+
+ public CallParser
+CallParser proc far
+
+ push ds
+ PUSH ES
+
+ push cs
+ pop ds
+ assume ds:DGROUP
+
+ push cs
+ pop es
+ assume es:DGROUP
+
+ nop
+
+ call SysParse
+
+ POP ES
+ pop ds
+
+ ret
+
+CallParser endp
+
+
+
+_DATA ends
+
+_TEXT segment byte public 'CODE'
+
+ ASSUME CS:_TEXT
+ ASSUME DS:DGROUP
+ ASSUME ES:NOTHING
+ ASSUME SS:DGROUP
+
+_parse proc near
+
+ push bp ; save user's base pointer
+ mov bp,sp ; set bp to current sp
+ push di ; save some registers
+ push si
+
+; copy C inregs into proper registers
+
+ mov di,[bp+4] ; fix di (arg 0)
+
+;-------------------------------------------------------------------
+
+ mov ax,[di+0ah] ; load di
+ push ax ; the di value from inregs is now on stack
+
+ mov ax,[di+00] ; get inregs.x.ax
+ mov bx,[di+02] ; get inregs.x.bx
+ mov cx,[di+04] ; get inregs.x.cx
+ mov dx,[di+06] ; get inregs.x.dx
+ mov si,[di+08] ; get inregs.x.si
+ pop di ; get inregs.x.di from stack
+
+ push bp ; save base pointer
+
+;-------------------------------------------------------------------
+;-------------------------------------------------------------------
+
+ call CallParser ; call the parser
+
+;-------------------------------------------------------------------
+;-------------------------------------------------------------------
+
+ pop bp ; restore base pointer
+ push di ; the di value from call is now on stack
+ mov di,[bp+6] ; fix di (arg 1)
+
+ mov [di+00],ax ; load outregs.x.ax
+ mov [di+02],bx ; load outregs.x.bx
+ mov [di+04],cx ; load outregs.x.cx
+ mov [di+06],dx ; load outregs.x.dx
+ mov [di+08],si ; load outregs.x.si
+
+ xor ax,ax ; clear ax
+ lahf ; get flags into ax
+ mov [di+0ch],ax ; load outregs.x.cflag
+
+ pop ax ; get di from stack
+ mov [di+0ah],ax ; load outregs.x.di
+
+;-------------------------------------------------------------------
+
+ pop si ; restore registers
+ pop di
+ mov sp,bp ; restore sp
+ pop bp ; restore user's bp
+ ret
+
+_parse endp
+
+_TEXT ends ; end code segment
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/mem/chkvdisk.asm b/private/mvdm/dos/v86/cmd/mem/chkvdisk.asm
new file mode 100644
index 000000000..0c7cfd10c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/chkvdisk.asm
@@ -0,0 +1,217 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+; Check for existence of a VDisk header. Check the beginning of the segment
+; addressed by the INT 19 vector, and, if XMS is available to give us
+; A20 toggling, check at the 1Mb boundary. We don't do the latter check
+; if we can't do the A20 switch.
+;
+; Return the size of the VDisk if found.
+;
+
+; Checking for a VDISK header at 1Mb is currently disabled. This is because
+; the XMS calls used to access the HMA will cause INT 15 memory to
+; be claimed if there are currently no Himem or XMS users, and the MEM
+; command shouldn't disturb the memory environment in that way.
+; We rely on VDisk allocators to use the INT 19 approach to signal
+; their memory usage. According to Ray Duncan, this may not be
+; entirely reliable, but this is probably better than adding the
+; code necessary to do lots of INT 15 block moves to interrogate
+; the extended memory arena.
+
+CHECKXMS equ 0 ; set to non-zero to enable checking
+ ; of the HMA for VDisk headers.
+
+.MODEL SMALL
+.CODE
+
+ extrn _XMM_Installed :Near
+ extrn _XMM_QueryA20 :Near
+ extrn _XMM_EnableA20 :Near
+ extrn _XMM_DisableA20 :Near
+
+;----------------------------------------------------------------------------
+;
+; following piece of code will be moved into a para boundary. And the para
+; address posted in seg of int 19h vector. Offset of int 19h will point to
+; VDint19. This is to protect HMA from apps which use VDISK header method
+; to determine free extended memory.
+;
+; For more details read "power programming" column by Ray Duncan in the
+; May 30 1989 issue of PC Magazine (pp 377-388) [USING EXTENDED MEMORY,PART 1]
+;
+;----------------------------------------------------------------------------
+;
+StartVDHead label byte
+;
+;-------------- what follows is a dummy device driver header (not used by DOS)
+;
+ dd 0 ; link to next device driver
+ dw 8000h ; device attribute
+ dw 0 ; strategy routine offset
+ dw 0 ; interrupt routine offset
+ db 1 ; number of units
+ db 7 dup(0) ; reserved area
+VDiskSig1 db 'VDISK'
+
+VLEN1 equ ($-offset VDiskSig1)
+
+ db ' V3.3' ; vdisk label
+ db 15 dup (0) ; pad
+VDiskEnd1 dw 0 ; bits 0-15 of free HMA
+ db 11h ; bits 16-23 of free HMA (1M + 64K)
+
+VDInt19:
+ db 0eah ; jmp to old vector
+OldVDInt19 dd ? ; Saved int 19 vector
+
+EndVDHead label byte
+;
+;
+VDiskHMAHead db 0,0,0 ; non-bootable disk
+VDiskSig2 db 'VDISK'
+
+VLEN2 equ ($-offset VDiskSig2)
+
+ db '3.3' ; OEM - signature
+ dw 128 ; number of bytes/sector
+ db 1 ; sectors/cluster
+ dw 1 ; reserved sectors
+ db 1 ; number of FAT copies
+ dw 64 ; number of root dir entries
+ dw 512 ; number of sectors
+ db 0feh ; media descriptor
+ dw 6 ; number of sectors/FAT
+ dw 8 ; sectors per track
+ dw 1 ; number of heads
+ dw 0 ; number of hodden sectors
+VDiskEnd2 dw 440h ; Start of free HMA in K (1M+64K)
+EndVDiskHMAHead label byte
+;
+;
+;----------------------------------------------------------------------------
+;
+; procedure : IsVDiskInstalled
+;
+; Checks for the presence of VDISK header at 1MB boundary
+; & INT 19 vector. Returns number of Kb used as Vdisk
+;
+; Inputs : none
+; Outputs : AX = size of VDisk in Kb, 0 if none found
+; Uses : AX, CX
+;
+;----------------------------------------------------------------------------
+;
+ public _CheckVDisk
+
+_CheckVDisk proc near
+ push bp
+ push si ; Save regs
+ push di
+ push es
+ push ds
+
+ mov ax,3519h ; Get Int Vector 19h
+ int 21h
+ ; set registers for CMPS
+ mov di, offset VDiskSig1 - offset StartVDHead
+ mov cx, VLEN1
+ push cs
+ pop ds
+ mov si, offset VDiskSig1
+ rep cmpsb
+IF NOT CHECKXMS
+ jnz cvd_NoDisk
+ELSE
+ jnz cvd_checkXMS ; jump if we didn't find it
+ENDIF
+
+;
+; Get the first free address in Kb, and determine the number of Kb used
+; above 1Mb. First free address in a 24-bit address, so divide by 1024
+; to get number of Kb
+;
+ mov di,offset VDiskEnd1 - offset StartVDHead
+ mov ax,es:[di]+1 ; load top 16 bits of end address
+ shr ax,1
+ shr ax,1 ; fast divide of 24 bits by 1024
+ test es:[di],03FFh ; check for rounding
+ jz @F
+ inc ax ; round up if needed
+@@:
+IF NOT CHECKXMS
+ jmp short cvd_End
+
+ELSE
+ pop ds ; clear top of stack
+ jmp short cvd_End ; AX now has size in Kb
+
+
+;
+; Ensure that A20 is on before we check above 1Mb. If XMS is not
+; installed, we punt, and assume no VDisk
+;
+
+cvd_checkXMS:
+ pop ds ; get DS again
+ call _XMM_Installed
+ or ax,ax
+ jz cvd_NoDisk ; No XMS, assume no VDisk
+
+;
+; Get and save current A20 state, get A20 on
+;
+ call _XMM_QueryA20
+ push ax ; save current state
+ or ax,ax ; already on?
+ jnz cvd_A20On ; yes, don't turn it on
+ call _XMM_EnableA20 ; turn it on
+
+cvd_A20On:
+ push ds ; save DS again
+ mov ax, 0ffffh
+ mov ds, ax
+ mov si, 10h+(offset VDiskSig2 - offset VDiskHMAHead)
+ mov ax,cs
+ mov es,ax
+ mov di, offset VDiskSig2
+ mov cx, VLEN2
+ rep cmpsb
+ jne @F ; if no header, turn off A20 now
+ ; get first free address in Kb
+ mov si,offset VDiskEnd2 - offset VDiskHMAHead
+ mov ax,[si]
+@@:
+ pop ds ; get original DS again
+ pop ax ; get original A20 state
+ pushf ; save result of header check
+ or ax,ax ; was A20 already on?
+ jnz @F ; jump if yes
+ call _XMM_DisableA20 ; else turn it off again
+
+@@:
+ popf ; get result of header check
+ je cvd_End ; jump if present
+
+ENDIF ; CHECKXMS
+
+cvd_NoDisk:
+ mov ax,1024 ; set up to return 0
+
+cvd_End:
+ sub ax,1024 ; discount first 1Mb from first
+ ; free address to get size in Kb
+IF NOT CHECKXMS
+ pop ds
+ENDIF
+ pop es
+ pop di
+ pop si
+ pop bp
+ ret
+_CheckVDisk endp
+
+ end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/mem/makefile b/private/mvdm/dos/v86/cmd/mem/makefile
new file mode 100644
index 000000000..fbbbbdd8d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/makefile
@@ -0,0 +1,81 @@
+# Makefile for mem.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+extcsw =/Gs
+include ..\..\make.inc
+hinc =..\..\h
+dest =mem.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+mem.ctl: mem.skl \
+ $(msg)\$(COUNTRY).msg makefile
+
+_parse.obj: _parse.asm \
+ makefile \
+ $(inc)\version.inc \
+ $(inc)\parse.asm \
+ $(inc)\psdata.inc
+
+_msgret.obj: _msgret.asm \
+ makefile \
+ mem.ctl \
+ $(inc)\msgserv.asm \
+ $(inc)\sysmsg.inc
+
+mem.obj: mem.c \
+ xmm.h \
+ msgdef.h \
+ mem.h \
+ $(hinc)\version.h \
+ $(hinc)\copyrigh.h
+
+membase.obj: membase.c \
+ xmm.h \
+ msgdef.h \
+ mem.h \
+ $(hinc)\version.h \
+ $(hinc)\copyrigh.h
+
+memex.obj: memex.c \
+ xmm.h \
+ msgdef.h \
+ mem.h \
+ $(hinc)\version.h \
+ $(hinc)\copyrigh.h
+
+submsg.obj: submsg.c \
+ xmm.h \
+ msgdef.h \
+ mem.h \
+ $(hinc)\version.h \
+ $(hinc)\copyrigh.h
+
+memctrlc.obj: memctrlc.c \
+ $(hinc)\copyrigh.h
+
+chkvdisk.obj: chkvdisk.asm
+
+$(dest): mem.obj _msgret.obj _parse.obj memex.obj submsg.obj membase.obj \
+ mem.lnk chkvdisk.obj memctrlc.obj
+ link16 $(exelink) @mem.lnk
diff --git a/private/mvdm/dos/v86/cmd/mem/mem.c b/private/mvdm/dos/v86/cmd/mem/mem.c
new file mode 100644
index 000000000..2a40b4222
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/mem.c
@@ -0,0 +1,467 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+
+/*----------------------------------------------------------------------+
+| |
+| |
+| Title: MEM |
+| |
+| Syntax: |
+| |
+| From the DOS command line: |
+| |
+| MEM |
+| - Used to display DOS memory map summary. |
+| |
+| MEM /PROGRAM |
+| - Used to display DOS memory map. |
+| |
+| MEM /DEBUG |
+| - Used to display a detailed DOS memory map. |
+| |
+| AN001 - PTM P2914 -> This PTM relates to MEM's ability to report|
+| the accurate total byte count for EM |
+| memory. |
+| |
+| AN002 - PTM P3477 -> MEM was displaying erroneous base memory |
+| information for "Total" and "Available" |
+| memory. This was due to incorrect logic |
+| for RAM carving. |
+| |
+| AN003 - PTM P3912 -> MEM messages do not conform to spec. |
+| PTM P3989 |
+| |
+| Date: 1/28/88 |
+| |
+| AN004 - PTM P4510 -> MEM does not give correct DOS size. |
+| |
+| Date: 4/27/88 |
+| |
+| AN005 - PTM P4957 -> MEM does not give correct DOS size for |
+| programs loaded into high memory. |
+| |
+| Date: 6/07/88 |
+| |
+| Revision History |
+| ================ |
+| |
+| M000 SR 8/27/90 Added new Ctrl-C handler to delink UMBs |
+| |
+| M003 NSM 12/28/90 Added a New switch /Classify which |
+| groups programs in conv and UMB and gives sizes |
+| in decimal and hex. |
+| |
++----------------------------------------------------------------------*/
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+#include "ctype.h"
+#include "conio.h" /* need for kbhit prototype */
+#include "stdio.h"
+#include "dos.h"
+#include "string.h"
+#include "stdlib.h"
+#include "msgdef.h"
+#include "parse.h"
+#include "version.h" /* MSKK02 07/18/89 */
+#include "mem.h"
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+/* All global declarations go here */
+
+ char *SingleDrive = "%c:" ;
+ char *MultipleDrives = "%c: - %c:" ;
+ char *UnOwned = "----------" ;
+#if IBMCOPYRIGHT /*EGH*/
+ char *Ibmbio = "IBMBIO" ; /*EGH*/
+ char *Ibmdos = "IBMDOS" ; /*EGH*/
+#else /*EGH*/
+ char *Ibmbio = "IO " ;
+ char *Ibmdos = "MSDOS " ;
+#endif /*EGH*/
+ char LinkedIn = 0; /* Flag set when mem links in UMBs :M000 */
+ void (interrupt far *OldCtrlc)(); /* Old Ctrlc handler save vector :M000*/
+
+/*----------------------------------------------------------------------+
+| define structure used by parser |
++----------------------------------------------------------------------*/
+
+struct p_parms p_p;
+
+struct p_parmsx p_px;
+
+struct p_control_blk p_con1;
+struct p_control_blk p_con2;
+struct p_control_blk p_con3;
+struct p_control_blk p_con4;
+
+struct p_result_blk p_result1;
+struct p_result_blk p_result2;
+struct p_result_blk p_result3;
+struct p_result_blk p_result4;
+
+struct p_value_blk p_noval;
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+ struct sublistx sublist[4];
+
+ unsigned far *ArenaHeadPtr;
+ struct SYSIVAR far *SysVarsPtr;
+
+ char OwnerName[128];
+ char TypeText[128];
+ char cmd_line[128];
+ char far *cmdline;
+
+ unsigned UMB_Head;
+ unsigned LastPSP=0;
+
+ char UseArgvZero = TRUE;
+ char EMSInstalledFlag = (char) 2;
+
+ union REGS InRegs;
+ union REGS OutRegs;
+ struct SREGS SegRegs;
+
+ int DataLevel;
+ int Classify; /* M003 */
+ int i;
+
+ int BlockDeviceNumber;
+ char *Parse_Ptr; /* ;an003; dms; pointer to command */
+
+ struct mem_classif mem_table[100]; /* M003 */
+ int noof_progs = 0; /* no of entries in mem_table above */
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void interrupt cdecl far MemCtrlc (unsigned es, unsigned ds,
+ unsigned di, unsigned si, unsigned bp, unsigned sp,
+ unsigned bx, unsigned dx, unsigned cx, unsigned ax );
+
+
+int main()
+{
+ unsigned char UMB_Linkage;
+ unsigned int rc=0; /* init to NO ERROR */
+
+
+ sysloadmsg(&InRegs,&OutRegs);
+ if ((OutRegs.x.cflag & CarryFlag) == CarryFlag)
+ {
+ sysdispmsg(&OutRegs,&OutRegs);
+ exit(1);
+ }
+
+
+ InRegs.h.ah = (unsigned char) 0x62; /* an000; dms; get the PSP */
+ intdosx(&InRegs, &InRegs, &SegRegs); /* an000; dms; invoke the INT 21 */
+
+ FP_OFF(cmdline) = 0x81; /* an000; dms; offset of command line */
+ FP_SEG(cmdline) = InRegs.x.bx; /* an000; dms; segment of command line */
+
+ i = 0; /* an000; dms; init index */
+ while ( *cmdline != (char) '\x0d' ) cmd_line[i++] = *cmdline++; /* an000; dms; while no CR */
+ cmd_line[i++] = (char) '\x0d'; /* an000; dms; CR terminate string */
+ cmd_line[i++] = (char) '\0'; /* an000; dms; null terminate string */
+
+ DataLevel = Classify = 0; /* M003 */
+ CSwitch_init(); /* M003: init data structures for */
+ /* Classify */
+ parse_init(); /* an000; dms; init for parser */
+ InRegs.x.si = (unsigned)cmd_line; /* an000; dms; initialize to command ln.*/
+ InRegs.x.cx = (unsigned)0; /* an000; dms; ordinal of 0 */
+ InRegs.x.dx = (unsigned)0; /* an000; dms; init pointer */
+ InRegs.x.di = (unsigned)&p_p; /* an000; dms; point to ctrl blocks */
+ Parse_Ptr = cmd_line; /*;an003; dms; point to command */
+
+ parse(&InRegs,&OutRegs); /* an000; dms; parse command line */
+ while (OutRegs.x.ax == p_no_error) /* an000; dms; good parse loop */
+ {
+ if (p_result4.P_SYNONYM_Ptr == (unsigned int)p_con4.p_keyorsw)
+ {
+ for (i = MSG_OPTIONS_FIRST; i <= MSG_OPTIONS_LAST; i++)
+ Sub0_Message(i, STDOUT, Utility_Msg_Class);
+ return(0);
+ }
+ if (p_result1.P_SYNONYM_Ptr == (unsigned int)p_con1.p_keyorsw || /* DEBUG switch */
+ p_result1.P_SYNONYM_Ptr == (unsigned int)p_con1.p_keyorsw +
+ (strlen(p_con1.p_keyorsw)+1))
+ DataLevel = 2; /* flag DEBUG switch */
+
+ if (p_result2.P_SYNONYM_Ptr == (unsigned int)p_con2.p_keyorsw || /* PROGRAM switch */
+ p_result2.P_SYNONYM_Ptr == (unsigned int)p_con2.p_keyorsw +
+ (strlen(p_con2.p_keyorsw)+1))
+ DataLevel = 1; /* flag PROGRAM switch */
+
+/* M003 BEGIN - parsing for switch /C */
+ if (p_result3.P_SYNONYM_Ptr == (unsigned int)p_con3.p_keyorsw || /* Classify switch */
+ p_result3.P_SYNONYM_Ptr == (unsigned int)p_con3.p_keyorsw +
+ (strlen(p_con3.p_keyorsw)+1))
+ {
+ DataLevel = 1; /* treat this similar to /P switch */
+ Classify = 1;
+ }
+/* M003 END */
+
+ Parse_Ptr = (char *) (OutRegs.x.si); /* point to next parm */
+ parse(&OutRegs,&OutRegs); /* parse the line */
+ if (OutRegs.x.ax == p_no_error) /* check for > 1 switch */
+ OutRegs.x.ax = p_too_many; /* flag too many */
+ }
+
+ if (OutRegs.x.ax != p_rc_eol) /* parse error? */
+ {
+ Parse_Message(OutRegs.x.ax,STDERR,Parse_Err_Class,(char far *)Parse_Ptr); /* display parse error */
+ exit(1); /* exit the program */
+ }
+
+ /* Store the current Ctrl-C handler and replace with our
+ Ctrl-C handler :M000
+ */
+ OldCtrlc = _dos_getvect( 0x23 ); /* M000 */
+ _dos_setvect( 0x23, MemCtrlc ); /* M000 */
+
+ if (DataLevel > 0)
+ {
+ /* save current state of UMB linkage */
+ InRegs.x.ax = GET_UMB_LINK_STATE;
+ intdos(&InRegs, &OutRegs);
+ if (!(UMB_Linkage = OutRegs.h.al))
+ { /* UMBs not presently linked, so do it now */
+ InRegs.x.ax = SET_UMB_LINK_STATE;
+ InRegs.x.bx = LINK_UMBS;
+ intdos(&InRegs, &OutRegs);
+ LinkedIn++; /* Indicate that we have linked in UMBs :M000 */
+ }
+
+ rc = DisplayBaseDetail(); /* go show the memory state */
+
+ /* restore original UMB link state */
+ if (!UMB_Linkage) /* weren't linked originally */
+ {
+ InRegs.x.ax = SET_UMB_LINK_STATE;
+ InRegs.x.bx = UNLINK_UMBS;
+ intdos(&InRegs, &OutRegs); /* take 'em out again */
+ LinkedIn--;
+ }
+ }
+ if (!rc) { /* if no error in DisplayBaseDetail */
+ /* go display other things and summary */
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ /* M003 BEGIN - Display summary acc. to option chosen */
+ if (Classify)
+ DisplayClassification();
+ else
+ DisplayBaseSummary(); /* display low memory totals */
+ /* M003 END */
+
+ if (EMSInstalled() && (DataLevel > 1))
+ DisplayEMSDetail(); /* display EMS memory totals */
+
+
+ if (EMSInstalled())
+ DisplayEMSSummary(); /* display EMS memory totals */
+
+ DisplayExtendedSummary(); /* display extended memory summary */
+ /* NOTE: we don't display status of
+ * HMA because to enquire about its
+ * status can cause XMS to kick in
+ *
+ * If we didn't care about that, then
+ * display HMA status here.
+ */
+ } /* end of if (!rc) */
+
+ /* If user did not issue Ctrl-C till here, we just remove the handler */
+ _dos_setvect( 0x23, OldCtrlc ); /* M000 */
+
+ return(rc); /* end of MEM main routine */
+
+ }
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+unsigned long AddressOf(Pointer)
+char far *Pointer;
+{
+
+ unsigned long SegmentAddress,OffsetAddress;
+
+ SegmentAddress = (unsigned long) (FP_SEG(Pointer)) * 16l;
+ OffsetAddress = (unsigned long) (FP_OFF(Pointer));
+
+ return( SegmentAddress + OffsetAddress);
+
+ }
+
+/*----------------------------------------------------------------------+
+| |
+| SUBROUTINE NAME: PARSE_INIT |
+| |
+| SUBROUTINE FUNCTION: |
+| |
+| This routine is called by the FILESYS MAIN routine to initialize|
+| the parser data structures. |
+| |
+| INPUT: |
+| none |
+| |
+| OUTPUT: |
+| properly initialized parser control blocks |
+| |
++----------------------------------------------------------------------*/
+void parse_init()
+ {
+ p_p.p_parmsx_address = &p_px; /* address of extended parm list */
+ p_p.p_num_extra = 0;
+
+ p_px.p_minp = 0;
+ p_px.p_maxp = 0;
+ p_px.p_maxswitch = 4;
+ p_px.p_control[0] = &p_con1;
+ p_px.p_control[1] = &p_con2;
+ p_px.p_control[2] = &p_con3;
+ p_px.p_control[3] = &p_con4;
+ p_px.p_keyword = 0;
+
+ p_con1.p_match_flag = p_none;
+ p_con1.p_function_flag = p_cap_file;
+ p_con1.p_result_buf = (unsigned int)&p_result1;
+ p_con1.p_value_list = (unsigned int)&p_noval;
+ p_con1.p_nid = 2;
+ strcpy(p_con1.p_keyorsw,"/DEBUG"+NUL);
+ strcpy(p_con1.p_keyorsw + (strlen(p_con1.p_keyorsw)+1),"/D"+NUL);
+
+ p_con2.p_match_flag = p_none;
+ p_con2.p_function_flag = p_cap_file;
+ p_con2.p_result_buf = (unsigned int)&p_result2;
+ p_con2.p_value_list = (unsigned int)&p_noval;
+ p_con2.p_nid = 2;
+ strcpy(p_con2.p_keyorsw,"/PROGRAM"+NUL);
+ strcpy(p_con2.p_keyorsw + (strlen(p_con2.p_keyorsw)+1),"/P"+NUL);
+
+ p_con3.p_match_flag = p_none;
+ p_con3.p_function_flag = p_cap_file;
+ p_con3.p_result_buf = (unsigned int)&p_result3;
+ p_con3.p_value_list = (unsigned int)&p_noval;
+ p_con3.p_nid = 2;
+ strcpy(p_con3.p_keyorsw,"/CLASSIFY"+NUL);
+ strcpy(p_con3.p_keyorsw + (strlen(p_con3.p_keyorsw)+1),"/C"+NUL);
+
+ p_con4.p_match_flag = p_none;
+ p_con4.p_function_flag = p_none;
+ p_con4.p_result_buf = (unsigned int)&p_result4;
+ p_con4.p_value_list = (unsigned int)&p_noval;
+ p_con4.p_nid = 1;
+ strcpy(p_con4.p_keyorsw,"/?"+NUL);
+
+ p_noval.p_val_num = 0;
+
+ p_result1.P_Type = 0;
+ p_result1.P_Item_Tag = 0;
+ p_result1.P_SYNONYM_Ptr = 0;
+ p_result1.p_result_buff = 0;
+
+ p_result2.P_Type = 0;
+ p_result2.P_Item_Tag = 0;
+ p_result2.P_SYNONYM_Ptr = 0;
+ p_result2.p_result_buff = 0;
+
+ p_result3.P_Type = 0;
+ p_result3.P_Item_Tag = 0;
+ p_result3.P_SYNONYM_Ptr = 0;
+ p_result3.p_result_buff = 0;
+
+ return;
+
+ } /* end parse_init */
+
+
+/************************************************************************/
+/* Parse_Message - This routine will print only those */
+/* messages that require 1 replaceable */
+/* parm. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm - pointer to parm to replace */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Parse_Message(Msg_Num,Handle,Message_Type,parse_ptr)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+char far *parse_ptr;
+
+{
+
+
+ if (parse_ptr) {
+ sublist[1].value = (unsigned far *)parse_ptr;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 0;
+ sublist[1].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[1].max_width = 40;
+ sublist[1].min_width = 01;
+ sublist[1].pad_char = Blank;
+
+ InRegs.x.cx = SubCnt1;
+ }
+ else
+ InRegs.x.cx = 0;
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ return;
+}
+
+
+/* M003 BEGIN */
+/*----------------------------------------------------------------------+
+| |
+| SUBROUTINE NAME: CSwitch_init |
+| |
+| SUBROUTINE FUNCTION: |
+| |
+| This routine is called by the FILESYS MAIN routine to initialize|
+| the C(lassify) switch related data structures. |
+| |
+| INPUT: |
+| none |
+| |
+| OUTPUT: |
+| properly initialized C switch related Data structures |
+| |
++----------------------------------------------------------------------*/
+void CSwitch_init()
+{
+ int i;
+ int *ptr;
+
+ ptr = (int *) (mem_table);
+
+ for (i=sizeof(mem_table)/2;i>0;i--)
+ *ptr++ = 0;
+
+ noof_progs=0;
+}
+
+/* M003 END */
+
diff --git a/private/mvdm/dos/v86/cmd/mem/mem.h b/private/mvdm/dos/v86/cmd/mem/mem.h
new file mode 100644
index 000000000..d9f877121
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/mem.h
@@ -0,0 +1,233 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+ /* MEM.H - general equates and externals for the MEM command.
+ * Extracted from the original MEM.C file.
+ */
+
+/* Structure definitions */
+
+struct DEVICEHEADER {
+ struct DEVICEHEADER far *NextDeviceHeader;
+ unsigned Attributes;
+ unsigned Strategy;
+ unsigned Interrupt;
+ char Name[8];
+ };
+
+
+struct SYSIVAR {
+ char far *DpbChain;
+ char far *SftChain;
+ char far *Clock;
+ char far *Con;
+ unsigned MaxSectorSize;
+ char far *BufferChain;
+ char far *CdsList;
+ char far *FcbChain;
+ unsigned FcbKeepCount;
+ unsigned char BlockDeviceCount;
+ char CdsCount;
+ struct DEVICEHEADER far *DeviceDriverChain;
+ unsigned NullDeviceAttributes;
+ unsigned NullDeviceStrategyEntryPoint;
+ unsigned NullDeviceInterruptEntryPoint;
+ char NullDeviceName[8];
+ char SpliceIndicator;
+ unsigned DosParagraphs;
+ char far *DosServiceRntryPoint;
+ char far *IfsChain;
+ unsigned BufferValues;
+ unsigned LastDriveValue;
+ char BootDrive;
+ char MoveType;
+ unsigned ExtendedMemory;
+ };
+
+
+struct ARENA {
+ char Signature;
+ unsigned Owner;
+ unsigned Paragraphs;
+ char Dummy[3];
+ char OwnerName[8];
+ };
+
+struct sublistx {
+ unsigned char size; /* sublist size */
+ unsigned char reserved; /* reserved for future growth */
+ unsigned far *value; /* pointer to replaceable parm */
+ unsigned char id; /* type of replaceable parm */
+ unsigned char flags; /* how parm is to be displayed */
+ unsigned char max_width; /* max width of replaceable field */
+ unsigned char min_width; /* min width of replaceable field */
+ unsigned char pad_char; /* pad character for replaceable field */
+ };
+
+struct mem_classif { /* M003 - struct for storing sizes */
+ unsigned int psp_add; /* acc. to PSPs */
+ unsigned int mem_conv; /* conv.mem for PSP */
+ unsigned int mem_umb; /* umb mem for PSP */
+};
+
+/* miscellaneous defines */
+
+#define DA_TYPE 0x8000;
+#define DA_IOCTL 0x4000;
+
+#define a(fp) ((char) fp)
+
+/* relevant DOS functions */
+
+#define GET_VECT 0x35
+#define GET_UMB_LINK_STATE 0x5802
+#define SET_UMB_LINK_STATE 0x5803
+#define LINK_UMBS 1
+#define UNLINK_UMBS 0
+
+#define EMS 0x67
+
+#define CASSETTE 0x15 /* interrupt to get extended memory */
+
+#define DOSEMSVER 0x40 /* EMS version */
+
+#define EMSGetStat 0x4000 /* get stat */
+#define EMSGetVer 0x4600 /* get version */
+#define EMSGetFreePgs 0x4200 /* get free pages */
+
+#define GetExtended 0x8800 /* get extended memory size */
+
+
+/* defines used by total memory determination */
+#define GET_PSP (unsigned char ) 0x62 /* get PSP function call */
+
+#define MEMORY_DET 0x12 /* BIOS interrupt used to get total memory size */
+
+#define FALSE (char)(1==0)
+#define TRUE !(FALSE)
+#define CR '\x0d'
+#define LF '\x0a'
+#define NUL (char) '\0'
+#define TAB '\x09'
+#define BLANK ' '
+
+#define MAX_CLDATA_INDEX 100
+ /* max index no for mem_table array */
+ /* this is the max no of progs or free arenas that mem/c can used */
+ /* to process ; if the memory is fragmented and too many progs are */
+ /* loaded such that this no exceeds 100, we terminate with errmsg */
+
+/* external variables */
+
+extern unsigned DOS_TopOfMemory; /* PSP Top of memory from 'C' init code */ /* ;an005; */
+extern unsigned far *ArenaHeadPtr;
+extern struct SYSIVAR far *SysVarsPtr;
+
+extern unsigned UMB_Head;
+extern unsigned LastPSP;
+
+extern char OwnerName[128];
+extern char TypeText[128];
+extern char cmd_line[128];
+extern char far *cmdline;
+
+extern char UseArgvZero;
+extern char EMSInstalledFlag;
+
+extern union REGS InRegs;
+extern union REGS OutRegs;
+extern struct SREGS SegRegs;
+
+extern int DataLevel;
+extern int Classify;
+extern int i;
+
+extern int BlockDeviceNumber;
+extern char *Parse_Ptr; /* ;an003; dms; pointer to command */
+extern struct mem_classif mem_table[MAX_CLDATA_INDEX];
+extern int noof_progs;
+
+extern struct sublistx sublist[4];
+
+extern char *SingleDrive;
+extern char *MultipleDrives;
+extern char *UnOwned;
+extern char *Ibmbio;
+extern char *Ibmdos;
+
+
+/* function prototypes */
+
+int main(void);
+int printf();
+int sprintf();
+int strcmp(const char *, const char *);
+int sscanf();
+void exit(int);
+int kbhit();
+char *OwnerOf(struct ARENA far *);
+char *TypeOf(struct ARENA far *);
+unsigned long AddressOf(char far *);
+void CSwitch_init(void);
+
+char EMSInstalled(void);
+void DisplayEMSSummary(void);
+void DisplayEMSDetail(void);
+
+void DisplayBaseSummary(void);
+void DisplayExtendedSummary(void);
+unsigned CheckDOSHigh(void);
+unsigned CheckVDisk(void);
+
+unsigned int DisplayBaseDetail(void);
+
+void DisplayClassification(void); /* M003 */
+unsigned long DispMemClass(int); /* M003 */
+void DispBigFree(char,unsigned int); /* M003 */
+
+unsigned int AddMem_to_PSP(unsigned int,unsigned long,unsigned long); /* M003 */
+
+void GetFromArgvZero(unsigned,unsigned far *);
+
+void DisplayDeviceDriver(struct DEVICEHEADER far *,int);
+
+void parse_init(void);
+
+void Parse_Message(int,int,unsigned char,char far *);
+void Sub0_Message(int,int,unsigned char);
+void Sub1_Message(int,int,unsigned char,unsigned long int *);
+void Sub2_Message(int,int,unsigned char,char *,int);
+void Sub3_Message(int,int,unsigned char,
+ char *,
+ unsigned long int *,
+ int);
+
+void Sub4_Message(int,int,unsigned char,
+ unsigned long int *,
+ int,
+ unsigned long int *,
+ int);
+
+void Sub4a_Message(int,int,unsigned char,
+ unsigned long int *,
+ char *,
+ unsigned long int *,
+ char *);
+
+void EMSPrint(int,int,unsigned char,
+ int *,
+ char *,
+ unsigned long int *);
+
+void SubC2_Message(int,int,unsigned long int*,char*); /* M003 */
+
+void SubC4_Message(int,int,char *,int, /* M003 */
+ unsigned long int *,
+ char *);
+
+extern void sysloadmsg(union REGS *, union REGS *);
+extern void sysdispmsg(union REGS *, union REGS *);
+extern void sysgetmsg(union REGS *, struct SREGS *, union REGS *);
+extern void parse(union REGS *, union REGS *);
diff --git a/private/mvdm/dos/v86/cmd/mem/mem.lnk b/private/mvdm/dos/v86/cmd/mem/mem.lnk
new file mode 100644
index 000000000..a06e4d841
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/mem.lnk
@@ -0,0 +1,11 @@
+mem+
+_msgret+
+_parse+
+memex+
+submsg+
+membase+
+chkvdisk+
+memctrlc
+
+
+..\..\lib\xmm ..\..\lib\mem ..\..\lib\;
diff --git a/private/mvdm/dos/v86/cmd/mem/mem.skl b/private/mvdm/dos/v86/cmd/mem/mem.skl
new file mode 100644
index 000000000..abe97b65d
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/mem.skl
@@ -0,0 +1,83 @@
+
+:util MEM
+
+:class 1
+
+:class A
+:use COMMON1 ;Incorrect DOS version
+:def 10 CR,LF
+:def 11 " Address Name Size Type ",CR,LF
+:def 12 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+:def 13 " Handle EMS Name Size ",CR,LF
+:def 14 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+:def 15 " %1 %2 %3 %4",CR,LF
+:def 16 " %1 %2 %3 ",CR,LF
+:def 17 " %1 %2 ",CR,LF ;fix in usa
+:def 18 "%1 bytes total conventional memory",CR,LF
+:def 19 "%1 bytes available for MS-DOS",CR,LF
+:def 20 "%1 largest executable program size",CR,LF
+:def 21 "%1 bytes total EMS memory",CR,LF
+:def 22 "%1 bytes free EMS memory",CR,LF
+:def 23 "%1 bytes total contiguous extended memory",CR,LF
+:def 24 "Interrupt Vector",0
+:def 25 "ROM Communication Area",0
+:def 26 "DOS Communication Area",0
+:def 27 "IBMBIO",0
+:def 28 "IBMDOS",0
+:def 29 "System Data",0
+:def 30 "System Program",0
+:def 31 "System Device Driver",0
+:def 32 "Installed Device Driver",0
+:def 33 "%1:",0
+:def 34 "%1: - %2:",0
+:def 35 "BUFFERS=",0
+:def 36 "FILES=",0
+:def 37 "FCBS=",0
+:def 38 "STACKS=",0
+:def 39 "DEVICE=",0
+:def 40 "IFS=",0
+:def 45 "INSTALL=",0
+:def 56 "IBMBIO",0 ;*EGH
+:def 57 "IBMDOS",0 ;*EGH
+:def 59 "Memory below 640K (Conventional Message)"
+:def 60 "Memory above 640K (Upper Memory Blocks)"
+:def 61 " Total FREE: "
+:def 63 "Name size in decimal size in hex",CR,LF
+:def 64 "-------- --------------- -----------",CR,LF
+:def 65 "Total bytes avail to programs (Conv + UMB) : %1 %2",CR,LF
+:def 66 "Largest executable program size : %1 %2",CR,LF
+:def 67 "Largest Loadhigh executable program size : %1 %2",CR,LF
+:def 68 "Too much of memory fragmentation; MEM /C cannot be done",CR,LF
+:def 69 "SYSTEM"
+:def 70 "Total bytes avail to programs : %1 %2",CR,LF
+
+
+; 300 - 399 reserved for options help messages
+:def 300 MEM /?
+:def 301 MEM /?
+:def 302 MEM /?
+:def 303 MEM /?
+:def 304 MEM /?
+
+:class B
+:def 41 "LASTDRIVE=",0
+:def 42 "----------",0
+:def 43 " ",0
+:def 44 " %1 %2 %3",CR,LF
+:def 46 "%1 bytes available contiguous extended memory",CR,LF
+:def 47 "System Stacks",0
+:def 48 "-- Free --",0
+:def 49 "Program",0
+:def 50 "Environment",0
+:def 51 "Data",0
+:def 52 "%1 bytes available XMS memory",0
+:def 53 " 64Kb High Memory Area available",CR,LF
+:def 54 " High Memory Area in use",CR,LF
+:def 55 " MS-DOS resident in High Memory Area",CR,LF
+:def 58 " MS-DOS resident in ROM using High Memory Area",CR,LF
+:def 62 "FREE",0
+
+:def 400 "ADDDRV",0
+
+:end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/mem/mem.tag b/private/mvdm/dos/v86/cmd/mem/mem.tag
new file mode 100644
index 000000000..67654d81a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/mem.tag
@@ -0,0 +1,34 @@
+M000 SR 08/27/90 Added a Ctrl-C handler for Mem which delinks
+ UMBs if they were linked in by Mem.
+ Bug #2542
+ Files: MEM.C
+ New File: MEMCTRLC.C
+
+M001 SR 08/27/90 Changed Mem's strategy to find largest
+ executable block. This used to fail in UMBs
+ because Mem assumed the largest block to be
+ the one it was currently loaded in.
+ Bug #2541
+ Files: MEMBASE.C
+
+M002 NSM 11/20/90 Mem now checks for OwnerNames being printable
+ If they are not printable, it displays "----".
+ Bug#3310 File: MemBase.C
+
+M003 NSM 1/15/91 Added new switch /C. This groups the progs in
+ conv. and UMB acc.to psps and displays the size
+ in Decimal and hex.
+ MEM.C : Changes for parsing new switch
+ MEM.H : defines new data structures for /C opt
+ MEM.SKL : new messages for /C
+ MSGDEF.H: -- do --
+ MEMBASE.C: New code for /C added at end
+ PARSE.H: extra decls for /C switch
+ SUBMSG.C : Code for display of two new types of
+ msgs for /C switch added
+
+M004 NSM 1/16/91 Fixed problems with XBDA size in reporting total
+ mem size. (P4855)
+ MEMBASE.C : Check to see if XBDA is at end of
+ conv.mem before adding it to total mem size
+
diff --git a/private/mvdm/dos/v86/cmd/mem/membase.c b/private/mvdm/dos/v86/cmd/mem/membase.c
new file mode 100644
index 000000000..70797d578
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/membase.c
@@ -0,0 +1,1160 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/* MEMBASE.C - MEM routines for determining and displaying memory usage
+* for conventional memory.
+*/
+
+#include "stdio.h"
+#include "dos.h"
+#include "string.h"
+#include "stdlib.h"
+#include "msgdef.h"
+#include "version.h"
+#include "mem.h"
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+/* go through the arena and print out the program name,size etc for /P switch */
+/* but just keep storing them in a datastruct for later disp. for /C switch */
+
+unsigned int DisplayBaseDetail()
+{
+
+ struct ARENA far *ThisArenaPtr;
+ struct ARENA far *NextArenaPtr;
+ struct ARENA far *ThisConfigArenaPtr;
+ struct ARENA far *NextConfigArenaPtr;
+
+ struct DEVICEHEADER far *ThisDeviceDriver;
+
+ int SystemDataType;
+ char SystemDataOwner[64];
+ unsigned int far *UMB_Head_ptr;
+
+ unsigned int long Out_Var1;
+ unsigned int long Out_Var2;
+ char Out_Str1[64];
+ char Out_Str2[64];
+ unsigned int msgno;
+
+ InRegs.h.ah = (unsigned char) 0x52;
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+
+ FP_SEG(SysVarsPtr) = FP_SEG(UMB_Head_ptr) = SegRegs.es;
+ FP_OFF(SysVarsPtr) = OutRegs.x.bx;
+
+ FP_OFF(UMB_Head_ptr) = 0x8c; /* ptr to UMB_HEAD in DOS Data */
+ UMB_Head = *UMB_Head_ptr;
+
+ if (!Classify)
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ if (DataLevel > 0)
+ {
+ if (!Classify) {
+ Sub0_Message(Title1Msg,STDOUT,Utility_Msg_Class);
+ Sub0_Message(Title2Msg,STDOUT,Utility_Msg_Class);
+ }
+ }
+
+ InRegs.h.ah = (unsigned char) 0x30;
+ intdos(&InRegs, &OutRegs);
+
+ if ( (OutRegs.h.al != (unsigned char) 3) || (OutRegs.h.ah < (unsigned char) 40) )
+ UseArgvZero = TRUE;
+ else UseArgvZero = FALSE;
+
+ /* Display stuff below DOS */
+ Out_Var1 = 0l;
+ Out_Var2 = 0x400l;
+ if (Classify) /* M003 */
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ BlankMsg,
+ &Out_Var2,
+ InterruptVectorMsg);
+
+ Out_Var1 = 0x400l;
+ Out_Var2 = 0x100l;
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ BlankMsg,
+ &Out_Var2,
+ ROMCommunicationAreaMsg);
+
+ Out_Var1 = 0x500l;
+ Out_Var2 = 0x200l;
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ BlankMsg,
+ &Out_Var2,
+ DOSCommunicationAreaMsg);
+
+ /* Display the DOS data */
+
+ /* Display the BIO data location and size */
+
+ if (!Classify)
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+
+ Out_Var1 = 0x700l;
+ Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l;
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ IbmbioMsg,
+ &Out_Var2,
+ SystemDataMsg);
+
+ /* Display the Base Device Driver Locations and Sizes */
+
+ /*********************************************************************/
+ /* to do this get the starting address of the internal driver header */
+ /* chain. Start from the first header and get the address of the */
+ /* first header. Display the driver name and address by calling */
+ /* "DISPLAYDEVICEDRIVER". Repeat this for next driver on the chain */
+ /* until the last driver. Note that driver name is in the header. */
+ /* The driver header addrs is in the system variable table from */
+ /* INT 21H fun 52H call. */
+ /*********************************************************************/
+
+ BlockDeviceNumber = 0;
+
+ for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain;
+ (FP_OFF(ThisDeviceDriver) != 0xFFFF);
+ ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader)
+ { if ( FP_SEG(ThisDeviceDriver) < FP_SEG(SysVarsPtr) )
+ DisplayDeviceDriver(ThisDeviceDriver,SystemDeviceDriverMsg);
+ }
+
+ /* Display the DOS data location and size */
+
+ FP_SEG(ArenaHeadPtr) = FP_SEG(SysVarsPtr); /* ;an004; */
+ FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2; /* ;an004; */
+ /* ;an004; */
+ FP_SEG(ThisArenaPtr) = *ArenaHeadPtr; /* ;an004; */
+ FP_OFF(ThisArenaPtr) = 0; /* ;an004; */
+ if (!Classify)
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+ Out_Var1 = (long) FP_SEG(SysVarsPtr) * 16l;
+ Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1); /* ;ac004; */
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ IbmdosMsg,
+ &Out_Var2,
+ SystemDataMsg);
+
+ if (!Classify)
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+ /* Display the memory data */
+
+/* IO.SYS data area contains BUFFERS, FCBs, LAST DRIVE etc. They are contained */
+/* in a one huge memory block. This block has a seg iD 0008. This seg ID can */
+/* be found from the block header owner area. This seg id 0008:0000 */
+/* points to the buffer table as shown below. If seg id is 0008:000, then */
+/* using the seg id find the table. Each entry is contained in a sub block */
+/* within the main block. Each sub block has header and this header contains */
+/* id such as B for BUFFER, X for FCBs, I for IFS, D for external device */
+/* drivers. Go through the sub blocks and display the name ans size. that's all. */
+/* */
+/* If the block contains D, then it contains external drivers. The driver name */
+/* is not in the sub block. So we have to find the driver name from the driver */
+/* header chain. To do this get the address of the driver chain from syster */
+/* variable table from INT 21H FN 52H call. Go through the chain and findout */
+/* the name. Display name from the header and the size we got from the sub block. */
+/* */
+/* */
+/* After this main block, comes other buffer blocks which contains programs */
+/* such as command.com, doscolor, even MEM. From these blocks, get the program */
+/* name and the size and display them too. */
+/* */
+/* 0008:000->------------------ ------------------- */
+/* | BUFFERS | -------->|B (signature) | Block header */
+/* ------------------ ------------------- */
+/* | FCBs | -- | | */
+/* ------------------ | | Buffers data | */
+/* | IFSs | | | | */
+/* ------------------ | | | */
+/* | LAST DRIVE | | | | */
+/* ------------------ | -------------------- */
+/* | EXTERN DRIVER 1| | */
+/* ------------------ | ------------------- */
+/* | EXTERN DRIVER 2| | -------->|X (signature) | Block header */
+/* ------------------ ------------------- */
+/* | EXTERN DRIVER 3| | | */
+/* ------------------ | Buffers data | */
+/* | | */
+/* | | */
+/* | | */
+/* -------------------- */
+/* */
+/* For DOS 5.0, there are some additions to the above. Basically, we have
+/* three possible memory maps, to wit:
+/*
+/* DOS Loads Low DOS loads high
+/* 70:0 - BIOS data 70:0 - BIOS data
+/* DOS data DOS data
+/* BIOS + DOS code Sysinit data (arena name SD)
+/* (arena owner 8, name "SC") VDisk header (arena name SC)
+/* Sysinit data (arean owner 8, name SD)
+/*
+/* DOS tries to load high but fails
+/* 70:0 - BIOS data
+/* DOS data
+/* Sysinit data (arena name SD)
+/* DOS + BIOS code (arena name SC)
+/*
+/* We have to detect the special arena ownership marks and display them
+/* correctly. Everything after DOS and BIOS data should have an arena header
+/******************************************************************************/
+
+ while (ThisArenaPtr -> Signature != (char) 'Z')
+ {
+ /* MSKK02 */
+#ifdef JAPAN /* MSKK02 07/18/89 */ /* MSKK02 */
+/* MSKK02 BEGIN */
+ if (ThisArenaPtr -> Owner == 8 || ThisArenaPtr -> Owner == 9 )
+ {
+ FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
+ FP_OFF(NextArenaPtr) = 0;
+
+ Out_Var1 = AddressOf((char far *)ThisArenaPtr);
+ Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;
+ if (ThisArenaPtr->OwnerName[0] == 'S' &&
+ ThisArenaPtr->OwnerName[1] == 'C')
+ { /* display message for BIOS and DOS code */
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else {
+ msgno = (FP_SEG(ThisArenaPtr) < UMB_Head) ? IbmdosMsg:SystemMsg;
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ msgno,
+ &Out_Var2,
+ SystemProgramMsg);
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ }
+ }
+ else /* display message for data */
+ {
+
+ if (!Classify)
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ (ThisArenaPtr -> Owner == 8) ? IbmbioMsg : AdddrvMsg,
+ &Out_Var2,
+ (ThisArenaPtr -> Owner == 8) ? SystemDataMsg : ProgramMsg );
+
+ FP_SEG(ThisConfigArenaPtr) = FP_SEG(ThisArenaPtr) + 1;
+ FP_OFF(ThisConfigArenaPtr) = 0;
+
+
+ while ( (FP_SEG(ThisConfigArenaPtr) > FP_SEG(ThisArenaPtr)) &&
+ (FP_SEG(ThisConfigArenaPtr) < FP_SEG(NextArenaPtr)) )
+ {
+ strcpy(SystemDataOwner," ");
+ switch(ThisConfigArenaPtr -> Signature)
+ {
+ case 'B':
+ SystemDataType = ConfigBuffersMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'D':
+ SystemDataType =ConfigDeviceMsg;
+ strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr));
+ break;
+ case 'F':
+ SystemDataType = ConfigFilesMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'I':
+ SystemDataType = ConfigIFSMsg;
+ strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr));
+ break;
+ case 'L':
+ SystemDataType = ConfigLastDriveMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'S':
+ SystemDataType = ConfigStacksMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'T':
+ SystemDataType = ConfigInstallMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'X':
+ SystemDataType = ConfigFcbsMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case '?':
+ SystemDataType = DataMsg;
+ break;
+ default:
+ SystemDataType = BlankMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ }
+ Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;
+ if (!Classify)
+ Sub3_Message(DriverLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ SystemDataOwner,
+ &Out_Var1,
+ SystemDataType );
+
+ NextConfigArenaPtr = ThisConfigArenaPtr;
+ FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;
+ if (ThisConfigArenaPtr -> Signature == (char) 'D')
+ {
+
+ FP_SEG(ThisDeviceDriver) = FP_SEG(ThisConfigArenaPtr) + 1;
+ FP_OFF(ThisDeviceDriver) = 0;
+ while ( (FP_SEG(ThisDeviceDriver) > FP_SEG(ThisConfigArenaPtr)) &&
+ (FP_SEG(ThisDeviceDriver) < FP_SEG(NextConfigArenaPtr)) ) {
+ DisplayDeviceDriver(ThisDeviceDriver,InstalledDeviceDriverMsg);
+ ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader;
+ }
+ }
+
+ FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;
+ }
+ }
+ }
+
+
+/* MSKK02 END */
+#else
+ if (ThisArenaPtr -> Owner == 8)
+ {
+ FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
+ FP_OFF(NextArenaPtr) = 0;
+
+ Out_Var1 = AddressOf((char far *)ThisArenaPtr);
+ Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;
+ if (ThisArenaPtr->OwnerName[0] == 'S' &&
+ ThisArenaPtr->OwnerName[1] == 'C')
+ { /* display message for BIOS and DOS code */
+ if (Classify)
+ /* classify this memory also as part of DOS */
+ { if (AddMem_to_PSP(8,Out_Var1,Out_Var2)) return(1); }
+ else {
+ msgno = (FP_SEG(ThisArenaPtr) < UMB_Head) ? IbmdosMsg:SystemMsg;
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ msgno,
+ &Out_Var2,
+ SystemProgramMsg);
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ }
+ }
+ else /* display message for data */
+ {
+ if (!Classify)
+ Sub4_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ IbmbioMsg,
+ &Out_Var2,
+ SystemDataMsg);
+
+ FP_SEG(ThisConfigArenaPtr) = FP_SEG(ThisArenaPtr) + 1;
+ FP_OFF(ThisConfigArenaPtr) = 0;
+
+
+ while ( (FP_SEG(ThisConfigArenaPtr) > FP_SEG(ThisArenaPtr)) &&
+ (FP_SEG(ThisConfigArenaPtr) < FP_SEG(NextArenaPtr)) )
+ {
+ strcpy(SystemDataOwner," ");
+ switch(ThisConfigArenaPtr -> Signature)
+ {
+ case 'B':
+ SystemDataType = ConfigBuffersMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'D':
+ SystemDataType = ConfigDeviceMsg;
+ if (AddMem_to_PSP(ThisConfigArenaPtr->Owner,((long)FP_SEG(ThisConfigArenaPtr)*16l) ,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr));
+ break;
+ case 'F':
+ SystemDataType = ConfigFilesMsg;
+ if (AddMem_to_PSP(8,((long)FP_SEG(ThisConfigArenaPtr) *16l),((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'I':
+ SystemDataType = ConfigIFSMsg;
+ strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr));
+ if (AddMem_to_PSP(ThisConfigArenaPtr->Owner,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'L':
+ SystemDataType = ConfigLastDriveMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'S':
+ SystemDataType = ConfigStacksMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ case 'T': /* gga */
+ SystemDataType = ConfigInstallMsg; /* gga */
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break; /* gga */
+ case 'X':
+ SystemDataType = ConfigFcbsMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+
+ // NTVDM for special kbd\mouse drivers
+ case 'Q':
+ SystemDataType = SystemProgramMsg;
+ strcpy(SystemDataOwner,OwnerOf(ThisConfigArenaPtr));
+ if (AddMem_to_PSP(ThisConfigArenaPtr->Owner,((long)FP_SEG(ThisConfigArenaPtr)*16l) ,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ default:
+ SystemDataType = BlankMsg;
+ if (AddMem_to_PSP(8,((long)ThisConfigArenaPtr) <<4,((long)ThisConfigArenaPtr->Paragraphs <<4) +1)) return(1);
+ break;
+ }
+
+ /****************************************************/
+ /* Found one, now display the owner name and size */
+ /****************************************************/
+
+ Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;
+ if (!Classify)
+ Sub3_Message(DriverLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ SystemDataOwner,
+ &Out_Var1,
+ SystemDataType );
+
+ NextConfigArenaPtr = ThisConfigArenaPtr;
+ FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;
+ if (ThisConfigArenaPtr -> Signature == (char) 'D')
+ {
+
+ FP_SEG(ThisDeviceDriver) = FP_SEG(ThisConfigArenaPtr) + 1;
+ FP_OFF(ThisDeviceDriver) = 0;
+/* start MSKK bug fix - MSKK01 */
+ while ( (FP_SEG(ThisDeviceDriver) > FP_SEG(ThisConfigArenaPtr)) &&
+ (FP_SEG(ThisDeviceDriver) < FP_SEG(NextConfigArenaPtr)) ) {
+ DisplayDeviceDriver(ThisDeviceDriver,InstalledDeviceDriverMsg);
+ ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader;
+ }
+/* end MSKK bug fix - MSKK01 */
+ }
+
+ FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;
+
+ }
+ }
+ }
+#endif
+ else {
+
+/*******************************************************************************/
+/* If not BIOS table, it is a program like MEM, etc. */
+/* calculate the size of the block occupied by the program and display program */
+/* name and size */
+/*******************************************************************************/
+
+ Out_Var1 = AddressOf((char far *)ThisArenaPtr);
+ Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
+ strcpy(Out_Str1,OwnerOf(ThisArenaPtr));
+ strcpy(Out_Str2,TypeOf(ThisArenaPtr));
+ if (Classify)
+ { if (AddMem_to_PSP(ThisArenaPtr->Owner,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4a_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ Out_Str1,
+ &Out_Var2,
+ Out_Str2);
+ }
+
+ FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1;
+
+ }
+ Out_Var1 = AddressOf((char far *)ThisArenaPtr);
+ Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
+ strcpy(Out_Str1,OwnerOf(ThisArenaPtr));
+ strcpy(Out_Str2,TypeOf(ThisArenaPtr));
+ if (Classify)
+ { if (AddMem_to_PSP(ThisArenaPtr->Owner,Out_Var1,Out_Var2)) return(1); }
+ else
+ Sub4a_Message(MainLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &Out_Var1,
+ Out_Str1,
+ &Out_Var2,
+ Out_Str2);
+
+
+ return(0); /* end of MEM main routine */
+
+ }
+
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void DisplayDeviceDriver(ThisDeviceDriver,DeviceDriverType)
+struct DEVICEHEADER far *ThisDeviceDriver;
+int DeviceDriverType;
+{
+ char LocalDeviceName[16];
+ int i;
+
+ if (DataLevel < 2) return;
+
+ if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 )
+ { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i];
+ LocalDeviceName[8] = NUL;
+
+ Sub2_Message(DeviceLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ LocalDeviceName,
+ DeviceDriverType);
+
+ }
+
+ else {
+ if ((int) ThisDeviceDriver -> Name[0] == 1)
+ sprintf(&LocalDeviceName[0],SingleDrive,'A'+BlockDeviceNumber);
+ else sprintf(&LocalDeviceName[0],MultipleDrives,
+ 'A'+BlockDeviceNumber,
+ 'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1);
+
+ Sub2_Message(DeviceLineMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ LocalDeviceName,
+ DeviceDriverType);
+
+ BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]);
+
+ }
+
+ return;
+
+ }
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void DisplayBaseSummary()
+ {
+
+ struct PSP_STRUC
+ {
+ unsigned int int_20;
+ unsigned int top_of_memory;
+ };
+
+ char far *CarvedPtr;
+
+ unsigned long int total_mem; /* total memory in system */
+ unsigned long int avail_mem; /* avail memory in system */
+ unsigned long int free_mem; /* free memory */
+ unsigned long biggest_free; /* largest free block now :M001 */
+ struct PSP_STRUC far *PSPptr;
+
+/* skip a line */
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+/* get PSP info */
+ InRegs.h.ah = GET_PSP; /* get PSP function call */
+ intdos(&InRegs,&OutRegs);
+
+ FP_SEG(PSPptr) = OutRegs.x.bx; /* PSP segment */
+ FP_OFF(PSPptr) = 0; /* offset 0 */
+
+/* Get total memory in system */
+ int86(MEMORY_DET,&InRegs,&OutRegs);
+
+/* Convert to bytes */
+ total_mem = (unsigned long int) OutRegs.x.ax * 1024l;
+ avail_mem = total_mem;
+
+/* M004 BEGIN */
+/* Adjust for XBDA size */
+/* XBDA size should be added to total mem size reported by INT 12 */
+/* IFF XBDA is placed just at the end of conv.mem */
+/* IF EMM386 or QEMM is loaded, XBDA gets relocated to EMM driver mem */
+/* and int 12 reports correct size of memory in this case */
+
+ InRegs.x.bx = 0;
+ InRegs.x.ax = 0xc100;
+ int86x(0x15, &InRegs, &OutRegs, &SegRegs);
+ if (OutRegs.x.cflag == 0)
+ {
+ if (total_mem == ((long)SegRegs.es) * 16l) {
+ FP_SEG(CarvedPtr) = SegRegs.es;
+ FP_OFF(CarvedPtr) = 0;
+ total_mem = total_mem + ( (unsigned long int) (*CarvedPtr) * 1024l) ; /* ;an002; dms;adjust total for */
+ }
+ } /* RAM carve value */
+/* M004 END */
+
+ Sub1_Message(TotalMemoryMsg,STDOUT,Utility_Msg_Class,&total_mem);
+
+ Sub1_Message(AvailableMemoryMsg,STDOUT,Utility_Msg_Class,&avail_mem);
+
+/* Calculate the total memory used. PSP segment * 16. Subtract from total to
+ get free_mem */
+ free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l); /* ;an000;ac005; */
+
+ /* Get largest free block in system :M001 */
+
+ InRegs.x.ax = 0x4800; /* M001 */
+ InRegs.x.bx = 0xffff; /* M001 */
+ intdos(&InRegs, &OutRegs); /* M001 */
+ biggest_free = OutRegs.x.bx * 16L; /* Size of largest block now :M001 */
+
+ /* The largest free block in the system is either the block we are
+ currently in or the block we have allocated. We can either be the
+ topmost program or be loaded in a hole or UMB. In either case, the
+ larger of the 2 values gives us the largest free block :M001
+ */
+
+ if ( biggest_free > free_mem ) /* M001 */
+ free_mem = biggest_free; /* M001 */
+
+ Sub1_Message(FreeMemoryMsg,STDOUT,Utility_Msg_Class,&free_mem);
+
+ return;
+
+ } /* end of display_low_total */
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+
+char *OwnerOf(ArenaPtr)
+struct ARENA far *ArenaPtr;
+{
+
+ char far *StringPtr;
+ char *o;
+ unsigned far *EnvironmentSegmentPtr;
+ unsigned PspSegment;
+ int i,fPrintable;
+
+ o = &OwnerName[0];
+ *o = NUL;
+ sprintf(o,UnOwned);
+
+ PspSegment = ArenaPtr -> Owner;
+
+
+ if (PspSegment == 0) sprintf(o,Ibmdos);
+ else if (PspSegment == 8) sprintf(o,Ibmbio);
+ else {
+ FP_SEG(ArenaPtr) = PspSegment-1; /* -1 'cause Arena is 16 bytes before PSP */
+ StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
+/* M002 BEGIN */
+ fPrintable = TRUE;
+
+
+/* Chars below 0x20 (Space) and char 0x7f are not printable in US and
+ * European Code pages. The following code checks for it and does not print
+ * such names. - Nagara 11/20/90
+ */
+
+#ifndef DBCS
+ for (i = 0; i < 8;i++,StringPtr++) {
+ if ( (*StringPtr < 0x20) | (*StringPtr == 0x7f) ) {
+ /* unprintable char ? */
+ if (*StringPtr) fPrintable = FALSE;
+ break;
+ }
+ }
+#endif
+
+ if (fPrintable) { /* the name is printable */
+ StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
+ for (i = 0; i < 8;i++)
+ *o++ = *StringPtr++;
+ *o = (char) '\0';
+ }
+/* M002 END */
+ }
+
+ if (UseArgvZero) GetFromArgvZero(PspSegment,EnvironmentSegmentPtr);
+
+ return(&OwnerName[0]);
+
+ }
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void GetFromArgvZero(PspSegment,EnvironmentSegmentPtr)
+unsigned PspSegment;
+unsigned far *EnvironmentSegmentPtr;
+{
+
+ char far *StringPtr;
+ char *OutputPtr;
+ unsigned far *WordPtr;
+
+ OutputPtr = &OwnerName[0];
+
+ if (UseArgvZero)
+ {
+ if (PspSegment < FP_SEG(ArenaHeadPtr))
+ {
+ if (*OutputPtr == NUL) sprintf(OutputPtr,Ibmdos);
+ }
+ else {
+ FP_SEG(EnvironmentSegmentPtr) = PspSegment;
+ FP_OFF(EnvironmentSegmentPtr) = 44;
+
+/* FP_SEG(StringPtr) = *EnvironmentSegmentPtr; */
+ FP_SEG(StringPtr) = FP_SEG(EnvironmentSegmentPtr);
+ FP_OFF(StringPtr) = 0;
+
+ while ( (*StringPtr != NUL) || (*(StringPtr+1) != NUL) ) StringPtr++;
+
+ StringPtr += 2;
+ WordPtr = (unsigned far *) StringPtr;
+
+ if (*WordPtr == 1)
+ {
+ StringPtr += 2;
+ while (*StringPtr != NUL)
+ *OutputPtr++ = *StringPtr++;
+ *OutputPtr++ = NUL;
+
+ while ( OutputPtr > &OwnerName[0] )
+ { if (*OutputPtr == (char) '.') *OutputPtr = NUL;
+ if ( (*OutputPtr == (char) '\\') || (*OutputPtr == (char) ':') )
+ { OutputPtr++;
+ break;
+ }
+ OutputPtr--;
+ }
+
+ }
+
+ }
+ }
+
+ strcpy(&OwnerName[0],OutputPtr);
+
+ return;
+
+ }
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+
+char *TypeOf(Header)
+struct ARENA far *Header;
+{
+
+ char *t;
+ unsigned PspSegment;
+ unsigned far *EnvironmentSegmentPtr;
+ unsigned int Message_Number;
+ char far *Message_Buf;
+ unsigned int i;
+
+ t = &TypeText[0];
+ *t = NUL;
+
+ Message_Number = 0xff; /* ;an000; initialize number value */
+ if (Header -> Owner == 8) Message_Number = StackMsg;
+ if (Header -> Owner == 0) Message_Number = FreeMsg;
+
+ PspSegment = Header -> Owner;
+ if (PspSegment < FP_SEG(ArenaHeadPtr))
+ {
+ if (Message_Number == 0xff) Message_Number = BlankMsg;
+ }
+ else {
+ FP_SEG(EnvironmentSegmentPtr) = PspSegment;
+ FP_OFF(EnvironmentSegmentPtr) = 44;
+
+
+ if (PspSegment == FP_SEG(Header)+1)
+ Message_Number = ProgramMsg;
+ else if ( *EnvironmentSegmentPtr == FP_SEG(Header)+1 )
+ Message_Number = EnvironMsg;
+ else
+ Message_Number = DataMsg;
+
+ }
+
+ InRegs.x.ax = Message_Number;
+ InRegs.h.dh = Utility_Msg_Class;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(Message_Buf) = OutRegs.x.si;
+ FP_SEG(Message_Buf) = SegRegs.ds;
+
+ i = 0;
+ while ( *Message_Buf != (char) '\x0' )
+ TypeText[i++] = *Message_Buf++;
+ TypeText[i++] = '\x0';
+
+
+ return(t);
+
+ }
+/* M003 BEGIN */
+/*----------------------------------------------------------------------*/
+/* AddMem_to_PSP */
+/* Entry: PSP_ADDR (to which this mem. should be added) */
+/* ARENA_START_ADDR */
+/* Length_of_Arena */
+/* Exit: mem_table updated. */
+/* returns 1 if more than MAX_CL_ENTRIES in mem_table */
+/* else 0 */
+/* */
+/* CAVEATS: */
+/* -------- */
+/* 1. any system area (BIOS,SYSINIT,DOS ) code/data is listed as belonging */
+/* to PSP 8. */
+/* */
+/* 2. We look at the UMB_HEAD in DOS DATA to determine whether an arena */
+/* is in UMB or not; For the Arena at the UMB boundary, we add one */
+/* para to conv. and remaining to UMB portion of that PSP */
+/* */
+/* 3. Any free memory is always added as a new entry in the mem_table */
+/* instead of just adding the sizes to an existing FREE entry */
+/* Free memory gets added to the previous free memory if they are */
+/* contiguous */
+/* */
+/* 4. The no of programs/free arenas cannot exceed a max of (100) */
+/* (defined by MAX_CLDATA_INDEX ) */
+/* If the memory is fragmented and a lot of small TSRs loaded such */
+/* that we exceed this limit, we TERMINATE */
+/* */
+/* 5. Mem occupied by this MEM are also reported as FREE mem */
+/* */
+/*----------------------------------------------------------------------*/
+
+unsigned int AddMem_to_PSP(psp,start_addr,length)
+unsigned int psp;
+unsigned long start_addr,length;
+{
+ unsigned int para_no,len_in_paras,CurPSP;
+ int i;
+ extern unsigned int _psp;
+
+ para_no = (unsigned int)(start_addr >> 4); /* convert to paras*/
+ len_in_paras = (unsigned int)(length >> 4); /* convert to paras */
+
+ CurPSP = psp;
+
+ if (psp == _psp) psp = 0; /* treat MEM's arenas as FREE */
+
+ if (!psp) {
+ if (LastPSP == _psp) { /* if the prev.arena was MEM */
+ i = noof_progs -1; /* look at the last entry */
+ if (mem_table[i].psp_add != psp) /* was the last entry free ?*/
+ i++;
+ else len_in_paras++; /* account for one free arena header */
+ }
+ else i = noof_progs; /* new entry for FREE mem */
+ }
+ else
+ for (i = 0;i < noof_progs;i++)
+ if (mem_table[i].psp_add == psp) break;
+
+ /* if psp is not already listed in the table, add it */
+ if (i == noof_progs) {
+ if (noof_progs == MAX_CLDATA_INDEX) {
+ /* use parse error message proc to display err msg */
+ Parse_Message(CMemFragMsg,STDERR,Utility_Msg_Class,(char far *) NULL);
+ return(1);
+ }
+ mem_table[i].psp_add = psp;
+ noof_progs++;
+ }
+
+ /* add the memory to the table entry */
+
+ if (para_no < UMB_Head)
+ mem_table[i].mem_conv += len_in_paras;
+ else if (para_no == UMB_Head) {
+ mem_table[i].mem_conv++;
+ mem_table[i].mem_umb = len_in_paras-1;
+ }
+ else mem_table[i].mem_umb += len_in_paras;
+ LastPSP = CurPSP;
+ return(0);
+}
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+/************************************************************************/
+/* DisplayClassification */
+/* Main display proc for /C switch */
+/* */
+/* ENTRY: none */
+/* */
+/* EXIT: none */
+/* */
+/* find out if UMB is available by going through mem_table entries */
+/* (also find out MEM's size from these entries) */
+/* display memory break up for conventional memory */
+/* if (UMB in system) display memmory break up for UMB memory */
+/* display the total free size (= total free in conv.+total_free */
+/* in UMB + MEM's size ) */
+/* call DispBigFree to display the largest prog. sizes in Conv.&UMB*/
+/* */
+/************************************************************************/
+
+#define CONVONLY 0
+#define UMBONLY 1
+
+void DisplayClassification()
+{
+ unsigned long tot_freemem=0L;
+ char ShDSizeName[12];
+ int i;
+ unsigned int cur_psp;
+ char fUMBAvail=0;
+
+
+ /* get PSP info */
+
+ InRegs.h.ah = GET_PSP; /* get PSP function call */
+ intdos(&InRegs,&OutRegs);
+
+ cur_psp = OutRegs.x.bx; /* psp of MEM */
+
+ for (i=0;i <noof_progs;i++) {
+ if (mem_table[i].mem_umb)
+ fUMBAvail = TRUE;
+ if (mem_table[i].psp_add == cur_psp) {
+ tot_freemem += (long)(mem_table[i].mem_conv + mem_table[i].mem_umb);
+ if (fUMBAvail) break;
+ }
+ }
+ tot_freemem *=16l; /* convert to bytes */
+
+ Sub0_Message(CTtlConvMsg,STDOUT,Utility_Msg_Class);
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ tot_freemem += DispMemClass(CONVONLY);
+
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+ if (fUMBAvail) {
+ Sub0_Message(CTtlUMBMsg,STDOUT,Utility_Msg_Class);
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ tot_freemem += DispMemClass(UMBONLY);
+
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ }
+
+ sprintf(ShDSizeName," (%5.1fK)",((float)tot_freemem)/1024l );
+ i = (fUMBAvail) ? CSumm1Msg:CSumm1AMsg;
+ SubC2_Message(i,STDOUT,&tot_freemem, ShDSizeName);
+
+ DispBigFree(fUMBAvail,cur_psp);
+
+}
+/************************************************************************/
+/* DispMemClass */
+/* (displays the progs and FREE sizes in either the */
+/* conventional or UMB) */
+/* */
+/* ENTRY: memtype => Conventional(0) /UMB (1) */
+/* */
+/* EXIT: total_freemem_size (in bytes) */
+/* */
+/* go through mem_table entries and display NON-ZERO size, NON-FREE */
+/* entries in the given mem_type */
+/* go through mem_table entries and display NON_ZERO size, FREE */
+/* entries in the given mem_type */
+/* calculate the total free mem size in the given mem type &return */
+/* */
+/* CAVEATS: */
+/* Arenas marked as belonging to MSDOS (code) in UMB are displayed */
+/* as SYSTEM */
+/* */
+/************************************************************************/
+
+unsigned long DispMemClass(memtype)
+int memtype;
+{
+ int i,msgtype;
+ unsigned int cur_memsize;
+ unsigned long memsize;
+ char *nameptr;
+ char ShDSizeName[12];
+ unsigned long tot_free = 0;
+ struct ARENA far *ArenaPtr;
+
+ Sub0_Message(CTtlNameMsg,STDOUT,Utility_Msg_Class);
+ Sub0_Message(CTtlUScoreMsg,STDOUT,Utility_Msg_Class);
+
+ for (i=0; i <noof_progs; i++) {
+
+ cur_memsize = (memtype == CONVONLY) ? mem_table[i].mem_conv:mem_table[i].mem_umb;
+ if (!cur_memsize) continue;
+ if (!mem_table[i].psp_add) continue;
+ msgtype = 0;
+ if (mem_table[i].psp_add == 8) /* if DOS area */
+ msgtype = (memtype == CONVONLY)?IbmdosMsg:SystemMsg;
+ if (!msgtype) {
+ FP_SEG(ArenaPtr) = mem_table[i].psp_add-1;
+ /* -1 'cause Arena is 16 bytes before PSP */
+ FP_OFF(ArenaPtr) = 0;
+ nameptr = OwnerOf(ArenaPtr);
+ }
+ else nameptr = NULL;
+
+ memsize = ((long) cur_memsize) *16l;
+ sprintf(ShDSizeName," (%5.1fK)",((float)memsize)/1024l );
+ SubC4_Message(MainLineMsg,STDOUT,nameptr,msgtype,&memsize, ShDSizeName);
+
+ }
+ for (i=0; i <noof_progs; i++) {
+
+ if (mem_table[i].psp_add) continue;
+ cur_memsize = (memtype == CONVONLY) ? mem_table[i].mem_conv:mem_table[i].mem_umb;
+ if (!cur_memsize) continue;
+ tot_free += (long) cur_memsize;
+
+ memsize = ((long) cur_memsize) *16l;
+ sprintf(ShDSizeName," (%5.1fK)",((float)memsize)/1024l );
+ SubC4_Message(MainLineMsg,STDOUT,NULL,CFreeMsg,&memsize, ShDSizeName);
+
+ }
+
+ tot_free *= 16l;
+ sprintf(ShDSizeName," (%5.1fK)",((float)tot_free )/1024l );
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+ SubC2_Message(CTotalFreeMsg,STDOUT,&tot_free, ShDSizeName);
+
+ return(tot_free);
+
+
+}
+/************************************************************************/
+/* DispBigFree */
+/* ENTRY: UMBAvailable? (flag) 1-> there is UMB */
+/* MEM's PSP */
+/* EXIT: none (largest prog.sizes displayed) */
+/* This finds out and displays the largest contig.mem available in */
+/* in Conventional and UMB memory */
+/* This calculation is done assuming that MEM is not loaded */
+/* */
+/************************************************************************/
+
+void DispBigFree(fUMBAvail,cur_psp)
+char fUMBAvail;
+unsigned int cur_psp;
+{
+
+ int i;
+ unsigned int ConvBigFree = 0;
+ unsigned int UMBBigFree = 0;
+ unsigned long TmpBigFree;
+ char ShDSizeName[12];
+ unsigned far *Env_ptr;
+ unsigned int env_mem,BigFree;
+ char fMEMHigh;
+
+
+ /* assume that the biggest free size is the top of mem we got when */
+ /* MEM was loaded */
+
+ FP_SEG(Env_ptr) = cur_psp;
+ FP_OFF(Env_ptr) = 44; /* get the env for MEM */
+ FP_SEG(Env_ptr) = (*Env_ptr)-1; /* get to arena for env. */
+ FP_OFF(Env_ptr) = 3; /* get the size of environment */
+ env_mem = *Env_ptr + 1; /* 1 extra para for arena header */
+
+ fMEMHigh = (char)((cur_psp > UMB_Head) ? 1:0);
+
+ BigFree = DOS_TopOfMemory - cur_psp;
+
+ if (fMEMHigh ) /* mem was loaded higher */
+ UMBBigFree = BigFree;
+ else
+ ConvBigFree = BigFree;
+
+ for (i =0; i<noof_progs;i++) {
+ if (mem_table[i].psp_add) continue; /* skip non-FREE entries */
+ if (mem_table[i].mem_conv > ConvBigFree)
+ ConvBigFree = mem_table[i].mem_conv;
+ if (mem_table[i].mem_umb > UMBBigFree)
+ UMBBigFree = mem_table[i].mem_umb;
+ }
+
+ if (fMEMHigh) { /* MEM was loaded high */
+ if (FP_SEG(Env_ptr) > UMB_Head) /* env also in UMB */
+ if (UMBBigFree == (BigFree + env_mem))
+ UMBBigFree = BigFree;
+ }
+ else { /* MEM was loaded low */
+ if (FP_SEG(Env_ptr) < UMB_Head) /* env also in Conv */
+ if (ConvBigFree == (BigFree + env_mem))
+ ConvBigFree = BigFree;
+ }
+
+
+ TmpBigFree = ((unsigned long)ConvBigFree) * 16l;
+ sprintf(ShDSizeName," (%5.1fK)",((float)TmpBigFree)/1024l );
+ SubC2_Message(CSumm2Msg,STDOUT,&TmpBigFree, ShDSizeName);
+
+ if (fUMBAvail) {
+ TmpBigFree = ((unsigned long)UMBBigFree) * 16l;
+ sprintf(ShDSizeName," (%5.1fK)",((float)TmpBigFree)/1024l );
+ SubC2_Message(CSumm3Msg,STDOUT,&TmpBigFree, ShDSizeName);
+ }
+
+}
+/* M003 END */
+
diff --git a/private/mvdm/dos/v86/cmd/mem/memctrlc.c b/private/mvdm/dos/v86/cmd/mem/memctrlc.c
new file mode 100644
index 000000000..d903d8db9
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/memctrlc.c
@@ -0,0 +1,46 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/*******************************************************************/
+/* MEMCTRLC.C */
+/* */
+/* This module contains the Ctrl-C handler put in by Mem when */
+/* it links in UMBs. On a Ctrl-C, UMBs are delinked if they were */
+/* explicitly enabled by Mem. The old Ctrl-C handler is restored */
+/* and Mem then exits. If we dont do this, UMBs remain linked in */
+/* after a Ctrl-C and as a result lot of old programs dont run. */
+/* */
+/*******************************************************************/
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <dos.h>
+
+extern char LinkedIn;
+extern void (interrupt far *OldCtrlc)();
+
+void interrupt cdecl far MemCtrlc (unsigned es, unsigned ds,
+ unsigned di, unsigned si, unsigned bp, unsigned sp,
+ unsigned bx, unsigned dx, unsigned cx, unsigned ax )
+{
+ union REGS inregs;
+
+ ((void)es), ((void)ds), ((void)si), ((void)bp), ((void)sp);
+ ((void)bx), ((void)dx), ((void)bx), ((void)dx), ((void)cx);
+ ((void)di), ((void)ax);
+
+ if ( LinkedIn ) /* Did we link in UMBs */
+ {
+ inregs.x.ax = 0x5803;
+ inregs.x.bx = 0;
+ intdos( &inregs, &inregs ); /* Delink UMBs */
+ }
+
+ _dos_setvect( 0x23, OldCtrlc ); /* Restore previous ctrlc handler */
+
+ exit(0); /* Exit Mem */
+
+}
diff --git a/private/mvdm/dos/v86/cmd/mem/memex.c b/private/mvdm/dos/v86/cmd/mem/memex.c
new file mode 100644
index 000000000..33cbdf5dc
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/memex.c
@@ -0,0 +1,262 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/* MEMEX.C - expanded and extended memory handling functions for MEM.C.
+*/
+
+#include "ctype.h"
+#include "conio.h" /* need for kbhit prototype */
+#include "stdio.h"
+#include "dos.h"
+#include "string.h"
+#include "stdlib.h"
+#include "msgdef.h"
+#include "version.h" /* MSKK02 07/18/89 */
+#include "mem.h"
+#include "xmm.h"
+#include "versionc.h"
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void DisplayEMSDetail()
+ {
+
+#define EMSGetHandleName 0x5300 /* get handle name function */
+#define EMSGetHandlePages 0x4c00 /* get handle name function */
+#define EMSCODE_83 0x83 /* handle not found error */
+#define EMSMaxHandles 256 /* max number handles */
+
+ int HandleIndex; /* used to step through handles */
+ char HandleName[9]; /* save area for handle name */
+ unsigned long int HandleMem; /* memory associated w/handle */
+ char TitlesPrinted = FALSE; /* flag for printing titles */
+
+ HandleName[0] = NUL; /* initialize the array */
+
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+ segread(&SegRegs);
+
+ SegRegs.es = SegRegs.ds;
+
+ for (HandleIndex = 0; HandleIndex < EMSMaxHandles; HandleIndex++)
+ {
+
+ InRegs.x.ax = EMSGetHandleName; /* get handle name */
+ InRegs.x.dx = HandleIndex; /* handle in question */
+ InRegs.x.di = (unsigned int) HandleName; /* point to handle name */
+ int86x(EMS, &InRegs, &OutRegs, &SegRegs);
+
+ HandleName[8] = NUL; /* make sure terminated w/nul */
+
+ if (OutRegs.h.ah != EMSCODE_83)
+ {
+ InRegs.x.ax = EMSGetHandlePages; /* get pages assoc w/this handle */
+ InRegs.x.dx = HandleIndex;
+ int86x(EMS, &InRegs, &OutRegs, &SegRegs);
+ HandleMem = OutRegs.x.bx;
+ HandleMem *= (long) (16l*1024l);
+
+ if (!TitlesPrinted)
+ {
+ Sub0_Message(Title3Msg,STDOUT,Utility_Msg_Class);
+ Sub0_Message(Title4Msg,STDOUT,Utility_Msg_Class);
+ TitlesPrinted = TRUE;
+ }
+
+ if (HandleName[0] == NUL) strcpy(HandleName," ");
+ EMSPrint(HandleMsg,
+ STDOUT,
+ Utility_Msg_Class,
+ &HandleIndex,
+ HandleName,
+ &HandleMem);
+ }
+
+ } /* end for (HandleIndex = 0; HandleIndex < EMSMaxHandles;HandleIndex++) */
+
+ return;
+
+ } /* end of DisplayEMSDetail */
+
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void DisplayExtendedSummary()
+ {
+
+ unsigned long int EXTMemoryTot;
+ unsigned long int XMSMemoryTot;
+ unsigned long int HMA_In_Use;
+ unsigned DOS_Is_High,DOS_in_ROM;
+
+ InRegs.h.ah = (unsigned char) 0x52; /* Get SysVar Pointer ;an001; dms;*/
+ intdosx(&InRegs,&OutRegs,&SegRegs); /* Invoke interrupt ;an001; dms;*/
+
+ FP_SEG(SysVarsPtr) = SegRegs.es; /* put pointer in var ;an001; dms;*/
+ FP_OFF(SysVarsPtr) = OutRegs.x.bx; /* ;an001; dms;*/
+ if ((SysVarsPtr) -> ExtendedMemory != 0) /* extended memory? ;an001; dms;*/
+ { /* yes ;an001; dms;*/
+ EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory; /* get total EM size ;an001; dms;*/
+ EXTMemoryTot *= (long) 1024l; /* at boot time ;an001; dms;*/
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class); /* print blank line ;an001; dms;*/
+ Sub1_Message(EXTMemoryMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* print total EM mem ;an001; dms;*/
+
+ OutRegs.x.cflag = 0; /* clear carry flag ;an001; dms;*/
+ InRegs.x.ax = GetExtended; /* get extended mem ;an001; dms;*/
+ /* available */
+ int86(CASSETTE, &InRegs, &OutRegs); /* INT 15h call ;an001; dms;*/
+
+ EXTMemoryTot = (unsigned long) OutRegs.x.ax * 1024l; /* returns 1K mem blocks;an001; dms;*/
+
+ /* subtract out VDisk usage. Note assumption that VDisk usage doesn't
+ * exceed 64Mb. Don't bother if there is no extended memory
+ */
+ if (EXTMemoryTot != 0)
+ EXTMemoryTot -= (unsigned long) (CheckVDisk() * 1024l);
+
+ Sub1_Message(EXTMemAvlMsg,STDOUT,Utility_Msg_Class,&EXTMemoryTot); /* display available ;an001; dms;*/
+
+ /* if an XMS driver is present, INT 15 may return 0 as the amount
+ * of extended memory available. In that case, call the XMS
+ * driver to find out the amount of XMS free. Don't call XMS
+ * unconditionally, because that will cause it to claim memory
+ * if it has not already done so.
+ *
+ * However, it is possible, with the newer versions of Himem,
+ * for XMS memory and INT 15 memory to coexist. There is no
+ * completely reliable way to detect this situation, but we
+ * do know that if Himem is installed, DOS is high, and INT 15
+ * memory exists, then we are configured that way. In that case,
+ * we can make calls to Himem without disrupting the memory environment.
+ * Otherwise we can't.
+ */
+ if (XMM_Installed())
+ {
+
+ InRegs.x.ax = 0x3306; /* get DOS version info */
+ intdos(&InRegs, &OutRegs); /* call DOS */
+ DOS_Is_High = (OutRegs.h.dh & DOSHMA);
+ DOS_in_ROM = (OutRegs.h.dh & DOSROM);
+
+ if (DOS_Is_High || EXTMemoryTot == 0)
+ { /* make this check only if we won't disrupt environment */
+ /* get and display XMS memory available */
+ XMSMemoryTot = XMM_QueryTotalFree() * 1024l;
+ Sub1_Message(XMSMemAvlMsg,STDOUT,Utility_Msg_Class,
+ &XMSMemoryTot);
+ }
+
+ /* get and display HMA status */
+ /* DOS High implies HMA is in use */
+ if (DOS_Is_High)
+ if (DOS_in_ROM)
+ Sub0_Message(ROMDOSMsg,STDOUT,Utility_Msg_Class);
+ else
+ Sub0_Message(HMADOSMsg,STDOUT,Utility_Msg_Class);
+
+ /* DOS isn't, check if HMA in use, but only if we can quietly */
+ else if (EXTMemoryTot == 0)
+ {
+ HMA_In_Use = XMM_RequestHMA(0xffff);
+ if (HMA_In_Use)
+ Sub0_Message(HMANotAvlMsg,STDOUT,Utility_Msg_Class);
+ else
+ {
+ XMM_ReleaseHMA();
+ Sub0_Message(HMAAvlMsg,STDOUT,Utility_Msg_Class);
+ }
+ }
+ }
+ }
+} /* end of DisplayExtendedSummary */
+
+
+
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+void DisplayEMSSummary()
+ {
+
+ unsigned long int EMSFreeMemoryTot;
+ unsigned long int EMSAvailMemoryTot;
+
+ Sub0_Message(NewLineMsg,STDOUT,Utility_Msg_Class);
+
+ InRegs.x.ax = EMSGetFreePgs; /* get total number unallocated pages */
+ int86x(EMS, &InRegs, &OutRegs, &SegRegs);
+
+ EMSFreeMemoryTot = OutRegs.x.bx; /* total unallocated pages in BX */
+ EMSFreeMemoryTot *= (long) (16l*1024l);
+
+ EMSAvailMemoryTot = OutRegs.x.dx; /* total pages */
+ EMSAvailMemoryTot *= (long) (16l*1024l);
+
+ Sub1_Message(EMSTotalMemoryMsg,STDOUT,Utility_Msg_Class,&EMSAvailMemoryTot);
+ Sub1_Message(EMSFreeMemoryMsg,STDOUT,Utility_Msg_Class,&EMSFreeMemoryTot);
+
+ return;
+
+ } /* end of DisplayEMSSummary */
+
+
+
+
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+
+char EMSInstalled()
+ {
+
+ unsigned int EMSStatus;
+ unsigned int EMSVersion;
+
+ char EmsName[8];
+ void far *EmsNameP;
+
+
+ if (EMSInstalledFlag == 2)
+ {
+ EMSInstalledFlag = FALSE;
+ InRegs.h.ah = GET_VECT; /* get int 67 vector */
+ InRegs.h.al = EMS;
+ intdosx(&InRegs,&OutRegs,&SegRegs);
+
+
+ /* only want to try this if vector is non-zero */
+
+
+ if ((SegRegs.es != 0) && (OutRegs.x.bx != 0))
+ {
+
+ EmsNameP = EmsName;
+ movedata(SegRegs.es, 0x000a, FP_SEG(EmsNameP), FP_OFF(EmsNameP), 8);
+ if (strncmp(EmsName, "EMMXXXX0", 8))
+ return (EMSInstalledFlag);
+
+ InRegs.x.ax = EMSGetStat; /* get EMS status */
+ int86x(EMS, &InRegs, &OutRegs, &SegRegs);
+ EMSStatus = OutRegs.h.ah; /* EMS status returned in AH */
+
+ InRegs.x.ax = EMSGetVer; /* get EMS version */
+ int86x(EMS, &InRegs, &OutRegs, &SegRegs);
+ EMSVersion = OutRegs.h.al; /* EMS version returned in AL */
+
+ if ((EMSStatus == 0) && (EMSVersion >= DOSEMSVER))
+ EMSInstalledFlag = TRUE;
+ } /* end ((SegRegs.es != 0) && (OutRegs.x.bx != 0)) */
+
+ } /* end if (EMSInstalledFlag == 2) */
+
+
+ return(EMSInstalledFlag);
+
+
+ }
diff --git a/private/mvdm/dos/v86/cmd/mem/msgdef.h b/private/mvdm/dos/v86/cmd/mem/msgdef.h
new file mode 100644
index 000000000..88c9842b3
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/msgdef.h
@@ -0,0 +1,126 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/************************************************************************/
+/* MSGDEF.H - This include file defines each message type */
+/* that can occur in MEM. These defines will */
+/* be used by MEM to build the proper message. */
+/* */
+/* Date : 10/29/87 */
+/************************************************************************/
+#include "version.h" /*EGH*/
+
+#define NewLineMsg 10
+#define Title1Msg 11
+#define Title2Msg 12
+#define Title3Msg 13
+#define Title4Msg 14
+#define MainLineMsg 15
+#define DriverLineMsg 16
+#define DeviceLineMsg 17
+#define TotalMemoryMsg 18
+#define AvailableMemoryMsg 19
+#define FreeMemoryMsg 20
+#define EMSTotalMemoryMsg 21
+#define EMSFreeMemoryMsg 22
+#define EXTMemoryMsg 23
+#define InterruptVectorMsg 24
+#define ROMCommunicationAreaMsg 25
+#define DOSCommunicationAreaMsg 26
+#if IBMCOPYRIGHT /*EGH*/
+#define IbmbioMsg 56 /*EGH*/
+#define IbmdosMsg 57 /*EGH*/
+#else /*EGH*/
+#define IbmbioMsg 27
+#define IbmdosMsg 28
+#endif /*EGH*/
+#define SystemDataMsg 29
+#define SystemProgramMsg 30
+#define SystemDeviceDriverMsg 31
+#define InstalledDeviceDriverMsg 32
+#define SingleDriveMsg 33
+#define MultipleDrivesMsg 34
+#define ConfigBuffersMsg 35
+#define ConfigFilesMsg 36
+#define ConfigFcbsMsg 37
+#define ConfigStacksMsg 38
+#define ConfigDeviceMsg 39
+#define ConfigIFSMsg 40
+#define ConfigLastDriveMsg 41
+#define ConfigInstallMsg 45 /* gga */
+#define UnownedMsg 42
+#define BlankMsg 43
+#define HandleMsg 44
+#define EXTMemAvlMsg 46 /* ;an001; dms;*/
+#define StackMsg 47
+#define FreeMsg 48
+#define ProgramMsg 49
+#define EnvironMsg 50
+#define DataMsg 51
+#define XMSMemAvlMsg 52
+#define HMAAvlMsg 53
+#define HMANotAvlMsg 54
+#define HMADOSMsg 55
+#define ROMDOSMsg 58
+#define CTtlConvMsg 59
+#define CTtlUMBMsg 60
+#define CTotalFreeMsg 61
+#define CFreeMsg 62
+#define CTtlNameMsg 63
+#define CTtlUScoreMsg 64
+#define CSumm1Msg 65
+#define CSumm2Msg 66
+#define CSumm3Msg 67
+#define CMemFragMsg 68
+#define SystemMsg 69
+#define CSumm1AMsg 70
+
+#define MSG_OPTIONS_FIRST 300
+#define MSG_OPTIONS_LAST 304
+
+#ifdef JAPAN
+#define AdddrvMsg 400
+#endif
+
+#define ParseError1Msg 01
+#define ParseError10Msg 10
+
+/************************************************************************/
+/* Message Retriever Standard Equates */
+/************************************************************************/
+
+#define Ext_Err_Class 0x0001
+#define Parse_Err_Class 0x0002
+#define Utility_Msg_Class 0x00ff
+#define No_Handle 0xffff
+#define No_Replace 0x0000
+#define Sublist_Length 0x000b
+#define Reserved 0x0000
+#define Left_Align 0x0000
+#define Right_Align 0x0080
+#define Char_Field_Char 0x0000
+#define Char_Field_ASCIIZ 0x0010
+#define Unsgn_Bin_Byte 0x0011
+#define Unsgn_Bin_Word 0x0021
+#define Unsgn_Bin_DWord 0x0031
+#define Sgn_Bin_Byte 0x0012
+#define Sgn_Bin_Word 0x0022
+#define Sgn_Bin_DWord 0x0032
+#define Bin_Hex_Byte 0x0013
+#define Bin_Hex_Word 0x0023
+#define Bin_Hex_DWord 0x0033
+#define No_Input 0x0000
+#define STDIN 0x0000
+#define STDOUT 0x0001
+#define STDERR 0x0002
+#define Blank 0x0020
+
+#define SubCnt1 0x0001
+#define SubCnt2 0x0002
+#define SubCnt3 0x0003
+#define SubCnt4 0x0004
+#define SubCnt5 0x0005
+
+#define CarryFlag 0x0001
diff --git a/private/mvdm/dos/v86/cmd/mem/parse.h b/private/mvdm/dos/v86/cmd/mem/parse.h
new file mode 100644
index 000000000..93803912b
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/parse.h
@@ -0,0 +1,147 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/*  */
+/*----------------------------------------------------------------------+
+| |
+| This file contains the structures and defines that are needed to use |
+| the parser from a C program. |
+| |
+| |
+| Date: 5-21-87 |
+| |
++----------------------------------------------------------------------*/
+
+
+#define p_len_parms 4 /* length of p_parms */
+#define p_i_use_default 0 /* no extra stuff specified */
+#define p_i_have_delim 1 /* extra delimiter specified */
+#define p_i_have_eol 2 /* extra EOL specified */
+
+struct p_parms
+ {
+ struct p_parmsx *p_parmsx_address; /* address of p_parmsx */
+ unsigned char p_num_extra; /* number of extra stuff */
+ unsigned char p_len_extra_delim; /* length of extra delimiter */
+ char p_extra_delim[30]; /* extra delimiters */
+ };
+
+struct p_parmsx
+ {
+ unsigned char p_minp; /* Minimum positional number */
+ unsigned char p_maxp; /* Maximum positional number */
+ unsigned char p_maxswitch; /* Maximum switches */
+ struct p_control_blk *p_control[4]; /* Address of the 1st CONTROL block */
+ unsigned char p_keyword; /* Keyword count */
+ };
+
+
+struct p_control_blk
+ {
+ unsigned int p_match_flag; /* Controls type matched */
+ unsigned int p_function_flag; /* Function should be taken */
+ unsigned int p_result_buf; /* Result buffer address */
+ unsigned int p_value_list; /* Value list address */
+ unsigned char p_nid; /* # of keyword/SW synonyms */
+ char p_keyorsw[32]; /* keyword or sw */
+ };
+
+/* Match_Flags */
+
+#define p_num_val 0x8000 /* Numeric Value */
+#define p_snum_val 0x4000 /* Signed numeric value */
+#define p_simple_s 0x2000 /* Simple string */
+#define p_date_s 0x1000 /* Date string */
+#define p_time_s 0x0800 /* Time string */
+#define p_cmpx_s 0x0400 /* Complex string */
+#define p_file_spc 0x0200 /* File Spec */
+#define p_drv_only 0x0100 /* Drive Only */
+#define p_qu_string 0x0080 /* Quoted string */
+#define p_ig_colon 0x0010 /* Ignore colon at end in match */
+#define p_repeat 0x0002 /* Repeat allowed */
+#define p_optional 0x0001 /* Optional */
+#define p_none 0x0000
+
+/*----------------------------------------------------------------------+
+| |
+| Function flags |
+| |
++----------------------------------------------------------------------*/
+
+#define p_cap_file 0x0001 /* CAP result by file table */
+#define p_cap_char 0x0002 /* CAP result by character table */
+#define p_rm_colon 0x0010 /* Remove ":" at the end */
+
+
+
+#define p_nval_none 0 /* no value list ID */
+#define p_nval_range 1 /* range list ID */
+#define p_nval_value 2 /* value list ID */
+#define p_nval_string 3 /* string list ID */
+#define p_len_range 9 /* Length of a range choice(two DD plus one DB) */
+#define p_len_value 5 /* Length of a value choice(one DD plus one DB) */
+#define p_len_string 3 /* Length of a string choice(one DW plus one DB) */
+
+/*----------------------------------------------------------------------+
+| |
+| Value block structure |
+| |
++----------------------------------------------------------------------*/
+
+struct p_value_blk
+ {
+ unsigned char p_val_num;
+ };
+
+
+/*----------------------------------------------------------------------+
+| |
+| Result block structure |
+| |
++----------------------------------------------------------------------*/
+
+struct p_result_blk
+ {
+ unsigned char P_Type; /* Type returned */
+ unsigned char P_Item_Tag; /* Matched item tag */
+ unsigned int P_SYNONYM_Ptr; /* pointer to Synonym list returned */
+ unsigned long int p_result_buff; /* result value */
+ };
+
+/*----------------------------------------------------------------------+
+| |
+| type |
+| |
++----------------------------------------------------------------------*/
+
+#define p_eol 0 /* End of line */
+#define p_number 1 /* Number */
+#define p_list_idx 2 /* List Index */
+#define p_string 3 /* String */
+#define p_complex 4 /* Complex */
+#define p_file_spec 5 /* File Spec */
+#define p_drive 6 /* Drive */
+#define p_date_f 7 /* Date */
+#define p_time_f 8 /* Time */
+#define p_quoted_string 9 /* Quoted String */
+
+#define p_no_tag 0x0FF /* No ITEM_TAG found */
+
+/*----------------------------------------------------------------------+
+| |
+| following return code will be returned in the AX register. |
+| |
++----------------------------------------------------------------------*/
+
+#define p_no_error 0 /* No error */
+#define p_too_many 1 /* Too many operands */
+#define p_op_missing 2 /* Required operand missing */
+#define p_not_in_sw 3 /* Not in switch list provided */
+#define p_not_in_key 4 /* Not in keyword list provided */
+#define p_out_of_range 6 /* Out of range specified */
+#define p_not_in_val 7 /* Not in value list provided */
+#define p_not_in_str 8 /* Not in string list provided */
+#define p_syntax 9 /* Syntax error */
+#define p_rc_eol 0x0ffff /* End of command line */
diff --git a/private/mvdm/dos/v86/cmd/mem/submsg.c b/private/mvdm/dos/v86/cmd/mem/submsg.c
new file mode 100644
index 000000000..c12cc4d45
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/submsg.c
@@ -0,0 +1,678 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/* SUBMSG.C - Message retriever interface functions for MEM command.
+*/
+
+#include "ctype.h"
+#include "conio.h" /* need for kbhit prototype */
+#include "stdio.h"
+#include "dos.h"
+#include "string.h"
+#include "stdlib.h"
+#include "msgdef.h"
+#include "version.h" /* MSKK02 07/18/89 */
+#include "mem.h"
+
+/*ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ*/
+
+
+/************************************************************************/
+/* SUB0_MESSAGE - This routine will print only those */
+/* messages that do not require a */
+/* a sublist. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub0_Message(Msg_Num,Handle,Message_Type) /* print messages with no subs */
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+ /* extended, parse, or utility */
+ {
+ InRegs.x.ax = Msg_Num; /* put message number in AX */
+ InRegs.x.bx = Handle; /* put handle in BX */
+ InRegs.x.cx = No_Replace; /* no replaceable subparms */
+ InRegs.h.dl = No_Input; /* no keyboard input */
+ InRegs.h.dh = Message_Type; /* type of message to display */
+ sysdispmsg(&InRegs,&OutRegs); /* display the message */
+
+ return;
+ }
+
+
+/************************************************************************/
+/* SUB1_MESSAGE - This routine will print only those */
+/* messages that require 1 replaceable */
+/* parm. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm - pointer to parm to replace */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub1_Message(Msg_Num,Handle,Message_Type,Replace_Parm)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+ /* extended, parse, or utility */
+unsigned long int *Replace_Parm; /* pointer to message to print */
+
+{
+
+
+ {
+
+ sublist[1].value = (unsigned far *)Replace_Parm;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Unsgn_Bin_DWord+Right_Align;
+ sublist[1].max_width = 10;
+ sublist[1].min_width = 10;
+ sublist[1].pad_char = Blank;
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt1;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+
+/************************************************************************/
+/* SUB2_MESSAGE - This routine will print only those */
+/* messages that require 2 replaceable */
+/* parms. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm1 - pointer to parm to replace */
+/* Replace_Parm2 - pointer to parm to replace */
+/* Replace_Parm3 - pointer to parm to replace */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub2_Message(Msg_Num,Handle,Message_Type,
+ Replace_Parm1,
+ Replace_Message1)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+int Replace_Message1;
+ /* extended, parse, or utility */
+char *Replace_Parm1; /* pointer to message to print */
+{
+
+
+ {
+ switch(Msg_Num)
+ {
+ case DeviceLineMsg:
+
+ sublist[1].value = (unsigned far *)Replace_Parm1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[1].max_width = 0x0008;
+ sublist[1].min_width = 0x0008;
+ sublist[1].pad_char = Blank;
+
+ InRegs.x.ax = Replace_Message1;
+ InRegs.h.dh = Message_Type;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(sublist[2].value) = OutRegs.x.si;
+ FP_SEG(sublist[2].value) = SegRegs.ds;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Right_Align;
+ sublist[2].max_width = 00;
+ sublist[2].min_width = 10;
+ sublist[2].pad_char = Blank;
+ break;
+ }
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt2;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+/************************************************************************/
+/* SUB3_MESSAGE - This routine will print only those */
+/* messages that require 3 replaceable */
+/* parms. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm1 - pointer to parm to replace */
+/* Replace_Parm2 - pointer to parm to replace */
+/* Replace_Parm3 - pointer to parm to replace */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub3_Message(Msg_Num,Handle,Message_Type,
+ Replace_Parm1,
+ Replace_Parm2,
+ Replace_Message1)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+char *Replace_Parm1;
+unsigned long int *Replace_Parm2;
+int Replace_Message1;
+ /* extended, parse, or utility */
+{
+
+
+ {
+ switch(Msg_Num)
+ {
+ case DriverLineMsg:
+
+ sublist[1].value = (unsigned far *)Replace_Parm1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[1].max_width = 0x0008;
+ sublist[1].min_width = 0x0008;
+ sublist[1].pad_char = Blank;
+
+ sublist[2].value = (unsigned far *)Replace_Parm2;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Bin_Hex_DWord+Right_Align;
+ sublist[2].max_width = 0x0006;
+ sublist[2].min_width = 0x0006;
+ sublist[2].pad_char = 0x0030;
+
+ InRegs.x.ax = Replace_Message1;
+ InRegs.h.dh = Message_Type;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(sublist[3].value) = OutRegs.x.si;
+ FP_SEG(sublist[3].value) = SegRegs.ds;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[3].max_width = 00;
+ sublist[3].min_width = 10;
+ sublist[3].pad_char = Blank;
+ break;
+
+ case HandleMsg:
+ sublist[1].value = (unsigned far *)Replace_Parm1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Unsgn_Bin_Byte+Right_Align;
+ sublist[1].max_width = 0x0009;
+ sublist[1].min_width = 0x0009;
+ sublist[1].pad_char = Blank;
+
+ sublist[2].value = (unsigned far *)Replace_Parm2;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[2].max_width = 0x0008;
+ sublist[2].min_width = 0x0008;
+ sublist[2].pad_char = Blank;
+
+ InRegs.x.ax = Replace_Message1;
+ InRegs.h.dh = Message_Type;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(sublist[3].value) = OutRegs.x.si;
+ FP_SEG(sublist[3].value) = SegRegs.ds;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Bin_Hex_DWord+Right_Align;
+ sublist[3].max_width = 00;
+ sublist[3].min_width = 10;
+ sublist[3].pad_char = Blank;
+ break;
+
+ }
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt3;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+
+/************************************************************************/
+/* SUB4_MESSAGE - This routine will print only those */
+/* messages that require 4 replaceable */
+/* parms. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm1 - pointer to parm to replace */
+/* Replace_Parm2 - pointer to parm to replace */
+/* Replace_Parm3 - pointer to parm to replace */
+/* Dynamic_Parm - parm number to use as replaceable */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub4_Message(Msg_Num,Handle,Message_Type,
+ Replace_Value1,
+ Replace_Message1,
+ Replace_Value2,
+ Replace_Message2)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+unsigned long int *Replace_Value1;
+int Replace_Message1;
+unsigned long int *Replace_Value2;
+int Replace_Message2;
+ /* extended, parse, or utility */
+{
+
+
+ {
+ switch(Msg_Num)
+ {
+ case MainLineMsg:
+
+ sublist[1].value = (unsigned far *)Replace_Value1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Bin_Hex_DWord+Right_Align;
+ sublist[1].max_width = 06;
+ sublist[1].min_width = 06;
+ sublist[1].pad_char = 0x0030;
+
+ InRegs.x.ax = Replace_Message1;
+ InRegs.h.dh = Message_Type;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(sublist[2].value) = OutRegs.x.si;
+ FP_SEG(sublist[2].value) = SegRegs.ds;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[2].max_width = 0x0008;
+ sublist[2].min_width = 0x0008;
+ sublist[2].pad_char = Blank;
+
+ sublist[3].value = (unsigned far *)Replace_Value2;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Bin_Hex_DWord+Right_Align;
+ sublist[3].max_width = 06;
+ sublist[3].min_width = 06;
+ sublist[3].pad_char = 0x0030;
+
+ InRegs.x.ax = Replace_Message2;
+ InRegs.h.dh = Message_Type;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+
+ FP_OFF(sublist[4].value) = OutRegs.x.si;
+ FP_SEG(sublist[4].value) = SegRegs.ds;
+ sublist[4].size = Sublist_Length;
+ sublist[4].reserved = Reserved;
+ sublist[4].id = 4;
+ sublist[4].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[4].max_width = 0;
+ sublist[4].min_width = 10;
+ sublist[4].pad_char = Blank;
+ break;
+ }
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt4;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+
+
+/************************************************************************/
+/* SUB4a_MESSAGE - This routine will print only those */
+/* messages that require 4 replaceable */
+/* parms. */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Parm1 - pointer to parm to replace */
+/* Replace_Parm2 - pointer to parm to replace */
+/* Replace_Parm3 - pointer to parm to replace */
+/* Dynamic_Parm - parm number to use as replaceable */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void Sub4a_Message(Msg_Num,Handle,Message_Type,
+ Replace_Value1,
+ Replace_Message1,
+ Replace_Value2,
+ Replace_Message2)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+unsigned long int *Replace_Value1;
+char *Replace_Message1;
+unsigned long int *Replace_Value2;
+char *Replace_Message2;
+
+{
+
+
+ {
+ switch(Msg_Num)
+ {
+ case MainLineMsg:
+
+ sublist[1].value = (unsigned far *)Replace_Value1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Bin_Hex_DWord+Right_Align;
+ sublist[1].max_width = 06;
+ sublist[1].min_width = 06;
+ sublist[1].pad_char = 0x0030;
+
+ sublist[2].value = (unsigned far *)Replace_Message1;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[2].max_width = 0x0008;
+ sublist[2].min_width = 0x0008;
+ sublist[2].pad_char = Blank;
+
+ sublist[3].value = (unsigned far *)Replace_Value2;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Bin_Hex_DWord+Right_Align;
+ sublist[3].max_width = 06;
+ sublist[3].min_width = 06;
+ sublist[3].pad_char = 0x0030;
+
+ sublist[4].value = (unsigned far *)Replace_Message2;
+ sublist[4].size = Sublist_Length;
+ sublist[4].reserved = Reserved;
+ sublist[4].id = 4;
+ sublist[4].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[4].max_width = 0;
+ sublist[4].min_width = 10;
+ sublist[4].pad_char = Blank;
+ break;
+ }
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt4;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+
+/************************************************************************/
+/* EMSPrint - This routine will print the message */
+/* necessary for EMS reporting. */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void EMSPrint(Msg_Num,Handle,Message_Type,
+ Replace_Value1,
+ Replace_Message1,
+ Replace_Value2)
+
+int Msg_Num;
+int Handle;
+unsigned char Message_Type;
+int *Replace_Value1;
+char *Replace_Message1;
+unsigned long int *Replace_Value2;
+ /* extended, parse, or utility */
+{
+
+ {
+ sublist[1].value = (unsigned far *)Replace_Value1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Unsgn_Bin_Word+Right_Align;
+ sublist[1].max_width = 03;
+ sublist[1].min_width = 03;
+ sublist[1].pad_char = Blank;
+
+ sublist[2].value = (unsigned far *)Replace_Message1;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[2].max_width = 0x0008;
+ sublist[2].min_width = 0x0008;
+ sublist[2].pad_char = Blank;
+
+ sublist[3].value = (unsigned far *)Replace_Value2;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Bin_Hex_DWord+Right_Align;
+ sublist[3].max_width = 06;
+ sublist[3].min_width = 06;
+ sublist[3].pad_char = 0x0030;
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt3;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Message_Type;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ }
+ return;
+}
+
+/* M003 BEGIN - output procs for C switch */
+/************************************************************************/
+/* SUBC4_MESSAGE - This routine will print only those */
+/* messages that require 4 replaceable */
+/* parms.(for Classify Switch) */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Message_Type - type of message to display */
+/* Replace_Message1 - pointer to a Replacement message */
+/* Replace_Value1 - pointer to parm to replace */
+/* Replace_Message2 - pointer to a Replacement message */
+/* Replace_Value2 - pointer to parm to replace */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void SubC4_Message(Msg_Num,Handle,
+ Replace_Message1,Msg_Type,
+ Replace_Value1,
+ Replace_Message2)
+
+int Msg_Num;
+int Handle,Msg_Type;
+unsigned long int *Replace_Value1;
+char *Replace_Message1,*Replace_Message2;
+
+{
+
+ switch(Msg_Type)
+ {
+ case IbmdosMsg:
+ case CFreeMsg:
+ case SystemMsg:
+ InRegs.x.ax = Msg_Type;
+ InRegs.h.dh = Utility_Msg_Class;
+ sysgetmsg(&InRegs,&SegRegs,&OutRegs);
+ FP_OFF(sublist[1].value) = OutRegs.x.si;
+ FP_SEG(sublist[1].value) = SegRegs.ds;
+ break;
+ default:
+ sublist[1].value = (unsigned far *) Replace_Message1;
+ break;
+ }
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[1].max_width = 0x0008;
+ sublist[1].min_width = 0x0008;
+ sublist[1].pad_char = Blank;
+
+ sublist[2].value = (unsigned far *)Replace_Value1;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Unsgn_Bin_DWord+Right_Align;
+ sublist[2].max_width = 10;
+ sublist[2].min_width = 10;
+ sublist[2].pad_char = Blank;
+
+ sublist[3].value = (unsigned far *) Replace_Message2;
+ sublist[3].size = Sublist_Length;
+ sublist[3].reserved = Reserved;
+ sublist[3].id = 3;
+ sublist[3].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[3].max_width = 0x0009;
+ sublist[3].min_width = 0x0009;
+ sublist[3].pad_char = Blank;
+
+ sublist[4].value = (unsigned far *)Replace_Value1;
+ sublist[4].size = Sublist_Length;
+ sublist[4].reserved = Reserved;
+ sublist[4].id = 4;
+ sublist[4].flags = Bin_Hex_DWord+Right_Align;
+ sublist[4].max_width = 06;
+ sublist[4].min_width = 06;
+ sublist[4].pad_char = Blank;
+
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt4;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Utility_Msg_Class;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ return;
+}
+/************************************************************************/
+/* SUBC2_MESSAGE - This routine will print only those */
+/* messages that require 2 replaceable */
+/* parms (for Classify Switch). */
+/* */
+/* Inputs : Msg_Num - number of applicable message */
+/* Handle - display type */
+/* Replace_Parm1 - pointer to parm to replace */
+/* Replace_Message1 - pointer to replace message */
+/* */
+/* Outputs : message */
+/* */
+/************************************************************************/
+
+void SubC2_Message(Msg_Num,Handle, Replace_Parm1,
+ Replace_Message1)
+
+int Msg_Num;
+int Handle;
+unsigned long int *Replace_Parm1;
+char *Replace_Message1;
+{
+
+ sublist[1].value = (unsigned far *)Replace_Parm1;
+ sublist[1].size = Sublist_Length;
+ sublist[1].reserved = Reserved;
+ sublist[1].id = 1;
+ sublist[1].flags = Unsgn_Bin_DWord+Right_Align;
+ sublist[1].max_width = 10;
+ sublist[1].min_width = 10;
+ sublist[1].pad_char = Blank;
+
+ sublist[2].value = (unsigned far *)Replace_Message1;
+ sublist[2].size = Sublist_Length;
+ sublist[2].reserved = Reserved;
+ sublist[2].id = 2;
+ sublist[2].flags = Char_Field_ASCIIZ+Left_Align;
+ sublist[2].max_width = 0x0009;
+ sublist[2].min_width = 0x0009;
+ sublist[2].pad_char = Blank;
+
+ InRegs.x.ax = Msg_Num;
+ InRegs.x.bx = Handle;
+ InRegs.x.cx = SubCnt2;
+ InRegs.h.dl = No_Input;
+ InRegs.h.dh = Utility_Msg_Class;
+ InRegs.x.si = (unsigned int)&sublist[1];
+ sysdispmsg(&InRegs,&OutRegs);
+ return;
+}
+/* M003 END */
diff --git a/private/mvdm/dos/v86/cmd/mem/value b/private/mvdm/dos/v86/cmd/mem/value
new file mode 100644
index 000000000..75c216a7f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/value
@@ -0,0 +1,139 @@
+MEM.C: /*----------------------------------------------------------------------+
+MEM.C: | - Used to display DOS memory map summary. |
+MEM.C: | - Used to display DOS memory map. |
+MEM.C: | - Used to display a detailed DOS memory map. |
+MEM.C: | AN001 - PTM P2914 -> This PTM relates to MEM's ability to report|
+MEM.C: | AN002 - PTM P3477 -> MEM was displaying erroneous base memory |
+MEM.C: | AN003 - PTM P3912 -> MEM messages do not conform to spec. |
+MEM.C: | AN004 - PTM P4510 -> MEM does not give correct DOS size. |
+MEM.C: | AN005 - PTM P4957 -> MEM does not give correct DOS size for |
+MEM.C: | M000 SR 8/27/90 Added new Ctrl-C handler to delink UMBs |
+MEM.C: +----------------------------------------------------------------------*/
+MEM.C: char *MultipleDrives = "%c: - %c:" ;
+MEM.C: char *UnOwned = "----------" ;
+MEM.C: /*----------------------------------------------------------------------+
+MEM.C: +----------------------------------------------------------------------*/
+MEM.C: /* Store the current Ctrl-C handler and replace with our
+MEM.C: Ctrl-C handler :M000
+MEM.C: LinkedIn--;
+MEM.C: /* If user did not issue Ctrl-C till here, we just remove the handler */
+MEM.C: /*----------------------------------------------------------------------+
+MEM.C: +----------------------------------------------------------------------*/
+MEM.C: /* Parse_Message - This routine will print only those */
+MEM.C: /* Inputs : Msg_Num - number of applicable message */
+MEM.C: /* Handle - display type */
+MEM.C: /* Message_Type - type of message to display */
+MEM.C: /* Replace_Parm - pointer to parm to replace */
+MEMBASE.C: /* MEMBASE.C - MEM routines for determining and displaying memory usage
+MEMBASE.C: Out_Var2 = (long) (FP_SEG(SysVarsPtr) - 0x70)*16l;
+MEMBASE.C: for (ThisDeviceDriver = SysVarsPtr -> DeviceDriverChain;
+MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader)
+MEMBASE.C: FP_OFF(ArenaHeadPtr) = FP_OFF(SysVarsPtr) - 2; /* ;an004; */
+MEMBASE.C: Out_Var2 = (long) ((AddressOf((char far *)ThisArenaPtr)) - Out_Var1); /* ;ac004; */
+MEMBASE.C: /* 0008:000->------------------ ------------------- */
+MEMBASE.C: /* | BUFFERS | -------->|B (signature) | Block header */
+MEMBASE.C: /* ------------------ ------------------- */
+MEMBASE.C: /* | FCBs | -- | | */
+MEMBASE.C: /* ------------------ | | Buffers data | */
+MEMBASE.C: /* ------------------ | | | */
+MEMBASE.C: /* ------------------ | -------------------- */
+MEMBASE.C: /* ------------------ | ------------------- */
+MEMBASE.C: /* | EXTERN DRIVER 2| | -------->|X (signature) | Block header */
+MEMBASE.C: /* ------------------ ------------------- */
+MEMBASE.C: /* ------------------ | Buffers data | */
+MEMBASE.C: /* -------------------- */
+MEMBASE.C: /* 70:0 - BIOS data 70:0 - BIOS data
+MEMBASE.C: /* 70:0 - BIOS data
+MEMBASE.C: while (ThisArenaPtr -> Signature != (char) 'Z')
+MEMBASE.C: if (ThisArenaPtr -> Owner == 8 || ThisArenaPtr -> Owner == 9 ) /* MSKK02 */
+MEMBASE.C: FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
+MEMBASE.C: Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l; /* MSKK02 */
+MEMBASE.C: if (ThisArenaPtr->OwnerName[0] == 'S' &&
+MEMBASE.C: ThisArenaPtr->OwnerName[1] == 'C')
+MEMBASE.C: (ThisArenaPtr -> Owner == 8) ? IbmbioMsg : AdddrvMsg, /* MSKK02 */
+MEMBASE.C: (ThisArenaPtr -> Owner == 8) ? SystemDataMsg : ProgramMsg ); /* MSKK02 */
+MEMBASE.C: switch(ThisConfigArenaPtr -> Signature) /* MSKK02 */
+MEMBASE.C: Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l; /* MSKK02 */
+MEMBASE.C: FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1; /* MSKK02 */
+MEMBASE.C: if (ThisConfigArenaPtr -> Signature == (char) 'D') /* MSKK02 */
+MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader; /* MSKK02 */
+MEMBASE.C: FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1; /* MSKK02 */
+MEMBASE.C: if (ThisArenaPtr -> Owner == 8)
+MEMBASE.C: FP_SEG(NextArenaPtr) = FP_SEG(ThisArenaPtr) + ThisArenaPtr -> Paragraphs + 1;
+MEMBASE.C: Out_Var2 = (long) (ThisArenaPtr -> Paragraphs) * 16l;
+MEMBASE.C: if (ThisArenaPtr->OwnerName[0] == 'S' &&
+MEMBASE.C: ThisArenaPtr->OwnerName[1] == 'C')
+MEMBASE.C: switch(ThisConfigArenaPtr -> Signature)
+MEMBASE.C: Out_Var1 = ((long) ThisConfigArenaPtr -> Paragraphs) * 16l;
+MEMBASE.C: FP_SEG(NextConfigArenaPtr) += NextConfigArenaPtr -> Paragraphs + 1;
+MEMBASE.C: if (ThisConfigArenaPtr -> Signature == (char) 'D')
+MEMBASE.C: ThisDeviceDriver = ThisDeviceDriver -> NextDeviceHeader; /* MSKK01 */
+MEMBASE.C: FP_SEG(ThisConfigArenaPtr) += ThisConfigArenaPtr -> Paragraphs + 1;
+MEMBASE.C: Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
+MEMBASE.C: FP_SEG(ThisArenaPtr) += ThisArenaPtr -> Paragraphs + 1;
+MEMBASE.C: Out_Var2 = ((long) (ThisArenaPtr -> Paragraphs)) * 16l;
+MEMBASE.C: if ( ((ThisDeviceDriver -> Attributes) & 0x8000 ) != 0 )
+MEMBASE.C: { for (i = 0; i < 8; i++) LocalDeviceName[i] = ThisDeviceDriver -> Name[i];
+MEMBASE.C: if ((int) ThisDeviceDriver -> Name[0] == 1)
+MEMBASE.C: 'A'+BlockDeviceNumber + ((int) ThisDeviceDriver -> Name[0]) - 1);
+MEMBASE.C: BlockDeviceNumber += (int) (ThisDeviceDriver -> Name[0]);
+MEMBASE.C: free_mem = (DOS_TopOfMemory * 16l) - (FP_SEG(PSPptr)*16l); /* ;an000;ac005; */
+MEMBASE.C: PspSegment = ArenaPtr -> Owner;
+MEMBASE.C: FP_SEG(ArenaPtr) = PspSegment-1; /* -1 'cause Arena is 16 bytes before PSP */
+MEMBASE.C: StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
+MEMBASE.C: * such names. - Nagara 11/20/90
+MEMBASE.C: StringPtr = (char far *) &(ArenaPtr -> OwnerName[0]);
+MEMBASE.C: OutputPtr--;
+MEMBASE.C: if (Header -> Owner == 8) Message_Number = StackMsg;
+MEMBASE.C: if (Header -> Owner == 0) Message_Number = FreeMsg;
+MEMBASE.C: PspSegment = Header -> Owner;
+MEMCTRLC.C: /* This module contains the Ctrl-C handler put in by Mem when */
+MEMCTRLC.C: /* it links in UMBs. On a Ctrl-C, UMBs are delinked if they were */
+MEMCTRLC.C: /* explicitly enabled by Mem. The old Ctrl-C handler is restored */
+MEMCTRLC.C: /* after a Ctrl-C and as a result lot of old programs dont run. */
+MEMEX.C: /* MEMEX.C - expanded and extended memory handling functions for MEM.C.
+MEMEX.C: if ((SysVarsPtr) -> ExtendedMemory != 0) /* extended memory? ;an001; dms;*/
+MEMEX.C: EXTMemoryTot = (long) (SysVarsPtr) -> ExtendedMemory; /* get total EM size ;an001; dms;*/
+MEMEX.C: EXTMemoryTot -= (unsigned long) (CheckVDisk() * 1024l);
+MEMEX.C: /* only want to try this if vector is non-zero */
+SUBMSG.C: /* SUBMSG.C - Message retriever interface functions for MEM command.
+SUBMSG.C: /* SUB0_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* SUB1_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* Replace_Parm - pointer to parm to replace */
+SUBMSG.C: /* SUB2_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
+SUBMSG.C: /* SUB3_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
+SUBMSG.C: /* SUB4_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
+SUBMSG.C: /* Dynamic_Parm - parm number to use as replaceable */
+SUBMSG.C: /* SUB4a_MESSAGE - This routine will print only those */
+SUBMSG.C: /* Inputs : Msg_Num - number of applicable message */
+SUBMSG.C: /* Handle - display type */
+SUBMSG.C: /* Message_Type - type of message to display */
+SUBMSG.C: /* Replace_Parm1 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm2 - pointer to parm to replace */
+SUBMSG.C: /* Replace_Parm3 - pointer to parm to replace */
+SUBMSG.C: /* Dynamic_Parm - parm number to use as replaceable */
+SUBMSG.C: /* EMSPrint - This routine will print the message */
diff --git a/private/mvdm/dos/v86/cmd/mem/xmm.h b/private/mvdm/dos/v86/cmd/mem/xmm.h
new file mode 100644
index 000000000..851accb16
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/mem/xmm.h
@@ -0,0 +1,42 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988 - 1991
+; * All Rights Reserved.
+; */
+/*
+ * XMS Driver C Interface Routine Definitions
+ *
+ */
+
+unsigned XMM_Installed(void);
+
+long XMM_Version(void);
+long XMM_RequestHMA(unsigned);
+long XMM_ReleaseHMA(void);
+long XMM_GlobalEnableA20(void);
+long XMM_GlobalDisableA20(void);
+long XMM_EnableA20(void);
+long XMM_DisableA20(void);
+long XMM_QueryA20(void);
+long XMM_QueryLargestFree(void);
+long XMM_QueryTotalFree(void);
+long XMM_AllocateExtended(unsigned);
+long XMM_FreeExtended(unsigned);
+long XMM_MoveExtended(struct XMM_Move *);
+long XMM_LockExtended(unsigned);
+long XMM_UnLockExtended(unsigned);
+long XMM_GetHandleLength(unsigned);
+long XMM_GetHandleInfo(unsigned);
+long XMM_ReallocateExtended(unsigned, unsigned);
+long XMM_RequestUMB(unsigned);
+long XMM_ReleaseUMB(unsigned);
+
+struct XMM_Move {
+ unsigned long Length;
+ unsigned short SourceHandle;
+ unsigned long SourceOffset;
+ unsigned short DestHandle;
+ unsigned long DestOffset;
+};
+
+#define XMSERROR(x) (char)((x)>>24)
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/doesmac.inc b/private/mvdm/dos/v86/cmd/nlsfunc/doesmac.inc
new file mode 100644
index 000000000..a4683a281
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/doesmac.inc
@@ -0,0 +1,46 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+CallInstall MACRO name,mpx,fn,save,restore
+BREAK MACRO subtitle
+ SUBTTL subtitle
+ PAGE
+ENDM
+.xcref break
+IF Installed
+ IFNB <save>
+ SaveReg <save>
+ ENDIF
+ MOV AX,(mpx SHL 8) + fn
+ INT 2Fh
+ IFNB <restore>
+ RestoreReg <restore>
+ ENDIF
+ELSE
+ Invoke name
+ENDIF
+ENDM
+
+BREAK <SaveReg - save a set of registers>
+
+SaveReg MACRO reglist ;; push those registers
+IRP reg,<reglist>
+ ?stackdepth = ?stackdepth + 1
+ PUSH reg
+ENDM
+ENDM
+.xcref SaveReg
+
+BREAK <RestoreReg - unsave some registers>
+
+RestoreReg MACRO reglist ;; pop those registers
+IRP reg,<reglist>
+ ?stackdepth = ?stackdepth - 1
+ POP reg
+ENDM
+ENDM
+.xcref RestoreReg
+
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/funcdbcs.inc b/private/mvdm/dos/v86/cmd/nlsfunc/funcdbcs.inc
new file mode 100644
index 000000000..64db21d6c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/funcdbcs.inc
@@ -0,0 +1,24 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;; generic ioctl call data "packet" pointed to by DS:DX =E
+PACKET STRUC ;USED BY MINOR CODES: 6AH,4AH,4DH (SELECT, QUERY SELECTED, PREPARE END) =E
+PACKLEN DW 0 ;LENGTH OF PACKET IN BYTES =E 2/16/KK
+PACKCPID DW 0 ;CODE PAGE ID =E
+DBCS_EV DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+ DB 0,0 ; 2/16/KK
+PACKET ENDS
+
+
+STD_CPLENGTH equ 2
+PK PACKET <> ;CNS
+
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/funcparm.inc b/private/mvdm/dos/v86/cmd/nlsfunc/funcparm.inc
new file mode 100644
index 000000000..c08f1a9d2
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/funcparm.inc
@@ -0,0 +1,51 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;Parser INPUT PARM LIST Structure
+
+ PUBLIC NLS_PARMS
+ NLS_PARMS label word
+ dw NLS_PARMSX
+ db 0 ;no extra delimiters
+
+ PUBLIC NLS_PARMSX
+ NLS_PARMSX label word
+ db 0,1 ;Min 0 - no path
+ ;Max 1 - path
+ dw NLS_POS1
+ db 1 ; 1 switch supported
+ dw NLS_OPTS ; its addr
+
+ PUBLIC NLS_POS1
+ NLS_POS1 label word
+ dw 0201h ;File spec (optional)
+ dw 0001h ;Cap result by file
+ dw Res_Valptr ;tbl
+ dw NoVal ;no value list
+ db 0 ;no switch or
+ ;keyword synonyms
+
+ PUBLIC NLS_OPTS, OPT_SYN
+NLS_OPTS label word
+ dw 0000 ; Match Mask
+ dw 0000 ; Function Mask
+ dw RES_VALPTR ; ptr to results
+ dw NOVAL ; ptr to values
+ db 1 ; count of synonyms
+OPT_SYN db "/?", 0
+
+NOVAL label word
+ db 0
+
+ PUBLIC RES_VALPTR, RES_SYN
+ RES_VALPTR label word
+
+ RES_TYPE db ? ;Result_type
+ RES_ITAG db 0 ;Matched item tag
+ RES_SYN dw 0 ;synonym returned
+ RES_POFF dw 0 ;drive type or beginning of string
+ RES_PSEG dw 0 ;may be string
+
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/makefile b/private/mvdm/dos/v86/cmd/nlsfunc/makefile
new file mode 100644
index 000000000..d59821914
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/makefile
@@ -0,0 +1,57 @@
+# Makefile for nlsfunc.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 28-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =nlsfunc.exe
+
+#
+####################### dependencies begin here. #########################
+#
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+nlsfunc.ctl: nlsfunc.skl \
+ $(msg)\$(COUNTRY).msg \
+ makefile
+
+
+nlsfunc.obj: nlsfunc.asm \
+ funcdbcs.inc \
+ msg2nls.inc \
+ funcparm.inc \
+ nlsfunc.ctl \
+ doesmac.inc \
+ $(inc)\mult.inc \
+ $(inc)\msgserv.asm \
+ $(inc)\doscntry.inc \
+ $(inc)\devsym.inc \
+ $(inc)\struc.inc \
+ $(inc)\copyrigh.inc \
+ makefile
+
+nlsparm.obj: nlsparm.asm \
+ $(inc)\version.inc \
+ $(inc)\parse.asm \
+ $(inc)\psdata.inc \
+ makefile
+
+
+
+nlsfunc.exe: nlsfunc.obj \
+ nlsparm.obj
+ link16 $(exelink) nlsfunc+nlsparm;
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/msg2nls.inc b/private/mvdm/dos/v86/cmd/nlsfunc/msg2nls.inc
new file mode 100644
index 000000000..205167dcd
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/msg2nls.inc
@@ -0,0 +1,99 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+BADDOS equ 1
+ALLINS equ 2
+FNF equ 3
+FLAG1 equ LEFT_ALIGN+CHAR_FIELD_ASCIIZ
+
+;*****************************************************************************
+;******************************************************************************
+; VALUES FOR THE MSG_DESC CONTROL BLOCK
+ONE_SUBS EQU 1 ;ONE VARIABLE FIELD IN MESSAGE
+TWO_SUBS EQU 2 ;TWO VARIABLE FIELDS IN MESSAGE
+THREE_SUBS EQU 3 ;THREE VARIABLE FIELDS IN MESSAGE
+CLASS_1 EQU EXT_ERR_CLASS ;CLASS 1 (DOS EXTENDED ERRORS)
+CLASS_2 EQU PARSE_ERR_CLASS ;CLASS 2 (PARSE ERRORS)
+CLASS_A EQU UTILITY_MSG_CLASS ;CLASS A TYPE MESSAGE
+
+;THIS MESSAGE DESCRIPTOR CONTROL BLOCK IS GENERATED, ONE PER MESSAGE,
+;TO DEFINE THE SEVERAL PARAMETERS THAT ARE EXPECTED TO BE PASSED IN
+;CERTAIN REGISTERS WHEN THE SYSDISPMSG FUNCTION IS TO BE INVOKED.
+
+;MSG_DESC STRUC
+;MSG_NUM DW 0 ;MESSAGE NUMBER (TO AX)
+;MSG_HAND DW 0 ;HANDLE OF OUTPUT DEVICE (TO BX)
+;MSG_SUBLIST Dd 0 ;POINTER TO SUBLIST (TO SI)
+;MSG_COUNT DW 0 ;SUBSTITUTION COUNT (TO CX)
+;MSG_CLASS DB 0 ;MESSAGE CLASS (IN HIGH BYTE, TO DH)
+; ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL)
+;MSG_DESC ENDS
+; VALUES FOR THE SUBLIST CONTROL BLOCK
+PC_ID_0 EQU 0 ;ID OF " - " TRAILER TO MESSAGE
+PC_ID_1 EQU 1 ;ID OF PERCENT VARIABLE FIELD
+PC_ID_2 EQU 2 ;ID OF PERCENT VARIABLE FIELD
+PC_ID_3 EQU 3 ;ID OF PERCENT VARIABLE FIELD
+MAX_0 EQU 0 ;MAXIMUM WIDTH OF STRING FIELD (0=NO LIMIT)
+MIN_1 EQU 1 ;MINIMUM WIDTH OF STRING FIELD
+ID_0 EQU 0
+
+;Message PARM LIST Structure
+ PARMLIST1 LABEL BYTE ;PARM LIST
+ ;(File not found - 'PATH_SPEC')
+ DB 11 ;PARMLIST size
+ DB 0 ;reserved
+ DD PATH_SPEC
+ DB id_0 ;; n of %n
+ DB FLAG1 ;; data type
+ DB max_0 ;;max width
+ DB min_1 ;;min width
+ DB PAD_CHAR ;;char defined to be space
+
+
+ PARMLIST2 LABEL BYTE ;PARM LIST
+ ;(NLSFUNC already installed)
+ DB 11 ;PARMLIST size
+ DB 0 ;reserved
+ DD UTILITY ;; ptr to data
+ DB 1 ;; n of %n
+ DB FLAG1 ;; data type
+ DB 0 ;;max width
+ DB 1 ;;min width
+ DB PAD_CHAR ;;char defined
+
+ PARMLIST3 LABEL BYTE ;PARM LIST
+ ;(Invalid parameter 'PATH_SPEC')
+ DB 11 ;PARMLIST size
+ DB 0 ;reserved
+ DD PATH_SPEC ;; ptr to data
+ DB id_0 ;; n of %n
+ DB FLAG1 ;; data type
+ DB 0 ;;max width
+ DB 1 ;;min width
+ DB PAD_CHAR ;;char defined
+
+; THE NEXT GROUP ARE ALL CLASS "1" MESSAGES
+
+; PUBLIC MSGNUM_EXTERR
+;MSGNUeM_EXTERR MSG_DESC <FNF,STDERR,,,CLASS_1> ;ALL EXTENDED DOS ERRORS
+ ;File not found - %0
+
+; THE NEXT GROUP ARE ALL CLASS "2" MESSAGES
+
+; PUBLIC MSGNUM_PARSE ;SO PARSE DRIVER CAN FIND IT
+;MSGNUM_PARSE MSG_DESC <,STDERR,,,CLASS_2> ;ALL PARSING ERRORS BUT INVALID
+ ;SYNTAX
+ ;ERROR NUMBER WILL NEED TO BE FILLED IN
+
+; THE NEXT GROUP ARE ALL CLASS "A" MESSAGES
+; THESE ARE THE "CANNED" MESSAGES ALWAYS PRESENT
+
+; PUBLIC MSGNUM_VER
+;MSGNUM_VER MSG_DESC <1,STDERR> ;"Incorrect DOS Version"
+
+; PUBLIC MSGNUM_INST
+;MSGNUM_INST MSG_DESC <ALLINS,STDERR> ;"%1 - already installed"
+;end of MSGHAN.INC
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.asm b/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.asm
new file mode 100644
index 000000000..0baad99b1
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.asm
@@ -0,0 +1,2013 @@
+ PAGE ,132 ;
+ TITLE NLSFUNC - GET/SET CP & COUNTRY INFO CHCP SUPPORT
+
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;**************************************************************************
+;This is the NLSFUNC int2f command that supports the INT21h functions
+;Get_Extended Country Information and the Set_codepage...
+;NLSFUNC will read the COUNTRY.SYS information from disk , store the
+;data in a buffer , then move the information into a buffer
+;area specified by DOS.
+;d:NLSFUNC {path}
+; *
+;CHECKINSTALL: *
+;CheckRequest proc *
+; If installed previously *
+; report back error already installed and exit *
+; otherwise goto install *
+;Checkrequest endp *
+;*************************************************************************
+; NEW CODE *
+;*************************************************************************
+subttl get extended country data
+page
+;
+;***************************************
+;* Process_Path Procedure *
+;***************************************
+;* CALL SYSLOADMSG *
+;* Do DOS Version check *
+;* If ne X.X then (carry set) *
+;* CALL SYSDISPLAY_MSG *
+;* DISPLAY_MSG(Message number 001) *
+;* (001 - Incorrect DOS Version) *
+;* (Class 3 - Utility Msg) *
+;* exit *
+;* else *
+;* Establish addressability *
+;* to command line parms (DS:SI) *
+;* Establish addressability to PARM *
+;* control block (ES:DI) *
+;* *
+;* Call SYSPARSE for filename *
+;* GET Parse Block results *
+;* IF PARSE_ERROR *
+;* CALL SYSDISPLAY_MSG (Class 2)*
+;* DISPLAY_MSG = PARSE_NUM *
+;* ELSE *
+;* SUCCESSFUL_PARSE (0 or -1) *
+;* ENDIFELSE *
+;* GET_PARSE_RESULTS Path_Spec *
+;* IF No path exist then *
+;* assume current directory *
+;* assume default filename *
+;* ENDIF *
+;* IF No Drive exist then *
+;* Use Current Drive *
+;* ENDIF *
+;* IF No filename exist then *
+;* assume default filename *
+;* and concatenate with drive *
+;* ENDIF *
+;* CHECK_PATH *
+;* IF PATH EXIST THAN *
+;* INSTALL_NLS (NLS_RESCODE) *
+;* ENDIF *
+;* ELSE NOT PATH_EXIST THAN *
+;* GET_PARSE_RESULTS (Class 3) *
+;* PASS_TO_MSGTXT (Message 003) *
+;* (File not found %1) *
+;* ERR_CODE SET TO 2 *
+;* EXIT *
+;* ENDIFELSE *
+;* *
+;* INSTALL_NLS *
+;* CHECK INSTALL FLAG *
+;* IF INSTALLED *
+;* (Class 3) *
+;* PASS_TO_MGSTXT (Msg 002) *
+;* %1 already installed *
+;* ELSE *
+;* HOOK IN CODE *
+;* TERMINATE & STAY RESIDENT *
+;* ENDIFELSE *
+;* *
+;* *
+;* EXIT *
+;* CHECK FOR ERRORCODE *
+;* exit to DOS *
+;***************************************
+;
+;INSTALL:
+; Get the current 2f handler in the chain
+; make it the next install my handler in the
+; beginning of the the chain using get interrupt (25)
+; and set interrupt (35); Once in the chain
+; terminate and stay resident.
+;
+;DOS NEEDS ME.......
+;
+;Install Dos Interface Logic
+; Dos issues Call Install
+; Establish residency
+; If Mult Id is mine (* NLSFUNC*)
+; CheckInstall Status to see if installed or not
+; otherwise
+; jump to the next 2f handler
+;CheckInstall
+; If not installed returns
+; If installed program is executed (*NLSFUNC resident portion *)
+;*******************************************************************************
+;
+;Program Logic
+;
+; Check to make sure not reserved DOS number in the al
+;
+; Go establish which function is to be performed
+;
+;Sel_Func proc
+; mov FUNC_CODE,al
+; case
+; function code = 0
+; function code = 1
+; function code = 2
+; function code = 3
+; function code = 4
+; otherwise error_routine
+; return
+;Sel_Func endp
+
+
+;funcode0 proc
+;INSTALL NLSFUNC must be installed in mem
+; return 0FFh that I am installed
+;funcode0 endp
+
+;funcode1 proc
+; (* Means Set codepage and "select" device drivers*)
+; same at funcode 3 plus device drivers are invoked with the
+; specified code page.
+;funcode1 endp
+
+;funcode2 proc
+; (* Get_extended_country info issued by DOS not in buffer*)
+; BP = info_type
+; call trans_Cty_Data Proc
+; return
+;funcode2 endp
+
+;funcode3 proc
+; (* Means Set codepage *)
+; On entry DOS gives me the CODEP in BX & the CC in DX,SIZE in CX
+; Search for Country.sys file on disk
+; if file is found }BUFFER will exist in code 320 (can be altered)
+; the control buffer = 64 bytes of the buffer
+; the data buffer = 256 bytes of the buffer
+; call Trans_Cty_Data Proc
+; otherwise return an error flag
+; return
+;funcode3 endp
+
+
+;funcode4 proc
+; (* Get_extended_country info - old 38 call*)
+; set flag and same as funcode 2
+; data returned slightly Revised
+;funcode4 endp
+
+; ****************************
+; if selected is FUNCTION 1, 3
+; PassDOS_Data(*ES:DI*)
+; otherwise FUNCTION 2, 4
+; Get the INFO ID
+; Flag that it is function 2
+; PassUserData(*ES:DI*)
+; mov NO_ERRORS to ERROR_FLAG
+; ****************************
+;Trans_Cty_Data Proc
+; Open file(Dos call back 38)
+; Do an LSEEK to move CTY_INFO into NLSFUNC control buffer 39
+; Do an LSEEK to move tables into NLSFUNC data buffer 39
+; if R/W pointer ok on Disk
+; Read the file(Dos call back 38)
+; Check to see if it is FUNCTION 1 or FUNCTION 2
+; Flag if FUNCTION 2
+; if FUNCTION 2
+; Search for user specified INFO ID
+; until found or report back error to DOS & exit
+; if INFO ID is found
+; godo move the data and set the counter to zero (entry value)
+;
+;
+;
+;
+;MOVE_DATA: Manage transfer from disk to buffer
+; Check to see if entire entry can fit in to the data
+; buffer if not read the maximum allowed into buffer
+; Check to see what is left to read; read until no more
+; Search for appropriate field in the DOS INFO
+; if found move in info until complete
+; get the next entry until number of entries is 0
+; otherwise
+; report to DOS error and exit
+; loop back to read file until (all entries are Obtained) or (EOF)
+; Close file handle (Dos call back 40)
+; otherwise mov 05h to error_flag & jump to error_routine
+;
+; return
+;Trans ENDP
+;
+;
+;Error_routine proc
+; mov al,error_flag
+; return
+;error_routine endp
+;*******************************************************************************
+;**********************************INTRO****************************************
+subttl Revision History
+page
+;****************************** Revision History *************************** ;
+;
+; =A 7/29/86 RG PTM P64
+; Prevent overwrite of DOS monocase routine entry point during
+; transfer of SetCountryInfo.
+; For Get Ext Cty Info, put DOS monocase routine entry point into
+; user buffer.
+;
+; =B 7/29/86 RG PTM P67
+; Correct jump condition in ERROR_ROUTINE of NLSRES_CODE.
+; This prevents exit without COUNTRY.SYS file close.
+;
+; =C 7/30/86 RG PTM P85
+; Preserve ES register in NLSFUNC for IBMDOS.
+;
+; =D 7/31/86 RG PTM P86
+; Corrects information put into user buffer for Get Extended
+; Country Information.
+;
+; =E 7/31/85 RG DCR 18
+; CHCP support.
+;
+; =F 8/4/86 RG
+; Get Country Info - Revised info from Get Extended Country Info
+;
+; =G 8/5/86 RG
+; Correct carry set for good exit.
+;
+; =H 8/5/86 RG
+; Start extended info at length instead of signature.
+;
+; =FC 8/14/86 FChen
+; Insert code for control buff management and actual length retunred
+;
+; =I 8/20/86 RG
+; Improve path parameter parsing.
+;
+; =J 8/22/86 RG
+; Change error codes
+;
+; =K 8/28/86 RG
+; 65 call-get ext cty info put final csize (# bytes returned)
+; in cx on iret ;
+;
+; =L 11/7/86 RG
+; Set error to INVALID DATA (13) on no cp/cty match.
+;
+; =M 05/20/87 CNS
+; Additional re-design for structured code using STRUC
+; PARSER implementation
+; Message Retriever implementation
+; DBCS Support for Environmental Vector recognition (Walk Devices& IOCTL call)
+; Enable the Interrupt when NLSFUNC is loaded PTM ???
+;
+;AN001; P2685 NLSFUNC should not visit the same device repeatedly. 01/15/88 J.K.
+;AN002; P3934 Bad write on sacred DOS area - segmentation incorrect 03/22/88 CNS
+;*******************************************************************************
+subttl macros
+page
+PUSHALL macro reg1,reg2,reg3 ;used to save all
+ push reg1 ;registers needed
+ push reg2 ;for DOS interactions
+ push reg3
+ endm
+
+POPALL macro reg1,reg2,reg3 ;used to restore all
+ pop reg3 ;for DOS interactions
+ pop reg2
+ pop reg1
+ endm
+
+;SHOWERR macro msg,len_msg
+; mov ah,40h
+; mov bx,2
+; lea dx,msg ;displays error msgs
+; mov cx,len_msg
+; int 21h
+; endm
+
+
+EXTRN SYSPARSE:NEAR
+
+subttl NLSFUNC data
+page
+NLS_DATA SEGMENT byte PUBLIC 'DATA'
+
+;Copyright 1988 Microsoft
+;***************************** MSG DATA ************************************
+UTILITY db "NLSFUNC",0 ;AC000;
+;***************************** MSG DATA ************************************
+
+.xlist
+include copyrigh.inc ;AN000;
+include struc.inc
+include DOESMAC.INC
+include MULT.INC
+include sf.inc ;AN001;
+include DOSCNTRY.INC
+include DEVSYM.INC
+include SYSMSG.INC ;AN000;
+include FUNCDBCS.INC ;AN000;
+include MSG2NLS.INC
+include FUNCPARM.INC ;AN000;
+include version.inc ; MSKK02 07/18/89
+MSG_UTILNAME <NLSFUNC> ;AN000;
+
+.list
+
+MSG_OPTIONS_FIRST equ 300 ; first options message line
+MSG_OPTIONS_LAST equ 302 ; last options message line
+
+MULT_NLSFUNC equ 14h
+INSTALLED equ 0ffh
+; nlsfunc function codes
+CHG_CODEPAGE equ 1
+GET_EXT_CTY_INFO equ 2
+SET_CODEPAGE equ 3
+GET_CTY_INFO equ 4
+
+INVALID_FUNCTION equ 1 ;=J
+INVALID_DATA equ 13 ;=L
+;FILE_NOT_FOUND equ 2 ;=J(=L no longer explicitly used)
+;TAB equ 9
+;CR equ 13
+PAD_CHAR equ ' ' ;AN000;
+BAD_INVOKE equ 65 ;=E
+UPCASE_A equ 'A'
+BUFFSIZE equ 512 ; ;AC000;REDUCTION OF ORIGINAL (128 BYTES) TO STORE
+LOCATE_INFOTYPE equ 18 ;THE DEVICE LIST & THE OLD COUNTRY INFO
+CTL_BUFF equ 256 ; ;AC000;
+ID_TAG equ 8
+DATA_BUFF_LENG equ (BUFFSIZE - CTL_BUFF)
+MAXBUFF_FIT equ (BUFFSIZE - (CTL_BUFF + ID_TAG))
+DATA_N_ID equ (CTL_BUFF + ID_TAG)
+SETCTY_LENG equ 38
+;SPACE equ ' '
+BACKSLASH equ '\'
+PERIOD equ '.'
+;COLON equ ':'
+;
+;**************** NEW VARIABLE ****************
+subttl NLSFUNC data
+page
+IN_DEX equ bp ;AN000;
+FILESPEC_PTR equ byte ptr ds:[in_dex] ;AN000;
+FILEVAL equ 0100h ;convert data block after checking for the
+ ;AN000;
+ ;drive only to look for the filespec
+CL_NUM equ 81h ;command line at the PSP
+ ;AN000;
+;**************** NEW VARIABLE ****************
+;interrupts
+SET_INT equ 25h
+GET_INT equ 35h
+;
+;dos call backs
+;dosopen equ 38
+;dosclose equ 39
+;lseek equ 40
+;dosread equ 41
+;
+;NO_ERRORS equ 0FFh
+
+;variable definition area
+;initialization area
+
+MSG_SERVICES <MSGDATA>
+; Replace a bunch of bytes that are storing one byte (0 or 1) for one
+; byte where I control each bit.
+
+ID_CHECK_F equ 00000001b
+GET_EXT_F equ 00000010b
+GOOD_PAR_F equ 00000100b
+PARSE_ERR_F equ 00001000b
+EXIT_STAY_F equ 00010000b
+NO_PARMS_F equ 00100000b
+GOOD_PATH_F equ 01000000b
+OPTIONS_SENT_F equ 10000000b
+
+INFO_FLAG db ID_CHECK_F ;Only ID_CHECK_F set, the rest 0
+
+
+
+
+;ID_CHECK db 1 ;resident variable re-initialize
+ALL_DONE db 0 ;resident variable re-initialize
+;GET_EXT db 0 ;resident variable re-initialize
+INFO_ID db 0 ;resident variable re-initialize
+DONT_CLOSE db 0 ;if open or close error,this is set
+
+RES_PARASIZE dw 0 ;adjusted size for terminate & stay func.
+ERROR_CODE db 0 ;contains extended error code val
+FUNC_CODE db 0 ;save function number
+;GOOD_PAR db 0
+;PARSE_ERR db 0
+
+SI_DOSLOCATE dw 0
+DS_DOSLOCATE dw 0
+SAVEDX dw 0 ;=FC file offset
+SAVECX dw 0 ;=FC
+NOFFSET dw 2 ;=FC
+CSIZE dw 0
+CCODE dw 0
+CPAGE dw 0
+;VALID_FUNC db 0 ;Flag to check for valid function #
+;EXIT_STAY db 0
+FILENAME db "COUNTRY.SYS",0
+PATH_SPEC db 64 dup(0) ;used to build path parameter
+USER_PATH db 0 ;=I
+PAR_RETC dw 0
+;NO_PARMS db 0
+;GOOD_PATH db 0
+;OPTIONS_SENT db 0 ; non-zero if options msg displayed
+PATHSEG DW 0
+SW_SPEC dW 0
+;LENGTH_HOLD db 0 ;dead code
+;***CNS
+CUR_PTR DW 0 ;AN003;; keeps track of parameter position ;AN000
+OLD_PTR DW 0 ;AN003;; keeps track of parameter position ;AN000
+;***CNS
+;********************************************************************************
+NLS_BUFFER db BUFFSIZE dup (?) ;NLS BUFFER to transfer data
+
+
+DATASIZE equ $-NLS_DATA
+
+NLS_DATA ENDS
+
+NLS_INIT_CODE SEGMENT BYTE PUBLIC 'CODE'
+
+ ASSUME CS:NLS_INIT_CODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+
+
+INT_2f_NEXT DD ? ;Chain location.
+subttl resident code
+page
+;**************************** resident portion ********************************
+
+NLSRES_CODE PROC NEAR
+ cmp ah,MULT_NLSFUNC ;Check the mutliplex value
+ je IS_NLSFUNC ;the # is mine
+ jmp dword ptr INT_2F_NEXT ;Chain to* the next handler
+
+IS_NLSFUNC:
+
+
+ cmp al,0f8h ;Make sure AL does not have reserved
+ ;DOS value 0F8 - 0FFH
+ jb SEL_FUNC ;Select the function code between 0,
+ ;1,2,3,4
+
+ iret ;return on reserved functions
+
+SEL_FUNC:
+
+
+ push es ;=C
+ push ds ;save the user's data segment
+ push si
+ push ds
+ push ax ;save the function value
+
+
+ mov ax,NLS_DATA ;so it won't be hosed
+ mov ds,ax ;set the data segment to mine
+
+ ASSUME DS:NLS_DATA
+
+ pop ax
+ pop DS_DOSLOCATE
+ pop SI_DOSLOCATE
+
+ mov INFO_FLAG,ID_CHECK_F ;re-initalize flags
+ mov ALL_DONE,0 ;from resident portion
+ mov DONT_CLOSE,0 ;no open or close error yet
+
+ pushall bx,cx,dx ;save all DOS registers
+ pushall bp,si,di ;save all DOS registers
+; *************************** CNS **********************************************
+ sti ;;AN000;the interrupt for external devices
+ ;AN000;
+; *************************** CNS **********************************************
+ mov FUNC_CODE,al ;save function #
+; or al,al
+; jnz FUNCODE_DOSTATE ;state is not 0
+ dec al ;Tell DOS I am installed (dec 0 = ff)
+ js RES_EXIT ;state is 0
+; jmp short RES_EXIT ;exit
+
+
+FUNCODE_DOSTATE:
+; dec al ;cmp al,CHG_CODEPAGE
+ jz FUNCODE3_1 ;je FUNCODE3_1
+ dec al ;cmp al,GET_EXT_CTY_INFO
+ jz FUNCODE2 ;je FUNCODE2
+ dec al ;cmp al,SET_CODEPAGE
+ jz FUNCODE3_1 ;je FUNCODE3_1
+ ; If al >= 4 then do 4
+
+
+FUNCODE4: ;Get Country Data - old 38 call =F
+ mov bp,1 ;set info_id to 1 =F
+; jmp short FUNCODE2 ; =F
+
+
+FUNCODE2: ;Get Extended Country Information
+ mov ax,bp ;information requested by the user
+ mov INFO_ID,al
+ or INFO_FLAG,GET_EXT_F ;get extended cty into user buffer
+ call RES_MAIN
+ jc ERROR_ROUTINE
+
+ jmp short CLOSE_FILE ;=E
+
+
+
+FUNCODE3_1: ;Set Codepage/Get Country Information =E
+ les di,dword ptr SI_DOSLOCATE
+; cmp es:[di].ccDosCodePage,bx ;=E
+; jne fc3_1_10 ;=E
+; cmp es:[di].ccDosCountry,dx ;=E
+; jne fc3_1_10 ;=E
+; mov CPAGE,bx ;get the codepage value =E
+; jmp short fc3_1_20 ;=E
+;
+;fc3_1_10:
+ call RES_MAIN
+ jc ERROR_ROUTINE
+ CallInstall Dosclose,multdos,39,<ax,bx,cx,dx,ds,es>,<es,ds,dx,cx,bx,ax> ;close the file
+ jc NO_CLOSE
+
+fc3_1_20:
+ cmp FUNC_CODE,1 ;=E
+ je FUNCODE1 ;=E
+ mov al,ALL_DONE ;=E
+ jmp short RES_EXIT ;=E
+
+
+FUNCODE1: ;CHCP - Change Code Page =E
+ call WALK_DEVICES ;=E
+ mov al,ALL_DONE ;=E
+ jmp short RES_EXIT ;=E
+
+NO_CLOSE:
+ mov ALL_DONE,al ;=J
+ inc DONT_CLOSE
+
+;if an error was detected
+
+ERROR_ROUTINE:
+ mov al,ALL_DONE
+ cmp DONT_CLOSE,1
+ je RES_EXIT
+; jmp CLOSE_FILE
+
+
+
+CLOSE_FILE: ;DOS 3eh function close COUNTRY.SYS
+ mov al,ALL_DONE
+
+ CallInstall Dosclose,multdos,39,<ax,bx,cx,dx,ds,es>,<es,ds,dx,cx,bx,ax> ;close the file
+ jc NO_CLOSE
+ ;clear to let DOS know ok
+
+
+RES_EXIT:
+ popall bp,si,di ;restore all DOS registers
+ popall bx,cx,dx ;restore all DOS registers
+
+ cmp FUNC_CODE,GET_EXT_CTY_INFO ; =K
+ jne NC_IRET ; =K
+ or al,al ;if successful 65 call, put size =K
+ jnz NC_IRET ;of info returned in CX =K
+ mov cx,CSIZE ; =K
+
+NC_IRET: ; =K
+ pop ds ;restore user's data segment =K moved
+ pop es ;=C =K moved
+ iret ;Return to DOS
+
+
+NLSRES_CODE ENDP
+;*******************************END OF NLSRES_CODE******************************
+subttl resident main routine
+page
+;*******************************RES_MAIN****************************************
+RES_MAIN PROC NEAR
+
+; mov VALID_FUNC,1 ;function exist ; dead code?
+ mov CPAGE,bx ;get the codepage value
+ mov CCODE,dx ;get the country code
+ mov CSIZE,cx ;size of the buffer
+; call CHK_OPEN ;go open file if possible
+
+; instead of calling the procedure, I include the procedure here
+; Begining of procedure CHK_OPEN
+
+ xor cx,cx ;zero cx for open
+ cmp USER_PATH,1 ;either user supplied=I
+ je co_user ;or default DOS
+
+co_dos: push ds ;save current ds value
+ push si ;save current si value
+ lds si,dword ptr SI_DOSLOCATE ;old dos ds si value
+ lea dx,ds:[si].ccPATH_COUNTRYSYS
+ CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
+ pop si ;restore current si
+ pop ds ;restore current ds
+ jmp short co_10
+
+co_user: lea dx,PATH_SPEC
+ CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
+
+co_10: jc BADREP_FILE ;bx contains the
+ mov bx,ax ;file handle
+ jmp short END_OPEN
+
+BADREP_FILE:
+ mov ALL_DONE,al ;=J
+ inc DONT_CLOSE
+
+END_OPEN:
+; End of procedure CHK_OPEN
+
+ jc END_RES ;scan and read country info
+
+ mov ax,CCODE
+ mov dx,CPAGE
+ mov si,offset NLS_BUFFER
+ call Trans_Cty_Data
+ ;into my buffer & the dos buffer
+ END_RES:
+ ret
+
+RES_MAIN ENDP
+;*******************************END RES_MAIN************************************
+subttl check open procedure
+page
+;******************************CHECK OPEN PROCEDURE****************************
+;CHK_OPEN PROC NEAR
+;
+;
+; xor cx,cx ;zero cx for open
+; cmp USER_PATH,1 ;either user supplied=I
+; je co_user ;or default DOS
+;
+;co_dos: push ds ;save current ds value
+; push si ;save current si value
+; lds si,dword ptr SI_DOSLOCATE ;old dos ds si value
+; lea dx,ds:[si].ccPATH_COUNTRYSYS
+; CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
+; pop si ;restore current si
+; pop ds ;restore current ds
+; jmp short co_10
+;
+;co_user: lea dx,PATH_SPEC
+; CallInstall Dosopen,Multdos,38,<BX,DS,ES,SI,DI>,<DI,SI,ES,DS,BX>
+;
+;co_10: jc BADREP_FILE ;bx contains the
+; mov bx,ax ;file handle
+; jmp short END_OPEN
+;
+;BADREP_FILE:
+; mov ALL_DONE,al ;=J
+; inc DONT_CLOSE
+;
+;END_OPEN:
+; ret
+;
+; CHK_OPEN ENDP
+;******************************END OF CHKOPEN**********************************
+subttl transfer country data
+page
+;******************************TRANS_CTY__DATA ********************************
+TRANS_CTY_DATA PROC NEAR
+
+TRANSTART:
+ push di ;save start of CTY/CP INFO
+ ;get the size of the file
+ xor cx,cx ;clear cx to start at
+ xor dx,dx ;at the beginning of the
+ ;file
+ call READ_CTLBUFF ;Read in the file header
+ jnc CHK_INFOTYPE
+ jmp END_TRANS ;=G
+
+CHK_INFOTYPE:
+ add si,LOCATE_INFOTYPE ;si > Country info type
+ cmp byte ptr ds:[si],1 ;only 1 type exist currently
+ je GET_INFOIDS
+ jmp BAD_FILE
+GET_INFOIDS:
+ inc si ;si > set to file offset
+ mov dx,word ptr ds:[si] ;Get the Info file offset
+ mov cx,word ptr ds:[si+2] ;Doubleword
+
+ mov SAVEDX,dx ;=FC save offset
+ mov SAVECX,cx ;=FC for more than 1 buffer
+ mov NOFFSET,2 ;=FC start from beginning
+
+ call READ_CTLBUFF ;Read Info
+ jc Bridge_END_TRANS
+; jmp END_TRANS ;=G
+
+COUNT_ENTRIES:
+
+ mov cx,word ptr ds:[si] ;Get count of entries
+ ;in info
+ inc si ;next word
+ inc si ;si > Entry info packet
+
+FIND_CTY: ;Search for CTY/CP combo
+
+ mov ax,word ptr ds:[si] ;=FC get size of entry
+ inc ax ;=FC include length filed
+ inc ax
+ add NOFFSET,ax ;=FC look ahead
+ cmp NOFFSET,CTL_BUFF-4 ;=FC < (256 - 4)
+ jb IN_BUFF ;=FC
+ sub NOFFSET,ax ;=FC restore to old offset
+ push cx ;=FC save number of cntries
+ mov cx,SAVECX ;=FC get file offset
+ mov dx,SAVEDX ;=FC
+ add dx,NOFFSET ;=FC update to the entry
+ adc cx,0 ;=FC beginning
+ mov SAVECX,cx ;=FC save them for next use
+ mov SAVEDX,dx ;=FC
+ call READ_CTLBUFF ;=FC read next buffer in
+ jc READERROR ;=FC read error occurs
+ pop cx ;=FC restore number of cntries
+ mov NOFFSET,0 ;=FC a new beginning
+IN_BUFF:
+
+ mov dx,CPAGE
+ mov ax,CCODE
+ cmp ax,word ptr ds:[si+2] ;compare country id
+ jne NEXT_CTY
+ cmp dx, word ptr ds:[si+4] ;compare code page id
+ je FOUND_CTY
+ or dx,dx ;=FC if default pick the
+ jz FOUND_CTY2 ;=FC 1st country
+
+NEXT_CTY:
+ add si, word ptr ds:[si] ;next entry
+ inc si
+ inc si ;take a word for size of entry itself
+ loop FIND_CTY
+
+ mov ALL_DONE,INVALID_DATA ;if it exits the loop =J =L
+ jmp FINDCTY_FAIL ;then no cp/cty match
+
+READERROR: pop cx ;=FC
+Bridge_END_TRANS:
+ jmp END_TRANS ;=FC
+
+FOUND_CTY2: mov dx,word ptr ds:[si+4] ;=FC from now on,this is
+ mov CPAGE,dx ;=FC the code page
+
+FOUND_CTY: ;found the matching entry
+ mov dx, word ptr ds:[si+10] ;get the file offset of country data
+ mov cx, word ptr ds:[si+12]
+ call READ_CTLBUFF
+ jc Bridge_END_TRANS
+; jmp END_TRANS ;=G
+NUM_ENTRY:
+ mov cx, word ptr ds:[si] ;get the number of entries to handle.
+ inc si
+ inc si ;SI -> first entry
+
+SETDOSCTY_DATA:
+.REPEAT
+ push di ;ES:DI -> DOS_COUNTRY_CDPG_INFO
+ push si ;si -> current entry in Control buffer
+ push cx ;save # of entry left
+
+ mov al, byte ptr ds:[si+2] ;get data entry id
+ xor ah,ah ;clear out for comparison with
+ ;info-id in case id is > 256
+
+
+
+ test INFO_FLAG,GET_EXT_F ;check to see if function 2
+ ;get_extended info was needed
+ jz TRANSALL ;if not assume function code 1
+ ;set codepage
+
+ cmp INFO_ID,-1 ;Minus 1 means return all of the
+ jne CHK_ID ;country info to the user
+ ;otherwise get the specific
+ ;info id and return only that info
+
+
+ pop cx ;error can not return all
+ pop si ;info accept for currently
+ pop di ;loaded control info in DOS
+ jmp BAD_SETID ;area
+
+CHK_ID: cmp al,INFO_ID ;check to see if the selected
+ ;id is the same as the id in the
+ ;ctrl buffer area
+
+ jne SETDOSCTY_NEXT ;if not equal go search for the
+ ;next information id
+
+ pop cx ;Bingo!! Found it set counter
+ mov cx,1 ;to zero to exit loop
+ push cx
+
+ and INFO_FLAG,NOT ID_CHECK_F ;Turn bit off. found a valid id
+ test INFO_FLAG,GET_EXT_F ;after transferring data to USER
+ jnz GET_ADDR ;area
+
+ ;set cx image in stack to force
+ ;exit loop
+TRANSALL:
+
+
+
+ call GetDOSCTY_Dest ;get the address of destination in ES:DI
+ jc SetDOSCTY_NEXT ;No matching data entry id in DOS
+
+GET_ADDR:
+
+ mov dx, word ptr ds:[si+4] ;get offset of data
+ mov cx, word ptr ds:[si+6]
+
+
+
+SEEK_READ:
+
+ push ax ;=A save data id.
+ xor bp,bp ;DOS 4200h function
+ CallInstall Lseek,multdos,40,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;move ptr
+ pop ax ;=A
+ jc DATASEEKNREAD
+ ;when ptr moved
+ mov dx,offset NLS_BUFFER +CTL_BUFF ;set the buffer to the beginning of the
+ ;data buffer area
+
+ mov cx,DATA_BUFF_LENG ;set to number of bytes in the
+ ;data buffer area
+ push ax ;=A
+ ;DOS 3fh
+ CallInstall Dosread,Multdos,41,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;Read cx many bytes into the buffer
+ pop ax ;=A
+ jc DATASEEKNREAD
+
+IS_EXTENDED:
+ test INFO_FLAG,GET_EXT_F
+ jz CHK_OVERWRITE
+ call GETEXT_CTY
+ jmp short SETDOSCTY_NEXT
+
+
+CHK_OVERWRITE: ;=A
+ ; If SetCountryInfo, then
+ ; put DOS monocase routine
+ ; entry point into
+ ; NLS_BUFFER so don't
+ ; write over. =A
+
+ ; MSKK02 07/18/89
+ call SetDBCS_before_clear ; check DBCS vector set
+
+
+ cmp al,SetCountryInfo ;=A
+ jne DOS_MOVE ;=A
+ mov ax,word ptr es:[di+24] ;=A
+ mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 32],ax ;=A
+ mov ax,word ptr es:[di+26] ;=A
+ mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 34],ax ;=A
+
+ mov ax,CPAGE ;=FC, CPAGE is right
+ mov word ptr ds:[NLS_BUFFER+CTL_BUFF + 12],ax ;=FC
+
+DOS_MOVE:
+ call CHK_ADJUST ;now check to see if the entire
+ ;table fits
+
+SETDOSCTY_NEXT:
+
+ pop cx
+ pop si
+ pop di
+ add si, word ptr ds:[si]
+ inc si
+ inc si
+ dec cx
+ .UNTIL <cx eq 0> NEAR ;loop SETDOSCTY_DATA
+
+ ;Check for an invalid id
+ test INFO_FLAG,GET_EXT_F ;Check to see if a get_ext func 2 was issued
+ jz CTLSEEKnREAD ;if not move on
+ test INFO_FLAG,ID_CHECK_F ;if so check to see if an id was found
+ jnz BAD_SETID ;if none was found report an error
+ ;otherwise continue
+
+
+
+CTLSEEKnREAD:
+ clc ;=G
+ jmp short END_TRANS ;exit
+
+
+
+DATASEEKnREAD:
+ mov ALL_DONE,al ;=J
+ pop cx
+ pop si
+ pop di
+ jmp short END_TRANS
+
+BAD_SETID:
+; mov ALL_DONE,INVALID_FUNCTION ;=J
+; jmp short FINDCTY_FAIL ;=J
+
+BAD_FILE:
+ mov ALL_DONE,INVALID_FUNCTION ;=J
+
+FINDCTY_FAIL:
+ stc
+
+END_TRANS:
+ pop di ;Restore header start
+ ret
+
+
+
+TRANS_CTY_DATA ENDP
+
+ ; MSKK02 07/18/89
+SetDBCS_before_clear:
+ cmp al,SetDBCS ; DBCS vector set?
+ jnz @F ; jump if not
+ cmp word ptr es:[di], 0 ; zero byte data block?
+ jz @F ; jump if so
+ push di ;
+ push ax ;
+ push cx ;
+ mov cx,es:[di] ; load block length
+ add di,2 ; points actual data
+ xor al,al ; fill bytes
+ rep stosb ; clear data block
+ pop cx ;
+ pop ax ;
+ pop di ;
+@@:
+ ret ;
+
+;******************************END TRANS_CTY_DATA ******************************
+subttl get DOS country destination
+page
+;****************************GETCTY_DEST***********************************************
+GetDOSCty_Dest proc near
+;Get the destination address in the DOS country info table.
+;Input: AL - Data ID
+; ES:DI -> DOS_COUNTRY_CDPG_INFO
+;On return:
+; ES:DI -> Destination address of the matching data id
+; carry set if no matching data id found in DOS.
+
+ push cx
+ add di, ccNumber_of_entries ;skip the reserved area, syscodepage etc.
+ mov cx, word ptr es:[di] ;get the number of entries
+ inc di
+ inc di ;SI -> the first start entry id
+GetCntryDest:
+ cmp byte ptr es:[di], al
+ je GetCntryDest_OK
+ cmp byte ptr es:[di], SetCountryInfo ;was it SetCountryInfo entry?
+ je GetCntryDest_1
+ add di, 5 ;next data id
+ jmp short GetCntryDest_loop
+
+GetCntryDest_1:
+ add di, NEW_COUNTRY_SIZE + 1 ;next data id
+
+GetCntryDest_loop:
+ loop GetCntryDest
+ stc
+ jmp short GetCntryDest_exit
+
+GetCntryDest_OK:
+
+ cmp al, SetCountryInfo ;select country info?
+ jne GetCntryDest_OK1
+ inc di ;now DI -> ccCountryInfoLen
+ clc ;clear the carry
+ jmp short GetCntryDest_exit
+
+GetCntryDest_OK1:
+
+ les di, dword ptr es:[di+1] ;get the destination in ES:DI
+ clc
+
+GetCntryDest_Exit:
+ pop cx
+ ret
+
+GetDOSCty_Dest endp
+;****************************GETDOSCTY_DEST*************************************
+subttl get extended country data
+page
+;****************************GETEXT_CTY*****************************************
+GETEXT_CTY proc
+
+JUSTONE_ID:
+ mov ah,func_code ;=F
+ cmp ah,GET_CTY_INFO ;=F
+ je id_ctyinfo1 ;=F
+
+ mov al,INFO_ID
+ mov byte ptr es:[di],al
+
+ cmp INFO_ID,SetCountryInfo ;SETCTY_INFO =D moved.
+ je ID_CTYINFO ;=D don't want ptr if 1.
+
+ mov word ptr es:[di+1],offset nls_buffer + ctl_buff+8 ;=H
+ mov word ptr es:[di+3],ds ;my current ds value
+ mov CSIZE,5 ;=K
+
+ jmp short GET_EXT_END
+
+ID_CTYINFO:
+ inc di ;=D (old code - add di,5) =F(moved).
+id_ctyinfo1: ;=F
+ mov cx,CSIZE
+ ;next line used to be "add si,5"
+ ;si needs to point to cty info. =D
+ mov si,offset nls_buffer + ctl_buff + 8 ;=D
+
+ push es ;=A put DOS Monocase Routine
+ push di ;=A entry point in user buffer.
+ push ax ;=A
+ les di,dword ptr si_doslocate ;=A
+ mov ax,word ptr es:[di].ccMono_Ptr ;=A
+ mov word ptr ds:[si+24],ax ;=A
+ mov ax,word ptr es:[di].ccMono_Ptr+2 ;=A
+ mov word ptr ds:[si+26],ax ;=A
+
+ mov ax,CPAGE ;=FC trust CPAGE
+ mov word ptr ds:[si+4],ax ;=FC
+
+ pop ax ;=A
+ pop di ;=A
+ pop es ;=A
+
+ push bx ;=F
+ cmp ah,GET_CTY_INFO ;=F if get cty info(38) slide info
+ jne id_ctyinfo2 ;=F ptr up to date.
+ add si,6 ;=F
+ mov cx,old_country_size ;=FC
+ jmp short MOVE_CTY ;=FC
+
+id_ctyinfo2: mov bx,word ptr ds:[si] ;=FC get table size
+
+
+ sub CSIZE,3 ;=FC size begins after length field
+ mov cx,CSIZE ;=FC
+
+ cmp cx,bx ;=D was cmped to SETCTR_LENG
+ ja TRUNC_SIZE ;=FC used to be jg
+ jmp short MOV_SIZE
+TRUNC_SIZE:
+ mov cx,bx ;=F
+MOV_SIZE:
+ mov es:[di],cx ;=FC move actual length to user's buff
+ inc di ;=FC update index
+ inc di
+ inc si ;=FC skip length field
+ inc si
+
+MOVE_CTY: pop bx ;=F
+ mov CSIZE,cx ;=K
+ add CSIZE,3 ;=K
+ rep movsb
+
+GET_EXT_END:
+ ret
+
+GETEXT_CTY endp
+;*****************************END GETEXT_CTY*************************************
+subttl read into control buffer
+page
+;**************************READ_CTLBUFF*****************************************
+;
+READ_CTLBUFF proc near
+;Move file pointer to CX:DX
+;Read 64 bytes into the control buffer. Assume that the necessary data
+;is within that limit.
+;SI will be set to beginning of the offset my NLS_BUFFER hence DS:SI points to the control buffer.
+;Entry: CX,DX offset from the start of the file where the read/write pointer
+; be moved.
+; BX - file handle
+; DS - buffer seg.
+;Return: The control data information is read into DS:0 - DS:0200.
+; CX,DX value destroyed.
+; Carry set if error in Reading file.
+;
+ ;Function 4200h
+ xor bp,bp
+ CallInstall Lseek,multdos,40,<bx,cx,ds,es,di,si>,<si,di,es,ds,cx,bx> ;move pointer
+ jc NO_SEEK1
+
+ mov dx,offset NLS_BUFFER ;ds:dx -> control buffer
+ mov si,dx ;index for the entire buffer
+ ;read into the buffer function 3fh
+ mov cx, CTL_BUFF ;XXX bytes. Size of the information
+ CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx> ;should be less than XXX bytes.
+ jc NO_READ1
+ jmp short RICB_exit
+
+
+NO_SEEK1:
+; mov ALL_DONE,al ;=J
+; jmp short RICB_exit
+
+NO_READ1:
+ mov ALL_DONE,al ;=J
+
+RICB_exit: ;In this case 64 bytes
+ ret
+
+READ_CTLBUFF endp
+;****************************END READ_CTLBUFF***********************************
+subttl check / adjust / move data into DOS buffer
+page
+;****************************CHK_ADJUST*****************************************
+CHK_ADJUST PROC NEAR
+
+ push ax ;save info id
+ mov si,offset NLS_BUFFER+DATA_N_ID ;start of buffer + tag id
+ mov cx, word ptr ds:[si] ;get the length of the structure
+
+ inc cx
+ inc cx
+
+ cmp cx,MAXBUFF_FIT
+ jbe MOVE_DATA
+ push cx
+ mov cx,MAXBUFF_FIT
+ rep movsb
+ pop cx
+ sub cx,MAXBUFF_FIT
+
+NEED_ADJUST:
+ mov dx,offset NLS_BUFFER+CTL_BUFF ;reset to the beginning of the data buffer
+ mov si,dx ;reset to the beginning of the data buffer
+ cmp cx,DATA_BUFF_LENG ;check to see if it fits for the nth read
+ jbe LAST_READ ;last portion fits
+ push cx ;save how much is left to read
+ mov cx,DATA_BUFF_LENG ;set to how much you read at one time
+
+ ;read again ;function 3fh
+ ;read into the data buffer
+ CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx> ;save the file handle
+ jc ADJUST_END
+
+ rep movsb ;move data into DOS area
+ pop cx ;restore size remaining to
+ sub cx,DATA_BUFF_LENG ;be read get new size
+ jmp NEED_ADJUST ;must read agian
+
+LAST_READ:
+ ;one more read 3f
+ CallInstall Dosread,multdos,41,<bx,cx,dx,ds,es,di,si>,<si,di,es,ds,dx,cx,bx>
+ jc ADJUST_END
+
+MOVE_DATA:
+ rep movsb ;move data into DOS area
+
+ADJUST_END:
+ pop ax
+ ret
+CHK_ADJUST ENDP
+;*******************************END CHK_ADJUST *********************************
+subttl walk through device drivers and invoke
+page
+;************************ WALK DEVICE DRIVERS **********************************
+;=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=E=
+
+WALK_DEVICES PROC NEAR
+
+ mov si,offset NLS_BUFFER ;Prepare to hold device name
+ push es ;AN001; Clear out NLS_BUFFER to 0
+ push ds ;AN001;
+ pop es ;AN001;
+ mov di, si ;AN001; ES:DI-> NLS_BUFFER
+ xor ax, ax ;AN001; AX=0
+ mov cx, BUFFSIZE ;AN001;
+ shr cx, 1 ;AN001; /2 to make a # of words
+ rep stosw ;AN001;
+ pop es ;AN001; Restore es
+ ;Get ptr to hdr of 1st device.
+ push si ;AN001;
+ CallInstall GetDevLst,Multdos,44,<DS>,<DS>
+ pop si ;AN001;
+ mov es,bx ;bx:ax -> hdr.
+ mov di,ax
+char_test:
+ test es:[di].sdevatt,devtyp ;check attribute word for
+ je BR_GET_NEXT_DEVICE
+; jmp GET_NEXT_DEVICE ;character device.
+
+OPEN_DEVICE:
+ push si
+ push di ;set up asciiz filename
+ add di,10 ;for DOS file open
+ mov cx,8
+
+set_asciiz: mov al,es:[di]
+ cmp al,20h
+ je done_set_asciiz
+ mov ds:[si],al
+ inc di
+ inc si
+ loop set_asciiz
+
+done_set_asciiz:xor al,al
+ mov ds:[si],al
+
+ pop di
+ pop si
+
+ mov cx,1 ;open for write
+ mov dx,si
+ CallInstall Dosopen,Multdos,38,<DS,SI,ES,DI>,<DI,ES,SI,DS>
+ jnc end_open_device
+
+BR_GET_NEXT_DEVICE:
+ jmp GET_NEXT_DEVICE ; ignore this =FC
+
+end_open_device:
+ mov bx,ax ;put handle in bx
+ call Chk_Revisit ;AN001; Have been here already?
+ jc BR_CLOSE_DEVICE ;AN001; No, a new one.
+; jmp short CLOSE_DEVICE ;AN001; Yes. Close and ignore this.
+
+INVOKE_DEVICE:
+ push ds ;Check print queue first.
+ push si ;Set up for 2f print call.
+ clc
+ mov ax,0106h ;2f call to command.com.
+ int 2fh ;If print active: carry set,
+ jnc invoke_it ;DS:SI -> hdr of printing device.
+ cmp si,di ;Check if printing device is this
+ jne invoke_it ;device. Match on ptr to device.
+ mov ax,ds
+ mov cx,es
+ cmp ax,cx
+ jne invoke_it
+
+ pop si
+ pop ds
+ mov ALL_DONE,BAD_INVOKE ;Match. Set invoke error.
+
+BR_CLOSE_DEVICE:
+ jmp short CLOSE_DEVICE
+
+invoke_it: pop si ;save the current
+ pop ds ;environment
+
+;*************** CNS *********** Start of DBCS Support
+; 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
+ push di
+ push bx
+ push cx
+ push es
+ les di,dword ptr SI_DOSLOCATE ;get the environmental
+;*************** CNS ******************
+; mov bx,es:[di].ccDBCS_ptr ;values to allow
+; mov es,es:[di].ccDBCS_ptr+2 ;recognition and
+;*************** CNS ******************
+ les bx,es:[di].ccDBCS_ptr
+ mov cx,es:[bx] ;invocation of data
+ inc cx
+ inc cx
+ inc bx ;and ID for start
+ inc bx
+ mov di,offset pk.DBCS_EV ;and stop values for
+ ;otherwise it is a DBCS
+;****CHANGE ;or custom designed codepage
+
+ mov PK.PACKLEN,cx ;if packet length is zero
+
+NODBCS_CP:
+ add cx,-2 ;AN002; reset counter before CP addition
+
+;****CHANGE
+
+DB_EVECS:
+ or cx,cx ;AN002;no need to alter packet
+ jz NO_LOAD ;An002;initialized to zero
+
+
+ .REPEAT ;;AN000;DBCS transmission
+ ;AN000;
+ mov al,es:[bx] ;;AN000;get the the contents
+;***CNS ;AN000;
+ mov ds:[di],al ;;AN002;of where the DBCS Points
+;***CNS ;AN000;
+ inc di ;;AN000;data packet for ioctl
+ ;AN000;
+ inc bx ;AN000;;call--- get the start
+ ;stop values to load
+ ;AN000;
+ dec cx ;AN000;
+
+ .UNTIL <CX EQ 0 > ;AN000;
+ ;invocation of 1 codepage
+ ;standard codepage selection
+
+
+NO_LOAD:
+
+ pop es ;AN000;;accordingly & restore
+ ;AN000;
+ pop cx ;AN000;;values
+ ;AN000;
+ pop bx ;AN000;
+ ;AN000;
+ pop di ;AN000;
+ ;AN000;;invoke codepage
+;************************ CNS*** End of DBCS
+
+ ;Set up data packet for generic
+ mov ax,cpage ;ioctl call.
+ mov pk.packcpid,ax
+ lea dx,pk
+
+ mov cx,004ah
+ mov bp,0ch ;generic ioctl
+ CallInstall IOCTL,multdos,43,<DS,SI,ES,DI,BX>,<BX,DI,ES,SI,DS>
+ jc device_error
+
+
+CLOSE_DEVICE:
+ CallInstall Dosclose,multdos,39,<DS,SI,ES,DI>,<DI,ES,SI,DS>
+ jc dev_open_close_error ; ignore this =FC
+
+GET_NEXT_DEVICE:
+ cmp word ptr es:[di],0FFFFH
+ je END_WALK_DEVICES
+ les di,dword ptr es:[di]
+ jmp char_test
+
+DEVICE_ERROR:
+ cmp ax,1
+ je CLOSE_DEVICE
+ CallInstall GetExtErr,multdos,45,<DS,SI,ES,DI,BX>,<BX,DI,ES,SI,DS>
+ cmp ax,22
+ je CLOSE_DEVICE
+ mov ALL_DONE,BAD_INVOKE
+ jmp CLOSE_DEVICE
+
+dev_open_close_error:
+ mov ALL_DONE,BAD_INVOKE
+ jmp GET_NEXT_DEVICE
+
+END_WALK_DEVICES:
+
+
+ ret
+
+WALK_DEVICES endp
+;*********************** END WALK DEVICE DRIVERS *******************************
+;************************ Chk_Revisit******************************************
+;This routine will check if we are opening the same device driver again.
+;If it is, then carry bit will set.
+;This routine will use the NLS_BUFFER to keep the history of already
+;visited device driver address (OFFSET,SEGMENT). NLS_BUFFER will be
+;used from the end of the buffer towards to the front of the buffer.
+;For 512 byte length and considering the front part used for OPEN device
+;driver name string, this will handle appr. 126 devices maximum. which is
+;sufficient enough. - J.K. 1/15/88
+;IN: BX = file handle
+; DS = NLS_BUFFER segment
+;OUT: carry set = visited
+; carry not set = new one.
+; Other registers saved.
+
+Chk_Revisit proc near
+ push ax ;AN001;
+ push bx ;AN001;
+ push es ;AN001;
+ push di ;AN001;
+ mov ax, 1220h ;AN001; Get the spot of SFT
+ int 2fh ;AN001;
+ jc Chk_Rvst_Ret ;AN001; This won't happen
+ xor bx, bx ;AN001;
+ mov bl, byte ptr es:[di] ;AN001;
+ mov ax, 1216h ;AN001; Get the SFT pointer
+ int 2fh ;AN001; es:di-> SFT table
+ jc Chk_Rvst_Ret ;AN001; This won't happen
+ mov ax, word ptr es:[di].SF_DEVPTR ;AN001; offset of device
+ mov bx, word ptr es:[di].SF_DEVPTR+2;AN001; Segment of device
+ mov di, offset NLS_BUFFER ;AN001;
+ add di, BUFFSIZE-2 ;AN001; ds:di-> last word of the buffer
+Chk_Rvst_While: ;AN001;
+ cmp word ptr ds:[di], 0 ;AN001; di-> segment value
+ jne Chk_Rvst_Cont ;AN001;
+ cmp word ptr ds:[di-2], 0 ;AN001; offset
+ jne Chk_Rvst_Cont ;AN001;
+ jmp short Chk_Rvst_New ;AN001; Encountered a blank entry in the buffer
+Chk_Rvst_Cont: ;AN001;
+ cmp word ptr ds:[di], bx ;AN001;
+ jne Chk_Rvst_Next ;AN001;
+ cmp word ptr ds:[di-2], ax ;AN001;
+ jne Chk_Rvst_Next ;AN001;
+ stc ;AN001; found a match
+ jmp short Chk_Rvst_Ret ;AN001;
+Chk_Rvst_Next: ;AN001;
+ sub di, 4 ;AN001; move the pointer to the next entry
+ jmp Chk_Rvst_While ;AN001;
+Chk_Rvst_New: ;AN001;
+ mov word ptr ds:[di],bx ;AN001; Keep the current open device segment
+ mov word ptr ds:[di-2], ax ;AN001; and offset
+ clc ;AN001; New device
+Chk_Rvst_Ret: ;AN001;
+ pop di ;AN001;
+ pop es ;AN001;
+ pop bx ;AN001;
+ pop ax ;AN001;
+ ret ;AN001;
+Chk_Revisit endp
+
+subttl end nlsfunc resident code
+page
+ NLSRES_LENG equ $-NLSRES_CODE+DATASIZE
+subttl initialization
+page
+;***************************** NLSFUNC Initialization **************************
+
+
+ ASSUME CS:NLS_INIT_CODE,SS:STACK
+ PUBLIC MAIN
+MAIN PROC FAR
+
+ mov ax,NLS_DATA ;set up data segment
+ mov ds,ax
+ assume ds:NLS_DATA
+
+ mov PATHSEG,ax
+
+ call SYSLOADMSG ;does DOS version check
+
+ .IF <NC>
+
+ mov dx,NLSRES_LENG ;calculate paragraph
+ add dx,15 ;add 15
+ shr dx,1 ;divide by 16 to get conversion from
+ shr dx,1 ;bytes to paragraphs
+ shr dx,1
+ shr dx,1
+ add dx,11h ;size based on the byte size of
+ mov RES_PARASIZE,dx ;the resident procedure
+ call PROCESS_PATH
+
+ .ELSE
+
+ call SYSDISPMSG
+
+ .ENDIF
+
+ ; See if we should install and set
+ ; the TSR flag.
+
+; .IF <OPTIONS_SENT eq 0>
+
+ test INFO_FLAG,OPTIONS_SENT_F
+ jnz JJOPSOUT
+
+
+; .IF <NO_PARMS eq 1> or
+; .IF <GOOD_PATH eq 1>
+
+ test INFO_FLAG,NO_PARMS_F OR GOOD_PATH_F
+ jz JJOPSOUT
+
+OPSEOK:
+ call INSTALL_NLS ;let's install NLSFUNC
+
+; .IF <NC>
+
+ jc JJOPSOUT
+ or INFO_FLAG,EXIT_STAY_F ;if nothing wrong occured
+
+
+; .ENDIF ; <NC>
+; .ENDIF ; <NO_PARMS eq 1> or <GOOD_PATH eq 1>
+; .ENDIF ; <OPTIONS_SENT eq 0>
+JJOPSOUT:
+ ;determine path of exit
+ ;error or residency
+
+;****************************** EXIT PROG *********************************************
+
+ push ax ;AN004;save existing values
+ push es ;
+ xor ax,ax
+ mov ax,es:[2ch]
+ or ax,ax
+ jz NO_FREEDOM
+ mov es,ax
+ mov ax,4900H ;AN004;make the free allocate mem func
+ int 21h
+
+NO_FREEDOM:
+ pop es ;AN004;restore existing values
+ pop ax ;
+
+; .IF <EXIT_STAY eq 1> ;Terminate and stay resident
+
+ test INFO_FLAG,EXIT_STAY_F
+ jz JJEXSY
+
+ mov bx,4 ;1st close file handles
+
+ .REPEAT
+ mov ah,3eh
+ int 21h
+ dec bx
+ .UNTIL <BX eq 0>
+
+ mov ah,031h
+ mov dx,RES_PARASIZE ;paragraphs allocated
+ jmp short JJEXOUT
+
+; .ELSE
+JJEXSY:
+ clc
+ mov ah,04ch ;value passed to ERRORLEVEL
+
+; .ENDIF
+JJEXOUT:
+
+ mov al, ERROR_CODE ;check for an error
+ int 21H
+
+MAIN ENDP
+
+;****************************** EXIT PROG *********************************************
+subttl parse
+page
+; On entry: ES points at the PSP
+; DS points at NLS_DATA
+; DX was used to calculate paragraph size
+;
+; PARSER EFFECTS ES & DS wil be swapped
+;
+; Changes : ES:DI seg:off containing PARM Input Block
+; to DS:SI seg:off containing command line
+; segments
+;
+;
+;
+;
+;
+;
+;****************************** PROCESS PATH ***********************************
+;=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=I=
+
+PROCESS_PATH PROC NEAR
+
+ ;to command line parms
+
+
+ push es ;;AC000;e original es (nothing)
+ ;AC000;
+ push ds ;AC000;he original ds (Nls_data)
+ ;AC002;
+ push ds ;save for both es & ds to point at data
+
+ push es ;AC000;hat's in my es the PSP value
+ ;AN000;
+ push ds ;AN000;he segment id that points to my
+ ;es now points to data
+ pop es ;AC000;
+ ;input parameter control block (NLS_DATA)
+ ;AN000;
+
+ pop ds ;AN000; points to the segment for
+ ;the command line string
+ ;AN000;
+
+ ASSUME DS:NOTHING,ES:NLS_DATA
+
+ xor dx,dx
+ xor cx,cx
+
+;***CNS
+RE_START:
+ mov si,80h ;get the command line length
+
+ mov cl,byte ptr ds:[si] ;get the length for the counter
+;
+; mov LENGTH_HOLD,cl ;save the length of the command line
+;
+
+
+
+; .IF <dx eq 0>
+
+ mov di,OFFSET NLS_BUFFER ;
+ ; mov dx,1
+ ; .ELSE
+ ; mov di,OFFSET PATH_SPEC ;
+ ; mov dx,-1
+ ; .ENDIF
+
+ mov si,CL_NUM ;AN000; points to the offset command
+ ;line input string at value 81h
+ ;AN000;
+
+ rep movsb ;transfer command line to NLS_BUFFER
+
+; .IF <dx eq 1>
+; jmp RE_START
+; .ENDIF
+
+;***CNS
+
+
+
+
+ mov di,OFFSET NLS_PARMS ;AN000; into ES of the PARMS INPUT
+ ;BLOCK
+ ;AN000;
+ pop ds ; ds also point at NLS_DATA
+
+
+ ASSUME DS:NLS_DATA
+
+
+ mov si,OFFSET NLS_BUFFER ;si now points to the offset command
+;***CNS
+
+ xchg ax,CUR_PTR ;AN003;Save environment
+ ;AN003;Set advancing ptr to end of argument
+ xchg ax,OLD_PTR ;AN003;after saving the beginning the string
+ ;AN003;
+ xchg ax,CUR_PTR ;AN003;Restore the environment
+ mov CUR_PTR,si
+
+;***CNS
+
+
+
+ xor cx,cx ;AN000;l value should be atleast 1
+ xor dx,dx ;AN000;ut dx for input into the PARSER
+ ;AN000;
+
+ .WHILE <PAR_RETC eq 0> ;AN000;
+
+ call SYSPARSE ;AN000;empt to parse
+;***CNS
+
+ xchg ax,CUR_PTR ;AN003;Save environment
+ ;AN003;Set advancing ptr to end of argument
+ xchg ax,OLD_PTR ;AN003;after saving the beginning the string
+ ;AN003;
+ xchg ax,CUR_PTR ;AN003;Restore the environment
+ mov CUR_PTR,si
+
+;***CNS
+
+ .IF <RES_SYN EQ <OFFSET OPT_SYN>>
+
+ ; Display the user options help message
+
+ call DISPLAY_OPTIONS
+
+ ; Flag that the options message has been displayed,
+ ; and now we want out of this program so the user
+ ; can try again.
+
+ or INFO_FLAG,OPTIONS_SENT_F ; to get out of program
+ and INFO_FLAG,NOT EXIT_STAY_F ; and not TSR
+ mov ERROR_CODE, 0 ; and no error for help
+ mov ax, 1 ; to get out of WHILE loop
+
+ .ELSEIF <Res_type eq 5> ;AN000;ound
+ ;AN000;
+ mov USER_PATH,1 ;AN000;;path specified
+ ;AC000;
+ .ENDIF ;AN000;
+
+ mov PAR_RETC, AX ;AN000;;keep parsing until eoln
+ ;AN000;
+ .ENDWHILE ;AN000;
+
+ ; If we didn't display the option help message,
+ ; then continue on with normal processing.
+
+; .IF <OPTIONS_SENT EQ 0> NEAR
+
+ test INFO_FLAG,OPTIONS_SENT_F
+ jz JJBR1
+ jmp JJOUT1
+
+; .IF <PAR_RETC gt 0> ;AN000;;parse error
+JJBR1:
+ cmp PAR_RETC,0
+ jnge JJRETC
+
+
+ LEA DI,PATH_SPEC ;AN003;Set PTR to look at the STRING
+ PUSH SI ;AN003;Save current SI index
+ PUSH AX
+ MOV AX,OLD_PTR ;AN003;Last locale of the end of a PARAM
+ SUB CUR_PTR,AX ;AN003;Get the length via the PSP
+ MOV SI,CUR_PTR
+ MOV CX,SI ;AN003;Save it in CX to move in the chars
+ POP AX ;AN003;Restore the PTR to the command line position
+
+ MOV SI,OLD_PTR ;AN003;Last locale of the end of a PARAM
+ REP MOVSB ;AN003;Move in the chars until no more
+
+ LEA DI,PATH_SPEC ;AN003;Set PTR to look at the STRING
+
+ POP SI ;AN003;Restore the PTR to the command line position
+
+ mov cx,1 ;AN003;;
+ mov bx,STDERR ;AN003;
+ mov dl,no_input ;AN003;
+ mov dh,PARSE_ERR_CLASS ;AN003;
+ mov ds,PATHSEG ;AN003;
+ mov si,OFFSET PARMLIST3 ;AN003;
+ call SYSDISPMSG ;AN003;
+ or INFO_FLAG,PARSE_ERR_F ;AN003;;PARSE ERROR OCCURED
+
+ jmp short JJOUTRETC
+
+; .ELSEIF <CX eq 1> ;AN000;ordinal check
+JJRETC:
+
+ cmp cx,1
+ jne JJCX
+ ;AN000;
+ or INFO_FLAG,GOOD_PAR_F ;AN000;you are at the end of the line
+
+ jmp short JJOUTRETC ;AN000;
+
+JJCX:
+; .ELSE
+
+ or INFO_FLAG,NO_PARMS_F ;AN000;there is no argument go install
+
+; .ENDIF ; <PAR_RETC gt 0>
+JJOUTRETC:
+
+
+; .IF <PARSE_ERR eq 0> NEAR ;AN000;if not true you encountered a parse error
+
+ test INFO_FLAG,PARSE_ERR_F
+ jnz JJOUT1
+
+; .IF <GOOD_PAR eq 1> NEAR ;AN000;there is a parameter line available
+ ;to parse
+ test INFO_FLAG,GOOD_PAR_F ;AN000;
+ jz JJOUT1 ;Check the flags to see what
+ ;was returned in the return block
+
+ lea di,path_spec ;AC000;es:di > final path_spec
+ ;that will be used after fixup
+
+; .IF <USER_PATH gt 0> ;AC000;drive has been solved need
+ ;to check the filespec now
+ cmp USER_PATH,0
+ jnge USPA1
+
+ xor in_dex,in_dex ;AN000;clear ctr
+ mov bx,Res_POFF ;AN000;get file spec ptr to text
+ push ds ;AN000;prepare for entry
+ mov ds,Res_PSEG ;AN000;
+ mov in_dex,bx ;AN000;string seg value if filename
+
+; .ENDIF ;user path ;AN000;
+USPA1:
+
+ .WHILE <Filespec_PTR ne NULL> ;load chars until no more
+ ;AN000;
+ ;AN000;
+ mov al,FILESPEC_PTR ;AN000;
+ mov byte ptr es:[di],al ;move value into pathspec and
+ inc in_dex ;increment to next char position
+ inc di ;AN000;
+
+ .ENDWHILE
+
+;************************** CNS **********************************************
+;The new method of checking for a "bogus" file will be to attempt an
+;open on the path_spec if pathspec exist close path and continue if
+;carry set stuff error code with 02 and exit.....
+;*****************************************************************************
+; push es ;AN000;
+
+ pop ds ;into find first
+ mov si,di ;AN000;
+ xor cx,cx ;AN000;
+
+ ASSUME DS:NLS_DATA
+
+ mov byte ptr ds:[si],NULL ;add asciiz value
+ ;AN000;
+ lea dx,PATH_SPEC ;check full pathname
+ mov ah,4eh
+ int 21h
+ ;set up addressability
+; .IF <NC>
+
+ jc JJC1
+
+ clc ;ok-clear carry/exit
+ or INFO_FLAG,GOOD_PATH_F
+
+ jmp short JJOUT1
+
+; .ELSE
+JJC1:
+ mov ax,FNF ;AN000;
+ mov cx,1 ; ;AN000;
+ mov bx,STDERR ;AN000;
+ mov dl,no_input ;AN000;
+ mov dh,UTILITY_MSG_CLASS ;AN000;
+ mov ds,PATHSEG ;AN000;
+ mov si,OFFSET PARMLIST1 ;AN000;
+ call SYSDISPMSG ;AN000;
+ mov ERROR_CODE,02 ;
+ stc
+
+; .ENDIF ; <NC>
+
+; .ENDIF ; <GOOD_PAR eq 1>
+
+; .ENDIF ; <PARSE_ERR eq 0>
+
+; .ENDIF ; <OPTIONS_SENT EQ 0>
+
+JJOUT1:
+
+
+ pop ds ;AN000;;restore original ds (NLS_DATA)
+ ;AN000;
+ pop es ;AN000;;restore original es (nothing)
+ ;AN000;
+ ;AN000;;after munging around with the PARSER
+
+ ASSUME DS:NLS_DATA,ES:NOTHING
+
+ ret
+
+PROCESS_PATH ENDP
+
+
+subttl display_options
+page
+;**************************** DISPLAY OPTIONS *******************************
+;
+; 04/26/90 c-PaulB
+;
+; on entry:
+; No value passed
+;
+; on exit:
+; No value returned
+; AX, BX, CX, DX, SI modified
+;
+; function:
+; Displays all lines of the options help message to standard
+; output.
+;
+;**************************** DISPLAY OPTIONS *******************************
+
+ PUBLIC DISPLAY_OPTIONS
+DISPLAY_OPTIONS PROC NEAR
+
+ push ds
+ mov ax, MSG_OPTIONS_FIRST ; message to display
+ mov bx, STDOUT ; output handle
+ mov cx, 0 ; no substitutions
+ mov dh, UTILITY_MSG_CLASS ; message class
+ mov dl, no_input ; no input wanted
+ mov si, 0 ; no substitution list
+ mov ds, PATHSEG
+DO_LOOP:
+ call SYSDISPMSG ; send this message line
+ cmp ax, MSG_OPTIONS_LAST ; last message?
+ je DO_DONE ; we're done if so
+ inc ax ; else get next msg
+ jmp short DO_LOOP ; and go do it
+DO_DONE:
+ pop ds
+ ret
+
+DISPLAY_OPTIONS ENDP
+
+
+;****************************** CNS *******************************************
+subttl install NLSFUNC
+page
+;******************************** INSTALL NLSFUNC *****************************
+
+INSTALL_NLS PROC NEAR
+
+ push es
+
+ xor ax,ax ;clear the ax
+ mov ah,MULT_NLSFUNC ;load in my multiplex
+ INT 2fh ;id value 14
+ or al,al ;check to see if
+; jz DO_INSTALL ;hooked in the chain
+; *********************** CNS *************************************************
+
+ .IF <Z> ;AN000
+
+ ;Install NLSFUNC
+ mov al,2fh ;Get interrupt
+ mov ah,GET_INT ;2f in the chain
+ int 21h
+ mov word ptr INT_2f_NEXT+2,ES ;store the address
+ mov word ptr INT_2f_NEXT,BX ;to make the current
+ push ds ;2f handler next in
+ push cs ;the chain
+ pop ds ;set Dataseg to the Code
+ mov dx,offset NLSRES_CODE ;give start address
+ mov al,2fh ;of resident logic
+ mov ah,SET_INT ;set the 2f in the
+ int 21h ;chain
+ pop ds ;restore original ds
+ ;terminate &
+ CLC ; Let main know everything OK ;BN001;
+ ;stay
+;FREE THE ENVIRONMENT ;no then install
+
+; push ax ;AN004;save existing values
+; push es ;
+; mov ah,49H ;AN004;make the free allocate mem func
+; mov es,es:[2ch] ;AN004;get the segment address
+; int 21h ;
+; pop es ;AN004;restore existing values
+; pop ax ;
+
+ .ELSE ;AN000;
+;TBR Message retriever ;otherwise
+ mov ax,ALLINS ;
+ mov cx,1 ;
+ mov bx,STDERR ;AN000;
+ mov dl,no_input ;AN000;
+ mov dh,UTILITY_MSG_CLASS ;AN000;
+ mov ds,PATHSEG
+ mov si,OFFSET PARMLIST2
+ call SYSDISPMSG ;AN000;
+ mov ERROR_CODE,80 ;UTILITY ERROR CODE
+ stc
+
+.ENDIF
+
+ pop es
+
+ ret
+
+INSTALL_NLS ENDP
+
+msg_services <LOADmsg> ;AN000;
+msg_services <DISPLAYmsg,CHARmsg> ;AN000;
+msg_services <nlsfunc.cl1,nlsfunc.cl2,nlsfunc.cla> ;AN000;
+
+;******************************** END OF NLS_INIT_CODE **************************
+NLS_INIT_CODE ENDS
+subttl stack
+page
+
+STACK SEGMENT PARA STACK 'STACK'
+ DB 512 DUP (?)
+STACK ENDS
+
+ END MAIN
+
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.skl b/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.skl
new file mode 100644
index 000000000..6c9f32a15
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/nlsfunc.skl
@@ -0,0 +1,30 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+:util NLSFUNC ;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;
+:use PARSE10 ;AN003;
+
+:class A ;AN000;
+:use 1 COMMON1 ;AN000;;MSG 1 is always "Incorrect DOS version"
+:use 2 COMMON2 ;AN000;;MSG 2 is always "%1 already installed"
+:use 3 EXTEND2 ;AN000;;MSG 3 is always "File not found - %1"
+
+; 300 - 399 reserved for options help message
+:def 300 NLSFUNC /?
+:def 301 NLSFUNC /?
+:def 302 NLSFUNC /?
+
+:end ;AN000;
+
diff --git a/private/mvdm/dos/v86/cmd/nlsfunc/nlsparm.asm b/private/mvdm/dos/v86/cmd/nlsfunc/nlsparm.asm
new file mode 100644
index 000000000..ddd006a53
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/nlsfunc/nlsparm.asm
@@ -0,0 +1,154 @@
+ PAGE ,132 ;
+ TITLE NLSPARM.SAL - NLSFUNC SYSTEM COMMAND LINE PARSER
+
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;****************** START OF SPECIFICATIONS *****************************
+; MODULE NAME: NLSPARM.SAL
+;
+; DESCRIPTIVE NAME: Include the DOS system PARSER in the SEGMENT
+; configuration expected by the modules of NLSFUNC.
+;
+;FUNCTION: The common code of the DOS command line PARSER is optimized by
+; the setting of certain switches that cause the conditional
+; assembly of only the required portions of the common PARSER.
+; The segment registers are ASSUMED according to the type .EXE.
+;
+; ENTRY POINT: SYSPARSE, near
+;
+; INPUT:
+; ES - has seg id of the SEGMENT
+; that contains the input control blocks,
+; defined below.
+;
+; DI - offset into ES of the PARMS INPUT BLOCK
+;
+; DS - has seg id of the SEGMENT
+; that contains the DOS input COMMAND
+; string, which is originally presented at 81h
+; in the PSP.
+;
+; SI - offset into DS of the text of the DOS input COMMAND string
+; as originally presented at 81H in the PSP.
+;
+; DX - zero
+;
+; CX - ordinal value, intially zero, updated on each subsequent call
+; to the value returned in CX on the previous call.
+;
+; CS - points to the segment containing the
+; INCLUDE PARSE.SAL statement
+;
+; DS - also points to the segment containing the INCLUDE
+; PARSE.SAL statement.
+;
+; EXIT-NORMAL: Output registers:
+; AX - return code:
+; RC_No_Error equ 0 ; No error
+; RC_EOL equ -1 ; End of command line
+;
+; DX - Offset into ES of the selected RESULT BLOCK.
+; BL - terminated delimiter code
+; CX - new operand ordinal
+; SI - set past scanned operand
+;
+; EXIT-ERROR: Output registers:
+; AX - return code:
+; RC_Too_Many equ 1 ; Too many operands
+; RC_Op_Missing equ 2 ; Required operand missing
+; RC_Not_In_SW equ 3 ; Not in switch list provided
+; RC_Not_In_Key equ 4 ; Not in keyword list provided
+; RC_Out_Of_Range equ 6 ; Out of range specified
+; RC_Not_In_Val equ 7 ; Not in value list provided
+; RC_Not_In_Str equ 8 ; Not in string list provided
+; RC_Syntax equ 9 ; Syntax error
+;
+; INTERNAL REFERENCES:
+; ROUTINES: SYSPARSE:near (INCLUDEd in PARSE.SAL)
+;
+; DATA AREAS: none
+;
+; EXTERNAL REFERENCES:
+; ROUTINES: none
+;
+; DATA AREAS: control blocks pointed to by input registers.
+;
+; NOTES:
+; This module should be processed with the ASMUT preprocessor
+; with the re-alignment not requested, as:
+;
+; SALUT NLSPARM,NUL;
+;
+; To assemble these modules, the sequential
+; ordering of segments may be used.
+;
+; For LINK instructions, refer to the PROLOG of the main module,
+; NLSFUNC.SAL
+;
+; REVISION HISTORY: A000 Version 4.00: add PARSER, System Message Handler,
+;
+; COPYRIGHT: "The DOS NLSFUNC Utility"
+; "Version 4.00 (C)Copyright 1988 Microsoft
+; "Licensed Material - Program Property of Microsoft "
+;
+;****************** END OF SPECIFICATIONS *****************************
+ IF1
+ %OUT COMPONENT=NLSFUNC, MODULE=NLSPARM.SAL...
+ ENDIF
+; = = = = = = = = = = = =
+ HEADER <MACRO DEFINITION>
+; = = = = = = = = = = = =
+
+HEADER MACRO TEXT
+.XLIST
+ SUBTTL TEXT
+.LIST
+ PAGE
+ ENDM
+
+; = = = = = = = = = = = =
+ HEADER <SYSPARSE - SYSTEM COMMAND LINE PARSER>
+NLS_DATA SEGMENT BYTE PUBLIC 'DATA'
+
+CAPSW EQU 1 ;SUPPORT FILENAME TBL CAPS
+FARSW EQU 0 ;PARSER CALL FAR
+FILESW EQU 1 ;CHECK FOR FILESPEC
+SWSW EQU 1 ;SUPPORT CHECKING FOR SWITCHES
+DATESW EQU 0 ;SUPPRESS DATE CHECKING
+TIMESW EQU 0 ;SUPPRESS TIME CHECKING
+CMPXSW EQU 0 ;SUPPRESS CHECKING COMPLEX LIST
+NUMSW EQU 0 ;SUPPRESS CHECKING NUMERIC VALUE
+KEYSW EQU 0 ;SUPPRESS KEYWORD SUPPORT
+VAL1SW EQU 0 ;SUPPRESS SUPPORT OF VALUE DEFINITION 1
+VAL2SW EQU 0 ;SUPPRESS SUPPORT OF VALUE DEFINITION 2
+VAL3SW EQU 0 ;SUPPRESS SUPPORT OF VALUE DEFINITION 3
+DRVSW EQU 0 ;SUPPORT OF DRIVE ONLY FORMAT
+QUSSW EQU 0 ;SUPPRESS SUPPORT OF QUOTED STRING FORMAT
+
+; INCLUDE PSDATA.INC ;PARSE WORK AREA & EQUATES
+
+NLS_DATA ENDS
+
+NLS_INIT_CODE SEGMENT BYTE PUBLIC 'CODE'
+
+; ASSUME CS:NLS_INIT_CODE,DS:NLS_DATA
+ ASSUME CS:NLS_INIT_CODE,DS:nothing ; tsuneo
+
+; mov ax,NLS_DATA
+; mov ds,ax
+
+;INCSW equ 0
+
+
+
+ include version.inc
+ INCLUDE PARSE.ASM
+ PUBLIC SYSPARSE
+
+NLS_INIT_CODE ENDS
+;NLS_DATA ENDS
+ END
diff --git a/private/mvdm/dos/v86/cmd/qbasic/edit.hlp b/private/mvdm/dos/v86/cmd/qbasic/edit.hlp
new file mode 100644
index 000000000..0b0615e53
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/edit.hlp
Binary files differ
diff --git a/private/mvdm/dos/v86/cmd/qbasic/gorilla.bas b/private/mvdm/dos/v86/cmd/qbasic/gorilla.bas
new file mode 100644
index 000000000..ef2663f5e
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/gorilla.bas
@@ -0,0 +1,1135 @@
+' Q B a s i c G o r i l l a s
+'
+' Copyright (C) Microsoft Corporation 1990
+'
+' Your mission is to hit your opponent with the exploding banana
+' by varying the angle and power of your throw, taking into account
+' wind speed, gravity, and the city skyline.
+'
+' Speed of this game is determined by the constant SPEEDCONST. If the
+' program is too slow or too fast adjust the "CONST SPEEDCONST = 500" line
+' below. The larger the number the faster the game will go.
+'
+' To run this game, press Shift+F5.
+'
+' To exit QBasic, press Alt, F, X.
+'
+' To get help on a BASIC keyword, move the cursor to the keyword and press
+' F1 or click the right mouse button.
+'
+
+'Set default data type to integer for faster game play
+DEFINT A-Z
+
+'Sub Declarations
+DECLARE SUB DoSun (Mouth)
+DECLARE SUB SetScreen ()
+DECLARE SUB EndGame ()
+DECLARE SUB Center (Row, Text$)
+DECLARE SUB Intro ()
+DECLARE SUB SparklePause ()
+DECLARE SUB GetInputs (Player1$, Player2$, NumGames)
+DECLARE SUB PlayGame (Player1$, Player2$, NumGames)
+DECLARE SUB DoExplosion (x#, y#)
+DECLARE SUB MakeCityScape (BCoor() AS ANY)
+DECLARE SUB PlaceGorillas (BCoor() AS ANY)
+DECLARE SUB UpdateScores (Record(), PlayerNum, Results)
+DECLARE SUB DrawGorilla (x, y, arms)
+DECLARE SUB GorillaIntro (Player1$, Player2$)
+DECLARE SUB Rest (t#)
+DECLARE SUB VictoryDance (Player)
+DECLARE SUB ClearGorillas ()
+DECLARE SUB DrawBan (xc#, yc#, r, bc)
+DECLARE FUNCTION Scl (n!)
+DECLARE FUNCTION GetNum# (Row, Col)
+DECLARE FUNCTION DoShot (PlayerNum, x, y)
+DECLARE FUNCTION ExplodeGorilla (x#, y#)
+DECLARE FUNCTION Getn# (Row, Col)
+DECLARE FUNCTION PlotShot (StartX, StartY, Angle#, Velocity, PlayerNum)
+DECLARE FUNCTION CalcDelay! ()
+
+'Make all arrays Dynamic
+'$DYNAMIC
+
+'User-Defined TYPEs
+TYPE XYPoint
+ XCoor AS INTEGER
+ YCoor AS INTEGER
+END TYPE
+
+'Constants
+CONST SPEEDCONST = 500
+CONST TRUE = -1
+CONST FALSE = NOT TRUE
+CONST HITSELF = 1
+CONST BACKATTR = 0
+CONST OBJECTCOLOR = 1
+CONST WINDOWCOLOR = 14
+CONST SUNATTR = 3
+CONST SUNHAPPY = FALSE
+CONST SUNSHOCK = TRUE
+CONST RIGHTUP = 1
+CONST LEFTUP = 2
+CONST ARMSDOWN = 3
+
+'Global Variables
+DIM SHARED GorillaX(1 TO 2) 'Location of the two gorillas
+DIM SHARED GorillaY(1 TO 2)
+DIM SHARED LastBuilding
+
+DIM SHARED pi#
+DIM SHARED LBan&(x), RBan&(x), UBan&(x), DBan&(x) 'Graphical picture of banana
+DIM SHARED GorD&(120) 'Graphical picture of Gorilla arms down
+DIM SHARED GorL&(120) 'Gorilla left arm raised
+DIM SHARED GorR&(120) 'Gorilla right arm raised
+
+DIM SHARED gravity#
+DIM SHARED Wind
+
+'Screen Mode Variables
+DIM SHARED ScrHeight
+DIM SHARED ScrWidth
+DIM SHARED Mode
+DIM SHARED MaxCol
+
+'Screen Color Variables
+DIM SHARED ExplosionColor
+DIM SHARED SunColor
+DIM SHARED BackColor
+DIM SHARED SunHit
+
+DIM SHARED SunHt
+DIM SHARED GHeight
+DIM SHARED MachSpeed AS SINGLE
+
+ DEF FnRan (x) = INT(RND(1) * x) + 1
+ DEF SEG = 0 ' Set NumLock to ON
+ KeyFlags = PEEK(1047)
+ IF (KeyFlags AND 32) = 0 THEN
+ POKE 1047, KeyFlags OR 32
+ END IF
+ DEF SEG
+
+ GOSUB InitVars
+ Intro
+ GetInputs Name1$, Name2$, NumGames
+ GorillaIntro Name1$, Name2$
+ PlayGame Name1$, Name2$, NumGames
+
+ DEF SEG = 0 ' Restore NumLock state
+ POKE 1047, KeyFlags
+ DEF SEG
+END
+
+
+CGABanana:
+ 'BananaLeft
+ DATA 327686, -252645316, 60
+ 'BananaDown
+ DATA 196618, -1057030081, 49344
+ 'BananaUp
+ DATA 196618, -1056980800, 63
+ 'BananaRight
+ DATA 327686, 1010580720, 240
+
+EGABanana:
+ 'BananaLeft
+ DATA 458758,202116096,471604224,943208448,943208448,943208448,471604224,202116096,0
+ 'BananaDown
+ DATA 262153, -2134835200, -2134802239, -2130771968, -2130738945,8323072, 8323199, 4063232, 4063294
+ 'BananaUp
+ DATA 262153, 4063232, 4063294, 8323072, 8323199, -2130771968, -2130738945, -2134835200,-2134802239
+ 'BananaRight
+ DATA 458758, -1061109760, -522133504, 1886416896, 1886416896, 1886416896,-522133504,-1061109760,0
+
+InitVars:
+ pi# = 4 * ATN(1#)
+
+ 'This is a clever way to pick the best graphics mode available
+ ON ERROR GOTO ScreenModeError
+ Mode = 9
+ SCREEN Mode
+ ON ERROR GOTO PaletteError
+ IF Mode = 9 THEN PALETTE 4, 0 'Check for 64K EGA
+ ON ERROR GOTO 0
+
+ MachSpeed = CalcDelay
+
+ IF Mode = 9 THEN
+ ScrWidth = 640
+ ScrHeight = 350
+ GHeight = 25
+ RESTORE EGABanana
+ REDIM LBan&(8), RBan&(8), UBan&(8), DBan&(8)
+
+ FOR i = 0 TO 8
+ READ LBan&(i)
+ NEXT i
+
+ FOR i = 0 TO 8
+ READ DBan&(i)
+ NEXT i
+
+ FOR i = 0 TO 8
+ READ UBan&(i)
+ NEXT i
+
+ FOR i = 0 TO 8
+ READ RBan&(i)
+ NEXT i
+
+ SunHt = 39
+
+ ELSE
+
+ ScrWidth = 320
+ ScrHeight = 200
+ GHeight = 12
+ RESTORE CGABanana
+ REDIM LBan&(2), RBan&(2), UBan&(2), DBan&(2)
+ REDIM GorL&(20), GorD&(20), GorR&(20)
+
+ FOR i = 0 TO 2
+ READ LBan&(i)
+ NEXT i
+ FOR i = 0 TO 2
+ READ DBan&(i)
+ NEXT i
+ FOR i = 0 TO 2
+ READ UBan&(i)
+ NEXT i
+ FOR i = 0 TO 2
+ READ RBan&(i)
+ NEXT i
+
+ MachSpeed = MachSpeed * 1.3
+ SunHt = 20
+ END IF
+RETURN
+
+ScreenModeError:
+ IF Mode = 1 THEN
+ CLS
+ LOCATE 10, 5
+ PRINT "Sorry, you must have CGA, EGA color, or VGA graphics to play GORILLA.BAS"
+ END
+ ELSE
+ Mode = 1
+ RESUME
+ END IF
+
+PaletteError:
+ Mode = 1 '64K EGA cards will run in CGA mode.
+ RESUME NEXT
+
+REM $STATIC
+'CalcDelay:
+' Checks speed of the machine.
+FUNCTION CalcDelay!
+
+ s! = TIMER
+ DO
+ i! = i! + 1
+ LOOP UNTIL TIMER - s! >= .5
+ CalcDelay! = i!
+
+END FUNCTION
+
+' Center:
+' Centers and prints a text string on a given row
+' Parameters:
+' Row - screen row number
+' Text$ - text to be printed
+'
+SUB Center (Row, Text$)
+ Col = MaxCol \ 2
+ LOCATE Row, Col - (LEN(Text$) / 2 + .5)
+ PRINT Text$;
+END SUB
+
+' DoExplosion:
+' Produces explosion when a shot is fired
+' Parameters:
+' X#, Y# - location of explosion
+'
+SUB DoExplosion (x#, y#)
+
+ PLAY "MBO0L32EFGEFDC"
+ Radius = ScrHeight / 50
+ IF Mode = 9 THEN Inc# = .5 ELSE Inc# = .41
+ FOR c# = 0 TO Radius STEP Inc#
+ CIRCLE (x#, y#), c#, ExplosionColor
+ NEXT c#
+ FOR c# = Radius TO 0 STEP (-1 * Inc#)
+ CIRCLE (x#, y#), c#, BACKATTR
+ FOR i = 1 TO 100
+ NEXT i
+ Rest .005
+ NEXT c#
+END SUB
+
+' DoShot:
+' Controls banana shots by accepting player input and plotting
+' shot angle
+' Parameters:
+' PlayerNum - Player
+' x, y - Player's gorilla position
+'
+FUNCTION DoShot (PlayerNum, x, y)
+
+ 'Input shot
+ IF PlayerNum = 1 THEN
+ LocateCol = 1
+ ELSE
+ IF Mode = 9 THEN
+ LocateCol = 66
+ ELSE
+ LocateCol = 26
+ END IF
+ END IF
+
+ LOCATE 2, LocateCol
+ PRINT "Angle:";
+ Angle# = GetNum#(2, LocateCol + 7)
+
+ LOCATE 3, LocateCol
+ PRINT "Velocity:";
+ Velocity = GetNum#(3, LocateCol + 10)
+
+ IF PlayerNum = 2 THEN
+ Angle# = 180 - Angle#
+ END IF
+
+ 'Erase input
+ FOR i = 1 TO 4
+ LOCATE i, 1
+ PRINT SPACE$(30 \ (80 \ MaxCol));
+ LOCATE i, (50 \ (80 \ MaxCol))
+ PRINT SPACE$(30 \ (80 \ MaxCol));
+ NEXT
+
+ SunHit = FALSE
+ PlayerHit = PlotShot(x, y, Angle#, Velocity, PlayerNum)
+ IF PlayerHit = 0 THEN
+ DoShot = FALSE
+ ELSE
+ DoShot = TRUE
+ IF PlayerHit = PlayerNum THEN PlayerNum = 3 - PlayerNum
+ VictoryDance PlayerNum
+ END IF
+
+END FUNCTION
+
+' DoSun:
+' Draws the sun at the top of the screen.
+' Parameters:
+' Mouth - If TRUE draws "O" mouth else draws a smile mouth.
+'
+SUB DoSun (Mouth)
+
+ 'set position of sun
+ x = ScrWidth \ 2: y = Scl(25)
+
+ 'clear old sun
+ LINE (x - Scl(22), y - Scl(18))-(x + Scl(22), y + Scl(18)), BACKATTR, BF
+
+ 'draw new sun:
+ 'body
+ CIRCLE (x, y), Scl(12), SUNATTR
+ PAINT (x, y), SUNATTR
+
+ 'rays
+ LINE (x - Scl(20), y)-(x + Scl(20), y), SUNATTR
+ LINE (x, y - Scl(15))-(x, y + Scl(15)), SUNATTR
+
+ LINE (x - Scl(15), y - Scl(10))-(x + Scl(15), y + Scl(10)), SUNATTR
+ LINE (x - Scl(15), y + Scl(10))-(x + Scl(15), y - Scl(10)), SUNATTR
+
+ LINE (x - Scl(8), y - Scl(13))-(x + Scl(8), y + Scl(13)), SUNATTR
+ LINE (x - Scl(8), y + Scl(13))-(x + Scl(8), y - Scl(13)), SUNATTR
+
+ LINE (x - Scl(18), y - Scl(5))-(x + Scl(18), y + Scl(5)), SUNATTR
+ LINE (x - Scl(18), y + Scl(5))-(x + Scl(18), y - Scl(5)), SUNATTR
+
+ 'mouth
+ IF Mouth THEN 'draw "o" mouth
+ CIRCLE (x, y + Scl(5)), Scl(2.9), 0
+ PAINT (x, y + Scl(5)), 0, 0
+ ELSE 'draw smile
+ CIRCLE (x, y), Scl(8), 0, (210 * pi# / 180), (330 * pi# / 180)
+ END IF
+
+ 'eyes
+ CIRCLE (x - 3, y - 2), 1, 0
+ CIRCLE (x + 3, y - 2), 1, 0
+ PSET (x - 3, y - 2), 0
+ PSET (x + 3, y - 2), 0
+
+END SUB
+
+'DrawBan:
+' Draws the banana
+'Parameters:
+' xc# - Horizontal Coordinate
+' yc# - Vertical Coordinate
+' r - rotation position (0-3). ( \_/ ) /-\
+' bc - if TRUE then DrawBan draws the banana ELSE it erases the banana
+SUB DrawBan (xc#, yc#, r, bc)
+
+SELECT CASE r
+ CASE 0
+ IF bc THEN PUT (xc#, yc#), LBan&, PSET ELSE PUT (xc#, yc#), LBan&, XOR
+ CASE 1
+ IF bc THEN PUT (xc#, yc#), UBan&, PSET ELSE PUT (xc#, yc#), UBan&, XOR
+ CASE 2
+ IF bc THEN PUT (xc#, yc#), DBan&, PSET ELSE PUT (xc#, yc#), DBan&, XOR
+ CASE 3
+ IF bc THEN PUT (xc#, yc#), RBan&, PSET ELSE PUT (xc#, yc#), RBan&, XOR
+END SELECT
+
+END SUB
+
+'DrawGorilla:
+' Draws the Gorilla in either CGA or EGA mode
+' and saves the graphics data in an array.
+'Parameters:
+' x - x coordinate of gorilla
+' y - y coordinate of the gorilla
+' arms - either Left up, Right up, or both down
+SUB DrawGorilla (x, y, arms)
+ DIM i AS SINGLE ' Local index must be single precision
+
+ 'draw head
+ LINE (x - Scl(4), y)-(x + Scl(2.9), y + Scl(6)), OBJECTCOLOR, BF
+ LINE (x - Scl(5), y + Scl(2))-(x + Scl(4), y + Scl(4)), OBJECTCOLOR, BF
+
+ 'draw eyes/brow
+ LINE (x - Scl(3), y + Scl(2))-(x + Scl(2), y + Scl(2)), 0
+
+ 'draw nose if ega
+ IF Mode = 9 THEN
+ FOR i = -2 TO -1
+ PSET (x + i, y + 4), 0
+ PSET (x + i + 3, y + 4), 0
+ NEXT i
+ END IF
+
+ 'neck
+ LINE (x - Scl(3), y + Scl(7))-(x + Scl(2), y + Scl(7)), OBJECTCOLOR
+
+ 'body
+ LINE (x - Scl(8), y + Scl(8))-(x + Scl(6.9), y + Scl(14)), OBJECTCOLOR, BF
+ LINE (x - Scl(6), y + Scl(15))-(x + Scl(4.9), y + Scl(20)), OBJECTCOLOR, BF
+
+ 'legs
+ FOR i = 0 TO 4
+ CIRCLE (x + Scl(i), y + Scl(25)), Scl(10), OBJECTCOLOR, 3 * pi# / 4, 9 * pi# / 8
+ CIRCLE (x + Scl(-6) + Scl(i - .1), y + Scl(25)), Scl(10), OBJECTCOLOR, 15 * pi# / 8, pi# / 4
+ NEXT
+
+ 'chest
+ CIRCLE (x - Scl(4.9), y + Scl(10)), Scl(4.9), 0, 3 * pi# / 2, 0
+ CIRCLE (x + Scl(4.9), y + Scl(10)), Scl(4.9), 0, pi#, 3 * pi# / 2
+
+ FOR i = -5 TO -1
+ SELECT CASE arms
+ CASE 1
+ 'Right arm up
+ CIRCLE (x + Scl(i - .1), y + Scl(14)), Scl(9), OBJECTCOLOR, 3 * pi# / 4, 5 * pi# / 4
+ CIRCLE (x + Scl(4.9) + Scl(i), y + Scl(4)), Scl(9), OBJECTCOLOR, 7 * pi# / 4, pi# / 4
+ GET (x - Scl(15), y - Scl(1))-(x + Scl(14), y + Scl(28)), GorR&
+ CASE 2
+ 'Left arm up
+ CIRCLE (x + Scl(i - .1), y + Scl(4)), Scl(9), OBJECTCOLOR, 3 * pi# / 4, 5 * pi# / 4
+ CIRCLE (x + Scl(4.9) + Scl(i), y + Scl(14)), Scl(9), OBJECTCOLOR, 7 * pi# / 4, pi# / 4
+ GET (x - Scl(15), y - Scl(1))-(x + Scl(14), y + Scl(28)), GorL&
+ CASE 3
+ 'Both arms down
+ CIRCLE (x + Scl(i - .1), y + Scl(14)), Scl(9), OBJECTCOLOR, 3 * pi# / 4, 5 * pi# / 4
+ CIRCLE (x + Scl(4.9) + Scl(i), y + Scl(14)), Scl(9), OBJECTCOLOR, 7 * pi# / 4, pi# / 4
+ GET (x - Scl(15), y - Scl(1))-(x + Scl(14), y + Scl(28)), GorD&
+ END SELECT
+ NEXT i
+END SUB
+
+'ExplodeGorilla:
+' Causes gorilla explosion when a direct hit occurs
+'Parameters:
+' X#, Y# - shot location
+FUNCTION ExplodeGorilla (x#, y#)
+ YAdj = Scl(12)
+ XAdj = Scl(5)
+ SclX# = ScrWidth / 320
+ SclY# = ScrHeight / 200
+ IF x# < ScrWidth / 2 THEN PlayerHit = 1 ELSE PlayerHit = 2
+ PLAY "MBO0L16EFGEFDC"
+
+ FOR i = 1 TO 8 * SclX#
+ CIRCLE (GorillaX(PlayerHit) + 3.5 * SclX# + XAdj, GorillaY(PlayerHit) + 7 * SclY# + YAdj), i, ExplosionColor, , , -1.57
+ LINE (GorillaX(PlayerHit) + 7 * SclX#, GorillaY(PlayerHit) + 9 * SclY# - i)-(GorillaX(PlayerHit), GorillaY(PlayerHit) + 9 * SclY# - i), ExplosionColor
+ NEXT i
+
+ FOR i = 1 TO 16 * SclX#
+ IF i < (8 * SclX#) THEN CIRCLE (GorillaX(PlayerHit) + 3.5 * SclX# + XAdj, GorillaY(PlayerHit) + 7 * SclY# + YAdj), (8 * SclX# + 1) - i, BACKATTR, , , -1.57
+ CIRCLE (GorillaX(PlayerHit) + 3.5 * SclX# + XAdj, GorillaY(PlayerHit) + YAdj), i, i MOD 2 + 1, , , -1.57
+ NEXT i
+
+ FOR i = 24 * SclX# TO 1 STEP -1
+ CIRCLE (GorillaX(PlayerHit) + 3.5 * SclX# + XAdj, GorillaY(PlayerHit) + YAdj), i, BACKATTR, , , -1.57
+ FOR Count = 1 TO 200
+ NEXT
+ NEXT i
+
+ ExplodeGorilla = PlayerHit
+END FUNCTION
+
+'GetInputs:
+' Gets user inputs at beginning of game
+'Parameters:
+' Player1$, Player2$ - player names
+' NumGames - number of games to play
+SUB GetInputs (Player1$, Player2$, NumGames)
+ COLOR 7, 0
+ CLS
+
+ LOCATE 8, 15
+ LINE INPUT "Name of Player 1 (Default = 'Player 1'): "; Player1$
+ IF Player1$ = "" THEN
+ Player1$ = "Player 1"
+ ELSE
+ Player1$ = LEFT$(Player1$, 10)
+ END IF
+
+ LOCATE 10, 15
+ LINE INPUT "Name of Player 2 (Default = 'Player 2'): "; Player2$
+ IF Player2$ = "" THEN
+ Player2$ = "Player 2"
+ ELSE
+ Player2$ = LEFT$(Player2$, 10)
+ END IF
+
+ DO
+ LOCATE 12, 56: PRINT SPACE$(25);
+ LOCATE 12, 13
+ INPUT "Play to how many total points (Default = 3)"; game$
+ NumGames = VAL(LEFT$(game$, 2))
+ LOOP UNTIL NumGames > 0 AND LEN(game$) < 3 OR LEN(game$) = 0
+ IF NumGames = 0 THEN NumGames = 3
+
+ DO
+ LOCATE 14, 53: PRINT SPACE$(28);
+ LOCATE 14, 17
+ INPUT "Gravity in Meters/Sec (Earth = 9.8)"; grav$
+ gravity# = VAL(grav$)
+ LOOP UNTIL gravity# > 0 OR LEN(grav$) = 0
+ IF gravity# = 0 THEN gravity# = 9.8
+END SUB
+
+'GetNum:
+' Gets valid numeric input from user
+'Parameters:
+' Row, Col - location to echo input
+FUNCTION GetNum# (Row, Col)
+ Result$ = ""
+ Done = FALSE
+ WHILE INKEY$ <> "": WEND 'Clear keyboard buffer
+
+ DO WHILE NOT Done
+
+ LOCATE Row, Col
+ PRINT Result$; CHR$(95); " ";
+
+ Kbd$ = INKEY$
+ SELECT CASE Kbd$
+ CASE "0" TO "9"
+ Result$ = Result$ + Kbd$
+ CASE "."
+ IF INSTR(Result$, ".") = 0 THEN
+ Result$ = Result$ + Kbd$
+ END IF
+ CASE CHR$(13)
+ IF VAL(Result$) > 360 THEN
+ Result$ = ""
+ ELSE
+ Done = TRUE
+ END IF
+ CASE CHR$(8)
+ IF LEN(Result$) > 0 THEN
+ Result$ = LEFT$(Result$, LEN(Result$) - 1)
+ END IF
+ CASE ELSE
+ IF LEN(Kbd$) > 0 THEN
+ BEEP
+ END IF
+ END SELECT
+ LOOP
+
+ LOCATE Row, Col
+ PRINT Result$; " ";
+
+ GetNum# = VAL(Result$)
+END FUNCTION
+
+'GorillaIntro:
+' Displays gorillas on screen for the first time
+' allows the graphical data to be put into an array
+'Parameters:
+' Player1$, Player2$ - The names of the players
+'
+SUB GorillaIntro (Player1$, Player2$)
+ LOCATE 16, 34: PRINT "--------------"
+ LOCATE 18, 34: PRINT "V = View Intro"
+ LOCATE 19, 34: PRINT "P = Play Game"
+ LOCATE 21, 35: PRINT "Your Choice?"
+
+ DO WHILE Char$ = ""
+ Char$ = INKEY$
+ LOOP
+
+ IF Mode = 1 THEN
+ x = 125
+ y = 100
+ ELSE
+ x = 278
+ y = 175
+ END IF
+
+ SCREEN Mode
+ SetScreen
+
+ IF Mode = 1 THEN Center 5, "Please wait while gorillas are drawn."
+
+ VIEW PRINT 9 TO 24
+
+ IF Mode = 9 THEN PALETTE OBJECTCOLOR, BackColor
+
+ DrawGorilla x, y, ARMSDOWN
+ CLS 2
+ DrawGorilla x, y, LEFTUP
+ CLS 2
+ DrawGorilla x, y, RIGHTUP
+ CLS 2
+
+ VIEW PRINT 1 TO 25
+ IF Mode = 9 THEN PALETTE OBJECTCOLOR, 46
+
+ IF UCASE$(Char$) = "V" THEN
+ Center 2, "Q B A S I C G O R I L L A S"
+ Center 5, " STARRING: "
+ P$ = Player1$ + " AND " + Player2$
+ Center 7, P$
+
+ PUT (x - 13, y), GorD&, PSET
+ PUT (x + 47, y), GorD&, PSET
+ Rest 1
+
+ PUT (x - 13, y), GorL&, PSET
+ PUT (x + 47, y), GorR&, PSET
+ PLAY "t120o1l16b9n0baan0bn0bn0baaan0b9n0baan0b"
+ Rest .3
+
+ PUT (x - 13, y), GorR&, PSET
+ PUT (x + 47, y), GorL&, PSET
+ PLAY "o2l16e-9n0e-d-d-n0e-n0e-n0e-d-d-d-n0e-9n0e-d-d-n0e-"
+ Rest .3
+
+ PUT (x - 13, y), GorL&, PSET
+ PUT (x + 47, y), GorR&, PSET
+ PLAY "o2l16g-9n0g-een0g-n0g-n0g-eeen0g-9n0g-een0g-"
+ Rest .3
+
+ PUT (x - 13, y), GorR&, PSET
+ PUT (x + 47, y), GorL&, PSET
+ PLAY "o2l16b9n0baan0g-n0g-n0g-eeen0o1b9n0baan0b"
+ Rest .3
+
+ FOR i = 1 TO 4
+ PUT (x - 13, y), GorL&, PSET
+ PUT (x + 47, y), GorR&, PSET
+ PLAY "T160O0L32EFGEFDC"
+ Rest .1
+ PUT (x - 13, y), GorR&, PSET
+ PUT (x + 47, y), GorL&, PSET
+ PLAY "T160O0L32EFGEFDC"
+ Rest .1
+ NEXT
+ END IF
+END SUB
+
+'Intro:
+' Displays game introduction
+SUB Intro
+
+ SCREEN 0
+ WIDTH 80, 25
+ MaxCol = 80
+ COLOR 15, 0
+ CLS
+
+ Center 4, "Q B a s i c G O R I L L A S"
+ COLOR 7
+ Center 6, "Copyright (C) Microsoft Corporation 1990"
+ Center 8, "Your mission is to hit your opponent with the exploding"
+ Center 9, "banana by varying the angle and power of your throw, taking"
+ Center 10, "into account wind speed, gravity, and the city skyline."
+ Center 11, "The wind speed is shown by a directional arrow at the bottom"
+ Center 12, "of the playing field, its length relative to its strength."
+ Center 24, "Press any key to continue"
+
+ PLAY "MBT160O1L8CDEDCDL4ECC"
+ SparklePause
+ IF Mode = 1 THEN MaxCol = 40
+END SUB
+
+'MakeCityScape:
+' Creates random skyline for game
+'Parameters:
+' BCoor() - a user-defined type array which stores the coordinates of
+' the upper left corner of each building.
+SUB MakeCityScape (BCoor() AS XYPoint)
+
+ x = 2
+
+ 'Set the sloping trend of the city scape. NewHt is new building height
+ Slope = FnRan(6)
+ SELECT CASE Slope
+ CASE 1: NewHt = 15 'Upward slope
+ CASE 2: NewHt = 130 'Downward slope
+ CASE 3 TO 5: NewHt = 15 '"V" slope - most common
+ CASE 6: NewHt = 130 'Inverted "V" slope
+ END SELECT
+
+ IF Mode = 9 THEN
+ BottomLine = 335 'Bottom of building
+ HtInc = 10 'Increase value for new height
+ DefBWidth = 37 'Default building height
+ RandomHeight = 120 'Random height difference
+ WWidth = 3 'Window width
+ WHeight = 6 'Window height
+ WDifV = 15 'Counter for window spacing - vertical
+ WDifh = 10 'Counter for window spacing - horizontal
+ ELSE
+ BottomLine = 190
+ HtInc = 6
+ NewHt = NewHt * 20 \ 35 'Adjust for CGA
+ DefBWidth = 18
+ RandomHeight = 54
+ WWidth = 1
+ WHeight = 2
+ WDifV = 5
+ WDifh = 4
+ END IF
+
+ CurBuilding = 1
+ DO
+
+ SELECT CASE Slope
+ CASE 1
+ NewHt = NewHt + HtInc
+ CASE 2
+ NewHt = NewHt - HtInc
+ CASE 3 TO 5
+ IF x > ScrWidth \ 2 THEN
+ NewHt = NewHt - 2 * HtInc
+ ELSE
+ NewHt = NewHt + 2 * HtInc
+ END IF
+ CASE 4
+ IF x > ScrWidth \ 2 THEN
+ NewHt = NewHt + 2 * HtInc
+ ELSE
+ NewHt = NewHt - 2 * HtInc
+ END IF
+ END SELECT
+
+ 'Set width of building and check to see if it would go off the screen
+ BWidth = FnRan(DefBWidth) + DefBWidth
+ IF x + BWidth > ScrWidth THEN BWidth = ScrWidth - x - 2
+
+ 'Set height of building and check to see if it goes below screen
+ BHeight = FnRan(RandomHeight) + NewHt
+ IF BHeight < HtInc THEN BHeight = HtInc
+
+ 'Check to see if Building is too high
+ IF BottomLine - BHeight <= MaxHeight + GHeight THEN BHeight = MaxHeight + GHeight - 5
+
+ 'Set the coordinates of the building into the array
+ BCoor(CurBuilding).XCoor = x
+ BCoor(CurBuilding).YCoor = BottomLine - BHeight
+
+ IF Mode = 9 THEN BuildingColor = FnRan(3) + 4 ELSE BuildingColor = 2
+
+ 'Draw the building, outline first, then filled
+ LINE (x - 1, BottomLine + 1)-(x + BWidth + 1, BottomLine - BHeight - 1), BACKGROUND, B
+ LINE (x, BottomLine)-(x + BWidth, BottomLine - BHeight), BuildingColor, BF
+
+ 'Draw the windows
+ c = x + 3
+ DO
+ FOR i = BHeight - 3 TO 7 STEP -WDifV
+ IF Mode <> 9 THEN
+ WinColr = (FnRan(2) - 2) * -3
+ ELSEIF FnRan(4) = 1 THEN
+ WinColr = 8
+ ELSE
+ WinColr = WINDOWCOLOR
+ END IF
+ LINE (c, BottomLine - i)-(c + WWidth, BottomLine - i + WHeight), WinColr, BF
+ NEXT
+ c = c + WDifh
+ LOOP UNTIL c >= x + BWidth - 3
+
+ x = x + BWidth + 2
+
+ CurBuilding = CurBuilding + 1
+
+ LOOP UNTIL x > ScrWidth - HtInc
+
+ LastBuilding = CurBuilding - 1
+
+ 'Set Wind speed
+ Wind = FnRan(10) - 5
+ IF FnRan(3) = 1 THEN
+ IF Wind > 0 THEN
+ Wind = Wind + FnRan(10)
+ ELSE
+ Wind = Wind - FnRan(10)
+ END IF
+ END IF
+
+ 'Draw Wind speed arrow
+ IF Wind <> 0 THEN
+ WindLine = Wind * 3 * (ScrWidth \ 320)
+ LINE (ScrWidth \ 2, ScrHeight - 5)-(ScrWidth \ 2 + WindLine, ScrHeight - 5), ExplosionColor
+ IF Wind > 0 THEN ArrowDir = -2 ELSE ArrowDir = 2
+ LINE (ScrWidth / 2 + WindLine, ScrHeight - 5)-(ScrWidth / 2 + WindLine + ArrowDir, ScrHeight - 5 - 2), ExplosionColor
+ LINE (ScrWidth / 2 + WindLine, ScrHeight - 5)-(ScrWidth / 2 + WindLine + ArrowDir, ScrHeight - 5 + 2), ExplosionColor
+ END IF
+END SUB
+
+'PlaceGorillas:
+' PUTs the Gorillas on top of the buildings. Must have drawn
+' Gorillas first.
+'Parameters:
+' BCoor() - user-defined TYPE array which stores upper left coordinates
+' of each building.
+SUB PlaceGorillas (BCoor() AS XYPoint)
+
+ IF Mode = 9 THEN
+ XAdj = 14
+ YAdj = 30
+ ELSE
+ XAdj = 7
+ YAdj = 16
+ END IF
+ SclX# = ScrWidth / 320
+ SclY# = ScrHeight / 200
+
+ 'Place gorillas on second or third building from edge
+ FOR i = 1 TO 2
+ IF i = 1 THEN BNum = FnRan(2) + 1 ELSE BNum = LastBuilding - FnRan(2)
+
+ BWidth = BCoor(BNum + 1).XCoor - BCoor(BNum).XCoor
+ GorillaX(i) = BCoor(BNum).XCoor + BWidth / 2 - XAdj
+ GorillaY(i) = BCoor(BNum).YCoor - YAdj
+ PUT (GorillaX(i), GorillaY(i)), GorD&, PSET
+ NEXT i
+
+END SUB
+
+'PlayGame:
+' Main game play routine
+'Parameters:
+' Player1$, Player2$ - player names
+' NumGames - number of games to play
+SUB PlayGame (Player1$, Player2$, NumGames)
+ DIM BCoor(0 TO 30) AS XYPoint
+ DIM TotalWins(1 TO 2)
+
+ J = 1
+
+ FOR i = 1 TO NumGames
+
+ CLS
+ RANDOMIZE (TIMER)
+ CALL MakeCityScape(BCoor())
+ CALL PlaceGorillas(BCoor())
+ DoSun SUNHAPPY
+ Hit = FALSE
+ DO WHILE Hit = FALSE
+ J = 1 - J
+ LOCATE 1, 1
+ PRINT Player1$
+ LOCATE 1, (MaxCol - 1 - LEN(Player2$))
+ PRINT Player2$
+ Center 23, LTRIM$(STR$(TotalWins(1))) + ">Score<" + LTRIM$(STR$(TotalWins(2)))
+ Tosser = J + 1: Tossee = 3 - J
+
+ 'Plot the shot. Hit is true if Gorilla gets hit.
+ Hit = DoShot(Tosser, GorillaX(Tosser), GorillaY(Tosser))
+
+ 'Reset the sun, if it got hit
+ IF SunHit THEN DoSun SUNHAPPY
+
+ IF Hit = TRUE THEN CALL UpdateScores(TotalWins(), Tosser, Hit)
+ LOOP
+ SLEEP 1
+ NEXT i
+
+ SCREEN 0
+ WIDTH 80, 25
+ COLOR 7, 0
+ MaxCol = 80
+ CLS
+
+ Center 8, "GAME OVER!"
+ Center 10, "Score:"
+ LOCATE 11, 30: PRINT Player1$; TAB(50); TotalWins(1)
+ LOCATE 12, 30: PRINT Player2$; TAB(50); TotalWins(2)
+ Center 24, "Press any key to continue"
+ SparklePause
+ COLOR 7, 0
+ CLS
+END SUB
+
+'PlayGame:
+' Plots banana shot across the screen
+'Parameters:
+' StartX, StartY - starting shot location
+' Angle - shot angle
+' Velocity - shot velocity
+' PlayerNum - the banana thrower
+FUNCTION PlotShot (StartX, StartY, Angle#, Velocity, PlayerNum)
+
+ Angle# = Angle# / 180 * pi# 'Convert degree angle to radians
+ Radius = Mode MOD 7
+
+ InitXVel# = COS(Angle#) * Velocity
+ InitYVel# = SIN(Angle#) * Velocity
+
+ oldx# = StartX
+ oldy# = StartY
+
+ 'draw gorilla toss
+ IF PlayerNum = 1 THEN
+ PUT (StartX, StartY), GorL&, PSET
+ ELSE
+ PUT (StartX, StartY), GorR&, PSET
+ END IF
+
+ 'throw sound
+ PLAY "MBo0L32A-L64CL16BL64A+"
+ Rest .1
+
+ 'redraw gorilla
+ PUT (StartX, StartY), GorD&, PSET
+
+ adjust = Scl(4) 'For scaling CGA
+
+ xedge = Scl(9) * (2 - PlayerNum) 'Find leading edge of banana for check
+
+ Impact = FALSE
+ ShotInSun = FALSE
+ OnScreen = TRUE
+ PlayerHit = 0
+ NeedErase = FALSE
+
+ StartXPos = StartX
+ StartYPos = StartY - adjust - 3
+
+ IF PlayerNum = 2 THEN
+ StartXPos = StartXPos + Scl(25)
+ direction = Scl(4)
+ ELSE
+ direction = Scl(-4)
+ END IF
+
+ IF Velocity < 2 THEN 'Shot too slow - hit self
+ x# = StartX
+ y# = StartY
+ pointval = OBJECTCOLOR
+ END IF
+
+ DO WHILE (NOT Impact) AND OnScreen
+
+ Rest .02
+
+ 'Erase old banana, if necessary
+ IF NeedErase THEN
+ NeedErase = FALSE
+ CALL DrawBan(oldx#, oldy#, oldrot, FALSE)
+ END IF
+
+ x# = StartXPos + (InitXVel# * t#) + (.5 * (Wind / 5) * t# ^ 2)
+ y# = StartYPos + ((-1 * (InitYVel# * t#)) + (.5 * gravity# * t# ^ 2)) * (ScrHeight / 350)
+
+ IF (x# >= ScrWidth - Scl(10)) OR (x# <= 3) OR (y# >= ScrHeight - 3) THEN
+ OnScreen = FALSE
+ END IF
+
+
+ IF OnScreen AND y# > 0 THEN
+
+ 'check it
+ LookY = 0
+ LookX = Scl(8 * (2 - PlayerNum))
+ DO
+ pointval = POINT(x# + LookX, y# + LookY)
+ IF pointval = 0 THEN
+ Impact = FALSE
+ IF ShotInSun = TRUE THEN
+ IF ABS(ScrWidth \ 2 - x#) > Scl(20) OR y# > SunHt THEN ShotInSun = FALSE
+ END IF
+ ELSEIF pointval = SUNATTR AND y# < SunHt THEN
+ IF NOT SunHit THEN DoSun SUNSHOCK
+ SunHit = TRUE
+ ShotInSun = TRUE
+ ELSE
+ Impact = TRUE
+ END IF
+ LookX = LookX + direction
+ LookY = LookY + Scl(6)
+ LOOP UNTIL Impact OR LookX <> Scl(4)
+
+ IF NOT ShotInSun AND NOT Impact THEN
+ 'plot it
+ rot = (t# * 10) MOD 4
+ CALL DrawBan(x#, y#, rot, TRUE)
+ NeedErase = TRUE
+ END IF
+
+ oldx# = x#
+ oldy# = y#
+ oldrot = rot
+
+ END IF
+
+
+ t# = t# + .1
+
+ LOOP
+
+ IF pointval <> OBJECTCOLOR AND Impact THEN
+ CALL DoExplosion(x# + adjust, y# + adjust)
+ ELSEIF pointval = OBJECTCOLOR THEN
+ PlayerHit = ExplodeGorilla(x#, y#)
+ END IF
+
+ PlotShot = PlayerHit
+
+END FUNCTION
+
+'Rest:
+' pauses the program
+SUB Rest (t#)
+ s# = TIMER
+ t2# = MachSpeed * t# / SPEEDCONST
+ DO
+ LOOP UNTIL TIMER - s# > t2#
+END SUB
+
+'Scl:
+' Pass the number in to scaling for cga. If the number is a decimal, then we
+' want to scale down for cga or scale up for ega. This allows a full range
+' of numbers to be generated for scaling.
+' (i.e. for 3 to get scaled to 1, pass in 2.9)
+FUNCTION Scl (n!)
+
+ IF n! <> INT(n!) THEN
+ IF Mode = 1 THEN n! = n! - 1
+ END IF
+ IF Mode = 1 THEN
+ Scl = CINT(n! / 2 + .1)
+ ELSE
+ Scl = CINT(n!)
+ END IF
+
+END FUNCTION
+
+'SetScreen:
+' Sets the appropriate color statements
+SUB SetScreen
+
+ IF Mode = 9 THEN
+ ExplosionColor = 2
+ BackColor = 1
+ PALETTE 0, 1
+ PALETTE 1, 46
+ PALETTE 2, 44
+ PALETTE 3, 54
+ PALETTE 5, 7
+ PALETTE 6, 4
+ PALETTE 7, 3
+ PALETTE 9, 63 'Display Color
+ ELSE
+ ExplosionColor = 2
+ BackColor = 0
+ COLOR BackColor, 2
+
+ END IF
+
+END SUB
+
+'SparklePause:
+' Creates flashing border for intro and game over screens
+SUB SparklePause
+
+ COLOR 4, 0
+ A$ = "* * * * * * * * * * * * * * * * * "
+ WHILE INKEY$ <> "": WEND 'Clear keyboard buffer
+
+ WHILE INKEY$ = ""
+ FOR A = 1 TO 5
+ LOCATE 1, 1 'print horizontal sparkles
+ PRINT MID$(A$, A, 80);
+ LOCATE 22, 1
+ PRINT MID$(A$, 6 - A, 80);
+
+ FOR b = 2 TO 21 'Print Vertical sparkles
+ c = (A + b) MOD 5
+ IF c = 1 THEN
+ LOCATE b, 80
+ PRINT "*";
+ LOCATE 23 - b, 1
+ PRINT "*";
+ ELSE
+ LOCATE b, 80
+ PRINT " ";
+ LOCATE 23 - b, 1
+ PRINT " ";
+ END IF
+ NEXT b
+ NEXT A
+ WEND
+END SUB
+
+'UpdateScores:
+' Updates players' scores
+'Parameters:
+' Record - players' scores
+' PlayerNum - player
+' Results - results of player's shot
+SUB UpdateScores (Record(), PlayerNum, Results)
+ IF Results = HITSELF THEN
+ Record(ABS(PlayerNum - 3)) = Record(ABS(PlayerNum - 3)) + 1
+ ELSE
+ Record(PlayerNum) = Record(PlayerNum) + 1
+ END IF
+END SUB
+
+'VictoryDance:
+' gorilla dances after he has eliminated his opponent
+'Parameters:
+' Player - which gorilla is dancing
+SUB VictoryDance (Player)
+
+ FOR i# = 1 TO 4
+ PUT (GorillaX(Player), GorillaY(Player)), GorL&, PSET
+ PLAY "MFO0L32EFGEFDC"
+ Rest .2
+ PUT (GorillaX(Player), GorillaY(Player)), GorR&, PSET
+ PLAY "MFO0L32EFGEFDC"
+ Rest .2
+ NEXT
+END SUB
+
diff --git a/private/mvdm/dos/v86/cmd/qbasic/makefile b/private/mvdm/dos/v86/cmd/qbasic/makefile
new file mode 100644
index 000000000..8b3d09900
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/makefile
@@ -0,0 +1,26 @@
+# Makefile for qbasic.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+
+#
+####################### dependencies begin here. #########################
+#
+
+all:
+ binplace qbasic.exe
+ binplace qbasic.hlp
+ binplace msherc.com
+ binplace edit.com
+ binplace edit.hlp
+ binplace gorilla.bas
+ binplace nibbles.bas
+ binplace money.bas
+ binplace remline.bas
+
+clean:
diff --git a/private/mvdm/dos/v86/cmd/qbasic/money.bas b/private/mvdm/dos/v86/cmd/qbasic/money.bas
new file mode 100644
index 000000000..9c1772d2f
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/money.bas
@@ -0,0 +1,1536 @@
+'
+' Q B a s i c M O N E Y M A N A G E R
+'
+' Copyright (C) Microsoft Corporation 1990
+'
+' The Money Manager is a personal finance manager that allows you
+' to enter account transactions while tracking your account balances
+' and net worth.
+'
+' To run this program, press Shift+F5.
+'
+' To exit QBasic, press Alt, F, X.
+'
+' To get help on a BASIC keyword, move the cursor to the keyword and press
+' F1 or click the right mouse button.
+'
+
+
+'Set default data type to integer for faster operation
+DEFINT A-Z
+
+'Sub and function declarations
+DECLARE SUB TransactionSummary (item%)
+DECLARE SUB LCenter (text$)
+DECLARE SUB ScrollUp ()
+DECLARE SUB ScrollDown ()
+DECLARE SUB Initialize ()
+DECLARE SUB Intro ()
+DECLARE SUB SparklePause ()
+DECLARE SUB Center (row%, text$)
+DECLARE SUB FancyCls (dots%, Background%)
+DECLARE SUB LoadState ()
+DECLARE SUB SaveState ()
+DECLARE SUB MenuSystem ()
+DECLARE SUB MakeBackup ()
+DECLARE SUB RestoreBackup ()
+DECLARE SUB Box (Row1%, Col1%, Row2%, Col2%)
+DECLARE SUB NetWorthReport ()
+DECLARE SUB EditAccounts ()
+DECLARE SUB PrintHelpLine (help$)
+DECLARE SUB EditTrans (item%)
+DECLARE FUNCTION Cvdt$ (X#)
+DECLARE FUNCTION Cvst$ (X!)
+DECLARE FUNCTION Cvit$ (X%)
+DECLARE FUNCTION Menu% (CurrChoiceX%, MaxChoice%, choice$(), ItemRow%(), ItemCol%(), help$(), BarMode%)
+DECLARE FUNCTION GetString$ (row%, col%, start$, end$, Vis%, Max%)
+DECLARE FUNCTION Trim$ (X$)
+
+'Constants
+CONST TRUE = -1
+CONST FALSE = NOT TRUE
+
+'User-defined types
+TYPE AccountType
+ Title AS STRING * 20
+ AType AS STRING * 1
+ Desc AS STRING * 50
+END TYPE
+
+TYPE Recordtype
+ Date AS STRING * 8
+ Ref AS STRING * 10
+ Desc AS STRING * 50
+ Fig1 AS DOUBLE
+ Fig2 AS DOUBLE
+END TYPE
+
+'Global variables
+DIM SHARED account(1 TO 19) AS AccountType 'Stores the 19 account titles
+DIM SHARED ColorPref 'Color Preference
+DIM SHARED colors(0 TO 20, 1 TO 4) 'Different Colors
+DIM SHARED ScrollUpAsm(1 TO 7) 'Assembly Language Routines
+DIM SHARED ScrollDownAsm(1 TO 7)
+DIM SHARED PrintErr AS INTEGER 'Printer error flag
+
+ DEF SEG = 0 ' Turn off CapLock, NumLock and ScrollLock
+ KeyFlags = PEEK(1047)
+ POKE 1047, &H0
+ DEF SEG
+
+ 'Open money manager data file. If it does not exist in current directory,
+ ' goto error handler to create and initialize it.
+ ON ERROR GOTO ErrorTrap
+ OPEN "money.dat" FOR INPUT AS #1
+ CLOSE
+ ON ERROR GOTO 0 'Reset error handler
+
+ Initialize 'Initialize program
+ Intro 'Display introduction screen
+ MenuSystem 'This is the main program
+ COLOR 7, 0 'Clear screen and end
+ CLS
+
+ DEF SEG = 0 ' Restore CapLock, NumLock and ScrollLock states
+ POKE 1047, KeyFlags
+ DEF SEG
+
+ END
+
+' Error handler for program
+' If data file not found, create and initialize a new one.
+ErrorTrap:
+ SELECT CASE ERR
+ ' If data file not found, create and initialize a new one.
+ CASE 53
+ CLOSE
+ ColorPref = 1
+ FOR a = 1 TO 19
+ account(a).Title = ""
+ account(a).AType = ""
+ account(a).Desc = ""
+ NEXT a
+ SaveState
+ RESUME
+ CASE 24, 25
+ PrintErr = TRUE
+ Box 8, 13, 14, 69
+ Center 11, "Printer not responding ... Press Space to continue"
+ WHILE INKEY$ <> "": WEND
+ WHILE INKEY$ <> " ": WEND
+ RESUME NEXT
+ CASE ELSE
+ END SELECT
+ RESUME NEXT
+
+
+'The following data defines the color schemes available via the main menu.
+'
+' scrn dots bar back title shdow choice curs cursbk shdow
+DATA 0, 7, 15, 7, 0, 7, 0, 15, 0, 0
+DATA 1, 9, 12, 3, 0, 1, 15, 0, 7, 0
+DATA 3, 15, 13, 1, 14, 3, 15, 0, 7, 0
+DATA 7, 12, 15, 4, 14, 0, 15, 15, 1, 0
+
+'The following data is actually a machine language program to
+'scroll the screen up or down very fast using a BIOS call.
+DATA &HB8,&H01,&H06,&HB9,&H01,&H04,&HBA,&H4E,&H16,&HB7,&H00,&HCD,&H10,&HCB
+DATA &HB8,&H01,&H07,&HB9,&H01,&H04,&HBA,&H4E,&H16,&HB7,&H00,&HCD,&H10,&HCB
+
+'Box:
+' Draw a box on the screen between the given coordinates.
+SUB Box (Row1, Col1, Row2, Col2) STATIC
+
+ BoxWidth = Col2 - Col1 + 1
+
+ LOCATE Row1, Col1
+ PRINT "Ú"; STRING$(BoxWidth - 2, "Ä"); "¿";
+
+ FOR a = Row1 + 1 TO Row2 - 1
+ LOCATE a, Col1
+ PRINT "³"; SPACE$(BoxWidth - 2); "³";
+ NEXT a
+
+ LOCATE Row2, Col1
+ PRINT "À"; STRING$(BoxWidth - 2, "Ä"); "Ù";
+
+END SUB
+
+'Center:
+' Center text on the given row.
+SUB Center (row, text$)
+ LOCATE row, 41 - LEN(text$) / 2
+ PRINT text$;
+END SUB
+
+'Cvdt$:
+' Convert a double precision number to a string WITHOUT a leading space.
+FUNCTION Cvdt$ (X#)
+
+ Cvdt$ = RIGHT$(STR$(X#), LEN(STR$(X#)) - 1)
+
+END FUNCTION
+
+'Cvit$:
+' Convert an integer to a string WITHOUT a leading space.
+FUNCTION Cvit$ (X)
+ Cvit$ = RIGHT$(STR$(X), LEN(STR$(X)) - 1)
+END FUNCTION
+
+'Cvst$:
+' Convert a single precision number to a string WITHOUT a leading space
+FUNCTION Cvst$ (X!)
+ Cvst$ = RIGHT$(STR$(X!), LEN(STR$(X!)) - 1)
+END FUNCTION
+
+'EditAccounts:
+' This is the full-screen editor which allows you to change your account
+' titles and descriptions
+SUB EditAccounts
+
+ 'Information about each column
+ REDIM help$(4), col(4), Vis(4), Max(4), edit$(19, 3)
+
+ 'Draw the screen
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ Box 2, 1, 24, 80
+
+ COLOR colors(5, ColorPref), colors(4, ColorPref)
+ LOCATE 1, 1: PRINT SPACE$(80)
+ LOCATE 1, 4: PRINT "Account Editor";
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+
+ LOCATE 3, 2: PRINT "No³ Account Title ³ Description ³A/L"
+ LOCATE 4, 2: PRINT "ÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄ"
+ u$ = "##³\ \³\ \³ ! "
+ FOR a = 5 TO 23
+ LOCATE a, 2
+ X = a - 4
+ PRINT USING u$; X; account(X).Title; account(X).Desc; account(X).AType;
+ NEXT a
+
+ 'Initialize variables
+ help$(1) = " Account name | <F2=Save and Exit> <Escape=Abort>"
+ help$(2) = " Account description | <F2=Save and Exit> <Escape=Abort>"
+ help$(3) = " Account type (A = Asset, L = Liability) | <F2=Save and Exit> <Escape=Abort>"
+
+ col(1) = 5: col(2) = 26: col(3) = 78
+ Vis(1) = 20: Vis(2) = 50: Vis(3) = 1
+ Max(1) = 20: Max(2) = 50: Max(3) = 1
+
+ FOR a = 1 TO 19
+ edit$(a, 1) = account(a).Title
+ edit$(a, 2) = account(a).Desc
+ edit$(a, 3) = account(a).AType
+ NEXT a
+
+ finished = FALSE
+
+ CurrRow = 1
+ CurrCol = 1
+ PrintHelpLine help$(CurrCol)
+
+ 'Loop until F2 or <ESC> is pressed
+ DO
+ GOSUB EditAccountsShowCursor 'Show Cursor
+ DO 'Wait for key
+ Kbd$ = INKEY$
+ LOOP UNTIL Kbd$ <> ""
+
+ IF Kbd$ >= " " AND Kbd$ < "~" THEN 'If legal, edit item
+ GOSUB EditAccountsEditItem
+ END IF
+ GOSUB EditAccountsHideCursor 'Hide Cursor so it can move
+ 'If it needs to
+ SELECT CASE Kbd$
+ CASE CHR$(0) + "H" 'Up Arrow
+ CurrRow = (CurrRow + 17) MOD 19 + 1
+ CASE CHR$(0) + "P" 'Down Arrow
+ CurrRow = (CurrRow) MOD 19 + 1
+ CASE CHR$(0) + "K", CHR$(0) + CHR$(15) 'Left or Shift+Tab
+ CurrCol = (CurrCol + 1) MOD 3 + 1
+ PrintHelpLine help$(CurrCol)
+ CASE CHR$(0) + "M", CHR$(9) 'Right or Tab
+ CurrCol = (CurrCol) MOD 3 + 1
+ PrintHelpLine help$(CurrCol)
+ CASE CHR$(0) + "<" 'F2
+ finished = TRUE
+ Save = TRUE
+ CASE CHR$(27) 'Esc
+ finished = TRUE
+ Save = FALSE
+ CASE CHR$(13) 'Return
+ CASE ELSE
+ BEEP
+ END SELECT
+ LOOP UNTIL finished
+
+ IF Save THEN
+ GOSUB EditAccountsSaveData
+ END IF
+
+ EXIT SUB
+
+EditAccountsShowCursor:
+ COLOR colors(8, ColorPref), colors(9, ColorPref)
+ LOCATE CurrRow + 4, col(CurrCol)
+ PRINT LEFT$(edit$(CurrRow, CurrCol), Vis(CurrCol));
+ RETURN
+
+EditAccountsEditItem:
+ COLOR colors(8, ColorPref), colors(9, ColorPref)
+ ok = FALSE
+ start$ = Kbd$
+ DO
+ Kbd$ = GetString$(CurrRow + 4, col(CurrCol), start$, end$, Vis(CurrCol), Max(CurrCol))
+ edit$(CurrRow, CurrCol) = LEFT$(end$ + SPACE$(Max(CurrCol)), Max(CurrCol))
+ start$ = ""
+
+ IF CurrCol = 3 THEN
+ X$ = UCASE$(end$)
+ IF X$ = "A" OR X$ = "L" OR X$ = "" OR X$ = " " THEN
+ ok = TRUE
+ IF X$ = "" THEN X$ = " "
+ edit$(CurrRow, CurrCol) = X$
+ ELSE
+ BEEP
+ END IF
+ ELSE
+ ok = TRUE
+ END IF
+
+ LOOP UNTIL ok
+ RETURN
+
+EditAccountsHideCursor:
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ LOCATE CurrRow + 4, col(CurrCol)
+ PRINT LEFT$(edit$(CurrRow, CurrCol), Vis(CurrCol));
+ RETURN
+
+
+EditAccountsSaveData:
+ FOR a = 1 TO 19
+ account(a).Title = edit$(a, 1)
+ account(a).Desc = edit$(a, 2)
+ account(a).AType = edit$(a, 3)
+ NEXT a
+ SaveState
+ RETURN
+
+END SUB
+
+'EditTrans:
+' This is the full-screen editor which allows you to enter and change
+' transactions
+SUB EditTrans (item)
+
+ 'Stores info about each column
+ REDIM help$(6), col(6), Vis(6), Max(6), CurrString$(3), CurrFig#(5)
+ 'Array to keep the current balance at all the transactions
+ REDIM Balance#(1000)
+
+ 'Open random access file
+ file$ = "money." + Cvit$(item)
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 8 AS IoDate$, 10 AS IoRef$, 50 AS IoDesc$, 8 AS IoFig1$, 8 AS IoFig2$
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+
+ 'Initialize variables
+ CurrString$(1) = ""
+ CurrString$(2) = ""
+ CurrString$(3) = ""
+ CurrFig#(4) = 0
+ CurrFig#(5) = 0
+
+ GET #1, 1
+ IF valid$ <> "THISISVALID" THEN
+ LSET IoDate$ = ""
+ LSET IoRef$ = ""
+ LSET IoDesc$ = ""
+ LSET IoFig1$ = MKD$(0)
+ LSET IoFig2$ = MKD$(0)
+ PUT #1, 2
+ LSET valid$ = "THISISVALID"
+ LSET IoMaxRecord$ = "1"
+ LSET IoBalance$ = MKD$(0)
+ PUT #1, 1
+ END IF
+
+ MaxRecord = VAL(IoMaxRecord$)
+
+ Balance#(0) = 0
+ a = 1
+ WHILE a <= MaxRecord
+ GET #1, a + 1
+ Balance#(a) = Balance#(a - 1) + CVD(IoFig1$) - CVD(IoFig2$)
+ a = a + 1
+ WEND
+ GOSUB EditTransWriteBalance
+
+ help$(1) = "Date of transaction (mm/dd/yy) "
+ help$(2) = "Transaction reference number "
+ help$(3) = "Transaction description "
+ help$(4) = "Increase asset or debt value "
+ help$(5) = "Decrease asset or debt value "
+
+ col(1) = 2
+ col(2) = 11
+ col(3) = 18
+ col(4) = 44
+ col(5) = 55
+
+ Vis(1) = 8
+ Vis(2) = 6
+ Vis(3) = 25
+ Vis(4) = 10
+ Vis(5) = 10
+
+ Max(1) = 8
+ Max(2) = 6
+ Max(3) = 25
+ Max(4) = 10
+ Max(5) = 10
+
+
+ 'Draw Screen
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ Box 2, 1, 24, 80
+
+ COLOR colors(5, ColorPref), colors(4, ColorPref)
+ LOCATE 1, 1: PRINT SPACE$(80);
+ LOCATE 1, 4: PRINT "Transaction Editor: " + Trim$(account(item).Title);
+
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ LOCATE 3, 2: PRINT " Date ³ Ref# ³ Description ³ Increase ³ Decrease ³ Balance "
+ LOCATE 4, 2: PRINT "ÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÄÄ"
+
+ u$ = "\ \³\ \³\ \³"
+ u1$ = " ³ ³ ³ ³ ³ "
+ u1x$ = "ßßßßßßßß³ßßßßßß³ßßßßßßßßßßßßßßßßßßßßßßßßß³ßßßßßßßßßß³ßßßßßßßßßß³ßßßßßßßßßßßßßß"
+ u2$ = "###,###.##"
+ u3$ = "###,###,###.##"
+ u4$ = " "
+
+ CurrTopline = 1
+ GOSUB EditTransPrintWholeScreen
+
+ CurrRow = 1
+ CurrCol = 1
+ PrintHelpLine help$(CurrCol) + "| <F2=Save and Exit> <F9=Insert> <F10=Delete>"
+
+ GOSUB EditTransGetLine
+
+ finished = FALSE
+
+
+ 'Loop until <F2> is pressed
+ DO
+ GOSUB EditTransShowCursor 'Show Cursor, Wait for key
+ DO: Kbd$ = INKEY$: LOOP UNTIL Kbd$ <> ""
+ GOSUB EditTransHideCursor
+
+ IF Kbd$ >= " " AND Kbd$ < "~" OR Kbd$ = CHR$(8) THEN 'If legal key, edit item
+ GOSUB EditTransEditItem
+ END IF
+
+ SELECT CASE Kbd$ 'Handle Special keys
+ CASE CHR$(0) + "H" 'up arrow
+ GOSUB EditTransMoveUp
+ CASE CHR$(0) + "P" 'Down arrow
+ GOSUB EditTransMoveDown
+ CASE CHR$(0) + "K", CHR$(0) + CHR$(15) 'Left Arrow,BackTab
+ CurrCol = (CurrCol + 3) MOD 5 + 1
+ PrintHelpLine help$(CurrCol) + "| <F2=Save and Exit> <F9=Insert> <F10=Delete>"
+ CASE CHR$(0) + "M", CHR$(9) 'Right Arrow,Tab
+ CurrCol = (CurrCol) MOD 5 + 1
+ PrintHelpLine help$(CurrCol) + "| <F2=Save and Exit> <F9=Insert> <F10=Delete>"
+ CASE CHR$(0) + "G" 'Home
+ CurrCol = 1
+ CASE CHR$(0) + "O" 'End
+ CurrCol = 5
+ CASE CHR$(0) + "I" 'Page Up
+ CurrRow = 1
+ CurrTopline = CurrTopline - 19
+ IF CurrTopline < 1 THEN
+ CurrTopline = 1
+ END IF
+ GOSUB EditTransPrintWholeScreen
+ GOSUB EditTransGetLine
+ CASE CHR$(0) + "Q" 'Page Down
+ CurrRow = 1
+ CurrTopline = CurrTopline + 19
+ IF CurrTopline > MaxRecord THEN
+ CurrTopline = MaxRecord
+ END IF
+ GOSUB EditTransPrintWholeScreen
+ GOSUB EditTransGetLine
+ CASE CHR$(0) + "<" 'F2
+ finished = TRUE
+ CASE CHR$(0) + "C" 'F9
+ GOSUB EditTransAddRecord
+ CASE CHR$(0) + "D" 'F10
+ GOSUB EditTransDeleteRecord
+ CASE CHR$(13) 'Enter
+ CASE ELSE
+ BEEP
+ END SELECT
+ LOOP UNTIL finished
+
+ CLOSE
+
+ EXIT SUB
+
+
+EditTransShowCursor:
+ COLOR colors(8, ColorPref), colors(9, ColorPref)
+ LOCATE CurrRow + 4, col(CurrCol)
+ SELECT CASE CurrCol
+ CASE 1, 2, 3
+ PRINT LEFT$(CurrString$(CurrCol), Vis(CurrCol));
+ CASE 4
+ IF CurrFig#(4) <> 0 THEN
+ PRINT USING u2$; CurrFig#(4);
+ ELSE
+ PRINT SPACE$(Vis(CurrCol));
+ END IF
+ CASE 5
+ IF CurrFig#(5) <> 0 THEN
+ PRINT USING u2$; CurrFig#(5);
+ ELSE
+ PRINT SPACE$(Vis(CurrCol));
+ END IF
+ END SELECT
+ RETURN
+
+
+EditTransHideCursor:
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ LOCATE CurrRow + 4, col(CurrCol)
+ SELECT CASE CurrCol
+ CASE 1, 2, 3
+ PRINT LEFT$(CurrString$(CurrCol), Vis(CurrCol));
+ CASE 4
+ IF CurrFig#(4) <> 0 THEN
+ PRINT USING u2$; CurrFig#(4);
+ ELSE
+ PRINT SPACE$(Vis(CurrCol));
+ END IF
+ CASE 5
+ IF CurrFig#(5) <> 0 THEN
+ PRINT USING u2$; CurrFig#(5);
+ ELSE
+ PRINT SPACE$(Vis(CurrCol));
+ END IF
+ END SELECT
+ RETURN
+
+
+EditTransEditItem:
+
+ CurrRecord = CurrTopline + CurrRow - 1
+ COLOR colors(8, ColorPref), colors(9, ColorPref)
+
+ SELECT CASE CurrCol
+ CASE 1, 2, 3
+ Kbd$ = GetString$(CurrRow + 4, col(CurrCol), Kbd$, new$, Vis(CurrCol), Max(CurrCol))
+ CurrString$(CurrCol) = new$
+ GOSUB EditTransPutLine
+ GOSUB EditTransGetLine
+ CASE 4
+ start$ = Kbd$
+ DO
+ Kbd$ = GetString$(CurrRow + 4, col(4), start$, new$, Vis(4), Max(4))
+ new4# = VAL(new$)
+ start$ = ""
+ LOOP WHILE new4# >= 999999.99# OR new4# < 0
+
+ a = CurrRecord
+ WHILE a <= MaxRecord
+ Balance#(a) = Balance#(a) + new4# - CurrFig#(4) + CurrFig#(5)
+ a = a + 1
+ WEND
+ CurrFig#(4) = new4#
+ CurrFig#(5) = 0
+ GOSUB EditTransPutLine
+ GOSUB EditTransGetLine
+ GOSUB EditTransPrintBalances
+ GOSUB EditTransWriteBalance
+ CASE 5
+ start$ = Kbd$
+ DO
+ Kbd$ = GetString$(CurrRow + 4, col(5), start$, new$, Vis(5), Max(5))
+ new5# = VAL(new$)
+ start$ = ""
+ LOOP WHILE new5# >= 999999.99# OR new5# < 0
+
+ a = CurrRecord
+ WHILE a <= MaxRecord
+ Balance#(a) = Balance#(a) - new5# + CurrFig#(5) - CurrFig#(4)
+ a = a + 1
+ WEND
+ CurrFig#(4) = 0
+ CurrFig#(5) = new5#
+ GOSUB EditTransPutLine
+ GOSUB EditTransGetLine
+ GOSUB EditTransPrintBalances
+ GOSUB EditTransWriteBalance
+ CASE ELSE
+ END SELECT
+ GOSUB EditTransPrintLine
+ RETURN
+
+EditTransMoveUp:
+ IF CurrRow = 1 THEN
+ IF CurrTopline = 1 THEN
+ BEEP
+ ELSE
+ ScrollDown
+ CurrTopline = CurrTopline - 1
+ GOSUB EditTransGetLine
+ GOSUB EditTransPrintLine
+ END IF
+ ELSE
+ CurrRow = CurrRow - 1
+ GOSUB EditTransGetLine
+ END IF
+ RETURN
+
+EditTransMoveDown:
+ IF (CurrRow + CurrTopline - 1) >= MaxRecord THEN
+ BEEP
+ ELSE
+ IF CurrRow = 19 THEN
+ ScrollUp
+ CurrTopline = CurrTopline + 1
+ GOSUB EditTransGetLine
+ GOSUB EditTransPrintLine
+ ELSE
+ CurrRow = CurrRow + 1
+ GOSUB EditTransGetLine
+ END IF
+ END IF
+ RETURN
+
+EditTransPrintLine:
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ CurrRecord = CurrTopline + CurrRow - 1
+ LOCATE CurrRow + 4, 2
+ IF CurrRecord = MaxRecord + 1 THEN
+ PRINT u1x$;
+ ELSEIF CurrRecord > MaxRecord THEN
+ PRINT u1$;
+ ELSE
+ PRINT USING u$; CurrString$(1); CurrString$(2); CurrString$(3);
+ IF CurrFig#(4) = 0 AND CurrFig#(5) = 0 THEN
+ PRINT USING u4$ + "³" + u4$ + "³" + u3$; Balance#(CurrRecord)
+ ELSEIF CurrFig#(5) = 0 THEN
+ PRINT USING u2$ + "³" + u4$ + "³" + u3$; CurrFig#(4); Balance#(CurrRecord)
+ ELSE
+ PRINT USING u4$ + "³" + u2$ + "³" + u3$; CurrFig#(5); Balance#(CurrRecord)
+ END IF
+ END IF
+ RETURN
+
+EditTransPrintBalances:
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ FOR a = 1 TO 19
+ CurrRecord = CurrTopline + a - 1
+ IF CurrRecord <= MaxRecord THEN
+ LOCATE 4 + a, 66
+ PRINT USING u3$; Balance#(CurrTopline + a - 1);
+ END IF
+ NEXT a
+ RETURN
+
+EditTransDeleteRecord:
+ IF MaxRecord = 1 THEN
+ BEEP
+ ELSE
+ CurrRecord = CurrTopline + CurrRow - 1
+ MaxRecord = MaxRecord - 1
+ a = CurrRecord
+ WHILE a <= MaxRecord
+ GET #1, a + 2
+ PUT #1, a + 1
+ Balance#(a) = Balance#(a + 1) - CurrFig#(4) + CurrFig#(5)
+ a = a + 1
+ WEND
+
+ LSET valid$ = "THISISVALID"
+ LSET IoMaxRecord$ = Cvit$(MaxRecord)
+ PUT #1, 1
+ GOSUB EditTransPrintWholeScreen
+ CurrRecord = CurrTopline + CurrRow - 1
+ IF CurrRecord > MaxRecord THEN
+ GOSUB EditTransMoveUp
+ END IF
+ GOSUB EditTransGetLine
+ GOSUB EditTransWriteBalance
+ END IF
+ RETURN
+
+EditTransAddRecord:
+ CurrRecord = CurrTopline + CurrRow - 1
+ a = MaxRecord
+ WHILE a > CurrRecord
+ GET #1, a + 1
+ PUT #1, a + 2
+ Balance#(a + 1) = Balance#(a)
+ a = a - 1
+ WEND
+ Balance#(CurrRecord + 1) = Balance#(CurrRecord)
+ MaxRecord = MaxRecord + 1
+ LSET IoDate$ = ""
+ LSET IoRef$ = ""
+ LSET IoDesc$ = ""
+ LSET IoFig1$ = MKD$(0)
+ LSET IoFig2$ = MKD$(0)
+ PUT #1, CurrRecord + 2
+
+ LSET valid$ = "THISISVALID"
+ LSET IoMaxRecord$ = Cvit$(MaxRecord)
+ PUT #1, 1
+ GOSUB EditTransPrintWholeScreen
+ GOSUB EditTransGetLine
+ RETURN
+
+EditTransPrintWholeScreen:
+ temp = CurrRow
+ FOR CurrRow = 1 TO 19
+ CurrRecord = CurrTopline + CurrRow - 1
+ IF CurrRecord <= MaxRecord THEN
+ GOSUB EditTransGetLine
+ END IF
+ GOSUB EditTransPrintLine
+ NEXT CurrRow
+ CurrRow = temp
+ RETURN
+
+EditTransWriteBalance:
+ GET #1, 1
+ LSET IoBalance$ = MKD$(Balance#(MaxRecord))
+ PUT #1, 1
+ RETURN
+
+EditTransPutLine:
+ CurrRecord = CurrTopline + CurrRow - 1
+ LSET IoDate$ = CurrString$(1)
+ LSET IoRef$ = CurrString$(2)
+ LSET IoDesc$ = CurrString$(3)
+ LSET IoFig1$ = MKD$(CurrFig#(4))
+ LSET IoFig2$ = MKD$(CurrFig#(5))
+ PUT #1, CurrRecord + 1
+ RETURN
+
+EditTransGetLine:
+ CurrRecord = CurrTopline + CurrRow - 1
+ GET #1, CurrRecord + 1
+ CurrString$(1) = IoDate$
+ CurrString$(2) = IoRef$
+ CurrString$(3) = IoDesc$
+ CurrFig#(4) = CVD(IoFig1$)
+ CurrFig#(5) = CVD(IoFig2$)
+ RETURN
+END SUB
+
+'FancyCls:
+' Clears screen in the right color, and draws nice dots.
+SUB FancyCls (dots, Background)
+
+ VIEW PRINT 2 TO 24
+ COLOR dots, Background
+ CLS 2
+
+ FOR a = 95 TO 1820 STEP 45
+ row = a / 80 + 1
+ col = a MOD 80 + 1
+ LOCATE row, col
+ PRINT CHR$(250);
+ NEXT a
+
+ VIEW PRINT
+
+END SUB
+
+'GetString$:
+' Given a row and col, and an initial string, edit a string
+' VIS is the length of the visible field of entry
+' MAX is the maximum number of characters allowed in the string
+FUNCTION GetString$ (row, col, start$, end$, Vis, Max)
+ curr$ = Trim$(LEFT$(start$, Max))
+ IF curr$ = CHR$(8) THEN curr$ = ""
+
+ LOCATE , , 1
+
+ finished = FALSE
+ DO
+ GOSUB GetStringShowText
+ GOSUB GetStringGetKey
+
+ IF LEN(Kbd$) > 1 THEN
+ finished = TRUE
+ GetString$ = Kbd$
+ ELSE
+ SELECT CASE Kbd$
+ CASE CHR$(13), CHR$(27), CHR$(9)
+ finished = TRUE
+ GetString$ = Kbd$
+
+ CASE CHR$(8)
+ IF curr$ <> "" THEN
+ curr$ = LEFT$(curr$, LEN(curr$) - 1)
+ END IF
+
+ CASE " " TO "}"
+ IF LEN(curr$) < Max THEN
+ curr$ = curr$ + Kbd$
+ ELSE
+ BEEP
+ END IF
+
+ CASE ELSE
+ BEEP
+ END SELECT
+ END IF
+
+ LOOP UNTIL finished
+
+ end$ = curr$
+ LOCATE , , 0
+ EXIT FUNCTION
+
+
+GetStringShowText:
+ LOCATE row, col
+ IF LEN(curr$) > Vis THEN
+ PRINT RIGHT$(curr$, Vis);
+ ELSE
+ PRINT curr$; SPACE$(Vis - LEN(curr$));
+ LOCATE row, col + LEN(curr$)
+ END IF
+ RETURN
+
+GetStringGetKey:
+ Kbd$ = ""
+ WHILE Kbd$ = ""
+ Kbd$ = INKEY$
+ WEND
+ RETURN
+END FUNCTION
+
+'Initialize:
+' Read colors in and set up assembly routines
+SUB Initialize
+
+ WIDTH , 25
+ VIEW PRINT
+
+ FOR ColorSet = 1 TO 4
+ FOR X = 1 TO 10
+ READ colors(X, ColorSet)
+ NEXT X
+ NEXT ColorSet
+
+ LoadState
+
+ P = VARPTR(ScrollUpAsm(1))
+ DEF SEG = VARSEG(ScrollUpAsm(1))
+ FOR I = 0 TO 13
+ READ J
+ POKE (P + I), J
+ NEXT I
+
+ P = VARPTR(ScrollDownAsm(1))
+ DEF SEG = VARSEG(ScrollDownAsm(1))
+ FOR I = 0 TO 13
+ READ J
+ POKE (P + I), J
+ NEXT I
+
+ DEF SEG
+
+END SUB
+
+'Intro:
+' Display introduction screen.
+SUB Intro
+ SCREEN 0
+ WIDTH 80, 25
+ COLOR 7, 0
+ CLS
+
+ Center 4, "Q B a s i c"
+ COLOR 15
+ Center 5, "Ü Ü ÜÜÜÜ Ü Ü ÜÜÜÜ Ü Ü Ü Ü ÜÜÜÜ Ü Ü ÜÜÜÜ ÜÜÜÜÜ ÜÜÜÜ ÜÜÜÜÜ"
+ Center 6, "ÛßÜ ÜßÛ Û Û ÛÜ Û Û ÛÜÜÜÛ ÛßÜ ÜßÛ Û Û ÛÜ Û Û Û Û Û Û Û"
+ Center 7, "Û ß Û Û Û Û ßÜÛ Ûßßß Û Û ß Û ÛßßÛ Û ßÜÛ ÛßßÛ Û ßßÛ Ûßßß ÛßÛßß"
+ Center 8, "Û Û ÛÜÜÛ Û Û ÛÜÜÜ Û Û Û Û Û Û Û Û Û ÛÜÜÜÛ ÛÜÜÜ Û ßÜ"
+ COLOR 7
+ Center 11, "A Personal Finance Manager written in"
+ Center 12, "MS-DOS QBasic"
+ Center 24, "Press any key to continue"
+
+ SparklePause
+END SUB
+
+'LCenter:
+' Center TEXT$ on the line printer
+SUB LCenter (text$)
+ LPRINT TAB(41 - LEN(text$) / 2); text$
+END SUB
+
+'LoadState:
+' Load color preferences and account info from MONEY.DAT
+SUB LoadState
+
+ OPEN "money.dat" FOR INPUT AS #1
+ INPUT #1, ColorPref
+
+ FOR a = 1 TO 19
+ LINE INPUT #1, account(a).Title
+ LINE INPUT #1, account(a).AType
+ LINE INPUT #1, account(a).Desc
+ NEXT a
+
+ CLOSE
+
+END SUB
+
+'Menu:
+' Handles Menu Selection for a single menu (either sub menu, or menu bar)
+' currChoiceX : Number of current choice
+' maxChoice : Number of choices in the list
+' choice$() : Array with the text of the choices
+' itemRow() : Array with the row of the choices
+' itemCol() : Array with the col of the choices
+' help$() : Array with the help text for each choice
+' barMode : Boolean: TRUE = menu bar style, FALSE = drop down style
+'
+' Returns the number of the choice that was made by changing currChoiceX
+' and returns the scan code of the key that was pressed to exit
+'
+FUNCTION Menu (CurrChoiceX, MaxChoice, choice$(), ItemRow(), ItemCol(), help$(), BarMode)
+
+ currChoice = CurrChoiceX
+
+ 'if in bar mode, color in menu bar, else color box/shadow
+ 'bar mode means you are currently in the menu bar, not a sub menu
+ IF BarMode THEN
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ LOCATE 1, 1
+ PRINT SPACE$(80);
+ ELSE
+ FancyCls colors(2, ColorPref), colors(1, ColorPref)
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ Box ItemRow(1) - 1, ItemCol(1) - 1, ItemRow(MaxChoice) + 1, ItemCol(1) + LEN(choice$(1)) + 1
+
+ COLOR colors(10, ColorPref), colors(6, ColorPref)
+ FOR a = 1 TO MaxChoice + 1
+ LOCATE ItemRow(1) + a - 1, ItemCol(1) + LEN(choice$(1)) + 2
+ PRINT CHR$(178); CHR$(178);
+ NEXT a
+ LOCATE ItemRow(MaxChoice) + 2, ItemCol(MaxChoice) + 2
+ PRINT STRING$(LEN(choice$(MaxChoice)) + 2, 178);
+ END IF
+
+ 'print the choices
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ FOR a = 1 TO MaxChoice
+ LOCATE ItemRow(a), ItemCol(a)
+ PRINT choice$(a);
+ NEXT a
+
+ finished = FALSE
+
+ WHILE NOT finished
+
+ GOSUB MenuShowCursor
+ GOSUB MenuGetKey
+ GOSUB MenuHideCursor
+
+ SELECT CASE Kbd$
+ CASE CHR$(0) + "H": GOSUB MenuUp
+ CASE CHR$(0) + "P": GOSUB MenuDown
+ CASE CHR$(0) + "K": GOSUB MenuLeft
+ CASE CHR$(0) + "M": GOSUB MenuRight
+ CASE CHR$(13): GOSUB MenuEnter
+ CASE CHR$(27): GOSUB MenuEscape
+ CASE ELSE: BEEP
+ END SELECT
+ WEND
+
+ Menu = currChoice
+
+ EXIT FUNCTION
+
+
+MenuEnter:
+ finished = TRUE
+ RETURN
+
+MenuEscape:
+ currChoice = 0
+ finished = TRUE
+ RETURN
+
+MenuUp:
+ IF BarMode THEN
+ BEEP
+ ELSE
+ currChoice = (currChoice + MaxChoice - 2) MOD MaxChoice + 1
+ END IF
+ RETURN
+
+MenuLeft:
+ IF BarMode THEN
+ currChoice = (currChoice + MaxChoice - 2) MOD MaxChoice + 1
+ ELSE
+ currChoice = -2
+ finished = TRUE
+ END IF
+ RETURN
+
+MenuRight:
+ IF BarMode THEN
+ currChoice = (currChoice) MOD MaxChoice + 1
+ ELSE
+ currChoice = -3
+ finished = TRUE
+ END IF
+ RETURN
+
+MenuDown:
+ IF BarMode THEN
+ finished = TRUE
+ ELSE
+ currChoice = (currChoice) MOD MaxChoice + 1
+ END IF
+ RETURN
+
+MenuShowCursor:
+ COLOR colors(8, ColorPref), colors(9, ColorPref)
+ LOCATE ItemRow(currChoice), ItemCol(currChoice)
+ PRINT choice$(currChoice);
+ PrintHelpLine help$(currChoice)
+ RETURN
+
+MenuGetKey:
+ Kbd$ = ""
+ WHILE Kbd$ = ""
+ Kbd$ = INKEY$
+ WEND
+ RETURN
+
+MenuHideCursor:
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ LOCATE ItemRow(currChoice), ItemCol(currChoice)
+ PRINT choice$(currChoice);
+ RETURN
+
+
+END FUNCTION
+
+'MenuSystem:
+' Main routine that controls the program. Uses the MENU function
+' to implement menu system and calls the appropriate function to handle
+' the user's selection
+SUB MenuSystem
+
+ DIM choice$(20), menuRow(20), menuCol(20), help$(20)
+ LOCATE , , 0
+ choice = 1
+ finished = FALSE
+
+ WHILE NOT finished
+ GOSUB MenuSystemMain
+
+ subchoice = -1
+ WHILE subchoice < 0
+ SELECT CASE choice
+ CASE 1: GOSUB MenuSystemFile
+ CASE 2: GOSUB MenuSystemEdit
+ CASE 3: GOSUB MenuSystemAccount
+ CASE 4: GOSUB MenuSystemReport
+ CASE 5: GOSUB MenuSystemColors
+ END SELECT
+ FancyCls colors(2, ColorPref), colors(1, ColorPref)
+
+ SELECT CASE subchoice
+ CASE -2: choice = (choice + 3) MOD 5 + 1
+ CASE -3: choice = (choice) MOD 5 + 1
+ END SELECT
+ WEND
+ WEND
+ EXIT SUB
+
+
+MenuSystemMain:
+ FancyCls colors(2, ColorPref), colors(1, ColorPref)
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ Box 9, 19, 14, 61
+ Center 11, "Use arrow keys to navigate menu system"
+ Center 12, "Press Enter to select a menu item"
+
+ choice$(1) = " File "
+ choice$(2) = " Accounts "
+ choice$(3) = " Transactions "
+ choice$(4) = " Reports "
+ choice$(5) = " Colors "
+
+ menuRow(1) = 1: menuCol(1) = 2
+ menuRow(2) = 1: menuCol(2) = 8
+ menuRow(3) = 1: menuCol(3) = 18
+ menuRow(4) = 1: menuCol(4) = 32
+ menuRow(5) = 1: menuCol(5) = 41
+
+ help$(1) = "Exit the Money Manager"
+ help$(2) = "Add/edit/delete accounts"
+ help$(3) = "Add/edit/delete account transactions"
+ help$(4) = "View and print reports"
+ help$(5) = "Set screen colors"
+
+ DO
+ NewChoice = Menu((choice), 5, choice$(), menuRow(), menuCol(), help$(), TRUE)
+ LOOP WHILE NewChoice = 0
+ choice = NewChoice
+ RETURN
+
+MenuSystemFile:
+ choice$(1) = " Exit "
+
+ menuRow(1) = 3: menuCol(1) = 2
+
+ help$(1) = "Exit the Money Manager"
+
+ subchoice = Menu(1, 1, choice$(), menuRow(), menuCol(), help$(), FALSE)
+
+ SELECT CASE subchoice
+ CASE 1: finished = TRUE
+ CASE ELSE
+ END SELECT
+ RETURN
+
+
+MenuSystemEdit:
+ choice$(1) = " Edit Account Titles "
+
+ menuRow(1) = 3: menuCol(1) = 8
+
+ help$(1) = "Add/edit/delete accounts"
+
+ subchoice = Menu(1, 1, choice$(), menuRow(), menuCol(), help$(), FALSE)
+
+ SELECT CASE subchoice
+ CASE 1: EditAccounts
+ CASE ELSE
+ END SELECT
+ RETURN
+
+
+MenuSystemAccount:
+
+ FOR a = 1 TO 19
+ IF Trim$(account(a).Title) = "" THEN
+ choice$(a) = RIGHT$(STR$(a), 2) + ". ------------------- "
+ ELSE
+ choice$(a) = RIGHT$(STR$(a), 2) + ". " + account(a).Title
+ END IF
+ menuRow(a) = a + 2
+ menuCol(a) = 19
+ help$(a) = RTRIM$(account(a).Desc)
+ NEXT a
+
+ subchoice = Menu(1, 19, choice$(), menuRow(), menuCol(), help$(), FALSE)
+
+ IF subchoice > 0 THEN
+ EditTrans (subchoice)
+ END IF
+ RETURN
+
+
+MenuSystemReport:
+ choice$(1) = " Net Worth Report "
+ menuRow(1) = 3: menuCol(1) = 32
+ help$(1) = "View and print net worth report"
+
+ FOR a = 1 TO 19
+ IF Trim$(account(a).Title) = "" THEN
+ choice$(a + 1) = RIGHT$(STR$(a), 2) + ". ------------------- "
+ ELSE
+ choice$(a + 1) = RIGHT$(STR$(a), 2) + ". " + account(a).Title
+ END IF
+ menuRow(a + 1) = a + 3
+ menuCol(a + 1) = 32
+ help$(a + 1) = "Print " + RTRIM$(account(a).Title) + " transaction summary"
+ NEXT a
+
+ subchoice = Menu(1, 20, choice$(), menuRow(), menuCol(), help$(), FALSE)
+
+ SELECT CASE subchoice
+ CASE 1
+ NetWorthReport
+ CASE 2 TO 20
+ TransactionSummary (subchoice - 1)
+ CASE ELSE
+ END SELECT
+ RETURN
+
+MenuSystemColors:
+ choice$(1) = " Monochrome Scheme "
+ choice$(2) = " Cyan/Blue Scheme "
+ choice$(3) = " Blue/Cyan Scheme "
+ choice$(4) = " Red/Grey Scheme "
+
+ menuRow(1) = 3: menuCol(1) = 41
+ menuRow(2) = 4: menuCol(2) = 41
+ menuRow(3) = 5: menuCol(3) = 41
+ menuRow(4) = 6: menuCol(4) = 41
+
+ help$(1) = "Color scheme for monochrome and LCD displays"
+ help$(2) = "Color scheme featuring cyan"
+ help$(3) = "Color scheme featuring blue"
+ help$(4) = "Color scheme featuring red"
+
+ subchoice = Menu(1, 4, choice$(), menuRow(), menuCol(), help$(), FALSE)
+
+ SELECT CASE subchoice
+ CASE 1 TO 4
+ ColorPref = subchoice
+ SaveState
+ CASE ELSE
+ END SELECT
+ RETURN
+
+
+END SUB
+
+'NetWorthReport:
+' Prints net worth report to screen and printer
+SUB NetWorthReport
+ DIM assetIndex(19), liabilityIndex(19)
+
+ maxAsset = 0
+ maxLiability = 0
+
+ FOR a = 1 TO 19
+ IF account(a).AType = "A" THEN
+ maxAsset = maxAsset + 1
+ assetIndex(maxAsset) = a
+ ELSEIF account(a).AType = "L" THEN
+ maxLiability = maxLiability + 1
+ liabilityIndex(maxLiability) = a
+ END IF
+ NEXT a
+
+ 'Loop until <F2> is pressed
+ finished = FALSE
+ DO
+ u1$ = "\ \$$###,###,###.##"
+ u2$ = "\ \+$$#,###,###,###.##"
+
+ COLOR colors(5, ColorPref), colors(4, ColorPref)
+ LOCATE 1, 1: PRINT SPACE$(80);
+ LOCATE 1, 4: PRINT "Net Worth Report: " + DATE$;
+ PrintHelpLine "<F2=Exit> <F3=Print Report>"
+
+ COLOR colors(7, ColorPref), colors(4, ColorPref)
+ Box 2, 1, 24, 40
+ Box 2, 41, 24, 80
+
+ LOCATE 2, 16: PRINT " ASSETS "
+ assetTotal# = 0
+ a = 1
+ count1 = 1
+ WHILE a <= maxAsset
+ file$ = "money." + Cvit$(assetIndex(a))
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+ GET #1, 1
+ IF valid$ = "THISISVALID" THEN
+ LOCATE 2 + count1, 3: PRINT USING u1$; account(assetIndex(a)).Title; CVD(IoBalance$)
+ assetTotal# = assetTotal# + CVD(IoBalance$)
+ count1 = count1 + 1
+ END IF
+ CLOSE
+ a = a + 1
+ WEND
+
+ LOCATE 2, 55: PRINT " LIABILITIES "
+ liabilityTotal# = 0
+ a = 1
+ count2 = 1
+ WHILE a <= maxLiability
+ file$ = "money." + Cvit$(liabilityIndex(a))
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+ GET #1, 1
+ IF valid$ = "THISISVALID" THEN
+ LOCATE 2 + count2, 43: PRINT USING u1$; account(liabilityIndex(a)).Title; CVD(IoBalance$)
+ liabilityTotal# = liabilityTotal# + CVD(IoBalance$)
+ count2 = count2 + 1
+ END IF
+ CLOSE
+ a = a + 1
+ WEND
+ IF count2 > count1 THEN count1 = count2
+ LOCATE 2 + count1, 25: PRINT "--------------"
+ LOCATE 2 + count1, 65: PRINT "--------------"
+ LOCATE 3 + count1, 3: PRINT USING u2$; "Total assets"; assetTotal#;
+ LOCATE 3 + count1, 43: PRINT USING u2$; "Total liabilities"; liabilityTotal#
+
+ COLOR colors(5, ColorPref), colors(4, ColorPref)
+ LOCATE 1, 43: PRINT USING u2$; " NET WORTH:"; assetTotal# - liabilityTotal#
+
+ DO: Kbd$ = INKEY$: LOOP UNTIL Kbd$ <> ""
+
+ SELECT CASE Kbd$ 'Handle Special keys
+ CASE CHR$(0) + "<" 'F2
+ finished = TRUE
+ CASE CHR$(0) + "=" 'F3
+ GOSUB NetWorthReportPrint
+ CASE ELSE
+ BEEP
+ END SELECT
+ LOOP UNTIL finished
+ EXIT SUB
+
+NetWorthReportPrint:
+ PrintHelpLine ""
+
+ Box 8, 20, 14, 62
+ Center 10, "Prepare printer on LPT1 for report"
+ Center 12, "Hit <Enter> to print, or <Esc> to abort"
+
+ DO: Kbd$ = INKEY$: LOOP WHILE Kbd$ <> CHR$(13) AND Kbd$ <> CHR$(27)
+
+ IF Kbd$ = CHR$(13) THEN
+ Box 8, 20, 14, 62
+ Center 11, "Printing report..."
+ u0$ = " \ \ "
+ u1$ = " \ \ $$###,###,###.##"
+ u2$ = " --------------"
+ u3$ = " ============="
+ u4$ = " \ \+$$#,###,###,###.##"
+ PrintErr = FALSE
+ ON ERROR GOTO ErrorTrap ' test if printer is connected
+ LPRINT
+ IF PrintErr = FALSE THEN
+ LPRINT : LPRINT : LPRINT : LPRINT : LPRINT
+ LCenter "Q B a s i c"
+ LCenter "M O N E Y M A N A G E R"
+ LPRINT : LPRINT
+ LCenter "NET WORTH REPORT: " + DATE$
+ LCenter "-------------------------------------------"
+ LPRINT USING u0$; "ASSETS:"
+ assetTotal# = 0
+ a = 1
+ WHILE a <= maxAsset
+ file$ = "money." + Cvit$(assetIndex(a))
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+ GET #1, 1
+ IF valid$ = "THISISVALID" THEN
+ LPRINT USING u1$; account(assetIndex(a)).Title; CVD(IoBalance$)
+ assetTotal# = assetTotal# + CVD(IoBalance$)
+ END IF
+ CLOSE #1
+ a = a + 1
+ WEND
+ LPRINT u2$
+ LPRINT USING u4$; "Total assets"; assetTotal#
+ LPRINT
+ LPRINT
+ LPRINT USING u0$; "LIABILITIES:"
+ liabilityTotal# = 0
+ a = 1
+ WHILE a <= maxLiability
+ file$ = "money." + Cvit$(liabilityIndex(a))
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+ GET #1, 1
+ IF valid$ = "THISISVALID" THEN
+ LPRINT USING u1$; account(liabilityIndex(a)).Title; CVD(IoBalance$)
+ liabilityTotal# = liabilityTotal# + CVD(IoBalance$)
+ END IF
+ CLOSE #1
+ a = a + 1
+ WEND
+ LPRINT u2$
+ LPRINT USING u4$; "Total liabilities"; liabilityTotal#
+ LPRINT
+
+ LPRINT
+ LPRINT u3$
+ LPRINT USING u4$; "NET WORTH"; assetTotal# - liabilityTotal#
+ LCenter "-------------------------------------------"
+ LPRINT : LPRINT : LPRINT
+ END IF
+ ON ERROR GOTO 0
+ END IF
+ RETURN
+END SUB
+
+'PrintHelpLine:
+' Prints help text on the bottom row in the proper color
+SUB PrintHelpLine (help$)
+ COLOR colors(5, ColorPref), colors(4, ColorPref)
+ LOCATE 25, 1
+ PRINT SPACE$(80);
+ Center 25, help$
+END SUB
+
+'SaveState:
+' Save color preference and account information to "MONEY.DAT" data file.
+SUB SaveState
+ OPEN "money.dat" FOR OUTPUT AS #2
+ PRINT #2, ColorPref
+
+ FOR a = 1 TO 19
+ PRINT #2, account(a).Title
+ PRINT #2, account(a).AType
+ PRINT #2, account(a).Desc
+ NEXT a
+
+ CLOSE #2
+END SUB
+
+'ScrollDown:
+' Call the assembly program to scroll the screen down
+SUB ScrollDown
+ DEF SEG = VARSEG(ScrollDownAsm(1))
+ CALL Absolute(VARPTR(ScrollDownAsm(1)))
+ DEF SEG
+END SUB
+
+'ScrollUp:
+' Calls the assembly program to scroll the screen up
+SUB ScrollUp
+ DEF SEG = VARSEG(ScrollUpAsm(1))
+ CALL Absolute(VARPTR(ScrollUpAsm(1)))
+ DEF SEG
+END SUB
+
+'SparklePause:
+' Creates flashing border for intro screen
+SUB SparklePause
+
+ COLOR 4, 0
+ a$ = "* * * * * * * * * * * * * * * * * "
+ WHILE INKEY$ <> "": WEND 'Clear keyboard buffer
+
+ WHILE INKEY$ = ""
+ FOR a = 1 TO 5
+ LOCATE 1, 1 'print horizontal sparkles
+ PRINT MID$(a$, a, 80);
+ LOCATE 22, 1
+ PRINT MID$(a$, 6 - a, 80);
+
+ FOR b = 2 TO 21 'Print Vertical sparkles
+ c = (a + b) MOD 5
+ IF c = 1 THEN
+ LOCATE b, 80
+ PRINT "*";
+ LOCATE 23 - b, 1
+ PRINT "*";
+ ELSE
+ LOCATE b, 80
+ PRINT " ";
+ LOCATE 23 - b, 1
+ PRINT " ";
+ END IF
+ NEXT b
+ NEXT a
+ WEND
+END SUB
+
+'TransactionSummary:
+' Print transaction summary to line printer
+SUB TransactionSummary (item)
+ FancyCls colors(2, ColorPref), colors(1, ColorPref)
+ PrintHelpLine ""
+ Box 8, 20, 14, 62
+ Center 10, "Prepare printer on LPT1 for report"
+ Center 12, "Hit <Enter> to print, or <Esc> to abort"
+
+ DO: Kbd$ = INKEY$: LOOP WHILE Kbd$ <> CHR$(13) AND Kbd$ <> CHR$(27)
+
+ IF Kbd$ = CHR$(13) THEN
+ Box 8, 20, 14, 62
+ Center 11, "Printing report..."
+ PrintErr = FALSE
+ ON ERROR GOTO ErrorTrap ' test if printer is connected
+ LPRINT
+ IF PrintErr = FALSE THEN
+ PRINT
+ LPRINT : LPRINT : LPRINT : LPRINT : LPRINT
+ LCenter "Q B a s i c"
+ LCenter "M O N E Y M A N A G E R"
+ LPRINT : LPRINT
+ LCenter "Transaction summary: " + Trim$(account(item).Title)
+ LCenter DATE$
+ LPRINT
+ u5$ = "--------|------|------------------------|----------|----------|--------------"
+ LPRINT u5$
+ LPRINT " Date | Ref# | Description | Increase | Decrease | Balance "
+ LPRINT u5$
+ u0$ = "\ \|\ \|\ \|"
+ u2$ = "###,###.##"
+ u3$ = "###,###,###.##"
+ u4$ = " "
+
+ file$ = "money." + Cvit$(item)
+ OPEN file$ FOR RANDOM AS #1 LEN = 84
+ FIELD #1, 8 AS IoDate$, 10 AS IoRef$, 50 AS IoDesc$, 8 AS IoFig1$, 8 AS IoFig2$
+ FIELD #1, 11 AS valid$, 5 AS IoMaxRecord$, 8 AS IoBalance$
+ GET #1, 1
+ IF valid$ = "THISISVALID" THEN
+ Balance# = 0
+ MaxRecord = VAL(IoMaxRecord$)
+ CurrRecord = 1
+ WHILE CurrRecord <= MaxRecord
+
+ GET #1, CurrRecord + 1
+ Fig1# = CVD(IoFig1$)
+ Fig2# = CVD(IoFig2$)
+
+ LPRINT USING u0$; IoDate$; IoRef$; IoDesc$;
+ IF Fig2# = 0 AND Fig1# = 0 THEN
+ LPRINT USING u4$ + "|" + u4$ + "|" + u3$; Balance#
+ ELSEIF Fig2# = 0 THEN
+ Balance# = Balance# + Fig1#
+ LPRINT USING u2$ + "|" + u4$ + "|" + u3$; Fig1#; Balance#
+ ELSE
+ Balance# = Balance# - Fig2#
+ LPRINT USING u4$ + "|" + u2$ + "|" + u3$; Fig2#; Balance#
+ END IF
+ CurrRecord = CurrRecord + 1
+ WEND
+ LPRINT u5$
+ LPRINT : LPRINT
+ END IF
+ ON ERROR GOTO 0
+ END IF
+ CLOSE
+ END IF
+END SUB
+
+'Trin$:
+' Remove null and spaces from the end of a string.
+FUNCTION Trim$ (X$)
+
+ IF X$ = "" THEN
+ Trim$ = ""
+ ELSE
+ lastChar = 0
+ FOR a = 1 TO LEN(X$)
+ y$ = MID$(X$, a, 1)
+ IF y$ <> CHR$(0) AND y$ <> " " THEN
+ lastChar = a
+ END IF
+ NEXT a
+ Trim$ = LEFT$(X$, lastChar)
+ END IF
+
+END FUNCTION
+
diff --git a/private/mvdm/dos/v86/cmd/qbasic/nibbles.bas b/private/mvdm/dos/v86/cmd/qbasic/nibbles.bas
new file mode 100644
index 000000000..809ca47b8
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/nibbles.bas
@@ -0,0 +1,722 @@
+'
+' Q B a s i c N i b b l e s
+'
+' Copyright (C) Microsoft Corporation 1990
+'
+' Nibbles is a game for one or two players. Navigate your snakes
+' around the game board trying to eat up numbers while avoiding
+' running into walls or other snakes. The more numbers you eat up,
+' the more points you gain and the longer your snake becomes.
+'
+' To run this game, press Shift+F5.
+'
+' To exit QBasic, press Alt, F, X.
+'
+' To get help on a BASIC keyword, move the cursor to the keyword and press
+' F1 or click the right mouse button.
+'
+
+'Set default data type to integer for faster game play
+DEFINT A-Z
+
+'User-defined TYPEs
+TYPE snakeBody
+ row AS INTEGER
+ col AS INTEGER
+END TYPE
+
+'This type defines the player's snake
+TYPE snaketype
+ head AS INTEGER
+ length AS INTEGER
+ row AS INTEGER
+ col AS INTEGER
+ direction AS INTEGER
+ lives AS INTEGER
+ score AS INTEGER
+ scolor AS INTEGER
+ alive AS INTEGER
+END TYPE
+
+'This type is used to represent the playing screen in memory
+'It is used to simulate graphics in text mode, and has some interesting,
+'and slightly advanced methods to increasing the speed of operation.
+'Instead of the normal 80x25 text graphics using chr$(219) "Û", we will be
+'using chr$(220)"Ü" and chr$(223) "ß" and chr$(219) "Û" to mimic an 80x50
+'pixel screen.
+'Check out sub-programs SET and POINTISTHERE to see how this is implemented
+'feel free to copy these (as well as arenaType and the DIM ARENA stmt and the
+'initialization code in the DrawScreen subprogram) and use them in your own
+'programs
+TYPE arenaType
+ realRow AS INTEGER 'Maps the 80x50 point into the real 80x25
+ acolor AS INTEGER 'Stores the current color of the point
+ sister AS INTEGER 'Each char has 2 points in it. .SISTER is
+END TYPE '-1 if sister point is above, +1 if below
+
+'Sub Declarations
+DECLARE SUB SpacePause (text$)
+DECLARE SUB PrintScore (NumPlayers%, score1%, score2%, lives1%, lives2%)
+DECLARE SUB Intro ()
+DECLARE SUB GetInputs (NumPlayers, speed, diff$, monitor$)
+DECLARE SUB DrawScreen ()
+DECLARE SUB PlayNibbles (NumPlayers, speed, diff$)
+DECLARE SUB Set (row, col, acolor)
+DECLARE SUB Center (row, text$)
+DECLARE SUB DoIntro ()
+DECLARE SUB Initialize ()
+DECLARE SUB SparklePause ()
+DECLARE SUB Level (WhatToDO, sammy() AS snaketype)
+DECLARE SUB InitColors ()
+DECLARE SUB EraseSnake (snake() AS ANY, snakeBod() AS ANY, snakeNum%)
+DECLARE FUNCTION StillWantsToPlay ()
+DECLARE FUNCTION PointIsThere (row, col, backColor)
+
+'Constants
+CONST TRUE = -1
+CONST FALSE = NOT TRUE
+CONST MAXSNAKELENGTH = 1000
+CONST STARTOVER = 1 ' Parameters to 'Level' SUB
+CONST SAMELEVEL = 2
+CONST NEXTLEVEL = 3
+
+'Global Variables
+DIM SHARED arena(1 TO 50, 1 TO 80) AS arenaType
+DIM SHARED curLevel, colorTable(10)
+
+ RANDOMIZE TIMER
+ GOSUB ClearKeyLocks
+ Intro
+ GetInputs NumPlayers, speed, diff$, monitor$
+ GOSUB SetColors
+ DrawScreen
+
+ DO
+ PlayNibbles NumPlayers, speed, diff$
+ LOOP WHILE StillWantsToPlay
+
+ GOSUB RestoreKeyLocks
+ COLOR 15, 0
+ CLS
+END
+
+ClearKeyLocks:
+ DEF SEG = 0 ' Turn off CapLock, NumLock and ScrollLock
+ KeyFlags = PEEK(1047)
+ POKE 1047, &H0
+ DEF SEG
+ RETURN
+
+RestoreKeyLocks:
+ DEF SEG = 0 ' Restore CapLock, NumLock and ScrollLock states
+ POKE 1047, KeyFlags
+ DEF SEG
+ RETURN
+
+SetColors:
+ IF monitor$ = "M" THEN
+ RESTORE mono
+ ELSE
+ RESTORE normal
+ END IF
+
+ FOR a = 1 TO 6
+ READ colorTable(a)
+ NEXT a
+ RETURN
+
+ 'snake1 snake2 Walls Background Dialogs-Fore Back
+mono: DATA 15, 7, 7, 0, 15, 0
+normal: DATA 14, 13, 12, 1, 15, 4
+END
+
+'Center:
+' Centers text on given row
+SUB Center (row, text$)
+ LOCATE row, 41 - LEN(text$) / 2
+ PRINT text$;
+END SUB
+
+'DrawScreen:
+' Draws playing field
+SUB DrawScreen
+
+ 'initialize screen
+ VIEW PRINT
+ COLOR colorTable(1), colorTable(4)
+ CLS
+
+ 'Print title & message
+ Center 1, "Nibbles!"
+ Center 11, "Initializing Playing Field..."
+
+ 'Initialize arena array
+ FOR row = 1 TO 50
+ FOR col = 1 TO 80
+ arena(row, col).realRow = INT((row + 1) / 2)
+ arena(row, col).sister = (row MOD 2) * 2 - 1
+ NEXT col
+ NEXT row
+END SUB
+
+'EraseSnake:
+' Erases snake to facilitate moving through playing field
+SUB EraseSnake (snake() AS snaketype, snakeBod() AS snakeBody, snakeNum)
+
+ FOR c = 0 TO 9
+ FOR b = snake(snakeNum).length - c TO 0 STEP -10
+ tail = (snake(snakeNum).head + MAXSNAKELENGTH - b) MOD MAXSNAKELENGTH
+ Set snakeBod(tail, snakeNum).row, snakeBod(tail, snakeNum).col, colorTable(4)
+ NEXT b
+ NEXT c
+
+END SUB
+
+'GetInputs:
+' Gets player inputs
+SUB GetInputs (NumPlayers, speed, diff$, monitor$)
+
+ COLOR 7, 0
+ CLS
+
+ DO
+ LOCATE 5, 47: PRINT SPACE$(34);
+ LOCATE 5, 20
+ INPUT "How many players (1 or 2)"; num$
+ LOOP UNTIL VAL(num$) = 1 OR VAL(num$) = 2
+ NumPlayers = VAL(num$)
+
+ LOCATE 8, 21: PRINT "Skill level (1 to 100)"
+ LOCATE 9, 22: PRINT "1 = Novice"
+ LOCATE 10, 22: PRINT "90 = Expert"
+ LOCATE 11, 22: PRINT "100 = Twiddle Fingers"
+ LOCATE 12, 15: PRINT "(Computer speed may affect your skill level)"
+ DO
+ LOCATE 8, 44: PRINT SPACE$(35);
+ LOCATE 8, 43
+ INPUT gamespeed$
+ LOOP UNTIL VAL(gamespeed$) >= 1 AND VAL(gamespeed$) <= 100
+ speed = VAL(gamespeed$)
+
+ speed = (100 - speed) * 2 + 1
+
+ DO
+ LOCATE 15, 56: PRINT SPACE$(25);
+ LOCATE 15, 15
+ INPUT "Increase game speed during play (Y or N)"; diff$
+ diff$ = UCASE$(diff$)
+ LOOP UNTIL diff$ = "Y" OR diff$ = "N"
+
+ DO
+ LOCATE 17, 46: PRINT SPACE$(34);
+ LOCATE 17, 17
+ INPUT "Monochrome or color monitor (M or C)"; monitor$
+ monitor$ = UCASE$(monitor$)
+ LOOP UNTIL monitor$ = "M" OR monitor$ = "C"
+
+ startTime# = TIMER ' Calculate speed of system
+ FOR i# = 1 TO 1000: NEXT i# ' and do some compensation
+ stopTime# = TIMER
+ speed = speed * .5 / (stopTime# - startTime#)
+
+END SUB
+
+'InitColors:
+'Initializes playing field colors
+SUB InitColors
+
+ FOR row = 1 TO 50
+ FOR col = 1 TO 80
+ arena(row, col).acolor = colorTable(4)
+ NEXT col
+ NEXT row
+
+ CLS
+
+ 'Set (turn on) pixels for screen border
+ FOR col = 1 TO 80
+ Set 3, col, colorTable(3)
+ Set 50, col, colorTable(3)
+ NEXT col
+
+ FOR row = 4 TO 49
+ Set row, 1, colorTable(3)
+ Set row, 80, colorTable(3)
+ NEXT row
+
+END SUB
+
+'Intro:
+' Displays game introduction
+SUB Intro
+ SCREEN 0
+ WIDTH 80, 25
+ COLOR 15, 0
+ CLS
+
+ Center 4, "Q B a s i c N i b b l e s"
+ COLOR 7
+ Center 6, "Copyright (C) Microsoft Corporation 1990"
+ Center 8, "Nibbles is a game for one or two players. Navigate your snakes"
+ Center 9, "around the game board trying to eat up numbers while avoiding"
+ Center 10, "running into walls or other snakes. The more numbers you eat up,"
+ Center 11, "the more points you gain and the longer your snake becomes."
+ Center 13, " Game Controls "
+ Center 15, " General Player 1 Player 2 "
+ Center 16, " (Up) (Up) "
+ Center 17, "P - Pause " + CHR$(24) + " W "
+ Center 18, " (Left) " + CHR$(27) + " " + CHR$(26) + " (Right) (Left) A D (Right) "
+ Center 19, " " + CHR$(25) + " S "
+ Center 20, " (Down) (Down) "
+ Center 24, "Press any key to continue"
+
+ PLAY "MBT160O1L8CDEDCDL4ECC"
+ SparklePause
+
+END SUB
+
+'Level:
+'Sets game level
+SUB Level (WhatToDO, sammy() AS snaketype) STATIC
+
+ SELECT CASE (WhatToDO)
+
+ CASE STARTOVER
+ curLevel = 1
+ CASE NEXTLEVEL
+ curLevel = curLevel + 1
+ END SELECT
+
+ sammy(1).head = 1 'Initialize Snakes
+ sammy(1).length = 2
+ sammy(1).alive = TRUE
+ sammy(2).head = 1
+ sammy(2).length = 2
+ sammy(2).alive = TRUE
+
+ InitColors
+
+ SELECT CASE curLevel
+ CASE 1
+ sammy(1).row = 25: sammy(2).row = 25
+ sammy(1).col = 50: sammy(2).col = 30
+ sammy(1).direction = 4: sammy(2).direction = 3
+
+
+ CASE 2
+ FOR i = 20 TO 60
+ Set 25, i, colorTable(3)
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 60: sammy(2).col = 20
+ sammy(1).direction = 3: sammy(2).direction = 4
+
+ CASE 3
+ FOR i = 10 TO 40
+ Set i, 20, colorTable(3)
+ Set i, 60, colorTable(3)
+ NEXT i
+ sammy(1).row = 25: sammy(2).row = 25
+ sammy(1).col = 50: sammy(2).col = 30
+ sammy(1).direction = 1: sammy(2).direction = 2
+
+ CASE 4
+ FOR i = 4 TO 30
+ Set i, 20, colorTable(3)
+ Set 53 - i, 60, colorTable(3)
+ NEXT i
+ FOR i = 2 TO 40
+ Set 38, i, colorTable(3)
+ Set 15, 81 - i, colorTable(3)
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 60: sammy(2).col = 20
+ sammy(1).direction = 3: sammy(2).direction = 4
+
+ CASE 5
+ FOR i = 13 TO 39
+ Set i, 21, colorTable(3)
+ Set i, 59, colorTable(3)
+ NEXT i
+ FOR i = 23 TO 57
+ Set 11, i, colorTable(3)
+ Set 41, i, colorTable(3)
+ NEXT i
+ sammy(1).row = 25: sammy(2).row = 25
+ sammy(1).col = 50: sammy(2).col = 30
+ sammy(1).direction = 1: sammy(2).direction = 2
+
+ CASE 6
+ FOR i = 4 TO 49
+ IF i > 30 OR i < 23 THEN
+ Set i, 10, colorTable(3)
+ Set i, 20, colorTable(3)
+ Set i, 30, colorTable(3)
+ Set i, 40, colorTable(3)
+ Set i, 50, colorTable(3)
+ Set i, 60, colorTable(3)
+ Set i, 70, colorTable(3)
+ END IF
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 65: sammy(2).col = 15
+ sammy(1).direction = 2: sammy(2).direction = 1
+
+ CASE 7
+ FOR i = 4 TO 49 STEP 2
+ Set i, 40, colorTable(3)
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 65: sammy(2).col = 15
+ sammy(1).direction = 2: sammy(2).direction = 1
+
+ CASE 8
+ FOR i = 4 TO 40
+ Set i, 10, colorTable(3)
+ Set 53 - i, 20, colorTable(3)
+ Set i, 30, colorTable(3)
+ Set 53 - i, 40, colorTable(3)
+ Set i, 50, colorTable(3)
+ Set 53 - i, 60, colorTable(3)
+ Set i, 70, colorTable(3)
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 65: sammy(2).col = 15
+ sammy(1).direction = 2: sammy(2).direction = 1
+
+ CASE 9
+ FOR i = 6 TO 47
+ Set i, i, colorTable(3)
+ Set i, i + 28, colorTable(3)
+ NEXT i
+ sammy(1).row = 40: sammy(2).row = 15
+ sammy(1).col = 75: sammy(2).col = 5
+ sammy(1).direction = 1: sammy(2).direction = 2
+
+ CASE ELSE
+ FOR i = 4 TO 49 STEP 2
+ Set i, 10, colorTable(3)
+ Set i + 1, 20, colorTable(3)
+ Set i, 30, colorTable(3)
+ Set i + 1, 40, colorTable(3)
+ Set i, 50, colorTable(3)
+ Set i + 1, 60, colorTable(3)
+ Set i, 70, colorTable(3)
+ NEXT i
+ sammy(1).row = 7: sammy(2).row = 43
+ sammy(1).col = 65: sammy(2).col = 15
+ sammy(1).direction = 2: sammy(2).direction = 1
+
+ END SELECT
+END SUB
+
+'PlayNibbles:
+' Main routine that controls game play
+SUB PlayNibbles (NumPlayers, speed, diff$)
+
+ 'Initialize Snakes
+ DIM sammyBody(MAXSNAKELENGTH - 1, 1 TO 2) AS snakeBody
+ DIM sammy(1 TO 2) AS snaketype
+ sammy(1).lives = 5
+ sammy(1).score = 0
+ sammy(1).scolor = colorTable(1)
+ sammy(2).lives = 5
+ sammy(2).score = 0
+ sammy(2).scolor = colorTable(2)
+
+ Level STARTOVER, sammy()
+ startRow1 = sammy(1).row: startCol1 = sammy(1).col
+ startRow2 = sammy(2).row: startCol2 = sammy(2).col
+
+ curSpeed = speed
+
+ 'play Nibbles until finished
+
+ SpacePause " Level" + STR$(curLevel) + ", Push Space"
+ gameOver = FALSE
+ DO
+ IF NumPlayers = 1 THEN
+ sammy(2).row = 0
+ END IF
+
+ number = 1 'Current number that snakes are trying to run into
+ nonum = TRUE 'nonum = TRUE if a number is not on the screen
+
+ playerDied = FALSE
+ PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
+ PLAY "T160O1>L20CDEDCDL10ECC"
+
+ DO
+ 'Print number if no number exists
+ IF nonum = TRUE THEN
+ DO
+ numberRow = INT(RND(1) * 47 + 3)
+ NumberCol = INT(RND(1) * 78 + 2)
+ sisterRow = numberRow + arena(numberRow, NumberCol).sister
+ LOOP UNTIL NOT PointIsThere(numberRow, NumberCol, colorTable(4)) AND NOT PointIsThere(sisterRow, NumberCol, colorTable(4))
+ numberRow = arena(numberRow, NumberCol).realRow
+ nonum = FALSE
+ COLOR colorTable(1), colorTable(4)
+ LOCATE numberRow, NumberCol
+ PRINT RIGHT$(STR$(number), 1);
+ count = 0
+ END IF
+
+ 'Delay game
+ FOR a# = 1 TO curSpeed: NEXT a#
+
+ 'Get keyboard input & Change direction accordingly
+ kbd$ = INKEY$
+ SELECT CASE kbd$
+ CASE "w", "W": IF sammy(2).direction <> 2 THEN sammy(2).direction = 1
+ CASE "s", "S": IF sammy(2).direction <> 1 THEN sammy(2).direction = 2
+ CASE "a", "A": IF sammy(2).direction <> 4 THEN sammy(2).direction = 3
+ CASE "d", "D": IF sammy(2).direction <> 3 THEN sammy(2).direction = 4
+ CASE CHR$(0) + "H": IF sammy(1).direction <> 2 THEN sammy(1).direction = 1
+ CASE CHR$(0) + "P": IF sammy(1).direction <> 1 THEN sammy(1).direction = 2
+ CASE CHR$(0) + "K": IF sammy(1).direction <> 4 THEN sammy(1).direction = 3
+ CASE CHR$(0) + "M": IF sammy(1).direction <> 3 THEN sammy(1).direction = 4
+ CASE "p", "P": SpacePause " Game Paused ... Push Space "
+ CASE ELSE
+ END SELECT
+
+ FOR a = 1 TO NumPlayers
+ 'Move Snake
+ SELECT CASE sammy(a).direction
+ CASE 1: sammy(a).row = sammy(a).row - 1
+ CASE 2: sammy(a).row = sammy(a).row + 1
+ CASE 3: sammy(a).col = sammy(a).col - 1
+ CASE 4: sammy(a).col = sammy(a).col + 1
+ END SELECT
+
+ 'If snake hits number, respond accordingly
+ IF numberRow = INT((sammy(a).row + 1) / 2) AND NumberCol = sammy(a).col THEN
+ PLAY "MBO0L16>CCCE"
+ IF sammy(a).length < (MAXSNAKELENGTH - 30) THEN
+ sammy(a).length = sammy(a).length + number * 4
+ END IF
+ sammy(a).score = sammy(a).score + number
+ PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
+ number = number + 1
+ IF number = 10 THEN
+ EraseSnake sammy(), sammyBody(), 1
+ EraseSnake sammy(), sammyBody(), 2
+ LOCATE numberRow, NumberCol: PRINT " "
+ Level NEXTLEVEL, sammy()
+ PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
+ SpacePause " Level" + STR$(curLevel) + ", Push Space"
+ IF NumPlayers = 1 THEN sammy(2).row = 0
+ number = 1
+ IF diff$ = "P" THEN speed = speed - 10: curSpeed = speed
+ END IF
+ nonum = TRUE
+ IF curSpeed < 1 THEN curSpeed = 1
+ END IF
+ NEXT a
+
+ FOR a = 1 TO NumPlayers
+ 'If player runs into any point, or the head of the other snake, it dies.
+ IF PointIsThere(sammy(a).row, sammy(a).col, colorTable(4)) OR (sammy(1).row = sammy(2).row AND sammy(1).col = sammy(2).col) THEN
+ PLAY "MBO0L32EFGEFDC"
+ COLOR , colorTable(4)
+ LOCATE numberRow, NumberCol
+ PRINT " "
+
+ playerDied = TRUE
+ sammy(a).alive = FALSE
+ sammy(a).lives = sammy(a).lives - 1
+
+ 'Otherwise, move the snake, and erase the tail
+ ELSE
+ sammy(a).head = (sammy(a).head + 1) MOD MAXSNAKELENGTH
+ sammyBody(sammy(a).head, a).row = sammy(a).row
+ sammyBody(sammy(a).head, a).col = sammy(a).col
+ tail = (sammy(a).head + MAXSNAKELENGTH - sammy(a).length) MOD MAXSNAKELENGTH
+ Set sammyBody(tail, a).row, sammyBody(tail, a).col, colorTable(4)
+ sammyBody(tail, a).row = 0
+ Set sammy(a).row, sammy(a).col, sammy(a).scolor
+ END IF
+ NEXT a
+
+ LOOP UNTIL playerDied
+
+ curSpeed = speed ' reset speed to initial value
+
+ FOR a = 1 TO NumPlayers
+ EraseSnake sammy(), sammyBody(), a
+
+ 'If dead, then erase snake in really cool way
+ IF sammy(a).alive = FALSE THEN
+ 'Update score
+ sammy(a).score = sammy(a).score - 10
+ PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
+
+ IF a = 1 THEN
+ SpacePause " Sammy Dies! Push Space! --->"
+ ELSE
+ SpacePause " <---- Jake Dies! Push Space "
+ END IF
+ END IF
+ NEXT a
+
+ Level SAMELEVEL, sammy()
+ PrintScore NumPlayers, sammy(1).score, sammy(2).score, sammy(1).lives, sammy(2).lives
+
+ 'Play next round, until either of snake's lives have run out.
+ LOOP UNTIL sammy(1).lives = 0 OR sammy(2).lives = 0
+
+END SUB
+
+'PointIsThere:
+' Checks the global arena array to see if the boolean flag is set
+FUNCTION PointIsThere (row, col, acolor)
+ IF row <> 0 THEN
+ IF arena(row, col).acolor <> acolor THEN
+ PointIsThere = TRUE
+ ELSE
+ PointIsThere = FALSE
+ END IF
+ END IF
+END FUNCTION
+
+'PrintScore:
+' Prints players scores and number of lives remaining
+SUB PrintScore (NumPlayers, score1, score2, lives1, lives2)
+ COLOR 15, colorTable(4)
+
+ IF NumPlayers = 2 THEN
+ LOCATE 1, 1
+ PRINT USING "#,###,#00 Lives: # <--JAKE"; score2; lives2
+ END IF
+
+ LOCATE 1, 49
+ PRINT USING "SAMMY--> Lives: # #,###,#00"; lives1; score1
+END SUB
+
+'Set:
+' Sets row and column on playing field to given color to facilitate moving
+' of snakes around the field.
+SUB Set (row, col, acolor)
+ IF row <> 0 THEN
+ arena(row, col).acolor = acolor 'assign color to arena
+ realRow = arena(row, col).realRow 'Get real row of pixel
+ topFlag = arena(row, col).sister + 1 / 2 'Deduce whether pixel
+ 'is on topß, or bottomÜ
+ sisterRow = row + arena(row, col).sister 'Get arena row of sister
+ sisterColor = arena(sisterRow, col).acolor 'Determine sister's color
+
+ LOCATE realRow, col
+
+ IF acolor = sisterColor THEN 'If both points are same
+ COLOR acolor, acolor 'Print chr$(219) "Û"
+ PRINT CHR$(219);
+ ELSE
+ IF topFlag THEN 'Since you cannot have
+ IF acolor > 7 THEN 'bright backgrounds
+ COLOR acolor, sisterColor 'determine best combo
+ PRINT CHR$(223); 'to use.
+ ELSE
+ COLOR sisterColor, acolor
+ PRINT CHR$(220);
+ END IF
+ ELSE
+ IF acolor > 7 THEN
+ COLOR acolor, sisterColor
+ PRINT CHR$(220);
+ ELSE
+ COLOR sisterColor, acolor
+ PRINT CHR$(223);
+ END IF
+ END IF
+ END IF
+ END IF
+END SUB
+
+'SpacePause:
+' Pauses game play and waits for space bar to be pressed before continuing
+SUB SpacePause (text$)
+
+ COLOR colorTable(5), colorTable(6)
+ Center 11, "ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ"
+ Center 12, "Û " + LEFT$(text$ + SPACE$(29), 29) + " Û"
+ Center 13, "ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ"
+ WHILE INKEY$ <> "": WEND
+ WHILE INKEY$ <> " ": WEND
+ COLOR 15, colorTable(4)
+
+ FOR i = 21 TO 26 ' Restore the screen background
+ FOR j = 24 TO 56
+ Set i, j, arena(i, j).acolor
+ NEXT j
+ NEXT i
+
+END SUB
+
+'SparklePause:
+' Creates flashing border for intro screen
+SUB SparklePause
+
+ COLOR 4, 0
+ a$ = "* * * * * * * * * * * * * * * * * "
+ WHILE INKEY$ <> "": WEND 'Clear keyboard buffer
+
+ WHILE INKEY$ = ""
+ FOR a = 1 TO 5
+ LOCATE 1, 1 'print horizontal sparkles
+ PRINT MID$(a$, a, 80);
+ LOCATE 22, 1
+ PRINT MID$(a$, 6 - a, 80);
+
+ FOR b = 2 TO 21 'Print Vertical sparkles
+ c = (a + b) MOD 5
+ IF c = 1 THEN
+ LOCATE b, 80
+ PRINT "*";
+ LOCATE 23 - b, 1
+ PRINT "*";
+ ELSE
+ LOCATE b, 80
+ PRINT " ";
+ LOCATE 23 - b, 1
+ PRINT " ";
+ END IF
+ NEXT b
+ NEXT a
+ WEND
+
+END SUB
+
+'StillWantsToPlay:
+' Determines if users want to play game again.
+FUNCTION StillWantsToPlay
+
+ COLOR colorTable(5), colorTable(6)
+ Center 10, "ÛßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßÛ"
+ Center 11, "Û G A M E O V E R Û"
+ Center 12, "Û Û"
+ Center 13, "Û Play Again? (Y/N) Û"
+ Center 14, "ÛÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÛ"
+
+ WHILE INKEY$ <> "": WEND
+ DO
+ kbd$ = UCASE$(INKEY$)
+ LOOP UNTIL kbd$ = "Y" OR kbd$ = "N"
+
+ COLOR 15, colorTable(4)
+ Center 10, " "
+ Center 11, " "
+ Center 12, " "
+ Center 13, " "
+ Center 14, " "
+
+ IF kbd$ = "Y" THEN
+ StillWantsToPlay = TRUE
+ ELSE
+ StillWantsToPlay = FALSE
+ COLOR 7, 0
+ CLS
+ END IF
+
+END FUNCTION
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/cmd/qbasic/qbasic.hlp b/private/mvdm/dos/v86/cmd/qbasic/qbasic.hlp
new file mode 100644
index 000000000..e4d451530
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/qbasic.hlp
Binary files differ
diff --git a/private/mvdm/dos/v86/cmd/qbasic/remline.bas b/private/mvdm/dos/v86/cmd/qbasic/remline.bas
new file mode 100644
index 000000000..41386f664
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/qbasic/remline.bas
@@ -0,0 +1,395 @@
+'
+' Microsoft RemLine - Line Number Removal Utility
+' Copyright (C) Microsoft Corporation 1985-1990
+'
+' REMLINE.BAS is a program to remove line numbers from Microsoft Basic
+' Programs. It removes only those line numbers that are not the object
+' of one of the following statements: GOSUB, RETURN, GOTO, THEN, ELSE,
+' RESUME, RESTORE, or RUN.
+'
+' When REMLINE is run, it will ask for the name of the file to be
+' processed and the name of the file or device to receive the
+' reformatted output. If no extension is given, .BAS is assumed (except
+' for output devices). If filenames are not given, REMLINE prompts for
+' file names. If both filenames are the same, REMLINE saves the original
+' file with the extension .BAK.
+'
+' REMLINE makes several assumptions about the program:
+'
+' 1. It must be correct syntactically, and must run in BASICA or
+' GW-BASIC interpreter.
+' 2. There is a 400 line limit. To process larger files, change
+' MaxLines constant.
+' 3. The first number encountered on a line is considered a line
+' number; thus some continuation lines (in a compiler-specific
+' construction) may not be handled correctly.
+' 4. REMLINE can handle simple statements that test the ERL function
+' using relational operators such as =, <, and >. For example,
+' the following statement is handled correctly:
+'
+' IF ERL = 100 THEN END
+'
+' Line 100 is not removed from the source code. However, more
+' complex expressions that contain the +, -, AND, OR, XOR, EQV,
+' MOD, or IMP operators may not be handled correctly. For example,
+' in the following statement REMLINE does not recognize line 105
+' as a referenced line number and removes it from the source code:
+'
+' IF ERL + 5 = 105 THEN END
+'
+' If you do not like the way REMLINE formats its output, you can modify
+' the output lines in SUB GenOutFile. An example is shown in comments.
+DEFINT A-Z
+
+' Function and Subprocedure declarations
+DECLARE FUNCTION GetToken$ (Search$, Delim$)
+DECLARE FUNCTION StrSpn% (InString$, Separator$)
+DECLARE FUNCTION StrBrk% (InString$, Separator$)
+DECLARE FUNCTION IsDigit% (Char$)
+DECLARE SUB GetFileNames ()
+DECLARE SUB BuildTable ()
+DECLARE SUB GenOutFile ()
+DECLARE SUB InitKeyTable ()
+
+' Global and constant data
+CONST TRUE = -1
+CONST false = 0
+CONST MaxLines = 400
+
+DIM SHARED LineTable!(MaxLines)
+DIM SHARED LineCount
+DIM SHARED Seps$, InputFile$, OutputFile$, TmpFile$
+
+' Keyword search data
+CONST KeyWordCount = 9
+DIM SHARED KeyWordTable$(KeyWordCount)
+
+KeyData:
+ DATA THEN, ELSE, GOSUB, GOTO, RESUME, RETURN, RESTORE, RUN, ERL, ""
+
+' Start of module-level program code
+ Seps$ = " ,:=<>()" + CHR$(9)
+ InitKeyTable
+ GetFileNames
+ ON ERROR GOTO FileErr1
+ OPEN InputFile$ FOR INPUT AS 1
+ ON ERROR GOTO 0
+ COLOR 7: PRINT "Working"; : COLOR 23: PRINT " . . .": COLOR 7: PRINT
+ BuildTable
+ CLOSE #1
+ OPEN InputFile$ FOR INPUT AS 1
+ ON ERROR GOTO FileErr2
+ OPEN OutputFile$ FOR OUTPUT AS 2
+ ON ERROR GOTO 0
+ GenOutFile
+ CLOSE #1, #2
+ IF OutputFile$ <> "CON" THEN CLS
+
+END
+
+FileErr1:
+ CLS
+ PRINT " Invalid file name": PRINT
+ INPUT " New input file name (ENTER to terminate): ", InputFile$
+ IF InputFile$ = "" THEN END
+FileErr2:
+ INPUT " Output file name (ENTER to print to screen) :", OutputFile$
+ PRINT
+ IF (OutputFile$ = "") THEN OutputFile$ = "CON"
+ IF TmpFile$ = "" THEN
+ RESUME
+ ELSE
+ TmpFile$ = ""
+ RESUME NEXT
+ END IF
+
+'
+' BuildTable:
+' Examines the entire text file looking for line numbers that are
+' the object of GOTO, GOSUB, etc. As each is found, it is entered
+' into a table of line numbers. The table is used during a second
+' pass (see GenOutFile), when all line numbers not in the list
+' are removed.
+' Input:
+' Uses globals KeyWordTable$, KeyWordCount, and Seps$
+' Output:
+' Modifies LineTable! and LineCount
+'
+SUB BuildTable STATIC
+
+ DO WHILE NOT EOF(1)
+ ' Get line and first token
+ LINE INPUT #1, InLin$
+ Token$ = GetToken$(InLin$, Seps$)
+ DO WHILE (Token$ <> "")
+ FOR KeyIndex = 1 TO KeyWordCount
+ ' See if token is keyword
+ IF (KeyWordTable$(KeyIndex) = UCASE$(Token$)) THEN
+ ' Get possible line number after keyword
+ Token$ = GetToken$("", Seps$)
+ ' Check each token to see if it is a line number
+ ' (the LOOP is necessary for the multiple numbers
+ ' of ON GOSUB or ON GOTO). A non-numeric token will
+ ' terminate search.
+ DO WHILE (IsDigit(LEFT$(Token$, 1)))
+ LineCount = LineCount + 1
+ LineTable!(LineCount) = VAL(Token$)
+ Token$ = GetToken$("", Seps$)
+ IF Token$ <> "" THEN KeyIndex = 0
+ LOOP
+ END IF
+ NEXT KeyIndex
+ ' Get next token
+ Token$ = GetToken$("", Seps$)
+ LOOP
+ LOOP
+
+END SUB
+
+'
+' GenOutFile:
+' Generates an output file with unreferenced line numbers removed.
+' Input:
+' Uses globals LineTable!, LineCount, and Seps$
+' Output:
+' Processed file
+'
+SUB GenOutFile STATIC
+
+ ' Speed up by eliminating comma and colon (can't separate first token)
+ Sep$ = " " + CHR$(9)
+ DO WHILE NOT EOF(1)
+ LINE INPUT #1, InLin$
+ IF (InLin$ <> "") THEN
+ ' Get first token and process if it is a line number
+ Token$ = GetToken$(InLin$, Sep$)
+ IF IsDigit(LEFT$(Token$, 1)) THEN
+ LineNumber! = VAL(Token$)
+ FoundNumber = false
+ ' See if line number is in table of referenced line numbers
+ FOR index = 1 TO LineCount
+ IF (LineNumber! = LineTable!(index)) THEN
+ FoundNumber = TRUE
+ END IF
+ NEXT index
+ ' Modify line strings
+ IF (NOT FoundNumber) THEN
+ Token$ = SPACE$(LEN(Token$))
+ MID$(InLin$, StrSpn(InLin$, Sep$), LEN(Token$)) = Token$
+ END IF
+
+ ' You can replace the previous lines with your own
+ ' code to reformat output. For example, try these lines:
+
+ 'TmpPos1 = StrSpn(InLin$, Sep$) + LEN(Token$)
+ 'TmpPos2 = TmpPos1 + StrSpn(MID$(InLin$, TmpPos1), Sep$)
+ '
+ 'IF FoundNumber THEN
+ ' InLin$ = LEFT$(InLin$, TmpPos1 - 1) + CHR$(9) + MID$(InLin$, TmpPos2)
+ 'ELSE
+ ' InLin$ = CHR$(9) + MID$(InLin$, TmpPos2)
+ 'END IF
+
+ END IF
+ END IF
+ ' Print line to file or console (PRINT is faster than console device)
+ IF OutputFile$ = "CON" THEN
+ PRINT InLin$
+ ELSE
+ PRINT #2, InLin$
+ END IF
+ LOOP
+
+END SUB
+
+'
+' GetFileNames:
+' Gets a file name by prompting the user.
+' Input:
+' User input
+' Output:
+' Defines InputFiles$ and OutputFiles$
+'
+SUB GetFileNames STATIC
+
+ CLS
+ PRINT " Microsoft RemLine: Line Number Removal Utility"
+ PRINT " (.BAS assumed if no extension given)"
+ PRINT
+ INPUT " Input file name (ENTER to terminate): ", InputFile$
+ IF InputFile$ = "" THEN END
+ INPUT " Output file name (ENTER to print to screen): ", OutputFile$
+ PRINT
+ IF (OutputFile$ = "") THEN OutputFile$ = "CON"
+
+ IF INSTR(InputFile$, ".") = 0 THEN
+ InputFile$ = InputFile$ + ".BAS"
+ END IF
+
+ IF INSTR(OutputFile$, ".") = 0 THEN
+ SELECT CASE OutputFile$
+ CASE "CON", "SCRN", "PRN", "COM1", "COM2", "LPT1", "LPT2", "LPT3"
+ EXIT SUB
+ CASE ELSE
+ OutputFile$ = OutputFile$ + ".BAS"
+ END SELECT
+ END IF
+
+ DO WHILE InputFile$ = OutputFile$
+ TmpFile$ = LEFT$(InputFile$, INSTR(InputFile$, ".")) + "BAK"
+ ON ERROR GOTO FileErr1
+ NAME InputFile$ AS TmpFile$
+ ON ERROR GOTO 0
+ IF TmpFile$ <> "" THEN InputFile$ = TmpFile$
+ LOOP
+
+END SUB
+
+'
+' GetToken$:
+' Extracts tokens from a string. A token is a word that is surrounded
+' by separators, such as spaces or commas. Tokens are extracted and
+' analyzed when parsing sentences or commands. To use the GetToken$
+' function, pass the string to be parsed on the first call, then pass
+' a null string on subsequent calls until the function returns a null
+' to indicate that the entire string has been parsed.
+' Input:
+' Search$ = string to search
+' Delim$ = String of separators
+' Output:
+' GetToken$ = next token
+'
+FUNCTION GetToken$ (Search$, Delim$) STATIC
+
+ ' Note that SaveStr$ and BegPos must be static from call to call
+ ' (other variables are only static for efficiency).
+ ' If first call, make a copy of the string
+ IF (Search$ <> "") THEN
+ BegPos = 1
+ SaveStr$ = Search$
+ END IF
+
+ ' Find the start of the next token
+ NewPos = StrSpn(MID$(SaveStr$, BegPos, LEN(SaveStr$)), Delim$)
+ IF NewPos THEN
+ ' Set position to start of token
+ BegPos = NewPos + BegPos - 1
+ ELSE
+ ' If no new token, quit and return null
+ GetToken$ = ""
+ EXIT FUNCTION
+ END IF
+
+ ' Find end of token
+ NewPos = StrBrk(MID$(SaveStr$, BegPos, LEN(SaveStr$)), Delim$)
+ IF NewPos THEN
+ ' Set position to end of token
+ NewPos = BegPos + NewPos - 1
+ ELSE
+ ' If no end of token, return set to end a value
+ NewPos = LEN(SaveStr$) + 1
+ END IF
+ ' Cut token out of search string
+ GetToken$ = MID$(SaveStr$, BegPos, NewPos - BegPos)
+ ' Set new starting position
+ BegPos = NewPos
+
+END FUNCTION
+
+'
+' InitKeyTable:
+' Initializes a keyword table. Keywords must be recognized so that
+' line numbers can be distinguished from numeric constants.
+' Input:
+' Uses KeyData
+' Output:
+' Modifies global array KeyWordTable$
+'
+SUB InitKeyTable STATIC
+
+ RESTORE KeyData
+ FOR Count = 1 TO KeyWordCount
+ READ KeyWord$
+ KeyWordTable$(Count) = KeyWord$
+ NEXT
+
+END SUB
+
+'
+' IsDigit:
+' Returns true if character passed is a decimal digit. Since any
+' Basic token starting with a digit is a number, the function only
+' needs to check the first digit. Doesn't check for negative numbers,
+' but that's not needed here.
+' Input:
+' Char$ - initial character of string to check
+' Output:
+' IsDigit - true if within 0 - 9
+'
+FUNCTION IsDigit (Char$) STATIC
+
+ IF (Char$ = "") THEN
+ IsDigit = false
+ ELSE
+ CharAsc = ASC(Char$)
+ IsDigit = (CharAsc >= ASC("0")) AND (CharAsc <= ASC("9"))
+ END IF
+
+END FUNCTION
+
+'
+' StrBrk:
+' Searches InString$ to find the first character from among those in
+' Separator$. Returns the index of that character. This function can
+' be used to find the end of a token.
+' Input:
+' InString$ = string to search
+' Separator$ = characters to search for
+' Output:
+' StrBrk = index to first match in InString$ or 0 if none match
+'
+FUNCTION StrBrk (InString$, Separator$) STATIC
+
+ Ln = LEN(InString$)
+ BegPos = 1
+ ' Look for end of token (first character that is a delimiter).
+ DO WHILE INSTR(Separator$, MID$(InString$, BegPos, 1)) = 0
+ IF BegPos > Ln THEN
+ StrBrk = 0
+ EXIT FUNCTION
+ ELSE
+ BegPos = BegPos + 1
+ END IF
+ LOOP
+ StrBrk = BegPos
+
+END FUNCTION
+
+'
+' StrSpn:
+' Searches InString$ to find the first character that is not one of
+' those in Separator$. Returns the index of that character. This
+' function can be used to find the start of a token.
+' Input:
+' InString$ = string to search
+' Separator$ = characters to search for
+' Output:
+' StrSpn = index to first nonmatch in InString$ or 0 if all match
+'
+FUNCTION StrSpn% (InString$, Separator$) STATIC
+
+ Ln = LEN(InString$)
+ BegPos = 1
+ ' Look for start of a token (character that isn't a delimiter).
+ DO WHILE INSTR(Separator$, MID$(InString$, BegPos, 1))
+ IF BegPos > Ln THEN
+ StrSpn = 0
+ EXIT FUNCTION
+ ELSE
+ BegPos = BegPos + 1
+ END IF
+ LOOP
+ StrSpn = BegPos
+
+END FUNCTION
+
diff --git a/private/mvdm/dos/v86/cmd/setver/device.asm b/private/mvdm/dos/v86/cmd/setver/device.asm
new file mode 100644
index 000000000..17ee31887
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/device.asm
@@ -0,0 +1,233 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;========================================================
+COMMENT #
+
+ DEVICE.ASM
+
+
+ =================================================
+ Device driver to activate the version table in
+ MS-DOS 5.0. Upon initialization the driver will
+ set the DWORD PTR in the DOS data area at offset
+ 05dh to point to the version table in the device
+ driver and also calculates the minimum install
+ size needed to include only the valid entries
+ in the default version table.
+
+
+ ================================================
+
+ johnhe - 12/30/90
+
+END COMMENT #
+
+; =======================================================
+
+INCLUDE VERSIONA.INC
+
+CMD EQU 2 ; Command field offset in packet
+STATUS EQU 3 ; Return status field offset
+DEV_LEN EQU 14 ; Device length field offset
+
+DOS_TABLE EQU 5dh ; Lie table ptr offset in dos data
+TABLE_LEN EQU 2048 ; Max size of lie table
+
+; ====================================================================
+
+A_DEVICE SEGMENT BYTE PUBLIC 'CODE'
+ ASSUME CS:A_DEVICE, DS:NOTHING, ES:NOTHING
+
+PUBLIC ENTRY
+PUBLIC DeviceInit
+
+; ====================================================================
+
+
+DeviceHeader:
+ dw -1,-1
+ dw 1000000000000000b; Device attributes (character device)
+ dw Strategy ; Device strategy entry offset
+ dw Entry ; Device entry offset
+ db 'SETVERXX'
+ExtendedHeader: ; Extended header is used by the
+ ; SETVER.EXE program to determine
+ ; where the version table is located
+ ; within the .EXE file
+VerMinor db 0 ; Version 1.0 of Setver
+VerMajor db 1 ;
+TableOffset dd OFFSET VerList ; Offset of table from device start
+TableLength dw TABLE_LEN ; Max table size
+PtrSave dd (?) ; Address of device packet
+
+; ====================================================================
+
+; ====================================================================
+
+StratProc PROC FAR
+
+Strategy:
+ mov WORD PTR CS:[PtrSave],BX ; Save device packet for
+ mov WORD PTR CS:[PtrSave][2],ES ; use on call to dev entry
+ ret
+
+StratProc ENDP
+
+; ====================================================================
+
+; ====================================================================
+
+Entry PROC FAR ; Device driver entry location
+ push BX
+ push DS
+
+ lds BX,[PtrSave] ; DS:BX --> Cmd structure
+ mov AL,DS:[BX].CMD ; AL == command from sysinit
+ cbw
+ or AX,AX ; Check for init function zero
+ jnz CmdError ; If not init then error
+ jmp DeviceInit ; Jmp to initialize device
+
+CmdError:
+ mov AL,3 ; Return invalid function code
+ mov AH,10000001b ; Signal error in AH
+
+SetStatus:
+ mov [BX].Status,AX ; Copy status to packet
+
+ pop DS
+ pop BX
+ ret
+
+Entry ENDP
+
+; ====================================================================
+; ====================================================================
+
+SIG db 'PCMN'
+TblLen dw TABLE_LEN
+
+; ====================================================================
+; ====================================================================
+
+
+; NTVDM commented out unsupported drivers\apps 19-Aug-1992 Jonle
+if 0
+ db 10,"WIN200.BIN" ,3,40 ; windows 2.x
+ db 10,"WIN100.BIN" ,3,40 ; win 1.x
+ db 11,"WINWORD.EXE" ,4,10 ; winword 1.0
+ db 9, "EXCEL.EXE" ,4,10 ; excel 2.x
+ db 11,"HITACHI.SYS" ,4,00 ; CDROMS
+ db 10,"MSCDEX.EXE" ,4,00 ; CDROMS
+ db 10,"REDIR4.EXE" ,4,00 ; Banyan networks
+ db 7, "NET.EXE" ,4,00 ; 3+ Open
+ db 7, "NET.COM" ,3,30 ; IBM PCLP
+ db 12,"NETWKSTA.EXE" ,4,00 ; 3+ Open
+ db 12,"DXMA0MOD.SYS" ,3,30 ; Token ring
+ db 7, "BAN.EXE" ,4,00 ; Banyan
+ db 7, "BAN.COM" ,4,00 ; Banyan
+ db 11,"MSREDIR.EXE" ,4,00 ; LanMan
+ db 9, "METRO.EXE" ,3,31 ; Lotus Metro
+ db 12,"IBMCACHE.SYS" ,3,40 ; IBM CHACHE Program
+ db 11,"REDIR40.EXE" ,4,00 ; IBM PCLP 1.3/4 redirector
+ db 6, "DD.EXE" ,4,01 ; Laplink III software
+ db 6, "DD.BIN" ,4,01 ; Laplink III software
+ db 7, "LL3.EXE" ,4,01 ; Laplink III software
+ db 9, "REDIR.EXE" ,4,00 ; DOS 4 redir
+ db 9, "SYQ55.SYS" ,4,00 ; Removable SCSII drive from Syquest
+ db 12,"SSTDRIVE.SYS" ,4,00 ; Columbia SCSI driver
+ db 8, "ZDRV.SYS" ,4,01 ; Unisys CD-ROM B#4734
+ db 8, "ZFMT.SYS" ,4,01 ; Unisys CD-ROM B#4734
+ db 11,"TOPSRDR.EXE" ,4,00 ; TOPS redir Bug 5968
+endif
+
+ public VerList
+
+VerList db 11,"WINWORD.EXE" ,4,10 ; winword 1.0
+ db 9, "EXCEL.EXE" ,4,10 ; excel 2.x
+ db 9, "METRO.EXE" ,3,31 ; Lotus Metro
+ db 6, "DD.EXE" ,4,01 ; Laplink III software
+ db 6, "DD.BIN" ,4,01 ; Laplink III software
+ db 7, "LL3.EXE" ,4,01 ; Laplink III software
+
+ db (TABLE_LEN - ($ - VerList)) dup (0)
+ db 0
+
+
+; ====================================================================
+; Device initialization function first determines minimum size the
+; driver needs to be and then sets the DWORD PTR in the DOS data area
+; to the location of the version table.
+; ====================================================================
+
+DeviceInit:
+
+ push BX
+ push CX
+ mov AH,30h ; Get version
+ int 21h
+ pop CX
+ pop BX
+
+ cmp AX,expected_version
+ je SetupScan
+ xor AX,AX ; Set end of device to 0
+ jmp SHORT SetDevEnd
+
+SetupScan:
+ push SI
+ push DS
+ mov AX,CS
+ mov DS,AX
+ mov SI, OFFSET VerList ; DS:SI --> Version table
+
+ xor AX,AX ; Clear high byte of AX
+ScanLoop:
+ lodsb ; Grab the name length
+ or AX,AX ; Test for end of the table
+ jz FoundEnd
+ inc AX ; Add 2 bytes for the version number
+ inc AX
+ add SI,AX ; Make SI so it points to next entry
+ jmp SHORT ScanLoop
+
+FoundEnd:
+ mov AX,SI ; AX == Offset of end of table
+ inc AX ; Need 1 zero byte at end of table
+ pop DS
+ pop SI
+
+SetTablePtr:
+ push BX
+ push ES
+
+ push AX ; Save end of device offset
+ mov AH,52h ; Get the DOS data segment
+ int 21h
+ pop AX ; Restore end of device offset to AX
+
+ cli ; Safety measure when altering DOSdata
+ mov WORD PTR ES:[DOS_TABLE], OFFSET VerList ; Offset of lie table
+ mov WORD PTR ES:[DOS_TABLE][2],CS ; Segment of lie table
+ sti
+ pop ES
+ pop BX
+
+SetDevEnd:
+ mov WORD PTR DS:[BX].DEV_LEN,AX ; Set end of driver @ end of list
+ mov DS:[BX].DEV_LEN[2],CS ; Set device segment
+ mov AH,00000001b ; Normal status return
+
+ jmp SetStatus ; End of init code
+
+; ====================================================================
+
+A_DEVICE ENDS
+
+; ====================================================================
+
+ END
diff --git a/private/mvdm/dos/v86/cmd/setver/dos.asm b/private/mvdm/dos/v86/cmd/setver/dos.asm
new file mode 100644
index 000000000..fdfc980b1
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/dos.asm
@@ -0,0 +1,228 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;================= DOS.ASM =========================
+COMMENT #
+
+
+ johnhe - 05/09/90
+
+END COMMENT #
+
+;========================================================
+
+INVALID_DRIVE EQU 15
+DOS_PUTCHAR EQU 02
+
+DOSSEG
+.Model SMALL,C
+
+
+.Data
+
+CrLf db 0dh, 0ah, 0
+
+
+.Code
+
+; =========================================================================
+; Verifies that a drive exists using the IsChangeable IOCtl function.
+;
+; int IsValidDrive( char DrvLetter )
+;
+; ARGUMENTS: DrvLetter - The drive letter to verify
+; RETURNS: int - FALSE if not a valid drive letter
+; else !FALSE
+;
+; =========================================================================
+
+IsValidDrive PROC Drive:WORD
+
+ mov BX,Drive ; BX = Drive number
+ cmp BX,26 ; Make not greater than drive Z
+ jg NotValid
+
+ mov AX,4408h ; AX = IOCtl Is changeable function
+ int 21h
+ jnc IsValid ; Drv valid
+ ; Else check error code to see if
+ cmp AX,INVALID_DRIVE ; invalid drive error
+ jne IsValid ; Drive is valid
+
+NotValid:
+ xor AX,AX ; Return FALSE
+ jmp SHORT DrvChkRet ; Done
+
+IsValid:
+ mov AX,1 ; Return TRUE
+
+DrvChkRet:
+ ret ; Return AX = TRUE or FALSE
+
+IsValidDrive ENDP
+
+; =========================================================================
+; Displays a zero terminated ascii string on the console followed by
+; a carriage return line feed conbination.
+;
+; void PutStr( char *String )
+;
+; ARGUMENTS: String - Ptr to string to be displayed
+; RETURNS: void
+;
+; =========================================================================
+
+PutStr PROC USES SI, String:PTR
+
+ mov SI,String ; DS:SI -> to caller's string
+ mov CX,2 ; 2 loops
+
+PrintLoop:
+ cld ; Always clear direction flag
+ lodsb ; Load char in AL & inc SI
+ or AL,AL ; Test for EOL character
+ jz EndOfStr
+
+ mov AH,DOS_PUTCHAR ; AH = DOS put char function
+ mov DL,AL ; Put character to print in DL
+ int 21h ; Output the character
+ jmp SHORT PrintLoop ; Go back and do the next one
+
+EndOfStr:
+ mov SI,OFFSET CrLf ; DS:SI -> CR/LF return string
+ loop PrintLoop ; Go back and print CR/LF
+
+ ret
+
+PutStr ENDP
+
+; =========================================================================
+;
+; Seeks to the specified offset in an open disk
+; disk file.
+;
+; long _dos_seek( int Handle, long lOffset, int Mode )
+;
+; ARGUMENTS: Handle - Open DOS file handle
+; lOffset - Offset to seek to in bytes
+; Mode - Seek mode as described below
+; 0 = Beginning of file + offset
+; 1 = Current file position + offset
+; 2 = End of file + offset
+; RETURNS: long - New offset in file is success
+; or -1L if error
+; =========================================================================
+
+_dos_seek PROC USES ES, Handle:WORD, lOffset:DWORD, Mode:BYTE
+
+ mov AH,42h ; AH = DOS file SEEK function
+ mov AL,Mode ; AL = SEEK mode specified by caller
+ mov BX,Handle ; BX = Open file handle from caller
+
+LoadOffset:
+ les DX,lOffset ; Load file offset into ES:DX
+ mov CX,ES ; CX:DX = Offset to seek to in the file
+
+Int21Call:
+ int 21h ; DOS call
+ jc SeekError ; Error check
+ jmp SHORT SeekReturn ;Everything is OK
+
+SeekError:
+ mov AX,-1 ; Error code
+ cwd ; Extend sign to make a LONG (dword)
+
+SeekReturn:
+ ret
+
+_dos_seek ENDP
+
+; =======================================================
+; M001 ; Start of changes to check for SETVER.EXE in the
+; device chain.
+; =======================================================
+
+.DATA
+
+SetVerStr db 'SETVERXX'
+
+LEN_SETVERSTR EQU $-SetVerStr
+
+.Code
+
+; =======================================================
+;
+; Checks to see if SETVER.EXE was installed as as a device
+; driver by walking the device chain looking for the name
+; "SETVERXX".
+;
+; int SetVerCheck ( void )
+;
+; ARGUMENTS: NONE
+; RETURNS: int - TRUE if SetVer device driver is installed else FALSE
+;
+; =======================================================
+
+SetVerCheck PROC USES SI DI DS ES
+ ASSUME ES:NOTHING
+
+ mov AH,52h
+ int 21h ; ES:BX --> first DBP
+
+ push BX ; Save offset
+ mov AH,30h
+ int 21h ; AL == Major version
+ pop DI ; Restore DPB offset to BX
+
+ add DI,17h ; DOS 2.x offset of NULL device is 17h
+ cmp AL,2 ; See if version is really 2.x
+ jle @f
+ add DI,0bh ; Offset for DOS > 2.x is 22h
+@@:
+ mov AX,@DATA
+ mov DS,AX
+
+ mov SI,OFFSET SetVerStr
+ mov CX,LEN_SETVERSTR
+ cld
+
+NameCmpLoop:
+ cmp DI,0ffffh ; See if ES:DX is xxxx:ffff
+ je NoSetVer
+
+SaveSetup:
+ push CX ; Save name length
+ push DI ; Save ptr to current device
+ push SI ; Save ptr to SetVer string
+ add DI,0ah ; ES:DI --> Device name + 1
+
+ repe cmpsb
+ pop SI
+ pop DI
+ pop CX
+
+ je FoundSetVer
+ les DI,ES:[DI] ; Load ptr to next device.
+ jmp SHORT NameCmpLoop
+
+NoSetVer:
+ xor AX,AX
+ jmp SHORT SetVerReturn
+
+FoundSetVer:
+ mov AX,1
+
+SetVerReturn:
+ ret
+
+SetVerCheck ENDP
+
+; =======================================================
+; M001 ; End of changes
+; =======================================================
+
+ END
+
diff --git a/private/mvdm/dos/v86/cmd/setver/makefile b/private/mvdm/dos/v86/cmd/setver/makefile
new file mode 100644
index 000000000..f12eeee28
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/makefile
@@ -0,0 +1,63 @@
+# Makefile for setver.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+
+include ..\..\make.inc
+
+!IF "$(DEBUG)" == "CODEVIEW" || "$(debug)" == "codeview" || \
+ "$(DEBUG)" == "CODEVIEW" || "$(debug)" == "codeview"
+
+c_debug_flags = -Zi -Od
+a_debug_flags = -Zi
+link_opts = /CO
+
+!ELSE
+
+c_debug_flags = -Os
+link_opts =
+
+!ENDIF
+
+#************************************************************************
+
+extcsw = $(c_debug_flags) -AS -Gs
+extasw = $(a_debug_flags) -Zd -I..\..\inc
+dest =setver.exe
+
+all: $(dest)
+ binplace $(dest)
+
+message.h : $(COUNTRY)\message.h
+ copy $(COUNTRY)\message.h .
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+
+$(dest): setver.obj \
+ parse.obj \
+ dos.obj \
+ device.obj
+ link16 $(link_opts) /MAP/LINE device+setver+parse+dos,$(dest),,..\..\lib\;
+
+setver.obj: setver.c setver.h message.h
+
+parse.obj: parse.c setver.h
+
+dos.obj: dos.asm
+
+device.obj: device.asm
+
+data.obj: data.asm
diff --git a/private/mvdm/dos/v86/cmd/setver/parse.c b/private/mvdm/dos/v86/cmd/setver/parse.c
new file mode 100644
index 000000000..75a81e5c0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/parse.c
@@ -0,0 +1,568 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+/***************************************************************************/
+/* PARSE.C */
+/* */
+
+/* Command line parsing functions for SETVER.C. */
+/* */
+/* Valid command lines are: */
+/* List table: SETVER [D:\path] */
+/* Add entry: SETVER [D:\path] name.ext X.XX */
+/* Delete entry: SETVER [D:\path] name.ext /DELETE */
+/* Display help SETVER /? */
+/* Delete entry quietly: SETVER [D:\path] name.ext /DELETE /QUIET */
+/* */
+/* The following error codes are returned: */
+/* */
+/* S_INVALID_SWITCH Invalid switch */
+/* S_INVALID_FNAME Invalid file name */
+/* S_BAD_VERSION_FMT Invalid version number format */
+/* S_BAD_DRV_SPEC Invalid drive/path specifier */
+/* S_TOO_MANY_PARMS Too many command line parameters */
+/* S_MISSING_PARM Missing parameter */
+/* S_INVALID_PATH Path specifier is invalid */
+/* */
+/* johnhe 05-01-90 */
+/***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <dos.h>
+#include <direct.h>
+
+#include <setver.h>
+
+/***************************************************************************/
+/* Parses the command line to get the optional drive letter, optional */
+/* executable file name and optional switch /DELETE. Also handles a single */
+/* "/?" switch for displaying command help. The /DELETE switch will accept */
+/* any number of chars in the the word DELETE for the switch. Also */
+/* supports a /QUIET switch, similarly handled, but only valid in */
+/* combination with the /DELETE switch */
+/* */
+/* int ParseCmd( int argc, char *argv[], struct TableEntry *Entry ) */
+/* */
+/* ARGUMENTS: argc - Count of command line arguments */
+/* argv - Array of ptrs to command line argments */
+/* Entry - Ptr to struct to be filled in */
+/* RETURNS: int - Valid function number or parse error code */
+/* */
+/***************************************************************************/
+
+int ParseCmd( int argc, char *argv[], struct TableEntry *Entry )
+{
+ register Funct;
+ unsigned uVersion;
+ int iTmp;
+ int iStrLen;
+
+ strcpy( Entry->Path, argv[0] ); /* Set default setver.exe path */
+
+ if ( argc == 1 ) /* Chk for default of 0 parms */
+ return( DO_LIST ); /* No args so just do a listing */
+
+ for ( iTmp = 1; iTmp < argc; iTmp++ )
+ strupr( argv[ iTmp ] ); /* Convert params to upper case */
+
+ /* Chk for help switch */
+ if ( MatchSwitch( argv[ 1 ], HELP_SWITCH ) )
+ return( argc > 2 ? S_TOO_MANY_PARMS : DO_HELP);
+
+ iTmp = 1;
+
+ /* Chk for optional drive:\path spec */
+ if ( strchr( argv[1], ':' ) )
+ {
+ if ( IsValidDrive( (unsigned)argv[1][0] - 0x40 ) && argv[1][1] == ':' )
+ {
+ if ( (iStrLen = strlen( argv[1] )) > (MAX_PATH_LEN - 1) )
+ return( S_INVALID_PATH );
+ else
+ {
+ strcpy( Entry->Path, argv[1] );
+#ifdef DBCS
+ if ( (*(Entry->Path + iStrLen - 1) != '\\' && argv[1][2] != EOL )
+ || CheckDBCSTailByte(Entry->Path,Entry->Path + iStrLen - 1) )
+#else
+ if ( *(Entry->Path + iStrLen - 1) != '\\' && argv[1][2] != EOL )
+#endif
+ strcat( Entry->Path, "\\" );
+ strcat( Entry->Path, "SETVER.EXE" );
+ iTmp++;
+ }
+ }
+ else
+ return( S_BAD_DRV_SPEC );
+ }
+
+ if ( iTmp >= argc )
+ Funct = DO_LIST;
+
+ else if ( IsValidFileName( argv[ iTmp ] ) )
+ {
+ strcpy( Entry->szFileName, argv[ iTmp++ ] );
+
+ if ( iTmp >= argc ) /* Version # or /D or /Q must follow */
+ Funct = S_MISSING_PARM;
+
+ /* note that Quiet switch requires Del switch also be supplied */
+ else if ( MatchSwitch( argv[ iTmp ], DEL_SWITCH ) )
+ {
+ if ( ++iTmp < argc ) /* more args left */
+ {
+ if (MatchSwitch(argv[iTmp], QUIET_SWITCH))
+ Funct = (++iTmp < argc ? S_TOO_MANY_PARMS : DO_QUIET);
+ else
+ Funct = S_TOO_MANY_PARMS;
+ }
+ else
+ Funct = DO_DELETE;
+ }
+ else if ( MatchSwitch( argv[iTmp], QUIET_SWITCH ) )
+ {
+ if ( ++iTmp < argc ) /* must find delete switch */
+ if (MatchSwitch(argv[iTmp], DEL_SWITCH))
+ Funct = (++iTmp < argc ? S_TOO_MANY_PARMS : DO_QUIET);
+ else
+ Funct = S_INVALID_SWITCH;
+ else
+ Funct = S_INVALID_SWITCH;
+ }
+ else if ( *argv[iTmp] == '/' ) /* Make sure not a bogus switch */
+ Funct = S_INVALID_SWITCH;
+ else if ( (uVersion = ParseVersion( argv[ iTmp++ ] )) != 0 )
+ {
+ Entry->MajorVer = (char)(uVersion >> 8);
+ Entry->MinorVer = (char)(uVersion & 0xff);
+ Funct = (iTmp < argc ? S_TOO_MANY_PARMS : DO_ADD_FILE);
+ }
+ else
+ Funct = S_BAD_VERSION_FMT;
+ }
+ else
+ Funct = S_INVALID_FNAME;
+
+ return( Funct );
+}
+
+
+/***************************************************************************/
+/* Parses a DOS major and minor version number from an ascii string in the */
+/* form of "00.00" where the major number is on the left of the decminal */
+/* point and the minor version follows the version number. Valid version */
+/* numbers are decimal numbers between 2.00 and 9.99. */
+/* */
+/* unsigned ParseVersion( char *szDosVer ) */
+/* */
+/* ARGUMENTS: szDosVer - Ptr to an ascii verion number string */
+/* RETURNS: unsigned - Version # in the form (Major << 8) + */
+/* Minor or 0 if not valid version string */
+/* */
+/***************************************************************************/
+
+unsigned ParseVersion( char *szDosVer )
+{
+ unsigned Version = 0;
+ size_t Len;
+ char *szMinor;
+
+ /* First parse the minor version number */
+ if ( (szMinor = strchr( szDosVer, '.' )) != NULL )
+ {
+ *szMinor = EOL;
+ szMinor++;
+ if ( (Len = strlen( szMinor )) > 2 || !IsDigitStr( szMinor ) )
+ Version = (unsigned) S_ERROR;
+ else
+ {
+ Version = (unsigned)atoi( szMinor );
+ while( Len++ < 2 ) /* Convert .x to .x0 */
+ Version *= 10;
+ }
+ }
+ /* Now get the major part of the number */
+ szDosVer = SkipLeadingChr( szDosVer, '0' );
+ if ( Version == (unsigned)S_ERROR || strlen( szDosVer ) > 2 ||
+ !IsDigitStr( szDosVer ) )
+ Version = 0;
+ else
+ Version |= ((unsigned)atoi( szDosVer ) << 8);
+
+ /* Check for min and max versions */
+ if ( Version < MIN_VERSION || Version >= MAX_VERSION )
+ Version = 0;
+
+ return( Version );
+}
+
+/***************************************************************************/
+/* Checks a string to verify that all characters in the string are decmial */
+/* numbers 0-9. */
+/* */
+/* int IsDigitStr( char *szStr ) */
+/* */
+/* ARGUMENTS: szStr - Ptr to ascii string to be scanned */
+/* RETURNS: int - TRUE if all chars are numbers else FALSE */
+/* */
+/***************************************************************************/
+
+int IsDigitStr( char *szStr )
+{
+ while( *szStr != EOL )
+ {
+ if ( !isdigit( *(szStr++) ) )
+ return( FALSE );
+ }
+ return( TRUE );
+}
+
+/***************************************************************************/
+/* Accepts a pointer to a string and a single character to match. Returns */
+/* a ptr to the first character in the string not matching the specified */
+/* character. */
+/* */
+/* char *SkipLeadingChr( char *szStr, char chChar ) */
+/* */
+/* ARGUMENTS: szStr - Ptr to an ascii string */
+/* chChar - Ascii character to match */
+/* RETURNS: char * - Ptr to first char in the string not */
+/* matching the specified character */
+/***************************************************************************/
+
+char *SkipLeadingChr( char *szStr, char chChar )
+{
+ while( *szStr == chChar )
+ szStr++;
+ return( szStr );
+}
+
+
+/***************************************************************************/
+/* Compares a cmd line switch against a test string. The test switch is an */
+/* ascii string which will be used as a pattern to be matched against the */
+/* command string. The command string may be any subset of the test string */
+/* which has been prefixed with a switch character. */
+/* */
+/* int MatchSwitch( char *szCmdParm, char *szTestSwitch ) */
+/* */
+/* ARGUMENTS: szCmdParm - Command line parameter to be tested */
+/* szTestSwitch - Switch to test command line against */
+/* RETURN: int - TRUE if there is a match else FALSE */
+/* */
+/***************************************************************************/
+
+int MatchSwitch( char *szCmdParm, char *szTestSwitch )
+{
+ /* Must have a leading '/' and at least 1 char */
+ if ( *(szCmdParm++) != SWITCH_CHAR || *szCmdParm == EOL )
+ return( FALSE );
+
+ while ( *szTestSwitch != EOL && *szTestSwitch == *szCmdParm )
+ szTestSwitch++, szCmdParm++;
+
+ return( *szCmdParm == EOL ? TRUE : FALSE );
+}
+
+
+/***************************************************************************/
+/* Scans a string to see if the string can be used a valid file name. */
+/* The scan checks to be sure each character in the name is a valid */
+/* character for a path name. There is also a check to be sure that only */
+/* there is not more than 1 decimal in the name and that if there is a */
+/* decimal that the primary name and extension do not exceed the maximum */
+/* length of 8 chars for primary and 3 for extension. If the name does */
+/* not include a decimal the max length is 8 characters. */
+/* */
+/* int IsValidFileName( char *szPath ) */
+/* */
+/* ARGUMENTS: szFile - String containing a file name. */
+/* RETURNS : int - TRUE if valid name else FALSE. */
+/* */
+/***************************************************************************/
+
+int IsValidFileName( char *szFile )
+{
+ char *szDecimal;
+
+ RemoveTrailing( szFile, '.' );
+
+ /*
+ * Check to be sure length of filename is greater than 0,
+ * there are no invalid file characters,
+ * there is no path associated with the filename,
+ * the filename is not a reserved DOS filename, and
+ * there are no wildcard characters used in the filename.
+ */
+#ifdef DBCS
+ if ( strlen( szFile ) > 0 && ValidFileChar( szFile ) &&
+ ((strchr(szFile, '\\') == NULL) || CheckDBCSTailByte(szFile,strchr(szFile, '\\'))) &&
+ !IsReservedName( szFile ) && !IsWildCards( szFile ) )
+#else
+ if ( strlen( szFile ) > 0 && ValidFileChar( szFile ) &&
+ (strchr(szFile, '\\') == NULL) &&
+ !IsReservedName( szFile ) && !IsWildCards( szFile ) )
+#endif
+ {
+ /* Check for appropriate 8.3 filename */
+ if ( (szDecimal = strchr( szFile, '.' )) != NULL )
+ {
+ if ( strchr( szDecimal + 1, '.' ) == NULL && /* Chk for more '.'s */
+ (szDecimal - szFile) <= 8 && /* Chk lengths */
+ (strchr( szDecimal, EOL ) - szDecimal - 1) <= 3 )
+ return ( TRUE );
+ }
+ else if ( strlen( szFile ) <= 8 )
+ return ( TRUE );
+ }
+ return( FALSE );
+}
+
+/***************************************************************************/
+/* Checks all of the characters in a string to see if they are vaild path */
+/* name characaters. */
+/* */
+/* int ValidFileChar( char *szFile ) */
+/* */
+/* ARGUMENTS: szFile - File name string */
+/* RETURN: int - TRUE if chars in string are valid else */
+/* FALSE */
+/* */
+/***************************************************************************/
+
+int ValidFileChar( char *szFile )
+{
+ int IsOk = TRUE;
+
+ while ( IsOk && *szFile != EOL )
+ #ifdef DBCS
+ if (IsDBCSLeadByte(*szFile))
+ szFile += 2;
+ else
+ #endif
+ IsOk = IsValidFileChr( *(szFile++) );
+ return( IsOk );
+}
+
+
+/***************************************************************************/
+/* Checks a file or path name against a list of reserved DOS filenames and */
+/* returns TRUE if the name is a reserved name. The function must first */
+/* off any extension from the name. */
+/* */
+/* int IsReservedName( char *szFile ) */
+/* */
+/* ARGUMENTS: szFile - File name string */
+/* RETURN: int - TRUE if name is reserved DOS name */
+/* */
+/***************************************************************************/
+
+int IsReservedName( char *szFile )
+{
+ register Status;
+ register i;
+ char *szTmp;
+ static char *apszRes[] = { "AUX", "CLOCK$", "COM1", "COM2",
+ "COM3", "COM4", "CON", "LPT", "LPT1",
+ "LPT2", "LPT3", "LST", "NUL", "PRN", NULL };
+
+ if ( (szTmp = strchr( szFile, '.' )) != NULL )
+ *szTmp = EOL;
+ for ( i = 0, Status = FALSE; Status == FALSE && apszRes[i] != NULL; i++ )
+ Status = !strcmpi( szFile, apszRes[i] );
+ if ( szTmp != NULL )
+ *szTmp = '.';
+
+ return( Status );
+}
+
+/***************************************************************************/
+/* Checks a file or path name for any wildcards (* and ?). If wildcard */
+/* characters exist, it returns TRUE. Otherwise, it returns FALSE. */
+/* */
+/* int IsWildCards( char *szFile ) */
+/* */
+/* ARGUMENTS: szFile - File name string */
+/* RETURN: int - TRUE if wildcards exist in name */
+/* */
+/***************************************************************************/
+
+int IsWildCards( char *szFile )
+{
+ if ( ((strchr( szFile, '*' )) != NULL) ||
+ ((strchr( szFile, '?' )) != NULL) )
+ return( TRUE );
+ return( FALSE );
+}
+
+
+/***************************************************************************/
+/* Validates a character as a valid path and file name character. */
+/* */
+/* IsValidFileChr( char Char ) */
+/* */
+/* ARGUMENTS: Char - Character to be tested */
+/* RETURNS: int - TRUE if a valid character else FALSE */
+/* */
+/***************************************************************************/
+
+int IsValidFileChr( char Char )
+{
+ int IsOk;
+
+ switch( Char )
+ {
+ case ' ' :
+ case '\t' :
+ case 0x0d :
+ case '/' :
+ case ':' :
+ case ';' :
+ case '=' :
+ case '<' :
+ case '>' :
+ case '|' :
+ IsOk = FALSE;
+ break;
+ default :
+ IsOk = TRUE;
+ break;
+ }
+ return( IsOk );
+}
+
+/***************************************************************************/
+/* Removes all trailing characters of the type specified from a string. */
+/* */
+/* void RemoveTrailing( char *String, char Char ) */
+/* */
+/* ARGUMENTS: String - pointer to a string */
+/* Char - ascii char to remove from end of string */
+/* RETURNS: void */
+/* */
+/***************************************************************************/
+
+void RemoveTrailing( char *String, char Char )
+{
+ char *EndOfString;
+
+ EndOfString = strchr(String, EOL );
+ while( EndOfString != String && *(EndOfString-1) == Char )
+ EndOfString--;
+ *EndOfString = EOL;
+}
+
+/***************************************************************************/
+/* Copyright (c) 1989 - Microsoft Corp. */
+/* All rights reserved. */
+/* */
+/* Returns a pointer to the first character in the filename which may or */
+/* may not be appended to a path. */
+/* */
+/* char *ParseFileName( char *szPath ) */
+/* */
+/* ARGUMENTS: szPath - Ptr to a file path in the form d:\xxxx\xxx.xxx */
+/* RETURNS: char * - Ptr to file name or character after last */
+/* backslash or ':' in the string if the path did */
+/* not contain a file name */
+/* */
+/***************************************************************************/
+
+char *ParseFileName( char *szPath )
+{
+ char *szPtr;
+
+ for ( szPtr = szPath;
+ *szPtr != EOL && (IsValidFileChr( *szPtr ) || *szPtr == ':');
+ szPtr++ )
+ #ifdef DBCS
+ if (IsDBCSLeadByte(*szPtr))
+ szPtr++;
+ #else
+ ;
+ #endif
+
+ #ifdef DBCS
+ while(( --szPtr >= szPath && *szPtr != '\\' && *szPtr != ':') ||
+ (szPtr >= szPath && CheckDBCSTailByte(szPath,szPtr)) )
+ #else
+ while( --szPtr >= szPath && *szPtr != '\\' && *szPtr != ':' )
+ #endif
+ ;
+
+ return( ++szPtr );
+}
+
+#ifdef DBCS
+/***************************************************************************/
+/* Test if the character is DBCS lead byte. */
+/* */
+/* int IsDBCSLeadByte(char c) */
+/* */
+/* ARGUMENTS: c - character to test */
+/* RETURNS: TRUE if leadbyte */
+/* */
+/***************************************************************************/
+
+int IsDBCSLeadByte(c)
+unsigned char c;
+{
+ static unsigned char far *DBCSLeadByteTable = NULL;
+ union REGS inregs,outregs;
+ struct SREGS segregs;
+ unsigned char far *p;
+
+
+ if (DBCSLeadByteTable == NULL)
+ {
+ inregs.x.ax = 0x6300; /* get DBCS lead byte table */
+ intdosx(&inregs, &outregs, &segregs);
+ FP_OFF(DBCSLeadByteTable) = outregs.x.si;
+ FP_SEG(DBCSLeadByteTable) = segregs.ds;
+ }
+
+ p = DBCSLeadByteTable;
+ while (p[0] || p[1])
+ {
+ if (c >= p[0] && c <= p[1])
+ return TRUE;
+ p += 2;
+ }
+ return ( FALSE );
+}
+
+
+/***************************************************************************/
+/*
+/* Check if the character point is at tail byte
+/*
+/* input: *str = strart pointer of the string
+/* *point = character pointer to check
+/* output: TRUE if at the tail byte
+/*
+/***************************************************************************/
+
+int CheckDBCSTailByte(str,point)
+unsigned char *str,*point;
+{
+ unsigned char *p;
+
+ p = point;
+ while (p != str)
+ {
+ p--;
+ if (!IsDBCSLeadByte(*p))
+ {
+ p++;
+ break;
+ }
+ }
+ return ((point - p) & 1 ? TRUE : FALSE);
+}
+#endif
diff --git a/private/mvdm/dos/v86/cmd/setver/setver.c b/private/mvdm/dos/v86/cmd/setver/setver.c
new file mode 100644
index 000000000..86591df6c
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/setver.c
@@ -0,0 +1,530 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+/***************************************************************************/
+/* SETVER.C */
+/* */
+/* This module contains the functions which read in the version table */
+/* from MSDOS.SYS and then updates the table with new entries and */
+/* writes it back to the file. */
+/* */
+/* The fake version table is located in the DOS system file and it's */
+/* location and length are specified with 2 words at offset 7 in the */
+/* file. The first word is the table offset and second word is length. */
+/* */
+/* Table layout: */
+/* */
+/* ENTRY FILENAME LEN: Length of filename in bytes 1 byte */
+/* ENTRY FILENAME: Variable length to 12 bytes ? bytes */
+/* ENTRY VERSION MAJOR: Dos major version to return 1 byte */
+/* ENTRY VERSION MINOR: Dos minor version to return 1 byte */
+/* */
+/* */
+/* USEAGE: */
+/* List table: SETVER [D:] */
+/* Add entry: SETVER [D:] name.ext X.XX */
+/* Delete entry: SETVER [D:] name.ext /DELETE */
+/* Delete entry quietly: SETVER [D:] name.ext /DELETE /QUIET */
+/* Display help SETVER /? */
+/* */
+/* WHERE: */
+/* D: is the drive containing MSDOS.SYS */
+/* name.ext is the executable file name */
+/* X.XX is the major and minor version numbers */
+/* */
+/* RETURN CODES: */
+/* 0 Successful completion */
+/* 1 Invalid switch */
+/* 2 Invalid file name */
+/* 3 Insuffient memory */
+/* 4 Invalid version number format */
+/* 5 Entry not found in the table */
+/* 6 MSDOS.SYS file not found */
+/* 7 Invalid MSDOS.SYS or IBMDOS.SYS file */
+/* 8 Invalid drive specifier */
+/* 9 Too many command line parameters */
+/* 10 DOS version was not specified */
+/* 11 Missing parameter */
+/* 12 Error reading MS-DOS system file */
+/* 13 Version table is corrupt */
+/* 14 Specifed file does not support a version table */
+/* 15 Insuffient space in version table for new entry */
+/* 16 Error writing MS-DOS system file */
+/* */
+/* johnhe 05-01-90 */
+/***************************************************************************/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <string.h>
+#include <dos.h>
+#include <io.h>
+#include <fcntl.h>
+
+#include <setver.h>
+#include <message.h>
+
+
+/***************************************************************************/
+
+static char *ReadBuffer;
+static char *LieBuffer; /* Buffer to read lietable into */
+static char *EndBuf; /* Ptr to end of the buffer */
+struct ExeHeader ExeHdr;
+struct DevHeader DevHdr;
+struct TableEntry Entry;
+static char *szSetVer = "SETVERXX";
+
+long FileOffset;
+/* static UINT TableLen; */
+
+/***************************************************************************/
+/* Program entry point. Parses the command line and if it's valid executes */
+/* the requested function and then returns the proper error code. Any */
+/* error codes returned by ParseCommand are negative so they must be */
+/* converted with a negate before being returned as valid error codes. */
+/* */
+/* int main( int argc, char *argv[] ) */
+/* */
+/* ARGUMENTS: argc - Count of command line arguments */
+/* argv - Array of ptrs to argument strings */
+/* RETURNS: int - Valid return code for batch processing */
+/* */
+/***************************************************************************/
+
+int main( int argc, char *argv[] )
+{
+ register iFunc;
+ char szError[ 80 ];
+
+ iFunc = ParseCmd( argc, argv, &Entry );
+ if ( iFunc >= 0 )
+ iFunc = DoFunction( iFunc );
+
+ if ( iFunc != S_OK )
+ {
+ iFunc = -(iFunc);
+ strcpy( szError, ErrorMsg[ 0 ] );
+ strcat( szError, ErrorMsg[ iFunc ] );
+ PutStr( szError );
+ PutStr( szMiniHelp );
+ }
+ return( iFunc );
+}
+
+/***************************************************************************/
+/* Calls the appropriate function to do whatever was specified by the */
+/* user. The lie table if first read in except in the case only the help */
+/* function was requested. To be sure duplicate table entries are not */
+/* created a call to DeleteEntry with the new program name will be done */
+/* before the new entry is created. */
+/* */
+/* int DoFunction( int iFunc ) */
+/* */
+/* ARGUMENTS: iFunct - The function to be performed */
+/* RETURNS: int - S_OK if no errors else an error code */
+/* */
+/***************************************************************************/
+
+int DoFunction( int iFunc )
+{
+ register iStatus;
+
+ if ( iFunc == DO_HELP )
+ {
+ DisplayMsg( Help );
+ return( S_OK );
+ }
+
+ if ( iFunc == DO_ADD_FILE )
+ DisplayMsg( Warn ); /* Read in the lie table and */
+ /* then decide what to do */
+ if ( (iStatus = ReadVersionTable()) == S_OK )
+ {
+ if ( iFunc == DO_LIST )
+ iStatus = DisplayTable();
+ else
+ {
+ if ( (iFunc == DO_DELETE || iFunc == DO_QUIET) &&
+ (iStatus = MatchFile( LieBuffer, Entry.szFileName )) < S_OK )
+ return( iStatus );
+ /* Always a delete before add */
+
+ if ( (iStatus = DeleteEntry()) == S_OK && iFunc == DO_ADD_FILE )
+ iStatus = AddEntry();
+
+ if ( iStatus == S_OK &&
+ (iStatus = WriteVersionTable()) == S_OK &&
+ !(iFunc == DO_QUIET) )
+ {
+ PutStr( SuccessMsg );
+ if ( SetVerCheck() == TRUE ) /* M001 */
+ PutStr( SuccessMsg2 );
+ }
+ }
+ }
+ /* M001 Install check to see if currently in device chain */
+ if ( iStatus == S_OK && iFunc != DO_QUIET && SetVerCheck() == FALSE )
+ DisplayMsg( szNoLoadMsg );
+
+ return( iStatus );
+}
+
+/***************************************************************************/
+/* Displays the help text for "/?" option, or the warning text. */
+/* */
+/* void DisplayHelp( tbl ) */
+/* */
+/* ARGUMENTS: char *tbl[] */
+/* RETURNS: void */
+/* */
+/***************************************************************************/
+
+void DisplayMsg( char *tbl[] )
+{
+ register i;
+
+ for ( i = 0; tbl[i] != NULL; i++ )
+ PutStr( tbl[ i ] );
+}
+
+/***************************************************************************/
+/* Displays all entries in the version table which must have already been */
+/* read into the work buffer. The name and version number are created as */
+/* as ascii string in a tempory buffer and then printed as a single string */
+/* in the format: */
+/* */
+/* 1234567890123456789 */
+/* FILENAME.EXT X.XX */
+/* */
+/* int DisplayTable( void ) */
+/* */
+/* ARGUMENTS: void */
+/* RETURNS: int - S_CORRUPT_TABLE if table corrupt else S_OK */
+/* */
+/***************************************************************************/
+
+int DisplayTable( void )
+{
+ char *BufPtr;
+ char *szTmp;
+ char *szVersion;
+ char szEntry[ 50 ];
+
+ BufPtr = LieBuffer;
+ szVersion = szEntry + VERSION_COLUMN;
+
+ PutStr( "" );
+ while ( *BufPtr != 0 && BufPtr < EndBuf )
+ {
+ /* Chk for table corruption */
+ if ( !IsValidEntry( BufPtr ) )
+ return( S_CORRUPT_TABLE );
+ /* Copy file name and pad with spaces */
+ strncpy( szEntry, BufPtr+1, (unsigned)((int)*BufPtr) );
+ for ( szTmp = szEntry + *BufPtr; szTmp < szVersion; szTmp++ )
+ *szTmp = ' ';
+
+ /* Point to version number */
+ BufPtr += *BufPtr;
+ BufPtr++;
+
+ /* Now create ascii version */
+ itoa( (int)*(BufPtr++), szVersion, DECIMAL );
+ strcat( szVersion, (int)*BufPtr < 10 ? ".0" : "." );
+ itoa( (int)*(BufPtr++), strchr( szVersion, EOL ), DECIMAL );
+
+ PutStr( szEntry );
+ }
+ if ( BufPtr == LieBuffer )
+ PutStr( szTableEmpty );
+
+ return( S_OK );
+}
+
+
+/***************************************************************************/
+/* Deletes all matching entries in the version table by moving all of the */
+/* entries following the matched entry down in the buffer to replace the */
+/* entry being deleted. After the entries are moved down the residuals */
+/* at the end of the table must be zeroed out. Before returning the entire */
+/* end of the table buffer after the valid entries is zeroed out to remove */
+/* any possible corruption. */
+/* */
+/* int DeleteEntry( void ) */
+/* */
+/* ARGUMENTS: NONE */
+/* RETURNS: int - S_CORRUPT_TABLE if errors found else S_OK */
+/* */
+/***************************************************************************/
+
+int DeleteEntry( void )
+{
+ char *pchPtr;
+ char *pchTmp;
+ int iOffset;
+ UINT uEntryLen;
+ UINT uBlockLen;
+
+ pchPtr = LieBuffer;
+
+ while ( (iOffset = MatchFile( pchPtr, Entry.szFileName )) >= 0 )
+ {
+ pchPtr = LieBuffer + iOffset; /* Move block down */
+ uEntryLen = (UINT)((int)*pchPtr) + 3;
+ uBlockLen = (UINT)(EndBuf - pchPtr) + uEntryLen;
+ memmove( pchPtr, pchPtr + uEntryLen, uBlockLen );
+
+ pchTmp = pchPtr + uBlockLen; /* Clean end of blk */
+ memset( pchTmp, 0, uEntryLen );
+ }
+
+ if ( iOffset == S_ENTRY_NOT_FOUND ) /* Clean end of table */
+ {
+ if ( (pchTmp = GetNextFree()) != NULL )
+ memset( pchTmp, 0, DevHdr.TblLen - (unsigned)(pchTmp - LieBuffer) );
+ return( S_OK );
+ }
+ else
+ return( S_CORRUPT_TABLE );
+}
+
+
+/***************************************************************************/
+/* Adds a new entry to the end of any existing entries in the version */
+/* table. There must be suffient room in the table for the entry or the */
+/* call will fail with a S_NO_ROOM error returned. */
+/* */
+/* int AddEntry( void ) */
+/* */
+/* ARGUMENTS: NONE */
+/* RETURNS: int - S_OK if room for entry else S_NO_ROOM */
+/* */
+/***************************************************************************/
+
+int AddEntry( void )
+{
+ register iLen;
+ char *pchNext;
+
+ iLen = (int)strlen( Entry.szFileName ) + 3;
+
+ if ( (pchNext = GetNextFree()) != NULL && iLen <= EndBuf - pchNext )
+ {
+ *pchNext = (char)(iLen - 3);
+ strcpy( pchNext + 1, Entry.szFileName );
+ pchNext += (int)(*pchNext) + 1;
+ *(pchNext++) = (char)Entry.MajorVer;
+ *pchNext = (char)Entry.MinorVer;
+ return( S_OK );
+ }
+ else
+ return( S_NO_ROOM );
+}
+
+
+/***************************************************************************/
+/* Returns the offset of a specified name in the version table. The start */
+/* of the search is specified by the caller so that searches for duplicate */
+/* entries can be made without redundency. NOTE: file name entries in the */
+/* version table are not zero terminated strings so the comparision must */
+/* be conditioned by length and the search strings length must be checked */
+/* to avoid an error caused by a match of a shorter table entry name. */
+/* */
+/* int MatchFile( char *pchStart, char *szFile ) */
+/* */
+/* ARGUMENTS: pchStart - Ptr specifying search starting point */
+/* szFile - Ptr to file name to match */
+/* RETURNS: int - Offset of entry from start of version */
+/* buffer or -1 if not match or */
+/* S_CORRUPT_TABLE if error */
+/* */
+/***************************************************************************/
+
+int MatchFile( char *pchPtr, char *szFile )
+{
+ for ( ; pchPtr < EndBuf && *pchPtr != 0; pchPtr += *pchPtr + 3 )
+ {
+ if ( !IsValidEntry( pchPtr ) ) /* Corruption check */
+ return( S_CORRUPT_TABLE );
+ else if ( strncmp( szFile, pchPtr + 1, (UINT)((int)*pchPtr) ) == S_OK &&
+ *(szFile + *pchPtr) == EOL )
+ return( pchPtr - LieBuffer ); /* Return ptr offset */
+ }
+ return( S_ENTRY_NOT_FOUND ); /* Return no match */
+}
+
+/***************************************************************************/
+/* Checks a version table entry to see if it a valid entry. The definition */
+/* of a valid entry is one which has a file length less than MAX_NAME_LEN */
+/* and the entire entry lies within the version table. */
+/* */
+/* int IsValidEntry( char *pchPtr ) */
+/* */
+/* ARGUMENTS: pchPtr - Ptr to version tbl entry in table buffer */
+/* RETURNS: int - TRUE if entry is valid else FALSE */
+/* */
+/***************************************************************************/
+
+int IsValidEntry( char *pchPtr )
+{
+ if ( (int)*pchPtr < MAX_NAME_LEN && (pchPtr + (int)*pchPtr + 3) < EndBuf )
+ return( TRUE );
+ else
+ return( FALSE );
+}
+
+
+/***************************************************************************/
+/* Returns a pointer to the next free entry in the version table. If there */
+/* are no free entries left in the buffer a NULL ptr will be returned. */
+/* Since DeleteEntry is always called before AddEntry there is no check */
+/* for table corruption since it will have already been done by the */
+/* DeleteEntry call. */
+/* */
+/* char *GetNextFree( void ) */
+/* */
+/* ARGUMENTS: NONE */
+/* RETURNS: char* - Ptr to next free entry or NULL if tbl full */
+/* */
+/* NOTE: This caller of this function must check to be sure any entry any */
+/* entry to be added at the ptr returned will fit in the remaining */
+/* buffer area because the remaining buffer size may be less than */
+/* MAX_ENTRY_SIZE. */
+/* */
+/***************************************************************************/
+
+char *GetNextFree( void )
+{
+ char *pchPtr;
+
+ for ( pchPtr = LieBuffer; *pchPtr != 0 && pchPtr < EndBuf;
+ pchPtr += *pchPtr + 3 )
+ ;
+
+ return( pchPtr < EndBuf ? pchPtr : NULL );
+}
+
+/***************************************************************************/
+/* Opens the DOS system file and reads in the table offset and length */
+/* structure. Then allocates a buffer and reads in the table. */
+/* */
+/* int ReadVersionTable( void ) */
+/* */
+/* ARGUMENTS: NONE */
+/* RETURNS: int - OK if successful else error code */
+/* */
+/***************************************************************************/
+
+int ReadVersionTable( void )
+{
+ register iStatus; /* Function's return value */
+ int iFile; /* DOS file handle */
+ unsigned uRead; /* Number of bytes read from file */
+
+
+ /* Open the file and read in the max buffer len from stack seg */
+
+ if ( _dos_open( Entry.Path, O_RDONLY, &iFile ) != S_OK )
+ return( S_FILE_NOT_FOUND );
+
+ if ( _dos_read( iFile, &ExeHdr, sizeof( ExeHdr ), &uRead ) == S_OK &&
+ uRead == sizeof( ExeHdr ) )
+ {
+ FileOffset += (long)(ExeHdr.HeaderParas * 16);
+ if ( SeekRead( iFile, &DevHdr, FileOffset, sizeof( DevHdr ) ) == S_OK )
+ {
+ if ( strncmp( DevHdr.Name, szSetVer, 8 ) == S_OK &&
+ DevHdr.VersMajor == 1 )
+ {
+ FileOffset += DevHdr.TblOffset;
+ if ( (LieBuffer = malloc( DevHdr.TblLen )) == NULL )
+ iStatus = S_MEMORY_ERROR;
+
+ else if ( SeekRead( iFile, LieBuffer, FileOffset,
+ DevHdr.TblLen ) == S_OK )
+ {
+ iStatus = S_OK;
+ EndBuf = LieBuffer + DevHdr.TblLen;
+ }
+ }
+ else
+ iStatus = S_INVALID_SIG;
+ }
+ else
+ iStatus = S_FILE_READ_ERROR;
+ }
+ else
+ iStatus = S_FILE_READ_ERROR;
+ _dos_close( iFile );
+
+ return( iStatus );
+}
+
+/***************************************************************************/
+/* Opens the DOS system file and writes the versin table back to the file. */
+/* */
+/* int WriteVersionTable( void ) */
+/* */
+/* ARGUMENTS: NONE */
+/* RETURNS: int - OK if successful else error code */
+/* */
+/***************************************************************************/
+
+int WriteVersionTable( void )
+{
+ register iStatus; /* Function's return value */
+ int iFile; /* DOS file handle */
+ unsigned uWritten; /* Number of bytes written to file */
+ struct find_t Info;
+
+ if ( _dos_findfirst( Entry.Path, _A_HIDDEN|_A_SYSTEM, &Info ) == S_OK &&
+ _dos_setfileattr( Entry.Path, _A_NORMAL ) == S_OK &&
+ _dos_open( Entry.Path, O_RDWR, &iFile ) == S_OK )
+ {
+ if ( _dos_seek( iFile, FileOffset, SEEK_SET ) == FileOffset &&
+ _dos_write(iFile, LieBuffer, DevHdr.TblLen, &uWritten ) == S_OK &&
+ uWritten == DevHdr.TblLen )
+ iStatus = S_OK;
+ else
+ iStatus = S_FILE_WRITE_ERROR;
+
+ _dos_setftime( iFile, Info.wr_date, Info.wr_time );
+ _dos_close( iFile );
+ _dos_setfileattr( Entry.Path, (UINT)((int)(Info.attrib)) );
+ }
+ else
+ iStatus = S_FILE_NOT_FOUND;
+
+ return( iStatus );
+}
+
+/***************************************************************************/
+/* Seeks to the specified offset in a file and reads in the specified */
+/* number of bytes into the caller's buffer. */
+/* */
+/* unsigned SeekRead( int iFile, char *Buf, long lOffset, unsigned uBytes )*/
+/* */
+/* ARGUMENTS: iFile - Open DOS file handle */
+/* Buf - Ptr to read buffer */
+/* lOffset - Offset in file to start reading at */
+/* uBytes - Number of bytes to read */
+/* RETURNS: unsigned - S_OK if successfull else S_FILE_READ_ERROR */
+/* */
+/***************************************************************************/
+
+int SeekRead( int iFile, void *Buf, long lOffset, unsigned uBytes )
+{
+ unsigned uRead;
+
+ if ( _dos_seek( iFile, lOffset, SEEK_SET ) == lOffset &&
+ _dos_read( iFile, Buf, uBytes, &uRead ) == S_OK &&
+ uRead == uBytes )
+ return( S_OK );
+ else
+ return( S_FILE_READ_ERROR );
+}
diff --git a/private/mvdm/dos/v86/cmd/setver/setver.doc b/private/mvdm/dos/v86/cmd/setver/setver.doc
new file mode 100644
index 000000000..92246f378
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/setver.doc
@@ -0,0 +1,194 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+
+ SETVER Command overview
+ MS-DOS 5.00
+ 05/13/90
+
+SETVER is an external MS-DOS command which allows the user to
+determine the MS-DOS version number will be reported by MS-DOS
+to a specified user application. This will allow applications
+which check for a specific version of MS-DOS to run under
+MS-DOS 5.0.
+
+A version table has been included as part of the MS-DOS system
+files on the user's boot disk. SETVER will update the system
+files so that next time and times thereafter, that MS-DOS is
+booted, the updated version table will be in effect. NOTE: The
+changes to the version table will not take effect until the
+user reboots using the updated version of the table.
+
+
+NOTE:
+ Currently there is 512 bytes set aside for entries in the
+ table but Ericst may want to up it in the near future so
+ for right now I wouldn't mention the number of entries
+ which the table will hold. Right now it will hold a minimum
+ of 34 entries.
+
+==========================================================================
+
+USEAGE:
+ List table: SETVER [D:]
+ Add entry: SETVER [D:] name.ext N.NN
+ Delete entry: SETVER [D:] name.ext /DELETE
+ Display help SETVER /?
+
+WHERE:
+ D: is the drive containing MSDOS.SYS
+ name.ext is the executable file name
+ N.NN is the major and minor version numbers
+ /DELETE is any combination of /D - /DELETE
+
+==========================================================================
+
+MESSAGES:
+
+ If the table is being updated and there are no errors detected
+ this message will be displayed.
+
+ "Version table successfully updated"
+
+ If the version table is only being displayed it will listed
+ on the screen in the format:
+
+ WIN200.BIN 3.30
+ EXCEL.EXE 4.01
+ MYPROG.EXE 3.20
+ DELNODE.EXE 4.01
+
+
+==========================================================================
+
+EXAMPLE 1:
+
+ SETVER a: excel.exe 4.01
+
+ This example will add a new entry in the table for EXCEL.EXE
+ to the version table on drive A: and will tell DOS to always
+ report the MS-DOS version number 4.01 to this application.
+
+EXAMPLE 2:
+
+ SETVER a: excel.exe /DELETE
+
+ This example will delete the EXCEL.EXE entry from the version
+ table on drive A:.
+
+EXAMPLE 3:
+
+ SETVER
+
+ This example will list the contents of the version table
+ on the current drive.
+
+EXAMPLE 4:
+
+ SETVER /?
+
+ This example will cause the SETVER command to display
+ help in using the command.
+
+==========================================================================
+
+RETURN CODES:
+ 0 Successful completion
+ 1 Invalid command switch
+ 2 Invalid file name specified
+ 3 Insuffient memory
+ 4 Invalid version number format
+ 5 Specified entry was not found in table
+ 6 MS-DOS system files not found
+ 7 Invalid drive specifier
+ 8 Too many command line parameters
+ 9 Missing parameters
+ 10 Error reading MS-DOS system files
+ 11 Version table is corrupt in system files
+ 12 Specifed MS-DOS system files do not support a version table
+ 13 Insuffient space in version table for new entry
+ 14 Error writing MS-DOS system files
+
+
+==========================================================================
+
+ERROR MESSAGES:
+
+ERROR: Invalid switch
+
+ The user specified an invalid command line switch.
+
+ERROR: Invalid file name
+
+ The user specified an invalid file name for a new
+ version table entry. Possible causes are the specified
+ file name did not follow standard MS-DOS file naming
+ conventions or was a reserved MS-DOS file name
+
+ERROR: Insuffient memory
+
+ There is insuffient memory for the program to run.
+
+ERROR: Invalid version number format must be 2.11 - 9.99
+
+ An invalid version number was specified. Possible causes
+ of this are that the specified version number was not in
+ the proper format or it was less than 2.11 or greater than
+ 9.99.
+
+ERROR: Specified entry was not found in the version table
+
+ The tried to delete an entry which was not in the existing
+ version table.
+
+ERROR: File MSDOS.SYS not found on specified drive
+
+ The user specified a drive which does not contain MS-DOS
+ system files.
+
+ERROR: Invalid drive specifier
+
+ The user specified a drive that does not exist.
+
+ERROR: Too many command line parameters
+
+ The user specifed too many command line parameters such as
+ by specifing both a version number and the /DELETE switch.
+
+ERROR: Missing parameter
+
+ The user entered a file name but forgot to include either
+ a version number or the /DELETE switch.
+
+ERROR: Reading MS-DOS system file
+
+ There was an error trying to read the system files on the
+ specified drive. Possible cause is that the specified drive
+ does not contain system files.
+
+ERROR: Version table is corrupt
+
+ An error was detected in the version table and it is not
+ useable. The user should replace the system files on that
+ disk and try again.
+
+ERROR: System files on the specifed drive do not support a version table
+
+ The user specified a drive which contains MS-DOS system files
+ which at not version 5.0 or above.
+
+ERROR: Insuffient space in version table for new entry
+
+ The version table on the specified drive is full. The user can
+ delete some entries from the table and try again.
+ NOTE: To be sure of room for the new entry the user should be
+ sure that the entry that is deleted has a file name
+ at least as long as the new entry.
+
+ERROR: Writing MS-DOS system file
+
+ There was an error while trying to write the updated version
+ version table. This would be caused by a bad disk.
diff --git a/private/mvdm/dos/v86/cmd/setver/setver.h b/private/mvdm/dos/v86/cmd/setver/setver.h
new file mode 100644
index 000000000..212eeffeb
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/setver.h
@@ -0,0 +1,195 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+/***************************************************************************/
+/* */
+/* SETVER.H */
+/* */
+/* Include file for MS-DOS set version program. */
+/* */
+/* johnhe 05-01-90 */
+/***************************************************************************/
+
+#pragma pack(1)
+
+/***************************************************************************/
+/* Normal variable typedefs. These type defs are compatible with OS2 */
+/* typedefs. */
+/***************************************************************************/
+
+typedef char CHAR;
+typedef unsigned char UCHAR;
+typedef int INT;
+typedef unsigned int UINT;
+typedef long LONG;
+typedef unsigned long UL;
+typedef float FLOAT;
+typedef double DOUBLE;
+
+/***************************************************************************/
+/* Standard global constants. */
+/* Don't change the TRUE define because some functions depend on it being */
+/* 1 instead of !FALSE. */
+/***************************************************************************/
+
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+#ifndef TRUE
+ #define TRUE 1
+#endif
+
+#define EOL '\0'
+
+#define HEX 16
+#define DECIMAL 10
+#define OCTAL 8
+
+/***************************************************************************/
+/* Module specific constants */
+/***************************************************************************/
+
+#define MAX_NAME_LEN 13
+#define MAX_ENTRY_SIZE (MAX_NAME_LEN + 1 + 2 + 1)
+#define MAX_PATH_LEN 68
+
+#define MAX_VERSION 0x0a00 /* Max version 9.99 */
+#define MIN_VERSION 0x020b /* Min version 2.11 */
+
+#define S_ERROR -1
+#define S_OK 0
+#define S_INVALID_SWITCH -1
+#define S_INVALID_FNAME -2
+#define S_MEMORY_ERROR -3
+#define S_BAD_VERSION_FMT -4
+#define S_ENTRY_NOT_FOUND -5
+#define S_FILE_NOT_FOUND -6
+#define S_BAD_DRV_SPEC -7
+#define S_TOO_MANY_PARMS -8
+#define S_MISSING_PARM -9 /* Missing version number or /d */
+#define S_FILE_READ_ERROR -10
+#define S_CORRUPT_TABLE -11
+#define S_INVALID_SIG -12
+#define S_NO_ROOM -13
+#define S_FILE_WRITE_ERROR -14
+#define S_INVALID_PATH -15
+
+#define DO_LIST 1
+#define DO_ADD_FILE 2
+#define DO_DELETE 3
+#define DO_HELP 4
+#define DO_QUIET 5
+
+#define VERSION_COLUMN 16 /* Screen column for version # */
+#define SIGNATURE_STR "PCMN" /* Signature string in MSDOS.SYS */
+#define SIGNATURE_LEN 4
+#define BUF_LEN 4096
+
+/***************************************************************************/
+/* Defines for possible command line switches. */
+/***************************************************************************/
+
+#define HELP_SWITCH "?"
+#define DEL_SWITCH "DELETE"
+#define SWITCH_CHAR '/'
+#define QUIET_SWITCH "QUIET"
+
+/***************************************************************************/
+
+struct TableEntry
+{
+ char Drive;
+ char Path[ MAX_PATH_LEN ];
+ char szFileName[ MAX_NAME_LEN + 1 ];
+ UCHAR MajorVer;
+ UCHAR MinorVer;
+};
+
+struct ExeHeader
+{
+ UINT Signature;
+ UINT LastPageLen;
+ UINT TotalFilePages;
+ UINT NumRelocEntries;
+ UINT HeaderParas;
+ UINT MinEndParas;
+ UINT MaxEndParas;
+ UINT StackSeg;
+ UINT StackPtr;
+ UINT NegChkSum;
+ UINT IndexPtr;
+ UINT CodeSeg;
+ UINT RelocTblOffset;
+ UINT OverlayNum;
+};
+
+struct DevHeader
+{
+ char far *NextDevice;
+ unsigned DeviceAttrib;
+ char near *Strategy;
+ char near *Entry;
+ char Name[ 8 ];
+ char VersMinor;
+ char VersMajor;
+ long TblOffset;
+ unsigned TblLen;
+};
+
+/***************************************************************************/
+/* Function prototypes for SETVER.C */
+/***************************************************************************/
+
+extern int main( int argc, char *argv[] );
+static int Error( int iErrCode );
+static int DoFunction( int iFunction );
+
+static void DisplayMsg( char *tbl[] );
+static int DeleteEntry( void );
+static int AddEntry( void );
+
+static int DisplayTable( void );
+static int MatchFile( char *pchStart, char *szFile );
+static int IsValidEntry( char *pchPtr );
+static char *GetNextFree( void );
+
+static int ReadVersionTable( void );
+static int WriteVersionTable( void );
+
+static int SeekRead( int iFile, void *Buf, long lOffset, unsigned uBytes );
+
+/***************************************************************************/
+/* Function prototypes for PARSE.C */
+/***************************************************************************/
+
+extern int ParseCmd( int argc, char *argv[], struct TableEntry *Entry );
+static int IsValidFile( char *szFileName );
+static UINT ParseVersion( char *szVersion );
+static int IsDigitStr( char *szStr );
+static char *SkipLeadingChr( char *szStr, char chChar );
+static void RemoveTrailing( char *szStr, char chChar );
+static int MatchSwitch( char *szCmdParm, char *szTestSwitch );
+static int IsValidFileName( char *szFile );
+static int IsReservedName( char *szFile );
+static int IsWildCards( char *szFile );
+static int ValidFileChar( char *szFile );
+static int IsValidFileChr( char Char );
+
+#ifdef DBCS
+static int IsDBCSLeadByte(unsigned char);
+static int CheckDBCSTailByte(unsigned char *,unsigned char *);
+#endif
+
+/***************************************************************************/
+/* Function prototypes for DOS.ASM */
+/***************************************************************************/
+
+extern int IsValidDrive( unsigned DrvLetter );
+extern void PutStr( char *String );
+extern long _dos_seek( int Handle, long lOffset, int Mode );
+extern int SetVerCheck ( void ); /* M001 */
+
diff --git a/private/mvdm/dos/v86/cmd/setver/setver.tag b/private/mvdm/dos/v86/cmd/setver/setver.tag
new file mode 100644
index 000000000..0c8a2b1b0
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/setver.tag
@@ -0,0 +1,16 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+M000 01/09/90 JAH message.h Changed text of help message to show
+ new path option to SETVER.EXE bug #5022
+
+M001 01/10/90 JAH dos.asm Added a check to see if SETVER.EXE is
+ message.h installed in the device chain and if
+ setver.c not display a message saying how to get
+ setver.h SETVER working. BUG # 5025
+
+
+
diff --git a/private/mvdm/dos/v86/cmd/setver/usa-ms/message.h b/private/mvdm/dos/v86/cmd/setver/usa-ms/message.h
new file mode 100644
index 000000000..efcc38a4a
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/setver/usa-ms/message.h
@@ -0,0 +1,75 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+/***************************************************************************/
+/* */
+/* MESSAGE.H */
+/* */
+/* Include file for MS-DOS set version program. */
+/* */
+/* johnhe 05-01-90 */
+/***************************************************************************/
+
+char *ErrorMsg[]=
+{
+ "\r\nERROR: ",
+ "Invalid switch.",
+ "Invalid filename.",
+ "Insuffient memory.",
+ "Invalid version number, format must be 2.11 - 9.99.",
+ "Specified entry was not found in the version table.",
+ "Could not find the file SETVER.EXE.",
+ "Invalid drive specifier.",
+ "Too many command line parameters.",
+ "Missing parameter.",
+ "Reading SETVER.EXE file.",
+ "Version table is corrupt.",
+ "The SETVER file in the specified path is not a compatible version.",
+ "There is no more space in version table new entries.",
+ "Writing SETVER.EXE file."
+ "An invalid path to SETVER.EXE was specified."
+};
+
+char *SuccessMsg = "\r\nVersion table successfully updated";
+char *SuccessMsg2 = "The version change will take effect the next time you restart your system";
+char *szMiniHelp = " Use \"SETVER /?\" for help";
+char *szTableEmpty = "\r\nNo entries found in version table";
+
+char *Help[] =
+{
+ "Sets the version number that MS-DOS reports to a program.\r\n",
+ "Display current version table: SETVER [drive:path]",
+ "Add entry: SETVER [drive:path] filename n.nn",
+ "Delete entry: SETVER [drive:path] filename /DELETE [/QUIET]\r\n",
+ " [drive:path] Specifies location of the SETVER.EXE file.",
+ " filename Specifies the filename of the program.",
+ " n.nn Specifies the MS-DOS version to be reported to the program.",
+ " /DELETE or /D Deletes the version-table entry for the specified program.",
+ " /QUIET Hides the message typically displayed during deletion of",
+ " version-table entry.",
+ NULL
+
+};
+char *Warn[] =
+{
+ "\nWARNING - The application you are adding to the MS-DOS version table ",
+ "may not have been verified by Microsoft on this version of MS-DOS. ",
+ "Please contact your software vendor for information on whether this ",
+ "application will operate properly under this version of MS-DOS. ",
+ "If you execute this application by instructing MS-DOS to report a ",
+ "different MS-DOS version number, you may lose or corrupt data, or ",
+ "cause system instabilities. In that circumstance, Microsoft is not ",
+ "reponsible for any loss or damage.",
+ NULL
+};
+
+char *szNoLoadMsg[] = /* M001 */
+{
+ "",
+ "NOTE: SETVER device not loaded. To activate SETVER version reporting",
+ " you must load the SETVER.EXE device in your CONFIG.SYS.",
+ NULL
+};
diff --git a/private/mvdm/dos/v86/cmd/share/makefile b/private/mvdm/dos/v86/cmd/share/makefile
new file mode 100644
index 000000000..abdbb3dfa
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/share/makefile
@@ -0,0 +1,33 @@
+# Makefile for share.exe
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+dest =share.exe
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.lst del *.lst
+
+
+share.obj: share.asm \
+ makefile
+
+$(dest): share.obj
+ link16 $(exelink) @share.lnk
diff --git a/private/mvdm/dos/v86/cmd/share/share.asm b/private/mvdm/dos/v86/cmd/share/share.asm
new file mode 100644
index 000000000..8770c0635
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/share/share.asm
@@ -0,0 +1,24 @@
+; share.asm
+;
+; Copyright (c) 1991, Microsoft Corporation
+;
+; History:
+; 13-Apr-1992 Sudeep Bharati (sudeepb)
+; Created.
+;
+; On NT this utility is just a stub which does nothing.
+;
+
+code segment byte public 'CODE'
+ assume cs:code, ds:code, es:code
+
+ org 100h
+public start
+start:
+ mov ah,4ch
+ xor al,al
+ int 21h
+ ret
+
+code ends
+ end start
diff --git a/private/mvdm/dos/v86/cmd/share/share.lnk b/private/mvdm/dos/v86/cmd/share/share.lnk
new file mode 100644
index 000000000..f9ac1c549
--- /dev/null
+++ b/private/mvdm/dos/v86/cmd/share/share.lnk
@@ -0,0 +1,2 @@
+share.OBJ
+share.EXE,/LI/MAP;
diff --git a/private/mvdm/dos/v86/dev/ansi/ansi.asm b/private/mvdm/dos/v86/dev/ansi/ansi.asm
new file mode 100644
index 000000000..a17b62272
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansi.asm
@@ -0,0 +1,1848 @@
+PAGE ,132
+TITLE CONDEV FANCY CONSOLE DRIVER
+;******************************************************************************
+
+; Change Log:
+
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 06/01/90 MKS C02 Bug#173. ANSI was permitting you to go one line below
+; the bottom of the screen. PROMPT $e[25;3H $e[1B will
+; show you. (PYS: badly done. M005)
+;******************************************************************************
+
+;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+; ADDRESSES FOR I/O
+
+;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+;------------------------------------------------------------------------------
+; New functionality in DOS 4.00
+; GHG fix scrolling flashes on Mod 25/30's
+; P1767 VIDEO_MODE_TABLE not initialized correctly 10/16/87 J.K.
+; D375 /X needs to be supported by ANSI sequence also 12/14/87 J.K.
+; D397 /L option for Enforcing number of lines 12/17/87 J.K.
+; D479 An option to disable the extended keyboard functions 02/12/88 J.K.
+; P4241 AN001 fix be Revised to fix this problem 04/20/88 J.K.
+; P4532 Scrolling has a snow for CGA adapter 04/27/88 J.K.
+; P4533 In mode Dh, Eh, Fh, 10h and 13h, Scrolling not working 04/27/88 J.K.
+; P4766 In mode 11h, and 12h erase display leaves bottom 5 05/24/88 F.G.
+;------------------------------------------------------------------------------
+
+INCLUDE DEVSYM.INC
+INCLUDE ANSI.INC ;equates and structures
+INCLUDE VECTOR.INC
+
+BREAK <ANSI driver code>
+
+PUBLIC SWITCH_X ; /X option for extended keyboard redefinition support
+PUBLIC SCAN_LINES
+PUBLIC VIDEO_MODE_TABLE
+PUBLIC VIDEO_TABLE_MAX
+PUBLIC MAX_VIDEO_TAB_NUM ;P1767
+PUBLIC PTRSAV
+PUBLIC ERR1
+PUBLIC ERR2
+PUBLIC EXT_16
+PUBLIC BRKKY
+PUBLIC COUT
+PUBLIC BASE
+PUBLIC MODE
+PUBLIC MAXCOL
+PUBLIC EXIT
+PUBLIC NO_OPERATION
+PUBLIC HDWR_FLAG
+PUBLIC SWITCH_L
+PUBLIC SWITCH_K
+PUBLIC SWITCH_S ; M008 /S for screensize option setting.
+PUBLIC fhavek09 ; M006
+
+PUBLIC CON$READ
+PUBLIC CON$RDND
+PUBLIC CON$FLSH
+PUBLIC CON$WRIT
+PUBLIC VIDEO
+PUBLIC CUU
+PUBLIC CUD
+PUBLIC CUF
+PUBLIC CUB
+PUBLIC CUP
+PUBLIC ED
+PUBLIC CPR
+PUBLIC SM
+PUBLIC RM
+PUBLIC SGR
+PUBLIC DSR
+PUBLIC KEYASN
+PUBLIC EXTKEY
+PUBLIC PSCP
+PUBLIC PRCP
+
+IFDEF JAPAN
+PUBLIC ROW_ADJ
+ENDIF
+
+CODE SEGMENT PUBLIC BYTE
+
+ ASSUME CS:CODE,DS:NOTHING,ES:NOTHING
+;-----------------------------------------------
+
+; C O N - CONSOLE DEVICE DRIVER
+
+
+EXTRN CON$INIT : NEAR ; ANSI initialization code
+EXTRN GENERIC_IOCTL : NEAR ; Generic IOCTL code
+EXTRN REQ_TXT_LENGTH : WORD ; current text length
+EXTRN GRAPHICS_FLAG : BYTE ; graphics flag
+
+ATTRIB EQU CHARDEV+DEVIOCTL+DEV320+ISSPEC+ISCOUT+ISCIN
+CONDEV: SYSDEV <-1,ATTRIB,STRATEGY,ENTRY,'CON '> ; Matches CON
+
+;--------------------------------------------------------------
+
+; COMMAND JUMP TABLES
+CONTBL:
+ DW CON$INIT
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW CON$READ
+ DW CON$RDND
+ DW NO_OPERATION
+ DW CON$FLSH
+ DW CON$WRIT
+ DW CON$WRIT
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW NO_OPERATION
+ DW GENERIC_IOCTL ; generic IOCTL routine offset
+MAX_CMD EQU ($ - CONTBL)/2 ; size of CONTBL
+
+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' ; dynamic support of /X option through ansi sequence
+ DW EXTKEY ; esc[0q = reset it. esc[1q = set it
+ DB 's'
+ DW PSCP ; save cursor postion
+ DB 'u'
+ DW PRCP ; restore cursor position
+IFDEF JAPAN
+ DB 'M'
+ DW DELETE ; delete line
+ DB 'L'
+ DW INSERT ; insert line
+ENDIF
+ 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
+
+
+PTRSAV DD 0
+
+BUF1: BUF_DATA <> ; Next CON Buffer area
+
+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
+
+; Check if header link has to be set (Code ported from
+; DISPLAY.SYS)
+
+ lea bx,BUF1
+ mov di,OFFSET CONDEV ; CON Device header
+
+ mov CONPTR.DEV_HDRO,di
+ mov CONPTR.DEV_HDRS,cs
+ cld ; all moves forward
+
+ cmp CONPTR.CON_STRAO, -1
+ jne L4 ; has been linked to DOS CON
+ cmp CONPTR.CON_STRAS, -1
+ jne L4 ; has been linked to DOS CON
+ ; next device header : ES:[DI]
+ lds si,dword ptr CONPTR.DEV_HDRO
+ les di,HP.SDEVNEXT
+
+L1: ; while pointer to next device header
+ push es ; is not -1
+ pop ax
+ cmp ax,-1
+ jne NOT0FFFF ; leave if both offset and segment are
+ cmp di,-1 ; 0FFFFH
+ je L4
+
+NOT0FFFF:
+ push di
+ push si
+ mov cx,8
+ lea di,NHD.SDEVNAME
+ lea si,HP.SDEVNAME
+ repe cmpsb
+ pop si
+ pop di
+ and cx,cx
+ ; Exit if name is found in linked hd.
+ jnz L3 ; Name is not found
+ ; Name is found in the linked header
+ mov ax,NHD.SDEVSTRAT ; Get the STRATEGY address
+ mov CONPTR.CON_STRAO,ax
+ mov ax,es
+X1: mov CONPTR.CON_STRAS,ax
+
+ mov ax,NHD.SDEVINT ; Get the INTERRUPT address
+ mov CONPTR.CON_INTRO,ax
+ mov ax,es
+X2: mov CONPTR.CON_INTRS,ax
+
+ jmp SHORT L4 ; Device Name
+L3:
+ les di,NHD.SDEVNEXT
+ jmp L1
+L4:
+ lds bx,cs:[PTRSAV] ; GET PONTER TO I/O PACKET
+
+ mov cx,word ptr ds:[bx].COUNT
+
+ mov al,byte ptr ds:[bx].CMD
+ cbw
+ mov si,OFFSET CONTBL
+ add si,ax
+ add si,ax
+ cmp al,MAX_CMD ; not a call for ANSI...chain to lower device
+ ja NO_OPERATION
+
+ifdef KOREA ; <MSCH>
+ mov ah, byte ptr ds:[bx].media
+endif ; KOREA
+
+ les di,dword ptr ds:[bx].TRANS
+
+ ; Following code, supplied by Compaq, is the "hit-it-on-the-head"
+ ; approach to solving the problem of resetting the screen length
+ ; after a character set reload. We should try to find a better
+ ; approach. For now this will stay in. - MGD
+
+ push ax ; SAVE AX
+ mov ax,40H ; GET ROM VAR
+ mov ds,ax ;
+
+ mov al,ds:[84h] ; GET MAX NUM OF ROWS
+ cmp al,0 ; Q:ZERO
+ jne ENTRY10 ; jmp IF NO
+ mov al,24 ; SET TO 24 ROWS
+ENTRY10: ;
+ push cs
+ pop ds
+
+ ASSUME ds:CODE
+
+ inc al ; BUMP FOR ONE BASED
+ mov byte ptr [REQ_TXT_LENGTH],al ; SET LENGTH TO 40:84H VALUE. *F
+ pop ax ; RESTORE AX
+
+ 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:
+ call PASS_CONTROL ; Pass control to lower CON
+ jmp SHORT ERR2
+
+ERR$EXIT:
+ mov ah,10000001B ; MARK ERROR RETURN
+ jmp SHORT ERR1
+
+EXITP PROC FAR
+
+EXIT: mov ah,00000001B
+
+ifdef KOREA
+INTERIM$EXIT: ; <MSCH>
+endif ; KOREA
+
+ERR1: lds bx,cs:[PTRSAV]
+ mov word ptr [bx].STATUS,ax ; MARK OPERATION COMPLETE
+ERR2:
+ 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
+
+
+; PASS CONTROL
+
+; This calls the attached device to perform any further
+; action on the call!
+
+
+PASS_CONTROL PROC
+ lea si,BUF1
+ les bx,cs:[PTRSAV] ; pass the request header to the
+ call dword ptr cs:[si].CON_STRAO ; CON strategy routine.
+ call dword ptr cs:[si].CON_INTRO ; interrupt the CON
+ ret
+PASS_CONTROL ENDP
+;-----------------------------------------------
+
+; BREAK KEY HANDLING
+
+BRKKY:
+ mov byte ptr 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
+
+SAVE_CHAR DW 0 ; Temp storage for char/attr for new scroll code
+
+EXT_16 DB 0 ; Extended INT 16h flag
+SWITCH_X DB OFF ; /X flag
+SWITCH_L DB OFF ; DCR397; 1= /L flag entered.
+SWITCH_K DB OFF ; To control EXT_16
+fhavek09 DB OFF ; M006
+SCAN_LINES DB ? ; flag for available scan lines (VGA)
+HDWR_FLAG DW 0 ; byte of flags indicating video support
+SWITCH_S DB OFF ; M008; /S flag
+
+ifdef KOREA ;
+REQ_TYPE DB 0 ;
+EXT_REQ_TYPE DB 0 ;
+LEADBYTE DB 0 ;
+TRAILBYTE DB 0 ;
+ECSPRE DB 0 ;
+endif ; KOREA ;
+
+VIDEO_MODE_TABLE LABEL BYTE ; table containing applicable
+MODE_TABLE <> ; video modes and corresponding
+MODE_TABLE <> ; data.
+MODE_TABLE <> ; this table is initialized at
+MODE_TABLE <> ; INIT time
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+MODE_TABLE <>
+
+ifdef KOREA ; The KOREAN video mode
+MODE_TABLE <> ; have 4 more than standard
+MODE_TABLE <> ; VGA card
+MODE_TABLE <> ;
+MODE_TABLE <> ;
+endif ; KOREA ;
+
+VIDEO_TABLE_MAX EQU $ ; maximum address for video table
+MAX_VIDEO_TAB_NUM EQU ($-VIDEO_MODE_TABLE)/TYPE MODE_TABLE ;P1767 Max number of table
+
+
+IFDEF DBCS
+dbcs_flag DB 0 ; 0=single, 1=lead byte, 2=tail byte
+ENDIF
+IFDEF JAPAN
+new_mode DB 0 ; mode for '>'
+row_adj DB 0 ; for ESC[>1l
+ENDIF
+
+;-------------------------------------------------------------
+
+; 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:
+
+ifdef KOREA ; <MSCH>
+;
+ cmp [leadbyte],1 ; Is the previous byte a lead byte? ; KeyW
+ jnz TestDBCSRange ; No,
+ mov byte ptr [leadbyte],0
+ mov byte ptr [trailbyte],1 ; Mark that this is trail byte of ECS
+ jmp short OUTCHR
+;
+;
+; Note : TestECS routine is hard coded. If you have the different code range,
+; you should change some codes below.
+; 1990/11/9 This routine is changed to use IsDBCS routines.
+;
+TestDBCSRange:
+ mov byte ptr [trailbyte], 0 ; Mark it as a non trail byte
+ call IsDBCSleadbyte
+ jnz realout ; Jump if one byte code
+;
+; CMP AL, 0A1H ;
+; JB REALOUT ;
+; CMP AL, 0FEH ;
+; JA REALOUT ;
+
+ mov byte ptr [leadbyte], 1 ; it as a lead byte
+ mov ah, [col] ;
+ cmp ah, [maxcol] ;
+ jnz outchr ;
+; ;
+; Decide the position to print the Lead byte which is on the column boundary.
+;
+ cmp [wrap],0 ;
+ jz skip1 ;
+ dec [col] ;
+ cmp [ecspre],1 ;
+ jnz oneback1 ;
+ dec [col] ;
+oneback1: ;
+ call setit1 ;
+ jmp short outchr ;
+skip1: ;
+ push ax ;
+ call outchr1 ;
+ pop ax ;
+ jmp short outchr ;
+realout:
+endif ; KOREA ;
+
+ cmp al,13
+ jnz trylf
+ mov [COL],0
+
+ifdef KOREA
+ jmp setit
+else
+IFDEF JAPAN
+ jmp setit
+ELSE
+ jmp short setit
+ENDIF
+endif ; KOREA
+
+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]
+
+ifdef KOREA
+;
+; Set boundary position for DBCS code.
+; No lead byte can arrive here.
+;
+ cmp [trailbyte],1
+ jnz onebk
+ dec [col]
+onebk:
+ call setit1
+;
+; We don't need ECSPRE change, because we have enough time to deal with it.
+; Wait for another character to change ECSPRE.
+;
+endif ; KOREA
+
+ 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
+
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jne tmplab1
+ mov ah,DEFAULT_LENGTH
+ jmp short tmplab2
+tmplab1:
+ mov ah,byte ptr [REQ_TXT_LENGTH]
+tmplab2:
+LF2: ; GHG Fix for ROUNDUP/PALACE
+IFDEF JAPAN
+ sub ah,row_adj
+ENDIF
+ 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:
+
+ifdef KOREA
+preset:
+ xor al, al
+ cmp [trailbyte],al
+ jz noDBCStrail
+ inc al
+noDBCStrail:
+ mov [ecspre], al
+setit1:
+endif ; KOREA
+
+ mov dh,row
+ mov dl,col
+ mov bh,[bpage]
+ mov ah,2
+ int 10h
+ ret
+
+;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.
+
+; Following code is bug fix supplied by Compaq - MGD
+scroll:
+
+ifdef KOREA ; Responsible for ROM
+ mov al, 10
+ jmp torom
+else
+IFDEF JAPAN ; ### if JAPAN ###
+
+ xor cx,cx
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz scroll10 ; if nor graphic
+ mov dh,DEFAULT_LENGTH
+ xor bh,bh
+ jmp short scroll20
+scroll10:
+ mov dh,byte ptr [REQ_TXT_LENGTH]
+ mov bh,[ATTR]
+scroll20:
+ sub dh,row_adj
+ dec dh
+ mov dl,[MAXCOL]
+ mov ax,0601h ; scroll up
+ int 10h
+ jmp short setit
+
+else ; ### if Not JAPAN ###
+
+ mov al,mode ; get display mode
+ cmp al,4 ;Q: mode less than 4?
+ jc is_text ;Y: perform kludge
+ cmp al,7 ;N: Q: monochrome mode?
+ je is_text ; Y: perform kludge
+ mov al,10 ; send the line feed to the ROM
+ jmp torom ; exit
+is_text:
+ mov ah,8 ; read char/attr at cursor pos
+ mov bh,[bpage]
+ int 10h
+ mov [save_char],ax ; save char/attribute
+
+ mov ah,9 ; write char at cursor pos
+ mov bx,[ATTRW] ; use current attribute
+ mov cx,1
+ int 10h
+
+ mov al,10 ; send the line feed to the ROM
+ call torom
+ mov ah,3 ; read cursor pos
+ int 10h
+ push dx ; save it
+ mov ah,2 ; set cursor position
+ dec dh ; (to row-1)
+ int 10h
+
+ mov ax,[save_char] ; retrieve saved char/attr
+ mov bl,ah
+ mov ah,9 ; write it back to the screen
+ mov cx,1
+ int 10h
+
+ pop dx ; retrieve new cursor position
+ mov ah,2 ; set cursor position
+ int 10h
+ ret
+ENDIF ; ### end if Not JAPAN ###
+endif ; KOREA
+
+
+;------------------------------------------------------
+
+; CONSOLE READ ROUTINE
+
+CON$READ:
+ jcxz CON$EXIT
+
+ifdef KOREA ;
+ mov [req_type], 0 ;
+ mov [ext_req_type], 10h ;
+ test ah, 00000001b ;
+ jz con$loop ;
+ mov [req_type], 0f0h ; ; Get Interim mode
+ mov [ext_req_type], 0f8h ;
+ cmp cx, 1 ;
+ jnz con$ndisp ;
+ ;
+ call chrin ;
+ stosb ;
+ cmp ah, 0f0h ; ; Is this an interim code ?
+ jnz con$exit ;
+ mov ah, 00000101b ;
+ jmp interim$exit ; ; return to DOS with interim flag set
+con$ndisp: ;
+ call chrin ;
+ cmp ah, 0f0h ; ; Is this an interim code ?
+ jz con$ndisp ; ; Skip the interims
+ stosb ;
+ LOOP CON$NDISP ;
+ JMP EXIT ;
+endif ; KOREA
+
+
+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
+
+ifdef KOREA
+ mov ah, [req_type]
+else
+ xor ah,AH
+endif ; KOREA
+
+ cmp EXT_16,ON ; extended interrupt available?
+ jne tmplab3
+
+ifdef KOREA
+ mov ah, [ext_req_type]
+else
+ mov ah,10h ; yes..perform extended call
+endif ; KOREA
+
+ INT 16h
+
+ifdef KOREA
+ cmp ah, 0f0h
+ jz keyret1 ; Breief return for the interim code
+endif ; KOREA
+
+ cmp SWITCH_X,OFF ; /X switch used?
+ jne tmplab5
+ call CHECK_FOR_REMAP ; no....map to normal call
+
+tmplab5:
+ call SCAN ; check for redefinition
+ jz tmplab4 ; no redefinition?....and
+ cmp SWITCH_X,ON ; /X switch used?
+ jne tmplab4
+ call CHECK_FOR_REMAP ; then remap..
+ or bx,bx ; reset zero flag for jump test in old code
+
+ jmp short tmplab4
+
+; extended interrupt not available
+
+tmplab3:
+ int 16h
+
+ifdef KOREA
+ cmp ah, 0f0h
+ jz keyret1
+endif ; KOREA
+
+ call SCAN ; check for redefinition
+
+tmplab4:
+ jnz ALT10 ; IF NO MATCH JUST RETURN IT
+
+ dec cx
+ dec cx
+ inc bx
+ inc bx
+ cmp al,0 ; check whether keypacket is an extended one
+ jz tmplab7
+ cmp al,0e0h
+ jnz tmplab6
+
+ifdef KOREA
+ cmp ah, 0f0h
+ jb mschtmp2
+ cmp ah, 0f2h
+ jbe tmplab7
+mschtmp2:
+endif ; KOREA
+
+ cmp SWITCH_X,1
+ jnz tmplab6
+tmplab7:
+ dec cx ; adjust pointers
+ inc bx ; appropiately
+tmplab6:
+ 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:
+
+ifdef KOREA
+ mov ah, 0f1h
+keyret1:
+endif ; KOREA
+
+ 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
+ cmp al,0 ; check whether extended keypacket
+ jz tmplab8
+ cmp al,0e0h ; extended must be enabled with /x
+ jnz tmplab9
+
+ifdef KOREA ; Jump when Hangeul char
+ cmp ah, 0f0h
+ jb mschtmp1
+ cmp ah, 0f2h
+ jbe tmplab9
+mschtmp1:
+endif ; KOREA
+
+ cmp SWITCH_X,ON
+ jnz tmplab9
+tmplab8:
+ cmp ax,word ptr [bx+1] ; yes...compare the word
+ jmp short tmplab10
+tmplab9:
+ cmp al,byte ptr [bx+1] ; no...compare the byte
+tmplab10:
+ 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
+
+ifdef KOREA
+ jnz To_RDEXIT
+else
+ jnz RDEXIT
+endif ; KOREA
+
+ cmp [KEYCNT],0
+ jz RD1
+ mov bx,[KEYPTR]
+ mov al,byte ptr [bx]
+
+ifdef KOREA
+to_rdexit:
+ jmp rdexit
+else
+ jmp SHORT RDEXIT
+endif ; KOREA
+
+RD1:
+
+ifdef KOREA
+ mov [req_type], 1
+ mov [ext_req_type], 11H
+ test ah, 00000001b
+ jz rd11
+ mov [req_type], 0f1h
+ mov [ext_req_type], 0f9H
+RD11:
+ mov ah, [req_type]
+ cmp ext_16, on
+ jnz tmplab11
+ mov ah, [ext_req_type]
+else
+ mov ah,1
+ cmp EXT_16,ON
+ jnz tmplab11
+ add ah,10h ; yes....adjust to extended call
+endif ; KOREA
+
+tmplab11:
+ int 16h
+ jz CheckForEvent
+ or ax,ax
+ jnz RD2
+
+ifdef KOREA
+ mov ah, [req_type]
+ and ah, 11111110b
+else
+ mov ah,0
+endif ; KOREA
+
+ cmp EXT_16,ON ; extended interrupt available?
+ jne tmplab12
+
+ifdef KOREA
+ mov ah, [ext_req_type]
+ and ah, 11111110b
+else
+ mov ah,10h ; yes..perform extended call
+endif ; KOREA
+
+ int 16h
+ cmp SWITCH_X,OFF ; /X switch used?
+ jnz tmplab13
+ call CHECK_FOR_REMAP ; no....map to normal call
+ jmp short tmplab13
+tmplab12:
+ int 16h
+tmplab13:
+ jmp CON$RDND
+
+RD2:
+
+ifdef KOREA
+ cmp ah, 0f0h
+ jz rdexit
+endif ; KOREA
+
+ call SCAN
+ jz tmplab14 ; if no redefinition
+ cmp EXT_16,ON
+ jnz tmplab14 ; and extended INT16 used
+ cmp SWITCH_X,ON ; and /x used
+ jnz tmplab14
+
+ call CHECK_FOR_REMAP ; remap to standard call
+ or bx,bx ; reset zero flag for jump test in old code
+
+tmplab14:
+ 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
+
+; M006 - begin
+
+CheckForEvent:
+ cmp fhavek09,0
+ jz CONBUS ; return with busy status if not k09
+
+ les bx,[ptrsav]
+ assume es:nothing
+ test es:[bx].status,0400h ; system wait enabled?
+ jz CONBUS ; return with busy status if not
+
+; need to wait for ibm response to request for code
+; on how to use the system wait call.
+
+ mov ax,4100h ; wait on an external event
+ xor bl,bl ; wait for any event
+ int 15h ; call rom for system wait
+
+; M006 - end
+
+CONBUS: jmp BUS$EXIT
+;--------------------------------------------------------------
+
+; KEYBOARD FLUSH ROUTINE
+
+CON$FLSH:
+ mov [ALTAH],0 ; Clear out holding buffer
+ mov [KEYCNT],0
+
+ifdef KOREA
+ mov ah, 0f3h
+ int 16h
+ ReadNullByte: ; We may have final char
+ mov ah, 0f1h
+ int 16h
+ jz FlushDone
+ mov ah, 0f0h
+ int 16h
+ jmp short ReadNullByte
+FlushDone:
+else
+Flush: mov ah,1
+ cmp EXT_16,ON ; if extended call available
+ jnz tmplab15
+ add ah,10h ; then use it
+tmplab15:
+
+ int 16h
+ jz FlushDone
+ mov ah,0
+
+ cmp EXT_16,ON ; if extended call available
+ jnz tmplab16
+ add ah,10h ; use it
+tmplab16:
+ int 16h
+ jmp Flush
+FlushDone:
+endif ; KOREA
+
+ jmp EXVEC
+;----------------------------------------------------------
+
+; CONSOLE WRITE ROUTINE
+
+CON$WRIT:
+ jcxz EXVEC
+
+ifdef KOREA
+ test ah, 00000001b
+ jnz con$lp_nac ;OUT CHAR WITHOUT CURSOR ADVANCING
+endif ; KOREA
+
+CON$LP: mov al,es:[di] ; GET CHAR
+ inc di
+ call OUTC ; OUTPUT CHAR
+ loop CON$LP ; REPEAT UNTIL ALL THROUGH
+ jmp EXVEC
+
+ifdef KOREA
+con$lp_nac:
+ mov al, es:[di]
+ inc di
+ call outchr_nac ;OUTPUT CHAR WITHOUT CURSOR MOVE
+ loop con$lp_nac ;REPEAT UNTIL ALL THROUGH
+ jmp exit
+
+outchr_nac:
+ push ax
+ push si
+ push di
+ push bp
+ mov ah, 0feh ;OUTPUT CHAR WITHOUT CURSOR ADVANCING
+ mov bl, 7 ;SET FOREGROUND COLOR
+ int 10h ;CALL ROM BIOS
+ pop bp
+ pop di
+ pop si
+ pop ax
+ ret
+endif
+
+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
+
+ifdef KOREA
+ cmp al, '$'
+ jnz chk_off
+ mov word ptr [si], offset S8
+ ret
+chk_off:
+ cmp al, '('
+ jnz jmp_S1
+ mov word ptr [si], offset S10
+ ret
+jmp_S1:
+endif ; KOREA
+
+ 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
+IFDEF JAPAN
+ cmp al,'>'
+ jz s3f
+ENDIF
+ cmp al,'"' ; BEGIN QUOTED STRING
+ jz S3E
+ cmp al,"'"
+ jnz S7
+S3E: mov word ptr [si],OFFSET S4
+ mov [INQ],al
+S3ret: ret
+
+IFDEF JAPAN
+s3f:
+ mov new_mode,1
+ jmp short s3ret
+ENDIF
+
+
+; 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
+
+
+ PUBLIC S7
+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
+IFDEF DBCS
+ mov dbcs_flag,0
+ENDIF
+IFDEF JAPAN
+ mov new_mode,0
+ENDIF
+ mov word ptr [si],OFFSET S2
+ ret
+
+S1B:
+
+ifndef KOREA ; IN KOREA, WE ALREADY handled
+IFDEF DBCS
+ cmp dbcs_flag,1
+ jz set_dbcs ; if it was lead byte
+ cmp dbcs_flag,2
+ jnz @f ; if it was not tail byte
+ mov dbcs_flag,0 ; reset
+@@:
+ call IsDBCSLeadByte
+ jnz @f ; if this is not lead byte
+set_dbcs:
+ inc dbcs_flag
+@@:
+ cmp dbcs_flag,1
+ jnz @f
+ mov dl,col
+ cmp dl,maxcol
+ jnz @f
+ push ax
+ mov al,' '
+ call chrout
+ pop ax
+@@:
+ENDIF
+endif ; NOT KOREA
+
+ call CHROUT
+S1A: mov word ptr [STATE],OFFSET S1
+ ret
+
+ifdef KOREA
+S8: cmp al, ')'
+ jnz s1
+ mov word ptr [si], offset S9
+ ret
+S9: cmp al, '1'
+ jnz S1
+han_on:
+ mov ah, 0f2h
+ mov al, 08h ; Hangeul input mode on
+ int 16h
+ ret
+
+S10: cmp al, '2'
+ jnz S1
+han_off:
+ mov ah, 0f2h
+ mov al, 00h
+ int 16h
+ ret
+endif ; KOREA
+
+MOVCUR: ;C02
+ cmp byte ptr [bx],AH
+ jz SETCUR
+ add byte ptr [bx],al
+ loop MOVCUR
+SETCUR: mov dx,word ptr COL
+;*C05 xor bx,bx
+ mov ah,0fh ;*C05
+ int 10h ;*C05
+ mov ah,2
+ int 16
+ jmp S1A
+
+CUP:
+
+IFDEF JAPAN ; ### if JAPAN ###
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz tmplab17 ; if not graphic mode
+ mov ah,DEFAULT_LENGTH
+ jmp short tmplab18
+tmplab17:
+ mov ah,byte ptr [REQ_TXT_LENGTH]
+tmplab18:
+ sub ah,row_adj
+ cmp cl,ah
+ELSE
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz tmplab17
+ cmp cl,DEFAULT_LENGTH
+ jmp short tmplab18
+tmplab17:
+ cmp cl,byte ptr [REQ_TXT_LENGTH]
+tmplab18:
+ENDIF ; ### end if JAPAN ###
+
+ 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:
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz tmplab19
+ mov ah,DEFAULT_LENGTH
+ jmp short tmplab20
+tmplab19:
+ mov ah,byte ptr [REQ_TXT_LENGTH]
+ dec ah ; M005; REQ_TXT_LENGTH is not 0 based
+tmplab20:
+IFDEF JAPAN
+ sub ah,row_adj
+ENDIF
+ mov al,1
+ jmp CUU1
+
+ExtKey:
+ cmp dl, 0 ; DL = previous parameter
+ jne ExtKey_1
+ mov Switch_X, OFF ; reset it if 0.
+ jmp S1A
+ExtKey_1:
+ cmp dl, 1 ; 1 ?
+ je SetExtKey
+ jmp S1A ; ignore it
+SetExtKey:
+ mov Switch_X, ON ; set it if 1.
+ jmp S1A
+
+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
+
+IFDEF JAPAN ; ### if JAPAN ###
+ED:
+ mov bl,dl ; save function no.
+ mov dh,30
+ mov al,MODE
+ cmp al,11h
+ je ed20 ; if graphic 640X480
+ cmp al,12h
+ je ed20 ; if graphic 640X480
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz ed10 ; if not graphic mode
+ mov dh,DEFAULT_LENGTH
+ jmp short ed20
+ed10:
+ mov dh,byte ptr [REQ_TXT_LENGTH]
+ed20:
+ sub dh,row_adj
+ dec dh ; last row
+ mov dl,MAXCOL
+ xor cx,cx
+ cmp bl,0
+ jz ed_func0
+ cmp bl,1
+ jz ed_func1
+ mov word ptr COL,cx ; ESC[2J
+ jmp short ed_30
+ed_func0: ; ESC[0J
+ push dx
+ mov cx,word ptr COL
+ mov dh,ch
+ mov dl,MAXCOL
+ call erase ; erase to eol
+ pop dx
+ mov ch,ROW
+ cmp ch,dh
+ jz ed_end ; if at bottom
+ inc ch
+ mov cl,0
+ jmp short ed_30
+ed_func1: ; ESC[1J
+ mov dx,word ptr COL
+ mov ch,dh
+ mov cl,0
+ call erase ; erase from top
+ mov dh,ROW
+ cmp dh,0
+ jz ed_end
+ dec dh
+ mov dl,MAXCOL
+ xor cx,cx
+ed_30:
+ call erase
+ed_end:
+ jmp setcur
+
+EL:
+ cmp dl,1
+ jz el_func1
+ cmp dl,2
+ jz el_func2
+ mov cx,word ptr COL ; ESC[0K
+ mov dh,ch
+ mov dl,MAXCOL
+ jmp short el_10
+el_func1:
+ mov dx,word ptr COL ; ESC[1K
+ mov ch,dh
+ mov cl,0
+ jmp short el_10
+el_func2:
+ mov ch,ROW ; ESC[2K
+ mov dh,ch
+ mov cl,0
+ mov dl,MAXCOL
+el_10:
+ call erase
+ jmp setcur
+
+erase:
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE ; if we are in graphics mode,
+ jnz erase10
+ xor bh,bh ; then use 0 as attribute
+ jmp short erase20
+erase10:
+ mov bh,ATTR ; else use ATTR
+erase20:
+ mov ax,0600H ; clear
+ int 10h
+ ret
+
+else ; ### if Not JAPAN ###
+
+ED: xor cx,cx
+ mov word ptr COL,cx
+ mov DH,30
+ mov al,MODE
+ cmp al,11H
+ je ERASE
+ cmp al,12H
+ je ERASE
+
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz tmplab21
+ mov dh,DEFAULT_LENGTH
+ jmp short tmplab22
+tmplab21:
+ mov dh,byte ptr [REQ_TXT_LENGTH]
+tmplab22:
+ERASE: mov DL,MAXCOL
+
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE ; if we are in graphics mode,
+ jnz tmplab23
+ xor bh,bh ; then use 0 as attribute
+ jmp short tmplab24
+tmplab23:
+ mov bh,ATTR ; else use ATTR
+tmplab24:
+ mov ax,0600H
+ int 16
+ED3: jmp SETCUR
+
+EL: mov cx,word ptr COL
+ mov DH,CH
+ jmp ERASE
+
+ENDIF ; ### end if Not JAPAN ###
+
+IFDEF JAPAN ; ### if JAPAN ###
+delete:
+ mov ah,6 ; scroll up
+ jmp short insdel
+insert:
+ mov ah,7 ; scroll down
+insdel:
+ mov al,cl ; set scroll number
+ mov COL,0 ; set to top of row
+ mov cx,word ptr COL
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz line10 ; if not graphic mode
+ mov dh,DEFAULT_LENGTH
+ xor bh,bh ; attribute
+ jmp short line20
+line10:
+ mov bh,ATTR
+ mov dh,byte ptr [REQ_TXT_LENGTH]
+line20:
+ sub dh,row_adj
+ dec dh
+ mov dl,MAXCOL
+ int 10h ; scroll
+ jmp setcur
+ENDIF ; ### end if JAPAN ###
+
+BIN2ASC:mov DL,10
+ inc AL
+ xor ah,AH
+ div dl
+ add ax,'00'
+ ret
+DSR: mov ah,REQ_CRSR_POS
+ push bx
+ xor bh,bh
+ int 10h
+ pop bx
+ push dx
+ mov al,dh ;REPORT CURRENT CURSOR POSITION
+ call BIN2ASC
+ mov word ptr REPORT+2,ax
+ pop dx
+ mov al,DL
+ 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
+
+IFDEF JAPAN
+ cmp new_mode,1
+ jz nmode
+ENDIF
+
+ cmp al,MODE7 ; if mode isn't (0-6, 13-19)
+ jl tmplab25 ; then skip (cas -- signed?)
+ cmp al,MODE13
+ jl tmplab26
+ cmp al,MODE19
+ jg tmplab26
+
+tmplab25:
+ test HDWR_FLAG,LCD_ACTIVE ; is this the LCD?
+ jz tmplab25a ; skip if not
+
+ push ds ; WGR yes...
+ push ax ; WGR save mode
+ mov ax,ROM_BIOS
+ mov ds,ax ; WGR get equipment status flag..
+ mov ax,DS:[EQUIP_FLAG]
+ and ax,INIT_VID_MASK ; WGR clear initial video bits..
+ or ax,LCD_COLOR_MODE ; WGR .....set bits as color
+ mov ds:[EQUIP_FLAG],ax ; WGR replace updated flag.
+ pop ax ; WGR restore mode.
+ pop ds
+
+tmplab25a:
+
+ mov ah,SET_MODE ; WGR yes....set mode..
+ int 10H
+ jmp short tmplab27
+
+tmplab26:
+ cmp al,7 ; then if 7, wrap at EOL
+ jnz tmplab27
+ mov [WRAP],CL ; WGR yes....wrap...
+tmplab27:
+ jmp CPR
+
+IFDEF JAPAN ; ### if JAPAN ###
+nmode:
+ mov new_mode,0
+ cmp al,1
+ jz row_mode ; set row mode
+ cmp al,5
+ jz cur_mode ; set cursor mode
+ jmp cpr
+row_mode:
+ mov row_adj,0
+ jcxz row_mode_ret ; if set mode
+ cmp GRAPHICS_FLAG,GRAPHICS_MODE
+ jnz row_mode10 ; if not graphic mode
+ mov ah,DEFAULT_LENGTH
+ jmp short row_mode20
+row_mode10:
+ mov ah,byte ptr [REQ_TXT_LENGTH]
+row_mode20:
+ dec ah
+ cmp row,ah
+ jb row_mode_30 ; if cursor not at bottom row
+ dec row
+ call scroll
+row_mode_30:
+ inc row_adj
+row_mode_ret:
+ jmp cpr
+cur_mode:
+ push cx
+ mov ah,3 ; get cursor
+ mov bh,bpage
+ int 10h
+ pop ax
+ or ax,ax
+ jz cur_mode10 ; if for cursor off
+ and ch,11011111b ; cursor on
+ jmp short cur_mode20
+cur_mode10:
+ or ch,00100000b ; corsor off
+cur_mode20:
+ mov ah,1 ; set cursor
+ int 10h
+ jmp cpr
+ENDIF ; ### end if JAPAN ###
+
+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
+
+
+
+
+; CHECK_FOR_REMAP:
+
+; This function esnures that the keypacket
+; passed to it in AX is mapped to a standard INT16h call
+
+
+
+CHECK_FOR_REMAP PROC NEAR
+ cmp al,0e0h ; extended key?
+ jnz tmplab28
+
+ifdef KOREA
+ cmp ah, 0f0h
+ jb mschtmp
+ cmp ah, 0f2h
+ jbe tmplab28
+mschtmp:
+endif ; KOREA
+
+ or ah,ah ; probably, but check for alpha character
+ jz tmplab28
+ xor al,al ; if not an alpha, map extended to standard
+tmplab28:
+ ret
+CHECK_FOR_REMAP ENDP
+
+IFDEF DBCS
+
+; Test if the character is DBCS Lead Byte
+
+; input: AL = character to check
+; outpit: ZF = 1 if DBCS Lead Byte
+
+ public DBCSLeadByteTable
+DBCSLeadByteTable dd 0
+
+IsDBCSLeadByte proc near
+ push ax
+ push si
+ push ds
+ lds si,cs:DBCSLeadByteTable
+idlb_check:
+ cmp word ptr [si],0
+ jz idlb_not ; if end of table
+ cmp al,[si]
+ jb idlb_next ; if below low value
+ cmp al,[si+1]
+ jbe idlb_yes ; if below high value
+idlb_next:
+ add si,2 ; do next
+ jmp short idlb_check
+idlb_not:
+ or al,1 ; reset ZF
+ jmp short idlb_end
+idlb_yes:
+ and al,0 ; set ZF
+idlb_end:
+ pop ds
+ pop si
+ pop ax
+ ret
+IsDBCSLeadByte endp
+ENDIF
+
+
+BUF DB 4,00,72H,16,0
+ DB ASNMAX+8-5 DUP (?)
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/ansi/ansi.inc b/private/mvdm/dos/v86/dev/ansi/ansi.inc
new file mode 100644
index 000000000..f54b195b7
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansi.inc
@@ -0,0 +1,315 @@
+
+
+; Equates and Strucs.
+
+
+;------------------------------------------------------------------------------
+; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K.
+; D493 New INIT request structure for error message 02/25/88 J.K.
+; P4934 Change ANSI 2F function number to 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]
+NHD EQU ES:[DI]
+
+; CON data structure CS:[BX]
+
+CONPTR 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
+BUF_DATA ENDS
+
+; INIT Structures and equates
+IFNDEF TRUE
+TRUE EQU -1
+ENDIF
+IFNDEF FALSE
+FALSE EQU 0
+ENDIF
+BRKADR EQU 6Ch ; Break vector address
+CR EQU 13 ; carriage return
+BACKSP EQU 8 ; backspace
+ESC_CHAR EQU 1BH
+ASNMAX EQU 400 ; (increased) SIZE OF KEY ASSIGNMENT BUFFER
+ROM_BIOS EQU 40h ; Segment of ROM_BIOS data area
+EQUIP_FLAG EQU 10h ; equipment flag. (for LCD)
+KBD_FLAG_3 EQU 96h ; offset of KBD_FLAG_3 in data area
+NUM_ROWS EQU 84h ; offset of number of rows in data area
+EXT16_FLAG EQU 00010000b ; mask for Extended INT16 bit
+INIT_VID_MASK EQU 0FFCFh ; mask for equipment list
+LCD_COLOR_MODE EQU 20h ; LCD as color
+LCD_MONO_MODE EQU 30h ; LCD as MONOchrome
+UNKNOWN_CMD EQU 8103H ; unknown command status byte
+RC_EOL EQU -1 ; parser return code for EOL
+RC_NO_ERROR EQU 0 ; parser return code for not in switch list
+INVALID_PARM EQU 10 ; PARSE Invalid parameter message number
+SSTRING EQU 3 ; PARSE Too many parameters message
+FUNC_CALL EQU 1BH ; VGA functionality call
+ALT_SELECT EQU 12H ; EGA alternate select call
+EGA_INFO EQU 10H ; EGA return information subcall
+ALT_PRT_SC EQU 20H ; select alternate print screen subcall
+MONOCHROME EQU 1 ; monochrome attached to EGA
+COLOR EQU 0 ; some color attached to EGA
+PS2_MONO EQU 7 ; display adapter types...
+PS2_COLOR EQU 8
+MOD30_MONO EQU 0BH
+MOD30_COLOR EQU 0CH
+LCD_MODEL EQU 0F9H ; Convertible model byte value
+GET_SYS_ID EQU 0C0H ; INT15H call for system identification
+GET_STATUS EQU 43H ; read system status (Convertible)
+MONO_ADDRESS EQU 0B000H ; base address for monochrome
+COLOR_ADDRESS EQU 0B800H ; base address for CGA
+UNOCCUPIED EQU -1 ; value in VIDEO_MODE_TABLE if space unused
+LCD_ACTIVE EQU 00000001B ; LCD adapter is present
+MONO_ACTIVE EQU 00000010B ; monochrome adapter is present
+CGA_ACTIVE EQU 00000100B ; CGA adapter is present
+MCGA_ACTIVE EQU 00001000B ; MCGA is present
+E5151_ACTIVE EQU 00010000B ; EGA with monochrome is present
+E5153_ACTIVE EQU 00100000B ; EGA with color display is present
+E5154_ACTIVE EQU 01000000B ; EGA with enhanced color display is present
+VGA_ACTIVE EQU 10000000B ; VGA is present
+INT10_LOW EQU (4*10H) ; interrupt 10 vector location
+INT10_HI EQU (4*10H)+2
+INT2F_LOW EQU (4*2FH) ; interrupt 2F vector location
+INT2F_HI EQU (4*2FH)+2
+ONE EQU 1
+THREE EQU 3
+EIGHT EQU 8
+NINE EQU 9
+FOURTEEN EQU 14
+REQ_CRSR_POS EQU 3 ; function call to return cursor position
+MODE7 EQU 7
+MODE13 EQU 13
+MODE15 EQU 15
+MODE19 EQU 19
+
+; Request Header Structure (INIT)
+
+INIT_REQ_HDR STRUC ; INIT Request header structure
+ DB 13 DUP(?) ; standard request header
+NUM_UNITS DB ? ; number of units (N/A)
+END_ADDRESS_O DW ? ; ending address of resident code
+END_ADDRESS_S DW ?
+ARG_PTR DD ? ; ptr. to remaining arguments
+DRIVE_NUM DB ? ; drive number (N/A)
+CONFIG_ERRMSG DW 0 ; Flag to control "Error in CONFIG.SYS.." msg.
+INIT_REQ_HDR ENDS
+
+
+; Information Block Structure
+; (for functionality call)
+
+
+INFO_BLOCK STRUC ; information block for functionality call
+STATIC_ADDRESS DD ? ; address of static functionality table
+ DB 33 DUP(?) ; don't care
+ACTIVE_DISPLAY DB ? ; active display code
+ALT_DISPLAY DB ? ; alternate display code
+ DB 3 DUP(?) ; don't care
+CURRENT_SCANS DB ? ; current number of scan lines
+ DB 2 DUP(?) ; don't care
+MISC_INFO DB ? ; miscellaneous state information
+ DB 18 DUP(?) ; don't care
+INFO_BLOCK ENDS
+
+; Video table entry structure
+
+
+MODE_TABLE STRUC
+V_MODE DB -1 ; video mode
+D_MODE DB -1 ; display mode
+RESERVED_BYTE DB 0 ; reserved
+COLORS DW -1 ; colors
+SCR_WIDTH DW -1 ; screen width (pels)
+SCR_LENGTH DW -1 ; screen length (pels)
+SCR_COLS DW -1 ; number columns
+SCR_ROWS DW -1 ; number rows
+MODE_TABLE ENDS
+
+
+; Structure of Static Block
+; (for functionality call
+
+
+STATIC_BLOCK STRUC ; format of static functionality table
+ DB 7 DUP(?) ; don't care
+SCAN_TEXT DB ? ; available scan lines in text modes
+STATIC_BLOCK ENDS
+
+
+; Structure of System ID call return block
+
+
+SYS_ID STRUC ; format of return system config data
+ DW ? ; don't care
+MODEL_BYTE DB ? ; model byte
+SYS_ID ENDS
+
+
+
+; INT2f Strucs and Equates
+
+
+MULT_ANSI EQU 1Ah ; ANSI multiplex number
+INSTALL_CHECK EQU 0 ; install check for ANSI
+IOCTL_2F EQU 1 ; 2F interface to IOCTL
+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)
+
+;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 L_STATE
+DA_SETMODE_FLAG DB 0 ; 1: DISPLAY.SYS is calling INT 10h call, SET MODE. 0=finished.
+DA_L_STATE DB 0 ; 1 = /L active, 0 = /L inactive
+DA_INFO_PACKET ENDS
+
+
+
+; GENERIC IOCTL Strucs and Equates
+
+
+
+DISPLAY_TYPE EQU 3 ; MAJ_FUNC type for display
+GET_FUNC EQU 7FH ; MIN_FUNC for get subfunction
+SET_FUNC EQU 5FH ; MIN_FUNC for set subfunction
+REQ_VID_MODE EQU 0FH ; request video mode INT10h function call
+DONE EQU 0100H ; set done bit for IOCTL status
+CMD_ERROR EQU 8000H ; set error bit for IOCTL status
+INVALID_FUNC EQU 1 ; invalid function
+NOT_SUPPORTED EQU 10 ; return code non-supported ioctl function
+NOT_AVAILABLE EQU 12 ; return code for font not available
+TEXT_MODE EQU 1 ; text mode = 1 in request packet
+GRAPHICS_MODE EQU 2 ; graphics mode = 2
+DEFAULT_LENGTH EQU 25 ; normal screen length
+OFF EQU 0000H
+ON EQU 0001H
+INT_BIT EQU 00100000b ; mask for int. bit from functionality call
+FOUND EQU 1 ; flag value for FOUND
+NOT_FOUND EQU 0 ; flag value for not FOUND
+SET_MODE EQU 0 ; set mode INT10H function number
+DISPLAY_CHECK EQU 0AD00H ; install check for DISPLAY.SYS
+CHECK_ACTIVE EQU 0AD02H ; active code page check for DISPLAY.SY
+INSTALLED EQU 0FFH ; present in AL if installed
+LOAD_8X8 EQU 1112H ; register value for 8x8 ROM load
+SET_BLOCK_0 EQU 1103H ; activate block = 0.
+CHECK_FOR_FONT EQU 0AD10H ; check for 8x8 RAM font - DISPLAY.SYS
+SELECT_SCAN EQU 30H ; subfunction to set scan lines (VGA)
+SET_INTENSIFY EQU 0 ; value to enable intensify.
+SET_BLINK EQU 1 ; value to enable blink.
+BLINK_TOGGLE EQU 1003H ; INT10 call to toggle int/blink bit.
+CURSOR_FLAG EQU 87H ; cursor flag byte in ROM_BIOS
+SET_CURSOR_CALL EQU 1 ; INT10 function call to set cursor typ
+VIDEO_MASK EQU 7FH ; turn of clear buffer bit of mode value
+MULT_ANSI EQU 1Ah ; ANSI multiplex number ;AC003
+INSTALL_CHECK EQU 0 ; install check for ANSI
+IOCTL_2F EQU 1 ; 2F interface to IOCTL
+NOT_CY EQU 0FFFEH ; turn carry bit off
+CY EQU 1 ; turn carry bit off
+INVALID_FLAGS EQU 0FFFEH ; test for invalid flags in control word
+TURN_OFF EQU 0FEH ; values to turn off and on cursor..
+TURN_ON EQU NOT TURN_OFF ; emulation
+SUB_SIZE EQU 11 ; sublist size
+LEFT_ASCIIZ EQU 00010000B ; left-aligned asciiz string
+UNLIMITED EQU 0 ; unlimited message size.
+
+
+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
+
+
+; REQUEST PACKET STRUCTURE (Generic IOCTL)
+
+
+REQ_PCKT STRUC
+INFO_LEVEL DB ? ; information level (should be 0)
+ DB ? ; reserved
+DATA_LENGTH DW ? ; length of remaining data
+RP_FLAGS DW ? ; control flags
+RP_MODE DB ? ; display mode
+RESERVED2 DB ? ; reserved
+RP_COLORS DW ? ; # of colors
+RP_WIDTH DW ? ; screen width
+RP_LENGTH DW ? ; screen length
+RP_COLS DW ? ; columns
+RP_ROWS DW ? ; rows
+REQ_PCKT ENDS
+
+
+; Scan Lines available structure
+
+
+SCAN_LINE_STR STRUC
+NUM_LINES DW ? ; number of scan lines
+REP_1BH DB ? ; representation in 1Bh call
+REP_12H DB ? ; representation in 12h call
+SCAN_LINE_STR ENDS
+
+
+; SUBLIST struc
+
+
+SUB_STRUC STRUC
+ DB 2 DUP(?)
+SUB_PTR_O DW ?
+SUB_PTR_S DW ?
+SUB_STRUC ENDS
+
+
+; RESULT BUFFER struc
+
+
+RESULT_STRUC STRUC
+RESULT_TYPE DB ?
+ DB ?
+RES_SYN_PTR DW ?
+RES_PTR DD ?
+RESULT_STRUC ENDS
+
+BREAK MACRO subtitle
+ SUBTTL subtitle
+ PAGE ,132
+ENDM
+
+AsmVars Macro varlist
+IRP var,<varlist>
+AsmVar var
+ENDM
+ENDM
+
+AsmVar Macro var
+IFNDEF var
+var = FALSE
+ENDIF
+ENDM
diff --git a/private/mvdm/dos/v86/dev/ansi/ansi.lnk b/private/mvdm/dos/v86/dev/ansi/ansi.lnk
new file mode 100644
index 000000000..6997ef548
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansi.lnk
@@ -0,0 +1,7 @@
+ANSI.OBJ+
+ IOCTL.OBJ+
+ ANSIINIT.OBJ+
+ PARSER.OBJ
+ANSI.EXS
+ANSI.MAP /M
+;
diff --git a/private/mvdm/dos/v86/dev/ansi/ansi.skl b/private/mvdm/dos/v86/dev/ansi/ansi.skl
new file mode 100644
index 000000000..d79767824
--- /dev/null
+++ b/private/mvdm/dos/v86/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/private/mvdm/dos/v86/dev/ansi/ansi.tag b/private/mvdm/dos/v86/dev/ansi/ansi.tag
new file mode 100644
index 000000000..552e8587b
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansi.tag
@@ -0,0 +1,19 @@
+M001 08/31/90 PYS IOCTL.ASM Modes unknown are assumed to be
+ graphic modes for /L option.
+M002 09/05/90 PYS IOCTL.ASM 1827, 2486, 2020: /L has no
+ more effect.
+M003 09/13/90 PYS IOCTL.ASM 2696 reloading font without
+ telling anyone loaded after ansi
+M004 09/21/90 PYS IOCTL.ASM 2356 ansi problem with dual screen
+M005 10/17/90 PYS ANSI.ASM 3567 compaq patch for bug 173 is a
+ goof and generated this bug (3567)
+M006 11/12/90 PYS ANSI.ASM 3913: Ansi lacked support of wait
+ ANSIINIT.ASM for external event.
+M007 12/12/90 PYS ANSI.ASM 4520: /SCREENSIZE:(row,column) was
+ PARSER.ASM added.
+M008 01/18/91 SHK ANSI.ASM 4520: /SCREENSIZE and /S parsing
+ ANSIINIT.ASM code added for init time set to 25
+ PARSER.ASM line mode, deleted stuff relating to
+ Switch_SRow, Col from M007.
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/ansi/ansiinit.asm b/private/mvdm/dos/v86/dev/ansi/ansiinit.asm
new file mode 100644
index 000000000..6e9d0da04
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansiinit.asm
@@ -0,0 +1,540 @@
+PAGE ,132
+TITLE ANSI Console device CON$INIT routine
+
+;******************************************************************************
+
+; Change Log:
+
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+; 06/05/90 MKS C03 Bug#234. ANSI was not recognizing the presence of a
+; VGA if there was another video board in the system.
+;******************************************************************************
+
+
+
+; 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
+; . NEW PROCS HAVE BEEN MARKED AS SUCH.
+
+
+; P1767 VIDEO_MODE_TABLE not initialized correctly 10/16/87 J.K.
+; P2617 Order dependecy problem with Display.sys 11/23/87 J.K.
+; D479 An option to disable the extended keyboard functions 02/12/88 J.K.
+; D493 New INIT request structure for error message 02/25/88 J.K.
+; P5699 Moving selecting alternate print screen routine to only when it
+; 10/26/88 is needed. OEM EGA cards don't support the call it, so they
+; K. Sayers couldn't (shift) print screen at all.
+;-------------------------------------------------------------------------------
+
+INCLUDE ANSI.INC ; equates and strucs
+
+PUBLIC CON$INIT
+
+
+CODE SEGMENT PUBLIC BYTE
+ ASSUME CS:CODE,DS:CODE
+
+EXTRN VIDEO_MODE_TABLE:BYTE
+EXTRN FUNC_INFO:BYTE
+EXTRN HDWR_FLAG:WORD
+EXTRN VIDEO_TABLE_MAX:ABS
+EXTRN SCAN_LINES:BYTE
+EXTRN PTRSAV:DWORD
+EXTRN PARSE_PARM:NEAR
+EXTRN ERR2:NEAR
+EXTRN EXT_16:BYTE
+EXTRN BRKKY:NEAR
+EXTRN COUT:NEAR
+EXTRN BASE:WORD
+EXTRN MODE:BYTE
+EXTRN MAXCOL:BYTE
+EXTRN EXIT:NEAR
+EXTRN MAX_SCANS:BYTE
+EXTRN ROM_INT10:WORD
+EXTRN INT10_COM:NEAR
+EXTRN ROM_INT2F:WORD
+EXTRN INT2F_COM:NEAR
+EXTRN ABORT:BYTE
+EXTRN Display_Loaded_Before_me:byte ;Defined in IOCTL.ASM
+EXTRN Switch_K:Byte
+EXTRN fhavek09:BYTE ; M006
+EXTRN Switch_S:BYTE ; M008
+
+ifdef DBCS
+EXTRN DBCSLeadByteTable:dword
+endif
+
+
+INCLUDE ANSIVID.INC ; video tables data
+
+CON$INIT:
+ lds bx,cs:[PTRSAV] ; establish addressability to request header
+ lds si,[BX].ARG_PTR ; ds:SI now points to rest of DEVICE=statement
+ call PARSE_PARM ; parse DEVICE= command line
+ jnc CONT_INIT ; no error in parse...continue install
+ lds bx,cs:[PTRSAV] ; prepare to abort install
+ xor ax,ax ;
+ mov [BX].NUM_UNITS,al ; set number of units to zero
+ mov [BX].END_ADDRESS_O,ax ; set ending address offset to 0
+ mov [BX].END_ADDRESS_S,cs ; set ending address segment to CS
+ mov word ptr [bx].CONFIG_ERRMSG, -1 ; Let IBMBIO display "Error in CONFIG.SYS..".
+ mov ax,UNKNOWN_CMD ; set error in status
+ mov WORD PTR [BX].STATUS,ax ; set error status
+ jmp ERR2 ; prepare to exit
+
+CONT_INIT:
+ push cs
+ pop ds ; restore DS to ANSI segment
+ mov ax,ROM_BIOS
+ mov es,ax ; ES now points to BIOS data area
+
+ cmp Switch_S,OFF ; M008
+ jz noscreensizesw ; M008
+
+ mov BYTE PTR es:[84h],24 ; M008 ; Use default value
+
+noscreensizesw: ; M008
+
+ mov ah,es:[KBD_FLAG_3] ; load AH with KBD_FLAG_3
+
+ test ah,EXT16_FLAG ; if extended Int16 available
+ jz tlab01
+ cmp Switch_K,OFF ; and user didn't disable it
+ jnz tlab01
+
+ mov EXT_16,ON ; then enable extended int16
+tlab01:
+ call DET_HDWR ; procedure to determine video hardware status
+ call LOAD_INT10 ; load interrupt 10h handler
+ call LOAD_INT2F ; load interrupt 2Fh handler
+
+; M006 - begin
+ push ds
+ pop es
+ xor di,di ; es:di points to begining of driver
+
+ mov ax,4101h ; wait for bh=es:[di]
+ mov bl,1 ; wait for 1 clock tick
+ mov bh,byte ptr es:[di]
+ stc ; Assume we will fail
+ int 15h
+ jc CheckColor
+ mov fhavek09,ON ; remember we have a k09 type
+CheckColor:
+; M006 - end
+
+ 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
+
+ifdef DBCS
+ mov ax,6300h
+ int 21h ; get DBCS lead byte table
+ mov word ptr cs:DBCSLeadByteTable,si
+ mov word ptr cs:DBCSLeadByteTable+2,ds
+endif
+
+ 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
+ mov ah,GET_SYS_ID ; see if this is a Convertible
+ int 15h
+
+ cmp es:[BX].MODEL_BYTE,LCD_MODEL ; and it has an LCD attached
+ jnz tlab04
+
+ mov ah,GET_STATUS ; system status will tell us
+ int 15h
+
+ test al,1 ; if bit 0 = 0 then LCD..
+ jnz tlab04
+
+ or HDWR_FLAG,LCD_ACTIVE ; so ...set hdwr flag and...
+ lea si,COLOR_TABLE
+ mov cx,COLOR_NUM ; load color table (for LCD)
+ call LOAD_TABLE
+ lea si,MONO_TABLE ; and mono table
+ mov cx,MONO_NUM
+ call LOAD_TABLE
+ jmp short tlab05
+
+; not LCD... check for CGA and mono
+
+tlab04:
+ mov ax,MONO_ADDRESS ; write to mono buffer to see if present
+ call CHECK_BUF
+
+ cmp ah,al
+ jnz tlab03 ; if present then,
+
+ or HDWR_FLAG,MONO_ACTIVE ; set hdwr flag and..
+ lea si,MONO_TABLE
+ mov cx,MONO_NUM ; load mono table
+ call LOAD_TABLE
+
+tlab03:
+
+ mov ax,COLOR_ADDRESS ; write to CGA buffer to see if present
+ call CHECK_BUF
+ cmp ah,al
+ jnz tlab02 ; if present then,
+
+ or HDWR_FLAG,CGA_ACTIVE ; set hdwr flag and...
+ lea si,COLOR_TABLE
+ mov cx,COLOR_NUM ; load color table
+ call LOAD_TABLE
+
+tlab02:
+
+tlab05:
+ push cs ; setup addressiblity for
+ pop es ; functionality call
+
+ xor ax,ax
+ mov ah,FUNC_call ; functionality call
+ xor bx,bx ; implementation type 0
+ lea DI,FUNC_INFO ; block to hold data
+ int 10H
+
+ cmp al,FUNC_call ; if call supported, then...
+ jne tlab11
+
+ mov ax,1A00h ; alternate check for VGA ;C03
+ int 10h ; C03
+
+ cmp bl,8 ; test for color VGA or mono VGA
+ jz tlab08
+ cmp bl,7
+ jnz tlab09
+tlab08:
+
+ or HDWR_FLAG,VGA_ACTIVE ; yes ....so
+ lea si,COLOR_TABLE ; set hdwr flag and...
+ mov cx,COLOR_NUM ; load color table +..
+ call LOAD_TABLE
+ lea si,VGA_TABLE ; load VGA table
+ mov cx,VGA_NUM
+ call LOAD_TABLE
+
+ jmp short tlab07
+
+; not VGA, must be MCGA
+
+tlab09:
+ cmp [DI].ACTIVE_DISPLAY,MOD30_MONO
+ jz tlab06
+ cmp [DI].ACTIVE_DISPLAY,MOD30_COLOR
+ jz tlab06
+ cmp [DI].ALT_DISPLAY,MOD30_MONO
+ jz tlab06
+ cmp [DI].ALT_DISPLAY,MOD30_COLOR
+ jnz tlab07
+
+tlab06:
+ or HDWR_FLAG,MCGA_ACTIVE ; so...set hdwr flag and...
+ lea si,COLOR_TABLE
+ mov cx,COLOR_NUM ; load color table +..
+ call LOAD_TABLE
+ lea si,MCGA_TABLE ; load MCGA table
+ mov cx,MCGA_NUM
+ call LOAD_TABLE
+
+tlab07:
+ mov al,[DI].CURRENT_SCANS ; copy current scan line setting..
+ mov MAX_SCANS,al ; as maximum text mode scan setting.
+ les DI,[DI].STATIC_ADDRESS ; point to static functionality table
+ mov al,es:[DI].SCAN_TEXT ; load available scan line flag byte..
+ mov SCAN_LINES,al ; and store it in resident data.
+
+ jmp short DET_HDWR_DONE
+
+; call not supported, try EGA
+
+tlab11:
+ mov ah,alT_SELECT ; alternate select call
+ mov BL,EGA_INFO ; get EGA information subcall
+ int 10H
+
+ cmp bl,EGA_INFO ; see if call was valid
+ jz DET_HDWR_DONE
+
+ cmp bh,MONOCHROME ; yes, check for monochrome
+ jnz tlab17
+
+ or HDWR_FLAG,E5151_ACTIVE ; ..5151 found so set hdwr flag and..
+ lea si,EGA_5151_TABLE
+ mov cx,EGA_5151_NUM ; load 5151 table.
+ call LOAD_TABLE
+
+ jmp short DET_HDWR_DONE
+
+tlab17:
+ and CL,0FH ; clear upper nibble of switch setting byte
+
+ cmp cl,9 ; test for switch settings of 5154
+ jz tlab13
+ cmp cl,3
+ jnz tlab14
+tlab13:
+
+ or HDWR_FLAG,E5154_ACTIVE ; so..set hdwr flag and...
+ lea si,COLOR_TABLE
+ mov cx,COLOR_NUM ; load color table +..
+ call LOAD_TABLE
+ lea si,EGA_5154_TABLE ; load 5154 table
+ mov cx,EGA_5154_NUM
+ call LOAD_TABLE
+
+ jmp short DET_HDWR_DONE
+
+; 5154 not found, must be 5153
+
+tlab14:
+ or HDWR_FLAG,E5153_ACTIVE ; so..set hdwr flag and...
+ lea si,COLOR_TABLE
+ mov cx,COLOR_NUM ; load color table +..
+ call LOAD_TABLE
+ lea si,EGA_5153_TABLE ; load 5153 table
+ mov cx,EGA_5153_NUM
+ call LOAD_TABLE
+
+DET_HDWR_DONE:
+ 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
+
+ push ds
+ mov ds,ax ; load DS with address of buffer
+ mov CH,ds:0 ; save buffer information (if present)
+ mov al,55H ; prepare to write sample data
+ mov ds:0,al ; write to buffer
+ push BX ; terminate the bus so that lines..
+ pop BX ; are reset
+ mov ah,ds:0 ; bring sample data back...
+ mov ds:0,CH ; repair damage to buffer
+ pop ds
+ ret
+
+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
+ push DI ; save DI
+ push es ; and ES
+ push cs ; setup ES to code segment
+ pop es
+ lea DI,VIDEO_MODE_TABLE ; point DI to resident video table
+
+while01:
+ cmp cx,0 ; do for as many records as there are
+ jz while01_exit
+ cmp di,VIDEO_TABLE_MAX ; check to ensure other data not overwritten
+ jge while01_exit ; cas --- signed compare!!!
+
+ mov al,[DI].V_MODE ; prepare to check resident table
+
+ cmp al,UNOCCUPIED ; if this spot is occupied
+ jz tlab20
+ cmp al,[si].V_MODE ; and is not the same mode then
+ jz tlab20
+
+ add DI,TYPE MODE_TABLE ; do not touch...go to next mode
+
+ jmp short while01
+
+; can write at this location
+
+tlab20:
+ push cx ; save record count
+ mov cx,TYPE MODE_TABLE ; load record length
+ rep movsb ; copy record to resident data
+ lea DI,VIDEO_MODE_TABLE ; Set DI to the top of the target again.
+ pop cx ; restore record count and..
+ dec cx ; decrement
+
+ jmp short while01
+
+while01_exit:
+ pop es ; restore..
+ pop DI ; registers
+ ret
+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
+ push es
+ xor ax,ax ; point ES to low..
+ mov es,ax ; memory.
+ mov cx,es:WORD PTR INT10_LOW; store original..
+ mov cs:ROM_INT10,cx ; interrupt 10h..
+ mov cx,es:WORD PTR INT10_HI ; location..
+ mov cs:ROM_INT10+2,cx
+ cli
+ mov es:WORD PTR INT10_LOW,OFFSET INT10_COM ; replace vector..
+ mov es:WORD PTR INT10_HI,cs ; with our own..
+ sti
+ mov ax, DISPLAY_CHECK ;DISPLAY.SYS already loaded?
+ int 2fh
+ cmp al, INSTALLED
+ jne L_INT10_Ret
+ mov cs:Display_Loaded_Before_Me,1
+L_INT10_Ret:
+ pop es
+ ret
+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
+ push es
+ xor ax,ax ; point ES to low..
+ mov es,ax ; memory.
+ mov ax,es:WORD PTR INT2F_LOW; store original..
+ mov cs:ROM_INT2F,ax ; interrupt 2Fh..
+ mov cx,es:WORD PTR INT2F_HI ; location..
+ mov cs:ROM_INT2F+2,cx
+ or ax,cx ; check if old int2F is 0
+ jnz tlab21
+ mov ax,OFFSET ABORT ; yes....point to..
+ mov cs:ROM_INT2F,ax ; IRET.
+ mov ax,cs
+ mov cs:ROM_INT2F+2,ax
+
+tlab21:
+ cli
+ mov es:WORD PTR INT2F_LOW,OFFSET INT2F_COM ; replace vector..
+ mov es:WORD PTR INT2F_HI,cs ; with our own..
+ sti
+ pop es
+ ret
+LOAD_INT2F ENDP
+
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/ansi/ansivid.inc b/private/mvdm/dos/v86/dev/ansi/ansivid.inc
new file mode 100644
index 000000000..8d5bf2e82
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ansivid.inc
@@ -0,0 +1,55 @@
+
+VGA_TABLE LABEL BYTE
+ MODE_TABLE < 1, 1,, 16, -1, -1, 40, -1> ; mode 1 Ä¿ To give preference
+ MODE_TABLE < 0, 1,, 16, -1, -1, 40, -1> ; mode 0 ³ of COxx over
+ MODE_TABLE < 3, 1,, 16, -1, -1, 80, -1> ; mode 3 ³ BWxx.
+ MODE_TABLE < 2, 1,, 16, -1, -1, 80, -1> ; mode 2 ÄÙ (see text)
+ MODE_TABLE < 7, 1,, 0, -1, -1, 80, -1> ; mode 7
+ MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13
+ MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14
+ MODE_TABLE <15, 2,, 0, 640, 350, 80, 25> ; mode 15
+ MODE_TABLE <16, 2,, 16, 640, 350, 80, 25> ; mode 16
+ MODE_TABLE <17, 2,, 2, 640, 480, 80, 30> ; mode 17
+ MODE_TABLE <18, 2,, 16, 640, 480, 80, 30> ; mode 18
+ MODE_TABLE <19, 2,,256, 320, 200, 40, 25> ; mode 19
+VGA_NUM EQU ($ - VGA_TABLE)/(TYPE MODE_TABLE)
+
+MCGA_TABLE LABEL BYTE
+ MODE_TABLE <17, 2,, 2, 640, 480, 80, 30> ; mode 17
+ MODE_TABLE <19, 2,,256, 320, 200, 40, 25> ; mode 19
+MCGA_NUM EQU ($ - MCGA_TABLE)/(TYPE MODE_TABLE)
+
+EGA_5154_TABLE LABEL BYTE
+ MODE_TABLE < 1, 1,, 16, -1, -1, 40, 43> ; mode 1 Ä¿ To give preference
+ MODE_TABLE < 0, 1,, 16, -1, -1, 40, 43> ; mode 0 ³ of COxx over
+ MODE_TABLE < 3, 1,, 16, -1, -1, 80, 43> ; mode 3 ³ BWxx.
+ MODE_TABLE < 2, 1,, 16, -1, -1, 80, 43> ; mode 2 ÄÙ (see text)
+ MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13
+ MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14
+ MODE_TABLE <16, 2,, 16, 640, 350, 80, 25> ; mode 16
+EGA_5154_NUM EQU ($ - EGA_5154_TABLE)/(TYPE MODE_TABLE)
+
+EGA_5153_TABLE LABEL BYTE
+ MODE_TABLE <13, 2,, 16, 320, 200, 40, 25> ; mode 13
+ MODE_TABLE <14, 2,, 16, 640, 200, 80, 25> ; mode 14
+EGA_5153_NUM EQU ($ - EGA_5153_TABLE)/(TYPE MODE_TABLE)
+
+EGA_5151_TABLE LABEL BYTE
+ MODE_TABLE < 7, 1,, 0, -1, -1, 80, 43> ; mode 7
+ MODE_TABLE <15, 2,, 0, 640, 350, 80, 25> ; mode 15
+EGA_5151_NUM EQU ($ - EGA_5151_TABLE)/(TYPE MODE_TABLE)
+
+MONO_TABLE LABEL BYTE
+ MODE_TABLE < 7, 1,, 0, -1, -1, 80, 25> ; mode 7
+MONO_NUM EQU ($ - MONO_TABLE)/(TYPE MODE_TABLE)
+
+COLOR_TABLE LABEL BYTE
+ MODE_TABLE < 1, 1,, 16, -1, -1, 40, 25> ; mode 1 Ä¿ To give preference
+ MODE_TABLE < 0, 1,, 16, -1, -1, 40, 25> ; mode 0 ³ of COxx over
+ MODE_TABLE < 3, 1,, 16, -1, -1, 80, 25> ; mode 3 ³ BWxx.
+ MODE_TABLE < 2, 1,, 16, -1, -1, 80, 25> ; mode 2 ÄÙ (see text)
+ MODE_TABLE < 4, 2,, 4, 320, 200, 40, 25> ; mode 4
+ MODE_TABLE < 5, 2,, 2, 320, 200, 40, 25> ; mode 5
+ MODE_TABLE < 6, 2,, 2, 640, 200, 80, 25> ; mode 6
+COLOR_NUM EQU ($ - COLOR_TABLE)/(TYPE MODE_TABLE)
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/ansi/ioctl.asm b/private/mvdm/dos/v86/dev/ansi/ioctl.asm
new file mode 100644
index 000000000..95e70b8e0
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/ioctl.asm
@@ -0,0 +1,1203 @@
+PAGE ,132
+TITLE ANSI Generic IOCTL Code
+
+;******************************************************************************
+
+; Change Log:
+
+; Date Who # Description
+; -------- --- --- ------------------------------------------------------
+
+; 06/29/90 MKS C04 Bug#1150. Video 7 Fastwrite VGA has problems if a
+; Hercules mono board is the active display.
+
+;******************************************************************************
+
+;****************** 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
+; 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
+
+; 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 *********************************************************
+; P1350 Codepage switching not working on EGA 10/10/87 J.K.
+; P1626 ANSI does not allow lines=43 with PS2,Monochrome 10/15/87 J.K.
+; p1774 Lines=43 after selecting cp 850 does not work 10/20/87 J.K.
+; p1740 MODE CON LINES command causes problem with PE2 w PS/210/24/87 J.K.
+; p2167 Does'nt say EGA in medium resol. cannot do 43 lines 10/30/87 J.K.
+; p2236 After esc [=0h, issuing INT10h,AH=fh returns mode=1. 11/3/87 J.K.
+; p2305 With ANSI loaded, loading RDTE hangs the system 11/06/87 J.K.
+; P2617 Order dependecy problem with Display.sys 11/23/87 J.K.
+; p2716 HOT key of VITTORIA does not work properly 12/03/87 J.K.
+; d398 /L option for Enforcing the number of lines 12/17/87 J.K.
+; D425 For OS2 compatibiltiy box, /L option status query 01/14/88 J.K.
+; P5699 Moving selecting alternate print screen routine to only when it
+; 10/26/88 is needed. OEM EGA cards don't support the call it, so they
+; K. Sayers couldn't (shift) print screen at all when the alt. routine was
+; invoked during initialization.
+;******************************************************************************
+
+INCLUDE DEVSYM.INC
+INCLUDE ANSI.INC
+INCLUDE MULT.INC
+
+PUBLIC GENERIC_IOCTL
+PUBLIC SET_IOCTL
+PUBLIC GET_IOCTL
+PUBLIC SET_SEARCH
+PUBLIC GET_SEARCH
+PUBLIC SET_CURSOR_EMUL
+PUBLIC FUNC_INFO
+PUBLIC MAX_SCANS
+PUBLIC INT10_COM
+PUBLIC SET_MODE_HANDLER
+PUBLIC SET_CURSOR_HANDLER
+PUBLIC ROM_INT10
+PUBLIC INT2F_COM
+PUBLIC INT2F_HANDLER
+PUBLIC ROM_INT2F
+PUBLIC ABORT
+PUBLIC MAP_DOWN
+PUBLIC SET_VIDEO_MODE
+PUBLIC REQ_TXT_LENGTH
+PUBLIC GRAPHICS_FLAG
+PUBLIC DO_ROWS
+PUBLIC Display_Loaded_Before_Me
+
+CODE SEGMENT PUBLIC BYTE
+ ASSUME CS:CODE,DS:CODE
+
+EXTRN PTRSAV:DWORD
+EXTRN NO_OPERATION:NEAR
+EXTRN ERR1:NEAR
+EXTRN VIDEO_MODE_TABLE:BYTE
+EXTRN MAX_VIDEO_TAB_NUM:ABS
+EXTRN HDWR_FLAG:WORD
+EXTRN SCAN_LINES:BYTE
+EXTRN SWITCH_L:Byte ;Defined in ANSI.ASM
+
+IFDEF JAPAN
+EXTRN row_adj:byte
+ENDIF
+
+SCAN_LINE_TABLE LABEL BYTE
+ SCAN_LINE_STR <200,000000001B,0> ; 200 scan lines
+ SCAN_LINE_STR <344,000000010B,1> ; 350 scan lines
+ SCAN_LINE_STR <400,000000100B,2> ; 400 scan lines
+SCANS_AVAILABLE EQU ($ - SCAN_LINE_TABLE)/TYPE SCAN_LINE_STR
+
+;This is used when ANSI calls Get_IOCTL, Set_IOCTL by itself.
+In_Generic_IOCTL_flag db 0
+I_AM_IN_NOW EQU 00000001b
+SET_MODE_BY_DISPLAY EQU 00000010b ;Display.sys calls Set mode INT 10h.
+CALLED_BY_INT10COM EQU 00000100b ;To prevent from calling set mode int 10h again.
+
+INT10_V_Mode db 0ffh ;Used by INT10_COM
+
+My_IOCTL_Req_Packet REQ_PCKT <0,0,0Eh,0,?,0,?,?,?,?,?>
+
+FUNC_INFO INFO_BLOCK <> ;data block for functionality call
+ROM_INT10 DW ? ;segment and offset of original..
+ DW ? ;interrupt 10h vector.
+ROM_INT2F DW ? ;segment and offset of original..
+ DW ? ;interrupt 2Fh vector.
+INTENSITY_FLAG DW OFF ;intensity flag initially off
+REQ_TXT_LENGTH DW DEFAULT_LENGTH ;requested text screen length
+SCAN_DESIRED DB 0 ;scan lines desired
+MAX_SCANS DB 0 ;maximum scan line setting
+GRAPHICS_FLAG DB TEXT_MODE ;flag for graphics mode
+Display_Loaded_Before_Me db 0 ;flag
+ANSI_SetMode_Call_Flag db 0 ;Ansi is issuing INT10,AH=0.
+ALT_PRT_SC_INVOKED DB FALSE ;indicates that have already set up alternat print screen routine
+
+
+
+; 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:
+ les bx,[PTRSAV] ; establish addressability to request header
+ mov al,es:[bx].MINORFUNCTION
+ les di,es:[bx].GENERICIOCTL_PACKET ; point to request packet
+
+ cmp al,GET_FUNC ; is this get subfunction?
+ jnz gi_not_get
+
+ call GET_IOCTL ; yes...execute routine
+
+ jmp short gi_check_error
+
+gi_not_get:
+ cmp al,SET_FUNC ; is this the set subfunction?
+ jnz gi_none
+
+ call SET_IOCTL ; yes....execute routine
+
+gi_check_error:
+ jnc gi_done ; branch if no error
+ or ax,CMD_ERROR ; yes...set error bit in status
+
+gi_done:
+ or ax,DONE ; add done bit to status
+ jmp ERR1 ; return with status in ax
+
+gi_none:
+ jmp NO_OPERATION ; call lower CON device
+
+
+; 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
+
+ cmp es:[di].INFO_LEVEL,0 ; check for valid info level
+ jnz gi_invalid
+ cmp es:[di].DATA_LENGTH,TYPE MODE_TABLE+1 ; and buffer size
+ jge gi_valid
+
+gi_invalid:
+ mov ax,INVALID_FUNC ; not valid...unsupported
+ stc ; function..set error flag and
+ ret
+
+gi_valid:
+ mov es:[di].INFO_LEVEL+1,0 ; set reserved byte to 0.
+ mov ah,REQ_VID_MODE ; request current video mode
+ int 10H
+ and al,VIDEO_MASK
+ lea si,VIDEO_MODE_TABLE ; point to resident video table
+ call GET_SEARCH ; perform search
+ jnc gi_supported ; found?
+
+ mov ax,NOT_SUPPORTED ; no....load unsupported function
+ ret ; carry already set
+
+gi_supported:
+ push di ;Save Request Buffer pointer
+ mov WORD PTR es:[di].DATA_LENGTH,(TYPE MODE_TABLE)+1 ;length of data is struc size
+ inc si ; skip mode value
+ add di,RP_FLAGS ; point to flag word
+
+; VGA,MCGA: VALUE RETURNED FROM FUNCTIONALITY CALL
+; EGA: VALUE LAST SET THROUGH IOCTL. DEFAULT IS BLINKING.
+; CGA,MONO: BLINKING
+
+ cmp al,7 ; M004; Monochrome screen?
+ mov ax,OFF ; assume CGA,MONO
+ ; (we always have blink).
+ jz gi_flags_done ; M004;
+
+ cmp HDWR_FLAG,MCGA_ACTIVE ; if we have an EGA or better
+ jl gi_flags_done
+
+ test HDWR_FLAG,VGA_ACTIVE ; VGA supported?
+ jz gi_as_intensity_flag
+
+ push es ; yes...prepare for
+ push di ; functionality call
+
+ push ds
+ pop es
+ lea di,FUNC_INFO ; point to data block
+ mov ah,FUNC_CALL ; load function number
+ xor bx,bx ; implementation type 0
+ int 10H
+
+ mov INTENSITY_FLAG,OFF ; assume no intensity
+ test es:[di].MISC_INFO,INT_BIT ; is blink bit set?
+ jnz gi_intensity_is_fine ; if not no intensity
+
+ inc INTENSITY_FLAG ; we want intensity
+
+gi_intensity_is_fine:
+ pop di ; restore registers
+ pop es
+
+gi_as_intensity_flag:
+ mov ax,INTENSITY_FLAG ; write the control flag..
+
+gi_flags_done:
+ stosw ; write the control flag..
+ ; point to next field (display)
+ mov cx,(TYPE MODE_TABLE)-1 ; load count
+ rep movsb ; transfer data from video table
+ ; to request packet
+ sub si,TYPE MODE_TABLE ; point back to start of mode data
+
+ifdef JAPAN
+ dec di ; point to number of rows
+ dec di
+ENDIF
+
+ cmp [si].D_MODE,TEXT_MODE ; if we are in text mode and
+ jnz gi_row_counted
+ cmp [si].SCR_ROWS,DEFAULT_LENGTH ; length <> 25 then we have an EGA or VGA
+ jz gi_row_counted
+
+ifndef JAPAN
+ dec di ; point back to length entry in req packet
+ dec di
+ENDIF
+ push ds
+ mov ax,ROM_BIOS ; load ROM BIOS data area segment
+ mov ds,ax
+ mov al,BYTE PTR ds:[NUM_ROWS] ; load current number of rows
+ cbw
+ inc ax ; add 1 to row count
+ mov WORD PTR es:[di],ax ; and copy to request packet
+ pop ds
+
+gi_row_counted:
+
+ifdef JAPAN
+ mov al,row_adj
+ xor ah,ah
+ sub es:[di],ax ; support ESC[>1l
+ENDIF
+
+ xor ax,ax ; no errors
+ clc ; clear error flag
+ pop di ; Restore Request Buffer pointer
+ ret ; return to calling module
+
+GET_IOCTL ENDP
+
+
+
+
+; 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
+
+ or In_Generic_IOCTL_Flag, I_AM_IN_NOW ; Signal GENERIC_IOCTL request being processed
+ push REQ_TXT_LENGTH ; save old value in case of error
+
+ cmp es:[di].INFO_LEVEL,0 ; check for valid info level
+ jnz si_invalid
+ cmp es:[di].DATA_LENGTH,TYPE MODE_TABLE+1 ; ane buffer size
+ jnz si_invalid
+ mov ax,es:[di].RP_FLAGS ; test for invalid flags
+ test ax,INVALID_FLAGS
+ jnz si_invalid
+ test es:[di].RP_FLAGS,ON ; if intensity is requested and..
+ jz si_valid
+ cmp HDWR_FLAG,MCGA_ACTIVE ; hardware does not support it
+ jge si_valid
+
+si_invalid:
+ mov ax,INVALID_FUNC ; not valid...unsupported..
+ jmp si_failed
+
+si_valid:
+ call SET_SEARCH ; search table for match
+ jnc si_mode_valid
+
+si_not_supp:
+ jmp si_not_supported
+
+si_mode_valid:
+ cmp [si].D_MODE,TEXT_MODE ; is a text mode being requested?
+ jz si_do_text_mode
+
+ call SET_VIDEO_MODE
+ jmp si_end_ok
+
+si_do_text_mode:
+ mov ax,es:[di].RP_ROWS ; save new requested value.
+ mov REQ_TXT_LENGTH,ax
+
+ cmp ax,DEFAULT_LENGTH ; is it just 25 lines needed?
+ jz si_display_ok
+
+ mov ax,DISPLAY_CHECK
+ int 2FH
+
+ cmp al,INSTALLED ; or is DISPLAY.SYS not there?
+ jnz si_display_ok
+
+ mov ax,CHECK_FOR_FONT
+ int 2FH ; or if it is does it have the..
+ jnc si_display_ok
+
+ mov ax,NOT_AVAILABLE ; DISPLAY.SYS does not have the font
+ jmp si_failed
+
+si_display_ok:
+ cmp [si].SCR_ROWS,UNOCCUPIED
+ jz si_is_vga
+ test HDWR_FLAG,VGA_ACTIVE
+ jz si_non_vga
+
+si_is_vga:
+ mov ax,1A00h ;Get currently active adap.;C04
+ int 10h ;VGA interrupt ;C04
+ mov ax,REQ_TXT_LENGTH ; restore AX
+ cmp bl,7 ;Q: non_vga adapter? ;C04
+ jb si_non_vga ;Yes so do other stuff ;C04
+
+process_vga:
+ mov cl,3 ; ax loaded with length requested
+ shl ax,cl ; mulitply by 8 to get scan lines
+ lea bx,SCAN_LINE_TABLE ; load bx with scan line table start
+ mov cx,SCANS_AVAILABLE ; total number of scan lines settings
+
+pv_while:
+ cmp ax,[bx].NUM_LINES ; pointing at the right setting?
+ jz pv_found
+
+ add bx,TYPE SCAN_LINE_STR ; not this setting..point to next
+ loop pv_while
+
+ jmp short si_not_supp
+
+pv_found:
+ mov dl,[bx].REP_1BH
+
+ test SCAN_LINES,dl ; does the hardware have it?
+ jz si_not_supp
+
+ mov cl,[bx].REP_12H ; yes, store value to set it
+ mov SCAN_DESIRED,cl
+
+ cmp REQ_TXT_LENGTH,DEFAULT_LENGTH ; 25 lines requested?
+ jnz pv_scan_ok
+
+ mov al,MAX_SCANS ; desired scan setting should be..
+ mov SCAN_DESIRED,AL ; the maximum.
+
+pv_scan_ok:
+
+; following added to overcome problems with rolling
+; screens in QBX and WZMAIL. Problem still exists when switching between
+; mono and VGA screens when ANSI is loaded with /L.
+
+ test In_Generic_IOCTL_Flag,CALLED_BY_INT10COM
+ jnz si_set_mode_done
+
+ mov ah,ALT_SELECT ; set the appropriate number..
+ mov bl,SELECT_SCAN ; of scan lines..
+ mov al,SCAN_DESIRED
+ int 10H
+
+ jmp short si_processed
+
+si_non_vga:
+ mov ax,REQ_TXT_LENGTH
+ cmp ax,DEFAULT_LENGTH ; see if length requested..
+ jz si_cursor_emul ; is valid
+ cmp ax,[si].SCR_ROWS
+ jnz si_not_supported
+
+si_cursor_emul:
+ call SET_CURSOR_EMUL
+
+si_processed:
+ call SET_VIDEO_MODE
+
+si_set_mode_done:
+ call DO_ROWS
+ cmp ALT_PRT_SC_INVOKED,FALSE ; If not set up already
+ jnz si_printscreen_ok
+ cmp es:[di].RP_ROWS,DEFAULT_LENGTH ; and needed because lines (or 30?)
+ jle si_printscreen_ok
+ cmp HDWR_FLAG,MCGA_ACTIVE ; and if we have EGA or better then.. (supported)
+ jl si_printscreen_ok
+
+ mov ah,ALT_SELECT ; issue select alternate print..
+ mov BL,ALT_PRT_SC ; screen routine call..
+ int 10H
+ mov ALT_PRT_SC_INVOKED,TRUE ; mark that it was done
+
+si_printscreen_ok:
+ call SET_CURSOR_EMUL ; yes..ensure cursor emulation
+ ; is set accordingly.
+ cmp HDWR_FLAG,MCGA_ACTIVE ; for the EGA and better...
+ jl si_end_ok
+
+ cmp [si].V_MODE,7 ; M004; and not monochrome
+ jz si_end_ok
+
+ xor bx,bx ; bx: 1=intensity on, 0: off
+ ; assume off
+ test es:[di].RP_FLAGS,ON
+ jz si_intensity_ok
+
+ inc bx ; user wants intensity
+
+si_intensity_ok:
+ mov INTENSITY_FLAG,bx
+ mov ax,BLINK_TOGGLE
+ xor bl,ON ; bl is opposite
+ ; of INTENSITY_FLAG
+ int 10H
+
+si_end_ok:
+ and In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW ; Turn the flag off
+ pop ax ; forget old REQ_TXT_LENGTH
+ xor ax,ax ; clear error register
+ clc ; clear error flag
+ ret
+
+si_not_supported:
+ mov ax,NOT_SUPPORTED
+
+si_failed:
+ and In_Generic_IOCTL_Flag, NOT I_AM_IN_NOW ; Turn the flag off
+ pop REQ_TXT_LENGTH ; error...so restore old value.
+ stc ; set error flag
+ ret
+
+SET_IOCTL ENDP
+
+
+
+; 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
+
+ cmp req_txt_length, DEFAULT_LENGTH
+ je dr_exit
+ mov ax,LOAD_8X8 ; load 8x8 ROM font
+ xor bl,bl
+ int 10H ; M003;
+ mov ax,SET_BLOCK_0 ; activate block = 0
+ xor bl,bl
+ int 10H ; M003;
+dr_exit:
+ ret
+
+DO_ROWS ENDP
+
+
+
+
+
+
+; PROCEDURE_NAME: SET_SEARCH
+
+; FUNCTION:
+; THIS PROCEDURE SEARCHES THE RESIDENT VIDEO TABLE IN ATTEMPT TO
+; FIND A MODE THAT MATCHES THE CHARACTERISTICS REQUESTED.
+
+; AT ENTRY:
+
+; AT EXIT:
+; NORMAL: CARRY CLEAR - SI POINTS TO APPLICABLE RECORD
+
+; ERROR: CARRY SET
+
+; 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.
+
+; WARNING: TRASH CX
+
+SET_SEARCH PROC NEAR
+
+ lea si,VIDEO_MODE_TABLE ; point to video table
+ mov cx,MAX_VIDEO_TAB_NUM ; load counter, # of tables
+
+ss_while:
+ cmp [si].V_MODE,UNOCCUPIED ; while we have valid entries
+ jz ss_not_found
+
+ mov al,INT10_V_Mode
+
+ cmp al,0ffh ; if not issued by Int10 set mode,
+ jnz ss_from_set_mode
+
+
+ mov al,es:[di].RP_MODE ; load register for compare.
+ cmp [si].D_MODE,al ; match?
+ jnz ss_end_while
+
+ mov ax,es:[di].RP_COLORS ; yes...prepare next field
+ cmp [si].COLORS,ax ; match?
+ jnz ss_end_while
+
+ cmp es:[di].RESERVED2,0 ; yes, ensure reserved byte is zero
+ jnz ss_end_while
+
+ cmp es:[di].RP_MODE,GRAPHICS_MODE ; for graphics mode
+ jnz ss_not_graphic ; check the following:
+
+ mov ax,es:[di].RP_WIDTH ; screen width.
+ cmp [si].SCR_WIDTH,ax
+ jnz ss_end_while
+
+ mov ax,es:[di].RP_LENGTH ; screen length
+ cmp [si].SCR_LENGTH,ax
+ jnz ss_end_while ; ignore #rows and #coloumns
+
+ jmp short ss_found
+
+ss_not_graphic:
+ mov ax,es:[di].RP_COLS ; the rows are matched
+ cmp [si].SCR_COLS,ax ; in the main routine
+ jnz ss_end_while
+
+ss_found:
+ clc
+ jmp short ss_done
+
+ss_from_set_mode:
+ cmp [si].V_MODE,al ; if V_MODE = AL, we are ok
+ jz ss_found
+
+ss_end_while:
+ add si,type MODE_TABLE ; then, this is not the correct entry.
+ loop ss_while ; Let's find the next entry.
+
+ss_not_found:
+ stc
+
+ss_done:
+ mov INT10_V_Mode, 0FFh ; Done. Reset the value
+ ret
+
+SET_SEARCH ENDP
+
+
+
+
+; 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
+
+; WARNING: TRASH CX
+
+GET_SEARCH PROC NEAR
+
+ mov cx,MAX_VIDEO_TAB_NUM ; # of total tables
+
+gs_while:
+ cmp [si].V_MODE,UNOCCUPIED ; while we're not pointing to
+ jz gs_error
+ cmp [si].V_MODE,al ; the right mode and we are still
+ jz gs_got_it
+
+ add si,TYPE MODE_TABLE ; point to the next mode
+ loop gs_while
+
+gs_error:
+ stc ; no, set error flag
+ ret
+
+gs_got_it:
+ clc
+ ret
+
+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
+
+ test HDWR_FLAG,E5154_ACTIVE ; EGA with 5154?
+ jz sce_done
+
+ push si
+ push ds ; yes..so..
+ mov ax,ROM_BIOS ; check cursor emulation..
+ mov ds,ax
+ mov si,CURSOR_FLAG
+ mov al,BYTE PTR [si]
+
+ cmp cs:REQ_TXT_LENGTH,DEFAULT_LENGTH; >25 lines req?
+ jnz sce_cursor_on
+
+ and al,TURN_OFF ; no....set it OFF
+
+ jmp short sce_cursor_ok
+
+sce_cursor_on:
+ or al,TURN_ON ; yes...set it ON
+
+sce_cursor_ok:
+ mov BYTE PTR [si],AL
+ pop ds
+ pop si
+
+sce_done:
+ ret ; return to calling module
+
+SET_CURSOR_EMUL ENDP
+
+
+
+
+; 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.
+
+;M002; What is bellow was modified. The /L option was removed. But ansi
+;M002; will still do a GET_IOCTL/SET_IOCTL for the application.
+; 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
+
+ sti ; restore interrupts
+ cmp ah,SET_CURSOR_CALL
+ jz SET_CURSOR_HANDLER
+ cmp ah,SET_MODE
+ jz SET_MODE_HANDLER
+
+ jmp DWORD PTR cs:ROM_INT10 ; no...pass it on.
+
+SET_CURSOR_HANDLER:
+ push ax
+
+ test cs:HDWR_FLAG,E5151_ACTIVE ; do we have an EGA?
+ jz sch_goto_rom
+ cmp cs:REQ_TXT_LENGTH,DEFAULT_LENGTH
+ jz sch_goto_rom
+ cmp cs:GRAPHICS_FLAG,TEXT_MODE ; with 5151..so perform cursor mapping
+ jnz sch_goto_rom
+ cmp cl,8
+ jl sch_goto_rom
+
+ mov al,ch ; check for cursor..
+ and al,60h ; off emulation. J.K.
+
+ cmp al,20h
+ jz sch_goto_rom
+
+ mov al,ch ; start position for cursor
+ call MAP_DOWN
+ mov ch,al
+ mov al,cl ; end position for cursor
+ call MAP_DOWN
+ mov cl,al
+
+sch_goto_rom:
+ pop ax
+ jmp DWORD PTR CS:ROM_INT10 ; continue interrupt processing
+
+SET_MODE_HANDLER:
+ pushf ; prepare for IRET
+ mov cs:ANSI_SetMode_Call_Flag, 1 ; Used by INT2F_COM
+ call DWORD PTR CS:ROM_INT10 ; call INT10 routine
+ mov cs:ANSI_SetMode_Call_Flag, 0 ; Reset it
+ push bp
+ push es
+ push ds
+ push si
+ push di
+ push dx
+ push cx
+ push bx
+ push ax
+ push cs
+ pop ds
+ mov ah,REQ_VID_MODE ; get current mode..
+ pushf
+ call DWORD PTR ROM_INT10
+ and al,VIDEO_MASK ; mask bit 7 (refresh)
+ test In_Generic_IOCTL_Flag, (I_AM_IN_NOW + SET_MODE_BY_DISPLAY) ; Flag is on?
+;If not (I_AM_IN_NOW or SET_MODE_BY_DISPLAY),
+
+ jnz smh_ioctl_done
+
+; cmp SWITCH_L,0 ;M002; No more /L
+; jnz smh_ioctl_done ;M002; No more /L
+
+ push ax ;Save mode
+ push es
+ push cs
+ pop es
+ mov di,offset My_IOCTL_Req_Packet
+ mov INT10_V_Mode,al ;Save current mode for SET_SEARCH
+ call Get_IOCTL
+
+ jc smh_set_ioctl_done
+
+ or In_Generic_IOCTL_Flag, CALLED_BY_INT10COM ;Do not set mode INT 10h again. Already done.
+ call Set_IOCTL
+ and In_Generic_IOCTL_Flag, not CALLED_BY_INT10COM
+
+smh_set_ioctl_done:
+
+ pop es
+ pop ax ;Restore mode
+ mov INT10_V_Mode,0FFh
+
+
+smh_ioctl_done:
+
+ lea si,VIDEO_MODE_TABLE
+ call GET_SEARCH ; look through table for mode selected.
+ jc smh_graphic_mode ; M001; if not found then
+ ; M001; assume graphic mode
+
+ cmp [si].D_MODE,TEXT_MODE ; text mode?
+ jz smh_text_mode
+
+smh_graphic_mode:
+ mov GRAPHICS_FLAG,GRAPHICS_MODE ; no, set graphics flag
+ jmp short smh_flag_done
+
+smh_text_mode:
+ mov GRAPHICS_FLAG,TEXT_MODE ; set TEXT MODE
+
+
+smh_flag_done:
+
+; test In_Generic_IOCTL_Flag, I_AM_IN_NOW
+; jnz smh_l_done ; M002; No more /L
+; cmp Graphics_Flag,TEXT_MODE ; M002; No more /L
+; jnz smh_l_done ; M002; No more /L
+; cmp SWITCH_L,1 ; M002; No more /L
+; jnz smh_l_done ; M002; No more /L
+
+; call DO_ROWS ; M002; No more /L
+
+smh_l_done:
+
+;For each SET mode function int 10h function call, if it is not
+;issued by ANSI GET_IOCTL and SET_IOCTL procedure themselves, we assume
+;that the APPS, which usually does not know the ANSI GET_IOCTL/SET_IOCTL
+;interfaces, intend to change the screen mode. In this case, ANSI is
+;kind enough to call GET_IOCTL and SET_IOCTL function call for themselves.
+
+ pop ax
+ pop bx
+ pop cx
+ pop dx
+ pop di
+ pop si
+ pop ds
+ pop es
+ pop bp
+ iret
+
+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
+
+ sti
+ cmp ah,multANSI ; is this for ANSI?
+ jnz ic_goto_rom
+ cmp al,DA_INFO_2F
+ jle INT2F_HANDLER
+
+ic_goto_rom:
+ jmp DWORD PTR CS:ROM_INT2F ; no....jump to old INT2F
+
+INT2F_HANDLER:
+
+ cmp al,INSTALL_CHECK
+ jnz ih_not_check
+
+; do install check
+
+ mov al,INSTALLED ; load value to indicate installed
+ clc ; clear error flag.
+ jmp ih_iret
+
+ih_not_check:
+ cmp al,DA_INFO_2F ; IOCTL or INFO passing?
+ jbe ih_valid
+ jmp ih_iret
+
+ih_valid:
+ push bp
+ push ax ; s
+ push cx ; a
+ push dx ; v
+ push ds ; e r
+ push es ; e
+ push di ; g
+ push si ; s.
+ push bx
+ push ds ; load ES with DS (for call)
+ pop es
+ mov di,dx ; load DI with dx (for call)
+ push cs ; setup local addressability
+ pop ds
+
+ cmp al,IOCTL_2F ; IOCTL request
+ jnz ih_not_ioctl
+
+ cmp cl,GET_FUNC ; get function requested.
+ jnz ih_not_get
+
+ call GET_IOCTL
+
+ jc ih_set_flags ; if no error and
+ cmp HDWR_FLAG,E5151_ACTIVE ; >25 lines supported
+ jl ih_set_flags
+ cmp [si].D_MODE,TEXT_MODE ; this is a text mode then..
+ jnz ih_set_flags
+
+
+; cmp SWITCH_L,1 ; M002; No more /L
+; jz ih_use_rtl ; M002; No more /L
+
+ cmp ANSI_SetMode_Call_Flag,1
+ jnz ih_use_rtl ; if not originated by ANSI thru AH=0, Int10
+ cmp Display_Loaded_Before_me,1 ; or Display.sys not loaded before ANSI,
+ jz ih_get_ok
+
+ih_use_rtl:
+ mov bx,REQ_TXT_LENGTH ; then use REQ_TXT_LENGTH instead..
+ mov es:[di].RP_ROWS,bx
+
+ih_get_ok:
+ clc
+ jmp short ih_set_flags
+
+ih_not_get:
+ cmp cl,SET_FUNC
+ jnz ih_invalid
+
+ call SET_IOCTL ; set function requested.
+
+ jmp short ih_set_flags
+
+; invalid function
+
+ih_invalid:
+ mov ax,INVALID_FUNC ; load error and...
+ stc ; set error flag.
+ jmp short ih_set_flags ; Info. passing
+
+ih_not_ioctl:
+ cmp es:[di].DA_INFO_LEVEL,0 ; 0 - DA_SETMODE_FLAG request
+ jnz ih_not_info
+
+
+ cmp es:[di].DA_SETMODE_FLAG,1
+ jnz ih_not_set
+
+ or In_Generic_IOCTL_Flag, SET_MODE_BY_DISPLAY ;Turn the flag on
+ jmp short ih_info_ok
+
+ih_not_set:
+ and In_Generic_IOCTL_Flag, not SET_MODE_BY_DISPLAY ;Turn the flag off
+
+ jmp short ih_info_ok
+
+ih_not_info:
+
+ cmp es:[di].DA_INFO_LEVEL,1 ; 1 = DA_L_STATA query
+ jnz ih_info_ok
+
+; mov al,cs:[SWITCH_L] ; M002; No more /L
+ mov al,OFF ; M002; No more /L
+
+ mov es:[di].DA_L_STATE, al
+
+ih_info_ok:
+ clc ; clear carry. There is no Error in DOS 4.00 for this call.
+
+ih_set_flags:
+ pop bx ; restore all..
+ pop si
+ pop di ; registers except..
+ pop es
+ pop ds ; BP.
+ pop dx
+ pop cx
+ push ax ; save error condition
+ mov bp,sp ; setup frame pointer
+ mov ax,[bp+10] ; load stack flags
+ jc ih_error ; carry set???
+
+ and ax,NOT_CY ; no.. set carry off.
+ mov [bp+10],ax ; put back on stack.
+ pop ax ; remove error flag from stack
+ pop ax ; no error so bring back function call
+ XCHG ah,al ; exchange to show that ANSI present
+ jmp short ih_pop_bp
+
+ih_error:
+ or ax,CY ; yes...set carry on.
+ mov [bp+10],ax ; put back on stack.
+ pop ax ; restore error flag
+ pop bp ; pop off saved value of ax (destroyed)
+
+ih_pop_bp:
+ pop bp ; restore final register.
+ih_iret:
+ABORT: iret
+
+INT2F_COM ENDP
+
+
+
+
+; 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
+
+ push bx
+ xor ah,ah ; clear upper byte of cursor position
+ mov bl,EIGHT ; multiply by current box size.
+ push dx ; al x
+ mul bl ; ---- = ---
+ pop dx ; 14 8
+ mov bl,FOURTEEN
+ div bl ; divide by box size expected.
+ pop bx
+ ret
+
+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
+
+ test In_Generic_IOCTL_Flag,CALLED_BY_INT10COM
+ jnz svm_done
+
+ mov al,[si].V_MODE ; ..issue set mode
+
+ test HDWR_FLAG,LCD_ACTIVE
+ jnz svm_update_bios ; is this the LCD?
+ test HDWR_FLAG,VGA_ACTIVE ; or VGA? (done for BRECON card)
+ jz svm_update_done
+
+svm_update_bios:
+ push ds ; yes...
+ mov bl,al ; save mode
+ mov ax,ROM_BIOS
+ mov ds,ax ; get equipment status flag..
+ mov ax,ds:[EQUIP_FLAG]
+ and ax,INIT_VID_MASK ; clear initial video bits..
+
+ cmp bl,MODE7 ; are we setting mono?
+ jz svm_mono
+ cmp bl,MODE15
+ jnz svm_color
+
+svm_mono:
+ or ax,LCD_MONO_MODE ; yes...set bits as mono
+ jmp short svm_update_it
+
+svm_color:
+ or ax,LCD_COLOR_MODE ; no...set bits as color
+
+svm_update_it:
+ mov ds:[EQUIP_FLAG],ax ; replace updated flag.
+ mov al,bl ; restore mode.
+ pop ds
+
+svm_update_done:
+ mov ah,SET_MODE ; set mode
+ int 10H
+
+svm_done:
+ ret
+
+SET_VIDEO_MODE ENDP
+
+CODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/dev/ansi/makefile b/private/mvdm/dos/v86/dev/ansi/makefile
new file mode 100644
index 000000000..70acdb474
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/makefile
@@ -0,0 +1,79 @@
+#;
+#; Microsoft Confidential
+#; Copyright (C) Microsoft Corporation 1988-1991
+#; All Rights Reserved.
+#;
+#
+# Make file for ANSI.SYS
+#
+# Modification History
+#
+# Sudeepb 26-Jul-1992 Ported for NT DOS Support
+
+#*********************** Makefile for ansi.sys ****************************
+include ../../make.inc
+
+cinc =../../../../inc
+AINC =-I. -I$(cinc) -I../../../../inc
+
+dest =ansi.sys
+
+#
+####################### Dependencies Begin Here ##########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.bin del *.bin
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist ansi.sys del ansi.sys
+
+
+ansi.ctl: ansi.skl \
+ makefile \
+ $(msg)\$(COUNTRY).msg
+
+ansi.obj: ansi.asm \
+ makefile \
+ ansi.inc \
+ $(inc)\vector.inc \
+ $(inc)\mult.inc \
+ $(inc)\struc.inc
+
+ioctl.obj: ioctl.asm \
+ makefile \
+ ansi.inc \
+ $(inc)\struc.inc
+
+ansiinit.obj: ansiinit.asm \
+ makefile \
+ ansi.inc \
+ ansivid.inc \
+ $(inc)\struc.inc
+
+parser.obj: parser.asm \
+ makefile \
+ ansi.inc \
+ $(inc)\sysmsg.inc \
+ $(inc)\version.inc \
+ $(inc)\parse.asm \
+ $(inc)\struc.inc \
+ ansi.ctl \
+ $(inc)\versiona.inc
+
+ansi.exs: ansi.obj \
+ ioctl.obj \
+ ansiinit.obj \
+ parser.obj \
+ ansi.lnk \
+ makefile
+ link16 @ansi.lnk
+
+$(dest): ansi.exs
diff --git a/private/mvdm/dos/v86/dev/ansi/parser.asm b/private/mvdm/dos/v86/dev/ansi/parser.asm
new file mode 100644
index 000000000..4d143a460
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/ansi/parser.asm
@@ -0,0 +1,356 @@
+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**********************************************************
+; P1529 ANSI /x /y gives wrong error message 10/8/87 J.K.
+; D397 /L option for "Enforcing" the line number 12/17/87 J.K.
+; D479 An option to disable the extended keyboard functions 02/12/88 J.K.
+;******************************************************************************
+
+
+INCLUDE ANSI.INC ; ANSI equates and structures
+.XLIST
+INCLUDE SYSMSG.INC ; Message retriever code
+MSG_UTILNAME <ANSI> ; Let message retriever know its ANSI.SYS
+.LIST
+
+PUBLIC PARSE_PARM ; near procedure for parsing DEVICE= statement
+
+
+
+; Set assemble switches for parse code that is not required!!
+
+
+
+DateSW EQU 0
+TimeSW EQU 0
+CmpxSW EQU 0
+DrvSW EQU 0
+QusSW EQU 0
+NumSW EQU 0
+KeySW EQU 0
+Val1SW EQU 0
+Val2SW EQU 0
+Val3SW EQU 0
+
+
+CODE SEGMENT PUBLIC BYTE
+ ASSUME CS:CODE
+
+.XLIST
+MSG_SERVICES <MSGDATA>
+MSG_SERVICES <DISPLAYmsg,LOADmsg,CHARmsg>
+MSG_SERVICES <ANSI.CL1>
+MSG_SERVICES <ANSI.CL2>
+MSG_SERVICES <ANSI.CLA>
+
+INCLUDE VERSION.INC
+INCLUDE PARSE.ASM ; Parsing code
+.LIST
+
+
+EXTRN SWITCH_X:BYTE ; /X switch flag
+extrn Switch_L:Byte ; /L switch flag
+extrn Switch_K:Byte ; /K switch flag
+extrn Switch_S:Byte ; M008 ; /S or /SCREENSIZE switch flag
+
+
+
+; PARM control blocks for ANSI
+; Parsing DEVICE= statment from CONFIG.SYS
+
+; DEVICE=[d:][path]ANSI.SYS [/X] [/K] [/L] [/S | /SCREENSIZE] ; M008
+
+
+
+PARMS LABEL WORD
+ DW PARMSX
+ DB 0 ; no extra delimeters or EOLs.
+
+PARMSX LABEL BYTE
+ DB 1,1 ; 1 valid positional operand
+ DW FILENAME ; filename
+ DB 1 ; 1 switche definition in the following
+ DW Switches
+ DB 0 ; no keywords
+
+FILENAME LABEL WORD
+ DW 0200H ; file spec
+ DW 0001H ; cap by file table
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 0 ; no switch/keyword synonyms
+
+Switches LABEL WORD
+ DW 0 ; switch with no value
+ DW 0 ; no functions
+ DW RESULT_BUF ; result
+ DW NOVALS ; no value checking done
+ DB 5 ;AN003; M008; 5 switch synonym
+X_SWITCH DB "/X",0 ; /X name
+L_SWITCH DB "/L",0 ; /L
+K_SWITCH DB "/K",0 ; /K
+SSIZE_SWITCH DB "/SCREENSIZE",0 ; M008; /SCREENSIZE
+S_SWITCH DB "/S",0 ; M008; /S
+
+NOVALS LABEL BYTE
+ DB 0 ; no value checking done
+
+RESULT_BUF LABEL BYTE
+ DB ? ; type returned (number, string, etc.)
+ DB ? ; matched item tag (if applicable)
+SYNONYM_PTR DW 0 ; synonym ptr (if applicable)
+ DD ? ; value
+
+SUBLIST LABEL DWORD ; list for substitution
+ DB SUB_SIZE
+ DB 0
+ DD ?
+ DB 1
+ DB LEFT_ASCIIZ
+ DB UNLIMITED
+ DB 1
+ DB " "
+
+Old_SI dw ?
+Saved_Chr db 0
+Continue_Flag db ON
+Parse_Err_Flag db OFF
+
+
+
+; 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
+ CALL SYSLOADMSG ; load message
+
+ jnc plab01
+
+ CALL SYSDISPMSG ; display error message
+ STC ; ensure carry still set
+
+ jmp plab02
+
+plab01:
+ PUSH CS ; establish ES ..
+ POP ES ; addressability to data
+ LEA DI,PARMS ; point to PARMS control block
+ XOR CX,CX ; clear both CX and DX for
+ XOR DX,DX ; SYSPARSE
+ CALL SYSPARSE ; move pointer past file spec
+ mov Switch_L, OFF
+ mov Switch_X, OFF
+
+while01:
+ cmp Continue_Flag,ON
+ jz plab_bogus ; M008; bogus label to avoid jmp
+ jmp while01_end ; M008; out of short range.
+
+plab_bogus: ; M008
+
+ mov Old_SI, SI ;to be use by PARM_ERROR
+ call SysParse
+
+ cmp ax,RC_EOL
+ jnz plab09
+
+ mov Continue_Flag, OFF
+ jmp short while01
+
+plab09:
+
+ cmp ax,RC_NO_ERROR
+ jz plab07
+
+ mov Continue_Flag, OFF
+ mov Switch_X, OFF
+ mov Switch_L, OFF
+ mov Switch_K, OFF
+ call Parm_Error
+ mov Parse_Err_Flag,ON
+
+ jmp short while01
+
+plab07:
+
+ cmp Synonym_ptr,offset X_SWITCH
+ jnz plab05
+
+ mov Switch_X,ON
+ jmp short plab04
+
+
+plab05:
+ cmp Synonym_ptr,offset L_SWITCH
+ jnz plab03
+
+ mov Switch_L,ON
+ jmp short plab04
+
+plab03: ; M008
+ cmp Synonym_ptr, offset S_SWITCH ; M008
+ jnz plab11 ; M008
+
+plab12: ; M008
+ mov Switch_S,ON ; M008
+ jmp short plab04 ; M008
+
+plab11: ; M008
+ cmp Synonym_ptr, offset SSIZE_SWITCH; M008
+ jz plab12 ; M008
+
+ mov Switch_K,ON ; must be /K
+
+plab04:
+ clc
+
+ jmp while01
+
+while01_end:
+
+ cmp Parse_Err_Flag,ON
+ jnz plab10
+
+ stc
+ jmp short plab02
+
+plab10:
+ clc
+
+plab02:
+
+ RET
+PARSE_PARM ENDP
+
+
+
+
+; 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
+ PUSH CX
+ PUSH SI
+ PUSH ES
+ PUSH DS
+
+; PUSH CS
+; POP DS ; establish addressability
+; MOV BX,DX
+; LES DX,[BX].RES_PTR ; find offending parameter
+ push ds
+ pop es
+ mov si, cs:Old_SI ;Now es:dx -> offending parms
+ push si ;Save it
+Get_CR:
+ cmp byte ptr es:[si], 13 ;CR?
+ je Got_CR
+ inc si
+ jmp Get_CR
+Got_CR:
+ inc si ; The next char.
+ mov al, byte ptr es:[si]
+ mov cs:Saved_Chr, al ; Save the next char
+
+ mov byte ptr es:[si], 0 ; and make it an ASCIIZ
+ mov cs:Old_SI, si ; Set it again
+ pop dx ; saved SI -> DX
+
+ push cs
+ pop ds ;for addressability
+
+ LEA SI,SUBLIST ; ..and place the offset..
+ MOV [SI].SUB_PTR_O,DX ; ..in the SUBLIST..
+ MOV [SI].SUB_PTR_S,ES
+ MOV AX,INVALID_PARM ; load 'Invalid parameter' message number
+ MOV BX,STDERR ; to standard error
+ MOV CX,ONE ; 1 substitution
+ XOR DL,DL ; no input
+ MOV DH,UTILITY_MSG_CLASS ; parse error
+ CALL SYSDISPMSG ; display error message
+ mov si, cs:Old_SI ;restore the original char.
+ mov cl, cs:Saved_Chr
+ mov byte ptr es:[si], cl
+
+ POP DS
+ POP ES
+ POP SI
+ POP CX
+ RET
+PARM_ERROR ENDP
+
+include msgdcl.inc
+
+CODE ENDS
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/country/alclbjfk b/private/mvdm/dos/v86/dev/country/alclbjfk
new file mode 100644
index 000000000..95a8b16ea
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/alclbjfk
@@ -0,0 +1,2054 @@
+;
+; create country.sys file
+;
+;
+ include mkcntry.inc
+;
+; -----------------------------------------------------------
+;
+; 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 <CENTRYSIZE,CID_AL,852,,,al852_data> ; Albania
+ ctryent <CENTRYSIZE,CID_AL,850,,,al850_data> ;
+
+ ctryent <CENTRYSIZE,CID_AR,850,,,ar850_data> ; Argentina
+ ctryent <CENTRYSIZE,CID_AR,437,,,ar437_data> ;
+
+ ctryent <CENTRYSIZE,CID_AU,437,,,au437_data> ; Australia
+ ctryent <CENTRYSIZE,CID_AU,850,,,au850_data> ;
+
+ ctryent <CENTRYSIZE,CID_AT,850,,,at850_data> ; Austria
+ ctryent <CENTRYSIZE,CID_AT,437,,,at437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BE,850,,,be850_data> ; Belgium
+ ctryent <CENTRYSIZE,CID_BE,437,,,be437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BH,852,,,bh852_data> ; Bosnia/Herzegovina
+ ctryent <CENTRYSIZE,CID_BH,850,,,bh850_data> ;
+
+ ctryent <CENTRYSIZE,CID_BR,850,,,br850_data> ; Brazil
+ ctryent <CENTRYSIZE,CID_BR,437,,,br437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BG,855,,,bg855_data> ; Bulgaria IBM Country Code
+ ctryent <CENTRYSIZE,CID_BG,850,,,bg850_data> ;
+
+ ctryent <CENTRYSIZE,CID_BGI,855,,,bgi855_data> ; Bulgaria Real Country Code
+ ctryent <CENTRYSIZE,CID_BGI,850,,,bgi850_data> ;
+
+ ctryent <CENTRYSIZE,CID_CA,850,,,ca850_data> ; Canada French
+ ctryent <CENTRYSIZE,CID_CA,863,,,ca863_data> ;
+
+ ctryent <CENTRYSIZE,CID_CAE,850,,,cae850_data> ; Canada English
+ ctryent <CENTRYSIZE,CID_CAE,863,,,cae863_data> ;
+
+ ctryent <CENTRYSIZE,CID_CL,850,,,cl850_data> ; Chile
+ ctryent <CENTRYSIZE,CID_CL,437,,,cl437_data> ;
+
+ ctryent <CENTRYSIZE,CID_CO,850,,,co850_data> ; Colombia
+ ctryent <CENTRYSIZE,CID_CO,437,,,co437_data> ;
+
+ ctryent <CENTRYSIZE,CID_CRO,852,,,cro852_data> ; Croatia
+ ctryent <CENTRYSIZE,CID_CRO,850,,,cro850_data> ;
+
+ ctryent <CENTRYSIZE,CID_CS,852,,,cs852_data> ; Czech Republic
+ ctryent <CENTRYSIZE,CID_CS,850,,,cs850_data> ;
+
+ ctryent <CENTRYSIZE,CID_EC,850,,,ec850_data> ; Ecuador
+ ctryent <CENTRYSIZE,CID_EC,437,,,ec437_data> ;
+
+ ctryent <CENTRYSIZE,CID_DK,850,,,dk850_data> ; Denmark
+ ctryent <CENTRYSIZE,CID_DK,865,,,dk865_data> ;
+
+ ctryent <CENTRYSIZE,CID_FI,850,,,fi850_data> ; Finland
+ ctryent <CENTRYSIZE,CID_FI,437,,,fi437_data> ;
+
+ ctryent <CENTRYSIZE,CID_FR,850,,,fr850_data> ; France
+ ctryent <CENTRYSIZE,CID_FR,437,,,fr437_data> ;
+
+ ctryent <CENTRYSIZE,CID_GR,850,,,gr850_data> ; Germany
+ ctryent <CENTRYSIZE,CID_GR,437,,,gr437_data> ;
+
+ ctryent <CENTRYSIZE,CID_GK,869,,,gk869_data> ; Greece
+ ctryent <CENTRYSIZE,CID_GK,737,,,gk737_data> ;
+ ctryent <CENTRYSIZE,CID_GK,850,,,gk850_data> ;
+
+ ctryent <CENTRYSIZE,CID_HK,437,,,hk437_data> ; Hong Kong
+
+ ctryent <CENTRYSIZE,CID_HU,852,,,hu852_data> ; Hungary
+ ctryent <CENTRYSIZE,CID_HU,850,,,hu850_data> ;
+
+ ctryent <CENTRYSIZE,CID_IC,850,,,ic850_data> ; Iceland
+ ctryent <CENTRYSIZE,CID_IC,861,,,ic861_data> ;
+
+ ctryent <CENTRYSIZE,CID_IN,437,,,in437_data> ; Indea
+
+ ctryent <CENTRYSIZE,CID_AFE,437,,,afe437_data> ; International English
+ ctryent <CENTRYSIZE,CID_AFE,850,,,afe850_data> ;
+
+ ctryent <CENTRYSIZE,CID_IT,850,,,it850_data> ; Italy
+ ctryent <CENTRYSIZE,CID_IT,437,,,it437_data> ;
+
+ ctryent <CENTRYSIZE,CID_IE,850,,,ie850_data> ; Ireland
+ ctryent <CENTRYSIZE,CID_IE,437,,,ie437_data> ;
+
+ ctryent <CENTRYSIZE,CID_LA,850,,,la850_data> ; Latin America
+ ctryent <CENTRYSIZE,CID_LA,437,,,la437_data> ;
+
+ ctryent <CENTRYSIZE,CID_MAC,855,,,mac855_data> ; FYR Macedonia
+ ctryent <CENTRYSIZE,CID_MAC,850,,,mac850_data> ;
+
+ ctryent <CENTRYSIZE,CID_MY,437,,,my437_data> ; Malaysia
+
+ ctryent <CENTRYSIZE,CID_MX,850,,,mx850_data> ; Mexico
+ ctryent <CENTRYSIZE,CID_MX,437,,,mx437_data> ;
+
+ ctryent <CENTRYSIZE,CID_NL,850,,,nl850_data> ; Netherlands
+ ctryent <CENTRYSIZE,CID_NL,437,,,nl437_data> ;
+
+ ctryent <CENTRYSIZE,CID_NZ,437,,,nz437_data> ; New Zealand
+ ctryent <CENTRYSIZE,CID_NZ,850,,,nz850_data> ;
+
+ ctryent <CENTRYSIZE,CID_NO,850,,,no850_data> ; Norway
+ ctryent <CENTRYSIZE,CID_NO,865,,,no865_data> ;
+
+ ctryent <CENTRYSIZE,CID_PL,852,,,pl852_data> ; Poland
+ ctryent <CENTRYSIZE,CID_PL,850,,,pl850_data> ;
+
+ ctryent <CENTRYSIZE,CID_PO,850,,,po850_data> ; Portugal
+ ctryent <CENTRYSIZE,CID_PO,860,,,po860_data> ;
+
+ ctryent <CENTRYSIZE,CID_RO,852,,,ro852_data> ; Romania
+ ctryent <CENTRYSIZE,CID_RO,850,,,ro850_data> ;
+
+ ctryent <CENTRYSIZE,CID_RU,866,,,ru866_data> ; Russia
+ ctryent <CENTRYSIZE,CID_RU,437,,,ru437_data> ;
+ ctryent <CENTRYSIZE,CID_RU,850,,,ru850_data> ;
+ ctryent <CENTRYSIZE,CID_RU,855,,,ru855_data> ;
+ ctryent <CENTRYSIZE,CID_RU,852,,,ru852_data> ;
+
+ ctryent <CENTRYSIZE,CID_SM,855,,,sm855_data> ; Serbia/Montenegro
+ ctryent <CENTRYSIZE,CID_SM,850,,,sm850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SG,437,,,sg437_data> ; Singapore
+
+ ctryent <CENTRYSIZE,CID_SL,852,,,sl852_data> ; Slovakia
+ ctryent <CENTRYSIZE,CID_SL,850,,,sl850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SLN,852,,,sln852_data> ; Slovenia
+ ctryent <CENTRYSIZE,CID_SLN,850,,,sln850_data> ;
+
+ ctryent <CENTRYSIZE,CID_ZA,437,,,za437_data> ; South Africa
+ ctryent <CENTRYSIZE,CID_ZA,850,,,za850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SP,850,,,sp850_data> ; Spain
+ ctryent <CENTRYSIZE,CID_SP,437,,,sp437_data> ;
+
+ ctryent <CENTRYSIZE,CID_SV,850,,,sv850_data> ; Sweden
+ ctryent <CENTRYSIZE,CID_SV,437,,,sv437_data> ;
+
+ ctryent <CENTRYSIZE,CID_SW,850,,,sw850_data> ; Switzerland
+ ctryent <CENTRYSIZE,CID_SW,437,,,sw437_data> ;
+
+ ctryent <CENTRYSIZE,CID_TR,857,,,tr857_data> ; Turkey
+ ctryent <CENTRYSIZE,CID_TR,850,,,tr850_data> ;
+
+ ctryent <CENTRYSIZE,CID_UK,850,,,uk850_data> ; United Kingdom
+ ctryent <CENTRYSIZE,CID_UK,437,,,uk437_data> ;
+
+ ctryent <CENTRYSIZE,CID_US,437,,,us437_data> ; United States
+ ctryent <CENTRYSIZE,CID_US,850,,,us850_data> ;
+
+ ctryent <CENTRYSIZE,CID_VE,850,,,ve850_data> ; Venezuela
+ ctryent <CENTRYSIZE,CID_VE,437,,,ve437_data> ;
+
+ ctryent <CENTRYSIZE,CID_YU,852,,,yu852_data> ; Yugoslavia
+ ctryent <CENTRYSIZE,CID_YU,850,,,yu850_data> ;
+ ctryent <CENTRYSIZE,CID_YC,855,,,yc855_data> ; Yugoslavia Cyrillic
+
+ ctryent <CENTRYSIZE,CID_IS,850,,,is850_data> ; Israel
+ ctryent <CENTRYSIZE,CID_IS,862,,,is862_data> ;
+
+ ctryent <CENTRYSIZE,CID_AS,850,,,as850_data> ; Area South (Arab States)
+ ctryent <CENTRYSIZE,CID_AS,864,,,as864_data> ;
+
+ ctryent <CENTRYSIZE,CID_JP,437,,,jp437_data> ; Japan
+ ctryent <CENTRYSIZE,CID_JP,932,,,jp932_data> ;
+
+ ctryent <CENTRYSIZE,CID_KO,949,,,ko934_data> ; Korea Windows
+ ctryent <CENTRYSIZE,CID_KO,437,,,ko437_data> ; Korea
+ ctryent <CENTRYSIZE,CID_KO,934,,,ko934_data> ;
+
+ ctryent <CENTRYSIZE,CID_PR,437,,,pr437_data> ; PRC
+ ctryent <CENTRYSIZE,CID_PR,936,,,pr936_data> ;
+
+ ctryent <CENTRYSIZE,CID_TA,950,,,ta938_data> ; Taiwan Windows
+ ctryent <CENTRYSIZE,CID_TA,437,,,ta437_data> ; Taiwan Old MS-DOS Code
+ ctryent <CENTRYSIZE,CID_TA,938,,,ta938_data> ;
+ ctryent <CENTRYSIZE,CID_TAI,437,,,tai437_data> ; Taiwan Real Country Code
+ ctryent <CENTRYSIZE,CID_TAI,938,,,tai938_data> ;
+
+ ctryent <CENTRYSIZE,CID_ISO,437,,,iso437_data> ; Work around an NLSFUNC.EXE
+ ctryent <CENTRYSIZE,CID_ISO,737,,,iso437_data> ; bug entry. USA with
+ ctryent <CENTRYSIZE,CID_ISO,850,,,iso850_data> ; ISO 8601 Date format.
+ ctryent <CENTRYSIZE,CID_ISO,852,,,iso850_data> ;
+ ctryent <CENTRYSIZE,CID_ISO,855,,,iso850_data> ;
+ ctryent <CENTRYSIZE,CID_ISO,857,,,iso850_data> ;
+
+
+dummy macro p
+finalCNT equ p
+ endm
+ dummy %cntrycnt
+
+
+al852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,al852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+al850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,al850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+as864_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,as864_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Arabic_864_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+as850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,as850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ar850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ar850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ar437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ar437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+au437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,au437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+au850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,au850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+at850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,at850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+at437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,at437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+be850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,be850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Belgian_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+be437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,be437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Belgian_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+bh852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bh852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bh850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bh850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+br850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,br850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Brazilian_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+br437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,br437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+bg855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bg855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bg850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bg850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bgi855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bgi855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bgi850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bgi850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ca850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ca850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ca863_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ca863_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,FrnCdn_863_collate>
+ ctrydat <CDATASIZE,SETUCASE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cae850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cae850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cae863_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cae863_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,FrnCdn_863_collate>
+ ctrydat <CDATASIZE,SETUCASE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cl437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cl437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+co850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,co850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+co437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,co437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cro852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cro852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cro850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cro850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cs852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cs852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cs850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cs850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+dk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,dk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Danish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+dk865_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,dk865_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Danish_865_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ec850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ec850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ec437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ec437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+fi850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fi850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Finnish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+fi437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fi437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swed_Fin_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+fr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+fr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+gr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+gk869_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk869_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Greek_869_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Greek_869_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Greek_869_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gk737_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk737_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Greek_737_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Greek_737_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Greek_737_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+hk437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hk437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+hu852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hu852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+hu850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hu850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ic850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ic850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ic861_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ic861_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Icelandic_861_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Icelandic_861_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Icelandic_861_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+afe437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,afe437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+afe850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,afe850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ie850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ie850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ie437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ie437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+in437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,in437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+is862_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,is862_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Hebrew_862_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Hebrew_862_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Hebrew_862_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+is850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,is850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+it850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,it850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+it437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,it437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+jp932_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,jp932_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Japan_932_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,jp932_dbcs>
+
+jp437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,jp437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ko934_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ko934_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Korea_934_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ko934_dbcs>
+
+
+ko437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ko437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+la850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,la850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+la437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,la437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+mac855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mac855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+mac850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mac850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+my437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,my437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+mx850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mx850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+mx437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mx437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+nl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Dutch_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Dutch_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Dutch_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+nl437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nl437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Dutch_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Dutch_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Dutch_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+nz437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nz437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+nz850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nz850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+no850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,no850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Norwegian_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+no865_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,no865_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Norwegian_865_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+pr936_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pr936_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,PRC_936_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,pr936_dbcs>
+
+
+pr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+pl852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pl852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+pl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+po850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,po850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+po860_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,po860_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Portuguese_860_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Portuguese_860_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Portuguese_860_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ro852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ro852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ro850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ro850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ru866_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru866_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Russian_866_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Russian_866_ucase>
+ ctrydat <CDATASIZE,SETLCASE,,ru866_lcase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Russian_866_ucase>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sm855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sm855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sm850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sm850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sg437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sg437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sl852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sl852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sln852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sln852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sln850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sln850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+za437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,za437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+za850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,za850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sp850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sp850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sp437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sp437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sv850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sv850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swedish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sv437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sv437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swed_Fin_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sw850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sw850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swiss_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swiss_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swiss_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sw437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sw437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swiss_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swiss_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swiss_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ta938_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ta938_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Taiwan_938_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ta938_dbcs>
+
+ta437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ta437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+tai938_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tai938_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Taiwan_938_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ta938_dbcs>
+
+tai437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tai437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+tr857_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tr857_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Turkish_857_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Turkish_857_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Turkish_857_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+tr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Turkish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Turkish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Turkish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+uk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,uk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+uk437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,uk437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+us437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,us437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+us850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,us850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ve850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ve850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ve437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ve437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+yu852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yu852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+yu850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yu850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+yc855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yc855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+iso437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,iso437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+iso850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,iso850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+
+; ----------------------------------------
+;
+; World Trade Country Info Tables
+;
+; ----------------------------------------
+
+;================================================
+
+al852_info label word ;CP852 Albania
+ ctable <>
+ cinfo <CID_AL,852,YMD,'L','e','k',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+al850_info label word ;CP850 Albania
+ ctable <>
+ cinfo <CID_AL,850,YMD,'L','e','k',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+as864_info label word ;CP864 Area South (Arabic)
+ ctable <>
+ cinfo <CID_AS,864,DMY,164,000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,3,HR12,0,';'>
+
+as850_info label word ;CP850 Area South (Arabic)
+ ctable <>
+ cinfo <CID_AS,864,DMY,'Ï',000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,3,HR12,0,';'>
+
+;================================================
+
+ar850_info label word ;CP850 Argentina
+ ctable <>
+ cinfo <CID_AR,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,'.',0,CurrAmount,2,HR24,0,','>
+
+ar437_info label word ;CP437 Argentina
+ ctable <>
+ cinfo <CID_AR,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,'.',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+au437_info label word ;CP437 Australia
+ ctable <>
+ cinfo <CID_AU,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+au850_info label word ;CP850 Australia
+ ctable <>
+ cinfo <CID_AU,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+at850_info label word ;CP850 Austria
+ ctable <>
+ cinfo <CID_AT,850,DMY,'S',000,000,000,0,'.',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+at437_info label word ;CP437 Austria
+ ctable <>
+ cinfo <CID_AT,437,DMY,'S',000,000,000,0,'.',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+be850_info label word ;CP850 Belgium
+ ctable <>
+ cinfo <CID_BE,850,DMY,'B','F',000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+be437_info label word ;CP437 Belgium
+ ctable <>
+ cinfo <CID_BE,437,DMY,'B','F',000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+bh852_info label word ;CP852 Bosnia/Herzegovina
+ ctable <>
+ cinfo <CID_BH,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+bh850_info label word ;CP850 Bosnia/Herzegovina
+ ctable <>
+ cinfo <CID_BH,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+br850_info label word ;CP850 Brazil
+ ctable <>
+ cinfo <CID_BR,850,DMY,'C','r','$',000,0,'.',0,',',0,'/',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+br437_info label word ;CP437 Brazil
+ ctable <>
+ cinfo <CID_BR,437,DMY,'C','r','$',000,0,'.',0,',',0,'/',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+bg855_info label word ;CP855 Bulgaria IBM Country Code
+ ctable <>
+ cinfo <CID_BG,855,DMY,'Ð','ë','.',000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+bg850_info label word ;CP850 Bulgaria IBM Country Code
+ ctable <>
+ cinfo <CID_BG,850,DMY,'L','v',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+bgi855_info label word ;CP855 Bulgaria Real Country Code
+ ctable <>
+ cinfo <CID_BGI,855,DMY,'Ð','ë','.',000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+bgi850_info label word ;CP850 Bulgaria Real Country Code
+ ctable <>
+ cinfo <CID_BGI,850,DMY,'L','v',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+ca850_info label word ;CP850 French Canadian
+ ctable <>
+ cinfo <CID_CA,850,YMD,'$',000,000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ca863_info label word ;CP863 French Canadian
+ ctable <>
+ cinfo <CID_CA,863,YMD,'$',000,000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+cae850_info label word ;CP850 English Canadian
+ ctable <>
+ cinfo <CID_CAE,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+cae863_info label word ;CP863 English Canadian
+ ctable <>
+ cinfo <CID_CAE,863,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+cl850_info label word ;CP850 Chile
+ ctable <>
+ cinfo <CID_CL,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+cl437_info label word ;CP437 Chile
+ ctable <>
+ cinfo <CID_CL,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+; Columbia
+co850_info label word ;CP850 Columbia
+ ctable <>
+ cinfo <CID_CO,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+co437_info label word ;CP437 Columbia
+ ctable <>
+ cinfo <CID_CO,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+cro852_info label word ;CP852 Croatia
+ ctable <>
+ cinfo <CID_CRO,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+cro850_info label word ;CP850 Croatia
+ ctable <>
+ cinfo <CID_CRO,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+cs852_info label word ;CP852 Czech Republic
+ ctable <>
+ cinfo <CID_CS,852,DMY,'K','Ÿ',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,','>
+
+cs850_info label word ;CP850 Czech Republic
+ ctable <>
+ cinfo <CID_CS,850,DMY,'K','c',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,','>
+
+;================================================
+
+dk850_info label word ;CP850 Denmark
+ ctable <>
+ cinfo <CID_DK,850,DMY,'k','r',000,000,0,'.',0,',',0,'-',0,'.',0,Cur_Amount,2,HR24,0,';'>
+
+dk865_info label word ;CP865 Denmark
+ ctable <>
+ cinfo <CID_DK,865,DMY,'k','r',000,000,0,'.',0,',',0,'-',0,'.',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+ec850_info label word ;CP850 Ecuador
+ ctable <>
+ cinfo <CID_EC,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+ec437_info label word ;CP437 Ecuador
+ ctable <>
+ cinfo <CID_EC,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+
+;================================================
+
+fi850_info label word ;CP850 Finland
+ ctable <>
+ cinfo <CID_FI,437,DMY,'m','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+fi437_info label word ;CP437
+ ctable <>
+ cinfo <CID_FI,437,DMY,'m','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+fr850_info label word ;CP850 France
+ ctable <>
+ cinfo <CID_FR,850,DMY,'F',000,000,000,0,' ',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+fr437_info label word ;CP437 France
+ ctable <>
+ cinfo <CID_FR,437,DMY,'F',000,000,000,0,' ',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+gr850_info label word ;CP850 Germany
+ ctable <>
+ cinfo <CID_GR,850,DMY,'D','M',000,000,0,'.',0,',',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+gr437_info label word ;CP437 Germany
+ ctable <>
+ cinfo <CID_GR,437,DMY,'D','M',000,000,0,'.',0,',',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+gk869_info label word ;CP869 Greece
+ ctable <>
+ cinfo <CID_GK,869,DMY,'§','ë','ô',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk737_info label word ;CP737 Greece
+ ctable <>
+ cinfo <CID_GK,737,DMY,'ƒ','¨','®',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk852_info label word ;CP852 Greece
+ ctable <>
+ cinfo <CID_GK,852,DMY,'D','r','s',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk850_info label word ;CP850 Greece
+ ctable <>
+ cinfo <CID_GK,850,DMY,'D','r','s',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+;================================================
+
+hk437_info label word ;CP437 Hong Kong
+ ctable <>
+ cinfo <CID_HK,437,DMY,'H','K','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+hu852_info label word ;CP852 Hungary
+ ctable <>
+ cinfo <CID_HU,852,YMD,'F','t',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+hu850_info label word ;CP850 Hungary
+ ctable <>
+ cinfo <CID_HU,850,YMD,'F','t',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+ic861_info label word ;CP861 Iceland
+ ctable <>
+ cinfo <CID_IC,861,YMD,'¥','K','r',000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ic850_info label word ;CP850 Iceland
+ ctable <>
+ cinfo <CID_IC,850,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+in437_info label word ;CP437 Indea
+ ctable <>
+ cinfo <CID_IN,437,DMY,'R','s',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+afe437_info label word ;CP437 International English
+ ctable <>
+ cinfo <CID_AFE,437,DMY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+afe850_info label word ;CP850 International English
+ ctable <>
+ cinfo <CID_AFE,850,DMY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+ie850_info label word ;CP850 Ireland
+ ctable <>
+ cinfo <CID_IE,850,DMY,'I','R','œ',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+ie437_info label word ;CP437 Ireland
+ ctable <>
+ cinfo <CID_IE,437,DMY,'I','R','œ',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+is862_info label word ;CP862 Israel
+ ctable <>
+ cinfo <CID_IS,862,DMY,153,000,000,000,0,',',0,'.',0,'/',0,':',0,Cur_Amount,2,HR24,0,','>
+
+is850_info label word ;CP850 Israel
+ ctable <>
+ cinfo <CID_IS,850,DMY,'N','I','S',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+it850_info label word ;CP850 Italy
+ ctable <>
+ cinfo <CID_IT,850,DMY,'L','.',000,000,0,'.',0,',',0,'/',0,'.',0,Cur_Amount,0,HR24,0,';'>
+
+it437_info label word ;CP437 Italy
+ ctable <>
+ cinfo <CID_IT,437,DMY,'L','.',000,000,0,'.',0,',',0,'/',0,'.',0,Cur_Amount,0,HR24,0,';'>
+
+;================================================
+
+jp932_info label word ;CP932 Japan
+ ctable <>
+ cinfo <CID_JP,932,YMD,'\',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,0,HR12,0,','>
+
+jp437_info label word ;CP437 Japan
+ ctable <>
+ cinfo <CID_JP,437,YMD,'',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,0,HR12,0,','>
+
+;================================================
+
+ko934_info label word ;CP934 Korea
+ ctable <>
+ cinfo <CID_KO,934,YMD,'\',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,0,HR24,0,','>
+
+ko437_info label word ;CP437 Korea
+ ctable <>
+ cinfo <CID_KO,437,YMD,'W',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+la850_info label word ;CP850 Latin America
+ ctable <>
+ cinfo <CID_LA,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+la437_info label word ;CP437 Latin America
+ ctable <>
+ cinfo <CID_LA,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+mac855_info label word ;CP855 FYR Macedonia
+ ctable <>
+ cinfo <CID_MAC,855,YMD,'§','¨','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+mac850_info label word ;CP850 FYR Macedonia
+ ctable <>
+ cinfo <CID_MAC,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+my437_info label word ;CP437 Malaysia
+ ctable <>
+ cinfo <CID_MY,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+mx850_info label word ;CP850 Mexico
+ ctable <>
+ cinfo <CID_MX,850,DMY,'N','$',000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+mx437_info label word ;CP437 Mexico
+ ctable <>
+ cinfo <CID_MX,437,DMY,'N','$',000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+nl850_info label word ;CP850 Netherlands
+ ctable <>
+ cinfo <CID_NL,850,DMY,'Ÿ',000,000,000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+nl437_info label word ;CP437 Netherlands
+ ctable <>
+ cinfo <CID_NL,437,DMY,'Ÿ',000,000,000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+nz437_info label word ;CP437 New Zealand
+ ctable <>
+ cinfo <CID_NZ,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+nz850_info label word ;CP850 New Zealand
+ ctable <>
+ cinfo <CID_NZ,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+no850_info label word ;CP850 Norway
+ ctable <>
+ cinfo <CID_NO,850,DMY,'k','r',000,000,0,' ',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+no865_info label word ;CP865 Norway
+ ctable <>
+ cinfo <CID_NO,865,DMY,'k','r',000,000,0,' ',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+pr936_info label word ;CP936 People's Republic of China
+ ctable <>
+ cinfo <CID_PR,936,YMD,'\',000,000,000,0,',',0,'.',0,'.',0,':',0,CurrAmount,2,HR12,0,','>
+
+pr437_info label word ;CP437 People's Republic of China
+ ctable <>
+ cinfo <CID_PR,437,YMD,'',000,000,000,0,',',0,'.',0,'.',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+pl852_info label word ;CP852 Poland
+ ctable <>
+ cinfo <CID_PL,852,YMD,'Z','ˆ',000,000,0,' ',0,',',0,'.',0,':',0,CurrAmount,2,HR24,0,';'>
+
+pl850_info label word ;CP850 Poland
+ ctable <>
+ cinfo <CID_PL,850,YMD,'Z','l',000,000,0,' ',0,',',0,'.',0,':',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+po850_info label word ;CP850 Portugal
+ ctable <>
+ cinfo <CID_PO,850,DMY,'E','s','c','.',0,'.',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+po860_info label word ;CP860 Portugal
+ ctable <>
+ cinfo <CID_PO,860,DMY,'E','s','c','.',0,'.',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+ro852_info label word ;CP852 Romania
+ ctable <>
+ cinfo <CID_RO,852,YMD,'L','e','i',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+ro850_info label word ;CP850 Romania
+ ctable <>
+ cinfo <CID_RO,850,YMD,'L','e','i',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+ru866_info label word ;CP866 Russia
+ ctable <>
+ cinfo <CID_RU,866,DMY,'à','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru437_info label word ;CP437 Russia
+ ctable <>
+ cinfo <CID_RU,437,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru850_info label word ;CP850 Russia
+ ctable <>
+ cinfo <CID_RU,850,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru855_info label word ;CP855 Russia
+ ctable <>
+ cinfo <CID_RU,855,DMY,'á','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru852_info label word ;CP852 Russia
+ ctable <>
+ cinfo <CID_RU,852,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sm855_info label word ;CP855 Serbia/Montenegro
+ ctable <>
+ cinfo <CID_SM,855,YMD,'§','·','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+sm850_info label word ;CP850 Serbia/Montenegro
+ ctable <>
+ cinfo <CID_SM,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+sg437_info label word ;CP437 Singapore
+ ctable <>
+ cinfo <CID_SG,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+sl852_info label word ;CP852 Slovakia
+ ctable <>
+ cinfo <CID_SL,852,DMY,'S','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+sl850_info label word ;CP850 Slovakia
+ ctable <>
+ cinfo <CID_SL,850,DMY,'S','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sln852_info label word ;CP852 Slovenia
+ ctable <>
+ cinfo <CID_SLN,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+sln850_info label word ;CP850 Slovenia
+ ctable <>
+ cinfo <CID_SLN,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+za437_info label word ;CP437 South Africa
+ ctable <>
+ cinfo <CID_ZA,437,YMD,'R',000,000,000,0,' ',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+za850_info label word ;CP850 South Africa
+ ctable <>
+ cinfo <CID_ZA,850,YMD,'R',000,000,000,0,' ',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+sp850_info label word ;CP850 Spain
+ ctable <>
+ cinfo <CID_SP,437,DMY,'P','t','s',000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,0,HR24,0,';'>
+
+sp437_info label word ;CP437 Spain
+ ctable <>
+ cinfo <CID_SP,437,DMY,'ž',000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,0,HR24,0,';'>
+
+;================================================
+
+sv850_info label word ;CP850 Sweden
+ ctable <>
+ cinfo <CID_SV,850,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+sv437_info label word ;CP437 Sweden
+ ctable <>
+ cinfo <CID_SV,437,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sw850_info label word ;CP850 Switzerland
+ ctable <>
+ cinfo <CID_SW,850,DMY,'S','F','r','.',0,"'",0,'.',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+sw437_info label word ;CP437 Switzerland
+ ctable <>
+ cinfo <CID_SW,437,DMY,'S','F','r','.',0,"'",0,'.',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+ta938_info label word ;CP938 Taiwan
+ ctable <>
+ cinfo <CID_TA,938,YMD,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+ta437_info label word ;CP437 Taiwan
+ ctable <>
+ cinfo <CID_TA,437,YMD,'N','T','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+tai938_info label word ;CP938 Taiwan with Real Country Code
+ ctable <>
+ cinfo <CID_TAI,938,YMD,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+tai437_info label word ;CP437 Taiwan with Real Country Code
+ ctable <>
+ cinfo <CID_TAI,437,YMD,'N','T','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+tr850_info label word ;CP852 Turkey
+ ctable <>
+ cinfo <CID_TR,850,DMY,'T','L',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,';'>
+
+tr857_info label word ;CP852 Turkey
+ ctable <>
+ cinfo <CID_TR,857,DMY,'T','L',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+uk850_info label word ;CP850 United Kingdom
+ ctable <>
+ cinfo <CID_UK,850,DMY,'œ',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+uk437_info label word ;CP437 United Kingdom
+ ctable <>
+ cinfo <CID_UK,437,DMY,'œ',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+us437_info label word ;CP437 United States
+ ctable <>
+ cinfo <CID_US,437,MDY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+us850_info label word ;CP850 United States
+ ctable <>
+ cinfo <CID_US,850,MDY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+ve850_info label word ;CP850 Venezuela
+ ctable <>
+ cinfo <CID_VE,850,DMY,'B','s','.',000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+ve437_info label word ;CP437 Venezuela
+ ctable <>
+ cinfo <CID_VE,437,DMY,'B','s','.',000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+yu852_info label word ;CP852 Yugoslavia
+ ctable <>
+ cinfo <CID_YU,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+yu850_info label word ;CP850 Yugoslavia
+ ctable <>
+ cinfo <CID_YU,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+yc855_info label word ;CP855 Yugoslavia Cyrillic
+ ctable <>
+ cinfo <CID_YC,855,YMD,'§','·','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+iso437_info label word ;CP437 Work around an NLSFUNC.EXE Bug Entry
+ ctable <>
+ cinfo <CID_ISO,437,YMD,'E','A','$',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+iso850_info label word ;CP850 Work around an NLSFUNC.EXE Bug Entry
+ ctable <>
+ cinfo <CID_ISO,850,YMD,'J','K','$',000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+ page
+
+include nls437.inc
+include nls737.inc
+include nls850.inc
+include nls852.inc
+include nls855.inc
+include nls857.inc
+include nls860.inc
+include nls861.inc
+include nls862.inc
+include nls863.inc
+include nls864.inc
+include nls865.inc
+include nls866.inc
+include nls869.inc
+include nls93x.inc
+
+
+; ----------------------------------------------------------------------------
+;
+; World Trade Valid Filename Character Tables
+;
+; Currently all countries have same (4/14/86)
+;
+;
+; ----------------------------------------------------------------------------
+Valid_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
+
+
+
+; ----------------------------------------------------------------------------
+;
+; World Trade DBCS Tables
+;
+; Currently all countries have same (4/14/86)
+;
+;
+; ----------------------------------------------------------------------------
+;
+Not_dbcs label word
+ ctable <,'DBCS ',dbcsterm-dbcsbegin> ;AN000;
+dbcsbegin label word ;AN000;
+dbcsterm db 0,0 ;AN000;
+dbcsend label word ;AN000;
+
+
+
+include DBCS93x.inc
+
+
+
+include copyrigh.inc
+
+; ---------------------------------------------------------------
+;
+; END OF CDI SEGMENT
+;
+; ---------------------------------------------------------------
+
+
+dseg ends
+ end
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/country/country.asm b/private/mvdm/dos/v86/dev/country/country.asm
new file mode 100644
index 000000000..76c90c561
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/country.asm
@@ -0,0 +1,2069 @@
+;
+; create country.sys file
+;
+;
+ include mkcntry.inc
+;
+; -----------------------------------------------------------
+;
+; 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 <CENTRYSIZE,CID_AL,852,,,al852_data> ; Albania
+ ctryent <CENTRYSIZE,CID_AL,850,,,al850_data> ;
+
+ ctryent <CENTRYSIZE,CID_AR,850,,,ar850_data> ; Argentina
+ ctryent <CENTRYSIZE,CID_AR,437,,,ar437_data> ;
+
+ ctryent <CENTRYSIZE,CID_AU,437,,,au437_data> ; Australia
+ ctryent <CENTRYSIZE,CID_AU,850,,,au850_data> ;
+
+ ctryent <CENTRYSIZE,CID_AT,850,,,at850_data> ; Austria
+ ctryent <CENTRYSIZE,CID_AT,437,,,at437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BE,850,,,be850_data> ; Belgium
+ ctryent <CENTRYSIZE,CID_BE,437,,,be437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BH,852,,,bh852_data> ; Bosnia/Herzegovina
+ ctryent <CENTRYSIZE,CID_BH,850,,,bh850_data> ;
+
+ ctryent <CENTRYSIZE,CID_BR,850,,,br850_data> ; Brazil
+ ctryent <CENTRYSIZE,CID_BR,437,,,br437_data> ;
+
+ ctryent <CENTRYSIZE,CID_BG,855,,,bg855_data> ; Bulgaria IBM Country Code
+ ctryent <CENTRYSIZE,CID_BG,850,,,bg850_data> ;
+
+ ctryent <CENTRYSIZE,CID_BGI,855,,,bgi855_data> ; Bulgaria Real Country Code
+ ctryent <CENTRYSIZE,CID_BGI,850,,,bgi850_data> ;
+
+ ctryent <CENTRYSIZE,CID_CA,850,,,ca850_data> ; Canada French
+ ctryent <CENTRYSIZE,CID_CA,863,,,ca863_data> ;
+
+ ctryent <CENTRYSIZE,CID_CAE,850,,,cae850_data> ; Canada English
+ ctryent <CENTRYSIZE,CID_CAE,863,,,cae863_data> ;
+
+ ctryent <CENTRYSIZE,CID_CL,850,,,cl850_data> ; Chile
+ ctryent <CENTRYSIZE,CID_CL,437,,,cl437_data> ;
+
+ ctryent <CENTRYSIZE,CID_CO,850,,,co850_data> ; Colombia
+ ctryent <CENTRYSIZE,CID_CO,437,,,co437_data> ;
+
+ ctryent <CENTRYSIZE,CID_CRO,852,,,cro852_data> ; Croatia
+ ctryent <CENTRYSIZE,CID_CRO,850,,,cro850_data> ;
+
+ ctryent <CENTRYSIZE,CID_CS,852,,,cs852_data> ; Czech Republic
+ ctryent <CENTRYSIZE,CID_CS,850,,,cs850_data> ;
+
+ ctryent <CENTRYSIZE,CID_EC,850,,,ec850_data> ; Ecuador
+ ctryent <CENTRYSIZE,CID_EC,437,,,ec437_data> ;
+
+ ctryent <CENTRYSIZE,CID_DK,850,,,dk850_data> ; Denmark
+ ctryent <CENTRYSIZE,CID_DK,865,,,dk865_data> ;
+
+ ctryent <CENTRYSIZE,CID_FI,850,,,fi850_data> ; Finland
+ ctryent <CENTRYSIZE,CID_FI,437,,,fi437_data> ;
+
+ ctryent <CENTRYSIZE,CID_FR,850,,,fr850_data> ; France
+ ctryent <CENTRYSIZE,CID_FR,437,,,fr437_data> ;
+
+ ctryent <CENTRYSIZE,CID_GR,850,,,gr850_data> ; Germany
+ ctryent <CENTRYSIZE,CID_GR,437,,,gr437_data> ;
+
+ ctryent <CENTRYSIZE,CID_GK,869,,,gk869_data> ; Greece
+ ctryent <CENTRYSIZE,CID_GK,737,,,gk737_data> ;
+ ctryent <CENTRYSIZE,CID_GK,850,,,gk850_data> ;
+
+ ctryent <CENTRYSIZE,CID_HK,437,,,hk437_data> ; Hong Kong
+
+ ctryent <CENTRYSIZE,CID_HU,852,,,hu852_data> ; Hungary
+ ctryent <CENTRYSIZE,CID_HU,850,,,hu850_data> ;
+
+ ctryent <CENTRYSIZE,CID_IC,850,,,ic850_data> ; Iceland
+ ctryent <CENTRYSIZE,CID_IC,861,,,ic861_data> ;
+
+ ctryent <CENTRYSIZE,CID_IN,437,,,in437_data> ; Indea
+
+ ctryent <CENTRYSIZE,CID_AFE,437,,,afe437_data> ; International English
+ ctryent <CENTRYSIZE,CID_AFE,850,,,afe850_data> ;
+
+ ctryent <CENTRYSIZE,CID_IT,850,,,it850_data> ; Italy
+ ctryent <CENTRYSIZE,CID_IT,437,,,it437_data> ;
+
+ ctryent <CENTRYSIZE,CID_IE,850,,,ie850_data> ; Ireland
+ ctryent <CENTRYSIZE,CID_IE,437,,,ie437_data> ;
+
+ ctryent <CENTRYSIZE,CID_LA,850,,,la850_data> ; Latin America
+ ctryent <CENTRYSIZE,CID_LA,437,,,la437_data> ;
+
+ ctryent <CENTRYSIZE,CID_MAC,855,,,mac855_data> ; FYR Macedonia
+ ctryent <CENTRYSIZE,CID_MAC,850,,,mac850_data> ;
+
+ ctryent <CENTRYSIZE,CID_MY,437,,,my437_data> ; Malaysia
+
+ ctryent <CENTRYSIZE,CID_MX,850,,,mx850_data> ; Mexico
+ ctryent <CENTRYSIZE,CID_MX,437,,,mx437_data> ;
+
+ ctryent <CENTRYSIZE,CID_NL,850,,,nl850_data> ; Netherlands
+ ctryent <CENTRYSIZE,CID_NL,437,,,nl437_data> ;
+
+ ctryent <CENTRYSIZE,CID_NZ,437,,,nz437_data> ; New Zealand
+ ctryent <CENTRYSIZE,CID_NZ,850,,,nz850_data> ;
+
+ ctryent <CENTRYSIZE,CID_NO,850,,,no850_data> ; Norway
+ ctryent <CENTRYSIZE,CID_NO,865,,,no865_data> ;
+
+ ctryent <CENTRYSIZE,CID_PL,852,,,pl852_data> ; Poland
+ ctryent <CENTRYSIZE,CID_PL,850,,,pl850_data> ;
+
+ ctryent <CENTRYSIZE,CID_PO,850,,,po850_data> ; Portugal
+ ctryent <CENTRYSIZE,CID_PO,860,,,po860_data> ;
+
+ ctryent <CENTRYSIZE,CID_RO,852,,,ro852_data> ; Romania
+ ctryent <CENTRYSIZE,CID_RO,850,,,ro850_data> ;
+
+ ctryent <CENTRYSIZE,CID_RU,866,,,ru866_data> ; Russia
+ ctryent <CENTRYSIZE,CID_RU,437,,,ru437_data> ;
+ ctryent <CENTRYSIZE,CID_RU,850,,,ru850_data> ;
+ ctryent <CENTRYSIZE,CID_RU,855,,,ru855_data> ;
+ ctryent <CENTRYSIZE,CID_RU,852,,,ru852_data> ;
+
+ ctryent <CENTRYSIZE,CID_SM,855,,,sm855_data> ; Serbia/Montenegro
+ ctryent <CENTRYSIZE,CID_SM,850,,,sm850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SG,437,,,sg437_data> ; Singapore
+
+ ctryent <CENTRYSIZE,CID_SL,852,,,sl852_data> ; Slovakia
+ ctryent <CENTRYSIZE,CID_SL,850,,,sl850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SLN,852,,,sln852_data> ; Slovenia
+ ctryent <CENTRYSIZE,CID_SLN,850,,,sln850_data> ;
+
+ ctryent <CENTRYSIZE,CID_ZA,437,,,za437_data> ; South Africa
+ ctryent <CENTRYSIZE,CID_ZA,850,,,za850_data> ;
+
+ ctryent <CENTRYSIZE,CID_SP,850,,,sp850_data> ; Spain
+ ctryent <CENTRYSIZE,CID_SP,437,,,sp437_data> ;
+
+ ctryent <CENTRYSIZE,CID_SV,850,,,sv850_data> ; Sweden
+ ctryent <CENTRYSIZE,CID_SV,437,,,sv437_data> ;
+
+ ctryent <CENTRYSIZE,CID_SW,850,,,sw850_data> ; Switzerland
+ ctryent <CENTRYSIZE,CID_SW,437,,,sw437_data> ;
+
+ ctryent <CENTRYSIZE,CID_TR,857,,,tr857_data> ; Turkey
+ ctryent <CENTRYSIZE,CID_TR,850,,,tr850_data> ;
+
+ ctryent <CENTRYSIZE,CID_UK,850,,,uk850_data> ; United Kingdom
+ ctryent <CENTRYSIZE,CID_UK,437,,,uk437_data> ;
+
+ ctryent <CENTRYSIZE,CID_US,437,,,us437_data> ; United States
+ ctryent <CENTRYSIZE,CID_US,850,,,us850_data> ;
+
+ ctryent <CENTRYSIZE,CID_VE,850,,,ve850_data> ; Venezuela
+ ctryent <CENTRYSIZE,CID_VE,437,,,ve437_data> ;
+
+ ctryent <CENTRYSIZE,CID_YU,852,,,yu852_data> ; Yugoslavia
+ ctryent <CENTRYSIZE,CID_YU,850,,,yu850_data> ;
+ ctryent <CENTRYSIZE,CID_YC,855,,,yc855_data> ; Yugoslavia Cyrillic
+
+ ctryent <CENTRYSIZE,CID_IS,850,,,is850_data> ; Israel
+ ctryent <CENTRYSIZE,CID_IS,862,,,is862_data> ;
+
+ ctryent <CENTRYSIZE,CID_AS,850,,,as850_data> ; Area South (Arab States)
+ ctryent <CENTRYSIZE,CID_AS,864,,,as864_data> ;
+
+ ctryent <CENTRYSIZE,CID_JP,437,,,jp437_data> ; Japan
+ ctryent <CENTRYSIZE,CID_JP,932,,,jp932_data> ;
+
+ ctryent <CENTRYSIZE,CID_KO,949,,,ko949_data> ; Korea Windows
+ ctryent <CENTRYSIZE,CID_KO,437,,,ko437_data> ; Korea
+ ctryent <CENTRYSIZE,CID_KO,1361,,,ko1361_data> ;
+
+ ctryent <CENTRYSIZE,CID_PR,936,,,pr936_data> ; PRC
+ ctryent <CENTRYSIZE,CID_PR,437,,,pr437_data> ;
+
+ ctryent <CENTRYSIZE,CID_TA,950,,,ta938_data> ; Taiwan Windows
+ ctryent <CENTRYSIZE,CID_TA,437,,,ta437_data> ; Taiwan Old MS-DOS Code
+ ctryent <CENTRYSIZE,CID_TA,938,,,ta938_data> ;
+ ctryent <CENTRYSIZE,CID_TAI,950,,,tai938_data> ; Taiwan Real Country Code
+ ctryent <CENTRYSIZE,CID_TAI,437,,,tai437_data> ;
+ ctryent <CENTRYSIZE,CID_TAI,938,,,tai938_data> ;
+
+ ctryent <CENTRYSIZE,CID_ISO,437,,,iso437_data> ; Work around an NLSFUNC.EXE
+ ctryent <CENTRYSIZE,CID_ISO,737,,,iso437_data> ; bug entry. USA with
+ ctryent <CENTRYSIZE,CID_ISO,850,,,iso850_data> ; ISO 8601 Date format.
+ ctryent <CENTRYSIZE,CID_ISO,852,,,iso850_data> ;
+ ctryent <CENTRYSIZE,CID_ISO,855,,,iso850_data> ;
+ ctryent <CENTRYSIZE,CID_ISO,857,,,iso850_data> ;
+
+
+dummy macro p
+finalCNT equ p
+ endm
+ dummy %cntrycnt
+
+
+al852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,al852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+al850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,al850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+as864_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,as864_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Arabic_864_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+as850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,as850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ar850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ar850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ar437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ar437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+au437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,au437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+au850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,au850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+at850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,at850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+at437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,at437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+be850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,be850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Belgian_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+be437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,be437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Belgian_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+bh852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bh852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bh850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bh850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+br850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,br850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Brazilian_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+br437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,br437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+bg855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bg855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bg850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bg850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bgi855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bgi855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+bgi850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,bgi850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ca850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ca850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ca863_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ca863_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,FrnCdn_863_collate>
+ ctrydat <CDATASIZE,SETUCASE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cae850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cae850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cae863_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cae863_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,FrnCdn_863_collate>
+ ctrydat <CDATASIZE,SETUCASE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,FrnCdn_863_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cl437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cl437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+co850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,co850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+co437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,co437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cro852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cro852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cro850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cro850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+cs852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cs852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+cs850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,cs850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+dk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,dk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Danish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+dk865_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,dk865_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Danish_865_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ec850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ec850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ec437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ec437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+fi850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fi850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Finnish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+fi437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fi437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swed_Fin_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+fr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+fr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,fr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+gr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,German_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+gk869_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk869_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Greek_869_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Greek_869_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Greek_869_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gk737_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk737_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Greek_737_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Greek_737_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Greek_737_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+gk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,gk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+hk437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hk437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+hu852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hu852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+hu850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,hu850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ic850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ic850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ic861_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ic861_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Icelandic_861_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Icelandic_861_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Icelandic_861_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+afe437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,afe437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+afe850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,afe850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ie850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ie850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ie437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ie437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+in437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,in437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+is862_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,is862_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Hebrew_862_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Hebrew_862_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Hebrew_862_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+is850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,is850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+it850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,it850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+it437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,it437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+jp932_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,jp932_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Japan_932_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,jp932_dbcs>
+
+jp437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,jp437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ko949_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ko949_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Korea_949_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ko949_dbcs>
+
+
+ko1361_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ko1361_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Korea_949_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ko1361_dbcs>
+
+
+ko437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ko437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+la850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,la850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+la437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,la437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+mac855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mac855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+mac850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mac850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+my437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,my437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+mx850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mx850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+mx437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,mx437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+nl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Dutch_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Dutch_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Dutch_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+nl437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nl437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Dutch_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Dutch_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Dutch_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+nz437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nz437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+nz850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,nz850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+no850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,no850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Norwegian_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+no865_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,no865_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Norwegian_865_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Nordic_865_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+pr936_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pr936_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,PRC_936_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,pr936_dbcs>
+
+
+pr437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pr437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+pl852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pl852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+pl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,pl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+po850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,po850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+po860_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,po860_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Portuguese_860_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Portuguese_860_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Portuguese_860_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ro852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ro852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ro850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ro850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ru866_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru866_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Russian_866_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Russian_866_ucase>
+ ctrydat <CDATASIZE,SETLCASE,,ru866_lcase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Russian_866_ucase>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ru852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ru852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sm855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sm855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sm850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sm850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sg437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sg437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sl852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sl852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sl850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sl850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sln852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sln852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sln850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sln850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+za437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,za437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+za850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,za850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sp850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sp850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sp437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sp437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sv850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sv850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swedish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sv437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sv437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swed_Fin_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swed_Fin_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+sw850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sw850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swiss_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swiss_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swiss_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+sw437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,sw437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Swiss_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Swiss_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Swiss_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ta938_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ta938_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Taiwan_938_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ta938_dbcs>
+
+ta437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ta437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+tai938_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tai938_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Taiwan_938_collate>
+ ctrydat <CDATASIZE,SETUCASE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,DBCS_93x_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,ta938_dbcs>
+
+tai437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tai437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+tr857_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tr857_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Turkish_857_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Turkish_857_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Turkish_857_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+tr850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,tr850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Turkish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Turkish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Turkish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+uk850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,uk850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+uk437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,uk437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+us437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,us437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+us850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,us850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+ve850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ve850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Spanish_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+ve437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,ve437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Spanish_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+yu852_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yu852_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_852_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_852_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP852_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+yu850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yu850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin2_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin2_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,CP850_ucfile>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+yc855_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,yc855_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Cyrillic_855_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Cyrillic_855_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+iso437_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,iso437_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_437_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_437_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+iso850_data label word
+ dw CDATAITEMS ; number of entries
+ ctrydat <CDATASIZE,SETCOUNTRYINFO,,iso850_info>
+ ctrydat <CDATASIZE,SETCOLLATE,,Latin1_850_collate>
+ ctrydat <CDATASIZE,SETUCASE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETUCASEFILE,,Latin1_850_ucase>
+ ctrydat <CDATASIZE,SETFILELIST,,Valid_flist>
+ ctrydat <CDATASIZE,SETDBCS,,Not_dbcs>
+
+
+
+; ----------------------------------------
+;
+; World Trade Country Info Tables
+;
+; ----------------------------------------
+
+;================================================
+
+al852_info label word ;CP852 Albania
+ ctable <>
+ cinfo <CID_AL,852,YMD,'L','e','k',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+al850_info label word ;CP850 Albania
+ ctable <>
+ cinfo <CID_AL,850,YMD,'L','e','k',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+as864_info label word ;CP864 Area South (Arabic)
+ ctable <>
+ cinfo <CID_AS,864,DMY,164,000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,3,HR12,0,';'>
+
+as850_info label word ;CP850 Area South (Arabic)
+ ctable <>
+ cinfo <CID_AS,864,DMY,'Ï',000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,3,HR12,0,';'>
+
+;================================================
+
+ar850_info label word ;CP850 Argentina
+ ctable <>
+ cinfo <CID_AR,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,'.',0,CurrAmount,2,HR24,0,','>
+
+ar437_info label word ;CP437 Argentina
+ ctable <>
+ cinfo <CID_AR,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,'.',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+au437_info label word ;CP437 Australia
+ ctable <>
+ cinfo <CID_AU,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+au850_info label word ;CP850 Australia
+ ctable <>
+ cinfo <CID_AU,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+at850_info label word ;CP850 Austria
+ ctable <>
+ cinfo <CID_AT,850,DMY,'S',000,000,000,0,'.',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+at437_info label word ;CP437 Austria
+ ctable <>
+ cinfo <CID_AT,437,DMY,'S',000,000,000,0,'.',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+be850_info label word ;CP850 Belgium
+ ctable <>
+ cinfo <CID_BE,850,DMY,'B','F',000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+be437_info label word ;CP437 Belgium
+ ctable <>
+ cinfo <CID_BE,437,DMY,'B','F',000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+bh852_info label word ;CP852 Bosnia/Herzegovina
+ ctable <>
+ cinfo <CID_BH,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+bh850_info label word ;CP850 Bosnia/Herzegovina
+ ctable <>
+ cinfo <CID_BH,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+br850_info label word ;CP850 Brazil
+ ctable <>
+ cinfo <CID_BR,850,DMY,'C','r','$',000,0,'.',0,',',0,'/',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+br437_info label word ;CP437 Brazil
+ ctable <>
+ cinfo <CID_BR,437,DMY,'C','r','$',000,0,'.',0,',',0,'/',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+bg855_info label word ;CP855 Bulgaria IBM Country Code
+ ctable <>
+ cinfo <CID_BG,855,DMY,'Ð','ë','.',000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+bg850_info label word ;CP850 Bulgaria IBM Country Code
+ ctable <>
+ cinfo <CID_BG,850,DMY,'L','v',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+bgi855_info label word ;CP855 Bulgaria Real Country Code
+ ctable <>
+ cinfo <CID_BGI,855,DMY,'Ð','ë','.',000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+bgi850_info label word ;CP850 Bulgaria Real Country Code
+ ctable <>
+ cinfo <CID_BGI,850,DMY,'L','v',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+ca850_info label word ;CP850 French Canadian
+ ctable <>
+ cinfo <CID_CA,850,YMD,'$',000,000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ca863_info label word ;CP863 French Canadian
+ ctable <>
+ cinfo <CID_CA,863,YMD,'$',000,000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+cae850_info label word ;CP850 English Canadian
+ ctable <>
+ cinfo <CID_CAE,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+cae863_info label word ;CP863 English Canadian
+ ctable <>
+ cinfo <CID_CAE,863,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+cl850_info label word ;CP850 Chile
+ ctable <>
+ cinfo <CID_CL,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+cl437_info label word ;CP437 Chile
+ ctable <>
+ cinfo <CID_CL,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+; Columbia
+co850_info label word ;CP850 Columbia
+ ctable <>
+ cinfo <CID_CO,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+co437_info label word ;CP437 Columbia
+ ctable <>
+ cinfo <CID_CO,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+cro852_info label word ;CP852 Croatia
+ ctable <>
+ cinfo <CID_CRO,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+cro850_info label word ;CP850 Croatia
+ ctable <>
+ cinfo <CID_CRO,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+cs852_info label word ;CP852 Czech Republic
+ ctable <>
+ cinfo <CID_CS,852,DMY,'K','Ÿ',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,','>
+
+cs850_info label word ;CP850 Czech Republic
+ ctable <>
+ cinfo <CID_CS,850,DMY,'K','c',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,','>
+
+;================================================
+
+dk850_info label word ;CP850 Denmark
+ ctable <>
+ cinfo <CID_DK,850,DMY,'k','r',000,000,0,'.',0,',',0,'-',0,'.',0,Cur_Amount,2,HR24,0,';'>
+
+dk865_info label word ;CP865 Denmark
+ ctable <>
+ cinfo <CID_DK,865,DMY,'k','r',000,000,0,'.',0,',',0,'-',0,'.',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+ec850_info label word ;CP850 Ecuador
+ ctable <>
+ cinfo <CID_EC,850,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+ec437_info label word ;CP437 Ecuador
+ ctable <>
+ cinfo <CID_EC,437,DMY,'$',000,000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+
+;================================================
+
+fi850_info label word ;CP850 Finland
+ ctable <>
+ cinfo <CID_FI,437,DMY,'m','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+fi437_info label word ;CP437
+ ctable <>
+ cinfo <CID_FI,437,DMY,'m','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+fr850_info label word ;CP850 France
+ ctable <>
+ cinfo <CID_FR,850,DMY,'F',000,000,000,0,' ',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+fr437_info label word ;CP437 France
+ ctable <>
+ cinfo <CID_FR,437,DMY,'F',000,000,000,0,' ',0,',',0,'/',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+gr850_info label word ;CP850 Germany
+ ctable <>
+ cinfo <CID_GR,850,DMY,'D','M',000,000,0,'.',0,',',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+gr437_info label word ;CP437 Germany
+ ctable <>
+ cinfo <CID_GR,437,DMY,'D','M',000,000,0,'.',0,',',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+gk869_info label word ;CP869 Greece
+ ctable <>
+ cinfo <CID_GK,869,DMY,'§','ë','ô',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk737_info label word ;CP737 Greece
+ ctable <>
+ cinfo <CID_GK,737,DMY,'ƒ','¨','®',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk852_info label word ;CP852 Greece
+ ctable <>
+ cinfo <CID_GK,852,DMY,'D','r','s',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+gk850_info label word ;CP850 Greece
+ ctable <>
+ cinfo <CID_GK,850,DMY,'D','r','s',000,0,'.',0,',',0,'/',0,':',0,AmountCurr,2,HR12,0,','>
+
+;================================================
+
+hk437_info label word ;CP437 Hong Kong
+ ctable <>
+ cinfo <CID_HK,437,DMY,'H','K','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+hu852_info label word ;CP852 Hungary
+ ctable <>
+ cinfo <CID_HU,852,YMD,'F','t',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+hu850_info label word ;CP850 Hungary
+ ctable <>
+ cinfo <CID_HU,850,YMD,'F','t',000,000,0,' ',0,',',0,'.',0,'.',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+ic861_info label word ;CP861 Iceland
+ ctable <>
+ cinfo <CID_IC,861,YMD,'¥','K','r',000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ic850_info label word ;CP850 Iceland
+ ctable <>
+ cinfo <CID_IC,850,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+in437_info label word ;CP437 Indea
+ ctable <>
+ cinfo <CID_IN,437,DMY,'R','s',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+afe437_info label word ;CP437 International English
+ ctable <>
+ cinfo <CID_AFE,437,DMY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+afe850_info label word ;CP850 International English
+ ctable <>
+ cinfo <CID_AFE,850,DMY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+ie850_info label word ;CP850 Ireland
+ ctable <>
+ cinfo <CID_IE,850,DMY,'I','R','œ',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+ie437_info label word ;CP437 Ireland
+ ctable <>
+ cinfo <CID_IE,437,DMY,'I','R','œ',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+is862_info label word ;CP862 Israel
+ ctable <>
+ cinfo <CID_IS,862,DMY,153,000,000,000,0,',',0,'.',0,'/',0,':',0,Cur_Amount,2,HR24,0,','>
+
+is850_info label word ;CP850 Israel
+ ctable <>
+ cinfo <CID_IS,850,DMY,'N','I','S',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+it850_info label word ;CP850 Italy
+ ctable <>
+ cinfo <CID_IT,850,DMY,'L','.',000,000,0,'.',0,',',0,'/',0,'.',0,Cur_Amount,0,HR24,0,';'>
+
+it437_info label word ;CP437 Italy
+ ctable <>
+ cinfo <CID_IT,437,DMY,'L','.',000,000,0,'.',0,',',0,'/',0,'.',0,Cur_Amount,0,HR24,0,';'>
+
+;================================================
+
+jp932_info label word ;CP932 Japan
+ ctable <>
+ cinfo <CID_JP,932,YMD,'\',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,0,HR24,0,','>
+
+jp437_info label word ;CP437 Japan
+ ctable <>
+ cinfo <CID_JP,437,MDY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+ko949_info label word ;CP949 Korea
+ ctable <>
+ cinfo <CID_KO,949,YMD,'\',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,0,HR24,0,','>
+
+ko1361_info label word ;CP1361 Korea
+ ctable <>
+ cinfo <CID_KO,1361,YMD,'\',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,0,HR24,0,','>
+
+ko437_info label word ;CP437 Korea
+ ctable <>
+ cinfo <CID_KO,437,MDY,'$',000,000,000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+la850_info label word ;CP850 Latin America
+ ctable <>
+ cinfo <CID_LA,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+la437_info label word ;CP437 Latin America
+ ctable <>
+ cinfo <CID_LA,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+mac855_info label word ;CP855 FYR Macedonia
+ ctable <>
+ cinfo <CID_MAC,855,YMD,'§','¨','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+mac850_info label word ;CP850 FYR Macedonia
+ ctable <>
+ cinfo <CID_MAC,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+my437_info label word ;CP437 Malaysia
+ ctable <>
+ cinfo <CID_MY,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+mx850_info label word ;CP850 Mexico
+ ctable <>
+ cinfo <CID_MX,850,DMY,'N','$',000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+mx437_info label word ;CP437 Mexico
+ ctable <>
+ cinfo <CID_MX,437,DMY,'N','$',000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+nl850_info label word ;CP850 Netherlands
+ ctable <>
+ cinfo <CID_NL,850,DMY,'Ÿ',000,000,000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+nl437_info label word ;CP437 Netherlands
+ ctable <>
+ cinfo <CID_NL,437,DMY,'Ÿ',000,000,000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+nz437_info label word ;CP437 New Zealand
+ ctable <>
+ cinfo <CID_NZ,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+nz850_info label word ;CP850 New Zealand
+ ctable <>
+ cinfo <CID_NZ,850,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+no850_info label word ;CP850 Norway
+ ctable <>
+ cinfo <CID_NO,850,DMY,'k','r',000,000,0,' ',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+no865_info label word ;CP865 Norway
+ ctable <>
+ cinfo <CID_NO,865,DMY,'k','r',000,000,0,' ',0,',',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+pr936_info label word ;CP936 People's Republic of China
+ ctable <>
+ cinfo <CID_PR,936,YMD,'\',000,000,000,0,',',0,'.',0,'.',0,':',0,CurrAmount,2,HR12,0,','>
+
+pr437_info label word ;CP437 People's Republic of China
+ ctable <>
+ cinfo <CID_PR,437,YMD,'$',000,000,000,0,',',0,'.',0,'.',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+pl852_info label word ;CP852 Poland
+ ctable <>
+ cinfo <CID_PL,852,YMD,'Z','ˆ',000,000,0,' ',0,',',0,'.',0,':',0,CurrAmount,2,HR24,0,';'>
+
+pl850_info label word ;CP850 Poland
+ ctable <>
+ cinfo <CID_PL,850,YMD,'Z','l',000,000,0,' ',0,',',0,'.',0,':',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+po850_info label word ;CP850 Portugal
+ ctable <>
+ cinfo <CID_PO,850,DMY,'E','s','c','.',0,'.',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+po860_info label word ;CP860 Portugal
+ ctable <>
+ cinfo <CID_PO,860,DMY,'E','s','c','.',0,'.',0,',',0,'-',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+ro852_info label word ;CP852 Romania
+ ctable <>
+ cinfo <CID_RO,852,YMD,'L','e','i',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+ro850_info label word ;CP850 Romania
+ ctable <>
+ cinfo <CID_RO,850,YMD,'L','e','i',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+ru866_info label word ;CP866 Russia
+ ctable <>
+ cinfo <CID_RU,866,DMY,'à','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru437_info label word ;CP437 Russia
+ ctable <>
+ cinfo <CID_RU,437,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru850_info label word ;CP850 Russia
+ ctable <>
+ cinfo <CID_RU,850,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru855_info label word ;CP855 Russia
+ ctable <>
+ cinfo <CID_RU,855,DMY,'á','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+ru852_info label word ;CP852 Russia
+ ctable <>
+ cinfo <CID_RU,852,DMY,'r','.',000,000,0,' ',0,'.',0,'.',0,':',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sm855_info label word ;CP855 Serbia/Montenegro
+ ctable <>
+ cinfo <CID_SM,855,YMD,'§','·','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+sm850_info label word ;CP850 Serbia/Montenegro
+ ctable <>
+ cinfo <CID_SM,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+sg437_info label word ;CP437 Singapore
+ ctable <>
+ cinfo <CID_SG,437,DMY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+sl852_info label word ;CP852 Slovakia
+ ctable <>
+ cinfo <CID_SL,852,DMY,'S','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+sl850_info label word ;CP850 Slovakia
+ ctable <>
+ cinfo <CID_SL,850,DMY,'S','k',000,000,0,' ',0,',',0,'.',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sln852_info label word ;CP852 Slovenia
+ ctable <>
+ cinfo <CID_SLN,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+sln850_info label word ;CP850 Slovenia
+ ctable <>
+ cinfo <CID_SLN,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+za437_info label word ;CP437 South Africa
+ ctable <>
+ cinfo <CID_ZA,437,YMD,'R',000,000,000,0,' ',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+za850_info label word ;CP850 South Africa
+ ctable <>
+ cinfo <CID_ZA,850,YMD,'R',000,000,000,0,' ',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+sp850_info label word ;CP850 Spain
+ ctable <>
+ cinfo <CID_SP,437,DMY,'P','t','s',000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,0,HR24,0,';'>
+
+sp437_info label word ;CP437 Spain
+ ctable <>
+ cinfo <CID_SP,437,DMY,'ž',000,000,000,0,'.',0,',',0,'/',0,':',0,Amount_Cur,0,HR24,0,';'>
+
+;================================================
+
+sv850_info label word ;CP850 Sweden
+ ctable <>
+ cinfo <CID_SV,850,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+sv437_info label word ;CP437 Sweden
+ ctable <>
+ cinfo <CID_SV,437,YMD,'k','r',000,000,0,' ',0,',',0,'-',0,'.',0,Amount_Cur,2,HR24,0,';'>
+
+;================================================
+
+sw850_info label word ;CP850 Switzerland
+ ctable <>
+ cinfo <CID_SW,850,DMY,'S','F','r','.',0,"'",0,'.',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+sw437_info label word ;CP437 Switzerland
+ ctable <>
+ cinfo <CID_SW,437,DMY,'S','F','r','.',0,"'",0,'.',0,'.',0,':',0,Cur_Amount,2,HR24,0,';'>
+
+;================================================
+
+ta938_info label word ;CP938 Taiwan
+ ctable <>
+ cinfo <CID_TA,938,YMD,'N','T','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+ta437_info label word ;CP437 Taiwan
+ ctable <>
+ cinfo <CID_TA,437,YMD,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+tai938_info label word ;CP938 Taiwan with Real Country Code
+ ctable <>
+ cinfo <CID_TAI,938,YMD,'N','T','$',000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+tai437_info label word ;CP437 Taiwan with Real Country Code
+ ctable <>
+ cinfo <CID_TAI,437,YMD,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+tr850_info label word ;CP852 Turkey
+ ctable <>
+ cinfo <CID_TR,850,DMY,'T','L',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,';'>
+
+tr857_info label word ;CP852 Turkey
+ ctable <>
+ cinfo <CID_TR,857,DMY,'T','L',000,000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR24,0,';'>
+
+;================================================
+
+uk850_info label word ;CP850 United Kingdom
+ ctable <>
+ cinfo <CID_UK,850,DMY,'œ',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+uk437_info label word ;CP437 United Kingdom
+ ctable <>
+ cinfo <CID_UK,437,DMY,'œ',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+us437_info label word ;CP437 United States
+ ctable <>
+ cinfo <CID_US,437,MDY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+us850_info label word ;CP850 United States
+ ctable <>
+ cinfo <CID_US,850,MDY,'$',000,000,000,0,',',0,'.',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+ve850_info label word ;CP850 Venezuela
+ ctable <>
+ cinfo <CID_VE,850,DMY,'B','s','.',000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+ve437_info label word ;CP437 Venezuela
+ ctable <>
+ cinfo <CID_VE,437,DMY,'B','s','.',000,0,'.',0,',',0,'/',0,':',0,CurrAmount,2,HR12,0,','>
+
+;================================================
+
+yu852_info label word ;CP852 Yugoslavia
+ ctable <>
+ cinfo <CID_YU,852,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+yu850_info label word ;CP850 Yugoslavia
+ ctable <>
+ cinfo <CID_YU,850,YMD,'D','i','n',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+yc855_info label word ;CP855 Yugoslavia Cyrillic
+ ctable <>
+ cinfo <CID_YC,855,YMD,'§','·','Ô',000,0,'.',0,',',0,'-',0,':',0,Cur_Amount,2,HR24,0,','>
+
+;================================================
+
+iso437_info label word ;CP437 Work around an NLSFUNC.EXE Bug Entry
+ ctable <>
+ cinfo <CID_ISO,437,YMD,'E','A','$',000,0,'.',0,',',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+iso850_info label word ;CP850 Work around an NLSFUNC.EXE Bug Entry
+ ctable <>
+ cinfo <CID_ISO,850,YMD,'J','K','$',000,0,',',0,'.',0,'-',0,':',0,CurrAmount,2,HR24,0,','>
+
+;================================================
+
+ page
+
+include nls437.inc
+include nls737.inc
+include nls850.inc
+include nls852.inc
+include nls855.inc
+include nls857.inc
+include nls860.inc
+include nls861.inc
+include nls862.inc
+include nls863.inc
+include nls864.inc
+include nls865.inc
+include nls866.inc
+include nls869.inc
+include nls93x.inc
+
+
+; ----------------------------------------------------------------------------
+;
+; World Trade Valid Filename Character Tables
+;
+; Currently all countries have same (4/14/86)
+;
+;
+; ----------------------------------------------------------------------------
+Valid_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
+
+
+
+; ----------------------------------------------------------------------------
+;
+; World Trade DBCS Tables
+;
+; Currently all countries have same (4/14/86)
+;
+;
+; ----------------------------------------------------------------------------
+;
+Not_dbcs label word
+ ctable <,'DBCS ',dbcsterm-dbcsbegin> ;AN000;
+dbcsbegin label word ;AN000;
+dbcsterm db 0,0 ;AN000;
+dbcsend label word ;AN000;
+
+
+
+include DBCS93x.inc
+
+
+
+include copyrigh.inc
+
+; ---------------------------------------------------------------
+;
+; END OF CDI SEGMENT
+;
+; ---------------------------------------------------------------
+
+
+dseg ends
+ end
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/country/dbcs93x.inc b/private/mvdm/dos/v86/dev/country/dbcs93x.inc
new file mode 100644
index 000000000..cab995c21
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/dbcs93x.inc
@@ -0,0 +1,58 @@
+; ----------------------------------------------------------------------------
+;
+; World Trade DBCS Tables for Code Pages 932, 949, 936, and 938
+;
+; ----------------------------------------------------------------------------
+;
+
+;
+; Japan DBCS lead byte table
+;
+jp932_dbcs label word
+ ctable <,'DBCS ',db932end-db932bgn>
+db932bgn label word
+ db 081h,09Fh
+ db 0E0h,0FCh
+db932term db 000h,000h
+db932end equ $
+
+;
+; Korea DBCS lead byte table
+;
+ko949_dbcs label word
+ ctable <,'DBCS ',db949end-db949bgn>
+db949bgn label word
+ db 081h,0FEh
+db949term db 000h,000h
+db949end equ $
+
+
+ko1361_dbcs label word
+ ctable <,'DBCS ',db1361end-db1361bgn>
+db1361bgn label word
+ db 084h,0d3h
+ db 0d8h,0deh
+ db 0e0h,0f9h
+db1361ter db 000h,000h
+db1361end equ $
+
+;
+; PRC DBCS lead byte table
+;
+pr936_dbcs label word
+ ctable <,'DBCS ',db936end-db936bgn>
+db936bgn label word
+ db 0A1h,0FEh
+db936term db 000h,000h
+db936end equ $
+
+;
+; Taiwan DBCS lead byte table
+;
+ta938_dbcs label word
+ ctable <,'DBCS ',ta938end-ta938bgn>
+ta938bgn label word
+ db 081h,0FEh
+ta938term db 000h,000h
+ta938end equ $
+
diff --git a/private/mvdm/dos/v86/dev/country/makefile b/private/mvdm/dos/v86/dev/country/makefile
new file mode 100644
index 000000000..9e0b452ad
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/makefile
@@ -0,0 +1,24 @@
+#;/*
+#; * Microsoft Confidential
+#; * Copyright (C) Microsoft Corporation 1991
+#; * All Rights Reserved.
+#; */
+#************************ Makefile for Country.sys ************************
+
+!include ..\..\make.inc
+
+all: country.sys
+ binplace country.sys
+
+clean: cleanup all
+
+cleanup:
+ -del country.obj country.exe country.map country.sym country.sys > nul 2>&1
+
+country.obj: country.asm mkcntry.inc
+
+country.exe: country.obj
+ link16 /map country;
+
+country.sys: country.exe
+ reloc country.exe country.sys
diff --git a/private/mvdm/dos/v86/dev/country/mkcntry.inc b/private/mvdm/dos/v86/dev/country/mkcntry.inc
new file mode 100644
index 000000000..ec8b328dc
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/mkcntry.inc
@@ -0,0 +1,258 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+;
+; 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
+
+;
+; 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_CAE EQU 004 ; Canadian English
+CID_AS EQU 785 ; Area South (Saudi Arabia)
+CID_PO EQU 351 ; Portugal
+CID_LA EQU 003 ; Latin America
+CID_BR EQU 055 ; Brazil
+CID_IC EQU 354 ; Iceland
+CID_TR EQU 090 ; Turkey
+CID_YU EQU 038 ; YUGOSLAVIA
+CID_CS EQU 042 ; CZECH
+CID_GK EQU 030 ; GREEK added 9/15/93
+CID_HU EQU 036 ; HUNGARY
+CID_PL EQU 048 ; POLAND
+CID_RO EQU 040 ; ROMANIA
+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_TAI EQU 886 ; Real Country Code for Taiwan (EA)
+CID_RU EQU 007 ; Russia (YST)
+CID_AL EQU 355 ; Albania (EA)
+CID_AR EQU 054 ; Argentina (EA)
+CID_AU EQU 061 ; Australia (EA)
+CID_AT EQU 043 ; Austria (EA)
+CID_BH EQU 387 ; Bosnia/Herzegovina (EA)
+CID_BG EQU 035 ; IBM Country Code for Bulgaria (EA)
+CID_BGI EQU 359 ; Real Country Code for Bulgaria (EA)
+CID_CL EQU 056 ; Chile (EA)
+CID_CO EQU 057 ; Columbia (EA)
+CID_CRO EQU 384 ; Croatia (EA)
+CID_EC EQU 593 ; Ecuador (EA)
+CID_MAC EQU 389 ; FYR Macedonia (EA)
+CID_IE EQU 353 ; Ireland (EA)
+CID_MX EQU 052 ; Mexico (EA)
+CID_NZ EQU 064 ; New Zealand (EA)
+CID_SM EQU 381 ; Serbia/Montenegro (EA)
+CID_SLN EQU 386 ; Slovenia (EA)
+CID_ZA EQU 027 ; South Africa (EA)
+CID_VE EQU 058 ; Venezuela (EA)
+CID_YC EQU 038 ; Yugoslavia Cyrillic (EA)
+CID_HK EQU 852 ; Hong Kong (EA)
+CID_IN EQU 091 ; Indea (EA)
+CID_MY EQU 060 ; Malaysia (EA)
+CID_SG EQU 065 ; Singapore (EA)
+CID_SL EQU 421 ; SLOVAK (Not Real Country Code,
+ ; but need to get a new number
+ ; since it now has different
+ ; settings than Czech Rep. and
+ ; AT&T have not assigned a new
+ ; number yet.) (EA)
+CID_ISO EQU 711 ; Work around an NLSFUNC.EXE bug
+ ; Entry. USA with ISO 8601 Date
+ ; format. (EA)
+CID_XX EQU 000 ; Dummy entry
+
+
+;
+; country code pages
+;
+CP_UK EQU 850
+CP_FR EQU 850
+CP_GR EQU 850
+CP_SP EQU 850
+CP_IT EQU 850
+CP_SV EQU 850
+CP_AFE EQU 437
+CP_DA EQU 865
+CP_SW EQU 850
+CP_NO EQU 865
+CP_NL EQU 850
+CP_BE EQU 850
+CP_FI EQU 850
+CP_US EQU 437
+CP_IS EQU 862
+CP_CA EQU 863
+CP_CAE EQU 863
+CP_AS EQU 864
+CP_PO EQU 860
+CP_BR EQU 850
+CP_IC EQU 850
+CP_TR EQU 857
+CP_GK EQU 869 ; GREEK
+CP_YU EQU 852 ; YUGOSLAVIA
+CP_CS EQU 852 ; CZECH
+CP_SL EQU 852 ; SLOVAK (CZECH)
+CP_HU EQU 852 ; HUNGARY
+CP_PL EQU 852 ; POLAND
+CP_RO EQU 852 ; ROMANIA
+CP_JP EQU 932 ; Japan 2/17/KK
+CP_KO EQU 949 ; Korea 2/17/KK
+CP_PR EQU 936 ; PRC 2/17/KK
+CP_TA EQU 938 ; Taiwan 2/17/KK
+CP_TAI EQU 938
+CP_RU EQU 866 ; Russia 1/22/91 (YST)
+CP_AL EQU 852 ; Albania (EA)
+CP_AR EQU 850 ; Argentina (EA)
+CP_AU EQU 437 ; Australia (EA)
+CP_AT EQU 850 ; Austria (EA)
+CP_BH EQU 852 ; Bosnia/Herzegovina (EA)
+CP_BG EQU 855 ; IBM Country Code for Bulgaria (EA)
+CP_BGI EQU 855 ; Real Country Code for Bulgaria (EA)
+CP_CL EQU 850 ; Chile (EA)
+CP_CO EQU 850 ; Columbia (EA)
+CP_CRO EQU 852 ; Croatia (EA)
+CP_EC EQU 850 ; Ecuador (EA)
+CP_MAC EQU 855 ; FYR Macedonia (EA)
+CP_IE EQU 850 ; Ireland (EA)
+CP_MX EQU 850 ; Mexico (EA)
+CP_NZ EQU 437 ; New Zealand (EA)
+CP_SM EQU 855 ; Serbia/Montenegro (EA)
+CP_SLN EQU 852 ; Slovenia (EA)
+CP_ZA EQU 437 ; South Africa (EA)
+CP_VE EQU 850 ; Venezuela (EA)
+CP_HK EQU 437 ; Hong Kong (EA)
+CP_IN EQU 437 ; Indea (EA)
+CP_MY EQU 437 ; Malaysia (EA)
+CP_SG EQU 437 ; Singapore (EA)
+CP_ISO EQU 437 ; Work around an NLSFUNC.EXE bug
+ ; Entry. USA with ISO 8601 Date
+ ; format. (EA)
+
+
+;
+; date formats
+;
+MDY EQU 0
+DMY EQU 1
+YMD EQU 2
+
+;
+; time formats
+;
+HR12 EQU 0 ; 12 HOUR TIME FORMAT
+HR24 EQU 1 ; 24 HOUR TIME FORMAT
+
+;
+; CURRENCY FORMAT FLAGS
+;
+CurrAmount EQU 0 ; $100
+AmountCurr EQU 1 ; 100$
+Cur_Amount EQU 2 ; $ 100
+Amount_Cur EQU 3 ; 100 $
+
+;
+; STRUC definitions
+;
+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
+
+
+CENTRYSIZE EQU (TYPE CTRYSTR) - 2 ; SIZE OF COUNTRY ENTRY
+
+
+CTRYENT MACRO PARMS
+ CTRYSTR <PARMS>
+ CNTRYCNT = CNTRYCNT + 1
+ENDM
+
+
+CTRYDAT STRUC
+ DW 0
+ DB 0
+ DB 0
+ DW 0
+ DW 0
+CTRYDAT ENDS
+
+
+CDATASIZE EQU (TYPE CTRYDAT) - 2 ; SIZE OF COUNTRY DATA
+
+
+CINFO STRUC ; OFFSET FIELD
+ DW 0 ; 0 COUNTRY ID
+ DW 0 ; 2 CODE PAGE
+ DW 0 ; 4 DATE FORMAT
+ DB 0 ; 5 CURRENCY SYMBOL (5 BYTES)
+ DB 0
+ DB 0
+ DB 0
+ DB 0
+ DB 0 ; 10 1000 SEPARATOR
+ DB 0
+ DB 0 ; 12 DECIMAL SEPARATOR
+ DB 0
+ DB 0 ; 14 DATE SEPARATOR
+ DB 0
+ DB 0 ; 16 TIME SEPARATOR
+ DB 0
+ DB 0 ; 18 CURRENCY FORMAT FLAGS
+ DB 0 ; 19 DIGITS IN CURRENCY
+ DB 0 ; 20 TIME FORMAT
+ DD 0 ; 21 RESERVED
+ DB 0 ; 25 DATA LIST SEPARATOR
+ DB 0
+ DW 5 DUP (0) ; 27 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/private/mvdm/dos/v86/dev/country/nls437.inc b/private/mvdm/dos/v86/dev/country/nls437.inc
new file mode 100644
index 000000000..6d9daed33
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls437.inc
@@ -0,0 +1,356 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 437
+;
+; -----------------------------------------
+;
+Latin1_437_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db " ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/"
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?"
+ ; @ A B C D E F G H I J K L M N O
+ db "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_"
+ ; ` a b c d e f g h i j k l m n o
+ db "`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; p q r s t u v w x y z { | } ~ 
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "C","U","E","A","A","A","A","C","E","E","E","I","I","I","A","A"
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "E","A","A","O","O","O","U","U","Y","O","U","$","$","$","$","$"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","N","N",166,167,"?",169,170,171,172,"!",'"','"'
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,"S",226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Dutch_437_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,154,144,065,142,065,143,128,069,069,069,073,073,073,142,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 144,146,146,079,079,079,085,085,152,079,085,155,156,157,158,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,165,165,166,167,168,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Spanish_437_collate label word
+ ctable <,'COLLATE',256>
+ db 000,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164
+ db 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 000,060,061,062,063,064,065,000,066,067,068,069,070,000,071,072
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 034,035,036,037,038,039,040,041,042,043,073,074,075,076,077,078
+ ; @ A B C D E F G H I J K L M N O
+ db 079,001,002,003,006,008,009,010,011,012,013,014,015,017,018,020
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 021,022,023,024,026,028,029,030,031,032,033,080,081,082,083,084
+ ; ` a b c d e f g h i j k l m n o
+ db 085,001,002,003,006,008,009,010,011,012,013,014,015,017,018,020
+ ; p q r s t u v w x y z { | } ~ 
+ db 021,022,023,024,026,028,029,030,031,032,033,086,087,088,089,090
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 004,028,008,001,001,001,001,004,008,008,008,012,012,012,001,001
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 008,001,001,020,020,020,028,028,032,020,028,091,092,093,094,095
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 001,012,020,028,019,019,001,020,096,097,098,099,100,101,102,103
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 104,105,106,107,108,181,182,183,184,109,110,111,112,185,186,113
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 114,115,116,117,118,119,187,188,120,121,122,123,124,125,126,189
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 190,191,192,193,194,195,196,197,198,127,128,129,130,199,200,131
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 201,025,202,203,204,205,132,206,207,208,209,210,211,212,213,214
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 215,133,216,217,218,219,134,220,221,222,000,223,224,135,136,225
+
+;
+;Spanish_437_collate label word
+; ctable <,'COLLATE',256>
+; db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+; db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+; ; ! " # $ % & ' ( ) * + , - . /
+; db 001,009,023,045,039,046,044,022,026,027,042,047,006,005,014,013
+; ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+; db 060,064,066,068,070,071,072,073,074,075,008,007,051,052,053,011
+; ; @ A B C D E F G H I J K L M N O
+; db 036,077,094,096,104,108,118,120,122,124,134,136,138,144,146,150
+; ; P Q R S T U V W X Y Z [ \ ] ^ _
+; db 165,167,169,171,174,178,188,190,192,194,199,028,043,029,017,002
+; ; ` a b c d e f g h i j k l m n o
+; db 016,076,093,095,103,107,117,119,121,123,133,135,137,143,145,149
+; ; p q r s t u v w x y z { | } ~ 
+; db 164,166,168,170,173,177,187,189,191,193,198,030,055,031,019,200
+; ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+; db 098,185,109,083,087,081,085,097,113,115,111,131,129,127,088,086
+; ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+; db 110,091,092,156,158,154,183,181,197,158,186,038,040,041,039,200
+; ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+; db 079,125,152,179,147,148,078,151,012,200,054,062,061,010,024,025
+; ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+; db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+; ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+; db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+; ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+; db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+; ; à á â ã ä å æ ç è é ê ë ì í î ï
+; db 201,172,202,203,204,205,058,206,207,208,209,210,211,212,213,214
+; ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+; db 215,048,216,217,218,219,049,220,057,020,020,223,224,067,240,255
+;
+
+Swed_Fin_437_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,092,065,091,067,069,069,069,073,073,073,092,091
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,092,092,079,093,079,085,085,089,093,089,036,036,036,036,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Swiss_437_collate label word
+ ctable <,'COLLATE',256>
+ db 001,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214
+ db 215,216,217,218,140,141,219,220,221,222,223,224,225,226,227,228
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,060,061,062,063,064,065,066,067,068,069,070,071,072,073,074
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 032,033,034,035,036,037,038,039,040,041,075,076,077,078,079,080
+ ; @ A B C D E F G H I J K L M N O
+ db 081,002,003,004,005,007,008,009,010,011,012,013,014,015,016,018
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 019,020,021,022,024,026,027,028,029,030,031,082,083,084,052,085
+ ; ` a b c d e f g h i j k l m n o
+ db 051,002,003,004,005,007,008,009,010,011,012,013,014,015,016,018
+ ; p q r s t u v w x y z { | } ~ 
+ db 019,020,021,022,024,026,027,028,029,030,031,086,087,088,054,089
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 004,026,007,002,002,002,002,004,007,007,007,011,011,011,002,002
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 007,002,002,018,018,018,026,026,030,018,026,111,090,112,150,092
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 002,011,018,026,017,017,002,018,093,151,095,096,097,098,099,100
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 101,102,103,104,105,152,153,154,155,107,108,109,110,156,157,113
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 114,115,116,117,118,119,158,159,120,121,122,123,124,125,126,160
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 161,162,163,164,165,166,167,168,169,128,129,130,131,170,171,133
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 172,023,173,174,175,176,134,177,178,179,180,181,182,183,184,185
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 186,137,187,188,189,190,142,191,143,192,144,193,194,147,148,001
+
+
+Belgian_437_collate label word
+ ctable <,'COLLATE',256>
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 255,033,034,035,036,037,038,255,040,041,042,043,044,255,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,065,067,069,069,069,073,073,073,065,065
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,065,065,079,079,079,085,085,089,079,085,155,156,157,158,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,168,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,255,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 437
+;
+; ---------------------------------------------------------------
+;
+Latin1_437_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","E","A","Ž","A","","€","E","E","E","I","I","I","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","O","™","O","U","U","Y","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
+Swed_Fin_437_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","A","Ž","A","","€","E","E","E","I","I","I","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","O","™","O","U","U","Y","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
+Swiss_437_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","A","Ž","A","","€","E","E","E","I","I","I","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","O","™","O","U","U","Y","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
+Dutch_437_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","U","E","A","A","A","","€","E","E","E","I","I","I","A",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "E","’","’","O","O","O","U","U","˜","O","U","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
+;
+; World Trade Mono Case Filename Character Tables
+;
+;
+; ----------------------------------------------------------------------------
+CP437_ucfile label word
+ ctable <,'FUCASE ',128>
+ ; View this table in CP437
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","’","“","”","•","–","—","˜","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db " ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls737.inc b/private/mvdm/dos/v86/dev/country/nls737.inc
new file mode 100644
index 000000000..546c6facd
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls737.inc
@@ -0,0 +1,69 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 737
+;
+; -----------------------------------------
+;
+Greek_737_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,015,044,084,072,085,082,043,050,052,079,089,010,009,022,021
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 112,114,115,117,119,120,121,123,124,125,014,012,097,100,103,018
+ ; @ A B C D E F G H I J K L M N O
+ db 069,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 226,228,230,232,234,236,238,240,242,244,246,054,081,055,027,003
+ ; ` a b c d e f g h i j k l m n o
+ db 042,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225
+ ; p q r s t u v w x y z { | } ~ 
+ db 227,229,231,233,235,237,239,241,243,245,247,056,105,057,033,063
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 126,131,133,135,137,141,143,147,149,156,158,160,162,164,168,170
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 172,174,177,179,186,188,190,192,127,132,134,136,138,142,144,148
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 150,157,159,161,163,165,167,171,173,175,176,178,180,187,189,191
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 193,130,140,146,154,152,169,182,184,195,128,139,145,151,181,168
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 194,091,096,102,153,183,080,099,045,036,037,088,248,116,254,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 737
+;
+; ---------------------------------------------------------------
+;
+Greek_737_ucase label word
+ ctable <,'UCASE ',128>
+
+; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,081h,082h,083h,084h,085h,086h,087h,088h,089h,08Ah,08Bh,08Ch,08Dh,08Eh,08Fh
+; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,091h,092h,093h,094h,095h,096h,097h,080h,081h,082h,083h,084h,085h,086h,087h
+;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 088h,089h,08ah,08bh,08ch,08dh,08eh,08fh,090h,091h,05fh,092h,093h,094h,095h,096h
+; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 0b0h,0b1h,0b2h,0b3h,0b4h,0b5h,0b6h,0b7h,0b8h,0b9h,0bah,0bbh,0bch,0bdh,0beh,0bfh
+; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 0c0h,0c1h,0c2h,0c3h,0c4h,0c5h,0c6h,0c7h,0c8h,0c9h,0cah,0cbh,0cch,0cdh,0ceh,0cfh
+; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d0h,0d1h,0d2h,0d3h,0d4h,0d5h,0d6h,0d7h,0d8h,0d9h,0dah,0dbh,0dch,0ddh,0deh,0dfh
+; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 097h,0eah,05fh,0ech,0f4h,0edh,0eeh,0efh,0f5h,0f0h,0EAh,0EBh,0ECh,0EDh,0EEh,0EFh
+; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 0F0h,0F1h,0F2h,0F3h,0F4h,0F5h,0F6h,0F7h,0F8h,0F9h,0FAh,0FBh,0FCh,0FDh,0FEh,0FFh
+
+
diff --git a/private/mvdm/dos/v86/dev/country/nls850.inc b/private/mvdm/dos/v86/dev/country/nls850.inc
new file mode 100644
index 000000000..a2d28c502
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls850.inc
@@ -0,0 +1,642 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 850
+;
+; -----------------------------------------
+;
+Latin1_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,065,067,069,069,069,073,073,073,065,065
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,065,065,079,079,079,085,085,089,079,085,079,036,079,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,079,079,230,232,232,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Latin2_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,067,068,069,071,073,074,075,076,078,079,080,081,082,083
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 085,086,087,088,089,090,092,093,094,095,097,040,047,041,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,067,068,069,071,073,074,075,076,078,079,080,081,082,083
+ ; p q r s t u v w x y z { | } ~ 
+ db 085,086,087,088,089,090,092,093,094,095,097,040,047,041,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 068,091,072,066,066,066,066,068,072,072,072,077,077,077,066,066
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 072,099,099,084,100,084,091,091,096,100,091,084,036,084,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 066,077,084,091,082,082,065,084,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,066,066,066,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,066,066,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 070,070,072,072,072,076,077,077,077,217,218,219,220,221,077,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 084,067,084,084,084,084,230,098,098,091,091,091,096,096,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+;
+;Latin2_850_collate label word
+; ctable <,'COLLATE',256>
+; db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+; db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+; ; ! " # $ % & ' ( ) * + , - . /
+; db 001,008,025,039,035,040,038,024,026,027,036,041,005,004,011,010
+; ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+; db 049,050,051,052,053,054,055,056,057,058,007,006,044,045,046,009
+; ; @ A B C D E F G H I J K L M N O
+; db 033,060,072,074,082,088,098,100,102,104,110,112,114,122,124,130
+; ; P Q R S T U V W X Y Z [ \ ] ^ _
+; db 140,142,144,150,159,165,175,177,179,181,185,028,037,029,015,002
+; ; ` a b c d e f g h i j k l m n o
+; db 013,059,071,073,081,087,097,099,101,103,109,111,113,121,123,129
+; ; p q r s t u v w x y z { | } ~ 
+; db 139,141,143,149,158,164,174,176,178,180,184,030,047,031,020,198
+; ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+; db 080,170,089,065,067,201,201,079,202,093,202,203,107,203,068,201
+; ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+; db 090,201,201,133,135,205,207,207,208,136,171,205,035,205,199,199
+; ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+; db 061,105,131,166,204,204,201,205,199,199,199,200,200,199,030,031
+; ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+; db 240,240,240,240,240,062,066,201,199,240,240,240,240,035,035,240
+; ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+; db 240,240,240,240,240,240,201,201,240,240,240,240,240,240,240,034
+; ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+; db 085,086,202,094,202,203,106,108,203,240,240,240,240,047,203,240
+; ; à á â ã ä å æ ç è é ê ë ì í î ï
+; db 132,157,134,205,205,205,199,206,206,166,207,207,182,183,199,012
+; ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+; db 004,199,199,200,199,032,042,022,017,018,199,200,200,200,240,255
+;
+
+Dutch_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,143,067,069,069,069,073,073,073,065,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,146,146,079,079,079,085,085,152,079,085,079,156,079,158,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,165,165,166,167,168,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 209,209,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,225,079,079,079,079,230,232,232,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Danish_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,091,065,093,067,069,069,069,073,073,073,091,093
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,091,091,079,092,079,085,085,089,092,089,092,036,092,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,065,079,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,079,079,230,080,080,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Norwegian_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,091,065,093,067,069,069,069,073,073,073,091,093
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,091,091,079,092,079,085,085,089,092,089,092,036,092,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,065,079,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,079,079,230,080,080,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Finnish_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,092,065,091,067,069,069,069,073,073,073,092,091
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,092,092,079,093,079,085,085,089,093,089,093,036,093,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,079,079,230,232,232,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Swedish_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,092,065,091,067,069,069,069,073,073,073,092,091
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,092,092,079,093,079,085,085,089,093,089,093,036,093,158,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,065,065,065,184,185,186,187,188,036,036,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,065,065,200,201,202,203,204,205,206,036
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,217,218,219,220,221,073,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,093,093,230,232,232,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Swiss_850_collate label word
+ ctable <,'COLLATE',256>
+ db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 000,165,168,133,185,134,135,169,170,171,136,158,172,174,175,176
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 117,118,120,122,124,125,126,127,128,129,177,178,160,161,162,179
+ ; @ A B C D E F G H I J K L M N O
+ db 137,002,018,020,024,028,038,040,042,044,055,057,059,061,063,067
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 081,083,085,087,090,094,104,106,108,110,115,138,139,140,191,173
+ ; ` a b c d e f g h i j k l m n o
+ db 190,003,019,021,025,029,039,041,043,056,045,058,060,062,064,068
+ ; p q r s t u v w x y z { | } ~ 
+ db 082,084,086,088,091,095,105,107,109,111,116,142,143,144,193,157
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 022,103,031,009,011,007,015,023,035,037,033,053,051,049,010,014
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 030,017,016,074,076,072,101,099,114,075,102,080,184,079,164,188
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 005,047,070,097,066,065,149,148,180,154,156,131,130,166,181,182
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 207,208,209,206,204,004,008,006,153,210,211,212,213,186,187,198
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 197,202,201,203,205,200,013,012,214,215,216,217,218,219,220,183
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 027,026,034,036,032,054,046,050,052,199,196,223,221,155,048,222
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 069,089,073,071,078,077,146,092,093,096,100,098,113,112,145,189
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 167,159,141,132,151,150,163,194,147,192,195,119,123,121,152,001
+
+
+Belgian_850_collate label word
+ ctable <,'COLLATE',256>
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 255,033,034,035,036,037,038,255,040,041,042,043,044,255,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,065,067,069,069,069,073,073,073,065,065
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,065,065,079,079,079,085,085,089,079,085,079,156,079,158,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,164,166,167,168,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 255,255,255,255,255,065,065,065,184,255,255,255,255,189,190,255
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 255,255,255,255,255,255,065,065,255,255,255,255,255,255,255,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 068,068,069,069,069,073,073,073,073,255,255,255,255,221,073,255
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 079,083,079,079,079,079,230,084,084,085,085,085,089,089,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 255,241,242,243,244,245,246,247,248,249,250,251,252,253,255,255
+
+
+Spanish_850_collate label word
+ ctable <,'COLLATE',256>
+ db 000,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164
+ db 165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 000,060,061,062,063,064,065,000,066,067,068,069,070,000,071,072
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 034,035,036,037,038,039,040,041,042,043,073,074,075,076,077,078
+ ; @ A B C D E F G H I J K L M N O
+ db 079,001,002,003,006,008,009,010,011,012,013,014,015,017,018,020
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 021,022,023,024,026,028,029,030,031,032,033,080,081,082,083,084
+ ; ` a b c d e f g h i j k l m n o
+ db 085,001,002,003,006,008,009,010,011,012,013,014,015,017,018,020
+ ; p q r s t u v w x y z { | } ~ 
+ db 021,022,023,024,026,028,029,030,031,032,033,086,087,088,089,090
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 004,028,008,001,001,001,001,004,008,008,008,012,012,012,001,001
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 008,001,001,020,020,020,028,028,032,020,028,020,092,020,094,095
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 001,012,020,028,019,019,001,020,096,097,098,099,100,101,102,103
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 104,105,106,107,108,001,001,001,184,109,110,001,001,091,093,113
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 114,115,116,117,118,119,187,188,120,121,122,123,124,125,126,189
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 007,007,008,008,008,012,012,012,012,127,128,129,130,199,012,131
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 020,025,020,020,020,020,132,027,027,028,028,028,032,032,213,214
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 000,133,216,217,218,219,134,220,221,222,000,223,224,135,136,225
+
+
+;
+;Spanish_850_collate label word
+; ctable <,'COLLATE',256>
+; db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+; db 255,255,255,255,255,255,255,255,255,255,255,255,255,255,255,255
+; ; ! " # $ % & ' ( ) * + , - . /
+; db 001,009,023,045,039,046,044,022,026,027,042,047,006,005,014,013
+; ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+; db 060,064,066,068,070,071,072,073,074,075,008,007,051,052,053,011
+; ; @ A B C D E F G H I J K L M N O
+; db 036,077,094,096,104,108,118,120,122,124,134,136,138,144,146,150
+; ; P Q R S T U V W X Y Z [ \ ] ^ _
+; db 165,167,169,171,174,178,188,190,192,194,199,028,043,029,017,002
+; ; ` a b c d e f g h i j k l m n o
+; db 016,076,093,095,103,107,117,119,121,123,133,135,137,143,145,149
+; ; p q r s t u v w x y z { | } ~ 
+; db 164,166,168,170,173,177,187,189,191,193,198,030,055,031,019,200
+; ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+; db 098,185,109,083,087,081,085,097,113,115,111,131,129,127,088,086
+; ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+; db 110,091,092,156,158,154,183,181,197,159,186,162,040,163,050,200
+; ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+; db 079,125,152,179,147,148,078,151,012,035,054,062,061,010,024,025
+; ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+; db 254,254,254,254,254,080,084,082,034,254,254,254,254,038,041,254
+; ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+; db 254,254,254,254,254,254,089,090,254,254,254,254,254,254,254,037
+; ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+; db 105,106,114,116,112,200,126,130,132,254,254,254,254,056,128,254
+; ; à á â ã ä å æ ç è é ê ë ì í î ï
+; db 153,172,157,155,160,161,058,175,176,180,184,182,195,196,003,015
+; ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+; db 005,048,201,063,033,032,049,021,057,018,020,065,069,067,254,255
+;
+
+Turkish_850_collate label word
+ ctable <,'COLLATE',256>
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 000,009,023,045,039,046,044,022,026,027,042,047,006,005,014,013
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 060,064,066,068,070,071,072,073,074,075,008,007,051,052,053,011
+ ; @ A B C D E F G H I J K L M N O
+ db 036,077,094,096,100,102,112,114,118,120,132,134,136,138,140,144
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 159,161,163,165,170,172,182,184,186,188,191,028,043,029,017,002
+ ; ` a b c d e f g h i j k l m n o
+ db 016,076,093,095,099,101,111,113,117,121,131,133,135,137,139,143
+ ; p q r s t u v w x y z { | } ~ 
+ db 158,160,162,164,169,171,181,183,185,187,190,030,055,031,019,192
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 098,179,103,083,087,081,085,097,107,109,105,129,127,125,088,086
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 104,091,092,151,156,148,177,175,189,157,180,154,040,155,050,192
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 079,123,146,173,141,142,078,145,012,035,054,062,061,010,024,025
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 240,240,240,240,240,080,084,082,034,240,240,240,240,038,040,240
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 240,240,240,240,240,240,089,090,240,240,240,240,240,240,240,037
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 193,193,108,110,106,119,124,128,130,240,240,240,240,056,125,240
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 147,166,151,149,152,153,058,193,193,174,178,176,193,193,003,015
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 005,048,193,063,033,032,049,021,057,018,020,065,069,067,240,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for 850
+;
+; ---------------------------------------------------------------
+;
+Latin1_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+German_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Spanish_850_ucase label word
+Swed_Fin_850_ucase label word
+Nordic_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Swiss_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Dutch_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Latin2_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Brazilian_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+Turkish_850_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+;
+; World Trade Mono Case Filename Character Tables
+;
+;
+; ----------------------------------------------------------------------------
+CP850_ucfile label word
+ ctable <,'FUCASE ',128>
+ ; View this table in CP850
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 080h,9ah,90h,0b6h,8eh,0b7h,8fh,80h,0d2h,0d3h,0d4h,0d8h,0d7h,0deh,08eh,8fh
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 090h,092h,092h,0e2h,099h,0e3h,0eah,0ebh,05fh,099h,09ah,09dh,09ch,09dh,09eh,09fh
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 0b5h,0d6h,0e0h,0e9h,0a5h,0a5h,"¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,199,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 0d1h,0d1h,210,211,212,"I",214,215,216,217,218,219,220,"Ý",222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,229,229,230,232,232,233,234,235,237,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls852.inc b/private/mvdm/dos/v86/dev/country/nls852.inc
new file mode 100644
index 000000000..85a9eee46
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls852.inc
@@ -0,0 +1,120 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 852
+;
+; -----------------------------------------
+;
+Latin2_852_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 100,101,102,103,104,105,106,107,108,109,126,127,128,129,130,131
+ ; @ A B C D E F G H I J K L M N O
+ db 132,033,039,040,044,047,052,053,054,055,058,059,060,064,065,068
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 073,074,075,078,083,086,091,092,093,094,096,133,134,135,136,137
+ ; ` a b c d e f g h i j k l m n o
+ db 138,033,039,040,044,047,052,053,054,055,058,059,060,064,065,068
+ ; p q r s t u v w x y z { | } ~ 
+ db 073,074,075,078,083,086,091,092,093,094,096,139,140,141,142,032
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 043,089,048,038,035,088,041,043,063,051,072,072,057,098,035,041
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 048,061,061,070,071,062,062,082,082,071,089,084,084,063,143,042
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 034,056,069,087,036,036,097,097,050,050,144,098,042,081,145,146
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 151,152,153,154,155,034,038,049,081,156,157,158,159,099,099,160
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 161,162,163,164,165,166,037,037,167,168,169,170,171,172,173,147
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 045,045,046,051,046,066,056,057,049,174,175,176,177,085,088,178
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 069,079,070,067,067,066,080,080,076,087,076,090,095,095,085,180
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 148,181,182,183,184,149,150,185,186,187,188,090,077,077,179,255
+
+
+;
+;Latin2_852_collate label word
+; ctable <,'COLLATE',256>
+; db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+; db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+; ; ! " # $ % & ' ( ) * + , - . /
+; db 001,008,025,039,035,040,038,024,026,027,036,041,005,004,011,010
+; ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+; db 049,050,051,052,053,054,055,056,057,058,007,006,044,045,046,009
+; ; @ A B C D E F G H I J K L M N O
+; db 033,060,072,074,082,088,098,100,102,104,110,112,114,122,124,130
+; ; P Q R S T U V W X Y Z [ \ ] ^ _
+; db 140,142,144,150,159,165,175,177,179,181,185,028,037,029,015,002
+; ; ` a b c d e f g h i j k l m n o
+; db 013,059,071,073,081,087,097,099,101,103,109,111,113,121,123,129
+; ; p q r s t u v w x y z { | } ~ 
+; db 139,141,143,149,158,164,174,176,178,180,184,030,047,031,020,200
+; ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+; db 080,170,089,065,067,168,075,079,119,093,138,137,107,187,068,076
+; ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+; db 090,116,115,133,135,118,117,152,151,136,171,161,160,120,043,077
+; ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+; db 061,105,131,166,070,069,189,188,096,095,000,186,078,155,030,031
+; ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+; db 240,240,240,240,240,062,066,092,156,240,240,240,240,191,190,240
+; ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+; db 240,240,240,240,240,240,064,063,240,240,240,240,240,240,240,034
+; ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+; db 085,086,084,094,083,128,106,108,091,240,240,240,240,163,169,240
+; ; à á â ã ä å æ ç è é ê ë ì í î ï
+; db 132,157,134,126,125,127,154,153,146,167,145,173,182,183,162,012
+; ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+; db 004,019,023,016,014,032,042,022,017,018,021,172,148,147,240,255
+;
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 852
+;
+; ---------------------------------------------------------------
+;
+Latin2_852_ucase label word
+ ctable <,'UCASE ',128>
+ ; x
+ db 080h,09Ah,090h,0B6h,08Eh,0DEh,08Fh,080h,09Dh,0D3h,08Ah,08Ah,0D7h,08Dh,08Eh,08Fh
+ ; x x x
+ db 090h,091h,092h,0E2h,099h,095h,05Fh,097h,097h,099h,09Ah,09Bh,09Bh,09Dh,09Eh,0ACh
+ db 0B5h,092h,0E0h,0E9h,0A4h,0A4h,0A6h,0A6h,0A8h,0A8h,0AAh,08Dh,0ACh,0B8h,0AEh,0AFh
+ db 0B0h,0B1h,0B2h,0B3h,0B4h,0B5h,0B6h,0B7h,0B8h,0B9h,0BAh,0BBh,0BCh,0BDh,0BDh,0BFh
+ db 0C0h,0C1h,0C2h,0C3h,0C4h,0C5h,0C6h,0C6h,0C8h,0C9h,0CAh,0CBh,0CCh,0CDh,0CEh,0CFh
+ db 0D1h,0D1h,0D2h,0D3h,0D2h,0D5h,0D6h,0D7h,0B7h,0D9h,0DAh,0DBh,0DCh,0DDh,0DEh,0DFh
+ db 0E0h,0E1h,0E2h,0E3h,0E3h,0D5h,0E6h,0E6h,0E8h,0E9h,0E8h,0EBh,0EDh,0EDh,0DDh,0EFh
+ db 0F0h,0F1h,0F2h,0F3h,0F4h,0F5h,0F6h,0F7h,0F8h,0F9h,0FAh,0EBh,0FCh,0FCh,0FEh,0FFh
+
+;
+; World Trade Mono Case Filename Character Tables
+;
+;
+; ----------------------------------------------------------------------------
+CP852_ucfile label word
+ ctable <,'FUCASE ',128>
+ ; View this table in CP852
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","¶","Ž","Þ","","€","","Ó","Š","Š","×","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","‘","â","™","•","•","—","—","™","š","›","›","","ž","¬"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "µ","Ö","à","é","¤","¤","¦","¦","¨","¨","ª","","¬","¸","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","½",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Æ",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ñ","Ñ","Ò","Ó","Ò","Õ","Ö","×","·",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ã","Õ","æ","æ","è","é","è","ë","í","í","Ý","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","ë","ü","ü",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls855.inc b/private/mvdm/dos/v86/dev/country/nls855.inc
new file mode 100644
index 000000000..baaf7c112
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls855.inc
@@ -0,0 +1,102 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 855
+;
+; -----------------------------------------
+;
+Russian_855_collate label word
+ ctable <,'COLLATE',256>
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,008,016,030,025,031,028,015,017,018,026,032,005,004,011,010
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 038,039,040,041,042,043,044,045,046,047,007,006,033,034,035,009
+ ; @ A B C D E F G H I J K L M N O
+ db 024,049,051,053,055,057,059,061,063,065,067,069,071,073,075,077
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 079,081,083,085,087,089,091,093,095,097,099,019,027,020,013,002
+ ; ` a b c d e f g h i j k l m n o
+ db 012,048,050,052,054,056,058,060,062,064,066,068,070,072,074,076
+ ; p q r s t u v w x y z { | } ~ 
+ db 078,080,082,084,086,088,090,092,094,096,098,021,036,022,014,172
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "H","H","G","G",134,134,135,135,"S","S",139,139,140,140,"J","J"
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "L","L","N","N","H","H","K","K",152,152,"C","C",163,163,161,161
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 128,128,129,129,155,155,132,132,133,133,153,153,131,131,061,062
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,154,154,138,138,185,186,187,188,141,141,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,142,142,200,201,202,203,204,205,206,"$"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 143,143,144,144,145,145,146,146,147,217,218,219,220,147,164,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 164,148,148,149,149,150,150,151,151,136,136,130,130,159,159,"#"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "-",160,160,137,137,157,157,162,162,158,158,156,156,253,254,255
+
+
+Cyrillic_855_collate label word
+ ctable <,'COLLATE',256>
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,008,016,030,025,031,028,015,017,018,026,032,005,004,011,010
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 038,039,040,041,042,043,044,045,046,047,007,006,033,034,035,009
+ ; @ A B C D E F G H I J K L M N O
+ db 024,049,051,053,055,057,059,061,063,065,067,069,071,073,075,077
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 079,081,083,085,087,089,091,093,095,097,099,019,027,020,013,002
+ ; ` a b c d e f g h i j k l m n o
+ db 012,048,050,052,054,056,058,060,062,064,066,068,070,072,074,076
+ ; p q r s t u v w x y z { | } ~ 
+ db 078,080,082,084,086,088,090,092,094,096,098,021,036,022,014,200
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 112,113,110,111,118,119,116,117,124,125,128,129,130,131,134,135
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 140,141,146,147,160,161,158,159,164,165,174,175,188,189,180,181
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 100,101,102,103,170,171,108,109,114,115,166,167,106,107,021,022
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 240,240,240,240,240,168,169,126,127,240,240,240,240,132,133,240
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 240,240,240,240,240,240,136,137,240,240,240,240,240,240,240,025
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 138,139,142,143,144,145,148,149,150,240,240,240,240,151,190,240
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 191,152,153,154,155,156,157,162,163,120,121,104,105,184,185,029
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 004,182,183,122,123,176,177,186,187,178,179,172,173,023,240,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 855
+;
+; ---------------------------------------------------------------
+;
+Cyrillic_855_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "","","ƒ","ƒ","…","…","‡","‡","‰","‰","‹","‹","","","",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "‘","‘","“","“","•","•","—","—","™","™","›","›","","","Ÿ","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "¡","¡","£","£","¥","¥","§","§","©","©","«","«","­","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"¶","¶","¸","¸",185,186,187,188,"¾","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Ç","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ñ","Ñ","Ó","Ó","Õ","Õ","×","×","Ý",217,218,219,220,"Ý","à",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","â","â","ä","ä","æ","æ","è","è","ê","ê","ì","ì","î","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ò","ò","ô","ô","ö","ö","ø","ø","ú","ú","ü","ü","ý",254,255
+
+
diff --git a/private/mvdm/dos/v86/dev/country/nls857.inc b/private/mvdm/dos/v86/dev/country/nls857.inc
new file mode 100644
index 000000000..48a9d1001
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls857.inc
@@ -0,0 +1,68 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 857
+;
+; -----------------------------------------
+;
+Turkish_857_collate label word
+ ctable <,'COLLATE',256>
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 000,009,023,045,039,046,044,022,026,027,042,047,006,005,014,013
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 060,064,066,068,070,071,072,073,074,075,008,007,051,052,053,011
+ ; @ A B C D E F G H I J K L M N O
+ db 036,077,094,096,100,102,112,114,118,120,132,134,136,138,140,144
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 159,161,163,165,170,172,182,184,186,188,191,028,043,029,017,002
+ ; ` a b c d e f g h i j k l m n o
+ db 016,076,093,095,099,101,111,113,117,121,131,133,135,137,139,143
+ ; p q r s t u v w x y z { | } ~ 
+ db 158,160,162,164,169,171,181,183,185,187,190,030,055,031,019,192
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 098,179,103,083,087,081,085,097,107,109,105,129,127,119,088,086
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 104,091,092,150,156,148,177,175,122,157,180,154,040,155,168,167
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 079,123,146,173,141,142,116,115,012,035,054,062,061,010,024,025
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 240,240,240,240,240,080,084,082,034,240,240,240,240,038,041,240
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 240,240,240,240,240,240,089,090,240,240,240,240,240,240,240,037
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 145,078,108,110,106,001,124,128,130,240,240,240,240,056,126,240
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 147,166,151,149,152,153,058,001,050,174,178,176,125,189,003,015
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 005,048,001,063,033,032,049,021,057,018,020,065,069,067,240,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings
+;
+; ---------------------------------------------------------------
+;
+Turkish_857_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","¶","Ž","·","","€","Ò","Ó","Ô","Ø","×","I","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","â","™","ã","ê","ë","˜","™","š","","œ","","ž","ž"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "µ","Ö","à","é","¥","¥","¦","¦","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Ç","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô"," ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","å","å","æ","ç","è","é","ê","ë","Þ","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
diff --git a/private/mvdm/dos/v86/dev/country/nls860.inc b/private/mvdm/dos/v86/dev/country/nls860.inc
new file mode 100644
index 000000000..66fd6fc7f
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls860.inc
@@ -0,0 +1,64 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 860
+;
+; -----------------------------------------
+;
+Portuguese_860_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,065,067,069,069,069,073,079,073,065,065
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,065,069,079,079,079,085,085,073,079,085,036,036,085,036,079
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,079,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 860
+;
+; ---------------------------------------------------------------
+;
+Portuguese_860_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","","Ž","‘","†","€","‰","‰","’","‹","Œ","˜","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","’","Œ","™","©","–","","˜","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "†","‹","Ÿ","–","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls861.inc b/private/mvdm/dos/v86/dev/country/nls861.inc
new file mode 100644
index 000000000..050e50140
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls861.inc
@@ -0,0 +1,64 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 861
+;
+; -----------------------------------------
+;
+Icelandic_861_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,'E',065,091,065,093,067,069,069,069,'D','D','[',091,093
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 'E','\','\',079,']','[',085,'Y','Y',']',089,092,036,092,036,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 'A','I','O','U','A','I','O','U',063,169,170,171,172,033,034,036
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 861
+;
+; ---------------------------------------------------------------
+;
+Icelandic_861_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","A","Ž","A","","€","E","E","E","‹","‹","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","O","™","","U","—","—","™","š","","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "¤","¥","¦","§","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls862.inc b/private/mvdm/dos/v86/dev/country/nls862.inc
new file mode 100644
index 000000000..1bb0f27b4
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls862.inc
@@ -0,0 +1,68 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 862
+;
+; -----------------------------------------
+;
+Hebrew_862_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 144,145,146,147,148,149,150,151,152,153,154,036,036,036,036,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,166,167,063,169,170,171,172,033,034,034
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 862
+;
+; ---------------------------------------------------------------
+;
+Hebrew_862_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","’","“","”","•","–","—","˜","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
diff --git a/private/mvdm/dos/v86/dev/country/nls863.inc b/private/mvdm/dos/v86/dev/country/nls863.inc
new file mode 100644
index 000000000..d173336df
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls863.inc
@@ -0,0 +1,64 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 863
+;
+; -----------------------------------------
+;
+FrnCdn_863_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,085,069,065,065,065,134,067,069,069,069,073,073,141,065,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,069,069,079,069,073,085,085,152,079,085,155,156,085,085,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 160,161,079,085,164,165,166,167,073,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 863
+;
+; ---------------------------------------------------------------
+;
+FrnCdn_863_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "C","U","E","A","A","A","†","C","E","E","E","I","I","","A",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "E","E","E","O","E","I","U","U","˜","O","U","›","œ","U","U","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db " ","¡","O","U","¤","¥","¦","§","I","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls864.inc b/private/mvdm/dos/v86/dev/country/nls864.inc
new file mode 100644
index 000000000..054e8e7c5
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls864.inc
@@ -0,0 +1,39 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 864
+;
+; -----------------------------------------
+;
+Arabic_864_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 144,145,146,147,148,149,150,151,152,233,234,251,255,235,236,179
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 153,154,182,155,156,184,253,254,188,189,192,194,163,196,198,200
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 164,165,166,167,168,169,170,171,172,173,224,174,206,208,210,175
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 157,180,181,183,185,217,186,187,190,191,193,195,197,199,201,202
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 203,204,205,207,209,211,213,214,215,218,222,158,159,160,161,216
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 178,225,227,229,237,239,241,243,245,246,250,212,219,221,220,238
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 177,176,240,242,244,247,249,223,226,231,232,230,228,248,162,255
diff --git a/private/mvdm/dos/v86/dev/country/nls865.inc b/private/mvdm/dos/v86/dev/country/nls865.inc
new file mode 100644
index 000000000..0d6de5820
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls865.inc
@@ -0,0 +1,102 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 865
+;
+; -----------------------------------------
+;
+Danish_865_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,040,047,041,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,091,065,093,067,069,069,069,073,073,073,091,093
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,091,091,079,092,079,085,085,089,092,089,092,036,092,036,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,065,079,063,169,170,171,172,033,034,036
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+Norwegian_865_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 032,033,034,035,036,037,038,039,040,041,042,043,044,045,046,047
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 048,049,050,051,052,053,054,055,056,057,058,059,060,061,062,063
+ ; @ A B C D E F G H I J K L M N O
+ db 064,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 080,081,082,083,084,085,086,087,088,089,090,091,092,093,094,095
+ ; ` a b c d e f g h i j k l m n o
+ db 096,065,066,067,068,069,070,071,072,073,074,075,076,077,078,079
+ ; p q r s t u v w x y z { | } ~ 
+ db 080,081,082,083,084,085,086,087,088,089,090,123,124,125,126,127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 067,089,069,065,091,065,093,067,069,069,069,073,073,073,091,093
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 069,091,091,079,092,079,085,085,089,092,089,092,036,092,036,036
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 065,073,079,085,078,078,065,079,063,169,170,171,172,033,034,036
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,083,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 865
+;
+; ---------------------------------------------------------------
+;
+Nordic_865_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","š","","A","Ž","A","","€","E","E","E","I","I","I","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","’","’","O","™","O","U","U","Y","™","š","","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "A","I","O","U","¥","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
+
+
diff --git a/private/mvdm/dos/v86/dev/country/nls866.inc b/private/mvdm/dos/v86/dev/country/nls866.inc
new file mode 100644
index 000000000..a3d94eb9e
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls866.inc
@@ -0,0 +1,103 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 866
+;
+; -----------------------------------------
+;
+Russian_866_collate label word
+ ctable <,'COLLATE',256>
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ db 254,254,254,254,254,254,254,254,254,254,254,254,254,254,254,254
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,008,016,030,025,031,028,015,017,018,026,032,005,004,011,010
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 038,039,040,041,042,043,044,045,046,047,007,006,033,034,035,009
+ ; @ A B C D E F G H I J K L M N O
+ db 024,049,051,053,055,057,059,061,063,065,067,069,071,073,075,077
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 079,081,083,085,087,089,091,093,095,097,099,019,027,020,013,002
+ ; ` a b c d e f g h i j k l m n o
+ db 012,048,050,052,054,056,058,060,062,064,066,068,070,072,074,076
+ ; p q r s t u v w x y z { | } ~ 
+ db 078,080,082,084,086,088,090,092,094,096,098,021,036,022,014,172
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 101,103,105,107,109,111,115,117,119,121,123,125,127,129,131,133
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 135,137,139,141,143,145,147,149,151,153,155,157,159,161,163,165
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 100,102,104,106,108,110,114,116,118,120,122,124,126,128,130,132
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 240,240,240,240,240,240,240,240,240,240,240,240,240,240,240,240
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 134,136,138,140,142,144,146,148,150,152,154,156,158,160,162,164
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 113,112,167,166,169,168,171,170,037,037,037,173,029,025,240,255
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 866
+;
+; ---------------------------------------------------------------
+;
+Russian_866_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","’","“","”","•","–","—","˜","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "€","","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "","‘","’","“","”","•","–","—","˜","™","š","›","œ","","ž","Ÿ"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ð","ò","ò","ô","ô","ö","ö","ø","ù","ú","û","ü","ý",254,255
+
+
+ru866_lcase label word
+ ctable <,'LCASE ',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 " ","¡","¢","£","¤","¥","¦","§" ; 80..87
+ db "¨","©","ª","«","¬","­","®","¯" ; 88..8f
+ db "à","á","â","ã","ä","å","æ","ç" ; 90..97
+ db "è","é","ê","ë","ì","í","î","ï" ; 98..9f
+ db " ","¡","¢","£","¤","¥","¦","§" ; a0..a7
+ db "¨","©","ª","«","¬","­",'®','¯' ; a8..af
+ db 176,177,178,179,180,"µ","¶","·" ; b0..b7
+ db "¸",185,186,187,188,"½","¾",191 ; b8..bf
+ db 192,193,194,195,196,197,"Æ","Ç" ; c0..c7
+ db 200,201,202,203,204,205,206,"Ï" ; c8..cf
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×" ; d0..d7
+ db "Ø",217,218,219,220,"Ý","Þ",223 ; d8..df
+ db "à","á","â","ã","ä","å","æ","ç" ; e0..e7
+ db "è","é","ê","ë","ì","í","î","ï" ; e8..ef
+ db "ñ","ñ","ó","ó","õ","õ","÷","÷" ; f0..f7
+ db "ø","ù","ú","û","ü","ý",254,255 ; f8..ff
+
diff --git a/private/mvdm/dos/v86/dev/country/nls869.inc b/private/mvdm/dos/v86/dev/country/nls869.inc
new file mode 100644
index 000000000..825fcfe8d
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls869.inc
@@ -0,0 +1,66 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 869
+;
+; -----------------------------------------
+;
+Greek_869_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db 001,015,044,084,072,085,082,043,050,052,079,089,010,009,022,021
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db 112,114,115,117,119,120,121,123,124,125,014,012,097,100,103,018
+ ; @ A B C D E F G H I J K L M N O
+ db 069,196,198,200,202,204,206,208,210,212,214,216,218,220,222,224
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db 226,228,230,232,234,236,238,240,242,244,246,054,081,055,027,003
+ ; ` a b c d e f g h i j k l m n o
+ db 042,197,199,201,203,205,207,209,211,213,215,217,219,221,223,225
+ ; p q r s t u v w x y z { | } ~ 
+ db 227,229,231,233,235,237,239,241,243,245,247,056,105,057,033,063
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 111,111,111,111,111,111,128,111,036,104,106,042,043,139,009,145
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 151,153,168,111,111,181,183,066,194,117,119,130,076,140,146,152
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 154,155,169,182,126,131,133,135,137,141,143,114,147,149,048,049
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 110,110,110,110,110,156,158,160,162,110,110,110,110,164,166,110
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 110,110,110,110,110,110,170,172,110,110,110,110,110,110,100,174
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 177,179,186,188,190,190,127,132,134,110,110,110,110,136,138,110
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 142,144,148,150,157,159,161,163,165,167,171,173,175,176,178,024
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 007,091,180,187,189,064,181,029,045,030,193,184,185,195,110,112
+
+
+;
+; ---------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Page 869
+;
+; ---------------------------------------------------------------
+;
+Greek_869_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","","‚","ƒ"," ","‡","†"," ","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","‘","“","”","•","–","—","˜","™","š","†","œ","","",""
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db "‘","‘","’","•","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","¤","¥","¦",217,218,219,220,"§","¨",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "©","«","¬","­","µ","¶","·","¸","½","¾","Æ","Ç","Ï","Ï","Ð","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","Ñ","Ò","Ó","õ","Ô","÷","ø","ù","Õ","–","–","˜",254,255
diff --git a/private/mvdm/dos/v86/dev/country/nls93x.inc b/private/mvdm/dos/v86/dev/country/nls93x.inc
new file mode 100644
index 000000000..c6eab845e
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/country/nls93x.inc
@@ -0,0 +1,149 @@
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 932
+;
+; -----------------------------------------
+;
+Japan_932_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db " ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/"
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?"
+ ; @ A B C D E F G H I J K L M N O
+ db "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_"
+ ; ` a b c d e f g h i j k l m n o
+ db "`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; p q r s t u v w x y z { | } ~ 
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 129,130,131,132,133,189,134,135,136,137,138,139,140,141,142,143
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,190,191,192
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+;
+; -----------------------------------------
+;
+; Collating Table(s) for Code Page 949
+;
+; -----------------------------------------
+;
+Korea_949_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db " ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/"
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?"
+ ; @ A B C D E F G H I J K L M N O
+ db "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_"
+ ; ` a b c d e f g h i j k l m n o
+ db "`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; p q r s t u v w x y z { | } ~ 
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 177,178,179,180,181,182,183,184,185,186,187,188,189,253,254,255
+
+
+;
+; -----------------------------------------------
+;
+; Collating Table(s) for Code Pages 936 & 938
+;
+; -----------------------------------------------
+;
+PRC_936_collate label word
+Taiwan_938_collate label word
+ ctable <,'COLLATE',256>
+ db 000,001,002,003,004,005,006,007,008,009,010,011,012,013,014,015
+ db 016,017,018,019,020,021,022,023,024,025,026,027,028,029,030,031
+ ; ! " # $ % & ' ( ) * + , - . /
+ db " ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/"
+ ; 0 1 2 3 4 5 6 7 8 9 : ; < = > ?
+ db "0","1","2","3","4","5","6","7","8","9",":",";","<","=",">","?"
+ ; @ A B C D E F G H I J K L M N O
+ db "@","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; P Q R S T U V W X Y Z [ \ ] ^ _
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","[","\","]","^","_"
+ ; ` a b c d e f g h i j k l m n o
+ db "`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O"
+ ; p q r s t u v w x y z { | } ~ 
+ db "P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",127
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db 128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db 144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db 160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db 208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db 224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db 240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255
+
+
+;
+; --------------------------------------------------------------------
+;
+; World Trade Case Mappings for Code Pages 932, 949, 936, and 938
+;
+; --------------------------------------------------------------------
+;
+DBCS_93x_ucase label word
+ ctable <,'UCASE ',128>
+ ; € ‚ ƒ „ … † ‡ ˆ ‰ Š ‹ Œ Ž
+ db "€","","‚","ƒ","„","…","†","‡","ˆ","‰","Š","‹","Œ","","Ž",""
+ ; ‘ ’ “ ” • – — ˜ ™ š › œ ž Ÿ
+ db "","‘","’","“","”","•","–","—","˜","™","š","›","œ","","ž","Ÿ"
+ ;   ¡ ¢ £ ¤ ¥ ¦ § ¨ © ª « ¬ ­ ® ¯
+ db " ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯"
+ ; ° ± ² ³ ´ µ ¶ · ¸ ¹ º » ¼ ½ ¾ ¿
+ db 176,177,178,179,180,"µ","¶","·","¸",185,186,187,188,"½","¾",191
+ ; À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï
+ db 192,193,194,195,196,197,"Æ","Ç",200,201,202,203,204,205,206,"Ï"
+ ; Ð Ñ Ò Ó Ô Õ Ö × Ø Ù Ú Û Ü Ý Þ ß
+ db "Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø",217,218,219,220,"Ý","Þ",223
+ ; à á â ã ä å æ ç è é ê ë ì í î ï
+ db "à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï"
+ ; ð ñ ò ó ô õ ö ÷ ø ù ú û ü ý þ ÿ
+ db "ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý",254,255
diff --git a/private/mvdm/dos/v86/dev/himem/himem.asm b/private/mvdm/dos/v86/dev/himem/himem.asm
new file mode 100644
index 000000000..298b68eba
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem.asm
@@ -0,0 +1,1537 @@
+;/* himem.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; *
+; * williamh 25-Sept-1992 Added RequestUMB and ReleaseUMB
+; */
+
+
+ page 95,160
+ title 'HIMEM.SYS - Microsoft XMS Device Driver'
+;*****************************************************************************
+;* *
+;* HIMEM.ASM - *
+;* *
+;* Extended Memory Specification Driver - *
+;* *
+;*****************************************************************************
+;
+; himem.inc - global equates, macros, structures, opening segment
+; himem.asm - main driver entry, interrupt hooks, a20/HMA functions
+; himem1.asm - a20 switching code
+; himem2.asm - driver initialization
+; himem3.asm - messages for driver initialization
+; himem4.asm - extended memory allocation functions
+; himem5.asm - memory move function
+;
+; for revision history prior to 1990, see version 2.37 or earlier
+;
+; 2.35 - Removed a few push/pops from IsA20On, misc 01/14/90
+; source code reformatting
+; 2.36 - Include Int 6Dh vector in shadow RAM disable 01/18/90
+; check, also allow disable if video Ints already
+; point at C000h segment. Also added some CLD's near
+; string instructions.
+; 2.37 - Removed 2.33 'fix' for All Chargecard. They 01/23/89
+; now do Global and Local enables to turn on A20, and
+; the previous 'fix' caused us to never didle A20 again
+; after running Windows real mode twice (Windows does
+; Global enables/disables too). Also, GetParms needed to
+; check for LF in addition to CR for end of line.
+;;
+;;; Following changes synced from \402\dev\himem tree
+;;
+; 2.50 - Revised version # for Windows 3.0 release. 02/05/90
+; "" - Ignore 'super'-extended memory on EISA memory 02/08/90
+; memory boards (mem > 16 meg). Software that
+; uses 24 bit (80286) descriptors doesn't do
+; well with memory @ 16 meg.
+; "" - Himem will now try to control A20 by default, 02/12/90
+; even if A20 is already enabled when himem is
+; loaded. Added /A20CONTROL: ON | OFF switch to
+; override this if necessary (ON is default and
+; means we take control, OFF means we take control
+; unless A20 was already on, in which case we
+; don't mess with it).
+;
+; 2.60 - Added special A20 routine for Toshiba 1600 02/22/90
+; laptop, and revised driver version number to
+; be later than Compaq's (2.50) so Windows
+; setup will install ours.
+; "" - Clear bit 15 in device attributes word of 02/28/90
+; device header if driver is being flushed. The
+; MS-DOS Encylopedia says to do this, and a
+; system with DOS 3.21 was hanging when loading
+; the driver after himem if himem flushed itself.
+; "" - Added special A20 handler for Wyse 12.5 MHz 03/27/90
+; 286 machine. Almost the same as AT, but
+; a little different.
+; "" - Now displays a msg indicating which A20 04/05/90
+; handler is installed, and allows numbers for the
+; /MACHINE: parameter.
+;;
+;;; End of \402\dev\himem changes
+;;
+;
+; "" - Added /INT15=xxxx option to reserve xxxxK of 04/13/90
+; extended memory for INT 15. Himem will reserve xxxx K
+; (64 K of HMA inclusive) for apps which use Ext Mem thru
+; int 15 interface. The HMA portion of the INT 15 ext memory
+; should be protected by a VDISK header. Apps which
+; do not recognize VDISK headers may destroy the HMA.
+;
+; "" - When there is a /INT15=xxxx option on the 04/20/90
+; command line, the HMA is made unavailable to the
+; apps. But DOS 5.0 goes ahead and checks for INT 15
+; memory if the alloc HMA call fails. And if INT 15 memory
+; is present it uses the first 64 K for loading itself
+; high (simulated HMA)
+;
+; "" - ORGed the movable segment to high value for flexibility
+; in loading into HMA. Added code to be flexible enough to
+; run from HMA as well as low memory.
+
+ public Interrupt
+ public dd_int_loc
+ public fHMAExists
+ public PrevInt15
+ public fA20Check
+ public OldStackSeg
+ public pPPFIRET
+ public EnableCount
+ public pReqHdr
+ public MinHMASize
+ public Int2fHandler
+ public fHMAMayExist
+ public MemCorr
+ public PrevInt2f
+ public MoveIt
+ public fCanChangeA20
+ public IsVDISKIn
+ public fVDISK
+
+ public LocalEnableA20
+ public LocalDisableA20
+ public FLclEnblA20
+ public FLclDsblA20
+ public xLocalEnableA20
+ public xLocalDisableA20
+ public IsA20On
+ public winbug_fix
+ public ATA20Delay
+ public AddMem
+
+ public TopOfTextSeg
+ public A20State
+
+ public Int15Handler
+
+; Define a direct call to the Phoenix Cascade BIOS for A20 handling
+; Note: if these segments are not defined here, the Int13Handler
+; definition in segment Zero in the 386 memory move will generate
+; bad code.
+
+PTL_Seg segment at 0f000h
+PTL_Seg ends
+BiosSeg SEGMENT AT 40h ; Used to locate 6300 PLUS reset address
+BiosSeg ends
+
+ include himem.inc ; define structures, macros, open seg.
+ include xmssvc.inc
+ include vint.inc
+ extrn EndText:byte
+_text ends
+
+funky segment para public 'funky'
+ assume cs:funky
+
+; externals from himem4
+
+ extrn Version:near
+ extrn MoveBlock:near
+ extrn QueryExtMemory:near
+ extrn AllocExtMemory:near
+ extrn FreeExtMemory:near
+ extrn LockExtMemory:near
+ extrn UnlockExtMemory:near
+ extrn GetExtMemoryInfo:near
+ extrn ReallocExtMemory:near
+ extrn RequestUMB:near
+ extrn ReleaseUMB:near
+ extrn cHandles:word
+ extrn KiddValley:word
+
+; externals from himem5
+
+
+funky ends
+
+;
+;------ the following segment should be the last in the sys file
+; This segment is read by the stripdd utility to remove
+; the zeroes introduced by the hi ORG in the movable segment
+
+ZZZ segment para 'ZZZ'
+ dw 16 ; len of this segment
+ dw offset _text:EndText ; len of text seg in double word
+ dw 0
+ dw HISEG_ORG ; number of zeroes to be stripped
+ dw -1
+ dw -1 ; terminator
+ db (4) dup (55h) ; filler
+ZZZ ends
+
+
+_text segment word public 'code'
+ assume cs:_text
+
+; externals from himem1
+
+ extrn A20Handler:near
+
+; externals from himem2
+
+ extrn InitInterrupt:near
+
+ public DevAttr
+ public Int15MemSize
+ public fInHMA
+
+; The Driver Header definition.
+Header dd -1 ; Link to next driver, -1 = end of list
+DevAttr dw 1010000000000000b ; Char device & Output until busy(?)
+ dw Strategy ; "Stategy" entry point
+dd_int_loc dw InitInterrupt ; "Interrupt" entry point
+ db 'XMSXXXX0' ; Device name
+
+
+;************************************************************************
+;* *
+;* Global Variables *
+;* *
+;************************************************************************
+
+
+ if keep_cs
+callers_cs dw 0
+ endif
+
+TopOfTextSeg dw 0 ; size of retained driver
+pPPFIRet dw PPFIRet ; The offset of an IRET for the POPFF macro
+pReqHdr dd ? ; Pointer to MSDOS Request Header structure
+pInt15Vector dw 15h*4,0 ; Pointer to the INT 15 Vector
+PrevInt15 dd 0 ; Original INT 15 Vector
+PrevInt2f dd 0 ; Original INT 2f Vector
+fHMAInUse db 0 ; High Memory Control Flag, != 0 -> In Use
+fCanChangeA20 db 1 ; A20 Enabled at start? (assume changable)
+fHMAMayExist db 0 ; True if the HMA could exist at init time
+fHMAExists db 0 ; True if the HMA exists
+fInstalled db 0 ; True if ext mem has been allocated
+fInHMA db 0 ; true if hiseg is in HMA
+
+fVDISK db 0 ; True if a VDISK device was found
+
+fA20Check db 0 ; True if A20 handler supports On/Off check
+ATA20Delay db 0 ; Type of AT A20 delay in use (0 - NUM_ALT_A20)
+EnableCount dw 0 ; A20 Enable/Disable counter
+fGlobalEnable dw 0 ; Global A20 Enable/Disable flag
+MinHMASize dw 0 ; /HMAMIN= parameter value
+Int15MemSize dw 0 ; Memory size reserved for INT 15
+
+MemCorr dw 0 ; KB of memory at FA0000 on AT&T 6300 Plus.
+ ; This is used to correct INT 15h,
+ ; Function 88h return value.
+OldStackSeg dw 0 ; Stack segment save area for 6300 Plus.
+ ; Needed during processor reset.
+
+ if NUM_A20_RETRIES
+A20Retries db 0 ; Count of retires remaining on A20 diddling
+ endif
+
+A20State db 0 ; recored the current A20 state
+ public lpExtA20Handler
+
+lpExtA20Handler dd 0 ; Far entry point to an external A20 handler
+
+;*----------------------------------------------------------------------*
+;* *
+;* Strategy - *
+;* *
+;* Called by MS-DOS when ever the driver is accessed. *
+;* *
+;* ARGS: ES:BX = Address of Request Header *
+;* RETS: Nothing *
+;* REGS: Preserved *
+;* *
+;*----------------------------------------------------------------------*
+
+Strategy proc far
+ assume ds:nothing
+
+ ; Save the address of the request header.
+ mov word ptr [pReqHdr],bx
+ mov word ptr [pReqHdr][2],es
+ ret
+
+Strategy endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* Interrupt - *
+;* *
+;* Called by MS-DOS immediately after Strategy routine *
+;* *
+;* ARGS: None *
+;* RETS: Return code in Request Header's Status field *
+;* REGS: Preserved *
+;* *
+;* This is our permanent entry point. By this time, the only *
+;* useful function done by the device driver (initializing us) *
+;* has been done by a previous call. There are no more valid *
+;* uses for this entry point. All we have to do is decide *
+;* whether to ignore the call or generate an error. *
+;* *
+;*----------------------------------------------------------------------*
+
+Interrupt proc far
+ assume ds:nothing
+
+
+ push bx ; save minimal register set
+ push ds
+
+ lds bx,[pReqHdr] ; ds:bx = Request Header
+
+ cmp ds:[bx].Command,16 ; legal DOS function? (approx???)
+ mov ds:[bx].Status,100h ; "Done" for healthy calls
+ jbe FuncOk
+ or ds:[bx].Status,8003h ; Return "Unknown Command" error
+FuncOk:
+ pop ds
+ pop bx
+ ret
+
+Interrupt endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* Int2fHandler - *
+;* *
+;* Hooks Function 43h, Subfunction 10h to return the *
+;* address of the High Memory Manager Control function. *
+;* Also returns 80h if Function 43h, Subfunction 0h is requested. *
+;* *
+;* ARGS: AH = Function, AL = Subfunction *
+;* RETS: ES:BX = Address of XMMControl function (if AX=4310h) *
+;* AL = 80h (if AX=4300) *
+;* REGS: Preserved except for ES:BX (if AX=4310h) *
+;* Preserved except for AL (if AX=4300h) *
+;* *
+;*----------------------------------------------------------------------*
+
+Int2fHandler proc far
+ assume ds:nothing
+
+ call DOSTI ; Flush any queued interrupts
+
+ cmp ah,43h ; Function 43h?
+ jne I2fNextInt
+ or al,al ; Subfunction 0?
+ jne I2fNextSub ; No, continue
+
+ mov al,80h ; Return 80h in AL (XMS Installed)
+PPFIRet:
+ jmp DOIRET ; Label sets up the POPFF macro
+
+I2fNextSub:
+ cmp al,10h ; Subfunction 10?
+ jne I2fNextInt ; No, goto next handler
+
+ push cs ; return XMS entry in es:bx
+ pop es
+ mov bx,offset XMMControl
+ jmp DOIRET
+
+; Continue down the Int 2f chain.
+
+I2fNextInt:
+ call DOCLI ; Disable interrupts again
+ jmp [PrevInt2f]
+
+Int2fHandler endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* ControlJumpTable - *
+;* *
+;* Contains the address for each of the XMS Functions. *
+;* *
+;* **************** WARNING ********************** *
+;* *
+;* Assumes that offsets of functions in lo mem seg are < 8000h *
+;* & that offsets of segment in Hiseg are >= 8000h *
+;* *
+;*----------------------------------------------------------------------*
+
+ControlJumpTable label word
+ dw Version ; Function 00h
+ dw RequestHMA ; Function 01h
+ dw ReleaseHMA ; Function 02h
+ dw GlobalEnableA20 ; Function 03h
+ dw GlobalDisableA20 ; Function 04h
+xLocalEnableA20 dw LocalEnableA20 ; Function 05h
+xLocalDisableA20 dw LocalDisableA20 ; Function 06h
+ dw IsA20On ; Function 07h
+ dw QueryExtMemory ; Function 08h
+ dw AllocExtMemory ; Function 09h
+ dw FreeExtMemory ; Function 0Ah
+MoveIt dw MoveBlock ; Function 0Bh
+ dw LockExtMemory ; Function 0Ch
+ dw UnlockExtMemory ; Function 0Dh
+ dw GetExtMemoryInfo ; Function 0Eh
+ dw ReallocExtMemory ; Function 0Fh
+ dw RequestUMB ; Function 10h
+ dw ReleaseUMB ; Function 11h
+NumFns = ((offset $) - (offset ControlJumpTable))/2
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* XMMControl - *
+;* *
+;* Main Entry point for the Extended Memory Manager *
+;* *
+;* ARGS: AH = Function, AL = Optional parm *
+;* RETS: AX = Function Success Code, BL = Optional Error Code *
+;* REGS: AX, BX, DX and ES may not be preserved depending on func. *
+;* *
+;* INTERNALLY REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+
+XMMControl proc far
+
+ jmp short XCControlEntry ; For "hookability"
+ nop ; NOTE: The jump must be a
+ nop ; short jump to indicate
+ nop ; the end of any hook chain.
+ ; The nop's allow a far jump
+ ; to be patched in.
+XCControlEntry:
+
+if keep_cs ;--------------------------------------------------------
+ push bp
+ mov bp,sp
+ mov bp,4[bp] ; get caller's cs
+ mov callers_cs,bp ; (debug only)
+ pop bp
+endif ;--------------------------------------------------------
+
+ push cx ; preserve some registers
+ push si
+ push di
+ push ds
+ push es
+ pushf
+ cld
+
+ push ds ; save ds in es
+ pop es ; NOTE: ES cannot be used for parms!
+
+ push cs ; ds=cs
+ pop ds
+ assume ds:_text
+
+ push ax ; save the function number
+
+if debug_vers
+ call debug_dump
+endif
+
+ or ah,ah ; GetXMSVersion?
+ jz XCCallFunc ; Yes, don't hook INT 15h yet
+
+ cmp ah,NumFns ; valid function number??
+ jb XCCheckHook
+ pop ax ; No, Un-preserve AX and return an error
+ xor ax,ax
+ mov bl,ERR_NOTIMPLEMENTED
+ jmp short XCExit
+
+XCCheckHook:
+ pushf ; Is INT 15h already hooked?
+ call DOCLI ; This is a critical section
+
+ cmp word ptr [PrevInt15][2],0 ; Is the segment non-zero?
+ jne XCCheckVD
+
+ push dx ; save callers DX
+ call HookInt15 ; claim all remaining ext mem
+ pop dx
+
+XCCheckVD:
+ popff ; End of critical section
+
+ cmp [fVDISK],0 ; was VDISK found?
+ je XCCallFunc
+ pop ax ; Yes, Un-preserve AX and return error
+ xor ax,ax
+ mov bl,ERR_VDISKFOUND
+ xor dx,dx
+ jmp short XCExit
+
+; Call the appropriate API function.
+
+
+XCCallFunc:
+ pop ax ; Restore AX
+ push ax ; save ax so functions get both ah & al
+ mov al,ah
+ xor ah,ah
+ shl ax,1
+ mov di,ax ; NOTE: DI cannot be used for parms!
+ pop ax ; restore callers ax for function
+
+ mov di,ControlJumpTable[di] ; get function address
+ or di,di
+ jns CallLowSegFn ; brif it's in the low segment
+
+ cmp fInHMA, 0 ; is the hiseg in HMA ?
+ jz InLoMem
+;
+;------ Turn on the A20 line if it is off
+;
+ push si
+ push di
+ push ax
+ push bx
+ push cx
+ call LocalEnableA20 ; Note: This is always necessary
+ cmp ax, 1
+ pop cx ; for the Memory Move function. In
+ pop bx ; the case where this driver loads
+ pop ax ; high, it is necessary for all calls
+ pop di ; to the high segment.
+ pop si
+ jne a20_error
+InLoMem:
+ push cs ; set up far return
+ call call_hi_in_di ; and call the function
+
+ cmp fInHMA, 0 ; is the hiseg in HMA ?
+ jz XCExit
+
+ push ax ; save the registers which may be
+ push bx ; returning values
+ call LocalDisableA20 ; and restore a20
+ cmp ax, 1
+ pop bx
+ pop ax
+
+ je short XCExit
+
+a20_error:
+ xor ax, ax
+ xor dx, dx
+ mov bl, ERR_A20
+ jmp short XCExit
+
+CallLowSegFn:
+ call di ; call routine in this segment
+
+XCExit:
+; if debug_vers or tdump ;------------------------------------
+; pusha
+; call dump_tables
+; popa
+; endif ;------------------------------------------------------
+
+ popff ; NOTE: Flags must be restored
+ pop es ; immedately after call API functions.
+ pop ds
+ pop di
+ pop si
+ pop cx
+
+; if debug_vers ;---------------------------------------------------
+; pushf
+; pusha
+; mov al,'.'
+; call cofa
+; mov al,cs:byte ptr fun_number
+; sub al,0bh ; don't get key on 0bh, 0ch or 0dh
+; cmp al,2
+; jbe no_keywait
+; mov ah,1 ; wait for console key now!!!!!!
+;; int 21h
+;no_keywait:
+; popa
+; popf
+; endif ;------------------------------------------------------
+
+ ret
+
+XMMControl endp
+
+ if tdump or debug_vers ;------------------------------------
+
+fun_number db 0 ; function number for debug info
+
+dump_tables:
+ if not tdump
+ cmp fun_number,9 ; only display on allocate calls
+ jnz dd_done ; unless full tdump is enabled
+ endif
+ mov dx,offset heading
+ mov ah,9
+ int 21h
+
+ push es
+ mov es,hiseg
+ assume es:funky
+ mov si,[KiddValley]
+ mov cx,[cHandles]
+ mov bx,SIZE Handle
+
+xlup:
+ mov al,[si].Flags ; get flags
+ cmp al,4 ; don't show UNUSED entries
+ jz x_entry_done
+
+ mov dx,offset msg_FREE
+ cmp al,1 ; free?
+ jz x_showflags
+ mov dx,offset msg_USED
+ cmp al,2 ; used?
+ jz x_showflags
+ mov dx,offset msg_BAD
+x_showflags:
+ mov ah,9
+ int 21h
+
+ mov al,[si].cLock ; get lock count
+ call hex_byte
+ call space
+
+ mov ax,[si].Base ; get base
+ call hex_word
+ call space
+
+ mov ax,[si].Len ; get length
+ call hex_word
+
+ if keep_cs
+ call space
+ mov ax,[si].Acs ; get the allocator's cs:
+ call hex_word
+ endif
+
+x_newline:
+ mov al,13
+ call cofa
+ mov al,10
+ call cofa
+
+x_entry_done:
+ add si,bx
+ loop xlup
+
+ pop es
+ assume es:nothing
+ mov dx,offset donemsg
+ mov ah,9
+ int 21h
+dd_done:
+ ret
+
+
+heading db 'Flags Lock Base Len CS:',13,10,'$'
+msg_FREE db 'FREE $'
+msg_USED db 'USED $'
+msg_BAD db 'BAD $'
+donemsg db 'End of XMS table$'
+
+ endif
+
+ if debug_vers
+
+
+debug_dump proc near
+ pusha
+ mov fun_number,ah ; save (non-reentrantly!) function number
+; ; so that we can display different debug
+; ; information on exit depending on which
+; ; function we've been doing
+ mov al,ah ; just display function number
+ call hex_nib
+ popa
+ ret
+
+ if 0 ; enable this if you want to see the
+; ; command block for memory moves
+ cmp ah,0bh ; memory move?
+ jnz debug_dump_done ; done if not
+ pusha
+ call crlf
+ mov ax,es:2[si] ; get count-hi
+ call hex_word
+ mov ax,es:[si] ; get count-low
+ call hex_word
+ add si,4 ; point to source address field
+
+ mov cx,2 ; now display two handle/addresses
+dd1:
+ call space
+ lods es:word ptr [si] ; get a handle
+ call hex_word
+ mov al,'-'
+ call cofa
+ mov ax,es:2[si] ; get high address
+ call hex_word
+ mov al,':'
+ call cofa
+ lods es:word ptr [si] ; get low address
+ call hex_word
+ add si,2 ; skip to next entry for loop
+ loop dd1
+ popa
+debug_dump_done:
+ endif
+ ret
+debug_dump endp
+
+ endif
+
+ if debug_vers or tdump
+
+hex_word:
+ push ax
+ mov al,ah
+ call hex_byte
+ pop ax
+hex_byte:
+ push ax
+ shr ax,4 ; XMS present implies '286 or better
+ call hex_nib
+ pop ax
+hex_nib:
+ and al,0fh
+ add al,90h
+ daa
+ adc al,3ah
+ daa
+cofa:
+; mov dl,al
+; mov ah,2
+; int 21h
+ mov ah,0eh
+ mov bx,7
+ int 10h
+ ret
+
+space:
+ mov al,' '
+ jmp cofa
+
+crlf:
+ mov al,13
+ call cofa
+ mov al,10
+ jmp cofa
+
+ endif ;------------------------------------------------------
+
+; little utility stub for calling routine in the other segment.
+; called with the branch offset address in di
+; a far return address is already on the stack. Now branch to
+; hiseg:(di)
+
+ public hiseg ; allow initialization code to relocate hiseg
+hiseg dw funky
+
+ public call_hi_in_di
+call_hi_in_di proc near
+ push hiseg
+ push di
+call_hi_in_di endp
+call_hi_far proc far
+ ret
+call_hi_far endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* HookInt15 - *
+;* *
+;* Insert the INT 15 hook *
+;* *
+;* ARGS: None *
+;* RETS: None *
+;* REGS: AX, BX, CX, DX, DI, SI, and Flags are clobbered *
+;* *
+;* EXTERNALLY NON-REENTRANT *
+;* Interrupts must be disabled before calling this function. *
+;* *
+;*----------------------------------------------------------------------*
+
+
+HookInt15 proc near
+
+ push es
+
+ call IsVDISKIn ; has a VDISK been installed?
+ cmp [fVDISK],0
+ je HINoVD ; No, continue
+ pop es ; Yes, return without hooking
+ ret
+
+HINoVD: ; notify softpc of hooking I15
+ mov ax,offset Int15Handler ; args: cs:di new I15 vector
+ XMSSVC XMS_NOTIFYHOOKI15 ; returns CX=ExtMem in K
+
+; Save the curr INT 15 vector, and put ours in the IVT
+
+ les si,dword ptr pInt15Vector
+ xchg ax,es:[si][0]
+ mov word ptr [PrevInt15][0],ax
+ mov ax,cs
+ xchg ax,es:[si][2]
+ mov word ptr [PrevInt15][2],ax
+
+ mov ax, cx
+ cmp ax,15*1024 ; Limit himem.sys to using 15 meg
+ jb @f ; of extended memory for apps
+ mov ax,15*1024 ; that don't deal with > 24 bit
+@@: ; addresses
+
+ sub ax,[MemCorr] ; 6300 Plus may have memory at FA0000h
+ cmp ax,64
+ jb HIInitMemory ; Less than 64K free? Then no HMA.
+ cmp Int15MemSize, 0 ; are we supporting int 15 memory
+ jnz HIInitMemory ; then we dont support HMA
+ mov [fHMAExists],1
+
+HIInitMemory:
+
+; Init the first handle to be one huge free block.
+
+ or ax, ax ; don't do it if no Int 15 memory avail
+ jz HISkipInit
+
+ mov cx,1024 ; base is just above 1 meg
+
+ xor bx, bx ; assume no HMA
+
+ cmp [fHMAExists],0 ; Reserve room for HMA if it exists
+ je @f
+ mov bx, 64
+@@: cmp bx, Int15MemSize
+ jae @f
+ mov bx, Int15MemSize
+@@: add cx,bx
+ sub ax,bx
+ call AddMem ; add that to memory table
+
+HISkipInit:
+
+ pop es
+ ret
+
+HookInt15 endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* IsVDISKIn - *
+;* *
+;* Looks for drivers which use the IBM VDISK method of allocating *
+;* Extended Memory. XMS is incompatible with the VDISK method. It is *
+;* necessary to check two different locations since some programs only *
+;* one or the other, although they should do both. *
+;* *
+;* ARGS: None *
+;* RETS: None. Sets "fVDISK" accordingly *
+;* REGS: AX, BX, CX, SI, DI and Flags are clobbered *
+;* *
+;* INTERNALLY REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+pVDISK label dword
+ dw 00013h
+ dw 0FFFFh
+
+szVDISK db 'VDISK'
+
+IsVDISKIn proc near
+
+; Look for "VDISK" signature at offset 12h in Int 19h segment
+
+ push es
+
+ xor ax,ax
+ mov es,ax
+ mov es,es:[(19h * 4)+2]
+ mov di,12h
+ mov si,offset szVDISK
+ mov cx,5
+ cld
+ repz cmpsb
+
+ pop es
+
+ jz IVIFoundIt
+
+; Look for "VDISK" starting at the 4th byte of extended memory.
+
+ call LocalEnableA20 ; Turn on A20
+
+ push es
+
+ les di,cs:pVDISK ; set up the comparison
+ mov si,offset szVDISK
+ mov cx,5
+ cld
+ repz cmpsb ; Do the comparison
+
+ pop es
+
+ pushf
+ call LocalDisableA20
+ popff
+
+ jz IVIFoundIt
+
+ mov [fVDISK],0 ; No VDISK device found
+ ret
+
+IVIFoundIt:
+ mov [fVDISK],1 ; "VDISK" was found
+ ret
+
+IsVDISKIn endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* Int15Handler - *
+;* *
+;* Hooks Function 88h to return zero as the amount of extended *
+;* memory available in the system. *
+;* *
+;* Hooks Function 87h and preserves the state of A20 across the *
+;* block move. *
+;* *
+;* ARGS: AH = Function, AL = Subfunction *
+;* RETS: AX = 0 (if AH == 88h) *
+;* REGS: AX is clobbered *
+;* *
+;*----------------------------------------------------------------------*
+
+
+Int15Handler proc far
+
+ cmp ah,88h ; request == report free ext mem?
+ je I15ExtMem
+
+ cmp ah,87h ; Block move?
+ je I15BlkMov
+
+ jmp cs:[PrevInt15] ; continue down the int 15h chain
+
+I15ExtMem:
+ mov ax, cs:Int15MemSize ; return 'free' Int 15h extended memory
+ jmp DOIRET
+
+
+I15BlkMov:
+ call DOCLI ; Make sure interrupts are off
+
+ sub sp,4 ; Make space for A20 flag & flags word
+ pusha ; Preserve the caller's registers
+
+ call IsA20On ; Get current A20 state
+
+ mov bp,sp ; Stk= [pusha] [fl] [a20] [ip] [cs] [fl]
+ mov [bp+18],ax ; Save A20 state
+ mov ax,[bp+24] ; Get caller's entry flags and save on
+ mov [bp+16],ax ; stack, forms part of iret frame
+
+ popa ; Restore the caller's registers
+
+; Simulate an interrupt to lower level Int 15h handler. Note that
+; the flags image is already on the stack from code above. The Int
+; 15h handler may or may return with interrupts enabled.
+
+ call cs:[PrevInt15]
+
+ push ax ; Save returned AX
+ pushf ; Save flags returned from lower level
+
+ push bp ; Stack =
+ mov bp,sp ; [bp] [fl] [ax] [a20] [ip] [cs] [fl]
+ mov ax,[bp+2] ; Setup to pass lower level flags
+ mov [bp+12],ax ; back to caller on iret
+ cmp word ptr [bp+6],0 ; While we're here test old A20 state
+ pop bp
+ pop ax ; Discard flags
+ pop ax ; Restore AX
+
+ jz I15HExit ; A20 was off, don't mess with it
+
+ call DOCLI ; A20 handlers called with ints off
+ pusha ; Preserve previous handler's return
+ mov ax,1
+ call A20Handler ; turn A20 back on
+ popa ; Restore the previous handler's return
+
+I15HExit:
+ add sp,2 ; 'pop' A20 state flag
+ jmp DOIRET ; Uses flags from lower level handler
+
+Int15Handler endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* RequestHMA - FUNCTION 01h *
+;* *
+;* Give caller control of the High Memory Area if it is available. *
+;* *
+;* ARGS: DX = HMA space requested in bytes *
+;* RETS: AX = 1 if the HMA was reserved, 0 otherwise. BL = Error *
+;* REGS: AX, BX and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+winbug_fix dw 0 ; storage for windows bug workaround
+
+RequestHMA proc near
+
+ call DOCLI ; This is a non-reentrant function.
+ ; Flags are restored after the return.
+
+ mov bl,ERR_HMAINUSE
+
+; ***************************
+; ** There's a problem with WIN386 2.11. It calls XMS driver
+; ** incorrectly and then goes ahead and uses the memory
+; ** it didn't properly allocate. In order to convince it
+; ** not to go ahead and use the extended memory, we must
+; ** fail this function when it calls us. We know that
+; ** al=40h and dx=free memory returned from QueryExtMemory
+; ** when we're called from windows. Hopefully no legitimate
+; ** caller will happen to have that exact same 24 bit code
+; ** in al/dx when they call this function because they will fail.
+; ***************************
+
+ cmp al,40h ; called from win386 2.11?
+ jnz not_winbug
+ cmp dx,winbug_fix ; dx=last result from QueryExtMem?
+ jz RHRetErr ; fail if so
+not_winbug:
+
+ cmp [fHMAInUse],1 ; Is the HMA already allocated?
+ je RHRetErr
+
+ mov bl,ERR_HMANOTEXIST
+ cmp [fHMAExists],0 ; Is the HMA available?
+ je RHRetErr
+
+ mov bl,ERR_HMAMINSIZE
+ cmp dx,[MinHMASize] ; Is this guy allowed in?
+ jb RHRetErr
+
+ mov ax,1
+ mov [fHMAInUse],al ; Reserve the High Memory Area
+ xor bl,bl ; Clear the error code
+ ret
+
+RHRetErr:
+ xor ax,ax ; Return failure with error code in BL
+ ret
+
+RequestHMA endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* ReleaseHMA - FUNCTION 02h *
+;* *
+;* Caller is releasing control of the High Memory area *
+;* *
+;* ARGS: None *
+;* RETS: AX = 1 if control is released, 0 otherwise. BL = Error *
+;* REGS: AX, BX and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+ReleaseHMA proc near
+
+ call DOCLI ; This is a non-reentrant function
+
+ mov al,[fHMAInUse] ; HMA currently in use?
+ or al,al
+ jz RLHRetErr ; No, return error
+
+ mov [fHMAInUse],0 ; Release the HMA and return success
+ mov ax,1
+ xor bl,bl
+ ret
+
+RLHRetErr:
+ xor ax,ax
+ mov bl,ERR_HMANOTALLOCED
+ ret
+
+ReleaseHMA endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* GlobalEnableA20 - FUNCTION 03h *
+;* *
+;* Globally enable the A20 line *
+;* *
+;* ARGS: None *
+;* RETS: AX = 1 if the A20 line is enabled, 0 otherwise. BL = Error *
+;* REGS: AX, BX CX, SI, DI and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+GlobalEnableA20 proc near
+
+ call DOCLI ; This is a non-reentrant function
+
+ cmp [fGlobalEnable],1 ; Is A20 already globally enabled?
+ je GEARet
+
+GEAEnable:
+ call LocalEnableA20 ; Attempt to enable A20
+ or ax,ax
+ jz GEAA20Err
+
+ mov [fGlobalEnable],1 ; Mark A20 global enabled
+
+GEARet:
+ mov ax,1 ; return success
+ xor bl,bl
+ ret
+
+GEAA20Err:
+ mov bl,ERR_A20 ; some A20 error occurred
+ xor ax,ax
+ ret
+
+GlobalEnableA20 endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* GlobalDisableA20 - FUNCTION 04h *
+;* *
+;* Globally disable the A20 line *
+;* *
+;* ARGS: None *
+;* RETS: AX=1 if the A20 line is disabled, 0 otherwise. BL = Error *
+;* REGS: AX, BX, CX, SI, DI and Flags are clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+GlobalDisableA20 proc near
+
+ call DOCLI ; This is a non-reentrant function
+
+ cmp [fGlobalEnable],0 ; Is A20 already global-disabled?
+ je GDARet
+
+ call LocalDisableA20 ; Attempt to disable it
+ or ax,ax ; (also zaps CX, SI, DI)
+ jz GDAA20Err
+
+ mov [fGlobalEnable],0 ; mark as global-disabled
+
+GDARet:
+ mov ax,1 ; return success
+ xor bl,bl
+ ret
+
+GDAA20Err:
+ mov bl,ERR_A20 ; some A20 error occurred
+ xor ax,ax
+ ret
+
+GlobalDisableA20 endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* LocalEnableA20 - FUNCTION 05h *
+;* *
+;* Locally enable the A20 line *
+;* *
+;* ARGS: None *
+;* RETS: AX = 1 if the A20 line is enabled, 0 otherwise. BL = Error *
+;* REGS: AX, BX, CX, SI, DI and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+
+LocalEnableA20 proc near
+
+ call DOCLI ; This is a non-reentrant function
+
+ cmp [fCanChangeA20],1 ; Can we change A20?
+ jne LEARet ; No, don't touch A20
+
+if NUM_A20_RETRIES
+ mov A20Retries,NUM_A20_RETRIES
+endif
+
+ cmp [EnableCount],0 ; If enable count == 0, go set it
+ jz LEASetIt ; without bothering to check 1st
+
+if NUM_A20_RETRIES
+
+LEATestIt:
+
+endif
+ call IsA20On ; If A20 is already on, don't do
+ or ax,ax ; it again, but if it isn't on,
+ jnz LEAIncIt ; then make it so
+
+LEASetIt:
+ mov ax,1 ; attempt to turn A20 on
+ call A20Handler ; Call machine-specific A20 handler
+
+ife NUM_A20_RETRIES
+ or ax,ax ; If we're not doing retries, then
+ jz LEAA20Err ; use A20 handler's error return
+else
+ dec A20Retries ; Any retries remaining? If so, go
+ jnz LEATestIt ; test current state, else return
+ jmp short LEAA20Err ; an error condition
+endif
+
+LEAIncIt:
+ inc [EnableCount]
+LEARet:
+ mov ax,1 ; return success
+ xor bl,bl
+ ret
+
+LEAA20Err:
+ mov bl,ERR_A20 ; some A20 error occurred
+
+ xor ax,ax
+ if debug_vers
+disp_a20_err:
+ pusha
+ mov al,'#'
+ call cofa
+ popa
+ endif
+ ret
+
+LocalEnableA20 endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* LocalDisableA20 - FUNCTION 06h *
+;* *
+;* Locally disable the A20 line *
+;* *
+;* ARGS: None *
+;* RETS: AX=1 if the A20 line is disabled, 0 otherwise. BL = Error *
+;* REGS: AX, BX, CX, SI, DI and Flags are clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+
+LocalDisableA20 proc near
+
+ call DOCLI ; This is a non-reentrant function
+
+ cmp [fCanChangeA20],0 ; Can we change A20?
+ je LDARet ; No, don't touch A20
+
+ cmp [EnableCount],0 ; make sure the count's not zero
+ je LDAA20Err
+
+if NUM_A20_RETRIES
+
+ mov A20Retries,NUM_A20_RETRIES
+
+LDATestIt:
+
+endif
+ call IsA20On ; Currently on or off?
+
+ cmp [EnableCount],1 ; Only if the count = 1 should A20 be
+ jnz LDAStayOn ; turned off, otherwise it stays on
+
+ or ax,ax ; If A20 is already off, don't
+ jz LDADecIt ; bother to turn off again
+
+ xor ax,ax ; It's on, but should be turned off
+ jmp short LDASetIt
+
+LDAStayOn:
+ or ax,ax ; A20 must stay on, if it is on, just
+ jnz LDADecIt ; dec count, else force A20 on
+
+ mov ax,1
+LDASetIt:
+ call A20Handler ; Call machine-specific A20 handler
+
+ife NUM_A20_RETRIES
+ or ax,ax ; If we're not doing retries, then
+ jz LDAA20Err ; use A20 handler's error return
+else
+ dec A20Retries ; Any retries remaining? If so, go
+ jnz LDATestIt ; test current state, else return
+ jmp short LDAA20Err ; an error condition
+endif
+
+LDADecIt:
+ dec [EnableCount]
+
+LDARet:
+ mov ax,1 ; return success
+ xor bl,bl
+ ret
+
+LDAA20Err:
+ mov bl,ERR_A20 ; some A20 error occurred
+ xor ax,ax
+ if debug_vers
+ jmp disp_a20_err
+ endif
+ ret
+
+LocalDisableA20 endp
+
+;
+;---------------------------------------------------------------------------
+; procedure : FLclEnblA20
+; procedure : FLclDsblA20
+;
+; Called from the Block move functions. Serves 2 purposes
+; 1. Interfaces a far call for a near routine
+; 2. If funky is in HMA does a dummy success return
+;---------------------------------------------------------------------------
+;
+
+FLclEnblA20 proc far
+ cmp cs:fInHMA, 0
+ jz @f
+ mov ax, 1
+ ret
+@@:
+ call LocalEnableA20
+ ret
+FLclEnblA20 endp
+
+FLclDsblA20 proc far
+ cmp cs:fInHMA, 0
+ jz @f
+ mov ax, 1
+ ret
+@@:
+ call LocalDisableA20
+ ret
+FLclDsblA20 endp
+;
+;*----------------------------------------------------------------------*
+;* *
+;* IsA20On - FUNCTION 07h *
+;* *
+;* Returns the state of the A20 line *
+;* *
+;* ARGS: None *
+;* RETS: AX = 1 if the A20 line is enabled, 0 otherwise *
+;* BL = 0 *
+;* REGS: AX, BL, CX, SI, DI and Flags clobbered *
+;* *
+;* INTERNALLY REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+; NOTE: When this routine is called from the Int15 handler, ds is undefined.
+; Hence the CS: overrides on data references.
+
+
+IsA20On proc near
+ mov al, cs:A20State
+ cbw
+ xor bl, bl
+ ret
+
+IsA20On endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* AddMem - add memory to free pool *
+;* *
+;* The trick here is that we're going to check for overlapping *
+;* or adjacent blocks and crunch them together. The thinking *
+;* here is that we may be informed of a memory resource from *
+;* more than one source. In any case, we NEVER want the same *
+;* memory to appear in our resource table more than once. *
+;* *
+;* Note: there's presently no way of reporting errors if the *
+;* handle table is full. If it happens, we'll just lose the *
+;* memory block. This should not be a problem as long as *
+;* we're only being called during program initialization. *
+;* *
+;* It would be nice if we could throw this code away after *
+;* initialization, unfortunately this is actually invoked *
+;* at HookInt15 time, so it's too late to do away with *
+;* obsolete code. *
+;* *
+;* ARGS: CX - base of block in 1K increments *
+;* AX - length of block in 1K increments *
+;* TRASHES: AX,BX,CX,DX,SI,DI *
+;* *
+;* messes with handle table - not reentrant - assumes ints disabled *
+;* *
+;*----------------------------------------------------------------------*
+
+
+AddMem proc near
+
+; We might as well be scanning for a free handle while we're
+; at it since we're normally going to need one at the end
+
+ mov dx,ax ; save new block length in dx
+ mov si,cx ; save new block base in si
+ xor di,di ; haven't found free handle yet
+
+ push es
+ mov es,hiseg
+ assume es:funky
+
+ mov bx,[KiddValley] ; prepare to loop thru handle tab
+ mov cx,[cHandles]
+
+AM01:
+ cmp [bx].Flags,UNUSEDFLAG ; is this handle available?
+ jnz AM02 ; skip if not
+
+ or di,di ; use the first free handle we
+ jnz AM05 ; find. skip if we've got one
+
+ mov di,bx ; save the unused handle in di
+ jmp short AM05
+
+AM02:
+
+
+; Note: Normally all handles will be either UNUSED or FREE at
+; this point. However, in the case of checking for Zenith memory,
+; it may have a temporarily allocated dummy block. Therefore
+; we'll only be merging blocks marked as FREE.
+
+ cmp [bx].Flags,FREEFLAG
+ jnz AM05 ; ignore USED blocks
+
+; First check for new block being entirely after block at [bx]
+
+ mov ax,[bx].Base
+ add ax,[bx].Len
+ cmp ax,si ; is [bx].end < new.Base?
+ jb AM05 ; done checking this entry if so
+
+; Now check for new block being entirely before block at [bx]
+
+ mov ax,si ; new.base
+ add ax,dx ; + new.len = new.end
+ cmp ax,[bx].Base
+ jb AM05 ; brif no overlap at all
+
+; Now suck the block at [bx] up into our block in registers so
+; that we can continue the scan. There may be other adjacent
+; blocks, even in the case of no overlap, fr'instance when a
+; block is added which entirely fills the gap between two others.
+
+ cmp si,[bx].Base ; Find base of combined block
+ jbe AM03 ; Brif new block on bottom
+ add dx,si ; Add new.base - [bx].base to
+ mov si,[bx].Base ; new.len, set new.base=[bx].Base
+ sub dx,si ; new.len
+AM03:
+ mov ax,[bx].Base ; see which block ends later
+ add ax,[bx].Len ; get [bx].end
+ sub ax,dx ; less new.len
+ sub ax,si ; compare to new.Base
+ jbe AM04 ; brif new.end >= [bx].end
+
+; now ax has the amount our block must grow by
+
+ add dx,ax
+
+AM04:
+ mov [bx].Flags,UNUSEDFLAG ; mark the block unused
+ or di,di ; did we find an unused handle yet?
+ jnz AM05 ; brif so
+ mov di,bx ; save this one if not
+
+AM05:
+ add bx,SIZE handle
+ loop AM01
+
+ or di,di ; did we find a free handle?
+ jz AM06 ; error! no handles free!
+
+ mov [di].cLock,0
+ mov [di].Flags,FREEFLAG ; create the free memory block
+ mov [di].Base,si
+ mov [di].Len,dx
+
+AM06:
+ pop es
+ assume es:nothing
+ ret
+
+AddMem endp
+
+ PUBLIC DOCLI
+DOCLI:
+ FCLI
+ ret
+
+ PUBLIC DOSTI
+DOSTI:
+ FSTI
+ ret
+
+ PUBLIC DOIRET
+DOIRET:
+ FIRET
+
+_text ends
+ end
+
+
diff --git a/private/mvdm/dos/v86/dev/himem/himem.inc b/private/mvdm/dos/v86/dev/himem/himem.inc
new file mode 100644
index 000000000..2e7c8aaf0
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem.inc
@@ -0,0 +1,160 @@
+;/* himem.inc
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; */
+
+
+;*----------------------------------------------------------------------*
+;* EQUATES *
+;*----------------------------------------------------------------------*
+
+; Build options
+
+NUM_A20_RETRIES = 3 ; # times to retry A20 diddles
+
+; Debugging options
+
+debug_vers = 00000h
+tdump = 00000h ; display the handle table on each call
+keep_cs = 00000h ; keep track of allocator's cs:
+
+XMSVersion equ 0200h
+HimemVersion equ 0200h+77h
+DATE_String equ '02/27/91'
+
+INT2F_ID equ 043h ; XMS Int 2Fh multiplex ID
+INT2F_INS_CHK equ 000h ; driver installation check
+INT2F_CTL_FUN equ 010h ; get control function address
+INT2F_EXT_A20 equ 030h ; get external A20 hander info
+
+ifndef DBCS
+HISEG_ORG equ 0A000h ; ORG for the seg to be moved
+ ; into HMA
+else
+HISEG_ORG equ 0A000h+01000h ; adjust for DBCS System
+endif
+
+multMULT equ 4ah
+multMULTGETHMAPTR equ 1
+multMULTALLOCHMA equ 2
+
+DEFHANDLES equ 32 ; Default # of EMB handles
+MAXHANDLES equ 128 ; Max # of EMB handles
+
+FREEFLAG equ 00000001b ; EMB Flags
+USEDFLAG equ 00000010b
+UNUSEDFLAG equ 00000100b
+
+;*----------------------------------------------------------------------*
+;* XMS Error Codes *
+;*----------------------------------------------------------------------*
+
+ERR_NOTIMPLEMENTED equ 080h
+ERR_VDISKFOUND equ 081h
+ERR_A20 equ 082h
+ERR_GENERAL equ 08Eh
+ERR_UNRECOVERABLE equ 08Fh
+
+ERR_HMANOTEXIST equ 090h
+ERR_HMAINUSE equ 091h
+ERR_HMAMINSIZE equ 092h
+ERR_HMANOTALLOCED equ 093h
+
+ERR_OUTOMEMORY equ 0A0h
+ERR_OUTOHANDLES equ 0A1h
+ERR_INVALIDHANDLE equ 0A2h
+ERR_SHINVALID equ 0A3h
+ERR_SOINVALID equ 0A4h
+ERR_DHINVALID equ 0A5h
+ERR_DOINVALID equ 0A6h
+ERR_LENINVALID equ 0A7h
+ERR_OVERLAP equ 0A8h
+ERR_PARITY equ 0A9h
+ERR_EMBUNLOCKED equ 0AAh
+ERR_EMBLOCKED equ 0ABh
+ERR_LOCKOVERFLOW equ 0ACh
+ERR_LOCKFAIL equ 0ADh
+
+ERR_UMBSIZETOOBIG equ 0B0h
+ERR_NOUMBS equ 0B1h
+ERR_INVALIDUMB equ 0B2h
+
+
+; Macro to avoid the 286 POPF bug. Performs a harmless IRET to simulate a
+; popf. Some 286s allow interrupts to sneak in during a real popf.
+
+popff macro
+ push cs
+ call pPPFIRet ; Defined as the offset of any IRET
+ endm
+
+.286
+
+;*----------------------------------------------------------------------*
+;* SEGMENT DEFINITION *
+;*----------------------------------------------------------------------*
+
+_text segment word public 'code'
+ assume cs:_text,ds:_text
+
+;************************************************************************
+;* *
+;* Data Structures *
+;* *
+;************************************************************************
+
+; The driver Request Header structure definition.
+ReqHdr struc
+ ReqLen db ?
+ Unit db ?
+ Command db ?
+ Status dw ?
+ Reserved db 8 dup (?)
+ Units db ?
+ Address dd ?
+ pCmdLine dd ?
+ReqHdr ends
+
+; An EMB Handle structure definition.
+Handle struc ; Handle Table Entry
+ zzFlags db ? ; Unused/InUse/Free
+ zzcLock db ? ; Lock count
+ zzBase dw ? ; 32-bit base address in K
+ zzLen dw ? ; 32-bit length in K
+ if keep_cs
+ zzAcs dw ? ; allocator's code segment
+ endif
+Handle ends
+
+; allow easy generation of appropriate segment overrides
+
+xFlags equ funky:zzFlags
+xcLock equ funky:zzcLock
+xBase equ funky:zzBase
+xLen equ funky:zzLen
+ if keep_cs
+xAcs equ funky:zzAcs
+ endif
+Flags equ funky:zzFlags
+cLock equ funky:zzcLock
+Base equ funky:zzBase
+Len equ funky:zzLen
+ if keep_cs
+Acs equ funky:zzAcs
+ endif
+
+; Extended Memory Move Block structure definition.
+MoveExtendedStruc struc
+ bCount dd ? ; Length of block to move
+ SourceHandle dw ? ; Handle for souce
+ SourceOffset dd ? ; Offset into source
+ DestHandle dw ? ; Handle for destination
+ DestOffset dd ? ; Offset into destination
+MoveExtendedStruc ends
+
diff --git a/private/mvdm/dos/v86/dev/himem/himem1.asm b/private/mvdm/dos/v86/dev/himem/himem1.asm
new file mode 100644
index 000000000..ca1af1fe0
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem1.asm
@@ -0,0 +1,94 @@
+;/* himem1.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; */
+
+ page 95,160
+ title himem1 - A20 Handler stuff
+
+ .xlist
+ include himem.inc
+ include xmssvc.inc
+ .list
+
+ public A20Handler
+ extrn TopOfTextSeg:word
+ extrn fA20Check:byte
+ extrn A20State:byte
+
+ assume cs:_text,ds:nothing
+
+;*--------------------------------------------------------------------------*
+;* *
+;* A20 Handler Section: *
+;* *
+;* The Init code copies the proper A20 Handler in place. *
+;* *
+;* NOTE: the A20 handler may be called from the Int 15h hook which does *
+;* not set ds = _text. DO NOT ASSUME DS == _TEXT! *
+;* *
+;*--------------------------------------------------------------------------*
+
+A20Handler:
+
+;*----------------------------------------------------------------------*
+;* *
+;* TheA20Handler - Hardware Independent A20 handler for NT himem *
+;* *
+;* Enable/Disable the A20 line *
+;* *
+;* ARGS: AX = 0 for Disable, 1 for Enable, 2 for On/Off query *
+;* RETS: AX = 1 for success, 0 otherwise *
+;* if input AX=2 then Exit AX=0 means off and 1 means on *
+;* REGS: AX and flags effected *
+;* *
+;*----------------------------------------------------------------------*
+TheA20Handler proc near
+ cmp ax, 2
+ jne @F
+ mov al, cs:A20State
+ cbw
+ ret
+@@:
+ XMSSVC XMS_A20
+ ret
+TheA20Handler endp
+
+End_A20Handler:
+
+
+; Sudeepb NOTE: DONOT ADD ANY THING after End_A20Handler and before InstallA20.
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* InstallA20 - *
+;* *
+;* Install the A20 Handler *
+;* *
+;* ARGS: None *
+;* RETS: None *
+;* REGS: *
+;* *
+;*----------------------------------------------------------------------*
+
+ public InstallA20
+
+InstallA20 proc near
+
+ mov fA20Check,1 ; A20 ON/OFF query supported
+ mov [TopOfTextSeg],offset End_A20Handler
+ clc
+ ret
+InstallA20 endp
+
+
+_text ends
+ end
+
diff --git a/private/mvdm/dos/v86/dev/himem/himem2.asm b/private/mvdm/dos/v86/dev/himem/himem2.asm
new file mode 100644
index 000000000..835d2d6cd
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem2.asm
@@ -0,0 +1,1093 @@
+;/* himem2.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; *
+; * williamh 25-Sept-1992 added UMB initialization
+; */
+
+ page 95,160
+ title 'HIMEM2 - Initialization code'
+
+funky segment word public 'funky'
+ extrn textseg:word ; in high segment
+ extrn KiddValley:word
+ extrn KiddValleyTop:word
+ extrn cHandles:word
+ extrn pack_and_truncate:near
+ extrn end_of_funky_seg:byte
+ extrn LEnblA20:word
+ extrn LDsblA20:word
+funky ends
+
+ .xlist
+ include himem.inc ; get structures, equ's, etc.
+ ; and open segment
+ include xmssvc.inc
+
+ .list
+
+; public f000
+ public InitInterrupt
+ public MachineNum
+
+;************************************************************************
+;* *
+;* Global Variables *
+;* *
+;************************************************************************
+
+ extrn pPPFIRET:word
+ extrn dd_int_loc:word
+ extrn Interrupt:near
+ extrn hiseg:word
+ extrn call_hi_in_di:near
+ extrn fCanChangeA20:byte
+ extrn fHMAMayExist:byte
+
+ extrn fVDISK:byte
+ extrn IsVDISKIn:near
+
+ extrn A20Handler:near
+ extrn EnableCount:word
+ extrn MemCorr:word
+ extrn MinHMASize:word
+
+ extrn pReqHdr:dword
+ extrn PrevInt2f:dword
+ extrn TopOfTextSeg:word
+
+ extrn AddMem:near
+ extrn InstallA20:near
+ extrn Int2fHandler:near
+; extrn Is6300Plus:near
+ extrn IsA20On:near
+
+ extrn SignOnMsg:byte
+ extrn ROMDisabledMsg:byte
+ extrn UnsupportedROMMsg:byte
+ extrn ROMHookedMsg:byte
+ extrn BadDOSMsg:byte
+ extrn NowInMsg:byte
+ extrn On8086Msg:byte
+ extrn NoExtMemMsg:byte
+ extrn FlushMsg:byte
+ extrn StartMsg:byte
+ extrn HandlesMsg:byte
+ extrn HMAMINMsg:byte
+ extrn KMsg:byte
+ extrn NoHMAMsg:byte
+ extrn A20OnMsg:byte
+ extrn HMAOKMsg:byte
+ extrn VDISKInMsg:byte
+ extrn BadArgMsg:byte
+
+ extrn DevAttr:word
+ extrn Int15MemSize:word
+
+ extrn EndText:byte
+ extrn A20State:byte
+
+ extrn DOSTI:near
+ extrn DOCLI:near
+
+;************************************************************************
+;* *
+;* Code/Data below here will be discarded after driver initialization *
+;* *
+;************************************************************************
+
+; Discardable Initialization Data
+
+public fShadowOff, f1stWasWarning
+
+fShadowOff db 0 ; NZ if shadow RAM should be disabled,
+ ; 0/1 set by command line switch, 0FFh
+ ; set if little extended and hope to disable
+
+f1stWasWarning db 0 ; NZ if 1st attempt to diddle A20 generated
+ ; a warning (and not an error)
+ public fA20Control
+
+fA20Control db 0ffh ; NZ if himem should take control of A20, even
+ ; it was already on when himem loaded.
+
+ public fCPUClock
+
+fCPUClock db 0 ; NZ if himem should try to preserve CPU clock
+ ; speed when gating A20
+
+ public StringParm, MachineNum, MachineName
+
+StringParm db 13 DUP (' ')
+
+MachineNum dw -1
+
+; Note: the following table MUST be in the same order as the entries in the
+; A20_Scan_Table! If you add entries here, also add one there!
+
+MachineName label byte
+ db 'ptlcascade',0 ; Phoenix Cascade BIOS
+ db 'att6300plus',0 ; AT&T 6300 Plus
+ db 'ps2',0 ; IBM PS/2
+ db 'hpvectra',0 ; HP 'Classic' Vectra (A & A+)
+ db 'acer1100',0 ; Acer 1100
+ db 'toshiba',0 ; Toshiba 1600 & 1200XE
+ db 'wyse',0 ; Wyse 12.5 MHz 286 machine
+ db 'tulip',0 ; Tulip machines
+ db 'zenith',0 ; Zenith ZBIOS
+ db 'at1',0 ; IBM AT/delay 0
+ db 'at2',0 ; IBM AT/delay 1
+ db 'at3',0 ; IBM AT/delay 2
+ db 'philips',0 ; Philips machines
+ db 'css',0 ; CSS Lab machines
+ db 'fasthp',0 ; Single byte method for HP Vectras
+ db 'ibm7552',0 ; IBM 7552 Industrial Computer
+ db 'bullmicral',0 ; Bull Micral 60 M004
+ db 'at',0 ; IBM AT
+ db 0FFh ; end of table
+
+;NOTE: there is code in GetParms which depends on AltNameTbl coming
+; after MachineName table.
+
+ public AltName1, AltName2, AltName3, AltName4, AltName5
+ public AltName6, AltName7, AltName8, AltName9, AltName10
+ public AltName11, AltName12, AltName13, AltName14, AltName15
+ public AltName16 ;M004
+
+AltNameTbl label byte
+AltName3 db '3',0 ; Phoenix Cascade BIOS
+AltName5 db '5',0 ; AT&T 6300 Plus
+AltName2 db '2',0 ; IBM PS/2
+AltName4 db '4',0 ; HP 'Classic' Vectra (A & A+)
+AltName6 db '6',0 ; Acer 1100
+AltName7 db '7',0 ; Toshiba 1600 & 1200XE
+AltName8 db '8',0 ; Wyse 12.5 Mhz 286 machine
+AltName9 db '9',0 ; Tulip machine
+AltName10 db '10',0 ; Zenith ZBIOS
+AltName11 db '11',0 ; IBM AT/delay 0
+AltName12 db '12',0 ; IBM AT/delay 1
+AltName13 db '13',0 ; IBM AT/delay 2
+ db '13',0 ; Philips machines (same as AT3)
+ db '12',0 ; CSS machines
+AltName14 db '14',0 ; Single byte HP Vectra m/cs
+AltName15 db '15',0 ; IBM 7552 Industrial Computer
+AltName16 db '16',0 ; Bull Micral 60 M004
+AltName1 db '1',0 ; IBM AT
+ db 0FFh ; end of table
+
+ifdef debug_tsr ;-----------------------------------------------
+
+;*----------------------------------------------------------------------*
+;* *
+;* ExeStart - *
+;* *
+;* Entry point when himem is invoked as an .EXE. *
+;* *
+;*----------------------------------------------------------------------*
+
+lpCmdLine dd 81h ; far ptr to command tail
+
+ public ExeStart
+
+ExeStart:
+
+ mov word ptr cs:[lpCmdLine+2],es ; save PSP segment in pointer
+
+ mov ax,cs ; Setup segment regs to all be the same
+ mov ds,ax
+ mov es,ax
+
+ call InitDriver ; Initialize...
+
+ mov ax,TopOfTextSeg ; TopOfTextSeg == 0 is error installing
+ or ax,ax
+ jnz @f
+
+ mov ax,4C03h ; error, so just terminate
+ int 21h
+@@:
+ mov di,offset pack_and_truncate
+ jmp call_hi_in_di ; terminate and stay resident
+
+endif ;------------------------------------------------
+
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* InitInterrupt - *
+;* *
+;* Called by MS-DOS immediately after Strategy routine *
+;* *
+;* ARGS: None *
+;* RETS: Return code in Request Header's Status field *
+;* REGS: Preserved *
+;* *
+;* This entry point is used only during initialization. *
+;* It replaces itself with a much shorter version which only *
+;* serves to report the appropriate errors when this driver *
+;* is called in error. *
+;* *
+;*----------------------------------------------------------------------*
+
+InitInterrupt proc far
+
+ ; Save the registers including flags.
+
+ push ax ; We cannot use pusha\popa because
+ push bx ; we could be on an 8086 at this point
+ push cx
+ push dx
+ push ds
+ push es
+ push di
+ push si
+ push bp
+ pushf
+
+ push cs ; Set DS=CS for access to global variables.
+ pop ds
+
+ les di,[pReqHdr] ; ES:DI = Request Header
+
+ mov bl,es:[di].Command ; Get Function code in BL
+
+ or bl,bl ; Only Function 00h (Init) is legal
+ jz IInit
+
+ cmp bl,16 ; Test for "legal" DOS functions
+ jle IOtherFunc
+
+IBogusFunc:
+ mov ax,8003h ; Return "Unknown Command"
+ jmp short IExit
+
+IOtherFunc:
+ xor ax,ax ; Return zero for unsupported functions
+ jmp short IExit
+
+IInit:
+ call InitDriver ; Initialize the driver
+ les di,[pReqHdr] ; Restore es:di = Request Header
+
+IExit:
+ or ax,0100h ; Turn on the "Done" bit
+ mov es:[di].Status,ax ; Store return code
+
+ popff ; restore the registers
+ pop bp
+ pop si
+ pop di
+ pop es
+ pop ds
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ mov dd_int_loc,offset Interrupt ; replace Interrupt with
+ ret ; tiny permanent stub
+
+InitInterrupt endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* InitDriver - *
+;* *
+;* Called when driver is Initialized. *
+;* *
+;* ARGS: ES:DI = Address of the Request Header *
+;* RETS: pHdr.Address = Bottom of resident driver code *
+;* REGS: AX, CX and Flags are clobbered *
+;* *
+;*----------------------------------------------------------------------*
+
+ public InitDriver
+
+InitDriver proc near
+
+ cld
+
+ ifndef debug_tsr
+ call LocateHiSeg ; locate the hiseg in low memory properly
+
+
+ mov ax,cs
+ push es
+ mov es,hiseg
+ assume es:funky
+ add textseg,ax ; relocate text segment pointer
+ add LEnblA20+2, ax ; update ptrs to enble & disable a20 rtns
+ add LDsblA20+2, ax
+ pop es
+ assume es:nothing
+ endif
+
+; mov ah,9 ; display signon message
+; mov dx,offset SignOnMsg
+; int 21h
+
+ mov ah,30h ; make sure we've got DOS 3.00 or higher
+ int 21h ; Get DOS versions number
+ cmp al,3
+ jae IDCheckXMS
+
+ mov dx,offset BadDOSMsg
+ jmp IDFlushMe
+
+IDCheckXMS:
+ mov ax,(INT2F_ID SHL 8) OR INT2F_INS_CHK
+ int 2Fh ; make sure there's no other XMS installed
+ cmp al,80h ; Is INT 2F hooked?
+ jne IDNotInYet
+ mov dx,offset NowInMsg
+ jmp IDFlushMe
+
+IDNotInYet:
+ call GetParms ; process command line parameters
+;; don't call IsA20On at this moment because we haven't init it yet
+ mov ax, 2
+ XMSSVC XMS_A20
+;;;; call IsA20On ; Is A20 already enabled?
+ or ax,ax ; (may zap cx, si, di)
+ jz IDInsA20 ; no, go install A20 handler
+
+ mov dx,offset A20OnMsg ; "A20 already on" message
+ cmp fA20Control,0 ; should we take control of A20 anyway?
+ jne IDInsA20 ; yes, go muck with it
+ mov [fCanChangeA20],0 ; no, don't allow changing of A20
+ mov ah,9 ; and tell user about it
+ int 21h
+ jmp short IDAfterA20
+
+IDInsA20:
+ call InstallA20 ; install proper A20 handler
+ jc IDFlushMe ; CY means fatal error
+
+; Note: A side affect of the previous InstallA20 is that MemCorr
+; is set to reflect the adjustment factor if we're on an AT&T 6300+
+
+IDAfterA20:
+ call InitHandles ; initialize handle table
+
+ call GetInt15Memory ; how much extended memory is installed?
+ cmp ax,64 ; Is there >= 64K of extended?
+ jae IDHMAOK
+
+ push es
+ mov es,hiseg
+ assume es:funky
+ mov bx,[KiddValley] ; get size of memory we already have in tables
+ mov cx,[cHandles]
+
+IDAnyMem:
+ cmp [bx].Flags,FREEFLAG
+ jnz IDAnyMem_1 ; brif not a valid free block
+ add ax,[bx].Len ; accumulate total
+IDAnyMem_1:
+ add bx,SIZE Handle
+ loop IDAnyMem
+
+ pop es
+ assume es:nothing
+
+ mov dx,offset NoHMAMsg
+ or ax,ax ; no HMA, any other memory to control?
+ jnz disp_hma_msg ; jmp if some memory
+
+; We can't find any memory to manage.
+
+ mov dx,offset NoExtMemMsg
+
+; Display the message in DX followed by the "Flush" message.
+
+IDFlushMe:
+ mov ah,9
+ int 21h
+ mov dx,offset FlushMsg
+ mov ah,9
+ int 21h
+
+ xor ax,ax ; discard the driver
+ mov [TopOfTextSeg],ax
+
+ifndef debug_tsr ;-------------------------------
+ les di,[pReqHdr]
+ mov es:[di].Units,al
+ and cs:DevAttr,not 8000h ; clr bit 15 in attrib of driver header
+endif
+ jmp short IDReturn ;-------------------------------
+IDHMAOK:
+ mov [fHMAMayExist],1
+ mov dx,offset HMAOKMsg
+disp_hma_msg:
+; mov ah,9
+; int 21h
+
+;; tell xms.lib where our variable is
+ mov ax, cs
+ mov bx, offset A20State
+ XMSSVC XMS_INITUMB
+
+ call HookInt2F ; "turn on" the driver
+
+; Initialization finished (or failed) -- return to caller
+
+IDReturn:
+
+ifndef debug_tsr ;-------------------------------
+ mov di,offset pack_and_truncate
+ jmp call_hi_in_di ; pack stuff down and terminate
+endif ;-------------------------------
+ ret
+
+InitDriver endp
+;
+;----------------------------------------------------------------------------
+; procedure : LocateHiSeg
+;
+; Locate the movable segment properly in the low seg.
+; taking care of the stripped ORG zeroes. This function
+; calculates the segment at which the hiseg should run
+; with the ORG. If the segment cvalue goes below zero the
+; code is moved up high enough to run the code from a seg value
+; of zero.
+;
+; This function assumes that the 'funky' segment follows
+; immediately after the text seg.
+;
+;----------------------------------------------------------------------------
+;
+LocateHiSeg proc near
+ push ds
+ mov ax, cs ; para start of text seg
+ mov cx, offset _text:EndText ; end of text seg
+ add cx, 15 ; para round it
+ shr cx, 1
+ shr cx, 1
+ shr cx, 1
+ shr cx, 1
+ add ax, cx ; para start of funky seg
+ cmp ax, (HISEG_ORG shr 4) ; will the seg go below zero?
+ jb MoveHiSeg ; yeah, we have to move it
+ sub ax, (HISEG_ORG shr 4) ; no, it fits in
+ pop ds
+ mov hiseg, ax ; update the segment in which
+ ; it is going to run from.
+ ret
+MoveHiSeg:
+ mov ds, ax ; segment at which funky
+ ; resides without the ORG
+ xor ax, ax
+ mov es, ax ; we want to movve the code
+ ; to 0:HISEG_ORG
+ mov di, offset funky:end_of_funky_seg
+ mov si, di
+ sub si, HISEG_ORG
+ mov cx, si
+ dec di
+ dec si
+ std ; move backward (safe when
+ ; source & dest overlap
+ rep movsb
+ cld
+ pop ds
+ mov hiseg, 0 ; funky is going to run from
+ ; segment zero
+ ret
+LocateHiSeg endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* HookInt2F - *
+;* *
+;* Insert the INT 2F hook *
+;* *
+;* ARGS: None *
+;* RETS: None *
+;* REGS: AX, SI, ES and Flags are clobbered *
+;* *
+;*----------------------------------------------------------------------*
+
+ public HookInt2F
+
+HookInt2F proc near
+
+ call DOCLI
+ xor ax,ax
+ mov es,ax
+ mov si,2Fh * 4 ; save previous int2f vector
+ mov ax,offset Int2FHandler ; and exchange with new one
+ xchg ax,es:[si][0]
+ mov word ptr [PrevInt2F][0],ax
+ mov ax,cs
+ xchg ax,es:[si][2]
+ mov word ptr [PrevInt2F][2],ax
+ call DOSTI
+ ret
+
+HookInt2F endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* GetInt15Memory - *
+;* *
+;* Returns the amount of memory INT 15h, Function 88h says is free *
+;* *
+;* ARGS: None *
+;* RETS: AX = Amount of free extended memory in K-bytes *
+;* REGS: AX and Flags are clobbered *
+;* *
+;*----------------------------------------------------------------------*
+
+
+GetInt15Memory proc near
+
+IFDEF WHEN_INT15_DONE
+ mov ah,88h ; snag the int 15h memory
+ clc
+ int 15h ; Is Function 88h around?
+ jnc xret_geti15
+ xor ax,ax ; No, return 0
+xret_geti15:
+
+ifndef NOLIMIT ;M005
+ cmp ax,15*1024 ; Limit himem.sys to using 15 meg
+ jb @f ; of extended memory for apps
+ mov ax,15*1024 ; that don't deal with > 24 bit
+@@: ; addresses
+endif ;M005
+
+ELSE
+ XMSSVC XMS_EXTMEM ; return ext-mem in ax5
+ENDIF
+
+ ret
+
+GetInt15Memory endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* GetParms - *
+;* *
+;* Get any parameters off of the HIMEM command line *
+;* *
+;* ARGS: None *
+;* RETS: None *
+;* REGS: AX, BX, CX, DX, DI, SI, ES and Flags clobbered *
+;* *
+;* Side Effects: cHandles and MinHMASize may be changed *
+;* *
+;*----------------------------------------------------------------------*
+
+GPArgPtr dd ?
+GPRegSave dw ?
+
+ public GetParms
+
+GetParms proc near
+
+ cld ; better safe than sorry
+
+ push ds
+
+ifdef debug_tsr ;-------------------------------
+ lds si,lpCmdLine
+else ;-------------------------------
+ les di,[pReqHdr] ; Running as a device driver
+ lds si,es:[di].pCmdLine ; DS:SI points to first char
+ ; after "DEVICE="
+@@: call GPGetChar ; Skip over driver name, up to
+ jc GPDatsAll ; first blank or / or eol
+ jz GPNextArg
+ cmp al,'/'
+ jnz @b
+ dec si ; Backup to get / again
+endif ;-------------------------------
+
+ assume ds:nothing,es:nothing
+
+; Scan until we see a non-blank or the end of line.
+
+GPNextArg:
+ call GPGetChar
+ jc GPDatsAll ; eol
+ jz GPNextArg ; blank
+
+ mov word ptr cs:[GPArgPtr], si ; save ptr to start of arg
+ mov word ptr cs:[GPArgPtr+2], ds ; incase we want to complain
+ dec word ptr cs:[GPArgPtr] ; (GPGetChar points at next)
+
+ cmp al,'/' ; better be a / or not a valid arg
+ jz GPGotOne
+
+; Detected invalid parameter or value, complain to user
+
+GPBadParm:
+
+ mov ah,9 ; tell'm something isn't right
+ push cs
+ pop ds
+ mov dx,offset BadArgMsg
+ int 21h
+
+ lds si,cs:[GPArgPtr] ; backup to last parameter
+
+GPBadDisp:
+ call GPGetChar ; disp arg up to space or eol
+ jc GPDatsAll ; skips over bad arg while we're at it
+ jz GPNextArg
+
+ cmp al,'/' ; start of next arg?
+ jnz @f
+ dec si ; maybe yes, maybe no--might
+ cmp si,word ptr cs:[GPArgPtr] ; be same arg
+ jnz GPNextArg ; next, go process new arg
+ inc si ; same, keep displaying
+@@:
+ mov dl,al
+ mov ah,2
+ int 21h
+ jmp short GPBadDisp
+
+; Finished, we're outta here...
+
+GPDatsAll:
+ pop ds
+ ret
+
+; Save what we found and get the number or string after it.
+
+GPGotOne:
+ lodsb
+ mov cs:[GPRegSave],ax
+
+; Scan past the rest of the parm for a number, EOL, or a space.
+
+GPNeedParm:
+ call GPGetChar
+ jc GPBadParm
+ jz GPBadParm ; blank
+ cmp al,':' ; start of string arg
+ je GPString
+ cmp al,'='
+ jne GPNeedParm
+
+; Read the number at DS:SI into DX
+
+GPNeedNum:
+ call GPGetChar
+ jc GPDatsAll
+ cmp al,'0'
+ jb GPNeedNum
+ cmp al,'9'
+ ja GPNeedNum
+
+ xor dx,dx
+GPNumLoop:
+ sub al,'0'
+ cbw
+ add dx,ax
+ call GPGetChar
+ jc GPNumDone
+ jz GPNumDone
+ cmp al,'0'
+ jb GPBadParm
+ cmp al,'9'
+ ja GPBadParm
+ shl dx,1 ; Stupid multiply DX by 10
+ mov bx,dx
+ shl dx,1
+ shl dx,1
+ add dx,bx
+ jmp short GPNumLoop
+
+; Move the string arg from ds:si to StringParm
+
+GPString:
+ mov cx,(SIZE StringParm) - 1
+ push cs
+ pop es
+ mov di,offset _text:StringParm
+
+GPStrLoop:
+ call GPGetChar
+ jc GPStrDone
+ jz GPStrDone
+ stosb
+ loop GPStrLoop
+
+GPStrDone:
+
+ mov byte ptr es:[di],0 ; Null terminate the string
+ mov dx,-1 ; In case parm expects a num, give'm
+ ; a likely invalid one
+
+; Which parameter are we dealing with here?
+
+GPNumDone:
+ xchg ax,cs:[GPRegSave]
+ cmp al,'H' ; HMAMIN= parameter?
+ jne @f
+ jmp GPGotMin
+@@:
+ cmp al,'N' ; NUMHANDLES= parameter?
+ jne @f
+ jmp GPGotHands
+@@: cmp al,'M' ; MACHINE: parameter?
+ je GPGotMachine
+ cmp al,'A' ; A20CONTROL: parameter?
+ je GPGotA20Control
+ cmp al,'S' ; SHADOWRAM: parameter?
+ jne @f
+ jmp GPGotShadow
+@@: cmp al, 'I' ; INT15=
+ jne @f
+ jmp GPGotInt15
+@@: cmp al, 'C' ; CPUCLOCK:
+ jne @f
+ jmp GPGotCPUClock
+@@: jmp GPBadParm
+
+
+; Process /A20CONTROL: parameter
+
+GPGotA20Control:
+ mov ax,word ptr [StringParm]
+ or ax,2020h
+ mov bl,0FFh
+ cmp ax,'no' ; ON ? - means we take control
+ jz GPSetA20
+ inc bl
+ cmp ax,'fo' ; OFF ? - means we leave alone if on
+ jz GPSetA20
+ jmp GPBadParm
+
+GPSetA20:
+ mov fA20Control,bl ; Z if A20 should be left alone if
+ jmp GPNextParm ; it's already on when we're loaded
+
+
+; Process /MACHINE: parameter.
+
+GPGotMachine:
+ push si ; save current location
+ push ds ; in param string
+
+ push cs
+ pop ds
+ mov di,offset _text:MachineName ; es:di -> MachineName
+
+GPNextTbl:
+ xor bx,bx
+
+GPNextName:
+ mov si,offset _text:StringParm ; ds:si -> StringParm
+
+GPChkNext:
+ cmp byte ptr es:[di],0FFh ; end of name table?
+ jz GPNoName
+
+ lodsb ; char from StringParm
+ cmp al,'A' ; force to lower case for match
+ jb @f ; (might be numeric, so don't just OR)
+ cmp al,'Z'
+ ja @f
+ or al,20h
+@@:
+ cmp al,es:[di] ; match so far?
+ jnz GPFlushName
+
+ or al,al ; finished if matched up to & incl NULL
+ jz GPFoundName
+
+ inc di ; still matches, check next char
+ jmp short GPChkNext
+
+GPFlushName:
+ inc bx
+GPFN2:
+ inc di
+ cmp byte ptr es:[di],0FFh
+ jz GPNoName
+
+ cmp byte ptr es:[di],0
+ jnz GPFN2
+ inc di
+ jmp short GPNextName
+
+GPFoundName:
+ mov cs:[MachineNum],bx ; found a match, remember which entry
+ jmp short GPNameDone ; it is for later
+
+GPNoName:
+
+ cmp di,offset _text:AltNameTbl
+ ja GPBadName
+ mov di,offset _text:AltNameTbl
+ jmp short GPNextTbl
+
+GPNameDone:
+ pop ds ; recover parm line pointer
+ pop si
+ jmp GPNextParm
+
+GPBadName:
+ pop ds ; clear stack and error out...
+ pop si
+ jmp GPBadParm
+
+; Process /NUMHANDLES= parameter.
+
+GPGotHands:
+ cmp dx,MAXHANDLES
+ jna @f
+ jmp GPBadParm
+@@:
+ or dx,dx ; Zero?
+ jnz @f
+ jmp GPBadParm
+@@:
+ push es
+ mov es,hiseg
+ assume es:funky
+ mov [cHandles],dx ; Store it
+ pop es
+ assume es:nothing
+
+
+ mov dx,offset StartMsg ; display descriptive message
+ call GPPrintIt
+
+ push es
+ mov es,hiseg
+ assume es:funky
+ mov ax,[cHandles]
+ pop es
+ assume es:nothing
+
+ call GPPrintAX
+ mov dx,offset HandlesMsg
+ call GPPrintIt
+ jmp GPNextParm
+
+GPGotMin:
+ cmp dx,64 ; process /hmamin= parameter
+ jna @f
+ jmp GPBadParm
+@@:
+ push dx
+ mov cs:[MinHMASize],dx
+
+ mov dx,offset HMAMINMsg ; print a descriptive message
+ call GPPrintIt
+ mov ax,cs:[MinHMASize]
+ call GPPrintAX
+ mov dx,offset KMsg
+ call GPPrintIt
+
+ pop dx
+ mov cl,10 ; Convert from K to bytes
+ shl dx,cl
+ mov cs:[MinHMASize],dx
+ jmp short GPNextParm
+
+
+; Process /SHADOWRAM: parameter
+
+GPGotShadow:
+ mov ax,word ptr [StringParm]
+ or ax,2020h
+ xor bl,bl
+ cmp ax,'no' ; ON ? - means we leave it alone
+ jz GPSetShadow
+ inc bl
+ cmp ax,'fo' ; OFF ? - means we turn it off
+ jz GPSetShadow
+ jmp GPBadParm
+
+GPSetShadow:
+ mov fShadowOff,bl ; NZ if Shadow RAM should be turned off
+ jmp short GPNextParm
+
+
+; Process /CPUCLOCK: parameter
+
+GPGotCPUClock:
+
+ mov ax,word ptr [StringParm]
+ or ax,2020h
+ xor bl,bl
+ cmp ax,'fo' ; OFF ? - means we don't worry about it
+ jz GPSetClock
+ inc bl
+ cmp ax,'no' ; ON ? - means we preserve CPU clock
+ jz GPSetClock ; rate
+ jmp GPBadParm
+
+GPSetClock:
+ mov fCPUClock,bl ; NZ if clock rate preserved
+ jmp short GPNextParm
+
+
+; Process /INT15= parameter
+
+GPGotInt15:
+ cmp dx, 64 ; atleast 64K
+ jae @f
+ jmp GPBadParm
+@@: call GetInt15Memory
+ cmp ax, dx ; enuf Ext Mem ?
+ jae @f
+ jmp GPBadParm
+@@: mov [Int15MemSize], dx
+ ; Fall through to GetNextParm
+
+GPNextParm:
+ mov ax,cs:[GPRegSave] ; are we at the end of the line?
+ cmp al,13 ; may not be needed any longer...
+ je GPExit
+ cmp al,10
+ je GPExit
+ jmp GPNextArg
+
+GPExit:
+ pop ds
+ ret
+
+GetParms endp
+
+; Get the next character from DS:SI, set CY if it's an EOL (CR, LF), set
+; Z if it's a space
+
+GPOffEOL dw -1
+
+ public GPGetChar
+
+GPGetChar proc near
+
+ cmp si,cs:[GPOffEOL] ; are we already at EOL?
+ jnb GPAtEOL
+
+ lodsb ; no, get next char
+ cmp al,10 ; is this the EOL?
+ je GPHitEOL
+ cmp al,13
+ je GPHitEOL
+
+ cmp al,' ' ; set Z if blank
+
+ clc
+ ret
+
+GPHitEOL:
+ mov cs:[GPOffEOL],si ; save EOL offset once
+GPAtEOL:
+ stc
+ ret
+
+GPGetChar endp
+
+
+;*----------------------------------------------------------------------*
+
+GPPrintIt proc near
+
+ push ds ; Save current DS
+ push cs ; Set DS=CS
+ pop ds
+ mov ah,9
+ int 21h
+ pop ds ; Restore DS
+ ret
+
+GPPrintIt endp
+
+;*----------------------------------------------------------------------*
+
+GPPrintAX proc near
+
+ mov cx,10
+ xor dx,dx
+ div cx
+ or ax,ax
+ jz GPAPrint
+ push dx
+ call GPPrintAX
+ pop dx
+GPAPrint:
+ add dl,'0'
+ mov ah,2
+ int 21h
+ ret
+
+GPPrintAX endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* InitHandles - *
+;* *
+;* Initialize the Extended Memory Handle Table *
+;* *
+;* ARGS: None *
+;* RETS: None *
+;* REGS: AX, BX, CX, and Flags are clobbered *
+;* *
+;*----------------------------------------------------------------------*
+
+ assume ds:_text
+
+ public InitHandles
+
+InitHandles proc near
+ push es
+ mov es,hiseg
+ assume es:funky
+ mov cx,[cHandles]
+
+; Init the Handle table.
+
+ mov bx,[KiddValley]
+
+ xor ax,ax
+IHTabLoop:
+ mov [bx].Flags,UNUSEDFLAG
+ mov [bx].cLock,al
+ mov [bx].Base,ax
+ mov [bx].Len,ax
+ if keep_cs
+ mov [bx].Acs,ax
+ endif
+ add bx,SIZE Handle
+ loop IHTabLoop
+
+ mov [KiddValleyTop],bx ; save top for handle validation
+ pop es
+ assume es:nothing
+ ret
+
+InitHandles endp
+
+_text ends
+
+ifdef debug_tsr
+
+EndStmt equ <end ExeStart>
+
+STACK segment stack 'STACK'
+ db 1024 dup (?)
+STACK ends
+
+else
+
+EndStmt equ <end>
+
+endif
+
+ EndStmt
diff --git a/private/mvdm/dos/v86/dev/himem/himem4.asm b/private/mvdm/dos/v86/dev/himem/himem4.asm
new file mode 100644
index 000000000..085d87847
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem4.asm
@@ -0,0 +1,674 @@
+;/* himem4.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; *
+; * williamh 25-Sept-1992 Added RequestUMB and ReleaseUMB
+; *
+; * daveh 1-Feb-1994 Changed to do mem management on 32 bit side
+; */
+ page 95,160
+ title himem4 - block allocation stuff
+
+ .xlist
+ include himem.inc
+ include xmssvc.inc
+ include vint.inc
+ .list
+
+; The stuff we provide:
+
+ public Version
+ public QueryExtMemory
+ public AllocExtMemory
+ public FreeExtMemory
+ public LockExtMemory
+ public UnlockExtMemory
+ public GetExtMemoryInfo
+ public ReallocExtMemory
+ public end_of_hiseg
+ public textseg
+ public KiddValley
+ public KiddValleyTop
+ public cHandles
+ public RequestUMB
+ public ReleaseUMB
+
+; externals from himem.asm
+
+ extrn PrevInt15:dword
+ extrn Moveit:word
+ extrn fHMAMayExist:byte
+ extrn fHMAExists:byte
+ extrn winbug_fix:word
+ extrn FLclEnblA20:far
+ extrn FLclDsblA20:far
+_text ends
+
+funky segment word public 'funky'
+ assume cs:funky,ds:_text
+
+ extrn end_of_funky_seg:near
+
+ org HISEG_ORG
+
+ public LEnblA20
+ public LDsblA20
+
+end_of_hiseg dw end_of_funky_seg
+textseg dw _text
+KiddValley dw end_of_funky_seg; The address of the handle table
+KiddValleyTop dw 0 ; end of handle table
+cHandles dw DEFHANDLES ; number of handles
+LEnblA20 dd _text:FLclEnblA20
+LDsblA20 dd _text:FLclDsblA20
+;*----------------------------------------------------------------------*
+;* *
+;* Get XMS Version Number - FUNCTION 00h *
+;* *
+;* Returns the XMS version number *
+;* *
+;* ARGS: None *
+;* RETS: AX = XMS Version Number *
+;* BX = Internal Driver Version Number *
+;* DX = 1 if HMA exists, 0 if it doesn't *
+;* REGS: AX, BX and DX are clobbered *
+;* *
+;* INTERNALLY REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+
+Version proc far
+
+ mov ax,XMSVersion
+ mov bx,HimemVersion
+ xor dh,dh
+
+; Is Int 15h hooked?
+
+ cmp word ptr [PrevInt15][2],0 ; Is the segment non-zero?
+ jne VHooked
+ mov dl,[fHMAMayExist] ; No, return the status at
+ ret ; init time.
+
+VHooked:
+ mov dl,[fHMAExists] ; Yes, return the real status
+ ret
+
+Version endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* QueryExtMemory - FUNCTION 08h *
+;* *
+;* Returns the size of the largest free extended memory block in K *
+;* *
+;* ARGS: None *
+;* RETS: AX = Size of largest free block in K. BL = Error code *
+;* DX = Total amount of free extended memory in K *
+;* REGS: AX, BX, DX, DI, SI and Flags clobbered *
+;* *
+;* INTERNALLY REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+QueryExtMemory proc far
+
+ mov bl,0 ; assume no error
+ XMSSVC XMS_QUERYEXTMEM
+ test dx,dx
+ jne QEM20
+
+ mov bl,ERR_OUTOMEMORY
+QEM20:
+ ret
+
+QueryExtMemory endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* AllocExtMemory - FUNCTION 09h *
+;* *
+;* Reserve a block of extended memory *
+;* *
+;* ARGS: DX = Amount of K being requested *
+;* RETS: AX = 1 of successful, 0 otherwise. BL = Error Code *
+;* DX = 16-bit handle to the allocated block *
+;* REGS: AX, BX, DX and Flags clobbered *
+;* *
+;* Notice: called internally from ReallocExtMemory *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+hFreeBlock dw ?
+hUnusedBlock dw ?
+
+AllocExtMemoryNear proc near
+AllocExtMemoryNear endp
+AllocExtMemory proc far
+
+ call FunkyCLI ; This is a non-reentrant function
+
+; Scan the handle table looking for an unused handle
+
+ xor ax,ax
+ mov [hUnusedBlock],ax
+ mov bx,[KiddValley]
+ mov cx,[cHandles] ; Loop through the handle table
+
+; Have we already found a free block which is large enough?
+
+AEMhLoop:
+
+ cmp [bx].Flags,UNUSEDFLAG ; Is this block unused?
+ jne AEMNexth ; No, get the next handle
+
+ mov [hUnusedBlock],bx ; save this guy away
+ jmp AEMGotHandle
+
+AEMNexth:
+ add bx,SIZE Handle ; go check the next handle
+ loop AEMhLoop
+
+; We are at the end of the handle table and we didn't an unused
+; handle
+
+ jmp AEMOOHandles ; No, Case 4 - We're out of handles
+
+AEMGotHandle:
+
+ mov di,[hUnusedBlock]
+
+ XMSSVC XMS_ALLOCBLOCK ; ax=Base and dx=Size
+ or ax,ax
+ jz AEMOOMemory
+
+ mov [di].Base,ax
+ mov [di].Len,dx
+ mov [di].Flags,USEDFLAG ; New.Flags = USED
+
+ if keep_cs
+ mov ax,callers_cs
+ mov [si].Acs,ax ; keep track of allocator's cs:
+ endif
+
+ mov dx,[hUnusedBlock]
+ mov ax,1
+ xor bl,bl
+ ret
+
+AEMOOMemory:
+ mov bl,ERR_OUTOMEMORY
+ jmp short AEMErrRet
+
+AEMOOHandles:
+ mov bl,ERR_OUTOHANDLES
+AEMErrRet:
+ xor ax,ax ; Return failure
+ mov dx,ax
+ ret
+AllocExtMemory endp
+
+;*----------------------------------------------------------------------*
+;* *
+;* FreeExtMemory - FUNCTION 0Ah *
+;* *
+;* Frees a block of extended memory *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* RETS: AX = 1 if successful, 0 otherwise. BL = Error code *
+;* REGS: AX, BX, CX, DX, SI, DI and Flags clobbered *
+;* *
+;* called internally from ReallocExtMemory *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+FreeExtMemoryNear proc near
+FreeExtMemoryNear endp
+
+FreeExtMemory proc far
+ call FunkyCLI ; This is a non-reentrant function
+
+ call ValidateHandle ; Make sure handle is valid
+ jnc FEMBadh
+ mov si,dx ; Move the handle into SI
+
+ cmp [si].cLock,0 ; make sure it points to unlocked block
+ jne FEMLockedh
+
+ mov [si].Flags,UNUSEDFLAG ; mark it as UNUSED
+ cmp [si].Len,0 ; if zero length block
+ jz FEMExit ; done if it was zero length
+
+ mov ax,[si].Base
+ mov dx,[si].Len
+ XMSSVC XMS_FREEBLOCK ; ax=base dx=size in k
+ or ax,ax
+ je FEMBadh
+
+FEMExit:
+
+ mov ax,1 ; Return success
+ xor bl,bl
+ ret
+
+FEMBadh:
+ mov bl,ERR_INVALIDHANDLE
+ jmp short FEMErrExit
+
+FEMLockedh:
+ mov bl,ERR_EMBLOCKED
+FEMErrExit:
+ xor ax,ax ; Return failure
+ ret
+FreeExtMemory endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* LockExtMemory - FUNCTION 0Ch *
+;* *
+;* Locks a block of extended memory *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* RETS: AX = 1 of successful, 0 otherwise. BL = Error code *
+;* DX:BX = 32-bit linear address of the base of the memory block *
+;* REGS: AX, BX, DX and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+LockExtMemory proc far
+
+ call FunkyCLI ; This is a non-reentrant function
+
+ call ValidateHandle ; Is the handle valid?
+ jnc LEMBadh
+ mov bx,dx ; Move the handle into BX
+
+; Are we at some preposterously large limit?
+
+ cmp [bx].cLock,0FFh
+ je LEMOverflow
+
+ inc [bx].cLock ; lock the block
+
+ mov dx,[bx].Base ; return the 32-bit address of base
+ mov bx,dx
+ shr dx,6
+ shl bx,10
+
+ mov ax,1 ; return success
+ ret
+
+LEMBadh:
+ mov bl,ERR_INVALIDHANDLE
+ jmp short LEMErrExit
+
+LEMOverflow:
+ mov bl,ERR_LOCKOVERFLOW
+LEMErrExit:
+ xor ax,ax ; Return failure
+ mov dx,ax
+ ret
+
+LockExtMemory endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* UnlockExtMemory - FUNCTION 0Dh *
+;* *
+;* Unlocks a block of extended memory *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* RETS: AX = 1 if successful, 0 otherwise. BL = Error code *
+;* REGS: AX, BX and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+UnlockExtMemory proc far
+
+ call FunkyCLI ; This is a non-reentrant function
+
+ call ValidateHandle ; Is the handle valid?
+ jnc UEMBadh
+ mov bx,dx ; Move the handle into BX
+
+ cmp [bx].cLock,0 ; is handle locked?
+ je UEMUnlocked ; No, return error
+
+ dec [bx].cLock ; Unlock the block
+
+ mov ax,1 ; Return success
+ xor bl,bl
+ ret
+
+UEMUnlocked:
+ mov bl,ERR_EMBUNLOCKED
+ jmp short UEMErrExit
+
+UEMBadh:
+ mov bl,ERR_INVALIDHANDLE
+UEMErrExit:
+ xor ax,ax
+ ret
+
+UnlockExtMemory endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* GetExtMemoryInfo - FUNCTION 0Eh *
+;* *
+;* Gets other information about an extended memory block *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* RETS: AX = 1 if successful, 0 otherwise. BL = Error code *
+;* BH = EMB's lock count *
+;* BL = Total number of unused handles in the system *
+;* DX = EMB's length *
+;* REGS: AX, BX, CX, DX and Flags clobbered *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+GetExtMemoryInfo proc far
+
+ call FunkyCLI ; This is a non-reentrant function
+
+ call ValidateHandle ; is the handle valid?
+ jnc GEMBadh
+ mov si,dx ; Move the handle into SI
+
+ xor al,al ; count number of UNUSED handles
+ mov bx,[KiddValley]
+ mov cx,[cHandles] ; Loop through the handle table
+GEMLoop:
+ cmp [bx].Flags,USEDFLAG ; Is this handle in use?
+ je GEMNexth ; Yes, continue
+ inc al ; No, increment the count
+GEMNexth:
+ add bx,SIZE Handle
+ loop GEMLoop
+
+ mov dx,[si].Len ; Length in DX
+ mov bh,[si].cLock ; Lock count in BH
+ mov bl,al
+ mov ax,1
+ ret
+
+GEMBadh:
+ mov bl,ERR_INVALIDHANDLE
+ xor ax,ax
+ ret
+
+GetExtMemoryInfo endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* ReallocExtMemory - FUNCTION 0Fh *
+;* *
+;* Reallocates a block of extended memory *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* BX = new size for block *
+;* RETS: AX = 1 if successful, 0 otherwise. BL = Error code *
+;* REGS: trashes si,di,bx,cx,dx *
+;* *
+;* INTERNALLY NON-REENTRANT *
+;* *
+;*----------------------------------------------------------------------*
+
+; Define our memory move structure for calling the move function
+
+ReallocExtMemory proc far
+
+ call FunkyCLI ; This is a non-reentrant function
+
+ call ValidateHandle ; is the handle valid?
+ mov si,dx ; Move the handle into SI
+ mov dx,bx ; Move the new length into dx
+ mov bl,ERR_INVALIDHANDLE
+ jnc REMError
+
+ cmp [si].cLock,0 ; We can only work on unlocked EMBs
+ mov bl,ERR_EMBLOCKED
+ jnz REMError
+
+ mov bx,dx
+ cmp [si].Len,bx
+ je REMExit
+
+ mov ax,[si].Base
+ mov dx,[si].Len
+ XMSSVC XMS_REALLOCBLOCK ; ax = old base, dx = old size
+ cmp cx,0 ; cx = new base, bx = new size
+ je REM20
+
+ mov [si].Base,cx
+ mov [si].Len,bx
+REMExit:
+ mov ax,1 ; succesful return
+ xor bl,bl ; non-documented no-error return
+ ret
+
+REM20:
+ mov bl,ERR_OUTOMEMORY
+REMError:
+ xor ax,ax
+ ret
+
+ReallocExtMemory endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* FindAdjacent unused blocks *
+;* *
+;* Scan through handle list looking for blocks adjacent *
+;* to a given handle. *
+;* *
+;* ARGS: SI handle of original block *
+;* RETS: DI = handle of adjacent block below or zero if none *
+;* BP = handle of adjacent block above or zero if none *
+;* *
+;* TRASHES: AX,BX,CX,DX *
+;* *
+;* messes with handle table - not reentrant - assumes ints disabled *
+;* *
+;*----------------------------------------------------------------------*
+
+FindAdjacent proc near
+
+ mov ax,[si].Base ; look for blocks ending here
+ mov dx,[si].Len
+ add dx,ax ; and ending here
+
+ xor di,di ; initialize to fail condition
+ mov bp,di
+
+ mov bx,[KiddValley] ; prepare to loop thru handle tab
+ mov cx,[cHandles]
+
+ push si ; preserve original handle
+
+FindAdj1:
+ cmp [bx].Flags,FREEFLAG
+ jnz FindAdj3 ; ignore blocks that aren't UNUSED
+ mov si,[bx].Base
+ cmp dx,si ; found beg block?
+ jnz FindAdj2 ; skip if not
+ mov bp,bx ; remember the handle
+ or di,di ; did we already find a follower?
+ jnz FindAdj9 ; we're done if so
+
+FindAdj2:
+ add si,[bx].Len ; find length
+ cmp si,ax ; does this block end at spec addr?
+ jnz FindAdj3 ; skip if not
+ mov di,bx ; remember the handle
+ or bp,bp ; did we already find a leader?
+ jnz FindAdj9 ; we're done if so
+
+FindAdj3:
+ add bx,SIZE handle
+ loop FindAdj1
+
+FindAdj9:
+ pop si ; restore original handle
+ ret
+;
+
+FindAdjacent endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* ValidateHandle - *
+;* *
+;* Validates an extended memory block handle *
+;* *
+;* ARGS: DX = 16-bit handle to the extended memory block *
+;* RETS: Carry is set if the handle is valid *
+;* REGS: Preserved except the carry flag *
+;* *
+;*----------------------------------------------------------------------*
+
+ValidateHandle proc near
+
+ pusha ; Save everything
+ mov bx,dx ; Move the handle into BX
+
+; The handle must be equal to or above "KiddValley".
+
+ cmp bx,[KiddValley]
+ jb VHOne
+
+; The handle must not be above "KiddValleyTop".
+
+ cmp bx,[KiddValleyTop]
+ ja VHOne
+
+; (The handle-"KiddValley") must be a multiple of a handle's size.
+
+ sub dx,[KiddValley]
+ mov ax,dx
+ xor dx,dx
+ mov cx,SIZE Handle
+ div cx
+ or dx,dx ; Any remainder?
+ jnz VHOne ; Yup, it's bad
+
+; Does the handle point to a currently USED block?
+
+ cmp [bx].Flags,USEDFLAG
+ jne VHOne ; This handle is not being used.
+
+; The handle looks good to me...
+
+ popa ; Restore everything
+ stc ; Return success
+ ret
+
+VHOne:
+
+; It's really bad.
+ popa ; Restore everything
+ clc ; Return failure
+ ret
+
+ValidateHandle endp
+
+BlkMovX proc near
+ assume ds:_text
+ jmp MoveIt
+BlkMovX endp
+
+;-----------------------------------------------------------------------;
+;This is the routine for XMS function 16, request UMB.
+;
+; Input:
+; (DX) = requested size in paragraphs
+;
+; Output:
+; (AX) = 1 if request is granted and
+; (BX) = segment address of the requested block
+; (DX) = actual size allocated in paragraphs
+; = 0 if requtest failed and
+; (BL) = 0B0h if a smaller UMB is available
+; (BL) = 0B1h if no UMBs are available
+; (DX) = largest UMB available.
+;Modified: AX, BX, DX
+;
+;NOTE:
+;The funcition was implemented in the 32bits xms because
+;any memory we need for house keeping purpose are kept in extented memory
+;rather than in the UMB itself(DOS arena). Of course, it has the penalty
+;of ring transition each time a request being made. However, the major
+;allocator of UMBs is IO.SYS, the device driver of MS-DOS for devicehigh
+;and loadhigh during bootstrap. This should adjust the penalty a little bits.
+;
+;-----------------------------------------------------------------------;
+RequestUMB proc far
+ XMSSVC XMS_REQUESTUMB
+ ret
+RequestUMB endp
+
+
+;-----------------------------------------------------------------------;
+;This is the routine for XMS function 17, release UMB
+;
+; Input:
+; (DX) = segment of the UMB block to be released
+;
+; Output:
+; (AX) = 1 if the block was released successfully.
+; (AX) = 0 if the block couldn't be released and
+; (BL) = 0B2h if the given segment is invalid
+; Modified: AX, BX
+;
+;Note:
+; See note in RequestUMB
+;-----------------------------------------------------------------------;
+
+ReleaseUMB proc far
+ XMSSVC XMS_RELEASEUMB
+ ret
+ReleaseUMB endp
+
+ PUBLIC FunkyCLI
+FunkyCLI:
+ FCLI
+ ret
+
+ PUBLIC FunkySTI
+FunkySTI:
+ FSTI
+ ret
+
+;*----------------------------------------------------------------------*
+;* *
+;* NOTE: RequestUMB and ReleaseUMB will not be implemented by HIMEM. *
+;* *
+;*----------------------------------------------------------------------*
+
+funky ends
+ end
+
diff --git a/private/mvdm/dos/v86/dev/himem/himem5.asm b/private/mvdm/dos/v86/dev/himem/himem5.asm
new file mode 100644
index 000000000..7dd668511
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/himem5.asm
@@ -0,0 +1,485 @@
+;/* himem5.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; */
+ page 95,160
+ title himem5.asm - Extended Memory Moves
+
+;
+;----------------------------------------------------------------------------
+;
+; M001 : inserted a jmp $+2 between an out & in while reading the ISR
+; M003 : fixed bug to do with not returning int 15h errors on a blockmove
+; call.
+;
+;----------------------------------------------------------------------------
+;
+ .xlist
+ include himem.inc
+ include xmssvc.inc
+ include vint.inc
+ .list
+
+
+ extrn TopOfTextSeg:word
+ extrn hiseg:word
+ extrn pReqHdr:dword
+ extrn dd_int_loc:word
+ extrn interrupt:word
+
+
+ extrn fInHMA:byte
+ extrn EndText:byte
+_text ends
+
+funky segment word public 'funky'
+ assume cs:funky
+
+ extrn KiddValley:word
+ extrn KiddValleyTop:word
+ extrn end_of_hiseg:word
+ extrn textseg:word
+ extrn LEnblA20:dword
+ extrn LDsblA20:dword
+ extrn FunkyCLI:near
+ extrn FunkySTI:near
+
+
+;******************************************************************************
+;
+; MoveBlock
+; XMM Move Extended Memory Block
+;
+; Entry:
+; ES:SI Points to structure containing:
+; bCount dd ? ; Length of block to move
+; SourceHandle dw ? ; Handle for souce
+; SourceOffset dd ? ; Offset into source
+; DestHandle dw ? ; Handle for destination
+; DestOffset dd ? ; Offset into destination
+;
+; Return:
+; AX = 1 Success
+; AX = 0 Failure
+; Error code in BL
+;
+; Registers Destroyed:
+; Flags
+;
+;------------------------------------------------------------------------------
+
+ public MoveBlock
+
+MoveBlock proc far
+ assume ds:_text
+
+ call FunkySTI ; Be nice
+ push bp ; Set up stack frame so we
+ mov bp, sp ; can have local variables
+ sub sp, 18 ; Space for local variables
+
+; Following Ordering is used in xms.dll and should be retained
+; as is or changed in both places.
+
+Count = -4 ; Local DWORD for byte count
+SrcLinear = -8
+DstLinear = -12
+MEReturn = -14 ; Local WORD for return code
+SrcHandle = -16
+DstHandle = -18
+ push bx
+ push dx
+
+ xor ax, ax
+ mov [bp.MEReturn], ax ; Assume success
+ mov [bp.SrcHandle], ax
+ mov [bp.DstHandle], ax
+ mov ax, word ptr es:[si].bCount ; Pick up length specified
+ mov word ptr [bp.Count], ax
+ mov cx, word ptr es:[si].bCount+2
+ mov word ptr [bp.Count+2], cx
+ or cx, ax
+ jcxz MEM2_Exit ; Exit immediately if zero
+
+ lea bx, [si].SourceHandle ; Normalize Source
+ call GetLinear ; Linear address in DX:AX
+ jc MEM2_SrcError ; Have Dest Error Code
+
+ mov word ptr [bp.SrcLinear], ax ; Save Linear address
+ mov word ptr [bp.SrcLinear+2], dx
+ mov [bp.SrcHandle], bx ; Save Handle for Unlock
+
+ lea bx, [si].DestHandle ; Normalize Destination
+ call GetLinear
+ jc MEM2_Error
+
+ mov word ptr [bp.DstLinear], ax ; Save Linear address
+ mov word ptr [bp.DstLinear+2], dx
+ mov [bp.DstHandle], bx ; Save Handle for Unlock
+
+ shr word ptr [bp.Count+2], 1 ; Make word count
+ rcr word ptr [bp.Count], 1
+ jc MEM2_InvCount ; Odd count not allowed
+
+ call LEnblA20
+ cmp ax, 1
+ jne MEM2_Error
+
+ XMSSVC XMS_MOVEBLOCK ; Call Worker
+ ; Parameters on the stack
+
+ call LDSblA20
+ cmp ax, 1
+ jne MEM2_Error
+
+MEM2_Exit:
+ mov bx, [bp.SrcHandle] ; Unlock Handles if necessary
+ or bx, bx
+ jz NoSrcHandle
+ dec [bx].cLock ; Unlock Source
+NoSrcHandle:
+ mov bx, [bp.DstHandle]
+ or bx, bx
+ jz NoDstHandle
+ dec [bx].cLock ; Unlock Destination
+NoDstHandle:
+ pop dx
+ pop bx
+ mov ax, 1
+ cmp word ptr [bp.MEReturn], 0
+ jz MEM2_Success
+ dec ax
+ mov bl, byte ptr [bp.MEReturn]
+MEM2_Success:
+ mov sp, bp ; Unwind stack
+ pop bp
+ ret
+
+MEM2_SrcError:
+ cmp bl, ERR_LENINVALID ; Invalid count
+ je MEM2_Error ; yes, no fiddle
+ sub bl, 2 ; Convert to Source error code
+ jmp short MEM2_Error
+MEM2_InvCount:
+ mov bl, ERR_LENINVALID
+MEM2_Error:
+ mov byte ptr [bp.MEReturn], bl ; Pass error code through
+ jmp short MEM2_Exit
+MoveBlock endp
+
+;*******************************************************************************
+;
+; GetLinear
+; Convert Handle and Offset (or 0 and SEG:OFFSET) into Linear address
+; Locks Handle if necessary
+;
+; Entry:
+; ES:BX Points to structure containing:
+; Handle dw
+; Offset dd
+; [BP.Count] Count of bytes to move
+;
+; Return:
+; BX Handle of block (0 if conventional)
+; AX:DX Linear address
+; CARRY => Error
+; Error code in BL
+;
+; Registers Destroyed:
+; Flags, CX, DI
+;
+;-------------------------------------------------------------------------------
+
+GetLinear proc near
+ push si
+ call FunkyCLI ; NO INTERRUPTS
+ mov si, word ptr es:[bx+2] ; Offset from start of handle
+ mov di, word ptr es:[bx+4] ; in DI:SI
+ mov bx, word ptr es:[bx] ; Handle in bx
+ or bx, bx
+ jz GL2_Conventional
+
+ test [bx].Flags, USEDFLAG ; Valid Handle?
+ jz GL2_InvHandle
+
+ mov ax, [bx].Len ; Length of Block
+ mov cx, 1024
+ mul cx ; mul is faster
+ sub ax, si
+ sbb dx, di ; DX:AX = max possible count
+ jc GL2_InvOffset ; Base past end of block
+ sub ax, word ptr [bp.Count]
+ sbb dx, word ptr [bp.Count+2]
+ jc GL2_InvCount ; Count too big
+
+ inc [bx].cLock ; Lock the Handle
+ mov ax, [bx].Base
+ mul cx
+ add ax, si ; Linear address
+ adc dx, di ; in DX:AX
+
+GL2_OKExit:
+ clc
+GL2_Exit:
+ call FunkySTI
+ pop si
+ ret
+
+GL2_Conventional:
+ mov ax, di ; Convert SEG:OFFSET into
+ mov dx, 16 ; 24 bit address
+ mul dx
+ add ax, si
+ adc dx, 0 ; DX:AX has base address
+ mov di, dx
+ mov si, ax
+ add si, word ptr [bp.Count] ; Get End of Block + 1 in DI:SI
+ adc di, word ptr [bp.Count+2]
+
+ cmp di, 010h ; Make sure it doesn't wrap
+ ja GL2_InvCount ; past the end of the HMA
+ jb GL2_OKExit
+ cmp si, 0FFF0h
+ jbe GL2_OKExit ; Must be < 10FFF0h
+GL2_InvCount:
+ mov bl, ERR_LENINVALID
+ jmp short GL2_Error
+
+GL2_InvHandle:
+ mov bl, ERR_DHINVALID ; Dest handle invalid
+ jmp short GL2_Error
+
+GL2_InvOffset:
+ mov bl, ERR_DOINVALID ; Dest Offset invalid
+GL2_Error:
+ stc
+ jmp short GL2_Exit
+
+GetLinear endp
+
+
+;*----------------------------------------------------------------------*
+;* *
+;* pack_and_truncate - packs everything down into the *
+;* lowest available memory and sets up variable for driver *
+;* truncation, then terminates. *
+;* *
+;*----------------------------------------------------------------------*
+
+ public pack_and_truncate
+pack_and_truncate proc far
+
+ assume ds:_text,es:nothing
+ push ds
+ mov dx, offset _text:EndText ; end of text seg
+ add dx, 15
+ and dx, not 15 ; size of text seg including init code
+
+ mov ax, TopOfTextSeg ; end of resident text seg
+ or ax, ax
+ jnz @f
+ xor di, di
+ pop es
+ jmp short InitFailed
+
+@@:
+ add ax, 15
+ and ax, not 15 ; size of resident text seg
+
+ sub dx, ax ; size of memory whole between
+ shr dx, 4 ; resident text seg and funky seg
+ ; The funky seg should be moved down
+ ; 'dx' number of paragraphs
+ mov ax, hiseg ; Get the current seg at which funky
+ ; is running from
+
+ cmp ax, dx ; If funky is already running from a
+ ; segment value less than 'dx'
+ ; number of paras funky can be
+ ; moved to zero segment only
+ jbe @f
+ mov ax, dx ; ax has min of seg of funky
+ ; & memory whole size in para
+@@:
+ or ax, ax ; if funky is to be moved by zero
+ ; paras our job is over
+ jnz @f
+ mov es, hiseg
+ assume es:funky
+ mov di, es:KiddValleyTop
+ jmp NoMoveEntry
+@@:
+ mov dx, hiseg ; current segment value of funky
+ push ds
+ pop es
+ assume es:_text
+ mov ds, dx ; which is our source for move
+ assume ds:nothing
+ sub dx, ax ; less the 'paras' to be shrinked
+ mov hiseg, dx ; is the new seg value of funky
+ mov es, dx ; which is our dest. for the move
+ assume es:nothing
+ mov si, HISEG_ORG
+ mov di, si
+ mov cx, end_of_hiseg
+ sub cx, si ; size of funky without ORG
+ cld
+ rep movsb ; move it!!!
+
+;;
+MoveHandleTable:
+ inc di ; round to word value
+ and di,0fffeh
+
+ mov si,di
+ assume es:funky
+ xchg si,es:KiddValley ; replace KiddValley with new location
+ mov cx,es:KiddValleyTop
+ sub cx,si
+
+ rep movsb ; move the handle table down
+ mov es:KiddValleyTop,di ; update end of table
+ assume es:nothing
+
+NoMoveEntry:
+ pop ds ; restore _text segment
+ assume ds:_text
+ add di,15 ; round new segment to paragraph
+ and di,not 15
+
+InitFailed:
+ ifdef debug_tsr
+ mov ax,ds ; # paragraphs to keep =
+ mov dx,es ; (ES - DS) +
+ sub dx,ax ; (DI >> 4) +
+ mov ax,di ; 10h
+ shr ax,4
+ add dx,ax
+ add dx,10h ; PSP size
+ mov ax,3100h
+ int 21h
+ else
+ lds si,[pReqHdr] ; discard the initialization code
+ mov word ptr ds:[si].Address[0],di
+ mov word ptr ds:[si].Address[2],es
+ mov ds:[si].Status,100h ; Store return code - DONE
+
+ pop ax ; throw away return from InitDriver
+
+ push cs
+ call an_iret ; call an iret in our segment
+
+ or di, di
+ jz we_are_quitting
+
+ mov ds, textseg
+ assume ds:_text
+ mov ax, hiseg
+ mov dd_int_loc,offset Interrupt ; replace Interrupt with
+ ; tiny permanent stub
+
+ mov ax, KiddValleyTop
+ sub ax, KiddValley
+ add ax, end_of_hiseg
+ sub ax, HISEG_ORG ; size of resident funky including
+ mov cs:HMALen, ax
+
+ mov ax, ((multMULT shl 8)+multMULTGETHMAPTR)
+ xor bx, bx ; in case there is no HMA handler
+ int 2fh
+ cmp cs:HMALen, bx
+ ja we_are_quitting
+
+ cmp di, HISEG_ORG
+ ja we_are_quitting
+
+ mov bx, cs:HMALen
+ mov ax, ((multMULT shl 8)+multMULTALLOCHMA)
+ int 2fh
+ cmp di, 0ffffh
+ je we_are_quitting
+
+ call MoveHi
+
+we_are_quitting:
+ pop bp
+ pop si
+ pop di
+ pop es
+ pop ds
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ ret ; far return from driver init
+ endif
+
+pack_and_truncate endp
+
+HMALen dw ? ; Length of funky (without init code)
+
+
+;
+;---------------------------------------------------------------------------
+;
+; procedure : MoveHi
+;
+;---------------------------------------------------------------------------
+;
+MoveHi proc near
+ push di ; remember offset in HMA
+ mov si, HISEG_ORG
+ mov cx, cs:HMALen
+ mov ax, textseg
+ mov ds, ax
+ assume ds:_text
+ mov ds, hiseg
+ assume ds:nothing
+ rep movsb ; move it to HMA
+ pop di ; get back offset in HMA
+ mov ax, HISEG_ORG
+ sub ax, di
+ shr ax, 1
+ shr ax, 1
+ shr ax, 1
+ shr ax, 1
+ mov bx, es
+ sub bx, ax
+
+
+ mov ax, textseg
+ mov ds, ax ; get addressability to text seg
+ assume ds:_text
+ mov fInHMA, 1 ; Flag that we are running from HMA
+
+ mov hiseg, bx
+ mov es, bx
+
+ mov di, TopOfTextSeg ; end of resident text code
+ mov ax, textseg
+ lds si, pReqHdr
+ assume ds:nothing
+
+ mov word ptr ds:[si].Address[0],di
+ mov word ptr ds:[si].Address[2],ax
+
+ ret
+MoveHi endp
+
+;
+an_iret proc near
+ FIRET
+an_iret endp
+
+ public end_of_funky_seg
+end_of_funky_seg:
+funky ends
+ end
+
+
diff --git a/private/mvdm/dos/v86/dev/himem/makefile b/private/mvdm/dos/v86/dev/himem/makefile
new file mode 100644
index 000000000..18e4d9612
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/makefile
@@ -0,0 +1,61 @@
+#;
+#; Microsoft Confidential
+#; Copyright (C) Microsoft Corporation 1988-1991
+#; All Rights Reserved.
+#;
+#
+# Make file for HIMEM.SYS
+#
+# Modification History
+#
+# Sudeepb 14-May-1991 Ported for NT XMS Support
+
+include ../../make.inc
+dest =himem.sys
+
+cinc =../../../../inc
+AINC =-I. -I$(cinc) -I../../../../inc
+
+
+#
+####################### Dependencies Begin Here ##########################
+#
+
+all: $(dest)
+ binplace $(dest)
+
+messages.asm : $(COUNTRY)\messages.asm
+ copy $(COUNTRY)\messages.asm .
+
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.bin del *.bin
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist himem.sys del himem.sys
+
+
+himem.obj: himem.asm himem.inc $(cinc)/xmssvc.inc $(cinc)/vint.inc
+
+himem1.obj: himem1.asm himem.inc $(cinc)/xmssvc.inc
+
+himem2.obj: himem2.asm himem.inc $(cinc)/xmssvc.inc
+
+messages.obj: messages.asm himem.inc
+
+himem4.obj: himem4.asm himem.inc $(cinc)/xmssvc.inc $(cinc)/vint.inc
+
+himem5.obj: himem5.asm himem.inc $(cinc)/xmssvc.inc $(cinc)/vint.inc
+
+himem.exe: himem.obj himem1.obj himem2.obj messages.obj himem4.obj himem5.obj
+ link16 himem+himem1+himem2+messages+himem4+himem5/map/li;
+
+himem.bin: himem.exe
+ reloc himem.exe himem.bin 0
+
+$(dest): himem.bin
+ stripdd himem.bin $(dest)
diff --git a/private/mvdm/dos/v86/dev/himem/usa-ms/messages.asm b/private/mvdm/dos/v86/dev/himem/usa-ms/messages.asm
new file mode 100644
index 000000000..3fc8b1d1d
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/himem/usa-ms/messages.asm
@@ -0,0 +1,102 @@
+;/* messages.asm
+; *
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1991
+; * All Rights Reserved.
+; *
+; * Modification History
+; *
+; * Sudeepb 14-May-1991 Ported for NT XMS support
+; */
+
+
+ page 95,160
+ title himem3 - Initialization messages
+
+ .xlist
+ include himem.inc
+ .list
+
+;*----------------------------------------------------------------------*
+;* DRIVER MESSAGES *
+;*----------------------------------------------------------------------*
+
+ public SignOnMsg
+ public ROMDisabledMsg
+ public UnsupportedROMMsg
+ public ROMHookedMsg
+ public BadDOSMsg
+ public NowInMsg
+ public On8086Msg
+ public NoExtMemMsg
+ public FlushMsg
+ public StartMsg
+ public HandlesMsg
+ public HMAMINMsg
+ public KMsg
+ public NoHMAMsg
+ public A20OnMsg
+ public HMAOKMsg
+ public InsA20Msg
+ public InsA20EndMsg
+ public InsExtA20msg
+ public NoA20HandlerMsg
+ public VDISKInMsg
+ public BadArgMsg
+ public EndText
+
+; Start of text subject to translation
+; Material appearing in single quotation marks should be translated.
+
+
+SignOnMsg db 13,10,'HIMEM: DOS XMS Driver, Version '
+ db '0' + (HimemVersion shr 8),'.'
+ db '0' + ((HimemVersion and 0ffh) / 16)
+ db '0' + ((HimemVersion and 0ffh) mod 16)
+ db ' - '
+ db DATE_String
+ db 13,10,'XMS Specification Version 2.0'
+ db 13,10,'Copyright 1988-1991 Microsoft Corp.'
+ db 13,10,'$'
+
+ROMDisabledMsg db 13,10, 'Shadow RAM disabled.$'
+UnsupportedROMMsg db 13,10,'WARNING: Shadow RAM disable not supported '
+ db 'on this system.$'
+ROMHookedMsg db 13,10,'WARNING: Shadow RAM is in use and can''t '
+ db 'be disabled.$'
+
+BadDOSMsg db 13,10,'ERROR: This HIMEM.SYS is for Windows NT.$'
+NowInMsg db 13,10,'ERROR: An Extended Memory Manager is already installed.$'
+On8086Msg db 13,10,'ERROR: HIMEM.SYS requires an 80x86-based machine.$'
+NoExtMemMsg db 13,10,'ERROR: No available extended memory was found.$'
+NoA20HandlerMsg db 13,10,'ERROR: Unable to control A20 line!$'
+VDISKInMsg db 13,10,'ERROR: VDISK memory allocator already installed.$'
+FlushMsg db 13,10,7,' XMS Driver not installed.',13,10,13,10,'$'
+
+StartMsg db 13,10,'$'
+HandlesMsg db ' extended memory handles available.$'
+HMAMINMsg db 13,10,'Minimum HMA size set to $'
+KMsg db 'K.$'
+InsA20Msg db 13,10,'Installed A20 handler number $'
+InsA20EndMsg db '.$'
+InsExtA20Msg db 13,10,'Installed external A20 handler.$'
+
+NoHMAMsg db 13,10,'WARNING: The High Memory Area is unavailable.'
+ db 13,10,'$'
+A20OnMsg db 13,10,'WARNING: The A20 Line was already enabled.'
+ db 13,10,'$'
+
+BadArgMsg db 13,10,'WARNING: Invalid parameter ignored: $'
+
+HMAOKMsg db 13,10,'64K High Memory Area is available.'
+ db 13,10,13,10,'$'
+
+ db 'This program is the property of Microsoft Corporation.'
+
+; end of material subject to translation
+
+
+EndText label byte
+_text ends
+ end
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdf.asm b/private/mvdm/dos/v86/dev/keyboard/kdf.asm
new file mode 100644
index 000000000..b8538e79c
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdf.asm
@@ -0,0 +1,397 @@
+
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; 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
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+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/private/mvdm/dos/v86/dev/keyboard/kdfbe.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbe.asm
new file mode 100644
index 000000000..dcfe4c5a6
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbe.asm
@@ -0,0 +1,1790 @@
+; ACUTE lc y added
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+; ****** CNS 12/18
+; ****** CNS 01/21 NUM PAD
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Belgium.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; NICK SAVAGE - IBM Corp.
+;; 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 0 ;;;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
+ 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: ;;
+ ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; 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/private/mvdm/dos/v86/dev/keyboard/kdfbg.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbg.asm
new file mode 100644
index 000000000..a9f5210b9
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbg.asm
@@ -0,0 +1,689 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;;
+;; This file contains the keyboard tables for Bulgaria
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; This file was generated YKEY.EXE V3.0 01/05/94
+;; Copyright (C) YST_HOME 1991-1994
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BG_LOGIC ;;
+ PUBLIC BG_866_XLAT ;;
+ PUBLIC BG_850_XLAT ;;
+ PUBLIC BG_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BU State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BG_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; <CTRL>+<RIGHT SHIFT> for Cyrillic mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT ;;
+ IFF LEFT_SHIFT ;; Primary mode
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;; secondary mode
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BU 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 BG_COMMON_XLAT ;;
+BG_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BU Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BG_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BU Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BG_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ DB 0DH, 46 ;; .
+ DB 010H, 44 ;; ,
+ DB 01BH, 59 ;; ;
+ DB 02BH, 41 ;; )
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; number of entries
+ DB 03H, 63 ;; ?
+ DB 04H, 43 ;; +
+ DB 05H, 34 ;; "
+ DB 06H, 37 ;; %
+ DB 07H, 61 ;; =
+ DB 08H, 58 ;; :
+ DB 09H, 47 ;; /
+ DB 0AH, 45 ;; -
+ DB 0BH, 239 ;; Numer
+ DB 0DH, 056h ;; V
+ DB 010H, 242 ;; Non alpha because of lower case comma
+ DB 01BH, 253 ;; Paragraph
+ DB 02BH, 40 ;; (
+
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T11_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 32 ;; Number of scans
+ DB 16, 0F1h ;;
+ DB 17, 0E7H ;; ã - 011h ;;
+ DB 18, 0A8H ;; ¥ - 012
+ DB 19, 0B7H ;; ¨ - 013
+ DB 20, 0F5H ;; è - 014
+ DB 21, 0F9H ;; é - 015
+ DB 22, 0C6H ;; ª - 016
+ DB 23, 0E3H ;; á - 017
+ DB 24, 0A6H ;; ¤ - 018
+ DB 25, 0F3H ;; § - 019
+ DB 26, 0A4H ;; æ - 01A
+ DB 30, 0EDH ;; ì - 01E
+ DB 31, 0DEH ;; ï - 01F
+ DB 32, 0A0H ;;   - 020
+ DB 33, 0D6H ;; ® - 021
+ DB 34, 0E9H ;; ¦ - 022
+ DB 35, 0ACH ;; £ - 023
+ DB 36, 0E5H ;; â - 024
+ DB 37, 0D4H ;; ­ - 025
+ DB 38, 0EBH ;; ¢ - 026
+ DB 39, 0D2H ;; ¬ - 027
+ DB 40, 0FBH ;; ç - 028
+ DB 44, 09CH ;; î - 02C
+ DB 45, 0BDH ;; © - 02D
+ DB 46, 09EH ;; ê - 02E
+ DB 47, 0F7H ;; í - 02F
+ DB 48, 0AAH ;; ä - 030
+ DB 49, 0B5H ;; å - 031
+ DB 50, 0D8H ;; ¯ - 032
+ DB 51, 0E1H ;; à - 033
+ DB 52, 0D0H ;; « - 034
+ DB 53, 0A2H ;; ¡ - 035
+ ;;
+CP855_A_LO_K1_T11_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T11_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 32H ;; Scan code
+ DB 12, 139 ;; I - 011
+ DB 17, 0E8H ;; “ - 011
+ DB 18, 0A9H ;; … - 012
+ DB 19, 0B8H ;; ˆ - 013
+ DB 20, 0F6H ;; ˜ - 014
+ DB 21, 0FAH ;; ™ - 015
+ DB 22, 0C7H ;; Š - 016
+ DB 23, 0E4H ;; ‘ - 017
+ DB 24, 0A7H ;; „ - 018
+ DB 25, 0F4H ;; ‡ - 019
+ DB 26, 0A5H ;; – - 01A
+ DB 30, 0EEH ;; œ - 01E
+ DB 31, 224 ;; Ÿ
+ DB 32, 0A1H ;; € - 020
+ DB 33, 0D7H ;; Ž - 021
+ DB 34, 0EAH ;; † - 022
+ DB 35, 0ADH ;; ƒ - 023
+ DB 36, 0E6H ;; ’ - 024
+ DB 37, 0D5H ;; - 025
+ DB 38, 0ECH ;; ‚ - 026
+ DB 39, 0D3H ;; Π- 027
+ DB 40, 0FCH ;; — - 028
+ DB 44, 09DH ;; ž - 02C
+ DB 45, 0BEH ;; ‰ - 02D
+ DB 46, 09FH ;; š - 02E
+ DB 47, 0F8H ;; - 02F
+ DB 48, 0ABH ;; ” - 030
+ DB 49, 0B6H ;; • - 031
+ DB 50, 0DDH ;; - 032
+ DB 51, 0E2H ;; - 033
+ DB 52, 0D1H ;; ‹ - 034
+ DB 53, 0A3H ;; - 035
+ ;;
+CP855_A_UP_K1_T11_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * BU Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BG_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ DB 0DH, 46 ;; .
+ DB 010H, 44 ;; ,
+ DB 01BH, 59 ;; ;
+ DB 02BH, 41 ;; )
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; number of entries
+ DB 03H, 63 ;; ?
+ DB 04H, 43 ;; +
+ DB 05H, 34 ;; "
+ DB 06H, 37 ;; %
+ DB 07H, 61 ;; =
+ DB 08H, 58 ;; :
+ DB 09H, 47 ;; /
+ DB 0AH, 45 ;; -
+ DB 0BH, 252 ;; Numer
+ DB 0DH, 46 ;; .
+ DB 010H, 235 ;;
+ DB 01BH, 21 ;; Paragraph
+ DB 02BH, 40 ;; (
+
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T11_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 33 ;; number of scans
+ DB 12, 105 ;; i - 010
+ DB 16, 0EBH ;;
+ DB 17, 227 ;; ã - 011h
+ DB 18, 165 ;; ¥ - 012
+ DB 19, 168 ;; ¨ - 013
+ DB 20, 232 ;; è - 014
+ DB 21, 233 ;; é - 015
+ DB 22, 170 ;; ª - 016
+ DB 23, 225 ;; á - 017
+ DB 24, 164 ;; ¤ - 018
+ DB 25, 167 ;; § - 019
+ DB 26, 230 ;; æ - 01A
+ DB 30, 236 ;; ì - 01E
+ DB 31, 239 ;; ï - 01F
+ DB 32, 160 ;;   - 020
+ DB 33, 174 ;; ® - 021
+ DB 34, 166 ;; ¦ - 022
+ DB 35, 163 ;; £ - 023
+ DB 36, 226 ;; â - 024
+ DB 37, 173 ;; ­ - 025
+ DB 38, 162 ;; ¢ - 026
+ DB 39, 172 ;; ¬ - 027
+ DB 40, 231 ;; ç - 028
+ DB 44, 238 ;; î - 02C
+ DB 45, 169 ;; © - 02D
+ DB 46, 234 ;; ê - 02E
+ DB 47, 237 ;; í - 02F
+ DB 48, 228 ;; ä - 030
+ DB 49, 229 ;; å - 031
+ DB 50, 175 ;; ¯ - 032
+ DB 51, 0E0H ;;
+ DB 52, 171 ;; « - 034
+ DB 53, 161 ;; ¡ - 035
+CP866_A_LO_K1_T11_END:
+
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T11_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 33 ;; number of scans
+ DB 12, 73 ;; I - 011
+ DB 16, 09bh ;;
+ DB 17, 147 ;; “ - 011
+ DB 18, 133 ;; … - 012
+ DB 19, 136 ;; ˆ - 013
+ DB 20, 152 ;; ˜ - 014
+ DB 21, 153 ;; ™ - 015
+ DB 22, 138 ;; Š - 016
+ DB 23, 145 ;; ‘ - 017
+ DB 24, 132 ;; „ - 018
+ DB 25, 135 ;; ‡ - 019
+ DB 26, 150 ;; – - 01A
+ DB 30, 156 ;; œ - 01E
+ DB 31, 159 ;; Ÿ
+ DB 32, 128 ;; € - 020
+ DB 33, 142 ;; Ž - 021
+ DB 34, 134 ;; † - 022
+ DB 35, 131 ;; ƒ - 023
+ DB 36, 146 ;; ’ - 024
+ DB 37, 141 ;; - 025
+ DB 38, 130 ;; ‚ - 026
+ DB 39, 140 ;; Π- 027
+ DB 40, 151 ;; — - 028
+ DB 44, 158 ;; ž - 02C
+ DB 45, 137 ;; ‰ - 02D
+ DB 46, 154 ;; š - 02E
+ DB 47, 157 ;; - 02F
+ DB 48, 148 ;; ” - 030
+ DB 49, 149 ;; • - 031
+ DB 50, 143 ;; - 032
+ DB 51, 144 ;; - 033
+ DB 52, 139 ;; ‹ - 034
+ DB 53, 129 ;; - 035
+ ;;
+CP866_A_UP_K1_T11_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfbl.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbl.asm
new file mode 100644
index 000000000..3a923e0a7
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbl.asm
@@ -0,0 +1,1107 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BL_LOGIC ;;
+ PUBLIC BL2_LOGIC ;;
+ PUBLIC BL3_LOGIC ;;
+ PUBLIC BL_866_XLAT ;;
+ PUBLIC BL_437_XLAT ;;
+ PUBLIC BL_850_XLAT ;;
+ PUBLIC BL_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL1_COMMON_XLAT ;;
+BL1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL2_COMMON_XLAT ;;
+BL2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL3_COMMON_XLAT ;;
+BL3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 08AH ;; i
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 098H ;; ÷
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 08BH ;; I
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 099H ;; ö
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * BL Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 105 ;; i
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 247 ;; ÷
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 073 ;; I
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 246 ;; ö
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfbl097.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbl097.asm
new file mode 100644
index 000000000..8a9e77f77
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbl097.asm
@@ -0,0 +1,811 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BL1_LOGIC ;;
+ PUBLIC BL1_866_XLAT ;;
+ PUBLIC BL1_437_XLAT ;;
+ PUBLIC BL1_850_XLAT ;;
+ PUBLIC BL1_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL1_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL1_COMMON_XLAT ;;
+BL1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL1_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL1_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL1_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 08AH ;; i
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 098H ;; ÷
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 08BH ;; I
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 099H ;; ö
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * BL Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL1_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 105 ;; i
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 247 ;; ÷
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 073 ;; I
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 246 ;; ö
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfbl098.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbl098.asm
new file mode 100644
index 000000000..0a00d8e93
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbl098.asm
@@ -0,0 +1,807 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BL2_LOGIC ;;
+ PUBLIC BL2_866_XLAT ;;
+ PUBLIC BL2_437_XLAT ;;
+ PUBLIC BL2_850_XLAT ;;
+ PUBLIC BL2_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL2_COMMON_XLAT ;;
+BL2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL2_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL2_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL2_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 08AH ;; i
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 098H ;; ÷
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 08BH ;; I
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 099H ;; ö
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * BL Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL2_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 105 ;; i
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 247 ;; ÷
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 073 ;; I
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 246 ;; ö
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfbl099.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbl099.asm
new file mode 100644
index 000000000..0ee3ad01c
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbl099.asm
@@ -0,0 +1,805 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BL3_LOGIC ;;
+ PUBLIC BL3_866_XLAT ;;
+ PUBLIC BL3_437_XLAT ;;
+ PUBLIC BL3_850_XLAT ;;
+ PUBLIC BL3_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; BL3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+BL3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; BL 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 BL3_COMMON_XLAT ;;
+BL3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL3_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL3_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BL Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL3_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 08AH ;; i
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 098H ;; ÷
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 08BH ;; I
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 099H ;; ö
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * BL Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BL3_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 105 ;; i
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 247 ;; ÷
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 073 ;; I
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 246 ;; ö
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfbr.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbr.asm
new file mode 100644
index 000000000..8753ef422
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbr.asm
@@ -0,0 +1,1165 @@
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; XT section enabled
+;; ************* CNS 12/18/86
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Brazil
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Adapted for Brazil by Mihindu Senanayake (Microsoft) - Oct 1990
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BR_LOGIC ;;
+ PUBLIC BR_437_XLAT ;;
+ PUBLIC BR_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BR_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 ;;
+ IFF CIRCUMFLEX ;;
+ RESET_NLS ;;
+ XLATT CIRCUMFLEX_CIRCUMFLEX ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO CIRCUMFLEX_ON ;;
+ ENDIFF ;;
+ IFF TILDE ;;
+ RESET_NLS ;;
+ XLATT TILDE_TILDE ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO TILDE_ON ;;
+ ENDIFF ;;
+ IFF DIARESIS ;;
+ RESET_NLS ;;
+ XLATT DIARESIS_DIARESIS ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO DIARESIS_ON ;;
+ ENDIFF ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF
+ IFF GRAVE ;;
+ RESET_NLS ;;
+ XLATT GRAVE_GRAVE ;;
+ SET_FLAG DEAD_LOWER
+ GOTO GRAVE_ON ;;
+ ENDIFF ;;
+ IFF ACUTE ;;
+ RESET_NLS ;;
+ XLATT ACUTE_ACUTE ;;
+ SET_FLAG DEAD_LOWER
+ GOTO ACUTE_ON ;;
+ ENDIFF ;;
+ SET_FLAG DEAD_LOWER
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ACUTE_PROC:
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO DIARESIS_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: ;;
+ 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 ;;
+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: ;;
+ 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 ;;
+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,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 ;;
+TILDE_ON: ;;
+ 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 ;;
+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,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.
+ 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 ;;
+;**************************************;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR 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 BR_COMMON_XLAT ;;
+BR_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Lower Shift Dead Key
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DK_LO_K1_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 40 ;; scan code
+ FLAG ACUTE ;; flag bit to set
+ DB 41 ;;
+ FLAG GRAVE ;;
+ ;;
+ ;;
+COM_DK_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Upper Shift Dead Key
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DK_UP_K1_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 3 ;; number of entries
+ DB 7 ;; scan code
+ FLAG CIRCUMFLEX ;; flag bit to set
+ DB 40 ;;
+ FLAG DIARESIS ;;
+ DB 41 ;;
+ FLAG TILDE ;;
+ ;;
+COM_DK_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: Any,
+;; 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: Any,
+;; 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: Grave Twice
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_GR_END-$ ;; length of state section
+ DB GRAVE_GRAVE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW COM_GR_GR_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 41,96 ;; STANDALONE GRAVE
+ ;;
+COM_GR_GR_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_GR_GR_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: Any,
+;; 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: Any,
+;; 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: Circumflex Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_CI_END-$ ;; length of state section
+ DB CIRCUMFLEX_CIRCUMFLEX ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW COM_CI_CI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 7,94 ;; STANDALONE CIRCUMFLEX
+ ;;
+COM_CI_CI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CI_CI_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_LO_K1_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_K1_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_K1_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_TI_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Upper Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_UP_K1_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_K1_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_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: Any,
+;; 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Twice
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_TI_END-$ ;; length of state section
+ DB TILDE_TILDE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW COM_TI_TI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 41,07EH ;; STANDALONE TILDE
+ ;;
+COM_TI_TI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_TI_TI_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: Any,
+;; 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 6 ;; 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
+ DB 46,'‡' ;; scan code,ASCII - c-cedilla
+ ;;
+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: Any
+;; 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,090H ;; scan code,ASCII - E
+ DB 46,080H ;; C cedilla
+ ;;
+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: Any
+;; 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: Acute Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_AC_END-$ ;; length of state section
+ DB ACUTE_ACUTE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 39,0 ;; error character = standalone accent
+ ;;
+ DW COM_AC_AC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 40,39 ;; scan code,ASCII - ACUTE
+ ;;
+COM_AC_AC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_AC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',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,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
+ ;;
+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
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; 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 22,09AH ;; U diaeresis
+ DB 24,099H ;; O diaeresis
+ DB 30,08EH ;; A diaeresis
+ ;;
+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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',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,'"' ;; scan code,ASCII - SPACE
+ ;;
+COM_DI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DI_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_DI_END-$ ;; length of state section
+ DB DIARESIS_DIARESIS ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_DI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 40,'"' ;; scan code,ASCII - SPACE
+ ;;
+COM_DI_DI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DI_DI_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BR Specific Translate Section for 437
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC BR_437_XLAT ;;
+BR_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC BR_850_XLAT ;;
+BR_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alt Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_ALT_K1_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_ALT_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 40,0EFH ;; scan code, acute
+ ;;
+CP850_ALT_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_ALT_K1_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_THIRD_K1_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_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 40,0F9H ;; scan code, diaresis
+ ;;
+CP850_THIRD_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP850_THIRD_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ 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: Diaresis Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',0 ;; error character = standalone accent
+ ;;
+ DW CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;;
+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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',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: Any
+;; 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: Tilde Lower
+;; KEYBOARD TYPES: Any
+;; 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 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: Any
+;; 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 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 Upper
+;; KEYBOARD TYPES: Any
+;; 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/private/mvdm/dos/v86/dev/keyboard/kdfbr275.asm b/private/mvdm/dos/v86/dev/keyboard/kdfbr275.asm
new file mode 100644
index 000000000..2c28c11f7
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfbr275.asm
@@ -0,0 +1,1328 @@
+;/* Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+
+;; XT section enabled
+;; ************* CNS 12/18/86
+
+
+ PAGE ,132
+ TITLE MS-DOS 5.0 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MS-DOS 5.0 - NLS Support - Keyboard Defintion File
+;;
+;; This file contains the keyboard tables for Brazil - type 275
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Adapted for Brazil by Mihindu Senanayake (Microsoft) - Oct 1990
+;; Adapted for IBM Brazil by Vera Vaitekunas (Microsoft - verav) - January 92
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC BR_LOGIC ;;
+ PUBLIC BR_437_XLAT ;;
+ PUBLIC BR_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BR_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 ;;
+ IFF CIRCUMFLEX ;;
+ RESET_NLS ;;
+ XLATT CIRCUMFLEX_CIRCUMFLEX ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO CIRCUMFLEX_ON ;;
+ ENDIFF ;;
+ IFF TILDE ;;
+ RESET_NLS ;;
+ XLATT TILDE_TILDE ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO TILDE_ON ;;
+ ENDIFF ;;
+ IFF DIARESIS ;;
+ RESET_NLS ;;
+ XLATT DIARESIS_DIARESIS ;;
+ SET_FLAG DEAD_UPPER ;;
+ GOTO DIARESIS_ON ;;
+ ENDIFF ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF
+ IFF GRAVE ;;
+ RESET_NLS ;;
+ XLATT GRAVE_GRAVE ;;
+ SET_FLAG DEAD_LOWER
+ GOTO GRAVE_ON ;;
+ ENDIFF ;;
+ IFF ACUTE ;;
+ RESET_NLS ;;
+ XLATT ACUTE_ACUTE ;;
+ SET_FLAG DEAD_LOWER
+ GOTO ACUTE_ON ;;
+ ENDIFF ;;
+ SET_FLAG DEAD_LOWER
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ACUTE_PROC:
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO DIARESIS_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: ;;
+ 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 ;;
+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: ;;
+ 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 ;;
+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,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 ;;
+TILDE_ON: ;;
+ 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 ;;
+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,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.
+ 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 ;;
+;**************************************;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR 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 BR_COMMON_XLAT_275 ;;
+BR_COMMON_XLAT_275: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Lower Shift Dead Key
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DK_LO_K1_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 1ah ;; scan code
+ FLAG ACUTE ;; flag bit to set
+ DB 28H ;;
+ FLAG TILDE ;;
+
+COM_DK_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Upper Shift Dead Key
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DK_UP_K1_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 3 ;; number of entries
+ DB 28h ;; scan code
+ FLAG CIRCUMFLEX ;; flag bit to set
+ DB 7 ;;
+ FLAG DIARESIS ;;
+ DB 1ah ;;
+ FLAG GRAVE ;;
+ ;;
+COM_DK_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: Any,
+;; 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: Any,
+;; 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: Grave Twice
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_GR_END-$ ;; length of state section
+ DB GRAVE_GRAVE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW COM_GR_GR_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 54h,96 ;; STANDALONE GRAVE <verav>
+ ;;
+COM_GR_GR_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_GR_GR_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: Any,
+;; 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: Any,
+;; 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: Circumflex Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_CI_END-$ ;; length of state section
+ DB CIRCUMFLEX_CIRCUMFLEX ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW COM_CI_CI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 7,94 ;; STANDALONE CIRCUMFLEX
+ ;;
+COM_CI_CI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CI_CI_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_LO_K1_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_K1_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_K1_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_TI_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Upper Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_UP_K1_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_K1_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_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: Any,
+;; 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Twice
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_TI_END-$ ;; length of state section
+ DB TILDE_TILDE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW COM_TI_TI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 54h,07EH ;; STANDALONE TILDE <verav>
+ ;;
+COM_TI_TI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_TI_TI_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: Any,
+;; 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 6 ;; 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
+ DB 46,'‡' ;; scan code,ASCII - c-cedilla
+ ;;
+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: Any
+;; 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,090H ;; scan code,ASCII - E
+ DB 46,080H ;; C cedilla
+ ;;
+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: Any
+;; 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: Acute Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_AC_END-$ ;; length of state section
+ DB ACUTE_ACUTE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 39,0 ;; error character = standalone accent
+ ;;
+ DW COM_AC_AC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 1ah,39 ;; scan code,ASCII - ACUTE
+ ;;
+COM_AC_AC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_AC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 'ù',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,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
+ ;;
+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
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; 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 22,09AH ;; U diaeresis
+ DB 24,099H ;; O diaeresis
+ DB 30,08EH ;; A diaeresis
+ ;;
+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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW COM_DI_SP_END-$ ;; length of state section
+; DB DIARESIS_SPACE ;; State ID
+; DW ANY_KB ;; Keyboard Type
+; DB 'ù',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 7,'"' ;; scan code,ASCII - SPACE
+ ;;
+;COM_DI_SP_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;COM_DI_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Twice
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_DI_END-$ ;; length of state section
+ DB DIARESIS_DIARESIS ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 'ù',0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_DI_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 1ah,'ù' ;; scan code,ASCII - SPACE <verav>
+ ;;
+COM_DI_DI_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DI_DI_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Alpha lower case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_ALC_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character - buffer entry
+ ;;
+ DW COM_ALC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ db 27h,'‡' ;; cedilha
+COM_ALC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_ALC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Alpha Upper case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AUC_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character - buffer entry
+ ;;
+ DW COM_AUC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ db 27h,80h ;; cedilha
+COM_AUC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AUC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Non-Alpha lower case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NALC_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character - buffer entry
+ ;;
+ DW COM_NALC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 29h,27h ;; apostrofe
+ db 35h,';' ;; ponto e virgula
+ db 73h,'/' ;; barra
+ db 7eh,'.' ;; (decimal point)
+ db 1bh,5bh ;; abre colchete
+ db 2bh,5dh ;; fecha colchete
+ db 53h,',' ;; decimal comma
+COM_NALC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NALC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: NON-Alpha UPPER case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NAUC_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character - buffer entry
+ ;;
+ DW COM_NAUC_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 29h,22h ;; ASPAS
+ db 35h,3AH ;; DOIS PONTOS
+ db 73h,3FH ;; INTERROGACAO
+ db 7eh,'.' ;; (decimal point)
+ db 1bh,7bh ;; abre chaves
+ db 2bh,7dh ;; fecha chaves
+ db 53h,',' ;; virgula no teclado numerico
+COM_NAUC_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NAUC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Third Shift
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_K1_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 16,'/' ; AltGr + Q = slash
+ DB 17,'?' ; AltGr + W = question mark
+ DB 18,0f8h ; AltGr + E = degree sign
+COM_THIRD_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; BR Specific Translate Section for 437
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC BR_437_XLAT ;;
+BR_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC BR_850_XLAT ;;
+BR_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alt Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_ALT_K1_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_ALT_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+; Atencao! esta tecla esta apenas programada para permitir
+; a utilizacao do "?"
+ DB 1 ;; number of scans
+ DB 2,'?' ;; scan code for '!', question mark
+CP850_ALT_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_ALT_K1_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_THIRD_K1_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_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 10 ;; number of entries
+; DB 1ah,0F9H ;; scan code, diaresis <verav>
+ db 2,0fbh ; exp 1 û
+ db 3,0fdh ; exp 2 ý
+ db 4,0fch ; exp 3 ü
+ db 5,09ch ; libra
+ db 6,0bdh ; cent
+ db 7,0aah ; not
+ db 1bh,0a6h ; primeira
+ db 2bh,0a7h ; primeiro
+ db 73h,0f8h ; grau
+ db 0dh,0f5h
+CP850_THIRD_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP850_THIRD_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ 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: Diaresis Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',0 ;; error character = standalone accent
+ ;;
+ DW CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;;
+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: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB '"',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
+ ;;
+;;; Esta' Certo?
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Space Bar
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW cp850_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 'ù',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 7,'ù' ;; 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: Any
+;; 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: Tilde Lower
+;; KEYBOARD TYPES: Any
+;; 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 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: Any
+;; 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 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 Upper
+;; KEYBOARD TYPES: Any
+;; 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/private/mvdm/dos/v86/dev/keyboard/kdfcf.asm b/private/mvdm/dos/v86/dev/keyboard/kdfcf.asm
new file mode 100644
index 000000000..5a4f599c6
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfcf.asm
@@ -0,0 +1,1776 @@
+
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ PAGE ,132
+ TITLE PC DOS 3.3 KEYBOARD.SYS
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - KEYBOARD.SYS
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard table for Canadian French
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM
+;;
+;; Author: T.T. CHEN & BILL DEVLIN- IBM Canada Laboratory - July 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 15 ;; number of entries
+ 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,'}' ;;
+
+; these are not supported in Enhanced keyboard (p12).
+; 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/private/mvdm/dos/v86/dev/keyboard/kdfcz.asm b/private/mvdm/dos/v86/dev/keyboard/kdfcz.asm
new file mode 100644
index 000000000..d13f31847
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfcz.asm
@@ -0,0 +1,2519 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;;
+;; This file contains the keyboard tables for:
+;; Czechoslovakia (Czech)
+;; Alterations created by Gyorgy Balint on behalf of IBM ROECE
+;; 21.10.87 Basingstoke
+;;
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC CZ_LOGIC ;;
+ PUBLIC CZ_850_XLAT ;;
+ PUBLIC CZ_852_XLAT ;;
+ PUBLIC CZ_855_XLAT ;;
+ PUBLIC CZ_866_XLAT ;;
+ PUBLIC CZ_437_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; CZ State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+CZ_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW 0 ;; special features
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; COMMANDS START HERE
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ XLATT NON_ALPHA_UPPER ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER ;;
+; XLATT NON_ALPHA_LOWER ;;
+; XLATT NON_ALPHA_UPPER ;;
+ 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 ;;
+; XLATT NON_ALPHA_LOWER ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; CZ 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 CZ_COMMON_XLAT ;;
+CZ_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 ;;
+ FLAG ACUTE ;;
+ DB 43 ;;
+ FLAG DIARESIS ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 41 ;;
+ FLAG OVERCIRCLE ;;
+ DB 13 ;;
+ FLAG CARON ;;
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CZ_TH_END-$ ;; length of state section
+ DB DEAD_THIRD ;; State ID
+; DW G_KB ;; Keyboard Type
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_CZ_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: G_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW G_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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,";" ;; changes made!!!!! x
+ DB 02h,"+" ;; x
+ DB 0ch,"=" ;; x
+ DB 01bh,")" ;; x
+ DB 056h,"&" ;; x
+ DB 035h,"-" ;; x
+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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 20 ;; number of entries
+ DB 002h,"1" ;; x
+ DB 003h,"2" ;; x
+ DB 004h,"3" ;; x
+ DB 005h,"4" ;; x
+ DB 006h,"5" ;; x
+ DB 007h,"6" ;; x
+ DB 008h,"7" ;; x
+ DB 009h,"8" ;; x
+ DB 00ah,"9" ;; x
+ DB 00bh,"0" ;; x
+ DB 00ch,"%" ;; x
+ DB 01ah,"/" ;; x
+ DB 01bh,"(" ;; x
+ DB 027h,'"' ;; x
+ DB 028h,"!" ;; x
+ DB 02Bh, 39 ;; x
+ DB 056h,"*" ;; x
+ DB 033H,"?" ;;
+ DB 034H,":" ;;
+ DB 035h,"_" ;; x
+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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 26 ;; number of entries
+ DB 2,'~',02H ;;
+ db 8,'`',08H
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 20,'$',14H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,'<',17H ;;
+ DB 24,'>',18H ;;
+ DB 25,'*',19H ;;
+ DB 26,'ö',1AH ;;
+ DB 33,"[",021h ;; x
+ DB 34,"]",022h ;; x
+ DB 35,"&",023h ;; x
+ DB 39,"$",027H ;; x
+ db 40,0e1h,028h ;; sharpes s x
+ DB 86,"<",056h ;; x
+ DB 44,">",02ch ;; x
+ DB 45,"#",02dh ;; x
+ DB 46,"&",02eh ;; x
+ DB 47,"@",02fh ;; x
+ DB 48,"{",30h ;; x
+ DB 49,"}",031h ;; x
+ DB 51,"<",033h ;; x
+ DB 52,">",034h ;; x
+ DB 53,"*",035h ;; x
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; CZ Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CZ_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; CZ Specific Translate Section for 866
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CZ_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; CZ Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CZ_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC CZ_850_XLAT ;;
+CZ_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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,-1 ;; CURRENCY SYMBOL
+ DB 40,015H ;;
+CP850_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 2 ;; number of entries
+ DB 13,-1
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 2 ;; number of entries
+ DB 13,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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,0FEH,0 ;; 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: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FEH,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FEH ;; OGONEK SPACE
+CP850_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC CZ_852_XLAT ;;
+CZ_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;section commented out by gy.balint ;;
+; DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+; DB STANDARD_TABLE ;; xlat options:
+; DB 2 ;; number of entries
+; DB 13,088H ;; l STROKE
+; DB 27,0D0H ;; d STROKE
+;CP852_AL_LO_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;section commented out by gy. balint ;;
+; DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+; DB STANDARD_TABLE ;; xlat options:
+; DB 2 ;; number of entries
+; DB 13,09DH ;; L STROKE
+; DB 27,0D1H ;; D STROKE
+;CP852_AL_UP_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 8 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 22,0CFH,16H ;; CURRENCY SYMBOL
+ DB 27,09eh,1bh ;; multiple sign x
+ DB 31,0d0h,1fh ;; d stroke small x
+ DB 32,0d1h,20h ;; D stroke capital x
+ DB 37,088h,025h ;; l stroke small x
+ DB 38,09dh,026h ;; L stroke capital
+ DB 43,0cfh,02Bh ;; sun
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE:CP 852
+;; STATE: Non-alpha lower case
+;; KEYBOARD TYPES: G
+;;TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_LO_K1_END-$ ;; length of section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard type
+ DB -1,-1 ;; Buffer entry for error chars.
+ ;;
+ DW CP852_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; NUMBER OF ENTRIES
+ DB 03h,0d8h ;; e caron small x
+ DB 04h,0e7h ;; s caron small x
+ DB 05h,09fh ;; c caron small x
+ DB 06h,0fdh ;; r caron small x
+ DB 07h,0a7h ;; z caron small x
+ DB 08h,0ech ;; y acute small x
+ DB 09h,0a0h ;; a acute small x
+ DB 0ah,0a1h ;; i acute small x
+ DB 0bh,082h ;; e acute small x
+; DB 0DH,0EFH ;; ACUTE ACCENT DEAD KEY!
+ DB 01ah,0a3h ;; u acute small x
+ DB 027h,085h ;; u overdot small x
+ DB 028h,0f5h ;; section symbol x
+ DB 02Bh,0f9h ;; diaresis accent x
+
+CP852_NA_LO_K1_T1_END:
+ DW 0
+CP852_NA_LO_K1_END:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_NA_UP_K1_END-$ ;; length of state section
+;; DB NON_ALPHA_UPPER ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB -1,-1 ;; Buffer entry for error character
+ ;;
+;; DW CP852_NA_UP_K1_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE ;; xlat options:
+;; DB 2 ;; number of entries
+;; DB 029h,0f8h ;; overcircle
+;; DB 0dh,0f3h ;; caron
+;;CP852_NA_UP_K1_T1_END: ;;
+ ;;
+;; DW 0 ;; Size of xlat table - null table
+ ;;
+;;CP852_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfdk.asm b/private/mvdm/dos/v86/dev/keyboard/kdfdk.asm
new file mode 100644
index 000000000..e164b2a20
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfdk.asm
@@ -0,0 +1,1638 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;; LATEST CHANGE P12 NUMERIC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Danish
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Updated: MIKE SAUNDERS - WSD IBM Hursley Laboratory - August 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfdv.asm b/private/mvdm/dos/v86/dev/keyboard/kdfdv.asm
new file mode 100644
index 000000000..65e1ab2d3
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfdv.asm
@@ -0,0 +1,589 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC DV_LOGIC ;;
+ PUBLIC DV_COMMON_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; DV State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+DV_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: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; DV 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 DV_COMMON_XLAT ;;
+DV_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 36 ;; number of entries
+ DB 0CH, 0, 01AH ;; Alt+{
+ DB 0DH, 0, 01BH ;; Alt+}
+ DB 010H, 0, 028H ;; Altl+"
+ DB 011H, 0, 033H ;; Altl+,
+ DB 012H, 0, 034H ;; Altl+.
+ DB 013H, 0, 019H ;; Altl+P
+ DB 014H, 0, 015H ;; Altl+Y
+ DB 015H, 0, 021H ;; Altl+F
+ DB 016H, 0, 022H ;; Altl+G
+ DB 017H, 0, 02EH ;; Altl+C
+ DB 018H, 0, 013H ;; Altl+R
+ DB 019H, 0, 026H ;; Altl+L
+ DB 01AH, 0, 035H ;; Altl+?
+ DB 01BH, 0, 0DH ;; Altl+=
+ DB 01EH, 0, 01EH ;; Altl+A
+ DB 01FH, 0, 018H ;; Altl+O
+ DB 020H, 0, 012H ;; Altl+E
+ DB 021H, 0, 016H ;; Altl+U
+ DB 022H, 0, 017H ;; Altl+I
+ DB 023H, 0, 020H ;; Altl+D
+ DB 024H, 0, 023H ;; Altl+H
+ DB 025H, 0, 014H ;; Altl+T
+ DB 026H, 0, 031H ;; Altl+N
+ DB 027H, 0, 01FH ;; Altl+S
+ DB 028H, 0, 0CH ;; Altl+-
+ DB 02BH, 0, 02BH ;; Altl+|
+ DB 02CH, 0, 027H ;; Altl+;
+ DB 02DH, 0, 010H ;; Altl+Q
+ DB 02EH, 0, 024H ;; Altl+J
+ DB 02FH, 0, 025H ;; Altl+K
+ DB 030H, 0, 02DH ;; Altl+X
+ DB 031H, 0, 030H ;; Altl+B
+ DB 032H, 0, 032H ;; Altl+M
+ DB 033H, 0, 011H ;; Altl+W
+ DB 034H, 0, 02FH ;; Altl+V
+ DB 035H, 0, 02CH ;; Altl+Z
+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 36 ;; number of entries
+ DB 0CH, 01BH, 0CH ;; Ctrl+{
+ DB 0DH, 01DH, 0DH ;; Ctrl+}
+ DB 010H, 00H, 010H ;; Ctrl+"
+ DB 011H, 00H, 011H ;; Ctrl+,
+ DB 012H, 00H, 012H ;; Ctrl+.
+ DB 013H, 010H, 013H ;; Ctrl+P
+ DB 014H, 019H, 014H ;; Ctrl+Y
+ DB 015H, 06H, 015H ;; Ctrl+F
+ DB 016H, 07H, 016H ;; Ctrl+G
+ DB 017H, 03H, 017H ;; Ctrl+C
+ DB 018H, 012H, 018H ;; Ctrl+R
+ DB 019H, 0CH, 019H ;; Ctrl+L
+ DB 01AH, 00H, 01AH ;; Ctrl+?
+ DB 01BH, 00H, 01BH ;; Ctrl+=
+ DB 01EH, 01H, 01EH ;; Ctrl+A
+ DB 01FH, 0FH, 01FH ;; Ctrl+O
+ DB 020H, 05H, 020H ;; Ctrl+E
+ DB 021H, 015H, 021H ;; Ctrl+U
+ DB 022H, 09H, 022H ;; Ctrl+I
+ DB 023H, 04H, 023H ;; Ctrl+D
+ DB 024H, 08H, 024H ;; Ctrl+H
+ DB 025H, 014H, 025H ;; Ctrl+T
+ DB 026H, 0EH, 026H ;; Ctrl+N
+ DB 027H, 013H, 027H ;; Ctrl+S
+ DB 028H, 01FH, 028H ;; Ctrl+-
+ DB 02BH, 00H, 02BH ;; Ctrl+|
+ DB 02CH, 00H, 02CH ;; Ctrl+;
+ DB 02DH, 011H, 02DH ;; Ctrl+Q
+ DB 02EH, 0AH, 02EH ;; Ctrl+J
+ DB 02FH, 0BH, 02FH ;; Ctrl+K
+ DB 030H, 018H, 030H ;; Ctrl+X
+ DB 031H, 02H, 031H ;; Ctrl+B
+ DB 032H, 0DH, 032H ;; Ctrl+M
+ DB 033H, 017H, 033H ;; Ctrl+W
+ DB 034H, 016H, 034H ;; Ctrl+V
+ DB 035H, 01AH, 035H ;; Ctrl+Z
+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 ANY_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 9 ;; number of entries
+ DB 00CH,"[" ;; '
+ DB 00DH,']' ;; #
+ DB 010H,"'" ;; #
+ DB 011H,',' ;; #
+ DB 012H,'.' ;; #
+ DB 01AH,'/' ;; #
+ DB 01BH,'=' ;; #
+ DB 028H,'-' ;; #
+ DB 02CH,';' ;; #
+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_KB+P12_KB+
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 9 ;; number of entries
+ DB 00CH,"{" ;; '
+ DB 00DH,'}' ;; #
+ DB 010H,'"' ;; #
+ DB 011H,'<' ;; #
+ DB 012H,'>' ;; #
+ DB 01AH,'?' ;; #
+ DB 01BH,'+' ;; #
+ DB 028H,'_' ;; #
+ DB 02CH,':' ;; #
+COM_NA_UP_T1_K1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NA_UP_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CPCOM_A_K1_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 CPCOM_A_LO_K1_T01_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 26 ;; number of entries
+ DB 13H, 'p' ;; j
+ DB 14H, 'y' ;; l
+ DB 15H, 'f' ;; m
+ DB 16H, 'g' ;; f
+ DB 17H, 'c' ;; p
+ DB 18H, 'r' ;; p
+ DB 19H, 'l' ;; p
+ DB 1EH, 'a' ;; o
+ DB 1FH, 'o' ;; r
+ DB 20H, 'e' ;; s
+ DB 21H, 'u' ;; u
+ DB 22H, 'i' ;; y
+ DB 23H, 'd' ;; b
+ DB 24H, 'h' ;; b
+ DB 25H, 't' ;; b
+ DB 26H, 'n' ;; b
+ DB 27H, 's' ;; b
+ DB 2DH, 'q' ;; z
+ DB 2EH, 'j' ;; a
+ DB 2FH, 'k' ;; e
+ DB 30H, 'x' ;; h
+ DB 31H, 'b' ;; t
+ DB 32H, 'm' ;; d
+ DB 33H, 'w' ;; c
+ DB 34H, 'v' ;; k
+ DB 35H, 'z' ;; k
+CPCOM_A_LO_K1_T01_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CPCOM_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CPCOM_A_K1_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 CPCOM_A_UP_K1_T01_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 26 ;; number of entries
+ DB 13H, 'P' ;; j
+ DB 14H, 'Y' ;; l
+ DB 15H, 'F' ;; m
+ DB 16H, 'G' ;; f
+ DB 17H, 'C' ;; p
+ DB 18H, 'R' ;; p
+ DB 19H, 'L' ;; p
+ DB 1EH, 'A' ;; o
+ DB 1FH, 'O' ;; r
+ DB 20H, 'E' ;; s
+ DB 21H, 'U' ;; u
+ DB 22H, 'I' ;; y
+ DB 23H, 'D' ;; b
+ DB 24H, 'H' ;; b
+ DB 25H, 'T' ;; b
+ DB 26H, 'N' ;; b
+ DB 27H, 'S' ;; b
+ DB 2DH, 'Q' ;; z
+ DB 2EH, 'J' ;; a
+ DB 2FH, 'K' ;; e
+ DB 30H, 'X' ;; h
+ DB 31H, 'B' ;; t
+ DB 32H, 'M' ;; d
+ DB 33H, 'W' ;; c
+ DB 34H, 'V' ;; k
+ DB 35H, 'Z' ;; k
+CPCOM_A_UP_K1_T01_END: ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CPCOM_A_K1_UP_END: ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+COMMON_XLAT_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfeof.asm b/private/mvdm/dos/v86/dev/keyboard/kdfeof.asm
new file mode 100644
index 000000000..267576538
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfeof.asm
@@ -0,0 +1,41 @@
+
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+
+
+ PAGE ,132
+ TITLE PC DOS TUGBOAT Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS TUGBOAT - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the eof marker for the entire table
+;; and the keyboard.sys copyright information
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+CODE SEGMENT PUBLIC 'CODE' ;;
+ ASSUME CS:CODE,DS:CODE ;;
+ ;;
+ ;;
+ ;;
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Copyright statement
+;; DB 'KEYBOARD.SYS Version TUGBOAT (C) Copyright IBM Corp. 1986,1987,1988',13,10 ;;
+;; DB 'Authors : Bill Devlin, Nick Savage, Mike Saunders, et al..',13,10
+;; DB 'Development: Toronto,Boca Raton,Basingstoke',13,10
+
+include copyrigh.inc
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DB 1AH ;; EOF
+ ;;
+CODE ENDS ;;
+ END ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdffr.asm b/private/mvdm/dos/v86/dev/keyboard/kdffr.asm
new file mode 100644
index 000000000..f4e69d41b
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdffr.asm
@@ -0,0 +1,1535 @@
+;; LATEST CHANGE ALT & CTL disenabled US invalids
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; 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 PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdffr120.asm b/private/mvdm/dos/v86/dev/keyboard/kdffr120.asm
new file mode 100644
index 000000000..99ba1dce2
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdffr120.asm
@@ -0,0 +1,2314 @@
+; ACUTE lc y added
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+; ****** CNS 12/18
+; ****** CNS 01/21 NUM PAD
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Belgium.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; NICK SAVAGE - IBM Corp.
+;; 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 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,"_" ;;
+ DB 27,"*" ;;
+ DB 40,'%' ;;
+ DB 41,0FCH ;; Superscript 3
+ 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/private/mvdm/dos/v86/dev/keyboard/kdffr189.asm b/private/mvdm/dos/v86/dev/keyboard/kdffr189.asm
new file mode 100644
index 000000000..80bfa0242
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdffr189.asm
@@ -0,0 +1,1534 @@
+;; LATEST CHANGE ALT & CTL disenabled US invalids
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; 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 PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 0 ;;;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 ;;
+ 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: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;;
+;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 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,"+" ;; 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/private/mvdm/dos/v86/dev/keyboard/kdfge.asm b/private/mvdm/dos/v86/dev/keyboard/kdfge.asm
new file mode 100644
index 000000000..182721c50
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfge.asm
@@ -0,0 +1,1391 @@
+;; LATEST CHANGE ALT & CTL "Z & Y", "-" symbol (AT)
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; Eliminated zero scan tag from alpha upper CP section
+;; SECTION SYMBOL
+;; SCAN CODE OUTPUT CHANGES MADE 12/18/86
+;; **************** CNS ************************
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 0 ;;;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 ;;
+ 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: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; 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 2 ;; number of entries
+ DB 13 ;; scan code
+ FLAG ACUTE ;; flag bit to set
+ DB 41
+ FLAG CIRCUMFLEX
+ ;;
+ ;;
+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: 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 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 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: 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: 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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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/private/mvdm/dos/v86/dev/keyboard/kdfgk.asm b/private/mvdm/dos/v86/dev/keyboard/kdfgk.asm
new file mode 100644
index 000000000..b3fb6ef82
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfgk.asm
@@ -0,0 +1,1614 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1988-1993.
+; * All Rights Reserved.
+; */
+
+ PAGE 118,132
+ TITLE MS-DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MS-DOS - NLS Support - Keyboard Definition File
+;;
+;; This file contains the keyboard tables for Dual mode Canadian, French
+;;
+;; Linkage Instructions:
+;; Refer to KDFNOW.ASM.
+;; Created by John Hicks 9-19-93
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC GK_LOGIC ;;
+ PUBLIC GK_869_XLAT ;;
+ PUBLIC GK_737_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; GK State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+GK_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <CTRL + Left SHIFT> and
+;; <CTRL+Right SHIFT> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT ;;
+ IFF LEFT_SHIFT ;; Primary mode
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;; secondary mode
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; LATIN
+ IFF RUS_MODE,NOT ;; Primary Mode dead keys
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL,NOT ;;
+ IFF LC_E0,NOT ;;
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;; GREEK
+ ELSEF ;; Secondary Mode Dead Keys
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL,NOT ;;
+ IFF LC_E0,NOT ;;
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER_SEC ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER_SEC ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF EITHER_SHIFT,NOT ;;
+ IFKBD XT_KB+AT_KB ;;
+ IFF EITHER_CTL ;;
+ ANDF ALT_SHIFT ;;
+ SET_FLAG DEAD_THIRD_SEC ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF R_ALT_SHIFT ;;
+ ANDF EITHER_CTL,NOT ;;
+ ANDF LC_E0,NOT ;;
+ SET_FLAG DEAD_THIRD_SEC ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CIRCUMFLEX ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ IFF CIRCUMFLEX,NOT ;;
+ GOTO DIARESIS_PROC ;;
+ 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 ;;
+ XLATT CIRCUMFLEX_UPPER ;;
+ ELSEF ;;
+ XLATT CIRCUMFLEX_LOWER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CIRCUMFLEX: ;;
+ PUT_ERROR_CHAR CIRCUMFLEX_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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DIARESIS ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DIARESIS_PROC: ;;
+ ;;
+ IFF DIARESIS,NOT ;;
+ GOTO DIARESIS_SEC_PROC ;;
+ ENDIFF ;;
+ RESET_NLS ;;
+ 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: ;;
+ PUT_ERROR_CHAR DIARESIS_LOWER ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DIARESIS ACCENT TRANSLATIONS SEC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DIARESIS_SEC_PROC: ;;
+ ;;
+ IFF DIARESIS_SEC,NOT ;;
+ GOTO GRAVE_PROC ;;
+ ENDIFF ;;
+ RESET_NLS1 ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DIARESIS_SPACE_SEC ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DIARESIS_LOWER_SEC ;
+ ELSEF ;;
+ XLATT DIARESIS_UPPER_SEC ;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE ;;
+ XLATT DIARESIS_UPPER_SEC ;
+ ELSEF ;;
+ XLATT DIARESIS_LOWER_SEC ;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+INVALID_DIARESIS_SEC: ;;
+ PUT_ERROR_CHAR DIARESIS_LOWER_SEC ; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; GRAVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+GRAVE_PROC: ;;
+ ;;
+ IFF GRAVE,NOT ;;
+ GOTO ACUTE_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 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ACUTE_PROC: ;;
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO ACUTE_SEC_PROC ;; changed for bug 1502
+ 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 ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACUTE-DIARESIS ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ACUTE_SEC_PROC: ;;
+ ;;
+ IFF ACUTE_SEC,NOT ;;
+ GOTO ACUTE_DIAR_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS1 ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT ACUTE_SPACE_SEC ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT ACUTE_LOWER_SEC ;;
+ ELSEF ;;
+ XLATT ACUTE_UPPER_SEC ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE ;;
+ XLATT ACUTE_UPPER_SEC ;;
+ ELSEF ;;
+ XLATT ACUTE_LOWER_SEC ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+INVALID_ACUTE_SEC: ;;
+ PUT_ERROR_CHAR ACUTE_LOWER_SEC ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ACUTE-DIARESIS ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ACUTE_DIAR_PROC: ;;
+ ;;
+ IFF ACUTE_DIAR,NOT ;;
+ GOTO TILDE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS1 ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT ACDI_SPACE_SEC ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT ACDI_LOWER_SEC ;;
+ ELSEF ;;
+ XLATT ACDI_UPPER_SEC ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE ;;
+ XLATT ACDI_UPPER_SEC ;;
+ ELSEF ;;
+ XLATT ACDI_LOWER_SEC ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_ACDI_DIAR: ;;
+ PUT_ERROR_CHAR ACDI_LOWER_SEC ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; TILDE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+TILDE_PROC: ;;
+ ;;
+ IFF TILDE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+TILDE_ON: ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+NON_DEAD: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE,NOT ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ELSEF ;;
+ IFF LC_E0, NOT ;;
+ IFF EITHER_SHIFT ;;
+ XLATT NON_ALPHA_UPPER_SEC ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER_SEC ;;
+ ELSEF ;;
+ XLATT ALPHA_UPPER_SEC ;;
+ ENDIFF ;;
+ ELSEF ;;
+ XLATT NON_ALPHA_LOWER_SEC ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_UPPER_SEC ;;
+ ELSEF ;;
+ XLATT ALPHA_LOWER_SEC ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ELSEF
+ IFF EITHER_ALT,NOT ;;
+ XLATT CTRL_CASE
+ ELSEF ;;
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT,NOT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + Ctrl
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; GK 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 GK_COMMON_XLAT ;;
+GK_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ********
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 3 ;; number of entries
+ DB 27h ;;
+ FLAG ACUTE ;;
+ DB 2bh ;;
+ FLAG GRAVE ;;
+; DB 28h ;; No corresponding characters with Circ.
+; FLAG CIRCUMFLEX ;; in either codepage, so replaced by corresponding
+ ;; standalone character.
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ********
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 27h ;;
+ FLAG DIARESIS ;;
+;; DB 28h ;; No corresponding characters in either codepage
+;; FLAG TILDE ;; so commented out and replaced by
+ ;; standalone tilde.
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift DEAD_UPPER_SEC
+;; KEYBOARD TYPES: G SECONDARY MODE
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_SC_UP_END-$ ;; length of state section
+ DB DEAD_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 27h ;;
+ FLAG DIARESIS_SEC ;; BUG-BUG
+ ;; Not available in 737 cp
+CP869_SC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift DEAD_lower_SEC
+;; KEYBOARD TYPES: G SECONDARY MODE
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_SC_LO_END-$ ;; length of state section
+ DB DEAD_LOWER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 27h ;;
+ FLAG ACUTE_SEC ;; BUG-BUG
+ ;; Not available in 737 cp
+CP869_SC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ******
+;; CODE PAGE: Common
+;; STATE: Third Shift Dead Key SECONDARY (Greek)
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; BUG-BUG not in 737
+ ;;
+ DW CP869_SE_TH_END-$ ;; length of state section
+ DB DEAD_THIRD_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 27h ;;
+ FLAG ACUTE_DIAR ;; Unique key to Greek codepages
+ ;; combination of diaresis and acute
+CP869_SE_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common ********
+;; STATE: Non-alpha Upper Case
+;; KEYBOARD: G_KB, P_KB, P12_KB Latin Mode
+;; 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 GK_005300-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 15 ;; number of scans
+ DB 03,22h ;; "
+ DB 07,26h ;; &
+ DB 08,2fh ;; /
+ DB 09,28h ;; (
+ DB 0Ah,29h ;; )
+ DB 0Bh,3dh ;; =
+ DB 0Ch,3fh ;; ?
+ DB 0Dh,2ah ;; *
+ DB 28h,7eh ;; Circumflex standalone char, to replace useless dead key
+ DB 29h,7ch ;; |
+ DB 2bh,40h ;; @
+ DB 33h,3bh ;; ;
+ DB 34h,3ah ;; :
+ DB 35h,5fh ;; _
+ DB 56h,3eh ;; >
+ ;;
+GK_005300: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NA_UP_1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Non-alpha Upper Case SECONDARY KEYBOARD MODE
+;; KEYBOARD: all
+;; TABLE TYPE: Translate Greek Mode
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_2_END-$ ;; Length of state section
+ DB NON_ALPHA_UPPER_SEC ;;
+ DW ANY_KB ;;
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_005301-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of scans
+ DB 03,22h ;; "
+ DB 08,2fh ;; /
+ DB 09,28h ;; (
+ DB 0Ah,29h ;; )
+ DB 0Bh,3dh ;; =
+ DB 0ch,0f8h ;; ú
+ DB 0Dh,2ah ;; *
+ DB 29h,0f1h ;; +-
+ DB 33h,3bh ;; ;
+ DB 34h,3ah ;; :
+ DB 35h,5fh ;; _
+
+GK_005301: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NA_UP_2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Non_alpha_lower Case
+;; KEYBOARD: all
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LC_1_END-$ ;; Length of state section
+ DB NON_ALPHA_LOWER ;;
+ DW ANY_KB ;;
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_005303-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of scans
+ DB 28h,5eh ;; Circumflex standalone char, to replace useless dead key
+ DB 29h,5ch ;; \
+ DB 0ch,27h ;; '
+ DB 0dh,2bh ;; +
+ DB 35h,2dh ;; -
+ DB 56h,3ch ;; <
+ ;;
+GK_005303: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NA_LC_1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common *******
+;; STATE: Non_alpha_lower Case Secondary keyboard
+;; KEYBOARD: all Greek
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_L_1_END-$ ;; Length of state section
+ DB NON_ALPHA_LOWER_SEC ;;
+ DW ANY_KB ;;
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_00530-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of scans
+ DB 29h,0abh ;; 1/2
+ DB 0ch,27h ;; '
+ DB 0dh,2bh ;; +
+ DB 35h,2dh ;;
+ DB 56h,15h ;; character 15h
+ ;;
+GK_00530: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_NA_L_1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: CIRCUMFLEX Lower Case
+;; 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 0 ;; number of scans
+ ;;
+COM_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Circumflex Space Bar
+;; KEYBOARD TYPES: P12_KB+G_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_SP_END-$ ;; length of state section
+ DB CIRCUMFLEX_SPACE ;; State ID
+ DW ANY_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 ;; error character = standalone accent
+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: Grave Lower Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_LO_END-$ ;; Length of state section
+ DB GRAVE_LOWER ;;
+ DW ANY_KB ;;
+ DB 60h,0 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_001200-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;;
+GK_001200: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_GR_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Space Bar
+;; KEYBOARD TYPES: Any,
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_SP_END-$ ;; length of state section
+ DB GRAVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW COM_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,060H ;; STANDALONE TILDE
+ ;;
+COM_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Lower
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;; 869,737 have no tilde characters
+COM_TI_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_TI_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Tilde Upper Case
+;; KEYBOARD TYPES: Any
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;; 863 has no tilde chars.
+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: Any,
+;; 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE: Any
+;; STATE: LAT_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F2_END-$ ;; length of state section
+ DB LAT_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; GK Specific Translate Section for 869
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC GK_869_XLAT ;;
+GK_869_XLAT: ;;
+ ;;
+ DW CP869_XLAT_END-$ ;; length of section
+ DW 869 ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ******* (Greek)
+;; CODE PAGE: 869
+;; STATE: Third Shift Sec SECONDARY
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C869_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW C869_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35h,0f0h ;; sd10
+ ;;
+C869_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C869_TS_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869 ******
+;; STATE: Non-Alpha Upper Case SECONDARY KEYBOARD
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP869_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 9 ;; number of entrie
+ DB 04h,9ch ;; œ
+ DB 07h,89h ;; -|
+ DB 2bh,9ah ;; superscript 3 not in 737
+ DB 56h,97h ;; copyright symbol not in 737
+ DB 1ah,0aeh ;; << does not exist in 737
+ DB 1bh,0afh ;; >> does not exist in 737
+ DB 10h,8eh ;; -- does not exist in 737
+ DB 11h,8ah ;; | does not exist in 737
+ DB 28h,8bh ;; ` does not exist in 737
+
+ ;;
+CP869_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Non Alpha Lower SECONDARY KEYBOARD
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP869_NA_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP869_NA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;; number of entries
+ ;;
+; DB 27h,0efh ;; Acute-now a dead key
+ DB 10h,88h ;;
+ DB 28h,8ch ;;
+ DB 2bh,99h ;;
+
+CP869_NA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_NA_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_AL_LW_END-$ ;; length of state section
+ DB ALPHA_LOWER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP869_AL_LW_T2_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 25 ;; number of scans
+ DB 11h,0edh ;;
+ DB 12h,0deh ;; Greek alpha characters
+ DB 13h,0ebh ;;
+ DB 14h,0eeh ;;
+ DB 15h,0e7h ;;
+ DB 16h,0e2h ;;
+ DB 17h,0e3h ;;
+ DB 18h,0e9h ;;
+ DB 19h,0eah ;;
+ DB 1eh,0d6h ;;
+ DB 1fh,0ech ;;
+ DB 20h,0ddh ;;
+ DB 21h,0f3h ;;
+ DB 22h,0d8h ;;
+ DB 23h,0e1h ;;
+ DB 24h,0e8h ;;
+ DB 25h,0e4h ;;
+ DB 26h,0e5h ;;
+ DB 2ch,0e0h ;;
+ DB 2dh,0f4h ;;
+ DB 2eh,0f6h ;;
+ DB 2fh,0fah ;;
+ DB 30h,0d7h ;;
+ DB 31h,0e7h ;;
+ DB 32h,0e6h ;;
+ ;;
+CP869_AL_LW_T2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_AL_LW_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_AL_2P_END-$ ;; length of state section
+ DB ALPHA_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP869_AL_UP_T2_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 25 ;; number of scans
+ ;;
+ DB 12h,0a8h ;; Greek alpha characters
+ DB 13h,0c7h ;;
+ DB 14h,0d0h ;;
+ DB 15h,0d1h ;;
+ DB 16h,0ach ;;
+ DB 17h,0adh ;;
+ DB 18h,0beh ;;
+ DB 19h,0c6h ;;
+ DB 1eh,0a4h ;;
+ DB 1fh,0cfh ;;
+ DB 20h,0a7h ;;
+ DB 21h,0d2h ;;
+ DB 22h,0a6h ;;
+ DB 23h,0aah ;;
+ DB 24h,0bdh ;;
+ DB 25h,0b5h ;;
+ DB 26h,0b6h ;;
+ DB 2ch,0a9h ;;
+ DB 2dh,0d3h ;;
+ DB 2eh,0d4h ;;
+ DB 2fh,0d5h ;;
+ DB 30h,0d7h ;;
+ DB 31h,0b8h ;;
+ DB 32h,0b7h ;;
+ ;;
+CP869_AL_UP_T2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_AL_2P_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Diaresis Upper Sec
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_D2_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0f9h,0 ;; error character = standalone accent
+ ;;
+ DW CP869_D2_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 17h,91h ;; I diaeresis
+ DB 15h,96h ;; U diaeresis
+ ;;
+CP869_D2_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_D2_UP_END: ;; length of state section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+;; CODE PAGE: 869 LATIN
+;; STATE: Diaresis Lower Case Sec
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C869_D2_LO_END-$ ;; Length of state section
+ DB DIARESIS_LOWER_SEC ;;
+ DW ANY_KB ;;
+ DB 0f9h,0 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK2_869-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 17h,0a0h ;; I diaresis GREEK char
+ DB 15h,0fbh ;; Y diaresis GREEK char
+GK2_869: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C869_D2_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Diaresis Space Bar SEC
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_D2_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0f9h,0 ;; error character = standalone accent
+ ;;
+ DW CP869_D2_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
+CP869_D2_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP869_D2_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Diaresis Upper
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0f9h,0 ;; error character = standalone accent
+ ;;
+ DW CP869_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 17h,91h ;; I diaeresis
+ DB 15h,96h ;; U diaeresis
+ ;;
+CP869_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_DI_UP_END: ;; length of state section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+;; CODE PAGE: 869 LATIN
+;; STATE: Diaresis Lower Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C869_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 GK_869-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 0 ;; number of scans
+ ;;
+GK_869: ;; No Characters for this in Either codepage
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C869_DI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: Diaresis Space Bar
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0f9h,0 ;; error character = standalone accent
+ ;;
+ DW CP869_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
+CP869_DI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP869_DI_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: ACUTE Upper Sec
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_A_UP_END-$ ;; length of state section
+ DB ACUTE_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0efh,0 ;; error character = standalone accent
+ ;;
+ DW CP869_A_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 12h,08dh ;; acute E
+ DB 15h,095h ;; acute Y
+ DB 18h,092h ;; acute O
+ DB 1eh,086h ;; acute A
+ DB 23h,08fh ;; acute H
+ DB 2fh,098h ;; acute OMEGA
+ DB 17h,090h ;; acute IOTA
+ ;;
+CP869_A_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_A_UP_END: ;; length of state section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+;; CODE PAGE: 869 LATIN
+;; STATE: ACUTE Lower Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C869_A_LO_END-$ ;; Length of state section
+ DB ACUTE_LOWER_SEC ;;
+ DW ANY_KB ;;
+ DB 0efh,0 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_A_869-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 12h,09dh ;; acute e
+ DB 15h,0a3h ;; acute y
+ DB 18h,0a2h ;; acute o
+ DB 1eh,09bh ;; acute a
+ DB 23h,09eh ;; acute h
+ DB 2fh,0fdh ;; acute omega
+ DB 17h,09fh ;; acute iota
+ ;;
+GK_A_869: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C869_A_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: ACUTE Space Bar Sec
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_A_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0efh,0 ;; error character = standalone accent
+ ;;
+ DW CP869_A_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0efh ;; error character = standalone accent
+CP869_A_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP869_A_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: ACUTE Upper
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_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 CP869_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 12h,08dh ;; acute E
+ DB 15h,095h ;; acute Y
+ DB 18h,092h ;; acute O
+ DB 1eh,086h ;; acute A
+ DB 23h,08fh ;; acute H
+ DB 2fh,098h ;; acute OMEGA
+ DB 17h,090h ;; acute IOTA
+ ;;
+CP869_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_AC_UP_END: ;; length of state section
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+;; CODE PAGE: 869 LATIN
+;; STATE: ACUTE Lower Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C869_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 GK_AC_869-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of scans
+ DB 12h,09dh ;; acute e
+ DB 15h,0a3h ;; acute y
+ DB 18h,0a2h ;; acute o
+ DB 1eh,09bh ;; acute a
+ DB 23h,09eh ;; acute h
+ DB 2fh,0fdh ;; acute omega
+ DB 17h,09fh ;; acute iota
+ ;;
+GK_AC_869: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C869_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869
+;; STATE: ACUTE Space Bar
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_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 CP869_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0efh ;; error character = standalone accent
+CP869_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP869_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869 Acute-Diaresis combo GREEK Secondary
+;; STATE: Acute-diaresis Lower Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_LO_END-$ ;; Length of state section
+ DB ACDI_LOWER_SEC ;;
+ DW ANY_KB ;;
+ DB 0f7h,0 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_001100-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 17h,0a1h ;; i acute-diaresis
+ DB 15h,0fch ;;
+GK_001100: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 869 SECONDARY Greek mode
+;; STATE: ACDI INPUT: Space Bar
+;; KEYBOARD: All Not really acute, but
+;; TABLE TYPE: Translate Acute_diaresis combination
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP869_AC2_SP_END-$ ;; Length of state section
+ DB ACDI_SPACE_SEC ;;
+ DW ANY_KB ;;
+ DB 0f7H,0 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_10450-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F7H ;; ACDI
+GK_10450: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP869_AC2_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: ACDI Upper Case
+;; KEYBOARD: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_UP_END-$ ;; Length of state section
+ DB ACDI_UPPER_SEC ;;
+ DW ANY_KB ;;
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW GK_003100-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 17h,0a1h ;; i ACDI-diaresis
+ DB 15h,0fch ;;
+GK_003100: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_UP_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP869_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; GK Specific Translate Section for 737
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+PUBLIC GK_737_XLAT ;;
+GK_737_XLAT: ;;
+ ;;
+ DW CP737_XLAT_END-$ ;; length of section
+ DW 737 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *******
+;; CODE PAGE: 737 GREEK
+;; STATE: Non Alpha Lower SECONDARY KEYBOARD
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP737_NA_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP737_NA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 2 ;; number of entries
+ DB 10h,0f9h ;; Middle dot
+ DB 2bh,0fdh ;; subscript 2
+
+CP737_NA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP737_NA_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Last state for 737 ;;
+;; CODE PAGE: 737
+;; STATE: Alpha lower Case SECONDARY
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP737_AL_LW_END-$ ;; length of state section
+ DB ALPHA_LOWER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP737_AL_LW_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 25 ;; number of scans
+ DB 11h,0aah ;;
+ DB 12h,09ch ;; Greek alpha characters
+ DB 13h,0a8h ;;
+ DB 14h,0abh ;;
+ DB 15h,0a4h ;;
+ DB 16h,09fh ;;
+ DB 17h,0a0h ;;
+ DB 18h,0a6h ;;
+ DB 19h,0a7h ;;
+ DB 1eh,098h ;;
+ DB 1fh,0a9h ;;
+ DB 20h,09bh ;;
+ DB 21h,0adh ;;
+ DB 22h,09ah ;;
+ DB 23h,09eh ;;
+ DB 24h,0a5h ;;
+ DB 25h,0a1h ;;
+ DB 26h,0a2h ;;
+ DB 2ch,09dh ;;
+ DB 2dh,0aeh ;;
+ DB 2eh,0afh ;;
+ DB 2fh,0e0h ;;
+ DB 30h,099h ;;
+ DB 31h,0a4h ;;
+ DB 32h,0a3h ;;
+ ;;
+CP737_AL_LW_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP737_AL_LW_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Last state for 737 ;;
+;; CODE PAGE: 737
+;; STATE: Alpha UPPER Case SECONDARY
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP737_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER_SEC ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP737_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 25 ;; number of scans
+ DB 12h,084h ;; Greek alpha characters
+ DB 13h,090h ;;
+ DB 14h,092h ;;
+ DB 15h,093h ;;
+ DB 16h,087h ;;
+ DB 17h,088h ;;
+ DB 18h,08eh ;;
+ DB 19h,08fh ;;
+ DB 1eh,080h ;;
+ DB 1fh,091h ;;
+ DB 20h,083h ;;
+ DB 21h,094h ;;
+ DB 22h,082h ;;
+ DB 23h,086h ;;
+ DB 24h,08dh ;;
+ DB 25h,089h ;;
+ DB 26h,08ah ;;
+ DB 2ch,085h ;;
+ DB 2dh,095h ;;
+ DB 2eh,096h ;;
+ DB 2fh,097h ;;
+ DB 30h,081h ;;
+ DB 31h,08ch ;;
+ DB 32h,08bh ;;
+ ;;
+CP737_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP737_AL_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Last state for 737 ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP737_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+CODE ENDS ;;
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfhu.asm b/private/mvdm/dos/v86/dev/keyboard/kdfhu.asm
new file mode 100644
index 000000000..3d5f2237e
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfhu.asm
@@ -0,0 +1,2363 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for:
+;; HUNGARY
+;; which form the Multilingual (ML) Group 2.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;; Adapted by Mihindu (Microsoft) Nov. 30, 1990
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC HU_LOGIC ;;
+ PUBLIC HU_850_XLAT ;;
+ PUBLIC HU_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; HU State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+HU_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 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ 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 ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; HU 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 HU_COMMON_XLAT ;;
+HU_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW COM_HU_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 41 ;;
+; FLAG OGONEK ;;
+ ;;
+;COM_HU_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW COM_HU_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 41 ;;
+; FLAG OVERDOT ;;
+; ;;
+;COM_HU_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_HU_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 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY (YST)
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_HU_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: ANY_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 4 ;; number of entries
+ DB 11,"”",0BH ;;
+ DB 12,"",0CH ;;
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 4 ;; number of entries
+ DB 11,"™",0BH ;;
+ DB 12,"š",0CH ;;
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 41,"0" ;;
+ 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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 2,"'" ;;
+ DB 3,'"' ;;
+ DB 4,"+" ;;
+ DB 5,"!" ;;
+ DB 7,'/' ;;
+ DB 8,'=' ;;
+ DB 9,'(' ;;
+ DB 10,')' ;;
+ DB 41, 0F5H ;;
+ 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: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 27 ;; number of entries
+ DB 2,'~',02H ;;
+ DB 8,'`',08H ;;
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 20,'$',14H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,0D6H,17H ;;
+ DB 24,'>',18H ;;
+ DB 25,'*',19H ;;
+ DB 26,'ö',1AH ;;
+ DB 30,';',1EH ;;
+ DB 33,'[',21H ;;
+ DB 34,']',22H ;;
+ DB 35,'&',23H ;;
+ DB 36,0A1H,24H ;;
+ DB 39,'$',27H ;;
+ DB 40,0E1H,28H ;; SHARP S
+ DB 44,'>',2CH ;;
+ DB 45,'#',2DH ;;
+ DB 46,'&',28H ;;
+ DB 47,'@',2FH ;;
+ DB 48,'{',30H ;;
+ DB 49,'}',31H ;;
+ DB 50,'<',32H ;;
+ DB 51,';',33H ;;
+ DB 52,'>',34H ;;
+ DB 53,'*',35H ;;
+ DB 86,'<',56H ;;
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC HU_850_XLAT ;;
+HU_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 5,-1 ;; CURRENCY SYMBOL
+CP850_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 1 ;; number of entries
+ DB 5,-1 ;; CURRENCY SYMBOL
+CP850_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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,0FEH,0 ;; 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: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FEH,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FEH ;; OGONEK SPACE
+CP850_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC HU_852_XLAT ;;
+HU_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 13,0A2H ;; o ACUTE
+ DB 26,08BH ;; o DOUBLE ACUTE
+ DB 27,0A3H ;; u ACUTE
+ DB 39,082H ;; e ACUTE
+ DB 40,0A0H ;; a ACUTE
+ DB 43,0FBH ;; u DOUBLE ACUTE
+ DB 86,0A1H ;; i ACUTE
+CP852_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 13,0E0H ;; O ACUTE
+ DB 26,08AH ;; O DOUBLE ACUTE
+ DB 27,0E9H ;; U ACUTE
+ DB 39,090H ;; E ACUTE
+ DB 40,0B5H ;; A ACUTE
+ DB 43,0EBH ;; U DOUBLE ACUTE
+ DB 86,214 ;; I ACUTE
+CP852_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 8 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 27,09EH,1BH ;;
+ DB 22,0CFH,16H ;; CURRENCY SYMBOL
+ DB 31,0D0H,1FH ;; d STROKE
+ DB 32,0D1H,20H ;; D STROKE
+ DB 37,088H,25H ;; l STROKE
+ DB 38,09DH,26H ;; L STROKE
+ DB 43,0CFH,2BH ;; CURRENCY SYMBOL
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 0 ;; number of entries
+CP852_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_UP_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 0 ;; number of entries
+CP852_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfic.asm b/private/mvdm/dos/v86/dev/keyboard/kdfic.asm
new file mode 100644
index 000000000..1595b63c1
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfic.asm
@@ -0,0 +1,1836 @@
+ 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
+;
+;17-10-1989
+; Skr in ¡slenskuŒ.
+; TILDE hlutinn er notaŒur fyrir bollu a ( †)
+; TILDE section used for ascii 134 (†), ascii 143 ()
+;
+; 29.11.1989
+; ¥ l¡nu 826 er b‘tt viŒ Alt-Gr , og Alt-Gr . n‘r ¡ t knin
+; < > minna og st‘rraen ......
+; Line ca. 826 (Alt-Gr ,) and (Alt-Gr .) for ascii 60 and 62
+; added for 91 key keyboards.
+;
+; 30.11.1989 CODE PAGE 850
+; Lagf‘rt ¡ 850 hlutanum b‘tt inn • og Œ ( thorn and eth )
+; TILDE hlutinn notaŒur fyrir bollu a ( †)
+;
+;
+; Til aŒ breyta kommu - punkt   talnaborŒi, •arf aŒ breyta
+; skilgreiningu   sv‘Œinu:
+; CODE PAGE: Common
+; STATE: Numeric key pad
+; l¡nun£mer ca. 480
+; 14.12.1990
+; CORRECTIONS MADE FROM THE "SWEDISH ORIGINAL"
+; Eftirfarandi breytingar gerŒar.
+; ¥ l¡nu ca. 827 er b‘tt inn "@" •.e. attsign   stafinn Q.
+; ¥ l¡nu ca. 559 er b‘tt inn "^_" sem er Soft Hyphen   underline
+; hnappinn.
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Icelandic (Swedish)
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC IC_LOGIC ;;
+ PUBLIC IC_861_XLAT ;;
+ PUBLIC IC_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; IC State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+IC_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 861 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; IS 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 IC_COMMON_XLAT ;;
+IC_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 40 ;13 ;; scan code
+ FLAG ACUTE ;; flag bit to set
+ DB 41 ;;
+ FLAG TILDE ;;
+; ;;
+; ;;
+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 40 ;; scan code
+ FLAG ACUTE ;; flag bit to set
+ DB 41 ;;
+ FLAG DIARESIS ;;
+ ;;
+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 43 ;; scan code
+ FLAG GRAVE ;; flag bit to set
+ DB 40 ;;
+ FLAG CIRCUMFLEX ;;
+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 9 ;; number of entries
+ DB 9,01BH,09H ;;
+ DB 10,01DH,0AH ;;
+ DB 12,-1,-1 ;;
+ DB 13,01FH,0DH ;; Soft Hyphen
+ 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 ( 861 )
+;; 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 4 ;; number of entries
+ DB 53,095H ;; iclandic thorn
+ DB 39,091H ;; lowercase ae
+ DB 26,08CH ;; icelandic eth
+ DB 12,094H ;; o - diaresis
+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 4 ;; number of entries
+ DB 53,08DH ;; icelandic uppercase thorn
+ DB 39,092H ;; uppercase AE
+ DB 26,08BH ;; uppercase ETH
+ DB 12,099H ;; uppercase 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 43,"+" ;; + INCLUDED FOR SIMPLIC.
+ DB 27,"'" ;; '
+ DB 86,"<" ;; <
+ DB 13,"-" ;; -
+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 41,"+" ;; +
+ DB 27,"'" ;; '
+ DB 43,"<" ;; <
+ DB 13,"-" ;; -
+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 41,"+" ;; +
+ DB 43,"<" ;; <
+ DB 27,"'" ;; '
+ DB 13,"-" ;; -
+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 14 ;; number of entries
+ DB 3,'"' ;;
+ DB 4,'#' ;;
+ DB 5,'$' ;;
+ DB 7,'&' ;;
+ DB 8,'/' ;;
+ DB 9,'(' ;;
+ DB 10,')' ;;
+ DB 11,'=' ;;
+ DB 27,'?' ;;
+; DB 41,'«' ;;
+ DB 43,'*' ;;
+ DB 51,';' ;;
+ DB 52,':' ;;
+ DB 13,'_' ;;
+ 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 5,'$'
+ 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 5,'$' ;;
+ DB 6,'%' ;;
+ 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 14 ;; number of entries
+ DB 16,'@' ;; breytt vegna IBM "staŒals"
+ DB 3,'@' ;; haldiŒ inni   "t”lustafnum 2"
+ DB 4,09CH ;; œ
+ DB 5,'$' ;;
+ DB 8,'{' ;;
+ DB 9,'[' ;;
+ DB 10,']' ;;
+ DB 11,'}' ;;
+ DB 12,'\' ;; Broken Vertical Line
+ DB 86,'|' ;;
+ DB 40,'^' ;;
+ DB 27,'~' ;;
+ DB 51,'<' ;;
+ DB 52,'>' ;;
+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 2 ;; number of scans
+ DB 18,'Š' ;; scan code,ASCII - e
+ DB 30,'…' ;; scan code,ASCII - a
+; DB 23,'' ;; scan code,ASCII - i
+; DB 24,'•' ;; scan code,ASCII - o
+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
+;; 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 1 ;; number of scans
+; DB 18,0D4H ;; E grave
+; DB 22,0EBH ;; U grave
+; DB 23,0DEH ;; I grave
+; DB 24,0E3H ;; O grave
+;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 4 ;; 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 OVERCIRLCE
+;; 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 248,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 30,'†' ;; scan code,ASCII - ¤
+ COM_TI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+ COM_TI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CODE PAGE: Common
+;;; STATE: Tilde Upper Case ;OVERCIRLCE
+;;; 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 248,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 30,'' ;; scan code,ASCII - A
+ 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 248,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,248 ;; 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: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; IS Specific Translate Section for 861
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC IC_861_XLAT ;;
+IC_861_XLAT: ;;
+ ;;
+ DW CP861_XLAT_END-$ ;; length of section
+ DW 861 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G, P12
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_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 CP861_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 5,'$' ;;
+CP861_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G, P12
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW CP861_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 CP861_NA_LO_K1_T1_END-$ ;; Size of xlat table
+; DB STANDARD_TABLE ;; xlat options:
+; DB 1 ;; number of entries
+; DB 41,015H ;; SECTION Symb
+;CP861_NA_LO_K1_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;CP861_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_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 CP861_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,'˜' ;; 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
+CP861_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_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 CP861_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of entries
+ DB 30,'¤' ;; scan code,ASCII - A
+ DB 18,'' ;; scan code,ASCII - E
+ DB 21,'—' ;; scan code,ASCII - Y
+ DB 22,'§' ;; scan code,ADCII - U
+ DB 23,'¥' ;; scan code,ASCII - I
+ DB 24,'¦' ;; scan code,ASCII - O
+CP861_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_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 CP861_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
+CP861_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_AC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP861
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 250,0 ;; error character = standalone accent
+ ;;
+ DW CP861_DI_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 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
+CP861_DI_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_DI_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP861
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 250,0 ;; error character = standalone accent
+ ;;
+ DW CP861_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 22,'š' ;; scan code,ASCII - U
+; DB 24,'™' ;; scan code,ASCII - O
+ DB 30,'Ž' ;; scan code,ASCII - A
+CP861_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP861_DI_UP_END: ;; length of state section
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 861
+;; STATE: Diaresis Space Bar
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP861_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 250,0 ;; error character = standalone accent
+ ;;
+ DW CP861_DI_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,250 ;; error character = standalone accent
+CP861_DI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP861_DI_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP861_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; IS Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC IC_850_XLAT ;;
+IC_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C850_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 C850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ DB 53,0E7H ;; iclandic thorn
+ DB 39,091H ;; lowercase ae
+ DB 26,0D0H ;; icelandic eth
+ DB 12,094H ;; o - diaresis
+C850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C850_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 C850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ DB 53,0E8H ;; icelandic uppercase thorn
+ DB 39,092H ;; uppercase AE
+ DB 26,0D1H ;; uppercase ETH
+ DB 12,099H ;; uppercase O-DIAERESIS
+C850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C850_AL_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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 icelndic
+ 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 icelandic
+ 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 BOLLU † ***********************
+;; 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 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_TI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+; DB 24,094H ;; scan code,ASCII - o tilde
+ DB 30,086H ;; scan code,ASCII - a tilde
+ CP850_TI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+ CP850_TI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CODE PAGE: 850
+;;; STATE: Tilde Upper Case BOLLU OG ™ **************
+;;; 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 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_TI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+; DB 24,099H ;; scan code,ASCII - O tilde
+ DB 30,08FH ;; 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: Tilde Space Bar BOLLU - OVERCIRCLE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW C850_TI_SP_END-$ ;; length of state section
+ DB TILDE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 248,0 ;; error character = standalone accent
+ ;;
+ DW C850_TI_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,248 ;; STANDALONE TILDE
+C850_TI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+C850_TI_SP_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/private/mvdm/dos/v86/dev/keyboard/kdfit.asm b/private/mvdm/dos/v86/dev/keyboard/kdfit.asm
new file mode 100644
index 000000000..76d6cb15d
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfit.asm
@@ -0,0 +1,800 @@
+;; LATEST CHANGE ALT & CTL
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfit141.asm b/private/mvdm/dos/v86/dev/keyboard/kdfit141.asm
new file mode 100644
index 000000000..d5cdaa97c
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfit141.asm
@@ -0,0 +1,800 @@
+
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfit142.asm b/private/mvdm/dos/v86/dev/keyboard/kdfit142.asm
new file mode 100644
index 000000000..1fcbe2196
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfit142.asm
@@ -0,0 +1,871 @@
+
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Author: NICK SAVAGE - IBM CORPORATION - May 1986,87
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfjp.asm b/private/mvdm/dos/v86/dev/keyboard/kdfjp.asm
new file mode 100644
index 000000000..3846dfe86
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfjp.asm
@@ -0,0 +1,843 @@
+;CODE to be deleted has a double ;; followed by actual asm code....****
+
+;; LATEST CHANGE ALT & CTL
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Japanese.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: Shuzo Kusuda - IBM Japan, Yamato Lab. - Feb. 1990
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+;M000 INCLUDE POSTEQU.SRC ;;
+ include postequ.inc ; M000 -- our inc file reflects the
+; ; necessary changes as M024
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC JP_LOGIC ;;
+ PUBLIC JP_COMMON_XLAT ;;
+ PUBLIC JP_932_XLAT ;;
+ PUBLIC JP_437_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; JP State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+JP_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW 0 ;; special features
+ ;;
+ ;; COMMANDS START HERE
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DBCS \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OPTIONS: If we find a scan match in
+;; an XLATT or SET_FLAG operation then
+;; exit from INT 9.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ OPTION EXIT_IF_FOUND ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OPTIONS: If we find a scan match in
+;; an XLATT or SET_FLAG operation then
+;; exit from INT 9.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IFKBD DBCS_OLD_A_KB ;; ;JP9009
+ XLATT DBCS_OLD_A ;; ;JP9009
+ENDIFF ;; ;JP9009
+ ;;
+IFF EITHER_ALT, NOT ;; ;JP900807
+ANDF EITHER_CTL, NOT ;; ;JP900807
+ IFF LC_E0 ;; Avoid accidentally translating
+ XLATT NUMERIC_PAD ;; the key of the numeric ;JP900807
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ENDIFF ;; ;JP900807
+ ;;
+;JP900727 IFF EITHER_CTL,NOT ;;
+;JP900727 IFF EITHER_ALT ;; ALT - case
+;JP900727 XLATT ALT_CASE ;;
+;JP900727 ENDIFF ;;
+;JP900727 ELSEF ;;
+ IFF EITHER_ALT ;; ;JP900727
+ XLATT ALT_CASE ;; ALT case ;JP900727
+ ENDIFF ;; ;JP900727
+ IFF EITHER_CTL ;; ;JP900727
+ IFF EITHER_ALT,NOT ;;
+ XLATT CTRL_CASE ;; CTRL case
+ ENDIFF ;;
+ 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.
+;JP900807 IFF NUM_STATE,NOT ;;
+;JP900807 XLATT NUMERIC_PAD ;;
+;JP900807 ENDIFF ;;
+ XLATT NON_ALPHA_UPPER ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER ;;
+ ELSEF ;;
+ XLATT ALPHA_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+;JP900807 IFF NUM_STATE ;;
+;JP900807 XLATT NUMERIC_PAD ;;
+;JP900807 ENDIFF ;;
+ XLATT NON_ALPHA_LOWER ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_UPPER ;;
+ ELSEF ;;
+ XLATT ALPHA_LOWER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; JP 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;
+; Hardware Scan Codes
+;
+HW_SC_0 equ 0bh ;JP9007
+HW_SC_HAT equ 0dh ;JP9007
+HW_SC_BACK_SLASH_NEW equ 73h
+HW_SC_BACK_SLASH equ 73h
+HW_SC_YEN_NEW equ 7dh
+HW_SC_YEN_OLD equ 2bh
+HW_SC_CONV equ 79h
+HW_SC_NO_CONV equ 7bh
+HW_SC_HALF_FULL_NEW equ 29h
+HW_SC_HALF_FULL_OLD equ 77h
+HW_SC_HIRAGANA equ 70h ; new G only
+HW_SC_KATAKANA equ 70h ; old G only
+HW_SC_KATAKANA_A equ 70h ; old A only
+HW_SC_KANJI_OLD_A equ 68h
+HW_SC_TANGO_TOHROKU_A equ 67h ;JP9009
+HW_SC_PAD_COMMA equ 33h ;JP900807
+;JP9009 PSEUDO_SC_HIRAGANA equ 7dh
+PSEUDO_SC_ALPHANUMERIC equ 7eh
+PSEUDO_SC_HIRAGANA equ 7fh ;JP9009
+
+HW_SC_TORIKESHI equ 55h ;JP9009
+HW_SC_PA1 equ 5ah ;JP9009
+HW_SC_CSR_BLINK equ 5bh ;JP9009
+HW_SC_INTERRUPT equ 5ch ;JP9009
+HW_SC_UF1 equ 5dh ;JP9009
+HW_SC_PA2 equ 5eh ;JP9009
+HW_SC_UF2 equ 63h ;JP9009
+HW_SC_UF3 equ 64h ;JP9009
+HW_SC_UF4 equ 65h ;JP9009
+HW_SC_ATTENTION equ 66h ;JP9009
+HW_SC_SIZE_CONV equ 69h ;JP9009
+HW_SC_MESSAGE equ 6ah ;JP9009
+HW_SC_COPY equ 6bh ;JP9009
+HW_SC_SHUHRYOH equ 6ch ;JP9009
+HW_SC_ERASE_EOF equ 6dh ;JP9009
+HW_SC_CLEAR equ 76h ;JP9009
+;
+; Type of converted scan code
+;
+PSEUDO_CODE equ 00h
+EXTENDED_CODE equ 0f0h
+EXTENDED_CODE_E0 equ 0e0h ;JP900807
+;
+; Extended code list
+;
+EXT_HALF_FULL equ 0afh
+EXT_HALF_FULL_UPPER equ 0b0h
+EXT_HALF_FULL_CTRL equ 0b1h
+EXT_KANJI equ 0b2h
+EXT_ALPHA_NUMERIC equ 0b3h
+EXT_ALPHA_NUMERIC_CTRL equ 0b4h
+EXT_KANJI_NO equ 0b5h
+EXT_HIRAGANA equ 0b6h
+EXT_KATAKANA equ 0b7h
+EXT_HIRAGANA_CTRL equ 0b8h
+EXT_ROMAJI equ 0b9h
+EXT_HALF_FULL_ALT equ 0bah
+EXT_ALPHA_NUMERIC_ALT equ 0bbh
+EXT_HIRAGANA_UPPER equ 0bch
+EXT_KATAKANA_CTRL equ 0bdh
+EXT_KANJI_UPPER equ 0beh
+EXT_KANJI_CTRL equ 0bfh
+EXT_KATAKANA_SHIFT_A equ 0c0h ;JP9009
+EXT_KATAKANA_ALT_A equ 0c1h ;JP9009
+EXT_TANGO_A equ 0c2h ;JP9009
+EXT_TANGO_SHIFT_A equ 0c3h ;JP9009
+EXT_TANGO_CTRL_A equ 0c4h ;JP9009
+EXT_TANGO_ALT_A equ 0c5h ;JP9009
+
+EXT_NO_CONV_1 equ 0abh
+EXT_NO_CONV_2 equ 0ach
+EXT_NO_CONV_3 equ 0adh
+EXT_NO_CONV_4 equ 0aeh
+EXT_CONV_1 equ 0a7h
+EXT_CONV_2 equ 0a8h
+EXT_CONV_3 equ 0a9h
+EXT_CONV_4 equ 0aah
+
+JP_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common ;JP9009
+;; STATE: DBCS Old A Keyboard Unique Keys ;JP9009
+;; KEYBOARD TYPES: Old DBCS keyboard ;JP9009
+;; TABLE TYPE: Translate ;JP9009
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JP9009
+ ;; ;JP9009
+ DW COM_OLD_A_END-$ ;; length of state section ;JP9009
+ DB DBCS_OLD_A ;; State ID ;JP9009
+ DW DBCS_OLD_KB ;; Keyboard Type ;JP9009
+ DB -1,-1 ;; Buffer entry for error char ;JP9009
+ ;; ;JP9009
+ DW COM_OLD_A_T1_END-$ ;; Size of xlat table ;JP9009
+ DB STANDARD_TABLE ;; xlat options: ;JP9009
+ DB 16 ;; number of entries ;JP9009
+ DB HW_SC_SHUHRYOH , -1 ;; ;JP9009
+ DB HW_SC_CLEAR , -1 ;; ;JP9009
+ DB HW_SC_MESSAGE , -1 ;; ;JP9009
+ DB HW_SC_SIZE_CONV, -1 ;; ;JP9009
+ DB HW_SC_TORIKESHI, -1 ;; ;JP9009
+ DB HW_SC_COPY , -1 ;; ;JP9009
+ DB HW_SC_CSR_BLINK, -1 ;; ;JP9009
+ DB HW_SC_INTERRUPT, -1 ;; ;JP9009
+ DB HW_SC_UF1 , -1 ;; ;JP9009
+ DB HW_SC_UF2 , -1 ;; ;JP9009
+ DB HW_SC_UF3 , -1 ;; ;JP9009
+ DB HW_SC_UF4 , -1 ;; ;JP9009
+ DB HW_SC_ERASE_EOF, -1 ;; ;JP9009
+ DB HW_SC_ATTENTION, -1 ;; ;JP9009
+ DB HW_SC_PA1 , -1 ;; ;JP9009
+ DB HW_SC_PA2 , -1 ;; ;JP9009
+COM_OLD_A_T1_END: ;; ;JP9009
+ DW 0 ;; Size of xlat table - null ;JP9009
+COM_OLD_A_END: ;; table ;JP9009
+ ;; ;JP9009
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common ;SK900807
+;; STATE: Numeric Pad Case ;SK900807
+;; KEYBOARD TYPES: New & Old DBCS keyboard ;SK900807
+;; TABLE TYPE: Translate ;SK900807
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;SK900807
+ ;; ;SK900807
+ DW COM_PAD_K1_END-$ ;; length of state section ;SK900807
+ DB NUMERIC_PAD ;; State ID ;SK900807
+ DW G_KB + P_KB + DBCS_OLD_KB ;; Keyboard Type ;SK900807
+ DB -1,-1 ;; Buffer entry for error char ;SK900807
+ ;; ;SK900807
+ DW COM_PAD_K1_T1_END-$ ;; Size of xlat table ;SK900807
+ DB TYPE_2_TAB ;; xlat options: ;SK900807
+ DB 1 ;; number of entries ;SK900807
+ db HW_SC_PAD_COMMA, ',', EXTENDED_CODE_E0 ;SK900807
+COM_PAD_K1_T1_END: ;; ;SK900807
+ DW 0 ;; Size of xlat table - null ;SK900807
+COM_PAD_K1_END: ;; table ;SK900807
+ ;; ;SK900807
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;SK900807
+;; CODE PAGE: Common
+;; STATE: Alt Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_ALT_K1_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW G_KB + P_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 7 ;; number of entries
+ db HW_SC_BACK_SLASH_NEW, -1, HW_SC_BACK_SLASH ;\\\\\
+ db HW_SC_YEN_NEW, -1, HW_SC_YEN_NEW
+ db HW_SC_HALF_FULL_NEW, EXTENDED_CODE, EXT_KANJI ;SK9006
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_KANJI_NO
+ db HW_SC_HIRAGANA, EXTENDED_CODE, EXT_ROMAJI ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_4
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_4
+COM_ALT_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_ALT_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Alt Case
+;; KEYBOARD TYPES: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_ALT_K2_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_ALT_K2_T2_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 10 ;; number of entries ;JP9009
+ db HW_SC_BACK_SLASH, -1, HW_SC_BACK_SLASH
+ db HW_SC_YEN_OLD, -1, HW_SC_YEN_OLD
+
+ db PSEUDO_SC_HIRAGANA, EXTENDED_CODE, EXT_ROMAJI
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_ALPHA_NUMERIC_ALT
+ db HW_SC_KATAKANA, EXTENDED_CODE, EXT_KANJI_NO ;SK9006
+ db HW_SC_HALF_FULL_OLD, EXTENDED_CODE, EXT_HALF_FULL_ALT ;SK9006
+
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_4
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_4
+ db HW_SC_KANJI_OLD_A, EXTENDED_CODE, EXT_KANJI_NO ;JP9009
+ ; The followings are for A-keyboard emulation. ;JP9009
+ db HW_SC_TANGO_TOHROKU_A, EXTENDED_CODE, EXT_TANGO_ALT_A ;JP9009
+COM_ALT_K2_T2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_ALT_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K1_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW G_KB + P_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 10 ;; number of entries
+ db 1ah, -1, 1ah ; throw away !!! ('@')
+ db 1bh, 1bh, 1bh ; CTRL+'[' = ESC
+ db 2bh, 1dh, 2bh ; CTRL+']' = GS
+ DB HW_SC_BACK_SLASH_NEW, 1ch, HW_SC_BACK_SLASH; CTRL+'\' = FS ;\\\\\
+ db HW_SC_YEN_NEW, 1ch, HW_SC_YEN_NEW ; CTRL+'\' = FS
+ db HW_SC_HALF_FULL_NEW, EXTENDED_CODE, EXT_HALF_FULL_CTRL ;SK9006
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_ALPHA_NUMERIC_CTRL
+ db HW_SC_HIRAGANA, EXTENDED_CODE, EXT_HIRAGANA_CTRL ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_3
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_3
+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: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW DBCS_OLD_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 12 ;; number of entries ;JP9009
+ db 1ah, 1bh, 1ah ; CTRL+'[' = ESC
+ db 1bh, 1dh, 1bh ; CTRL+']' = GS
+ db 29h, -1, 29h ; throw away !!! ('@')
+ db HW_SC_BACK_SLASH, 1ch, HW_SC_BACK_SLASH; CTRL+'\' = FS
+ db PSEUDO_SC_HIRAGANA, EXTENDED_CODE, EXT_HIRAGANA_CTRL
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_ALPHA_NUMERIC_CTRL
+ db HW_SC_KATAKANA, EXTENDED_CODE, EXT_KATAKANA_CTRL ;SK9006
+ db HW_SC_HALF_FULL_OLD, EXTENDED_CODE, EXT_HALF_FULL_CTRL ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_3
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_3
+ db HW_SC_KANJI_OLD_A, EXTENDED_CODE, EXT_KANJI_CTRL ;JP9009
+ ; The followings are for A-keyboard emulation. ;JP9009
+ db HW_SC_TANGO_TOHROKU_A, EXTENDED_CODE, EXT_TANGO_CTRL_A ;JP9009
+COM_CTRL_K2_T2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW G_KB + P_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 12 ;; number of entries
+ db 0dh, '^' , 0dh
+ db 1ah, '@' , 1ah
+ db 1bh, '[' , 1bh
+ db 28h, ':' , 28h
+ db 2bh, ']' , 2bh
+ db HW_SC_BACK_SLASH_NEW, '\', HW_SC_BACK_SLASH ;\\\\\
+ db HW_SC_YEN_NEW, '\' , HW_SC_YEN_NEW
+ db HW_SC_HALF_FULL_NEW, EXTENDED_CODE, EXT_HALF_FULL ;SK9006
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_ALPHA_NUMERIC
+ db HW_SC_HIRAGANA, EXTENDED_CODE, EXT_HIRAGANA ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_1
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_1
+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: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K2_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_NA_LO_T2_K2_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 14 ;; number of entries ;JP9009
+ db 0dh, '^' , 0dh
+ db 1ah, '[' , 1ah
+ db 1bh, ']' , 1bh
+ db 28h, ':' , 28h
+ db 29h, '@' , 29h
+ db HW_SC_BACK_SLASH, '\', HW_SC_BACK_SLASH
+ db PSEUDO_SC_HIRAGANA, EXTENDED_CODE, EXT_HIRAGANA
+ db PSEUDO_SC_ALPHANUMERIC, EXTENDED_CODE, EXT_ALPHA_NUMERIC
+ db HW_SC_KATAKANA, EXTENDED_CODE, EXT_KATAKANA ;SK9006
+ db HW_SC_HALF_FULL_OLD, EXTENDED_CODE, EXT_HALF_FULL ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_1
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_1
+ db HW_SC_KANJI_OLD_A, EXTENDED_CODE, EXT_KANJI ;JP9009
+ ; The followings are for A-keyboard emulation. ;JP9009
+ db HW_SC_TANGO_TOHROKU_A, EXTENDED_CODE, EXT_TANGO_A ;JP9009
+COM_NA_LO_T2_K2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_NA_LO_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW G_KB + P_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_NA_UP_T1_K1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 19 ;; number of entries
+ db 03h, '"', 03h
+ db 07h, '&', 07h
+ db 08h, "'", 08h
+ db 09h, '(', 09h
+ db 0ah, ')', 0ah
+ db HW_SC_0, EXTENDED_CODE , 0bh ; only for KKC ;SK9007
+ db 0ch, '=', 0ch
+ db HW_SC_HAT, '~', 0dh ;SK9007
+ db 1ah, '`', 1ah
+ db 1bh, '{', 1bh
+ db 27h, '+', 27h
+ db 28h, '*', 28h
+ db 2bh, '}', 2bh
+ db HW_SC_BACK_SLASH_NEW, '_', HW_SC_BACK_SLASH ;\\\\\\
+ db HW_SC_YEN_NEW, '|', HW_SC_YEN_NEW
+
+ db HW_SC_HALF_FULL_NEW, EXTENDED_CODE, EXT_HALF_FULL_UPPER ;SK9006
+ db HW_SC_HIRAGANA, EXTENDED_CODE, EXT_KATAKANA ;SK9006
+
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_2
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_2
+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: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K2_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_NA_UP_T2_K2_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 21 ;; number of entries ;JP9009
+ db 03h, '"', 03h
+ db 07h, '&', 07h
+ db 08h, "'", 08h
+ db 09h, '(', 09h
+ db 0ah, ')', 0ah
+ db HW_SC_0, EXTENDED_CODE , 0bh ; only for KKC ;SK9007
+ db 0ch, '=', 0ch
+ db HW_SC_HAT, '~', 0dh ;SK9007
+ db 1ah, '{', 1ah
+ db 1bh, '}', 1bh
+ db 27h, '+', 27h
+ db 28h, '*', 28h
+ db 29h, '`', 29h
+ db HW_SC_BACK_SLASH, '_', HW_SC_BACK_SLASH
+ db PSEUDO_SC_HIRAGANA, EXTENDED_CODE, EXT_HIRAGANA_UPPER
+ db HW_SC_KATAKANA, EXTENDED_CODE, EXT_KANJI ;SK9006
+ db HW_SC_HALF_FULL_OLD, EXTENDED_CODE, EXT_HALF_FULL_UPPER ;SK9006
+ db HW_SC_CONV, EXTENDED_CODE, EXT_CONV_2
+ db HW_SC_NO_CONV, EXTENDED_CODE, EXT_NO_CONV_2
+ db HW_SC_KANJI_OLD_A, EXTENDED_CODE, EXT_KANJI_UPPER ;JP9009
+ ; The followings are for A-keyboard emulation. ;JP9009
+ db HW_SC_TANGO_TOHROKU_A, EXTENDED_CODE, EXT_TANGO_SHIFT_A ;JP9009
+COM_NA_UP_T2_K2_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_NA_UP_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+COMMON_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; JP Specific Translate Section for ;;
+;; Code Page 932. ;;
+;; It is completely covered by the ;;
+;; common table. ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+JP_932_XLAT: ;;
+ ;;
+ DW CP932_XLAT_END - $ ;;
+ DW 932 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 932
+;; STATE: Alt Case
+;; KEYBOARD TYPES: Old A Type DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP932_ALT_K1_END - $ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW DBCS_OLD_A_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP932_ALT_K1_T1_END - $ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 1 ;; number of entries
+ db HW_SC_KATAKANA_A, EXTENDED_CODE, EXT_KATAKANA_ALT_A ;JP9009
+CP932_ALT_K1_T1_END: ;;
+ DW 0 ;;
+CP932_ALT_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 932
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: Old A Type DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 932
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: Old A Type DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 932
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: Old A Type DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP932_NA_UP_K1_END - $ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW DBCS_OLD_A_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP932_NA_UP_K1_T1_END - $ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 1 ;; number of entries
+ db HW_SC_KATAKANA_A, EXTENDED_CODE, EXT_KATAKANA_SHIFT_A ;JP9009
+CP932_NA_UP_K1_T1_END: ;;
+ DW 0 ;;
+CP932_NA_UP_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;;
+CP932_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; JP Specific Translate Section for ;;
+;; Code Page 437. ;;
+;; It is completely covered by the ;;
+;; common table. ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+JP_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END - $ ;;
+ DW 437 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437 ;JP9009
+;; STATE: DBCS Old A Keyboard Unique Keys ;JP9009
+;; KEYBOARD TYPES: Old DBCS keyboard ;JP9009
+;; TABLE TYPE: Translate ;JP9009
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;JP9009
+ ;; ;JP9009
+ DW CP437_OLD_A_END-$ ;; length of state section ;JP9009
+ DB DBCS_OLD_A ;; State ID ;JP9009
+ DW DBCS_OLD_KB ;; Keyboard Type ;JP9009
+ DB -1,-1 ;; Buffer entry for error char ;JP9009
+ ;; ;JP9009
+ DW CP437_OLD_A_T1_END-$ ;; Size of xlat table ;JP9009
+ DB STANDARD_TABLE ;; xlat options: ;JP9009
+ DB 3 ;; number of entries ;JP9009
+ DB HW_SC_KANJI_OLD_A, -1 ;; ;JP9009
+ DB HW_SC_KATAKANA_A , -1 ;; ;JP9009
+ DB HW_SC_TANGO_TOHROKU_A, -1 ;; ;JP9009
+CP437_OLD_A_T1_END: ;; ;JP9009
+ DW 0 ;; Size of xlat table - null ;JP9009
+CP437_OLD_A_END: ;; table ;JP9009
+ ;; ;JP9009
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alt Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_ALT_K1_END - $ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW G_KB + P_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_ALT_K1_T1_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_NEW, -1
+ db HW_SC_HIRAGANA, ' '
+CP437_ALT_K1_T1_END: ;;
+ DW 0 ;;
+CP437_ALT_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alt Case
+;; KEYBOARD TYPES: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_ALT_K2_END - $ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_ALT_K2_T2_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_OLD, -1
+ db HW_SC_KATAKANA, ' '
+CP437_ALT_K2_T2_END: ;;
+ DW 0 ;;
+CP437_ALT_K2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_CTRL_K1_END - $ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW G_KB + P_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_CTRL_K1_T1_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_NEW, -1
+ db HW_SC_HIRAGANA, ' '
+CP437_CTRL_K1_T1_END: ;;
+ DW 0 ;;
+CP437_CTRL_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_CTRL_K2_END - $ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_CTRL_K2_T2_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_OLD, -1
+ db HW_SC_KATAKANA, ' '
+CP437_CTRL_K2_T2_END: ;;
+ DW 0 ;;
+CP437_CTRL_K2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_NA_LO_K1_END - $ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW G_KB + P_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 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_NEW, -1
+ db HW_SC_HIRAGANA, ' '
+CP437_NA_LO_K1_T1_END: ;;
+ DW 0 ;;
+CP437_NA_LO_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_NA_LO_K2_END - $ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_NA_LO_K2_T2_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 4 ;; number of entries
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_OLD, -1
+ db HW_SC_KATAKANA, ' '
+CP437_NA_LO_K2_T2_END: ;;
+ DW 0 ;;
+CP437_NA_LO_K2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: New DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_NA_UP_K1_END - $ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW G_KB + P_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_NA_UP_K1_T1_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries ;SK9007
+ db HW_SC_0, '~' ;SK9007
+ db HW_SC_HAT, -1 ;SK9007
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_NEW, -1
+ db HW_SC_HIRAGANA, ' '
+CP437_NA_UP_K1_T1_END: ;;
+ DW 0 ;;
+CP437_NA_UP_K1_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: Old DBCS keyboard
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP437_NA_UP_K2_END - $ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW DBCS_OLD_KB ;; Keyboard Type
+ DB -1, -1 ;; Buffer entry for error character
+ DW CP437_NA_UP_K2_T2_END - $ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries ;SK9007
+ db HW_SC_0, '~' ;SK9007
+ db HW_SC_HAT, -1 ;SK9007
+ db HW_SC_CONV, ' '
+ db HW_SC_NO_CONV, ' '
+ db HW_SC_HALF_FULL_OLD, -1
+ db HW_SC_KATAKANA, ' '
+CP437_NA_UP_K2_T2_END: ;;
+ DW 0 ;;
+CP437_NA_UP_K2_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;;
+CP437_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+CODE ENDS ;;
+ END ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfla.asm b/private/mvdm/dos/v86/dev/keyboard/kdfla.asm
new file mode 100644
index 000000000..4c8f8df98
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfla.asm
@@ -0,0 +1,1331 @@
+PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+TITLE PC DOS 3.30 LAD Keyboard Definition File
+;; LATEST CHANGE ALT & CTL
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+; PC DOS 3.3 - LAD Keyboard Support - Keyboard Defintion File
+; (C) Copyright IBM Corp 1987
+;
+; This file contains the keyboard tables for Latin American.
+; The data for this file is taken from the project named
+; CARNIVAL (developed in Toronto, Canada - May 86).
+;
+; 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
+;
+; AUTHOR: Gordon Giddings, 28969
+; IBM Canada Ltd.
+;
+; 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 ;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfnl.asm b/private/mvdm/dos/v86/dev/keyboard/kdfnl.asm
new file mode 100644
index 000000000..fc2da460b
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfnl.asm
@@ -0,0 +1,1522 @@
+;; LATEST CHANGE ALT & CTL
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Netherlands
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;
+;; 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 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfno.asm b/private/mvdm/dos/v86/dev/keyboard/kdfno.asm
new file mode 100644
index 000000000..4e90d1196
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfno.asm
@@ -0,0 +1,1614 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;; LATEST CHANGE P12 NUMERIC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Norwegian
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Updated: MIKE SAUNDERS - WSD IBM Hursley Laboratory - August 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfnow.asm b/private/mvdm/dos/v86/dev/keyboard/kdfnow.asm
new file mode 100644
index 000000000..c0df437f8
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfnow.asm
@@ -0,0 +1,831 @@
+ PAGE ,132
+ TITLE MS-DOS 5.0 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MS-DOS 5.0 - NLS Support - Keyboard Definition File
+;; (c) Copyright Microsoft Corp 1988-91, 93
+;;
+;;ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
+;;º This file only for NT DOS 1.0! º
+;;º 3/20/91 YST Microsoft IPG, Ireland º
+;;º 2/25/93 YST Microsoft Corp. Redmond º
+;;ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
+;;
+;; This the file header and table pointers ONLY.
+;; The actual tables are contained in seperate source files.
+;; These are:
+;; KDFDV.ASM - English Dvorak
+;; KDFSP.ASM - Spanish
+;; KDFPO.ASM - Portuguese
+;; KDFGE.ASM - German
+;; KDFIT141.ASM - Italian
+;; KDFFR189.ASM - French
+;; KDFSG.ASM - Swiss German
+;; KDFSF.ASM - Swiss French
+;; KDFDK.ASM - Danish
+;; KDFUK166.ASM - English
+;; KDFBE.ASM - Belgium
+;; KDFNL.ASM - Netherlands
+;; KDFNO.ASM - Norway
+;; KDFCF.ASM - French Canadian
+;; KDFLA.ASM - Latin American
+;; KDFSV.ASM - SWEDEN -----> This moddule is used for both Sweden
+;; and Finland - exact same template
+;; KDFSv(U).ASM - Finland -----> Same module as Sweden eliminated
+;; KDFRU091.ASM - Russian [YST 1/21/91 : added Russia]
+;;
+;;
+;; daytona begin
+;;
+;; KDFBR.ASM - Brazilian 274
+;; KDFBG.ASM - Bulganian
+;; KDFCZ.ASM - Czech
+;; KDFGK.ASM - Greek
+;; KDFHU.ASM - Hungarian
+;; KDFIC.ASM - Iceland
+;; KDFPL.ASM - Polish
+;; KDFRO.ASM - Romanian
+;; KDFSL.ASM - Slovak
+;; KDFYU.ASM - Slovenian, Yugoslavian, Coratian
+;; KDFTR440.ASM - Turkish F
+;; KDFTR.ASM - Turkish Q
+;; KDFIT142.ASM - Itlian 142
+;; daytona end
+;;
+
+
+
+;; Dummy US - US
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+CODE SEGMENT PUBLIC 'CODE' ;;
+ ASSUME CS:CODE,DS:CODE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; File Header
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DB 0FFh,'KEYB ' ;; signature
+DB 8 DUP(0) ;; reserved
+DW 0460H ;; maximum size of Common Xlat Sect (650)
+DW 01F0H ;; max size of Specific Xlat Sect (350)
+DW 0280H ;; max size of State Logic (400)
+DW 0 ;;AC000;reserved
+DW 18 + 12 ;;AC000 number of IDs
+DW 19 + 11 ;;AC000 number of languages
+DB 'GR' ;; LANGUAGE CODE TABLE
+DW OFFSET GE_LANG_ENT,0 ;;
+DB 'SP' ;;
+DW OFFSET SP_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 'BE' ;;
+DW OFFSET BE_LANG_ENT,0 ;;
+DB 'SF' ;;
+DW OFFSET SF_LANG_ENT,0 ;;
+DB 'NL' ;;
+DW OFFSET NL_LANG_ENT,0 ;;
+DB 'PO' ;;
+DW OFFSET PO_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 'DV' ;;(YST);
+DW OFFSET DV_LANG_ENT,0 ;;(YST); Left single-handed
+DB 'RU' ;;(YST);
+DW OFFSET RU1_LANG_ENT,0 ;;(YST); Russia
+;
+; daytona begin
+;
+
+DB 'BR'
+DW OFFSET BR_LANG_ENT, 0
+DB 'BG'
+DW OFFSET BG_LANG_ENT, 0
+DB 'CZ'
+DW OFFSET CZ_LANG_ENT, 0
+DB 'GK'
+DW OFFSET GK_LANG_ENT, 0
+DB 'HU'
+DW OFFSET HU_LANG_ENT, 0
+DB 'IS'
+DW OFFSET IC_LANG_ENT, 0
+DB 'PL'
+DW OFFSET PL_LANG_ENT, 0
+DB 'RO'
+DW OFFSET RO_LANG_ENT, 0
+DB 'SL'
+DW OFFSET SL_LANG_ENT, 0
+DB 'YU'
+DW OFFSET YU_LANG_ENT, 0
+DB 'TR'
+DW OFFSET TR2_LANG_ENT, 0
+;
+; daytona end
+;
+DB 'US' ;;
+DW OFFSET DUMMY_ENT,0 ;;
+DW 172 ;;AN000;ID CODE TABLE ***************************
+DW OFFSET SP_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 141 ;;AN000;
+DW OFFSET IT2_LANG_ENT,0 ;;AN000;
+
+; daytona begin
+DW 142
+DW OFFSET IT1_LANG_ENT,0
+; daytona end
+
+DW 166 ;;AN000;
+DW OFFSET UK2_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 150 ;;AN000;
+DW OFFSET SF_LANG_ENT,0 ;;AN000;
+DW 153 ;;AN000;
+DW OFFSET SV_LANG_ENT,0 ;;AN000;
+DW 155 ;;AN000;
+DW OFFSET NO_LANG_ENT,0 ;;AN000;
+DW 163 ;;AN000;
+DW OFFSET PO_LANG_ENT,0 ;;AN000;
+DW 058 ;;AN000;
+DW OFFSET CF_LANG_ENT,0 ;;AN000;
+DW 171 ;;AN000;
+DW OFFSET LA_LANG_ENT,0 ;;AN000;
+DW 091 ;;(YST)
+DW OFFSET RU1_LANG_ENT,0 ;;(YST)
+DW 985 ;;(YST)
+DW OFFSET DV_LANG_ENT,0 ;;(YST)
+;
+; daytona begin
+;
+DW 274
+DW OFFSET BR_LANG_ENT, 0
+DW 442
+DW OFFSET BG_LANG_ENT, 0
+DW 243
+DW OFFSET CZ_LANG_ENT, 0
+DW 319
+DW OFFSET GK_LANG_ENT, 0
+DW 208
+DW OFFSET HU_LANG_ENT, 0
+DW 161
+DW OFFSET IC_LANG_ENT, 0
+DW 214
+DW OFFSET PL_LANG_ENT, 0
+;;;DW 333
+;;;DW OFFSET RO_LANG_ENT, 0
+DW 245
+DW OFFSET SL_LANG_ENT, 0
+DW 234
+DW OFFSET YU_LANG_ENT, 0
+DW 179
+DW OFFSET TR1_LANG_ENT, 0
+DW 440
+DW OFFSET TR2_LANG_ENT, 0
+;
+; daytona end
+;
+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 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
+ ;;
+;*****************************************************************************
+
+;; Daytona beging
+
+ EXTRN IT1_LOGIC:NEAR ;;
+ EXTRN IT1_437_XLAT:NEAR ;;
+ EXTRN IT1_850_XLAT:NEAR ;;
+ ;;
+ IT1_LANG_ENT: ;;AC000; language entry for ITALY
+ DB 'IT' ;;AC000; PRIMARY KEYBOARD ID VALUE
+ DW 142 ;;AN000; ID entry
+ DW OFFSET IT1_LOGIC,0 ;;AN000; pointer to LANG kb table
+ DB 2 ;;AC000; number of ids
+ DB 2 ;;AC000; number of code pages
+ DW 437 ;;AC000; code page
+ DW OFFSET IT1_437_XLAT,0 ;;AC000; table pointer
+ DW 850 ;;AC000; code page
+ DW OFFSET IT1_850_XLAT,0 ;;AC000; table pointer
+
+;; daytona end
+
+
+;*****************************************************************************
+ ;;
+ 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 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 RU1_LOGIC:NEAR ;;
+ EXTRN RU1_866_XLAT:NEAR ;;
+ EXTRN RU1_437_XLAT:NEAR ;;
+ EXTRN RU1_850_XLAT:NEAR ;;
+ EXTRN RU1_855_XLAT:NEAR ;;
+ EXTRN RU1_1251_XLAT:NEAR ;;
+ ;;
+ RU1_LANG_ENT: ;; language entry for Russia
+ DB 'RU' ;;
+ DW 091 ;; ID entry
+ DW OFFSET RU1_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids
+ DB 5 ;; number of code pages
+ DW 866 ;; code page
+ DW OFFSET RU1_866_XLAT,0 ;; table pointer
+ DW 437 ;; code page ;
+ DW OFFSET RU1_437_XLAT,0 ;; table pointer
+ DW 850 ;; code page
+ DW OFFSET RU1_850_XLAT,0 ;; table pointer
+ DW 855 ;; code page
+ DW OFFSET RU1_855_XLAT,0 ;; table pointer
+ DW 1251 ;; code page ;
+ DW OFFSET RU1_1251_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
+ ;;
+;*****************************************************************************
+ ;;
+ EXTRN DV_LOGIC:FAR ;;
+ EXTRN DV_COMMON_XLAT:FAR ;;
+ ;;
+ DV_LANG_ENT: ;; language entry for Yugo (Cyrillic)
+ DB 'DV' ;;
+ DW 985 ;; ID entry
+ DW OFFSET DV_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids
+ DB 2 ;; number of code pages
+ DW 437 ;; code page ; default to 437 -same as country.sys
+ DW OFFSET DV_COMMON_XLAT,0 ;; table pointer
+ DW 850 ;; code page
+ DW OFFSET DV_COMMON_XLAT,0 ;; table pointer
+ ;;
+;*****************************************************************************
+;
+; daytona begin
+;
+
+;***************************************************************************** ;;
+; [Verav : added Brazil IBM layout - Feb 92]
+
+ EXTRN BR_LOGIC:NEAR ;;AC000;
+ EXTRN BR_850_XLAT:NEAR ;;AC000;
+ EXTRN BR_437_XLAT:NEAR ;;AC000;
+ ;;
+BR_LANG_ENT: ;; language entry for BRAZIL
+ DB 'BR' ;;
+ DW 274 ;;AN000; ID entry
+ DW OFFSET BR_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 BR_850_XLAT,0 ;;AC000; table pointer
+ DW 437 ;;AC000; code page
+ DW OFFSET BR_437_XLAT,0 ;;AC000; table pointer
+
+;***************************************************************************** ;;
+;; JH added Bulgarian 241 keyboard YST converted from Windows
+
+ EXTRN BG_LOGIC:NEAR ;;AC000;
+ EXTRN BG_866_XLAT:NEAR ;;AC000;
+ EXTRN BG_850_XLAT:NEAR ;;AC000;
+ EXTRN BG_855_XLAT:NEAR ;;AC000;
+ ;;
+BG_LANG_ENT: ;; language entry for Bulgarian
+ DB 'BG' ;;
+ DW 442 ;;AN000; ID entry
+ DW OFFSET BG_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;;AC000; number of ids
+ DB 3 ;; number of code pages
+ DW 866 ;; code page
+ DW OFFSET BG_866_XLAT,0 ;; table pointer
+ DW 850 ;; code page
+ DW OFFSET BG_850_XLAT,0 ;; table pointer
+ DW 855 ;; code page
+ DW OFFSET BG_855_XLAT,0 ;; table pointer
+
+;;;*****************************************************************************
+ EXTRN CZ_LOGIC:NEAR ;;
+ EXTRN CZ_850_XLAT:NEAR ;;
+ EXTRN CZ_852_XLAT:NEAR ;;
+ ;;
+CZ_LANG_ENT: ;; language entry for CZECH
+ DB 'CZ' ;;
+ DW 243 ;; Keyboard ID entry |
+ DW OFFSET CZ_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages
+ DW 850 ;; code page
+ DW OFFSET CZ_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET CZ_852_XLAT,0 ;; table pointer
+ ;;
+;*****************************************************************************
+ EXTRN GK_LOGIC:NEAR ;;
+ EXTRN GK_869_XLAT:NEAR ;;
+ EXTRN GK_737_XLAT:NEAR ;;
+ ;;
+GK_LANG_ENT: ;;AC000; language entry for GREEK
+ DB 'GK' ;;AC000; PRIMARY KEYBOARD ID VALUE
+ DW 319 ;;AN000; ID entry
+ DW OFFSET GK_LOGIC,0 ;;AN000; pointer to LANG kb table
+ DB 1 ;;AC000; number of ids
+ DB 2 ;;AC000; number of code pages
+ DW 869 ;;AC000; code page
+ DW OFFSET GK_869_XLAT,0 ;;AC000; table pointer
+ DW 737 ;;AC000; cp needs new number from IBM
+ DW OFFSET GK_737_XLAT,0 ;;AC000; table pointer
+ ;;
+ ;;
+;*****************************************************************************
+ EXTRN HU_LOGIC:NEAR ;;
+ EXTRN HU_850_XLAT:NEAR ;;
+ EXTRN HU_852_XLAT:NEAR ;;
+ ;;
+HU_LANG_ENT: ;; language entry for HUNGARY
+ DB 'HU' ;;
+ DW 208 ;; Keyboard ID entry |
+ DW OFFSET HU_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages
+ DW 850 ;; code page
+ DW OFFSET HU_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET HU_852_XLAT,0 ;; table pointer
+
+;*****************************************************************************
+ EXTRN IC_LOGIC:NEAR ;;
+ EXTRN IC_861_XLAT:NEAR ;;
+ EXTRN IC_850_XLAT:NEAR ;;
+ ;;
+IC_LANG_ENT: ;; language entry for ¥sland
+ DB 'IS' ;;
+ DW 161 ;; ID entry
+ DW OFFSET IC_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids
+ DB 2 ;; number of code pages
+ DW 861 ;; code page
+ DW OFFSET IC_861_XLAT,0 ;; table pointer
+ DW 850 ;; code page
+ DW OFFSET IC_850_XLAT,0 ;; table pointer
+
+
+;;;*****************************************************************************
+ EXTRN PL_LOGIC:NEAR ;;
+ EXTRN PL_850_XLAT:NEAR ;;
+ EXTRN PL_852_XLAT:NEAR ;;
+ ;;
+PL_LANG_ENT: ;; language entry for POLAND
+ DB 'PL' ;;
+ DW 214 ;; Keyboard ID entry |
+ DW OFFSET PL_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages
+ DW 850 ;; code page
+ DW OFFSET PL_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET PL_852_XLAT,0 ;; table pointer
+;;;*****************************************************************************
+ EXTRN RO_LOGIC:NEAR ;;
+ EXTRN RO_850_XLAT:NEAR ;;
+ EXTRN RO_852_XLAT:NEAR ;;
+ ;;
+RO_LANG_ENT: ;; language entry for ROMANIA
+ DB 'RO' ;;
+ DW 333 ;; Keyboard ID entry |
+ DW OFFSET RO_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages
+ DW 850 ;; code page
+ DW OFFSET RO_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET RO_852_XLAT,0 ;; table pointer
+;;;*****************************************************************************
+ EXTRN SL_LOGIC:NEAR ;;
+ EXTRN SL_850_XLAT:NEAR ;;
+ EXTRN SL_852_XLAT:NEAR ;;
+ ;;
+SL_LANG_ENT: ;; language entry for SLOVAK
+ DB 'SL' ;;
+ DW 245 ;; Keyboard ID entry |
+ DW OFFSET SL_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages
+ DW 850 ;; code page
+ DW OFFSET SL_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET SL_852_XLAT,0 ;; table pointer
+;;;*****************************************************************************
+ ;;
+ EXTRN YU_LOGIC:NEAR ;;
+ EXTRN YU_850_XLAT:NEAR ;;
+ EXTRN YU_852_XLAT:NEAR ;;
+ ;;
+YU_LANG_ENT: ;; language entry for YUGOSLAVIA
+ DB 'YU' ;;
+ DW 234 ;; Keyboard ID entry |
+ DW OFFSET YU_LOGIC,0 ;; pointer to LANG kb table
+ DB 1 ;; number of ids |
+ DB 2 ;; number of code pages |
+ DW 850 ;; code page
+ DW OFFSET YU_850_XLAT,0 ;; table pointer
+ DW 852 ;; code page
+ DW OFFSET YU_852_XLAT,0 ;; table pointer
+ ;;
+;*****************************************************************************
+ EXTRN TR_LOGIC:NEAR ;;AN000;
+ EXTRN TR_850_XLAT:NEAR ;;AN000;
+ EXTRN TR_857_XLAT:NEAR ;;AN000;
+ ;;
+TR1_LANG_ENT: ;;AN000; language entry for Turkey 179
+ DB 'TR' ;;AN000; SECONDARY KEYBOARD ID VALUE
+ DW 179 ;;AN000; ID entry
+ DW OFFSET TR_LOGIC,0 ;;AN000; pointer to LANG kb table
+ DB 2 ;;AN000;number of ids
+ DB 2 ;;AN000; number of code pages
+ DW 850 ;;AN000; code page
+ DW OFFSET TR_850_XLAT,0 ;;AN000; table pointer
+ DW 857 ;;AN000; code page
+ DW OFFSET TR_857_XLAT,0 ;;AN000; table pointer
+ ;;
+;*****************************************************************************
+ EXTRN TR2_LOGIC:NEAR ;;
+ EXTRN TR2_850_XLAT:NEAR ;;
+ EXTRN TR2_857_XLAT:NEAR ;;
+ ;;
+TR2_LANG_ENT: ;;AC000; language entry for ITALY
+ DB 'TR' ;;AC000; PRIMARY KEYBOARD ID VALUE
+ DW 440 ;;AN000; ID entry
+ DW OFFSET TR2_LOGIC,0 ;;AN000; 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 TR2_850_XLAT,0 ;;AC000; table pointer
+ DW 857 ;;AC000; code page
+ DW OFFSET TR2_857_XLAT,0 ;;AC000; table pointer
+;
+; daytona end
+;
+
+;*****************************************************************************
+
+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 8 ;;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 852 ;; code page [Mihindu 11/30/90]
+ DW OFFSET DUMMY_XLAT_852,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
+ DW 866 ;; code page [YST 3/19/91]
+ DW OFFSET DUMMY_XLAT_866,0 ;; table pointer
+ DW 855 ;; code page [YST 3/19/91]
+ DW OFFSET DUMMY_XLAT_855,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_852: ;; [Mihindu 11/30/90]
+ DW 6 ;; length of section
+ DW 852 ;; 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
+ ;;
+DUMMY_XLAT_866: ;; (YST 3/19/91)
+ DW 6 ;; length of section
+ DW 866 ;; code page
+ DW 0 ;; LAST STATE
+ ;;
+DUMMY_XLAT_855: ;; (YST 3/19/91)
+ DW 6 ;; length of section
+ DW 855 ;; code page
+ DW 0 ;; LAST STATE
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;*****************************************************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfpl.asm b/private/mvdm/dos/v86/dev/keyboard/kdfpl.asm
new file mode 100644
index 000000000..0e22247a8
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfpl.asm
@@ -0,0 +1,2346 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for:
+;; Poland
+;; which form the Multilingual (ML) Group 2.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC PL_LOGIC ;;
+ PUBLIC PL_850_XLAT ;;
+ PUBLIC PL_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; PL State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+PL_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 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ 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 ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; PL 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 PL_COMMON_XLAT ;;
+PL_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 41 ;;
+ FLAG OGONEK ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 41 ;;
+ FLAG OVERDOT ;;
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY (YST)
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_PL_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: ANY_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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,"+" ;; '
+ DB 13,"'" ;;
+ 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 Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 13,"*" ;;
+ 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: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 20 ;; number of entries
+ DB 2,'~',02H ;;
+ DB 8,'`',08H ;;
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 20,'$',14H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,'<',17H ;;
+ DB 24,'>',18H ;;
+ DB 26,'ö',1AH ;;
+ DB 33,'[',21H ;;
+ DB 34,']',22H ;;
+ DB 39,'$',27H ;;
+ DB 40,0E1H,28H ;; SHARP S
+ DB 47,'@',2FH ;;
+ DB 48,'{',30H ;;
+ DB 49,'}',31H ;;
+ DB 50,0F5H,32H ;;
+ db 51,'<', 33H
+ db 52, '>', 34H
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC PL_850_XLAT ;;
+PL_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 5,-1 ;; CURRENCY SYMBOL
+CP850_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 1 ;; number of entries
+ DB 5,-1 ;; CURRENCY SYMBOL
+CP850_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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,0FEH,0 ;; 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: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FEH,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FEH ;; OGONEK SPACE
+CP850_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC PL_852_XLAT ;;
+PL_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 39,088H ;; l STROKE
+CP852_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 39,09DH ;; L STROKE
+CP852_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 4 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 27,09EH,1BH ;;
+ DB 31,0D0H,1FH ;; d STROKE
+ DB 32,0D1H,20H ;; D STROKE
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 13,027H ;; APOSTROPHE
+ DB 26,0BEH ;; z OVERDOT
+ DB 27,098H ;; s ACUTE
+ DB 40,0A5H ;; a OGONEK
+ DB 43,0A2H ;; o ACUTE
+CP852_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_UP_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries
+ DB 5,0CFH ;; CURRENCY SYMBOL
+ DB 13,02AH ;; ASTERISK
+ DB 26,0E4H ;; n ACUTE
+ DB 27,086H ;; c ACUTE
+ DB 40,0A9H ;; e OGONEK
+ DB 43,0ABH ;; z ACUTE
+CP852_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfpl1.asm b/private/mvdm/dos/v86/dev/keyboard/kdfpl1.asm
new file mode 100644
index 000000000..3d92ae570
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfpl1.asm
@@ -0,0 +1,1011 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for:
+;; Poland
+;; which form the Multilingual (ML) Group 2.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC PL_LOGIC ;;
+ PUBLIC PL_850_XLAT ;;
+ PUBLIC PL_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; PL State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+PL_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 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower, third and fourth 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.
+ 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 ;; 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
+ IFF EITHER_SHIFT ;;
+ XLATT FOURTH_SHIFT ;;
+ ELSEF ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ 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: ;;
+ ;;
+;***************************
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; PL 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 PL_COMMON_XLAT ;;
+PL_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 0 ;; number of entries
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 29H ;;
+ FLAG TILDE ;;
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 0 ;; number of entries
+ ;;
+COM_PL_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR ALT CASE
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Alt Case
+;; KEYBOARD TYPES: G
+;; 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
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 0 ;; number of entries
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 0 ;; number of entries
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 0 ;; number of entries
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 0 ;; number of entries
+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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 0 ;; number of entries
+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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 9 ;; number of entries
+ DB 18,0A9H,12H ;; e ogonek
+ DB 24,0A2H,18H ;; o acute
+ DB 30,0A5H,1EH ;; a ogonek
+ DB 31,098H,1FH ;; s acute
+ DB 38,088H,26H ;; l slash
+ DB 44,0BEH,2CH ;; z dot
+ DB 45,0ABH,2DH ;; z acute
+ DB 46,086H,2EH ;; c acute
+ DB 49,0E4H,31H ;; n acute
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Fourth Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_FOURTH_END-$ ;; length of state section
+ DB FOURTH_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_FOURTH_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 9 ;; number of entries
+ DB 18,0A8H,12H ;; E ogonek
+ DB 24,0E0H,18H ;; O acute
+ DB 30,0A4H,1EH ;; A ogonek
+ DB 31,097H,1FH ;; S acute
+ DB 38,09DH,26H ;; L slash
+ DB 44,0BDH,2CH ;; Z dot
+ DB 45,08DH,2DH ;; Z acute
+ DB 46,08FH,2EH ;; C acute
+ DB 49,0E3H,31H ;; N acute
+COM_FOURTH_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_FOURTH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Tilde Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 9 ;; number of scans
+ DB 18,0A9H ;; e ogonek
+ DB 24,0A2H ;; o acute
+ DB 30,0A5H ;; a ogonek
+ DB 31,098H ;; s acute
+ DB 38,088H ;; l slash
+ DB 44,0BEH ;; z dot
+ DB 45,0ABH ;; z acute
+ DB 46,086H ;; c acute
+ DB 49,0E4H ;; n acute
+COM_TI_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_TI_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Tilde Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 9 ;; number of scans
+ DB 18,0A8H ;; E ogonek
+ DB 24,0E0H ;; O acute
+ DB 30,0A4H ;; A ogonek
+ DB 31,097H ;; S acute
+ DB 38,09DH ;; L slash
+ DB 44,0BDH ;; Z dot
+ DB 45,08DH ;; Z acute
+ DB 46,08FH ;; C acute
+ DB 49,0E3H ;; N acute
+COM_TI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_TI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Tilde
+;; KEYBOARD TYPES: ANY_KB
+;; 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 ;;
+ ;;
+COM_TI_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC PL_850_XLAT ;;
+PL_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC PL_852_XLAT ;;
+PL_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfpo.asm b/private/mvdm/dos/v86/dev/keyboard/kdfpo.asm
new file mode 100644
index 000000000..5682c485a
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfpo.asm
@@ -0,0 +1,1613 @@
+;; LATEST CHANGE TO CTL [ and ] on XT moved to key 26 & 27
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; XT section enabled
+;; ************* CNS 12/18/86
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;; LATEST CHANGE P12 NUMERIC
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Portugeuse
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Updated for Portugal by M.J.Saunders WSD - August 1986.
+;; 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 ;;
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfro.asm b/private/mvdm/dos/v86/dev/keyboard/kdfro.asm
new file mode 100644
index 000000000..c506d2b64
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfro.asm
@@ -0,0 +1,2355 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for:
+;; Romania
+;; which form the Multilingual (ML) Group 2.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;; Adapted by Mihindu (Microsoft) Nov. 30, 1990
+;; Created from Hungary by Yuri Starikov (Microsoft) Aug. 06, 1991
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC RO_LOGIC ;;
+ PUBLIC RO_850_XLAT ;;
+ PUBLIC RO_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RO State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+RO_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 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ 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 ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; HU 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 RO_COMMON_XLAT ;;
+RO_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW COM_RO_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 41 ;;
+; FLAG OGONEK ;;
+ ;;
+;COM_RO_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW COM_RO_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 41 ;;
+; FLAG OVERDOT ;;
+; ;;
+;COM_RO_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_RO_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 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY (YST)
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_RO_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: ANY_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+;; DB 11,"”",0BH ;;
+;; DB 12,"",0CH ;;
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+;; DB 11,"™",0BH ;;
+;; DB 12,"š",0CH ;;
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 12,"+" ;; -
+ DB 13,"'" ;; -
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 2,"!" ;;
+ DB 3,'"' ;;
+ DB 4,"#" ;;
+ DB 5,"$" ;;
+ DB 6,"%" ;;
+ DB 7, "&" ;;
+ DB 8,'/' ;;
+ DB 9,'(' ;;
+ DB 10,')' ;;
+ DB 11,'=' ;;
+ DB 12,'?' ;;
+ DB 13,'*' ;;
+ DB 41,'[' ;;
+ DB 51,03bH ;;
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 17 ;; number of entries
+ DB 2,'~',02H ;;
+ DB 8,'`',08H ;;
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 20,'$',14H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,'<',17H ;;
+ DB 24,'>',18H ;;
+ DB 26,'ö',1AH ;;
+ DB 39,'$',27H ;;
+ DB 40,0E1H,28H ;; SHARP S
+ DB 47,'@',2FH ;;
+ DB 48,'{',20H ;;
+ DB 49,'}',21H ;;
+ DB 51,'<',33H ;;
+ DB 52,'>',35H ;;
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC RO_850_XLAT ;;
+RO_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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 0 ;; number of entries
+CP850_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 1 ;; number of entries
+ DB 5,-1 ;; CURRENCY SYMBOL
+CP850_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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,0FEH,0 ;; 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: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FEH,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FEH ;; OGONEK SPACE
+CP850_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC RO_852_XLAT ;;
+RO_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,0C7H ;; a BREVE
+ DB 27,08CH ;; i CIRCUMFLEX
+ DB 39,0ADH ;; s CEDILLA
+ DB 40,0EEH ;; t CEDILLA
+ DB 43,083H ;; a CIRCUMFLEX
+CP852_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,0C6H ;; A BREVE
+ DB 27,0D7H ;; I CIRCUMFLEX
+ DB 39,0B8H ;; S CEDILLA
+ DB 40,0DDH ;; T CEDILLA
+ DB 43,0B6H ;; a CIRCUMFLEX
+CP852_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 27,09EH,1BH ;;
+ DB 31,0D0H,1FH ;; d STROKE
+ DB 32,0D1H,20H ;; D STROKE
+ DB 37,088H,25H ;; l STROKE
+ DB 38,09DH,26H ;; L STROKE
+ DB 50,0F5H,32H ;; paragraph SYMBOL
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 0 ;; number of entries
+CP852_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_NA_UP_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ db 5, 0CFH
+CP852_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfru.asm b/private/mvdm/dos/v86/dev/keyboard/kdfru.asm
new file mode 100644
index 000000000..666c92539
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfru.asm
@@ -0,0 +1,1357 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC RU1_LOGIC ;;
+ PUBLIC RU2_LOGIC ;;
+ PUBLIC RU3_LOGIC ;;
+ PUBLIC RU_866_XLAT ;;
+ PUBLIC RU_437_XLAT ;;
+ PUBLIC RU_850_XLAT ;;
+ PUBLIC RU_855_XLAT ;;
+ PUBLIC RU_1251_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU1_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU1_COMMON_XLAT ;;
+RU1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU2_COMMON_XLAT ;;
+RU2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU3_COMMON_XLAT ;;
+RU3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 09EH ;; ê
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 09FH ;; š
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 1251
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU_1251_XLAT: ;;
+ ;;
+ DW CP1251_XLAT_END-$ ;; length of section
+ DW 1251 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP1251_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP1251_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0A4H ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP1251_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0E9H ;; ©
+ DB 0F6H ;; æ
+ DB 0F3H ;; ã
+ DB 0EAH ;; ª
+ DB 0E5H ;; ¥
+ DB 0EDH ;; ­
+ DB 0E3H ;; £
+ DB 0F8H ;; è
+ DB 0F9H ;; é
+ DB 0E7H ;; §
+ DB 0F5H ;; å
+ DB 0FAH ;; ê
+CP1251_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0F4H ;; ä
+ DB 0FBH ;; ë
+ DB 0E2H ;; ¢
+ DB 0E0H ;;  
+ DB 0EFH ;; ¯
+ DB 0F0H ;; à
+ DB 0EEH ;; ®
+ DB 0EBH ;; «
+ DB 0E4H ;; ¤
+ DB 0E6H ;; ¦
+ DB 0FDH ;; í
+ DB 0B8H ;; ñ
+CP1251_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0FFH ;; ï
+ DB 0F7H ;; ç
+ DB 0F1H ;; á
+ DB 0ECH ;; ¬
+ DB 0E8H ;; ¨
+ DB 0F2H ;; â
+ DB 0FCH ;; ì
+ DB 0E1H ;; ¡
+ DB 0FEH ;; î
+CP1251_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0C9H ;; ‰
+ DB 0D6H ;; –
+ DB 0D3H ;; “
+ DB 0CAH ;; Š
+ DB 0C5H ;; …
+ DB 0CDH ;;
+ DB 0C3H ;; ƒ
+ DB 0D8H ;; ˜
+ DB 0D9H ;; ™
+ DB 0C7H ;; ‡
+ DB 0D5H ;; •
+ DB 0DAH ;; š
+CP1251_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0D4H ;; ”
+ DB 0DBH ;; ›
+ DB 0C2H ;; ‚
+ DB 0C0H ;; €
+ DB 0CFH ;;
+ DB 0D0H ;;
+ DB 0CEH ;; Ž
+ DB 0CBH ;; ‹
+ DB 0C4H ;; „
+ DB 0C6H ;; †
+ DB 0DDH ;;
+ DB 0A8H ;; ð
+CP1251_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0D7H ;; —
+ DB 0D1H ;; ‘
+ DB 0CCH ;; Œ
+ DB 0C8H ;; ˆ
+ DB 0D2H ;; ’
+ DB 0DCH ;; œ
+ DB 0C1H ;;
+ DB 0DEH ;; ž
+CP1251_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0DFH ;; Ÿ
+ ;;
+CP1251_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP1251_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * RU Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 234 ;; ê
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 154 ;; š
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfru091.asm b/private/mvdm/dos/v86/dev/keyboard/kdfru091.asm
new file mode 100644
index 000000000..8ed340aa5
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfru091.asm
@@ -0,0 +1,1062 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC RU1_LOGIC ;;
+ PUBLIC RU1_866_XLAT ;;
+ PUBLIC RU1_437_XLAT ;;
+ PUBLIC RU1_850_XLAT ;;
+ PUBLIC RU1_855_XLAT ;;
+ PUBLIC RU1_1251_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU1_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU1_COMMON_XLAT ;;
+RU1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU1_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU1_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU1_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 09EH ;; ê
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 09FH ;; š
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 1251
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU1_1251_XLAT: ;;
+ ;;
+ DW CP1251_XLAT_END-$ ;; length of section
+ DW 1251 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP1251_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP1251_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0A4H ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP1251_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0E9H ;; ©
+ DB 0F6H ;; æ
+ DB 0F3H ;; ã
+ DB 0EAH ;; ª
+ DB 0E5H ;; ¥
+ DB 0EDH ;; ­
+ DB 0E3H ;; £
+ DB 0F8H ;; è
+ DB 0F9H ;; é
+ DB 0E7H ;; §
+ DB 0F5H ;; å
+ DB 0FAH ;; ê
+CP1251_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0F4H ;; ä
+ DB 0FBH ;; ë
+ DB 0E2H ;; ¢
+ DB 0E0H ;;  
+ DB 0EFH ;; ¯
+ DB 0F0H ;; à
+ DB 0EEH ;; ®
+ DB 0EBH ;; «
+ DB 0E4H ;; ¤
+ DB 0E6H ;; ¦
+ DB 0FDH ;; í
+ DB 0B8H ;; ñ
+CP1251_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0FFH ;; ï
+ DB 0F7H ;; ç
+ DB 0F1H ;; á
+ DB 0ECH ;; ¬
+ DB 0E8H ;; ¨
+ DB 0F2H ;; â
+ DB 0FCH ;; ì
+ DB 0E1H ;; ¡
+ DB 0FEH ;; î
+CP1251_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0C9H ;; ‰
+ DB 0D6H ;; –
+ DB 0D3H ;; “
+ DB 0CAH ;; Š
+ DB 0C5H ;; …
+ DB 0CDH ;;
+ DB 0C3H ;; ƒ
+ DB 0D8H ;; ˜
+ DB 0D9H ;; ™
+ DB 0C7H ;; ‡
+ DB 0D5H ;; •
+ DB 0DAH ;; š
+CP1251_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0D4H ;; ”
+ DB 0DBH ;; ›
+ DB 0C2H ;; ‚
+ DB 0C0H ;; €
+ DB 0CFH ;;
+ DB 0D0H ;;
+ DB 0CEH ;; Ž
+ DB 0CBH ;; ‹
+ DB 0C4H ;; „
+ DB 0C6H ;; †
+ DB 0DDH ;;
+ DB 0A8H ;; ð
+CP1251_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0D7H ;; —
+ DB 0D1H ;; ‘
+ DB 0CCH ;; Œ
+ DB 0C8H ;; ˆ
+ DB 0D2H ;; ’
+ DB 0DCH ;; œ
+ DB 0C1H ;;
+ DB 0DEH ;; ž
+CP1251_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0DFH ;; Ÿ
+ ;;
+CP1251_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP1251_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * RU Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU1_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 234 ;; ê
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 154 ;; š
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfru092.asm b/private/mvdm/dos/v86/dev/keyboard/kdfru092.asm
new file mode 100644
index 000000000..4bc8d2b4e
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfru092.asm
@@ -0,0 +1,1057 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC RU2_LOGIC ;;
+ PUBLIC RU2_866_XLAT ;;
+ PUBLIC RU2_437_XLAT ;;
+ PUBLIC RU2_850_XLAT ;;
+ PUBLIC RU2_855_XLAT ;;
+ PUBLIC RU2_1251_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU2_COMMON_XLAT ;;
+RU2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU2_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU2_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU2_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 09EH ;; ê
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 09FH ;; š
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 1251
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU2_1251_XLAT: ;;
+ ;;
+ DW CP1251_XLAT_END-$ ;; length of section
+ DW 1251 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP1251_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP1251_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0A4H ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP1251_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0E9H ;; ©
+ DB 0F6H ;; æ
+ DB 0F3H ;; ã
+ DB 0EAH ;; ª
+ DB 0E5H ;; ¥
+ DB 0EDH ;; ­
+ DB 0E3H ;; £
+ DB 0F8H ;; è
+ DB 0F9H ;; é
+ DB 0E7H ;; §
+ DB 0F5H ;; å
+ DB 0FAH ;; ê
+CP1251_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0F4H ;; ä
+ DB 0FBH ;; ë
+ DB 0E2H ;; ¢
+ DB 0E0H ;;  
+ DB 0EFH ;; ¯
+ DB 0F0H ;; à
+ DB 0EEH ;; ®
+ DB 0EBH ;; «
+ DB 0E4H ;; ¤
+ DB 0E6H ;; ¦
+ DB 0FDH ;; í
+ DB 0B8H ;; ñ
+CP1251_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0FFH ;; ï
+ DB 0F7H ;; ç
+ DB 0F1H ;; á
+ DB 0ECH ;; ¬
+ DB 0E8H ;; ¨
+ DB 0F2H ;; â
+ DB 0FCH ;; ì
+ DB 0E1H ;; ¡
+ DB 0FEH ;; î
+CP1251_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0C9H ;; ‰
+ DB 0D6H ;; –
+ DB 0D3H ;; “
+ DB 0CAH ;; Š
+ DB 0C5H ;; …
+ DB 0CDH ;;
+ DB 0C3H ;; ƒ
+ DB 0D8H ;; ˜
+ DB 0D9H ;; ™
+ DB 0C7H ;; ‡
+ DB 0D5H ;; •
+ DB 0DAH ;; š
+CP1251_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0D4H ;; ”
+ DB 0DBH ;; ›
+ DB 0C2H ;; ‚
+ DB 0C0H ;; €
+ DB 0CFH ;;
+ DB 0D0H ;;
+ DB 0CEH ;; Ž
+ DB 0CBH ;; ‹
+ DB 0C4H ;; „
+ DB 0C6H ;; †
+ DB 0DDH ;;
+ DB 0A8H ;; ð
+CP1251_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0D7H ;; —
+ DB 0D1H ;; ‘
+ DB 0CCH ;; Œ
+ DB 0C8H ;; ˆ
+ DB 0D2H ;; ’
+ DB 0DCH ;; œ
+ DB 0C1H ;;
+ DB 0DEH ;; ž
+CP1251_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0DFH ;; Ÿ
+ ;;
+CP1251_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP1251_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * RU Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU2_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 234 ;; ê
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 154 ;; š
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfru093.asm b/private/mvdm/dos/v86/dev/keyboard/kdfru093.asm
new file mode 100644
index 000000000..ae9e71079
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfru093.asm
@@ -0,0 +1,1055 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC RU3_LOGIC ;;
+ PUBLIC RU3_866_XLAT ;;
+ PUBLIC RU3_437_XLAT ;;
+ PUBLIC RU3_850_XLAT ;;
+ PUBLIC RU3_855_XLAT ;;
+ PUBLIC RU3_1251_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; RU3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+RU3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; RU 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 RU3_COMMON_XLAT ;;
+RU3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU3_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU3_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU3_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 09EH ;; ê
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 0F1H ;; ë
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 0F7H ;; í
+ DB 084H ;; ñ
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 09FH ;; š
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 0F2H ;; ›
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 0F8H ;;
+ DB 085H ;; ð
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; RU Specific Translate Section for 1251
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU3_1251_XLAT: ;;
+ ;;
+ DW CP1251_XLAT_END-$ ;; length of section
+ DW 1251 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP1251_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP1251_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP1251_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0A4H ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP1251_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0E9H ;; ©
+ DB 0F6H ;; æ
+ DB 0F3H ;; ã
+ DB 0EAH ;; ª
+ DB 0E5H ;; ¥
+ DB 0EDH ;; ­
+ DB 0E3H ;; £
+ DB 0F8H ;; è
+ DB 0F9H ;; é
+ DB 0E7H ;; §
+ DB 0F5H ;; å
+ DB 0FAH ;; ê
+CP1251_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0F4H ;; ä
+ DB 0FBH ;; ë
+ DB 0E2H ;; ¢
+ DB 0E0H ;;  
+ DB 0EFH ;; ¯
+ DB 0F0H ;; à
+ DB 0EEH ;; ®
+ DB 0EBH ;; «
+ DB 0E4H ;; ¤
+ DB 0E6H ;; ¦
+ DB 0FDH ;; í
+ DB 0B8H ;; ñ
+CP1251_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0FFH ;; ï
+ DB 0F7H ;; ç
+ DB 0F1H ;; á
+ DB 0ECH ;; ¬
+ DB 0E8H ;; ¨
+ DB 0F2H ;; â
+ DB 0FCH ;; ì
+ DB 0E1H ;; ¡
+ DB 0FEH ;; î
+CP1251_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 1251
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP1251_A_K1_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 CP1251_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0C9H ;; ‰
+ DB 0D6H ;; –
+ DB 0D3H ;; “
+ DB 0CAH ;; Š
+ DB 0C5H ;; …
+ DB 0CDH ;;
+ DB 0C3H ;; ƒ
+ DB 0D8H ;; ˜
+ DB 0D9H ;; ™
+ DB 0C7H ;; ‡
+ DB 0D5H ;; •
+ DB 0DAH ;; š
+CP1251_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0D4H ;; ”
+ DB 0DBH ;; ›
+ DB 0C2H ;; ‚
+ DB 0C0H ;; €
+ DB 0CFH ;;
+ DB 0D0H ;;
+ DB 0CEH ;; Ž
+ DB 0CBH ;; ‹
+ DB 0C4H ;; „
+ DB 0C6H ;; †
+ DB 0DDH ;;
+ DB 0A8H ;; ð
+CP1251_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0D7H ;; —
+ DB 0D1H ;; ‘
+ DB 0CCH ;; Œ
+ DB 0C8H ;; ˆ
+ DB 0D2H ;; ’
+ DB 0DCH ;; œ
+ DB 0C1H ;;
+ DB 0DEH ;; ž
+CP1251_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP1251_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0DFH ;; Ÿ
+ ;;
+CP1251_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP1251_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP1251_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * RU Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+RU3_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 234 ;; ê
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 235 ;; ë
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 237 ;; í
+ DB 241 ;; ñ
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 154 ;; š
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 148 ;; ”
+ DB 155 ;; ›
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 157 ;;
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 41,240 ;; ð
+ ;;
+CP866_A_UP_K1_T5_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsf.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsf.asm
new file mode 100644
index 000000000..679dbe0e9
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsf.asm
@@ -0,0 +1,1633 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Swiss French
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsg.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsg.asm
new file mode 100644
index 000000000..a762a9873
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsg.asm
@@ -0,0 +1,1635 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Swiss German
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsl.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsl.asm
new file mode 100644
index 000000000..ef4cd1652
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsl.asm
@@ -0,0 +1,2356 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;;
+;; This file contains the keyboard tables for:
+;; Czechoslovakia (Slovak)
+;; Alterations created by Gyorgy Balint on behalf of IBM ROECE
+;; 22.10.87 Basingstoke
+;;
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: Michael J. Saunders 2.OCTOBER 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC SL_LOGIC ;;
+ PUBLIC SL_850_XLAT ;;
+ PUBLIC SL_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; SL State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+SL_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 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 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 DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ 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 ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; SL 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 SL_COMMON_XLAT ;;
+SL_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 ;;
+ FLAG ACUTE ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 41 ;;
+ FLAG OVERCIRCLE ;;
+ DB 13 ;;
+ FLAG CARON ;;
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_SL_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 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY (YST)
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_SL_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: ANY_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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,";" ;; changes made!!!!! x
+ DB 02h,"+" ;; x
+ DB 0ch,"=" ;; x
+ DB 0dh,"`" ;; x
+ DB 056h,"&" ;; x
+ DB 035h,"-" ;; x
+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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 20 ;; number of entries
+ DB 002h,"1" ;; x
+ DB 003h,"2" ;; x
+ DB 004h,"3" ;; x
+ DB 005h,"4" ;; x
+ DB 006h,"5" ;; x
+ DB 007h,"6" ;; x
+ DB 008h,"7" ;; x
+ DB 009h,"8" ;; x
+ DB 00ah,"9" ;; x
+ DB 00bh,"0" ;; x
+ DB 00ch,"%" ;; x
+ DB 01ah,"/" ;; x
+ DB 01bh,"(" ;; x
+ DB 027h,'"' ;; x
+ DB 028h,"!" ;; x
+ DB 02Bh,")" ;; x
+ DB 056h,"*" ;; x
+ DB 033h,"?" ;; x
+ DB 034H,":" ;; x
+ DB 035H,"_" ;; x
+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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 26 ;; number of entries
+ DB 2,'~',02H ;;
+ DB 8,'`',08H ;;
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 20,'$',14H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,'<',17H ;;
+ DB 24,'>',18H ;;
+ DB 25,'*',19H ;;
+ DB 26,'ö',1AH ;;
+ DB 33,"[",021h ;; x
+ DB 34,"]",022h ;; x
+ DB 35,"&",023h ;; x
+ DB 39,"$",027H ;; x
+ db 40,0e1h,028h ;; sharpes s x
+ DB 86,"<",056h ;; x
+ DB 44,">",02ch ;; x
+ DB 45,"#",02dh ;; x
+ DB 46,"&",02dh ;; x
+ DB 47,"@",02fh ;; x
+ DB 48,"{",30h ;; x
+ DB 49,"}",031h ;; x
+ DB 51,"<",033h ;; x
+ DB 52,">",034h ;; x
+ DB 53,"*",035h ;; x
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC SL_850_XLAT ;;
+SL_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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,-1 ;; CURRENCY SYMBOL
+ DB 40,015H ;;
+CP850_NA_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 2 ;; number of entries
+ DB 13,-1
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 2 ;; number of entries
+ DB 13,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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,0FEH,0 ;; 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: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FEH,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FEH ;; OGONEK SPACE
+CP850_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 MULTILINGUAL 2 SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC SL_852_XLAT ;;
+SL_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;section commented out by gy.balint ;;
+; DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+; DB STANDARD_TABLE ;; xlat options:
+; DB 2 ;; number of entries
+; DB 13,088H ;; l STROKE
+; DB 27,0D0H ;; d STROKE
+;CP852_AL_LO_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;section commented out by gy. balint ;;
+; DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+; DB STANDARD_TABLE ;; xlat options:
+; DB 2 ;; number of entries
+; DB 13,09DH ;; L STROKE
+; DB 27,0D1H ;; D STROKE
+;CP852_AL_UP_T1_END: ;;
+ ;;
+; DW 0 ;; Size of xlat table - null table
+ ;;
+;CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 8 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 22,0CFH,16H ;; CURRENCY SYMBOL
+ DB 27,09eh,1bh ;; multiple sign x
+ DB 31,0d0h,1fh ;; d stroke small x
+ DB 32,0d1h,20h ;; D stroke capital x
+ DB 37,088h,025h ;; l stroke small x
+ DB 38,09dh,026h ;; L stroke capital
+ DB 43,0cfh,02Bh ;; sun
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE:CP 852
+;; STATE: Non-alpha lower case
+;; KEYBOARD TYPES: G
+;;TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_NA_LO_K1_END-$ ;; length of section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard type
+ DB -1,-1 ;; Buffer entry for error chars.
+ ;;
+ DW CP852_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; NUMBER OF ENTRIES
+ DB 03h,0096h ;; l caron small x
+ DB 04h,0e7h ;; s caron small x
+ DB 05h,09fh ;; c caron small x
+ DB 06h,009ch ;; t caron small x
+ DB 07h,0a7h ;; z caron small x
+ DB 08h,0ech ;; y acute small x
+ DB 09h,0a0h ;; a acute small x
+ DB 0ah,0a1h ;; i acute small x
+ DB 0bh,082h ;; e acute small x
+ DB 01ah,0a3h ;; u acute small x
+ DB 01bh,084h ;; a diaresis small x
+ DB 027h,093h ;; o circumflex small x
+ DB 028h,0f5h ;; section symbol x
+ DB 02Bh,0e5h ;; n caron small x
+
+CP852_NA_LO_K1_T1_END:
+ DW 0
+CP852_NA_LO_K1_END:
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP852
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_NA_UP_K1_END-$ ;; length of state section
+;; DB NON_ALPHA_UPPER ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB -1,-1 ;; Buffer entry for error character
+ ;;
+;; DW CP852_NA_UP_K1_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE ;; xlat options:
+;; DB 2 ;; number of entries
+;; DB 029h,0f8h ;; overcircle
+;; DB 0dh,0f3h ;; caron
+;;CP852_NA_UP_K1_T1_END: ;;
+ ;;
+;; DW 0 ;; Size of xlat table - null table
+ ;;
+;;CP852_NA_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsp.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsp.asm
new file mode 100644
index 000000000..888966477
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsp.asm
@@ -0,0 +1,1379 @@
+;; LATEST CHANGE ALT & CTL (November)
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;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 PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 3.4 ;; 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 3.4 ;; 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsu.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsu.asm
new file mode 100644
index 000000000..8a866e7eb
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsu.asm
@@ -0,0 +1,1687 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Finnish
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Updated: MIKE SAUNDERS - WSD IBM Hursley Laboratory - August 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfsv.asm b/private/mvdm/dos/v86/dev/keyboard/kdfsv.asm
new file mode 100644
index 000000000..456fe1b43
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfsv.asm
@@ -0,0 +1,1695 @@
+ PAGE ,132
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+ TITLE PC DOS 3.3 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
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Swedish
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Updated: MIKE SAUNDERS - WSD IBM Hursley Laboratory - August 1986
+;; NICK SAVAGE - ESD IBM Boca Raton Laboratory -August- December 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdftr.asm b/private/mvdm/dos/v86/dev/keyboard/kdftr.asm
new file mode 100644
index 000000000..7ae94a784
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdftr.asm
@@ -0,0 +1,1410 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Turkey
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; modded : DTF 18-Sep-86
+;; Corrected and Updated - Yucel Egecioglu - 6/4/87
+;; Corrected and Modified - MJS 12/6/87
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC TR_LOGIC ;;
+ PUBLIC TR_850_XLAT ;;
+ PUBLIC TR_857_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; TR State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+TR_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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+IFKBD G_KB+P12_KB ;; ONLY VALID FOR ENHANCED KB
+ ;;
+ IFF EITHER_CTL,NOT ;;
+ IFF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF R_ALT_SHIFT ;;
+ ANDF EITHER_SHIFT,NOT ;;
+ SET_FLAG DEAD_THIRD ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;IFKBD P12_KB+G_KB ;;
+; 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+JR_KB ;;
+; IFF EITHER_CTL ;;
+; ANDF ALT_SHIFT ;;
+; SET_FLAG DEAD_THIRD ;;
+; ENDIFF ;;
+; ELSEF ;;
+; IFF EITHER_CTL,NOT ;;
+; ANDF ALT_SHIFT,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 850 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 ;; 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+JR_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 ;;
+ IFF EITHER_CTL ;;
+ ANDF ALT_SHIFT ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT ALT_CASE ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+;**************************************;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; TR 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 TR_COMMON_XLAT ;;
+TR_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Upper Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TR_UP_END-$ ;; length of state section
+ DB DEAD_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 4 ;; scan code
+ FLAG CIRCUMFLEX ;;
+ ;;
+COM_TR_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TR_TH_END-$ ;; length of state section
+ DB DEAD_THIRD ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 4 ;; number of entries
+ DB 26 ;; scan code
+ FLAG DIARESIS ;; flag bit to set
+ DB 27 ;;
+ FLAG TILDE ;;
+ DB 39 ;; (could be 40!)
+ FLAG ACUTE ;;
+ DB 43 ;; scan code
+ FLAG GRAVE ;; flag bit to set
+ ;;
+COM_TR_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: G
+;; 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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_ALT_K1_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW G_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 07,00,35H ;;
+ DB 12,0,2BH ;;
+ DB 13,0,082H ;; 53 changed to 13 - YE
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW G_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 6 ;; number of entries
+ DB 09,1BH,09 ;; [
+ DB 10,1DH,10 ;; ]
+ DB 1AH,-1,-1 ;; " " [
+ DB 1BH,-1,-1 ;; " " ]
+ DB 12,01CH,2BH ;; backslash
+ DB 13,01FH,0CH ;; 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;;
+ DW COM_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_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 4 ;;
+; DB 16,'q' ;;
+; DB 17,'w' ;;
+; DB 18,'e' ;;
+; DB 19,'r' ;;
+; DB 20,'t' ;;
+; DB 21,'y' ;;
+; DB 22,'u' ;;
+;; DB 23,BELL ;; i "dotless" Turkish National DO NOT USE see 850
+; DB 24,'o' ;;
+; DB 25,'p' ;;
+;; DB 26,BELL ;; g "breve" Turkish National DO NOT USE see 850
+ DB 27,'' ;;
+; DB 30,'a' ;;
+; DB 31,'s' ;;
+; DB 32,'d' ;;
+; DB 33,'f' ;;
+; DB 34,'g' ;;
+; DB 35,'h' ;;
+; DB 36,'j' ;;
+; DB 37,'k' ;;
+; DB 38,'l' ;;
+;; DB 39,BELL ;; s "cedilla" Turkish National DO NOT USE see 850
+ DB 40,'i' ;; i "dot" Turkish National
+; DB 44,'z' ;;
+; DB 45,'x' ;;
+; DB 46,'c' ;;
+; DB 47,'v' ;;
+; DB 48,'b' ;;
+; DB 49,'n' ;;
+; DB 50,'m' ;;
+ DB 51,'”' ;;
+ DB 52,'‡' ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;;
+ DW COM_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_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 ;;
+; DB 16,'Q' ;;
+; DB 17,'W' ;;
+; DB 18,'E' ;;
+; DB 19,'R' ;;
+; DB 20,'T' ;;
+; DB 21,'Y' ;;
+; DB 22,'U' ;;
+; DB 23,'I' ;;
+; DB 24,'O' ;;
+; DB 25,'P' ;;
+;; DB 26,BELL ;; G "breve" Turkish National DO NOT USE see 850
+ DB 27,'š' ;;
+; DB 30,'A' ;;
+; DB 31,'S' ;;
+; DB 32,'D' ;;
+; DB 33,'F' ;;
+; DB 34,'G' ;;
+; DB 35,'H' ;;
+; DB 36,'J' ;;
+; DB 37,'K' ;;
+; DB 38,'L' ;;
+;; DB 39,BELL ;; S "cedilla" Turkish National DO NOT USE see 850
+;; DB 40,BELL ;; I "dot" Turkish National DO NOT USE se 850
+; DB 44,'Z' ;;
+; DB 45,'X' ;;
+; DB 46,'C' ;;
+; DB 47,'V' ;;
+; DB 48,'B' ;;
+; DB 49,'N' ;;
+; DB 50,'M' ;;
+ DB 51,'™' ;;
+ DB 52,'€' ;;
+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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW G_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 13,"-" ;;
+ DB 43,"," ;;
+ DB 41,22H ;;
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW G_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 2,"!" ;;
+ DB 3,"'" ;; Should ^ be here? MJS
+ DB 5,'+' ;;
+ DB 6,'%' ;;
+ DB 7,'&' ;;
+ DB 8,'/' ;;
+ DB 9,'(' ;;
+ DB 10,')' ;;
+ DB 11,'=' ;;
+ DB 12,'?' ;;
+ DB 13,'_' ;;
+ DB 41,082H ;;
+ DB 43,';' ;;
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW G_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 12 ;; number of entries
+ DB 3,09CH ;; UK Pound Sign
+ DB 4,'#' ;; Number Sign
+ DB 5,'$' ;; US Dollar Sign
+ DB 6,0ABH ;; One Half Sign
+ DB 8,'{' ;; Left Brace
+ DB 9,'[' ;; Left Bracket
+ DB 10,']' ;; Right Bracket
+ DB 11,'}' ;; Right Brace
+ DB 12,'\' ;; Backslash
+ DB 16,'@' ;; At Sign
+ DB 31,0E1H ;; SHARP S
+ DB 86,'|' ;; Unbroken Bar
+ ;;
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW G_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 40,'' ;; 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_SP_END-$ ;; length of state section
+ DB GRAVE_SPACE ;; State ID
+ DW G_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,060H ;; 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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_LO_END-$ ;; length of state section
+ DB CIRCUMFLEX_LOWER ;; State ID
+ DW G_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 40,'Œ' ;; 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_SP_END-$ ;; length of state section
+ DB CIRCUMFLEX_SPACE ;; State ID
+ DW G_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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_LO_END-$ ;; length of state section
+ DB TILDE_LOWER ;; State ID
+ DW G_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
+;;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_UP_END-$ ;; length of state section
+ DB TILDE_UPPER ;; State ID
+ DW G_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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_SP_END-$ ;; length of state section
+ DB TILDE_SPACE ;; State ID
+ DW G_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_LO_END-$ ;; length of state section
+ DB ACUTE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,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 22,'£' ;; scan code,ASCII - u
+ DB 40,'¡' ;; scan code,ASCII - i
+ DB 24,'¢' ;; scan code,ASCII - o
+ DB 30,' ' ;; scan code,ASCII - a
+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:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_UP_END-$ ;; length of state section
+ DB ACUTE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,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,090H ;; E acute
+COM_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 30,084H ;; a diaeresis
+ DB 18,089H ;; e "
+; DB 23,08BH ;; i diaeresis - with dotless i
+ DB 40,08BH ;; i "
+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
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,08EH ;; A diaeresis
+COM_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;SPECIFIC TURKEY 850 XLATES
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ PUBLIC TR_850_XLAT ;;
+TR_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0,0 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 23,-1 ;; dotless i - NO OPERATION BELL!
+ DB 26,-1 ;; g-breve
+ DB 39,-1 ;; s-cedilla
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0,0 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 26,-1 ;; G-breve NO OP WITH BELL!
+ DB 39,-1 ;; S-cedilla "
+ DB 40,-1 ;; I-overdot "
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;;
+CP850_XLAT_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;TURKEY SPECIFIC 857 XLATES
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+PUBLIC TR_857_XLAT ;;
+TR_857_XLAT: ;;
+ ;;
+ DW CP_857_XLAT_END-$ ;; length of section
+ DW 857 ;; code page
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP857_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 23,08DH ;; dotless i
+ DB 26,0A7H ;; g-breve
+ DB 39,09FH ;; s-cedilla
+CP857_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP857_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 26,0A6H ;; G-breve
+ DB 39,09EH ;; S-cedilla
+ DB 40,098H ;; I-overdot
+CP857_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AL_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW CP857_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 18,08AH ;; E grave
+ DB 22,097H ;; U grave
+ DB 23,0ECh ;; scan code,ASCII - dotless i
+ DB 24,095H ;; O grave
+ DB 30,085H ;; A grave
+ DB 40,0ECh ;; scan code,ASCII - dotted i
+CP857_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Grave Upper
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_GR_UP_END-$ ;; length of state section
+ DB GRAVE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW CP857_GR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 18,0D4H ;; E grave
+ DB 22,0EBH ;; U grave
+ DB 23,0DEH ;; I grave - dotless I
+ DB 40,0DEH ;; I grave - with dot I
+ DB 24,0E3H ;; O grave
+ DB 30,0B7H ;; A grave
+CP857_GR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_GR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_CI_LO_END-$ ;; length of state section
+ DB CIRCUMFLEX_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW CP857_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 23,08CH ;; scan code,ASCII - dotless i
+ DB 40,08CH ;; acan code,ASCII - dotted i
+CP857_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP857_CI_LO_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW CP857_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 30,0B6H ;; A circumflex
+ DB 18,0D2H ;; E circumflex
+ DB 24,0E2H ;; O circumflex
+ DB 23,0D7H ;; I "
+ DB 40,0D7H ;; I " - with dot I
+ DB 22,0EAH ;; U "
+CP857_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_CI_UP_END: ;; length of state section
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Tilde Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_TI_LO_END-$ ;; length of state section
+ DB TILDE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_TI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 49,0A4H ;; scan code,ASCII - ¤
+ DB 24,0E4h ;; o tilde
+ DB 30,0C6h ;; a tilde
+ CP857_TI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+ CP857_TI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CODE PAGE: Common
+;;; STATE: Tilde Upper Case
+;;; KEYBOARD TYPES: G
+;;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_TI_UP_END-$ ;; length of state section
+ DB TILDE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_TI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 49,0A5H ;; scan code,ASCII - ¥
+ DB 24,0E5h ;; O tilde
+ DB 30,0C7h ;; A tilde
+ CP857_TI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+ CP857_TI_UP_END: ;; length of state section
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Tilde Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW CP857_TI_SP_END-$ ;; length of state section
+; DB TILDE_SPACE ;; State ID
+; DW G_KB ;; Keyboard Type
+; DB 07EH,0 ;; error character = standalone accent
+; ;;
+; DW CP857_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
+;CP857_TI_SP_T1_END: ;;
+; ;;
+; DW 0 ;; Size of xlat table - null table
+; ;;
+;CP857_TI_SP_END: ;; length of state section
+; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AC_LO_END-$ ;; length of state section
+ DB ACUTE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 23,'¡' ;; scan code,ASCII - dotless i
+CP857_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AC_UP_END-$ ;; length of state section
+ DB ACUTE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 22,0E9H ;; U acute
+ DB 23,0D6H ;; I acute
+ DB 40,0D6H ;; I acute - with dot I
+ DB 24,0E0H ;; O acute
+ DB 30,0B5H ;; A acute
+CP857_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *****
+ ;;
+ DW CP857_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; STANDALONE ACUTE
+CP857_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 23,08BH ;; i diaeresis - with dotless i
+ DB 40,08BH ;; i diaeresis - with dotted i
+CP857_DI_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Upper
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 18,0D3H ;; E "
+ DB 23,0D8H ;; I "
+ DB 40,0D8H ;; I diaeresis with dot I
+CP857_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_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
+CP857_DI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_SP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP_857_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdftr440.asm b/private/mvdm/dos/v86/dev/keyboard/kdftr440.asm
new file mode 100644
index 000000000..65456c987
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdftr440.asm
@@ -0,0 +1,1433 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Turkey KBID 440
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; modded : DTF 18-Sep-86
+;; KBID 440 Support implemented by: T. Fikret Inam & D.Love
+;; 12 May 1992 - Boca Raton
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC TR2_LOGIC ;;
+ PUBLIC TR2_850_XLAT ;;
+ PUBLIC TR2_857_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; TR2 State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+TR2_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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+IFKBD G_KB+P12_KB ;; ONLY VALID FOR ENHANCED KB
+ ;;
+ IFF EITHER_CTL,NOT ;;
+ IFF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF R_ALT_SHIFT ;;
+ ANDF EITHER_SHIFT,NOT ;;
+ SET_FLAG DEAD_THIRD ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;IFKBD P12_KB+G_KB ;;
+; 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+JR_KB ;;
+; IFF EITHER_CTL ;;
+; ANDF ALT_SHIFT ;;
+; SET_FLAG DEAD_THIRD ;;
+; ENDIFF ;;
+; ELSEF ;;
+; IFF EITHER_CTL,NOT ;;
+; ANDF ALT_SHIFT,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 850 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 ;; 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+JR_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 ;;
+ IFF EITHER_CTL ;;
+ ANDF ALT_SHIFT ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT ALT_CASE ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+;**************************************;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; TR 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 TR2_COMMON_XLAT ;;
+TR2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Upper Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TR_UP_END-$ ;; length of state section
+ DB DEAD_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 4 ;; scan code
+ FLAG CIRCUMFLEX ;;
+ ;;
+COM_TR_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TR_TH_END-$ ;; length of state section
+ DB DEAD_THIRD ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;; Set Flag Table
+ DW 4 ;; number of entries
+ DB 26 ;; scan code
+ FLAG DIARESIS ;; flag bit to set
+ DB 27 ;;
+ FLAG TILDE ;;
+ DB 39 ;; (could be 40!)
+ FLAG ACUTE ;;
+ DB 43 ;; scan code
+ FLAG GRAVE ;; flag bit to set
+ ;;
+COM_TR_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: G
+;; 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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_ALT_K1_END-$ ;; length of state section
+ DB ALT_CASE ;; State ID
+ DW G_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 07,00,35H ;;
+ DB 12,0,2BH ;;
+ DB 13,0,082H ;; 53 changed to 13 - YE
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW G_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 6 ;; number of entries
+ DB 09,1BH,09 ;; [
+ DB 10,1DH,10 ;; ]
+ DB 1AH,-1,-1 ;; " " [
+ DB 1BH,-1,-1 ;; " " ]
+ DB 12,01CH,2BH ;; backslash
+ DB 13,01FH,0CH ;; MOVE HYPHEN
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;; ***************************************************
+;; ****** CHANGES START HERE FOR KBID 440 - F.I. *****
+;; ***************************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;;
+ DW COM_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_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 29 ;;
+ DB 16,'f' ;;
+ DB 17,'g' ;;
+; DB 18,BELL ;; g "breve" Turkish National DO NOT USE see 850
+; DB 19,BELL ;; i "dotless" Turkish National DO NOT USE see 850
+ DB 20,'o' ;;
+ DB 21,'d' ;;
+ DB 22,'r' ;;
+ DB 23,'n' ;;
+ DB 24,'h' ;;
+ DB 25,'p' ;;
+ DB 26,'q' ;;
+ DB 27,'w' ;;
+ DB 30,'u' ;;
+ DB 31,'i' ;;
+ DB 32,'e' ;;
+ DB 33,'a' ;;
+ DB 34,'' ;;
+ DB 35,'t' ;;
+ DB 36,'k' ;;
+ DB 37,'m' ;;
+ DB 38,'l' ;;
+ DB 39,'y' ;;
+; DB 40,BELL ;; s "cedilla" Turkish National DO NOT USE see 850
+ DB 43,'x' ;;
+ DB 44,'j' ;;
+ DB 45,'”' ;;
+ DB 46,'v' ;;
+ DB 47,'c' ;;
+ DB 48,'‡' ;;
+ DB 49,'z' ;;
+ DB 50,'s' ;;
+ DB 51,'b' ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;;
+ DW COM_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_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 29 ;;
+ DB 16,'F' ;;
+ DB 17,'G' ;;
+; DB 18,BELL ;; G "breve" Turkish National DO NOT USE see 850
+ DB 19,'I' ;;
+ DB 20,'O' ;;
+ DB 21,'D' ;;
+ DB 22,'R' ;;
+ DB 23,'N' ;;
+ DB 24,'H' ;;
+ DB 25,'P' ;;
+ DB 26,'Q' ;;
+ DB 27,'W' ;;
+ DB 30,'U' ;;
+; DB 31,BELL ;; I "overdot" Turkish National DO NOT USE se 850
+ DB 32,'E' ;;
+ DB 33,'A' ;;
+ DB 34,'š' ;;
+ DB 35,'T' ;;
+ DB 36,'K' ;;
+ DB 37,'M' ;;
+ DB 38,'L' ;;
+ DB 39,'Y' ;;
+; DB 40,BELL ;; S "cedilla" Turkish National DO NOT USE see 850
+ DB 43,'X' ;;
+ DB 44,'J' ;;
+ DB 45,'™' ;;
+ DB 46,'V' ;;
+ DB 47,'C' ;;
+ DB 48,'€' ;;
+ DB 49,'Z' ;;
+ DB 50,'S' ;;
+ DB 51,'B' ;;
+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_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW G_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 13,"-" ;;
+ DB 41,"+" ;;
+ DB 52,"." ;;
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW G_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 2,"!" ;;
+ DB 3,022H ;;
+ DB 5,'$' ;;
+ DB 6,'%' ;;
+ DB 7,'&' ;;
+ DB 8,027H ;;
+ DB 9,'(' ;;
+ DB 10,')' ;;
+ DB 11,'=' ;;
+ DB 12,'?' ;;
+ DB 13,'_' ;;
+ DB 41,'*' ;;
+ 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW G_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 24 ;; number of entries
+ DB 41,'ª' ;; Logical Not Sign
+ DB 2,0FBH ;; 1 Superscript
+ DB 3,0FDH ;; 2 Superscript
+ DB 4,'#' ;; Number Sign
+ DB 5,0ACH ;; One Quarter Sign
+ DB 6,0ABH ;; One Half Sign
+ DB 7,0F3H ;; Three Quarters Sign
+ DB 8,'{' ;; Left Brace
+ DB 9,'[' ;; Left Bracket
+ DB 10,']' ;; Right Bracket
+ DB 11,'}' ;; Right Brace
+ DB 12,'\' ;; Backslash
+ DB 16,'@' ;; At Sign
+ DB 19,0F4H ;; ô 244
+ DB 21,0BEH ;; Yen Sign
+ DB 24,09BH ;; › 155
+ DB 25,09CH ;; UK Pound Sign
+ DB 30,091H ;; ‘ 145
+ DB 31,0E1H ;; Sharp S
+ DB 44,0AEH ;; Left Angle Quotes
+ DB 45,0AFH ;; Right Angle Quotes
+ DB 46,0BDH ;; Cent Sign (NOT ON LAYOUT - F.I.)
+ DB 50,0E6H ;; Micro Symbol (NOT ON LAYOUT - F.I.)
+ DB 51,0E8H ;; Multiply Sign
+ DB 52,0F6H ;; Divide Sign
+ DB 53,0f0h ;; Syllable Hyphen
+ DB 86,'|' ;; Unbroken Bar
+ ;;
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW G_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 32,'Š' ;; scan code,ASCII - e
+ DB 30,'—' ;; scan code,ASCII - u
+ DB 31,0ECH ;; scan code,ASCII - i
+ DB 20,'•' ;; scan code,ASCII - o
+ DB 33,'…' ;; 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: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_GR_SP_END-$ ;; length of state section
+ DB GRAVE_SPACE ;; State ID
+ DW G_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,060H ;; 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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_LO_END-$ ;; length of state section
+ DB CIRCUMFLEX_LOWER ;; State ID
+ DW G_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 32,'ˆ' ;; scan code,ASCII - e
+ DB 30,'–' ;; scan code,ASCII - u
+ DB 31,'Œ' ;; scan code,ASCII - i
+ DB 20,'“' ;; scan code,ASCII - o
+ DB 33,'ƒ' ;; scan code,ASCII - a
+COM_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CI_SP_END-$ ;; length of state section
+ DB CIRCUMFLEX_SPACE ;; State ID
+ DW G_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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_LO_END-$ ;; length of state section
+ DB TILDE_LOWER ;; State ID
+ DW G_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 23,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
+;;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_UP_END-$ ;; length of state section
+ DB TILDE_UPPER ;; State ID
+ DW G_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 23,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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_TI_SP_END-$ ;; length of state section
+ DB TILDE_SPACE ;; State ID
+ DW G_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_LO_END-$ ;; length of state section
+ DB ACUTE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,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 32,'‚' ;; scan code,ASCII - e
+ DB 30,'£' ;; scan code,ASCII - u
+ DB 31,'¡' ;; scan code,ASCII - i
+ DB 20,'¢' ;; scan code,ASCII - o
+ DB 33,' ' ;; scan code,ASCII - a
+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:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_UP_END-$ ;; length of state section
+ DB ACUTE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,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 32,090H ;; E acute
+COM_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 33,084H ;; a diaeresis
+ DB 32,089H ;; e "
+ DB 31,08BH ;; i "
+ DB 20,094H ;; o "
+ DB 30,081H ;; u "
+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
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 4 ;; number of scans
+ DB 33,08EH ;; A diaeresis
+ DB 20,099H ;; O diaeresis
+ DB 30,09AH ;; U diaeresis
+ DB 19,0D8H ;; I "
+COM_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;SPECIFIC TURKEY 850 XLATES
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ PUBLIC TR2_850_XLAT ;;
+TR2_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0,0 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 19,-1 ;; dotless i - NO OPERATION BELL!
+ DB 18,-1 ;; g-breve
+ DB 40,-1 ;; s-cedilla
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0,0 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 18,-1 ;; G-breve NO OP WITH BELL!
+ DB 40,-1 ;; S-cedilla "
+ DB 31,-1 ;; I-overdot "
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;;
+CP850_XLAT_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;TURKEY SPECIFIC 857 XLATES
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+PUBLIC TR2_857_XLAT ;;
+TR2_857_XLAT: ;;
+ ;;
+ DW CP_857_XLAT_END-$ ;; length of section
+ DW 857 ;; code page
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP857_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 19,08DH ;; dotless i
+ DB 18,0A7H ;; g-breve
+ DB 40,09FH ;; s-cedilla
+CP857_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP857_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 3 ;;
+ DB 18,0A6H ;; G-breve
+ DB 40,09EH ;; S-cedilla
+ DB 31,098H ;; I-overdot
+CP857_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AL_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Grave Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW CP857_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 32,08AH ;; E grave
+ DB 30,097H ;; U grave
+ DB 19,0ECh ;; scan code,ASCII - dotless i
+ DB 31,0ECh ;; scan code,ASCII - i
+ DB 20,095H ;; O grave
+ DB 33,085H ;; A grave
+CP857_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Grave Upper
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_GR_UP_END-$ ;; length of state section
+ DB GRAVE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 96,0 ;; error character = standalone accent
+ ;;
+ DW CP857_GR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 32,0D4H ;; E grave
+ DB 30,0EBH ;; U grave
+ DB 19,0DEH ;; I grave - I
+ DB 31,0DEH ;; I grave - I overdot
+ DB 20,0E3H ;; O grave
+ DB 33,0B7H ;; A grave
+CP857_GR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_GR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_CI_LO_END-$ ;; length of state section
+ DB CIRCUMFLEX_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW CP857_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 19,08CH ;; scan code,ASCII - dotless i
+ DB 31,08CH ;; scan code,ASCII - i
+CP857_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP857_CI_LO_END: ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 94,0 ;; error character = standalone accent
+ ;;
+ DW CP857_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 6 ;; number of scans
+ DB 33,0B6H ;; A circumflex
+ DB 32,0D2H ;; E circumflex
+ DB 20,0E2H ;; O circumflex
+ DB 19,0D7H ;; I "
+ DB 31,0D7H ;; I " - with I overdot
+ DB 30,0EAH ;; U "
+CP857_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_CI_UP_END: ;; length of state section
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Tilde Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_TI_LO_END-$ ;; length of state section
+ DB TILDE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_TI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0A4H ;; scan code,ASCII - ¤
+ DB 20,0E4h ;; o tilde
+ DB 33,0C6h ;; a tilde
+ CP857_TI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+ CP857_TI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;; CODE PAGE: Common
+;;; STATE: Tilde Upper Case
+;;; KEYBOARD TYPES: G
+;;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_TI_UP_END-$ ;; length of state section
+ DB TILDE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 07EH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_TI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0A5H ;; scan code,ASCII - ¥
+ DB 20,0E5h ;; O tilde
+ DB 33,0C7h ;; A tilde
+ CP857_TI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+ CP857_TI_UP_END: ;; length of state section
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Tilde Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+; DW CP857_TI_SP_END-$ ;; length of state section
+; DB TILDE_SPACE ;; State ID
+; DW G_KB ;; Keyboard Type
+; DB 07EH,0 ;; error character = standalone accent
+; ;;
+; DW CP857_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
+;CP857_TI_SP_T1_END: ;;
+; ;;
+; DW 0 ;; Size of xlat table - null table
+; ;;
+;CP857_TI_SP_END: ;; length of state section
+; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AC_LO_END-$ ;; length of state section
+ DB ACUTE_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 19,'¡' ;; scan code,ASCII - dotless i
+CP857_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES:G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_AC_UP_END-$ ;; length of state section
+ DB ACUTE_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 30,0E9H ;; U acute
+ DB 19,0D6H ;; I acute
+ DB 31,0D6H ;; I acute - with I overdot
+ DB 20,0E0H ;; O acute
+ DB 33,0B5H ;; A acute
+CP857_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP857
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; *****
+ ;;
+ DW CP857_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0EFH,0 ;; error character = standalone accent
+ ;;
+ DW CP857_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; STANDALONE ACUTE
+CP857_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_LO_END-$ ;; length of state section
+ DB DIARESIS_LOWER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_DI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 19,08BH ;; i diaeresis - with dotless i
+ DB 39,0EDH ;; y diaeresis
+ DB 31,08BH ;; i diaeresis - with dotted i
+CP857_DI_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Upper
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_UP_END-$ ;; length of state section
+ DB DIARESIS_UPPER ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 32,0D3H ;; E "
+ DB 19,0D8H ;; I "
+ DB 31,0D8H ;; I diaeresis with dot I
+CP857_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 857
+;; STATE: Diaresis Space Bar
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP857_DI_SP_END-$ ;; length of state section
+ DB DIARESIS_SPACE ;; State ID
+ DW G_KB ;; Keyboard Type
+ DB 0F9H,0 ;; error character = standalone accent
+ ;;
+ DW CP857_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
+CP857_DI_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP857_DI_SP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP_857_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfuk.asm b/private/mvdm/dos/v86/dev/keyboard/kdfuk.asm
new file mode 100644
index 000000000..ea333f938
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfuk.asm
@@ -0,0 +1,661 @@
+;CODE to be deleted has a double ;; followed by actual asm code....****
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; LATEST CHANGE ALT & CTL
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfuk166.asm b/private/mvdm/dos/v86/dev/keyboard/kdfuk166.asm
new file mode 100644
index 000000000..0caa76a6f
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfuk166.asm
@@ -0,0 +1,661 @@
+;CODE to be deleted has a double ;; followed by actual asm code....****
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; LATEST CHANGE ALT & CTL
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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 ;;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfuk168.asm b/private/mvdm/dos/v86/dev/keyboard/kdfuk168.asm
new file mode 100644
index 000000000..550d279ef
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfuk168.asm
@@ -0,0 +1,855 @@
+;CODE to be deleted has a double ;; followed by actual asm code....****
+
+; * IBM CONFIDENTIAL * Jan 9 1990 *
+
+;; LATEST CHANGE ALT & CTL
+
+
+
+ PAGE ,132
+ TITLE PC DOS 3.4 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Defintion File
+;; (c) Copyright IBM Corp 198?,...
+;;
+;; This file contains the keyboard tables for Spanish.
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; Author: BILL DEVLIN - IBM Canada Laboratory - May 1986
+;; Author: NICK SAVAGE - IBM Corp. - May 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ 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;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfur.asm b/private/mvdm/dos/v86/dev/keyboard/kdfur.asm
new file mode 100644
index 000000000..09638ad78
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfur.asm
@@ -0,0 +1,1100 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC UR_LOGIC ;;
+ PUBLIC UR2_LOGIC ;;
+ PUBLIC UR3_LOGIC ;;
+ PUBLIC UR_866_XLAT ;;
+ PUBLIC UR_437_XLAT ;;
+ PUBLIC UR_850_XLAT ;;
+ PUBLIC UR_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR1_COMMON_XLAT ;;
+UR1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR2_COMMON_XLAT ;;
+UR2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR3_COMMON_XLAT ;;
+UR3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 08CH ;; õ
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 08AH ;; i
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 086H ;; ó
+ DB 027H ;; '
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 08DH ;; ô
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 08BH ;; I
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 087H ;; ò
+ DB 027H ;; '
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * UR Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 245 ;; õ
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 105 ;; i
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 243 ;; ó
+ DB 039 ;; '
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 244 ;; ô
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 148 ;; ”
+ DB 073 ;; I
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 242 ;; ò
+ DB 039 ;; '
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfur094.asm b/private/mvdm/dos/v86/dev/keyboard/kdfur094.asm
new file mode 100644
index 000000000..95ca5297c
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfur094.asm
@@ -0,0 +1,804 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC UR1_LOGIC ;;
+ PUBLIC UR1_866_XLAT ;;
+ PUBLIC UR1_437_XLAT ;;
+ PUBLIC UR1_850_XLAT ;;
+ PUBLIC UR1_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR1_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;;
+;; <CTRL>+<RIGHT SHIFT> for Russian mode
+;;
+;; <CTRL>+<LEFT SHIFT> for Latin mode
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR1_COMMON_XLAT ;;
+UR1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR1_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR1_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR1_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 08CH ;; õ
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 08AH ;; i
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 086H ;; ó
+ DB 027H ;; '
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 08DH ;; ô
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 08BH ;; I
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 087H ;; ò
+ DB 027H ;; '
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * UR Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR1_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 245 ;; õ
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 105 ;; i
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 243 ;; ó
+ DB 039 ;; '
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 244 ;; ô
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 148 ;; ”
+ DB 073 ;; I
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 242 ;; ò
+ DB 039 ;; '
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfur095.asm b/private/mvdm/dos/v86/dev/keyboard/kdfur095.asm
new file mode 100644
index 000000000..c6922f542
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfur095.asm
@@ -0,0 +1,800 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC UR2_LOGIC ;;
+ PUBLIC UR2_866_XLAT ;;
+ PUBLIC UR2_437_XLAT ;;
+ PUBLIC UR2_850_XLAT ;;
+ PUBLIC UR2_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR2 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR2_LOGIC: ;;
+ ;;
+ DW LOGIC2_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT>+<LEFT SHIFT>
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR2_COMMON_XLAT ;;
+UR2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON2_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM2_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 2 ;; number of entries
+ DB 42 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ DB 54 ;;
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM2_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON2_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR2_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR2_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR2_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 08CH ;; õ
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 08AH ;; i
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 086H ;; ó
+ DB 027H ;; '
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 08DH ;; ô
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 08BH ;; I
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 087H ;; ò
+ DB 027H ;; '
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * UR Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR2_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 245 ;; õ
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 105 ;; i
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 243 ;; ó
+ DB 039 ;; '
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 244 ;; ô
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 148 ;; ”
+ DB 073 ;; I
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 242 ;; ò
+ DB 039 ;; '
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfur096.asm b/private/mvdm/dos/v86/dev/keyboard/kdfur096.asm
new file mode 100644
index 000000000..d72d1a88d
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfur096.asm
@@ -0,0 +1,798 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC UR3_LOGIC ;;
+ PUBLIC UR3_866_XLAT ;;
+ PUBLIC UR3_437_XLAT ;;
+ PUBLIC UR3_850_XLAT ;;
+ PUBLIC UR3_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; UR3 State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+UR3_LOGIC: ;;
+ ;;
+ DW LOGIC3_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + shift
+ ENDIFF ;;
+ ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC3_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; UR 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 UR3_COMMON_XLAT ;;
+UR3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON3_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM3_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 29 ;; scan code
+ FLAG RUS_MODE ;; flag bit to set
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM3_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON3_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR3_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR3_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; UR Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR3_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0EFH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BDH ;; ©
+ DB 0A4H ;; æ
+ DB 0E7H ;; ã
+ DB 0C6H ;; ª
+ DB 0A8H ;; ¥
+ DB 0D4H ;; ­
+ DB 0ACH ;; £
+ DB 0F5H ;; è
+ DB 0F9H ;; é
+ DB 0F3H ;; §
+ DB 0B5H ;; å
+ DB 08CH ;; õ
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0AAH ;; ä
+ DB 08AH ;; i
+ DB 0EBH ;; ¢
+ DB 0A0H ;;  
+ DB 0D8H ;; ¯
+ DB 0E1H ;; à
+ DB 0D6H ;; ®
+ DB 0D0H ;; «
+ DB 0A6H ;; ¤
+ DB 0E9H ;; ¦
+ DB 086H ;; ó
+ DB 027H ;; '
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 0DEH ;; ï
+ DB 0FBH ;; ç
+ DB 0E3H ;; á
+ DB 0D2H ;; ¬
+ DB 0B7H ;; ¨
+ DB 0E5H ;; â
+ DB 0EDH ;; ì
+ DB 0A2H ;; ¡
+ DB 09CH ;; î
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 0BEH ;; ‰
+ DB 0A5H ;; –
+ DB 0E8H ;; “
+ DB 0C7H ;; Š
+ DB 0A9H ;; …
+ DB 0D5H ;;
+ DB 0ADH ;; ƒ
+ DB 0F6H ;; ˜
+ DB 0FAH ;; ™
+ DB 0F4H ;; ‡
+ DB 0B6H ;; •
+ DB 08DH ;; ô
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 0ABH ;; ”
+ DB 08BH ;; I
+ DB 0ECH ;; ‚
+ DB 0A1H ;; €
+ DB 0DDH ;;
+ DB 0E2H ;;
+ DB 0D7H ;; Ž
+ DB 0D1H ;; ‹
+ DB 0A7H ;; „
+ DB 0EAH ;; †
+ DB 087H ;; ò
+ DB 027H ;; '
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 45 ;; Scan code
+ DB 52 ;; range
+ DB 0FCH ;; —
+ DB 0E4H ;; ‘
+ DB 0D3H ;; Œ
+ DB 0B8H ;; ˆ
+ DB 0E6H ;; ’
+ DB 0EEH ;; œ
+ DB 0A3H ;;
+ DB 09DH ;; ž
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 44,0E0H ;; Ÿ
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; ********************************************* ;;
+;; * UR Specific Translate Section for 866 * ;;
+;; ********************************************* ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+UR3_866_XLAT: ;;
+ ;;
+ DW CP866_XLAT_END-$ ;; length of section
+ DW 866 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 1 ;; number of entries
+ DB 53,02EH ;; .
+CP866_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 7 ;; number of entries
+ DB 3,022H ;; "
+ DB 4,0FCH ;; NUMBER sign
+ DB 5,03BH ;; ;
+ DB 7,03AH ;; :
+ DB 8,03FH ;; ?
+ DB 43,02FH ;; /
+ DB 53,02CH ;; ,
+CP866_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP866_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0FDH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP866_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 169 ;; ©
+ DB 230 ;; æ
+ DB 227 ;; ã
+ DB 170 ;; ª
+ DB 165 ;; ¥
+ DB 173 ;; ­
+ DB 163 ;; £
+ DB 232 ;; è
+ DB 233 ;; é
+ DB 167 ;; §
+ DB 229 ;; å
+ DB 245 ;; õ
+CP866_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 34 ;; range
+ DB 228 ;; ä
+ DB 105 ;; i
+ DB 162 ;; ¢
+ DB 160 ;;  
+ DB 175 ;; ¯
+CP866_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 36 ;; Scan code
+ DB 41 ;; range
+ DB 174 ;; ®
+ DB 171 ;; «
+ DB 164 ;; ¤
+ DB 166 ;; ¦
+ DB 243 ;; ó
+ DB 039 ;; '
+CP866_A_LO_K1_T3_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 239 ;; ï
+ DB 231 ;; ç
+ DB 225 ;; á
+ DB 172 ;; ¬
+ DB 168 ;; ¨
+ DB 226 ;; â
+ DB 236 ;; ì
+ DB 161 ;; ¡
+ DB 238 ;; î
+CP866_A_LO_K1_T4_END: ;;
+ ;;
+ ;;
+ DW CP866_A_LO_K1_T5_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 35,0E0H ;; à
+CP866_A_LO_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 866
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP866_A_K1_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 CP866_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 137 ;; ‰
+ DB 150 ;; –
+ DB 147 ;; “
+ DB 138 ;; Š
+ DB 133 ;; …
+ DB 141 ;;
+ DB 131 ;; ƒ
+ DB 152 ;; ˜
+ DB 153 ;; ™
+ DB 135 ;; ‡
+ DB 149 ;; •
+ DB 244 ;; ô
+CP866_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 41 ;; range
+ DB 148 ;; ”
+ DB 073 ;; I
+ DB 130 ;; ‚
+ DB 128 ;; €
+ DB 143 ;;
+ DB 144 ;;
+ DB 142 ;; Ž
+ DB 139 ;; ‹
+ DB 132 ;; „
+ DB 134 ;; †
+ DB 242 ;; ò
+ DB 039 ;; '
+CP866_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP866_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 44 ;; Scan code
+ DB 52 ;; range
+ DB 159 ;; Ÿ
+ DB 151 ;; —
+ DB 145 ;; ‘
+ DB 140 ;; Œ
+ DB 136 ;; ˆ
+ DB 146 ;; ’
+ DB 156 ;; œ
+ DB 129 ;;
+ DB 158 ;; ž
+CP866_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP866_A_K1_UP_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP866_XLAT_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfyc116.asm b/private/mvdm/dos/v86/dev/keyboard/kdfyc116.asm
new file mode 100644
index 000000000..5a1bc6a85
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfyc116.asm
@@ -0,0 +1,1120 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC YC1_LOGIC ;;
+;; PUBLIC YC1_866_XLAT ;;
+ PUBLIC YC1_437_XLAT ;;
+ PUBLIC YC1_850_XLAT ;;
+;; PUBLIC YC1_852_XLAT ;;
+ PUBLIC YC1_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; YC State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+YC1_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <CTRL + Left SHIFT> and
+;; <CTRL+Right SHIFT> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL ;;
+ IFF LEFT_SHIFT ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ENDIFF ;;
+ IFF RIGHT_SHIFT ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL,NOT ;;
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;;
+; IFF CAPS_STATE
+; SET_FLAG DEAD_UPPER
+; ELSEF
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+; 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 ;;
+ ;;
+
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ RESET_NLS1 ;;
+ 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+NON_DEAD: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ELSEF
+ IFF LC_E0, NOT
+ IFF EITHER_SHIFT ;;
+ XLATT NON_ALPHA_UPPER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ENDIFF ;;
+ ELSEF ;;
+ XLATT NON_ALPHA_LOWER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+; IFKBD XT_KB+AT_KB,NOT ;; XT, AT, keyboards.
+; IFF EITHER_SHIFT ;; only.
+; XLATT THIRD_SHIFT ;; ALT + shift
+; ENDIFF ;;
+; ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+; ENDIFF ;;
+ ENDIFF ;;
+ ELSEF
+ IFF EITHER_ALT,NOT ;;
+ XLATT CTRL_CASE
+ ELSEF ;;
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT,NOT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + Ctrl
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; YC 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 YC1_COMMON_XLAT ;;
+YC1_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 12 ;;
+ FLAG ACUTE ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 0 ;; number of entries
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CZ_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 0 ;; number of entries
+ ;;
+COM_CZ_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: G_KB
+;; 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 2 ;; number of entries
+ DB 34,082H ;; 022h
+ DB 37,096H ;; 025h
+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: G_KB
+;; 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 entries
+ DB 34,083H ;; 022h
+ DB 37,097H ;; 025h
+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: P12_KB+G_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC1_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ DW CP437_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP437_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP437_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC1_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ DW CP850_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP850_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP850_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC1_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP855_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 090H ;; 010H
+ DB 092H ;; 011H
+ DB 0A8H ;; 012H
+ DB 0E1H ;; 013H
+ DB 0E5H ;; 014H
+ DB 0F3H ;; 015H
+ DB 0E7H ;; 016H
+ DB 0B7H ;; 017H
+ DB 0D6H ;; 018H
+ DB 0D8H ;; 019H
+ DB 0F5H ;; 01AH
+ DB 080H ;; 01BH
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A0H ;; 01EH
+ DB 0E3H ;; 01Fh
+ DB 0A6H ;; 020H
+ DB 0AAH ;; 021H
+ DB 0ACH ;; 022H
+ DB 0B5H ;; 023H
+ DB 08EH ;; 024H
+ DB 0C6H ;; 025H
+ DB 0D0H ;; 026H
+ DB 0FBH ;; 027H
+ DB 094H ;; 028H
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0E9H ;; 02BH
+ DB 088H ;; 02CH
+ DB 09AH ;; 02DH
+ DB 0A4H ;; 02EH
+ DB 0EBH ;; 02FH
+ DB 0A2H ;; 030H
+ DB 0D4H ;; 031H
+ DB 0D2H ;; 032H
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 091H ;; 010H
+ DB 093H ;; 011H
+ DB 0A9H ;; 012H
+ DB 0E2H ;; 013H
+ DB 0E6H ;; 014H
+ DB 0F4H ;; 015H
+ DB 0E8H ;; 016H
+ DB 0B8H ;; 017H
+ DB 0D7H ;; 018H
+ DB 0DDH ;; 019H
+ DB 0F6H ;; 01AH
+ DB 081H ;; 01BH
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A1H ;; 01EH
+ DB 0E4H ;; 01Fh
+ DB 0A7H ;; 020H
+ DB 0ABH ;; 021H
+ DB 0ADH ;; 022H
+ DB 0B6H ;; 023H
+ DB 08FH ;; 024H
+ DB 0C7H ;; 025H
+ DB 0D1H ;; 026H
+ DB 0FCH ;; 027H
+ DB 095H ;; 028H
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0EAH ;; 02BH
+ DB 089H ;; 02CH
+ DB 09BH ;; 02DH
+ DB 0A5H ;; 02EH
+ DB 0ECH ;; 02FH
+ DB 0A3H ;; 030H
+ DB 0D5H ;; 031H
+ DB 0D3H ;; 032H
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfyc117.asm b/private/mvdm/dos/v86/dev/keyboard/kdfyc117.asm
new file mode 100644
index 000000000..30ef24765
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfyc117.asm
@@ -0,0 +1,1120 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC YC2_LOGIC ;;
+;; PUBLIC YC2_866_XLAT ;;
+ PUBLIC YC2_437_XLAT ;;
+ PUBLIC YC2_850_XLAT ;;
+;; PUBLIC YC2_852_XLAT ;;
+ PUBLIC YC2_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; YC State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+YC2_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT SHIFT + LEFT SHIFT> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF RIGHT_SHIFT ;;
+ ANDF LEFT_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL,NOT ;;
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;;
+; IFF CAPS_STATE
+; SET_FLAG DEAD_UPPER
+; ELSEF
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+; 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 ;;
+ ;;
+
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ RESET_NLS1 ;;
+ 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+NON_DEAD: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ELSEF
+ IFF LC_E0, NOT
+ IFF EITHER_SHIFT ;;
+ XLATT NON_ALPHA_UPPER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ENDIFF ;;
+ ELSEF ;;
+ XLATT NON_ALPHA_LOWER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+; IFKBD XT_KB+AT_KB,NOT ;; XT, AT, keyboards.
+; IFF EITHER_SHIFT ;; only.
+; XLATT THIRD_SHIFT ;; ALT + shift
+; ENDIFF ;;
+; ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+; ENDIFF ;;
+ ENDIFF ;;
+ ELSEF
+ IFF EITHER_ALT,NOT ;;
+ XLATT CTRL_CASE
+ ELSEF ;;
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT,NOT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + Ctrl
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; YC 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 YC2_COMMON_XLAT ;;
+YC2_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 12 ;;
+ FLAG ACUTE ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 0 ;; number of entries
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CZ_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 0 ;; number of entries
+ ;;
+COM_CZ_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: G_KB
+;; 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 2 ;; number of entries
+ DB 34,082H ;; 022h
+ DB 37,096H ;; 025h
+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: G_KB
+;; 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 entries
+ DB 34,083H ;; 022h
+ DB 37,097H ;; 025h
+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: P12_KB+G_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC2_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ DW CP437_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP437_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP437_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC2_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ DW CP850_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP850_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP850_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC2_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP855_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 090H ;; 010H
+ DB 092H ;; 011H
+ DB 0A8H ;; 012H
+ DB 0E1H ;; 013H
+ DB 0E5H ;; 014H
+ DB 0F3H ;; 015H
+ DB 0E7H ;; 016H
+ DB 0B7H ;; 017H
+ DB 0D6H ;; 018H
+ DB 0D8H ;; 019H
+ DB 0F5H ;; 01AH
+ DB 080H ;; 01BH
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A0H ;; 01EH
+ DB 0E3H ;; 01Fh
+ DB 0A6H ;; 020H
+ DB 0AAH ;; 021H
+ DB 0ACH ;; 022H
+ DB 0B5H ;; 023H
+ DB 08EH ;; 024H
+ DB 0C6H ;; 025H
+ DB 0D0H ;; 026H
+ DB 0FBH ;; 027H
+ DB 094H ;; 028H
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0E9H ;; 02BH
+ DB 088H ;; 02CH
+ DB 09AH ;; 02DH
+ DB 0A4H ;; 02EH
+ DB 0EBH ;; 02FH
+ DB 0A2H ;; 030H
+ DB 0D4H ;; 031H
+ DB 0D2H ;; 032H
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 091H ;; 010H
+ DB 093H ;; 011H
+ DB 0A9H ;; 012H
+ DB 0E2H ;; 013H
+ DB 0E6H ;; 014H
+ DB 0F4H ;; 015H
+ DB 0E8H ;; 016H
+ DB 0B8H ;; 017H
+ DB 0D7H ;; 018H
+ DB 0DDH ;; 019H
+ DB 0F6H ;; 01AH
+ DB 081H ;; 01BH
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A1H ;; 01EH
+ DB 0E4H ;; 01Fh
+ DB 0A7H ;; 020H
+ DB 0ABH ;; 021H
+ DB 0ADH ;; 022H
+ DB 0B6H ;; 023H
+ DB 08FH ;; 024H
+ DB 0C7H ;; 025H
+ DB 0D1H ;; 026H
+ DB 0FCH ;; 027H
+ DB 095H ;; 028H
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0EAH ;; 02BH
+ DB 089H ;; 02CH
+ DB 09BH ;; 02DH
+ DB 0A5H ;; 02EH
+ DB 0ECH ;; 02FH
+ DB 0A3H ;; 030H
+ DB 0D5H ;; 031H
+ DB 0D3H ;; 032H
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfyc118.asm b/private/mvdm/dos/v86/dev/keyboard/kdfyc118.asm
new file mode 100644
index 000000000..495a0ea64
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfyc118.asm
@@ -0,0 +1,1119 @@
+ PAGE 118,132
+ TITLE DOS - Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS - - NLS Support - Keyboard Definition File
+;; (c) Copyright 1988 Microsoft
+;;
+;; This file contains the keyboard tables for Russia
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC YC3_LOGIC ;;
+;; PUBLIC YC3_866_XLAT ;;
+ PUBLIC YC3_437_XLAT ;;
+ PUBLIC YC3_850_XLAT ;;
+;; PUBLIC YC3_852_XLAT ;;
+ PUBLIC YC3_855_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
+ENX_KBD EQU G_KB+P12_KB
+ ;;
+ ;;
+DEBUG EQU 0 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;;
+;; YC State Logic
+;;
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ ;;
+YC3_LOGIC: ;;
+ ;;
+ DW LOGIC_END-$ ;; length
+ ;;
+ DW SHIFTS_TO_LOGIC+SWITCHABLE ;; 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 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Mode change CHECK
+;;
+;; MODE CHANGE BY <RIGHT CTRL> PRESS
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ IFF SHIFTS_PRESSED ;;
+ IFF EITHER_SHIFT,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ ANDF R_CTL_SHIFT ;;
+ IFF RUS_MODE ;;
+ BEEP ;;
+ RESET_NLS ;;
+ ELSEF ;;
+ BEEP ;;
+ SET_FLAG RUS_MODE_SET ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ EXIT_STATE_LOGIC ;;
+ ENDIFF ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IFF EITHER_ALT,NOT ;;
+ ANDF EITHER_CTL,NOT ;;
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;;
+; IFF CAPS_STATE
+; SET_FLAG DEAD_UPPER
+; ELSEF
+ IFF EITHER_SHIFT ;;
+ SET_FLAG DEAD_UPPER ;;
+ ELSEF ;;
+ SET_FLAG DEAD_LOWER ;;
+ ENDIFF ;;
+; 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 ;;
+ ;;
+
+ ;;
+ IFF ACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ RESET_NLS1 ;;
+ 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.
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;
+NON_DEAD: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Upper, lower and third shifts
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ ;;
+ IFF EITHER_CTL,NOT ;; Lower and upper case. Alphabetic
+ IFF EITHER_ALT,NOT ;; keys are affected by CAPS LOCK.
+ IFF RUS_MODE ;;
+ ANDF LC_E0,NOT ;; Enhanced keys are not
+ 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 ;; Third and Fourth shifts
+ ELSEF
+ IFF LC_E0, NOT
+ IFF EITHER_SHIFT ;;
+ XLATT NON_ALPHA_UPPER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ENDIFF ;;
+ ELSEF ;;
+ XLATT NON_ALPHA_LOWER_LAT ;;
+ IFF CAPS_STATE ;;
+ XLATT ALPHA_UPPER_LAT ;;
+ ELSEF ;;
+ XLATT ALPHA_LOWER_LAT ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF
+ ENDIFF ;;
+ ELSEF ;; ctl off, alt on at this point
+; IFKBD XT_KB+AT_KB,NOT ;; XT, AT, keyboards.
+; IFF EITHER_SHIFT ;; only.
+; XLATT THIRD_SHIFT ;; ALT + shift
+; ENDIFF ;;
+; ELSEF ;; ENHANCED keyboard
+ IFF R_ALT_SHIFT ;; ALTGr
+ ANDF EITHER_SHIFT,NOT ;;
+ XLATT THIRD_SHIFT ;;
+ ENDIFF ;;
+; ENDIFF ;;
+ ENDIFF ;;
+ ELSEF
+ IFF EITHER_ALT,NOT ;;
+ XLATT CTRL_CASE
+ ELSEF ;;
+ IFKBD XT_KB+AT_KB ;; XT, AT, keyboards.
+ IFF EITHER_SHIFT,NOT ;; only.
+ XLATT THIRD_SHIFT ;; ALT + Ctrl
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF
+ ENDIFF ;;
+ ;;
+;**************************************;;
+ ;;
+ EXIT_STATE_LOGIC ;;
+ ;;
+LOGIC_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; YC 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 YC3_COMMON_XLAT ;;
+YC3_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;; code page
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_lower
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 12 ;;
+ FLAG ACUTE ;;
+ ;;
+COM_PL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: low shift Dead_UPPER
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_PL_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 0 ;; number of entries
+ ;;
+COM_PL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CZ_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 0 ;; number of entries
+ ;;
+COM_CZ_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: G_KB
+;; 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 2 ;; number of entries
+ DB 34,082H ;; 022h
+ DB 37,096H ;; 025h
+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: G_KB
+;; 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 entries
+ DB 34,083H ;; 022h
+ DB 37,097H ;; 025h
+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: P12_KB+G_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 027H,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,027H ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ctrl Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Any
+;; STATE: RUS_MODE
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_F1_END-$ ;; length of state section
+ DB RUS_MODE_SET ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ ;; Set Flag Table
+ DW 3 ;; number of entries
+ DB 42 ;; scan code (Left Shift)
+ FLAG LAT_MODE ;; flag bit to set
+ DB 54 ;; scan code (Right Shift)
+ FLAG RUS_MODE ;; flag bit to set
+ DB 29 ;; scan code (Ctrl)
+ FLAG RUS_MODE ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_F1_END: ;;
+ ;;
+ ;;
+ ;;
+ ;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;;
+ ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 437
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC3_437_XLAT: ;;
+ ;;
+ DW CP437_XLAT_END-$ ;; length of section
+ DW 437 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 13 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP437_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_TS_END: ;;
+ ;;
+ DW CP437_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP437_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP437_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 437
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP437_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP437_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP437_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP437_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP437_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 850
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC3_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;; length of section
+ DW 850 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP850_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_TS_END: ;;
+ ;;
+ DW CP850_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP850_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+CP850_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP850_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+CP850_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YC Specific Translate Section for 855
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+YC3_855_XLAT: ;;
+ ;;
+ DW CP855_XLAT_END-$ ;; length of section
+ DW 855 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_K1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_K1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 6 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+CP855_NA_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_K1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NA_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 12 ;; number of entries
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+CP855_NA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW CP855_NA_Y1_LO_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NA_LO_Y1_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 11 ;; number of entries
+ DB 51, 02CH ;; 033H
+ DB 52, 02EH ;; 034H
+ DB 53, 02DH ;; 035H
+ DB 12, 027H ;; 0CH
+ DB 13, 02BH ;; 0DH
+ DB 86, 03Ch ;; 056H
+ DB 26, 05Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 07Ch ;; 027H
+ DB 40, 05Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NA_LO_Y1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NA_Y1_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Non-Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_NY_UP_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_NY_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 17 ;; number of entrie
+ DB 51, 03BH ;; 033H
+ DB 52, 03AH ;; 034H
+ DB 53, 05FH ;; 035H
+ DB 12, 03FH ;; 0CH
+ DB 13, 02AH ;; 0DH
+ DB 86, 03EH ;; 056H
+ DB 3, 022H ;; 03h
+ DB 7, 026H ;; 07h
+ DB 8, 02FH ;; 08h
+ DB 9, 028H ;; 09h
+ DB 10, 029H ;; 0ah
+ DB 11, 03dH ;; 0bh
+ DB 26, 07Bh ;; 01AH
+ DB 27, 05Ch ;; 01BH
+ DB 39, 05Eh ;; 027H
+ DB 40, 07Dh ;; 028H
+ DB 43, 040h ;; 02BH
+CP855_NY_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_NY_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_END-$ ;; length of state section
+ DB ALPHA_LOWER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_LO_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_END-$ ;; length of state section
+ DB ALPHA_UPPER_LAT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_AL_UP_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Third Shift
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_TS_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP855_TS_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 14 ;; number of entries
+ DB 03H,040H ;; @
+ DB 04H,023H ;; #
+ DB 05H,0CFH ;; RUBLES sign ý
+ DB 07H,05EH ;; ^
+ DB 08H,026H ;; &
+ DB 09H,024H ;; $
+ DB 0AH,03CH ;; <
+ DB 0BH,03EH ;; >
+ DB 1AH,05BH ;; [
+ DB 1BH,05DH ;; ]
+ DB 2BH,07CH ;; |
+ DB 33H,03CH ;; <
+ DB 34H,03EH ;; >
+ DB 35H,02FH ;; /
+CP855_TS_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_TS_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_LO_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 090H ;; 010H
+ DB 092H ;; 011H
+ DB 0A8H ;; 012H
+ DB 0E1H ;; 013H
+ DB 0E5H ;; 014H
+ DB 0F3H ;; 015H
+ DB 0E7H ;; 016H
+ DB 0B7H ;; 017H
+ DB 0D6H ;; 018H
+ DB 0D8H ;; 019H
+ DB 0F5H ;; 01AH
+ DB 080H ;; 01BH
+CP855_A_LO_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A0H ;; 01EH
+ DB 0E3H ;; 01Fh
+ DB 0A6H ;; 020H
+ DB 0AAH ;; 021H
+ DB 0ACH ;; 022H
+ DB 0B5H ;; 023H
+ DB 08EH ;; 024H
+ DB 0C6H ;; 025H
+ DB 0D0H ;; 026H
+ DB 0FBH ;; 027H
+ DB 094H ;; 028H
+CP855_A_LO_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_LO_K1_T4_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0E9H ;; 02BH
+ DB 088H ;; 02CH
+ DB 09AH ;; 02DH
+ DB 0A4H ;; 02EH
+ DB 0EBH ;; 02FH
+ DB 0A2H ;; 030H
+ DB 0D4H ;; 031H
+ DB 0D2H ;; 032H
+CP855_A_LO_K1_T4_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_LO_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 855
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: All
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP855_A_K1_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 CP855_A_UP_K1_T1_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 16 ;; Scan code
+ DB 27 ;; range
+ DB 091H ;; 010H
+ DB 093H ;; 011H
+ DB 0A9H ;; 012H
+ DB 0E2H ;; 013H
+ DB 0E6H ;; 014H
+ DB 0F4H ;; 015H
+ DB 0E8H ;; 016H
+ DB 0B8H ;; 017H
+ DB 0D7H ;; 018H
+ DB 0DDH ;; 019H
+ DB 0F6H ;; 01AH
+ DB 081H ;; 01BH
+CP855_A_UP_K1_T1_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T2_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 30 ;; Scan code
+ DB 40 ;; range
+ DB 0A1H ;; 01EH
+ DB 0E4H ;; 01Fh
+ DB 0A7H ;; 020H
+ DB 0ABH ;; 021H
+ DB 0ADH ;; 022H
+ DB 0B6H ;; 023H
+ DB 08FH ;; 024H
+ DB 0C7H ;; 025H
+ DB 0D1H ;; 026H
+ DB 0FCH ;; 027H
+ DB 095H ;; 028H
+CP855_A_UP_K1_T2_END: ;;
+ ;;
+ ;;
+ DW CP855_A_UP_K1_T3_END-$ ;; Size of xlat table
+ DB ASCII_ONLY ;; xlat options:
+ DB 43 ;; Scan code
+ DB 50 ;; range
+ DB 0EAH ;; 02BH
+ DB 089H ;; 02CH
+ DB 09BH ;; 02DH
+ DB 0A5H ;; 02EH
+ DB 0ECH ;; 02FH
+ DB 0A3H ;; 030H
+ DB 0D5H ;; 031H
+ DB 0D3H ;; 032H
+CP855_A_UP_K1_T3_END: ;;
+ ;;
+ ;;
+CP855_A_UP_K1_T5_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP855_A_K1_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP855_XLAT_END: ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;;
+ END ;;
+
diff --git a/private/mvdm/dos/v86/dev/keyboard/kdfyu.asm b/private/mvdm/dos/v86/dev/keyboard/kdfyu.asm
new file mode 100644
index 000000000..4f8e14742
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/kdfyu.asm
@@ -0,0 +1,2262 @@
+ PAGE ,132
+ TITLE PC DOS 3.3 Keyboard Definition File
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; PC DOS 3.3 - NLS Support - Keyboard Definition File
+;; (c) Copyright IBM Corp 1986,1987
+;;
+;; This file contains the keyboard tables for Yugoslavia (ID234)
+;;
+;; Linkage Instructions:
+;; Refer to KDF.ASM.
+;;
+;;
+;; WRITTEN: MJS 22.SEPTEMBER 1987
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ INCLUDE KEYBSHAR.INC ;;
+ INCLUDE POSTEQU.INC ;;
+ INCLUDE KEYBMAC.INC ;;
+ ;;
+ PUBLIC YU_LOGIC ;;
+ PUBLIC YU_850_XLAT ;;
+ PUBLIC YU_852_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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;***************************************
+;; YU State Logic
+;;***************************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ ;;
+YU_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 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 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_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.
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CEDILLA ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CEDILLA_PROC: ;;
+ ;;
+ IFF CEDILLA,NOT ;;
+ GOTO DIARESIS_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_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 850 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_SPACE ;; 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 CARON_PROC ;;
+ 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 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CARON ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CARON_PROC: ;;
+ ;;
+ IFF CARON,NOT ;;
+ GOTO BREVE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT CARON_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT CARON_LOWER ;;
+ ELSEF ;;
+ XLATT CARON_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_CARON: ;;
+ PUT_ERROR_CHAR CARON_LOWER ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; BREVE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+BREVE_PROC: ;;
+ ;;
+ IFF BREVE,NOT ;;
+ GOTO OVERCIRCLE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT BREVE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT BREVE_LOWER ;;
+ ELSEF ;;
+ XLATT BREVE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_BREVE: ;;
+ PUT_ERROR_CHAR BREVE_LOWER ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERCIRCLE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERCIRCLE_PROC: ;;
+ ;;
+ IFF OVERCIRCLE,NOT ;;
+ GOTO OGONEK_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERCIRCLE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERCIRCLE_LOWER ;;
+ ELSEF ;;
+ XLATT OVERCIRCLE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERCIRCLE: ;;
+ PUT_ERROR_CHAR OVERCIRCLE_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OGONEK ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OGONEK_PROC: ;;
+ ;;
+ IFF OGONEK,NOT ;;
+ GOTO OVERDOT_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OGONEK_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OGONEK_LOWER ;;
+ ELSEF ;;
+ XLATT OGONEK_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OGONEK: ;;
+ PUT_ERROR_CHAR OGONEK_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; OVERDOT ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+OVERDOT_PROC: ;;
+ ;;
+ IFF OVERDOT,NOT ;;
+ GOTO DOUBLEACUTE_PROC ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT OVERDOT_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT OVERDOT_LOWER ;;
+ ELSEF ;;
+ XLATT OVERDOT_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_OVERDOT: ;;
+ PUT_ERROR_CHAR OVERDOT_SPACE ;; standalone accent
+ BEEP ;; Invalid dead key combo.
+ GOTO NON_DEAD ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOUBLEACUTE ACCENT TRANSLATIONS
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+DOUBLEACUTE_PROC: ;;
+ ;;
+ IFF DOUBLEACUTE,NOT ;;
+ GOTO NON_DEAD ;;
+ ENDIFF ;;
+ ;;
+ RESET_NLS ;;
+ IFF R_ALT_SHIFT,NOT ;;
+ XLATT DOUBLEACUTE_SPACE ;;
+ ENDIFF ;;
+ IFF EITHER_CTL,NOT ;;
+ ANDF EITHER_ALT,NOT ;;
+ IFF EITHER_SHIFT ;;
+ IFF CAPS_STATE ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ELSEF ;;
+ IFF CAPS_STATE,NOT ;;
+ XLATT DOUBLEACUTE_LOWER ;;
+ ELSEF ;;
+ XLATT DOUBLEACUTE_UPPER ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ENDIFF ;;
+ ;;
+INVALID_DOUBLEACUTE: ;;
+ PUT_ERROR_CHAR DOUBLEACUTE_SPACE ;; 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
+;*******************************************
+ 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 ;;
+ 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: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;**********************************************************************
+;; YU 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 YU_COMMON_XLAT ;;
+YU_COMMON_XLAT: ;;
+ ;;
+ DW COMMON_XLAT_END-$ ;; length of section
+ DW -1 ;;
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Low Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_YU_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
+ ;; Set Flag Table
+ DW 1 ;; number of entries
+ DB 41 ;;
+ FLAG DIARESIS ;; flag bit to set
+ ;;
+COM_YU_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Up Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_YU_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 41 ;; scan code
+ FLAG CEDILLA ;; flag bit to set
+ ;;
+COM_YU_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Third Shift Dead Key
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Flag Table
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_YU_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 10 ;; number of entries
+;; DB 2 ;; TILDE IS NOT AN ACCENT KEY
+;; FLAG TILDE ;;
+ DB 3 ;;
+ FLAG CARON ;;
+ DB 4 ;;
+ FLAG CIRCUMFLEX ;;
+ DB 5 ;;
+ FLAG BREVE ;;
+ DB 6 ;;
+ FLAG OVERCIRCLE ;;
+ DB 7 ;;
+ FLAG OGONEK ;;
+;; DB 8 ;; GRAVE IS NOT AN ACCENT KEY (YST)
+;; FLAG GRAVE ;;
+ DB 9 ;;
+ FLAG OVERDOT ;;
+ DB 10 ;;
+ FLAG ACUTE ;;
+ DB 11 ;;
+ FLAG DOUBLEACUTE ;;
+ DB 12 ;;
+ FLAG DIARESIS ;;
+ DB 13 ;;
+ FLAG CEDILLA ;;
+ ;;
+COM_YU_TH_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;******************************
+;;***BD - ADDED FOR NUMERIC PAD (DECIMAL SEPERATOR)
+;;******************************
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Numeric Key Pad
+;; KEYBOARD TYPES: ANY_KB
+;; 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
+;; 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
+ DB 21,0,2CH ;;
+ DB 44,0,15H ;;
+ DB 53,0,82H ;;
+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
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CTRL_K2_END-$ ;; length of state section
+ DB CTRL_CASE ;; State ID
+ DW ANY_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 3 ;; number of entries
+ DB 21,01AH,2CH ;;
+ DB 44,019H,15H ;;
+ DB 53,01FH,0CH ;;
+COM_CTRL_K2_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CTRL_K2_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_LO_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"z",2CH ;;
+ DB 44,"y",15H ;;
+COM_AL_LO_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_LO_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_AL_UP_K1_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_K1_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 2 ;; number of entries
+ DB 21,"Z",2CH ;;
+ DB 44,"Y",15H ;;
+COM_AL_UP_K1_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_AL_UP_K1_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Non-Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_LO_K1_END-$ ;; length of state section
+ DB NON_ALPHA_LOWER ;; State ID
+ DW ANY_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,"'" ;; '
+ DB 13,"+" ;; +
+ 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 Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_NA_UP_K1_END-$ ;; length of state section
+ DB NON_ALPHA_UPPER ;; State ID
+ DW ANY_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 13,'*' ;;
+ 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: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW COM_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 17 ;; number of entries
+ DB 2,'~',02H ;;
+ DB 8,'`',08H ;;
+ DB 16,'\',10H ;;
+ DB 17,'|',11H ;;
+ DB 18,'ö',12H ;;
+ DB 21,0E1H,15H ;; SHARP S
+ DB 23,'<',17H ;;
+ DB 24,'>',18H ;;
+ DB 26,'ö',1AH ;;
+ DB 33,'[',21H ;;
+ DB 34,']',22H ;;
+ DB 40,0E1H,28H ;; Sharp S
+ DB 47,'@',2FH ;;
+ DB 48,'{',30H ;;
+ DB 49,'}',31H ;;
+ DB 51,'<',33H ;;
+ DB 52,'>',34H ;;
+COM_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+COM_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CA_SP_END-$ ;; length of state section
+ DB CARON_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CA_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F3H ;; Caron Space
+COM_CA_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CA_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COM
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_BR_SP_END-$ ;; length of state section
+ DB BREVE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW COM_BR_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F4H ;; BREVE SPACE
+COM_BR_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_BR_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OG_SP_END-$ ;; length of state section
+ DB OGONEK_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OG_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F2H ;; OGONEK SPACE
+COM_OG_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OG_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_DC_SP_END-$ ;; length of state section
+ DB DOUBLEACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW COM_DC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F1H ;; DOUBLEACUTE SPACE
+COM_DC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_DC_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; 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 3 ;; number of scans
+ DB 23,'Œ' ;; " " , " - 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: ANY_KB
+;; 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: Overcircle Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OC_SP_END-$ ;; length of state section
+ DB OVERCIRCLE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW COM_OC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0F8H ;; STANDALONE OVERCIRCLE
+COM_OC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_OC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Grave Space Bar
+;; KEYBOARD TYPES: ANY_KB
+;; 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: Overdot
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_OD_SP_END-$ ;; length of state section
+ DB OVERDOT_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW COM_OD_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0FAH ;; STANDALONE OVERDOT
+COM_OD_SP_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+COM_OD_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: Common
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of entries
+ DB 18,082H ;; e acute
+ DB 22,0A3H ;; u acute
+ DB 23,0A1H ;; i acute
+ DB 24,0A2H ;; o acute
+ DB 30,0A0H ;; a acute
+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: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 18,090H ;; E acute
+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: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 COM_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+COM_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+COM_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'‡' ;; scan code,ASCII - ‡
+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: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 46,'€' ;; € CEDILLA
+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
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_CE_SP_END-$ ;; length of state section
+ DB CEDILLA_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW COM_CE_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of entries
+ DB 57,0F7H ;; CEDILLA SPACE
+COM_CE_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+COM_CE_SP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: COMMON
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 4 ;; number of scans
+ DB 18,'‰' ;; scan code,ASCII - e
+ DB 22,'' ;; scan code,ASCII - u
+ DB 24,'”' ;; scan code,ASCII - o
+ DB 30,'„' ;; scan code,ASCII - a
+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: ANY_KB
+;; 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 22,'š' ;; U Diaeresis
+ DB 24,'™' ;; O Diaeresis
+ DB 30,'Ž' ;; A Diaeresis
+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_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW COM_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 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
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; Last State
+COMMON_XLAT_END: ;; END OF COMMON SECTION
+ ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 850 YUGOSLAV SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC YU_850_XLAT ;;
+YU_850_XLAT: ;;
+ ;;
+ DW CP850_XLAT_END-$ ;;
+ DW 850 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_LO_END-$ ;; length of state section
+ DB ALPHA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 39,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 40,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 43,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AL_UP_END-$ ;; length of state section
+ DB ALPHA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB -1,-1 ;; error character = standalone accent
+ ;;
+ DW CP850_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 27,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 39,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 40,-1 ;; BLOT OUT CHAR UNDER 850
+ DB 43,-1 ;; BLOT OUT CHAR UNDER 850
+CP850_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: CP850
+;; STATE: Circumflex Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_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 CP850_CI_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,88H ;; e CIRCUMFLEX
+ DB 23,8CH ;; i CIRCUMFLEX
+CP850_CI_LO_T1_END: ;;
+ ;;
+ DW 0 ;;
+ ;;
+CP850_CI_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,86H ;; a OVERCIRCLE
+CP850_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Overcircle Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,8FH ;; A OVERCIRCLE
+CP850_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Grave Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_GR_LO_END-$ ;; length of state section
+ DB GRAVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 060H,0 ;; error character = standalone accent
+ ;;
+ DW CP850_GR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 5 ;; number of scans
+ DB 18,8AH ;; e GRAVE
+ DB 22,97H ;; u GRAVE
+ DB 23,8DH ;; i GRAVE
+ DB 24,95H ;; o GRAVE
+ DB 30,85H ;; a GRAVE
+CP850_GR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP850_GR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP850_AC_SP_END-$ ;; length of state section
+ DB ACUTE_SPACE ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 27H,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,27H ;; error character = standalone accent
+CP850_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP850_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 850
+;; STATE: Diaresis Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; 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 1 ;; number of scans
+ DB 16,8BH ;; i DIARESIS
+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 Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; 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
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ DW 0 ;; LAST STATE
+ ;;
+CP850_XLAT_END: ;; END OF CP850 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; CODE PAGE 852 YUGOSLAV SPECIFIC TRANSLATION
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC YU_852_XLAT ;;
+YU_852_XLAT: ;;
+ ;;
+ DW CP852_XLAT_END-$ ;;
+ DW 852 ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Lower Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,0E7H ;; s CARON
+ DB 27,0D0H ;; d STROKE
+ DB 39,09FH ;; c CARON
+ DB 40,086H ;; c ACUTE
+ DB 43,0A7H ;; z CARON
+CP852_AL_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Alpha Upper Case
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AL_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE ;; xlat options:
+ DB 5 ;; number of entries
+ DB 26,0E6H ;; S CARON
+ DB 27,0D1H ;; D STROKE
+ DB 39,0ACH ;; C CARON
+ DB 40,08FH ;; C ACUTE
+ DB 43,0A6H ;; Z CARON
+CP852_AL_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AL_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Third Shift
+;; KEYBOARD TYPES: G
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_THIRD_END-$ ;; length of state section
+ DB THIRD_SHIFT ;; State ID
+ DW ANY_KB ;; Keyboard Type FERRARI
+ DB -1,-1 ;; Buffer entry for error character
+ ;;
+ DW CP852_THIRD_T1_END-$ ;; Size of xlat table
+ DB TYPE_2_TAB ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,09EH,13H ;;
+ DB 22,0CFH,16H ;; CURRENCY SYMBOL
+ DB 27,09EH,1BH ;;
+ DB 37,088H,25H ;;
+ DB 38,09DH,26H ;;
+ DB 43,0CFH,2BH ;;
+ DB 50,0F5H,32H ;;
+CP852_THIRD_T1_END: ;;
+ ;;
+ DW 0 ;; Last xlat table
+CP852_THIRD_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_LO_END-$ ;; length of state section
+ DB CARON_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0D8H ;; e CARON
+ DB 19,0FDH ;; r CARON
+ DB 20,09CH ;; t CARON
+ DB 21,0A7H ;; z CARON
+ DB 31,0E7H ;; s CARON
+ DB 32,0D4H ;; d CARON
+ DB 38,096H ;; l CARON
+ DB 46,09FH ;; c CARON
+ DB 49,0E5H ;; n CARON
+CP852_CA_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CA_UP_END-$ ;; length of state section
+ DB CARON_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F3H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CA_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 9 ;; number of scans
+ DB 18,0B7H ;; E CARON
+ DB 19,0FCH ;; R CARON
+ DB 20,09BH ;; T CARON
+ DB 21,0A6H ;; Z CARON
+ DB 31,0E6H ;; S CARON
+ DB 32,0D2H ;; D CARON
+ DB 38,095H ;; L CARON
+ DB 46,0ACH ;; C CARON
+ DB 49,0D5H ;; N CARON
+CP852_CA_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CA_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Caron Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CA_SP_END-$ ;; length of state section
+;; DB CARON_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F3H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CA_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F3H ;; e CARON
+;;CP852_CA_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CA_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Circumflex Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CI_UP_END-$ ;; length of state section
+ DB CIRCUMFLEX_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 05EH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 3 ;; number of scans
+ DB 23,0D7H ;; I CIRCUMFLEX
+ DB 24,0E2H ;; O CIRCUMFLEX
+ DB 30,0B6H ;; A CIRCUMFLEX
+CP852_CI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_LO_END-$ ;; length of state section
+ DB BREVE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C7H ;; a BREVE
+CP852_BR_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_BR_UP_END-$ ;; length of state section
+ DB BREVE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F4H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_BR_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 30,0C6H ;; A BREVE
+CP852_BR_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_BR_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Breve Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_BR_SP_END-$ ;; length of state section
+;; DB BREVE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F4H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_BR_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F4H ;; BREVE SPACE
+;;CP852_BR_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_BR_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcirle Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_LO_END-$ ;; length of state section
+ DB OVERCIRCLE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,085H ;; u OVERCIRCLE
+CP852_OC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overcircle Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OC_UP_END-$ ;; length of state section
+ DB OVERCIRCLE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F8H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 22,0DEH ;; O OVERCIRCLE
+CP852_OC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OC_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_LO_END-$ ;; length of state section
+ DB OGONEK_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A9H ;; e OGONEK
+ DB 30,0A5H ;; a OGONEK
+CP852_OG_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OG_UP_END-$ ;; length of state section
+ DB OGONEK_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F2H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OG_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of scans
+ DB 18,0A8H ;; E OGONEK
+ DB 30,0A4H ;; A OGONEK
+CP852_OG_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OG_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Ogonek Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_OG_SP_END-$ ;; length of state section
+;; DB OGONEK_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F2H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_OG_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of scans
+;; DB 57,0F2H ;; OGONEK SPACE
+;;CP852_OG_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_OG_SP_END: ;; length of state section
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Lower
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_LO_END-$ ;; length of state section
+ DB OVERDOT_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BEH ;; z OVERDOT
+CP852_OD_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_LO_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Overdot Upper
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_OD_UP_END-$ ;; length of state section
+ DB OVERDOT_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0FAH,0 ;; error character = standalone accent
+ ;;
+ DW CP852_OD_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 21,0BDH ;; Z OVERDOT
+CP852_OD_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_OD_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 7 ;; number of entries
+ DB 19,0EAH ;; r ACUTE
+ DB 21,0ABH ;; z ACUTE
+ DB 31,098H ;; s ACUTE
+ DB 38,092H ;; l ACUTE
+ DB 44,0ECH ;; y ACUTE
+ DB 46,086H ;; c ACUTE
+ DB 49,0E4H ;; n ACUTE
+CP852_AC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 11 ;; number of entries
+ DB 19,0E8H ;; R ACUTE
+ DB 21,08DH ;; Z ACUTE
+ DB 22,0E9H ;; U ACUTE
+ DB 23,0D6H ;; I ACUTE
+ DB 24,0E0H ;; O ACUTE
+ DB 30,0B5H ;; A ACUTE
+ DB 31,097H ;; S ACUTE
+ DB 38,091H ;; L ACUTE
+ DB 44,0EDH ;; Y ACUTE
+ DB 46,08FH ;; C ACUTE
+ DB 49,0E3H ;; N ACUTE
+CP852_AC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_AC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Acute Space Bar
+;; KEYBOARD TYPES: P12_KB+ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_AC_SP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 57,0EFH ;; error character = standalone accent
+CP852_AC_SP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+CP852_AC_SP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_LO_END-$ ;; length of state section
+ DB DOUBLEACUTE_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0FBH ;; u DOUBLEACUTE
+ DB 24,08BH ;; o DOUBLEACUTE
+CP852_DC_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_DC_UP_END-$ ;; length of state section
+ DB DOUBLEACUTE_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F1H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_DC_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 22,0EBH ;; U DOUBLEACUTE
+ DB 24,08AH ;; O DOUBLEACUTE
+CP852_DC_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DC_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Double Acute Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_DC_SP_END-$ ;; length of state section
+;; DB DOUBLEACUTE_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F1H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_DC_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F1H ;; DOUBLEACUTE SPACE
+;;CP852_DC_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_DC_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Diaresis Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_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 CP852_DI_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 1 ;; number of scans
+ DB 18,0D3H ;; E Diaeresis
+CP852_DI_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_DI_UP_END: ;; length of state section
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Lower Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_LO_END-$ ;; length of state section
+ DB CEDILLA_LOWER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_LO_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0EEH ;; t CEDILLA
+ DB 31,0ADH ;; s CEDILLA
+CP852_CE_LO_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_LO_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Upper Case
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW CP852_CE_UP_END-$ ;; length of state section
+ DB CEDILLA_UPPER ;; State ID
+ DW ANY_KB ;; Keyboard Type
+ DB 0F7H,0 ;; error character = standalone accent
+ ;;
+ DW CP852_CE_UP_T1_END-$ ;; Size of xlat table
+ DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+ DB 2 ;; number of entries
+ DB 20,0DDH ;; T CEDILLA
+ DB 31,0B8H ;; S CEDILLA
+CP852_CE_UP_T1_END: ;;
+ ;;
+ DW 0 ;; Size of xlat table - null table
+ ;;
+CP852_CE_UP_END: ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; CODE PAGE: 852
+;; STATE: Cedilla Space
+;; KEYBOARD TYPES: ANY_KB
+;; TABLE TYPE: Translate
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; ;;
+;; DW CP852_CE_SP_END-$ ;; length of state section
+;; DB CEDILLA_SPACE ;; State ID
+;; DW ANY_KB ;; Keyboard Type
+;; DB 0F7H,0 ;; error character = standalone accent
+;; ;;
+;; DW CP852_CE_SP_T1_END-$ ;; Size of xlat table
+;; DB STANDARD_TABLE+ZERO_SCAN ;; xlat options:
+;; DB 1 ;; number of entries
+;; DB 57,0F7H ;; CEDILLA SPACE
+;;CP852_CE_SP_T1_END: ;;
+;; ;;
+;; DW 0 ;; Size of xlat table - null table
+;; ;;
+;;CP852_CE_SP_END: ;;
+;; ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ DW 0 ;; LAST STATE
+ ;;
+CP852_XLAT_END: ;; END OF CP852 SECTION
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+CODE ENDS ;; END OF PROGRAM
+ END ;;
diff --git a/private/mvdm/dos/v86/dev/keyboard/keybmac.inc b/private/mvdm/dos/v86/dev/keyboard/keybmac.inc
new file mode 100644
index 000000000..baa6b04d3
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/keybmac.inc
@@ -0,0 +1,450 @@
+;/*
+; * Microsoft Confidential
+; * Copyright (C) Microsoft Corporation 1991
+; * All Rights Reserved.
+; */
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MS DOS 3.3 - NLS Support - Keyboard Definition File
+;;
+;; File Name: KEYBMAC.INC
+;; ----------
+;;
+;; Author: Bill Devlin - IBM Canada Laboratory - May 1986
+;; ------- ???????????
+;;
+;; 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 ;;
+RUS_MODE EQU 01H ;; added by YST for cryillic keyboard
+LAT_MODE EQU 00H ;; 1/21/91
+ ;; NLS_FLAG_2 : nothing defined yet
+CARON EQU 80H ;;
+BREVE EQU 40H ;;
+OVERCIRCLE EQU 20H ;;
+OGONEK EQU 10H ;;
+OVERDOT EQU 08H ;;
+DOUBLEACUTE EQU 04H ;;
+ACUTE_DIAR EQU 02h ;; Greek dead key combo
+ACUTE_SEC EQU 01h ;; Greek
+DIARESIS_SEC EQU 10h ;; Greek-BUG-BUG instead of making a NLS_FLAG_3 we
+ ;; use 10h, which is not used in the Greek keyboard
+ ;; and the Greek keyboard is the only one that uses
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; DIARESIS_SEC.
+;; 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 ;;
+TILDE_TILDE EQU 34 ;;
+ALT_CASE EQU 35 ;;
+CTRL_CASE EQU 36 ;;
+NUMERIC_PAD EQU 37 ;;
+DIVIDE_SIGN EQU 38 ;;
+BOTLH_CAPS EQU 39 ;;
+BOTRH_CAPS EQU 40 ;;
+BOTLH_F_CAPS EQU 41 ;;
+BOTRH_F_CAPS EQU 42 ;;
+RUS_MODE_SET EQU 143 ;; Added for FR-CAN
+LAT_MODE_SET EQU 144 ;; Added for FR-CAN
+
+
+;************************************************
+; Mihindu 11/30/90 - Added Eastern Europe support
+;************************************************
+CARON_SPACE EQU 43
+CARON_LOWER EQU 44
+CARON_UPPER EQU 45
+BREVE_SPACE EQU 46
+BREVE_LOWER EQU 47
+BREVE_UPPER EQU 48
+OVERCIRCLE_SPACE EQU 49
+OVERCIRCLE_LOWER EQU 50
+OVERCIRCLE_UPPER EQU 51
+OGONEK_SPACE EQU 52
+OGONEK_LOWER EQU 53
+OGONEK_UPPER EQU 54
+OVERDOT_SPACE EQU 55
+OVERDOT_LOWER EQU 56
+OVERDOT_UPPER EQU 57
+DOUBLEACUTE_SPACE EQU 58
+DOUBLEACUTE_LOWER EQU 59
+DOUBLEACUTE_UPPER EQU 60
+
+;******************************************************
+; M000 --- new state for KDFJP.ASM (Kermit) *******
+;******************************************************
+
+DBCS_OLD_A EQU 61 ; M000 (JP9009)
+
+NON_ALPHA_LOWER_SEC EQU 62 ;; Added for FR-CAN
+NON_ALPHA_UPPER_SEC EQU 63 ;; For secondary keyboard on Dual Mode
+ALPHA_LOWER_SEC EQU 64 ;; keyboard systems
+ALPHA_UPPER_SEC EQU 65 ;;
+DEAD_LOWER_SEC EQU 66 ;; Added for FR-CAN
+DEAD_THIRD_SEC EQU 67 ;; Greek
+DEAD_UPPER_SEC EQU 68 ;; Greek
+ACUTE_SPACE_SEC EQU 69 ;; Greek
+ACUTE_LOWER_SEC EQU 70 ;; Greek
+ACUTE_UPPER_SEC EQU 71 ;; Greek
+ACDI_SPACE_SEC EQU 72 ;; Greek Acute-diaresis combo
+ACDI_LOWER_SEC EQU 73 ;; Greek
+ACDI_UPPER_SEC EQU 74 ;; Greek
+DIARESIS_LOWER_SEC EQU 75 ;; Greek
+DIARESIS_UPPER_SEC EQU 76 ;; Greek
+DIARESIS_SPACE_SEC EQU 77 ;; Greek
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; Logic Macros
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+
+UNKNOWN = 255
+
+FIND_FLAG MACRO FLAG_MASK
+ IFIDN <FLAG_MASK>,<SCAN_MATCH>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_SHIFT>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CAPS_STATE>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<NUM_STATE>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_CTL>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<EITHER_ALT>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LEFT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<RIGHT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ALT_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CTL_SHIFT>
+ FLAG_ID = KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<R_ALT_SHIFT>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<R_CTL_SHIFT>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<TILDE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ACUTE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<GRAVE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<DIARESIS>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CEDILLA>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CIRCUMFLEX>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<CARON>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<BREVE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OVERCIRCLE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OGONEK>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<OVERDOT>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<DOUBLEACUTE>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ACUTE_DIAR>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<ACUTE_SEC>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<DIARESIS_SEC>
+ FLAG_ID = NLS_FLAG_2_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LC_E0>
+ FLAG_ID = KB_FLAG_3_ID
+ ELSE
+;; ============================================================
+;; For FR-CAN Dual mode
+;; ============================================================
+ IFIDN <FLAG_MASK>,<SHIFTS_PRESSED>
+ FLAG_ID = EXT_KB_FLAG_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<RUS_MODE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+ IFIDN <FLAG_MASK>,<LAT_MODE>
+ FLAG_ID = NLS_FLAG_1_ID
+ ELSE
+;; ============================================================
+;; End of FR-CAN dual mode
+;; ============================================================
+ FLAG_ID = UNKNOWN
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDIF
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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 <MASK_TYPE>
+ NOT_BIT = 00000000B
+ ELSE
+ IFIDN <MASK_TYPE>,<NOT>
+ 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
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+RESET_NLS1 MACRO
+ DB RESET_NLS1_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/private/mvdm/dos/v86/dev/keyboard/keyboard.lnk b/private/mvdm/dos/v86/dev/keyboard/keyboard.lnk
new file mode 100644
index 000000000..225d08205
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/keyboard.lnk
@@ -0,0 +1,13 @@
+/map kdfnow.OBJ+
+KDFDV.OBJ+KDFSP.OBJ+KDFPO.OBJ+
+KDFGE.OBJ+KDFIT141.OBJ+KDFFR189.OBJ+
+KDFSG.OBJ+KDFSF.OBJ+KDFDK.OBJ+
+KDFUK166.OBJ+KDFBE.OBJ+KDFNL.OBJ+
+KDFNO.OBJ+KDFCF.OBJ+KDFLA.OBJ+
+KDFSV.OBJ+KDFRU091.OBJ+
+KDFBR275.OBJ+KDFBG.OBJ+KDFCZ.OBJ+
+KDFGK.OBJ+KDFHU.OBJ+KDFIC.OBJ+
+KDFPL1.OBJ+KDFRO.OBJ+KDFSL.OBJ+
+KDFYU.OBJ+KDFTR.OBJ+KDFTR440.OBJ KDFIT142.OBJ +
+kdfeof.OBJ
+KEYBOARD.EXS;
diff --git a/private/mvdm/dos/v86/dev/keyboard/keybshar.inc b/private/mvdm/dos/v86/dev/keyboard/keybshar.inc
new file mode 100644
index 000000000..cc18054af
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/keybshar.inc
@@ -0,0 +1,338 @@
+.XLIST
+%OUT ..YST keybshar
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1991
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; 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:
+;; ---------------
+;;
+;; ;jwg ; - Feb 1990 For 4.03.
+;; ;AN007; - Add Patriot/Sebring determination code for HOT Replug
+;; so that INT 9 handler can alter keyboard Scan Code set.
+;; ;M030 Merged IBM (Kermit - JP), KEYBOARD.SYS and KEYB.COM
+;; versions of this file into one.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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 ;; M030 Merged back for kdfcf.asm
+;;========================================
+;; Added YST for Cyrillic keyboards
+;; 1/21/90
+;;========================================
+SHIFTS_TO_LOGIC EQU 2000H ;; - transfer CTRL, SHIFT, ALT keys
+ ;; to LOGIC section
+ ;;
+SWITCHABLE EQU 1000H ;; - Driver can use NLS/Def mode
+ ;; switching (like Rus/Lat mode)
+ ;; Used for Int 2Fh, function 0AD83h answer
+;;========================================
+;; End of YST
+;;========================================
+JR_KB equ 8000h ;; M030 Merged back for kdfcf.asm
+ ;; Some useful scan codes:
+F1_SCAN EQU 59 ;; F1
+F2_SCAN EQU 60 ;; F2
+ ;;
+ ;; SYSTEM_FLAG / Hardware equates:
+ ;; INT 16h and remote support
+EXT_16 EQU 8000H ;; extended INT 16h support is there
+EXT_122 EQU 4000H ;; extended INT 16h for 122 is there
+; EQU 2000H ;; unused
+PC_NET EQU 1000H ;; flag PC Net is installed
+ ;; System type/hardware support flags
+PC_81 EQU 0800H ;; flag for Original PC
+PC_XT EQU 0400H ;; code for PC, PC/XT, PORTABLE
+PC_LAP EQU 0200H ;; code for Convertiable (p-12)
+PC_PAL EQU 0080H ;; code for Model 30 (PALACE)
+PC_AT EQU 0040H ;; code for PC-AT with 8042
+PC_386 EQU 0020H ;; code for PS/2's with 8042 (WRANGLER)
+PS_8042 EQU 0010H ;; 8042 is a Patriot/Sebring type array;AN007;jwg
+ ;; or system set translate OFF (SCS=01)
+SECURITY_ACTIVE EQU 0008h ; M030 ;; Server password mode is active
+; ; M030 ;; This bit becomes off from on when
+; ; M030 ;; correct password is entered JP9010
+ ;;
+ ;; 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
+ dd 0 ;; reserved
+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
+ db 5 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
+INVOKED_KBD_ID DW 0 ;; WGR invoked keyboard id. ;AN000
+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
+ ;;
+SHIFTS_PRESSED EQU 04H ;; set if any SHIFT, ALT, CTRL key
+ ;; pressed (added YST for Cyrillic keyb.)
+ ;;
+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 ;;
+RESET_NLS1_COMMAND EQU 0C0H ;;
+CHECK_CORE_COMMAND EQU 0D0H ;;
+ ;;
+ ;;
+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 ;;
+XT_KB EQU 4000H ;;
+AT_KB EQU 2000H ;;
+G_KB EQU 1000H ;;
+P_KB EQU 0800H ;;
+P12_KB EQU 0400H ;;
+DBCS_OLD_A_KB EQU 0080H ; M030 ;; JP9009
+DBCS_OLD_P_KB EQU 0040H ; M030 ;; JP9009
+DBCS_OLD_G_KB EQU 0020H ; M030 ;; JP9009
+DBCS_OLD_KB EQU 00C0H ; M030 ;; JP9009
+DBCS_KB EQU 0020H ; M030 ;; JP9009
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/dev/keyboard/makefile b/private/mvdm/dos/v86/dev/keyboard/makefile
new file mode 100644
index 000000000..ee2c2c158
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/keyboard/makefile
@@ -0,0 +1,128 @@
+# m000 -- updated dependencies on keybmac.inc and keybshar.inc
+include ../../make.inc
+
+cinc =../../../../inc
+AINC =-I. -I$(cinc) -I../../../../inc
+
+#################################
+com =..\..\inc
+bins =
+cprs =..\..\compress
+dest =keyboard.sys
+cpr =keyboard.sy_
+
+# inc =c:\dos500\inc
+inc =..\..\inc
+extasw =-I$(inc)
+
+all: $(dest)
+ binplace $(dest)
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.bin del *.bin
+ if exist *.exs del *.exs
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist keyboard.sys del keyboard.sys
+
+
+.asm.obj:
+ $(asm) $(ainc) $(aflags) $*.asm;
+
+
+KDFNOW.OBJ: KDFNOW.ASM \
+ $(com)\postequ.inc \
+ $(com)\dseg.inc \
+ $(com)\keybshar.inc \
+ keybmac.inc \
+ keybmac.inc
+
+KDFEOF.OBJ: KDFEOF.ASM $(com)\COPYRIGH.INC
+
+KDFDV.OBJ: KDFDV.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFSP.OBJ: kdfsp.asm $(com)\keybshar.inc keybmac.inc makefile
+
+KDFPO.OBJ: KDFPO.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFGE.OBJ: KDFGE.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFIT141.OBJ: KDFIT141.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFFR189.OBJ: KDFFR189.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFSG.OBJ: KDFSG.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFSF.OBJ: KDFSF.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFDK.OBJ: KDFDK.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFUK166.OBJ: KDFUK166.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFBE.OBJ: KDFBE.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFNL.OBJ: KDFNL.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFNO.OBJ: KDFNO.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFCF.OBJ: KDFCF.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFLA.OBJ: KDFLA.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFSV.OBJ: KDFSv.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+# KDFBR.OBJ: KDFBR.ASM $(com)\keybshar.inc keybmac.inc makefile # [Mihindu 10/30/90 : added Brazil]
+
+KDFRU091.OBJ: KDFRU091.ASM $(com)\keybshar.inc keybmac.inc makefile # [YST 21/1/91 : added Russia]
+
+# for daytona
+
+KDFBR275.OBJ: KDFBR275.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFBG.OBJ: KDFBG.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFCZ.OBJ: KDFCZ.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFGK.OBJ: KDFGK.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFHU.OBJ: KDFHU.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFIC.OBJ: KDFIC.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+#KDFPL.OBJ: KDFPL.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFPL1.OBJ: KDFPL1.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFRO.OBJ: KDFRO.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFSL.OBJ: KDFSL.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFYU.OBJ: KDFYU.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFTR.OBJ: KDFTR.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFTR440.OBJ: KDFTR440.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+KDFIT142.OBJ: KDFIT142.ASM $(com)\keybshar.inc keybmac.inc makefile
+
+# end for daytona
+
+# KDFJP.OBJ: KDFJP.ASM $(com)\keybshar.inc keybmac.inc makefile # CAS M000 Merged JP from IBM
+
+KEYBOARD.exs: KDFDV.OBJ KDFSP.OBJ KDFPO.OBJ \
+ KDFGE.OBJ KDFIT141.OBJ KDFFR189.OBJ \
+ KDFSG.OBJ KDFSF.OBJ KDFDK.OBJ \
+ KDFUK166.OBJ KDFBE.OBJ KDFNL.OBJ \
+ KDFNO.OBJ KDFCF.OBJ KDFLA.OBJ \
+ KDFSV.OBJ KDFRU091.OBJ \
+ KDFBR275.OBJ KDFBG.OBJ KDFCZ.OBJ \
+ KDFGK.OBJ KDFHU.OBJ KDFIC.OBJ KDFPL1.OBJ \
+ KDFRO.OBJ KDFSL.OBJ KDFYU.OBJ KDFTR.OBJ \
+ KDFTR440.OBJ KDFIT142.OBJ \
+ kdfeof.OBJ kdfnow.obj keyboard.lnk
+ LINK16 @keyboard.lnk
+
+$(dest): Keyboard.exs
diff --git a/private/mvdm/dos/v86/dev/makefile b/private/mvdm/dos/v86/dev/makefile
new file mode 100644
index 000000000..a54a383a6
--- /dev/null
+++ b/private/mvdm/dos/v86/dev/makefile
@@ -0,0 +1,32 @@
+# DEV root-level makefile
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 15-May-1991 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\make.inc
+
+all:
+ cd himem
+ $(MAKE)
+ cd ..\ansi
+ $(MAKE)
+ cd ..\keyboard
+ $(MAKE)
+ cd ..\country
+ $(MAKE)
+ cd ..
+
+clean:
+ cd himem
+ $(MAKE) clean
+ cd ..\ansi
+ $(MAKE) clean
+ cd ..\keyboard
+ $(MAKE) clean
+ cd ..\country
+ $(MAKE) clean
+ cd ..
diff --git a/private/mvdm/dos/v86/doskrnl/bios/biosbop.inc b/private/mvdm/dos/v86/doskrnl/bios/biosbop.inc
new file mode 100644
index 000000000..57ca401c1
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/biosbop.inc
@@ -0,0 +1,10 @@
+
+bop MACRO callid
+ db 0c4h,0c4h,callid
+ endm
+
+BIOS_PRINTER_IO equ 17h
+PRNIO_EXECUTE equ -1
+PRNIO_FLUSH equ 0
+PRNIO_OPEN equ 1
+PRNIO_CLOSE equ 2
diff --git a/private/mvdm/dos/v86/doskrnl/bios/biosseg.inc b/private/mvdm/dos/v86/doskrnl/bios/biosseg.inc
new file mode 100644
index 000000000..9e2a54536
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/biosseg.inc
@@ -0,0 +1,39 @@
+; BIOSSEG.INC
+;
+; This file defines the segment structure of the BIOS.
+; It should be included at the beginning of each source file.
+; All further segment declarations in the file can then be done by just
+; by specifying the segment name, with no attribute, class, or align type.
+
+
+datagrp group Bios_Data,Bios_Data_Init
+
+
+Bios_Data segment word public 'Bios_Data'
+Bios_Data ends
+
+Bios_Data_Init segment word public 'Bios_Data_Init'
+Bios_Data_Init ends
+
+Filler segment para public 'Filler'
+Filler ends
+
+Bios_Code segment word public 'Bios_Code'
+Bios_Code ends
+
+Filler2 segment para public 'Filler2'
+Filler2 ends
+
+sysinitgrp group sysinitseg, SpcKbdSeg, SpcMseSeg, SpcEmmSeg
+
+SysInitSeg segment word public 'system_init'
+SysInitSeg ends
+
+SpcKbdSeg segment para public 'SoftpcKeyboard'
+SpcKbdSeg ends
+
+SpcMseSeg segment para public 'SoftpcMouse'
+SpcMseSeg ends
+
+SpcEmmSeg segment para public 'SoftpcEmm'
+SpcEmmSeg ends
diff --git a/private/mvdm/dos/v86/doskrnl/bios/biostruc.inc b/private/mvdm/dos/v86/doskrnl/bios/biostruc.inc
new file mode 100644
index 000000000..5afb16ac9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/biostruc.inc
@@ -0,0 +1,101 @@
+; rom bios call packet structures
+
+;*******************************
+;system service call ( int 15h )
+;*******************************
+;function ah = 0c0h, return system configuration
+;for pc and pcjr on return:
+; (ah) = 80h
+; (cy) = 1
+;for pcxt, pc portable and pcat on return:
+; (ah) = 86h
+; (cy) = 1
+;for all others:
+; (ah) = 0
+; (cy) = 0
+; (es:bx) = pointer to system descriptor vector in ros
+; system descriptor :
+; dw xxxx length of descriptor in bytes,
+; minimum length = 8
+; db xx model byte
+; 0ffh = pc
+; 0feh = pc/xt, portable
+; 0fdh = pc/jr
+; 0fch = pc/at, 6mhz pc/at,
+; 6mhz pc/at running coprocessor(?),
+; ps/2 model 50, 50 z
+; 0fah = ps/2 model 25, 30
+; 0f9h = pc convertible
+; 0f8h = ps/2 model 80
+; 0f7h = nova
+; 0e0 thru 0efh = reserved
+;
+; db xx secondary model byte
+; 000h = pc1
+; 000h = pc/xt, portable
+; 000h = pc/jr
+; 000h = pc/at
+; 001h = 6mhz pc/at
+; 003h = 6mhz pc/at running coprocessor(?)
+; 004h = ps/2 model 50, 50z
+; 001h = ps/2 model 25
+; 000h = pc convertible
+; 000h = ps/2 model 80
+; 000h = nova
+;
+; db xx bios revision level
+; 00 for first release, subsequent release
+; of code with same model byte and
+; secondary model byte require revison level
+; to increase by one.
+;
+; db xx feature information byte 1
+; x0000000 = 1, bios use dma channel 3
+; = 0, dma channel 3 not used
+;
+; 0x000000 = 1, 2nd interrupt chip present
+; = 0, 2nd interrupt chip not present
+;
+; 00x00000 = 1, real time clock present
+; = 0, real time clock not present
+;
+; 000x0000 = 1, keyboard escape sequence(int15h)
+; called in keyboard interrupt
+; (int 09h).
+; = 0, keyboard escape sequence not
+; called.
+; 0000xxxx reserved
+;
+; db xx feature information byte 2 - reserved
+;
+; db xx feature information byte 2 - reserved
+;
+; db xx feature information byte 2 - reserved
+;
+; db xx feature information byte 2 - reserved
+;
+
+bios_system_descriptor struc
+bios_sd_leng dw ?
+bios_sd_modelbyte db ?
+bios_sd_scnd_modelbyte db ?
+ db ?
+bios_sd_featurebyte1 db ?
+ db 4 dup (?)
+bios_system_descriptor ends
+
+;featurebyte1 bit map equates
+dmachannel3 equ 10000000b
+scndintcontroller equ 01000000b
+realtimeclock equ 00100000b
+keyescapeseq equ 00010000b
+;
+;model byte
+mdl_pc1 equ 0ffh
+mdl_xt equ 0feh
+mdl_jr equ 0fdh
+mdl_at equ 0fch
+mdl_convert equ 0f9h
+
+mdl_ps2_30 equ 0fah
+mdl_ps2_80 equ 0f8h
diff --git a/private/mvdm/dos/v86/doskrnl/bios/devmark.inc b/private/mvdm/dos/v86/doskrnl/bios/devmark.inc
new file mode 100644
index 000000000..4b55e6ad8
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/devmark.inc
@@ -0,0 +1,24 @@
+;structure, equtes for devmark for mem command.
+
+devmark struc
+devmark_id db 0
+devmark_seg dw 0
+devmark_size dw 0
+devmark_dum db 3 dup (?)
+devmark_filename db 8 dup (' ')
+devmark ends
+
+devmark_stk equ 'S'
+devmark_device equ 'D'
+devmark_ifs equ 'I'
+devmark_buf equ 'B'
+devmark_cds equ 'L' ;lastdrive
+devmark_files equ 'F'
+devmark_fcbs equ 'X'
+devmark_inst equ 'T' ;used for sysinit base for install= command.
+
+devmark_spc equ 'Q' ;used for spckbd,spcmse
+
+setbrkdone equ 00000001b
+for_devmark equ 00000010b
+not_for_devmark equ 11111101b
diff --git a/private/mvdm/dos/v86/doskrnl/bios/dosmsg.cmd b/private/mvdm/dos/v86/doskrnl/bios/dosmsg.cmd
new file mode 100644
index 000000000..daa8f6150
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/dosmsg.cmd
@@ -0,0 +1,6 @@
+cd ..\messages
+chmode -r %2
+..\tools\buildidx %2
+chmode +r %2
+cd ..\bios
+..\tools\nosrvbld %1 ..\messages\%2
diff --git a/private/mvdm/dos/v86/doskrnl/bios/makefile b/private/mvdm/dos/v86/doskrnl/bios/makefile
new file mode 100644
index 000000000..f30bfc5b4
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/makefile
@@ -0,0 +1,92 @@
+#************************** makefile for NTIO.SYS ***************************
+
+include ..\..\make.inc
+dest =ntio.sys
+
+#
+####################### dependencies begin here. #########################
+#
+
+
+all: $(dest)
+ binplace $(dest)
+ binplace ntio.sym
+
+inc.lst: inc.asm
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist msbio.cl? del msbio.cl?
+ if exist ntio.sys del ntio.sys
+
+msbio.cl1: msbio.skl \
+ $(msg)\$(COUNTRY).msg
+
+msbio1.obj msbio1.lst: msbio1.asm $(inc)\msbdata.inc \
+ $(inc)\devsym.inc msequ.inc $(cinc)\vint.inc
+
+mschar.obj mschar.lst: mschar.asm biosbop.inc $(inc)\devsym.inc \
+ $(inc)\ioctl.inc msequ.inc msgroup.inc $(cinc)\vint.inc
+
+
+msend.obj msend.lst: msend.asm
+
+msinit.obj msinit.lst: msinit.asm $(inc)\VERSIONA.inc \
+ $(inc)\dbcs.sw $(inc)\dirent.inc $(inc)\dosmac.inc $(inc)\dosmac.inc \
+ $(inc)\dossym.inc $(inc)\error.inc $(inc)\version.inc biostruc.inc \
+ msequ.inc msgroup.inc $(cinc)\dossvc.inc $(cinc)\vint.inc
+
+msint13.obj msint13.lst: msint13.asm biostruc.inc $(cinc)\vint.inc \
+ msequ.inc msgroup.inc
+
+
+sysconf.obj sysconf.lst: sysconf.asm $(inc)\doscntry.inc \
+ $(inc)\parse.asm $(inc)\psdata.inc $(inc)\smifssym.inc \
+ $(inc)\syscall.inc $(inc)\sysvar.inc $(inc)\version.inc devmark.inc \
+ $(inc)\devsym.inc $(cinc)\dossvc.inc $(cinc)\cmdsvc.inc
+
+sysimes.obj sysimes.lst: sysimes.asm
+
+spckbd.obj spckbd.lst: spckbd.asm $(cinc)\vint.inc
+
+spcmse_4.obj spcmse_4.lst: spcmse_4.asm $(cinc)\vint.inc
+
+spcemm.obj spcemm.lst: spcemm.asm $(cinc)\vint.inc
+
+sysinit1.obj sysinit1.lst: sysinit1.asm $(inc)\VERSIONA.inc \
+ $(inc)\arena.inc $(inc)\buffer.inc $(inc)\cputype.inc \
+ $(cinc)\curdir.inc $(inc)\dbcs.sw $(inc)\dirent.inc $(inc)\dosmac.inc \
+ $(inc)\dossym.inc $(inc)\error.inc $(inc)\exe.inc \
+ $(inc)\pdb.inc $(inc)\sf.inc $(inc)\smifssym.inc $(inc)\syscall.inc \
+ $(inc)\sysvar.inc $(inc)\version.inc biostruc.inc $(cinc)\vint.inc \
+ devmark.inc $(inc)\devsym.inc $(inc)\ioctl.inc $(cinc)\dossvc.inc \
+ $(cinc)\cmdsvc.inc
+
+sysinit2.obj sysinit2.lst: sysinit2.asm $(inc)\copyrigh.inc \
+ $(inc)\doscntry.inc $(inc)\syscall.inc $(inc)\version.inc \
+ devmark.inc $(inc)\devsym.inc $(inc)\ioctl.inc
+
+$(dest): msbio.cl1 msbio1.obj mschar.obj msint13.obj msinit.obj \
+ sysinit1.obj spckbd.obj spcmse_4.obj spcemm.obj sysconf.obj \
+ sysinit2.obj sysimes.obj msend.obj msbio_4.lnk
+ link16 $(link_opts) @msbio_4.lnk
+ mapsym ntio
+ reloc ntio.exe $(dest) 70
+ del ntio.exe
+
+# sudeepb 04-Mar-1991 : NT Message file handling for DOSEm.
+#
+# Many of the above .asm files needed for NTIO.SYS include "message class"
+# files (i.e. msbio.cl3 etc.). These files have the message strings extracted
+# from msbio.skl and internationalized using ..\messages\<COUNTRY>.msg file.
+# The utilities needed for getting these *.cl? files from *.skl and *.msg
+# files are all real mode, hence their building rules are not included in
+# this makefile. Use dosmsg.bat command from 3xbox to build these *.cl? files.
+# syntax for dosmsg.bat is "dosmsg <file>.skl <country>.msg". For example
+# building *.cl> files for bios for usa version, the command will be
+# "dosmsg msbio.skl usa-ms.msg"
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msbio.lnk b/private/mvdm/dos/v86/doskrnl/bios/msbio.lnk
new file mode 100644
index 000000000..425da9c1b
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msbio.lnk
@@ -0,0 +1,3 @@
+msbio1+mschar+msint13+spckbd+spcmse+spcemm+
+msinit+sysinit1+sysconf+sysinit2+sysimes+
+msend,ntio.exe,ntio.map;
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msbio.skl b/private/mvdm/dos/v86/doskrnl/bios/msbio.skl
new file mode 100644
index 000000000..3636eba2d
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msbio.skl
@@ -0,0 +1,95 @@
+;==============================================================================
+;REVISION HISTORY:
+;==============================================================================
+
+;==================
+:class 3
+;==================
+
+; displayed when there is a bad command in CONFIG.SYS. '$' TERMINATED, note
+; that this message includes crlfm!
+
+:def 03 BADOPM DB 13,10,"Unrecognized command in CONFIG.SYS"
+:def 04 CRLFM DB 13,10,'$'
+:def 22 BadParm db 13,10,"Bad command or parameters - $"
+
+;displayed when installed device specifies too large a sector size.'$' terminated.
+; FORM: <BADSIZ_PRE>device name<BADSIZ_POST>
+:def 05 BADSIZ_PRE DB 13,10,"Sector size too large in file $"
+
+;displayed when installed device cannot be found. '$' terminated.
+; FORM: <BADLD_PRE>device name<BADLD_POST>
+:def 06 BADLD_PRE DB 13,10,"Bad or missing $"
+
+;displayed when command interpreter is not found. NUL terminated.
+; FORM: <BADLD_PRE><BADCOM><BADLD_POST>
+:def 07 BADCOM DB "Command Interpreter",0
+
+;displayed when country code, code page combination was not found in country.sys file. '$' terminated.
+; FORM: <BADCOUNTRY>
+:def 08 BADCOUNTRY DB 13,10,"Invalid country code or code page",13,10,"$"
+
+;displayed when code page id is missing or wrong syntax.
+; FORM: <BADCOUNTRYCOM>
+:def 09 BADCOUNTRYCOM DB 13,10,"Error in COUNTRY command",13,10,"$"
+
+;displayed when the memory left is not sufficient to handle COUTRY.SYS file
+; FORM: <INSUFMEMORY>
+:def 10 INSUFMEMORY DB 13,10, "Insufficient memory for COUNTRY.SYS file",13,10,"$"
+
+; displayed when there is insufficient memory. '$' TERMINATED, note
+; that this message includes crlfm!
+:def 11 BADMEM DB 13,10,"Configuration too large for memory",13,10,"$"
+
+; displayed when the attempt is made to install a block device which would
+; have a drive letter > 'Z'
+:def 12 BADBLOCK DB 13,10,"Too many Block Devices",13,10,"$"
+
+; displayed when the attempt is made to install a stack with invalid
+; combinations of # of stacks, stack size.
+:def 13 BADSTACK DB 13,10,"Invalid STACK parameters",13,10,"$"
+
+; - displayed when encountering a command that is not "install=" after
+; we had a "Install=" command.
+; Translation::: Please leave the last blank space at the end of the line
+; as it is.
+:def 14 BADORDER DB 13,10,"Incorrect order in CONFIG.SYS line ","$"
+
+; - displayed when the command failed.
+; Translation::: Please leave the last blank space at the end of the line
+; as it is.
+:def 15 ERRORCMD DB "Error in CONFIG.SYS line ","$"
+
+; displayed when more than 24 fixed disk partitions are found ; M029
+:def 24 toomanydrivesmsg db "WARNING! Drives past Z: exist and will be ignored" ; M029
+
+;==================
+:class 4
+;==================
+;MSBIO SYSINIT
+;Message for SYSINIT_BASE program.
+:def 16 Mem_alloc_err db 13,10,"Memory allocation error","$"
+
+
+;==================
+:class 5
+;==================
+
+; PUBLIC FATAL_MSG
+:def 17 FATAL_MSG DB 0DH,0AH,7,0DH,0AH
+ DB "Internal stack overflow",0DH,0AH
+ DB "System halted",0DH,0AH,"$"
+;
+;==================
+:class 6
+;==================
+
+; - displayed when DOS loads due to non-availability of HMA.
+;
+:def 18 DOSLOMSG DB "HMA not available : Loading DOS low", 13, 10, "$"
+:def 23 FEMSG DB "Fatal Error:Cannot allocate Memory for DOS", 13, 10, "$"
+
+
+;:END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msbio1.asm b/private/mvdm/dos/v86/doskrnl/bios/msbio1.asm
new file mode 100644
index 000000000..e115bd0d0
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msbio1.asm
@@ -0,0 +1,955 @@
+ page ,160
+ title msbio1.asm - Bios_Data definition and device driver entry/exit
+
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;
+;----------------------------------------------------------------------------
+;
+ include version.inc ; set build flags
+ include biosseg.inc ; define BIOS segments
+
+ include devsym.inc
+ include msequ.inc
+ include vint.inc
+
+
+; Assembly conditional for stack switching
+;
+STACKSW equ 1
+
+Bios_Data segment
+
+ assume cs:Bios_Data
+ public BData_start
+BData_start:
+
+
+ assume ds:nothing,es:nothing
+
+ public hdrv_pat
+hdrv_pat label word ; patched by msinit
+ assume cs:Bios_Data
+
+ extrn init:near ; this is in msinit
+
+ jmp init ; go to initialization code
+
+
+; define some stuff that is also used by msdos.sys from an include file
+
+In_Bios = 0ffffh ; define flag for msbdata.inc
+ include msbdata.inc
+
+
+ public inHMA,xms
+inHMA db 0 ; flag indicates we're running from HMA
+xms dd 0 ; entry point to xms if above is true
+
+ align 4
+
+ public ntvdmstate
+ntvdmstate dd 0
+IF 2
+.errnz ntvdmstate-BData_start-FIXED_NTVDMSTATE_OFFSET
+ENDIF
+
+
+ public ptrsav
+ptrsav dd 0
+
+ public auxbuf
+auxbuf db 0,0,0,0 ;set of 1 byte buffers for com 1,2,3, and 4
+ public zeroseg
+zeroseg dw 0 ; easy way to load segment registers with zero
+
+ public auxnum
+auxnum dw 0 ;which aux device was requested
+
+
+ public res_dev_list
+
+res_dev_list label byte
+ p_attr = chardev+outtilbusy+dev320+IOQUERY+DEVOPCL
+; ** p_attr = chardev+outtilbusy+dev320
+
+ sysdev <auxdev2,8013h,strategy,con_entry,'CON '>
+auxdev2 sysdev <prndev2,8000h,strategy,aux0_entry,'AUX '>
+prndev2 sysdev <timdev,p_attr,strategy,prn0_entry,'PRN '>
+timdev sysdev <com1dev,8008h,strategy,tim_entry,'CLOCK$ '>
+com1dev sysdev <lpt1dev,8000h,strategy,aux0_entry,'COM1 '>
+lpt1dev sysdev <lpt2dev,p_attr,strategy,prn1_entry,"LPT1 ">
+lpt2dev sysdev <lpt3dev,p_attr,strategy,prn2_entry,"LPT2 ">
+lpt3dev sysdev <com2dev,p_attr,strategy,prn3_entry,"LPT3 ">
+com2dev sysdev <com3dev,8000h,strategy,aux1_entry,"COM2 ">
+com3dev sysdev <com4dev,8000h,strategy,aux2_entry,"COM3 ">
+com4dev dw -1,Bios_Data,8000h,strategy,aux3_entry
+ db "COM4 "
+
+
+ public RomVectors
+RomVectors label byte
+ public Old10, Old15, Old19, Old1B
+ db 10h ; M028
+Old10 dd (?) ; M028
+ db 15h
+Old15 dd (?)
+ db 19h
+Old19 dd (?)
+ db 1bh
+Old1B dd (?)
+EndRomVectors equ $
+ public NUMROMVECTORS
+NUMROMVECTORS equ ((EndRomVectors - RomVectors)/5)
+
+ public spc_mse_int10
+spc_mse_int10 dd (?)
+
+ public int29Perf
+int29Perf dd (?)
+
+
+ public keyrd_func
+ public keysts_func
+
+; moved altah to inc\msbdata.inc so it could go in instance table in DOS
+
+keyrd_func db 0 ; default is conventional keyboard read
+keysts_func db 1 ; default is conventional keyboard status check.
+
+ public printdev
+printdev db 0 ; index into above array
+
+ public multrk_flag
+multrk_flag dw 0
+
+; the following variable can be modified via ioctl sub-function 16. in this
+; way, the wait can be set to suit the speed of the particular printer being
+; used. one for each printer device.
+
+ public wait_count
+wait_count dw 4 dup (50h) ; array of retry counts for printer
+
+ public int19sem
+int19sem db 0 ; indicate that all int 19
+ ; initialization is complete
+
+; we assume the following remain contiguous and their order doesn't change
+i19_lst:
+ irp aa,<02,08,09,0a,0b,0c,0d,0e,70,72,73,74,76,77>
+ public int19old&aa
+ db aa&h ; store the number as a byte
+int19old&aa dd -1 ;orignal hardware int. vectors for int 19h.
+ endm
+
+num_i19 = ((offset $) - (offset i19_lst))/5
+
+
+;variables for dynamic relocatable modules
+;these should be stay resident.
+
+ public int6c_ret_addr
+int6c_ret_addr dd ? ; return address from int 6c for p12 machine
+
+;
+; data structures for real-time date and time
+;
+ public bin_date_time
+ public month_table
+ public daycnt2
+ public feb29
+
+bin_date_time:
+ db 0 ; century (19 or 20) or hours (0-23)
+ db 0 ; year in century (0...99) or minutes (0-59)
+ db 0 ; month in year (1...12) or seconds (0-59)
+ db 0 ; day in month (1...31)
+
+month_table:
+ dw 0 ; january
+ dw 31 ; february
+ dw 59
+ dw 90
+ dw 120
+ dw 151
+ dw 181
+ dw 212
+ dw 243
+ dw 273
+ dw 304
+ dw 334 ; december
+daycnt2 dw 0000 ; temp for count of days since 1-1-80
+feb29 db 0 ; february 29 in a leap year flag
+
+
+;************************************************************************
+;* *
+;* entry points into Bios_Code routines. The segment values *
+;* are plugged in by seg_reinit. *
+;* *
+;************************************************************************
+
+ public cdev
+cdev dd chardev_entry
+bcode_i2f dd i2f_handler
+end_BC_entries:
+
+;************************************************************************
+;* *
+;* cbreak - break key handling - simply set altah=3 and iret *
+;* *
+;************************************************************************
+
+ public cbreak
+cbreak proc near
+ assume ds:nothing,es:nothing
+
+ mov altah,3 ;indicate break key set
+
+ public intret ; general purpose iret in the Bios_Data seg
+intret:
+ FIRET
+cbreak endp
+
+;************************************************************************
+;* *
+;* strategy - store es:bx (device driver request packet) *
+;* away at [ptrsav] for next driver function call *
+;* *
+;************************************************************************
+
+ public strategy
+strategy proc far
+ assume ds:nothing,es:nothing
+
+ mov word ptr cs:[ptrsav],bx
+ mov word ptr cs:[ptrsav+2],es
+ ret
+strategy endp
+
+;************************************************************************
+;* *
+;* device driver entry points. these are the initial *
+;* 'interrupt' hooks out of the device driver chain. *
+;* in the case of our resident drivers, they'll just *
+;* stick a fake return address on the stack which *
+;* points to dispatch tables and possibly some unit *
+;* numbers, and then call through a common entry point *
+;* which can take care of a20 switching *
+;* *
+;************************************************************************
+
+con_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry ; call into code segment handler
+ dw con_table
+
+con_entry endp
+
+;--------------------------------------------------------------------
+
+prn0_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw prn_table
+ db 0,0 ; device numbers
+
+prn0_entry endp
+
+;--------------------------------------------------------------------
+
+prn1_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw prn_table
+ db 0,1
+
+prn1_entry endp
+
+;--------------------------------------------------------------------
+
+prn2_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw prn_table
+ db 1,2
+
+prn2_entry endp
+
+;--------------------------------------------------------------------
+
+prn3_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw prn_table
+ db 2,3
+
+prn3_entry endp
+
+;--------------------------------------------------------------------
+
+aux0_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw aux_table
+ db 0
+
+aux0_entry endp
+
+;--------------------------------------------------------------------
+
+aux1_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw aux_table
+ db 1
+
+aux1_entry endp
+
+;--------------------------------------------------------------------
+
+aux2_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw aux_table
+ db 2
+
+aux2_entry endp
+
+;--------------------------------------------------------------------
+
+aux3_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw aux_table
+ db 3
+
+aux3_entry endp
+
+;--------------------------------------------------------------------
+
+tim_entry proc near
+ assume ds:nothing,es:nothing
+
+ call cdev_entry
+ dw tim_table
+
+tim_entry endp
+
+;--------------------------------------------------------------------
+
+;************************************************************************
+;* *
+;* Ensure A20 is enabled before jumping into code in HMA. *
+;* This code assumes that if Segment of Device request packet is *
+;* DOS DATA segment then the Device request came from DOS & that *
+;* A20 is already on. *
+;* *
+;************************************************************************
+
+cdev_entry proc near
+ assume ds:nothing,es:nothing
+;
+; M064 - BEGIN
+;
+ cmp inHMA, 0
+ je ce_enter_codeseg; optimized for DOS in HMA
+
+ push ax
+ mov ax, DosDataSg
+ cmp word ptr [ptrsav+2], ax
+ pop ax
+ jne not_from_dos ; jump is coded this way to fall thru
+ ; in 99.99% of the cases
+ce_enter_codeseg:
+ jmp cdev
+not_from_dos:
+ call EnsureA20On
+;
+; M064 - END
+;
+ jmp short ce_enter_codeseg
+cdev_entry endp
+
+;************************************************************************
+;* *
+;* outchr - this is our int 29h handler. it writes the *
+;* character in al on the display using int 10h ttywrite *
+;* *
+;************************************************************************
+
+ public outchr
+outchr proc far
+ assume ds:nothing,es:nothing
+
+ push ax
+ push si
+ push di
+ push bp
+ push bx
+ mov ah,0eh ; set command to write a character
+ mov bx,7 ; set foreground color
+ int 10h ; call rom-bios
+ pop bx
+ pop bp
+ pop di
+ pop si
+ pop ax
+ jmp intret
+outchr endp
+
+; M001 - BEGIN
+
+;************************************************************************
+;* *
+;* EnsureA20On - ensure that a20 is enabled if we're running *
+;* in the HMA before interrupt entry points into Bios_Code *
+;* *
+;************************************************************************
+
+HiMem label dword
+ dw 90h
+ dw 0ffffh
+
+LoMem label dword
+ dw 80h
+ dw 0h
+
+EnsureA20On proc near
+ assume ds:nothing,es:nothing
+ call IsA20Off
+ jz ea_enable
+ ret
+
+EnableA20 proc near ; M041
+ea_enable:
+ push ax
+ push bx
+ mov ah,5 ; localenablea20
+ call xms
+ pop bx
+ pop ax
+bie_done:
+ ret
+EnableA20 endp ; M041
+
+EnsureA20On endp
+;
+; M001 - END
+
+; M041 : BEGIN
+;
+;----------------------------------------------------------------------------
+;
+; procedure : IsA20Off
+;
+;----------------------------------------------------------------------------
+;
+IsA20Off proc near
+ push ds
+ push es
+ push cx
+ push si
+ push di
+ lds si, HiMem
+ les di, LoMem
+ mov cx, 8
+ rep cmpsw
+ pop di
+ pop si
+ pop cx
+ pop es
+ pop ds
+ ret
+IsA20Off endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : DisableA20
+;
+;----------------------------------------------------------------------------
+;
+DisableA20 proc near
+ push ax
+ push bx
+ mov ah,6 ; localdisable a20
+ call xms
+ pop bx
+ pop ax
+ ret
+DisableA20 endp
+
+; M041 : END
+
+;************************************************************************
+;* *
+;* int19 - bootstrap interrupt -- we must restore a bunch of the *
+;* interrupt vectors before resuming the original int19 code *
+;* *
+;************************************************************************
+
+
+ public int19
+int19 proc far
+ assume ds:nothing,es:nothing
+
+ push cs
+ pop ds
+ assume ds:Bios_Data
+
+ mov es,zeroseg
+
+ mov cx, NUMROMVECTORS ; no. of rom vectors to be restored
+ mov si, offset RomVectors ; point to list of saved vectors
+next_int:
+ lodsb ; get int number
+ cbw ; assume < 128
+ shl ax, 1
+ shl ax, 1 ; int * 4
+ mov di, ax
+ lodsw
+ stosw
+ lodsw
+ stosw ; install the saved vector
+ loop next_int
+
+ cmp byte ptr int19sem,0 ; don't do the others unless we
+ jz doint19 ; set our initialization complete flag
+
+; stacks code has changed these hardware interrupt vectors
+; stkinit in sysinit1 will initialize int19holdxx values.
+
+ mov si,offset i19_lst
+ mov cx,num_i19
+
+i19_restore_loop:
+ lodsb ; get interrupt number
+ cbw ; assume < 128
+ mov di,ax ; save interrupt number
+ lodsw ; get original vector offset
+ mov bx,ax ; save it
+ lodsw ; get original vector segment
+ cmp bx,-1 ; check for 0ffffh (unlikely segment)
+ jz i19_restor_1 ;opt no need to check selector too
+ cmp ax,-1 ;opt 0ffffh is unlikely offset
+ jz i19_restor_1
+
+ add di,di
+ add di,di
+ xchg ax,bx
+ stosw
+ xchg ax,bx
+ stosw ; put the vector back
+
+i19_restor_1:
+ loop i19_restore_loop
+
+doint19:
+ int 19h
+int19 endp
+;
+; M036 - BEGIN
+;
+;
+;----------------------------------------------------------------------------
+;
+; procedure : int15
+;
+; Int15 handler for recognizing ctrl-alt-del seq.
+;
+;----------------------------------------------------------------------------
+;
+DELKEY equ 53h
+ public Int15
+Int15 proc far
+ assume ds:nothing
+ cmp ax, (4fh shl 8) + DELKEY ; del keystroke ?
+ je @f
+ jmp dword ptr Old15
+@@:
+ stc
+ jmp dword ptr Old15
+Int15 endp
+;
+;
+;************************************************************************
+;* *
+;* the int2f handler chains up to Bios_Code through here. *
+;* it returns through one of the three functions that follow. *
+;* notice that we'll assume we're being entered from DOS, so *
+;* that we're guaranteed to be A20 enabled if needed *
+;* *
+;************************************************************************
+
+int_2f proc far
+ assume ds:nothing,es:nothing
+ jmp bcode_i2f
+int_2f endp
+
+
+
+;************************************************************************
+;* *
+;* re_init - called back by sysinit after a bunch of stuff *
+;* is done. presently does nothing. affects no *
+;* registers! *
+;* *
+;************************************************************************
+
+ public re_init
+re_init proc far
+ assume ds:nothing,es:nothing
+ ret
+re_init endp
+
+
+;SR; WIN386 support
+; WIN386 instance data structure
+;
+;
+; Here is a Win386 startup info structure which we set up and to which
+; we return a pointer when Win386 initializes.
+;
+
+public Win386_SI, SI_Version, SI_Next
+
+Win386_SI label byte ; Startup Info for Win386
+SI_Version db 3, 0 ; for Win386 3.0
+SI_Next dd ? ; pointer to next info structure
+ dd 0 ; a field we don't need
+ dd 0 ; another field we don't need
+SI_Instance dw Instance_Table, Bios_Data ; far pointer to instance table
+
+;
+; This table gives Win386 the instance data in the BIOS and ROM-BIOS data
+; areas. Note that the address and size of the hardware stacks must
+; be calculated and inserted at boot time.
+;
+Instance_Table label dword
+ dw 00H, 50H ; print screen status...
+ dw 02 ; ...2 bytes
+ dw 0Eh, 50H ; ROM Basic data...
+ dw 14H ; ...14H bytes
+ dw ALTAH, Bios_Data ; a con device buffer...
+ dw 01 ; ... 1 byte
+IF STACKSW
+public NextStack
+NextStack label dword
+
+; NOTE: If stacks are disabled by STACKS=0,0, the following
+; instance items WILL NOT be filled in by SYSINIT.
+; That's just fine as long as these are the last items
+; in the instance list since the first item is initialized
+; to 0000 at load time.
+
+ dw 0, 0 ; pointer to next stack to be used...
+ dw 02 ; ...2 bytes
+; The next item in the instance table must be filled in at sysinit time
+public IT_StackLoc, IT_StackSize
+IT_StackLoc dd ? ; location of hardware stacks
+IT_StackSize dw ? ; size of hardware stacks
+ENDIF
+ dd 0 ; terminate the instance table
+
+;SR;
+; Flag to indicate whether Win386 is running or not
+;
+public IsWin386
+IsWin386 db 0
+
+;
+;This routine was originally in BIOS_CODE but this causes a lot of problems
+;when we call it including checking of A20. The code being only about
+;30 bytes, we might as well put it in BIOS_DATA
+;
+PUBLIC V86_Crit_SetFocus
+
+V86_Crit_SetFocus PROC FAR
+
+ push di
+ push es
+ push bx
+ push ax
+
+ xor di,di
+ mov es,di
+ mov bx,0015h ;Device ID of DOSMGR device
+ mov ax,1684h ;Get API entry point
+ int 2fh
+ mov ax,es
+ or ax,di
+ jz Skip
+;
+;Here, es:di is address of API routine. Set up stack frame to simulate a call
+;
+ push cs ;push return segment
+ mov ax,OFFSET Skip
+ push ax ;push return offset
+ push es
+ push di ;API far call address
+ mov ax,1 ;SetFocus function number
+ retf ;do the call
+Skip:
+ pop ax
+ pop bx
+ pop es
+ pop di
+ ret
+V86_Crit_SetFocus ENDP
+
+
+
+;
+;End WIN386 support
+;
+
+ public FreeHMAPtr
+ public MoveDOSIntoHMA
+FreeHMAPtr dw -1
+MoveDOSIntoHMA dd sysinitseg:FTryToMovDOSHi
+
+
+;SR;
+; A communication block has been setup between the DOS and the BIOS. All
+;the data starting from SysinitPresent will be part of the data block.
+;Right now, this is the only data being communicated. It can be expanded
+;later to add more stuff
+;
+ public SysinitPresent
+ public DemInfoFlag
+SysinitPresent db 0
+DemInfoFlag db 0
+
+
+; this will be the end of the BIOS data if no hard disks are in system
+
+ public endBIOSData
+endBIOSData label byte
+
+Bios_Data ends
+
+;
+; okay. so much for Bios_Data. Now let's put our device driver
+; entry stuff up into Bios_Code.
+
+Bios_Code segment
+ assume cs:Bios_Code
+
+; ORG a bit past zero to leave room for running in HMA...
+
+ org 30h
+ public BCode_start
+BCode_start:
+
+; device driver entry point tables
+
+ extrn con_table:near
+ extrn tim_table:near
+ extrn prn_table:near
+ extrn aux_table:near
+
+ extrn i2f_handler:far
+
+ public Bios_Data_Word
+Bios_Data_Word dw Bios_Data
+
+;************************************************************************
+;* *
+;* seg_reinit is called with ax = our new code segment value, *
+;* trashes di, cx, es *
+;* *
+;* cas -- should be made disposable! *
+;* *
+;************************************************************************
+
+ public seg_reinit
+seg_reinit proc far
+ assume ds:nothing,es:nothing
+
+ mov es,Bios_Data_Word
+ assume es:Bios_Data
+ mov di,2+offset cdev
+ mov cx,((offset end_BC_entries) - (offset cdev))/4
+
+seg_reinit_1:
+ stosw ; modify Bios_Code entry points
+ inc di
+ inc di
+ loop seg_reinit_1
+ ret
+seg_reinit endp
+
+;************************************************************************
+;* *
+;* chardev_entry - main device driver dispatch routine *
+;* called with a dummy parameter block on the stack *
+;* dw dispatch_table, dw prn/aux numbers (optional) *
+;* *
+;* will eventually take care of doing the transitions in *
+;* out of Bios_Code *
+;* *
+;************************************************************************
+
+chardev_entry proc far
+ assume ds:nothing,es:nothing
+
+ push si
+ push ax
+ push cx
+ push dx
+ push di
+ push bp
+ push ds
+ push es
+ push bx
+ mov bp,sp ; point to stack frame
+ mov si,18[bp] ; get return address (dispatch table)
+ mov ds,Bios_Data_Word ; load ds: -> Bios_Data
+ assume ds:Bios_Data
+ mov ax,word ptr 2[si] ; get the device number if present
+ mov byte ptr [auxnum],al
+ mov byte ptr [printdev],ah
+ mov si,word ptr [si] ; point to the device dispatch table
+
+ les bx,[ptrsav] ;get pointer to i/o packet
+
+ mov al,byte ptr es:[bx].unit ;al = unit code
+ mov ah,byte ptr es:[bx].media ;ah = media descrip
+ mov cx,word ptr es:[bx].count ;cx = count
+ mov dx,word ptr es:[bx].start ;dx = start sector
+
+ xchg di,ax
+ mov al,byte ptr es:[bx].cmd
+ cmp al,cs:[si]
+ jae command_error
+
+ cbw ; note that al <= 15 means ok
+ shl ax,1
+
+ add si,ax
+ xchg ax,di
+
+ les di,dword ptr es:[bx].trans
+
+ cld ; ***** always clear direction
+ call cs:word ptr [si+1] ;go do command
+ assume ds:nothing
+
+ jc already_got_ah_status ; if function returned status, don't
+ mov ah,1 ; load with normal completion
+
+already_got_ah_status:
+ mov ds,Bios_Data_Word ; cas///// note: shouldn't be needed!
+ assume ds:Bios_Data
+ lds bx,[ptrsav]
+ assume ds:nothing
+ mov word ptr [bx].status,ax ;mark operation complete
+
+ pop bx
+ pop es
+ pop ds
+ pop bp
+ pop di
+ pop dx
+ pop cx
+ pop ax
+ pop si
+ add sp,2 ; get rid of fake return address
+
+chardev_entry endp ; fall through into bc_retf
+
+ public bc_retf
+bc_retf proc far
+ assume ds:nothing,es:nothing
+
+ ret
+
+bc_retf endp
+
+
+command_error:
+ call bc_cmderr
+ jmp short already_got_ah_status
+
+;
+;----------------------------------------------------------------------------
+; The following piece of hack is for supporting CP/M compatibility
+; Basically at offset 5 we have a far call into 0:c0. But this does not call
+; 0:c0 directly instead it call f01d:fef0, because it needs to support 'lhld 6'
+; The following hack has to reside at ffff:d0 (= f01d:fef0) if BIOS is loaded
+; high.
+;----------------------------------------------------------------------------
+
+
+; BUGBUG sudeepb 21-May-1991 ; We can save these 30 bytes by moving
+; off_d0 to right place.
+
+ db 1fh dup (?) ; pad to bring offset to 0d0h
+
+if2
+ if ( offset off_d0 - 0d0h )
+ %out CP/M compatibilty broken!!!
+ %out Please re-pos hack to ffff:d0
+ endif
+endif
+
+ public off_d0
+off_d0 db 5 dup (?) ; 5 bytes from 0:c0 will be copied onto here
+ ; which is the CP/M call 5 entry point
+ .errnz (offset off_d0 - 0d0h)
+
+
+;----------------------------------------------------------
+;
+; exit - all routines return through this path
+;
+
+ public bc_cmderr
+bc_cmderr:
+ mov al,3 ;unknown command error
+
+; now zero the count field by subtracting its current value,
+; which is still in cx, from itself.
+
+
+; subtract the number of i/o's NOT YET COMPLETED from total
+; in order to return the number actually complete
+
+
+ public bc_err_cnt
+bc_err_cnt:
+ assume ds:Bios_Data
+ les bx,[ptrsav]
+ assume es:nothing
+ sub es:word ptr [bx].count,cx;# of successful i/o's
+ mov ah,81h ;mark error return
+ stc ; indicate abnormal end
+ ret
+
+Bios_Code ends
+
+
+; the last real segment is sysinitseg
+
+sysinitseg segment
+ assume cs:sysinitseg
+ extrn FTryToMovDOSHi:far
+ public SI_start
+SI_start:
+sysinitseg ends
+
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msbio_4.lnk b/private/mvdm/dos/v86/doskrnl/bios/msbio_4.lnk
new file mode 100644
index 000000000..739ec4e2a
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msbio_4.lnk
@@ -0,0 +1,3 @@
+msbio1+mschar+msint13+spckbd+spcmse_4+spcemm+
+msinit+sysinit1+sysconf+sysinit2+sysimes+
+msend,ntio.exe,ntio.map;
diff --git a/private/mvdm/dos/v86/doskrnl/bios/mschar.asm b/private/mvdm/dos/v86/doskrnl/bios/mschar.asm
new file mode 100644
index 000000000..069273832
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/mschar.asm
@@ -0,0 +1,1078 @@
+ page ,160
+ title mschar - character and clock devices
+;
+;----------------------------------------------------------------------------
+;
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;
+;----------------------------------------------------------------------------
+;
+
+ .xlist
+
+ include version.inc ; set build flags
+ include biosseg.inc ; establish bios segment structure
+
+ include msequ.inc
+ include devsym.inc
+ include ioctl.inc
+ include vint.inc
+
+break macro
+ endm
+
+ include biosbop.inc
+
+ include error.inc
+ .list
+
+ include msgroup.inc ; define Bios_Data segment
+
+
+ extrn ptrsav:dword
+
+ extrn altah:byte
+ extrn keyrd_func:byte
+ extrn keysts_func:byte
+
+ extrn auxnum:word
+ extrn auxbuf:byte
+
+ extrn wait_count:word
+ extrn printdev:byte
+ extrn Old10:dword
+ extrn spc_mse_int10:dword
+ extrn int29Perf:dword
+
+
+; close Bios_Data and open Bios_Code segment
+
+ tocode
+
+ extrn bc_cmderr:near
+ extrn bc_err_cnt:near
+
+MODE_CTRLBRK equ 0ffh ; M013
+
+;************************************************************************
+;* *
+;* device driver dispatch tables *
+;* *
+;* each table starts with a byte which lists the number of *
+;* legal functions, followed by that number of words. Each *
+;* word represents an offset of a routine in Bios_Code which *
+;* handles the function. The functions are terminated with *
+;* a near return. If carry is reset, a 'done' code is returned *
+;* to the caller. If carry is set, the ah/al registers are *
+;* returned as abnormal completion status. Notice that ds *
+;* is assumed to point to the Bios_Data segment throughout. *
+;* *
+;************************************************************************
+
+ public con_table
+con_table:
+ db (((offset con_table_end) - (offset con_table) - 1)/2)
+ dw bc_exvec ; 00 init
+ dw bc_exvec ; 01
+ dw bc_exvec ; 02
+ dw bc_cmderr ; 03
+ dw con_read ; 04
+ dw con_rdnd ; 05
+ dw bc_exvec ; 06
+ dw con_flush ; 07
+ dw con_writ ; 08
+ dw con_writ ; 09
+ dw bc_exvec ; 0a
+con_table_end:
+
+ public prn_table
+prn_table label byte
+ db (((offset prn_table_end) - (offset prn_table) -1)/2)
+ dw bc_exvec ; 00 init
+ dw bc_exvec ; 01
+ dw bc_exvec ; 02
+ dw bc_cmderr ; 03
+ dw prn_input ; 04 indicate zero chars read
+ dw z_bus_exit ; 05 read non-destructive
+ dw bc_exvec ; 06
+ dw bc_exvec ; 07
+ dw prn_writ ; 08
+ dw prn_writ ; 09
+ dw prn_stat ; 0a
+ dw bc_exvec ; 0b
+ dw bc_exvec ; 0c
+ dw prn_open ; 0d
+ dw prn_close ; 0e
+ dw bc_exvec ; 0f
+ dw prn_tilbusy ; 10
+ dw bc_exvec ; 11
+ dw bc_exvec ; 12
+ dw prn_genioctl ; 13
+ dw bc_exvec ; 14
+ dw bc_exvec ; 15
+ dw bc_exvec ; 16
+ dw bc_exvec ; 17
+ dw bc_exvec ; 18
+ dw prn_ioctl_query ; 19
+prn_table_end:
+
+
+
+ public aux_table
+aux_table label byte
+ db (((offset aux_table_end) - (offset aux_table) -1)/2)
+
+ dw bc_exvec ; 00 - init
+ dw bc_exvec ; 01
+ dw bc_exvec ; 02
+ dw bc_cmderr ; 03
+ dw aux_read ; 04 - read
+ dw aux_rdnd ; 05 - read non-destructive
+ dw bc_exvec ; 06
+ dw aux_flsh ; 07
+ dw aux_writ ; 08
+ dw aux_writ ; 09
+ dw aux_wrst ; 0a
+aux_table_end:
+
+
+ public tim_table
+tim_table label byte
+ db (((offset tim_table_end) - (offset tim_table) -1)/2)
+ dw bc_exvec ; 00
+ dw bc_exvec ; 01
+ dw bc_exvec ; 02
+ dw bc_cmderr ; 03
+ dw bc_cmderr ; 04
+ dw z_bus_exit ; 05
+ dw bc_exvec ; 06
+ dw bc_exvec ; 07
+ dw bc_cmderr ; 08
+ dw bc_cmderr ; 09
+tim_table_end:
+
+;************************************************************************
+;* *
+;* con_read - read cx bytes from keyboard into buffer at es:di *
+;* *
+;************************************************************************
+
+con_read proc near
+ assume ds:Bios_Data,es:nothing
+
+ jcxz con_exit
+
+con_loop:
+ call chrin ;get char in al
+ stosb ;store char at es:di
+ loop con_loop
+
+con_exit:
+ clc
+ ret
+con_read endp
+
+;************************************************************************
+;* *
+;* chrin - input single char from keyboard into al *
+;* *
+;* we are going to issue extended keyboard function, if *
+;* supported. the returning value of the extended keystroke *
+;* of the extended keyboard function uses 0e0h in al *
+;* instead of 00 as in the conventional keyboard function. *
+;* this creates a conflict when the user entered real *
+;* greek alpha charater (= 0e0h) to distinguish the extended *
+;* keystroke and the greek alpha. this case will be handled *
+;* in the following manner: *
+;* *
+;* ah = 16h *
+;* int 16h *
+;* if al == 0, then extended code (in ah) *
+;* else if al == 0e0h, then *
+;* if ah <> 0, then extended code (in ah) *
+;* else greek_alpha character. *
+;* *
+;* also, for compatibility reason, if an extended code is *
+;* detected, then we are going to change the value in al *
+;* from 0e0h to 00h. *
+;* *
+;************************************************************************
+
+
+chrin proc near
+ assume ds:Bios_Data,es:nothing
+
+ mov ah,keyrd_func ; set by msinit. 0 or 10h
+ xor al,al
+ xchg al,altah ;get character & zero altah
+
+ or al,al
+ jnz keyret
+
+ int 16h ; do rom bios keyrd function
+
+alt10:
+ or ax,ax ;check for non-key after break
+ jz chrin
+
+ cmp ax,7200h ;check for ctrl-prtsc
+ jnz alt_ext_chk
+
+ mov al,16
+ jmp short keyret
+
+alt_ext_chk:
+
+;**************************************************************
+; if operation was extended function (i.e. keyrd_func != 0) then
+; if character read was 0e0h then
+; if extended byte was zero (i.e. ah == 0) then
+; goto keyret
+; else
+; set al to zero
+; goto alt_save
+; endif
+; endif
+; endif
+
+ cmp byte ptr keyrd_func,0
+ jz not_ext
+ cmp al,0e0h
+ jnz not_ext
+
+ or ah,ah
+ jz keyret
+ifdef DBCS
+ifdef KOREA ; Keyl 1990/11/5
+ cmp ah, 0f0h ; If hangeul code range then
+ jb EngCodeRange1 ; do not modify any value.
+ cmp ah, 0f2h
+ jbe not_ext
+EngCodeRange1:
+endif ; KOREA
+endif ; DBCS
+ xor al,al
+ jmp short alt_save
+
+not_ext:
+
+ or al,al ;special case?
+ jnz keyret
+
+alt_save:
+ mov altah,ah ;store special key
+keyret:
+ ret
+chrin endp
+
+;************************************************************************
+;* *
+;* con_rdnd - keyboard non destructive read, no wait *
+;* *
+;* pc-convertible-type machine: if bit 10 is set by the dos *
+;* in the status word of the request packet, and there is no *
+;* character in the input buffer, the driver issues a system *
+;* wait request to the rom. on return from the rom, it returns *
+;* a 'char-not-found' to the dos. *
+;* *
+;************************************************************************
+
+con_rdnd proc near
+ assume ds:Bios_Data,es:nothing
+
+ mov al,[altah]
+ or al,al
+ jnz rdexit
+
+ mov ah,keysts_func ; keyboard i/o interrupt - get
+ int 16h ; keystroke status (keysts_func)
+ jnz gotchr
+
+;
+; pc-convertible checking is not needed on NTVDM
+; if no key in buff return immediatly with busy status
+;04-Aug-1992 Jonle
+;
+; cmp fhavek09,0
+; jz z_bus_exit ; return with busy status if not k09
+;
+; les bx,[ptrsav]
+; assume es:nothing
+; test es:[bx].status,0400h ; system wait enabled?
+; jz z_bus_exit ; return with busy status if not
+;
+; need to wait for ibm response to request for code
+; on how to use the system wait call.
+;
+; mov ax,4100h ; wait on an external event
+; xor bl,bl ; M055; wait for any event
+; int 15h ; call rom for system wait
+
+z_bus_exit:
+ stc
+ mov ah,3 ; indicate busy status
+ ret
+
+gotchr:
+ or ax,ax
+ jnz notbrk ;check for null after break
+
+ mov ah,keyrd_func ; issue keyboard read function
+ int 16h
+ jmp con_rdnd ;and get a real status
+
+notbrk:
+ cmp ax,7200h ;check for ctrl-prtsc
+ jnz rd_ext_chk
+
+ mov al,'P' and 1fh ; return control p
+ jmp short rdexit
+
+rd_ext_chk:
+ cmp keyrd_func,0 ; extended keyboard function?
+ jz rdexit ; no. normal exit.
+
+ cmp al,0e0h ; extended key value or greek alpha?
+ jne rdexit
+
+ifdef DBCS
+ifdef KOREA
+ cmp ah, 0f0h ; If hangeul code range then
+ jb EngCodeRange ; do not modify any value.
+ cmp ah, 0f2h
+ jbe rdexit ; Keyl 90/11/5
+EngCodeRange:
+endif ; KOREA
+endif ; DBCS
+
+ cmp ah,0 ; scan code exist?
+ jz rdexit ; yes. greek alpha char.
+ mov al,0 ; no. extended key stroke.
+ ; change it for compatibility
+
+rdexit:
+ les bx,[ptrsav]
+ assume es:nothing
+ mov es:[bx].media,al ; *** return keyboard character here
+
+bc_exvec:
+ clc ; indicate normal termination
+ ret
+
+con_rdnd endp
+
+;************************************************************************
+;* *
+;* con_write - console write routine *
+;* *
+;* entry: es:di -> buffer *
+;* cx = count *
+;* *
+;************************************************************************
+
+con_writ proc near
+ assume ds:Bios_Data,es:nothing
+
+ jcxz bc_exvec
+
+ push es
+
+ mov bx,word ptr [int29Perf]
+ mov dx,word ptr [int29Perf+2] ;DX:BX is original INT 29h vector
+ sub ax,ax
+ mov es,ax
+ cmp BX,es:[29h*4+0]
+ jne con_lp1 ; if not the same do single int10s
+ cmp DX,es:[29h*4+2]
+ jne con_lp1 ; if not the same do single int10s
+ mov bx,word ptr [spc_mse_int10]
+ mov dx,word ptr [spc_mse_int10+2] ;DX:BX is original INT 10h vector
+ cmp BX,es:[10h*4+0]
+ jne con_lp1 ; if not the same do single int10s
+ cmp DX,es:[10h*4+2]
+ jne con_lp1 ; if not the same do single int10s
+
+ pop es
+
+ ; Sudeepb 21-Jul-1992: We know that no one has hooked in10 so we
+ ; can optimize it by calling a private in1t10h which takes a full
+ ; string, displays it with the same attribute as present on the
+ ; screen and moves the cursor to the end.
+
+ mov ax,46h ; sounds like a good flag value
+ push ax ; make an iret frame
+ push cs
+ mov ax, offset ret_adr
+ push ax
+ push dx ; dx:bx is pointing to softpc int10 handler
+ push bx ; make the retf frame
+ mov ax,13FFh ; AH = WRITESTRING, AL = subfunction
+ retf
+ret_adr:
+ jmp short cc_ret
+
+con_lp1:
+ pop es
+
+con_lp:
+ mov al,es:[di] ;get char
+ inc di
+ int chrout ;output char
+ loop con_lp ;repeat until all through
+
+cc_ret:
+ clc
+ ret
+con_writ endp
+
+;************************************************************************
+;* *
+;* con_flush - flush out keyboard queue *
+;* *
+;************************************************************************
+
+ public con_flush ; called from msbio2.asm for floppy swapping
+con_flush proc near
+ assume ds:Bios_Data,es:nothing
+
+
+ mov [altah],0 ;clear out holding buffer
+
+; while (charavail()) charread();
+
+flloop:
+ mov ah,1 ; command code for check status
+ int 16h ; call rom-bios keyboard routine
+ jz cc_ret ; return carry clear if none
+
+ xor ah,ah ; if zf is nof set, get character
+ int 16h ; call rom-bios to get character
+ jmp flloop
+
+con_flush endp
+
+;************************************************************************
+;* *
+;* some equates for rom bios printer i/o *
+;* *
+;************************************************************************
+
+; ibm rom status bits (i don't trust them, neither should you)
+; warning!!! the ibm rom does not return just one bit. it returns a
+; whole slew of bits, only one of which is correct.
+
+
+notbusystatus = 10000000b ; not busy
+nopaperstatus = 00100000b ; no more paper
+prnselected = 00010000b ; printer selected
+ioerrstatus = 00001000b ; some kinda error
+timeoutstatus = 00000001b ; time out.
+
+noprinter = 00110000b ; no printer attached
+
+;************************************************************************
+;* *
+;* prn_input - return with no error but zero chars read *
+;* *
+;* enter with cx = number of characters requested *
+;* *
+;************************************************************************
+
+prn_input proc near
+ assume ds:Bios_Data,es:nothing
+
+ call bc_err_cnt ; reset count to zero (sub reqpkt.count,cx)
+ clc ; but return with carry reset for no error
+ ret
+
+prn_input endp
+
+;************************************************************************
+;* *
+;* prn_writ - write cx bytes from es:di to printer device *
+;* *
+;* auxnum has printer number *
+;* *
+;************************************************************************
+
+prn_writ proc near
+ assume ds:Bios_Data,es:nothing
+
+ jcxz prn_done ;no chars to output
+
+prn_loop:
+ mov bx,2 ;retry count
+
+prn_out:
+ call prnstat ; get status
+ jnz TestPrnError ; error
+
+ mov al,es:[di] ; get character to print
+ xor ah,ah
+ call prnop ; print to printer
+ jz prn_con ; no error - continue
+
+ cmp ah, MODE_CTRLBRK ; M013
+ jne @f ; M013
+ mov al, error_I24_gen_failure ; M013
+ mov altah, 0 ; M013
+ jmp short pmessg ; M013
+@@:
+ test ah,timeoutstatus
+ jz prn_con ; not time out - continue
+
+TestPrnError:
+ dec bx ;retry until count is exhausted.
+ jnz prn_out
+
+pmessg:
+ jmp bc_err_cnt ; return with error
+
+; next character
+
+prn_con:
+ inc di ;point to next char and continue
+ loop prn_loop
+
+prn_done:
+ clc
+ ret
+prn_writ endp
+
+;************************************************************************
+;* *
+;* prn_stat - device driver entry to return printer status *
+;* *
+;************************************************************************
+
+prn_stat proc near
+
+ call prnstat ;device in dx
+ jnz pmessg ; other errors were found
+ test ah,notbusystatus
+ jnz prn_done ;no error. exit
+ jmp z_bus_exit ; return busy status
+prn_stat endp
+
+;************************************************************************
+;* *
+;* prnstat - utilty function to call ROM BIOS to check *
+;* printer status. Return meaningful error code *
+;* *
+;************************************************************************
+
+prnstat proc near
+ assume ds:Bios_Data,es:nothing
+
+ mov ah, 2 ; set command for get status
+prnstat endp ; fall into prnop
+
+;************************************************************************
+;* *
+;* prnop - call ROM BIOS printer function in ah *
+;* return zero true if no error *
+;* return zero false if error, al = error code *
+;* *
+;************************************************************************
+
+prnop proc near
+ assume ds:Bios_Data,es:nothing
+
+ mov dx,[auxnum] ; get printer number
+ int 17h ; call rom-bios printer routine
+
+ ; This check was added to see if this is a case of no
+ ; printer being installed. This tests checks to be sure
+ ; the error is noprinter (30h)
+
+ push ax ; M044
+ and ah, noprinter ; M044
+ cmp AH,noprinter ; Chk for no printer
+ pop ax ; M044
+
+ jne NextTest
+ and AH,NOT nopaperstatus
+ or AH,ioerrstatus
+
+; examine the status bits to see if an error occurred. unfortunately, several
+; of the bits are set so we have to pick and choose. we must be extremely
+; careful about breaking basic.
+
+NextTest:
+ test ah,(ioerrstatus+nopaperstatus) ; i/o error?
+ jz checknotready ; no, try not ready
+
+; at this point, we know we have an error. the converse is not true.
+
+ mov al,error_I24_out_of_paper
+ ; first, assume out of paper
+ test ah,nopaperstatus ; out of paper set?
+ jnz ret1 ; yes, error is set
+ inc al ; return al=10 (i/o error)
+ret1:
+ ret ; return with error
+
+checknotready:
+ mov al,2 ; assume not-ready
+ test ah,timeoutstatus ; is time-out set?
+ ret ; if nz then error, else ok
+prnop endp
+
+;************************************************************************
+;* *
+;* prn_open - send bop to disable auto-close, and wait for *
+;* a DOS close *
+;* *
+;* inputs: *
+;* outputs: BOP has been issued *
+;* *
+;************************************************************************
+
+prn_open proc near
+ push si
+ push dx
+ push ds
+ mov dx,40h
+ mov ds,dx
+ test word ptr ds:[FIXED_NTVDMSTATE_REL40], EXEC_BIT_MASK
+ pop ds
+ jnz po_nobop
+ xor dh, dh
+ mov dl, [printdev]
+ or dl, dl
+ jz @f
+ dec dl
+@@:
+ mov si,PRNIO_OPEN
+ bop %BIOS_PRINTER_IO
+po_nobop:
+ pop dx
+ pop si
+ ret
+prn_open endp
+
+;************************************************************************
+;* *
+;* prn_close - send bop to close actual printer, and re-enable *
+;* autoclose *
+;* *
+;* inputs: *
+;* outputs: BOP has been issued *
+;* *
+;************************************************************************
+
+prn_close proc near
+ push si
+ push dx
+ push ds
+ mov dx,40h
+ mov ds,dx
+ test word ptr ds:[FIXED_NTVDMSTATE_REL40], EXEC_BIT_MASK
+ pop ds
+ jnz pc_nobop
+ xor dh, dh
+ mov dl, [printdev]
+ or dl, dl
+ jz @f
+ dec dl
+@@:
+ mov si,PRNIO_CLOSE
+ bop %BIOS_PRINTER_IO
+pc_nobop:
+ pop dx
+ pop si
+ ret
+prn_close endp
+
+;************************************************************************
+;* *
+;* prn_tilbusy - output until busy. Used by print spooler. *
+;* this entry point should never block waiting for *
+;* device to come ready. *
+;* *
+;* inputs: cx = count, es:di -> buffer *
+;* outputs: set the number of bytes transferred in the *
+;* device driver request packet *
+;* *
+;************************************************************************
+
+prn_tilbusy proc near
+
+ mov si,di ; everything is set for lodsb
+
+prn_tilbloop:
+ push cx
+
+ push bx
+ xor bh,bh
+ mov bl,[printdev]
+ shl bx,1
+ mov cx,wait_count[bx] ; wait count times to come ready
+ pop bx
+
+prn_getstat:
+ call prnstat ; get status
+ jnz prn_bperr ; error
+ test ah,10000000b ; ready yet?
+ loopz prn_getstat ; no, go for more
+
+ pop cx ; get original count
+ jz prn_berr ; still not ready => done
+
+ lods es:byte ptr [si]
+ xor ah,ah
+ call prnop
+ jnz prn_berr ; error
+
+ loop prn_tilbloop ; go for more
+
+ clc ; normal no-error return
+ ret ; from device driver
+
+prn_bperr:
+ pop cx ; restore transfer count from stack
+
+prn_berr:
+ jmp bc_err_cnt
+prn_tilbusy endp
+
+;************************************************************************
+;* *
+;* prn_genioctl - get/set printer retry count *
+;* *
+;************************************************************************
+
+prn_genioctl proc near
+ assume ds:Bios_Data,es:nothing
+
+ les di,[ptrsav]
+ cmp es:[di].majorfunction,ioc_pc
+ jz prnfunc_ok
+
+prnfuncerr:
+ jmp bc_cmderr
+
+prnfunc_ok:
+ mov al,es:[di].minorfunction
+ les di,es:[di].genericioctl_packet
+ xor bh,bh
+ mov bl,[printdev] ; get index into retry counts
+ shl bx,1
+ mov cx,wait_count[bx] ; pull out retry count for device
+
+ cmp al,get_retry_count
+ jz prngetcount
+
+ cmp al,set_retry_count
+ jnz prnfuncerr
+
+ mov cx,es:[di].rc_count
+prngetcount:
+ mov wait_count[bx],cx ; place "new" retry count
+ mov es:[di].rc_count,cx ; return current retry count
+ clc
+ ret
+prn_genioctl endp
+
+;************************************************************************
+;* *
+;* prn_ioctl_query *
+;* *
+;* Added for 5.00 *
+;************************************************************************
+
+prn_ioctl_query PROC NEAR
+ assume ds:Bios_Data,es:nothing
+
+ les di,[ptrsav]
+ cmp es:[di].majorfunction,ioc_pc
+ jne prn_query_err
+
+ mov al,es:[di].minorfunction
+ cmp al,get_retry_count
+ je IOCtlSupported
+ cmp al,set_retry_count
+ jne prn_query_err
+
+IOCtlSupported:
+ clc
+ ret
+
+prn_query_err:
+ stc
+ jmp BC_CmdErr
+
+prn_ioctl_query ENDP
+
+;************************************************************************
+;* *
+;* aux port driver code -- "aux" == "com1" *
+;* *
+;* the device driver entry/dispatch code sets up auxnum to *
+;* give the com port number to use (0=com1, 1=com2, 2=com3...) *
+;* *
+;************************************************************************
+
+; values in ah, requesting function of int 14h in rom bios
+
+auxfunc_send equ 1 ;transmit
+auxfunc_receive equ 2 ;read
+auxfunc_status equ 3 ;request status
+
+; error flags, reported by int 14h, reported in ah:
+
+flag_data_ready equ 01h ;data ready
+flag_overrun equ 02h ;overrun error
+flag_parity equ 04h ;parity error
+flag_frame equ 08h ;framing error
+flag_break equ 10h ;break detect
+flag_tranhol_emp equ 20h ;transmit holding register empty
+flag_timeout equ 80h ;timeout
+
+; these flags reported in al:
+
+flag_cts equ 10h ;clear to send
+flag_dsr equ 20h ;data set ready
+flag_rec_sig equ 80h ;receive line signal detect
+
+;************************************************************************
+;* *
+;* aux_read - read cx bytes from [auxnum] aux port to buffer *
+;* at es:di *
+;* *
+;************************************************************************
+
+aux_read proc near
+ assume ds:Bios_Data,es:nothing
+
+ jcxz exvec2 ; if no characters, get out
+
+ call getbx ; put address of auxbuf in bx
+ xor al,al ; clear al register
+ xchg al,[bx] ; get character , if any, from
+ ; buffer and clear buffer
+ or al,al ; if al is nonzero there was a
+ ; character in the buffer
+ jnz aux2 ; if so skip first auxin call
+
+aux1:
+ call auxin ; get character from port
+; ^^^^^ won't return if error
+aux2:
+ stosb ; store character
+ loop aux1 ; if more characters, go around again
+
+exvec2:
+ clc ; all done, successful exit
+ ret
+
+aux_read endp
+
+;************************************************************************
+;* *
+;* auxin - call rom bios to read character from aux port *
+;* if error occurs, map the error and return one *
+;* level up to device driver exit code, setting *
+;* the number of bytes transferred appropriately *
+;* *
+;************************************************************************
+
+;
+; M026 - BEGIN
+;
+auxin proc near
+ mov ah,auxfunc_receive
+ call auxop ;check for frame, parity, or overrun errors
+ ;warning: these error bits are unpredictable
+ ; if timeout (bit 7) is set
+ test ah, flag_frame or flag_parity or flag_overrun
+ jnz arbad ; skip if any error bits set
+ ret ; normal completion, ah=stat, al=char
+
+; error getting character
+
+arbad:
+ pop ax ; remove return address (near call)
+ xor al,al
+ or al,flag_rec_sig or flag_dsr or flag_cts
+ jmp bc_err_cnt
+
+auxin endp
+
+IFDEF COMMENTEDOUT
+auxin proc near
+ push cx
+ mov cx, 20 ; number of retries on time out errors
+@@:
+ mov ah,auxfunc_receive
+ call auxop ;check for frame, parity, or overrun errors
+ ;warning: these error bits are unpredictable
+ ; if timeout (bit 7) is set
+ test ah, flag_timeout
+ jz no_timeout
+ loop @b
+no_timeout:
+ pop cx
+ test ah, flag_timeout or flag_frame or flag_parity or flag_overrun
+ jnz arbad ; skip if any error bits set
+ ret ; normal completion, ah=stat, al=char
+
+; error getting character
+
+arbad:
+ pop ax ; remove return address (near call)
+ xor al,al
+ or al,flag_rec_sig or flag_dsr or flag_cts
+ jmp bc_err_cnt
+
+auxin endp
+ENDIF
+
+;
+; M026 - END
+;
+;************************************************************************
+;* *
+;* aux_rdnd - non-destructive aux port read *
+;* *
+;************************************************************************
+
+aux_rdnd proc near
+ assume ds:Bios_Data,es:nothing
+
+ call getbx ; have bx point to auxbuf
+ mov al,[bx] ; copy contents of buffer to al
+ or al,al ; if al is non-zero (char in buffer)
+ jnz auxrdx ; then return character
+
+ call auxstat ; if not, get status of aux device
+ test ah,flag_data_ready ; test data ready
+ jz auxbus ; then device is busy (not ready)
+
+ test al,flag_dsr ;test data set ready
+ jz auxbus ; then device is busy (not ready)
+
+ call auxin ; else aux is ready, get character
+ mov [bx],al ; save character in buffer
+
+auxrdx:
+ jmp rdexit ; return al in [packet.media]
+
+auxbus:
+ jmp z_bus_exit ; return busy status
+aux_rdnd endp
+
+;************************************************************************
+;* *
+;* aux_wrst - return aux port write status *
+;* *
+;************************************************************************
+
+aux_wrst proc near
+ assume ds:Bios_Data,es:nothing
+
+ call auxstat ; get status of aux in ax
+ test al,flag_dsr ; test data set ready
+ jz auxbus ; then device is busy (not ready)
+ test ah,flag_tranhol_emp ;test transmit hold reg empty
+ jz auxbus ; then device is busy (not ready)
+ clc
+ ret
+aux_wrst endp
+
+;************************************************************************
+;* *
+;* auxstat - call rom bios to determine aux port status *
+;* *
+;* exit: ax = status *
+;* dx = [auxnum] *
+;* *
+;************************************************************************
+
+auxstat proc near
+ mov ah,auxfunc_status
+auxstat endp ; fall into auxop
+
+;************************************************************************
+;* *
+;* auxop - perform rom-biox aux port interrupt *
+;* *
+;* entry: ah = int 14h function number *
+;* exit: ax = results *
+;* dx = [auxnum] *
+;* *
+;************************************************************************
+
+auxop proc near
+ ;ah=function code
+ ;0=init, 1=send, 2=receive, 3=status
+ mov dx,[auxnum] ; get port number
+ int 14h ; call rom-bios for status
+ ret
+auxop endp
+
+;************************************************************************
+;* *
+;* aux_flsh - flush aux input buffer - set contents of *
+;* auxbuf [auxnum] to zero *
+;* *
+;* cas - shouldn't this code call the rom bios input function *
+;* repeatedly until it isn't ready? to flush out any *
+;* pending serial input queue if there's a tsr like MODE *
+;* which is providing interrupt-buffering of aux port? *
+;* *
+;************************************************************************
+
+aux_flsh proc near
+ call getbx ; get bx to point to auxbuf
+ mov byte ptr [bx],0 ; zero out buffer
+ clc ; all done, successful return
+ ret
+aux_flsh endp
+
+;************************************************************************
+;* *
+;* aux_writ - write to aux device *
+;* *
+;************************************************************************
+
+aux_writ proc near
+ assume ds:Bios_Data ; set by aux device driver entry routine
+ jcxz exvec2 ; if cx is zero, no characters
+ ; to be written, jump to exit
+aux_loop:
+ mov al,es:[di] ; get character to be written
+ inc di ; move di pointer to next character
+ mov ah,auxfunc_send ;value=1, indicates a write
+ call auxop ;send character over aux port
+
+ test ah,flag_timeout ;check for error
+ jz awok ; then no error
+ mov al,10 ; else indicate write fault
+ jmp bc_err_cnt ; call error routines
+
+ ; if cx is non-zero, still more
+awok:
+ loop aux_loop ; more characrter to print
+ clc ; all done, successful return
+ ret
+aux_writ endp
+
+;************************************************************************
+;* *
+;* getbx - return bx -> single byte input buffer for *
+;* selected aux port ([auxnum]) *
+;* *
+;************************************************************************
+
+getbx proc near
+ assume ds:Bios_Data,es:nothing
+
+ mov bx,[auxnum]
+ add bx,offset auxbuf
+ ret
+getbx endp
+
+Bios_Code ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msend.asm b/private/mvdm/dos/v86/doskrnl/bios/msend.asm
new file mode 100644
index 000000000..305cedbe9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msend.asm
@@ -0,0 +1,52 @@
+ page ,160
+;
+;----------------------------------------------------------------------------
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;
+;----------------------------------------------------------------------------
+
+; Define end labels for each segment in
+; IO.SYS. Make the segments paragraph aligned
+; to save the trouble of rounding up at run-time.
+;
+; also defines a special segment called dos_load_seg which is
+; used to figure out where to load MSDOS (after sysinit)
+
+Bios_Data segment para public 'Bios_Data'
+ assume cs:Bios_Data
+ public BData_end
+BData_end:
+Bios_Data ends
+
+Bios_Code segment para public 'Bios_Code'
+ assume cs:Bios_Code
+ public BCode_end
+BCode_end:
+Bios_Code ends
+
+sysinitseg segment para public 'system_init'
+ assume cs:sysinitseg
+sysinitseg ends
+
+SpcKbdSeg segment para public 'SoftpcKeyboard'
+ assume cs:SpcKbdSeg
+SpcKbdSeg ends
+
+SpcMseSeg segment para public 'SoftpcMouse'
+ assume cs:SpcMseSeg
+SpcMseSeg ends
+
+SpcEmmSeg segment para public 'SoftpcEmm'
+ assume cs:SpcEmmSeg
+ public SI_end
+SI_end:
+SpcEmmSeg ends
+
+
+dos_load_seg segment para public 'dos_load_seg'
+dos_load_seg ends
+
+ end
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msequ.inc b/private/mvdm/dos/v86/doskrnl/bios/msequ.inc
new file mode 100644
index 000000000..bf743846d
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msequ.inc
@@ -0,0 +1,56 @@
+
+ftoobig equ 80h
+fbig equ 40h
+romstatus equ 1
+romread equ 2
+romwrite equ 3
+romverify equ 4
+romformat equ 5
+
+
+rsinit = 0a3h ;rs232 initialization
+ ;9600 baud:no parity:1 stop:8 bit word
+
+lf = 10 ;line feed
+cr = 13 ;carriage return
+backsp = 8 ;backspace
+brkadr = 1bh * 4 ;006c 1bh break vector address
+timadr = 1ch * 4 ;0070 1ch timer interrupt
+dskadr = 1eh * 4 ;address of ptr to disk parameters
+sec9 = 522h ;address of disk parameters
+headsettle= sec9+9 ;address of head settle time
+normsettle= 15 ;normal head settle
+speedsettle= 0 ;speed up settle time
+initspot= 534h ;ibm wants 4 zeros here
+akport = 20h
+eoi = 20h
+
+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
+extra = 22 ;usually a pointer to vol id for error 15
+start_l = 26 ; extended start sector (low)
+start_h = 28 ; extended start sector (high)
+
+
+chrout = 29h
+maxerr = 5
+lstdrv = 504h
+
+bootbias = 200h
+notbusystatus = 10000000b ; not busy
+ackstatus = 01000000b ; acknowledge (for what?)
+nopaperstatus = 00100000b ; no more paper
+.selectedstatus = 00010000b ; the printer said it was selected
+ioerrstatus = 00001000b ; some kinda error
+reserved = 00000110b ; nops
+timeoutstatus = 00000001b ; time out.
+error_unknown_media = 7 ; for use in build bpb call
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msgroup.inc b/private/mvdm/dos/v86/doskrnl/bios/msgroup.inc
new file mode 100644
index 000000000..605fe1314
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msgroup.inc
@@ -0,0 +1,18 @@
+
+tocode macro
+Bios_Data ends
+Bios_Code segment
+ assume cs:Bios_Code
+ endm
+
+todata macro
+Bios_Code ends
+Bios_Data segment
+ assume cs:Bios_Data
+ endm
+
+;align the segment on word boundary to allow for even alignment of data
+
+Bios_Data segment
+ assume cs:Bios_Data
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msinit.asm b/private/mvdm/dos/v86/doskrnl/bios/msinit.asm
new file mode 100644
index 000000000..d4c7b4f42
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msinit.asm
@@ -0,0 +1,288 @@
+ page ,160
+ title msinit for BIOS
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+;
+
+EXTENDEDKEY equ 1 ; use extended keyboard functions
+
+ include version.inc ; set build flags
+ include biosseg.inc ; establish bios segment structure
+
+ include msequ.inc
+ include dossym.inc
+ include dosmac.inc
+ include biostruc.inc
+ include dossvc.inc
+ include vint.inc
+
+; the following segment follows sysinit. It is used to define
+; the location to load MSDOS.SYS into.
+
+dos_load_seg segment para public 'dos_load_seg'
+dos_load_seg ends
+
+ extrn RomVectors:dword
+ extrn NUMROMVECTORS:abs
+ extrn res_dev_list:word
+ extrn keyrd_func:byte ; for mscon. defined in msdata.
+ extrn keysts_func:byte ; for mscon. defined in msdata.
+ extrn endBIOSData:byte
+
+ extrn dosdatasg:word
+
+ extrn Int15:far ; M036
+ extrn int19:far
+ extrn intret:near
+ extrn cbreak:near
+ extrn outchr:near
+ extrn outchr:near
+
+sysinitseg segment
+ assume cs:sysinitseg
+ extrn current_dos_location:word
+ extrn device_list:dword
+ extrn memory_size:word
+ extrn sysinit:far
+sysinitseg ends
+
+Bios_Data_Init segment
+ assume cs:datagrp
+
+;*********************************************************
+; system initialization
+;
+; the entry conditions are established by the bootstrap
+; loader and are considered unknown. the following jobs
+; will be performed by this module:
+;
+; 1. all device initialization is performed
+;
+; 2. a local stack is set up and ds:si are set
+; to point to an initialization table. then
+; an inter-segment call is made to the first
+; byte of the dos
+;
+; 3. once the dos returns from this call the ds
+; register has been set up to point to the start
+; of free memory. the initialization will then
+; load the command program into this area
+; beginning at 100 hex and transfer control to
+; this program.
+;
+;********************************************************
+
+
+
+;===========================================================================
+;
+; entry from boot sector. the register contents are:
+;
+; dl = int 13 drive number we booted from
+; ch = media byte
+; bx = first data sector on disk.
+; ax = first data sector (high)
+; di = sectors/fat for the boot media.
+;
+ public init
+init proc near
+ assume ds:nothing,es:nothing
+
+ FCLI
+ xor ax,ax
+ mov ds,ax
+
+; Save a pack of interrupt vectors...
+
+ push cs
+ pop es ; cannot use cs override for stos
+
+ mov cx, NUMROMVECTORS ; no. of rom vectors to be saved
+ mov si, offset RomVectors ; point to list of int vectors
+next_int:
+ lods byte ptr cs:[si] ; get int number
+ cbw ; assume < 128
+ shl ax, 1
+ shl ax, 1 ; int no * 4
+ mov di, ax
+ xchg si, di
+ lodsw
+ stosw
+ lodsw
+ stosw ; save the vector
+ xchg si, di
+ loop next_int
+
+; set up int 15 for new action ; M036
+
+ mov word ptr ds:[15h*4],offset Int15 ; M036
+ mov ds:[15h*4+2],cs ; M036
+
+
+
+; set up int 19 for new action
+
+ mov word ptr ds:[19h*4],offset int19
+ mov ds:[19h*4+2],cs
+
+;
+ xor dx,dx
+ mov ss,dx
+ mov sp,700h ;local stack
+ FSTI
+ assume ss:nothing
+
+ ; NTVDM we do not intialize the com,prn ports here
+ ; to stay seamless with the host OS
+ ; 15-Sep-1992 Jonle
+ ;
+ ; mov al,3 ; init com4
+ ; call aux_init
+ ; mov al,2 ; init com3
+ ; call aux_init
+ ; mov al,1 ; init com2
+ ; call aux_init
+ ; xor al,al ; init com1
+ ; call aux_init
+ ;
+ ; mov al,2 ; init lpt3
+ ; call print_init
+ ; mov al,1 ; init lpt2
+ ; call print_init
+ ; xor al,al ; init lpt1
+ ; call print_init
+
+ xor dx,dx
+ mov ds,dx ; to initialize print screen vector
+ mov es,dx
+
+ xor ax,ax
+ mov di,initspot
+ stosw ; init four bytes to 0
+ stosw
+
+ mov ax,cs ; fetch segment
+
+ mov ds:word ptr brkadr,offset cbreak ;break entry point
+ mov ds:brkadr+2,ax ;vector for break
+
+ mov ds:word ptr chrout*4,offset outchr
+ mov ds:word ptr chrout*4+2,ax
+
+ mov di,4
+ mov bx,offset intret ;will initialize rest of interrupts
+ xchg ax,bx
+ stosw ;location 4
+ xchg ax,bx
+ stosw ;int 1 ;location 6
+ add di,4
+ xchg ax,bx
+ stosw ;location 12
+ xchg ax,bx
+ stosw ;int 3 ;location 14
+ xchg ax,bx
+ stosw ;location 16
+ xchg ax,bx
+ stosw ;int 4 ;location 18
+
+ mov ds:word ptr 500h,dx ;set print screen & break =0
+ mov ds:word ptr lstdrv,dx ;clean out last drive spec
+
+
+ mov dx,sysinitseg
+ mov ds,dx
+
+ assume ds:sysinitseg
+
+; set pointer to resident device driver chain
+
+ mov word ptr device_list,offset res_dev_list
+ mov word ptr device_list+2,cs
+
+
+ mov current_dos_location,dos_load_seg ; will load MSDOS here
+
+
+ifdef EXTENDEDKEY
+
+; we will check if the system has ibm extended keyboard by
+; looking at a byte at 40:96. if bit 4 is set, then extended key board
+; is installed, and we are going to set keyrd_func to 10h, keysts_func to 11h
+; for the extended keyboard function. use cx as the temporary register.
+
+ xor cx,cx
+ mov ds,cx
+ assume ds:nothing
+ mov cl,ds:0496h ; get keyboard flag
+ test cl,00010000b
+ jz org_key ; orginal keyboard
+ mov byte ptr keyrd_func,10h ; extended keyboard
+ mov byte ptr keysts_func,11h ; change for ext. keyboard functions
+org_key:
+
+endif
+
+ push cs
+ pop ds
+ push cs
+ pop es
+
+ assume ds:datagrp, es:datagrp
+
+ mov di, offset endBIOSData ; BIOS data segment end address
+ shr di,1
+ shr di,1
+ shr di,1
+ shr di,1 ; Converted to segmnet
+ inc di ; para align
+
+ add di,datagrp ; Add segment of BIOS data
+ mov [dosdatasg],di ; di = to be dos data segment
+
+ mov di,dos_load_seg
+
+ SVC SVC_DEMLOADDOS ; di is segment to load DOS
+ ; If it fails it never comes back
+
+ jmp sysinit
+
+init endp
+
+
+;--------------------------------------------------------------------
+
+; al = device number
+
+print_init proc near
+ assume ds:nothing,es:nothing
+
+ cbw
+ mov dx,ax ; get printer port number into dx
+ mov ah,1 ;initalize printer port
+ int 17h ;call rom-bios routine
+ ret
+
+print_init endp
+
+;--------------------------------------------------------------------
+
+aux_init proc near
+ assume ds:nothing,es:nothing
+
+ cbw
+ mov dx,ax
+ mov al,rsinit ;2400,n,1,8 (msequ.inc)
+ mov ah,0 ;initalize aux port
+ int 14h ;call rom-bios routine
+ ret
+
+aux_init endp
+
+Bios_Data_Init ends
+ end
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/msint13.asm b/private/mvdm/dos/v86/doskrnl/bios/msint13.asm
new file mode 100644
index 000000000..a95c05d92
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/msint13.asm
@@ -0,0 +1,214 @@
+ page ,160
+ title MS-DOS BIOS int 2f handler
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+
+; THIS FILE SHOULD BE NAMED INT2f.ASM RATHER THAN INT13.ASM AS I HAVE RIPPED
+; THE INT 13 SUPPORT. TO REDUCE CONFUSION WHEN PICKING FIXES FROM DOS 5.1
+; THE NAME IS RETAINED AS IT IS.
+
+ include version.inc ; set build flags
+ include biosseg.inc ; establish bios segment structure
+
+ include msequ.inc
+ include biostruc.inc
+
+ include msgroup.inc ; establish Bios_Data segment
+ include vint.inc
+
+multMULT equ 4ah
+multMULTGETHMAPTR equ 1
+multMULTALLOCHMA equ 2
+
+
+Win386_RelTS equ 80h
+NT_WAIT_BOP equ 5Ah
+
+bop MACRO callid
+ db 0c4h,0c4h,callid
+endm
+
+;SR;
+; Include file for WIN386 support
+;
+ include win386.inc
+
+
+ extrn SysinitPresent:byte
+ extrn FreeHMAPtr:word
+ extrn MoveDOSIntoHMA:dword
+
+;SR;
+;New variables for Win386 support
+;
+ extrn IsWin386:byte
+ extrn Win386_SI:byte
+ extrn SI_Next:dword
+
+
+; close data, open Bios_code segment
+
+ tocode
+
+ extrn Bios_Data_Word:word
+
+; Int 2f functions to support communication of external block device
+; drivers with msdisk are not supported. It also does'nt support
+; function 13h which replaces the int 13 vector.
+;
+
+ public i2f_handler
+i2f_handler proc far
+ assume ds:nothing,es:nothing
+
+ cmp ah,13h
+ jz i2f_iret
+ cmp ah,8
+ jz i2f_iret
+
+;
+;Check for WIN386 startup and return the BIOS instance data
+;
+ cmp ah,MULTWIN386
+ jz win386call
+
+ cmp ah, multMULT
+ jne i2f_iret
+ jmp handle_multmult
+
+i2f_iret:
+ FIRET
+
+
+;WIN386 startup stuff is done here. If starting up we set our WIN386 present
+;flag and return instance data. If exiting, we reset the WIN386 present flag
+;NOTE: We assume that the BIOS int 2fh is at the bottom of the chain.
+
+win386call:
+ push ds
+ mov ds,cs:Bios_Data_Word
+ assume ds:Bios_Data
+
+ cmp al, Win386_Init ; is it win386 initializing?
+ je Win386Init
+ cmp al, Win386_Exit ; is it win386 exiting?
+ je Win386Exit
+ cmp al, Win386_RelTS ; is it app release timeslice call?
+ jne win_iret ; if not, continue int2f chain
+
+ push ax ; It's the idling case - call MS BOP A
+ xor ax,ax ; with AX = 0
+ bop NT_WAIT_BOP
+ pop ax
+ xor al, al
+ jmp short win_iret
+
+Win386Exit:
+ test dx, 1 ; is it win386 or win286 dos extender?
+ jnz win_iret ; if not win386, then continue
+ and [IsWin386], 0 ; indicate that win386 is not present
+ jmp short win_iret
+
+Win386Init:
+ test dx, 1 ; is it win386 or win286 dos extender?
+ jnz win_iret ; if not win386, then continue
+
+ or [IsWin386], 1 ; Indicate WIN386 present
+ mov word ptr [SI_Next], bx ; Hook our structure into chain
+ mov word ptr [SI_Next + 2], es
+ mov bx, offset Win386_SI ; point ES:BX to Win386_SI
+ push ds
+ pop es
+
+win_iret:
+ pop ds
+ assume ds:nothing
+ jmp i2f_iret ;return back up the chain
+
+handle_multmult:
+ cmp al, multMULTGETHMAPTR
+ jne try_2
+
+ push ds
+ call HMAPtr ; get offset of free HMA
+ mov bx, 0ffffh
+ mov es, bx ; seg of HMA
+ mov bx, di
+ not bx
+ or bx, bx
+ jz @f
+ inc bx
+@@:
+ pop ds
+ jmp i2f_iret
+try_2:
+ cmp al, multMULTALLOCHMA
+ jne try_3
+
+ push ds
+ mov di, 0ffffh ; assume not enough space
+ mov es, di
+ call HMAPtr ; get offset of free HMA
+ assume ds:Bios_Data
+ cmp di, 0ffffh
+ je InsuffHMA
+ neg di ; free space in HMA
+ cmp bx, di
+ jbe @f
+ mov di, 0ffffh
+ jmp short InsuffHMA
+@@:
+ mov di, FreeHMAPtr
+ add bx, 15
+ and bx, 0fff0h
+ add FreeHMAPtr, bx ; update the free pointer
+ jnz InsuffHMA
+ mov FreeHMAPtr, 0ffffh ; no more HMA if we have wrapped
+InsuffHMA:
+ pop ds
+ assume ds:nothing
+ jmp i2f_iret
+try_3:
+ jmp i2f_iret
+i2f_handler endp
+
+;
+;--------------------------------------------------------------------------
+;
+; procedure : HMAPtr
+;
+; Gets the offset of the free HMA area ( with respect to
+; seg ffff )
+; If DOS has not moved high, tries to move DOS high.
+; In the course of doing this, it will allocate all the HMA
+; and set the FreeHMAPtr to past the end of the BIOS and
+; DOS code. The call to MoveDOSIntoHMA (which is a pointer)
+; enters the routine in sysinit1 called FTryToMoveDOSHi.
+;
+; RETURNS : offset of free HMA in DI
+; BIOS_DATA, seg in DS
+;
+;--------------------------------------------------------------------------
+;
+HMAPtr proc near
+ mov ds, Bios_Data_Word
+ assume ds:Bios_Data
+ mov di, FreeHMAPtr
+ cmp di, 0ffffh
+ jne @f
+ cmp SysinitPresent, 0
+ je @f
+ call MoveDOSIntoHMA
+ mov di, FreeHMAPtr
+@@:
+ ret
+HMAPtr endp
+
+
+Bios_Code ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/spcemm.asm b/private/mvdm/dos/v86/doskrnl/bios/spcemm.asm
new file mode 100644
index 000000000..02440d144
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/spcemm.asm
@@ -0,0 +1,167 @@
+;
+; spcemm.asm,
+;
+; 10-Dec-1992 Jonle , adapted from em_drvr.asm from Insignia solutions
+;
+; This code serves as a stub device driver for emm memory manager.
+; Its sole purpose is for apps to be able to identify that an emm driver is
+; loaded and that LIM services are available. This code is linked into the
+; device driver chain contains a strategy, interrupt and device header
+;
+; The driver should only be loaded if emm memory is available
+; from NTVDM.
+;
+
+BOP MACRO callid
+ db 0c4h, 0c4h, callid
+endm
+
+
+;
+; Request Header, for initialization
+;
+REQHEAD STRUC
+ReqLen DB ? ; Length in bytes of request block
+ReqUnit DB ? ; Block Device unit number
+ReqFunc DB ? ; Type of request
+ReqStat DW ? ; Status Word
+REQHEAD ENDS
+
+;
+; Segment definitions for ntio.sys,
+;
+include biosseg.inc
+include vint.inc
+
+SpcEmmSeg segment
+
+ assume cs:SpcEmmSeg,ds:nothing,es:nothing
+
+;
+; SpcEmmBeg - SpcEmmEnd
+;
+; Marks the resident code, anything outside of these markers
+; is discarded after intialization
+; 11-Dec-1992 Jonle
+;
+
+ public SpcEmmBeg
+
+SpcEmmBeg label byte
+
+
+;
+; character device Header
+; must be first in the .sys file
+;
+ dd -1 ;pointer to next device driver
+ dw 8000H ;attribute (plain character device)
+ dw offset STRATEGY ;pointer to device "strategy" routine
+ dw offset Interrupt ;pointer to device "interrupt" routine
+ db 'EMMXXXX0' ;8 byte name DO NOT CHANGE THE NAME
+
+;
+; Request Header address, saved here by strategy routine
+;
+pReqHdr dd ?
+
+
+;
+; Device "strategy" entry point, save request header address
+;
+Strategy proc far
+ mov word ptr cs:pReqHdr, bx
+ mov word ptr cs:pReqHdr+2, es
+ ret
+Strategy endp
+
+
+; EmmIsr - int 67h isr
+;
+EmmIsr: ; LIM Isr
+ bop 67h
+emmiret:
+ FIRET
+
+; ret trap for em function 'alter page map & call'
+EmmRet:
+ bop 68h
+ jmp emmiret
+
+
+
+;----------------------------------------------------------------------
+; Device "interrupt" entry point
+;----------------------------------------------------------------------
+Interrupt PROC FAR
+
+ push es
+ push di
+
+ les di, cs:pReqHdr ; check for valid commands
+ cmp es:[di.ReqFunc], 0ah
+ je validcmd
+ cmp es:[di.ReqFunc], 0
+ je validcmd
+
+ mov ax, 8003h ; we don't handle anything else
+ jmp short irptexit
+
+validcmd:
+ xor ax,ax
+
+irptexit:
+ or ax, 0100h ;tell em we finished
+ mov es:[di.ReqStat],AX ;store status in request header
+
+ pop di
+ pop es
+ ret
+
+Interrupt ENDP
+
+ public SpcEmmEnd
+SpcEmmEnd label byte
+
+ public InitSpcEmm
+;
+; InitSpcEmm Initializes Spc 32 bit memory manager
+; returns ax=0 for success
+;
+; Inputs: ds is expected seg for drv code, cs is temporary sysinitseg
+; Outputs: ax zero for success
+;
+InitSpcEmm proc near
+
+ ; BOP 66 - initialize LIM memory
+ ; pass the address of bop 68 to the em manager
+ ; in ds:dx and to return the number of em pages in BX
+ ;
+ ; NOTE: All EMM options come from pif file
+ ; There are NO command line options
+ xor bx, bx
+ mov dx, offset EmmRet
+ bop 66h
+ cmp bx, 0ffffh ;ffff means incorrect config (eg no 64K gap)
+ je fail
+ cmp bx, 0 ;check expanded memory is available
+ je fail
+
+ ; set up IVT for INT 67h
+ FCLI
+ xor ax, ax
+ mov es, ax
+ mov bx, offset EmmIsr
+ mov word ptr es:[67h*4], bx
+ mov word ptr es:[(67h*4)+2], ds
+ FSTI
+
+ ret
+fail:
+ mov ax, 0ffffh
+ ret
+
+InitSpcEmm endp
+
+SpcEmmSeg ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/spckbd.asm b/private/mvdm/dos/v86/doskrnl/bios/spckbd.asm
new file mode 100644
index 000000000..4e559facf
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/spckbd.asm
@@ -0,0 +1,2343 @@
+;******************************************************************************
+;
+; Copyright (c) 1992 Insignia Solutions Ltd.
+;
+; Program:
+;
+; Purpose:
+;
+; Version:
+;
+; Author: Dave Bartlett
+; Modifications:
+; 1) Tim June 92. Changes to get DEC PC working. Take over
+; IVT entries 6h (illegal instruction), 11h (equipment
+; check), 16h (keyboard BIOS), 17h (printer),
+; 42h (default video).
+; 2) Tim June 92. Changed version to 1.11
+; 3) Tim June 92. Avoid accesses to host ROM as far as
+; possible. Take over lots of IVT entries and continue to
+; point them at this driver.
+; 4) Tim July 92. Version num 1.12, put pseudo ROM stuff back in.
+; 5) Tim July 92. v 1.13, use SoftPC video BIOS when windowed.
+;
+; 6) 12-Sep-1992 Jonle, Merged with ntio.sys
+; cleanup usage of assumes espcially with ES
+; optimized loading of IVT
+; other general cleanup
+;
+; This obj module is intially loaded in a temporary memory location
+; along with ntio.sys. Ntio.sys will copy the resident code (marked by
+; SpcKbdBeg, SpcKbdEnd) into the permanent memory location which resides
+; just below the normal device drivers loaded by config.sys.
+;
+; The nonresident intialization code is run with CS= temp seg
+; and DS= final seg.
+;
+;******************************************************************************
+
+
+.286
+
+include vint.inc
+
+;================================================================
+; Macros and includes
+;================================================================
+
+bop MACRO callid
+ db 0c4h,0c4h,callid
+endm
+
+
+BIOS_CPU_QUIT equ 0FEh
+BIOS_KB_INT equ 9
+BIOS_INT15 equ 15h
+BIOS_PRINTER_IO equ 17h
+UNEXP_BOP equ 2
+RTC_WAIT_FLAG equ 0a0h ; offset of rtc_wait_flag in bios data seg
+VERSIONID equ 0BEEFh
+
+FULLSCREEN equ 1
+STREAM_IO equ 2
+MAX_VIDEO_FUNC equ 1Ch
+GET_FONT_FUNC equ 11h
+
+VID_MODECHANGE equ 0
+MOUSE_LIGHT_PEN equ 4
+MIN_MOUSE_FUNC equ 0F0H
+MAX_MOUSE_FUNC equ 0F7H
+XTRA_MOUSE_FUNC equ 0FAH
+MS_VIDEO_STRING equ 13FFH
+
+MOUSE_VID_BOP equ 0BEh
+EGA_VIDEO_BOP equ 42h
+
+PRT_NOTBUSY equ 80h
+PRT_NUM_PORTS equ 3
+PRT_STATE_READY equ 0
+PRT_IRQ equ 10h
+PRT_LPT_BUSY equ 1
+
+TIMER_LOW equ 6ch
+TIMER_HIGH equ 6eh
+TIMER_OVFL equ 70h
+MOTOR_STATUS equ 3fh
+MOTOR_COUNT equ 40h
+
+; Keyboard buf ptrs
+BUFFER_HEAD equ 1ah
+BUFFER_TAIL equ 1ch
+BUFFER_START equ 80h
+BUFFER_END equ 82h
+
+; kb_flag and LED bits
+KB_FLAG equ 17h
+CAPS_STATE equ 40h
+NUM_STATE equ 20h
+SCROLL_STATE equ 10h
+
+KB_FLAG_1 equ 18h
+
+KB_FLAG_2 equ 97h
+KB_LEDS equ 07h ; Keyboard LED state bits
+KB_PR_LED equ 40h ; Mode indicator update
+
+
+KB_FLAG_3 equ 96h
+LC_E1 equ 01h
+LC_E0 equ 02h
+
+
+
+
+;..............................................keyboard constants
+
+; bits in kb_flag
+ RIGHT_SHIFT = 1
+ LEFT_SHIFT = 2
+ CTL_SHIFT = 4
+ ALT_SHIFT = 8
+
+
+; bit in kb_flag_1
+ HOLD_STATE = 8
+ SCROLL_SHIFT = 10h
+ NUM_SHIFT = 20h
+ CAPS_SHIFT = 40h
+ INS_SHIFT = 80h
+ SYS_SHIFT = 04h
+
+
+; IBM scan codes
+ CTL_KEY = 29
+ LEFT_SHIFTKEY = 42
+ RIGHT_SHIFTKEY = 54
+ ALT_KEY = 56
+ CAPS_KEY = 58
+ NUM_KEY = 69
+ SCROLL_KEY = 70
+ INS_KEY = 82
+
+
+
+;
+; Segment definitions for ntio.sys,
+;
+include biosseg.inc
+
+
+SpcKbdSeg segment
+
+ assume cs:SpcKbdSeg,ds:nothing,es:nothing
+
+;
+; SpcKbdBeg - SpcKbdEnd
+;
+; Marks the resident code, anything outside of these markers
+; is discarded after intialization
+; 13-Sep-1992 Jonle
+;
+ public SpcKbdBeg
+
+SpcKbdBeg label byte
+
+;
+; Reduced data table for Video 7 modes 0 and 2.
+; This table is extracted from our video7 ROM. Only text modes are
+; required, mode 0 and 1 are identical as are modes 2 and 3.
+;
+ega_parm_setup:
+
+;--40x25--
+ DB 40,24,16 ; width,height,character height
+ DW 00800H ; Page size in bytes
+
+ DB 008H, 003H, 000H, 002H ; Sequencer Parameters
+
+ DB 067H ;Misc Reg
+
+; CRTC Parameters
+ DB 02dH, 027H, 028H, 090H, 02bH
+ DB 0a0H, 0bfH, 01fH, 000H, 04fH
+ DB 00dH, 00eH, 000H, 000H, 000H
+ DB 000H, 09cH, 0aeH, 08fH, 014H
+ DB 01fH, 096H, 0b9H, 0a3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 001H, 002H, 003H, 004H
+ DB 005H, 014H, 007H, 038H, 039H
+ DB 03aH, 03bH, 03cH, 03dH, 03eH
+ DB 03fH, 00cH, 000H, 00fH, 008H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 010H, 00eH, 000H, 0ffH
+
+;--80x25--
+ DB 80,24,16 ; width,height,character height
+ DW 01000H ; Page size in bytes
+
+ DB 000H, 003H, 000H, 002H ; Sequencer Parameters
+
+ DB 067H ;Misc Reg
+
+; CRTC Parameters
+ DB 05fH, 04fH, 050H, 082H, 055H
+ DB 081H, 0bfH, 01fH, 000H, 04fH
+ DB 00dH, 00eH, 000H, 000H, 000H
+ DB 000H, 09cH, 08eH, 08fH, 028H
+ DB 01fH, 096H, 0b9H, 0a3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 001H, 002H, 003H, 004H
+ DB 005H, 014H, 007H, 038H, 039H
+ DB 03aH, 03bH, 03cH, 03dH, 03eH
+ DB 03fH, 00cH, 000H, 00fH, 008H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 010H, 00eH, 000H, 0ffH
+
+;--80x25 mono--
+ DB 80,24,16 ; width,height,character height
+ DW 01000H ; Page size in bytes
+
+ DB 000H, 003H, 000H, 003H ; Sequencer Parameters
+
+ DB 0a6H ;Misc Reg
+
+; CRTC Parameters
+ DB 05fH, 04fH, 050H, 082H, 055H
+ DB 081H, 0bfH, 01fH, 000H, 04dH
+ DB 00bH, 00cH, 000H, 000H, 000H
+ DB 000H, 083H, 0a5H, 05dH, 028H
+ DB 00dH, 063H, 0baH, 0a3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 008H, 008H, 008H, 008H
+ DB 008H, 008H, 008H, 010H, 018H
+ DB 018H, 018H, 018H, 018H, 018H
+ DB 018H, 00eH, 000H, 00fH, 008H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 010H, 00aH, 000H, 0ffH
+
+; Mode b (font load)
+
+ DB 5eh,32H,8 ; width,height,character height
+ DW 09700H ; Page size in bytes
+
+ DB 001H, 00fH, 000H, 006H ; Sequencer Parameters
+
+ DB 0e7H ;Misc Reg
+
+; CRTC Parameters
+ DB 06dH, 05dH, 05eH, 090H, 061H
+ DB 08fH, 0bfH, 01fH, 000H, 040H
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 000H, 0a2H, 08eH, 099H, 02fH
+ DB 000H, 0a1H, 0b9H, 0e3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 001H, 002H, 003H, 004H
+ DB 005H, 014H, 007H, 038H, 039H
+ DB 03aH, 03bH, 03cH, 03dH, 03eH
+ DB 03fH, 001H, 000H, 00fH, 000H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 000H, 005H, 00fH, 0ffH
+
+
+;--350 scanline 40x25
+ DB 40,24,14 ; width,height,character height
+ DW 00800H ; Page size in bytes
+
+ DB 009H, 003H, 000H, 002H ; Sequencer Parameters
+
+ DB 0a3H ;Misc Reg
+
+; CRTC Parameters
+ DB 02dH, 027H, 028H, 090H, 02bH
+ DB 0a0H, 0bfH, 01fH, 000H, 04dH
+ DB 00bH, 00cH, 000H, 000H, 000H
+ DB 000H, 083H, 0a5H, 05dH, 014H
+ DB 01fH, 063H, 0baH, 0a3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 001H, 002H, 003H, 004H
+ DB 005H, 014H, 007H, 038H, 039H
+ DB 03aH, 03bH, 03cH, 03dH, 03eH
+ DB 03fH, 008H, 000H, 00fH, 000H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 010H, 00eH, 000H, 0ffH
+
+;--350 scanline 80x25
+ DB 80,24,14 ; width,height,character height
+ DW 01000H ; Page size in bytes
+
+ DB 001H, 003H, 000H, 002H ; Sequencer Parameters
+
+ DB 0a3H ;Misc Reg
+
+; CRTC Parameters
+ DB 05fH, 04fH, 050H, 082H, 055H
+ DB 081H, 0bfH, 01fH, 000H, 04dH
+ DB 00bH, 00cH, 000H, 000H, 000H
+ DB 000H, 083H, 0a5H, 05dH, 028H
+ DB 01fH, 063H, 0baH, 0a3H, 0ffH
+
+; Attribute parameters
+ DB 000H, 001H, 002H, 003H, 004H
+ DB 005H, 014H, 007H, 038H, 039H
+ DB 03aH, 03bH, 03cH, 03dH, 03eH
+ DB 03fH, 008H, 000H, 00fH, 000H
+
+; Graph parameters
+ DB 000H, 000H, 000H, 000H, 000H
+ DB 010H, 00eH, 000H, 0ffH
+
+;
+; End of baby mode table.
+;
+; Table of VGA bios 'capability' info for func 1b to point at.
+vga_1b_table db 07fh, 060h, 00fh, 000h, 000h, 000h, 000h, 007h
+ db 002h, 008h, 0ffh, 00eh, 000h, 000h, 03fh, 000h
+
+; Configuration table for INT 15 Func C0 to point at.
+conf_table dw 008h
+;; db 0fch, 002h, 000h, 070h, 000h, 000h, 000h, 000h
+ db 0fch, 002h, 074h, 070h, 000h, 000h, 000h, 000h
+
+
+PRT_BUF_SIZE equ 255
+
+;================================================================
+; Printer status table
+;================================================================
+prt_status db PRT_NUM_PORTS dup (?)
+prt_state db PRT_NUM_PORTS dup (?)
+prt_control db PRT_NUM_PORTS dup (?)
+prt_lpt_stat db PRT_NUM_PORTS dup (?)
+cur_buf_size dw PRT_BUF_SIZE
+prt_data_buf db PRT_BUF_SIZE dup (?) ; buffer in the 16bit side for perf.
+cur_lpt db 0ffh ; buffer is not being used
+cur_count dw ?
+cur_busy db 0 ; initially not busy
+
+;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+; Keyboard tables
+;::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
+
+
+shift_keys: ;K6
+ DB INS_KEY,CAPS_KEY,NUM_KEY,SCROLL_KEY
+ DB ALT_KEY,CTL_KEY,LEFT_SHIFTKEY,RIGHT_SHIFTKEY
+
+shift_masks: ;K7
+ DB INS_SHIFT,CAPS_SHIFT,NUM_SHIFT,SCROLL_SHIFT
+ DB ALT_SHIFT,CTL_SHIFT,LEFT_SHIFT,RIGHT_SHIFT
+
+ctl_n_table: ;K8
+ DB 27, -1, 0, -1, -1, -1, 30, -1
+ DB -1, -1, -1, 31, -1, 127, 148, 17
+ DB 23, 5, 18, 20, 25, 21, 9, 15
+ DB 16, 27, 29, 10, -1, 1, 19, 4
+ DB 6, 7, 8, 10, 11, 12, -1, -1
+ DB -1, -1, 28, 26, 24, 3, 22, 2
+ DB 14, 13, -1, -1, -1, -1, 150, -1
+ DB ' ', -1
+
+ctl_f_table: ;K9
+ DB 94, 95, 96, 97, 98, 99, 100, 101
+ DB 102, 103, -1, -1, 119, 141, 132, 142
+ DB 115, 143, 116, 144, 117, 145, 118, 146
+ DB 147, -1, -1, -1, 137, 138
+
+lowercase:
+ DB 27, '1', '2', '3', '4', '5', '6', '7', '8', '9' ;K10
+ DB '0', '-', '=', 8, 9, 'q', 'w', 'e', 'r', 't'
+ DB 'y', 'u', 'i', 'o', 'p', '[', ']', 13, -1, 'a'
+ DB 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', 39
+ DB 96, -1, 92, 'z', 'x', 'c', 'v', 'b', 'n', 'm'
+ DB ',', '.', '/', -1, '*', -1, ' ', -1
+
+lc_tbl_scan:
+ DB 59, 60, 61, 62, 63, 64, 65, 66, 67, 68
+ DB -1, -1
+
+base_case:
+ DB 71, 72, 73, -1, 75, -1, 77, -1, 79, 80
+ DB 81, 82, 83, -1, -1, 92, 133, 134 ;K15
+
+uppercase: ;K11
+ DB 27, '!', '@', '#', '$', '%', '^', '&', '*', '('
+ DB ')', '_', '+', 8, 0, 'Q', 'W', 'E', 'R', 'T'
+ DB 'Y', 'U', 'I', 'O', 'P', '{', '}', 13, -1, 'A'
+ DB 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '"'
+ DB 126, -1, '|', 'Z', 'X', 'C', 'V', 'B', 'N', 'M'
+ DB '<', '>', '?', -1, 0, -1, ' ', -1;
+
+ucase_scan:
+ DB 84, 85, 86, 87, 88, 89, 90, 91, 92, 93
+ DB -1, -1
+
+numb_state:
+ DB '7', '8', '9', '-', '4', '5', '6', '+', '1', '2' ;K14
+ DB '3', '0', '.' , -1, -1, 124, 135, 136
+
+alt_table:
+ DB 82, 79, 80, 81, 75, 76, 77, 71, 72, 73 ;K30
+ DB 16, 17, 18, 19, 20, 21, 22, 23, 24, 25
+ DB 30, 31, 32, 33, 34, 35, 36, 37, 38, 44
+ DB 45, 46, 47, 48, 49, 50
+
+;================================================================
+; Keyboard break caller
+;================================================================
+
+keyboard_break_caller:
+ int 1bh ;keyboard break
+ bop %BIOS_CPU_QUIT
+
+;================================================================
+; Print screen caller
+;================================================================
+
+print_screen_caller:
+ int 5h ;print screen
+ bop %BIOS_CPU_QUIT
+
+;================================================================
+; Int 15 caller
+;================================================================
+; Tim modified int 15 caller. Copied from BIOS2. It gives CPU
+; a chance to take other interrupts. Suspect the extra jumps are
+; now harmless with IRET hooking.
+;int15h_caller:
+ ;int 15h
+ ;bop %BIOS_CPU_QUIT
+int15h_caller:
+ int 15h ; Cassette I/O.
+ jmp k1
+k1: jmp k2
+k2: jmp k3
+k3: BOP %BIOS_CPU_QUIT
+
+;================================================================
+; Unexpected interrupt handler
+;================================================================
+
+unexp_int:
+ bop %UNEXP_BOP
+ jmp iret_com
+
+;================================================================
+;Int 13 caller
+;================================================================
+int13h_caller:
+ int 13h
+ bop %BIOS_CPU_QUIT
+
+
+;================================================================
+; New interrupt 9h handler
+;================================================================
+
+int09h_vector:
+ push ax
+ xor ax, ax
+ bop %BIOS_KB_INT
+ pop ax
+ jmp iret_com
+
+ ; CarbonCopy traces int 9 in order to gain control
+ ; over where the kbd data is coming from (the physical kbd
+ ; or the serial link) The kbd_inb instruction must be visible
+ ; in the 16 bit code via int 1 tracing, for CarbonCopy to work.
+ ; Softpc assumes the exact location of the first nop
+ ; relative to the bop just above.
+ nop
+ nop
+ in al, 60h ; keyba_io_buffers
+ nop
+ nop
+ BOP %BIOS_CPU_QUIT
+
+
+
+
+
+;=================================================================
+; IRET hooks bop table
+;=================================================================
+
+
+IRET_HOOK = 5dh ;IRET hook BOP
+
+iret_bop_table:
+ bop %IRET_HOOK
+ db 0
+iret_end_first_entry:
+ bop %IRET_HOOK
+ db 1
+ bop %IRET_HOOK
+ db 2
+ bop %IRET_HOOK
+ db 3
+ bop %IRET_HOOK
+ db 4
+ bop %IRET_HOOK
+ db 5
+ bop %IRET_HOOK
+ db 6
+ bop %IRET_HOOK
+ db 7
+ bop %IRET_HOOK
+ db 8
+ bop %IRET_HOOK
+ db 9
+ bop %IRET_HOOK
+ db 10
+ bop %IRET_HOOK
+ db 11
+ bop %IRET_HOOK
+ db 12
+ bop %IRET_HOOK
+ db 13
+ bop %IRET_HOOK
+ db 14
+ bop %IRET_HOOK
+ db 15
+
+;================================================================
+; New interrupt 13h handler
+;================================================================
+
+int13h_vector:
+ cmp dl,80h ; 0 - 7f are floppy commands
+ jb int40h_vector
+
+ cmp ah,2 ; we fail the direct access commands
+ jb diskcmd ; read/write/seek/verify/format
+ cmp ah,5 ; but let others go through (disk tables etc)
+ jbe faildisk
+ cmp ah,0ah
+ jb diskcmd
+ cmp ah,0ch
+ ja diskcmd
+faildisk:
+ push ax
+ mov ax,1 ; direct access error panel
+ bop 59h
+ pop ax ; preserve AL for safety sake
+ mov ah, 80h ; error - timeout
+ stc
+ retf 2
+
+diskcmd:
+ bop 13h
+ retf 2
+
+;================================================================
+; New interrupt 40h handler
+;================================================================
+
+int40h_vector:
+; cmp ah,2 ; we fail the direct access commands
+; jb flopcmd ; read/write/seek/verify/format
+; cmp ah,5 ; but let others go through (disk tables etc)
+; jbe failflop
+; cmp ah,0ah
+; jb flopcmd
+; cmp ah,0ch
+; ja flopcmd
+failflop:
+; push ax
+; mov ax,0 ; direct access error panel
+; bop 59h
+; pop ax
+; mov ah, 80h ; error - timeout
+; stc
+; retf 2
+
+flopcmd:
+ bop 40h
+ retf 2
+
+;; waiting for diskette interrupt
+wait_int:
+ push ds
+ push ax
+ push cx
+ mov ax, 40h
+ mov ds, ax
+ mov cx, 10h
+wait_int_loop:
+ mov al, [3Eh]
+ test al, 80h
+ loopz wait_int_loop
+ pop cx
+ pop ax
+ pop ds
+ bop %BIOS_CPU_QUIT
+
+;; floppy parameters table
+floppy_table label byte
+
+ DB 01 ;; 360KB in 360KB
+ DW OFFSET md_tbl1
+ DB 82H ;; 360KB in 1,2MB
+ DW OFFSET md_tbl2
+ DB 02 ;; 1.2MB in 1.2MB
+ DW OFFSET md_tbl3
+ DB 03 ;; 720KB in 720KB
+ DW OFFSET md_tbl4
+ DB 84H ;; 720KB in 1.44MB
+ DW OFFSET md_tbl5
+ DB 04 ;; 1.44MB in 1.44MB
+ DW OFFSET md_tbl6
+ DB 85h ;; 720KB in 2.88MB
+ DW OFFSET md_tbl7
+ DB 85h ;; 1.44MB in 2.88MB
+ DW OFFSET md_tbl8
+ DB 5 ;; 2.88MB in 2.88MB
+ DW OFFSET md_tbl9
+
+
+md_tbl1:
+ ; MEDIA = 40 track low data rate; DRIVE = 40 track low data rate
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 9 ; sectors/track
+ DB 02Ah ; gap length
+ DB 0FFh ; data length
+ DB 050h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 39 ; maximum track number
+ DB 80H ; transfer rate
+
+md_tbl2:
+ ; MEDIA = 40 track low data rate; DRIVE = 80 track high data rate
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 9 ; sectors/track
+ DB 02Ah ; gap length
+ DB 0FFh ; data length
+ DB 050h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 39 ; maximum track number
+ DB 40H ; transfer rate
+
+md_tbl3:
+ ; MEDIA = 80 track high data rate; DRIVE = 80 track high data rate
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 15 ; sectors/track
+ DB 01Bh ; gap length
+ DB 0FFh ; data length
+ DB 054h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 79 ; maximum track number
+ DB 0 ; transfer rate
+
+md_tbl4:
+ ; MEDIA = 80 track low data rate; DRIVE = 80 track low data rate
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 9 ; sectors/track
+ DB 02Ah ; gap length
+ DB 0FFh ; data length
+ DB 050h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start ime
+ DB 79 ; maximum track number
+ DB 80H ; transfer rate
+
+md_tbl5:
+ ; MEDIA = 80 track low data rate; DRIVE = 80 track high data rate
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 9 ; sectors/track
+ DB 02Ah ; gap length
+ DB 0FFh ; data length
+ DB 050h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 79 ; maximum track number
+ DB 80H ; transfer rate
+
+md_tbl6:
+ ; MEDIA = 80 track high data rate; DRIVE = 80 track high data rate
+ DB 0AFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 18 ; sectors/track
+ DB 01Bh ; gap length
+ DB 0FFh ; data length
+ DB 06Ch ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 79 ; maximum track number
+ DB 0 ; transfer rate
+
+md_tbl7:
+ ;MEDIA = 80 tracks, 9 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
+
+ DB 0E1h ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 9 ; sectors/track
+ DB 02Ah ; gap length
+ DB 0FFh ; data length
+ DB 050h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start ime
+ DB 79 ; maximum track number
+ DB 80H ; transfer rate
+md_tbl8:
+ ;MEDIA = 80 tracks, 18 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
+
+ DB 0D1h ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 18 ; sectors/track
+ DB 01Bh ; gap length
+ DB 0FFh ; data length
+ DB 065h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 79 ; maximum track number
+ DB 0 ; transfer rate
+
+md_tbl9:
+ ;MEDIA = 80 tracks, 36 sectors/track; DRIVE = 80 tracks, 36 sectotrs per track
+
+ DB 0A1h ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 36 ; sectors/track
+ DB 038h ; gap length
+ DB 0FFh ; data length
+ DB 053h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+ DB 79 ; maximum track number
+ DB 0C0h ; transfer rate
+
+
+
+floppy_table_len equ $ - floppy_table
+
+bios_floppy_table label byte
+ DB 0DFh ; 1st specify byte
+ DB 2 ; 2nd specify byte
+ DB 25H ; motor off wait time
+ DB 2 ; ie 2 bytes/sector
+ DB 18 ; sectors/track
+ DB 01Bh ; gap length
+ DB 0FFh ; data length
+ DB 054h ; gap length for format
+ DB 0F6h ; fill byte for format
+ DB 15 ; head settle time/ms
+ DB 8 ; ie 1s motor start time
+bios_floppy_table_len equ $ - bios_floppy_table
+
+;===============================================================
+; New interrupt 15h handler
+;================================================================
+; Tim, modified this to be like a "normal" SoftPC ROM.
+; Copied from BIOS2, but rtc_wait_flag is now referenced via ES not
+; DS.
+;
+; 17-Sep-1992 Jonle , ES ref to rtc_wait was change from assume ES
+; to seg overides to prevent accidents in assuming.
+;
+
+;int15h_vector:
+ ;bop %BIOS_INT15
+ ;iret
+;;;;;;;;;STF hide this int15h_vector:
+int15h_vector:
+ call DOSTI
+ cmp ah, 88h
+ je lbl1
+ cmp ah, 91h
+ je lbl1
+ cmp ah, 86h
+ je lbl2
+ BOP 15h
+ RETF 2
+lbl1: BOP 15h
+ jmp iret_com
+lbl2: BOP 15h
+ jc lbl5
+ push cx
+ push dx
+ push es ; Tim, save ES not DS.
+ mov ax, 40h ; point es to biosdata
+ mov es, ax
+ xchg dx, cx
+lbl3:
+ test byte ptr es:[RTC_WAIT_FLAG], 080h ; check for end of wait
+ loopz lbl3 ; dec timeout delay
+ jnz lbl4 ; exit if wait ended
+ sub dx, 1 ; dec error timeout counter
+ jnc lbl3 ; loop till counters timeout
+lbl4:
+ mov byte ptr es:[RTC_WAIT_FLAG], 0 ; set function inactive
+ pop es ; Kipper, restore ES not DS.
+ pop dx
+ pop cx
+ clc
+lbl5:
+ RETF 2
+
+;=================================================================
+; Regular SoftPC int 17 handler (especially important for DEC PCs)
+;=================================================================
+
+int17h_vector:
+;
+; Do a get status purely in 16-bit code but only if the printer is ready and
+;we don't have interrupts turned on. Otherwise we must do a BOP and let 32-bit
+;code handle it.
+;
+ push si
+ push dx
+ push ax
+ mov ax, dx ; dx = adapter no., ensure it is no
+ xor dx, dx ; greater than PRT_NUM_PORTS.
+ mov si, PRT_NUM_PORTS
+ div si
+ mov si, dx
+ pop ax
+ cmp ah, 2
+ je do_prt_status
+ or ah,ah
+ je do_write
+ jmp do_print_bop
+
+do_prt_status:
+ cmp byte ptr cs:[si + prt_state], PRT_STATE_READY
+ jne do_print_bop
+ test byte ptr cs:[si + prt_control], PRT_IRQ
+ je get_status
+ jmp short do_print_bop
+
+do_write:
+ cmp byte ptr cs:[cur_lpt],0ffh
+ jne check_lpti
+ mov byte ptr cs:[cur_lpt],dl
+ mov word ptr cs:[cur_count],0
+ mov byte ptr cs:[cur_busy],0ffh
+ jmp short do_print_bop
+check_lpti:
+ cmp byte ptr cs:[cur_lpt],dl
+ je buf_ok
+ push si
+ xor si,si
+ bop %BIOS_PRINTER_IO
+ pop si
+ mov word ptr cs:[cur_count],0
+ mov byte ptr cs:[cur_lpt],dl
+ jmp short do_print_bop
+buf_ok:
+ mov dx,word ptr cs:[cur_count]
+ mov si,dx
+ mov byte ptr cs:[si + prt_data_buf],al
+ inc word ptr cs:[cur_count]
+ cmp word ptr cs:[cur_count],PRT_BUF_SIZE
+ jne no_flushing
+ xor si,si ; sub-function 0 for this bop
+ bop %BIOS_PRINTER_IO
+ test ah,08h
+ jz flush_ok
+ dec word ptr cs:[cur_count]
+ jmp short int17h_end
+flush_ok:
+ mov word ptr cs:[cur_count],0
+no_flushing:
+ mov ah,90h
+ jmp short int17h_end
+
+
+ ;
+ ; Risc int17 entry point, provided to cope with si subfunctions
+ ;
+int17h_RiscVector:
+
+ push si
+ push dx
+
+do_print_bop:
+ mov si,0ffffh ; sub-function 1
+ bop %BIOS_PRINTER_IO
+ jmp int17h_end
+
+get_status:
+ test byte ptr cs:[si + prt_lpt_stat], PRT_LPT_BUSY
+ jne noset
+ or byte ptr cs:[si + prt_status], PRT_NOTBUSY
+noset:
+ mov ah, cs:[si + prt_status]
+ and ah, 0f8h
+ xor ah, 48h
+int17h_end:
+ pop dx
+ pop si
+iret_com:
+ FIRET
+
+
+;=================================================================
+; Pseudo-ROM vectuz, copied from BIOS2.ASM
+;=================================================================
+
+dummy_vector: ; Copied from BIOS2.ASM
+ jmp iret_com
+illegal_bop_vector:
+ bop 72h
+ jmp iret_com
+intD11_vector:
+ bop 72h
+ jmp iret_com
+
+int05h_vector: ; Print Screen func. copied from BIOS2.ASM
+ call DOSTI
+ PUSH AX
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH DS
+ ;::::::::::::::::::::::::::::::::: Setup DS to point to BIOS data area
+ MOV AX,40H
+ MOV DS,AX
+ ;::::::::::::::::::::::::::::::: Print screen already in progress ????
+ CMP BYTE PTR DS:[100H],1
+ JE end_print
+ ;::::::::::::::::::::::::::::::::::::::::::::::: Set print screen busy
+ MOV BYTE PTR DS:[100h],1
+
+ ;::::: fetch no rows, columns, curr page from bios data area
+ mov ch, byte ptr ds:[4ah] ; cols
+ mov cl, byte ptr ds:[84h] ; rows
+ mov bh, byte ptr ds:[62h] ; curr page num
+
+
+ ;::::::::::::::::::::::::::::::::::: Print line feed / carriage return
+ CALL print_crlf
+ ;:::::::::::::::::::::::::::::::::::::::::: Get current cursor postion
+ PUSH CX
+ MOV AH,3
+ INT 10H
+ POP CX
+ ;::::::::::::::::::::::::::::::::::::::::::::::::: Save cursor postion
+ PUSH DX ;save current cursor postion
+ XOR DH,DH ;current row being processed
+start_print_col:
+ XOR DL,DL ;current column being processed
+ ;::::::::::::::::::::::::::::::::::::::::::::::: Start printing screen
+start_print_row:
+ ;:::::::::::::::::::::::::::::::::::::::::::::::::: Set cursor postion
+ PUSH DX ;save current row,column
+ MOV AH,2
+ INT 10H
+ ;::::::::::::::::::::::::::::::::::: Read character at current postion
+ MOV AH,8
+ INT 10H
+ ;::::::::::::::::::::::::::::::::::::::::::::::::::::: Print character
+ OR al,al
+ JNZ print_char
+ MOV AL,20H
+print_char:
+ XOR DX,DX
+ XOR AH,AH
+ INT 17H
+ ;:::::::::::::::::::::::::::::::::::::::::::: Check for printer errors
+ POP DX ;Restore current row,column
+ AND AH,25H
+ JZ cont2
+ MOV BYTE PTR DS:[100H],0FFH
+ JMP short exit_print
+ ;::::::::::::::::::::::::::::::::::::::::::: Move to mext print column
+cont2:
+ INC DL ;Inc current column
+ CMP DL,CH ;Current col compared to no. of cols
+ JB start_print_row
+ ;:::::::::::::::::::::::::::::::::::::::::: End of column, print CR/LF
+ CALL print_crlf
+ ;:::::::::::::::::::::::::::::::::::::::::::::::::: More rows to print
+ INC DH ;Inc current row
+ CMP DH,CL ;Current row compared to no. of rows
+ JBE start_print_col
+ MOV BYTE PTR DS:[0100H],0
+ ;:::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Exit print
+exit_print:
+ ;:::::::::::::::::::::::::::::::::::::; Restore orginal cursor postion
+ POP DX
+ MOV AH,2
+ INT 10H
+ ;:::::::::::::::::::::::::::::::::::::::::::::::::::: Tidy up and exit
+end_print:
+ POP DS
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+ jmp iret_com
+
+ ;::::::::::::::::::::::::::::::::::::::::::::::::::::::::: Print CR/LF
+print_crlf:
+ PUSH DX
+ XOR DX,DX
+ MOV AX,0DH
+ INT 17H
+ XOR DX,DX
+ MOV AX,0AH
+ INT 17H
+ POP DX
+ RET
+; End of int05_vector (print screen).
+
+int06h_vector:
+ bop 06h
+ jmp iret_com
+
+; IVT 7 is set to unexpected interrupt.
+
+
+int08h_vector:
+; The usual int8 handler modified for optimum performance.
+; - stays in 16 bit code (no BOP)
+; - keeps interrupts off when not needed
+; - calls int 1c directly
+;
+ call DOCLI ; make sure interrupts stay off until iret
+
+ push es
+ push ds ; save some registers
+ push ax
+ push dx
+
+ mov ax, 40h ; set ds to bios data area
+ mov ds, ax
+ xor ax, ax
+ mov es, ax ; set es to IVT seg for i1c callout
+
+ inc word ptr ds:[TIMER_LOW] ; inc time counters
+ jnz i8v1
+ inc word ptr ds:[TIMER_HIGH]
+i8v1:
+ cmp word ptr ds:[TIMER_HIGH], 018h ; check for 24 hours, wrap point
+ jnz i8v2
+ cmp word ptr ds:[TIMER_LOW], 0b0h
+ jnz i8v2
+
+
+ mov word ptr ds:[TIMER_HIGH], ax ; 24 hour wrap, set OVFL bit
+ mov word ptr ds:[TIMER_LOW], ax
+ mov byte ptr ds:[TIMER_OVFL], 1
+ or al, 8 ; set Overflow bit for fake flags
+
+ ;--- ; skip floppy motor stuff
+
+
+i8v2: ; handle the floppy motor stuff
+ push ax
+ dec byte ptr ds:[MOTOR_COUNT]
+ jnz i8v3
+ and byte ptr ds:[MOTOR_STATUS], 0f0h
+ mov al, 0ch
+ mov dx, 03f2h ; costly outb happens 1/256 timer tics...
+ out dx, al
+
+i8v3:
+ pop ax
+ ; call int1c user routine directly
+ lahf ; get lobyte of flags for fake flags
+ xchg ah,al
+ push ax ; put fake flags on the stack
+ call dword ptr es:[1ch*4] ; do it!
+ call DOCLI ; make sure interrupts stay off until iret
+
+ mov al, 20h ; send eoi
+ out 20h, al
+
+ pop dx ;restore the stack
+ pop ax
+ pop ds
+ pop es
+
+ jmp iret_com
+
+
+
+int0e_vector:
+ bop 0eh
+ jmp iret_com
+
+DOCLI:
+ FCLI
+ ret
+
+DOSTI:
+ FSTI
+ ret
+
+
+
+
+;-----------------------------------------------------------------------
+;function: sw_video_io
+;
+;description:
+; int10 ah=0e and ax=13ffh handler for "well-behaved" applications which
+; do their video i/o through dos/file or WriteTTy call
+; Since the output won't go to the video hardware, it was called software
+; video.
+;
+;input: whatever to int10
+;
+;output: carry flag = 1 if we have done the function
+; carry flag = 0 if we have not done anything, the caller has
+; to carry on the operation
+;
+;modified: none
+;-----------------------------------------------------------------------
+
+sw_temp db 0
+SW_VIDEO_BUFFER_SEGMENT = 0B000h
+SW_VIDEO_BUFFER_SIZE = 82 * 2
+;; make sure we are in word boundary because they are accessed from
+;; 32bits code
+ EVEN
+sw_video_dirty_count dw 0
+sw_video_busy dw 0
+sw_video_io proc near
+;stop 32bits code from accessing shared variables.
+;We do not bop to 32bits at all unless our buffer doesn't have
+;enough space for the new data. The 32 bits code would refresh
+;our buffer contents to the console periodically.
+;
+ inc cs:sw_video_busy ;indicate we are busy
+ ;this is the basic sync mechanism
+ ;with 32bits stream_io update code
+ cmp ax,13ffh ;secret write string?
+ jne sw_check_write_tty ;no, check for write tty
+ cmp cx, 1
+ je sw_video_string_1
+
+ push si
+ mov si, SW_VIDEO_BUFFER_SIZE
+ sub si, cs:sw_video_dirty_count
+ cmp cx, si
+ jae sw_video_overflow
+
+ push di
+ push cx
+ push dx
+ push ds
+ push es
+ mov dx, es ;ds:di ptr to the string
+ mov ds, dx
+ mov dx, SW_VIDEO_BUFFER_SEGMENT
+ mov es, dx
+ mov dx, cx
+ mov si, di
+ mov di, cs:sw_video_dirty_count
+ cld ;ds:si ptr to the string
+ shr cx, 1 ;cs has the byte count
+ rep movsw
+ adc cl, 0
+ rep movsb
+ add cs:sw_video_dirty_count, dx
+ pop es
+ pop ds
+ pop dx
+ pop cx
+ pop di
+ pop si
+ stc ;tell the caller we've done it
+ dec cs:sw_video_busy
+ ret
+
+sw_video_string_1:
+ push ax
+ mov ah, 0eh
+ mov al, es:[di]
+ call sw_video_write_tty
+ pop ax
+ ret
+;; this should be a rare case as we have a big buffer
+;; we go directly to 32bits and we will take care of it there
+sw_video_overflow:
+ pop si
+ dec cs:sw_video_busy
+ bop EGA_VIDEO_BOP ;not free buffer space
+ stc ;do it on 32bits
+ ret
+
+sw_check_write_tty:
+ cmp ah, 0eh
+ jne sw_mode_change ;we have to enable video h/w
+
+sw_video_write_tty:
+ push si
+ mov si, cs:sw_video_dirty_count ;the current count(index)
+ cmp si, SW_VIDEO_BUFFER_SIZE
+ jae sw_video_overflow
+ push ds
+ mov si, SW_VIDEO_BUFFER_SEGMENT
+ mov ds, si
+ mov si, cs:sw_video_dirty_count
+ mov ds:[si], al ;put it in the buffer
+ inc si
+ mov cs:sw_video_dirty_count, si ;new count, new index
+ pop ds
+ pop si
+sw_video_done:
+ stc
+ dec cs:sw_video_busy
+ ret
+
+sw_mode_change:
+ push ax
+ mov ax, 013FEh ;tell 32bits to initialize
+ bop EGA_VIDEO_BOP ;video hardware for us
+ pop ax
+ clc ;tell caller we didn't do any
+ dec cs:sw_video_busy
+ ret
+sw_video_io endp
+
+;
+; Tim August 92. Video BIOS grabber.
+; Call SPC BIOS when in windowed mode and the host BIOS when in full-screen.
+; Controled by value of 'use_host_int10'.
+; Try to limit bops by validating calling values. Mouse has to get first shot
+; and then video bios.
+;
+
+use_host_int10 db 01h ; native/softpc bios flag
+changing_mode db 01h ; delay handshake if in bios mode change
+
+PUBLIC int10h_vector
+
+int10h_vector:
+ cmp use_host_int10, STREAM_IO
+ jne hw_video_io
+ call sw_video_io
+ jc viddone
+hw_video_io:
+ cmp use_host_int10, FULLSCREEN
+ je nativebios
+
+ cmp ah,VID_MODECHANGE ; mode change??
+ je modechange
+ cmp ah,MAX_VIDEO_FUNC ; range check
+ ja mousecheck ; not a vid func but mouse has higher
+ cmp ah,MOUSE_LIGHT_PEN ; light pen special case
+ je mousebios
+spcbios:
+ bop EGA_VIDEO_BOP ; regular windowed Int 10
+ jmp viddone
+
+mousecheck:
+ cmp ah,MIN_MOUSE_FUNC ; range check mouse fn f0-f7 + fa.
+ jb badvid
+ cmp ah,MAX_MOUSE_FUNC
+ jbe mousebios
+ cmp ah,XTRA_MOUSE_FUNC
+ jne badvid
+
+mousebios: ; call softpc mouse video entrypoint
+ bop MOUSE_VID_BOP
+ jmp viddone
+
+modechange: ; windowed modechange. Mouse gets a look
+ mov changing_mode,1 ; then softpc video bios. If gfx mode then
+ bop MOUSE_VID_BOP ; will go fullscreen
+ ;;;nop
+ ;;;nop ; nops aid debugging
+ ;;;bop EGA_VIDEO_BOP ; will go fullscreen here
+ nop
+ nop
+ push ax ; save video mode which may have top bit set
+ and ax,7fh
+ cmp al,3
+ jbe endmode ; if graphics mode, repeat modechange to setup
+ cmp al,7 ; video card, else fall through
+ je endmode
+ pop ax
+ jmp nativebios
+endmode:
+ pop ax
+ mov changing_mode,0 ; Clear 'mode changing' flag.
+
+viddone:
+ jmp iret_com
+
+badvid: ; unrecognised video func
+ stc
+ jmp viddone
+
+nativebios:
+ mov changing_mode,0 ; Clear 'mode changing' flag.
+ cmp ax,MS_VIDEO_STRING ; ensure not MS special video string fn
+ je ms_wrt_string
+
+ cmp ah,MIN_MOUSE_FUNC ; could be a mouse call
+ jb chk_mse_vid
+ cmp ah,MAX_MOUSE_FUNC ; range check mouse fn f0-f7 + fa.
+ jbe mousebios
+ cmp ah,XTRA_MOUSE_FUNC
+ je mousebios
+ jmp jmp_native ; probably bad func but...
+
+chk_mse_vid:
+ cmp ah,MOUSE_LIGHT_PEN ; mouse handles light pen
+ je mousebios
+ cmp ah,VID_MODECHANGE
+ jne chk_font_change
+ bop MOUSE_VID_BOP ; mouse wants first sniff at mode changes
+ jmp jmp_native ; then fall through
+chk_font_change:
+ cmp ah,GET_FONT_FUNC
+ jne jmp_native
+ bop MOUSE_VID_BOP ; select mouse buffer for new no. of lines
+ ; then fall through
+
+jmp_native:
+
+ db 0EAh ; far jump
+host_int10 dd ? ; to native int 10 vector
+
+ms_wrt_string:
+ push si
+ push di
+ push bp
+go_loop1:
+ mov dx,46h ; looks a good value for flags
+ push dx ; make an iret frame
+ push cs
+ mov bx, offset go_cont
+ push bx
+ mov bx,7 ; set foreground color
+ mov ah,0eh ; set command to write a character
+ mov al,es:[di] ; get char
+ inc di
+ jmp jmp_native ; make far jmp to int 10 vector
+
+go_cont:
+ loop go_loop1 ;repeat until all through
+ pop bp
+ pop di
+ pop si
+ mov ax,1 ; return success
+goto_viddone:
+ jmp viddone
+;
+; int 42 - 'old' video bios entry point. Use same windowed/fullscreen
+; redirection as Int 10 above.
+;
+int42h_vector:
+ cmp use_host_int10, STREAM_IO
+ jne hw_video_io_42
+ call sw_video_io
+ jc goto_viddone
+
+hw_video_io_42:
+ cmp use_host_int10, FULLSCREEN
+ jz maybe_host_42_bios
+
+ bop 10h ; old video bop
+ jmp iret_com
+
+ ; If it's the special BIOS print string function, don't call the
+ ; host video BIOS cos it won't know what we are talking about.
+ ; It's only in our video BIOS.
+maybe_host_42_bios:
+ cmp AH, 013h
+ jnz gogo_host_42_bios
+ cmp AL, 0ffh
+ jz ms_wrt_string ; reuse path from Int 10
+
+gogo_host_42_bios:
+ db 0EAh ; far jump
+host_int42 dd ? ; to native int 42 vector
+
+int10h_caller:
+ int 10h ; Re-entrant video entry point.
+ bop 0feh
+
+int11h_vector: ; Equipment check.
+ bop 11h
+ jmp iret_com
+int12h_vector: ; Get memory size, copied from BIOS2.ASM
+ bop 12h
+ jmp iret_com
+
+; IVT 13 is floppy io, grabbed above to fake error status.
+
+int14h_vector: ; RS-232 serial comms, copied from BIOS2
+ bop 14h
+ jmp iret_com
+
+; Int 15 cassette io, is done above.
+
+
+
+; Idle indicators- All word sized, and dword aligned
+; Int 16 keyboard vector
+
+ align 4
+ public Icounter,CharsPerTick,MinTicks
+
+Icounter dw 0
+ dw 0
+CharsPerTick dw 0
+ dw 0
+MinTicks dw 50
+ dw 0
+
+int16h_vector:
+ push ds
+ push bx
+ mov bx, 40h ; bios data adressable
+ mov ds, bx
+ cmp ah, 10h
+ call DOCLI ; make sure interrupts are off
+ jb i16vStdFns
+ jmp i16vExtFns
+
+
+ ; The dispatch code must preserve the jz,dec,dec pattern
+ ; to return the same ah value as is returned by the
+ ; standard bios (0 for supported unless otherwise documented
+ ; and nonzero for unsupported). This is because some apps look
+ ; at the ret value of ah even tho it is a side effect of the
+ ; original dispatch code in the rom bios.
+
+i16vStdFns:
+ or ah, ah
+ jz i16v00h ; read key, wait
+ dec ah
+ jz i16v01h ; read key no wait
+ dec ah
+ jz i16v02h ; get shift state
+ dec ah
+ jz i16viret ; we don't support ah=3, set kbd rate
+ dec ah
+ jz i16viret ; undefined function
+ dec ah
+ jz i16v05h ; push char into kbd buffer
+ ; the rest are undefined\unsupported
+
+ ; normal iret exit
+i16viret:
+ pop bx
+ pop ds
+ jmp iret_com
+
+
+ ; return shift state in al
+i16v02h:
+ mov al, ds:[KB_FLAG]
+ jmp i16viret
+
+
+i16v05h:
+ push si
+ mov bx, word ptr ds:[BUFFER_TAIL]
+ mov si, bx
+ call IncrBuffPtr
+ cmp bx, word ptr ds:[BUFFER_HEAD]
+ je i16v05h1
+ mov word ptr ds:[si], cx
+ mov word ptr ds:[BUFFER_TAIL], bx
+ mov al, 0
+ pop si
+ jmp i16viret
+
+i16v05h1:
+ mov al, 1
+ pop si
+ jmp i16viret
+
+
+ ; read a character, wait if none available
+i16v00h:
+ mov bx, word ptr ds:[BUFFER_HEAD]
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+ jne i16v00h1
+ call DOSTI
+ mov ax, 09002h
+ int 15h ; wait device
+
+i16v00h0:
+ call DOCLI
+ mov bx, word ptr ds:[BUFFER_HEAD]
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+
+i16v00h1:
+ call UpdateLed
+ jne i16v00h2
+ call IdlePoll
+ jmp i16v00h0
+
+i16v00h2: ; translate.....
+ mov ax, [bx]
+ call IncrBuffPtr
+ mov word ptr ds:[BUFFER_HEAD], bx
+ call TranslateStd
+ jc i16v00h0
+ call IdleInit
+ jmp i16viret
+
+
+ ; read a character, nowait if none available
+i16v01h:
+ mov bx, word ptr ds:[BUFFER_HEAD] ;;maybe should turn IF on ??
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+ mov ax, [bx]
+ call UpdateLed
+ je i16vretf1
+
+ call IdleInit
+ call TranslateStd
+ call DOSTI
+ jnc i16vretf5 ; got a key, all done!
+ call IncrBuffPtr ; throw away key
+ mov word ptr ds:[BUFFER_HEAD], bx
+ jmp i16v01h ; go for the next one
+
+
+ ; ExtKbd read a character, nowait if none available
+i16v11h:
+ mov bx, word ptr ds:[BUFFER_HEAD] ;;maybe should turn IF on ??
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+ mov ax, [bx]
+ call UpdateLed
+ je i16vretf1 ; common retf stuff for nowait
+
+ call IdleInit
+ call TranslateExt
+ call DOSTI
+ jmp i16vretf5
+
+
+ ; retf2 exit preserving flags
+i16vretf1:
+ call DOSTI
+ push ax
+ lahf
+ push ax
+
+ mov ax, cs:Icounter
+ cmp ax, cs:MinTicks
+ jb i16vretf2
+
+ mov ah, 1 ; polling kbd, idle now
+ BOP 16h
+ jmp i16vretf4
+
+i16vretf2:
+ inc cs:CharsPerTick
+
+
+i16vretf4:
+ pop ax
+ sahf
+ pop ax
+
+i16vretf5:
+ pop bx
+ pop ds
+ retf 2
+
+
+
+i16vExtFns:
+ sub ah, 10h
+ jz i16v10h ; extended read key, wait
+ dec ah
+ jz i16v11h ; extended read key, nowait
+ dec ah
+ jz i16v12h ; extended shift status
+ jmp i16viret ; undefined
+
+
+ ; return extended shift state
+i16v12h:
+ mov al, ds:[KB_FLAG_1]
+ mov ah, al
+ and al, SYS_SHIFT
+ push cx
+ mov cl, 5
+ shl al, cl
+ pop cx
+ and ah, NOT (SYS_SHIFT+HOLD_STATE+INS_SHIFT)
+ or al, ah
+ mov ah, ds:[KB_FLAG_3]
+ and ah, NOT (LC_E1+LC_E0)
+ or ah, al
+ mov al, ds:[KB_FLAG]
+ jmp i16viret
+
+
+ ; ExtKbd read a character, wait if none available
+i16v10h:
+ mov bx, word ptr ds:[BUFFER_HEAD]
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+ jne i16v10h1
+ call DOSTI
+ mov ax, 09002h
+ int 15h ; wait device
+
+i16v10h0:
+ call DOCLI
+ mov bx, word ptr ds:[BUFFER_HEAD]
+ cmp bx, word ptr ds:[BUFFER_TAIL]
+
+i16v10h1:
+ call UpdateLed
+ jne i16v10h2
+ call IdlePoll
+ jmp i16v10h0
+
+i16v10h2: ; translate.....
+ mov ax, [bx]
+ call IncrBuffPtr
+ mov word ptr ds:[BUFFER_HEAD], bx
+ call TranslateExt
+ call IdleInit
+ jmp i16viret
+
+
+
+; IdlePoll - Spins waiting for a key, doing idle callouts as needed
+; flags trashed, all registers preserved
+; interrupts are left on upon exit
+;
+IdlePoll proc near
+ push ax
+
+ call DOSTI
+ mov ah, 2 ; Idle_waitio
+ BOP 16h
+IPoll1:
+ mov bx, word ptr ds:[BUFFER_HEAD]
+ cmp bx, word ptr ds:[BUFFER_TAIL] ; interrupts are off only
+ jne IPoll3 ; safe to peek for change
+
+ mov ax, cs:Icounter
+ cmp ax, cs:MinTicks
+ jae IPoll2
+ inc cs:CharsPerTick
+ jmp IPoll1
+IPoll2:
+ mov ah, 1 ; idle now
+ BOP 16h
+IPoll3:
+ pop ax
+ ret
+IdlePoll endp
+
+
+
+
+; IdleInit - reinits the idle indicators, dups functionality
+; of IDLE_init()
+;
+IdleInit proc near
+
+ mov cs:Icounter, 0
+ mov cs:CharsPerTick, 0
+
+ ret
+IdleInit endp
+
+
+; TranslateExt - Retrieves and translates next scan code
+; pair for extended kbd
+;
+; input: ax - raw scan code pair
+; output: ax - translated scan code pair
+;
+; all other flags,registers preserved
+
+TranslateExt proc near
+
+ push bx
+ push ax
+ lahf
+ mov bx, ax
+ pop ax
+ push bx
+
+ cmp al, 0f0h
+ jne TExt1
+ or ah, ah
+ jz TExt1
+ xor al, al
+TExt1:
+ mov bx, ax
+ pop ax
+ sahf
+ mov ax, bx
+ pop bx
+ ret
+
+TranslateExt endp
+
+
+; TranslateStd - Retrieves and translates next scan code
+; pair for standard kbd
+;
+; input: ax - raw scan code pair
+; output: ax - translated scan code pair
+; returns carry for throw away
+; all other flags,registers preserved
+
+TranslateStd proc near
+
+ push bx
+ push ax
+ lahf
+ mov bx, ax
+ pop ax
+ push bx
+
+ cmp ah, 0e0h
+ jne TStd1
+
+ ; keypad enter or '/'
+ mov ah, 1ch ; assume enter key
+ cmp al, 0dh
+ je TStdNoCarry
+ cmp al, 0ah
+ je TStdNoCarry
+ mov ah, 35h ; oops it was key pad!
+ jmp TStdNoCarry
+
+TStd1:
+ cmp ah, 84h
+ ja TStdCarry ; extended key ?
+
+ cmp al, 0f0h ; fill in key ?
+ jne TStd2
+ or ah, ah ; ah = 0 is special
+ jz TStdNoCarry
+ jmp TStdCarry
+
+TStd2:
+ cmp al, 0e0h ; convert to compatible output
+ jne TStdNoCarry
+ or ah, ah
+ jz TStdNoCarry
+ xor al, al
+
+TStdNoCarry:
+ mov bx, ax
+ pop ax
+ sahf
+ mov ax, bx
+ pop bx
+ clc
+ ret
+
+TStdCarry:
+ mov bx, ax
+ pop ax
+ sahf
+ mov ax, bx
+ pop bx
+ stc
+ ret
+TranslateStd endp
+
+
+
+; IncrBuffPtr - increments the buffer pointer
+;
+; input: ds:bx - curr buf ptr
+; output: ds:bx - new buf ptr
+; does not update the bios buf ptr
+
+IncrBuffPtr proc near
+ inc bx
+ inc bx
+ cmp bx, word ptr ds:[BUFFER_END]
+ jne ibpExit
+ mov bx, word ptr ds:[BUFFER_START]
+ibpExit:
+ ret
+IncrBuffPtr endp
+
+
+
+; UpdateLed - forms the data byte for the mode indicators
+; updates the led bits (MAKE_LED,SEND_LED)
+;
+; input: none
+; output: led bits updated
+;
+; Caveats: all low flags,registers preserved
+; MUST be called with interrupts off
+; does not update the kbd hardware (send_led)
+;
+UpdateLed proc near
+
+ push bx
+ push cx
+ push ax
+ lahf
+ push ax
+
+ ; make_led
+ mov al, byte ptr ds:[KB_FLAG] ; get led bits
+ and al, CAPS_STATE+NUM_STATE+SCROLL_STATE
+ mov cl, 4
+ shr al, cl ; shift for kb_flag_2
+ and al, KB_LEDS ; only led mode bits
+
+ mov bl, byte ptr ds:[KB_FLAG_2]
+ xor bl, al ; see if different
+ and bl, KB_LEDS ; only led mode bits
+ jz UledExit
+
+
+ test byte ptr ds:[KB_FLAG_2], KB_PR_LED ;if update under way
+ jnz ULedExit ; skip update
+ or byte ptr ds:[KB_FLAG_2], KB_PR_LED ;else upd in progress
+
+ shl bl, cl ; add in changebits
+ or al, bl ; to hi nibble of al
+ mov ah, 3 ; inform softpc to set lights
+ BOP 16h
+
+ and byte ptr ds:[KB_FLAG_2], NOT KB_LEDS ; clear led bits
+ and al, 0fh ; remove change bits
+ or byte ptr ds:[KB_FLAG_2], al ; stick in new led bits
+
+ and byte ptr ds:[KB_FLAG_2], NOT KB_PR_LED ; clear upd bit
+
+
+ULedExit:
+ pop ax
+ sahf
+ pop ax
+ pop cx
+ pop bx
+
+ ret
+UpdateLed endp
+
+
+
+
+; IVT 17 is printer IO, done above.
+
+int18h_vector: ; ROM BASIC, copied from BIOS2.ASM
+ bop 18h
+ jmp iret_com
+int19h_vector: ; reboot vector, we terminate vdm!
+ bop 19h
+ jmp iret_com
+
+
+IdleTicLo dw 0
+IdleTicHi dw 0
+IdleTicNum db 0
+
+int1Ah_vector: ; Time of day.
+ call DOSTI
+ cmp ah, 2
+ jl i1aTic1
+
+ bop 1ah
+ jmp iret_com
+
+i1aTic1:
+ push ds ; bios data adressable
+ push bx
+ push ax
+ mov ax, 40h
+ mov ds, ax
+ pop ax
+ call DOCLI
+
+ or ah, ah ; fn 0 or fn 1 ?
+ jnz i1aTic5
+
+i1aTic2:
+ mov al, byte ptr ds:[TIMER_OVFL] ; GetTickCount
+ mov cx, word ptr ds:[TIMER_HIGH]
+ mov dx, word ptr ds:[TIMER_LOW]
+
+
+ ; If time stamp is within 1 tic of curr tic count
+ ; do idle polling managment
+
+ cmp cs:IdleTicHi, cx ; check TIMER_HIGH
+ jnz i1aTic8
+
+ mov bx, cs:IdleTicLo ; check TIMER_LOW
+ cmp bx, dx
+ jz i1aTic3
+ inc bx
+ cmp bx, dx
+ jnz i1aTic8
+
+
+i1aTic3:
+ inc cs:IdleTicNum ; Yes, inc poll count
+ cmp cs:IdleTicNum, 16 ; Is poll count too hi ?
+ jb i1aTic9
+
+ call DOSTI
+ xor ax,ax ; Yes, do idle BOP
+ dec cs:IdleTicLo ; make sure only bop once
+ BOP 5ah
+ call DOCLI
+ jmp short i1aTic2
+
+i1aTic5:
+ mov word ptr ds:[TIMER_LOW], dx ; SetTickCount
+ mov word ptr ds:[TIMER_HIGH], cx
+
+i1aTic8:
+ mov cs:IdleTicNum, 0 ; reset idle indicators
+
+i1aTic9:
+ mov cs:IdleTicLo, dx ; store time stamp
+ mov cs:IdleTicHi, cx
+ mov byte ptr ds:[TIMER_OVFL], 0 ; common TicCount exit
+ pop bx
+ pop ds
+ jmp iret_com
+
+
+; IVT 1B is keyboard break, set to dummy.
+
+
+int1Eh_vector:
+ bop 1eh
+ jmp iret_com
+
+int70h_vector: ; Real time clock, copied from BIOS1.ASM
+ bop 70h ; rtc_bios.c:rtc_int()
+ jmp iret_com
+
+int4Ah_caller:
+ call DOSTI ; Called from base\bios\rtc_bios.c:rtc_int()
+ int 4ah ; User installed alarm.
+ jmp r1
+r1: jmp r2
+r2: jmp r3
+r3:
+ call DOCLI
+ bop 0feh
+
+int71h_vector: ; redirect, copied from BIOS1.ASM
+ bop 71h
+ int 0Ah
+ jmp iret_com
+int75h_vector: ; NPX 287.
+ bop 75h
+ int 02h
+ jmp iret_com
+;=================================================================
+; End of pseudo-ROM vectuz.
+;=================================================================
+
+
+;================================================================
+; Wait for interrupts
+;================================================================
+
+cpu_nop_code:
+ call DOSTI
+ jmp short nxt1
+nxt1: jmp short nxt2
+nxt2: jmp short nxt3
+nxt3: bop %BIOS_CPU_QUIT
+
+ public SpcKbdEnd
+SpcKbdEnd label byte
+
+ align 4 ;; makes MIPS happy
+
+; offset table for redirected functions
+kio_table dw 33 dup(?)
+
+ public InstSpcKbd
+
+;
+; InstSpcKbd - Installs the softpc custom interrupt hooks
+;
+; Inputs: ds == Resident location of SysInitSeg
+; Outputs: None
+;
+InstSpcKbd proc near
+
+ pusha
+ call DOCLI
+
+ ; The following vectors are used for both x86\mips
+ ; The dos interrupts Int 25\Int26 are handled by the dos kerenl
+ xor ax, ax
+ mov es, ax
+ mov word ptr es:[08h*4], offset int08h_vector
+ mov word ptr es:[(08h*4)+2], ds
+ mov word ptr es:[09h*4], offset int09h_vector
+ mov word ptr es:[(09h*4)+2], ds
+ mov word ptr es:[13h*4], offset int13h_vector
+ mov word ptr es:[(13h*4)+2], ds
+ mov word ptr es:[16h*4], offset int16h_vector
+ mov word ptr es:[(16h*4)+2], ds
+ mov word ptr es:[40h*4], offset int40h_vector
+ mov word ptr es:[(40h*4)+2], ds
+ mov word ptr es:[19h*4], offset int19h_vector
+ mov word ptr es:[(19h*4)+2], ds
+ mov word ptr es:[1ah*4], offset int1Ah_vector
+ mov word ptr es:[(1ah*4)+2], ds
+
+
+
+ ; BOP 5F - send interesting addresses to softpc C BIOS
+ ; CS seg of kio_table
+ ; DS seg of resident keyboard code
+ ; DI offset of bop table
+ ; CX size of bop table entry
+ ; SI offset of kio_table
+ mov si,offset sysinitgrp:kio_table
+ push ds
+ push cs
+ pop ds
+ mov word ptr [si], offset shift_keys ;K6
+ mov word ptr [si+2], offset shift_masks ;K7
+ mov word ptr [si+4], offset ctl_n_table ;K8
+ mov word ptr [si+6], offset ctl_f_table ;K9
+ mov word ptr [si+8], offset lowercase ;K10
+ mov word ptr [si+10], offset uppercase ;K11
+ mov word ptr [si+12], offset alt_table ;K30
+ mov word ptr [si+14], offset dummy_vector
+ mov word ptr [si+16], offset print_screen_caller
+ mov word ptr [si+18], offset int15h_caller
+ mov word ptr [si+20], offset cpu_nop_code
+ mov word ptr [si+22], offset int15h_vector
+ mov word ptr [si+24], offset Icounter
+ mov word ptr [si+26], offset int4Ah_caller
+ mov word ptr [si+28], offset keyboard_break_caller
+ mov word ptr [si+30], offset int10h_caller
+ mov word ptr [si+32], offset int10h_vector
+ mov word ptr [si+34], offset use_host_int10
+ mov word ptr [si+36], offset ega_parm_setup
+ mov word ptr [si+38], offset changing_mode
+ mov word ptr [si+40], offset prt_status
+ mov word ptr [si+42], offset wait_int
+ mov word ptr [si+44], offset floppy_table
+ mov word ptr [si+46], offset vga_1b_table
+ mov word ptr [si+48], offset conf_table
+ mov word ptr [si+50], offset int08h_vector
+ mov word ptr [si+52], offset int13h_vector
+ mov word ptr [si+54], offset int13h_caller
+ mov word ptr [si+56], SW_VIDEO_BUFFER_SIZE
+ mov word ptr [si+58], SW_VIDEO_BUFFER_SEGMENT
+ mov word ptr [si+60], offset sw_video_dirty_count
+ mov word ptr [si+62], offset sw_video_busy
+; The last entry is reserved for assertion checking
+ mov word ptr [si+64], VERSIONID
+ pop ds
+
+ ; mov si, offset kio_table
+ mov di, offset iret_bop_table
+ mov cx, offset iret_end_first_entry - offset iret_bop_table
+ mov ax, VERSIONID
+ bop 5fh
+ jc isk_int9
+
+ ;
+ ; Risc only
+ ;
+
+ xor ax, ax
+ mov es, ax
+ mov word ptr es:[17h*4], offset int17h_RiscVector
+ mov word ptr es:[(17h*4)+2], ds
+
+ ;
+ ; End Risc only
+ ;
+ jmp isk_Exit
+
+isk_int9:
+
+ ;
+ ; X86 only
+ ;
+
+ ; save old video int
+ xor ax, ax
+ mov es, ax
+ mov bx, es:[40h]
+ mov si, offset host_int10
+ mov word ptr ds:[si], bx
+ mov bx, es:[42h]
+ mov word ptr ds:[si+2], bx
+
+ ; save old secondary video int (42h)
+ mov bx, es:[108h]
+ mov si, offset host_int42
+ mov word ptr ds:[si], bx
+ mov bx, es:[10ah]
+ mov word ptr ds:[si+2], bx
+
+
+;-----------------------------------------------------------
+;
+; Crazy vector grabber
+;
+; Works OK on DEC PC when grab INT's 6, 11, 16, 17, 42.
+; Now try and avoid all accesses to host ROM.
+;
+; At this point we assume ES=0
+;-----------------------------------------------------------
+
+ ; Grab some prominent vectors for pseudo-ROM routines.
+ ; start at Int 0h and work our way up as needed
+ cld
+
+ mov di, 20
+ mov ax, offset int05h_vector ; INT 05h
+ stosw ; Print screen
+ mov ax, ds
+ stosw
+ mov ax, offset int06h_vector ; INT 06h
+ stosw ; Illegal instruction.
+ mov ax, ds
+ stosw
+ mov ax, offset unexp_int ; INT 07h
+ stosw
+ mov ax, ds
+ stosw
+
+ ; int 8h Timer hardware vector already done for both x86\mips
+ ; int 9h kbd hardware vector already done for both x86\mips
+ add di, 8
+
+ mov ax, offset unexp_int ; INT 0ah
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset unexp_int ; INT 0bh
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset unexp_int ; INT 0ch
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset unexp_int ; INT 0dh
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int0e_vector ; INT 0eh
+ stosw ; Floppy hardware int.
+ mov ax, ds
+ stosw
+ mov ax, offset unexp_int ; INT 0fh
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int10h_vector ; INT 10h
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int11h_vector ; INT 11h
+ stosw ; Equipment check.
+ mov ax, ds
+ stosw
+ mov ax, offset int12h_vector ; INT 12h
+ stosw ; Get memory size.
+ mov ax, ds
+ stosw
+
+ ; int 13h already done (see above) for both mips\x86
+
+ mov di, 14h*4 ; Communications.
+ mov ax, offset int14h_vector
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int15h_vector ; INT 15h
+ stosw
+ mov ax, ds
+ stosw
+
+ ; int 16h kbd hardware vector already done for both x86\mips
+ add di, 4
+
+ mov ax, offset int17h_vector ; INT 17h
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int18h_vector ; INT 18h
+ stosw ; ROM BASIC.
+ mov ax, ds
+ stosw
+
+ ; int 19h (reboot vector) already done for both x86\mips
+
+ ; int 1ah, time of day, already done for both x86\mips
+
+ mov di, 1Bh*4
+ mov ax, offset dummy_vector ; INT 1Bh
+ stosw ; Keyboard break.
+ mov ax, ds
+ stosw
+ mov ax, offset dummy_vector ; INT 1Ch
+ stosw ; Timer tick.
+ mov ax, ds
+ stosw
+
+ mov di, 1Eh*4 ; Floppy parameters.
+ mov ax, offset bios_floppy_table
+ stosw
+ mov ax, ds
+ stosw
+
+ ; int 40h already done (see above) for both mips\x86
+
+ mov di, 41h*4
+ mov ax, offset unexp_int ; INT 41h
+ stosw ; Hard disk parameters.
+ mov ax, ds
+ stosw
+ mov ax, offset int42h_vector ; INT 42h
+ stosw ; Default video.
+ mov ax, ds
+ stosw
+
+ mov di, 70h*4 ; Real time clock init.
+ mov ax, offset int70h_vector
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int71h_vector ; INT 71h Redirect.
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset intD11_vector ; INT 72h D11 int
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset intD11_vector ; INT 73h D11 int
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset intD11_vector ; INT 74h D11 int
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset int75h_vector ; INT 75h 287 int
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset intD11_vector ; INT 76h D11 int
+ stosw
+ mov ax, ds
+ stosw
+ mov ax, offset intD11_vector ; INT 77h D11 int
+ stosw
+ mov ax, ds
+ stosw
+
+
+isk_Exit:
+;;
+;; williamh, May 16, 1996
+;; Photostyler blindly calls EMS function without even checking
+;; if EMS driver ever exists at all. On most x86 machines, we are fine because
+;; the ROM BIOS sets the vector to a valid address. On certain x86 machines
+;; and all RISC machines, the vector is 0:0. This hack is to repoint
+;; the vector to our dummy iret routine if it is not initialized. Windows 3.1
+;; Windows 95 ALWAYS redirect this vector to their own, so they don't have
+;; the problem as we do.
+;; Also note that the application may skip the EMS calls if the system has
+;; big memory(more than 16MB, maybe). In this case, the problem won't get hit
+;; at all.
+;;
+;; ds = segment of ntio.sys resident portion. It is the segment of our
+;; iret_com rountine
+;;
+ xor di, di
+ mov es, di
+ mov di, 067h * 4 ; the EMS vector
+ mov ax, es:[di]
+ or ax, es:[di + 2] ;; anything set for the vector?
+ jnz i67_patch_done
+ mov word ptr es:[di], offset iret_com
+ mov es:[di + 2], ds
+
+i67_patch_done:
+ call DOSTI
+ popa
+ ret
+
+InstSpcKbd endp
+
+SpcKbdSeg ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/spcmse_4.asm b/private/mvdm/dos/v86/doskrnl/bios/spcmse_4.asm
new file mode 100644
index 000000000..b913a2bd0
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/spcmse_4.asm
@@ -0,0 +1,5399 @@
+; Program: Installable Device Driver for Mouse.
+;
+; Purpose: to provide compatability with the
+; Microsoft MOUSE.SYS device driver.
+; the code here installs the driver and
+; hooks the IVT in exactly the same
+; way as the current Insignia MOUSE.COM.
+;
+; Version: 1.00 Date: 28th October 1992.
+;
+; Author: Andrew Watson
+;
+; Revisions:
+;
+; 23-June-1994 Williamh, made mode 4/5 and 12 work.
+;
+; 12-Sep-1992 Jonle, Merged with ntio.sys
+; optimized loading of IVT
+;
+; 5-March-1993 Andyw, Moved fullscreen text pointer code
+; from 32bit land to 16bit driver for
+; for speed purposes.
+;
+; This obj module is intially loaded in a temporary memory location
+; along with ntio.sys. Ntio.sys will copy the resident code (marked by
+; SpcMseBeg, SpcMseEnd) into the permanent memory location which resides
+; just below the normal device drivers loaded by config.sys.
+;
+; The nonresident intialization code is run with CS= temp seg
+; and DS= final seg.
+;
+;
+;****************************************************************
+
+.286
+ include vint.inc
+
+;================================================================
+; Defined constants used in the driver.
+;================================================================
+
+
+ VERSIONID equ 0BEEFh
+ MAXCMD equ 16
+ UNKNOWN equ 8003h
+ DONE equ 0100h
+ MOUSEVER equ 0003h
+ INT1_BOP equ 0BAh
+ INT2_BOP equ 0BBh
+ IO_LANG_BOP equ 0BCh
+ IO_INTR_BOP equ 0BDh
+ VIDEO_IO_BOP equ 0BEh
+ UNSIMULATE_BOP equ 0FEh
+ VIDEO equ 010h
+ UNEXP_BOP equ 2
+ FORCE_YODA equ 05bh
+ ANDYS_BOP equ 060h
+ STACKSIZE equ 200h-1
+
+ TRUE equ 0
+ FALSE equ 1
+ STORED equ 0
+ NOTSTORED equ 1
+ ON equ 0
+ OFF equ 1
+
+ MAJOR_RELEASE_NUMBER equ 6
+ MINOR_RELEASE_NUMBER equ 26
+
+
+
+;MACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROS
+
+bop MACRO callid
+ db 0c4h,0c4h,callid
+endm
+
+
+
+;=============================================================================
+; Macro to reassign the stack segment register to point at the driver code
+; segment and the stack pointer to point to the most significant word in an
+; array reserved as the driver stack.
+;=============================================================================
+
+
+;; !!!! interrupt must be disabled before calling this function !!!!!!
+
+make_stack MACRO
+ LOCAL reent ;; a local symbol to this macro
+;; call DOCLI ;; turn off interrupts during this
+ ;; macro's execution even if the CPU
+ ;; does this for you when modifying SS
+ inc cs:reentrant ;; has the interrupt been nested?
+ jnz reent ;; not reentrant if == zero
+
+ ;; The driver code is not reentrant, so start the stack at the beginning
+
+ mov cs:top_of_stack,ss ;; save the entry SS
+ mov cs:top_of_stack-2,sp ;; save SP on the stack
+ push cs ;; the current code/data segment
+ pop ss ;; point SS at CS
+
+ ;; point SP at the next free stack location.
+
+ mov sp,offset top_of_stack-2 ;; The current stack pointer position
+
+reent: ;; REENTRANT > 0 therefore reentrancy exists
+ ;; The driver has gone reentrant due to a nested interrupt, so just
+ ;; leave the stack alone because it is the same under reentrancy.
+
+;; call DOSTI ;; reenable interrupts
+
+ ENDM
+
+;=============================================================================
+; Macro to return the stack pointer and segment back to what it was when
+; the driver was called.
+;=============================================================================
+
+kill_stack MACRO
+ LOCAL reent1
+;; cli
+ cmp cs:reentrant,0 ;; is the code currently reentrant?
+ jg reent1 ;; yes it is
+ mov sp,cs:top_of_stack-2 ;; pop SP
+ mov ss,cs:top_of_stack ;; pop SS
+reent1:
+ dec cs:reentrant ;; reduce the level of reentrancy
+;; call DOSTI
+ ENDM
+
+;MACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROSMACROS
+
+;
+; Segment definitions for ntio.sys,
+;
+include biosseg.inc
+
+
+
+
+SpcMseSeg segment
+ assume cs:SpcMseSeg, ds:nothing, es:nothing
+
+;
+; SpcMseBeg - SpcMseEnd
+;
+; Marks the resident code, anything outside of these markers
+; is discarded after intialization
+; 15-Sep-1992 Jonle
+;
+
+ public SpcMseBeg
+
+SpcMseBeg label byte
+
+ ; CAUTION: for crazy apps mouse recognition
+ ;
+ ; The offset for int33h_vector must not be Zero for Borlands QuattroPro
+ ; The segment must not be in ROM area for pctools
+ ; to keep the int33h_vector from having an offset of ZERO
+ ; I have moved the data above it
+ ; 25-Sep-1992 Jonle
+
+
+; describe the default screen and cursor masks
+; remember that x86 machines are little-endian
+
+ ;;; include pointer.inc
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;;; We'll Get this back to an include file soon but I'm including it like
+ ;;;; this for 'diplomatic' reasons. (ie I want to check this in without
+ ;;;; also doing an 'addfile' at this stage)!!! - Simon.
+ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+; This data will be accessed, on occasion, word by word, so
+; be tidy and align to a word boundary
+
+align 2
+
+; Describe the default mouse pointer image. This is used if the
+; user decides to switch on the pointer without specifying an image.
+
+default_cursor dw 0011111111111111b
+ dw 0001111111111111b
+ dw 0000111111111111b
+ dw 0000011111111111b
+ dw 0000001111111111b
+ dw 0000000111111111b
+ dw 0000000011111111b
+ dw 0000000001111111b
+ dw 0000000000111111b
+ dw 0000000000011111b
+ dw 0000000111111111b
+ dw 0001000011111111b
+ dw 0011000011111111b
+ dw 1111100001111111b
+ dw 1111100001111111b
+ dw 1111110001111111b
+ dw 0000000000000000b
+ dw 0100000000000000b
+ dw 0110000000000000b
+ dw 0111000000000000b
+ dw 0111100000000000b
+ dw 0111110000000000b
+ dw 0111111000000000b
+ dw 0111111100000000b
+ dw 0111111110000000b
+ dw 0111110000000000b
+ dw 0110110000000000b
+ dw 0100011000000000b
+ dw 0000011000000000b
+ dw 0000001100000000b
+ dw 0000001100000000b
+ dw 0000000000000000b
+
+ ; Set up the memory where the working cursor is situated. It is
+ ; initialised to the default cursor image
+
+;****************** ALIGNED FOR PIXEL ZERO *******************************
+
+ ; screen mask
+
+even
+current_cursor db 00111111b,11111111b,11111111b
+ db 00011111b,11111111b,11111111b
+ db 00001111b,11111111b,11111111b
+ db 00000111b,11111111b,11111111b
+ db 00000011b,11111111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000000b,01111111b,11111111b
+ db 00000000b,00111111b,11111111b
+ db 00000000b,00011111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00010000b,11111111b,11111111b
+ db 00110000b,11111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111100b,01111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 01000000b,00000000b,00000000b
+ db 01100000b,00000000b,00000000b
+ db 01110000b,00000000b,00000000b
+ db 01111000b,00000000b,00000000b
+ db 01111100b,00000000b,00000000b
+ db 01111110b,00000000b,00000000b
+ db 01111111b,00000000b,00000000b
+ db 01111111b,10000000b,00000000b
+ db 01111111b,11000000b,00000000b
+ db 01101100b,00000000b,00000000b
+ db 01000110b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL ONE *******************************
+
+ ; screen mask
+
+AlignData1:
+ db 10011111b,11111111b,11111111b
+ db 10001111b,11111111b,11111111b
+ db 10000111b,11111111b,11111111b
+ db 10000011b,11111111b,11111111b
+ db 10000001b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,01111111b,11111111b
+ db 10000000b,00111111b,11111111b
+ db 10000000b,00011111b,11111111b
+ db 10000000b,00001111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10001000b,01111111b,11111111b
+ db 10011000b,01111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111110b,00111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00100000b,00000000b,00000000b
+ db 00110000b,00000000b,00000000b
+ db 00111000b,00000000b,00000000b
+ db 00111100b,00000000b,00000000b
+ db 00111110b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00111111b,10000000b,00000000b
+ db 00111111b,11000000b,00000000b
+ db 00111111b,11100000b,00000000b
+ db 00110110b,00000000b,00000000b
+ db 00100011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL TWO *******************************
+
+ ; screen mask
+
+AlignData2:
+ db 11001111b,11111111b,11111111b
+ db 11000111b,11111111b,11111111b
+ db 11000011b,11111111b,11111111b
+ db 11000001b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,01111111b,11111111b
+ db 11000000b,00111111b,11111111b
+ db 11000000b,00011111b,11111111b
+ db 11000000b,00001111b,11111111b
+ db 11000000b,00000111b,11111111b
+ db 11000000b,01111111b,11111111b
+ db 11000100b,00111111b,11111111b
+ db 11001100b,00111111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111111b,00011111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00010000b,00000000b,00000000b
+ db 00011000b,00000000b,00000000b
+ db 00011100b,00000000b,00000000b
+ db 00011110b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,10000000b,00000000b
+ db 00011111b,11000000b,00000000b
+ db 00011111b,11100000b,00000000b
+ db 00011111b,11110000b,00000000b
+ db 00011011b,00000000b,00000000b
+ db 00010001b,10000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL THREE *******************************
+
+ ; screen mask
+
+AlignData3:
+ db 11100111b,11111111b,11111111b
+ db 11100011b,11111111b,11111111b
+ db 11100001b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,01111111b,11111111b
+ db 11100000b,00111111b,11111111b
+ db 11100000b,00011111b,11111111b
+ db 11100000b,00001111b,11111111b
+ db 11100000b,00000111b,11111111b
+ db 11100000b,00000011b,11111111b
+ db 11100000b,00111111b,11111111b
+ db 11100010b,00011111b,11111111b
+ db 11100110b,00011111b,11111111b
+ db 11111111b,00001111b,11111111b
+ db 11111111b,00001111b,11111111b
+ db 11111111b,10001111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00001000b,00000000b,00000000b
+ db 00001100b,00000000b,00000000b
+ db 00001110b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,10000000b,00000000b
+ db 00001111b,11000000b,00000000b
+ db 00001111b,11100000b,00000000b
+ db 00001111b,11110000b,00000000b
+ db 00001111b,11111000b,00000000b
+ db 00001101b,10000000b,00000000b
+ db 00001000b,11000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FOUR *******************************
+
+ ; screen mask
+
+AlignData4:
+ db 11110011b,11111111b,11111111b
+ db 11110001b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,01111111b,11111111b
+ db 11110000b,00111111b,11111111b
+ db 11110000b,00011111b,11111111b
+ db 11110000b,00001111b,11111111b
+ db 11110000b,00000111b,11111111b
+ db 11110000b,00000011b,11111111b
+ db 11110000b,00000001b,11111111b
+ db 11110000b,00011111b,11111111b
+ db 11110001b,00001111b,11111111b
+ db 11110011b,00001111b,11111111b
+ db 11111111b,10000111b,11111111b
+ db 11111111b,10000111b,11111111b
+ db 11111111b,11000111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000100b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,10000000b,00000000b
+ db 00000111b,11000000b,00000000b
+ db 00000111b,11100000b,00000000b
+ db 00000111b,11110000b,00000000b
+ db 00000111b,11111000b,00000000b
+ db 00000111b,11111100b,00000000b
+ db 00000110b,11000000b,00000000b
+ db 00000100b,01100000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FIVE *******************************
+
+ ; screen mask
+AlignData5:
+
+ db 11111001b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111000b,00111111b,11111111b
+ db 11111000b,00011111b,11111111b
+ db 11111000b,00001111b,11111111b
+ db 11111000b,00000111b,11111111b
+ db 11111000b,00000011b,11111111b
+ db 11111000b,00000001b,11111111b
+ db 11111000b,00000000b,11111111b
+ db 11111000b,00001111b,11111111b
+ db 11111000b,10000111b,11111111b
+ db 11111001b,10000111b,11111111b
+ db 11111111b,11000011b,11111111b
+ db 11111111b,11000011b,11111111b
+ db 11111111b,11100011b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000010b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,10000000b,00000000b
+ db 00000011b,11000000b,00000000b
+ db 00000011b,11100000b,00000000b
+ db 00000011b,11110000b,00000000b
+ db 00000011b,11111000b,00000000b
+ db 00000011b,11111100b,00000000b
+ db 00000011b,11111110b,00000000b
+ db 00000011b,01100000b,00000000b
+ db 00000010b,00110000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SIX *******************************
+
+ ; screen mask
+
+AlignData6:
+ db 11111100b,11111111b,11111111b
+ db 11111100b,01111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111100b,00011111b,11111111b
+ db 11111100b,00001111b,11111111b
+ db 11111100b,00000111b,11111111b
+ db 11111100b,00000011b,11111111b
+ db 11111100b,00000001b,11111111b
+ db 11111100b,00000000b,11111111b
+ db 11111100b,00000000b,01111111b
+ db 11111100b,00000111b,11111111b
+ db 11111100b,01000011b,11111111b
+ db 11111100b,11000011b,11111111b
+ db 11111111b,11100001b,11111111b
+ db 11111111b,11100001b,11111111b
+ db 11111111b,11110001b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000001b,11000000b,00000000b
+ db 00000001b,11100000b,00000000b
+ db 00000001b,11110000b,00000000b
+ db 00000001b,11111000b,00000000b
+ db 00000001b,11111100b,00000000b
+ db 00000001b,11111110b,00000000b
+ db 00000001b,11111111b,00000000b
+ db 00000001b,10110000b,00000000b
+ db 00000001b,00011000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SEVEN *******************************
+
+ ; screen mask
+AlignData7:
+
+ db 11111110b,01111111b,11111111b
+ db 11111110b,00111111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111110b,00001111b,11111111b
+ db 11111110b,00000111b,11111111b
+ db 11111110b,00000011b,11111111b
+ db 11111110b,00000001b,11111111b
+ db 11111110b,00000000b,11111111b
+ db 11111110b,00000000b,01111111b
+ db 11111110b,00000000b,00111111b
+ db 11111110b,00000011b,11111111b
+ db 11111110b,00100001b,11111111b
+ db 11111110b,01100001b,11111111b
+ db 11111111b,11110000b,11111111b
+ db 11111111b,11110000b,11111111b
+ db 11111111b,11111000b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000000b,10000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,11100000b,00000000b
+ db 00000000b,11110000b,00000000b
+ db 00000000b,11111000b,00000000b
+ db 00000000b,11111100b,00000000b
+ db 00000000b,11111110b,00000000b
+ db 00000000b,11111111b,00000000b
+ db 00000000b,11111111b,10000000b
+ db 00000000b,11011000b,00000000b
+ db 00000000b,10001100b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00000110b,00000000b
+ db 00000000b,00000110b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+; Data area reserved for the clipped cursor images. When the pointer
+; reaches byte 78 in the current raster, the image needs to be clipped
+; to prevent it from being wrapped to the left hand edge of the screen.
+; The image below stops that from happening by loading the image with
+; a 1's partial AND mask and a 0's partial XOR mask.
+; Note that byte 79 also needs a clipped image set.
+
+even
+clip_cursor78 db 00111111b,11111111b,11111111b
+ db 00011111b,11111111b,11111111b
+ db 00001111b,11111111b,11111111b
+ db 00000111b,11111111b,11111111b
+ db 00000011b,11111111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000000b,01111111b,11111111b
+ db 00000000b,00111111b,11111111b
+ db 00000000b,00011111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00010000b,11111111b,11111111b
+ db 00110000b,11111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111100b,01111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 01000000b,00000000b,00000000b
+ db 01100000b,00000000b,00000000b
+ db 01110000b,00000000b,00000000b
+ db 01111000b,00000000b,00000000b
+ db 01111100b,00000000b,00000000b
+ db 01111110b,00000000b,00000000b
+ db 01111111b,00000000b,00000000b
+ db 01111111b,10000000b,00000000b
+ db 01111111b,11000000b,00000000b
+ db 01101100b,00000000b,00000000b
+ db 01000110b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL ONE *******************************
+
+ ; screen mask
+
+AlignClip178:
+ db 10011111b,11111111b,11111111b
+ db 10001111b,11111111b,11111111b
+ db 10000111b,11111111b,11111111b
+ db 10000011b,11111111b,11111111b
+ db 10000001b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,01111111b,11111111b
+ db 10000000b,00111111b,11111111b
+ db 10000000b,00011111b,11111111b
+ db 10000000b,00001111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10001000b,01111111b,11111111b
+ db 10011000b,01111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111110b,00111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00100000b,00000000b,00000000b
+ db 00110000b,00000000b,00000000b
+ db 00111000b,00000000b,00000000b
+ db 00111100b,00000000b,00000000b
+ db 00111110b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00111111b,10000000b,00000000b
+ db 00111111b,11000000b,00000000b
+ db 00111111b,11100000b,00000000b
+ db 00110110b,00000000b,00000000b
+ db 00100011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL TWO *******************************
+
+ ; screen mask
+
+AlignClip278:
+ db 11001111b,11111111b,11111111b
+ db 11000111b,11111111b,11111111b
+ db 11000011b,11111111b,11111111b
+ db 11000001b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,01111111b,11111111b
+ db 11000000b,00111111b,11111111b
+ db 11000000b,00011111b,11111111b
+ db 11000000b,00001111b,11111111b
+ db 11000000b,00000111b,11111111b
+ db 11000000b,01111111b,11111111b
+ db 11000100b,00111111b,11111111b
+ db 11001100b,00111111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111111b,00011111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00010000b,00000000b,00000000b
+ db 00011000b,00000000b,00000000b
+ db 00011100b,00000000b,00000000b
+ db 00011110b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,10000000b,00000000b
+ db 00011111b,11000000b,00000000b
+ db 00011111b,11100000b,00000000b
+ db 00011111b,11110000b,00000000b
+ db 00011011b,00000000b,00000000b
+ db 00010001b,10000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL THREE *******************************
+
+ ; screen mask
+
+AlignClip378:
+ db 11100111b,11111111b,11111111b
+ db 11100011b,11111111b,11111111b
+ db 11100001b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,01111111b,11111111b
+ db 11100000b,00111111b,11111111b
+ db 11100000b,00011111b,11111111b
+ db 11100000b,00001111b,11111111b
+ db 11100000b,00000111b,11111111b
+ db 11100000b,00000011b,11111111b
+ db 11100000b,00111111b,11111111b
+ db 11100010b,00011111b,11111111b
+ db 11100110b,00011111b,11111111b
+ db 11111111b,00001111b,11111111b
+ db 11111111b,00001111b,11111111b
+ db 11111111b,10001111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00001000b,00000000b,00000000b
+ db 00001100b,00000000b,00000000b
+ db 00001110b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,10000000b,00000000b
+ db 00001111b,11000000b,00000000b
+ db 00001111b,11100000b,00000000b
+ db 00001111b,11110000b,00000000b
+ db 00001111b,11111000b,00000000b
+ db 00001101b,10000000b,00000000b
+ db 00001000b,11000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FOUR *******************************
+
+ ; screen mask
+
+AlignClip478:
+ db 11110011b,11111111b,11111111b
+ db 11110001b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,01111111b,11111111b
+ db 11110000b,00111111b,11111111b
+ db 11110000b,00011111b,11111111b
+ db 11110000b,00001111b,11111111b
+ db 11110000b,00000111b,11111111b
+ db 11110000b,00000011b,11111111b
+ db 11110000b,00000001b,11111111b
+ db 11110000b,00011111b,11111111b
+ db 11110001b,00001111b,11111111b
+ db 11110011b,00001111b,11111111b
+ db 11111111b,10000111b,11111111b
+ db 11111111b,10000111b,11111111b
+ db 11111111b,11000111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000100b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,10000000b,00000000b
+ db 00000111b,11000000b,00000000b
+ db 00000111b,11100000b,00000000b
+ db 00000111b,11110000b,00000000b
+ db 00000111b,11111000b,00000000b
+ db 00000111b,11111100b,00000000b
+ db 00000110b,11000000b,00000000b
+ db 00000100b,01100000b,00000000b
+ db 00000000b,01100000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FIVE *******************************
+
+ ; screen mask
+AlignClip578:
+
+ db 11111001b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111000b,00111111b,11111111b
+ db 11111000b,00011111b,11111111b
+ db 11111000b,00001111b,11111111b
+ db 11111000b,00000111b,11111111b
+ db 11111000b,00000011b,11111111b
+ db 11111000b,00000001b,11111111b
+ db 11111000b,00000000b,11111111b
+ db 11111000b,00001111b,11111111b
+ db 11111000b,10000111b,11111111b
+ db 11111001b,10000111b,11111111b
+ db 11111111b,11000011b,11111111b
+ db 11111111b,11000011b,11111111b
+ db 11111111b,11100011b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000010b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,10000000b,00000000b
+ db 00000011b,11000000b,00000000b
+ db 00000011b,11100000b,00000000b
+ db 00000011b,11110000b,00000000b
+ db 00000011b,11111000b,00000000b
+ db 00000011b,11111100b,00000000b
+ db 00000011b,11111110b,00000000b
+ db 00000011b,01100000b,00000000b
+ db 00000010b,00110000b,00000000b
+ db 00000000b,00110000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SIX *******************************
+
+ ; screen mask
+
+AlignClip678:
+ db 11111100b,11111111b,11111111b
+ db 11111100b,01111111b,11111111b
+ db 11111100b,00111111b,11111111b
+ db 11111100b,00011111b,11111111b
+ db 11111100b,00001111b,11111111b
+ db 11111100b,00000111b,11111111b
+ db 11111100b,00000011b,11111111b
+ db 11111100b,00000001b,11111111b
+ db 11111100b,00000000b,11111111b
+ db 11111100b,00000000b,11111111b
+ db 11111100b,00000111b,11111111b
+ db 11111100b,01000011b,11111111b
+ db 11111100b,11000011b,11111111b
+ db 11111111b,11100001b,11111111b
+ db 11111111b,11100001b,11111111b
+ db 11111111b,11110001b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,10000000b,00000000b
+ db 00000001b,11000000b,00000000b
+ db 00000001b,11100000b,00000000b
+ db 00000001b,11110000b,00000000b
+ db 00000001b,11111000b,00000000b
+ db 00000001b,11111100b,00000000b
+ db 00000001b,11111110b,00000000b
+ db 00000001b,11111111b,00000000b
+ db 00000001b,10110000b,00000000b
+ db 00000001b,00011000b,00000000b
+ db 00000000b,00011000b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SEVEN *******************************
+
+ ; screen mask
+AlignClip778:
+
+ db 11111110b,01111111b,11111111b
+ db 11111110b,00111111b,11111111b
+ db 11111110b,00011111b,11111111b
+ db 11111110b,00001111b,11111111b
+ db 11111110b,00000111b,11111111b
+ db 11111110b,00000011b,11111111b
+ db 11111110b,00000001b,11111111b
+ db 11111110b,00000000b,11111111b
+ db 11111110b,00000000b,11111111b
+ db 11111110b,00000000b,11111111b
+ db 11111110b,00000011b,11111111b
+ db 11111110b,00100001b,11111111b
+ db 11111110b,01100001b,11111111b
+ db 11111111b,11110000b,11111111b
+ db 11111111b,11110000b,11111111b
+ db 11111111b,11111000b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000000b,10000000b,00000000b
+ db 00000000b,11000000b,00000000b
+ db 00000000b,11100000b,00000000b
+ db 00000000b,11110000b,00000000b
+ db 00000000b,11111000b,00000000b
+ db 00000000b,11111100b,00000000b
+ db 00000000b,11111110b,00000000b
+ db 00000000b,11111111b,00000000b
+ db 00000000b,11111111b,00000000b
+ db 00000000b,11011000b,00000000b
+ db 00000000b,10001100b,00000000b
+ db 00000000b,00001100b,00000000b
+ db 00000000b,00000110b,00000000b
+ db 00000000b,00000110b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+clip_cursor79 db 00111111b,11111111b,11111111b
+ db 00011111b,11111111b,11111111b
+ db 00001111b,11111111b,11111111b
+ db 00000111b,11111111b,11111111b
+ db 00000011b,11111111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000000b,11111111b,11111111b
+ db 00000001b,11111111b,11111111b
+ db 00010000b,11111111b,11111111b
+ db 00110000b,11111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111000b,01111111b,11111111b
+ db 11111100b,01111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 01000000b,00000000b,00000000b
+ db 01100000b,00000000b,00000000b
+ db 01110000b,00000000b,00000000b
+ db 01111000b,00000000b,00000000b
+ db 01111100b,00000000b,00000000b
+ db 01111110b,00000000b,00000000b
+ db 01111111b,00000000b,00000000b
+ db 01111111b,00000000b,00000000b
+ db 01111111b,00000000b,00000000b
+ db 01101100b,00000000b,00000000b
+ db 01000110b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL ONE *******************************
+
+ ; screen mask
+
+AlignClip179:
+ db 10011111b,11111111b,11111111b
+ db 10001111b,11111111b,11111111b
+ db 10000111b,11111111b,11111111b
+ db 10000011b,11111111b,11111111b
+ db 10000001b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10000000b,11111111b,11111111b
+ db 10001000b,11111111b,11111111b
+ db 10011000b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00100000b,00000000b,00000000b
+ db 00110000b,00000000b,00000000b
+ db 00111000b,00000000b,00000000b
+ db 00111100b,00000000b,00000000b
+ db 00111110b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00111111b,00000000b,00000000b
+ db 00110110b,00000000b,00000000b
+ db 00100011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL TWO *******************************
+
+ ; screen mask
+
+AlignClip279:
+ db 11001111b,11111111b,11111111b
+ db 11000111b,11111111b,11111111b
+ db 11000011b,11111111b,11111111b
+ db 11000001b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000000b,11111111b,11111111b
+ db 11000100b,11111111b,11111111b
+ db 11001100b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00010000b,00000000b,00000000b
+ db 00011000b,00000000b,00000000b
+ db 00011100b,00000000b,00000000b
+ db 00011110b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011111b,00000000b,00000000b
+ db 00011011b,00000000b,00000000b
+ db 00010001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL THREE *******************************
+
+ ; screen mask
+
+AlignClip379:
+ db 11100111b,11111111b,11111111b
+ db 11100011b,11111111b,11111111b
+ db 11100001b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100000b,11111111b,11111111b
+ db 11100010b,11111111b,11111111b
+ db 11100110b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00001000b,00000000b,00000000b
+ db 00001100b,00000000b,00000000b
+ db 00001110b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001111b,00000000b,00000000b
+ db 00001101b,00000000b,00000000b
+ db 00001000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FOUR *******************************
+
+ ; screen mask
+
+AlignClip479:
+ db 11110011b,11111111b,11111111b
+ db 11110001b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110000b,11111111b,11111111b
+ db 11110001b,11111111b,11111111b
+ db 11110011b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000100b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000111b,00000000b,00000000b
+ db 00000110b,00000000b,00000000b
+ db 00000100b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL FIVE *******************************
+
+ ; screen mask
+AlignClip579:
+
+ db 11111001b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111000b,11111111b,11111111b
+ db 11111001b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000010b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000011b,00000000b,00000000b
+ db 00000010b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SIX *******************************
+
+ ; screen mask
+
+AlignClip679:
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111100b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000001b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+
+;****************** ALIGNED FOR PIXEL SEVEN *******************************
+
+ ; screen mask
+AlignClip779:
+
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111110b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+ db 11111111b,11111111b,11111111b
+
+ ; cursor mask
+
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+ db 00000000b,00000000b,00000000b
+
+CursorOffsetLUT dw current_cursor
+ dw AlignData1
+ dw AlignData2
+ dw AlignData3
+ dw AlignData4
+ dw AlignData5
+ dw AlignData6
+ dw AlignData7
+ClipOffsetLUT78 dw clip_cursor78
+ dw AlignClip178
+ dw AlignClip278
+ dw AlignClip378
+ dw AlignClip478
+ dw AlignClip578
+ dw AlignClip678
+ dw AlignClip778
+ClipOffsetLUT79 dw clip_cursor79
+ dw AlignClip179
+ dw AlignClip279
+ dw AlignClip379
+ dw AlignClip479
+ dw AlignClip579
+ dw AlignClip679
+ dw AlignClip779
+
+; pointer to the current look up table set for the pointer image.
+; The LUTs are swapped when the pointer enters bytes 78 and 79
+; along a scanline to prevent the pointer wrapping around the screen.
+
+PointerLUT label word
+ dw offset CursorOffsetLUT
+ ;;;;;;;;;;;;;;;;;;;;;;;
+ ;;;; End of what should be an include for pointer.inc
+ ;;;;;;;;;;;;;;;;;;;;;;;
+
+ even
+ clrgend dw 06e41h,07964h,05720h,07461h,06f73h,0f36eh
+ hiresylut dw 350,350,480,480
+
+;============================================================================
+; Surprisingly, a look up table multiply is much faster than
+; the shift - add instruction sequence for multiplying by 80.
+; So it would be silly not to use it eh? Times by 80 is needed
+; to convert a raster location (1 raster = 80 bytes) in pixel
+; y coordinates into a video buffer byte index
+; Note: Multiply by 80 is also used for text mode calculations
+; now! Andy on the 9/3/93
+;============================================================================
+ even
+
+ mult80lut label word
+
+ mulsum=0
+ REPT 480 ; number of VGA scanlines for mode 12h
+ dw mulsum
+ mulsum=mulsum+80
+ ENDM
+
+;============================================================================
+; A table to do a multiply by 320. This is used for converting number of
+; rasters into video buffer offsets for mode 13h (256 VGA colour mode).
+;============================================================================
+ even
+
+ mult320lut label word
+
+ mulsum=0
+ REPT 200 ; number of VGA scanlines for mode 13h
+ dw mulsum
+ mulsum=mulsum+320
+ ENDM
+ even
+
+;============================================================================
+; Look up table for use with modes 10h and 12h. This table provides the means
+; for the selection of a clipped or unclipped pointer image depending on the
+; current x position of the pointer.
+;============================================================================
+
+ ChooseImageLUT label word
+
+ REPT 624
+ dw offset CursorOffsetLUT
+ ENDM
+
+ REPT 8
+ dw offset ClipOffsetLUT78
+ ENDM
+
+ REPT 8
+ dw offset ClipOffsetLUT79
+ ENDM
+
+;============================================================================
+; Buffer arranged for 4 plane EGA video modes. The screen where
+; the pointer is going to be drawn is scanned plane by plane and
+; saved as bitplane separations.
+;============================================================================
+
+ even ; make sure that this data is word aligned
+
+ behindcursor dw 24 dup(?) ; Plane 0
+ dw 24 dup(?) ; Plane 1
+ dw 24 dup(?) ; Plane 2
+ dw 24 dup(?) ; Plane 3
+
+
+;============================================================================
+; a table of the video buffer segment for the supported
+; BIOS text and graphics modes.
+;============================================================================
+
+ even ; make sure that this data is word aligned
+
+ videomodetable dw 0b800h,0b800h ; modes 0,1
+ dw 0b800h,0b800h ; modes 2,3
+ dw 0b800h,0b800h ; modes 4,5
+ dw 0b800h,0b000h ; modes 6,7
+ dw 0ffffh,0ffffh ; n/a
+ dw 0ffffh,0ffffh ; n/a
+ dw 0ffffh,0a000h ; n/a,mode 0dh
+ dw 0a000h,0a000h ; modes 0eh,0fh
+ dw 0a000h,0a000h ; modes 10h,11h
+ dw 0a000h,0a000h ; modes 12h,13h
+ videobufferseg dw ?
+
+ even ; make sure that this data is word aligned
+
+ hotspot dw 2 dup(0)
+
+ VRAMlasttextcelloff label word ; last text offset in VRAM
+ VRAMlastbyteoff dw ? ; Last offset in VRAM
+ VRAMlastbitoff dw ? ; LSB: Where pointer is in byte
+ ; MSB: ODD/EVEN of the pointer
+ ; first scan line
+ LastXCounters dw ? ; last X looping counter
+ LastYCounters dw ? ; last Y looping counter
+ ; ODD in LSB and EVEN in MSB
+ lasttextimage dw ? ; text cell from last time
+
+ background dw NOTSTORED ; STORED if data in buffer
+ current_position_x dw ?
+ current_position_y dw ?
+ vidbytealigned dw ?
+ lastmaskrotate dw ?
+ lastvidmode db 0ffh ; the video mode during the last int.
+ internalCF db 0ffh ; the mouse driver keeps a flag called
+ ; the internal cursor flag. If the flag
+ ; = 0, then int 33h f1 will display the
+ ; pointer, -1 = default value.
+
+ ; 32 bit code writes to this area on a hardware interrupt and
+ ; when an app does an int 33h function 3, it reads the data
+ ; directly from here.
+ ; Data format is: word 0 -> button status
+ ; word 1 -> x virtual coordinate
+ ; word 2 -> y virtual coordinate
+
+ function3data dw 3 dup(?)
+
+ conditional_off db 0 ;!= 0 if conditional off is on
+ ;
+;=============================================================================
+; Data to determine the address of where the latches should be saved in the
+; video buffer for the current video mode.
+; latchcache contains the value looked up by saveVGAregisters and used by
+; restoreVGAregisters.
+;=============================================================================
+
+
+ latchcache dw ? ; location of latch cache in VRAM
+even
+latchhomeLUT label word
+ dw ? ; mode 0
+ dw ? ; mode 1
+ dw ? ; mode 2
+ dw ? ; mode 3
+ dw ? ; mode 4
+ dw ? ; mode 5
+ dw ? ; mode 6
+ dw ? ; mode 7
+ dw ? ; mode 8
+ dw ? ; mode 9
+ dw ? ; mode a
+ dw ? ; mode b
+ dw ? ; mode c
+ dw ? ; mode d
+ dw 80*200+78 ; mode e
+ dw 80*350+78 ; mode f
+ dw 80*350+78 ; mode 10
+ dw 80*480+78 ; mode 11
+ dw 80*480+78 ; mode 12
+
+;=============================================================================
+; CGA video mode 4 is a 2 bit per pixel graphics mode. The pointer images
+; received from the application (or the default images for that matter) are
+; described by a one bit per pixel map. This look up table provides the means
+; of conversion from one to two bits per pixel.
+;=============================================================================
+even
+LUT1to2bit label word
+ dw 00000h,00003h,0000Ch,0000Fh,00030h,00033h,0003Ch,0003Fh
+ dw 000C0h,000C3h,000CCh,000CFh,000F0h,000F3h,000FCh,000FFh
+ dw 00300h,00303h,0030Ch,0030Fh,00330h,00333h,0033Ch,0033Fh
+ dw 003C0h,003C3h,003CCh,003CFh,003F0h,003F3h,003FCh,003FFh
+ dw 00C00h,00C03h,00C0Ch,00C0Fh,00C30h,00C33h,00C3Ch,00C3Fh
+ dw 00CC0h,00CC3h,00CCCh,00CCFh,00CF0h,00CF3h,00CFCh,00CFFh
+ dw 00F00h,00F03h,00F0Ch,00F0Fh,00F30h,00F33h,00F3Ch,00F3Fh
+ dw 00FC0h,00FC3h,00FCCh,00FCFh,00FF0h,00FF3h,00FFCh,00FFFh
+
+ dw 03000h,03003h,0300Ch,0300Fh,03030h,03033h,0303Ch,0303Fh
+ dw 030C0h,030C3h,030CCh,030CFh,030F0h,030F3h,030FCh,030FFh
+ dw 03300h,03303h,0330Ch,0330Fh,03330h,03333h,0333Ch,0333Fh
+ dw 033C0h,033C3h,033CCh,033CFh,033F0h,033F3h,033FCh,033FFh
+ dw 03C00h,03C03h,03C0Ch,03C0Fh,03C30h,03C33h,03C3Ch,03C3Fh
+ dw 03CC0h,03CC3h,03CCCh,03CCFh,03CF0h,03CF3h,03CFCh,03CFFh
+ dw 03F00h,03F03h,03F0Ch,03F0Fh,03F30h,03F33h,03F3Ch,03F3Fh
+ dw 03FC0h,03FC3h,03FCCh,03FCFh,03FF0h,03FF3h,03FFCh,03FFFh
+
+ dw 0C000h,0C003h,0C00Ch,0C00Fh,0C030h,0C033h,0C03Ch,0C03Fh
+ dw 0C0C0h,0C0C3h,0C0CCh,0C0CFh,0C0F0h,0C0F3h,0C0FCh,0C0FFh
+ dw 0C300h,0C303h,0C30Ch,0C30Fh,0C330h,0C333h,0C33Ch,0C33Fh
+ dw 0C3C0h,0C3C3h,0C3CCh,0C3CFh,0C3F0h,0C3F3h,0C3FCh,0C3FFh
+ dw 0CC00h,0CC03h,0CC0Ch,0CC0Fh,0CC30h,0CC33h,0CC3Ch,0CC3Fh
+ dw 0CCC0h,0CCC3h,0CCCCh,0CCCFh,0CCF0h,0CCF3h,0CCFCh,0CCFFh
+ dw 0CF00h,0CF03h,0CF0Ch,0CF0Fh,0CF30h,0CF33h,0CF3Ch,0CF3Fh
+ dw 0CFC0h,0CFC3h,0CFCCh,0CFCFh,0CFF0h,0CFF3h,0CFFCh,0CFFFh
+
+ dw 0F000h,0F003h,0F00Ch,0F00Fh,0F030h,0F033h,0F03Ch,0F03Fh
+ dw 0F0C0h,0F0C3h,0F0CCh,0F0CFh,0F0F0h,0F0F3h,0F0FCh,0F0FFh
+ dw 0F300h,0F303h,0F30Ch,0F30Fh,0F330h,0F333h,0F33Ch,0F33Fh
+ dw 0F3C0h,0F3C3h,0F3CCh,0F3CFh,0F3F0h,0F3F3h,0F3FCh,0F3FFh
+ dw 0FC00h,0FC03h,0FC0Ch,0FC0Fh,0FC30h,0FC33h,0FC3Ch,0FC3Fh
+ dw 0FCC0h,0FCC3h,0FCCCh,0FCCFh,0FCF0h,0FCF3h,0FCFCh,0FCFFh
+ dw 0FF00h,0FF03h,0FF0Ch,0FF0Fh,0FF30h,0FF33h,0FF3Ch,0FF3Fh
+ dw 0FFC0h,0FFC3h,0FFCCh,0FFCFh,0FFF0h,0FFF3h,0FFFCh,0FFFFh
+
+;============================================================================
+; Table for selection of the correct pointer image for the current location
+; in the video buffer, when using video BIOS mode 4.
+;============================================================================
+
+mode4pointerLUT label word
+ REPT 76 ; for the first 76 bytes of scanline, use these
+ dw current_cursor
+ dw AlignData1
+ dw AlignData2
+ dw AlignData3
+ ENDM
+ dw clip_cursor78
+ dw AlignClip178
+ dw AlignClip278
+ dw AlignClip378
+ dw AlignClip478
+ dw AlignClip578
+ dw AlignClip678
+ dw AlignClip778
+ dw clip_cursor79
+ dw AlignClip179
+ dw AlignClip279
+ dw AlignClip379
+ dw AlignClip479
+ dw AlignClip579
+ dw AlignClip679
+ dw AlignClip779
+
+;============================================================================
+; Look up table to adjust CX on clipping in mode 4. This allows the mode4
+; pointer drawing algorithm to use the modes 10h/12h clipped pointer data
+; without having to modify it. The problem is that mode 10/12 expects the
+; data to be 4 bits per pixel and aligned to a word, whereas mode 4 is 2 bits
+; per pixel and aligns to a byte.
+;============================================================================
+
+mode4clipCXadjustLUT label word
+ adjtemp=0 ; data for pixel x-coordinates 0 -> 307
+ REPT 77
+ dw 4 dup(adjtemp)
+ adjtemp=adjtemp+1
+ ENDM
+ dw 4 dup(76) ; data for pixels 308 -> 311
+ dw 8 dup(78) ; data for pixels 312 -> 319
+
+
+;============================================================================
+; The CGA buffer is split at 2000h. Therefore if the pointer starts writing
+; below scanline 199 on the video display, the odd scanline video buffer
+; will become corrupted. In these cases, the pointer should be clipped to
+; display scanline 199. The look up table below maps loop counters to a
+; display scanline for this purpose.
+;
+; table arrangement (odd scanline data, even scanline data)
+;
+;============================================================================
+
+mode4clipDXLUT label word
+
+ db 200-15 dup(8,8) ; scanlines 0 -> 184
+ db 8,7 ; scanline 185
+ db 7,7 ; scanline 186
+ db 7,6 ; scanline 187
+ db 6,6 ; scanline 188
+ db 6,5 ; scanline 189
+ db 5,5 ; scanline 190
+ db 5,4 ; scanline 191
+ db 4,4 ; scanline 192
+ db 4,3 ; scanline 193
+ db 3,3 ; scanline 194
+ db 3,2 ; scanline 195
+ db 2,2 ; scanline 196
+ db 2,1 ; scanline 197
+ db 1,1 ; scanline 198
+ db 1,0 ; scanline 199
+
+mode4SelectedPointer label word
+ dw ?
+
+;==========================================================================
+; Some space into which the Medium resolution graphics pointer background
+; gets stored. Note that the 256 colour mode buffer encroaches on that of
+; mode 4.
+;==========================================================================
+
+bkgrnd256 label byte ; 256 colour buffer = 24*16 @ 1 byte/pix
+ db 384-64 dup(?) ; share the CGA buffer(=64 bytes)
+
+CGAbackgrnd label byte
+
+ db 24/4*16 dup(?) ; 24 pixels/row @ 4 pixels/byte for 16
+ ; rows.
+
+;===========================================================================
+; Jump table to redirect the code flow according to the current video mode.
+; Used in the 32 bit entry point procedure.
+; Pointer drawing routines.
+;===========================================================================
+even
+drawpointerJMPT label word
+ dw offset not_supported ; mode 0
+ dw offset not_supported ; mode 1
+IFDEF SIXTEENBIT
+ dw offset drawTextPointer ; mode 2
+ dw offset drawTextPointer ; mode 3
+ELSE
+ dw offset not_supported ; mode 2
+ dw offset not_supported ; mode 3
+ENDIF
+ dw offset drawMediumResPointer ; mode 4
+ dw offset drawMediumResPointer ; mode 5
+ dw offset not_supported ; mode 6
+IFDEF SIXTEENBIT
+ dw offset drawTextPointer ; mode 7
+ELSE
+ dw offset not_supported ; mode 7
+ENDIF
+ dw offset not_supported ; mode 8
+ dw offset not_supported ; mode 9
+ dw offset not_supported ; mode a
+ dw offset not_supported ; mode b
+ dw offset not_supported ; mode c
+ dw offset not_supported ; mode d
+ dw offset not_supported ; mode e
+ dw offset drawHiResPointer ; mode f
+ dw offset drawHiResPointer ; mode 10
+ dw offset drawHiResPointer ; mode 11
+ dw offset drawHiResPointer ; mode 12
+ dw offset drawC256pointer ; mode 13
+
+;===========================================================================
+; Jump table to redirect the code flow according to the current video mode.
+; Used in the 32 bit entry point procedure.
+; INT 33h Function 1 support modules.
+;===========================================================================
+even
+int33function1JMPT label word
+ dw offset not_supported ; mode 0
+ dw offset not_supported ; mode 1
+IFDEF SIXTEENBIT
+ dw offset TextInt33Function1 ; mode 2
+ dw offset TextInt33Function1 ; mode 3
+ELSE
+ dw offset not_supported ; mode 2
+ dw offset not_supported ; mode 3
+ENDIF
+ dw offset MediumResInt33Function1 ; mode 4
+ dw offset MediumResInt33Function1 ; mode 5
+ dw offset not_supported ; mode 6
+IFDEF SIXTEENBIT
+ dw offset TextInt33Function1 ; mode 7
+ELSE
+ dw offset not_supported ; mode 7
+ENDIF
+ dw offset not_supported ; mode 8
+ dw offset not_supported ; mode 9
+ dw offset not_supported ; mode a
+ dw offset not_supported ; mode b
+ dw offset not_supported ; mode c
+ dw offset not_supported ; mode d
+ dw offset not_supported ; mode e
+ dw offset HiResInt33Function1 ; mode f
+ dw offset HiResInt33Function1 ; mode 10
+ dw offset HiResInt33Function1 ; mode 11
+ dw offset HiResInt33Function1 ; mode 12
+ dw offset C256Int33Function1 ; mode 13
+
+;===========================================================================
+; Jump table to redirect the code flow according to the current video mode.
+; Used in the 32 bit entry point procedure.
+; INT 33h Function 2 support modules.
+;===========================================================================
+even
+int33function2JMPT label word
+ dw offset not_supported ; mode 0
+ dw offset not_supported ; mode 1
+IFDEF SIXTEENBIT
+ dw offset TextInt33Function2 ; mode 2
+ dw offset TextInt33Function2 ; mode 3
+ELSE
+ dw offset not_supported ; mode 2
+ dw offset not_supported ; mode 3
+ENDIF
+ dw offset MediumResInt33Function2 ; mode 4
+ dw offset MediumResInt33Function2 ; mode 5
+ dw offset not_supported ; mode 6
+IFDEF SIXTEENBIT
+ dw offset TextInt33Function2 ; mode 7
+ELSE
+ dw offset not_supported ; mode 7
+ENDIF
+ dw offset not_supported ; mode 8
+ dw offset not_supported ; mode 9
+ dw offset not_supported ; mode a
+ dw offset not_supported ; mode b
+ dw offset not_supported ; mode c
+ dw offset not_supported ; mode d
+ dw offset not_supported ; mode e
+ dw offset HiResInt33Function2 ; mode f
+ dw offset HiResInt33Function2 ; mode 10
+ dw offset HiResInt33Function2 ; mode 11
+ dw offset HiResInt33Function2 ; mode 12
+ dw offset C256Int33Function2 ; mode 13
+
+
+
+;==========================================================================
+; Some storage space for the critical VGA registers.
+;==========================================================================
+
+;Sequencer Registers
+
+seqregs label byte
+ db 4 dup(?) ; N.B. sequencer reset reg doesn't
+ ; get saved.
+
+; Graphics Controller Registers
+
+GCregs label byte
+ db 9 dup(?)
+
+;==========================================================================
+; The mouse driver's very own stack. To prevent unnecessary tears,
+; particulary from the application running in DOS land, a stack is
+; maintained by the driver. This prevents the driver routines from
+; blowing a very full stack elsewhere.
+; N.B. on leaving the driver, the stack should be empty!
+;==========================================================================
+
+even
+mouse_stack dw STACKSIZE dup(?)
+top_of_stack label word
+ dw ? ; this is where the stack starts
+
+;===========================================================================
+; The memory variable below is incremented on entry to the 16 bit code
+; and on exit, decremented. If an interrupt occurs during the execution of
+; this 16 bit code, the flag is incremented again, and thus greater than zero
+; so it is known that the code has been reentered and the stack must be
+; maintained accordingly.
+;===========================================================================
+
+reentrant dw -1
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; END OF DATA
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+
+;================================================================
+; code to redirect the flow of control from the segment:offset for
+; the mouse interrupt (33h) as indicated in the IVT (the IVT entry
+; has been set to point to here) to the Insignia mouse driver code.
+;================================================================
+int33h_vector:
+
+ jmp short skip
+
+; High level language entry point.
+
+lvector db 0EAh ; far jump opcode
+loffset dw ? ; destination offset
+lseg dw ? ; destination segment
+
+skip:
+db 0EAh ; far jump opcode
+moff dw ? ; will be filled in by the driver code from the IVT
+mseg dw ? ; as before
+
+DOCLI:
+ FCLI
+ ret
+
+DOSTI:
+ FSTI
+ ret
+
+DOIRET:
+ FIRET
+
+
+;================================================================
+; Functions moved out of ROM - real ROMS mapped in
+;================================================================
+
+unexp_int:
+ bop UNEXP_BOP
+ jmp DOIRET
+
+mouse_io:
+ ;
+ ; INT 33h entry point
+ ;
+
+ jmp mio_hack
+ nop
+mouse_io_lang: ; entry point for HLL
+ pushf ; check ASAP if redundant show/hide cursor
+ push di ; save di,
+ mov di, [di+14] ; get first parameter (mouse function),
+ ; then duplicate mio_hack below.
+ ; this has to be done to preserve
+ ; compatibility between both ways to
+ ; call the mouse.
+ jz lbop ; F0
+ cmp di,2
+ jg lbop ; >F2
+ je miol_2
+miol_1:
+ mov conditional_off, 0 ; disable conditonal off
+ cmp [internalCF],0 ; is the flag already zero?
+ je miol_12_quit ; if so, do nothing
+ inc [internalCF] ; increment it
+ jz lbop
+miol_12_quit:
+ pop di
+ popf
+ jmp DOIRET
+
+miol_2:
+ dec [internalCF] ; decrement the pointer internal flag
+ cmp [internalCF], 0ffh; currently displayed?
+ jne miol_12_quit
+lbop:
+ pop ax
+ popf
+ bop IO_LANG_BOP
+ retf 8
+
+mio_hack: ; int 33h handler
+ pushf ; save up the flags
+ cmp ax,1 ; mouse show cursor.
+ je mio_1
+ cmp ax,2 ; mouse hide cursor.
+ je mio_2
+ cmp ax,3 ; get button status and mouse position.
+ je mio_3
+ cmp ax,9 ; set graphics cursor
+ je mio_9
+ cmp ax,10 ; set text cursor - not supported
+ je mio_quit ; return straight back to app.
+
+ jmp short hack1bop ; none of the above, so goto 32 bit land
+
+mio_1:
+ mov conditional_off, 0 ; disable conditional off
+ cmp [internalCF],0 ; is the flag already zero?
+ je mio_quit ; if so, do nothing
+ inc [internalCF] ; increment it
+ jz hack1bop ; just turned zero, so turn pointer on
+ ; via the 32 bit code.
+mio_quit:
+ popf
+ jmp DOIRET
+
+mio_2:
+ dec [internalCF] ; decrement the pointer internal flag
+ cmp [internalCF], 0ffh; currently displayed?
+ jne mio_quit ; Already turned off, so quit
+
+hack1bop:
+ popf
+ bop IO_INTR_BOP ; BOP to the 32 bit part of the handler
+ jmp DOIRET ; return back after the BOP to caller
+mio_9:
+ call int33function9 ; change the shape of the graphics pointer
+ popf ; restore the flag state
+ jmp DOIRET ; back to the caller
+mio_3:
+ mov bx,[function3data] ; return button status
+ mov cx,[function3data+2] ; return x coordinate
+ mov dx,[function3data+4] ; return x coordinate
+ popf ; return back to the application
+ jmp DOIRET ; via an iret.
+
+
+IFDEF MOUSE_VIDEO_BIOS
+
+mouse_video_io:
+
+ pushf
+ or ah,ah
+ jne mvio1
+ jmp do_bop
+mvio1:
+ cmp ax,6f05h
+ jne mvio2
+ jmp do_bop
+mvio2:
+ cmp ah,4
+ jne mvio3
+ jmp do_bop
+mvio3:
+
+;=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
+
+ ; Microsoft EGA.LIB function support
+ ; input: AH = the function required
+
+ cmp ah,0f0h ; is function F0 or greater?
+ jge mvio4 ; YES, so check to see if less than or == F7
+ jmp go_rom ; NO, so do rom stuff
+mvio4:
+ cmp ah,0f7h ; is it greater than F7
+ jg mvio5 ; YES, so test for == FA
+ jmp ega_lib ; NO, but in range F0 to F7, so do EGALIB emm
+mvio5:
+ cmp ah,0fah
+ jne mvio6
+ jmp egaFA
+mvio6:
+ jmp go_rom
+
+ ; to get here, must want to do mouse video functions 0f0h to 0f7h or
+ ; function 0fah.
+
+ jmp ega_lib
+
+ ; data area for EGA.LIB function support
+ ; Notice that the sequencer register buffer only has space
+ ; for four entrys even though it actually has five addressable
+ ; registers. The Sequencer RESET status is not stored, so the buffer
+ ; is arranged thus:
+ ; buffer offset 0 1 2 3
+ ; register index 1 2 3 4
+ ;
+
+ even
+
+ ega_current_crtc db 25 dup(?) ; driver's copy of CRTC regs
+ ega_current_seq db 4 dup(?) ; driver's copy of Seq regs
+ ega_current_graph db 9 dup(?) ; driver's copy of GC regs
+ ega_current_attr db 20 dup(?) ; driver's copy of AC regs
+ ega_current_misc db ? ; driver's copy of misc reg
+ dirty_crtc db 25 dup(?)
+ dirty_seq db 4 dup(?)
+ dirty_graph db 9 dup(?)
+ dirty_attr db 20 dup(?)
+ ega_default_crtc db 25 dup(?) ; default EGA register values
+ ega_default_seq db 4 dup(?) ; as set by the application
+ ega_default_graph db 9 dup(?) ; through a call to F7
+ ega_default_attr db 20 dup(?)
+ ega_default_misc db ?
+
+ relnum label word
+
+ release_major db MAJOR_RELEASE_NUMBER
+ release_minor db MINOR_RELEASE_NUMBER
+
+ even
+
+ egalibjmp label word ; crafty jump table to replace a base
+ ; switch
+ dw egaF0 ; 0F0h - read one EGA register
+ dw egaF1 ; 0F1h - write one EGA register
+ dw egaF2 ; 0F2h - read register range
+ dw egaF3 ; 0F3h - write register range
+ dw egaF4 ; 0F4h - read register set
+ dw egaF5 ; 0F5h - write register set
+ dw egaF6 ; 0F6h - revert to default regs
+ dw egaF7 ; 0F7h - define deflt reg table
+ dw noint ; 0F8h is not a valid function
+ dw noint ; 0F9h is not a valid function
+ dw egaFA ; 0FAh - interrogate driver
+ega_lib:
+
+ xor al,al
+ sub ax,0f0h ; create a jump table index
+ shl ax,1 ; remember that a word pointer is reqd
+ mov si,ax
+ jmp [egalibjmp+si] ; get the relavent jump address
+
+egaF0: ;--- Read an EGA register ----------------------------------------------
+
+ pusha
+ and bx,0ffh ; just want the lower byte (BL)
+F00:
+ cmp dx,0
+ jne F08
+ mov bl,byte ptr [ega_current_crtc+bx]
+ popa
+ jmp noint
+F08:
+ cmp dx,8
+ jne F010
+ dec bx ; note that RESET is not stored
+ mov bl,byte ptr [ega_current_seq+bx]
+ popa
+ jmp noint
+F010:
+ cmp dx,010h
+ jne F018
+ mov bl,byte ptr [ega_current_graph+bx]
+ popa
+ jmp noint
+F018:
+ cmp dx,018h
+ jne F020
+ mov bl,byte ptr [ega_current_attr+bx]
+ popa
+ jmp noint
+F020:
+ cmp dx,020h
+ jne F028
+ mov bl,byte ptr [ega_current_misc]
+
+F028: ; do nothing for this case
+F0quit:
+ popa
+ jmp noint
+
+egaF1: ;--- Write an EGA register --------------------------------------------
+
+F10:
+ pusha
+ cmp dx,0
+ jne F18
+ mov dx,03d4h ; write to the CRTC index register
+ mov ax,bx ; values to write to ports 3d4/3d5
+ out dx,ax ; do the write
+ mov di,bx ; save the written values to memory
+ and di,0ffh ; get just the lower 8 bits
+ mov byte ptr [ega_current_crtc+di],bh
+ mov byte ptr [dirty_crtc+di],1
+ popa
+ jmp noint
+F18:
+ cmp dx,8
+ jne F110
+ mov dx,03c4h ; write to the Sequencer index register
+ mov ax,bx ; values to write to ports 3c4/3c5
+ out dx,ax ; do the write
+ cmp bl,0 ; Cannot index reset because it its
+ jle F18bra1 ; not stored. range = 1->4
+ and bx,0ffh ; just want BL
+ dec bx ; actually, one less than that
+ mov byte ptr [ega_current_seq+bx],ah
+ mov byte ptr [dirty_seq+bx],1
+F18bra1:
+ popa
+ jmp noint
+F110:
+ cmp dx,010h
+ jne F118
+ mov dx,03ceh ; write to the Graphics controller
+ mov ax,bx ; values to write to ports 3ce/3cf
+ out dx,ax ; do the write
+ mov di,bx ; save the written values to memory
+ and di,0ffh ; get just the lower 8 bits
+ mov byte ptr [ega_current_graph+di],bh
+ mov byte ptr [dirty_graph+di],1
+ popa
+ jmp noint
+F118:
+ cmp dx,018h
+ jne F120
+ mov dx,03dah ; clear attribute controller index
+ in al,dx ; the read clears this register
+ mov ax,bx ; need to write BX to the ports
+ mov dx,03c0h ; Attribute Controller index register
+ out dx,ax ; do the write
+ inc dx
+ mov al,020h ; EGA palette enable
+ out dx,al ; enable the palette
+ mov di,bx ; save the written values to memory
+ and di,0ffh ; get just the lower 8 bits
+ mov byte ptr [ega_current_graph+di],bh
+ mov byte ptr [dirty_graph+di],1
+ popa
+ jmp noint
+F120:
+ cmp dx,020h
+ jne F128
+ mov dx,03c2h ; EGA miscellaneous register
+ mov al,bl
+ out dx,al ; write to the register
+ mov [ega_current_misc],bl
+ popa
+ jmp noint
+F128:
+ cmp dx,028h
+ jne F128
+ mov dx,03dah ; EGA feature register
+ mov al,bl
+ out dx,al
+F1quit:
+ popa
+ jmp noint
+
+egaF2: ;--- Read a register range ---------------------------------------------
+
+ pusha
+ cmp dx,0
+ jne F28
+F20:
+ lea si,ega_current_crtc ; get the address of this buffer
+ mov dx,cx ; save this value
+ xchg ch,cl ; create an index with CH
+ and cx,0ffh ; only need CH (now CL)
+ add si,cx ; SOURCE adjust the address
+ xor dh,dh ; only want the old CL value
+ mov cx,dx ; restore CX
+ mov di,bx ; DESTINATION got from the application
+ rep movsb ; copy to the app's register block
+ popa
+ jmp noint
+F28:
+ cmp dx,8
+ jne F210
+ lea si,ega_current_seq ; get the address of this buffer
+ mov dx,cx ; save this value
+ xchg ch,cl ; create an index with CH
+ and cx,0ffh ; only need CH (now CL)
+ dec cx ; RESET is not stored, so index-1
+ add si,cx ; SOURCE adjust the address
+ xor dh,dh ; only want the old CL value
+ mov cx,dx ; restore CX
+ mov di,bx ; DESTINATION got from the application
+ rep movsb ; copy to the app's register block
+ popa
+ jmp noint
+F210:
+ cmp dx,010h
+ jne F218
+ lea si,ega_current_graph ; get the address of this buffer
+ mov dx,cx ; save this value
+ xchg ch,cl ; create an index with CH
+ and cx,0ffh ; only need CH (now CL)
+ add si,cx ; SOURCE adjust the address
+ xor dh,dh ; only want the old CL value
+ mov cx,dx ; restore CX
+ mov di,bx ; DESTINATION got from the application
+ rep movsb ; copy to the app's register block
+ popa
+ jmp noint
+F218:
+ cmp dx,018h
+ jne F2quit
+ lea si,ega_current_attr ; get the address of this buffer
+ mov dx,cx ; save this value
+ xchg ch,cl ; create an index with CH
+ and cx,0ffh ; only need CH (now CL)
+ add si,cx ; SOURCE adjust the address
+ xor dh,dh ; only want the old CL value
+ mov cx,dx ; restore CX
+ mov di,bx ; DESTINATION got from the application
+ rep movsb ; copy the application's register block
+F2quit:
+ popa
+ jmp noint
+
+egaF3: ;--- Write a register range to the EGA adapter ------------------------
+
+ pusha
+ push ds
+ push es
+F31:
+ cmp dx,0
+ jne F38
+ lea di,ega_current_crtc ; write the application data here
+ mov al,ch ; adjust the write position as required
+ cbw
+ add di,ax ; DESTINATION specified address
+ mov si,bx ; SOURCE from the application
+ lea bx,dirty_crtc ; need to write some data into here
+ add bx,ax ; well, at this offset anyway
+ mov ax,es ; The application is the source
+ mov ds,ax ; so point to its segment
+ mov dx,03d4h ; CRTC index register
+ mov ah,ch ; CRTC register to start at
+ xor ch,ch ; CX is now the loop counter
+ assume ds:nothing
+F31cp:
+ mov byte ptr cs:[bx],1 ; fill in the dirty_crtc array
+ inc bx
+ movsb ; get the value from the app to write
+ ; and write to the internal buffer
+ out dx,ax ; write to the EGA adapter
+ loop F31cp
+ jmp F3quit
+F38:
+ cmp dx,8
+ jne F310
+ lea di,ega_current_seq ; write the application data here
+ mov al,ch ; adjust the write position as required
+ cbw
+ add di,ax ; DESTINATION specified address
+ dec di ; RESET is not stored, so index-1
+ mov si,bx ; SOURCE from the application
+ lea bx,dirty_seq ; need to write some data into here
+ add bx,ax ; well, at this offset anyway
+ inc bx
+ mov ax,es ; The application is the source
+ mov ds,ax ; so point to its segment
+ mov dx,03c4h ; Sequencer index register
+ mov ah,ch ; Sequencer register to start at
+ inc ah
+ xor ch,ch ; CX is now the loop counter
+ assume ds:nothing
+F38cp:
+ mov byte ptr cs:[bx],1 ; fill in the dirty_seq array
+ inc bx
+ movsb ; get the value from the app to write
+ ; and write to the internal buffer
+ out dx,ax ; write to the EGA adapter
+ loop F38cp
+ assume ds:SpcMseSeg
+ jmp F3quit
+F310:
+ cmp dx,010h
+ jne F318
+ lea di,ega_current_graph ; write the application data here
+ mov al,ch ; adjust the write position as required
+ cbw
+ add di,ax ; DESTINATION specified address
+ mov si,bx ; SOURCE from the application
+ lea bx,dirty_graph ; need to write some data into here
+ add bx,ax ; well, at this offset anyway
+ mov ax,es ; The application is the source
+ mov ds,ax ; so point to its segment
+ mov dx,03ceh ; Graphics Controller index register
+ mov ah,ch ; GC register to start at
+ xor ch,ch ; CX is now the loop counter
+ assume ds:nothing
+F310cp:
+ mov byte ptr cs:[bx],1 ; fill in the dirty_graph array
+ inc bx
+ movsb ; get the value from the app to write
+ ; and write to the internal buffer
+ out dx,ax ; write to the EGA adapter
+ loop F310cp
+ assume ds:SpcMseSeg
+ jmp short F3quit
+F318:
+ cmp dx,018h
+ jne F3quit
+ mov dx,03dah ; clear attribute controller index
+ in al,dx ; the read clears this register
+ lea di,ega_current_attr ; write the application data here
+ mov al,ch ; adjust the write position as required
+ cbw
+ add di,ax ; DESTINATION specified address
+ mov si,bx ; SOURCE from the application
+ lea bx,dirty_attr ; need to write some data into here
+ add bx,ax ; well, at this offset anyway
+ mov ax,es ; The application is the source
+ mov ds,ax ; so point to its segment
+ mov dx,03c0h ; Attribute Controller index register
+ mov ah,ch ; AC register to start at
+ xor ch,ch ; CX is now the loop counter
+ assume ds:nothing
+F318cp:
+ mov byte ptr cs:[bx],1 ; fill in the dirty_attr array
+ inc bx
+ movsb ; get the value from the app to write
+ ; and write to the internal buffer
+ out dx,ax ; write to the EGA adapter
+ loop F318cp
+ assume ds:SpcMseSeg
+F3quit:
+ pop es
+ pop ds
+ popa
+ jmp noint
+
+egaF4: ;--- Read EGA register set -------------------------------------------
+ ;
+ ; note that the incoming/outgoing data is structured thus:
+ ;
+ ; from application --> db Port number
+ ; --> db must be zero
+ ; --> db pointer value
+ ; to application <-- db data read from register
+
+ pusha
+F4lp:
+ mov al,byte ptr es:[bx] ; get the type of the next EGA register
+ mov dl,byte ptr es:[bx+2] ; load up the offset required
+ xor dh,dh ; convert DL to a word (DX)
+ add bx,3 ; point to where the data should
+ ; be written for the application
+F40:
+ cmp al,0
+ jne F48
+ lea di,ega_current_crtc ; point to the internal CRTC reg. buffer
+ add di,dx ; index into the buffer
+ mov al,byte ptr [di] ; get the register value from the driver
+ mov byte ptr es:[bx],al ; store the register value
+ jmp short F4lp2 ; do the next loop iteration
+F48:
+ cmp al,8
+ jne F410
+ lea di,ega_current_seq ; point to the internal Sequencer buffer
+ add di,dx ; index into the buffer
+ dec di ; RESET is not stored, so index off 1
+ mov al,byte ptr [di] ; get the register value from the driver
+ mov byte ptr es:[bx],al ; store the register value
+ jmp short F4lp2 ; do the next loop iteration
+F410:
+ cmp al,010h
+ jne F418
+ lea di,ega_current_graph ; point to the internal GC reg. buffer
+ add di,dx ; index into the buffer
+ mov al,byte ptr [di] ; get the register value from the driver
+ mov byte ptr es:[bx],al ; store the register value
+ jmp short F4lp2 ; do the next loop iteration
+F418:
+ cmp al,018h
+ jne F420
+ lea di,ega_current_attr ; point to the interal AC reg. buffer
+ add di,dx ; index into the buffer
+ mov al,byte ptr [di] ; get the register value from the driver
+ mov byte ptr es:[bx],al ; store the register value
+ jmp short F4lp2 ; do the next loop iteration
+F420:
+ cmp al,020h
+ jne F4lp2
+ mov al,[ega_current_misc] ; load contents of miscellaneous reg
+ mov byte ptr[di],al ; store the register value
+
+ ; the C code actually loads BL here but I don't know why!
+F4lp2:
+ inc bx ; point to the next 'record'
+ loop F4lp
+ popa
+ jmp noint
+
+egaF5: ;--- Write EGA register set -------------------------------------------
+ ;
+ ; note that the incoming data is structured thus:
+ ;
+ ; from application --> db Port number
+ ; --> db must be zero
+ ; --> db pointer value
+ ; --> db data read from register
+
+ pusha
+F5lp:
+ mov al,byte ptr es:[bx] ; get the type of the next EGA register
+ mov dl,byte ptr es:[bx+2] ; load up the offset required
+ xor dh,dh ; turn from 8 bit to a word quantity
+ mov si,dx ; need this when accessing buffers
+ add bx,3 ; point to where the data should
+ ; be written for the application
+ mov ah,byte ptr es:[bx] ; load data to send to the port
+ inc bx ; point to the next 'record'
+F50:
+ cmp al,0
+ jne F58
+ mov al,dl ; also the port offset to access
+ mov dx,03d4h ; index register for CRTC
+ out dx,ax ; write to the specified port
+ mov byte ptr [ega_current_crtc+si],ah
+ mov byte ptr [dirty_crtc+si],1
+ jmp short F5lp2
+F58:
+ cmp al,8
+ jne F510
+ mov al,dl ; also the port offset to access
+ mov dx,03c4h ; index register for Sequencer
+ out dx,ax ; write to the specified port
+ dec si ; RESET is not stored, so index off 1
+ mov byte ptr [ega_current_seq+si],ah
+ mov byte ptr [dirty_seq+si],1
+ jmp short F5lp2
+F510:
+ cmp al,010h
+ jne F518
+ mov al,dl ; also the port offset to access
+ mov dx,03ceh ; index register for GC
+ out dx,ax ; write to the specified port
+ mov byte ptr [ega_current_graph+si],ah
+ mov byte ptr [dirty_graph+si],1
+ jmp short F5lp2
+F518:
+ cmp al,018h
+ jne F520
+ mov dx,03dah ; clear attribute controller index
+ in al,dx ; the read clears this register
+ lea di,ega_current_attr ; write the application data here
+ mov al,dl ; also the port offset to access
+ mov dx,03c0h ; index register for AC
+ out dx,ax ; write to the specified port
+ mov al,020h ; EGA palette enable
+ out dx,al ; reenable the video
+ mov byte ptr [ega_current_attr+si],ah
+ mov byte ptr [dirty_attr+si],1
+ jmp short F5lp2
+F520:
+ cmp al,020h
+ jne F528
+ mov byte ptr [ega_current_misc],ah
+ mov dx,03c2h ; Miscellaneous output register
+ xchg ah,al
+ out dx,al ; write one byte
+ jmp short F5lp2
+F528:
+ xchg ah,al
+ mov dx,03dah ; EGA feature register
+ out dx,al
+F5lp2:
+ dec cx
+ cmp cx,0
+ jz F5quit
+ jmp F5lp
+F5quit:
+ popa
+ jmp noint
+
+egaF6: ;--- Restore the EGA default register values --------------------------
+ pusha
+ push es
+
+ ; copy the default EGA register sets to the driver's internal cache
+
+ mov ax,ds
+ mov es,ax
+
+ mov cx,25
+ lea di,ega_current_crtc
+ lea si,ega_default_crtc
+ rep movsb
+ mov cx,4
+ lea di,ega_current_seq
+ lea si,ega_default_seq
+ rep movsb
+ mov cx,9
+ lea di,ega_current_graph
+ lea si,ega_default_graph
+ rep movsb
+ mov cx,20
+ lea di,ega_current_attr
+ lea si,ega_default_attr
+ rep movsb
+ mov al,[ega_default_misc]
+ mov [ega_current_misc],al
+
+ ; Set up the Sequencer defaults
+
+ mov dx,03c4h ; Sequencer index register
+ mov ax,0100h ; Synchronous reset
+ out dx,ax ; do the work
+
+ xor bx,bx ; do the four non reset registers
+ inc al ; point to the next Sequencer register
+F6lp1:
+ cmp [dirty_seq+bx],1 ; has the dirty bit been set?
+ jne F6ne1
+ mov ah,[ega_default_seq+bx] ; default value to send to the register
+ out dx,ax ; do the work
+F6ne1:
+ inc bx ; point to the next buffer location
+ inc al ; point to the next Sequencer register
+ cmp bx,3 ; copy elements 0->3 to ports
+ jl F6lp1
+ mov ax,0300h ; Clear synchronous reset
+ out dx,ax ; do the work
+
+ ; Set up the default Miscellaneous Output Register value.
+
+ mov dx,03c2h ; Miscellaneous o/p register address
+ mov al,[ega_default_misc] ; the default value
+ out dx,al ; write to the EGA/VGA
+
+ ; Set up the Cathode Ray Tube Controller in the default fashion
+
+ mov dx,03d4h ; Index to the CRTC
+ xor bx,bx ; clear an index register
+F6lp2:
+ cmp [dirty_crtc+bx],1 ; has the dirty bit been set?
+ jne F6ne2
+ mov ax,bx ; index for the CRTC index register
+ mov ah,[ega_default_crtc+bx] ; default value for the selected reg.
+ out dx,ax
+F6ne2:
+ inc bx ; point to the next location
+ cmp bx,25 ; 25 registers to copy
+ jl F6lp2
+
+ ; Set up the Attribute Controller default values
+ ; Remember that this is a funny beast which uses a flip-flop
+ ; off just one address/data port
+
+ mov dx,03dah ; CRT status register
+ in al,dx ; set the AC flip-flop
+ mov dx,03c0h ; Attibute controller address/data regs
+ xor bx,bx ; clear an index register
+F6lp3:
+ cmp [dirty_attr+bx],1 ; has the dirty bit been set?
+ jne F6ne3
+ mov ax,bx ; index for the CRTC index register
+ mov ah,[ega_default_attr+bx] ; default value for the selected reg.
+ out dx,al ; index the register, then flip the flop
+ xchg al,ah ; get the default data for this register
+ out dx,al ; write the data out
+F6ne3:
+ inc bx ; point to the next location
+ cmp bx,20 ; 20 registers to copy
+
+ ; Set the Graphics Controller default values
+
+ mov dx,03ceh ; Index to the GC
+ xor bx,bx ; clear an index register
+F6lp4:
+ cmp [dirty_graph+bx],1 ; has the dirty bit been set?
+ jne F6ne4
+ mov ax,bx ; index for the GC index register
+ mov ah,[ega_default_graph+bx] ; default value for the selected reg.
+ out dx,ax
+F6ne4:
+ inc bx ; point to the next location
+ cmp bx,9 ; 9 registers to copy
+ jl F6lp2
+
+ ; Reenable the video
+
+ mov dx,03c0h ; index register for AC
+ mov al,020h ; EGA palette enable
+ out dx,al ; reenable the video
+
+ ; Clean out the dirty register arrays
+
+ xor al,al ; put a nice zero in all the dirty
+ ; registers
+ mov cx,25+4+9+20 ; do the CRTC, SEQ, GC and AC in
+ mov di,offset dirty_crtc ; one go
+ rep stosb
+
+ pop es
+ popa
+ jmp noint
+
+egaF7: ;---Define default register table -------------------------------------
+ pusha
+ push es
+ push ds
+
+ ; Load a new set of default registers for a particular EGA/VGA component
+
+
+ mov si,bx ; SOURCE of the incoming data from the app
+ mov ax,es ; save the SOURCE segment register
+ mov bx,ds ; save the DESTINATION offset
+ mov ds,ax ; DS is now the SOURCE segment in the app
+ mov es,bx ; ES is now the DESTINATION segment in the dvr
+
+ assume ds:nothing, es:SpcMseSeg
+
+F70: ; Set the default CRTC registers
+
+ cmp dx,0
+ jne F78
+ mov cx,25 ; copy 25 register entries
+ mov di,offset ega_default_crtc
+ rep movsb ; do the copy
+ jmp short F7dirty
+
+F78: ; Set the default Sequencer registers
+
+ cmp dx,8
+ jne F710
+ mov cx,4 ; copy 4 register entries
+ mov di,offset ega_default_seq
+ rep movsb ; do the copy
+ jmp short F7dirty
+
+F710: ; Set the default Graphic Controller registers
+
+ cmp dx,10
+ jne F718
+ mov cx,9 ; copy 9 register entries
+ mov di,offset ega_default_graph
+ rep movsb ; do the copy
+ jmp short F7dirty
+
+F718: ; Set the default Attribute Controller registers
+
+ cmp dx,18
+ jne F720
+ mov cx,20 ; copy 20 register entries
+ mov di,offset ega_default_attr
+ rep movsb ; do the copy
+ jmp short F7dirty
+
+F720: ; Set the default Miscellaneous Output register
+
+ cmp dx,20
+ jne F7quit
+ mov word ptr cs:[ega_default_misc],si
+
+F7dirty:
+
+ ; Set all the dirty register arrays
+
+ mov al,1 ; put a nice one in all the dirty
+ ; registers
+ mov cx,25+4+9+20 ; dirty all the registers in one go
+ mov di,offset dirty_crtc
+ rep stosb
+
+F7quit:
+ pop ds ; need to restore the segment registers
+ pop es
+
+ assume ds:SpcMseSeg, es:nothing
+
+ popa
+
+ jmp noint
+
+egaFA: ;--- Interrogate driver -----------------------------------------------
+ ; The real Microsoft mouse driver gets this wrong (release 7.03)
+
+ push ax
+ mov ax,cs
+ mov es,ax
+ mov bx,offset relnum ; return the address of the mouse
+ ; driver version number
+ pop ax
+ jmp noint
+
+;=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
+
+ENDIF ; MOUSE_VIDEO_BIOS
+
+do_bop:
+
+ bop VIDEO_IO_BOP ;BOP BE
+ nop
+ nop
+ jnc noint
+go_rom:
+ popf
+ db 0EAh ; this is a far jump
+old_vid_int dd ? ; far pointer to the old int 10h vector
+ jmp DOIRET
+noint:
+ popf
+ jmp DOIRET
+
+mouse_int1:
+ bop INT1_BOP
+ jmp DOIRET
+
+mouse_version:
+ dw 04242h
+ dw 0000h
+
+mouse_copyright:
+ db "Windows NT MS-DOS subsystem Mouse Driver"
+
+video_io:
+ int VIDEO
+ bop UNSIMULATE_BOP
+
+mouse_int2:
+ bop INT2_BOP
+ jmp DOIRET
+
+mouseINB:
+ in al,dx
+ bop 0feh
+
+mouseOUTB:
+ out dx,al
+ bop 0feh
+
+mouseOUTW:
+ out dx,ax
+ bop 0feh
+
+
+;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+;16 BIT ENTRY POINT 16 BIT ENTRY POINT 16 BIT ENTRY POINT 16 BIT ENTRY POINT
+;
+;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+;========================================================================
+; Procedure that provides the driver interface to 32 bit land. This is
+; the entry point to the Intel 16 bit driver from the mouse interrupt
+; handler in the host mouse code.
+;
+; This procedure determines the current video mode from the BIOS data
+; area, and depending on this branches to the correct display routines
+; for this mode.
+;
+; N.B. This function MUST NOT modify CX and DX because the next level
+; of functions in the driver heirarchy requires the values passed in
+; them from 32 bit land.
+;========================================================================
+
+ assume ds:SpcMseSeg
+
+entry_point_from_32bit proc near
+ make_stack ; use the driver's own stack
+ push ds
+ push ax
+ push bx
+
+ mov ax,cs
+ mov ds,ax
+
+ call getBIOSvideomode; read the BIOS data area
+ xor bx,bx ; clear the jump table index
+ shl al,1 ; create a table index for word sized entries
+ mov bl,al ; move into a base register
+ call [drawpointerJMPT+bx] ; jump to the correct routine
+
+ pop bx
+ pop ax
+ pop ds
+ kill_stack ; return to the previous stack
+
+ bop 0FEh ; return to the 32 bit side
+
+entry_point_from_32bit endp
+
+
+;========================================================================
+; Procedure to set the cursor draw flag to DO DRAW. This is called from
+; SoftPC code via a host_simulate(). This routine is called when the
+; application does an INT 33h, function 1.
+;
+; In accordance with the Microsoft Programmer's Reference, the internal
+; cursor flag (internalCF) has a default value of -1. If intenalCF = 0
+; then the cursor is drawn. If the flag is already 0, then this function
+; does nothing.
+;
+; Note: with calls to int 33h AX = 2, it is legal to
+; make internalCF less than -1.
+;========================================================================
+
+int33function1 proc near
+
+ make_stack ; use the driver's own stack
+ push ax
+ push bx
+ push ds
+
+ mov ax,cs
+ mov ds,ax
+;; do not allow mouse int comes in while we are updating the cursor.
+;; call DOCLI
+
+ ; check to see if the pointer should be drawn
+
+; cmp [internalCF],0 ; is the flag already zero?
+; jz fn1quit ; if so, do nothing
+
+ ; pointer is not ON, so increment the flag to try to turn it ON
+
+; inc [internalCF] ; increment the pointer internal flag
+; cmp [internalCF],0 ; if 0, then the pointer can be drawn
+; jl fn1quit ; it is < 0, so don't draw the pointer.
+
+ ; The internal cursor flag hits zero for the first time, so
+ ; draw the pointer.
+
+ call getBIOSvideomode; read the BIOS data area
+ xor bx,bx ; clear the jump table index
+ shl al,1 ; create a table index for word sized entries
+ mov bl,al ; move into a base register
+ call [Int33function1JMPT+bx] ; do the correct function 1 handler
+fn1quit:
+;; call DOSTI
+ pop ds
+ pop bx
+ pop ax
+ kill_stack ; return to the previous stack
+ bop 0FEh ; back to jolly old 32 bit land
+
+int33function1 endp
+
+
+
+;========================================================================
+; Procedure to set the cursor draw flag to DONT DRAW. This is called from
+; SoftPC code via a host_simulate(). This routine is called when the
+; application does an INT 33h, function 2
+;
+; Note: with calls to int 33h AX = 2, it is legal to
+; make internalCF less than -1.
+;========================================================================
+
+int33function2 proc near
+
+ make_stack ; use the driver's own stack
+ push ax
+ push bx
+ push ds
+
+ mov ax,cs
+ mov ds,ax
+;; do not allow mouse int comes in while we are updating the cursor.
+;; call DOCLI
+
+; dec [internalCF] ; decrement the pointer internal flag
+
+ ; if the internal cursor flag is less than -1, then do not try
+ ; do remove the pointer from the screen because this has already
+ ; been done.
+
+; cmp [internalCF],0ffh
+; jl fn2quit ; do nothing if < -1
+
+ ; Internal flag hits -1, so remove the pointer from the screen.
+
+ call getBIOSvideomode; read the BIOS data area
+ xor bx,bx ; clear the jump table index
+ shl al,1 ; create a table index for word sized entries
+ mov bl,al ; move into a base register
+ call [Int33function2JMPT+bx] ; do the correct function 1 handler
+fn2quit:
+;; call DOSTI
+ pop ds
+ pop bx
+ pop ax
+ kill_stack ; return to the previous stack
+
+ bop 0feh
+
+int33function2 endp
+
+;========================================================================
+; Procedure to return straight back to cloud 32. This is needed if an
+; unsupported video mode is found in the BIOS data area.
+;========================================================================
+
+not_supported proc near
+ ret ; cant't BOP 0feh here or the stack will die
+ ; (out of balance with CS:IP stored from call)
+not_supported endp
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; END 16 BIT ENTRY END 16 BIT ENTRY END 16 BIT ENTRY END 16 BIT ENTRY
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+;========================================================================
+; Procedure to draw a cursor on the fullscreen X86 graphics display for
+; high resolution graphics modes.
+; This procedure saves the area about to be written over, blts the
+; pointer image onto the screen and restores the background from whence
+; cursor has just come.
+;
+; Input: CX = x-coordinate
+; DX = y-coordinate
+; Output: None
+;========================================================================
+
+
+drawHiResPointer proc near
+
+ ; save the video card's read/write context
+
+;; call DOCLI
+ pusha
+ push ds
+ mov ax,cs ; make sure that DS points to the
+ mov ds,ax ; right segment
+
+
+ call saveVGAregisters
+ call check_for_mode_change
+
+
+ mov bx,cx ; get X coordinate into a base register
+ shl bx,1 ; calculate a word index
+ mov ax,[ChooseImageLUT+bx] ; select the right image LUT
+ mov [PointerLUT],ax ; store the LUT address
+
+ xor ax,ax ; assume carry clear after the next call
+ call determineboundary
+ jnc detcont ; pointer in buonds if carry clear
+ not ax ; carry was set, so set AX non zero
+
+detcont:
+
+ ; Coordinates are now transformed from Cartesian to physical VRAM
+ ; memory byte and bit offsets.
+
+ mov di,dx ; store DX for later
+
+ ; internalCF = the current pointer status
+ ; background = indicates if a background has been stored or not
+ ;
+ ; if(internalCF == Zero && background == STORED)
+ ; The normal cursor ON condition
+
+ cmp [internalCF],0
+ jnz end_the_if ; request to turn pointer on
+ cmp [background],STORED
+ jne end_the_if
+
+ mov si,cx
+ mov di,dx
+ mov dx,[VRAMlastbyteoff]
+ mov cx,[VRAMlastbitoff]
+ call restore_background
+
+ cmp ax,0 ; should the pointer be drawn?
+ jnz end_the_if ; if the pointer has gone off the edge of
+ ; the screen, then quit
+
+ mov [VRAMlastbyteoff],di ; save the current position
+ mov [VRAMlastbitoff],si
+ mov cx,si
+ mov dx,di
+ call save_background
+ mov cx,si
+ mov dx,di
+ call drawEGApointer
+
+end_the_if:
+
+ call restoreVGAregisters
+
+ pop ds
+ popa
+;; call DOSTI
+ ret
+
+drawHiResPointer endp
+
+;========================================================================
+; Procedure to draw a cursor on the fullscreen X86 graphics display.for
+; medium resolution graphics modes.
+; This procedure saves the area about to be written over, blts the
+; pointer image onto the screen and restores the background from whence
+; cursor has just come.
+;
+; Input: CX = x-coordinate
+; DX = y-coordinate
+; Output: None
+;========================================================================
+
+drawMediumResPointer proc near
+
+ pusha
+;; call DOCLI
+
+ shr cx,1 ; map from 640 virtual to 320 real
+
+ ; CX,DX = x,y cartesian coordinates here.
+
+ call check_for_mode_change
+
+ ; internalCF = the current pointer status
+ ; background = indicates if a background has been stored or not
+ ;
+ ; if(internalCF == Zero && background == STORED)
+ ; The normal cursor ON condition
+
+
+ cmp [internalCF],0
+ jnz cant_draw_ptr ; request to turn pointer on
+ cmp [background],STORED
+ jne cant_draw_ptr
+ mov si, cx ; save new cursor position
+ mov di, dx
+ mov dx,[VRAMlastbyteoff] ;
+ mov cx,[VRAMlastbitoff]
+ mov bp,[LastYCounters] ; Y looping counter
+ call restorebkgrndmode4
+ mov cx, si ; restore new cursor position
+ mov dx, di
+ call detboundmode4 ; calculate new byte offset
+ jc cant_draw_ptr ; don't draw new cursor of out of scrn
+
+ mov [VRAMlastbyteoff], dx ; byte offset
+ mov [VRAMlastbitoff], cx ; MSB = 0FFh if start with ODD line
+ ; LSB = bit offset
+ mov [LastYCounters], bp ; MSB: even counter, LSB for odd
+ call savebkgrndmode4
+ call drawmode4pointer
+
+cant_draw_ptr:
+
+;; call DOSTI
+ popa
+ ret
+
+drawMediumResPointer endp
+
+;========================================================================
+; Procedure to draw a cursor on the fullscreen X86 graphics display for
+; medium resolution, 256 colour graphics mode. (video bios mode 13h).
+; This procedure saves the area about to be written over, blts the
+; pointer image onto the screen and restores the background from whence
+; cursor has just come.
+;
+; Input: CX = x-coordinate
+; DX = y-coordinate
+; Output: None
+;========================================================================
+
+drawC256Pointer proc near
+ pusha
+;; call DOCLI
+ shr cx,1 ; map from 640 virtual to 320 real x
+
+ ; CX,DX = x,y cartesian coordinates here.
+
+ call check_for_mode_change
+
+ ; internalCF = the current pointer status
+ ; background = indicates if a background has been stored or not
+ ;
+ ; if(internalCF == Zero && background == STORED)
+ ; The normal cursor ON condition
+
+
+ cmp [internalCF],0
+ jnz cant_draw_256ptr ; request to turn pointer on
+ cmp [background],STORED
+ jne cant_draw_256ptr
+
+ mov si,cx
+ mov di,dx
+ mov dx,[VRAMlastbyteoff]
+ mov cx,[LastXCounters]
+ mov bp,[LastYCounters]
+ call restorebkgrndmode13
+ mov cx, si
+ mov dx, di
+ call detboundmode13
+ jc cant_draw_256ptr
+
+ mov [VRAMlastbyteoff],dx ; save the current position
+ mov [LastXCounters],cx
+ mov [LastYCounters], bp
+ call savebkgrndmode13
+ call draw256pointer
+
+cant_draw_256ptr:
+;; call DOSTI
+ popa
+ ret
+drawC256Pointer endp
+
+;========================================================================
+; Procedure to draw a pointer on the fullscreen X86 text display for
+; BIOS modes 3 and 7.
+; This procedure saves the area about to be written over, XORs the
+; pointer image onto the screen and restores the background from whence
+; cursor has just come.
+;
+; Input: CX = x-coordinate
+; DX = y-coordinate
+; Output: None
+;========================================================================
+
+IFDEF SIXTEENBIT
+
+drawTextPointer proc near
+ pusha
+ push es
+
+ ; CX,DX = x,y virtual pixel coordinates here.
+ ; 0 <= x < 640
+ ; 0 <= y < 200 for 25 line mode
+ ; 0 <= y < 344 for 43 line mode
+ ; 0 <= y < 400 for 50 line mode
+ ; The virtual character size is always 8x8 virtual pixels.
+
+ call check_for_mode_change
+
+ ; internalCF = the current pointer status
+ ; background = indicates if a background has been stored or not
+ ;
+ ; if(internalCF == Zero && background == STORED)
+ ; The normal cursor ON condition
+
+ cmp [internalCF],0
+ jnz cant_draw_text_ptr ; request to turn pointer on
+ cmp [background],STORED
+ jne cant_draw_text_ptr
+
+
+ ; Calculate the current cell location as an offset
+ ; into the text buffer segment starting at B800:0
+ ; Note: The following kinky shifts allow for the fact that the text
+ ; video buffer consists of word elements of the form char:attr.
+ ; So, if a row = 80 characters wide on the screen, it is 160
+ ; bytes wide in VRAM.
+
+ mov bx,dx ; create a word table index
+ shr bx,3 ; virtual char height = 8, but 160 bytes
+ ; per text row, so save some shifts.
+ shl bx,1 ; make a word table index
+ mov di,[mult80lut+bx] ; multiply by 80 words per text row.
+ shl di,1
+ shr cx,3 ; divide the x virtual pixel coordinate
+ ; by 8 = virtual char width and mult
+ ; by 2 to get word offset in text row.
+ shl cx,1
+ add di,cx ; full VRAM location now in DI
+
+ ; Restore the text cell previously overwritten.
+
+ mov si,[VRAMlasttextcelloff]; address of last modified text cell
+ mov [VRAMlasttextcelloff],di; store the current cell location
+
+ mov ax,0b800h ; the text buffer segment
+ mov es,ax ; ES now points there
+
+ ; The text pointer uses the same magic as the graphics code
+ ; to place a pointer on the screen.
+
+ mov bx,07700h ; the magic cursor mask for pointer
+ mov cx,077ffh ; the magic screen mask for pointer
+
+ assume es:nothing
+
+ mov ax,[lasttextimage] ; restore the background
+ mov es:[si],ax ; from last time
+ mov ax,es:[di] ; load the cell to be modifyed
+ mov [lasttextimage],ax ; save this cell for next time
+ and ax,cx ; apply the screen mask
+ xor ax,bx ; apply the cursor mask
+ mov es:[di],ax ; and write back
+
+ assume es:SpcMseSeg
+
+cant_draw_text_ptr:
+
+ pop es
+ popa
+ ret
+drawTextPointer endp
+
+ENDIF ;; SIXTEENBIT
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; Interrupt 33h support functions.
+; These functions are called via a jump table from the 16 bit entry
+; point code.
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+;========================================================================
+; Procedure to set the cursor draw flag to DO DRAW. This is called from
+; SoftPC code via a host_simulate(). This routine is called when the
+; application does an INT 33h, function 1
+;========================================================================
+
+int33function0 proc near
+
+ make_stack ; use the driver's own stack
+ push ds
+ push es
+ pusha
+
+ ; sort out the segments
+
+ mov ax,cs
+ mov ds,ax
+ mov ax,cs
+ mov es,ax
+;; do not allow mouse int comes in while we are updating the cursor.
+;; call DOCLI
+ ; set the internal pointer flag to its default value.
+
+ mov [internalCF],0ffh
+
+ ; set the default hotspot location = (0,0)
+
+ xor ax,ax
+ mov [hotspot],ax
+ mov [hotspot+2],ax
+
+ ; copy the default pointer to the working pointer buffer
+
+ lea si,default_cursor
+ lea di,current_cursor
+ call copy_pointer_to_current
+
+ ; clear the pointer enabled flag, turn the pointer off by restoring
+ ; the background.
+
+ mov [background],NOTSTORED ; there is no stored background now
+
+;; call DOSTI
+ popa
+ pop es
+ pop ds
+ kill_stack ; restore the previous stack
+ bop 0FEh
+
+int33function0 endp
+
+
+
+;========================================================================
+; Procedure to accept a cursor bit image from the current application
+; at ES:DX. This is stored as the current pointer image for use by
+; the driver.
+;========================================================================
+
+assume es:nothing
+
+int33function9 proc near
+ call DOCLI
+ make_stack ; use the driver's own stack
+ push ds
+ push es
+ pusha
+
+
+ mov ax,cs ; point at the driver data segment
+ mov ds,ax
+;; do not allow mouse int comes in while we are updating the cursor.
+;; call DOCLI
+ ; Read in the hotspot cartesian coordinate values for the
+ ; new pointer image. If the hotspot values are out of range
+ ; i.e. >127 | < -128, then reset to the boundary value
+ ; Now using kinky non modRM short forms by clever use of AX
+
+ mov ax,127 ; load accumulator with 127
+ mov bp,ax ; store this constant in a register
+ cmp ax,bx ; compare X value of hotspot with 127
+ jg test_low_x ; if 127 > BX, BX is within upper limit
+ xchg ax,bx ; BX > 127, so set to 127
+ jmp short check_y_hotspot ; now test the Y values
+
+test_low_x:
+
+ not ax ; change accumulator from 127 to -128
+ cmp ax,bx ; compare X value of hotspot with -128
+ jl check_y_hotspot ; if -128 < BX, BX is within lower lim.
+ xchg ax,bx ; BX < -128, so set it to -128
+
+check_y_hotspot:
+
+ mov ax,bp ; reload AX with 127
+ cmp ax,cx ; compare Y value of hotspot with 127
+ jg test_low_y ; if 127 > CX, Cx is within upper limit
+ xchg ax,cx ; CX > 127, so set CX to 127
+ jmp short done_hotspot_check; both hotspot coords tested, so save
+
+test_low_y:
+
+ not ax ; change accumulator from 127 to -128
+ cmp ax,cx ; compare Y value of hotspot with -128
+ jl done_hotspot_check ; if -128 < CX, CX is within lower lim.
+ xchg ax,cx ; CX < -128, so set it to -128
+
+done_hotspot_check:
+
+ mov [hotspot],bx ; save the hotspot x,y
+ mov [hotspot+2],cx ; y component of the hotspot
+
+ ; DESTINATION: the driver current pointer buffer
+ ; Note: the SOURCE is already being pointed at by DX
+
+ lea di,current_cursor ; this is the bit that must change
+ mov si,dx
+
+ ; copy in the new application pointer
+
+ mov ax,es
+ mov ds,ax ; DS now points to where ES points
+ mov ax,cs
+ mov ax,es ; ES points to our data area now
+ call copy_pointer_to_current ; Copy the pointer image appropriately
+
+ popa
+ pop es
+ pop ds
+ kill_stack ; restore the previous stack
+ call DOSTI
+ ret ; this code is called from within this
+ ; 16 bit driver, so don't BOP
+int33function9 endp
+
+;============================================================================
+; Procedure to display the pointer image in HIRES graphics modes
+;============================================================================
+
+HiResInt33Function1 proc near
+
+ pusha
+ call check_for_mode_change
+ call saveVGAregisters
+ mov cx,[current_position_x] ; get the last known cursor position
+ mov dx,[current_position_y] ; from the OS via the event loop
+ call determineboundary ; convert to VRAM coordinates
+ jc end_function1 ; if the pointer has gone off the edge
+ ; of the screen, then quit
+ mov [VRAMlastbyteoff],dx ; save the restore background location
+ mov [VRAMlastbitoff],cx
+ mov si,cx
+ mov di,dx
+ call save_background
+ mov cx,si
+ mov dx,di
+ call drawEGApointer
+ mov [background],STORED
+end_function1:
+ call restoreVGAregisters
+ popa
+ ret ; return to driver surface manager code
+
+HiResInt33Function1 endp
+
+;============================================================================
+; Procedure to display the pointer image in MEDIUMRES graphics modes
+; Note that this function does a conversion from virtual pixel coordinates
+; to real screen coordinates as required if the stored values in the
+; current_position memory locations are greater than 320 for X or 200
+; for Y.
+;============================================================================
+
+MediumResInt33Function1 proc near
+
+ pusha
+ call check_for_mode_change
+ mov cx,[current_position_x] ; get the last known cursor position
+ mov dx,[current_position_y] ; from the OS via the event loop
+ shr cx,1 ; virtual coor -> screen coor
+ call detboundmode4 ; convert to VRAM coordinates
+ jc MediumResFunction1_exit
+
+ mov [VRAMlastbyteoff],dx ; save the restore background location
+ mov [VRAMlastbitoff],cx
+ mov [LastYCounters], bp
+ call savebkgrndmode4
+ call drawmode4pointer
+ mov [background],STORED
+
+MediumResFunction1_exit:
+ popa
+ ret
+
+MediumResInt33Function1 endp
+
+;============================================================================
+; Procedure to display the pointer image in VGA 256 colour graphics modes
+;============================================================================
+
+C256Int33Function1 proc near
+ pusha
+ call check_for_mode_change
+ call modifyentry255 ; make sure that DAC entry 255 is white
+ mov cx,[current_position_x] ; get the last known cursor position
+ mov dx,[current_position_y]
+ shr cx, 1 ; virtual coor -> screen coord
+ call detboundmode13 ; convert to VRAM coordinates
+ jc C256Function1_exit
+
+ mov [VRAMlastbyteoff],dx ; save the restore background location
+ mov [LastXCounters],cx ; X loop counter
+ mov [LastYCounters], bp ; Y loop counter
+ call savebkgrndmode13
+ call draw256pointer
+ mov [background],STORED
+
+C256Function1_exit:
+ popa
+ ret ; return to driver surface manager code
+
+C256Int33Function1 endp
+
+;============================================================================
+; Procedure to show the TEXT pointer
+;============================================================================
+IFDEF SIXTEENBIT
+
+TextInt33Function1 proc near
+
+ pusha
+ push es
+
+ mov [background],STORED
+ call check_for_mode_change
+
+ mov cx,[current_position_x] ; get the last known cursor position
+ mov bx,[current_position_y] ; from the OS via the event loop
+
+ shr bx,3 ; virtual char height = 8, but 160 bytes
+ ; per text row.
+ shl bx,1 ; make a word table index
+ mov di,[mult80lut+bx] ; multiply by 80 words per text row.
+ shl di,1 ; remember 160 bytes NOT 80 in a row
+ shr cx,3 ; divide the x virtual pixel coordinate
+ ; by 8 = virtual char width and mult
+ ; by 2 to get word offset in text row.
+ shl cx,1
+ add di,cx ; full VRAM location now in DI
+
+ mov [VRAMlasttextcelloff],di; store the current cell location
+
+ mov ax,0b800h ; the text buffer segment
+ mov es,ax ; DS now points there
+
+ mov bx,07700h ; the magic cursor mask for pointer
+ mov cx,077ffh ; the magic screen mask for pointer
+
+ assume es:nothing
+
+ mov ax,es:[di] ; load the cell to be modifyed
+ mov [lasttextimage],ax ; save this cell for next time
+ and ax,cx ; apply the screen mask
+ xor ax,bx ; apply the cursor mask
+ mov es:[di],ax ; and write back
+
+ assume es:SpcMseSeg
+
+ pop es
+ popa
+ ret ; return to driver surface manager code
+
+TextInt33Function1 endp
+
+ENDIF ;; SIXTEENBIT
+;============================================================================
+; Procedure to remove the pointer image in HIRES graphics modes
+;============================================================================
+
+HiResInt33Function2 proc near
+
+ push cx
+ push dx
+
+ call saveVGAregisters
+ call check_for_mode_change
+
+ cmp [background],STORED ; is there some stored background?
+ jne no_background_stored ; no, so don't restore it
+ mov dx,[VRAMlastbyteoff]
+ mov cx,[VRAMlastbitoff]
+ call restore_background ; restored the background at correct
+ mov [background],NOTSTORED ; place. Set buffer cleared Flag
+
+no_background_stored:
+
+ call restoreVGAregisters
+
+ pop dx
+ pop cx
+ ret
+
+HiResInt33Function2 endp
+
+;============================================================================
+; Procedure to remove the pointer image in MEDIUMRES graphics modes
+;============================================================================
+
+MediumResInt33Function2 proc near
+ push cx
+ push dx
+ push bp
+ call check_for_mode_change
+
+ cmp [background],STORED ; is there some stored background?
+ jne nobkgrndstored ; no, so don't restore it
+ mov dx,[VRAMlastbyteoff]
+ cmp dx,80*100 ; mustn't be greater than buffer size
+ jl vidoffok ; it's OK, so do nothing
+ mov dx,80*10-1 ; modify DX to fit in the buffer
+vidoffok:
+ mov cx,[VRAMlastbitoff] ; CL = bit offset
+ ; CH = odd/even flag
+ and cl,3 ; cannot be greater than bit 3( 2bits/p)
+ mov bp, [LastYCounters]
+ call restorebkgrndmode4 ; restored the background at correct
+ mov [background],NOTSTORED ; place. Set buffer cleared Flag
+
+nobkgrndstored:
+ pop bp
+ pop dx
+ pop cx
+ ret
+MediumResInt33Function2 endp
+
+;============================================================================
+; Procedure to remove the pointer image in MEDIUMRES graphics modes
+;============================================================================
+
+C256Int33Function2 proc near
+ push cx
+ push dx
+ push bp
+ call check_for_mode_change
+
+ cmp [background],STORED ; is there some stored background?
+ jne nobkgrndstored256 ; no, so don't restore it
+ mov dx,[VRAMlastbyteoff]
+ mov cx,[LastXCounters]
+ mov bp,[LastYCounters]
+ call restorebkgrndmode13 ; restored the background at correct
+ mov [background],NOTSTORED ; place. Set buffer cleared Flag
+nobkgrndstored256:
+
+ pop bp
+ pop dx
+ pop cx
+ ret
+
+C256Int33Function2 endp
+
+;============================================================================
+; Procedure to remove the pointer image in TEXT modes
+;============================================================================
+
+IFDEF SIXTEENBIT
+
+TextInt33Function2 proc near
+
+ push ax
+ push si
+ push es
+
+ call check_for_mode_change
+
+ cmp [background],STORED ; is there some stored background?
+ jne no_text_background_stored ; no, so don't restore it
+
+ mov [background],NOTSTORED ; place. Set buffer cleared Flag
+
+ ; Restore the text cell previously overwritten.
+
+ mov si,[VRAMlasttextcelloff]; address of last modified text cell
+
+ mov ax,0b800h ; the text buffer segment
+ mov es,ax ; DS now points there
+
+ assume es:nothing
+
+ mov ax,[lasttextimage] ; restore the background
+ mov es:[si],ax ; from last time
+
+no_text_background_stored:
+
+ assume es:SpcMseSeg
+
+ pop es
+ pop si
+ pop ax
+ ret
+
+TextInt33Function2 endp
+
+ENDIF ;; SIXTEENBIT
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; End of Interrupt 33h support functions.
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; Mouse driver general support functions
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+;========================================================================
+; Procedure to determine if the application has changed video modes since
+; the last mouse interrupt. If it has, then the image that is saved in the
+; background restore buffer is invalid and should not be drawn.
+;========================================================================
+
+check_for_mode_change proc near
+
+ push ax
+
+ call getBIOSvideomode; peek at the BIOS data area for video mode
+ cmp al,[lastvidmode]; compare with the last mode value
+ ; from the preceding interrupt
+ jnz mode_change ; a mode change has occurred
+ pop ax ; no mode change, so quit
+ ret
+mode_change:
+ mov [background],NOTSTORED
+ mov byte ptr [lastvidmode],al ; store the new mode
+ pop ax
+
+ ret
+check_for_mode_change endp
+
+;========================================================================
+; Procedure to read the BIOS data area and get the current video mode
+; Output: AL = BIOS video mode
+; Modifies: memory variable -> currentvidmode, puts the video found in
+; the BIOS data area in this memory location.
+;========================================================================
+
+getBIOSvideomode proc near
+
+ push es
+ push bx
+ mov ax,40h ; BIOS data area segment
+ mov es,ax
+
+ mov al,es:[49h] ; get the BIOS video mode data
+
+ mov bl,al ; copy the video mode value
+ xor bh,bh
+ shl bx,1 ; create a word table index
+ mov bx,[latchhomeLUT+bx] ; get the latch hiding place for this
+ ; video mode
+ mov [latchcache],bx ; save in memory for use in save and restore
+ ; vga registers.
+
+ pop bx
+ pop es ; restore the 'normal' data segment
+ ret
+
+getBIOSvideomode endp
+
+;=========================================================================
+; Function to modify the 256th palette entry for 256 colour mode. The
+; driver requires white to be set in this DAC register triple.
+;=========================================================================
+modifyentry255 proc near
+ push ax
+ push dx
+ mov dx,03c8h
+ mov al,0ffh
+ out dx,al
+ inc dx
+ out dx,al
+ out dx,al
+ out dx,al
+ pop dx
+ pop ax
+ ret
+modifyentry255 endp
+
+
+;========================================================================
+; Procedure to copy the required pointer image to the snapshot
+; buffers. Each buffer holds a different instance of the mouse
+; pointer for each possible alignment of the pointer image in
+; a VRAM byte.
+;
+; INPUT DS:SI = pointer to the source image
+;
+;========================================================================
+
+assume ds:nothing
+
+copy_pointer_to_current proc near
+
+ push ds
+ push es
+ pusha
+
+
+ ; Set up the destination for the copy
+
+ mov ax,cs ; point ES to this segment
+ mov es,ax
+ lea di,current_cursor ; this is the bit that must change
+ mov bx,di ; save this address for a while
+ mov bp,si ; save the application source address
+
+ ; Fill the AND buffer with 1s and then fill the XOR buffer with
+ ; 0s for the byte aligned pointer condition. This is done so that
+ ; the last byte in the 3byte scanline sequence is set to the correct
+ ; value to prevent image loss from the screen.
+
+ cld ; move low mem -> high mem
+ mov ax,24 ; avoid doing a modRM load of immediate
+ mov cx,ax ; 24 words to fill.
+ mov dx,ax ; store this for a while
+ xor ax,ax ; clear AX (AX = 0)
+ not ax ; AX = 0ffffh -> fill AND mask with it.
+ rep stosw ; fill the screen mask (AND mask)
+ mov cx,dx ; do the next 24 words (XOR mask)
+ not ax ; AX = 0h -> fill XOR mask with it
+ rep stosw ; Fill the cursor mask
+
+ ; Now fill the prepared 48 word buffer with the user defined
+ ; AND and XOR masks
+ ; Note that the image passed in from the application is little-endian.
+ ; To write to the VGA planes byte by byte, the image has to be reversed
+ ; to big-endian for the purpose of quick drawing since the VGA can only
+ ; read and write one byte from/to its latches.
+
+ mov di,bx ; point to the top of the buffer again
+ mov si,bp ; point to the new pointer image
+
+ mov cx,32
+norept1:
+ lodsw ; read in the required image word
+ xchg al,ah ; convert little endian to big endian
+ stosw ; write into local buffer
+ inc di ; remember local buffer in 3 bytes wide
+ dec cx
+ jnz norept1
+
+ ; Now, the aligned mask must be rotated, then copied into each of
+ ; the seven unaligned image buffers.
+
+ mov ax,cs
+ mov ds,ax ; return to the default data segment
+
+ mov bp,1000000000000000b ; a mask for the MSBit
+
+ lea di,AlignData1 ; point to the buffer for 1 bit offset
+ mov si,bx ; source = byte aligned pointer image
+
+ push bx
+ mov bx,32*7
+norept2:
+ lodsw ; load the word from 3 byte sequence
+ xchg al,ah ; put into little-endian format
+ mov cl,byte ptr [si] ; load the remaining byte
+ shr ax,1 ; LSB now stored in CF
+ rcr cl,1 ; CF into MSB, lsb into CF
+ jnc $+4 ; CF=0 -> don't need to do anything
+ or ax,bp ; OR in the carried bit from CF
+ xchg al,ah ; return to bitstream format
+ stosw ; write the rotated data
+ mov byte ptr[di],cl
+ inc si ; point to the next source scanline
+ inc di ; point to the next dest scanline
+
+ dec bx
+ jnz norept2
+ pop bx
+
+ ; Just to do a little bit more work, the rotated buffers created
+ ; above must be copied to the instances for byte 78 and byte 79
+ ; of the scanline. These images are then cunningly clipped in the
+ ; process to the edge of the screen!
+
+ mov si,bx ; BX points to the top of current buffer
+ ; Note DI points to clip_cursor78 now
+
+ ; may as well use the nice string functions now that I don't
+ ; have to XCHG bytes. (how space and cycle efficient
+
+ xor al,al ; constant for putting in masks
+
+ ; there are 8 instances for bits 0 to 7
+
+ mov bx,8
+norept3:
+
+ ; Do the AND mask modifications for byte 78
+
+ not al ; AL = 11111111b
+ REPT 16 ; 16 scanlines
+ movsw ; copy contents of AND word
+ stosb ; Nice clear AND mask = 11111111b
+ inc si ; point to the first image byte in
+ ; the next scanline
+ ENDM
+
+ ; Do the XOR mask modifications for byte 78
+
+ not al ; AL = 00000000b
+ REPT 16 ; 16 scanlines
+ movsw ; copy contents of XOR word
+ stosb ; Nice clear XOR mask = 00000000b
+ inc si ; point to the first image byte in
+ ; the next scanline
+ ENDM
+
+ dec bx
+ jnz norept3
+
+ ; prepare the BYTE 79 instances
+ ; SI and DI should be in the right place
+
+ xor ax,ax ; constant for putting in masks
+ mov bx,2 ; constant for addressing source
+
+ ; there are 8 instances for bits 0 to 7
+
+ mov cx,8
+norept4:
+
+ ; Do the AND mask modifications for byte 79
+
+ not ax ; AX = 0ffffh
+ REPT 16 ; 16 scanlines
+ movsb ; copy contents of AND byte
+ stosw ; Nice clear AND mask (=0ffffh)
+ add si,bx ; point to the first image byte in
+ ; the next scanline
+ ENDM
+
+ ; Do the XOR mask modifications for byte 79
+
+ not ax ; AX = 0h
+ REPT 16 ; 16 scanlines
+ movsb ; copy contents of XOR byte
+ stosw ; Nice clear XOR mask
+ add si,bx ; point to the first image byte in
+ ; the next scanline
+ ENDM
+
+ dec cx
+ jz norept4quit
+ jmp norept4
+norept4quit:
+
+ popa
+ pop es
+ pop ds
+
+ ret
+copy_pointer_to_current endp
+
+;========================================================================
+; Procedure to determine the segment of the video buffer for
+; the current display mode.
+;========================================================================
+
+assume ds:SpcMseSeg
+
+getvideobuffer proc near
+
+ push ax
+ push si
+
+ ; determine the current video mode from the BIOS and save it.
+ ; Use this value to determine the video buffer segment address.
+
+ mov ah,0fh ; use the bios to get the video mode
+ int 10h
+ cbw ; create a table index
+ shl ax,1 ; word sized table entries
+ mov si,ax
+ mov ax,[videomodetable+si] ; use video mode to index the table
+ mov [videobufferseg],ax
+
+
+ pop si
+ pop ax
+ ret
+
+getvideobuffer endp
+
+IFDEF DEBUGMOUSE
+
+;=========================================================================
+; Code to provide 32 bit side with a dump of the VGA registers on request.
+;=========================================================================
+
+VGAregs db 9+5+25 dup(?) ; enough room for sequencer, GC and CTRC
+
+dumpVGAregs proc near
+
+ call DOCLI
+ pusha
+ push ds
+
+
+ mov ax,cs
+ mov ds,ax
+
+ assume ds:SpcMseSeg
+
+ ; Save the Graphics Controller registers
+
+ xor bx,bx ; Index into the G.C. register saving array
+ mov dx,03ceh ; Graphics Controller index register
+ xor ax,ax
+
+ mov cx,9 ; save 9 G.C. registers
+norept5:
+ mov al,ah
+ out dx,al ; Select it
+ inc dx ; Address the register
+ in al,dx ; Get the register contents
+ mov [VGAregs+bx],al ; Save the register
+ inc bx ; index to next array entry
+ inc ah
+ dec dx ; Sequencer index register
+ dec cx
+ jnz norept5
+
+ ; Save the Sequencer registers
+
+ mov dx,03c4h ; Sequencer index register
+ xor ax,ax
+
+ mov cx,5 ; save 5 sequencer registers
+norept6:
+ mov al,ah
+ out dx,al ; Select it
+ inc dx ; Address the register
+ in al,dx ; Get the register contents
+ mov [VGAregs+bx],al ; Save the register
+ inc bx ; index to next array entry
+ inc ah
+ dec dx ; Sequencer index register
+ dec cx
+ jnz norept6
+
+ ; Save the CRTC registers
+
+ mov dx,03d4h ; CRTC index register
+ xor ax,ax
+
+ mov cx,25 ; save 25 sequencer registers
+norept7:
+ mov al,ah
+ out dx,al ; Select it
+ inc dx ; Address the register
+ in al,dx ; Get the register contents
+ mov [VGAregs+bx],al ; Save the register
+ inc bx ; index to next array entry
+ inc ah
+ dec dx ; CRTC index register
+ dec cx
+ jnz norept7
+
+ pop ds
+ popa
+ call DOSTI
+ bop 0feh ; return to 32 bit land
+
+dumpVGAregs endp
+
+ENDIF ; DEBUGMOUSE
+
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; End of Mouse driver general support functions
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+;========================================================================
+; Procedure to draw an EGA pointer image on the graphics screen at a
+; specified bit location.
+;
+; Input: CX = pointer offset in the current VRAM byte.
+; DX = offset in the video buffer to pointer
+; Output: None
+; Modifies: AX,BX,CX,DX,BP,SI,DI
+;========================================================================
+
+ assume ds:SpcMseSeg
+.286
+even
+
+drawEGApointer proc near
+
+ push es
+ push ds
+
+ mov ax,cs
+ mov ds,ax
+
+ cld ; index from low memory to high for LODSB
+
+ ; point to the video buffer
+
+ mov ax,0a000h
+ mov es,ax
+ mov bp,dx ; save the byte offset in VRAM for the XOR code
+
+ ; Select the Graphics Controller
+
+ mov dx,03ceh
+
+ ;************ AND MASK OPERATION **************************
+
+ ; use the bit position to select the relavent pointer image
+
+ shl cx,1 ; need a word offset into LUT
+ mov di,cx ; need an index register
+ mov bx,[PointerLUT]
+ mov si,[bx+di] ; Point to the screen (AND) mask
+ mov di,bp ; point to the byte offset in VRAM
+ mov ax,0803h ; Index the data rotate register and select AND
+ out dx,ax ; do it
+ mov ax,80-2 ; Avoid modRM loading of CX
+ mov cx,ax ; A constant handily kept in a register
+
+ ; The pointer contains 16 words of information
+ push bx
+ mov bx,16
+norept8:
+
+ lodsw ; Load 2 bytes from the AND mask into AL and AH
+ xchg al,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ inc di ; point to the next byte in VRAM
+
+ xchg ah,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ inc di ; point to the next byte in VRAM
+
+ lodsb ; Load a byte from the AND mask into AL
+ xchg al,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ add di,cx ; point to the next byte in VRAM on the next scan
+ ; line to write to. CX contains 80-2
+
+ dec bx
+ jnz norept8
+ pop bx
+
+ ;************ XOR MASK OPERATION **************************
+
+ ; Note: SI points to current_cursor+48 now, automatically
+ ; i.e. at the start of the XOR mask.
+
+ mov di,bp ; point to the byte offset in VRAM
+ mov ax,1803h ; Index the DATA ROTATE REGISTER and
+ ; Select the XOR function to XOR CPU data in
+ out dx,ax ; Do the deed
+
+ push bx
+ mov bx,16
+norept9:
+
+ lodsw ; Load 2 bytes from the AND mask into AL and AH
+ xchg al,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ inc di ; point to the next byte in VRAM
+
+ xchg ah,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ inc di ; point to the next byte in VRAM
+
+ lodsb ; Load a byte from the XOR mask into AL
+ xchg al,es:[di] ; Latch the 8 pixels for updating.
+ ; and write them back out with new data
+ add di,cx ; point to the next byte in VRAM on the next scan
+ ; line to write to. CX contains 80-2
+ dec bx
+ jnz norept9
+ pop bx
+
+ pop ds
+ pop es
+ ret
+
+drawEGApointer endp
+
+;========================================================================
+; Procedure to determine what the byte and bit offset is, in the current
+; VGA buffer for the top left hand corner of the pointer bitmap.
+; The X,Y value is modified for hotspot in this routine. A flag is set,
+; also, to relay whether or not the cursor bitmap is byte aligned or not.
+;
+; INPUT: CX,DX = pointer x,y coordinates
+; OUT : DX = byte offset to top left hand pointer pixel
+; CX = bit offset in the byte
+; CF = set if it is not possible to draw the pointer on the
+; screen because of the hotspot adjustment. (Usually a
+; negative hotspot value will cause clipping and wrapping
+; problems at the right and bottom screen boundaries.
+;========================================================================
+
+determineboundary proc near
+
+ push ax
+ push bx
+ push es
+
+
+ ; do the adjustment in x,y for pointer hotspot
+ ; Also test for top or left screen boundary problems
+ ; and zero the coordinate if it goes negative.
+
+
+ sub cx,[hotspot] ; adjust the x cartesian coord for hotspot
+ jns dont_zero_x ; if x goes negative, assume zero
+ xor cx,cx
+dont_zero_x:
+ sub dx,[hotspot+2] ; adjust the y cartesian coord for the hotspot
+ jns dont_zero_y ; if y goes negative, assume zero
+ xor dx,dx
+dont_zero_y:
+
+ ; Now check the right and bottom bounds to prevent the pointer
+ ; image wrapping if the hotspot adjustment forces either of
+ ; the coordinates to exceed the screen bounds.
+ ; First, for all video modes that this function handles, the
+ ; X bound is always x < 640 ... check this first.
+
+ cmp cx,640
+ jl didntexceedX
+ stc ; Oh oh - failed, so set carry flag.
+ jmp short quitdet ; bye bye.
+
+didntexceedX:
+
+ ; Now check out the y value by finding the maximum extent from
+ ; a lut based on the current BIOS video mode.
+
+ mov ax,40h ; B.D.A. segment
+ mov es,ax ; and ES points to it.
+ mov al,byte ptr es:[49h]
+ sub al,0fh ; table is normalized. mode f is in entry
+ ; zero.
+ xor ah,ah ; create a look up table index
+ shl ax,1 ; for a table with word sized elements.
+ xchg bx,ax ; use a suitable register as index
+
+ cmp dx,[hiresylut+bx] ; get the extent and compare y coord.
+ jl didntexceedY
+ stc ; Oh oh - failed, so set carry flag.
+ jmp short quitdet ; bye bye.
+
+didntexceedY:
+
+ ; determine the byte offset from the start of the video buffer
+ ; for the modified coordinates. First calculate how many bytes
+ ; there are for the number of scanlines -1 to where the pointer
+ ; is.
+
+ mov ax,dx ; copy Y position into AX
+ shl ax,1 ; create a word table index
+ xchg ax,bx ; copy table index into a base register
+ mov dx,[mult80lut+bx] ; do a fast LUT multiply by 80
+
+ ; determine the byte position of the pixel in question
+
+ mov ax,cx ; save the x-coordinate displacement
+ and ax,7 ; do a modulus 8 to find the pixel position
+ ; in the byte. The bit number is in DX.
+
+ ; add the whole number of bytes in the current row to the number
+ ; of complete-row bytes
+
+ shr cx,3 ; divide pixels by 8 to get bytes
+ add dx,cx ; DX hold the complete byte offset.
+ xchg ax,cx ; CX = bit offset in the byte.
+
+ ; the pointer has not exceeded the screen buonds, so clear
+ ; the carry flag to signify this.
+
+ clc
+
+ ; Wind up the routine and return with the carry flag:
+ ; SET if cursor exceeded screen bounds.
+ ; CLEAR otherwise.
+quitdet:
+
+ pop es
+ pop bx
+ pop ax
+ ret
+
+determineboundary endp
+
+;========================================================================
+; Procedure to buffer up the data over which the cursor will next be
+; drawn. This data will be used to replace the cursor at a later point
+; when the cursor position has changed and for generating a cursor image
+; To prevent having separate routines for aligned and unaligned pointer
+; saves, this routine saves a pixel block 24 x 16 deep in all cases. The
+; start offset is a byte location into VRAM in which the pointer TLHC lives.
+;
+; Input: DX = VRAM byte
+; Modifies: AX,BX,DI,CX,DX,ES
+;
+;========================================================================
+
+assume ds:SpcMseSeg
+
+even
+
+save_background proc near
+
+ push ds
+ push es
+ pusha
+
+ mov ax,cs ; point DS briefly at the driver data
+ mov ds,ax
+ mov es,ax ; point ES to the driver segment
+
+ lea di,behindcursor ; DESTINATION: a nice, safe place in the
+ ; driver segment
+ mov ax,0a000h ; point DS at VRAM
+ mov ds,ax
+
+ assume ds:nothing
+
+ mov bp,dx ; save DX=VRAM byte offset for later use
+ mov dx,03ceh ; VGA GC index register
+ mov al,4 ; select the read map select reg
+ out dx,al ; Index in the map select register
+ inc dx ; DX holds port address to map select register
+ xor al,al ; plane 0 will be selected first
+
+ cld ; make sure to address forward in memory
+ mov ah,3 ; number of bytes to copy per pointer scanline
+ xor cx,cx ; counter for the REP MOVSB
+ mov bx,80-3 ; another handy constant: move to next scanline
+ ; byte.
+
+ REPT 4 ; read the 4 EGA planes individually
+
+ mov si,bp ; SOURCE: somewhere in VRAM
+ out dx,al ; do the plane selection
+ inc al ; select the next plane to latch
+
+ ; note that only one byte at a time may be read from the latches
+
+ ; do 16 scanlines for each plane
+ push dx
+ mov dx,16
+@@:
+ mov cl,ah ; CX now contains 3
+ rep movsb ; copy 3 bytes from VRAM to data segment
+ add si,bx ; move down to the first byte in next scanline
+ dec dx
+ jnz @B ; norept10
+ pop dx
+
+ ENDM
+
+ popa
+ pop es
+ pop ds
+
+ ret
+
+save_background endp
+
+;========================================================================
+; Procedure to restore the area of the screen that was behind the cursor
+; before it had moved.
+;
+; Note. Currently (2/12/92) this is the only routine that modifies the
+; VGA sequencer. Therefore, the code from save and restore vga registers
+; that maintain the sequencer registers has been moved to here for
+; centralisation purposes.
+;
+; Input: DX = VRAM byte
+; Output: None
+; Modifies: AX,BX,CX,DX,DI,SI
+;========================================================================
+assume ds:SpcMseSeg
+
+even
+
+restore_background proc near
+ push ds
+ push es
+ pusha
+
+;; call DOCLI ; turn off interrupts
+ mov ax,cs
+ mov ds,ax ; point at the driver data segment
+ mov ax,0a000h ; videobufferseg
+ mov es,ax ; point ES at VRAM segment
+ mov bp,dx ; save the pointer for later
+ mov si,offset behindcursor ; SOURCE: point at the stored planes
+
+ ; set up the Graphic Controller for the restore.
+
+ mov dx,03ceh ; VGA GC index register
+ mov ax,0003h ; Select copy into latches function
+ out dx,ax ; i.e. data rotate -> replace
+ mov ax,0ff08h ; bitmask register reset
+ out dx,ax
+
+ ; do the 4 plane restore.
+
+ mov cx,80-2 ; point to the first byte in image on next line
+ cld ; write forward in memory
+ mov bx,0102h ; BH = initial plane mask value
+ ; plane 0 is selected with a 1
+ ; BL = map mask register offset
+ mov dx,03c4h ; index register for sequencer
+
+ mov al,bl ; point to the map mask register in sequencer
+ out dx,al ; index the register into 03c5h
+ inc dx ; point to the data register
+ in al,dx ; read the data register value in
+ dec dx ; restore DX to 03c4h
+ mov [seqregs],al ; save the map mask register value
+
+ REPT 4 ; 4 planes to restore
+
+ mov di,bp ; DESTINATION: pointer into VRAM
+ mov ax,bx ; select the plane to mask and map mask register
+ out dx,ax ; do the mask
+ shl bh,1 ; point to the mask for the next iteration
+
+ push dx
+ mov dx,16
+@@:
+
+ lodsw ; load the old background data (ONE WORD)
+ xchg al,es:[di] ; latch the VRAM data and swap with the
+ inc di ; point to next byte to replace
+ xchg ah,es:[di] ; latch the VRAM data and swap with the
+ inc di ; point to next byte to replace
+ lodsb ; load the old background data (ONE BYTE)
+ xchg al,es:[di] ; latch the VRAM data and swap with the
+ add di,cx ; point to the first byte in image on next line
+
+ dec dx
+ jnz @B ; norept11
+ pop dx
+
+ ENDM
+
+ mov ah,[seqregs] ; the old map mask value
+ mov al,bl ; need to restore the map mask register
+ out dx,ax ; do the restore
+;; call DOSTI ; reenable interrupts.
+ popa
+ pop es
+ pop ds
+ ret
+restore_background endp
+
+
+;==========================================================================
+; Procedure to save the register state of the VGA card on receiving a
+; mouse pointer update interrupt. This procedure also sets up the following
+; VGA registers to nice values for the driver.
+;
+; mode register <write mode 0, read mode 0>
+; data rotate register <do not rotate, no logical ops>
+; enable set/reset register <disable set/reset>
+;
+;==========================================================================
+
+even
+assume ds:SpcMseSeg
+
+saveVGAregisters proc near
+
+ push dx
+ push di
+ push es
+
+ ; Save the Graphics Controller registers that the
+ ; Driver uses
+
+ xor bx,bx ; Index into the G.C. register saving array
+ mov dx,03ceh ; Graphics Controller index register
+ xor al,al
+
+ push cx
+ mov cx,9 ; save 9 G.C. registers
+norept12:
+ out dx,al ; Select it
+ inc dx ; Address the register
+ in al,dx ; Get the register contents
+ mov [GCregs+bx],al ; Save the register
+ inc bx ; index to next array entry
+ mov al,bl
+ dec dx ; G.C. index register
+ dec cx
+ jnz norept12
+ pop cx
+
+ ; save the latches to location in a bit of video buffer
+ ; off the screen.
+
+ mov ax,0a000h ; point to the video buffer
+ mov es,ax
+
+ assume es:nothing
+
+ mov ax,0105h ; select write mode 1 to squirt latches out
+ out dx,ax ; do the selection
+ mov di,[latchcache] ; 1 byte over the last location
+ mov es:[di],al ; write the latches out to the planes
+
+ ; disable the enable set/reset register
+
+ mov ax,01h ; select enable set/reset register and clear it
+ out dx,ax
+
+ ; clear the data rotate register (no logical operations).
+
+ inc ax
+ inc ax ; select data rotate register and clear it
+ out dx,ax ; AX = 3 therefore points to the DRR
+
+ ; set write mode 0 for the graphics display
+ ; conveniently, this also sets read mode to 0 which is needed too!
+
+ inc ax
+ inc ax ; select write mode 0
+ out dx,ax ; AX = 5, i.e. the mode register
+
+ ; color don't care. don't care for all planes
+ inc ax ;register 7, color don't care
+ inc ax
+ out dx, ax
+ ; bit mask register. enable all planes
+ ;
+ inc ax ;register 8, bit mask
+ not ah
+ out dx, ax
+ pop es
+ pop di
+ pop dx
+ ret
+
+saveVGAregisters endp
+
+;==========================================================================
+; Procedure to restore the register state of the VGA card after dealing
+; with mouse pointer update interrupt.
+;==========================================================================
+
+restoreVGAregisters proc near
+
+ assume ds:SpcMseSeg
+
+ push es
+ push di
+ push bx
+
+ ; restore the latches that where saved in the video planes
+
+ mov ax,0a000h ; point to the video buffer
+ mov es,ax
+
+ assume es:nothing
+
+ mov di,[latchcache] ; the byte just off the end of the buffer
+ mov al,es:[di] ; read in the latches
+
+ ; Restore the Graphics Controller registers that the
+ ; Driver uses
+
+ xor ax,ax ; create an index
+ xor bx,bx ; Index into the G.C. register saving array
+ mov dx,03ceh ; Graphics Controller index register
+
+norept13:
+ mov ah,[GCregs+bx] ; restore the register
+ out dx,ax ; Select it
+ inc al ; index for the next register
+ inc bx ; index to next array entry
+ cmp al,9
+ jne norept13
+
+ pop bx
+ pop di
+ pop es
+ ret
+
+restoreVGAregisters endp
+
+;=======================================================================
+; Procedure to draw a BIOS Mode 4 graphics pointer to the display.
+; Input: DX = byte offset
+; CL = bit offset in the byte
+; CH = 0FFh if ODD, 0 if EVEN
+; BP = Y loop counter, ODD in LSB, EVEN in MSB
+;=======================================================================
+drawmode4pointer proc near
+
+ pusha
+ push es
+ cld
+
+ xchg dx, bp ;
+ mov di, bp ; bp = di = byte offset, dx = y counters
+ mov ax,0b800h ; point a segment register to
+ mov es,ax ; the CGA video buffer.
+ or ch, ch ;
+ je drawonevenscanline ;
+ jmp drawonoddscanline ; otherwise do an ODD job
+
+; ANDEVEN ANDEVEN ANDEVEN ANDEVEN ANDEVEN ANDEVEN ANDEVEN ANDEVEN ANDEVEN
+
+drawonevenscanline:
+
+ mov si,[mode4SelectedPointer]
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for even scanlines
+
+ xor cx, cx
+ mov cl, dh ; number of even scanlines to draw
+ push dx
+evensl1:
+ mov dx,3
+norept14:
+ lodsb ; load 8 pixels from pointer bitmap
+ xor bh,bh ; want a zero extended 16 bit value
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah ; little-endianise
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ and ax,bx ; AND the AND mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept14
+
+ add si,3
+ add di,80-6
+ loop evensl1
+ pop dx
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for odd scanlines
+
+ mov si,[mode4SelectedPointer]
+ add si,3
+ mov di,bp
+ add di,02000h ; offset into video buffer
+ ; the video buffer
+ mov cl,dl ; number of odd scanlines to draw
+ push dx
+oddsl1:
+ mov dx,3
+norept15:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ and ax,bx ; AND the AND mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept15
+
+ add si,3
+ add di,80-6
+ loop oddsl1
+ pop dx
+
+; XOREVEN XOREVEN XOREVEN XOREVEN XOREVEN XOREVEN XOREVEN XOREVEN XOREVEN
+
+
+ mov si,[mode4SelectedPointer]
+ add si,48
+
+ mov di,bp ; offset into video buffer
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for even scanlines
+
+ mov cl,dh ; number of even scanlines to draw
+ push dx
+evensl2:
+ mov dx,3
+norept16:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ xor ax,bx ; XOR the XOR mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept16
+
+ add si,3
+ add di,80-6
+ loop evensl2
+ pop dx
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for odd scanlines
+
+ mov si,[mode4SelectedPointer]
+ add si,48+3
+ mov di,bp
+ add di,02000h ; offset into video buffer
+ ; the video buffer
+ mov cl,dl ; number of odd scanlines to draw
+oddsl2:
+ mov dx,3
+norept17:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ xor ax,bx ; XOR the XOR mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept17
+
+ add si,3
+ add di,80-6
+ loop oddsl2
+ pop es
+ popa
+ ret
+
+
+; ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD ANDODD
+;
+; This part of the code draws the pointer on an odd numbered scanline
+; of the video display. Since the video buffer is split, 0000 to 1fff
+; containing even scanlines and 2000 to 3fff containing odd, the data
+; must be manipulated in a subtly different fashion than that of the
+; even display scanline code.
+; The even scanline code display arrangement falls through naturally,
+; with an even scanline drawing thus:
+; buffer 0: scanline 0
+; buffer 1: scanline 0
+; buffer 0: scanline 1
+; buffer 1: scanline 1
+; buffer 0: scanline 2
+; buffer 1: scanline 2 etc.
+; whereas in the odd case:
+; buffer 1: scanline 0
+; buffer 0: scanline 0
+; buffer 1: scanline 1
+; buffer 0: scanline 1
+; buffer 1: scanline 2
+; buffer 0: scanline 2 etc.
+; and this requires that the odd image scanlines must be placed
+; one scanline lower in the even buffer than the even image scanlines
+; do in the odd buffer
+
+drawonoddscanline:
+
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for odd scanlines
+
+ mov si,[mode4SelectedPointer]
+ add di,02000h ; offset into video buffer
+ ; the video buffer
+
+ xor cx,cx
+ mov cl,dl ; number of odd scanlines to draw
+ push dx
+oddsl3:
+ mov dx,3
+norept18:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ and ax,bx ; AND the AND mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept18
+
+ add si,3
+ add di,80-6
+ loop oddsl3
+ pop dx
+
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for even scanlines
+
+ and dh,dh
+ jz dontdothis1 ; can't do the loop 0 times
+
+ mov si,[mode4SelectedPointer]
+ add si,3
+ mov di,bp
+ add di,6 ; This is required to align the
+ ; even and odd scanlines together
+ mov cl,dh ; number of even scanlines to draw
+ push dx
+evensl3:
+ add di,80-6 ; remember even BELOW odd
+ mov dx,3
+norept19:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ and ax,bx ; AND the AND mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept19
+ add si,3
+ loop evensl3
+ pop dx
+
+dontdothis1:
+
+; XORODD XORODD XORODD XORODD XORODD XORODD XORODD XORODD XORODD XORODD XORODD
+
+
+ mov si,[mode4SelectedPointer]
+ add si,48
+ mov di,bp ; offset into video buffer
+ add di,02000h ; offset into video buffer
+ ; the video buffer
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for odd scanlines
+
+ mov cl,dl ; number of odd scanlines to draw
+ push dx
+oddsl4:
+ mov dx,3
+norept20:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ xor ax,bx ; XOR the XOR mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept20
+ add si,3
+ add di,80-6
+ loop oddsl4
+ pop dx
+
+ ; Load a word of the pointer image, convert it to two bits per
+ ; pixel and write to the screen for even scanlines
+
+ and dh,dh ; can't do a loop 0 times
+ jz dontdothis2
+
+ mov si,[mode4SelectedPointer]
+ add si,48+3
+ mov di,bp
+ add di,6
+
+ mov cl,dh ; number of even scanlines to draw
+
+evensl4:
+ add di,80-6
+ mov dx,3
+norept21:
+ lodsb ; load 8 pixels from bitmap
+ xor bh,bh
+ mov bl,al ; copy into a base register
+ shl bx,1 ; create a word address
+ mov ax,[LUT1to2bit+bx] ; get the byte to word conversion
+ xchg al,ah
+ mov bx,es:[di] ; get the current displayed 8 pixels
+ xor ax,bx ; XOR the XOR mask in
+ stosw ; write to the video buffer
+ dec dx
+ jnz norept21
+
+ add si,3
+ loop evensl4
+
+dontdothis2:
+
+; XORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXORXOR
+
+ pop es
+ popa
+ ret
+drawmode4pointer endp
+
+;========================================================================
+; Procedure to determine what the byte and bit offset is, in the current
+; VGA buffer for the top left hand corner of the pointer bitmap.
+; The X,Y value is modified for hotspot in this routine.
+; Y looping counter(ODD and EVEN) are also returned
+; The CGA buffer is interleaved, and runs from B800:0000 to B800:1999 for
+; odd scanlines and from B800:2000 for even scanlines.
+;
+; INPUT: CX,DX = pointer x,y coordinates
+; OUT :
+; carry set if either X or Y is out of screen
+; DX = byte offset to top left hand pointer pixel of the pointer
+; CL = bit offset in the byte
+; CH = 0FFh if ODD, 0 if EVEN
+; BP = Y loop counter(ODD in LSB and EVEN in MSB)
+;========================================================================
+
+detboundmode4 proc near
+
+ push ax
+ push bx
+ push ds
+
+ mov ax,cs
+ mov ds,ax
+
+ assume ds:SpcMseSeg
+
+
+ ; do the adjustment in x,y for pointer hotspot
+ ; modify the raw X,Y values for hotspot
+
+ sub cx,[hotspot] ; adjust the x cartesian coord for hotspot
+ jns dont_zero_xmode4; if x goes negative, assume zero
+ xor cx,cx
+
+dont_zero_xmode4:
+
+ sub dx,[hotspot+2] ; adjust the y cartesian coord for the hotspot
+ jns dont_zero_ymode4; if y goes negative, assume zero
+ xor dx,dx
+
+dont_zero_ymode4:
+
+ cmp cx, 320 ;
+ jae detboundmode4_exit ; CY is cleared
+ cmp dx, 200
+ jae detboundmode4_exit ; CY is cleared
+ ; determine the byte offset from the start of the video buffer
+ ; for the modified coordinates. First calculate how many bytes
+ ; there are for the number of scanlines -1 to where the pointer
+ ; is. Also if the pointer starts on a odd scanline, set CF, else
+ ; clear CF.
+
+ mov ax,dx ; copy Y position into AX
+ mov bp,dx ; copy Y position into BP for use later
+
+ ; CGA video buffer is split in two. Therefore, screen scanline 0 maps
+ ; to video buffer scanline 0 and screen scanline 1 maps to video
+ ; buffer+2000h, scanline 0
+
+ and ax,0fffeh ; do the mapping 0->0, 1->0, 2->1, 3->1 etc.
+ ; and create a word table index
+ mov bx, ax ; copy table index into a base register
+ ; 2bits/pixel -> 4 pixels/byte
+ ; sine x total is 320, we have 80bytes
+ ; so a shl bx, 1 will be wrong.
+ mov dx,[mult80lut+bx] ; do a fast LUT multiply by 80
+
+ ; determine the byte position of the pixel in question
+
+ mov ax,cx ; save the x-coordinate displacement
+ and ax,3 ; do a modulus 4 to find the pixel position
+ ; in the byte. The byte number will be in DX.
+
+ ; add the whole number of bytes in the current row to the number
+ ; of complete-row bytes. Note that mode 4 is 2bits per pixel, so
+ ; there are four pixels represented by one byte.
+
+ mov bx,cx ; Save in a base reg. to create a table index
+ shl bx,1 ; Create a table index for word sized entries
+ add dx,[mode4clipCXadjustLUT+bx]; DX hold the complete byte offset.
+ mov cx, ax ; CX = bit offset in the byte.
+
+ mov ax, [mode4pointerLUT + bx] ; select appropriate pointer
+ mov [mode4SelectedPointer], ax
+
+ ; Odd or Even scanline? note BP contains y cartesian coordinate
+
+ mov bx, bp ; y coordinate
+ shr bp, 1 ; shift right to determine if odd or even
+ ; CF if odd, or 0 if even.
+ sbb ch, ch ; CH = 0FFh if ODD, 0 if EVEN
+ shl bx, 1
+ mov bp, [mode4clipDXLUT + bx] ;the Y counters
+ stc ; we are fine, set the CY so we will return
+ ; CY cleared.
+detboundmode4_exit:
+ cmc ; revese the CY
+ pop ds
+ pop bx
+ pop ax
+ ret
+
+detboundmode4 endp
+
+
+
+;=============================================================================
+; Procedure to save the area of CGA video buffer into which the pointer will
+; be drawn. The memory buffer in which this data is stored is arranged odd
+; scanlines first, then even. So, the first 48 bytes are the odd scanline
+; data.
+;
+; Input: DX = byte offset
+; CL = bit offset in the byte
+; CH = 0FFh if ODD, 0 if EVEN
+; BP = Y loop counter, ODD in LSB, EVEN in MSB
+;
+;=============================================================================
+
+savebkgrndmode4 proc near
+
+ pusha
+ push es
+ push ds
+
+ ; set up the segment registers as required
+
+ mov ax,ds
+ mov es,ax
+ mov ax,0b800h
+ mov ds,ax
+ assume ds:nothing, es:SpcMseSeg
+ mov si,dx ; start the save.
+ or ch, ch
+ je svbkeven ; check the returned carry flag
+
+ ; the image's first scanline is odd
+
+ mov di,offset CGAbackgrnd ; where the background will be saved
+ mov bx,bp ; set the loop counter up
+ xor bh,bh ; don't want unwanted mess in MSB
+ add si,2000h ; odd part of buffer starts at 2000h
+svodd1:
+ mov cx,3 ; copy six bytes
+ rep movsw ; do the image scanline save
+ add si,80-6 ; point to the next scanline
+ dec bx ; decrement the loop counter
+ jnz svodd1 ; do more scanlines if necessary
+
+ ; save some even scanlines if need be.
+
+ mov si,dx ; offset into CGA buffer
+ add si, 80
+ mov bx,bp ; set up the loop counter
+ xchg bl,bh ; get the even part of loop counter
+ xor bh,bh ; trash the top end trash
+ and bx,bx ; check for a zero loop
+ jz misseven ; can't have a loop which execs 0 times
+ mov di,offset CGAbackgrnd+48; where the background will be saved
+sveven1:
+ mov cx,3 ; copy six bytes = 24 pixels
+ rep movsw ; do the scanline save
+ add si,80-6 ; point to the next scanline
+ dec bx ; decrement the loop counter
+ jnz sveven1 ; do more scanlines if necessary
+
+misseven: ; jump to here if there are no even scanlines to draw
+
+ jmp short endsavemode4
+
+svbkeven: ; the image's first scanline is even
+
+ mov di,offset CGAbackgrnd+48; where the background will be saved
+
+ mov bx,bp ; get the loop counter
+ xchg bl,bh ; rearrage to get the even part
+ xor bh,bh ; clear out the trash
+sveven2:
+ mov cx,3 ; copy six bytes
+ rep movsw ; do the copy
+ add si,80-6 ; point to the next scanline
+ dec bx ; decrement the loop counter
+ jnz sveven2 ; do more scanlines if necessary
+
+ mov si,dx ; offset into CGA buffer
+ add si,2000h ; odd part of the video buffer
+ mov di,offset CGAbackgrnd ; where to save the odd scanlines
+ mov bx,bp ; get the loop counter
+ xor bh,bh ; clear out the unwanted trash
+svodd2:
+ mov cx,3 ; copy six bytes
+ rep movsw ; do the copy
+ add si,80-6 ; point to the next scanline
+ dec bx ; decrement the loop counter
+ jnz svodd2 ; do more scanlines if necessary
+
+endsavemode4:
+ assume ds:SpcMseSeg, es:nothing
+
+ pop ds
+ pop es
+ popa
+ ret
+savebkgrndmode4 endp
+
+;=============================================================================
+; Procedure to restore the area of CGA video buffer into which the pointer
+; was drawn. The memory buffer in which this data is stored is arranged
+; odd scanlines first, then even. So, the first 48 bytes are the odd scanline
+; data.
+;
+; Input:
+; DX = byte offset to top left hand pointer pixel of the pointer
+; CL = bit offset in the byte
+; CH = 0FFh if ODD, 0 if EVEN
+; BP = Y loop counter(ODD in LSB and EVEN in MSB)
+;
+;=============================================================================
+
+restorebkgrndmode4 proc near
+
+ pusha
+ push es
+
+ ; set up the segment registers as required
+
+ mov ax,0b800h
+ mov es,ax
+ mov di,dx ; restore background
+ or ch, ch
+ je rsbkeven ; check the returned carry flag
+
+ ; the image's first scanline is odd. The CGA buffer is translated
+ ; so that a scanline (row N) from the even part of the buffer appears
+ ; on the screen at raster I. The scanline at position N from the
+ ; odd part of the video buffer maps to screen position I+1. If the
+ ; 1st. scanline is odd, then this is drawn at raster A and the
+ ; following algorithm draws the 1st. even row at raster A+1 to
+ ; compensate for the video buffer arrangement.
+
+ mov si,offset CGAbackgrnd ; where the background is be saved
+ add di,2000h ; do the odd buffer
+
+ mov bx,bp ; set the loop counter up
+ xor bh,bh ; clear out the MSB trash
+rsodd1:
+ mov cx,3 ; copy six bytes
+ rep movsw ; do the restore
+ add di,80-6 ; point to the next odd scanline
+ dec bx ; decrement the loop counter
+ jnz rsodd1 ; restore more even scanlines if needed
+
+ mov bx,bp ; let the loop counter
+ xchg bl,bh ; get the even part
+ xor bh,bh ; clear out the MSB trash
+ and bx,bx ; test for zero even scanlines
+ jz misseven1rs ; can't have a zero execute loop
+ mov di,dx ; offset into CGA buffer
+ add di,80 ; get the odd/even scanlines instep
+ mov si,offset CGAbackgrnd+48; where the background is be saved
+rseven1:
+ mov cx,3 ; restore six bytes
+ rep movsw ; do the restore
+ add di,80-6 ; point to the next even scanline
+ dec bx ; decrement the loop counter
+ jnz rseven1 ; restore more even scanlines if needed
+
+misseven1rs: ; jump to here if there are no even scanlines to be restored.
+
+ jmp short endrestoremode4
+
+rsbkeven: ; the image's first scanline is even
+
+ mov si,offset CGAbackgrnd+48; where the background will be saved
+
+ mov bx,bp ; get the loop counter
+ xchg bl,bh ; get the even part of the loop counter
+ xor bh,bh ; scrap the MSB trash
+rseven2:
+ mov cx,3 ; restore six bytes
+ rep movsw ; do the restore
+ add di,80-6 ; point to the next even scanline
+ dec bx ; decrement the loop counter
+ jnz rseven2 ; do more even scanlines if needed
+
+ mov di,dx ; offset into CGA buffer
+ add di,2000h ; do the odd buffer
+ mov si,offset CGAbackgrnd ; where to save the odd scanlines
+
+ mov bx,bp ; set the loop counter up
+ xor bh,bh ; scrap the MSB trash
+rsodd2:
+ mov cx,3 ; restore six bytes
+ rep movsw ; do the restore
+ add di,80-6 ; point to the next odd scanline
+ dec bx ; decrement the loop counter
+ jnz rsodd2 ; restore more odd scanlines if needed
+
+endrestoremode4:
+ assume ds:SpcMseSeg, es:nothing
+
+ pop es
+ popa
+ ret
+restorebkgrndmode4 endp
+
+;============================================================================
+; Procedure to draw the pointer image into the video buffer for mode 13h
+; VGA graphics.
+;
+; Input:
+; DX = byte offset
+; BP = Y loop counter
+; CX = X loop counter
+;
+;============================================================================
+
+draw256pointer proc near
+ pusha
+ push es
+ push ds
+
+ mov ax,0a000h ; point to the 256 colour mode video buffer
+ mov es,ax
+ mov ax,cs
+ mov ds,ax
+
+ assume ds:SpcMseSeg, es:nothing
+
+ cld ; write forward through the buffer
+ ; DX = TLHC pixel offset in the video buffer.
+ mov di,dx ; point DI at the video buffer location of fun
+ mov si, offset current_cursor ; we only use this cursor shape
+ ; because every pixel is on byte
+ ; boundary. The X counter would
+ ; take care of X clipping
+y_256:
+ push cx
+ lodsw ;and mask
+ mov dx, [si + 48 - 2] ;xor mask
+ inc si ;we don't need the third byte
+ xchg al, ah ; byte sequence
+ xchg dh, dl ;
+x_256:
+ shl ax, 1 ;AND mask bit
+ sbb bl, bl ; bl = 0FFf if CY, 0 if not CY
+ and bl, es:[di] ;and the target and save the result
+ shl dx, 1 ;XOR mask bit
+ sbb bh, bh ;
+ xor bl, bh ;xor with the save result
+ mov es:[di], bl ;update the target
+ inc di ;next pixel
+ loop x_256 ;until this scan line is done
+ pop cx ;recovery X loop counter
+ add di, 320 ;target address to next scan line
+ sub di, cx
+ dec bp ;Y counter
+ jne y_256
+
+ pop ds
+ pop es
+ popa
+ ret
+draw256pointer endp
+
+;=============================================================================
+; Procedure to save the area of 256 colour mode video buffer into which the
+; pointer will be drawn. The memory buffer in which this data is stored is
+; arranged odd scanlines first, then even. So, the first 48 bytes are the odd
+; scanline data.
+;
+; Input:
+; DX = byte offset
+; BP = Y loop counter
+; CX = X loop counter
+;
+;=============================================================================
+
+savebkgrndmode13 proc near
+ pusha
+ push es
+ push ds
+
+ mov di,offset bkgrnd256 ; point to the area in which backgound
+ ; data will be saved
+ mov si,dx ; SOURCE: the video buffer at x,y
+
+ mov ax,0a000h
+ mov ds,ax
+ mov ax,cs
+ mov es,ax
+ mov bx, cx ;x counter
+ mov dx, 320
+ sub dx, bx
+ assume ds:nothing, es:SpcMseSeg
+ cld
+save_256_loop:
+ mov cx, bx
+ shr cx, 1
+ rep movsw
+ adc cl, 0
+ rep movsb
+ add si, dx ; next scan line offset
+ dec bp ; until Y counter is done
+ jne save_256_loop
+
+ pop ds
+ pop es
+
+ assume es:nothing, ds:SpcMseSeg
+
+ popa
+ ret
+savebkgrndmode13 endp
+
+;=============================================================================
+; Procedure to replace an existing pointer image in the 256 colour video
+; buffer with the data that was there previous to the pointer draw operation.
+; The data is stored in an internal (to the driver) buffer.
+;
+; Input:
+; DX = byte offset
+; BP = Y loop counter
+; CX = X loop counter
+;
+;=============================================================================
+
+restorebkgrndmode13 proc near
+ pusha
+ push es
+
+ mov di,dx ; DESTINATION: in the VRAM
+ mov ax,0a000h ; point a segment register at video buffer
+ mov es,ax
+
+ assume es:nothing
+ mov bx, cx
+ mov si,offset bkgrnd256 ; where the data is saved
+ mov dx, 320
+ sub dx, bx
+
+ cld ; write forward in memory
+restore_256_loop:
+ mov cx, bx
+ shr cx, 1
+ rep movsw
+ adc cl, 0
+ rep movsb
+ add di, dx
+ dec bp
+ jne restore_256_loop
+
+ pop es
+ popa
+ ret
+restorebkgrndmode13 endp
+
+;========================================================================
+; Procedure to determine what the byte offset is, in the current
+; VGA buffer for the top left hand corner of the pointer bitmap.
+; The X,Y value is modified for hotspot in this routine. X and Y looping
+; counters are also returned.
+;
+; INPUT: CX,DX = pointer x,y coordinates
+; OUT :
+; carry set if either X or Y is out of screen
+; DX = byte offset to top left hand pointer pixel of the pointer
+; CX = X counter
+; BP = Y counter
+;========================================================================
+
+detboundmode13 proc near
+
+ push ax
+ push bx
+ push ds
+
+ mov ax,cs
+ mov ds,ax
+
+ assume ds:SpcMseSeg
+
+
+ ; do the adjustment in x,y for pointer hotspot
+ ; modify the raw X,Y values for hotspot
+
+ sub cx,[hotspot] ; adjust the x cartesian coord for hotspot
+ jns dont_zero_xmode13; if x goes negative, assume zero
+ xor cx,cx
+
+dont_zero_xmode13:
+
+ sub dx,[hotspot+2] ; adjust the y cartesian coord for the hotspot
+ jns dont_zero_ymode13; if y goes negative, assume zero
+ xor dx,dx
+
+dont_zero_ymode13:
+ cmp cx, 320
+ jae detboundmode13_exit ; CY is cleared
+ cmp dx, 200 ;
+ jae detboundmode13_exit ; CY is cleared
+
+ ; CX and DX are now validated for the following section: buffer
+ ; offset determination. Note, unlike other video modes, mode 13
+ ; provides a direct mapping of the video display to video buffer.
+ ; in other words; 1 byte represents 1 pixel. From this, it is not
+ ; necessary to provide byte alignment data.
+
+ mov bx,dx ; save in a base register
+ shl bx,1 ; create a word table index
+ mov dx,[mult320LUT+bx] ; do the multiply by 320
+ ; add in the offset along the current raster.
+
+ add dx,cx ; cx contains the byte offset from
+ mov ax,[mode4clipDXLUT + bx]; get Y loop counter from table
+ add al, ah ; the table has ODD/EVEN counters
+ cbw
+ mov bp, ax ; the final Y counter
+ ; column 0.
+ mov ax, 320 ; calculate X loop counter
+ sub ax, cx
+ cmp ax, 16 ;
+ jl set_new_x_counter
+ mov ax, 16
+set_new_x_counter:
+ mov cx, ax ; X counter
+ stc ; everything is fine, set CY
+ ; so we will return CY cleared
+detboundmode13_exit:
+ cmc ; complement the CY
+ pop ds
+ pop bx
+ pop ax
+ ret
+
+detboundmode13 endp
+
+
+ public SpcMseEnd
+SpcMseEnd label byte
+
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+;
+; Installation Code From Here Downwards
+;
+;++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+; segment:offset table for redirected mouse functions for real rom version.
+
+mio_table dw 38 dup(?)
+
+
+
+ assume cs:SpcMseSeg,ds:nothing,es:nothing
+
+ public InstSpcMse
+;
+; InstSpcMse - Installs the softpc mouse driver code
+;
+; Inputs: ds == Resident location of SpcMseSeg
+; Outputs: None
+;
+InstSpcMse proc near
+
+ ;;;;;;;;;;;;;;;;do ret to use old mouse driver;;; ret
+
+ pusha
+
+ ; save old int 10 vector
+ xor ax,ax
+ mov es,ax
+ mov ax,es:[40h]
+ mov si,offset old_vid_int
+ mov word ptr ds:[si],ax
+ mov ax,es:[42h]
+ mov word ptr ds:[si+2],ax
+
+ mov bx,ds
+ mov si,offset sysinitgrp:mio_table
+ push ds
+ push cs
+ pop ds
+
+ mov word ptr ds:[si], offset mouse_io
+ mov word ptr ds:[si+2],bx
+
+IFDEF MOUSE_VIDEO_BIOS
+
+ mov word ptr ds:[si+4],offset mouse_video_io
+ mov word ptr ds:[si+6],bx
+
+ENDIF ; MOUSE_VIDEO_BIOS
+
+ mov word ptr ds:[si+8],offset mouse_int1
+ mov word ptr ds:[si+10],bx
+ mov word ptr ds:[si+12], offset mouse_version
+ mov word ptr ds:[si+14],bx
+ mov word ptr ds:[si+16],offset mouse_copyright
+ mov word ptr ds:[si+18],bx
+ mov word ptr ds:[si+20],offset video_io
+ mov word ptr ds:[si+22],bx
+ mov word ptr ds:[si+24],offset mouse_int2
+ mov word ptr ds:[si+26],bx
+ mov word ptr ds:[si+28],offset entry_point_from_32bit
+ mov word ptr ds:[si+30],bx
+ mov word ptr ds:[si+32],offset int33function0
+ mov word ptr ds:[si+34],bx
+ mov word ptr ds:[si+36],offset int33function1
+ mov word ptr ds:[si+38],bx
+ mov word ptr ds:[si+40],offset int33function2
+ mov word ptr ds:[si+42],bx
+ mov word ptr ds:[si+44],offset int33function9
+ mov word ptr ds:[si+46],bx
+ mov word ptr ds:[si+48],offset current_position_x
+ mov word ptr ds:[si+50],bx
+ mov word ptr ds:[si+52],offset current_position_y
+ mov word ptr ds:[si+54],bx
+ mov word ptr ds:[si+56],offset mouseINB
+ mov word ptr ds:[si+58],bx
+ mov word ptr ds:[si+60],offset mouseOUTB
+ mov word ptr ds:[si+62],bx
+ mov word ptr ds:[si+64],offset mouseOUTW
+ mov word ptr ds:[si+66],bx
+ mov word ptr ds:[si+68],offset VRAMlasttextcelloff
+ mov word ptr ds:[si+70],bx
+ mov word ptr ds:[si+72],offset internalCF
+ mov word ptr ds:[si+74],bx
+ mov word ptr ds:[si+76],offset function3data
+ mov word ptr ds:[si+78],bx
+ mov word ptr ds:[si+80],offset conditional_off
+ mov word ptr ds:[si+82],bx
+ pop ds
+ mov bx, offset sysinitgrp:mio_table
+ bop 0C8h ; Host mouse installer BOP
+
+; get the freshly written int 33h vector from IVT
+; write the vector segment:offset data to the jump patch
+
+ xor ax,ax
+ mov es,ax
+ mov ax,es:[33h*4]
+ mov bx,es:[(33h*4)+2]
+ mov si,offset moff
+ mov word ptr ds:[si],ax
+ mov word ptr ds:[si+2],bx
+ add ax,2 ; HLL entry point
+ mov si,offset loffset
+ mov word ptr ds:[si],ax
+ mov word ptr ds:[si+2],bx
+
+; write the new value to the IVT
+ call DOCLI
+ mov bx, offset int33h_vector
+ mov word ptr es:[33h*4], bx
+ mov bx, ds
+ mov word ptr es:[(33h*4)+2], bx
+ call DOSTI
+
+ popa
+ ret
+InstSpcMse endp
+
+SpcMseSeg ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/sysconf.asm b/private/mvdm/dos/v86/doskrnl/bios/sysconf.asm
new file mode 100644
index 000000000..6a5209942
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/sysconf.asm
@@ -0,0 +1,3972 @@
+page ,160
+ title bios system initialization
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+
+ include version.inc ; set version build flags
+ include biosseg.inc ; establish bios segment structure
+
+lf equ 10
+cr equ 13
+tab equ 9
+
+have_install_cmd equ 00000001b ; config.sys has install= commands
+has_installed equ 00000010b ; sysinit_base installed.
+
+default_filenum = 8
+
+ break macro ; dummy empty macro
+ endm
+
+ include sysvar.inc
+ include pdb.inc ; M020
+ include syscall.inc
+ include doscntry.inc
+ include devsym.inc
+ include devmark.inc
+
+ include umb.inc
+ include dossym.inc
+ include dossvc.inc
+ include cmdsvc.inc
+ include softpc.inc
+
+stacksw equ true ;include switchable hardware stacks
+
+ if ibmjapver
+noexec equ true
+ else
+noexec equ false
+ endif
+
+
+
+
+; external variable defined in ibmbio module for multi-track
+
+multrk_on equ 10000000b ;user spcified mutitrack=on,or system turns
+ ; it on after handling config.sys file as a
+ ; default value,if multrk_flag = multrk_off1.
+multrk_off1 equ 00000000b ;initial value. no "multitrack=" command entered.
+multrk_off2 equ 00000001b ;user specified multitrack=off.
+
+Bios_Data segment
+ extrn multrk_flag:word
+ extrn keyrd_func:byte
+ extrn keysts_func:byte
+Bios_Data ends
+
+; end of multi-track definition.
+
+sysinitseg segment
+
+assume cs:sysinitseg,ds:nothing,es:nothing,ss:nothing
+
+ extrn badopm:byte,crlfm:byte,badcom:byte,badmem:byte,badblock:byte
+ extrn badsiz_pre:byte,badld_pre:byte
+ extrn badstack:byte,badcountrycom:byte
+ extrn badcountry:byte,insufmemory:byte
+ extrn condev:byte,auxdev:byte,prndev:byte,commnd:byte,config:byte
+ extrn cntry_drv:byte,cntry_root:byte,cntry_path:byte
+ extrn memory_size:word
+ extrn buffers:word
+ extrn files:byte,num_cds:byte
+ extrn dosinfo:dword
+ extrn fcbs:byte,keep:byte
+ extrn confbot:word,alloclim:word,command_line:byte
+ extrn zero:byte,sepchr:byte
+ extrn count:word,chrptr:word,cntryfilehandle:word
+ extrn memlo:word,memhi:word,prmblk:word,ldoff:word
+ extrn packet:byte,unitcount:byte,break_addr:dword
+ extrn bpb_addr:dword,drivenumber:byte,sysi_country:dword
+ extrn config_size:word
+ extrn install_flag:word
+ extrn badorder:byte
+ extrn errorcmd:byte
+ extrn linecount:word
+ extrn showcount:byte
+ extrn buffer_linenum:word
+ extrn h_buffers:word
+ extrn badparm:byte
+ extrn configmsgflag:word
+ extrn org_count:word
+ extrn multi_pass_id:byte
+
+ extrn mem_err:near,setdoscountryinfo:near
+ extrn pararound:near,tempcds:near
+ extrn set_country_path:near,move_asciiz:near,delim:near
+ extrn badfil:near,round:near
+ extrn do_install_exec:near
+ extrn setdevmark:near
+
+ extrn print:near,organize:near,newline:near
+ extrn parseline:near
+ extrn badload:near,calldev:near,prnerr:near
+
+ extrn runhigh:byte
+ extrn IsXMSLoaded:near
+
+ extrn TryToMovDOSHi:near
+
+ifdef DBCS
+ extrn testkanj:near
+endif
+
+ extrn bEchoConfig:byte ; NTVDM flag off\on echo of cfg processing
+
+ if stacksw
+
+; internal stack parameters
+
+entrysize equ 8
+
+mincount equ 8
+defaultcount equ 9
+maxcount equ 64
+
+minsize equ 32
+defaultsize equ 128
+maxsize equ 512
+
+DOS_FLAG_OFFSET equ 86h
+
+ extrn stack_count:word
+ extrn stack_size:word
+ extrn stack_addr:dword
+
+ endif
+
+ public doconf
+ public getchr
+ public multi_pass
+ public AllocUMB
+ public AllocUMBLow ; NTVDM
+ public multdeviceflag
+multdeviceflag db 0
+ public devmark_addr
+devmark_addr dw ? ;segment address for devmark.
+ public setdevmarkflag
+setdevmarkflag db 0 ;flag used for devmark
+
+ems_stub_installed db 0
+
+IFDEF DONT_LOAD_OS2_DD ; M045
+
+Os2ChkBuf DD 0 ; Tmp read buffer
+
+ENDIF ; M045
+
+badparm_ptr label dword
+badparm_off dw 0
+badparm_seg dw 0
+
+;******************************************************************************
+;take care of config.sys file.
+;system parser data and code.
+;******************************************************************************
+
+;*******************************************************************
+; parser options set for msbio sysconf module
+;*******************************************************************
+;
+;**** default assemble swiches definition **************************
+
+ ifndef farsw
+farsw equ 0 ; near call expected
+ endif
+
+ ifndef datesw
+datesw equ 0 ; check date format
+ endif
+
+ ifndef timesw
+timesw equ 0 ; check time format
+ endif
+
+ ifndef filesw
+filesw equ 1 ; check file specification
+ endif
+
+ ifndef capsw
+capsw equ 0 ; perform caps if specified
+ endif
+
+ ifndef cmpxsw
+cmpxsw equ 0 ; check complex list
+ endif
+
+ ifndef numsw
+numsw equ 1 ; check numeric value
+ endif
+
+ ifndef keysw
+keysw equ 0 ; support keywords
+ endif
+
+ ifndef swsw
+swsw equ 1 ; support switches
+ endif
+
+ ifndef val1sw
+val1sw equ 1 ; support value definition 1
+ endif
+
+ ifndef val2sw
+val2sw equ 0 ; support value definition 2
+ endif
+
+ ifndef val3sw
+val3sw equ 1 ; support value definition 3
+ endif
+
+ ifndef drvsw
+drvsw equ 1 ; support drive only format
+ endif
+
+ ifndef qussw
+qussw equ 0 ; support quoted string format
+ endif
+
+
+ include parse.asm ;together with psdata.inc
+
+;control block definitions for parser.
+;---------------------------------------------------
+; buffer = [n | n,m] {/e}
+
+p_parms struc
+ dw ?
+ db 1 ; an extra delimiter list
+ db 1 ; length is 1
+ db ';' ; delimiter
+p_parms ends
+
+p_pos struc
+ dw ? ; numeric value??
+ dw ? ; function
+ dw ? ; result value buffer
+
+; note: by defining result_val before this structure, we could remove
+; the "result_val" from every structure invocation
+
+ dw ? ; value list
+ db 0 ; no switches/keywords
+p_pos ends
+
+p_range struc
+ db 1 ; range definition
+ db 1 ; 1 definition of range
+ db 1 ; item tag for this range
+ dd ? ; numeric min
+ dd ? ; numeric max
+p_range ends
+
+buf_parms p_parms <buf_parmsx>
+buf_parmsx dw 201h,buf_pos1,buf_pos2 ; min 1, max 2 positionals
+ db 1 ; one switch
+ dw sw_x_ctrl
+ db 0 ; no keywords
+
+buf_pos1 p_pos <8000h,0,result_val,buf_range_1> ; numeric
+buf_range_1 p_range <,,,1,99> ; M050
+buf_pos2 p_pos <8001h,0,result_val,buf_range_2> ; optional num.
+buf_range_2 p_range <,,,0,8>
+
+sw_x_ctrl p_pos <0,0,result_val,noval,1> ; followed by one switch
+switch_x db '/X',0 ; M016
+
+p_buffers dw 0 ; local variables
+p_h_buffers dw 0
+p_buffer_slash_x db 0
+
+;common definitions ------------
+noval db 0
+
+result_val label byte
+ db ? ; type returned
+ db ? ; item tag returned
+ dw ? ; es:offset of the switch defined
+rv_byte label byte
+rv_dword dd ? ; value if number,or seg:offset to string.
+;-------------------------------
+
+; break = [ on | off ]
+
+brk_parms p_parms <brk_parmsx>
+
+brk_parmsx dw 101h,brk_pos ; min,max = 1 positional
+ db 0 ; no switches
+ db 0 ; no keywords
+
+brk_pos p_pos <2000h,0,result_val,on_off_string> ; simple string
+
+on_off_string label byte
+ db 3 ; signals that there is a string choice
+ db 0 ; no range definition
+ db 0 ; no numeric values choice
+ db 2 ; 2 strings for choice
+ db 1 ; the 1st string tag
+ dw on_string
+ db 2 ; the 2nd string tag
+ dw off_string
+
+on_string db "ON",0
+off_string db "OFF",0
+
+p_ctrl_break db 0 ; local variable
+
+;--------------------------------
+
+; country = n {m {path}}
+; or
+; country = n,,path
+
+cntry_parms p_parms <cntry_parmsx>
+
+cntry_parmsx dw 301h,cntry_pos1,cntry_pos2,cntry_pos3 ; min 1, max 3 pos.
+ db 0 ; no switches
+ db 0 ; no keywords
+
+cntry_pos1 p_pos <8000h,0,result_val,cc_range> ; numeric value
+cc_range p_range <,,,1,999>
+cntry_pos2 p_pos <8001h,0,result_val,cc_range> ; optional num.
+cntry_pos3 p_pos <201h,0,result_val,noval> ; optional filespec
+
+p_cntry_code dw 0 ; local variable
+p_code_page dw 0 ; local variable
+
+;--------------------------------
+
+; files = n
+
+files_parms p_parms <files_parmsx>
+
+files_parmsx dw 101h,files_pos ; min,max 1 positional
+ db 0 ; no switches
+ db 0 ; no keywords
+
+files_pos p_pos <8000h,0,result_val,files_range,0> ; numeric value
+files_range p_range <,,,8,255>
+
+p_files db 0 ; local variable
+
+;-------------------------------
+
+; fcbs = n,m
+
+fcbs_parms p_parms <fcbs_parmsx>
+
+fcbs_parmsx dw 201h,fcbs_pos_1,fcbs_pos_2 ; min,max = 2 positional
+ db 0 ; no switches
+ db 0 ; no keywords
+
+fcbs_pos_1 p_pos <8000h,0,result_val,fcbs_range> ; numeric value
+fcbs_range p_range <,,,1,255>
+fcbs_pos_2 p_pos <8000h,0,result_val,fcbs_keep_range> ; numeric value
+fcbs_keep_range p_range <,,,0,255>
+
+p_fcbs db 0 ; local variable
+p_keep db 0 ; local variable
+
+;-------------------------------
+; lastdrive = x
+
+ldrv_parms p_parms <ldrv_parmsx>
+
+ldrv_parmsx dw 101h,ldrv_pos ; min,max = 1 positional
+ db 0 ; no switches
+ db 0 ; no keywords
+
+ldrv_pos p_pos <110h,10h,result_val,noval> ; drive only, ignore colon
+ ; remove colon at end
+p_ldrv db 0 ; local variable
+
+;-------------------------------
+
+; stacks = n,m
+
+stks_parms p_parms <stks_parmsx>
+
+stks_parmsx dw 202h,stks_pos_1,stks_pos_2 ; min,max = 2 positionals
+ db 0 ; no switches
+ db 0 ; no keywords
+
+stks_pos_1 p_pos <8000h,0,result_val,stks_range> ; numeric value
+stks_range p_range <,,,0,64>
+stks_pos_2 p_pos <8000h,0,result_val,stk_size_range> ; numeric value
+stk_size_range p_range <,,,0,512>
+
+p_stack_count dw 0 ; local variable
+p_stack_size dw 0 ; local variable
+
+;-------------------------------
+
+; multitrack = [ on | off ]
+
+mtrk_parms p_parms <mtrk_parmsx>
+
+mtrk_parmsx dw 101h,mtrk_pos ; min,max = 1 positional
+ db 0 ; no switches
+ db 0 ; no keywords
+
+mtrk_pos p_pos <2000h,0,result_val,on_off_string> ; simple string
+
+p_mtrk db 0 ; local variable
+
+;-------------------------------
+; switches=/k
+
+swit_parms p_parms <swit_parmsx>
+
+swit_parmsx dw 0 ; no positionals
+ db 3 ; 2 switches for now. M059 M063
+ dw swit_k_ctrl ; /k control
+ dw swit_t_ctrl ; /t control M059
+ dw swit_w_ctrl ; /w control M063
+ db 0 ; no keywords
+
+swit_k_ctrl p_pos <0,0,result_val,noval,1> ; switch string follows
+swit_k db '/K',0
+swit_t_ctrl p_pos <0,0,result_val,noval,1> ; switch string follows M059
+swit_t db '/T',0 ; M059
+swit_w_ctrl p_pos <0,0,result_val,noval,1> ; switch string follows M063
+swit_w db '/W',0 ; M063
+
+p_swit_k db 0 ; local variable
+p_swit_t db 0 ; local variable M059
+p_swit_w db 0 ; local variable M063
+
+;-------------------------------
+
+; DOS = [ high | low ]
+
+dos_parms p_parms <dos_parmsx>
+
+dos_parmsx db 1 ; min parameters
+ db 2 ; max parameters
+ dw dos_pos ;
+ dw dos_pos ;
+ db 0 ; no switches
+ db 0 ; no keywords
+
+dos_pos p_pos <2000h,0,result_val,dos_strings> ; simple string
+ p_pos <2000h,0,result_val,dos_strings> ; simple string
+
+dos_strings label byte
+ db 3 ; signals that there is a string choice
+ db 0 ; no range definition
+ db 0 ; no numeric values choice
+ db 4 ; 4 strings for choice
+ db 1 ; the 1st string tag
+ dw hi_string
+ db 2 ; the 2nd string tag
+ dw lo_string
+ db 3
+ dw umb_string
+ db 4
+ dw noumb_string
+
+hi_string db "HIGH",0
+lo_string db "LOW",0
+umb_string db "UMB",0
+noumb_string db "NOUMB",0
+
+p_dos_hi db 0 ; local variable
+ ; BUGBUG : I dont know whether PARSER uses
+ ; this variable or not
+
+
+
+;******************************************************************************
+
+ public DevEntry
+
+DevSize dw ? ; size of the device driver being loaded(paras)
+DevLoadAddr dw ? ; Mem addr where the device driver is 2 b loaded
+DevLoadEnd dw ? ; MaxAddr to which device can be loaded
+DevEntry dd ? ; Entry point to the device driver
+DevBrkAddr dd ? ; Break address of the device driver
+;
+DevUMB db 0 ; byte indicating whether to load DDs in UMBs
+DevUMBAddr dw 0 ; cuurent UMB used fro loading devices (paras)
+DevUMBSize dw 0 ; Size of the current UMB being used (paras)
+DevUMBFree dw 0 ; Start of free are in the current UMB (paras)
+;
+DevXMSAddr dd ?
+;
+DevExecAddr dw ? ; Device load address parameter to Exec call
+DevExecReloc dw ? ; Device load relocation factor
+;
+DeviceHi db 0 ; Flag indicating whther the current device
+ ; is being loaded into UMB
+DevSizeOption dw ? ; SIZE= option
+;
+Int12Lied db 0 ; did we trap int 12 ?
+OldInt12Mem dw ? ; value in 40:13h (int 12 ram)
+ThreeComName db 'PROTMAN$' ; 3Com Device name
+;
+FirstUMBLinked db 0
+DevDOSData dw ? ; segment of DOS Data
+DevCmdLine dd ? ; Current Command line
+DevSavedDelim db ? ; The delimiter which was replaced with null
+ ; to use the file name in the command line
+;
+;----------------------------------------------------------------------------
+;
+; procedure : doconf
+;
+; Config file is parsed intitially with this routine. For the
+; Subsequent passes 'multi_pass' entry is used .
+;
+;----------------------------------------------------------------------------
+;
+doconf proc near
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+ mov ax,(char_oper shl 8) ;get switch character
+ int 21h
+ mov [command_line+1],dl ; set in default command line
+
+ mov dx,offset config ;now pointing to file description
+ mov ax,open shl 8 ;open file "config.sys"
+ stc ;in case of int 24
+ int 21h ;function request
+ jnc noprob ; brif opened okay
+ mov multi_pass_id,11 ; set it to unreasonable number
+ ret
+noprob: ;get file size (note < 64k!!)
+ mov bx,ax
+ xor cx,cx
+ xor dx,dx
+ mov ax,(lseek shl 8) or 2
+ int 21h
+ mov [count],ax
+
+ xor dx,dx
+ mov ax,lseek shl 8 ;reset pointer to beginning of file
+ int 21h
+
+ mov dx,[confbot] ;use current confbot value
+ mov ax,[count]
+ mov [config_size],ax ;save the size of config.sys file.
+ call pararound
+ sub dx,ax
+ sub dx,11h ;room for header
+ mov [confbot],dx ; config starts here. new conbot value.
+ call tempcds ; finally get cds to "safe" location
+ assume ds:nothing,es:nothing
+
+ mov dx,[confbot]
+ mov ds,dx
+ mov es,dx
+ xor dx,dx
+ mov cx,[count]
+ mov ah,read
+ stc ;in case of int 24
+ int 21h ;function request
+ pushf
+
+; find the eof mark in the file. if present,then trim length.
+
+ push ax
+ push di
+ push cx
+ mov al,1ah ; eof mark
+ mov di,dx ; point ro buffer
+ jcxz puteol ; no chars
+ repnz scasb ; find end
+ jnz puteol ; none found and count exahusted
+
+; we found a 1a. back up
+
+ dec di ; backup past 1a
+
+; just for the halibut,stick in an extra eol
+
+puteol:
+ mov al,cr
+ stosb
+ mov al,lf
+ stosb
+ sub di,dx ; difference moved
+ mov count,di ; new count
+
+ pop cx
+ pop di
+ pop ax
+
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+ push ax
+ mov ah,close
+ int 21h
+ pop ax
+ popf
+ jc conferr ;if not we've got a problem
+ cmp cx,ax
+ jz getcom ;couldn't read the file
+
+conferr:
+ mov dx,offset config ;want to print config error
+ call badfil
+endconv:
+ ret
+;
+;----------------------------------------------------------------------------
+;
+; entry : multi_pass
+;
+; called to execute device=,install= commands
+;
+;----------------------------------------------------------------------------
+;
+
+multi_pass:
+ push cs
+ pop ds
+
+ cmp multi_pass_id,10
+ jae endconv ; do nothing. just return.
+
+ push confbot
+ pop es ; es -> confbot
+
+ mov si,org_count
+ mov count,si ; set count
+ xor si,si
+ mov chrptr,si ; reset chrptr,linecount
+ mov linecount,si
+ call getchr
+ jmp short conflp
+
+getcom:
+ call organize ;organize the file
+ call getchr
+
+conflp: jc endconv
+
+;*** call reset_dos_version ; still need to reset version even ibmdos handles this through
+;*** ; function 4bh call,since ibmdos does not know when load/overlay call finishes.
+
+ inc linecount ; increase linecount.
+ mov multdeviceflag,0 ; reset multdeviceflag.
+ mov setdevmarkflag,0 ; reset setdevmarkflag.
+ cmp al,lf ; linefeed?
+ je blank_line ; then ignore this line.
+
+ mov ah,al
+ call getchr
+ jnc tryi
+
+ cmp multi_pass_id,2
+ jae endconv ;do not show badop again for multi_pass.
+ jmp badop
+
+coff: push cs
+ pop ds
+ call newline
+ jmp conflp
+
+blank_line:
+ call getchr
+ jmp conflp
+
+coff_p:
+ push cs
+ pop ds
+
+
+;to handle install= commands,we are going to use multi-pass.
+;the first pass handles the other commands and only set install_flag when
+;it finds any install command. the second pass will only handle the
+;install= command.
+
+;------------------------------------------------------------------------------
+;install command
+;------------------------------------------------------------------------------
+tryi:
+ cmp multi_pass_id,0 ; the initial pass for DOS=HI
+ je multi_try_doshi
+
+ cmp multi_pass_id,2 ; the second pass was for ifs=
+ je coff ; now it is NOPs
+ ; This pass can be made use of if
+ ; we want do some config.sys process
+ ; after device drivers are loaded
+ ; and before install= commands
+ ; are processed
+
+ cmp multi_pass_id,3 ; the third pass for install= ?
+ je multi_try_i
+ cmp ah, 'H'
+ je coff
+ cmp ah, 'E'
+ je coff
+ cmp ah,'I' ; install= command?
+ jne tryb ; the first pass is for normal operation.
+ or install_flag,have_install_cmd ; set the flag
+ jmp coff ; and handles the next command
+
+multi_try_i:
+ cmp ah,'I' ; install= command?
+ jne multi_pass_filter ; no. ignore this.
+ call do_install_exec ;install it.
+ jmp coff ;to handle next install= command.
+
+multi_pass_filter:
+ cmp ah,'Y' ; comment?
+ je multi_pass_adjust
+ cmp ah,'Z' ; bad command?
+ je multi_pass_adjust
+ cmp ah,'0' ; rem?
+ jne coff ; ignore the rest of the commands.
+
+multi_pass_adjust: ; these commands need to
+ dec chrptr ; adjust chrptr,count
+ inc count ; for newline proc.
+
+multi_pass_coff:
+ jmp coff ; to handle next install= commands.
+
+
+
+;----------------------------------------------------------------------------
+; DOS=HIGH/LOW command
+;
+; EchoConfig command turns on con echo for config processing
+; NTVDM 14-Aug-1992 Jonle
+;----------------------------------------------------------------------------
+;
+multi_try_doshi:
+ cmp ah, 'H'
+ je it_is_h
+ cmp ah, 'E'
+ jne multi_pass_filter
+
+ mov cs:bEchoConfig, ah ; init console
+ CMDSVC SVC_CMDINITCONSOLE
+ jmp coff
+
+
+it_is_h: ; M003 - removed initing DevUMB
+ ; & runhigh
+ mov di,offset dos_parms
+ xor cx,cx
+ mov dx,cx
+h_do_parse:
+ call sysinit_parse
+ jnc h_parse_ok ; parse error
+h_badparm:
+ call badparm_p ; show message and end the serach loop.
+ jmp short h_end
+
+h_parse_ok:
+ cmp ax,$p_rc_eol ; end of line?
+ jz h_end ; then end the $endloop
+ call ProcDOS
+ jmp short h_do_parse
+h_end:
+ jmp coff
+
+
+;------------------------------------------------------------------------------
+; buffer command
+;------------------------------------------------------------------------------
+;*******************************************************************************
+; *
+; function: parse the parameters of buffers= command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; buffers set *
+; buffer_slash_x flag set if /x option chosen. *
+; h_buffers set if secondary buffer cache specified. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to buf_parms; /*parse control definition*/ *
+; set dx,cx to 0; *
+; reset buffer_slash_x; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; if (result_val.$p_synonym_ptr == slash_e) then /*not a switch *
+; buffer_slash_x = 1 *
+; else if (cx == 1) then /* first positional */ *
+; buffers = result_val.$p_picked_val; *
+; else h_buffers = result_val.$p_picked_val; *
+; else {show error message;error exit} *
+; }; *
+; if (buffer_slash_x is off & buffers > 99) then show_error; *
+; }; *
+; *
+;*******************************************************************************
+
+tryb:
+ cmp ah,'B'
+ jnz tryc
+
+ ; NTVDM - buffers command is ignored
+ ; 15-Aug-1992 Jonle
+ jmp coff
+
+if 0
+ mov p_buffer_slash_x,0
+ mov di,offset buf_parms
+ xor cx,cx
+ mov dx,cx
+
+do7:
+ call sysinit_parse
+ jnc if7 ; parse error,
+ call badparm_p ; and show messages and end the search loop.
+ jmp short sr7
+
+if7:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en7 ; then jmp to $endloop for semantic check
+ cmp result_val.$p_synonym_ptr,offset switch_x
+ jnz if11
+
+; mov p_buffer_slash_x,1 ; set the flag M016
+ jmp short en11
+
+if11:
+ mov ax,word ptr result_val.$p_picked_val
+ cmp cx,1
+ jnz if13
+
+ mov p_buffers,ax
+ jmp short en11
+
+if13:
+ mov p_h_buffers,ax
+en11:
+ jmp do7
+
+en7:
+ cmp p_buffers,99
+ jbe if18
+; cmp p_buffer_slash_x,0 ; M016
+; jnz if18
+
+ call badparm_p
+ mov p_h_buffers,0
+ jmp short sr7
+
+if18:
+ mov ax,p_buffers ; we don't have any problem.
+ mov buffers,ax ; now,let's set it really.
+
+ mov ax,p_h_buffers
+ mov h_buffers,ax
+
+; mov al,p_buffer_slash_x ; M016
+; mov buffer_slash_x,al
+
+ mov ax,linecount
+ mov buffer_linenum,ax ; save the line number for the future use.
+
+sr7:
+ jmp coff
+endif
+
+
+;------------------------------------------------------------------------------
+; break command
+;------------------------------------------------------------------------------
+;****************************************************************************
+; *
+; function: parse the parameters of break = command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; turn the control-c check on or off. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di to brk_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; if (result_val.$p_item_tag == 1) then /*on */ *
+; set p_ctrl_break,on; *
+; else /*off */ *
+; set p_ctrl_break,off; *
+; else {show message;error_exit}; *
+; }; *
+; if (no error) then *
+; dos function call to set ctrl_break check according to *
+; }; *
+; *
+;****************************************************************************
+
+tryc:
+ cmp ah,'C'
+ jnz trym
+ mov di,offset brk_parms
+ xor cx,cx
+ mov dx,cx
+do22:
+ call sysinit_parse
+ jnc if22 ; parse error
+ call badparm_p ; show message and end the serach loop.
+ jmp short sr22
+
+if22:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en22 ; then end the $endloop
+ cmp result_val.$p_item_tag,1
+ jnz if26
+
+ mov p_ctrl_break,1 ; turn it on
+ jmp short en26
+
+if26:
+ mov p_ctrl_break,0 ; turn it off
+en26:
+ jmp short do22 ; we actually set the ctrl break
+
+en22:
+ mov ah,set_ctrl_c_trapping ; if we don't have any parse error.
+ mov al,1
+ mov dl,p_ctrl_break
+ int 21h
+sr22:
+ jmp coff
+
+;------------------------------------------------------------------------------
+; multitrack command
+;------------------------------------------------------------------------------
+;******************************************************************************
+; *
+; function: parse the parameters of multitrack= command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; turn multrk_flag on or off. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di to brk_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; if (result_val.$p_item_tag == 1) then /*on */ *
+; set p_mtrk,on; *
+; else /*off */ *
+; set p_mtrk,off; *
+; else {show message;error_exit}; *
+; }; *
+; if (no error) then *
+; dos function call to set multrk_flag according to p_mtrk. *
+; *
+; }; *
+; *
+;******************************************************************************
+
+trym:
+ cmp ah,'M'
+ jnz tryu
+
+ mov di,offset mtrk_parms
+ xor cx,cx
+ mov dx,cx
+do31:
+ call sysinit_parse
+ jnc if31 ; parse error
+ call badparm_p ; show message and end the serach loop.
+ jmp short sr31
+if31:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en31 ; then end the $endloop
+
+ cmp result_val.$p_item_tag,1
+ jnz if35
+
+ mov p_mtrk,1 ; turn it on temporarily.
+ jmp short en35
+
+if35:
+ mov p_mtrk,0 ; turn it off temporarily.
+en35:
+ jmp short do31 ; we actually set the multrk_flag here
+
+en31:
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+
+ cmp p_mtrk,0
+ jnz if39
+
+ mov multrk_flag,multrk_off2 ; 0001h
+ jmp short en39
+
+if39:
+ mov multrk_flag,multrk_on ; 8000h
+en39:
+ pop ds
+ assume ds:sysinitseg
+sr31:
+ jmp coff
+
+
+;
+;-----------------------------------------------------------------------------
+; devicehigh command
+;-----------------------------------------------------------------------------
+;
+ assume ds:nothing
+tryu:
+ cmp ah, 'U'
+ jne tryd
+ mov badparm_off, si ; stash it there in case of an error
+ mov badparm_seg, es
+ call ParseSize ; process the size= option
+ jnc @f
+ call badparm_p
+ jmp coff
+@@:
+ push si
+ push es
+@@:
+ mov al, es:[si]
+ cmp al, cr
+ je @f
+ cmp al, lf
+ je @f
+ call delim
+ jz @f
+ inc si
+ jmp @b
+@@:
+ mov DevSavedDelim, al ; Save the delimiter before replacing
+ ; it with null
+ mov byte ptr es:[si], 0
+ pop es
+ pop si
+
+ mov DeviceHi, 0
+ cmp DevUMB, 0 ; do we support UMBs
+ je LoadDevice ; no, we don't
+ mov DeviceHi, 1
+ jmp short LoadDevice
+;
+;------------------------------------------------------------------------------
+; device command
+;------------------------------------------------------------------------------
+
+ assume ds:nothing
+tryd:
+ cmp ah,'D'
+ jz gotd
+ jmp tryq
+gotd:
+ mov DeviceHi, 0 ; not to be loaded in UMB ;M007
+ mov DevSizeOption, 0
+ mov DevSavedDelim, ' ' ; In case of DEVICE= the null has to
+ ; be replaced with a ' '
+
+LoadDevice:
+ mov bx,cs ;device= or devicehigh= command.
+ mov ds,bx
+
+ mov word ptr [bpb_addr],si ; pass the command line to the dvice
+ mov word ptr [bpb_addr+2],es
+
+ mov word ptr DevCmdLine, si ; save it for ourself
+ mov word ptr DevCmdLine+2, es
+
+ call round
+
+ call SizeDevice
+ jc BadFile
+
+ call InitDevLoad
+
+ mov ax, DevLoadAddr
+ add ax, DevSize
+ jc NoMem
+ cmp DevLoadEnd, ax
+ jae LoadDev
+
+NoMem:
+ jmp mem_err
+
+BadFile:
+ cmp byte ptr es:[si], cr
+ jne @f
+ jmp badop
+@@:
+ call badload
+ jmp coff
+
+LoadDev:
+ push es
+ pop ds
+ assume ds:nothing
+ mov dx,si ;ds:dx points to file name
+
+ if noexec
+ les bx,dword ptr cs:[memlo]
+ call ldfil ;load in the device driver
+
+ else
+
+ call ExecDev ; load device driver using exec call
+
+ endif
+
+badldreset:
+ push ds
+ pop es ;es:si back to config.sys
+ push cs
+ pop ds ;ds back to sysinit
+ jc BadFile
+goodld:
+ push es
+ push si ; ???
+
+ call RemoveNull
+
+ push es
+ push si
+
+ push cs
+ pop es
+
+
+;NTVDM: block device drivers are not supported.
+; Putup user warning popup for unsupported device driver
+; 29-Sep-1992 Jonle
+;
+ push ds
+ push si
+ lds si, DevEntry ; peek the header attribute
+ test word ptr ds:[si.sdevatt],devtyp ; IS block device driver?
+ pop si
+ pop ds
+ jnz got_device_com_cont ; no!
+
+ pop si ;clear the stack
+ pop es
+
+ mov ax, NOSUPPORT_DRIVER
+ BOP BOP_NOSUPPORT
+ jmp short erase_dev_do
+
+got_device_com_cont:
+
+ call LieInt12Mem
+ call UpdatePDB ; update the PSP:2 value M020
+
+ cmp cs:multdeviceflag, 0 ; Pass limit only for the 1st device
+ ; driver in the file ; M027
+ jne skip_pass_limit ; ; M027
+
+ mov word ptr break_addr, 0 ; pass the limit to the DD
+ mov bx, DevLoadEnd
+ mov word ptr break_addr+2, bx
+skip_pass_limit: ; M027
+ mov bx,sdevstrat
+ call calldev ; calldev (sdevstrat);
+ mov bx,sdevint
+ call calldev ; calldev (sdevint);
+
+ call TrueInt12Mem
+
+ mov ax, word ptr break_addr ; move break addr from the req packet
+ mov word ptr DevBrkAddr, ax
+ mov ax, word ptr break_addr+2
+ mov word ptr DevBrkAddr+2, ax
+
+ assume ds:nothing
+
+ cmp DevUMB, 0
+ jz @f
+ call AllocUMB
+@@:
+
+;
+;------ If we are waiting to be moved into hma lets try it now !!!
+;
+ cmp runhigh, 0ffh
+ jne @f
+
+ call TryToMovDOSHi ; move DOS into HMA if reqd
+@@:
+
+ pop si
+ pop ds
+ mov byte ptr [si],0 ; *p = 0;
+
+ push cs
+ pop ds
+
+ jmp short was_device_com
+
+
+erase_dev_do: ; modified to show message "error in config.sys..."
+ pop si
+ pop es
+
+ push cs
+ pop ds
+
+; test [setdevmarkflag],setbrkdone ;if already set_break is done,
+; jnz skip1_resetmemhi ; then do not
+; dec [memhi] ;adjust memhi by a paragrah of devmark.
+
+skip1_resetmemhi:
+ cmp configmsgflag,0
+ je no_error_line_msg
+
+ call error_line ; no "error in config.sys" msg for device driver. dcr d493
+ mov configmsgflag,0 ;set the default value again.
+
+no_error_line_msg:
+ jmp coff
+;
+;----------------------------------------------------------------------------
+;
+was_device_com:
+ mov ax,word ptr [DevBrkAddr+2]
+ cmp ax,DevLoadEnd
+ jbe breakok
+
+ pop si
+ pop es
+ jmp BadFile
+
+breakok:
+ lds si,DevEntry ;ds:si points to header
+ les di,cs:[dosinfo] ;es:di point to dos info
+ mov ax,ds:[si.sdevatt] ;ax Dev attributes
+;
+;------ lets deal with character devices,
+; NTVDM: removed check for block drivers, jonle
+;
+ischardev:
+ or cs:[setdevmarkflag],for_devmark
+ call DevSetBreak ; go ahead and alloc mem for device
+ jc erase_dev_do ;device driver's init routine failed.
+
+ test ax,iscin ;is it a console in?
+ jz tryclk
+
+ mov word ptr es:[di.sysi_con],si
+ mov word ptr es:[di.sysi_con+2],ds
+
+tryclk: test ax,isclock ;is it a clock device?
+ jz linkit
+
+ mov word ptr es:[di+sysi_clock],si
+ mov word ptr es:[di+sysi_clock+2],ds
+
+linkit:
+
+ mov cx,word ptr es:[di.sysi_dev] ;dx:cx = head of list
+ mov dx,word ptr es:[di.sysi_dev+2]
+
+ mov word ptr es:[di.sysi_dev],si ;set head of list in dos
+ mov word ptr es:[di.sysi_dev+2],ds
+ mov ax,ds:[si] ;get pointer to next device
+ mov word ptr cs:[DevEntry],ax ;and save it
+
+ mov word ptr ds:[si],cx ;link in the driver
+ mov word ptr ds:[si+2],dx
+
+enddev:
+ pop si
+ pop es
+ inc ax ;ax = ffff (no more devs if yes)?
+ jz coffj3
+
+ inc cs:multdeviceflag ; possibly multiple device driver.
+ call DevBreak ; M009
+ jmp goodld ; otherwise pretend we loaded it in
+
+coffj3: mov cs:multdeviceflag,0 ; reset the flag
+ call DevBreak
+ jmp coff
+
+bad_bpb_size_sector:
+ pop si
+ pop es
+ mov dx,offset badsiz_pre
+ mov bx,offset crlfm
+ call prnerr
+
+; test [setdevmarkflag],setbrkdone ;if already set_break is done,
+; jnz skip2_resetmemhi ; then do not
+; dec [memhi] ;adjust memhi by a paragrah of devmark.
+
+skip2_resetmemhi:
+ jmp coff
+
+
+;------------------------------------------------------------------------------
+; country command
+; the syntax is:
+; country=country id {,codepage {,path}}
+; country=country id {,,path} :default codepage id in dos
+;------------------------------------------------------------------------------
+
+tryq:
+ cmp ah,'Q'
+ jz tryq_cont
+ jmp tryf
+tryq_cont:
+
+ mov cntry_drv,0 ; reset the drive,path to default value.
+ mov p_code_page,0
+ mov di,offset cntry_parms
+ xor cx,cx
+ mov dx,cx
+do52:
+ call sysinit_parse
+ jnc if52 ; parse error,check error code and
+
+ call cntry_error ; show message and end the search loop.
+ mov p_cntry_code,-1 ; signals that parse error.
+ jmp short sr52
+
+if52:
+ cmp ax,$p_rc_eol ; end of line?
+ jz sr52 ; then end the search loop
+
+ cmp result_val.$p_type,$p_number ; numeric?
+ jnz if56
+
+ mov ax,word ptr result_val.$p_picked_val
+ cmp cx,1
+ jnz if57
+
+ mov p_cntry_code,ax
+ jmp short en57
+
+if57:
+ mov p_code_page,ax
+en57:
+ jmp short en56 ; path entered
+
+if56:
+ push ds
+ push es
+ push si
+ push di
+
+ push cs
+ pop es
+
+ lds si,rv_dword ; move the path to known place.
+ mov di,offset cntry_drv
+ call move_asciiz
+
+ pop di
+ pop si
+ pop es
+ pop ds
+
+en56:
+ jmp do52
+
+sr52:
+ cmp p_cntry_code,-1 ; had a parse error?
+ jne tryq_open
+ jmp coff
+
+tryqbad: ;"invalid country code or code page"
+ stc
+ mov dx,offset badcountry
+ jmp tryqchkerr
+
+tryq_open:
+ cmp cntry_drv,0
+ je tryq_def
+ mov dx,offset cntry_drv
+ jmp short tryq_openit
+
+tryq_def:
+ mov dx,offset cntry_root
+tryq_openit:
+ mov ax,3d00h ;open a file
+ stc
+ int 21h
+ jc tryqfilebad ;open failure
+
+ mov cs:cntryfilehandle,ax ;save file handle
+ mov bx,ax
+ mov ax,cs:p_cntry_code
+ mov dx,cs:p_code_page ; now,ax=country id,bx=filehandle
+ mov cx,cs:[memhi]
+ add cx,384 ; need 6k buffer to handle country.sys
+ ; M023
+ cmp cx,cs:[alloclim]
+ ja tryqmemory ;cannot allocate the buffer for country.sys
+
+ mov si,offset cntry_drv ;ds:si -> cntry_drv
+ cmp byte ptr [si],0 ;default path?
+ jne tryq_set_for_dos
+
+ inc si
+ inc si ;ds:si -> cntry_root
+
+tryq_set_for_dos:
+ les di,cs:sysi_country ;es:di -> country info tab in dos
+ push di ;save di
+ add di,ccpath_countrysys
+ call move_asciiz ;set the path to country.sys in dos.
+ pop di ;es:di -> country info tab again.
+
+ mov cx,cs:[memhi]
+ mov ds,cx
+ xor si,si ;ds:si -> 2k buffer to be used.
+ call setdoscountryinfo ;now do the job!!!
+ jnc tryqchkerr ;read error or could not find country,code page combination
+
+ cmp cx,-1 ;could not find matching country_id,code page?
+ je tryqbad ;then "invalid country code or code page"
+
+tryqfilebad:
+ push cs
+ pop es
+ cmp cs:cntry_drv,0 ;is the default file used?
+ je tryqdefbad
+
+ mov si,offset cntry_drv
+ jmp short tryqbadload
+
+tryqdefbad: ;default file has been used.
+ mov si,offset cntry_root ;es:si -> \country.sys in sysinit_seg
+tryqbadload:
+ call badload ;ds will be restored to sysinit_seg
+ mov cx,cs:[confbot]
+ mov es,cx ;restore es -> confbot.
+ jmp short coffj4
+
+tryqmemory:
+ mov dx,offset insufmemory
+tryqchkerr:
+ mov cx,cs:[confbot]
+ mov es,cx ;restore es -> confbot seg
+ push cs
+ pop ds ;retore ds to sysinit_seg
+ jnc coffj4 ;if no error,then exit
+
+ call print ;else show error message
+ call error_line
+
+coffj4:
+ mov bx,cntryfilehandle
+ mov ah,3eh
+ int 21h ;close a file. don't care even if it fails.
+ jmp coff
+
+cntry_error proc near
+
+;function: show "invalid country code or code page" messages,or
+; "error in country command" depending on the error code
+; in ax returned by sysparse;
+;in: ax - error code
+; ds - sysinitseg
+; es - confbot
+;out: show message. dx destroyed.
+
+ cmp ax,$p_out_of_range
+ jnz if64
+ mov dx,offset badcountry ;"invalid country code or code page"
+ jmp short en64
+
+if64:
+ mov dx,offset badcountrycom ;"error in contry command"
+en64:
+ call print
+ call error_line
+ ret
+cntry_error endp
+
+;------------------------------------------------------------------------------
+; files command
+;------------------------------------------------------------------------------
+;*******************************************************************************
+; function: parse the parameters of files= command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; variable files set. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to files_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; files = result_val.$p_picked_val *
+; else *
+; error exit; *
+; }; *
+; }; *
+; *
+;*******************************************************************************
+tryf:
+ cmp ah,'F'
+ jnz tryl
+
+ mov di,offset files_parms
+ xor cx,cx
+ mov dx,cx
+
+do67:
+ call sysinit_parse
+ jnc if67 ; parse error
+ call badparm_p ; and show messages and end the search loop.
+ jmp short sr67
+
+if67:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en67 ; then end the $endloop
+ mov al,byte ptr result_val.$p_picked_val
+ mov p_files,al ; save it temporarily
+ jmp short do67
+
+en67:
+ mov al,p_files
+ SVC SVC_DEMWOWFILES ; For WOW VDM Set the file= to max.
+ mov files,al ; no error. really set the value now.
+
+sr67:
+ jmp coff
+
+;------------------------------------------------------------------------------
+; lastdrive command
+;------------------------------------------------------------------------------
+;*******************************************************************************
+; function: parse the parameters of lastdrive= command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; set the variable num_cds. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to ldrv_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; set num_cds to the returned value; *
+; else /*error exit*/ *
+; error exit; *
+; }; *
+; }; *
+; *
+;*******************************************************************************
+
+tryl:
+ cmp ah,'L'
+ jnz tryp
+ jmp coff
+
+;NTVDM Ignore the lastdrive command. Dos will figure this from the host OS.
+; 17-Aug-1992 Jonle
+if 0
+
+ mov di,offset ldrv_parms
+ xor cx,cx
+ mov dx,cx
+
+do73:
+ call sysinit_parse
+ jnc if73 ; parse error
+ call badparm_p ; and show messages and end the search loop.
+ jmp short sr73
+
+if73:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en73 ; then end the $endloop
+ mov al,rv_byte ; pick up the drive number
+ mov p_ldrv,al ; save it temporarily
+ jmp do73
+
+en73:
+ mov al,p_ldrv
+ mov num_cds,al ; no error. really set the value now.
+sr73:
+ jmp coff
+endif
+
+
+;--------------------------------------------------------------------------
+; setting drive parameters
+;--------------------------------------------------------------------------
+
+tryp:
+ cmp ah,'P'
+ jnz tryk
+ jmp coff
+
+; sudeepb 04-Mar-1991 : Ignoring DRIVEPARM command
+; call parseline
+; jc trypbad
+;
+; call setparms
+; call diddleback
+; jc trypbad
+; jmp coff
+;trypbad:jmp badop
+
+;--------------------------------------------------------------------------
+; setting internal stack parameters
+; stacks=m,n where
+; m is the number of stacks (range 8 to 64,default 9)
+; n is the stack size (range 32 to 512 bytes,default 128)
+; j.k. 5/5/86: stacks=0,0 implies no stack installation.
+; any combinations that are not within the specified limits will
+; result in "unrecognized command" error.
+;--------------------------------------------------------------------------
+
+;****************************************************************************
+; *
+; function: parse the parameters of stacks= command. *
+; the minimum value for "number of stacks" and "stack size" is *
+; 8 and 32 each. in the definition of sysparse value list,they *
+; are set to 0. this is for accepting the exceptional case of *
+; stacks=0,0 case (,which means do not install the stack.) *
+; so,after sysparse is done,we have to check if the entered *
+; values (stack_count,stack_size) are within the actual range, *
+; (or if "0,0" pair has been entered.) *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; set the variables stack_count,stack_size. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to stks_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; { if (cx == 1) then /* first positional = stack count */ *
+; p_stack_count = result_val.$p_picked_val; *
+; if (cx == 2) then /* second positional = stack size */ *
+; p_stack_size = result_val.$p_picked_val; *
+; } *
+; else /*error exit*/ *
+; error exit; *
+; }; *
+; here check p_stack_count,p_stack_size if it meets the condition; *
+; if o.k.,then set stack_count,stack_size; *
+; else error_exit; *
+; }; *
+;****************************************************************************
+
+tryk:
+ cmp ah,'K'
+ je do_tryk
+ jmp trys
+
+ if stacksw
+
+do_tryk:
+ mov di,offset stks_parms
+ xor cx,cx
+ mov dx,cx
+
+do79:
+ call sysinit_parse
+ jnc if79 ; parse error
+
+ mov dx,offset badstack ; "invalid stack parameter"
+ call print ; and show messages and end the search loop.
+ call error_line
+ jmp sr79
+
+if79:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en79 ; then end the $endloop
+
+ mov ax,word ptr result_val.$p_picked_val
+ cmp cx,1
+ jnz if83
+
+ mov p_stack_count,ax
+ jmp short en83
+
+if83:
+ mov p_stack_size,ax
+en83:
+ jmp do79
+
+en79:
+ cmp p_stack_count,0
+ jz if87
+
+ cmp p_stack_count,mincount
+ jb ll88
+ cmp p_stack_size,minsize
+ jnb if88
+
+ll88:
+ mov p_stack_count,-1 ; invalid
+if88:
+ jmp short en87
+
+if87:
+ cmp p_stack_size,0
+ jz en87
+ mov p_stack_count,-1 ; invalid
+en87:
+ cmp p_stack_count,-1 ; invalid?
+ jnz if94
+
+ mov stack_count,defaultcount ;reset to default value.
+ mov stack_size,defaultsize
+ mov word ptr stack_addr,0
+
+ mov dx,offset badstack
+ call print
+ call error_line
+ jmp short sr79
+
+if94:
+ mov ax,p_stack_count
+ mov stack_count,ax
+ mov ax,p_stack_size
+ mov stack_size,ax
+ mov word ptr stack_addr,-1 ; stacks= been accepted.
+sr79:
+ jmp coff
+
+ endif
+
+;------------------------------------------------------------------------
+; shell command
+;------------------------------------------------------------------------
+
+trys:
+ cmp ah,'S'
+ jnz tryx
+
+ mov [command_line+1],0
+ mov di,offset commnd + 1
+ mov [di-1],al
+
+storeshell:
+ call getchr
+ or al,al
+ jz getshparms
+
+ cmp al," "
+ jb endsh
+
+ mov [di],al
+ inc di
+ jmp storeshell
+
+endsh:
+ mov byte ptr [di],0
+; push di
+; mov di,offset commnd
+; SVC SVC_SETSHELLNAME
+; pop di
+
+ call getchr
+ cmp al,lf
+ jnz conv
+
+ call getchr
+conv: jmp conflp
+
+getshparms:
+ mov byte ptr [di],0
+ mov di,offset command_line+1
+
+parmloop:
+ call getchr
+ cmp al," "
+ jb endsh
+ mov [di],al
+ inc di
+ jmp parmloop
+
+;------------------------------------------------------------------------
+; fcbs command
+;------------------------------------------------------------------------
+
+;************************************************************************
+; function: parse the parameters of fcbs= command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; set the variables fcbs,keep. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to fcbs_parms; *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysparse; *
+; if (no error) then *
+; { if (cx == 1) then /* first positional = fcbs */ *
+; fcbs = result_val.$p_picked_val; *
+; if (cx == 2) then /* second positional = keep */ *
+; keep = result_val.$p_picked_val; *
+; } *
+; else /*error exit*/ *
+; error exit; *
+; }; *
+; }; *
+;************************************************************************
+
+tryx:
+ cmp ah,'X'
+ jnz tryy
+
+ mov di,offset fcbs_parms
+ xor cx,cx
+ mov dx,cx
+
+do98:
+ call sysinit_parse
+ jnc if98 ; parse error
+ call badparm_p ; and show messages and end the search loop.
+ jmp short sr98
+
+if98:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en98 ; then end the $endloop
+
+ mov al,byte ptr result_val.$p_picked_val
+ cmp cx,1 ; the first positional?
+ jnz if102
+ mov p_fcbs,al
+ jmp short en102
+
+if102:
+ mov p_keep,al
+en102:
+ jmp do98
+
+en98:
+ mov al,p_fcbs ; M017
+ mov fcbs,al ; M017
+ mov keep,0 ; M017
+sr98:
+ jmp coff
+
+;-------------------------------------------------------------------------
+; comment= do nothing. just decrese chrptr,and increase count for correct
+; line number
+;-------------------------------------------------------------------------
+
+tryy:
+ cmp ah,'Y'
+ jne try0
+
+donothing:
+ dec chrptr
+ inc count
+ jmp coff
+
+;------------------------------------------------------------------------
+; rem command
+;------------------------------------------------------------------------
+
+try0: ;do nothing with this line.
+ cmp ah,'0'
+ je donothing
+
+;-----------------------------------------------------------------------
+; switches command
+;-----------------------------------------------------------------------
+;****************************************************************************
+; *
+; function: parse the option switches specified. *
+; note - this command is intended for the future use also. when we need to *
+; to set system data flag,use this command. *
+; *
+; input : *
+; es:si -> parameters in command line. *
+; output: *
+; p_swit_k set if /k option chosen. *
+; *
+; subroutines to be called: *
+; sysinit_parse *
+; logic: *
+; { *
+; set di points to swit_parms; /*parse control definition*/ *
+; set dx,cx to 0; *
+; while (end of command line) *
+; { sysinit_parse; *
+; if (no error) then *
+; if (result_val.$p_synonym_ptr == swit_k) then *
+; p_swit_k = 1 *
+; endif *
+; else {show error message;error exit} *
+; }; *
+; }; *
+; *
+;****************************************************************************
+
+ cmp ah,'1' ;switches= command entered?
+ je do_try1
+ jmp tryt
+do_try1:
+ mov di,offset swit_parms
+ xor cx,cx
+ mov dx,cx
+
+do110:
+ call sysinit_parse
+ jnc if110 ; parse error
+ call badparm_p ; and show messages and end the search loop.
+ jmp short sr110
+
+if110:
+ cmp ax,$p_rc_eol ; end of line?
+ jz en110 ; then jmp to $endloop for semantic check
+
+ cmp result_val.$p_synonym_ptr,offset swit_k
+ jnz if115 ; ;M059
+ mov p_swit_k,1 ; set the flag
+ jmp do110
+if115: ;M059
+ cmp result_val.$p_synonym_ptr, offset swit_t ;M059
+ jne if116 ;M059 M063
+ mov p_swit_t, 1 ;M059
+ jmp do110 ;M059
+if116:
+ cmp result_val.$p_synonym_ptr, offset swit_w ;M063
+ jne do110 ;M063
+ mov p_swit_w, 1 ;M063
+ jmp do110 ;M063
+en110:
+ cmp p_swit_k,1 ;if /k entered,
+
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+ jnz if117
+ mov keyrd_func,0 ;use the conventional keyboard functions
+ mov keysts_func,1
+if117:
+; mov al, p_swit_t ;M059
+; mov t_switch, al ;M059
+
+ cmp p_swit_w, 0 ;M063
+ je skip_dos_flag ;M063
+ push es
+ push bx
+ mov ah, GET_IN_VARS ;M063
+ int 21h ;M063
+ or byte ptr es:[DOS_FLAG_OFFSET], SUPPRESS_WINA20 ;M063
+ pop bx
+ pop es
+skip_dos_flag: ;M063
+ pop ds
+ assume ds:sysinitseg
+
+sr110:
+ jmp coff
+
+;------------------------------------------------------------------------
+; NTCMDPROMPT command. This command forces SCS functionality to use
+; cmd.exe prompt rather than command.com's prompt on shelling out
+; and on finding a TSR.
+;------------------------------------------------------------------------
+tryt:
+ cmp ah,'T'
+ je tryt_5
+ jmp short tryo
+
+tryt_5:
+ push si
+ push bp
+ xor ax,ax
+ mov bp,ax
+ mov si,ax
+ mov al,4
+ mov ah,setdpb
+ int 21h
+ pop bp
+ pop si
+ jmp coff
+
+;------------------------------------------------------------------------
+; DOSONLY command. This command forces only DOS binaries to run from
+; command.com prompt. non_dos binaries will putup the stub message
+; of unable to run it under DOS.
+;------------------------------------------------------------------------
+tryo:
+ cmp ah,'O'
+ je tryo_5
+ jmp short tryz
+
+tryo_5:
+ push si
+ push bp
+ xor ax,ax
+ mov bp,ax
+ mov si,ax
+ mov al,6
+ mov ah,setdpb
+ int 21h
+ pop bp
+ pop si
+ jmp coff
+
+;------------------------------------------------------------------------
+; bogus command
+;------------------------------------------------------------------------
+
+tryz:
+ cmp ah,0ffh
+ je tryff
+
+ dec chrptr
+ inc count
+ jmp short badop
+
+;------------------------------------------------------------------------
+; null command
+;------------------------------------------------------------------------
+
+tryff: ;skip this command.
+ jmp donothing
+
+doconf endp
+
+;------------------------------------------------------------------------------
+
+sysinit_parse proc
+;set up registers for sysparse
+;in) es:si -> command line in confbot
+; di -> offset of the parse control defintion.
+;
+;out) calls sysparse.
+; carry will set if parse error.
+; *** the caller should check the eol condition by looking at ax
+; *** after each call.
+; *** if no parameters are found,then ax will contain a error code.
+; *** if the caller needs to look at the synomym@ of the result,
+; *** the caller should use cs:@ instead of es:@.
+; cx register should be set to 0 at the first time the caller calls this
+; procedure.
+; ax - exit code
+; bl - terminated delimeter code
+; cx - new positional ordinal
+; si - set to pase scanned operand
+; dx - selected result buffer
+
+ push es ;save es,ds
+ push ds
+
+ push es
+ pop ds ;now ds:si -> command line
+
+ push cs
+ pop es ;now es:di -> control definition
+
+ mov cs:badparm_seg,ds ;save the pointer to the parm
+ mov cs:badparm_off,si ; we are about to parse for badparm msg.
+ mov dx,0
+ call sysparse
+ cmp ax,$p_no_error ;no error
+
+;**cas note: when zero true after cmp, carry clear
+
+ jz ll4
+ cmp ax,$p_rc_eol ;or the end of line?
+ jnz if4
+
+ll4:
+ clc
+ jmp short en4
+
+if4:
+ stc
+en4:
+ pop ds
+ pop es
+ ret
+sysinit_parse endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : badop_p
+;
+; same thing as badop,but will make sure to set ds register back
+; to sysinitseg and return back to the caller.
+;
+;----------------------------------------------------------------------------
+;
+badop_p proc near
+
+
+ push cs
+ pop ds ;set ds to configsys seg.
+ mov dx,offset badopm
+ call print
+ call error_line
+ ret
+
+badop_p endp
+;
+;----------------------------------------------------------------------------
+;
+; label : badop
+;
+;----------------------------------------------------------------------------
+;
+badop: mov dx,offset badopm ;want to print command error "unrecognized command..."
+ call print
+ call error_line ;show "error in config.sys ..." .
+ jmp coff
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : badparm_p
+;
+; show "bad command or parameters - xxxxxx"
+; in badparm_seg,badparm_off -> xxxxx
+;
+;----------------------------------------------------------------------------
+;
+badparm_p proc near
+
+
+ push ds
+ push dx
+ push si
+
+ push cs
+ pop ds
+
+ mov dx,offset badparm
+ call print ;"bad command or parameters - "
+ lds si,badparm_ptr
+
+; print "xxxx" until cr.
+
+do1:
+ mov dl,byte ptr [si] ; get next character
+ cmp dl,cr ; is a carriage return?
+ jz en1 ; exit loop if so
+
+ mov ah,std_con_output ; function 2
+ int 21h ; display character
+ inc si ; next character
+ jmp do1
+en1:
+ push cs
+ pop ds
+
+ mov dx,offset crlfm
+ call print
+ call error_line
+
+ pop si
+ pop dx
+ pop ds
+badparmp_ret:
+ ret
+badparm_p endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : getchr
+;
+;----------------------------------------------------------------------------
+;
+getchr proc near
+ push cx
+ mov cx,count
+ jcxz nochar
+
+ mov si,chrptr
+ mov al,es:[si]
+ dec count
+ inc chrptr
+ clc
+get_ret:
+ pop cx
+ ret
+
+nochar: stc
+ jmp short get_ret
+getchr endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : incorrect_order
+;
+; show "incorrect order in config.sys ..." message.
+;
+;----------------------------------------------------------------------------
+;
+
+incorrect_order proc near
+
+ mov dx,offset badorder
+ call print
+ call showlinenum
+ ret
+
+incorrect_order endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : error_line
+;
+; show "error in config.sys ..." message.
+;
+;----------------------------------------------------------------------------
+;
+ public error_line
+error_line proc near
+
+
+ push cs
+ pop ds
+ mov dx,offset errorcmd
+ call print
+ call showlinenum
+ ret
+
+error_line endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : showlinenum
+;
+; convert the binary linecount to decimal ascii string in showcount
+;and display showcount at the current curser position.
+;in.) linecount
+;
+;out) the number is printed.
+;
+;----------------------------------------------------------------------------
+;
+showlinenum proc near
+
+
+ push es
+ push ds
+ push di
+
+ push cs
+ pop es ; es=cs
+
+ push cs
+ pop ds
+
+ mov di,offset showcount+4 ; di -> the least significant decimal field.
+ mov cx,10 ; decimal devide factor
+ mov ax,cs:linecount
+
+sln_loop:
+ cmp ax,10 ; < 10?
+ jb sln_last
+
+ xor dx,dx
+ div cx
+ or dl,30h ; add "0" (= 30h) to make it an ascii.
+ mov [di],dl
+ dec di
+ jmp sln_loop
+
+sln_last:
+ or al,30h
+ mov [di],al
+ mov dx,di
+ call print ; show it.
+ pop di
+ pop ds
+ pop es
+ ret
+showlinenum endp
+
+comment ^
+set_devmark proc near
+;***************************************************************************
+; function: set a paragraph of informations infront of a device file or *
+; an ifs file to be loaded for mem command. *
+; the structure is: *
+; devmark_id byte "d" for device,"i" for ifs *
+; devmark_size size in para for the device loaded *
+; devmark_filename 11 bytes. filename *
+; *
+; input : *
+; [memhi] = address to set up devmark. *
+; [memlo] = 0 *
+; es:si -> pointer to [drive][path]filename,0 *
+; [ifs_flag] = is_ifs bit set if ifs= command. *
+; *
+; output: devmark_id,devmark_filename set *
+; cs:[devmark_addr] set. *
+; ax,cx register destroyed. *
+;***************************************************************************
+
+ push ds
+ push si
+ push es
+ push di
+
+ mov di,cs:[memhi]
+ mov ds,di
+ assume ds:nothing
+ mov [devmark_addr],di ; save the devmark address for the future.
+ mov ds:[devmark_id],devmark_device ; 'd'
+ inc di
+ mov ds:[devmark_seg],di
+ xor al,al
+ push si
+ pop di ; now es:si = es:di = [path]filename,0
+ mov cx,128 ; maximum 128 char
+ repnz scasb ; find 0
+ dec di ; now es:di-> 0
+sdvmk_backward: ; find the pointer to the start of the filename.
+ mov al,byte ptr es:[di] ; we do this by check es:di backward until
+ cmp al,'\' ; di = si or di -> '\' or di -> ':'.
+ je sdvmk_gotfile
+ cmp al,':'
+ je sdvmk_gotfile
+ cmp di,si
+ je sdvmk_fileptr
+ dec di
+ jmp sdvmk_backward
+sdvmk_gotfile:
+ inc di
+sdvmk_fileptr: ; now es:di -> start of file name
+ push di ; cas - holy sh*t!!! CODE!
+ pop si ; save di to si.
+
+ push ds ; switch es,ds
+ push es
+ pop ds
+ pop es ; now,ds:si -> start of filename
+
+ mov di,devmark_filename
+ push di
+ mov al,' '
+ mov cx,8
+ rep stosb ; clean up memory.
+ pop di
+ mov cx,8 ; max 8 char. only
+sdvmk_loop:
+ lodsb
+ cmp al,'.'
+ je sdvmk_done
+ cmp al,0
+ je sdvmk_done
+ stosb
+ loop sdvmk_loop
+
+sdvmk_done:
+ pop di
+ pop es
+ pop si
+ pop ds
+ ret
+set_devmark endp
+^
+; =========================================================================
+;reset_dos_version proc near
+;
+;;function: issue ax=122fh,dx=0,int 2fh to restore the dos version.
+;
+; push ax
+; push dx
+; mov ax,122fh
+; mov dx,0
+; int 2fh
+; pop dx
+; pop ax
+; ret
+;reset_dos_version endp
+;
+;
+; =========================================================================
+
+IFDEF DONT_LOAD_OS2_DD ; M045
+
+EXE_SIG EQU 5a4dh ; .EXE file signature
+OS2_SIG EQU 454eh ; OS2 .EXE file signature
+
+SIGNATURE_LEN EQU 2 ; Lenght of .EXE signature in bytes
+SIZE_DWORD EQU 4
+
+SEG_SIG_OFFSET EQU 18h ; Offset of segmented .EXE signature
+SEG_EXE_SIG EQU 40h ; Signature of a segmented .EXE file
+SEG_HEADER_PTR EQU 3ch ; Offsets of ptr to segmented header
+
+; =========================================================================
+; CheckForOS2 PROC
+;
+; Examines an open file to see if it is really an OS2 executable file.
+;
+; REGISTERS: AX - Open file handle
+; RETURNS: Carry - Carry set if file is an OS2 executable or error.
+; DESTROYS: NOTHING
+; NOTE: The file ptr is assumed to be set to start of file
+; on entry and is not reset to begining of the file
+; on exit.
+;
+; Strategy: If word value at 00h == 454eh file is OS2
+; else if word value at 00h == 5a4dh and
+; (word value at 18h == 40h and the dword ptr at 3ch
+; points to word value of 454eh) file is OS2.
+;
+; =========================================================================
+
+CheckForOS2 PROC NEAR
+
+ push AX
+ push BX
+ push CX
+ push DX
+ push DS
+ push BP
+
+ push CS ; BUGBUG
+ pop DS ; NOT ROM DOS COMPATIBLE
+
+ mov BX,AX ; Put open file handle in BX
+ mov BP,offset DS:Os2ChkBuf ; Save buff offset for latter
+
+ ; First we need to read in the first 2 bytes of the file
+ ; to see if it's an OS2 .EXE file and if not see if
+ ; it is a DOS .EXE file.
+
+ mov AX,(read shl 8) ; AH = DOS read function
+ mov CX,SIGNATURE_LEN ; CX = size of word value
+ mov DX,BP ; DS:DX --> tmp buffer
+ int 21h
+ jc OS2ChkExit ; Return carry on error
+
+ dec AX ; Check number of byte read
+ dec AX
+ jnz NotOs2 ; Must be at end of file
+
+ mov AX, WORD PTR DS:Os2ChkBuf
+ cmp AX, OS2_SIG ; Check for 454eh
+ je IsOS2 ; Return is OS2 if match
+ cmp AX, EXE_SIG ; Now see if it's a DOS .EXE
+ jne NotOS2 ; If no match can't be OS2
+
+ ; Here we know the file has a valid DOS .EXE signature so
+ ; now we need to see if it's a segmented .EXE file by looking
+ ; for the segmented .EXE signature at file offset 18h
+
+ mov AX,(lseek shl 8) ; AX = Seek from begining
+ xor CX,CX
+ mov DX,SEG_SIG_OFFSET ; CX:DX = offset of segmented
+ int 21h ; Seek to offset 18h
+ jc OS2ChkExit ; Return carry on error
+
+ mov AX,read shl 8 ; AX = Read file
+ mov CX,SIGNATURE_LEN ; CX = size of word value
+ mov DX,BP ; Restore buffer offset
+ int 21h ; DS:DX -> buffer
+ jc OS2ChkExit ; Return carry on error
+
+ dec AX ; Check number of byte read
+ dec AX
+ jnz NotOs2 ; Must be at end of file
+
+ cmp WORD PTR DS:Os2ChkBuf,SEG_EXE_SIG ; Chk for segmented .EXE file
+ jne NotOS2 ; Can't be OS2 if no match
+
+ ; Here we know we have a segmented .EXE file so we have
+ ; to get the offset of the start of the segmented header
+ ; from offset 3ch in the file.
+
+ mov AX,(lseek shl 8) ; AX = Seek from begining
+ xor CX,CX
+ mov DX,SEG_HEADER_PTR ; CX:DX = offset of head ptr
+ int 21h ; Seek to offset 3ch
+ jc OS2ChkExit ; Return carry on error
+
+ mov AX,(read shl 8) ; AX = Read file
+ mov CX,SIZE_DWORD ; CX = size of dword (4 bytes)
+ mov DX,BP ; Restore buffer offset
+ int 21h ; Read in 4 byte offset
+ jc OS2ChkExit ; Return carry on error
+
+ cmp AX,SIZE_DWORD ; Check number of byte read
+ jne NotOs2 ; Must be at end of file
+
+ ; At this point OS2ChkBuf has a 4 byte offset into the file
+ ; to the start of a segmented .EXE header so we need to read
+ ; the 2 bytes at this location to see if they are 454eh
+
+ mov DX,WORD PTR DS:Os2ChkBuf
+ mov CX,WORD PTR DS:Os2ChkBuf[2] ; CX:DX = offset of new header
+ mov AX,(lseek shl 8) ; AX = Seek from begining
+ int 21h ; Seek to offset 3ch
+ jc OS2ChkExit ; Return carry on error
+
+ mov AX,(read shl 8) ; AX = Read file
+ mov CX,SIGNATURE_LEN ; CX = size of word (2 bytes)
+ mov DX,BP ; DS:DX --> Os2ChkBuf
+ int 21h ; Read in 4 byte offset
+ jc OS2ChkExit ; Return carry on error
+
+ dec AX ; Check number of byte read
+ dec AX
+ jnz NotOs2 ; Must be at end of file
+
+ ; We have the segmented .EXE header in OS2ChkBuf so all
+ ; we have left to do is see if it's a .EXE signature.
+
+ cmp WORD PTR DS:OS2ChkBuf,OS2_SIG ; Check for 454eh
+ jne NotOs2 ; Not OS2 if it doesn't match
+
+IsOs2:
+ stc ; Signal error or OS2 .EXE
+ jmp SHORT OS2ChkExit
+NotOs2:
+ clc ; Signal no err and not OS2
+
+OS2ChkExit:
+ pop BP
+ pop DS
+ pop DX
+ pop CX
+ pop BX
+ pop AX
+ ret
+
+CheckForOS2 ENDP
+
+ENDIF ; M045
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : ProcDOS
+;
+; Process the result of DOS= parsing
+;
+; result_val.$p_item_tag = 1 for DOS=HIGH
+; = 2 for DOS=LOW
+; = 3 for DOS=UMB
+; = 4 for DOS=NOUMB
+;----------------------------------------------------------------------------
+;
+ProcDOS proc near
+ assume ds:nothing, es:nothing
+ xor ah, ah
+ mov al, result_val.$p_item_tag
+ dec ax
+ jz pd_hi
+ dec ax
+ jz pd_lo
+ dec ax
+ jz pd_umb
+ mov DevUMB, 0
+ ret
+pd_umb:
+ mov DevUMB, 0ffh
+ ret
+pd_lo:
+ mov runhigh, 0
+ ret
+pd_hi:
+ mov runhigh, 0ffh
+ ret
+ProcDOS endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : LieInt12Mem
+;
+; Input : DevEntry points to Device Start address (offset == 0)
+; alloclim set to the limit of low memory.
+;
+; Output : none
+;
+; Changes the ROM BIOS variable which stores the total low memory
+; If a 3com device driver (any character device with name 'PROTMAN$')
+; is being loaded alloclim is converted into Ks and stored in 40:13h
+; Else if a device driver being loaded into UMB the DevLoadEnd is
+; converted into Ks and stored in 40:13h
+;
+;----------------------------------------------------------------------------
+;
+LieInt12Mem proc near
+
+ assume ds:nothing, es:nothing
+
+ mov ax, alloclim ; lie INT 12 as alloclim
+ ; assuming that it is 3Com
+ call IsIt3Com? ; Is it 3Com driver?
+ je lim_set ; yes, lie to him differently
+ cmp DeviceHi, 0 ; Is the DD being loaded in UMB
+ je limx ; no, don't lie
+ mov ax, DevLoadEnd ; lie INT 12 as end of UMB
+lim_set:
+ call SetInt12Mem
+limx:
+ ret
+LieInt12Mem endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : SetInt12Mem
+;
+; Input : AX = Memory size to be set (in paras)
+; Output : none
+;
+; Sets the variable 40:13 to the memory size passed in AX
+; It saves the old value in 40:13 in OldInt12Mem,
+; It also sets a flag Int12Lied to 0ffh, which is checked before
+; restoring the value of 40:13
+;
+;----------------------------------------------------------------------------
+;
+SetInt12Mem proc near
+
+ assume ds:nothing, es:nothing
+
+ push ds
+ mov bx, 40h
+ mov ds, bx ; ROM BIOS Data Segment
+ mov bx, word ptr ds:[13h] ; INT 12 memory variable
+ mov OldInt12Mem, bx ; save it
+ mov cl, 6
+ shr ax, cl ; convert paras into Ks
+ mov word ptr ds:[13h], ax ; Lie
+ mov Int12Lied, 0ffh ; mark that we are lying
+ pop ds
+ ret
+SetInt12Mem endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : TrueInt12Mem
+;
+; Input : Int12Lied = 0 if we are not lying currently
+; = 0ffh if we are lying
+; OldInt12Mem = Saved value of 40:13h
+;
+; Output : none
+;
+; Resets the INT 12 Memory variable if we were lying about int 12
+; and resets the flag which indicates that we were lying
+;
+;----------------------------------------------------------------------------
+;
+TrueInt12Mem proc near
+
+ assume ds:nothing, es:nothing
+
+ cmp Int12Lied, 0 ; were we lying so far?
+ mov Int12Lied, 0 ; reset it anyway
+ je timx ; no, we weren't
+ push ds
+ mov ax, 40h
+ mov ds, ax
+ mov ax, OldInt12Mem
+ mov word ptr ds:[13h], ax ; restore INT 12 memory
+ pop ds
+timx:
+ ret
+TrueInt12Mem endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : IsIt3Com?
+;
+; Input : DevEntry = Seg:0 of device driver
+; Output : Zero flag set if device name is 'PROTMAN$'
+; else Zero flag is reset
+;
+;----------------------------------------------------------------------------
+;
+IsIt3Com? proc near
+ assume ds:nothing, es:nothing, ss:nothing
+ push ds
+ push es
+ push si
+ lds si, DevEntry ; ptr to device header
+ add si, sdevname ; ptr device name
+ push cs
+ pop es
+ mov di, offset ThreeComName
+ mov cx, 8 ; name length
+ rep cmpsb
+ pop si
+ pop es
+ pop ds
+ ret
+IsIt3Com? endp
+
+;M020 : BEGIN
+;
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+;
+UpdatePDB proc near
+ assume ds:nothing
+ push ds
+ mov ah, 62h
+ int 21h
+ mov ds, bx
+ mov bx, alloclim
+ mov ds:[PDB_Block_Len], bx
+ pop ds
+ ret
+UpdatePDB endp
+;
+; M020 : END
+;
+;----------------------------------------------------------------------------
+;
+; procedure : InitDevLoad
+;
+; Input : DeviceHi = 0 indicates load DD in low memory
+; = 1 indicates load in UMB
+; DevSize = Size of the device driver file in paras
+;
+; Output : none
+;
+; Initializes DevLoadAddr, DevLoadEnd & DevEntry.
+; Also sets up a header for the Device driver entry for mem utility
+;
+;----------------------------------------------------------------------------
+;
+InitDevLoad proc near
+
+ assume ds:nothing, es:nothing
+
+ cmp DeviceHi, 0 ; Are we loading in UMB
+ je InitForLo ; no, init for lo mem
+ call SpaceInUMB? ; Do we have space left in the
+ ; current UMB ?
+ jnc InitForHi ; yes, we have
+ call ShrinkUMB ; shrink the current UMB in use
+ call GetUMBForDev ; else try to allocate new UMB
+ jc InitForLo ; we didn't succeed, so load
+ ; in low memory
+InitForHi:
+ mov ax, DevUMBFree ; get Para addr of free mem
+ mov dx, DevUMBAddr ; UMB start addr
+ add dx, DevUMBSize ; DX = UMB End addr
+ jmp short idl1
+
+InitForLo:
+ mov DeviceHi, 0 ; in case we failed to load
+ ; into UMB indicate that we
+ ; are loading low
+ mov ax, memhi ; AX = start of Low memory
+ mov dx, alloclim ; DX = End of Low memory
+idl1:
+ call DevSetMark ; setup a sub-arena for DD
+ mov DevLoadAddr, ax ; init the Device load address
+ mov DevLoadEnd, dx ; init the limit of the block
+ mov word ptr DevEntry, 0 ; init Entry point to DD
+ mov word ptr DevEntry+2, ax
+ ret
+InitDevLoad endp
+
+
+;------------------------------------------------------------------
+; NTVDM 08-Dec-1992 Jonle
+;
+; AllocUMBLow- Allocates a chunk from memory from UMB area
+; or from low memory area in case UMB memory
+; is unavailable.
+;
+; The arena is marked as
+;
+; Input: es:di addr of arena name to copy
+; cx size to allocate
+;
+; Output: es:di points to memory allocated
+;
+;------------------------------------------------------------------
+AllocUMBLow proc near
+
+ assume ds:nothing, es:nothing
+
+ mov ax, cx ; convert size to paras
+ add ax, 18 ; extra for dummy dev header for mem.exe
+ call pararound
+ mov DevSize, ax
+
+ mov word ptr [bpb_addr], di ; fake cmd line for dev name
+ mov word ptr [bpb_addr+2], es
+
+ mov al, DevUMB ; we want UMB
+ mov DeviceHi, al
+
+ call InitDevLoad
+
+ mov ax, word ptr DevEntry+2 ; mark arena for mem.exe
+ dec ax
+ mov es, ax
+ mov byte ptr es:[devmark_id], devmark_spc
+
+ inc ax ; mark final size
+ add ax, DevSize
+ mov word ptr DevBrkAddr+2,ax
+ mov word ptr DevBrkAddr, 0
+ call DevBreak
+
+ mov di, word ptr DevEntry ; es:di -> deventry
+ mov ax, word ptr DevEntry+2
+ mov es, ax
+
+AllocUMBLow endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : SpaceInUMB?
+;
+; Input : DevUMBAddr, DevUMBSize, DevUMBFree & DevSize
+; Output : Carry set if no space in UMB
+; Carry clear if Space is available for the device in
+; current UMB
+;
+;----------------------------------------------------------------------------
+;
+SpaceInUMB? proc near
+
+ assume ds:nothing, es:nothing
+
+ mov ax, DevUMBSize
+ add ax, DevUMBAddr ; End of UMB
+ sub ax, DevUMBFree ; - Free = Remaining space
+ or ax, ax ; Nospace ?
+ jnz @f
+ stc
+ ret
+@@:
+ dec ax ; space for sub-arena
+ cmp ax, DevSize ; do we have space ?
+ ret
+SpaceInUMB? endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : GetUMBForDev
+;
+; Input : DevSize
+; Output : Carry set if couldn't allocate a UMB to fit the
+; the device.
+; If success carry clear
+;
+; Allocates the biggest UMB for loading devices and updates
+; DevUMBSize, DevUMBAddr & DevUMBFree if it succeeded in allocating
+; UMB.
+;
+; This routine relies on the fact that all of the low memory
+; is allocated, and any DOS alloc calls should return memory
+; from the UMB pool.
+;
+;----------------------------------------------------------------------------
+;
+GetUMBForDev proc near
+
+ assume ds:nothing, es:nothing
+
+if 0
+;;
+ mov bx, 0ffffh
+ mov ax, 4800h
+ int 21h
+
+ or bx, bx
+ jz gufd_err
+
+ dec bx
+ cmp DevSize, bx
+ ja gufd_err
+ inc bx
+ mov ax, 4800h
+ int 21h
+ jc gufd_err
+
+ push ds
+ dec ax
+ mov ds, ax
+ mov word ptr ds:[arena_owner], 8
+ mov word ptr ds:[arena_name], 'DS'
+ inc ax
+ pop ds
+
+ mov DevUMBSize, bx ; update the UMB Variables
+ mov DevUMBAddr, ax
+ mov DevUMBFree, ax
+ clc ; mark no error
+ ret
+gufd_err:
+ xor ax, ax
+ mov DevUMBSize, ax ; erase the previous values
+ mov DevUMBAddr, ax
+ mov DevUMBFree, ax
+ stc
+ ret
+else
+;; we changed the allocation strategy to best-fit for NT. This is because
+;; we want to reserve bigger blocks for loadhigh command. In most case,
+;; device drivers are smaller than TSR(ran from loadhigh). This change give
+;; us a better chance to load the big tsr like DOSX.EXE to UMB and
+;; give applications more free conventional memory.
+;; The following implementation seems slow because every time we need an
+;; UMB, we go through the chain. This is done because each request has
+;; different size - We can grab all UMBs from the very beginning and put
+;; them in a list, but we have to maintain the list. -williamh
+ push cx
+ push dx
+ push es
+ xor cx, cx ;; allocated count = 0
+ mov dx, DevSize
+ inc dx ;; minimum size in paras
+ ;; bios needs its sub-arena
+search_for_best_block:
+ mov bx, 0ffffh ;; get largest block size
+ mov ah, 48h ;; so far
+ int 21h
+ cmp bx, dx ;; will this satisfy ours?
+ jb allocate_the_block ;; no, break
+ mov ah, 48h ;; allocate this block
+ int 21h
+ jc allocate_the_block ;; failed, use the previous one
+ inc cx ;; we have one more allocated
+ push bx ;; save the size
+ push ax ;; save the address
+ jmp short search_for_best_block
+
+allocate_the_block:
+;; the block saved on the top of the stack is the best fit one
+;; grab it if there is one
+ jcxz gufd_err ;; no block found, error
+ pop ax ;; get the address
+ pop DevUMBSize ;; and size
+ mov DevUMBAddr, ax
+ mov DevUMBFree, ax
+ dec ax
+ push ds
+ mov ds, ax
+ mov word ptr ds:[arena_owner], 8
+ mov word ptr ds:[arena_name], 'DS'
+ pop ds
+ dec cx
+;; now free those unnecessary blocks
+ jcxz allocate_done
+free_allocated_blocks:
+ pop es ;; get the address
+ add sp, 2 ;; discard the size
+ mov ah, 49h ;; free it
+ int 21h
+ loop free_allocated_blocks
+allocate_done:
+ clc ; mark no error
+ jmp short GetUMBForDevExit
+gufd_err:
+ xor ax, ax
+ mov DevUMBSize, ax ; erase the previous values
+ mov DevUMBAddr, ax
+ mov DevUMBFree, ax
+ stc
+GetUMBForDevExit:
+ pop es
+ pop dx
+ pop cx
+ ret
+endif
+
+GetUMBForDev endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : DevSetMark
+;
+; Input : AX - Free segment were device is going to be loaded
+; Output : AX - Segment at which device can be loaded (AX=AX+1)
+;
+; Creates a sub-arena for the device driver
+; puts 'D' marker in the sub-arena
+; Put the owner of the sub-arena as (AX+1)
+; Copies the file name into sub-arena name field
+;
+; Size field of the sub-arena will be set only at succesful
+; completion of Device load.
+;
+;----------------------------------------------------------------------------
+;
+DevSetMark proc near
+
+ assume ds:nothing, es:nothing
+
+ push es
+ push di
+ push ds
+ push si
+ mov es, ax
+ mov byte ptr es:[devmark_id], devmark_device ; 'D'
+ inc ax
+ mov word ptr es:[devmark_seg], ax
+;
+;-------------- Copy file name
+;
+ push ax ; save load addr
+ lds si, bpb_addr ; command line is still there
+;M004 - BEGIN
+ mov di, si
+ cld
+dsm_again:
+ lodsb
+ cmp al, ':'
+ jne isit_slash
+ mov di, si
+ jmp dsm_again
+isit_slash:
+ cmp al, '\'
+ jne isit_null
+ mov di, si
+ jmp dsm_again
+isit_null:
+
+ifdef DBCS
+ call testkanj
+ jz @f ; if this is not lead byte
+ lodsb ; get tail byte
+@@:
+endif
+
+ or al, al
+ jnz dsm_again
+ mov si, di
+;M004 - END
+ mov di, devmark_filename
+ mov cx, 8 ; maximum 8 characters
+dsm_next_char:
+ lodsb
+ or al, al
+ jz blankout
+ cmp al, '.'
+ jz blankout
+ stosb
+ loop dsm_next_char
+blankout:
+ jcxz dsm_exit
+ mov al, ' '
+ rep stosb ; blank out the rest
+dsm_exit:
+ pop ax ; restore load addr
+ pop si
+ pop ds
+ pop di
+ pop es
+ ret
+DevSetMark endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : SizeDevice
+;
+; Input : ES:SI - points to device file to be sized
+;
+; Output : Carry set if file cannot be opened or if it is an OS2EXE file
+;
+; Calculates the size of the device file in paras and stores it
+; in DevSize
+;
+;----------------------------------------------------------------------------
+;
+SizeDevice proc near
+
+ assume ds:nothing, es:nothing
+
+ push es
+ pop ds
+ mov dx, si ; ds:dx -> file name
+ mov ax, 3d00h ; open
+ int 21h
+ jc sd_err ; open failed
+
+IFDEF DONT_LOAD_OS2_DD ; M045
+ call CheckForOS2 ; is it a OS2 EXE file ?
+ jc sd_close ; yeah, we dont load them
+ENDIF ; M045
+
+ mov bx, ax ; BX - file handle
+ mov ax, 4202h ; seek
+ xor cx, cx
+ mov dx, cx ; to end of file
+ int 21h
+ jc sd_close ; did seek fail (impossible)
+ add ax, 15 ; para convert
+ adc dx, 0
+ test dx, 0fff0h ; size > 0ffff paras ?
+ jz @f ; no
+ mov DevSize, 0ffffh ; invalid device size
+ ; assuming that we fail later
+ jmp short sd_close
+@@:
+ mov cl, 4 ; conver it to paras
+ shr ax, cl
+ mov cl, 12
+ shl dx, cl
+ or ax, dx ;
+ cmp ax, DevSizeOption
+ ja @f
+ mov ax, DevSizeOption
+@@:
+ mov DevSize, ax ; save file size
+ clc
+sd_close:
+ pushf ; let close not spoil our
+ ; carry flag
+ mov ax, 3e00h ; close
+ int 21h ; we are not checking for err
+ popf
+sd_err:
+ ret
+SizeDevice endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : ExecDev
+;
+; Input : ds:dx -> device to be executed
+; DevLoadAddr - contains where device has to be loaded
+;
+; Output : Carry if error
+; Carry clear if no error
+;
+; Loads a device driver using the 4b03h function call
+;
+;----------------------------------------------------------------------------
+;
+ExecDev proc near
+
+ assume ds:nothing, es:nothing
+
+ mov bx, DevLoadAddr
+ mov DevExecAddr, bx ; Load the parameter block
+ ; block for exec with
+ ; Load address
+ mov DevExecReloc, bx
+ mov bx,cs
+ mov es,bx
+ mov bx,offset DevExecAddr ;es:bx points to parameters
+ mov al,3
+ mov ah,exec
+ int 21h ;load in the device driver
+ ret
+ExecDev endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : RemoveNull
+;
+; Input : ES:SI points to a null terminated string
+;
+; Output : none
+;
+; Replaces the null at the end of a string with blank
+;
+;----------------------------------------------------------------------------
+;
+
+RemoveNull proc near
+
+ assume ds:nothing, es:nothing
+
+rn_next:
+ mov bl, es:[si]
+ or bl, bl ; null ?
+ jz rn_gotnull
+ inc si ; advance the pointer
+ jmp rn_next
+rn_gotnull:
+ mov bl, DevSavedDelim
+ mov byte ptr es:[si], bl ; replace null with blank
+ ret
+RemoveNull endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : RoundBreakAddr
+;
+; Input : DevBrkAddr
+; Output : DevBrkAddr
+;
+; Rounds DevBrkAddr to a para address so that it is of the form xxxx:0
+;
+;----------------------------------------------------------------------------
+;
+RoundBreakAddr proc near
+
+ assume ds:nothing, es:nothing
+
+ mov ax, word ptr DevBrkAddr
+ call pararound
+ add word ptr DevBrkAddr+2, ax
+ mov word ptr DevBrkAddr, 0
+ mov ax, DevLoadEnd
+ cmp word ptr DevBrkAddr+2, ax
+ jbe rba_ok
+ jmp mem_err
+rba_ok:
+ ret
+RoundBreakAddr endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : DevSetBreak
+;
+; Input : DevBrkAddr
+; Output : Carry set if Device returned Init failed
+; Else carry clear
+;
+;----------------------------------------------------------------------------
+;
+DevSetBreak proc near
+
+ assume ds:nothing, es:nothing
+
+ push ax
+
+ mov ax,word ptr [DevBrkAddr+2] ;remove the init code
+ cmp multdeviceflag, 0
+ jne set_break_continue ;do not check it.
+ cmp ax, DevLoadAddr
+ jne set_break_continue ;if not same, then o.k.
+
+ cmp word ptr [DevBrkAddr],0
+ je break_failed ;[DevBrkAddr+2]=[memhi] & [DevBrkAddr]=0
+
+set_break_continue:
+ call RoundBreakAddr
+ pop ax
+ clc
+ ret
+break_failed:
+ pop ax
+ stc
+ ret
+DevSetBreak endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : DevBreak
+;
+; Input : DevLoadAddr & DevBrkAddr
+; Output : none
+;
+; Marks a succesful install of a device driver
+; Sets device size field in sub-arena &
+; Updates Free ptr in UMB or adjusts memhi
+;
+;----------------------------------------------------------------------------
+;
+DevBreak proc near
+
+ assume ds:nothing, es:nothing
+
+ push ds
+ mov ax, DevLoadAddr
+ mov bx, word ptr [DevBrkAddr+2]
+ dec ax ; seg of sub-arena
+ mov ds, ax
+ inc ax ; Back to Device segment
+ sub ax, bx
+ neg ax ; size of device in paras
+ mov ds:[devmark_size], ax ; store it in sub-arena
+ cmp DeviceHi, 0
+ je db_lo
+ mov DevUMBFree, bx ; update Free ptr in UMB
+ jmp short db_exit
+db_lo:
+ mov memhi, bx
+ mov memlo, 0
+db_exit:
+ pop ds
+ ret
+DevBreak endp
+;
+;----------------------------------------------------------------------------
+;
+; procedure : ParseSize
+;
+; Parses the command line for SIZE= command
+;
+; ES:SI = command line to parsed
+;
+; returns ptr to command line after SIZE= option in ES:SI
+; updates the DevSizeOption variable with value supplied
+; in SIZE=option
+; Returns carry if the SIZE option was invalid
+;
+;----------------------------------------------------------------------------
+;
+ParseSize proc near
+
+ assume ds:nothing, es:nothing
+
+ mov DevSizeOption, 0 ; init the value
+ mov word ptr DevCmdLine, si
+ mov word ptr DevCmdLine+2, es
+ call SkipDelim
+ cmp word ptr es:[si], 'IS'
+ jne ps_no_size
+ cmp word ptr es:[si+2], 'EZ'
+ jne ps_no_size
+ mov al, es:[si+4]
+ call delim
+ jne ps_no_size
+ add si, 5
+ call GetHexNum
+ jc ps_err
+ mov DevSizeOption, ax
+ call SkipDelim
+ps_no_size:
+ clc
+ ret
+ps_err:
+ stc
+ ret
+ParseSize endp
+;
+;----------------------------------------------------------------------------
+;
+; procedure : SkipDelim
+;
+; Skips delimiters in the string pointed to by ES:SI
+; Returns ptr to first non-delimiter character in ES:SI
+;
+;----------------------------------------------------------------------------
+;
+SkipDelim proc near
+
+ assume ds:nothing, es:nothing
+
+sd_next_char:
+ mov al, es:[si]
+ call delim
+ jnz sd_ret
+ inc si
+ jmp sd_next_char
+sd_ret:
+ ret
+SkipDelim endp
+;
+;----------------------------------------------------------------------------
+;
+; procedure : GetHexNum
+;
+; Converts an ascii string terminated by a delimiter into binary.
+; Assumes that the ES:SI points to a Hexadecimal string
+;
+; Returns in AX the number number of paras equivalent to the
+; hex number of bytes specified by the hexadecimal string.
+;
+; Returns carry in case it encountered a non-hex character or
+; if it encountered crlf
+;
+;----------------------------------------------------------------------------
+;
+GetHexNum proc near
+
+ assume ds:nothing, es:nothing
+
+ xor ax, ax
+ xor dx, dx
+ghn_next:
+ mov bl, es:[si]
+ cmp bl, cr
+ je ghn_err
+ cmp bl, lf
+ je ghn_err
+ push ax
+ mov al, bl
+ call Delim
+ pop ax
+ jz ghn_into_paras
+ call GetNibble
+ jc ghn_err
+ mov cx, 4
+ghn_shift1:
+ shl ax, 1
+ rcl dx, 1
+ loop ghn_shift1
+ or al, bl
+ inc si
+ jmp ghn_next
+ghn_into_paras:
+ add ax, 15
+ adc dx, 0
+ test dx, 0fff0h
+ jnz ghn_err
+ mov cx, 4
+ghn_shift2:
+ clc
+ rcr dx, 1
+ rcr ax, 1
+ loop ghn_shift2
+ clc
+ ret
+ghn_err:
+ stc
+ ret
+GetHexNum endp
+;
+;----------------------------------------------------------------------------
+;
+; procedure : GetNibble
+;
+; Convert one nibble (hex digit) in BL into binary
+;
+; Retruns binary value in BL
+;
+; Returns carry if BL contains non-hex digit
+;
+;----------------------------------------------------------------------------
+;
+GetNibble proc near
+ cmp bl, '0'
+ jb gnib_err
+ cmp bl, '9'
+ ja is_it_hex
+ sub bl, '0' ; clc
+ ret
+is_it_hex:
+ cmp bl, 'A'
+ jb gnib_err
+ cmp bl, 'F'
+ ja gnib_err
+ sub bl, 'A'- 10 ; clc
+ ret
+gnib_err:
+ stc
+ ret
+GetNibble endp
+;
+;
+;============================================================================
+;============================================================================
+;
+;----------------------------------------------------------------------------
+;
+; procedure : AllocUMB
+;
+; Allocate all UMBs and link it to DOS arena chain
+;
+;----------------------------------------------------------------------------
+;
+AllocUMB proc near
+ call InitAllocUMB ; link in the first UMB
+ jc au_exit ; quit on error
+au_next:
+ call umb_allocate ; allocate
+ jc au_coalesce
+ call umb_insert ; & insert till no UMBs
+ jmp short au_next
+au_coalesce:
+ call umb_coalesce ; coalesce all UMBs
+au_exit:
+ ret
+AllocUMB endp
+;
+;----------------------------------------------------------------------------
+;
+; procedure : InitAllocUMB
+;
+;----------------------------------------------------------------------------
+;
+InitAllocUMB proc near
+ call IsXMSLoaded
+ jnz iau_err ; quit on no XMS driver
+ mov ah, 52h
+ int 21h ; get DOS DATA seg
+ mov DevDOSData, es ; & save it for later
+ mov ax, 4310h
+ int 2fh
+ mov word ptr DevXMSAddr, bx ; get XMS driver address
+ mov word ptr DevXMSAddr+2, es
+ cmp FirstUMBLinked, 0 ; have we already linked a UMB?
+ jne @f ; quit if we already did it
+ call LinkFirstUMB ; else link the first UMB
+ jc iau_err
+ mov FirstUMBLinked, 0ffh ; mark that 1st UMB linked
+@@:
+ clc
+ ret
+iau_err:
+ stc
+ ret
+InitAllocUMB endp
+
+;-------------------------------------------------------------------------
+;
+; Procedure Name : umb_allocate
+;
+; Inputs : DS = data
+;
+; Outputs : if UMB available
+; Allocates the largest available UMB and
+; BX = segment of allocated block
+; DX = size of allocated block
+; NC
+; else
+; CY
+;
+; Uses : BX, DX
+;
+;-------------------------------------------------------------------------
+
+umb_allocate proc near
+
+ push ax
+ mov ah, XMM_REQUEST_UMB
+ mov dx, 0ffffh ; try to allocate largest
+ ; possible
+ call dword ptr DevXMSAddr
+ ; dx now contains the size of
+ ; the largest UMB
+ or dx, dx
+ jz ua_err
+
+ mov ah, XMM_REQUEST_UMB
+ call dword ptr DevXMSAddr
+
+ cmp ax, 1 ; Q: was the reqst successful
+ jne ua_err ; N: error
+
+ clc
+
+ua_done:
+ pop ax
+ ret
+
+ua_err:
+ stc
+ jmp short ua_done
+
+umb_allocate endp
+
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : umb_insert
+;
+; Inputs : DOSDATA:UMB_HEAD = start of umb chain
+; : BX = seg address of UMB to be linked in
+; : DX = size of UMB to be linked in paras
+; ; DS = data
+;
+; Outputs : links the UMB into the arena chain
+;
+; Uses : AX, CX, ES, DX, BX
+;
+;---------------------------------------------------------------------------
+
+
+umb_insert proc near
+
+ push ds
+
+ mov ds, [DevDOSData]
+ mov ds, ds:[UMB_ARENA] ; es = UMB_HEAD
+ mov ax, ds
+ mov es, ax
+
+ui_next:
+ cmp ax, bx ; Q: is current block above
+ ; new block
+ ja ui_insert ; Y: insert it
+ ; Q: is current block the
+ ; last
+ cmp es:[arena_signature], arena_signature_end
+ jz ui_append ; Y: append new block to chain
+ ; N: get next block
+
+ mov ds, ax ; M005
+ call get_next ; ax = es = next block
+ jmp short ui_next
+
+ui_insert:
+
+ mov cx, ds ; ds = previous arena
+ inc cx ; top of previous block
+
+ sub cx, bx
+ neg cx ; cx = size of used block
+ mov ds:[arena_signature], arena_signature_normal
+ mov ds:[arena_owner], 8 ; mark as system owned
+ mov ds:[arena_size], cx
+ mov word ptr ds:[arena_name], 'CS'
+
+; prepare the arena at start of new block
+
+ mov es, bx
+ mov es:[arena_signature], arena_signature_normal
+ mov es:[arena_owner], arena_owner_system
+ ; mark as free
+ sub dx, 2 ; make room for arena at
+ ; start & end of new block
+ mov es:[arena_size], dx
+
+; prepare arena at end of new block
+
+ add bx, dx
+ inc bx
+ mov es, bx ; es=arena at top of new block
+ inc bx ; bx=top of new block
+
+ ; ax contains arena just above
+ ; this block
+ sub ax, bx ; ax = size of used block
+
+ mov es:[arena_signature], arena_signature_normal
+ mov es:[arena_owner], 8 ; mark as system owned
+ mov es:[arena_size], ax
+ mov word ptr es:[arena_name], 'CS'
+
+ jmp short ui_done
+
+ui_append:
+
+ ; es = arena of last block
+
+ add ax, es:[arena_size] ; ax=top of last block-1 para
+ sub es:[arena_size], 1 ; reflect the space we are
+ ; going to rsrv on top of this
+ ; block for the next arena.
+ mov es:[arena_signature], arena_signature_normal
+
+ mov cx, ax ; cx=top of prev block-1
+ inc ax
+ sub ax, bx ; ax=top of prev block -
+ ; seg. address of new block
+
+ neg ax
+
+ mov es, cx ; ds = arena of unused block
+
+
+ mov es:[arena_signature], arena_signature_normal
+ mov es:[arena_owner], 8 ; mark as system owned
+ mov es:[arena_size], ax
+ mov word ptr es:[arena_name], 'CS'
+
+; prepare the arena at start of new block
+
+ mov es, bx
+ mov es:[arena_signature], arena_signature_end
+ mov es:[arena_owner], arena_owner_system
+ ; mark as free
+ dec dx ; make room for arena
+ mov es:[arena_size], dx
+
+ui_done:
+ pop ds
+ ret
+
+umb_insert endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+;** umb_coalesce - Combine free blocks ahead with current block
+;
+; Coalesce adds the block following the argument to the argument block,
+; iff it's free. Coalesce is usually used to join free blocks, but
+; some callers (such as $setblock) use it to join a free block to it's
+; preceeding allocated block.
+;
+; EXIT 'C' clear if OK
+; (ds) unchanged, this block updated
+; (ax) = address of next block, IFF not at end
+; 'C' set if arena trashed
+; USES cx, di, ds, es
+;
+;----------------------------------------------------------------------------
+;
+
+umb_coalesce proc near
+
+
+
+ xor di, di
+
+ mov es, [DevDOSData]
+ mov es, es:[UMB_ARENA] ; es = UMB_HEAD
+
+uc_nextfree:
+ mov ax, es
+ mov ds, ax
+ cmp es:[arena_owner], di ; Q: is current arena free
+ jz uc_again ; Y: try to coalesce with next block
+ ; N: get next arena
+ call get_next ; es, ax = next arena
+ jc uc_done
+ jmp short uc_nextfree
+uc_again:
+ call get_next ; ES, AX <- next block
+ jc uc_done
+uc_check:
+ cmp es:[arena_owner],di ; Q: is arena free
+ jnz uc_nextfree ; N: get next free arena
+ ; Y: coalesce
+ mov cx,es:[arena_size] ; cx <- next block size
+ inc cx ; cx <- cx + 1 (for header size)
+ add ds:[arena_size],cx ; current size <- current size + cx
+ mov cl,es:[di] ; move up signature
+ mov ds:[di],cl
+ jmp short uc_again ; try again
+uc_done:
+ ret
+
+umb_coalesce endp
+
+;
+;----------------------------------------------------------------------------
+;
+;** get_next - Find Next item in Arena
+;
+; ENTRY dS - pointer to block head
+; EXIT AX,ES - pointers to next head
+; 'C' set iff arena damaged
+;
+;----------------------------------------------------------------------------
+;
+
+get_next proc near
+
+ cmp byte ptr ds:[0], arena_signature_end
+ je gn_err
+
+ mov ax,ds ; ax=current block
+ add ax,ds:[arena_size] ; ax=ax + current block length
+ inc ax ; remember that header!
+ mov es, ax
+ clc
+ ret
+gn_err:
+ stc
+ ret
+
+get_next endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : LinkFirstUMB
+;
+;----------------------------------------------------------------------------
+;
+LinkFirstUMB proc near
+
+ call umb_allocate
+ jc lfu_err
+
+; bx = segment of allocated UMB
+; dx = size of UMB
+
+ int 12h ; ax = size of memory
+ mov cl, 6
+ shl ax, cl ; ax = size in paragraphs
+
+ mov cx, ax ; cx = size in paras
+ sub ax, bx ; ax = - size of unused block
+
+ neg ax
+
+ sub cx, 1 ; cx = first umb_arena
+ mov es, cx ; es = first umb_arena
+
+ mov es:[arena_signature], arena_signature_normal
+ mov es:[arena_owner], 8 ; mark as system owned
+
+ mov es:[arena_size], ax
+ mov word ptr es:[arena_name], 'CS'
+
+
+; put in the arena for the first UMB
+
+ mov es, bx ; es has first free umb seg
+ mov es:[arena_signature], arena_signature_end
+ mov es:[arena_owner], arena_owner_system
+ ; mark as free
+ dec dx ; make room for arena
+ mov es:[arena_size], dx
+
+
+ mov es, [DevDOSData]
+ mov di, UMB_ARENA
+ mov es:[di], cx ; initialize umb_head in DOS
+ ; data segment with the arena
+ ; just below Top of Mem
+
+; we must now scan the arena chain and update the size of the last
+; arena
+
+ mov di, DOS_ARENA
+ mov es, word ptr es:[di] ; es = start arena
+ xor di, di
+
+
+scan_next:
+ cmp byte ptr es:[di], arena_signature_end
+ jz got_last
+
+ mov ax, es
+ add ax, es:[arena_size]
+ inc ax
+ mov es, ax
+ jmp short scan_next
+
+got_last:
+;; -williamh- we reserved the last paragraph for UMB_HEAD already.
+;; refer to sysinit1.asm!goinit
+;; The following instruction was commentted out for this reason.
+;; sub es:[arena_size], 1
+;;
+ mov es:[arena_signature], arena_signature_normal
+ clc
+ ret
+
+lfu_err:
+ stc
+ ret
+LinkFirstUMB endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : ShrinkUMB
+;
+; Shrinks the current UMB in use, so that the unused portions
+; of the UMB is given back to the DOS free mem pool
+;
+;----------------------------------------------------------------------------
+;
+ public ShrinkUMB
+
+ShrinkUMB proc near
+ cmp DevUMBAddr, 0
+ je su_exit
+ push es
+ push bx
+ mov bx, DevUMBFree
+ sub bx, DevUMBAddr
+ mov es, DevUMBAddr
+ mov ax, 4a00h
+ int 21h
+ mov ax, es
+ dec ax
+ mov es, ax
+ mov word ptr es:[arena_owner], 8
+ pop bx
+ pop es
+su_exit:
+ ret
+ShrinkUMB endp
+
+;M002 - BEGIN
+;
+;----------------------------------------------------------------------------
+;
+; procedure : UnlinkUMB
+;
+; Unlinks the UMBs from the DOS arena chain
+;
+;----------------------------------------------------------------------------
+;
+ public UnlinkUMB
+
+UnlinkUMB proc near
+ push ds
+ push es
+ cmp FirstUMBLinked, 0
+ je ulu_x ; nothing to unlink
+ mov es, DevDOSData ; get DOS data seg
+ mov ds, es:[DOS_ARENA]
+ mov di, es:[UMB_ARENA]
+ulu_next:
+ call get_next
+ jc ulu_x
+ cmp di, ax ; is the next one UMB ?
+ je ulu_found
+ mov ds, ax
+ jmp ulu_next
+ulu_found:
+ mov ds:[arena_signature], 'Z'
+ulu_x:
+ pop es
+ pop ds
+ ret
+UnlinkUMB endp
+
+;M002 - END
+
+; =========================================================================
+;
+sysinitseg ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/sysimes.asm b/private/mvdm/dos/v86/doskrnl/bios/sysimes.asm
new file mode 100644
index 000000000..ee958e288
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/sysimes.asm
@@ -0,0 +1,26 @@
+ page ,160
+ ;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+
+ include version.inc ; set build flags
+ include biosseg.inc ; establish bios segment structure
+
+sysinitseg segment
+
+ public badopm,crlfm,badsiz_pre,badld_pre,badcom,badcountry
+ public badmem,badblock,badstack
+ public insufmemory,badcountrycom
+ public badorder,errorcmd
+ public badparm
+ public toomanydrivesmsg ;M029
+
+ include msbio.cl3
+
+sysinitseg ends
+ end
+
diff --git a/private/mvdm/dos/v86/doskrnl/bios/sysinit1.asm b/private/mvdm/dos/v86/doskrnl/bios/sysinit1.asm
new file mode 100644
index 000000000..e45d95e34
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/sysinit1.asm
@@ -0,0 +1,4007 @@
+ page ,160
+ title bios system initialization
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+
+break macro ; dummy empty macro
+ endm
+ include version.inc
+ include biosseg.inc
+ include sysvar.inc
+ include curdir.inc
+ include pdb.inc
+ include exe.inc
+ include sf.inc
+ include arena.inc
+ include syscall.inc
+ include devsym.inc
+ include ioctl.inc
+ include biostruc.inc
+ include dossym.inc
+ include dosmac.inc
+ include mult.inc
+ include dossvc.inc
+ include dbgsvc.inc
+ include cmdsvc.inc
+ include xmssvc.inc
+ include vint.inc
+
+Bios_Code segment
+ extrn BCode_start:near
+ extrn BCode_end:near
+ extrn seg_reinit:far
+
+Bios_Code ends
+
+ include devmark.inc
+ include cputype.inc
+
+
+true equ 0ffffh
+false equ 0
+cr equ 13
+lf equ 10
+tab equ 9
+
+;multMULT equ 4ah
+multMULTGETHMAPTR equ 1
+multMULTALLOCHMA equ 2
+
+
+stacksw equ true ;include switchable hardware stacks
+mycds_size equ 71 ; size of curdir_list. if it is not
+ ;the same, then will generate compile error.
+
+if DEBUG ; BUGBUG - Jeez, remove this!
+ dossize equ 0b200h
+else
+ dossize equ 0a000h
+endif
+
+ if ibmjapver
+noexec equ true
+ else
+noexec equ false
+ endif
+
+; if mycds_size <> curdirlen,then force a compilatiaon error.
+
+ if mycds_size ne curdirlen
+ %out !!! sysinit1 compilation failed. different cds size !!!
+ .errne mycds_size eq curdirlen
+ endif
+
+ if not ibmjapver
+ extrn re_init:far
+ endif
+
+ ifdef TAIWAN
+ extrn cdosinit:near
+ endif
+
+;---------------------------------------
+
+Bios_Data segment
+
+;equates for main stack and stack initialization program
+
+ if stacksw
+
+ extrn NextStack:dword ; Win386 Instance table stuff
+ extrn IT_StackLoc:dword ; we have to plug in so that our
+ extrn IT_StackSize:word ; stacks can be instanced
+
+entrysize equ 8
+
+mincount equ 8
+defaultcount equ 9
+maxcount equ 64
+
+minsize equ 32
+defaultsize equ 128
+maxsize equ 512
+
+allocbyte equ 0
+intlevel equ 1
+savedsp equ 2
+savedss equ 4
+newsp equ 6
+
+free equ 0
+allocated equ 1
+overflowed equ 2
+clobbered equ 3
+
+
+
+
+
+
+; external variables in ibmbio for int19h handling rouitne.
+
+ extrn int19sem:byte
+
+ irp aa,<02,08,09,0a,0b,0c,0d,0e,70,72,73,74,76,77>
+ extrn int19old&aa:dword
+ endm
+ endif
+
+
+;---------------------------------------
+; external variable defined in ibmbio module for multi-track
+multrk_on equ 10000000b ;user spcified mutitrack=on,or system turns
+ ; it on after handling config.sys file as a
+ ; default value,if multrk_flag = multrk_off1.
+multrk_off1 equ 00000000b ;initial value. no "multitrack=" command entered.
+multrk_off2 equ 00000001b ;user specified multitrack=off.
+
+ extrn multrk_flag:word
+;
+;SR; Win386 present flag
+;
+ extrn IsWin386:BYTE
+;
+;SR; Added for SetFocus routine for WIN386 support
+;
+ extrn V86_Crit_SetFocus:far
+
+ extrn xms:dword ; entry point for xms driver
+ extrn inHMA:byte ; flag meaning we're running high
+
+ extrn FreeHMAPtr:word
+ extrn MoveDOSIntoHMA:dword
+ extrn SysinitPresent:byte
+ extrn DemInfoFlag:byte
+ extrn spc_mse_int10:dword
+ extrn int29Perf:dword
+
+ extrn outchr:near
+Bios_Data ends
+
+; NTVDM 16-Sep-1992 Jonle
+; Softpc Kbd, mouse, emm drivers
+SpcKbdSeg segment
+ extrn InstSpcKbd:near
+ extrn SpcKbdBeg:byte
+ extrn SpcKbdEnd:byte
+ extrn int10h_vector:near
+SpcKbdSeg ends
+
+SpcMseSeg segment
+ extrn InstSpcMse:near
+ extrn SpcMseBeg:byte
+ extrn SpcMseEnd:byte
+SpcMseSeg ends
+
+SpcEmmSeg segment
+ extrn InitSpcEmm:near
+ extrn SpcEmmBeg:byte
+ extrn SpcEmmEnd:byte
+ extrn SI_end:byte
+SpcEmmSeg ends
+
+
+
+
+sysinitseg segment
+ assume cs:sysinitseg, ds:nothing,es:nothing,ss:nothing
+
+ extrn badcom:byte
+ extrn condev:byte
+ extrn auxdev:byte
+ extrn prndev:byte
+ extrn commnd:byte
+ extrn devmark_addr:word
+ extrn setdevmarkflag:byte
+ extrn pathstring:byte
+
+ extrn print:near
+ extrn int24:near
+ extrn mem_err:near
+ extrn doconf:near
+ extrn multi_pass:near
+
+ extrn badload:near
+ extrn error_line:near
+
+ extrn ShrinkUMB:near
+ extrn UnlinkUMB:near ;M002
+ extrn AllocUMB:near
+ extrn toomanydrivesmsg:byte ; M029
+
+
+ ;NTVDM
+ extrn MseDev:byte ; internal mouse driver name
+ extrn AllocUMBLow:near ; mem alloc for new internal drivers
+ extrn bEchoConfig:byte
+ extrn config:byte
+
+ public current_dos_location
+ public device_list
+ public sysi_country
+ public memory_size
+ public default_drive
+ public buffers
+ public files
+ public num_cds
+ public sysinit
+ public cntryfilehandle
+ public command_line
+
+ if stacksw ; internal stack information
+ public stack_count
+ public stack_size
+ public stack_addr
+ endif
+
+ public dosinfo
+ public fcbs
+ public keep
+ public confbot
+ public alloclim
+ public zero
+ public sepchr
+ public count
+ public chrptr
+ public org_count
+ public bufptr
+ public memlo
+ public prmblk
+ public memhi
+ public ldoff
+ public area
+ public packet
+ public unitcount
+ public break_addr
+ public bpb_addr
+ public drivenumber
+ public config_size
+ public install_flag
+ public com_level
+ public cmmt
+ public cmmt1
+ public cmmt2
+ public cmd_indicator
+ public linecount
+ public showcount
+ public buffer_linenum
+ public donotshownum
+ public h_buffers
+ public configmsgflag
+ public do_install_exec
+ public multi_pass_id
+ public temp_bcode_seg
+ public seg_reinit_ptr
+
+ public toomanydrivesflag ; M029
+
+sysinit$:
+ if stacksw
+.sall
+
+; interrupt level 2, 3, 4, 5, 6, 7,(10, 11, 12, 14, 15 - at level)
+; should follow the standard interrupt sharing scheme which has
+; a standard header structure.
+; fyi, the following shows the relations between
+; the interrupt vector and interrupt level.
+; vec(hex) 2 8 9 a b c d e 70 72 73 74 76 77
+; lvl(deci) 9 0 1 2 3 4 5 6 8 10 11 12 14 15
+; msstack module modifies the following interrupt vectors
+; to meet the standard interrupt sharing standard;
+; a, b, c, d, e, 72, 73, 74, 76, 77.
+; also, for interrupt level 7 and 15, the firstflag in a standard header
+; should be initialized to indicat whether this interrupt handler is
+; the first (= 80h) or not. the firstflag entry of int77h's
+; program header is initialized in this module.
+; firstflag is only meaningful for interrupt level 7 and 15.
+;
+
+; user specifies the number of stack elements - default = 9
+; minimum = 8
+; maximum = 64
+;
+; intercepts asynchronous hardware interrupts only
+;
+; picks a stack from pool of stacks and switches to it
+;
+; calls the previously saved interrupt vector after pushing flags
+;
+; on return, returns the stack to the stack pool
+;
+
+
+; this is a modification of stacks:
+; 1. to fix a bug which was causing the program to take up too much space.
+; 2. to dispense stack space from hi-mem first rather than low-mem first.
+; . clobbers the stack that got too big instead of innocent stack
+; . allows system to work if the only stack that got too big was the most
+; deeply nested one
+; 3. disables nmi interrupts while setting the nmi vector.
+; 4. double checks that a nested interrupt didn't get the same stack.
+; 5. intercepts ints 70, 72-77 for pc-ats and other future products
+
+ even
+ dw 0 ; spare field but leave these in order
+stackcount dw 0
+stackat dw 0
+stacksize dw 0
+stacks dw 0
+ dw 0
+
+firstentry dw stacks
+lastentry dw stacks+(defaultcount*entrysize)-entrysize
+nextentry dw stacks+(defaultcount*entrysize)-entrysize
+
+
+; these are the individual interrupt handlers
+
+ assume ds:nothing,es:nothing,ss:nothing
+
+public int02
+public old02
+ old02 dd 0
+int02 proc far
+
+;; NTVDM support for pc convertable is NOT NEEDED 10-Aug-1992 Jonle
+;;
+;; *********************************************************************
+;;
+;; this is special support for the pc convertible / nmi handler
+;;
+;; on the pc convertible, there is a situation where an nmi can be
+;; caused by using the "out" instructions to certain ports. when this
+;; occurs, the pc convertible hardware *guarantees* that **nothing**
+;; can stop the nmi or interfere with getting to the nmi handler. this
+;; includes other type of interrupts (hardware and software), and
+;; also includes other type of nmi's. when any nmi has occured,
+;; no other interrtupt (hardware, software or nmi) can occur until
+;; the software takes specific steps to allow further interrupting.
+;;
+;; for pc convertible, the situation where the nmi is generated by the
+;; "out" to a control port requires "fixing-up" and re-attempting. in
+;; otherwords, it is actually a "restartable exception". in this
+;; case, the software handler must be able to get to the stack in
+;; order to figure out what instruction caused the problem, where
+;; it was "out"ing to and what value it was "out"ing. therefore,
+;; we will not switch stacks in this situation. this situation is
+;; detected by interrogating port 62h, and checking for a bit value
+;; of 80h. if set, *****do not switch stacks*****.
+;;
+;; *********************************************************************
+;
+; push ax
+; push es
+; mov ax,0f000h
+; mov es,ax
+; cmp byte ptr es:[0fffeh],mdl_convert ;check if convertible
+; pop es
+; jne normal02
+;
+; in al,62h
+; test al,80h
+; jz normal02
+;
+;special02:
+; pop ax
+; jmp dword ptr old02
+;
+;normal02:
+; pop ax
+;
+
+ call do_int_stacks
+ dw old02
+
+int02 endp
+
+public int08
+public old08
+old08 dd 0
+int08 proc far
+ call do_int_stacks
+ dw old08
+int08 endp
+
+public int09
+public old09
+old09 dd 0
+int09 proc far
+
+; keyboard interrupt must have a three byte jump, a nop and a zero byte
+; as its first instruction for compatibility reasons
+
+ ifidn <09>,<09>
+ jmp short keyboard_lbl
+ nop
+ db 0
+keyboard_lbl label near
+ endif
+
+ call do_int_stacks
+ dw old09
+int09 endp
+
+public int70
+public old70
+old70 dd 0
+int70 proc far
+ call do_int_stacks
+ dw old70
+int70 endp
+
+ irp a,<0a,0b,0c,0d,0e,72,73,74,76,77>
+public int&a
+public old&a
+public firstflag&a
+int&a proc far
+ jmp short entry_int&a&_stk
+old&a dd 0 ;forward pointer
+ dw 424bh ;compatible signature for int. sharing
+firstflag&a db 0 ;the firstly hooked.
+ jmp short intret_&a ;reset routine. we don't care this.
+ db 7 dup (0) ;reserved for future.
+entry_int&a&_stk:
+ call do_int_stacks
+ dw old&a
+intret_&a:
+ jmp DOIRET
+int&a endp
+ endm
+
+
+DOCLI:
+ FCLI
+ ret
+DOSTI:
+ FSTI
+ ret
+DOIRET:
+ FIRET
+
+
+;********************************************************************
+;common routines
+
+; do interrupt stack switching. the fake return address holds
+; a pointer to the far-pointer of the actual interrupt
+; service routine
+
+do_int_stacks:
+ push ax
+ push bp
+ push es
+ mov es, cs:[stacks+2] ; get segment of stacks
+
+ mov bp,nextentry ; get most likely candidate
+ mov al,allocated
+ xchg es:byte ptr allocbyte[bp],al ; grab the entry
+ cmp al,free ; still avail?
+ jne notfree02
+
+ sub nextentry,entrysize ; set for next interrupt
+
+found02:
+ mov es:word ptr savedsp[bp],sp ; save sp value
+ mov es:word ptr savedss[bp],ss ; save ss also
+
+ mov ax,bp ; temp save of table offset
+
+
+ mov bp,es:word ptr newsp[bp] ; get new sp value
+ cmp es:[bp],ax ; check for offset into table
+ jne foundbad02
+
+ push bp
+ mov bp,sp
+ mov ax,8[bp] ; get offset of interrupt vector
+ pop bp
+
+ push es ; ss:sp = new stack
+ pop ss
+ mov sp,bp
+
+ mov bp,ax ; get pointer to interrupt vector
+ mov bp,cs:[bp]
+ pushf ; go execute the real interrupt handler
+ call cs:dword ptr [bp] ; call the old interrupt vector
+
+ mov bp,sp ; retrieve the table offset for us
+ mov bp,es:[bp] ; but leave it on the stack
+ mov ss,es:word ptr savedss[bp] ; get old stack back
+ mov sp,es:word ptr savedsp[bp]
+
+
+ mov es:byte ptr allocbyte[bp],free ; free the entry
+ mov nextentry,bp ; setup to use next time
+
+newerror02:
+ pop es
+ pop bp ; saved on entry
+ pop ax ; saved on entry
+ add sp,2 ; lose the fake return address
+
+intret_02:
+ jmp DOIRET ; done with this interrupt
+
+notfree02:
+ cmp al,allocated ; error flag
+ je findnext02 ; no, continue
+ xchg es:byte ptr allocbyte[bp],al ; yes, restore error value
+
+findnext02:
+ call longpath
+ jmp found02
+
+foundbad02:
+ cmp bp,firstentry
+ jc findnext02
+ mov bp,ax ; flag this entry
+ mov es:byte ptr allocbyte[bp],clobbered
+ jmp findnext02 ; keep looking
+longpath:
+ mov bp,lastentry ; start with last entry in table
+
+lploopp:
+ cmp es:byte ptr allocbyte[bp],free ; is entry free?
+ jne inuse ; no, try next one
+
+ mov al,allocated
+ xchg es:byte ptr allocbyte[bp],al ; allocate entry
+ cmp al,free ; is it still free?
+ je found ; yes, go use it
+
+ cmp al,allocated ; is it other than allocated or free?
+ je inuse ; no, check the next one
+
+ mov es:byte ptr allocbyte[bp],al ; yes, put back the error state
+
+inuse:
+ cmp bp,firstentry
+ je fatal
+ sub bp,entrysize
+ jmp lploopp
+
+found:
+ ret
+
+fatal proc near
+
+; NTVDM support for pc convertable is NOT NEEDED 10-Aug-1992 Jonle
+;
+; push ds
+; mov ax, 0f000h ;look at the model byte
+; mov ds, ax
+; cmp ds:byte ptr [0fffeh], mdl_convert ;convertible?
+; pop ds
+; jne skip_nmis
+;
+; mov al,07h ; disable pc convertible nmis
+; out 72h,al
+;
+;skip_nmis:
+
+ call DOCLI ; disable and mask
+ mov al,0ffh ; all other ints
+ out 021h,al
+ out 0a1h,al
+
+ mov si,cs
+ mov ds,si
+ mov si,offset fatal_msg
+
+;SR;
+; We set all foci to this VM to issue the stack failure message
+;
+ push ax
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+
+ test ds:[IsWin386],1
+ pop ds
+ pop ax
+ assume ds:nothing
+ jz fatal_loop ;win386 not present, continue
+
+ call V86_Crit_SetFocus ;set focus to this VM
+;
+;SR; We do not bother about the returned status of this call.
+;
+
+fatal_loop:
+ lodsb
+ cmp al,'$'
+ je fatal_done
+
+ mov bl,7
+ mov ah,14
+ int 010h ; whoops, this enables ints
+ jmp fatal_loop
+
+fatal_done:
+ jmp fatal_done
+fatal endp
+
+ include msbio.cl5 ;fatal stack error message
+.xall
+ public endstackcode
+endstackcode label byte
+ endif
+
+sysinit:
+ jmp goinit
+;
+;----------------------------------------------------------------------------
+;
+DDHighInfo struc
+ ddhigh_CSegPtr dd ? ; pointer to code segment to be relocated
+ ddhigh_CSegLen dw ? ; length of code segment to be relocated
+ ddhigh_CallBak dd ? ; pointer to the call back routine
+DDHighInfo ends
+
+ public runhigh
+runhigh db 0h
+
+
+dosinfo dd 0 ; address of the DOS Sysini Variables
+
+dos_temp_location label dword
+dosinit dw 0
+current_dos_location dw 0
+
+device_list dd 0
+
+sysi_country dd 0 ; pointer to country table in dos
+
+dos_segreinit dw 0,0 ; room for dword
+
+lo_doscod_size dw 0 ; dos code size when in low mem
+hi_doscod_size dw 0 ; dos code size when in HMA
+
+def_php dw 0
+
+
+; M022--
+; pointer for calling into Bios_Code for re-initializing segment values.
+; call with ax = new segment for Bios_Code. Notice that we'll
+; call it in its temporary home, cuz seg_reinit won't get moved to
+; the new home.
+
+seg_reinit_ptr label dword
+
+ dw offset Bios_Code:seg_reinit
+temp_bcode_seg dw Bios_Code
+
+
+;variables for stack initialization program.
+
+ if stacksw
+stack_count dw defaultcount
+stack_size dw defaultsize
+stack_addr dd 0
+ endif
+
+; various default values
+
+memory_size dw 1
+RPLMemTop dw 0
+default_drive db 0 ;initialized by ibminit.
+buffers dw -1 ; initialized during buffer allocation
+h_buffers dw 0 ; # of the heuristic buffers. initially 0.
+singlebuffersize dw ? ; maximum sector size + buffer header
+
+files db 8 ; enough files for pipe
+fcbs db 4 ; performance for recycling
+keep db 0 ; keep original set
+num_cds db 1 ; minimum needed is 1, so that initialization does'nt have a problem
+confbot dw ?
+alloclim dw ?
+DirStrng db "A:\",0 ; string for the root directory of a drive
+command_line db 2,0,"P" ;default command.com args
+ db 125 dup (0)
+zero db 0
+sepchr db 0
+linecount dw 0 ; line count in config.sys
+showcount db ' ',cr,lf,'$' ; used to convert linecount to ascii.
+buffer_linenum dw 0 ; line count for "buffers=" command if entered.
+
+
+buf_prev_off dw 0
+
+ if not noexec
+comexe exec0 <0,command_line,default_drive,zero>
+ endif
+
+;------------------------------------------------------------------
+; variables for install= command.
+
+multi_pass_id db 0 ; parameter passed to multi_pass
+ ; indicating the pass number
+ ; 0 - do scan for DOS=HIGH/LOW
+ ; 1 - load device drivers
+ ; 2 - was to load IFS
+ ; now it is unused
+ ; 3 - do install=
+ ; >3 - nop
+install_flag dw 0
+
+have_install_cmd equ 00000001b ; config.sys has install= commands
+has_installed equ 00000010b ; sysinit_base installed.
+
+config_size dw 0 ; size of config.sys file. set by sysconf.asm
+sysinit_base_ptr dd 0 ; pointer to sysinit_base
+sysinit_ptr dd 0 ; returning addr. from sysinit_base
+checksum dw 0 ; used by sum_up
+
+ldexec_fcb db 20 dup (' ') ;big enough
+ldexec_line db 0 ;# of parm characters
+ldexec_start db ' '
+ldexec_parm db 80 dup (0)
+
+instexe exec0 <0,ldexec_line,ldexec_fcb,ldexec_fcb>
+
+;------------------------------------------------------------------
+;variables for comment=
+
+com_level db 0 ;level of " " in command line
+cmmt db 0 ;length of comment string token
+cmmt1 db 0 ;token
+cmmt2 db 0 ;token
+cmd_indicator db ?
+donotshownum db 0
+
+;------------------------------------------------------------------
+count dw 0
+org_count dw 0
+chrptr dw 0
+cntryfilehandle dw 0
+old_area dw 0
+impossible_owner_size dw 0 ; paragraph
+;------------------------------------------------------------------
+
+bucketptr label dword
+bufptr label dword ;leave this stuff in order!
+memlo dw 0
+prmblk label word
+memhi dw 0
+ldoff dw 0
+area dw 0
+
+packet db 24 ; was 22
+ db 0
+ db 0 ;initialize code
+ dw 0
+ db 8 dup (?)
+
+unitcount db 0
+break_addr dd 0
+bpb_addr dd 0
+drivenumber db 0
+configmsgflag dw 0 ; used to control "error in config.sys line #" message
+
+toomanydrivesflag db 0 ;>24 fixed disk partitions flag ; M029
+
+BCodeSeg dw Bios_Code
+
+
+
+
+;SR;
+; This is the communication block between the DOS and the BIOS. It starts at
+;the SysinitPresent flag. Any other data that needs to be communicated
+;to the DOS should be added after SysinitPresent. The pointer to this block
+;is passed to DOS as part of the DOSINIT call.
+;
+
+BiosComBlock dd Bios_Data:SysinitPresent
+
+tempstack db 80h dup (?)
+
+goinit:
+
+ifdef JAPAN
+ mov ah,50h ; set crt mode
+ mov al,0
+ mov bx,81 ; for JAPAN
+ int 10h
+ mov ah,50h ; set keyboard mode
+ mov al,0
+ mov bx,81 ; for JAPAN
+ int 16h
+endif
+ cld
+
+;; Before we installed spckbd.asm (we hook a lot of vectors there),
+;; we shouldn't invoke any interrupt calls directly to bios(they will
+;; go directly to ROM bios). Since we do know what exactly those ROM
+;; bios(s) do, a safer manner is to issue bop to our 32 bits side.
+;; int 12h ; Get Memory in 1k
+ BOP 12h
+ mov cl,6
+ shl ax,cl ;convert to 16-byte blocks(segment no.)
+ mov cx,ax
+ dec cx ; one para for an arena at end of mem
+ ; in case of UMBs
+ mov memory_size,cx
+
+ push cs
+ pop ds
+ xor si,si
+ mov di,si
+ mov ax, offset sysinitgrp:SI_end ; need this much room for sysinit
+ call off_to_para
+ sub cx,ax
+
+; we need to leave room for the DOS and for the BIOS
+; code above sysinit in memory
+;
+ sub cx,dossize/16 ; leave this much room for DOS
+
+ mov ax,offset BCode_end
+ call off_to_para ; leave this much room for BIOS code
+ sub cx,ax
+
+ mov es,cx ; offset where sysinit will be located
+ mov cx,offset sysinitgrp:SI_end
+ shr cx,1 ;divide by 2 to get words
+ rep movsw ;relocate sysinit
+
+ push es ; push relocated segment
+ mov ax,offset sysin
+ push ax ; push relocated entry point
+
+ retf ; far jump to relocated sysinit
+
+
+; move the dos to its proper location
+
+sysin:
+ assume ds:nothing,es:nothing,ss:nothing
+
+ mov ax, Bios_Data ; point DS to BIOS data
+ mov ds, ax
+
+ assume ds:Bios_Data
+
+ mov word ptr MoveDOSIntoHMA+2, cs ; set seg of routine to move DOS
+ mov SysinitPresent, 1 ; flag that MoveDOSIntoHMA can be called
+
+ SVC SVC_ISDEBUG
+ mov DemInfoFlag, al
+
+ test al,ISDBG_DEBUGGEE
+ je @f
+ SAVEREG <bx,dx,es>
+ mov bx, cs ; current base of BIOS
+ xor cx, cx
+ mov dx, current_dos_location; get offset of end of code
+ sub dx, bios_data ; add in length of data segment
+ REPT 4
+ shl dx, 1
+ rcl cx, 1
+ endm
+
+ mov ax, SYMOP_LOAD SHL 8 + ID_NTIO
+ SVC SVC_DEMSYSTEMSYMBOLOP
+
+ mov bx, 1 ; bugbug: Hardcoded segment number
+ mov ax, ds ; low segment location
+ mov es, ax ; relocated segment
+
+ mov ax, SYMOP_MOVE SHL 8 + ID_NTIO
+ SVC SVC_DEMSYSTEMSYMBOLOP
+
+ RESTOREREG <es,dx,bx>
+@@:
+
+; first move the MSDOS.SYS image up to a harmless place
+; on top of our new sysinitseg
+
+ mov ax,offset sysinitgrp:SI_end ; how big is sysinitseg?
+ call off_to_para
+ mov cx,cs ; pick a buffer for msdos above us
+ add ax,cx
+ mov es,ax
+ xor si,si
+ mov di,si
+
+ mov ds,[current_dos_location] ; where it is (set by msinit)
+
+ assume ds:nothing
+
+ mov cx,dossize/2
+ rep movsw
+ mov [current_dos_location],es
+
+; The DOS code is ORGed at a non-zero value to allow it to be located in
+; HIMEM. Thus, the DOS segment location must be adjusted accordingly.
+
+ mov ax,ds:word ptr 3 ; get offset of dos
+ mov [dosinit],ax ; that's the entry point offset
+ call off_to_para ; subtract this much from segment
+ sub [current_dos_location],ax
+
+
+; BIOS code is moved to the top of memory
+; until it is determined whether it will be running in HIMEM or not.
+
+
+; now put Bios_Code up on top of that. Assume Bios_Code + dossize < 64k
+
+ mov ax,es
+ add ax,dossize/16 ; get paragraph of end of dos
+ mov es,ax
+ xchg ax,temp_bcode_seg ; swap with original home of Bios_Code
+ mov ds,ax ; point to loaded image of Bios_Code
+
+ assume ds:nothing
+
+ mov si,offset BCode_start
+ mov di,si
+ mov cx,offset BCode_end
+ sub cx,si
+ shr cx,1
+ rep movsw ; move Bios_Code into place
+
+ mov ax,es ; tell it what segment it's in
+ call [seg_reinit_ptr] ; far call to seg_reinit in Bios_Code (M022)
+
+
+; now call dosinit while it's in its temporary home
+
+ les di,cs:[BiosComBlock] ; ptr to BIOS communication block
+ lds si,cs:[device_list] ; set for call to dosinit
+
+ assume ds:nothing, es:nothing
+
+ mov dx,cs:[memory_size] ; set for call to dosinit
+
+ call DOCLI
+ mov ax,cs
+ mov ss,ax
+ align 2 ; assembler wouldn't let me do an "and 0fffeh"
+locstack label byte ; on the mov sp,offset locstack
+ mov sp,offset locstack ; set stack
+
+ call DOSTI
+
+
+; This call to DOSINIT will relocate the DOS data from its present location
+; at the top of memory, to its final location in low memory just above the
+; BIOS data. It will then build important DOS data structures in low
+; memory following the DOS data. It returns (among many other things) the
+; new starting address of free memory.
+
+ call [dos_temp_location] ; call dosinit
+ ;es:di -> sysinitvars_ext
+
+ mov [def_php],ds ; save pointer to PSP
+ mov [hi_doscod_size],ax ; size of doscode (including exepatch)
+ mov [lo_doscod_size],cx ; (not including exepatch)
+ mov [dos_segreinit],dx ; save offset of segreinit
+
+ mov ax,word ptr es:[di.sysi_initvars]
+ mov word ptr dosinfo,ax
+ mov ax,word ptr es:[di.sysi_initvars+2]
+ mov word ptr [dosinfo+2],ax ;set the sysvar pointer
+
+ mov ax,word ptr es:[di.sysi_country_tab]
+ mov word ptr [sysi_country],ax
+ mov ax,word ptr es:[di.sysi_country_tab+2]
+ mov word ptr [sysi_country+2],ax ;set the sysi_country pointer
+
+ mov es,[current_dos_location] ; give dos its temporary loc.
+ mov [dos_segreinit+2],es
+;
+ les di,dosinfo ;es:di -> dosinfo
+
+ clc ;get the extended memory size
+
+; execute the get extended memory size subfunction in the bios int 15h
+; if the function reports an error do nothing else store the extended
+; memory size reported at the appropriate location in the dosinfo buffer
+; currently pointed to by es:di. use the offsets specified in the
+; definition of the sysinitvars struct in inc\sysvar.inc
+
+ mov ah,88h
+;; IBM ps/2 90 int 15(ah = 88h) read a coms byte(0B6h) which we don't support.
+;; it returns 0 on this query.
+;; we issue a bop to 32bits to get the real extended memeory size
+;; int 15h ;check extended memory size
+ BOP 15h
+;; jc no_ext_memory
+ mov es:[di].sysi_ext_mem,ax ;save extended memory size
+;; or ax, ax
+no_ext_memory:
+ mov ax,es:[di.sysi_maxsec] ; get the sector size
+ add ax,bufinsiz ; size of buffer header
+ mov [singlebuffersize],ax ; total size for a buffer
+
+ SVC SVC_DEMGETBOOTDRIVE
+ mov [default_drive],al
+ mov es:[di.sysi_boot_drive],al ; set sysi_boot_drive
+
+; determine if 386 system...
+if 1
+ get_cpu_type ; macro to determine cpu type
+ cmp ax,2 ; is it a 386?
+ jne not_386_system ; no: don't mess with flag
+endif
+
+ mov es:[di.sysi_dwmove],1
+not_386_system:
+ mov al,es:[di.sysi_numio]
+ mov drivenumber,al ; save start of installable block drvs
+
+ mov ax,cs
+ sub ax,11h ; room for PSP we will copy shortly
+ mov cx,[singlebuffersize] ; temporary single buffer area
+ shr cx,1
+ shr cx,1 ; divide size by 16...
+ shr cx,1
+ shr cx,1 ; ...to get paragraphs...
+ inc cx ; ... and round up
+
+; cas note: this unorthodox paragraph rounding scheme wastes a byte if
+; [singlebuffersize] ever happens to be zero mod 16. Could this
+; ever happen? Only if the buffer overhead was zero mod 16, since
+; it is probably safe to assume that the sector size always will be.
+;
+; mohans also found a bug in CONFIG.SYS processing where it replaces
+; EOF's with cr,lf's, without checking for collision with [confbot].
+; perhaps the extra byte this code guarantees is what has kept that
+; other code from ever causing a problem???
+
+ sub ax,cx
+ mov [confbot],ax ; temp "unsafe" location
+; push es ; preserve pointer to DOSINFO data
+; push di
+
+; setup and initialize the temporary buffer
+
+; les di,es:[di.sysi_buf] ;get the buffer chain entry pointer
+; mov word ptr es:[di.Dirty_Buff_Count],0
+; mov word ptr es:[di.Buff_Queue],0
+; mov word ptr es:[di.Buff_Queue+2],ax
+; mov es,ax
+; xor ax,ax
+; mov di,ax ;es:di -> single buffer
+
+; mov es:[di.buf_next],ax ;points to itself
+; mov es:[di.buf_prev],ax ;points to itself
+
+; mov word ptr es:[di.buf_id],00ffh ;free buffer,clear flag
+; mov word ptr es:[di.buf_sector],0
+; mov word ptr es:[di.buf_sector+2],0
+
+; pop di ; restore pointer to DOSINFO data
+; pop es
+
+ push cs
+ pop ds
+
+ assume ds:sysinitseg
+
+ call tempcds ; set up cdss so re_init and sysinit
+ ; can make disk system calls
+ assume ds:nothing ; tempcds trashes ds
+
+ mov ds,[def_php] ; retreive pointer to PSP returned by DOSINIT
+
+ if not ibmjapver
+ call re_init ; re-call the bios
+ endif
+
+ call DOSTI ; ints ok
+ cld ; make sure
+
+; dosinit has set up a default "process" (php) at ds:0. we will move it out
+; of the way by putting it just below sysinit at end of memory.
+
+ mov bx,cs
+ sub bx,10h
+ mov es,bx
+ xor si,si
+ mov di,si
+ mov cx,80h
+ rep movsw
+
+ mov word ptr es:[pdb_jfn_pointer + 2],es ; relocate
+ mov ah,set_current_pdb
+ int 21h ; tell dos we moved it
+
+ push ds ; preserve DS returned by DOSINIT
+ push cs
+ pop ds ; point DS to sysinitseg
+
+ assume ds:sysinitseg
+
+ ; set up temp. critical error handler
+ mov dx,offset int24 ;set up int 24 handler
+ mov ax,(set_interrupt_vector shl 8) or 24h
+ int 21h
+
+ cmp byte ptr [TooManyDrivesFlag],0 ;Q: >24 partitions? M029
+ je no_err ; N: continue M029
+ mov dx,offset TooManyDrivesMsg ; Y: print error message M029
+ call print ; M029
+no_err: ; M029
+
+ pop ds ; start of free memory
+
+ assume ds:nothing
+
+ mov dl,[default_drive]
+ or dl,dl
+ jz nodrvset ; bios didn't say
+ dec dl ; a = 0
+ mov ah,set_default_drive
+ int 21h ;select the disk
+
+nodrvset:
+
+;
+; Process the CONFIG.SYS file
+;
+
+ProcessConfig:
+
+;
+; NTVDM store temp file name for config.sys, 23-Nov-1992 Jonle
+;
+ push ds
+ push cs
+ pop ds
+ assume ds:sysinitseg
+ mov dx,offset config ; ds:dx points file description
+ CMDSVC SVC_GETCONFIGSYS
+ pop ds
+ assume ds:nothing
+
+
+ifndef TAIWAN
+
+ call doconf ;do pre-scan for dos=high/low
+
+else ; taiwan
+
+ call chkoemlocaldrv
+ mov cs:oemdriverinst,ax
+ call cdosinit
+ push es
+ push bx
+
+ pop bx
+ pop es
+ call maketempvector ;make dummy int service routine
+
+ call doconf ;do pre-scan for dos=high/low
+
+ call chklocalexist ;check if local dev drv exist
+ ;if not found,system halt
+ call recovercsiint ;recover csi interrupt vector
+endif ; taiwan
+
+
+
+; Now, we decide what to do with the DOS code.
+; It will either be relocated to low memory, above the DOS data structures,
+; or else it will be located in HiMem, in which case a stub with the DOS
+; code entry points will be located in low memory. Dos_segreinit is used
+; to tell the DOS data where the code has been placed, and to install the
+; low memory stub if necessary. If the DOS is going to go into HiMem, we
+; must first initialize it in its present location and load the installable
+; device drivers. Then, if a HiMem driver has been located, we can actually
+; relocate the DOS code into HiMem.
+;
+
+; M025 begin
+
+ cmp runhigh, 0 ; Did user choose to run low ?
+ je dont_install_stub ; yes, don't install dos low mem stub
+;
+;------ user chose to load high
+;
+
+
+ mov es,[current_dos_location] ; give dos its temporary loc.
+
+ xor ax,ax ; ax = 00 ---> install stub
+ call cs:dword ptr [dos_segreinit] ; call dos segreinit
+ jmp short do_multi_pass
+
+;
+;------ User chose to load dos low
+;
+dont_install_stub:
+
+ xor bx, bx ; M012
+ ; don't use int 21 call to alloc mem
+
+ call MovDOSLo ; move it !
+
+
+ mov ax, 1 ; dont install stub
+ mov es, current_dos_location; set_dos_final_position set it up
+ call dword ptr dos_segreinit ; inform dos about new seg
+
+
+do_multi_pass:
+
+ call AllocFreeMem ; allocate all the free mem
+ ; & update [memhi] & [area]
+ ; start of free memory.
+
+; M025 end
+
+
+
+; NTVDM
+; Copy softpc keyboard driver resident code to start of free mem
+; Install Softpc IVT hooks
+ mov al,devmark_spc
+ call setdevmark
+ mov es, cs:[devmark_addr]
+ mov word ptr es:[arena_name], 'BK'
+ mov word ptr es:[arena_name+2], 'D'
+
+ cld
+ mov ax,[memhi]
+ push ds
+ mov cx,Bios_Data
+ mov ds,cx
+ assume ds:Bios_Data
+ mov word ptr spc_mse_int10,offset int10h_vector
+ mov word ptr spc_mse_int10+2,ax
+ mov word ptr int29Perf,offset outchr ; sudeepb 03-Nov-1992
+ mov word ptr int29Perf+2,ds ; added for int10 performance
+ pop ds
+ assume ds:nothing
+
+ mov es,ax ;es dest seg. for SpcKbd
+ push es
+ push cs
+ pop ds ;ds src seg for SpcKbd
+ mov si,offset sysinitgrp:SpcKbdBeg
+ mov cx,offset sysinitgrp:SpcKbdEnd
+ sub cx,si
+ xor di,di
+ mov [memlo],cx
+ or [setdevmarkflag],for_devmark
+ call round
+ rep movsb
+ pop ds
+ call sysinitgrp:InstSpcKbd
+
+ ; save value of int09 for int 09 hardware stack disable
+ xor ax,ax
+ mov ds,ax
+ mov si, 09h*4
+ lodsw
+ mov word ptr cs:old09, ax
+ lodsw
+ mov word ptr cs:old09+2, ax
+
+ ; save value of int08 for int 08 hardware stack disable
+ mov si, 08h*4
+ lodsw
+ mov word ptr cs:old08, ax
+ lodsw
+ mov word ptr cs:old08+2, ax
+
+
+; NTVDM
+; Attempt to init emm memory manager. if we have emm
+; then load internal emm stub device driver.
+;
+ ; check if emm memory is available
+ mov ax, [memhi]
+ inc ax ;1 para for arena header
+ mov ds, ax ;expected seg for emm drv
+ call sysinitgrp:InitSpcEmm
+ cmp ax, 0
+ jne NoEmmServices
+
+ ; fill in the arena name
+ mov al, devmark_device
+ call setdevmark
+ mov es, cs:[devmark_addr]
+ mov word ptr es:[arena_name], 'ME'
+ mov word ptr es:[arena_name+2], 'M'
+
+ ; copy in emm stub driver code
+ cld
+ mov ax,[memhi]
+ mov es,ax
+ push es ;save for diddling devheader
+ push cs
+ pop ds
+ mov si,offset sysinitgrp:SpcEmmBeg
+ mov cx,offset sysinitgrp:SpcEmmEnd
+ sub cx,si
+ xor di,di
+ mov [memlo],cx
+ or [setdevmarkflag],for_devmark
+ call round
+ rep movsb
+
+ ; link in emm stub driver
+ ; so apps can find emm driver
+ pop ds
+ xor si, si ;ds:si = device header
+ les di, cs:[dosinfo] ;es:di = to dos info
+ mov cx,word ptr es:[di.sysi_dev] ;dx:cx = head of list
+ mov dx,word ptr es:[di.sysi_dev+2]
+ mov word ptr es:[di.sysi_dev],si ;set head of list in dos
+ mov word ptr es:[di.sysi_dev+2],ds
+ mov word ptr ds:[si], cx ;link in the driver
+ mov word ptr ds:[si+2], dx
+
+NoEmmServices:
+
+
+; Now, process config.sys some more.
+; Load the device drivers and install programs
+ inc cs:multi_pass_id ; multi_pass_id = 1
+ call multi_pass ; load device drivers
+
+
+; NTVDM
+; Install Softpc Mouse driver in UMB if can else in LOW memory
+; This must be done after himem.sys is loaded for umb support
+;
+ mov cx, offset sysinitgrp:SpcMseEnd
+ sub cx, offset sysinitgrp:SpcMseBeg ; cx, size of SpceMse
+ mov di, offset MseDev
+ push cs
+ pop es ; es:di, dest
+ push cx ; preserve cx
+ call AllocUMBLow
+ pop cx
+ push es ; save to pass to InstSpcMse
+
+ mov si, offset sysinitgrp:SpcMseBeg
+ push cs
+ pop ds ; ds:si, Source of SpcMse code
+ rep movsb
+
+ pop ds
+ call sysinitgrp:InstSpcMse
+
+
+
+ call ShrinkUMB
+ call UnlinkUMB ; unlink all UMBs ;M002
+ inc cs:multi_pass_id ; multi_pass_id = 2
+ call multi_pass ; was load ifs (now does nothing)
+ call endfile ; setup fcbs, files, buffers etc
+
+;
+;Reset SysinitPresent flag here. This is needed for the special fix for lying
+;to device drivers. This has been moved up to this point to avoid problems
+;with overlays called from installed programs
+;
+ mov ax,Bios_Data
+ mov es,ax ; point ES to bios data
+
+ assume es:Bios_Data
+
+ mov es:SysinitPresent,0 ; clear SysinitPresent flag
+
+ test install_flag,have_install_cmd ; are there install commands?
+ jz dolast ; no, no need for further processing
+ inc cs:multi_pass_id ; mult_pass_id = 3
+ call multi_pass ; execute install= commands
+dolast:
+ assume es:nothing
+
+; [area] has the segment address for the allocated memory of sysinit, confbot.
+; free the confbot area used for config.sys and sysinit itself.
+
+
+; Now if DOS is supposed to run high, we actually move it into high memory
+; (if HiMem manager is available).
+;
+; There is also this little hack for CPM style DOS calls that needs to
+; be done when A20 is set...
+
+ cmp runhigh, 0ffh ; are we still waiting to be moved?
+ jne @f ; no, our job is over
+ call LoadDOSHiOrLo
+@@:
+
+ cmp runhigh, 0 ; are we running low
+ je @f ; yes, no CPM hack needed
+ call CPMHack ; make ffff:d0 same as 0:c0
+@@:
+
+
+; We are now done with CONFIG.SYS processing
+
+ConfigDone:
+;; let NTVDM knows that we have done config.sys processing
+ xor al, al ;config.sys done
+ BOP BOP_NOTIFICATION ;
+ call AllocUMB ; allocate remaining UMBs if there are any
+ mov cs:[donotshownum],1 ; done with config.sys. do not show line number message.
+ mov es,[area]
+
+ assume es:nothing
+
+ mov ah,49h ; free allocated memory for command.com
+ int 21h
+
+ test cs:[install_flag],has_installed ; sysinit_base installed?
+ jz skip_free_sysinitbase ; no.
+
+;set block from the old_area with impossible_owner_size.
+;this will free the unnecessary sysinit_base that had been put in memory to
+;handle install= command.
+
+ push es
+ push bx
+ mov es,cs:[old_area]
+ mov bx,cs:[impossible_owner_size]
+ mov ah,setblock
+ int 21h
+ mov ax,es
+ dec ax
+ mov es,ax ;point to arena
+ mov es:[arena_owner],8 ;set impossible owner
+ mov word ptr es:[arena_name], 'DS' ; System Data
+ pop bx
+ pop es
+
+skip_free_sysinitbase:
+
+if noexec
+ mov bp,ds ;save command.com segment
+ push ds
+ pop es
+ mov bx,cs
+ sub bx,10h ; point to current php
+ mov ds,bx
+ xor si,si
+ mov di,si
+ mov cx,80h
+ rep movsw ; copy it to new location for shell
+ mov word ptr es:[pdb_jfn_pointer + 2],es ; relocate
+ mov bx,es
+ mov ah,set_current_pdb
+ int 21h ; tell dos we moved it
+ mov es:[pdb_parent_pid],es ;we are the root
+endif ; noexec
+
+ push cs
+ pop ds ; point DS to sysinitseg
+
+ assume ds:sysinitseg
+
+; set up the parameters for command
+
+ mov si,offset command_line+1
+
+if noexec
+ mov di,81h
+else
+ push ds
+ pop es
+ mov di,si
+endif
+
+ mov cl,-1
+comtranlp: ;find length of command line
+ inc cl
+ lodsb
+ stosb ;copy command line in
+ or al,al
+ jnz comtranlp
+ dec di
+ mov al,cr ; cr terminate
+ stosb
+
+if noexec
+ mov es:[80h],cl ; set up header
+ mov al,[default_drive]
+ mov es:[5ch],al
+else
+ mov [command_line],cl ;count
+endif
+
+ mov dx,offset commnd ;now pointing to file description
+
+
+if noexec
+ mov es,bp ;set load address
+ mov bx,100h
+ call dfil ;read in command
+ jc comerr
+ mov ds,bp
+ mov dx,80h
+ mov ah,set_dma ;set disk tranfer address
+ int 21h
+ call DOCLI
+ mov ss,bp
+ mov sp,dx
+ call DOSTI
+ xor ax,ax ;push a word of zeros
+ push ax
+ push bp ;set high part of jump address
+ mov ax,100h
+ push ax ;set low part of jump address
+ retf ;crank up command!
+
+else ; not noexec
+
+; we are going to open the command interpreter and size it as is done in
+; ldfil. the reason we must do this is that sysinit is in free memory. if
+; there is not enough room for the command interpreter,exec will probably
+; overlay our stack and code so when it returns with an error sysinit won't be
+; here to catch it. this code is not perfect (for instance .exe command
+; interpreters are possible) because it does its sizing based on the
+; assumption that the file being loaded is a .com file. it is close enough to
+; correctness to be usable.
+
+ push dx ; save pointer to name
+
+; first, find out where the command interpreter is going to go.
+
+ mov bx,0ffffh
+ mov ah,alloc
+ int 21h ;get biggest piece
+ mov ah,alloc
+ int 21h ; second time gets it
+ jc memerrjx ; oooops
+
+ mov es,ax
+ mov ah,dealloc
+ int 21h ; give it right back
+ mov bp,bx
+
+; es:0 points to block,and bp is the size of the block
+; in para.
+
+; we will now adjust the size in bp down by the size of sysinit. we
+; need to do this because exec might get upset if some of the exec
+; data in sysinit is overlayed during the exec.
+
+ mov bx,[memory_size] ; get location of end of memory
+ mov ax,cs ; get location of beginning of sysinit
+ sub bx,ax ; bx is size of sysinit in para
+ add bx,11h ; add the sysinit php
+ sub bp,bx ; sub sysinit size from amount of free memory
+ jc memerrjx ; if there isn't even this much memory, give up
+
+ mov ax,(open shl 8) ;open the file being execed
+ stc ;in case of int 24
+ int 21h
+ jc comerr ; ooops
+
+ mov bx,ax ;handle in bx
+ xor cx,cx
+ xor dx,dx
+ mov ax,(lseek shl 8) or 2
+ stc ;in case of int 24
+ int 21h ; get file size in dx:ax
+ jc comerr
+ ; convert size in dx:ax to para in ax
+ add ax,15 ; round up size for conversion to para
+ adc dx,0
+ call off_to_para
+ mov cl,12
+ shl dx,cl ; low nibble of dx to high nibble
+ or ax,dx ; ax is now # of para for file
+ add ax,10h ; 100h byte php
+ cmp ax,bp ; will command fit in available mem?
+ jb okld ; jump if yes.
+memerrjx:
+ jmp mem_err
+
+okld:
+ mov ah,close
+ int 21h ; close file
+
+ pop dx ; recover pointer to name
+ push cs ; point es to sysinitseg
+ pop es
+ mov bx,offset comexe ; point to exec block
+ mov word ptr [bx.exec0_com_line+2],cs ; set segments
+ mov word ptr [bx.exec0_5c_fcb+2],cs
+ mov word ptr [bx.exec0_6c_fcb+2],cs
+ xor ax,ax ;load and go
+ mov ah,exec
+ stc ;in case of int 24
+ int 21h ;go start up command
+ endif
+
+; note fall through if exec returns (an error)
+
+comerr:
+ mov dx,offset badcom ;want to print command error
+ extrn badfil:near
+ call badfil
+ public stall
+stall: SVC SVC_DEMEXITVDM ; Will Kill The VDM
+
+;
+;----------------------------------------------------------------------------
+; procedure : AllocFreeMem
+;
+; Allocate Max memory from DOS to find out where to load DOS.
+; DOS is at temporary location when this call is being made
+;
+; Inputs : None
+; Outputs: The biggest chunk of memory is allocated (all mem at init time)
+; [area] & [memhi] set to the para value of the start of the
+; free memory.
+;
+; Uses : AX, BX
+;
+;----------------------------------------------------------------------------
+;
+AllocFreeMem proc near
+
+ assume es:nothing, ds:nothing
+ mov bx,0ffffh
+ mov ah,alloc
+ int 21h ;first time fails
+ mov ah,alloc
+ int 21h ;second time gets it
+ mov [area],ax
+ mov [memhi],ax ; memhi:memlo now points to
+ ret
+ ; start of free memory
+AllocFreeMem endp
+
+; start M000
+ include msbio.cl6
+; end M000
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : LoadDOSHiOrLo
+;
+; Tries to move DOS into HMA. If it fails then loads
+; DOS into Low memory.
+;
+;----------------------------------------------------------------------------
+;
+
+LoadDOSHiOrLo proc near
+ call TryToMovDOSHi ; Try moving it into HMA (M024)
+ jc LdngLo ; If that don't work...
+ ret
+LdngLo:
+ push cs
+ pop ds
+ mov ah, 9
+ mov dx, offset DOSLOMSG ; inform user that we are
+ int 21h ; loading low
+
+ ; actually move the dos, and reinitialize it.
+
+ mov bx, 1 ; M012
+ ; use int 21 alloc for mem
+ call MovDOSLo
+ mov es,[current_dos_location] ; give dos its temporary loc.
+ xor ax,ax ; ax = 00 ---> install stub
+ call cs:dword ptr [dos_segreinit] ; call dos segreinit
+
+ mov runhigh, 0 ; mark that we are running lo
+ ret
+LoadDOSHiOrLo endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : TryToMovDOSHi
+;
+; This tries to move DOS into HMA.
+; Returns CY if it failed.
+; If it succeeds returns with carry cleared.
+;
+;
+;----------------------------------------------------------------------------
+;
+
+ public TryToMovDOSHi
+
+TryToMovDOSHi proc near
+ call MovDOSHi
+ jc ttldhx
+
+
+ mov es,[current_dos_location] ; give dos its temporary loc.
+
+ xor ax,ax ; ax = 00 ---> install stub
+ call cs:dword ptr [dos_segreinit] ; call dos segreinit
+
+ mov runhigh, 1
+ clc
+ttldhx:
+ ret
+TryToMovDOSHi endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : MovDOSHi
+;
+; Tries to allocate HMA and Move DOS/BIOS code into HMA
+;
+; Returns : CY if it failed
+;
+;----------------------------------------------------------------------------
+;
+
+MovDOSHi proc near
+ call AllocHMA
+ jc mdhx ; did we get HMA?
+ mov ax, 0ffffh ; yes, HMA seg = 0ffffh
+ mov es, ax
+
+ ; actually move the BIOS and DOS
+
+ call MovBIOS ; First move BIOS into HMA
+
+ ; ES:DI points to free HMA after BIOS
+
+ mov cx, hi_doscod_size ; pass the code size of DOS
+ ; when it is in HMA
+ call MovDOS ; and move it
+
+ ; ES:DI points to free HMA after DOS
+
+ call SaveFreeHMAPtr ; Save the Free HMA ptr
+ clc
+mdhx:
+ ret
+MovDOSHi endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : MovDOSLo
+;
+; Allocates memory from DOS and moves BIOS/DOS code into it
+;
+;----------------------------------------------------------------------------
+;
+
+
+MovDOSLo proc near
+ call AllocMemForDOS ; incestuosly!!!
+ mov es, ax ; pass the segment to MovBIOS
+ call MovBIOS
+;
+;------ ES:DI points memory immediately after BIOS
+;
+ mov cx, lo_doscod_size ; DOS code size when loaded
+ ; low
+ call MovDOS
+ ret
+MovDOSLo endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : MovBIOS
+;
+; Moves BIOS code into requested segment
+;
+; In : ES - segment to which BIOS is to be moved
+; ( it moves always into offset BCode_Start)
+;
+; Out : ES:DI - pointer to memory immediately after BIOS
+;
+;----------------------------------------------------------------------------
+;
+
+
+MovBIOS proc near
+ mov ds, temp_bcode_seg ; current BIOS code seg
+ mov si, offset BCode_Start
+ mov di, si
+ mov cx, offset BCode_End
+ sub cx, si ; size of BIOS
+ shr cx, 1 ; Both the labels are para
+ ; aligned
+ rep movsw
+ push es
+ push di ; save end of BIOS
+ mov ax, es
+ mov BCodeSeg, ax ; save it for later use
+ call [seg_reinit_ptr] ; far call to seg_reinit (M022)
+ pop di
+ pop es ; get back end of BIOS
+ ret
+MovBIOS endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : MovDOS
+;
+; Moves DOS code into requested area
+;
+; In : ES:DI - pointer to memory where DOS is to be moved
+; CX - size of DOS code to be moved
+;
+; Out : ES:DI - pointer to memory immediately after DOS
+;
+;----------------------------------------------------------------------------
+;
+
+
+MovDOS proc near
+ push es
+ push di
+ lds si, dos_temp_location ; current location of DOS
+ rep movsb
+ pop bx ; get back offset into which
+ ; DOS was moved
+ mov ax, dosinit ; get the offset at which DOS
+ ; wants to run
+ sub ax, bx
+ call off_to_para
+ pop bx ; get the segment at which
+ ; we moved DOS into
+ sub bx, ax ; Adjust segment
+ mov current_dos_location, bx ; and save it
+ ret
+MovDOS endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : AllocMemForDOS
+;
+; Allocate memory for DOS/BIOS code from DOS !!!
+;
+; Out : AX - seg of allocated memoryblock
+;
+;----------------------------------------------------------------------------
+;
+
+
+AllocMemForDOS proc near
+ mov ax, offset BCode_end
+ sub ax, offset BCode_start ; BIOS code size
+ add ax, lo_doscod_size ; + DOS code size
+ add ax, 15
+ call off_to_para ; convert to para
+ or bx, bx ; M012
+ ; can we use int 21 for alloc
+ mov bx, ax
+ jz update_arena ; M012
+ mov ah, 48h ; request DOS
+ int 21h
+ jc FatalErr ; IF ERR WE ARE HOSED
+ sub ax, 3 ; Take care ORG 30h of
+ ; BIOS code
+ mov es, ax
+ mov word ptr es:[20h+arena_owner], 08h ; mark it as system
+ mov word ptr es:[20h+arena_name], 'CS' ; code area
+ ret
+
+;
+; M012 : BEGIN
+;
+update_arena:
+ push ds
+ push di
+ push cx
+ push dx
+ lds di, dosinfo ; get ptr to DOS var
+ dec di
+ dec di ; Arena head is immediately
+ ; before sysvar
+ mov es, ds:[di] ; es = arena head
+ mov cx, es:[arena_size] ; cx = total low mem size
+ cmp cx, bx ; is it sufficient ?
+ jb FatalErr ; no, fatal error
+ mov dl, es:[arena_signature]
+ mov ax, es
+ add ax, bx ; ax = new arena head
+ mov ds:[di], ax ; store it in DOS data area
+ mov ds, ax
+ mov byte ptr ds:[arena_signature], dl ; type of arena
+ mov word ptr ds:[arena_owner], 0 ; free
+ sub cx, bx ; size of the new block
+ mov word ptr ds:[arena_size], cx ; store it in the arena
+ mov ax, es ; return seg to the caller
+ sub ax, 3 ; Take care ORG 30h of
+ ; BIOS code
+ pop dx
+ pop cx
+ pop di
+ pop ds
+ ret
+;
+; M012 : END
+;
+FatalErr:
+ push cs
+ pop ds
+ mov dx, offset FEMsg
+ mov ah, 9h
+ int 21h
+ cli
+ hlt
+AllocMemForDOS endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : AllocHMA
+;
+; grab_the_hma tries to enable a20 and make sure there is memory
+; up there. If it gets any sort of error, it will return with
+; carry set so that we can resort to running low.
+;
+; It also returns ES: -> 0ffffh if it returns success
+;
+;----------------------------------------------------------------------------
+;
+
+AllocHMA proc near
+ assume ds:nothing,es:nothing
+;
+; cas note: The pre-286 check is no longer needed here since the
+; presence of XMS is sufficient. However, this code hasn't
+; been deleted because it can be recycled for skipping the
+; extra pass of CONFIG.SYS and assuming we're running low
+; in the case of a pre-286.
+
+;
+;; see if we're running on a pre-286. If not, force low.
+;
+; xor ax,ax
+; pushf ; save flags (like int)
+; push ax
+; popf
+; pushf
+; pop ax
+; popf ; restore original flags (like int)
+; and ax,0f000h
+; cmp ax,0f000h ; 8088/8086?
+; jz grab_hma_error
+;
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+
+ call IsXMSLoaded
+ jnz grabhma_error
+
+ mov ax,4310h
+ int 2fh ; get the vector into es:bx
+ mov word ptr xms,bx
+ mov word ptr xms+2,es
+
+ mov ah,1 ; request HMA
+ mov dx,0ffffh
+ call xms
+ dec ax
+ jz @f ; error if not able to allocate HMA
+
+;
+;------ Himem may be lying because it has allocated mem for int 15
+;
+ mov ah, 88h
+ int 15h
+ cmp ax, 64 ; less than 64 K of hma ?
+ jb grabhma_error
+
+@@: mov ah,5 ; localenableA20
+ call xms
+ dec ax
+ jnz grabhma_error ; error if couldn't enable A20
+
+ mov ax,0ffffh
+ mov es,ax
+ mov es:word ptr 10h,1234h ; see if we can really read/write there
+ cmp es:word ptr 10h,1234h
+ jnz grabhma_error ; don't try to load there if XMS lied
+
+ clc
+ pop ds
+ ret
+
+grabhma_error:
+ stc
+ pop ds
+ assume ds:nothing
+ ret
+
+AllocHMA endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : IsXMSLoaded
+;
+; Checks whether a XMS driver is loaded
+;
+; Returns : Z flag set if XMS driver loaded
+; Z flag reset if no XMS drivers are present
+;
+;----------------------------------------------------------------------------
+;
+ public IsXMSLoaded
+
+IsXMSLoaded proc near
+ mov ax,4300h
+ int 2fh
+ cmp al,80h ; XMS installed?
+ ret
+IsXMSLoaded endp
+
+;
+;
+;----------------------------------------------------------------------------
+; procedure : FTryToMovDOSHi
+;
+; Called from HMA suballoc calls
+;
+;----------------------------------------------------------------------------
+;
+;
+
+ public FTryToMovDOSHi
+FTryToMovDOSHi proc far
+
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push ds
+ push es
+ cmp runhigh, 0ffh
+ jne @f
+
+ call TryToMovDOSHi
+@@:
+ pop es
+ pop ds
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+
+ ret
+FTryToMovDOSHi endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : SaveFreeHMAPtr
+;
+; Save the Free HMA pointer in BIOS variable for later use.
+; (INT 2f ax==4a01 call returns pointer to free HMA)
+; Normalizes the pointer to ffff:xxxx format and stores only
+; the offset.
+;
+; Inputs : ES:DI - pointer to free HMA
+; Output : FreeHMAPtr in BIOS data segment updated
+;
+;----------------------------------------------------------------------------
+;
+SaveFreeHMAPtr proc near
+ mov bx, es
+ mov ax, 0ffffh ; HMA segment
+ sub ax, bx
+ add di, 15 ; para round
+ and di, 0fff0h
+ mov cl, 4
+ shl ax, cl
+ sub di, ax
+ push ds
+ mov ax, Bios_Data
+ mov ds, ax
+ assume ds:Bios_Data
+ mov FreeHMAPtr, di
+ mov inHMA, 0ffh
+ pop ds
+ assume ds:nothing
+ ret
+SaveFreeHMAPtr endp
+;
+;
+;----------------------------------------------------------------------------
+;
+; procedure : CPMHack
+;
+; Copies the code from 0:c0 into ffff:0d0h
+; for CPM comatibilty
+;
+;----------------------------------------------------------------------------
+;
+CPMHack proc near
+ push ds
+ mov cx, 0ffffH
+ mov es, cx ; ES = FFFF
+ xor cx, cx
+ mov ds, cx ; DS = 0
+ mov si, 0c0h
+ mov di, 0d0h
+ mov cx, 5
+ cld
+ rep movsb ; move 5 bytes from 0:C0 to FFFF:D0
+ pop ds
+ ret
+CPMHack endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : off_to_para
+;
+;----------------------------------------------------------------------------
+;
+
+off_to_para proc near
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ ret
+off_to_para endp
+
+
+;** TempCDS - Create (Temporary?) CDS
+;
+; ENTRY ?? BUGBUG
+; (DS) = SysInitSeg
+; EXIT ?? BUGBUG
+; USES ?? BUGBUG
+
+ public tempcds
+Procedure TempCDS
+
+ assume ds:sysinitseg
+ les di,dosinfo
+ mov cl,byte ptr es:[di.sysi_numio]
+ xor ch,ch ; (cx) = # of block devices
+ mov es:[di.sysi_ncds],cl ; one CDS per device
+ mov al,cl
+ mov ah,size curdir_list
+ mul ah ; (ax) = byte size for those CDSs
+ call pararound ; (ax) = paragraph size for CDSs
+ mov si,[confbot]
+; BUGBUG - we don't update confbot - won't someone else use it?
+ sub si,ax
+ mov [alloclim],si ; can't alloc past here!
+ mov word ptr es:[di.sysi_cds + 2],si
+ mov ax,si
+ mov word ptr es:[di.sysi_cds],0 ; set address of CDS list
+ assume ds:nothing
+ mov es,ax
+ xor di,di ; (es:di) = address of 1st CDS
+
+
+
+;* Initialize our temporary CDSs.
+;
+; (cx) = count of CDSs left to process
+; (si) = 0 based drive being processed
+; (es:di) = address of next CDS
+
+fooset:
+ xor dx,dx ; indicator to stop removable checks
+foogo:
+ mov ax,word ptr DirStrng
+ .errnz CURDIR_TEXT ; setup the root as the curdir
+ stosw
+ mov ax,word ptr DirStrng+2
+ stosw
+ xor ax,ax
+ push cx
+ .errnz CURDIR_FLAGS - CURDIR_TEXT - size CURDIR_TEXT
+ mov cx,curdir_flags - 4
+ rep stosb ; zero out rest of CURDIR_TEXTs
+
+; Here es:di points to CURDIR_FLAGS
+
+ or dx,dx ; have we found one fixed drive?
+ jnz fixed_drv2 ; NZ -> yes dont do IOCTL check
+
+ cmp byte ptr DirStrng, 'B'
+ jbe not_fixed ; 'A' and 'B' are always removable
+
+ mov bl,byte ptr DirStrng
+ sub bl,'A'
+ inc bl ; C is 3
+ mov ax,4408h
+ int 21h ; Is drive removable
+ jc fixed_drv ; Could'nt find means NET hence fixed
+ or ax,ax
+ jnz fixed_drv
+
+not_fixed:
+ mov ax,CURDIR_LOCAL OR CURDIR_INUSE
+ jmp short fill_in
+
+
+fixed_drv:
+ inc dx
+fixed_drv2:
+ mov ax,CURDIR_LOCAL OR CURDIR_INUSE OR CURDIR_NT_FIX
+
+fill_in:
+
+ FOLLOWS CURDIR_FLAGS,CURDIR_TEXT,2
+ stosw ; Save Flags
+
+ mov ax,2
+ FOLLOWS CURDIR_END,CURDIR_FLAGS,2
+ stosw ; Save CURDIR_END
+
+ inc byte ptr DirStrng
+ pop cx
+ loop foogo
+ mov byte ptr DirStrng,"A"
+ ret
+
+EndProc TempCDS
+
+
+;** EndFile - Build DOS structures
+;
+; This procedure is called after the config.sys has been processed and
+; installable device drivers have been loaded (but before "install="
+; programs are loaded) to create the dos structures such as SFTs, buffers,
+; FCBs, CDSs, etc. It also loads the sysinit_base module in low memory
+; to allow for the safe EXECing of "install=" programs. All memory
+; above these structures is deallocated back to DOS.
+;
+; ENTRY ?? BUGBUG
+; EXIT ?? BUGBUG
+; USES ?? BUGBUG
+
+
+;------------------------------------------------------------------------------
+; allocate files
+;------------------------------------------------------------------------------
+
+endfile:
+
+; we are now setting up final cdss,buffers,files,fcss strings etc. we no
+; longer need the space taken by the temp stuff below confbot,so set alloclim
+; to confbot.
+
+; if this procedure has been called to take care of install= command,
+; then we have to save es,si registers.
+
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+
+ cmp multrk_flag,multrk_off1 ;=0,multrack= command entered?
+ jne multrk_flag_done
+ or multrk_flag,multrk_on ; default will be on.
+multrk_flag_done:
+
+ pop ds
+ assume ds:nothing
+
+ mov ax,[confbot]
+ mov [alloclim],ax
+
+ push cs
+ pop ds
+ extrn round:near
+ call round
+ mov al,[files]
+ sub al,5
+ jbe dofcbs
+
+ push ax
+ mov al,devmark_files
+ call setdevmark ; set devmark for sfts (files)
+ pop ax
+ xor ah,ah ; do not use cbw instruction!!!!!
+ ; it does sign extend.
+ mov bx,[memlo]
+ mov dx,[memhi]
+ lds di,dosinfo ;get pointer to dos data
+ lds di,[di+sysi_sft] ;ds:bp points to sft
+ mov word ptr [di+sflink],bx
+ mov word ptr [di+sflink+2],dx ;set pointer to new sft
+
+ push cs
+ pop ds
+
+ les di,dword ptr [memlo] ;point to new sft
+ mov word ptr es:[di+sflink],-1
+ mov es:[di+sfcount],ax
+ mov bl,size sf_entry
+ mul bl ;ax = number of bytes to clear
+ mov cx,ax
+ add [memlo],ax ;allocate memory
+ mov ax,6
+ add [memlo],ax ;remember the header too
+ or [setdevmarkflag],for_devmark
+ call round ; check for mem error before the stosb
+ add di,ax
+ xor ax,ax
+ rep stosb ;clean out the stuff
+
+;------------------------------------------------------------------------------
+; allocate fcbs
+;------------------------------------------------------------------------------
+
+dofcbs:
+ push cs
+ pop ds
+ call round
+ mov al,devmark_fcbs ;='x'
+ call setdevmark
+ mov al,[fcbs]
+ xor ah,ah ; do not use cbw instruction!!!!!
+ ; it does sign extend.
+ mov bx,[memlo]
+ mov dx,[memhi]
+ lds di,dosinfo ;get pointer to dos data
+ assume ds:nothing
+
+ mov word ptr [di+sysi_fcb],bx
+ mov word ptr [di+sysi_fcb+2],dx ;set pointer to new table
+ mov bl,cs:keep
+ xor bh,bh
+ mov [di+sysi_keep],bx
+
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+ les di,dword ptr [memlo] ;point to new table
+ mov word ptr es:[di+sflink],-1
+ mov es:[di+sfcount],ax
+ mov bl,size sf_entry
+ mov cx,ax
+ mul bl ;ax = number of bytes to clear
+ add [memlo],ax ;allocate memory
+ mov ax,size sf-2
+ add [memlo],ax ;remember the header too
+ or [setdevmarkflag],for_devmark
+ call round ; check for mem error before the stosb
+ add di,ax ;skip over header
+ mov al,"A"
+fillloop:
+ push cx ; save count
+ mov cx,size sf_entry ; number of bytes to fill
+ cld
+ rep stosb ; filled
+
+ mov word ptr es:[di-(size sf_entry)+sf_ref_count],0
+ mov word ptr es:[di-(size sf_entry)+sf_position],0
+ mov word ptr es:[di-(size sf_entry)+sf_position+2],0
+
+ pop cx
+ loop fillloop
+
+;------------------------------------------------------------------------------
+; allocate cdss
+;------------------------------------------------------------------------------
+buf1:
+ call round
+
+ push ax
+ mov ax,devmark_cds ;='l'
+ call setdevmark
+ pop ax
+
+ les di,dosinfo
+ mov cl,byte ptr es:[di.sysi_numio]
+
+;NTVDM Ignore the lastdrive command. There exists only one cds for all
+; network drives and dos has already set sysi_numio to be
+; num real drives + 1 for all network drives 17-Aug-1992 Jonle
+;
+; cmp cl,[num_cds]
+; jae gotncds ; user setting must be at least numio
+; mov cl,[num_cds]
+;gotncds:
+;
+ xor ch,ch
+ mov es:[di.sysi_ncds],cl
+ mov ax,[memhi]
+ mov word ptr es:[di.sysi_cds + 2],ax
+ mov ax,[memlo]
+ mov word ptr es:[di.sysi_cds],ax
+ mov al,cl
+ mov ah,size curdir_list
+ mul ah
+ call pararound
+ add [memhi],ax
+
+ or [setdevmarkflag],for_devmark
+ call round ; check for mem error before initializing
+ assume ds:nothing
+ les di,es:[di.sysi_cds]
+ call fooset
+
+;------------------------------------------------------------------------------
+; allocate space for internal stack
+;------------------------------------------------------------------------------
+
+ if stacksw
+
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+doinstallstack:
+ mov ax,[stack_count] ; stack_count = 0?
+ or ax,ax ;then,stack size must be 0 too.
+ jz skipstack ;don't install stack.
+
+; dynamic relocation of stack code.
+
+ call round ;[memhi] = seg. for stack code
+ ;[memlo] = 0
+
+; set devmark block into memory for mem command
+; devmark_id = 's' for stack
+
+ mov al,devmark_stk ;='s'
+ call setdevmark
+
+ mov ax,[memhi]
+ mov es,ax ;es -> seg. the stack code is going to move.
+ assume es:nothing
+ push cs
+ pop ds
+ xor si,si ;!!we know that stack code is at the beginning of sysinit.
+ xor di,di
+ mov cx,offset endstackcode
+ mov [memlo],cx
+ call round ;have enough space for relocation?
+ rep movsb
+
+ push ds ; stick the location of the NextStack entry
+ mov ax,Bios_Data ; into the Win386 Instance Data tables
+ mov ds,ax
+ assume ds:Bios_Data
+ mov word ptr NextStack,offset nextentry
+ mov word ptr NextStack+2,es
+
+ mov ax,[memlo]
+ mov word ptr [stack_addr],ax ;set for stack area initialization
+ mov word ptr IT_StackLoc,ax ; pass it as Instance Data, too
+ mov ax,[memhi] ;this will be used by stack_init routine.
+ mov word ptr [stack_addr+2],ax
+ mov word ptr IT_StackLoc+2,ax
+
+; space for internal stack area = stack_count(entrysize + stack_size)
+
+ mov ax,entrysize
+ add ax,[stack_size]
+ mul [stack_count]
+
+ mov IT_StackSize,ax ; pass through to Instance Tables
+
+ pop ds ; no more need to access Instance Table
+ assume ds:nothing
+
+ call pararound ; convert size to pargraphs
+ add [memhi],ax
+ or [setdevmarkflag],for_devmark ;to set the devmark_size for stack by round routine.
+ call round ; check for memory error before
+ ; continuing
+ call stackinit ; initialize hardware stack. cs=ds=sysinitseg,es=relocated stack code & data
+
+skipstack:
+ endif
+
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+ mov al,[files]
+ xor ah,ah ; do not use cbw instruction!!!!!
+ ; it does sign extend.
+ mov cx,ax
+ xor bx,bx ;close standard input
+ mov ah,close
+ int 21h
+;; go directly to the handle table; donot close any invalid handles
+ push si
+ mov ah, Get_Current_PDB ;
+ int 21h
+ les si, es:[pdb_jfn_pointer]
+ mov bx, 2
+rcclloop:
+ cmp byte ptr es:[bx][si], 0FFh ;skip invalid handle
+ je skip_the_handle
+ mov ah,close ; need output so we can print message
+ int 21h ; in case we can't get new one open.
+skip_the_handle:
+ inc bx
+ loop rcclloop
+ pop si
+
+ mov dx,offset condev
+ mov al,2
+ mov ah,open ;open con for read/write
+ stc ; set for possible int 24
+ int 21h
+ jnc goaux
+ call badfil
+ jmp short goaux2
+
+goaux: push ax
+ mov bx,1 ;close standard output
+ mov ah,close
+ int 21h
+ pop ax
+
+ mov bx,ax ;new device handle
+ mov ah,xdup
+ int 21h ;dup to 1,stdout
+ mov ah,xdup
+ int 21h ;dup to 2,stderr
+
+goaux2: mov dx,offset auxdev
+ mov al,2 ;read/write access
+ extrn open_dev:near
+ call open_dev
+
+ mov dx,offset prndev
+ mov al,1 ;write only
+ call open_dev
+
+;global rearm command for shared interrupt devices attached in the system;
+;shared interrupt attachment has some problem when it issues interrupt
+;during a warm reboot. once the interrupt is presented by the attachment,
+;no further interrupts on that level will be presented until a global rearm
+;is issued. by the request of the system architecture group, msbio will
+;issue a global rearm after every device driver is loaded.
+;to issue a global rearm: ;for pc1,xt,palace
+;
+; out 02f2h,xx ; interrupt level 2
+; out 02f3h,xx ; interrupt level 3
+; out 02f4h,xx ; interrupt level 4
+; out 02f5h,xx ; interrupt level 5
+; out 02f6h,xx ; interrupt level 6
+; out 02f7h,xx ; interrupt level 7
+;
+; for pc at,in addition to the above commands,
+; need to handle the secondary interrupt handler
+;
+; out 06f2h,xx ; interrupt level 10
+; out 06f3h,xx ; interrupt level 11
+; out 06f4h,xx ; interrupt level 12
+; out 06f6h,xx ; interrupt level 14
+; out 06f7h,xx ; interrupt level 15
+;
+; for round-up machine
+;
+; none.
+
+; where xx stands for any value.
+;
+; for your information,after naples level machine,the system service bios
+; call (int 15h),function ah=0c0h returns the system configuration parameters
+;
+;
+; Sudeepb 31-Dec-1991 Commented out for NT
+if 0
+ push ax
+ push bx
+ push dx
+ push es
+
+ mov al,0ffh ;reset h/w by writing to port
+ mov dx,2f2h ;get starting address
+ out dx,al ; out 02f2h,0ffh
+ inc dx
+ out dx,al ; out 02f3h,0ffh
+ inc dx
+ out dx,al ; out 02f4h,0ffh
+ inc dx
+ out dx,al ; out 02f5h,0ffh
+ inc dx
+ out dx,al ; out 02f6h,0ffh
+ inc dx
+ out dx,al ; out 02f7h,0ffh
+
+;sb secondary global rearm
+
+ mov ax,0f000h ;get machine type
+ mov es,ax
+ cmp byte ptr es:[0fffeh],0fch ;q:is it a at type machine
+ je startrearm ; *if at no need to check
+
+ mov ah,0c0h ;get system configuration
+ int 15h ; *
+ jc finishrearm ; *jmp if old rom
+
+; test feature byte for secondary interrupt controller
+
+ test es:[bx.bios_sd_featurebyte1],scndintcontroller
+ je finishrearm ;jmp if it is there
+
+startrearm:
+ mov al,0ffh ;write any pattern to port
+ mov dx,6f2h ;get starting address
+ out dx,al ;out 06f2h,0ffh
+ inc dx ;bump address
+ out dx,al ;out 06f3h,0ffh
+ inc dx ;bump address
+ out dx,al ;out 06f4h,0ffh
+ inc dx ;bump address
+ inc dx ;bump address
+ out dx,al ;out 06f6h,0ffh
+ inc dx ;bump address
+ out dx,al ;out 06f7h,0ffh
+
+finishrearm:
+ pop es
+ pop dx
+ pop bx
+ pop ax
+endif
+
+; global rearm end *******************
+
+;------------------------------------------------------------------------------
+; allocate sysinit_base for install= command
+;------------------------------------------------------------------------------
+; sysinit_base allocation.
+; check if endfile has been called to handle install= command.
+
+set_sysinit_base:
+
+;--------------------------------------------------------------------------
+;sysinit_base will be established in the secure area of
+;lower memory when it handles the first install= command.
+;sysinit_base is the place where the actual exec function will be called and
+;will check sysinit module in high memory if it is damaged by the application
+;program. if sysinit module has been broken,then "memory error..." message
+;is displayed by sysinit_base.
+;--------------------------------------------------------------------------
+
+ push ax ; set devmark for mem command
+ mov ax,[memhi]
+ sub ax,[area]
+ mov [impossible_owner_size],ax ;remember the size in case.
+ mov al,devmark_inst
+ call setdevmark
+ pop ax
+
+ mov di,[memhi]
+ mov es,di
+ assume es:nothing
+ mov word ptr [sysinit_base_ptr+2],di ; save this entry for the next use.
+ xor di,di
+ mov word ptr [sysinit_base_ptr],di ; es:di -> destination.
+ mov si,offset sysinit_base ;ds:si -> source code to be relocated.
+ mov cx,(offset end_sysinit_base) - (offset sysinit_base)
+ add [memlo],cx
+ or cs:[setdevmarkflag],for_devmark
+ call round ; check mem error. also,readjust memhi for the next use.
+ rep movsb ; reallocate it.
+
+ mov word ptr [sysinit_ptr],offset sysinitptr ; returing address from
+ mov word ptr [sysinit_ptr+2],cs ; sysinit_base back to sysinit.
+ or [install_flag],has_installed ; set the flag.
+
+;------------------------------------------------------------------------------
+; free the rest of the memory from memhi to confbot. still from confbot to
+; the top of the memory will be allocated for sysinit and config.sys if
+; have_install_cmd.
+;------------------------------------------------------------------------------
+
+ call round
+ mov bx,[memhi]
+ mov ax,[area]
+ mov [old_area],ax ; save [area]
+ mov es,ax ;calc what we needed
+ sub bx,ax
+ mov ah,setblock
+ int 21h ;give the rest back
+
+ push es
+ mov ax,es
+ dec ax
+ mov es,ax ;point to arena
+ mov es:[arena_owner],8 ;set impossible owner
+ mov word ptr es:[arena_name], 'DS' ; System Data
+ pop es
+
+ mov bx,0ffffh
+ mov ah,alloc
+ int 21h
+ mov ah,alloc
+ int 21h ; allocate the rest of the memory
+
+ mov [memhi],ax ; start of the allocated memory
+ mov [memlo],0 ; to be used next.
+
+;;;; at this moment,memory from [memhi]:0 to top-of-the memory is
+;;;; allocated.
+;;;; to protect sysinit,confbot module (from confbot (or =alloclim at
+;;;; this time) to the top-of-the memory),here we are going to
+;;;; 1). "setblock" from memhi to confbot.
+;;;; 2). "alloc" from confbot to the top of the memory.
+;;;; 3). "free alloc memory" from memhi to confbot.
+
+;memory allocation for sysinit,confbot module.
+
+ mov es,ax
+ mov bx,[confbot]
+ sub bx,ax ; confbot - memhi
+ dec bx ; make a room for the memory block id.
+ dec bx ; make sure!!!.
+ mov ah,setblock
+ int 21h ; this will free (confbot to top of memory)
+ mov bx,0ffffh
+ mov ah,alloc
+ int 21h
+ mov ah,alloc
+ int 21h ; allocate (confbot to top of memory)
+ mov [area],ax ; save allocated memory segment.
+ ; need this to free this area for command.com.
+ mov es,[memhi]
+ mov ah,49h ; free allocated memory.
+ int 21h ; free (memhi to confbot(=area))
+
+endfile_ret:
+ ret
+
+; End of "EndFile" DOS structure configuration.
+
+
+;-------------------------------------------------------------------------
+; Do_Install_Exec
+;
+; This procedure is used to EXEC a program being loaded via the
+; "install=" mechanism in config.sys. It does this by setting up
+; the parameters, and then jumping to sysinit_base, which has been
+; setup in low memory. When complete, sysinit_base will jump back
+; up to this procedure (if sysinit remains uncorrupted by the installed
+; program).
+
+do_install_exec proc near ; now,handles install= command.
+
+ push si ; save si for config.sys again.
+
+; we are going to call load/exec function.
+; set es:bx to the parameter block here;;;;;;;
+; set ds:dx to the asciiz string. remember that we already has 0
+; after the filename. so parameter starts after that. if next
+; character is a line feed (i.e. 10),then assume that the 0
+; we already encountered used to be a carrage return. in this
+; case,let's set the length to 0 which will be followed by
+; carridge return.
+
+; es:si -> command line in config.sys. points to the first non blank
+;character after =.
+
+ push es
+ push ds
+ pop es
+ pop ds ; es->sysinitseg,ds->confbot seg
+ assume ds:nothing
+ mov dx,si ; ds:dx->file name,0 in config.sys image.
+
+ xor cx,cx
+ cld
+ mov cs:ldexec_start,' ' ; clear out the parm area
+ mov di,offset ldexec_parm
+installfilename: ; skip the file name
+ lodsb ; al = ds:si; si++
+ cmp al,0
+ je got_installparm
+ jmp installfilename
+got_installparm: ; copy the parameters to ldexec_parm
+ lodsb
+ mov es:[di],al
+ cmp al,lf ; line feed?
+ je done_installparm
+ inc cl ; # of char. in the parm.
+ inc di
+ jmp got_installparm
+done_installparm:
+ mov byte ptr cs:[ldexec_line],cl ; length of the parm.
+ cmp cl,0 ;if no parm,then
+ jne install_seg_set ; let the parm area
+ mov byte ptr cs:[ldexec_start],cr ; starts with cr.
+install_seg_set:
+ mov word ptr cs:0,0 ; make a null environment segment
+ mov ax,cs ; by overlap jmp instruction of sysinitseg.
+
+;hkn; the environment pointer is made 0. so the current environment ptr.
+;hkn; will be the same as pdb_environ which after dosinit is 0.
+
+ mov cs:[instexe.exec0_environ],0 ; set the environment seg.
+
+
+ mov word ptr cs:[instexe.exec0_com_line+2],ax ; set the seg.
+ mov word ptr cs:[instexe.exec0_5c_fcb+2],ax
+ mov word ptr cs:[instexe.exec0_6c_fcb+2],ax
+ call sum_up
+ mov es:checksum,ax ; save the value of the sum
+ xor ax,ax
+ mov ah,exec ; load/exec
+ mov bx,offset instexe ; es:bx -> parm block.
+ push es ; save es,ds for load/exec
+ push ds ; these registers will be restored in sysinit_base.
+ jmp cs:dword ptr sysinit_base_ptr ; jmp to sysinit_base to execute
+ ; load/exec function and check sum.
+
+;j.k. this is the returning address from sysinit_base.
+
+sysinitptr: ; returning far address from sysinit_base
+ pop si ; restore si for config.sys file.
+ push es
+ push ds
+ pop es
+ pop ds ; now ds - sysinitseg,es - confbot
+ jnc exec_exit_code
+
+
+ push si ; error in loading the file for install=.
+ call badload ; es:si-> path,filename,0.
+ pop si
+ jmp short install_exit_ret
+
+exec_exit_code:
+ mov ah,4dh
+ int 21h
+ cmp ah,3 ;only accept "stay resident" prog.
+ je install_exit_ret
+ call error_line ;inform the user
+
+ stc
+
+install_exit_ret:
+ ret
+
+do_install_exec endp
+
+
+
+;** ParaRound - Round Up length to paragraph multiple
+;
+; ParaRound rounds a byte count up to a multiple of 16, then divides
+; by 16 yielding a "length in paragraphs" value.
+;
+; ENTRY (ax) = byte length
+; EXIT (ax) = rounded up length in paragraphs
+; USES ax, flags
+
+Procedure ParaRound
+
+ add ax,15
+ rcr ax,1
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ ret
+
+EndProc ParaRound
+
+
+;------------------------------------------------------------------------------
+; sysinit_base module.
+;
+; This module is relocated by the routine EndFile to a location in low
+; memory. It is then called by SYSINIT to perform the EXEC of programs
+; that are being loaded by the "install=" command. After the EXEC call
+; completes, this module performs a checksum on the SYSINIT code (at the
+; top of memory) to be sure that the EXECed program did not damage it.
+; If it did, then this module will print an error message and stop the
+; system. Otherwise, it returns control to SYSINIT.
+;
+;
+;in: after relocation,
+; ax = 4b00h - load and execute the program dos function.
+; ds = confbot. segment of config.sys file image
+; es = sysinitseg. segment of sysinit module itself.
+; ds:dx = pointer to asciiz string of the path,filename to be executed.
+; es:bx = pointer to a parameter block for load.
+; SI_end (byte) - offset vaule of end of sysinit module label
+; bigsize (word) - # of word from confbot to SI_end.
+; chksum (word) - sum of every byte from confbot to SI_end in a
+; word boundary moduler form.
+; sysinit_ptr (dword ptr) - return address to sysinit module.
+;
+;note: sysinit should save necessary registers and when the control is back
+
+ public sysinit_base
+sysinit_base:
+ mov word ptr cs:sysinit_base_ss,ss ; save stack
+ mov word ptr cs:sysinit_base_sp,sp
+ int 21h ; load/exec dos call.
+ mov ss,word ptr cs:sysinit_base_ss ; restore stack
+ mov sp,word ptr cs:sysinit_base_sp
+ pop ds ; restore confbot seg
+ pop es ; restore sysinitseg
+ jc sysinit_base_end ; load/exec function failed.
+ ; at this time,i don't have to worry about
+ ; that sysinit module has been broken or not.
+ call sum_up ; otherwise,check if it is good.
+ cmp es:checksum,ax
+ je sysinit_base_end
+
+; memory broken. show "memory allocation error" message and stall.
+
+ mov ah,9
+ push cs
+ pop ds
+ mov dx,offset mem_alloc_err_msgx - sysinit_base
+ int 21h
+ jmp $ ; hang here!!!!
+
+sysinit_base_end: jmp es:sysinit_ptr ;return back to sysinit module
+
+sum_up:
+
+;in: es - sysinitseg.
+;out: ax - result
+;
+;remark: since this routine will only check starting from "locstack" to the end of
+; sysinit segment,the data area, and the current stack area are not
+; coverd. in this sense,this check sum routine only gives a minimal
+; gaurantee to be safe.
+;
+;first sum up confbot seg.
+
+ push ds
+ mov ax,es:confbot
+ mov ds,ax
+ xor si,si
+ xor ax,ax
+ mov cx,es:config_size ; if config_size has been broken,then this
+ ;whole test better fail.
+ shr cx,1 ; make it a word count
+ jz sum_sys_code ; when config.sys file not exist.
+sum1:
+ add ax,ds:word ptr [si]
+ inc si
+ inc si
+ loop sum1
+;now,sum up sysinit module.
+sum_sys_code:
+ mov si,offset locstack ; starting after the stack.
+ ; this does not cover the possible stack code!!!
+ mov cx,offset sysinitgrp:SI_end ; SI_end is the label at the end of sysinit
+ sub cx,si ; from after_checksum to SI_end
+ shr cx,1
+sum2:
+ add ax,es:word ptr [si]
+ inc si
+ inc si
+ loop sum2
+ pop ds
+ ret
+
+sysinit_base_ss equ $-sysinit_base
+ dw ?
+sysinit_base_sp equ $-sysinit_base
+ dw ?
+mem_alloc_err_msgx:
+
+ include msbio.cl4 ; memory allocation error message
+
+end_sysinit_base label byte
+
+;------------------------------------------------------------------------------
+; ibmstack initialization routine.
+ if stacksw
+.sall
+;
+; to follow the standard interrupt sharing scheme, msstack.asm
+; has been modified. this initialization routine also has to
+; be modified because for the interrupt level 7 and 15, firstflag
+; should be set to signal that this interrupt handler is the
+; first handler hooked to this interrupt vector.
+; we determine this by looking at the instruction pointed by
+; this vector. if it is iret, then this handler should be the
+; first one. in our case, only the interrupt vector 77h is the
+; interrupt level 15. (we don't hook interrupt level 7.)
+;
+; the followings are mainly due to m.r.t; ptm fix of p886 12/3/86
+; some design changes are needed to the above interrupt sharing
+; method. the above sharing scheme assumes that 1). interrupt
+; sharing is never done on levels that have bios support. 2). "phantom"
+; interrupts would only be generated on levels 7 and 15.
+; these assumptions are not true any more. we have to use the firstflag
+; for every level of interrupt. we will set the firstflag on the following
+; conditions:
+;
+; a. if the cs portion of the vector is 0000, then "first"
+; b. else if cs:ip points to valid shared header, then not "first"
+; c. else if cs:ip points to an iret, then "first"
+; d. else if cs:ip points to dummy, then "first"
+;
+; where dummy is - the cs portion must be f000, and the ip portion must
+; be equal to the value at f000:ff01. this location is the initial value
+; from vector_table for interrupt 7, one of the preserved addresses in all
+; the bioses for all of the machines.
+;
+; system design group requests bios to handle the phantom interrupts.
+;
+; the "phantom" interrupt is an illegal interrupt such as an interrupt
+; produced by the bogus adapter card even without interrupt request is
+; set. more specifically, 1). the 8259 has a feature when running in
+; edge triggered mode to latch a pulse and present the interrupt when
+; the processor indicates interrupt acknowledge (inta). the interrupt
+; pulse was exist at the time of inta to get a "phantom" interrupt.
+; 2). or, this is caused by adapter cards placing a glitch on the
+; interrupt line.
+;
+; to handle those "phantom" interrupts, the main stack code will check
+; the own firstflag, and if it is not "first" (which means the forward
+; pointer points to the legal shared interrupt handler), then pass the
+; control. if it is the first, then the following action should be
+; taken. we don't have to implement skack logic in this case.
+;
+; to implement this logic, we rather choose a simple method.
+; if ont of the above "firstflag" conditions is met, we are not
+; going to hook this interrupt vector. the reason is if the original
+; vector points to "iret" and do nothing, we don't need
+; to implement the stack logic for it. this will simplify implementation
+; while maintaining compatibility with the old version of dos.
+; this implies that in the main stack code, there might be a stack code
+; that will never be used, a dead code.
+;
+;in - cs, ds -> sysinitseg, es -> relocated stack code & data.
+
+ page
+ assume ds:sysinitseg
+stackinit proc near
+
+ push ax
+ push ds
+ push es
+ push bx
+ push cx
+ push dx
+ push di
+ push si
+ push bp
+
+;currently es -> stack code area
+
+ mov ax, cs:[stack_count] ;defined in cs
+ mov es:[stackcount], ax ;defined in stack code area
+ mov ax, [stack_size] ;in cs
+ mov es:[stacksize], ax
+ mov ax, word ptr cs:[stack_addr] ; offset
+ mov word ptr es:[stacks], ax
+ mov ax, word ptr cs:[stack_addr+word] ; segment
+ mov word ptr es:[stacks+word], ax
+
+; initialize the data fields with the parameters
+
+; "firstentry" will always be at stacks
+
+ mov bp, word ptr es:stacks ; get offset of stack
+ mov es:firstentry,bp
+
+; the stacks will always immediately follow the table entries
+
+ mov ax,entrysize
+ mov cx,es:stackcount
+ mul cx
+ add ax,bp
+ mov es:stackat,ax
+ mov bx,ax
+ sub bx,2
+
+; zero the entire stack area to start with
+
+ mov di,es:stackat
+ mov ax,es:stacksize
+ mul cx
+ mov cx,ax
+ xor ax,ax
+ push es
+ pop ds ;ds = relocated stack code seg.
+ assume ds:nothing
+
+;now, ds -> stack code area
+
+ mov es, word ptr ds:[stacks+2] ; get segment of stack area.
+ cld
+ rep stosb
+
+ mov cx, ds:stackcount
+
+; loop for "count" times, building a table entry
+; cs = sysinitseg, ds = relocated stack code seg , es = segment of stack space
+; cx = number of entries
+; es:bp => base of stacks - 2
+; es:bx => first table entry
+
+buildloop:
+ mov es:byte ptr allocbyte[bp],free
+ mov es:byte ptr intlevel[bp],al ;ax = 0
+ mov es:word ptr savedsp[bp],ax
+ mov es:word ptr savedss[bp],ax
+ add bx,ds:stacksize
+ mov es:word ptr newsp[bp],bx
+ mov es:[bx],bp
+ add bp,entrysize
+
+ loop buildloop
+
+ sub bp,entrysize
+ mov ds:lastentry,bp
+ mov ds:nextentry,bp
+
+; NTVDM support for pc convertable is NOT NEEDED 10-Aug-1992 Jonle
+; push ds
+; mov ax, 0f000h ;look at the model byte
+; mov ds, ax
+; cmp ds:byte ptr [0fffeh], mdl_convert ;convertible?
+; pop ds
+; jne skip_disablenmis
+;
+; mov al,07h ; disable convertible nmis
+; out 72h,al
+;
+;skip_disablenmis:
+
+ xor ax,ax
+ mov es,ax ;es - segid of vector table at 0
+ assume es:nothing ;ds - relocated stack code segment
+
+ call DOCLI
+
+ irp aa,<02,70>
+
+ mov si,aa&h*4 ;pass where vector is to be adjusted
+ mov di, offset int19old&aa ;we have to set old&aa for int19 handler too.
+ mov bx,offset old&aa ;pass where to save original owner pointer
+ mov dx,offset int&aa ;pass where new handler is
+ call new_init_loop ;adjust the vector to new handler,
+ ; saving pointer to original owner
+ endm
+
+
+ ; NTVDM int 08, 09, special handling 24-Jan-1993 Jonle
+ ;
+ ; These Ints are usually done in the macro above with int 02,70
+ ; However, we don't need stack swapping as long as no device
+ ; driver has hooked it. These ints are also left alone so that
+ ; softpc will know if they have been hooked by an app.
+
+ mov si, 09h*4
+ mov ax, word ptr es:[si+0]
+ cmp word ptr old09, ax
+ jne do_I9StkSwap
+ mov ax, word ptr es:[si+2]
+ cmp word ptr old09+2, ax
+ je skip_I9StkSwap
+do_I9StkSwap:
+ mov di, offset int19old09
+ mov bx,offset old09
+ mov dx,offset int09
+ call new_init_loop
+skip_I9StkSwap:
+
+ mov si, 08h*4
+ mov ax, word ptr es:[si+0]
+ cmp word ptr old08, ax
+ jne do_I8StkSwap
+ mov ax, word ptr es:[si+2]
+ cmp word ptr old08+2, ax
+ je skip_I8StkSwap
+do_I8StkSwap:
+ mov di, offset int19old08
+ mov bx,offset old08
+ mov dx,offset int08
+ call new_init_loop
+skip_I8StkSwap:
+
+
+ irp aa,<0a,0b,0c,0d,0e,72,73,74,76,77> ;shared interrupts
+
+ mov si,aa&h*4 ;pass where vector is to be adjusted
+ push ds ;save relocated stack code segment
+ lds bx, es:[si] ;ds:bx -> original interrupt handler
+ push ds
+ pop dx ;dx = segment value
+
+ cmp dx,0
+ jz int&aa&_first
+
+ cmp byte ptr ds:[bx],0cfh ;does vector point to an iret?
+ jz int&aa&_first
+
+ cmp word ptr ds:[bx.6],424bh ;magic offset (see int&aa, msstack.inc)
+ jz int&aa&_not_first
+
+ cmp dx,0f000h ;rom bios segment
+ jnz int&aa&_not_first
+
+ push es
+ push dx
+ mov dx,0f000h
+ mov es,dx
+ cmp bx,word ptr es:0ff01h
+ pop dx
+ pop es
+ jz int&aa&_first
+
+int&aa&_not_first: ;not the first. we are going to hook vector.
+ pop ds
+ mov di, offset int19old&aa ;we have to set old&aa for int19 handler too.
+ mov bx, offset old&aa ;pass where to save original owner pointer
+ mov dx, offset int&aa ;pass where new handler is
+ call new_init_loop ;adjust the vector to new handler, saving
+ ;pointer to original owner.
+ jmp short int&aa&_end
+int&aa&_first: ;the first. don't have to hook stack code.
+ pop ds
+int&aa&_end:
+
+ endm
+
+; NTVDM support for pc convertable is NOT NEEDED 10-Aug-1992 Jonle
+; push ds
+; mov ax, 0f000h ;loook at the model byte
+; mov ds, ax
+; cmp ds:byte ptr [0fffeh], mdl_convert ;pc convertible?
+; pop ds
+; jne skip_enablenmis
+;
+; mov al,27h ; enable convertible nmis
+; out 72h,al
+;
+; skip_enablenmis:
+
+ call DOSTI
+ mov ax,Bios_Data
+ mov ds,ax
+ assume ds:Bios_Data
+
+
+ mov [int19sem],1 ; indicate that int 19
+ ; initialization is complete
+
+ pop bp ; restore all
+ pop si
+ pop di
+ pop dx
+ pop cx
+ pop bx
+
+ pop es
+ pop ds
+ assume ds:sysinitseg
+
+ pop ax
+ ret
+stackinit endp
+
+new_init_loop proc near
+
+;input: si=ofset into vector table of the particular int vector being adjusted
+; bx=ds:offset of oldxx, where will be saved the pointer to original owner
+; dx=ds:offset of intxx, the new interrupt handler
+; di=offset value of int19old&aa variable in bios.
+; es=zero, segid of vector table
+; ds=relocated stack code segment
+
+ mov ax,es:[si+0] ;remember offset in vector
+ mov word ptr ds:[bx],ax ; to original owner in ds
+ mov ax,es:[si+2] ;remember segid in vector
+ mov word ptr ds:[bx]+2,ax ; to original owner in ds
+
+ push ds
+ mov ax,Bios_Data
+ mov ds,ax ;set int19oldxx value in bios for
+ mov ax,es:[si+0] ;int 19 handler
+ mov word ptr ds:[di],ax
+ mov ax,es:[si+2]
+ mov word ptr ds:[di]+2,ax
+ pop ds
+
+ mov word ptr es:[si+0],dx ;set vector to point to new int handler
+ mov es:[si+2],ds
+ ret
+new_init_loop endp
+
+
+.xall
+ endif
+;------------------------------------------------------------------------------
+ public setdevmark
+setdevmark proc
+
+;set the devmark for mem command.
+;in: [memhi] - the address to place devmark
+; [memlo] = 0
+; al = id for devmark_id
+;out: devmark established.
+; the address saved in cs:[devmark_addr]
+; [memhi] increase by 1.
+
+ push es
+ push cx
+
+ mov cx,cs:[memhi]
+ mov cs:[devmark_addr],cx
+ mov es,cx
+ mov es:[devmark_id],al
+ inc cx
+ mov es:[devmark_seg],cx
+
+ pop cx
+ pop es
+ inc cs:[memhi]
+ ret
+setdevmark endp
+
+
+ ifdef TAIWAN
+
+;---------------------
+; entry : none
+; exit : ax = 0 --> oem local driver not found
+; = 1 --> oem local driver found
+; destore : ds,es,bx,cx,dx,si,di
+; description :
+; search config.sys to find oem local driver.
+; oem local driver should in \csi\driver\ directory .
+; if (found oem local driver in config.sys)
+; ax=1;
+; else
+; ax=0;
+; return;
+; ps. please see state diagram for state description.
+;---------------------
+
+chkoemlocaldrv proc near
+ push es
+ push ds
+ push bx
+ push cx
+ push dx
+ push di
+ push si
+ call chkconfig
+ pop si
+ pop di
+ pop dx
+ pop cx
+ pop bx
+ pop ds
+ pop es
+ ret
+chkoemlocaldrv endp
+
+config_sys db "C:\CONFIG.SYS",0
+sizeofconfig dw 0
+filehandle dw 0
+workingmemptr dw 0
+deviceid db "DEVICE"
+csidrvid db "CSI\DRIVER\"
+localdrvname dw 0
+chkconfig proc near
+ call preprocess
+ jnc initstate
+ jmp notfoundret
+
+;
+; processing config.sys
+;
+; state 0
+; ds:si --> current line ( end of line is oah or 0dh )
+
+initstate:
+ mov si,dx
+state_0:
+ push cs
+ pop es
+ mov di,offset deviceid
+ mov cx,3
+ repz cmpsw
+ jz state_1
+ mov ax,0ffffh
+ jmp state_10
+state_1:
+ lodsb
+ cmp al,' '
+ jz state_1
+ cmp al,'='
+ jz state_2
+state_10a:
+ jmp state_10
+state_2:
+ lodsb
+ cmp al,' '
+ jz state_2
+ cmp al,'\'
+ jz state_5
+ cmp al,'A'
+ jb state_10a
+ cmp al,'z'
+ ja state_10a
+state_3:
+ dec si
+ mov cs:[localdrvname],si
+ inc si
+state_4:
+ lodsb
+ cmp al,':'
+ jz state_6
+ jmp state_10
+state_5:
+ dec si
+ mov cs:[localdrvname],si
+ inc si
+ jmp state_7
+state_6:
+ lodsb
+ cmp al,'\'
+ jz state_7
+ cmp al,'c'
+ jne state_10a
+ inc si
+state_7:
+ mov di,offset csidrvid
+ mov cx,11
+ repz cmpsb
+ jnz state_10a
+state_8:
+ lodsb
+ cmp al,'1'
+ jb state_10
+ cmp al,'z'
+ ja state_10
+state_9:
+tryopenlocaldrv:
+ mov dx,cs:[localdrvname]
+ mov si,dx
+chknextbyte:
+ lodsb
+ cmp al,0h
+ jz openfile
+ cmp al,' '
+ jne chknextbyte
+ dec si
+ mov byte ptr ds:[si],0
+openfile:
+ mov ax,3d00h ; open config.sys
+ stc
+ int 21h
+ jc notfoundret
+ mov bx,ax ; bx = file handle
+ mov ah,3eh
+ int 21h ; close local driver
+ jc notfoundret
+ jmp foundret
+
+state_10:
+ cmp al,1ah ; look current char. == eof ?
+ jz notfoundret
+ lodsb
+ cmp al,0
+ jz newlinestate
+ cmp al,1ah
+ jz notfoundret
+ jmp state_10
+newlinestate:
+ lodsb
+ cmp al,1ah
+ jz notfoundret
+ cmp al,0
+ jz newlinestate
+ dec si
+ jmp state_0
+notfoundret:
+ mov ax,0
+ jmp freemem
+foundret:
+ mov ax,1
+freemem:
+ push ax
+ call freememory
+ pop ax
+ ret
+
+chkconfig endp
+
+preprocess proc near
+ push cs
+ pop ds
+ mov dx,offset config_sys
+ mov ax,3d00h ; open config.sys
+ stc
+ int 21h
+ jc errorfile
+
+; get size of config.sys
+
+ mov bx,ax ; bx = file handle
+ mov cs:[filehandle],bx
+ xor cx,cx
+ xor dx,dx
+ mov ax,4202h ; move file ptr
+ int 21h
+ mov cs:[sizeofconfig],ax ; ax == size of config.sys
+ xor dx,dx ; ignore more than 64k of config
+ mov ax,4200h ; mov file ptr to beginning of file
+ int 21h
+
+; allocate for config.sys
+
+ mov ax,cs:[sizeofconfig]
+ add ax,15 ; change to para
+ rcr ax,1
+ shr ax,1
+ shr ax,1
+ shr ax,1
+ add ax,20h
+ mov bx,ax ; size of memory in para
+ mov ah,48h
+ int 21h
+ jc memerr
+ ; ax --> free memory
+ mov cs:[workingmemptr],ax
+
+; read config.sys
+
+ mov bx,cs:[filehandle] ; file handle
+ mov cx,cs:[sizeofconfig] ; byte count of reading
+ xor dx,dx
+ mov ds,ax ; ds:dx --> buffer
+ mov ah,3fh
+ int 21h
+ jc errorfile
+
+; translate to upper case
+
+ call transtoupper
+ clc
+ ret
+errorfile:
+memerr:
+ stc
+ ret
+preprocess endp
+
+; entry : ds:dx --> buffer
+; exit : none
+; description : translate all letter in buffer to upper type
+; ps ,don't change ds:dx
+
+transtoupper proc near
+ cld
+ mov cx,cs:[sizeofconfig]
+ mov si,dx
+transnext:
+ lodsb
+ cmp al,'A'
+ jb chklfcr
+ cmp al,'z'
+ ja chkcounter
+ sub al,'a'-'A'
+ mov ds:[si-1],al
+ jmp chkcounter
+chklfcr:
+ cmp al,0dh
+ jz setzero
+ cmp al,0ah
+ jz setzero
+ jmp chkcounter
+setzero:
+ mov al,0
+ mov ds:[si-1],al
+chkcounter:
+ loop transnext
+ ret
+transtoupper endp
+
+;entry : none ( free memory block ptr in [workingmem] )
+;exit : none
+
+freememory proc near
+ mov ax,cs:[workingmemptr]
+ mov es,ax
+ mov ah,49h
+ int 21h
+ ret
+freememory endp
+
+
+; name : maketempvector
+; entry : es:bx -->
+; dd original int 9 vector ( offfset ,segment )
+; dd original int 10h vector ( offfset ,segment )
+; dd original int 16h vector ( offfset ,segment )
+;
+; exit : none
+; description : 1. save local driver table in static area
+; 2. make temp. vector for int9 ,10h ,16h
+;
+oemdriverinst dw 0
+orgvectblptr dd 0
+
+ db 0eah
+dummyint9 dd 0
+ db 0eah
+dummyint10h dd 0
+ db 0eah
+dummyint16h dd 0
+
+csiint9 dd 0
+csiint10h dd 0
+csiint16h dd 0
+
+maketempvector proc near
+ push ds
+ push ax
+ push di
+ push si
+ push cx
+
+; save table ptr
+
+ mov word ptr cs:[orgvectblptr],bx
+ mov word ptr cs:[orgvectblptr+2],es
+ cmp cs:oemdriverinst,0
+ jnz ignoreint9
+
+; make temp. vector for int 9 ,
+
+ mov bx,9 ; int #
+ push cs
+ pop es
+ mov di,offset csiint9 ; es:di --> store area for csi vector
+ push cs
+ pop ds
+ mov si,offset dummyint9 ; ds:si --> dummy int service
+ call dummyvector
+
+ignoreint9:
+
+; make temp. vector for int 10h
+
+ mov bx,10h ; int #
+ push cs
+ pop es
+ mov di,offset csiint10h ; es:di --> store area for csi vector
+ push cs
+ pop ds
+ mov si,offset dummyint10h ; ds:si --> dummy int service
+ call dummyvector
+
+; make temp. vector for int 16h
+
+ mov bx,16h ; int #
+ push cs
+ pop es
+ mov di,offset csiint16h ; es:di --> store area for csi vector
+ push cs
+ pop ds
+ mov si,offset dummyint16h ; ds:si --> dummy int service
+ call dummyvector
+ pop cx
+ pop si
+ pop di
+ pop ax
+ pop ds
+ ret
+
+
+maketempvector endp
+
+;name : dummyvector
+; entey : ds:si --> dummy int sevice routine
+; es:di --> point to csi vector store area
+; bx == int number
+; exit : none
+; description :
+; setting dummy vector of int 9 ,10h,16h
+; for recover csi vector
+; /* phase 1*/
+; [ds:si]=[0:bx*4]
+; [ds:si+2]=[0:bx*4+2]
+; /* phase 2*/
+; [es:di]=[0:bx*4]
+; [es:di+2]=[0:bx*4+2]
+; /* phase 2*/
+; [0:bx*4]=si-1;
+; [0:bx*4+2]=ds;
+
+dummyvector proc near
+ shl bx,1 ; bx <- bx*4
+ shl bx,1 ; ie ,get offset of vector
+
+; phase 1
+; es --> 0
+; es:bx --> cpu int vector table
+
+ xor ax,ax
+ push es
+ mov es,ax
+ mov ax,es:[bx] ; get offset ds-->0
+ mov ds:[si],ax ; store offset
+ mov ax,es:[bx+2] ; get offset ds-->0
+ mov ds:[si+2],ax ; store segment
+ pop es
+
+; phase 2
+; ds --> 0
+; ds:bx --> cpu int vector table
+
+ xor ax,ax
+ push ds
+ mov ds,ax
+ mov ax,ds:[bx] ; get offset
+ mov es:[di],ax ; store offset
+ mov ax,ds:[bx+2] ; get offset
+ mov es:[di+2],ax ; store segment
+ pop ds
+
+; phase 3
+; es --> 0
+; es:bx --> cpu int vector table
+
+ xor ax,ax
+ push es
+ mov es,ax
+ dec si
+ mov es:[bx],si
+ mov ax,ds
+ mov es:[bx+2],ax
+ pop es
+ ret
+dummyvector endp
+
+; name : recovercsiint
+; entry : none
+; exit :none
+; description :
+; recover int 9 ,10h,16h ,for csi vector
+
+recovercsiint proc near
+ push es
+ push ds
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+
+;recover int 9
+
+ cmp cs:oemdriverinst,0
+ jnz ignoreint9recover
+
+ push cs
+ pop ds
+ mov si,offset dummyint9
+ push cs
+ pop es
+
+ mov di,offset csiint9
+ mov bx,9
+ mov ax,0
+ call recoverint
+ignoreint9recover:
+
+; recover int 10h
+
+ push cs
+ pop ds
+ mov si,offset dummyint10h
+ push cs
+ pop es
+ mov di,offset csiint10h
+ mov bx,10h
+ mov ax,0+4
+ call recoverint
+
+;recover int 16h
+
+ push cs
+ pop ds
+ mov si,offset dummyint16h
+ push cs
+ pop es
+ mov di,offset csiint16h
+ mov bx,16h
+ mov ax,0+4+4
+ call recoverint
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ pop ds
+ pop es
+ ret
+recovercsiint endp
+
+; name : recoverint
+; entey : ds:si --> dummy int sevice routine
+; es:di --> point to csi vector store area
+; bx == int number
+; ax == 0 ; int 9
+; 4 ; int 10h
+; 4+4 ; int 16h
+; exit : none
+; description :
+; 1. if( [0:bx*4] == si-1 .and. [es:bx*4+2] == ds )
+; {
+; [0:bx*4] = [es:di];
+; [0:bx*4+2] = [es:di+2];
+; }
+; else
+; {
+; /* phase 1 */
+; [ds:si] = [(*orgvectblptr)+ax]
+; [ds:si+2]= [(*orgvectblptr)+ax+2];
+; /* phase 2 */
+; [orgvectblptr+ax) ]=[0:bx*4] ;
+; [orgvectblptr+ax+2 ]=[0:bx*4+2] ;
+; /* phase 3 */
+; [0:bx*4] = [es:di];
+; [0:bx*4+2] = [es:di+2];
+;
+;
+; }
+
+;
+
+recoverint proc near
+;chek vector change ?
+; es --> 0
+
+ push es
+ mov cx,ax
+ xor ax,ax
+ mov es,ax
+ shl bx,1
+ shl bx,1 ; es:bx --> cpu int vector
+ mov ax,si
+ dec ax
+ cmp es:[bx],ax ; offset same ?
+ jne vectorbechanged
+
+ mov ax,ds
+ cmp es:[bx+2],ax ; segmnet same ?
+ jne vectorbechanged
+ pop es
+
+; vector not be changed
+; ds --> 0
+
+ xor ax,ax
+ mov ds,ax ; ds:bx --> cpu int vector
+ mov ax,es:[di]
+ mov ds:[bx],ax
+ mov ax,es:[di+2]
+ mov ds:[bx+2],ax
+ ret
+
+vectorbechanged:
+
+;phase 1
+; di:es --> addres of local driver
+
+ pop es
+ push di
+ push es
+ mov di,word ptr cs:[orgvectblptr]
+ mov es,word ptr cs:[orgvectblptr+2]
+ add di,cx
+ mov ax,es:[di]
+ mov ds:[si],ax
+ mov ax,es:[di+2]
+ mov ds:[si+2],ax
+
+;phase2
+; di:es --> addres of local driver
+; ds --> 0
+
+ push ds
+ xor ax,ax
+ mov ds,ax
+ mov ax,ds:[bx] ; ds:bx --> cpu int vector
+ mov es:[di],ax
+ mov ax,ds:[bx+2]
+ mov es:[di+2],ax
+ pop ds
+ pop es
+ pop di
+
+;phase3
+; ds --> 0
+
+ xor ax,ax
+ push ds
+ mov ds,ax
+ mov cx,es:[di]
+ mov ds:[bx],cx ; ds:bx --> cpu int vector
+ mov cx,es:[di+2]
+ mov ds:[bx+2],cx
+ pop ds
+ ret
+
+recoverint endp
+
+;name : chklocalexist
+;entry : none
+;exit :none
+; descriptin : check local driver exist ?
+; if not exist system halt !
+; otherwise null return
+
+chklocalexist proc near
+ push ax
+ push cx
+ push dx
+ mov ah,0dbh
+ mov al,80h ; module_extsysutil
+ mov cx,01 ; syscmd_extquerysysmode
+ int 16h
+ test ax,8000h ; bit 15 on
+ jnz csisystemerror ; no,system halt
+ ; yes ,dx == country id
+ push dx ; save current id
+ mov dx,58h
+ mov ah,0dbh
+ mov al,80h ; module_extsysutil
+ mov cx,02 ; syscmd_extsetsysmode
+ int 16h
+ test ax,8000h ; bit 15 on
+ jnz localdrvnotfound ; no ,local driver error
+
+ pop cx
+ cmp cx,dx ; current id == previous id ?
+ jnz localdrvnotfound ; no ,local driver error
+
+ pop dx
+ pop cx
+ pop ax
+ ret
+
+localdrvnotfound:
+csisystemerror:
+ push cs
+ pop ds
+ mov dx,offset bootfailmsg
+ mov ah,9
+ int 21h
+ cli
+ hlt
+ ret
+
+chklocalexist endp
+ endif
+
+sysinitseg ends
+ end
diff --git a/private/mvdm/dos/v86/doskrnl/bios/sysinit2.asm b/private/mvdm/dos/v86/doskrnl/bios/sysinit2.asm
new file mode 100644
index 000000000..3439dd2ed
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/bios/sysinit2.asm
@@ -0,0 +1,1609 @@
+ page ,160
+title bios system initialization
+
+;
+;----------------------------------------------------------------------------
+;
+; Modification history
+;
+; 26-Feb-1991 sudeepb Ported for NT DOSEm
+;----------------------------------------------------------------------------
+
+
+ include version.inc ; set version build flags
+ include biosseg.inc ; establish bios segment structure
+
+lf equ 10
+cr equ 13
+tab equ 9
+
+; the following depends on the positions of the various letters in switchlist
+
+switchnum equ 11111000b ; which switches require number
+
+ include syscall.inc
+ include doscntry.inc
+ include devsym.inc
+ include ioctl.inc
+ include devmark.inc ; needed
+
+
+stacksw equ true ;include switchable hardware stacks
+
+ if ibmjapver
+noexec equ true
+ else
+noexec equ false
+ endif
+
+
+sysinitseg segment public
+
+assume cs:sysinitseg,ds:nothing,es:nothing,ss:nothing
+
+ extrn badopm:byte,crlfm:byte,badcom:byte,badmem:byte,badblock:byte
+ extrn badsiz_pre:byte,badld_pre:byte
+
+ extrn dosinfo:dword
+ extrn memory_size:word,fcbs:byte,keep:byte
+ extrn default_drive:byte,confbot:word,alloclim:word
+ extrn buffers:word,zero:byte,sepchr:byte
+ extrn files:byte
+ extrn count:word,chrptr:word
+ extrn bufptr:byte,memlo:word,prmblk:byte,memhi:word
+ extrn ldoff:word,area:word,packet:byte,unitcount:byte,
+ extrn break_addr:dword,bpb_addr:dword,drivenumber:byte
+ extrn com_level:byte, cmmt:byte, cmmt1:byte, cmmt2:byte
+ extrn cmd_indicator:byte
+ extrn donotshownum:byte
+ extrn multdeviceflag:byte
+ extrn devmark_addr:word
+ extrn setdevmarkflag:byte
+ extrn org_count:word
+
+ extrn pararound:near
+ extrn getchr:near
+ extrn stall:near
+ extrn error_line:near
+
+ extrn DevEntry:dword
+
+ insert_blank db 0 ; M051: indicates that blank has been
+ ; M051: inserted
+
+ public int24,open_dev,organize,mem_err,newline,calldev,badload
+ public prndev,auxdev,config,commnd,condev,getnum,badfil,prnerr
+ public round,delim,print
+ public parseline,
+ public setdoscountryinfo,set_country_path,move_asciiz
+ public cntry_drv,cntry_root,cntry_path
+ public delim
+ public pathstring
+
+ public MseDev ; NTVDM internal mouse driver
+
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : parseline
+;
+; entry point is parseline. al contains the first character in command line.
+;
+;----------------------------------------------------------------------------
+;
+
+parseline proc near
+ ; don't get character first time
+ push ds
+
+ push cs
+ pop ds
+ assume ds:sysinitseg
+
+nextswtch:
+ cmp al,cr ; carriage return?
+ jz done_line
+ cmp al,lf ; linefeed?
+ jz put_back ; put it back and done
+
+; anything less or equal to a space is ignored.
+
+ cmp al,' ' ; space?
+ jbe get_next ; skip over space
+ cmp al,'/'
+ jz getparm
+ stc ; mark error invalid-character-in-input
+ jmp short exitpl
+
+getparm:
+ call check_switch
+ mov word ptr switches,bx ; save switches read so far
+ jc swterr
+
+get_next:
+ call getchr
+ jc done_line
+ jmp nextswtch
+
+swterr:
+ jmp short exitpl ; exit if error
+
+done_line:
+ test word ptr switches,flagdrive ; see if drive specified
+ jnz okay
+ stc ; mark error no-drive-specified
+ jmp short exitpl
+
+okay:
+; mov ax,word ptr switches
+; and ax,0003h ; get flag bits for changeline and non-rem
+; mov word ptr deviceparameters.dp_deviceattributes,ax
+; mov word ptr deviceparameters.dp_tracktableentries, 0
+; clc ; everything is fine
+; call setdeviceparameters
+exitpl:
+ pop ds
+ ret
+
+put_back:
+ inc count ; one more char to scan
+ dec chrptr ; back up over linefeed
+ jmp short done_line
+
+parseline endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : check_switch
+;
+; 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 proc near
+
+ call getchr
+ jc err_check
+ and al,0dfh ; convert it to upper case
+ cmp al,'A'
+ jb err_check
+ cmp al,'Z'
+ ja err_check
+
+ push es
+
+ push cs
+ pop es
+
+ mov cl,byte ptr switchlist ; get number of valid switches
+ mov ch,0
+ mov di,1+offset switchlist ; point to string of valid switches
+ repne scasb
+
+ pop es
+ jnz err_check
+
+ mov ax,1
+ shl ax,cl ; set bit to indicate switch
+ mov bx,word ptr switches ; get switches so far
+ or bx,ax ; save this with other switches
+ mov cx,ax
+ test ax, switchnum ; test against switches that require number to follow
+ jz done_swtch
+
+ call getchr
+ jc err_swtch
+
+ cmp al,':'
+ jnz err_swtch
+
+ call getchr
+ push bx ; preserve switches
+ mov byte ptr cs:sepchr,' ' ; allow space separators
+ call getnum
+ mov byte ptr cs:sepchr,0
+ pop bx ; restore switches
+
+; because getnum does not consider carriage-return or line-feed as ok, we do
+; not check for carry set here. if there is an error, it will be detected
+; further on (hopefully).
+
+ call process_num
+
+done_swtch:
+ clc
+ ret
+
+err_swtch:
+ xor bx,cx ; remove this switch from the records
+err_check:
+ stc
+ ret
+
+check_switch endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : process_num
+;
+; 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. zero is ok for form factor and drive, however.
+;
+;----------------------------------------------------------------------------
+;
+
+process_num proc near
+ test word ptr switches,cx ; if this switch has been done before,
+ jnz done_ret ; ignore this one.
+ test cx,flagdrive
+ jz try_f
+ mov byte ptr drive,al
+ jmp short done_ret
+
+try_f:
+ test cx,flagff
+ jz try_t
+
+; ensure that we do not get bogus form factors that are not supported
+
+; mov byte ptr deviceparameters.dp_devicetype,al
+ jmp short done_ret
+
+try_t:
+ or ax,ax
+ jz done_ret ; if number entered was 0, assume default value
+ test cx,flagcyln
+ jz try_s
+
+; mov word ptr deviceparameters.dp_cylinders,ax
+ jmp short done_ret
+
+try_s:
+ test cx,flagseclim
+ jz try_h
+ mov word ptr slim,ax
+ jmp short done_ret
+
+; must be for number of heads
+
+try_h:
+ mov word ptr hlim,ax
+
+done_ret:
+ clc
+ ret
+
+process_num endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : organize
+;
+;----------------------------------------------------------------------------
+;
+ assume ds:nothing, es:nothing
+organize proc near
+
+ mov cx,[count]
+ jcxz nochar1
+ call mapcase
+ xor si,si
+ mov di,si
+ xor ax,ax
+ mov com_level, 0
+
+;org1: call get ;skip leading control characters
+; cmp al,' '
+; jb org1
+org1:
+ call skip_comment
+ jz end_commd_line ; found a comment string and skipped.
+ call get2 ; not a comment string. then get a char.
+ cmp al, lf
+ je end_commd_line ; starts with a blank line.
+ cmp al, ' '
+ jbe org1 ; skip leading control characters
+ jmp short findit
+
+end_commd_line:
+ stosb ; store line feed char in buffer for the linecount.
+ mov com_level, 0 ; reset the command level.
+ jmp org1
+
+nochar1:
+ stc
+ ret
+
+findit:
+ push cx
+ push si
+ push di
+ mov bp,si
+ dec bp
+ mov si,offset comtab ;prepare to search command table
+ mov ch,0
+findcom:
+ mov di,bp
+ mov cl,[si]
+ inc si
+ jcxz nocom
+ repe cmpsb
+ lahf
+ add si,cx ;bump to next position without affecting flags
+ sahf
+ lodsb ;get indicator letter
+ jnz findcom
+ cmp byte ptr es:[di], cr ;the next char might be cr,lf
+ je gotcom0 ; such as in "rem",cr,lf case.
+ cmp byte ptr es:[di], lf
+ je gotcom0
+ push ax
+ mov al, byte ptr es:[di] ;now the next char. should be a delim.
+ call delim
+ pop ax
+ jnz findcom
+gotcom0:
+ pop di
+ pop si
+ pop cx
+ jmp short gotcom
+
+nocom:
+ pop di
+ pop si
+ pop cx
+ mov al,'Z'
+ stosb ; save indicator char.
+skip_line:
+ call get2
+ cmp al, lf ; skip this bad command line
+ jne skip_line
+ jmp end_commd_line ; handle next command line
+
+gotcom: stosb ;save indicator char in buffer
+ mov cmd_indicator, al ; save it for the future use.
+
+org2: call get2 ;skip the commad name until delimiter
+ cmp al, lf
+ je org21
+ cmp al, cr
+ je org21
+
+ call delim
+ jnz org2
+ jmp short org3
+
+org21: ;if cr or lf then
+ dec si ; undo si, cx register
+ inc cx ; and continue
+
+org3:
+ cmp cmd_indicator, 'Y' ; comment= command?
+ je get_cmt_token
+ cmp cmd_indicator, 'I' ; install= command?
+ je org_file
+ cmp cmd_indicator, 'D' ; device= command?
+ je org_file
+ cmp cmd_indicator, 'S' ; shell= is a special one!!!
+ je org_file
+ cmp cmd_indicator, '1' ; switches= command?
+ je org_switch
+
+ jmp org4
+
+org_switch:
+ call skip_comment
+ jz end_commd_line_brdg
+
+ call get2
+ call org_delim
+ jz org_switch
+
+ stosb
+ jmp org5
+
+org_file: ; get the filename and put 0 at end,
+ call skip_comment
+ jz org_put_zero
+
+ call get2 ; not a comment
+ call delim
+ jz org_file ; skip the possible delimeters
+
+ stosb ; copy the first non delim char found in buffer
+
+org_copy_file:
+ call skip_comment ; comment char in the filename?
+ jz org_put_zero ; then stop copying filename at that point
+
+ call get2
+ cmp al, '/' ; a switch char? (device=filename/xxx)
+ je end_file_slash ; this will be the special case.
+
+ stosb ; save the char. in buffer
+ call delim
+ jz end_copy_file
+
+ cmp al, ' '
+ ja org_copy_file ; keep copying
+ jmp short end_copy_file ; otherwise, assume end of the filename.
+
+get_cmt_token: ; get the token. just max. 2 char.
+ call get2
+ cmp al, ' ' ; skip white spaces or "=" char.
+ je get_cmt_token ; (we are allowing the other special
+ cmp al, tab ; charaters can used for comment id.
+ je get_cmt_token ; character.)
+ cmp al, '=' ; = is special in this case.
+ je get_cmt_token
+ cmp al, cr
+ je get_cmt_end ; cannot accept the carridge return
+ cmp al, lf
+ je get_cmt_end
+
+ mov cmmt1, al ; store it
+ mov cmmt, 1 ; 1 char. so far.
+ call get2
+ cmp al, ' '
+ je get_cmt_end
+ cmp al, tab
+ je get_cmt_end
+ cmp al, cr
+ je get_cmt_end
+ cmp al, lf
+ je end_commd_line_brdg
+
+ mov cmmt2, al
+ inc cmmt
+
+get_cmt_end:
+ call get2
+ cmp al, lf
+ jne get_cmt_end ; skip it.
+
+end_commd_line_brdg: jmp end_commd_line ; else jmp to end_commd_line
+
+org_put_zero: ; make the filename in front of
+ mov byte ptr es:[di], 0 ; the comment string to be an asciiz.
+ inc di
+ jmp end_commd_line ; (maybe null if device=/*)
+
+end_file_slash: ; al = "/" option char.
+ mov byte ptr es:[di],0 ; make a filename an asciiz
+ inc di ; and
+ stosb ; store "/" after that.
+ jmp short org5 ; continue with the rest of the line
+
+end_copy_file:
+ mov byte ptr es:[di-1], 0 ; make it an asciiz and handle the next char.
+ cmp al, lf
+ je end_commd_line_brdg
+ jmp short org5
+
+org4: ; org4 skips all delimiters after the command name except for '/'
+ call skip_comment
+ jz end_commd_line_brdg
+
+ call get2
+ call org_delim ; skip delimiters except '/' (mrw 4/88)
+ jz org4
+ jmp short org51
+
+org5: ; rest of the line
+ call skip_comment ; comment?
+ jz end_commd_line_brdg
+ call get2 ; not a comment.
+
+org51:
+ stosb ; copy the character
+ cmp al, '"' ; a quote ?
+ je at_quote
+ cmp al, ' '
+ ja org5
+ ; M051 - Start
+
+ cmp cmd_indicator, 'U' ; Q: is this devicehigh
+ jne not_dh ; N:
+ cmp al, lf ; Q: is this line feed
+ je org_dhlf ; Y: stuff a blank before the lf
+ cmp al, cr ; Q: is this a cr
+ jne org5 ; N:
+ mov byte ptr es:[di-1], ' ' ; overwrite cr with blank
+ stosb ; put cr after blank
+ inc [insert_blank] ; indicate that blank has been
+ ; inserted
+ jmp org5
+not_dh: ; M051 - End
+
+ cmp al, lf ; line feed?
+ je org1_brdg ; handles the next command line.
+ jmp org5 ; handles next char in this line.
+
+org_dhlf: ; M051 - Start
+ cmp [insert_blank], 1 ; Q:has a blank already been inserted
+ je org1_brdg ; Y:
+ mov byte ptr es:[di-1], ' ' ; overwrite lf with blank
+ stosb ; put lf after blank
+ ; M051 - End
+
+org1_brdg:
+ mov [insert_blank], 0 ; M051: clear blank indicator for
+ ; M051: devicehigh
+ jmp org1
+
+at_quote:
+ cmp com_level, 0
+ je up_level
+ mov com_level, 0 ; reset it.
+ jmp org5
+
+up_level:
+ inc com_level ; set it.
+ jmp org5
+
+organize endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : get2
+;
+;----------------------------------------------------------------------------
+;
+get2 proc near
+ jcxz noget
+ mov al,es:[si]
+ inc si
+ dec cx
+od_ret:
+ ret
+noget:
+ pop cx
+ mov count,di
+ mov org_count, di
+ xor si,si
+ mov chrptr,si
+ng_ret:
+ ret
+get2 endp
+
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : skip_comment
+;
+;skip the commented string until lf, if current es:si-> a comment string.
+;in) es:si-> sting
+; cx -> length.
+;out) zero flag not set if not found a comment string.
+; zero flag set if found a comment string and skipped it. al will contain
+; the line feed charater at this moment when return.
+; ax register destroyed.
+; if found, si, cx register adjusted accordingly.
+;
+;----------------------------------------------------------------------------
+;
+skip_comment proc near
+
+ jcxz noget ; get out of the organize routine.
+ cmp com_level, 0 ; only check it if parameter level is 0.
+ jne no_commt ; (not inside quotations)
+
+ cmp cmmt, 1
+ jb no_commt
+
+ mov al, es:[si]
+ cmp cmmt1, al
+ jne no_commt
+
+ cmp cmmt, 2
+ jne skip_cmmt
+
+ mov al, es:[si+1]
+ cmp cmmt2, al
+ jne no_commt
+
+skip_cmmt:
+ jcxz noget ; get out of organize routine.
+ mov al, es:[si]
+ inc si
+ dec cx
+ cmp al, lf ; line feed?
+ jne skip_cmmt
+
+no_commt:
+ ret
+
+skip_comment endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : delim
+;
+;----------------------------------------------------------------------------
+;
+delim proc near
+ cmp al,'/' ; ibm will assume "/" as an delimeter.
+ jz delim_ret
+
+ cmp al, 0 ; special case for sysinit!!!
+ jz delim_ret
+
+org_delim: ; used by organize routine except for getting
+ cmp al,' ' ;the filename.
+ jz delim_ret
+ cmp al,9
+ jz delim_ret
+ cmp al,'='
+ jz delim_ret
+ cmp al,','
+ jz delim_ret
+ cmp al,';'
+delim_ret:
+ ret
+delim endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : newline
+;
+; newline returns with first character of next line
+;
+;----------------------------------------------------------------------------
+;
+
+newline proc near
+
+ call getchr ;skip non-control characters
+ jc nl_ret
+ cmp al,lf ;look for line feed
+ jnz newline
+ call getchr
+nl_ret:
+ ret
+
+newline endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : mapcase
+;
+;----------------------------------------------------------------------------
+;
+mapcase proc near
+ push cx
+ push si
+ push ds
+
+ push es
+ pop ds
+
+ xor si,si
+
+convloop:
+ lodsb
+
+ ifdef DBCS
+ call testkanj
+ jz normconv ; if this is not lead byte
+
+ mov ah,al
+ lodsb ; get tail byte
+ cmp ax,DB_SPACE
+ jnz @f ; if this is not dbcs space
+ mov word ptr [si-2],' ' ; set 2 single space
+@@:
+
+ dec cx
+ jcxz convdone ;just ignore 1/2 kanji error
+ jmp short noconv
+
+;fall through, know al is not in 'a'-'z' range
+
+normconv:
+ endif
+
+ cmp al,'a'
+ jb noconv
+ cmp al,'z'
+ ja noconv
+ sub al,20h
+ mov [si-1],al
+noconv:
+ loop convloop
+
+convdone:
+ pop ds
+ pop si
+ pop cx
+ ret
+
+ ifdef DBCS
+
+ public testkanj
+testkanj:
+ push si
+ push ds
+
+ push ax
+ mov ax,6300h ; get dos dbcs vector
+ int 21h
+ pop ax
+
+bdbcs_do:
+
+ cmp ds:word ptr [si],0 ; end of lead byte info?
+ jz bdbcs_notfound ; jump if so
+ cmp al,ds:[si] ; less than first byte character?
+ jb bdbcs_next ; jump if not
+ cmp al,ds:[si+1] ; grater than first byte character?
+ ja bdbcs_next
+
+bdbcs_found:
+
+ push ax
+ xor ax,ax
+ inc ax ; reset zero flag
+ pop ax
+
+bdbcs_exit:
+
+ pop ds
+ pop si
+ ret
+
+bdbcs_notfound:
+
+ push ax
+ xor ax,ax ; set zero flag
+ pop ax
+ jmp short bdbcs_exit
+
+bdbcs_next:
+
+ add si,2 ; points next lead byte table
+ jmp short bdbcs_do
+
+ endif ; DBCS
+
+mapcase endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : round
+;
+; round the values in memlo and memhi to paragraph boundary.
+; perform bounds check.
+;
+;----------------------------------------------------------------------------
+;
+
+round proc near
+
+ push ax
+ mov ax,[memlo]
+
+ call pararound ; para round up
+
+ add [memhi],ax
+ mov [memlo],0
+ mov ax,memhi ; ax = new memhi
+ cmp ax,[alloclim] ; if new memhi >= alloclim, error
+ jae mem_err
+ test cs:[setdevmarkflag], for_devmark
+ jz skip_set_devmarksize
+ push es
+ push si
+ mov si, cs:[devmark_addr]
+ mov es, si
+ sub ax, si
+ dec ax
+ mov es:[devmark_size], ax ; paragraph
+ and cs:[setdevmarkflag], not_for_devmark
+ pop si
+ pop es
+skip_set_devmarksize:
+ pop ax
+ clc ;clear carry
+ ret
+
+mem_err:
+ mov dx,offset badmem
+ push cs
+ pop ds
+ call print
+ jmp stall
+
+round endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : calldev
+;
+;----------------------------------------------------------------------------
+;
+calldev proc near
+
+ mov ds,word ptr cs:[DevEntry+2]
+ add bx,word ptr cs:[DevEntry] ;do a little relocation
+ mov ax,ds:[bx]
+
+ push word ptr cs:[DevEntry]
+ mov word ptr cs:[DevEntry],ax
+ mov bx,offset packet
+ call [DevEntry]
+ pop word ptr cs:[DevEntry]
+ ret
+
+calldev endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : todigit
+;
+;----------------------------------------------------------------------------
+;
+todigit proc near
+ sub al,'0'
+ jb notdig
+ cmp al,9
+ ja notdig
+ clc
+ ret
+notdig:
+ stc
+ ret
+todigit endp
+
+;
+;----------------------------------------------------------------------------
+;
+; procedure : getnum
+;
+; getnum parses a decimal number.
+; returns it in ax, sets zero flag if ax = 0 (may be considered an
+; error), if number is bad carry is set, zero is set, ax=0.
+;
+;----------------------------------------------------------------------------
+;
+
+getnum proc near
+
+ push bx
+ xor bx,bx ; running count is zero
+
+b2:
+ call todigit ; do we have a digit
+ jc badnum ; no, bomb
+
+ xchg ax,bx ; put total in ax
+ push bx ; save digit
+ mov bx,10 ; base of arithmetic
+ mul bx ; shift by one decimal di...
+ pop bx ; get back digit
+ add al,bl ; get total
+ adc ah,0 ; make that 16 bits
+ jc badnum ; too big a number
+
+ xchg ax,bx ; stash total
+
+ call getchr ;get next digit
+ jc b1 ; no more characters
+ cmp al, ' ' ; space?
+ jz b15 ; then end of digits
+ cmp al, ',' ; ',' is a seperator!!!
+ jz b15 ; then end of digits.
+ cmp al, tab ; tab
+ jz b15
+ cmp al,sepchr ; allow 0 or special separators
+ jz b15
+ cmp al,'/' ; see if another switch follows
+ nop ; cas - remnant of old bad code
+ nop
+ jz b15
+ cmp al,lf ; line-feed?
+ jz b15
+ cmp al,cr ; carriage return?
+ jz b15
+ or al,al ; end of line separator?
+ jnz b2 ; no, try as a valid char...
+
+b15:
+ inc count ; one more character to s...
+ dec chrptr ; back up over separator
+b1:
+ mov ax,bx ; get proper count
+ or ax,ax ; clears carry, sets zero accordingly
+ pop bx
+ ret
+badnum:
+ mov sepchr,0
+ xor ax,ax ; set zero flag, and ax = 0
+ pop bx
+ stc ; and carry set
+ ret
+
+getnum endp
+
+;*****************************************************************
+
+setdoscountryinfo proc near
+
+;input: es:di -> pointer to dos_country_cdpg_info
+; ds:0 -> buffer.
+; si = 0
+; ax = country id
+; dx = code page id. (if 0, then use ccsyscodepage as a default.)
+; bx = file handle
+; this routine can handle maxium 438 country_data entries.
+;
+;output: dos_country_cdpg_info set.
+; carry set if any file read failure or wrong information in the file.
+; carry set and cx = -1 if cannot find the matching country_id, codepage
+; _id in the file.
+
+ push di
+ push ax
+ push dx
+
+ xor cx,cx
+ xor dx,dx
+ mov ax,512 ;read 512 bytes
+ call readincontrolbuffer ;read the file header
+ jc setdosdata_fail
+
+ push es
+ push si
+
+ push cs
+ pop es
+
+ mov di,offset country_file_signature
+ mov cx,8 ;length of the signature
+ repz cmpsb
+
+ pop si
+ pop es
+ jnz setdosdata_fail ;signature mismatch
+
+ add si,18 ;si -> county info type
+ cmp byte ptr ds:[si],1 ;only accept type 1 (currently only 1 header type)
+ jne setdosdata_fail ;cannot proceed. error return
+
+ inc si ;si -> file offset
+ mov dx,word ptr ds:[si] ;get the info file offset.
+ mov cx,word ptr ds:[si+2]
+ mov ax,6144 ;read 6144 bytes.
+ call readincontrolbuffer ;read info
+ jc setdosdata_fail
+
+ mov cx, word ptr ds:[si] ;get the # of country, codepage combination entries
+ cmp cx, 438 ;cannot handle more than 438 entries.
+ ;
+ ja setdosdata_fail
+
+ inc si
+ inc si ;si -> entry information packet
+ pop dx ;restore code page id
+ pop ax ;restore country id
+ pop di
+
+setdoscntry_find: ;search for desired country_id,codepage_id.
+ cmp ax, word ptr ds:[si+2] ;compare country_id
+ jne setdoscntry_next
+
+ cmp dx, 0 ;no user specified code page ?
+ je setdoscntry_any_codepage;then no need to match code page id.
+ cmp dx, word ptr ds:[si+4] ;compare code page id
+ je setdoscntry_got_it
+
+setdoscntry_next:
+ add si, word ptr ds:[si] ;next entry
+ inc si
+ inc si ;take a word for size of entry itself
+ loop setdoscntry_find
+
+ mov cx, -1 ;signals that bad country id entered.
+setdoscntry_fail:
+ stc
+ ret
+
+setdosdata_fail:
+ pop si
+ pop cx
+ pop di
+ jmp short setdoscntry_fail
+
+setdoscntry_any_codepage: ;use the code_page_id of the country_id found.
+ mov dx, word ptr ds:[si+4]
+
+setdoscntry_got_it: ;found the matching entry
+ mov cs:cntrycodepage_id, dx ;save code page id for this country.
+ mov dx, word ptr ds:[si+10] ;get the file offset of country data
+ mov cx, word ptr ds:[si+12]
+ mov ax, 512 ;read 512 bytes
+ call readincontrolbuffer
+ jc setdoscntry_fail
+
+ mov cx, word ptr ds:[si] ;get the number of entries to handle.
+ inc si
+ inc si ;si -> first entry
+
+setdoscntry_data:
+ push di ;es:di -> dos_country_cdpg_info
+ push cx ;save # of entry left
+ push si ;si -> current entry in control buffer
+
+ mov al, byte ptr ds:[si+2] ;get data entry id
+ call getcountrydestination ;get the address of destination in es:di
+ jc setdoscntry_data_next ;no matching data entry id in dos
+
+ mov dx, word ptr ds:[si+4] ;get offset of data
+ mov cx, word ptr ds:[si+6]
+ mov ax,4200h
+ stc
+ int 21h ;move pointer
+ jc setdosdata_fail
+
+ mov dx,512 ;start of data buffer
+ mov cx,20 ;read 20 bytes only. we only need to
+ mov ah,3fh ;look at the length of the data in the file.
+ stc
+ int 21h ;read the country.sys data
+ jc setdosdata_fail ;read failure
+
+ cmp ax,cx
+ jne setdosdata_fail
+
+ mov dx,word ptr ds:[si+4] ;get offset of data again.
+ mov cx,word ptr ds:[si+6]
+ mov ax,4200h
+ stc
+ int 21h ;move pointer back again
+ jc setdosdata_fail
+
+ push si
+ mov si,(512+8) ;get length of the data from the file
+ mov cx,word ptr ds:[si]
+ pop si
+ mov dx,512 ;start of data buffer
+ add cx,10 ;signature + a word for the length itself
+ mov ah,3fh ;read the data from the file.
+ stc
+ int 21h
+ jc setdosdata_fail
+
+ cmp ax, cx
+ jne setdosdata_fail
+
+ mov al,byte ptr ds:[si+2] ;save data id for future use.
+ mov si,(512+8) ;si-> data buffer + id tag field
+ mov cx,word ptr ds:[si] ;get the length of the file
+ inc cx ;take care of a word for lenght of tab
+ inc cx ;itself.
+ cmp cx,(2048 - 512 - 8) ;fit into the buffer?
+ ja setdosdata_fail
+
+ if bugfix
+ call setdbcs_before_copy
+ endif
+
+ cmp al, setcountryinfo ;is the data for setcountryinfo table?
+ jne setdoscntry_mov ;no, don't worry
+
+ push word ptr es:[di+ccmono_ptr-cccountryinfolen] ;cannot destroy ccmono_ptr address. save them.
+ push word ptr es:[di+ccmono_ptr-cccountryinfolen+2] ;at this time di -> cccountryinfolen
+ push di ;save di
+
+ push ax
+ mov ax,cs:cntrycodepage_id ;do not use the code page info in country_info
+ mov ds:[si+4], ax ;use the saved one for this !!!!
+ pop ax
+
+setdoscntry_mov:
+ rep movsb ;copy the table into dos
+ cmp al, setcountryinfo ;was the ccmono_ptr saved?
+ jne setdoscntry_data_next
+
+ pop di ;restore di
+ pop word ptr es:[di+ccmono_ptr-cccountryinfolen+2] ;restore
+ pop word ptr es:[di+ccmono_ptr-cccountryinfolen]
+
+setdoscntry_data_next:
+ pop si ;restore control buffer pointer
+ pop cx ;restore # of entries left
+ pop di ;restore pointer to dso_country_cdpg
+ add si, word ptr ds:[si] ;try to get the next entry
+ inc si
+ inc si ;take a word of entry length itself
+ dec cx
+ cmp cx,0
+ je setdoscntry_ok
+ jmp setdoscntry_data
+
+setdoscntry_ok:
+ ret
+setdoscountryinfo endp
+
+ if bugfix
+setdbcs_before_copy proc near
+
+ cmp al,setdbcs ; dbcs vector set?
+ jnz @f ; jump if not
+ cmp word ptr es:[di], 0 ; zero byte data block?
+ jz @f ; jump if so
+
+ push di
+ push ax
+ push cx
+ mov cx,es:[di] ; load block length
+ add di,2 ; points actual data
+ xor al,al ; fill bytes
+ rep stosb ; clear data block
+ pop cx
+ pop ax
+ pop di
+@@:
+ ret
+setdbcs_before_copy endp
+ endif
+
+getcountrydestination proc near
+
+;get the destination address in the dos country info table.
+;input: al - data id
+; es:di -> dos_country_cdpg_info
+;on return:
+; es:di -> destination address of the matching data id
+; carry set if no matching data id found in dos.
+
+ push cx
+ add di,ccnumber_of_entries ;skip the reserved area, syscodepage etc.
+ mov cx,word ptr es:[di] ;get the number of entries
+ inc di
+ inc di ;si -> the first start entry id
+
+getcntrydest:
+ cmp byte ptr es:[di],al
+ je getcntrydest_ok
+ cmp byte ptr es:[di],setcountryinfo ;was it setcountryinfo entry?
+ je getcntrydest_1
+
+ add di,5 ;next data id
+ jmp short getcntrydest_loop
+
+getcntrydest_1:
+ add di,new_country_size + 3 ;next data id
+getcntrydest_loop:
+ loop getcntrydest
+ stc
+ jmp short getcntrydest_exit
+
+getcntrydest_ok:
+ cmp al,setcountryinfo ;select country info?
+ jne getcntrydest_ok1
+
+ inc di ;now di -> cccountryinfolen
+ jmp short getcntrydest_exit
+
+getcntrydest_ok1:
+ les di,dword ptr es:[di+1] ;get the destination in es:di
+
+getcntrydest_exit:
+ pop cx
+ ret
+getcountrydestination endp
+
+
+readincontrolbuffer proc near
+
+;move file pointer to cx:dx
+;read ax bytes into the control buffer. (should be less than 2 kb)
+;si will be set to 0 hence ds:si points to the control buffer.
+;entry: cx,dx offset from the start of the file where the read/write pointer
+; be moved.
+; ax - # of bytes to read
+; bx - file handle
+; ds - buffer seg.
+;return: the control data information is read into ds:0 - ds:0200.
+; cx,dx value destroyed.
+; carry set if error in reading file.
+
+ push ax ;# of bytes to read
+ mov ax, 4200h
+ stc
+ int 21h ;move pointer
+ pop cx ;# of bytes to read
+ jc ricb_exit
+
+ xor dx,dx ;ds:dx -> control buffer
+ xor si,si
+ mov ah,3fh ;read into the buffer
+ stc
+ int 21h ;should be less than 1024 bytes.
+
+ricb_exit:
+ ret
+readincontrolbuffer endp
+
+
+set_country_path proc near
+
+;in: ds - sysinitseg, es - confbot, si -> start of the asciiz path string
+; dosinfo_ext, cntry_drv, cntry_root, cntry_path
+; assumes current directory is the root directory.
+;out: ds:di -> full path (cntry_drv).
+; set the cntry_drv string from the country=,,path command.
+; ds, es, si value saved.
+
+ push si
+
+ push ds ;switch ds, es
+ push es
+ pop ds
+ pop es ;now ds -> confbot, es -> sysinitseg
+
+ call chk_drive_letter ;current ds:[si] is a drive letter?
+ jc scp_default_drv ;no, use current default drive.
+
+ mov al, byte ptr ds:[si]
+ inc si
+ inc si ;si -> next char after ":"
+ jmp short scp_setdrv
+
+scp_default_drv:
+ mov ah, 19h
+ int 21h
+ add al, "A" ;convert it to a character.
+
+scp_setdrv:
+ mov cs:cntry_drv, al ;set the drive letter.
+ mov di, offset cntry_path
+ mov al, byte ptr ds:[si]
+ cmp al, "\"
+ je scp_root_dir
+
+ cmp al,"/" ;let's accept "/" as an directory delim
+ je scp_root_dir
+
+ jmp short scp_path
+
+scp_root_dir:
+ dec di ;di -> cntry_root
+scp_path:
+ call move_asciiz ;copy it
+
+ mov di, offset cntry_drv
+scpath_exit:
+
+ push ds ;switch ds, es
+ push es
+ pop ds
+ pop es ;ds, es value restored
+
+ pop si
+ ret
+set_country_path endp
+
+
+chk_drive_letter proc near
+;check if ds:[si] is a drive letter followed by ":".
+;assume that every alpha charater is already converted to upper case.
+;carry set if not.
+
+ push ax
+ cmp byte ptr ds:[si], "A"
+ jb cdletter_no
+ cmp byte ptr ds:[si], "Z"
+ ja cdletter_no
+ cmp byte ptr ds:[si+1], ":"
+ jne cdletter_no
+
+ jmp short cdletter_exit
+
+cdletter_no:
+ stc
+
+cdletter_exit:
+ pop ax
+ ret
+chk_drive_letter endp
+
+
+move_asciiz proc near
+;in: ds:si -> source es:di -> target
+;out: copy the string until 0.
+;assumes there exists a 0.
+
+masciiz_loop:
+ movsb
+ cmp byte ptr ds:[si-1],0 ;was it 0?
+ jne masciiz_loop
+ ret
+move_asciiz endp
+
+;
+; ds:dx points to string to output (asciz)
+;
+; prints <badld_pre> <string> <badld_post>
+
+badfil:
+ push cs
+ pop es
+
+ mov si,dx
+badload:
+ mov dx,offset badld_pre ;want to print config error
+ mov bx, offset crlfm
+
+prnerr:
+ push cs
+ pop ds
+ call print
+
+prn1:
+ mov dl,es:[si]
+ or dl,dl
+ jz prn2
+ mov ah,std_con_output
+ int 21h
+ inc si
+ jmp prn1
+
+prn2:
+ mov dx,bx
+ call print
+ cmp donotshownum,1 ; suppress line number when handling command.com
+ je prnexit
+ call error_line
+prnexit:
+ ret
+
+print:
+ cmp cs:bEchoConfig, 0 ; NTVDM skip print call, Jonle
+ je prnexit
+
+ mov ah,std_con_string_output
+ int 21h
+
+ ret
+
+ if noexec
+
+; load non exe file called [ds:dx] at memory location es:bx
+
+ldfil:
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push ds
+ push bx
+
+ xor ax,ax ;open the file
+ mov ah,open
+ stc ;in case of int 24
+ int 21h
+ pop dx ;clean stack in case jump
+ jc ldret
+
+ push dx
+ mov bx,ax ;handle in bx
+ xor cx,cx
+ xor dx,dx
+ mov ax,(lseek shl 8) or 2
+ stc ;in case of int 24
+ int 21h ; get file size in dx:ax
+ jc ldclsp
+
+ or dx,dx
+ jnz lderrp ; file >64k
+ pop dx
+
+ push dx
+ mov cx,es ; cx:dx is xaddr
+ add dx,ax ; add file size to xaddr
+ jnc dosize
+ add cx,1000h ; ripple carry
+dosize:
+ mov ax,dx
+ call pararound
+ mov dx,ax
+
+ add cx,dx
+ cmp cx,[alloclim]
+ jb okld
+ jmp mem_err
+
+okld:
+ xor cx,cx
+ xor dx,dx
+ mov ax,lseek shl 8 ;reset pointer to beginning of file
+ stc ;in case of int 24
+ int 21h
+ jc ldclsp
+
+ pop dx
+
+ push es ;read the file in
+ pop ds ;trans addr is ds:dx
+
+ mov cx,0ff00h ; .com files arn't any bigger than
+ ; 64k-100h
+ mov ah,read
+ stc ;in case of int 24
+ int 21h
+ jc ldcls
+
+ mov si,dx ;check for exe file
+ cmp word ptr [si],"ZM"
+ clc ; assume ok
+ jnz ldcls ; only know how to do .com files
+
+ stc
+ jmp short ldcls
+
+lderrp:
+ stc
+ldclsp:
+ pop dx ;clean stack
+ldcls:
+ pushf
+ mov ah,close ;close the file
+ stc
+ int 21h
+ popf
+
+ldret: pop ds
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ ret
+ endif
+
+;
+; open device pointed to by dx, al has access code
+; if unable to open do a device open null device instead
+;
+open_dev:
+ call open_file
+ jnc open_dev3
+
+open_dev1:
+ mov dx,offset nuldev
+ call open_file
+of_ret:
+ ret
+
+open_dev3:
+ mov bx,ax ; handle from open to bx
+ xor ax,ax ; get device info
+ mov ah,ioctl
+ int 21h
+ test dl,10000000b
+ jnz of_ret
+
+ mov ah,close
+ int 21h
+ jmp open_dev1
+
+open_file:
+ mov ah,open
+ stc
+ int 21h
+ ret
+
+; test int24. return back to dos with the fake user response of "fail"
+
+int24:
+ mov al, 3 ; fail the system call
+ iret ; return back to dos.
+
+include copyrigh.inc ; copyright statement
+
+nuldev db "NUL",0
+condev db "CON",0
+auxdev db "AUX",0
+prndev db "PRN",0
+MseDev db "MOUSE",0 ; NTVDM for internal spc mouse
+
+
+
+
+; NTVDM we use a temp file for config.sys 23-Nov-1992 Jonle
+; config db "C:\CONFIG.SYS",0
+config db 64 dup (0)
+
+cntry_drv db "A:"
+cntry_root db "\"
+cntry_path db "COUNTRY.SYS",0
+ db 52 dup (0)
+
+country_file_signature db 0ffh,'COUNTRY'
+
+cntrycodepage_id dw ?
+
+commnd db "\COMMAND.COM",0
+ db 51 dup (0)
+
+pathstring db 64 dup (0)
+
+comtab label byte
+
+; cmd len command cmd code
+; ------- ------- --------
+;
+ db 7, "BUFFERS", 'B'
+ db 5, "BREAK", 'C'
+ db 6, "DEVICE", 'D'
+ db 10, "DEVICEHIGH", 'U'
+ db 5, "FILES", 'F'
+ db 4, "FCBS", 'X'
+ db 9, "LASTDRIVE", 'L'
+ db 10, "MULTITRACK", 'M'
+ db 8, "DRIVPARM", 'P'
+if stacksw
+ db 6, "STACKS", 'K'
+endif
+ db 7, "COUNTRY", 'Q'
+ db 5, "SHELL", 'S'
+ db 7, "INSTALL", 'I'
+ db 7, "COMMENT", 'Y'
+ db 3, "REM", '0'
+ db 8, "SWITCHES", '1'
+ db 3, "DOS", 'H'
+ db 10, "ECHOCONFIG", 'E' ; NTVDM 14-Aug-1992 Jonle
+ db 11, "NTCMDPROMPT", 'T' ; NTVDM 06-May-1993 sudeepb
+ db 7, "DOSONLY", 'O' ; NTVDM 06-May-1993 sudeepb
+ db 0
+
+hlim dw 2
+slim dw 9
+
+public bEchoConfig ; NTVDM - 14-Aug-1992 Jonle
+bEchoConfig db 0
+
+public drive
+drive db ?
+
+public switches
+switches dw 0
+
+
+switchlist db 8,"FHSTDICN" ; preserve the positions of n and c.
+
+; the following depend on the positions of the various letters in switchlist
+
+;switchnum equ 11111000b ; which switches require number
+
+flagec35 equ 00000100b ; electrically compatible 3.5 inch disk drive
+flagdrive equ 00001000b
+flagcyln equ 00010000b
+flagseclim equ 00100000b
+flagheads equ 01000000b
+flagff equ 10000000b
+
+sysinitseg ends
+ end
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/abort.asm b/private/mvdm/dos/v86/doskrnl/dos/abort.asm
new file mode 100644
index 000000000..ea19a334d
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/abort.asm
@@ -0,0 +1,153 @@
+TITLE DOS_ABORT - Internal SFT close all files for proc call for MSDOS
+NAME DOS_ABORT
+
+; Internal Abort call closes all handles and FCBs associated with a process.
+;
+; DOS_ABORT
+;
+; Modification history:
+;
+; sudeepb 11-Mar-1991 Ported For NT DOSEm.
+
+
+;
+; get the appropriate segment definitions
+;
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include pdb.inc
+ include mult.inc
+ include dossvc.inc
+ .cref
+ .list
+
+Installed = TRUE
+
+ I_Need PROC_ID,WORD ; current process ID
+ I_Need USER_ID,WORD ; current user ID
+ i_need CurrentPDB,WORD
+ i_need sft_addr,DWORD
+ i_need THISSFT,DWORD
+ i_need JSHARE,DWORD
+ I_need sftFCB,DWORD ; pointer to SFTs for FCB cache
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+Break <DOS_ABORT -- CLOSE all files for process>
+;--------------------------------------------------------------------------
+;
+; Procedure Name : DOS_ABORT
+;
+; Inputs:
+; [CurrentPDB] points to aborting process
+; Function:
+; Close all files and free all SFTs for this PDB
+; Returns:
+; None
+; All destroyed except stack
+;---------------------------------------------------------------------------
+
+ Procedure DOS_ABORT,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING
+
+ MOV ES,[CurrentPDB] ; SS override
+ MOV CX,ES:[PDB_JFN_Length] ; Number of JFNs
+reset_free_jfn:
+ MOV BX,CX
+ PUSH CX
+ DEC BX ; get jfn (start with last one)
+
+ invoke $close
+ POP CX
+ LOOP reset_free_jfn ; and do 'em all
+;
+; Note: We do need to explicitly close FCBs. Reasons are as follows: If we
+; are running in the no-sharing no-network environment, we are simulating the
+; 2.0 world and thus if the user doesn't close the file, that is his problem
+; BUT... the cache remains in a state with garbage that may be reused by the
+; next process. We scan the set and blast the ref counts of the FCBs we own.
+;
+; If sharing is loaded, then the following call to close process will
+; correctly close all FCBs. We will then need to walk the list AFTER here.
+;
+; Finally, the following call to NET_Abort will cause an EOP to be sent to all
+; known network resources. These resources are then responsible for cleaning
+; up after this process.
+;
+; Sleazy, eh?
+;
+
+ context DS ; SS is DOSDATA
+ assume ds:nothing
+;
+; Scan the FCB cache for guys that belong to this process and zap their ref
+; counts.
+;
+
+ ; SS override
+ les di,sftFCB ; grab the pointer to the table
+ mov cx,es:[di].sfCount
+ jcxz FCBScanDone
+ LEA DI,[DI].sfTable ; point at table
+ mov ax,proc_id ; SS override
+FCBTest:
+ cmp es:[di].sf_PID,ax ; is this one of ours
+ jnz FCBNext ; no, skip it
+ call Close_NT_Handle
+FCBNext:
+ add di,size sf_Entry
+ loop FCBTest
+FCBScanDone:
+
+;
+; Walk the SFT to eliminate all busy SFT's for this process.
+;
+ XOR BX,BX
+Scan:
+ push bx
+ invoke SFFromSFN
+ pop bx
+ retc
+ cmp es:[di].sf_ref_count,sf_busy ; Is Sft busy? ;M038
+ jnz next
+;
+; we have a SFT that is busy. See if it is for the current process
+;
+
+ mov ax,proc_id ; SS override
+ cmp es:[di].sf_pid,ax
+ jnz next
+;
+; This SFT is labelled as ours.
+;
+ call Close_NT_Handle
+next:
+ inc bx
+ jmp scan
+
+EndProc DOS_Abort
+
+Close_NT_Handle:
+ push bp
+ push ax
+ mov bp,word ptr es:[di].sf_NTHandle
+ mov ax,word ptr es:[di].sf_NTHandle+2
+ HRDSVC SVC_DEMCLOSE
+ pop ax
+ pop bp
+ mov es:[di].sf_ref_count,0
+ ret
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/alloc.asm b/private/mvdm/dos/v86/doskrnl/dos/alloc.asm
new file mode 100644
index 000000000..f20d126d9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/alloc.asm
@@ -0,0 +1,760 @@
+ TITLE ALLOC.ASM - memory arena manager NAME Alloc
+
+;** Memory related system calls and low level routines
+;
+; $ALLOC
+; $SETBLOCK
+; $DEALLOC
+; $AllocOper
+; arena_free_process
+; arena_next
+; check_signature
+; Coalesce
+;
+; Modification history:
+; sudeepb 11-Mar-1991 Ported for NT DOSEm
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include arena.inc
+
+ .cref
+ .list
+
+ BREAK <memory allocation utility routines>
+
+ i_need arena_head,WORD ; seg address of start of arena
+ i_need CurrentPDB,WORD ; current process data block addr
+ i_need FirstArena,WORD ; first free block found
+ i_need BestArena,WORD ; best free block found
+ i_need LastArena,WORD ; last free block found
+ i_need AllocMethod,BYTE ; how to alloc first(best)last
+ I_need EXTERR_LOCUS,BYTE ; Extended Error Locus
+
+
+ I_need umb_head,WORD ; seg address of start of umb arenas
+ I_need start_arena,WORD ; seg address of arena from which to
+ ; start alloc scan
+ I_need umbflag,BYTE ; bit 0 indicates link state
+
+ I_need A20OFF_COUNT,BYTE ; M016, M068
+ I_need DOS_FLAG, BYTE ; M068
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ BREAK <Arena_Free_Process - Free a processes memory>
+
+
+;** Arena_Free_Process
+;
+; Free all arena blocks allocated to a pricess
+;
+; ENTRY (bx) = PID of process
+; EXIT none
+; USES ????? BUGBUG
+
+procedure arena_free_process,NEAR
+
+ MOV AX,[arena_head]
+
+arena_free_process_start:
+ MOV DI,arena_signature
+ CALL Check_Signature ; ES <- AX, check for valid block
+
+arena_free_process_loop:
+ jc ret_label ; return if carry set
+
+ PUSH ES
+ POP DS
+ CMP DS:[arena_owner],BX ; is block owned by pid?
+ JNZ arena_free_next ; no, skip to next
+ MOV DS:[arena_owner],DI ; yes... free him
+
+arena_free_next:
+ CMP BYTE PTR DS:[DI],arena_signature_end
+ ; end of road, Jack?
+
+ jz arena_chk_umbs ; M010: let's check umb arenas
+
+ CALL arena_next ; next item in ES/AX carry set if trash
+ JMP arena_free_process_loop
+
+arena_chk_umbs: ; M010 - Start
+ mov ax, [umb_head] ; ax = umb_head
+ cmp ax, 0ffffh ; Q: is umb_head initialized
+ je ret_label ; N: we're done
+
+ mov di, ds ; di = last arena
+ cmp di, ax ; Q: is last arena above umb_head
+ jae ret_label ; Y: we've scanned umbs also. done.
+ jmp short arena_free_process_start
+ ; M010 - End
+
+EndProc arena_free_process
+
+ BREAK <Arena Helper Routines>
+
+;** Arena_Next - Find Next item in Arena
+;
+; ENTRY DS - pointer to block head
+; (di) = 0
+; EXIT AX,ES - pointers to next head
+; 'C' set iff arena damaged
+
+procedure arena_next,NEAR
+
+ MOV AX,DS ; AX <- current block
+ ADD AX,DS:[arena_size] ; AX <- AX + current block length
+ INC AX ; remember that header!
+
+; fall into check_signature and return
+;
+; CALL check_signature ; ES <- AX, carry set if error
+; RET
+; BUGBUG - put fallthru here
+
+EndProc arena_next
+
+
+
+
+;** Check_Signature - Check Memory Block Signature
+;
+; ENTRY (AX) = address of block header
+; (di) = 0
+; EXIT ES = AX
+; 'C' clear if signature good
+; 'C' set if signature bad
+; USES ES, Flags
+
+;align 2 BUGBUG - put me in
+procedure check_signature,NEAR
+
+ MOV ES,AX ; ES <- AX
+ CMP BYTE PTR ES:[DI],arena_signature_normal
+ ; IF next signature = not_end THEN
+ jz ret_label ; GOTO OK (ret if Z)
+
+ CMP BYTE PTR ES:[DI],arena_signature_end
+ ; IF next signature = end then
+ jz ret_label ; GOTO ok (ret if Z)
+ STC ; set error
+
+ret_label:
+ return
+
+EndProc Check_signature
+
+
+
+;** Coalesce - Combine free blocks ahead with current block
+;
+; Coalesce adds the block following the argument to the argument block,
+; iff it's free. Coalesce is usually used to join free blocks, but
+; some callers (such as $setblock) use it to join a free block to it's
+; preceeding allocated block.
+;
+; ENTRY (ds) = pointer to the head of a free block
+; (di) = 0
+; EXIT 'C' clear if OK
+; (ds) unchanged, this block updated
+; (ax) = address of next block, IFF not at end
+; 'C' set if arena trashed
+; USES (cx)
+
+procedure Coalesce,NEAR
+
+ CMP BYTE PTR DS:[DI],arena_signature_end
+ ; IF current signature = END THEN
+ retz ; GOTO ok
+ CALL arena_next ; ES, AX <- next block, Carry set if error
+ retc ; IF no error THEN GOTO check
+
+coalesce_check:
+ CMP ES:[arena_owner],DI
+ retnz ; IF next block isnt free THEN return
+ MOV CX,ES:[arena_size] ; CX <- next block size
+ INC CX ; CX <- CX + 1 (for header size)
+ ADD DS:[arena_size],CX ; current size <- current size + CX
+ MOV CL,ES:[DI] ; move up signature
+ MOV DS:[DI],CL
+ JMP coalesce ; try again
+
+EndProc Coalesce
+
+ BREAK <$Alloc - allocate space in memory>
+
+;** $Alloc - Allocate Memory Space
+;
+; $Alloc services the INT21 that allocates memory space to a program.
+; Alloc returns a pointer to a free block of
+; memory that has the requested size in paragraphs.
+;
+; If the allocation strategy is HIGH_FIRST or HIGH_ONLY memory is
+; scanned from umb_head if not from arena_head. If the strategy is
+; HIGH_FIRST the scan is continued from arena_head if a block of
+; appropriate size is not found in the UMBs. If the strategy is
+; HIGH_FIRST+HIGH_ONLY only the UMBs are scanned for memory.
+;
+; In either case if bit 0 of UmbFlag is not initialized then the scan
+; starts from arena_head.
+;
+; Assembler usage:
+; MOV BX,size
+; MOV AH,Alloc
+; INT 21h
+;
+; BUGBUG - a lot can be done to improve performance. We can set marks
+; so that we start searching the arena at it's first non-trivial free
+; block, we can peephole the code, etc. (We can move some subr calls
+; inline, etc.) I assume that this is called rarely and that the arena
+; doesn't have too many memory objects in it beyond the first free one.
+; verify that this is true; if so, this can stay as is
+;
+; ENTRY (bx) = requested size, in bytes
+; (DS) = (ES) = DOSGROUP
+; EXIT 'C' clear if memory allocated
+; (ax:0) = address of requested memory
+; 'C' set if request failed
+; (AX) = error_not_enough_memory
+; (bx) = max size we could have allocated
+; (ax) = error_arena_trashed
+; USES All
+
+procedure $ALLOC,NEAR
+
+ EnterCrit critMem
+
+ ; M000 - start
+ mov ax, [arena_head]
+ mov [start_arena], ax ; assume LOW_FIRST
+
+ test byte ptr [AllocMethod], HIGH_FIRST+HIGH_ONLY
+ ; Q: should we start scanning from
+ ; UMB's
+ jz norm_alloc ; N: scan from arena_head
+
+; cmp [umb_head], -1 ; Q: Has umb_head been initialized
+; je norm_alloc ; N: scan from arena_head
+ test [UmbFlag], LINKSTATE ; Q: are umb's linked
+ jz norm_alloc ; N: scan from arena_head
+
+ mov ax, [umb_head]
+ mov [start_arena], ax ; start_arena = umb_head
+
+ ; M000 - end
+
+norm_alloc:
+
+ XOR AX,AX
+ MOV DI,AX
+
+ ; SS override for next First/Best/Last
+ ; Arena
+ MOV [FirstArena],AX ; init the options
+ MOV [BestArena],AX
+ MOV [LastArena],AX
+
+ PUSH AX ; alloc_max <- 0
+
+start_scan:
+ MOV AX,[start_arena] ; M000: AX <- beginning of arena
+; MOV AX,[arena_head] ; M000: AX <- beginning of arena
+
+
+ CALL Check_signature ; ES <- AX, carry set if error
+ JC alloc_err ; IF error THEN GOTO err
+
+alloc_scan:
+ PUSH ES
+ POP DS ; DS <- ES
+ CMP DS:[arena_owner],DI
+ JZ alloc_free ; IF current block is free THEN examine
+
+alloc_next:
+ ; M000 - start
+
+ test [UmbFlag], LINKSTATE ; Q: are umb's linked
+ jz norm_strat ; N: see if we reached last arena
+
+ test byte ptr [AllocMethod], HIGH_FIRST
+ ; Q: is alloc strategy high_first
+ jz norm_strat ; N: see if we reached last arena
+ mov ax, [start_arena]
+ cmp ax, [arena_head] ; Q: did we start scan from
+ ; arena_head
+ jne norm_strat ; N: see if we reached last arena
+ mov ax, ds ; ax = current block
+ cmp ax, [umb_head] ; Q: check against umb_head
+ jmp short alloc_chk_end
+
+norm_strat: ; M000 - end
+ ; check against last sig '5A'
+ CMP BYTE PTR DS:[DI],arena_signature_end
+
+alloc_chk_end: ; M000
+ ; IF current block is last THEN
+ JZ alloc_end ; GOTO end
+ CALL arena_next ; AX, ES <- next block, Carry set if error
+ JNC alloc_scan ; IF no error THEN GOTO scan
+
+alloc_err:
+ POP AX
+
+alloc_trashed:
+ LeaveCrit critMem
+ error error_arena_trashed
+
+alloc_end:
+ CMP [FirstArena],0
+ LJNZ alloc_do_split
+ ; M000 - start
+ mov ax, [arena_head]
+ cmp ax, [start_arena] ; Q: started scanning from arena_head
+ je alloc_fail ; Y: not enough memory
+ ; N:
+ ; Q: is the alloc strat HIGH_ONLY
+ test byte ptr [AllocMethod], HIGH_ONLY
+ jnz alloc_fail ; Y: return size of largest UMB
+
+ mov [start_arena], ax ; N: start scanning from arena_head
+ jmp short start_scan
+ ; M000 - end
+
+alloc_fail:
+ invoke get_user_stack
+ POP BX
+ MOV [SI].user_BX,BX
+ LeaveCrit critMem
+ error error_not_enough_memory
+
+alloc_free:
+ CALL coalesce ; add following free block to current
+ JC alloc_err ; IF error THEN GOTO err
+ MOV CX,DS:[arena_size]
+
+ POP DX ; check for max found size
+ CMP CX,DX
+ JNA alloc_test
+ MOV DX,CX
+
+alloc_test:
+ PUSH DX
+ CMP BX,CX ; IF BX > size of current block THEN
+ JA alloc_next ; GOTO next
+ CMP [FirstArena],0
+ JNZ alloc_best
+ MOV [FirstArena],DS ; save first one found
+alloc_best:
+ CMP [BestArena],0
+ JZ alloc_make_best ; initial best
+ PUSH ES
+ MOV ES,[BestArena]
+ CMP ES:[arena_size],CX ; is size of best larger than found?
+ POP ES
+ JBE alloc_last
+alloc_make_best:
+ MOV [BestArena],DS ; assign best
+alloc_last:
+ MOV [LastArena],DS ; assign last
+ JMP alloc_next
+
+;
+; split the block high
+;
+alloc_do_split_high:
+ MOV DS,[LastArena]
+ MOV CX,DS:[arena_size]
+ SUB CX,BX
+ MOV DX,DS
+ JE alloc_set_owner ; sizes are equal, no split
+ ADD DX,CX ; point to next block
+ MOV ES,DX ; no decrement!
+ DEC CX
+ XCHG BX,CX ; bx has size of lower block
+ JMP short alloc_set_sizes ; cx has upper (requested) size
+
+;
+; we have scanned memory and have found all appropriate blocks
+; check for the type of allocation desired; first and best are identical
+; last must be split high
+;
+alloc_do_split:
+ ; M000 - start
+ xor cx, cx
+ mov cl, byte ptr [AllocMethod]
+ and cx, STRAT_MASK ; mask off bit 7
+ cmp cx, BEST_FIT ; Q; is the alloc strategy best_fit
+
+; CMP BYTE PTR [AllocMethod], BEST_FIT
+ ; M000 - end
+
+ ; Q: is the alloc strategy best_fit
+ JA alloc_do_split_high ; N: it is last fit
+ MOV DS,[FirstArena] ; assume first_fit
+ JB alloc_get_size ; it is first_fit
+ MOV DS,[BestArena] ; it is last_fit
+alloc_get_size:
+ MOV CX,DS:[arena_size]
+ SUB CX,BX ; get room left over
+ MOV AX,DS
+ MOV DX,AX ; save for owner setting
+ JE alloc_set_owner ; IF BX = size THEN (don't split)
+ ADD AX,BX
+ INC AX ; remember the header
+ MOV ES,AX ; ES <- DS + BX (new header location)
+ DEC CX ; CX <- size of split block
+alloc_set_sizes:
+ MOV DS:[arena_size],BX ; current size <- BX
+ MOV ES:[arena_size],CX ; split size <- CX
+ MOV BL,arena_signature_normal
+ XCHG BL,DS:[DI] ; current signature <- 4D
+ MOV ES:[DI],BL ; new block sig <- old block sig
+ MOV ES:[arena_owner],DI
+
+alloc_set_owner:
+ MOV DS,DX
+
+
+ MOV AX,[CurrentPDB] ; SS override
+ MOV DS:[arena_owner],AX
+ MOV AX,DS
+ INC AX
+ POP BX
+ LeaveCrit critMem
+ transfer SYS_RET_OK
+
+EndProc $alloc
+
+ BREAK $SETBLOCK - change size of an allocated block (if possible)
+
+;** $SETBLOCK - Change size of an Alocated Block
+;
+; Setblock changes the size of an allocated block. First, we coalesce
+; any following free space onto this block; then we try to trim the
+; block down to the size requested.
+;
+; Note that if the guy wants to grow the block but that growth fails,
+; we still go ahead and coalesce any trailing free blocks onto it.
+; Thus the maximum-size-possible value that we return has already
+; been allocated! This is a bug, dare we fix it? BUGBUG
+;
+; NOTE - $SETBLOCK is in bed with $ALLOC and jumps into $ALLOC to
+; finish it's work. FOr this reason we build the allocsf
+; structure on the frame, to make us compatible with $ALLOCs
+; code.
+;
+; ENTRY (es) = segment of old block
+; (bx) = newsize
+; (ah) = SETBLOCK
+;
+; EXIT 'C' clear if OK
+; 'C' set if error
+; (ax) = error_invalid_block
+; = error_arena_trashed
+; = error_not_enough_memory
+; = error_invalid_function
+; (bx) = maximum size possible, iff (ax) = error_not_enough_memory
+; USES ???? BUGBUG
+
+procedure $SETBLOCK,NEAR
+
+ EnterCrit critMem
+ MOV DI,arena_signature
+ MOV AX,ES
+ DEC AX
+ CALL check_signature
+ JNC setblock_grab
+
+setblock_bad:
+ JMP alloc_trashed
+
+setblock_grab:
+ MOV DS,AX
+ CALL coalesce
+ JC setblock_bad
+ MOV CX,DS:[arena_size]
+ PUSH CX
+ CMP BX,CX
+ JBE alloc_get_size
+ JMP alloc_fail
+
+EndProc $setblock
+
+ BREAK $DEALLOC - free previously allocated piece of memory
+
+;** $DEALLOC - Free Heap Memory
+;
+; ENTRY (es) = address of item
+;
+; EXIT 'C' clear of OK
+; 'C' set if error
+; (AX) = error_invalid_block
+; USES ???? BUGBUG
+
+procedure $DEALLOC,NEAR
+
+ EnterCrit critMem
+
+ ; M016, M068 - Start
+ test [DOS_FLAG], EXECA20OFF
+ ; Q: was the previous call an int 21
+ ; exec call
+ jz @f ; N: continue
+ cmp [A20OFF_COUNT], 0 ; Q: is count 0
+ jne @f ; N: continue
+ mov [A20OFF_COUNT], 1 ; Y: set count to 1
+@@: ; M016, M068 - End
+
+
+ MOV DI,arena_signature
+ MOV AX,ES
+ DEC AX
+ CALL check_signature
+ JC dealloc_err
+ MOV ES:[arena_owner],DI
+ LeaveCrit critMem
+ transfer SYS_RET_OK
+
+dealloc_err:
+ LeaveCrit critMem
+ error error_invalid_block
+
+EndProc $DEALLOC
+
+ BREAK $AllocOper - get/set allocation mechanism
+
+;** $AllocOper - Get/Set Allocation Mechanism
+;
+; Assembler usage:
+; MOV AH,AllocOper
+; MOV BX,method
+; MOV AL,func
+; INT 21h
+;
+; ENTRY
+; (al) = 0
+; Get allocation Strategy in (ax)
+;
+; (al) = 1, (bx) = method = zw0000xy
+; Set allocation strategy.
+; w = 1 => HIGH_ONLY
+; z = 1 => HIGH_FIRST
+; xy = 00 => FIRST_FIT
+; = 01 => BEST_FIT
+; = 10 => LAST_FIT
+;
+; (al) = 2
+; Get UMB link state in (al)
+;
+; (al) = 3
+; Set UMB link state
+; (bx) = 0 => Unlink UMBs
+; (bx) = 1 => Link UMBs
+;
+;
+; EXIT 'C' clear if OK
+;
+; if (al) = 0
+; (ax) = existing method
+; if (al) = 1
+; Sets allocation strategy
+; if (al) = 2
+; (al) = 0 => UMBs not linked
+; (al) = 1 => UMBs linked in
+; if (al) = 3
+; Links/Unlinks the UMBs into DOS chain
+;
+; 'C' set if error
+; AX = error_invalid_function
+;
+; Rev. M000 - added support for HIGH_FIRST in (al) = 1. 7/9/90
+; Rev. M003 - added functions (al) = 2 and (al) = 3. 7/18/90
+; Rev. M009 - (al) = 3 will return 'invalid function' in ax if
+; umbhead has'nt been initialized by sysinit and 'trashed
+; arena' if an arena sig is damaged.
+;
+
+
+procedure $AllocOper,NEAR
+
+ or al, al
+ jz AllocGetStrat
+ cmp al, 1
+ jz AllocSetStrat
+ cmp al, 2
+ jz AllocGetLink
+ cmp al, 3
+ jz AllocSetLink
+
+AllocOperError:
+ ; SS override
+ MOV EXTERR_LOCUS,errLoc_mem ; Extended Error Locus
+ error error_invalid_function
+
+AllocArenaError:
+
+ MOV EXTERR_LOCUS,errLoc_mem ; M009: Extended Error Locus
+ error error_arena_trashed ; M009:
+
+
+AllocGetStrat:
+ ; SS override
+ MOV AL,BYTE PTR [AllocMethod]
+ XOR AH,AH
+ transfer SYS_RET_OK
+
+AllocSetStrat:
+
+ push bx ; M000 - start
+ and bx, STRAT_MASK ; M064: mask off bit 6 & 7
+ cmp bx,2 ; BX must be 0-2
+ pop bx ; M000 - end
+ ja AllocOperError
+
+ MOV [AllocMethod],BL
+ transfer SYS_RET_OK
+
+AllocGetLink:
+
+ mov al, [UmbFlag] ; return link state in al
+ and al, LINKSTATE
+ transfer SYS_RET_OK
+
+AllocSetLink:
+
+ ; M009 - start
+ mov cx, [umb_head] ; cx = umb_head
+ cmp cx, 0ffffh ; Q: has umb_head been initialized
+ je AllocOperError ; N: error
+ ; Y: continue
+ ; M009 - end
+
+ cmp bx, 1
+ jb UnlinkUmbs
+ jz LinkUmbs
+
+ jmp short AllocOperError
+
+UnlinkUmbs:
+
+ test [UmbFlag], LINKSTATE ; Q: umbs unlinked?
+ jz unlinked ; Y: return
+
+ call GetLastArena ; get arena before umb_head in DS
+ jc AllocArenaError ; M009: arena trashed
+
+ ; make it last
+ mov byte ptr ds:[0], arena_signature_end
+
+ and [UmbFlag], NOT LINKSTATE; indicate unlink'd state in umbflag
+
+unlinked:
+ transfer SYS_RET_OK
+
+LinkUmbs:
+
+ test [UmbFlag], LINKSTATE ; Q: umbs linked?
+ jnz linked ; Y: return
+
+ call GetLastArena ; get arena before umb_head
+ jc AllocArenaError ; M009: arena trashed
+
+ ; make it normal. M061: ds points to
+ ; arena before umb_head
+ mov byte ptr ds:[0], arena_signature_normal
+
+ or [UmbFlag], LINKSTATE ; indicate link'd state in umbflag
+linked:
+ transfer SYS_RET_OK
+
+EndProc $AllocOper
+
+
+;--------------------------------------------------------------------------
+;
+; Procedure Name : GetLastArena - M003
+;
+; Inputs : cx = umb_head
+;
+;
+; Outputs : If UMBs are linked
+; ES = umb_head
+; DS = arena before umb_head
+; else
+; DS = last arena
+; ES = next arena. will be umb_head if NC.
+;
+; CY if error
+;
+; Uses : DS, ES, DI, BX
+;
+;--------------------------------------------------------------------------
+
+Procedure GetLastArena, NEAR
+
+
+ push ax ; save ax
+
+ mov ax, [arena_head]
+ mov es, ax ; es = arena_head
+ xor di, di
+
+ cmp byte ptr es:[di],arena_signature_end
+ ; Q: is this the last arena
+ je GLA_done ; Y: return last arena in ES
+
+
+GLA_next:
+ mov ds, ax
+ call arena_next ; ax, es -> next arena
+ jc GLA_err
+
+ test [UmbFlag], LINKSTATE ; Q: are UMBs linked
+ jnz GLA_chkumb ; Y: terminating condition is
+ ; umb_head
+ ; N: terminating condition is 05Ah
+
+ cmp byte ptr es:[di],arena_signature_end
+ ; Q: is this the last arena
+ jmp short @f
+GLA_chkumb:
+ cmp ax, cx ; Q: is this umb_head
+@@:
+ jne GLA_next ; N: get next arena
+
+GLA_done:
+ ; M061 - Start
+ test [UmbFlag], LINKSTATE ; Q: are UMBs linked
+ jnz GLA_ret ; Y: we're done
+ ; N: let us confirm that the next
+ ; arena is umb_head
+ mov ds, ax
+ call arena_next ; ax, es -> next arena
+ jc GLA_err
+ cmp ax, cx ; Q: is this umb_head
+ jne GLA_err ; N: error
+ ; M061 - End
+
+GLA_ret:
+ clc
+ pop ax ; M061
+ ret ; M061
+
+GLA_err:
+ stc ; M061
+ pop ax
+ ret
+
+EndProc GetLastArena
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/cpmio.asm b/private/mvdm/dos/v86/doskrnl/dos/cpmio.asm
new file mode 100644
index 000000000..28b50850b
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/cpmio.asm
@@ -0,0 +1,931 @@
+;** Standard device IO for MSDOS (first 12 function calls)
+;
+
+ TITLE IBMCPMIO - device IO for MSDOS
+ NAME IBMCPMIO
+
+;** CPMIO.ASM - Standard device IO for MSDOS (first 12 function calls)
+;
+;
+; Old style CP/M 1-12 system calls to talk to reserved devices
+;
+; $Std_Con_Input_No_Echo
+; $Std_Con_String_Output
+; $Std_Con_String_Input
+; $RawConIO
+; $RawConInput
+; RAWOUT
+; RAWOUT2
+;
+; Revision history:
+;
+; A000 version 4.00 - Jan 1988
+; A002 PTM -- dir >lpt3 hangs
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ include sf.inc
+ include vector.inc
+ INCLUDE DEVSYM.INC
+ include doscntry.inc
+ .list
+ .cref
+
+
+; The following routines form the console I/O group (funcs 1,2,6,7,8,9,10,11).
+; They assume ES and DS NOTHING, while not strictly correct, this forces data
+; references to be SS or CS relative which is desired.
+
+ i_need CARPOS,BYTE
+ i_need STARTPOS,BYTE
+ i_need INBUF,128
+ i_need INSMODE,BYTE
+ i_need user_SP,WORD
+ EXTRN OUTCHA:NEAR ;AN000 char out with status check 2/11/KK
+ i_need Printer_Flag,BYTE
+ i_need SCAN_FLAG,BYTE
+ i_need DATE_FLAG,WORD
+ i_need Packet_Temp,WORD ; temporary packet used by readtime
+ i_need DEVCALL,DWORD
+ i_need InterChar,BYTE ;AN000;interim char flag ( 0 = regular char)
+ i_need InterCon,BYTE ;AN000;console flag ( 1 = in interim mode )
+ i_need SaveCurFlg,BYTE ;AN000;console out ( 1 = print and do not advance)
+ i_need COUNTRY_CDPG,byte ;AN000; 2/12/KK
+ i_need TEMP_VAR,WORD ;AN000; 2/12/KK
+ i_need DOS34_FLAG,WORD ;AN000; 2/12/KK
+
+NT_WAIT_BOP equ 5Ah
+
+bop MACRO callid
+ db 0c4h,0c4h,callid
+endm
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ EXTRN Get_IO_SFT:Near
+ EXTRN IOFunc:near
+
+ EXTRN EscChar:BYTE ; lead byte for function keys
+ EXTRN CanChar:BYTE ; Cancel character
+
+
+Break
+IFDEF DBCS ;AN000;
+;
+;----------------------------------------------------------------------------
+;
+; Procedure : $Std_Con_Input_No_Echo
+;
+;----------------------------------------------------------------------------
+;
+
+;--- Start of Korean Support 2/11/KK
+procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8 ;AN000;
+
+StdCILop: ;AN000;
+ invoke INTER_CON_INPUT_NO_ECHO ;AN000;
+ jmp InterApRet ; go to return fuction ;AN000;
+
+EndProc $STD_CON_INPUT_NO_ECHO ;AN000;
+;
+;----------------------------------------------------------------------------
+;
+; Procedure : Inter_Con_Input_No_Echo
+;
+;
+;----------------------------------------------------------------------------
+;
+procedure INTER_CON_INPUT_NO_ECHO,NEAR ;AN000;
+;--- End of Korean Support 2/11/KK
+
+; Inputs:
+; None
+; Function:
+; Same as $STD_CON_INPUT_NO_ECHO but uses interim character read from
+; the device.
+; Returns:
+; AL = character
+; Zero flag SET if interim character, RESET otherwise
+ELSE ;AN000;
+;
+; Inputs:
+; None
+; Function:
+; Input character from console, no echo
+; Returns:
+; AL = character
+
+procedure $STD_CON_INPUT_NO_ECHO,NEAR ;System call 8
+
+ENDIF
+ PUSH DS
+ PUSH SI
+ push cx
+
+INTEST:
+ mov cx, 10h
+
+InTest1:
+ push cx
+ invoke STATCHK
+ pop cx
+ JNZ Get
+ loop InTest1
+
+ ; extra idling for full screen
+ xor ax,ax ; with AX = 0 for WaitIfIdle
+ bop NT_WAIT_BOP
+
+;;; 7/15/86 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ JMP Intest
+Get:
+ XOR AH,AH
+ call IOFUNC
+ pop cx
+ POP SI
+ POP DS
+;;; 7/15/86
+
+;hkn; SS override
+ MOV BYTE PTR [SCAN_FLAG],0
+ CMP AL,0 ; extended code ( AL )
+ JNZ noscan
+
+;hkn; SS override
+ MOV BYTE PTR [SCAN_FLAG],1 ; set this flag for ALT_Q key
+
+noscan:
+;;; 7/15/86
+ IFDEF DBCS ;AN000;
+
+;hkn; InterChar is in DOSDATA. use SS override.
+ cmp [InterChar],1 ;AN000; set the zero flag if the character3/31/KK ;AN000;
+ ENDIF ;AN000;
+ return
+ IFDEF DBCS ;AN000;
+EndProc INTER_CON_INPUT_NO_ECHO ;AN000; ;2/11/KK ;AN000;
+ ELSE ;AN000;
+EndProc $STD_CON_INPUT_NO_ECHO
+ ENDIF ;AN000;
+
+ BREAK <$STD_CON_STRING_OUTPUT - Console String Output>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_CON_STRING_OUTPUT - Console String Output
+;
+;
+; ENTRY (DS:DX) Point to output string '$' terminated
+; EXIT none
+; USES ALL
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_CON_STRING_OUTPUT,NEAR ;System call 9
+
+ MOV SI,DX
+STRING_OUT1:
+ LODSB
+; IFDEF DBCS ;AN000;
+; invoke TESTKANJ ;AN000; 2/11/KK ;AN000;
+; jz SBCS00 ;AN000; 2/11/KK ;AN000;
+; invoke OUTT ;AN000; 2/11/KK ;AN000;
+; LODSB ;AN000; 2/11/KK ;AN000;
+; JMP NEXT_STR1 ;AN000; 2/11/KK ;AN000;
+;SBCS00: ;AN000; 2/11/KK ;AN000;
+; ENDIF ;AN000;
+ CMP AL,'$'
+ retz
+NEXT_STR1:
+ invoke OUTT
+ JMP STRING_OUT1
+
+EndProc $STD_CON_STRING_OUTPUT
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+
+IFDEF DBCS
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+
+ include kstrin.asm
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+
+ELSE ; Not double byte characters
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+; SCCSID = @(#)strin.asm 1.2 85/04/18
+
+ BREAK <$STD_CON_STRING_INPUT - Input Line from Console>
+
+
+;** $STD_CON_STRING_INPUT - Input Line from Console
+;
+; $STD_CON_STRING_INPUT Fills a buffer from console input until CR
+;
+; ENTRY (ds:dx) = input buffer
+; EXIT none
+; USES ALL
+
+ ASSUME DS:NOTHING,ES:NOTHING
+procedure $STD_CON_STRING_INPUT,NEAR ;System call 10
+
+ MOV AX,SS
+ MOV ES,AX
+ MOV SI,DX
+ XOR CH,CH
+ LODSW
+
+; (AL) = the buffer length
+; (AH) = the template length
+
+ OR AL,AL
+ retz ;Buffer is 0 length!!?
+ MOV BL,AH ;Init template counter
+ MOV BH,CH ;Init template counter
+
+; (BL) = the number of bytes in the template
+
+ CMP AL,BL
+ JBE NOEDIT ;If length of buffer inconsistent with contents
+ CMP BYTE PTR [BX+SI],c_CR
+ JZ EDITON ;If CR correctly placed EDIT is OK
+
+; The number of chars in the template is >= the number of chars in buffer or
+; there is no CR at the end of the template. This is an inconsistant state
+; of affairs. Pretend that the template was empty:
+;
+
+noedit: MOV BL,CH ;Reset buffer
+editon: MOV DL,AL
+ DEC DX ;DL is # of bytes we can put in the buffer
+
+; Top level. We begin to read a line in.
+
+;hkn; SS override
+newlin: MOV AL,[CARPOS]
+ MOV [STARTPOS],AL ;Remember position in raw buffer
+ PUSH SI
+
+;hkn; INBUF is in DOSDATA
+ MOV DI,OFFSET DOSDATA:INBUF ;Build the new line here
+
+;hkn; SS override
+ MOV [INSMODE],CH ;Insert mode off
+ MOV BH,CH ;No chars from template yet
+ MOV DH,CH ;No chars to new line yet
+ invoke $STD_CON_INPUT_NO_ECHO ;Get first char
+ CMP AL,c_LF ;Linefeed
+ JNZ GOTCH ;Filter out LF so < works
+
+; This is the main loop of reading in a character and processing it.
+;
+; (BH) = the index of the next byte in the template
+; (BL) = the length of the template
+; (DH) = the number of bytes in the buffer
+; (DL) = the length of the buffer
+
+entry GETCH
+ invoke $STD_CON_INPUT_NO_ECHO
+GOTCH:
+;
+; Brain-damaged Tim Patterson ignored ^F in case his BIOS did not flush the
+; input queue.
+;
+ CMP AL,"F"-"@"
+ JZ GETCH
+
+; If the leading char is the function-key lead byte
+
+
+;hkn; ESCCHAR is in TABLE seg (DOSCODE)
+ CMP AL,[ESCCHAR]
+ JZ ESCape ;change reserved keyword DBM 5-7-87
+
+; Rubout and ^H are both destructive backspaces.
+
+ CMP AL,c_DEL
+ JZ BACKSPJ
+ CMP AL,c_BS
+ JZ BACKSPJ
+
+; ^W deletes backward once and then backs up until a letter is before the
+; cursor
+
+ CMP AL,"W" - "@"
+
+; The removal of the comment characters before the jump statement will
+; cause ^W to backup a word.
+
+;*** JZ WordDel
+ NOP
+ NOP
+ CMP AL,"U" - "@"
+
+; The removal of the comment characters before the jump statement will
+; cause ^U to clear a line.
+
+;*** JZ LineDel
+ NOP
+ NOP
+
+
+; CR terminates the line.
+
+ CMP AL,c_CR
+ JZ ENDLIN
+
+; LF goes to a new line and keeps on reading.
+
+ CMP AL,c_LF
+ JZ PHYCRLF
+
+; ^X (or ESC) deletes the line and starts over
+
+
+;hkn; CANCHAR is in TABLE seg (DOSCODE), so CS override
+ CMP AL,[CANCHAR]
+ JZ KILNEW
+
+; Otherwise, we save the input character.
+
+savch: CMP DH,DL
+ JAE BUFFUL ; buffer is full.
+ STOSB
+ INC DH ; increment count in buffer.
+ invoke BUFOUT ;Print control chars nicely
+
+;hkn; SS override
+ CMP BYTE PTR [INSMODE],0
+ JNZ GETCH ; insertmode => don't advance template
+ CMP BH,BL
+ JAE GETCH ; no more characters in template
+ INC SI ; Skip to next char in template
+ INC BH ; remember position in template
+ JMP SHORT GETCH
+
+BACKSPJ: JMP SHORT BACKSP
+
+bufful: MOV AL,7 ; Bell to signal full buffer
+ invoke OUTT
+ JMP SHORT GETCH
+
+ESCape: transfer OEMFunctionKey ; let the OEM's handle the key dispatch
+
+ENDLIN:
+ STOSB ; Put the CR in the buffer
+ invoke OUTT ; Echo it
+ POP DI ; Get start of user buffer
+ MOV [DI-1],DH ; Tell user how many bytes
+ INC DH ; DH is length including CR
+COPYNEW:
+ SAVE <DS,ES>
+ RESTORE <DS,ES> ; XCHG ES,DS
+
+;hkn; INBUF is in DOSDATA
+ MOV SI,OFFSET DOSDATA:INBUF
+ MOV CL,DH ; set up count
+ REP MOVSB ; Copy final line to user buffer
+ return
+
+; Output a CRLF to the user screen and do NOT store it into the buffer
+
+PHYCRLF:
+ invoke CRLF
+ JMP GETCH
+
+;
+; Delete the previous line
+;
+LineDel:
+ OR DH,DH
+ JZ GetCh
+ Call BackSpace
+ JMP LineDel
+
+;
+; delete the previous word.
+;
+WordDel:
+WordLoop:
+ Call BackSpace ; backspace the one spot
+ OR DH,DH
+ JZ GetChJ
+ MOV AL,ES:[DI-1]
+ cmp al,'0'
+ jb GetChj
+ cmp al,'9'
+ jbe WordLoop
+ OR AL,20h
+ CMP AL,'a'
+ JB GetChJ
+ CMP AL,'z'
+ JBE WordLoop
+getchj: JMP GetCh
+
+; The user wants to throw away what he's typed in and wants to start over. We
+; print the backslash and then go to the next line and tab to the correct spot
+; to begin the buffered input.
+
+ entry KILNEW
+ MOV AL,"\"
+ invoke OUTT ;Print the CANCEL indicator
+ POP SI ;Remember start of edit buffer
+PUTNEW:
+ invoke CRLF ;Go to next line on screen
+
+;hkn; SS override
+ MOV AL,[STARTPOS]
+ invoke TAB ;Tab over
+ JMP NEWLIN ;Start over again
+
+
+
+; Destructively back up one character position
+
+entry BackSp
+ Call BackSpace
+ JMP GetCh
+
+BackSpace:
+ OR DH,DH
+ JZ OLDBAK ;No chars in line, do nothing to line
+ CALL BACKUP ;Do the backup
+ MOV AL,ES:[DI] ;Get the deleted char
+ CMP AL," "
+ JAE OLDBAK ;Was a normal char
+ CMP AL,c_HT
+ JZ BAKTAB ;Was a tab, fix up users display
+;; 9/27/86 fix for ctrl-U backspace
+ CMP AL,"U"-"@" ; ctrl-U is a section symbol not ^U
+ JZ OLDBAK
+ CMP AL,"T"-"@" ; ctrl-T is a paragraphs symbol not ^T
+ JZ OLDBAK
+;; 9/27/86 fix for ctrl-U backspace
+ CALL BACKMES ;Was a control char, zap the '^'
+OLDBAK:
+
+;hkn; SS override
+ CMP BYTE PTR [INSMODE],0
+ retnz ;In insert mode, done
+ OR BH,BH
+ retz ;Not advanced in template, stay where we are
+ DEC BH ;Go back in template
+ DEC SI
+ return
+
+BAKTAB:
+ PUSH DI
+ DEC DI ;Back up one char
+ STD ;Go backward
+ MOV CL,DH ;Number of chars currently in line
+ MOV AL," "
+ PUSH BX
+ MOV BL,7 ;Max
+ JCXZ FIGTAB ;At start, do nothing
+FNDPOS:
+ SCASB ;Look back
+ JNA CHKCNT
+ CMP BYTE PTR ES:[DI+1],9
+ JZ HAVTAB ;Found a tab
+ DEC BL ;Back one char if non tab control char
+CHKCNT:
+ LOOP FNDPOS
+FIGTAB:
+;hkn; SS override
+ SUB BL,[STARTPOS]
+HAVTAB:
+ SUB BL,DH
+ ADD CL,BL
+ AND CL,7 ;CX has correct number to erase
+ CLD ;Back to normal
+ POP BX
+ POP DI
+ JZ OLDBAK ;Nothing to erase
+TABBAK:
+ invoke BACKMES
+ LOOP TABBAK ;Erase correct number of chars
+ JMP SHORT OLDBAK
+
+BACKUP:
+ DEC DH ;Back up in line
+ DEC DI
+BACKMES:
+ MOV AL,c_BS ;Backspace
+ invoke OUTT
+ MOV AL," " ;Erase
+ invoke OUTT
+ MOV AL,c_BS ;Backspace
+ JMP OUTT ;Done
+
+;User really wants an ESC character in his line
+ entry TwoEsc
+
+;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override
+ MOV AL,[ESCCHAR]
+ JMP SAVCH
+
+;Copy the rest of the template
+ entry COPYLIN
+ MOV CL,BL ;Total size of template
+ SUB CL,BH ;Minus position in template, is number to move
+ JMP SHORT COPYEACH
+
+ entry CopyStr
+ invoke FINDOLD ;Find the char
+ JMP SHORT COPYEACH ;Copy up to it
+
+;Copy one char from template to line
+ entry COPYONE
+ MOV CL,1
+;Copy CX chars from template to line
+COPYEACH:
+;hkn; SS override
+ MOV BYTE PTR [INSMODE],0 ;All copies turn off insert mode
+ CMP DH,DL
+ JZ GETCH2 ;At end of line, can't do anything
+ CMP BH,BL
+ JZ GETCH2 ;At end of template, can't do anything
+ LODSB
+ STOSB
+ invoke BUFOUT
+ INC BH ;Ahead in template
+ INC DH ;Ahead in line
+ LOOP COPYEACH
+GETCH2:
+ JMP GETCH
+
+;Skip one char in template
+ entry SKIPONE
+ CMP BH,BL
+ JZ GETCH2 ;At end of template
+ INC BH ;Ahead in template
+ INC SI
+ JMP GETCH
+
+ entry SKIPSTR
+ invoke FINDOLD ;Find out how far to go
+ ADD SI,CX ;Go there
+ ADD BH,CL
+ JMP GETCH
+
+;Get the next user char, and look ahead in template for a match
+;CX indicates how many chars to skip to get there on output
+;NOTE: WARNING: If the operation cannot be done, the return
+; address is popped off and a jump to GETCH is taken.
+; Make sure nothing extra on stack when this routine
+; is called!!! (no PUSHes before calling it).
+FINDOLD:
+ invoke $STD_CON_INPUT_NO_ECHO
+
+;hkn; ESCCHAR is in TABLE seg (DOSCODE), so CS override
+ CMP AL,[ESCCHAR] ; did he type a function key?
+ JNZ FindSetup ; no, set up for scan
+ invoke $STD_CON_INPUT_NO_ECHO ; eat next char
+ JMP short NotFnd ; go try again
+FindSetup:
+ MOV CL,BL
+ SUB CL,BH ;CX is number of chars to end of template
+ JZ NOTFND ;At end of template
+ DEC CX ;Cannot point past end, limit search
+ JZ NOTFND ;If only one char in template, forget it
+ PUSH ES
+ PUSH DS
+ POP ES
+ PUSH DI
+ MOV DI,SI ;Template to ES:DI
+ INC DI
+ REPNE SCASB ;Look
+ POP DI
+ POP ES
+ JNZ NOTFND ;Didn't find the char
+ NOT CL ;Turn how far to go into how far we went
+ ADD CL,BL ;Add size of template
+ SUB CL,BH ;Subtract current pos, result distance to skip
+ return
+
+NOTFND:
+ POP BP ;Chuck return address
+ JMP GETCH
+
+entry REEDIT
+ MOV AL,"@" ;Output re-edit character
+ invoke OUTT
+ POP DI
+ PUSH DI
+ PUSH ES
+ PUSH DS
+ invoke COPYNEW ;Copy current line into template
+ POP DS
+ POP ES
+ POP SI
+ MOV BL,DH ;Size of line is new size template
+ JMP PUTNEW ;Start over again
+
+ entry EXITINS
+ entry ENTERINS
+
+;hkn; SS override
+ NOT BYTE PTR [INSMODE]
+ JMP GETCH
+
+;Put a real live ^Z in the buffer (embedded)
+ entry CTRLZ
+ MOV AL,"Z"-"@"
+ JMP SAVCH
+
+;Output a CRLF
+ entry CRLF
+ MOV AL,c_CR
+ invoke OUTT
+ MOV AL,c_LF
+ JMP OUTT
+
+EndProc $STD_CON_STRING_INPUT
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+
+ENDIF
+
+;----------------------------------------------------------------------------
+;----------------------------------------------------------------------------
+ BREAK <$RAW_CON_IO - Do Raw Console I/O>
+;
+;----------------------------------------------------------------------------
+;
+;** $RAW_CON_IO - Do Raw Console I/O
+;
+; Input or output raw character from console, no echo
+;
+; ENTRY DL = -1 if input
+; = output character if output
+; EXIT (AL) = input character if input
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $RAW_CON_IO,NEAR ; System call 6
+
+ MOV AL,DL
+ CMP AL,-1
+ LJNE RAWOUT ; is output
+
+;hkn; SS override
+ LES DI,DWORD PTR [user_SP] ; Get pointer to register save area
+ XOR BX,BX
+ call GET_IO_SFT
+ retc
+ IFDEF DBCS ;AN000;
+
+;hkn; SS override
+ push word ptr [Intercon] ;AN000;
+ mov [Intercon],0 ;AN000; disable interim characters
+ ENDIF ;AN000;
+ MOV AH,1
+ call IOFUNC
+ JNZ RESFLG
+ IFDEF DBCS ;AN000;
+
+;hkn; SS override
+ pop word ptr [InterCon] ;AN000; restore interim flag
+ ENDIF ;AN000;
+ invoke SPOOLINT
+ OR BYTE PTR ES:[DI.user_F],40H ; Set user's zero flag
+ XOR AL,AL
+ return
+
+RESFLG:
+ AND BYTE PTR ES:[DI.user_F],0FFH-40H ; Reset user's zero flag
+ IFDEF DBCS ;AN000;
+ XOR AH,AH ;AN000;
+ call IOFUNC ;AN000; get the character
+
+;hkn; SS override
+ pop word ptr [InterCon] ;AN000;
+ return ;AN000;
+ ENDIF ;AN000; ;AN000;
+
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Raw_CON_INPUT - Raw Console Input
+;
+; Input raw character from console, no echo
+;
+; ENTRY none
+; EXIT (al) = character
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+
+rci0: invoke SPOOLINT
+
+entry $RAW_CON_INPUT ; System call 7
+
+ PUSH BX
+ XOR BX,BX
+ call GET_IO_SFT
+ POP BX
+ retc
+ MOV AH,1
+ call IOFUNC
+ JNZ rci5
+
+; We don't do idling here for NTVDM because softpc's
+; idle detection requires a hi num polls/ tic to be
+; activated
+;
+; 04-Aug-1992 Jonle
+;
+; MOV AH,84h
+; INT int_IBM
+
+ JMP rci0
+
+rci5: XOR AH,AH
+ call IOFUNC
+ IFDEF DBCS ;AN000;
+
+;hkn; SS override
+ cmp [InterChar],1 ;AN000; 2/11/KK
+; 2/11/KK
+; Sets the application zero flag depending on the 2/11/KK
+; zero flag upon entry to this routine. Then returns 2/11/KK
+; from system call. 2/11/KK
+; 2/11/KK
+entry InterApRet ;AN000; 2/11/KK ;AN000;
+ pushf ;AN000; 3/16/KK
+;hkn; push ds ;AN000; 3/16/KK
+ push bx ;AN000; 3/16/KK
+
+;hkn; SS is DOSDATA
+;hkn; Context DS ;AN000; 3/16/KK
+
+;hkn; COUNTRY_CDPG is in DOSCODE;smr;NO in DOSDATA
+ MOV BX,offset DOSDATA:COUNTRY_CDPG.ccDosCodePage
+ cmp word ptr ss:[bx],934 ;AN000; 3/16/KK korean code page ?; bug fix. use SS
+ pop bx ;AN000; 3/16/KK
+;hkn; pop ds ;AN000; 3/16/KK
+ je do_koren ;AN000; 3/16/KK
+ popf ;AN000; 3/16/KK
+ return ;AN000; 3/16/KK
+do_koren: ;AN000; 3/16/KK
+ popf ;AN000;
+
+;hkn; SS override
+ LES DI,DWORD PTR [user_SP] ;AN000; Get pointer to register save area KK
+ jnz sj0 ;AN000; 2/11/KK
+ OR BYTE PTR ES:[DI.user_F],40H ;AN000; Set user's zero flag 2/11/KK
+ return ;AN000; 2/11/KK
+sj0: ;AN000; 2/11/KK
+ AND BYTE PTR ES:[DI.user_F],0FFH-40H ;AN000; Reset user's zero flag 2/KK
+ ENDIF ;AN000;
+ return ;AN000;
+;
+; Output the character in AL to stdout
+;
+ entry RAWOUT
+
+ PUSH BX
+ MOV BX,1
+
+ call GET_IO_SFT
+ JC RAWRET1
+
+ MOV BX,[SI.sf_flags] ;hkn; DS set up by get_io_sft
+
+ ;
+ ; If we are a network handle OR if we are not a local device then go do the
+ ; output the hard way.
+ ;
+
+ AND BX,sf_isNet + devid_device
+ CMP BX,devid_device
+ JNZ RawNorm
+ IFDEF DBCS ;AN000;
+
+;hkn; SS override
+ TEST [SaveCurFlg],01H ;AN000; print but no cursor adv?
+ JNZ RAWNORM ;AN000; 2/11/KK
+ ENDIF ;AN000;
+
+; TEST BX,sf_isnet ; output to NET?
+; JNZ RAWNORM ; if so, do normally
+; TEST BX,devid_device ; output to file?
+; JZ RAWNORM ; if so, do normally
+
+ PUSH DS
+ LDS BX,[SI.sf_devptr] ; output to special?
+ TEST BYTE PTR [BX+SDEVATT],ISSPEC
+ POP DS
+ JZ RAWNORM ; if not, do normally
+ INT int_fastcon ; quickly output the char
+RAWRET:
+ CLC
+RAWRET1:
+ POP BX
+ return
+RAWNORM:
+ CALL RAWOUT3
+ JMP RAWRET
+
+;
+; Output the character in AL to handle in BX
+;
+ entry RAWOUT2
+
+ call GET_IO_SFT
+ retc
+RAWOUT3:
+ PUSH AX
+ JMP SHORT RAWOSTRT
+ROLP:
+ invoke SPOOLINT
+
+;hkn; SS override
+ OR [DOS34_FLAG],CTRL_BREAK_FLAG ;AN002; set control break
+ invoke DSKSTATCHK ;AN002; check control break
+RAWOSTRT:
+ MOV AH,3
+ call IOFUNC
+ JZ ROLP
+;SR;
+; IOFUNC now returns ax = 0ffffh if there was an I24 on a status call and
+;the user failed. We do not send a char if this happens. We however return
+;to the caller with carry clear because this DOS call does not return any
+;status.
+;
+ inc ax ;fail on I24 if ax = -1
+ POP AX
+ jz nosend ;yes, do not send char
+
+ MOV AH,2
+ call IOFUNC
+nosend:
+ CLC ; Clear carry indicating successful
+ return
+EndProc $RAW_CON_IO
+
+;
+;----------------------------------------------------------------------------
+;
+; Inputs:
+; AX=0 save the DEVCALL request packet
+; =1 restore the DEVCALL request packet
+; Function:
+; save or restore the DEVCALL packet
+; Returns:
+; none
+;
+;----------------------------------------------------------------------------
+;
+
+procedure Save_Restore_Packet,NEAR
+
+ PUSH DS
+ PUSH ES
+ PUSH SI
+ PUSH DI
+ CMP AX,0 ; save packet
+ JZ save_packet
+restore_packet:
+ MOV SI,OFFSET DOSDATA:Packet_Temp ;sourec
+ MOV DI,OFFSET DOSDATA:DEVCALL ;destination
+ JMP short set_seg
+save_packet:
+ MOV DI,OFFSET DOSDATA:Packet_Temp ;destination
+ MOV SI,OFFSET DOSDATA:DEVCALL ;source
+set_seg:
+ MOV AX,SS ; set DS,ES to DOSDATA
+ MOV DS,AX
+ MOV ES,AX
+ MOV CX,11 ; 11 words to move
+ REP MOVSW
+
+ POP DI
+ POP SI
+ POP ES
+ POP DS
+ return
+EndProc Save_Restore_Packet
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/cpmio2.asm b/private/mvdm/dos/v86/doskrnl/dos/cpmio2.asm
new file mode 100644
index 000000000..344d228ad
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/cpmio2.asm
@@ -0,0 +1,406 @@
+ TITLE CPMIO2 - device IO for MSDOS
+ NAME CPMIO2
+
+;** Old style CP/M 1-12 system calls to talk to reserved devices
+;
+; $Std_Con_Input
+; $Std_Con_Output
+; OUTT
+; TAB
+; BUFOUT
+; $Std_Aux_Input
+; $Std_Aux_Output
+; $Std_Printer_Output
+; $Std_Con_Input_Status
+; $Std_Con_Input_Flush
+;
+; Revision History:
+;
+; AN000 version 4.00 - Jan. 1988
+
+ .xcref
+ .xlist
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ .list
+ .cref
+
+; The following routines form the console I/O group (funcs 1,2,6,7,8,9,10,11).
+; They assume ES and DS NOTHING, while not strictly correct, this forces data
+; references to be SS or CS relative which is desired.
+
+ i_need CARPOS,BYTE
+ i_need CHARCO,BYTE
+ i_need PFLAG,BYTE
+ i_need CurrentPDB,WORD ;AN000;
+ i_need InterCon,BYTE ;AN000;
+ i_need SaveCurFlg,BYTE ;AN000;
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+;hkn; All the variables use SS override or DS. Therefore there is
+;hkn; no need to specifically set up any seg regs unless SS assumption is
+;hkn; not valid.
+
+
+ BREAK <$STD_CON_INPUT - System Call 1>
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_CON_INPUT - System Call 1
+;
+; Input character from console, echo
+;
+; ENTRY none
+; EXIT (al) = character
+; USES ALL
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_CON_INPUT,NEAR ;System call 1
+ IFDEF DBCS ;AN000;
+ push word ptr [InterCon] ;AN000;
+ mov [InterCon],01H ;AN000;
+ invoke INTER_CON_INPUT_NO_ECHO ;AN000;
+ pop word ptr [InterCon] ;AN000;
+ pushf ;AN000;
+ push AX ;AN000;
+ mov [SaveCurFlg],0 ;AN000;
+ jnz sj0 ;AN000;
+ mov [SaveCurFlg],1 ;AN000;
+sj0: ;AN000;
+ invoke OUTT ;AN000;
+ mov [SaveCurFLg],0 ;AN000;
+ pop AX ;AN000;
+ popf ;AN000;
+ jz $STD_CON_INPUT ;AN000;
+ ELSE ;AN000;
+ invoke $STD_CON_INPUT_NO_ECHO
+ PUSH AX
+ invoke OUTT
+ POP AX
+ ENDIF ;AN000;
+ return
+EndProc $STD_CON_INPUT
+
+
+ BREAK <$STD_CON_OUTPUT - System Call 2>
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_CON_OUTPUT - System Call 2
+;
+; Output character to console
+;
+; ENTRY (dl) = character
+; EXIT none
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+ public OUTCHA ;AN000;
+procedure $STD_CON_OUTPUT,NEAR ;System call 2
+
+ MOV AL,DL
+
+ entry OUTT
+ CMP AL,20H
+ JB CTRLOUT
+ CMP AL,c_DEL
+ JZ OUTCH
+OUTCHA: ;AN000;
+ INC BYTE PTR [CARPOS]
+OUTCH:
+ PUSH DS
+ PUSH SI
+ INC BYTE PTR [CHARCO] ;invoke statchk...
+ AND BYTE PTR [CHARCO],00111111B ;AN000; every 64th char
+ JNZ OUTSKIP
+ PUSH AX
+ invoke STATCHK
+ POP AX
+OUTSKIP:
+ invoke RAWOUT ;output the character
+ POP SI
+ POP DS
+ IFDEF DBCS ;AN000;
+ TESTB [SaveCurFlg],01H ;AN000;print but no cursor adv? 2/13/KK
+ retnz ;AN000;if so then do not send to prt2/13/KK
+ ENDIF
+ TEST BYTE PTR [PFLAG],-1
+ retz
+ PUSH BX
+ PUSH DS
+ PUSH SI
+ MOV BX,1
+ invoke GET_IO_SFT ;hkn; GET_IO_SFT will set up DS:SI
+ ;hkn; to sft entry
+ JC TRIPOPJ
+ MOV BX,[SI].SF_FLAGS
+ TESTB BX,sf_isnet ; output to NET?
+ JNZ TRIPOPJ ; if so, no echo
+ TESTB BX,devid_device ; output to file?
+ JZ TRIPOPJ ; if so, no echo
+ MOV BX,4
+ invoke GET_IO_SFT
+ JC TRIPOPJ
+ TESTB [SI].SF_FLAGS,sf_net_spool ; StdPrn redirected?
+ JZ LISSTRT2J ; No, OK to echo
+ MOV BYTE PTR [PFLAG],0 ; If a spool, NEVER echo
+TRIPOPJ:
+ JMP TRIPOP
+
+LISSTRT2J:
+ JMP LISSTRT2
+
+CTRLOUT:
+ CMP AL,c_CR
+ JZ ZERPOS
+ CMP AL,c_BS
+ JZ BACKPOS
+ CMP AL,c_HT
+ JNZ OUTCH
+ MOV AL,[CARPOS]
+ OR AL,0F8H
+ NEG AL
+
+ entry TAB
+
+ PUSH CX
+ MOV CL,AL
+ MOV CH,0
+ JCXZ POPTAB
+TABLP:
+ MOV AL," "
+ invoke OUTT
+ LOOP TABLP
+POPTAB:
+ POP CX
+ return
+
+ZERPOS:
+ MOV BYTE PTR [CARPOS],0
+ JMP OUTCH
+OUTJ: JMP OUTT
+
+BACKPOS:
+ DEC BYTE PTR [CARPOS]
+ JMP OUTCH
+
+ entry BUFOUT
+ CMP AL," "
+ JAE OUTJ ;Normal char
+ CMP AL,9
+ JZ OUTJ ;OUT knows how to expand tabs
+
+ifdef DBCS ; MSKK01 07/14/89
+ifdef JAPAN ; MSKK01 07/14/89
+
+; convert CONTROL-U and CONTROL-T to ^U ^T in KANJI DOS
+
+else
+
+;DOS 3.3 7/14/86
+ CMP AL,"U"-"@" ; turn ^U to section symbol
+ JZ CTRLU
+ CMP AL,"T"-"@" ; turn ^T to paragraph symbol
+ JZ CTRLU
+endif
+else
+;DOS 3.3 7/14/86
+ CMP AL,"U"-"@" ; turn ^U to section symbol
+ JZ CTRLU
+ CMP AL,"T"-"@" ; turn ^T to paragraph symbol
+ JZ CTRLU
+endif
+NOT_CTRLU:
+;DOS 3.3 7/14/86
+
+ PUSH AX
+ MOV AL,"^"
+ invoke OUTT ;Print '^' before control chars
+ POP AX
+ OR AL,40H ;Turn it into Upper case mate
+CTRLU:
+ invoke OUTT
+ return
+EndProc $STD_CON_OUTPUT
+
+ BREAK <$STD_AUX_INPUT - System Call 3>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_AUX_INPUT - System Call 3
+;
+; $STD_AUX_INPUT returns a character from Aux Input
+;
+; ENTRY none
+; EXIT (al) = character
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_AUX_INPUT,NEAR ;System call 3
+
+ invoke STATCHK
+ MOV BX,3
+ invoke GET_IO_SFT
+ retc
+ JMP SHORT TAISTRT
+AUXILP:
+ invoke SPOOLINT
+TAISTRT:
+ MOV AH,1
+ invoke IOFUNC
+ JZ AUXILP
+ XOR AH,AH
+ invoke IOFUNC
+ return
+EndProc $STD_AUX_INPUT
+
+
+ BREAK <$STD_AUX_OUTPUT, $STD_PRINTER_OUTPUT, fcn 4,5>
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_AUX_OUTPUT - Output character to AUX
+;
+; ENTRY (dl) = character
+; EXIT none
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_AUX_OUTPUT,NEAR ;System call 4
+
+ PUSH BX
+ MOV BX,3
+ JMP SHORT SENDOUT
+
+EndProc $STD_AUX_OUTPUT
+
+
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_PRINTER_OUTPUT - Output character to printer
+;
+; ENTRY (dl) = character
+; EXIT none
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_PRINTER_OUTPUT,NEAR ;System call 5
+
+ PUSH BX
+ MOV BX,4
+
+SENDOUT:
+ MOV AL,DL
+ PUSH AX
+ invoke STATCHK
+ POP AX
+ PUSH DS
+ PUSH SI
+LISSTRT2:
+ invoke RAWOUT2
+TRIPOP:
+ POP SI
+ POP DS
+ POP BX
+ return
+EndProc $STD_PRINTER_OUTPUT
+
+ BREAK <$STD_CON_INPUT_STATUS - System Call 11>
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_CON_INPUT_STATUS - System Call 11
+;
+; Check console input status
+;
+; ENTRY none
+; EXIT AL = -1 character available, = 0 no character
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_CON_INPUT_STATUS,NEAR ;System call 11
+
+ invoke STATCHK
+ MOV AL,0 ; no xor!!
+ retz
+ OR AL,-1
+ return
+EndProc $STD_CON_INPUT_STATUS
+
+ BREAK <$STD_CON_INPUT_FLUSH - System call 12>
+;
+;----------------------------------------------------------------------------
+;
+;** $STD_CON_INPUT_FLUSH - System Call 12
+;
+; Flush console input buffer and perform call in AL
+;
+; ENTRY (AL) = DOS function to be called after flush (1,6,7,8,10)
+; EXIT (al) = 0 iff (al) was not one of the supported fcns
+; return arguments for the fcn supplied in (AL)
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $STD_CON_INPUT_FLUSH,NEAR ;System call 12
+
+ PUSH AX
+ PUSH DX
+ XOR BX,BX
+ invoke GET_IO_SFT
+ JC BADJFNCON
+ MOV AH,4
+ invoke IOFUNC
+
+BADJFNCON:
+ POP DX
+ POP AX
+ MOV AH,AL
+ CMP AL,1
+ JZ REDISPJ
+ CMP AL,6
+ JZ REDISPJ
+ CMP AL,7
+ JZ REDISPJ
+ CMP AL,8
+ JZ REDISPJ
+ CMP AL,10
+ JZ REDISPJ
+ MOV AL,0
+ return
+
+REDISPJ:
+ IFDEF DBCS ;AN000;
+ mov ds,[CurrentPDB] ;AN000;
+ ;AN000; set DS same as one from COMMAND entry
+ ENDIF
+ invoke DOCLI
+ transfer REDISP
+EndProc $STD_CON_INPUT_FLUSH
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/crit.asm b/private/mvdm/dos/v86/doskrnl/dos/crit.asm
new file mode 100644
index 000000000..4eb0b2711
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/crit.asm
@@ -0,0 +1,157 @@
+ TITLE CRIT - Critical Section Routines
+ NAME CRIT
+
+;** CRIT.ASM - Critical Section Routines
+;
+; Critical section handlers
+;
+; Modification history:
+;
+; Sudeepb 15-Mar-1991 Ported for NT DOSEm
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ include int2a.inc
+ include vector.inc
+ include bugtyp.inc
+ .cref
+ .list
+
+ I_need User_In_AX,WORD
+ i_need CurrentPDB,WORD
+
+ I_need redir_patch,BYTE
+
+DOSCODE SEGMENT
+ ASSUME SS:NOTHING,CS:DOSCODE
+
+ allow_getdseg
+
+ Break <Critical section handlers>
+
+;
+; Each handler must leave everything untouched; including flags!
+;
+; Sleaze for time savings: first instruction is a return. This is patched
+; by the sharer to be a PUSH AX to complete the correct routines.
+
+
+Procedure EcritDisk,NEAR
+ public EcritMem
+ public EcritSFT
+ECritMEM LABEL NEAR
+ECritSFT LABEL NEAR
+
+ ret
+; pushf
+; cmp ss:[redir_patch],0
+; jz @f
+; popff
+;
+; PUSH AX
+;if DEBUG
+; SAVE <ds>
+; GETDSEG DS
+; fmt TypSect,LevReq,<"PDB $x entering DISK">,<CurrentPDB>
+; RESTORE <ds>
+; ASSUME DS:nothing
+;endif
+; MOV AX,8000h+critDisk
+; INT int_ibm
+; POP AX
+; return
+;@@:
+; popff
+; ret
+
+EndProc EcritDisk
+
+
+Procedure LcritDisk,NEAR
+ public LcritMem
+ public LcritSFT
+LCritMEM LABEL NEAR
+LCritSFT LABEL NEAR
+ ret
+; pushf
+; cmp ss:[redir_patch],0
+; jz @f
+; popff
+;
+; PUSH AX
+;if DEBUG
+; SAVE <ds>
+; GETDSEG DS
+; fmt TypSect,LevReq,<"PDB $x leaving DISK">,<CurrentPDB>
+; RESTORE <ds>
+; ASSUME DS:nothing
+;endif
+; MOV AX,8100h+critDisk
+; INT int_ibm
+; POP AX
+; return
+;@@:
+; popff
+; ret
+
+EndProc LcritDisk
+
+
+Procedure EcritDevice,NEAR
+ ret
+
+; pushf
+; cmp ss:[redir_patch],0
+; jz @f
+; popff
+;
+; PUSH AX
+;if DEBUG
+; SAVE <ds>
+; GETDSEG DS
+; fmt TypSect,LevReq,<"PDB $x entering DEV">,<CurrentPDB>
+; RESTORE <ds>
+; ASSUME DS:nothing
+;endif
+; MOV AX,8000h+critDevice
+; INT int_ibm
+; POP AX
+; return
+;@@:
+; popff
+; ret
+
+EndProc EcritDevice
+
+Procedure LcritDevice,NEAR
+ ret
+;
+; pushf
+; cmp ss:[redir_patch],0
+; jz @f
+; popff
+;
+; PUSH AX
+;if DEBUG
+; SAVE <ds>
+; GETDSEG DS
+; fmt TypSect,LevReq,<"PDB $x leaving DEV">,<CurrentPDB>
+; RESTORE <ds>
+; ASSUME DS:nothing
+;endif
+; MOV AX,8100h+critDevice
+; INT int_ibm
+; POP AX
+; return
+;@@:
+; popff
+; ret
+
+EndProc LcritDevice
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dev.asm b/private/mvdm/dos/v86/doskrnl/dos/dev.asm
new file mode 100644
index 000000000..b673943be
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dev.asm
@@ -0,0 +1,632 @@
+ TITLE DEV - Device call routines
+ NAME Dev
+
+
+;** Misc Routines to do 1-12 low level I/O and call devices
+;
+; IOFUNC
+; DEVIOCALL
+; SETREAD
+; SETWRITE
+; DEVIOCALL2
+; DEV_OPEN_SFT
+; DEV_CLOSE_SFT
+; RW_SC
+; IN_SC
+; INVALIDATE_SC
+; VIRREAD
+; SC2BUF
+;
+; Revision history:
+; sudeepb 12-Mar-1991 Ported for NT DOSEm
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ i_need IOXAD,DWORD
+ i_need IOSCNT,WORD
+ i_need DEVIOBUF,4
+ i_need IOCALL,BYTE
+ i_need IOMED,BYTE
+ i_need IORCHR,BYTE
+ i_need CALLSCNT,WORD
+ i_need DMAAdd,DWORD
+ i_need CallDevAd,DWORD
+ i_need CallXAD,DWORD
+ i_need ThisSFT,DWORD
+ i_need DevCall,DWORD
+ i_need VerFlg,BYTE
+ i_need HIGH_SECTOR,WORD ;AN000;
+ i_need CALLSSEC,WORD ;AN000;
+ i_need CALLNEWSC,DWORD ;AN000;
+ i_need SC_CACHE_COUNT,WORD ;AN000;
+ i_need SC_CACHE_PTR,DWORD ;AN000;
+ i_need CURSC_SECTOR,WORD ;AN000;
+ i_need SEQ_SECTOR,DWORD ;AN000;
+ i_need SC_SECTOR_SIZE,WORD ;AN000;
+ i_need CURSC_DRIVE,BYTE ;AN000;
+ i_need SC_DRIVE,BYTE ;AN000;
+ i_need SC_STATUS,WORD ;AN000;
+ i_need SC_FLAG,BYTE ;AN000;
+ i_need TEMP_VAR,WORD ;AN000;
+ i_need TEMP_VAR2,WORD ;AN000;
+ i_need InterChar,BYTE ;AN000; interim character flag 2/13/KK
+ i_need InterCon,BYTE ;AN000; Console mode flag(1:interim mode) 2/13/KK
+ i_need SaveCurFlg,BYTE ;AN000; Console out mode(1:print & don't adv cursor) 2 /13/KK
+ i_need DDMOVE,BYTE ;AN000; flag for DWORD move
+ i_need DOS34_FLAG,WORD ;AN000;
+ i_need fshare,BYTE ;AN010; share flag
+
+ i_need IoStatFail,BYTE ;SR; set if user failed on I24 in IOFUNC
+
+
+DOSCODE Segment
+
+ ASSUME CS:DOSCODE
+
+Public DEV001S, DEV001E ; Pathgen labels
+DEV001s:
+; length of packets
+LenTab DB DRDWRHL, DRDNDHL, DRDWRHL, DSTATHL, DFLSHL, DRDNDHL,DRDWRHL
+
+; Error Function
+
+CmdTab DB 86h, DEVRD ; 0 input
+ DB 86h, DEVRDND ; 1 input status
+ DB 87h, DEVWRT ; 2 output
+ DB 87h, DEVOST ; 3 output status
+ DB 86h, DEVIFL ; 4 input flush
+ DB 86H, DEVRDND ; 5 input status with system WAIT
+ DB 87H, DEVWRT ; 6 output string
+DEV001E:
+
+ ASSUME CS:DOSCODE, SS:DOSDATA
+
+Break <IOFUNC -- DO FUNCTION 1-12 I/O>
+;----------------------------------------------------------------------------
+;
+; Procedure Name : IOFUNC
+;
+; Inputs:
+; DS:SI Points to SFT
+; AH is function code
+; = 0 Input
+; = 1 Input Status
+; = 2 Output
+; = 3 Output Status
+; = 4 Flush
+; = 5 Input Status - System WAIT invoked for K09 if no char
+; present.
+; = 6 Output String (sudeepb 28-Jul-1992 added for NT console
+; performance)
+; AL = character if output
+; ES:DI - string pointer if function 6
+; CX - count of characters in string for function 6
+; Function:
+; Perform indicated I/O to device or file
+; Outputs:
+; AL is character if input
+; If a status call
+; zero set if not ready
+; zero reset if ready (character in AL for input status)
+; For regular files:
+; Input Status
+; Gets character but restores position
+; Zero set on EOF
+; Input
+; Gets character advances position
+; Returns ^Z on EOF
+; Output Status
+; Always ready
+; AX altered, all other registers preserved
+;----------------------------------------------------------------------------
+
+procedure IOFUNC,NEAR
+
+ Assert ISSFT,<DS,SI>,"IOFUNC"
+
+ cmp ah,6
+ jne io_old
+ MOV WORD PTR [IOXAD+2],ES ; DS:DX is the string
+ MOV WORD PTR [IOXAD],DI
+ MOV WORD PTR [IOSCNT],cx ; char count
+ jmp short io_com
+
+io_old:
+ MOV WORD PTR [IOXAD+2],SS ; SS override for IOXAD, IOSCNT,
+ ; DEVIOBUF
+
+ ; DEVIOBUF is in DOSDATA
+ MOV WORD PTR [IOXAD],OFFSET DOSDATA:DEVIOBUF
+ MOV WORD PTR [IOSCNT],1
+ MOV WORD PTR [DEVIOBUF],AX
+
+io_com:
+ TESTB [SI].SF_FLAGS,devid_device
+ JNZ IOTo33 ;AN000;
+ JMP IOTOFILE ;AN000;
+IOTO33:
+ save_world
+ MOV DX,DS
+ MOV BX,SS
+ MOV DS,BX
+ MOV ES,BX
+
+ ASSUME DS:DOSDATA
+
+ XOR BX,BX
+ cmp ah,5 ; system wait enabled?
+ jnz no_sys_wait
+ or bx,0400H ; Set bit 10 in status word for driver
+ ; It is up to device driver to carry out
+ ; appropriate action.
+no_sys_wait:
+ MOV [IOCALL.REQSTAT],BX
+ XOR BX,BX
+ MOV BYTE PTR [IOMED],BL
+
+ MOV BL,AH ; get function
+ MOV AH,LenTab[BX]
+ SHL BX,1
+ MOV CX,WORD PTR CmdTab[BX]
+ MOV BX,OFFSET DOSDATA:IOCALL; IOCALL is in DOSDATA
+ MOV [IOCALL.REQLEN],AH
+ MOV [IOCALL.REQFUNC],CH
+ IFDEF DBCS ;AN000;
+;----------------------------- Start of DBCS 2/13/KK
+ PUSH CX ;AN000;
+ MOV CL, [InterCon] ;AN000;
+ CMP CH, DEVRD ;AN000; 0 input
+ JZ SETIN ;AN000;
+ CMP CH, DEVRDND ;AN000; 1(5) input status without(with) system WAIT
+ JZ SETIN ;AN000;
+ MOV CL, [SaveCurflg] ;AN000;
+ CMP CH, DEVWRT ;AN000; 2 output
+ JZ CHKERROUT ;AN000;
+ XOR CL,CL ;AN000; else, do normal
+SETIN: ;AN000;
+ MOV BYTE PTR [IoMed], CL ;AN000; set interim I/O indication
+ POP CX ;AN000;
+;----------------------------- End of DBCS 2/13/KK
+ ENDIF ;AN000;
+ MOV DS,DX
+ASSUME DS:NOTHING
+ CALL DEVIOCALL
+ MOV DI,[IOCALL.REQSTAT] ; SS override
+ .errnz STERR-8000h
+ and di,di
+ js DevErr
+OkDevIO:
+ MOV AX,SS
+ MOV DS,AX
+
+ ASSUME DS:DOSDATA
+
+ IFDEF DBCS ;AN000;
+ MOV [InterChar],0 ;AN000; reset interim character flag 2/13/KK
+ TEST DI,Ddkey ;AN000; is this a dead key (interim char)? 2/13/KK
+ JZ NotInterim ;AN000; no, flag already reset... 2/13/KK
+ INC [InterChar] ;AN000; yes, set flag for future 2/13/KK
+NotInterim: ;AN000; 2/13/KK
+ ENDIF ;AN000;
+ CMP CH,DEVRDND
+ JNZ DNODRD
+ MOV AL,BYTE PTR [IORCHR]
+ MOV [DEVIOBUF],AL
+
+DNODRD: MOV AH,BYTE PTR [IOCALL.REQSTAT+1]
+ NOT AH ; Zero = busy, not zero = ready
+ AND AH,STBUI SHR 8
+
+QuickReturn: ;AN000; 2/13/KK
+ restore_world
+ASSUME DS:NOTHING
+
+ ; We return ax = -1 if the user failed on I24. This is the case if
+ ; IoStatFail = -1 (set after return from the I24)
+ ;
+
+ pushf
+ mov al,ss:IoStatFail ;assume fail error
+ cbw ;sign extend to word
+ cmp ax,-1
+ jne not_fail_ret
+ inc ss:IoStatFail
+ popf
+ ret
+not_fail_ret:
+
+ MOV AX,WORD PTR [DEVIOBUF] ;ss override
+ popf
+ return
+
+ IFDEF DBCS ;AN000;
+;------------------------------ Start of DBCS 2/13/KK
+CHKERROUT: ;AN000;
+ MOV DS, DX ;AN000;
+ TESTB [SI].SF_FLAGS, devid_device_con_out ;AN000; output to console ?
+ JNZ GOOD ;AN000; yes
+ CMP CL, 01 ;AN000; write interim ?
+ JNZ GOOD ;AN000; no,
+ POP CX ;AN000;
+ JMP SHORT QuickReturn ;AN000; avoid writting interims to other than
+ ;AN000; console device
+GOOD: ;AN000;
+ PUSH SS ;AN000;
+ POP DS ;AN000;
+ JMP SETIN ;AN000;
+;------------------------------ End of DBCS 2/13/KK
+ ENDIF ;AN000;
+DevErr:
+ MOV AH,CL
+ invoke CHARHARD
+ CMP AL,1
+ JNZ NO_RETRY
+ restore_world ;hkn; use macro
+ JMP IOFUNC
+
+NO_RETRY:
+
+ ;
+ ; Know user must have wanted Ignore OR Fail. Make sure device shows ready
+ ; ready so that DOS doesn't get caught in a status loop when user
+ ; simply wants to ignore the error.
+ ;
+ ; SR; If fail wanted by user set ax to special value (ax = -1). This
+ ; should be checked by the caller on return
+ ;
+
+ ; SS override
+ AND BYTE PTR [IOCALL.REQSTAT+1], NOT (STBUI SHR 8)
+
+ ; SR;
+ ; Check if user failed
+ ;
+
+ cmp al,3
+ jnz not_fail
+ dec IoStatFail ;set flag indicating fail on I24
+not_fail:
+ JMP OKDevIO
+
+IOTOFILE:
+ SAVE <BX,CX,DX,SI,DI,DS,ES,BP>
+
+ASSUME DS:NOTHING
+
+ push ds
+ pop es
+ MOV CX,WORD PTR [IOXAD+2]
+ MOV DS,CX
+ MOV DX,WORD PTR [IOXAD] ; DS;DX -> buffer
+ mov cx,1
+
+ OR AH,AH
+ JZ IOIN_Wrap
+ DEC AH
+ JZ IOIST
+ DEC AH
+ JZ IOUT
+ jmp res_file ; NON ZERO FLAG FOR OUTPUT STATUS
+
+ ; Input Status case, read without seeking
+IOIST:
+ push si
+ CALL IOIN
+ pop si
+ jz ioist_ret ; ZF set if EOF
+ push ax
+ lahf
+ push ax
+ call GET_NT_HANDLE
+ mov bl,1
+ mov dx,-1
+ mov cx,dx
+ HRDSVC SVC_DEMCHGFILEPTR ; LSEEK back 1
+ pop ax
+ sahf
+ pop ax
+ioist_ret:
+ jmp res_file
+
+ ; Output case
+IOUT:
+ call GET_NT_HANDLE
+ cmp al, al ; set zero flag so demwrite won't do lseek
+ HRDSVC SVC_DEMWRITE
+ jmp res_file ; Zero flag does'nt matter
+
+GET_NT_HANDLE: ; AX:BP is NT handle
+ mov bp,word ptr es:[si].sf_NTHandle
+ mov ax,word ptr es:[si].sf_NTHandle+2
+ ret
+IOIN:
+ call GET_NT_HANDLE
+ OR [DOS34_FLAG],Disable_EOF_I24
+ cmp al, al ; set zero flag so demread won't do lseek
+ HRDSVC SVC_DEMREAD
+ AND [DOS34_FLAG],NO_Disable_EOF_I24
+ioin_1:
+ OR AX,AX ; Check EOF
+ MOV AL,[DEVIOBUF] ; Get byte from trans addr
+ jnz ioin_2
+ MOV AL,1AH ; ^Z if no bytes
+ test ES:[DI.SF_FLAGS], sf_nt_pipe_in ;the handle is a pipe?
+ jne PIPEIN ; yes, go special checking for pipe EOF
+ioin_2:
+ return
+
+ ; Input Case
+IOIN_Wrap:
+ call IOIN
+res_file:
+ RESTORE <BP,ES,DS,DI,SI,DX,CX,BX>
+ return
+
+PIPEIN:
+;; we read nothing back, make sure it is a real EOF
+wait_pipe_data_eof:
+ call GET_NT_HANDLE
+ SVC SVC_DEMPIPEFILEDATAEOF
+ jz wait_pipe_data_eof ;; not eof, no new data, wait
+ jnc IOIN ;; not eof, more data, go read it
+;; EOF encountered
+ and WORD PTR ES:[DI.SF_FLAGS], NOT(sf_nt_pipe_in); turn it off
+ mov WORD PTR ES:[DI.SF_SIZE], BP
+ mov WORD PTR ES:[DI.SF_SIZE + 2], AX
+ jmp short IOIN ;; do the read again. because new data
+ ;; could be available
+
+EndProc IOFUNC
+
+Break <DEV_OPEN_SFT, DEV_CLOSE_SFT - OPEN or CLOSE A DEVICE>
+
+
+;** Dev_Open_SFT - Open the Device for an SFT
+;
+; Dev_Open_SFT issues an open call to the device associated with
+; the SFT.
+;
+; ENTRY (ES:DI) = SFT
+; EXIT none
+; USES all
+
+procedure DEV_OPEN_SFT,NEAR
+
+ Assert ISSFT,<ES,DI>,"Dev_Open_SFT"
+
+ Save_World ; use macro
+ MOV AL,DEVOPN
+ JMP SHORT DO_OPCLS
+
+EndProc DEV_OPEN_SFT
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DEV_CLOSE_SFT
+;
+; Inputs:
+; ES:DI Points to SFT
+; Function:
+; Issue a CLOSE call to the correct device
+; Outputs:
+; None
+; ALL preserved
+;
+;---------------------------------------------------------------------------
+
+procedure DEV_CLOSE_SFT,NEAR
+
+ Assert ISSFT,<ES,DI>,"Dev_Close_SFT"
+
+ Save_World ; use macro
+
+ MOV AL,DEVCLS
+
+ ;
+ ; Main entry for device open and close. AL contains the function
+ ; requested. Subtlety: if Sharing is NOT loaded then we do NOT issue
+ ; open/close to block devices. This allows networks to function but
+ ; does NOT hang up with bogus change-line code.
+ ;
+
+ entry DO_OPCLS
+
+ ; Is the SFT for the net? If so, no action necessary.
+
+ TESTB es:[di].sf_Flags, SF_ISNET
+ JNZ OPCLS_DONE ; NOP on net SFTs
+ XOR AH,AH ; Unit
+ TESTB ES:[DI].SF_FLAGS,devid_device
+ LES DI,ES:[DI.sf_devptr] ; Get DPB or device
+ JZ OPCLS_DONE
+
+ ; We are about to call device open/close on a block driver. If no
+ ; sharing then just short circuit to done.
+
+GOT_DEV_ADDR: ; ES:DI -> device
+ TESTB ES:[DI.SDEVATT],DEVOPCL
+ JZ OPCLS_DONE ; Device can't
+ PUSH ES
+ POP DS
+ MOV SI,DI ; DS:SI -> device
+OPCLS_RETRY:
+ Context ES
+
+ ; DEVCALL is in DOSDATA
+ MOV DI,OFFSET DOSDATA:DEVCALL
+
+ MOV BX,DI
+ PUSH AX
+ MOV AL,DOPCLHL
+ STOSB ; Length
+ POP AX
+ XCHG AH,AL
+ STOSB ; Unit
+ XCHG AH,AL
+ STOSB ; Command
+ MOV WORD PTR ES:[DI],0 ; Status
+ PUSH AX ; Save Unit,Command
+ invoke DEVIOCALL2
+ MOV DI,ES:[BX.REQSTAT]
+ .errnz STERR-8000h
+ and di,di
+ Jns OPCLS_DONEP ; No error
+ TESTB [SI.SDEVATT],DEVTYP
+ JZ BLKDEV
+ MOV AH,86H ; Read error in data, Char dev
+ JMP SHORT HRDERR
+
+BLKDEV:
+ MOV AL,CL ; Drive # in AL
+ MOV AH,6 ; Read error in data, Blk dev
+HRDERR:
+ invoke CHARHARD
+ CMP AL,1
+ JNZ OPCLS_DONEP ; IGNORE or FAIL
+ ; Note that FAIL is essentually IGNORED
+ POP AX ; Get back Unit, Command
+ JMP OPCLS_RETRY
+
+OPCLS_DONEP:
+ POP AX ; Clean stack
+OPCLS_DONE:
+
+ Restore_World ;hkn; use macro
+ return
+
+EndProc DEV_CLOSE_SFT
+
+Break <DEVIOCALL, DEVIOCALL2 - CALL A DEVICE>
+
+
+;** DevIoCall - Call Device
+;
+; ENTRY DS:SI Points to device SFT
+; ES:BX Points to request data
+; EXIT DS:SI -> Device driver
+; USES DS:SI,AX
+
+;** DevIoCall2 - Call Device
+;
+; ENTRY DS:SI Points to Device Header
+; ES:BX Points to request data
+; EXIT DS:SI -> Device driver
+; USES DS:SI,AX
+
+procedure DEVIOCALL,NEAR
+
+ ; SS override for CALLSSEC,
+ ; CALLNEWSC, HIGH_SECTOR & CALLDEVAD
+ Assert ISSFT,<DS,SI>,"DevIOCall"
+ LDS SI,[SI.sf_devptr]
+
+entry DEVIOCALL2
+
+ MOV AX,[SI.SDEVSTRAT]
+ MOV WORD PTR [CALLDEVAD],AX
+ MOV WORD PTR [CALLDEVAD+2],DS
+ CALL DWORD PTR [CALLDEVAD]
+ MOV AX,[SI.SDEVINT]
+ MOV WORD PTR [CALLDEVAD],AX
+ CALL DWORD PTR [CALLDEVAD]
+ return
+EndProc DEVIOCALL
+
+Break <SETREAD, SETWRITE -- SET UP HEADER BLOCK>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : SETREAD, SETWRITE
+;
+; Inputs:
+; DS:BX = Transfer Address
+; CX = Record Count
+; DX = Starting Record
+; AH = Media Byte
+; AL = Unit Code
+; Function:
+; Set up the device call header at DEVCALL
+; Output:
+; ES:BX Points to DEVCALL
+; No other registers effected
+;
+;---------------------------------------------------------------------------
+
+procedure SETREAD,NEAR
+
+ PUSH DI
+ PUSH CX
+ PUSH AX
+ MOV CL,DEVRD
+SETCALLHEAD:
+ MOV AL,DRDWRHL
+ PUSH SS
+ POP ES
+
+ ; DEVCALL is in DOSDATA
+ MOV DI,OFFSET DOSDATA:DEVCALL
+
+ STOSB ; length
+ POP AX
+ STOSB ; Unit
+ PUSH AX
+ MOV AL,CL
+ STOSB ; Command code
+ XOR AX,AX
+ STOSW ; Status
+ ADD DI,8 ; Skip link fields
+ POP AX
+ XCHG AH,AL
+ STOSB ; Media byte
+ XCHG AL,AH
+ PUSH AX
+ MOV AX,BX
+ STOSW
+ MOV AX,DS
+ STOSW ; Transfer addr
+ POP CX ; Real AX
+ POP AX ; Real CX
+ STOSW ; Count
+ XCHG AX,DX ; AX=Real DX, DX=real CX, CX=real AX
+ STOSW ; Start
+ XCHG AX,CX
+ XCHG DX,CX
+ POP DI
+ ; DEVCALL is in DOSDATA
+ MOV BX,OFFSET DOSDATA:DEVCALL
+ return
+
+ entry SETWRITE
+ASSUME DS:NOTHING,ES:NOTHING
+
+; Inputs:
+; DS:BX = Transfer Address
+; CX = Record Count
+; DX = Starting Record
+; AH = Media Byte
+; AL = Unit Code
+; Function:
+; Set up the device call header at DEVCALL
+; Output:
+; ES:BX Points to DEVCALL
+; No other registers effected
+
+ PUSH DI
+ PUSH CX
+ PUSH AX
+ MOV CL,DEVWRT
+ ADD CL,[VERFLG] ; SS override
+ JMP SHORT SETCALLHEAD
+EndProc SETREAD
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dir2.asm b/private/mvdm/dos/v86/doskrnl/dos/dir2.asm
new file mode 100644
index 000000000..686d84624
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dir2.asm
@@ -0,0 +1,1468 @@
+ TITLE DIR2 - Directory and path cracking
+ NAME Dir2
+
+;** Main Path cracking routines, low level search routines and device
+; name detection routines
+;
+; GETPATH
+; GetPathNoSet
+; CHKDEV
+; ROOTPATH
+; FINDPATH
+; StartSrch
+; MatchAttributes
+; DEVNAME
+; Build_device_ent
+; Validate_CDS
+; CheckThisDevice
+;
+; Revision history:
+;
+; A000 version 4.00 Jan. 1988
+; A001 PTM 3564 -- search using fastopen
+;
+; M026 - set Attrib before invoking devname. 9/17/90
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include fastopen.inc
+ include curdir.inc
+ include dossvc.inc
+ .cref
+ .list
+
+
+ i_need NoSetDir,BYTE
+ i_need EntFree,WORD
+ i_need DirStart,WORD
+ i_need LastEnt,WORD
+ i_need WFP_START,WORD
+ i_need CURR_DIR_END,WORD
+ i_need CurBuf,DWORD
+ i_need THISCDS,DWORD
+ i_need Attrib,BYTE
+ i_need SAttrib,BYTE
+ i_need VolID,BYTE
+ i_need Name1,BYTE
+ i_need ThisDPB,DWORD
+ i_need EntLast,WORD
+ i_need Creating,BYTE
+ i_need NULDEV,DWORD
+ i_need DEVPT,DWORD
+ i_need DEVFCB,BYTE
+ i_need ALLOWED,BYTE
+ i_need EXTERR_LOCUS,BYTE
+ I_need FastOpenFlg,BYTE ;DOS 3.3
+ I_need FastOpenTable,BYTE ;DOS 3.3
+ I_need Dir_Info_Buff,BYTE ;DOS 3.3
+ I_need FastOpen_Ext_Info,BYTE ;DOS 3.3
+ I_need CLUSNUM,WORD ;DOS 3.3
+ I_need Next_Element_Start,WORD ;DOS 3.3
+ I_need HIGH_SECTOR,WORD ;AN000;>32mb
+ I_need DOS34_FLAG,WORD ;AN000;>32mb
+ I_need CURDRV, BYTE
+
+
+DOSCODE Segment
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+Break <GETPATH -- PARSE A WFP>
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : GETPATH
+;
+; Inputs:
+; [WFP_START] Points to WFP string ("d:\" must be first 3 chars, NUL
+; terminated; d:/ (note forward slash) indicates a real device).
+; [CURR_DIR_END] Points to end of Current dir part of string
+; ( = -1 if current dir not involved, else
+; Points to first char after last "/" of current dir part)
+; [THISCDS] Points to CDS being used
+; [SATTRIB] Is attribute of search, determines what files can be found
+; [NoSetDir] set
+; [THISDPB] set to DPB if disk otherwise garbage.
+; Function:
+; Crack the path
+; Outputs:
+; Sets EXTERR_LOCUS = errLOC_Disk if disk file
+; Sets EXTERR_LOCUS = errLOC_Unk if char device
+; ID1 field of [THISCDS] updated appropriately
+; [ATTRIB] = [SATTRIB]
+; ES:BP Points to DPB
+; Carry set if bad path
+; SI Points to path element causing failure
+; Zero set
+; [DIRSTART],[DIRSEC],[CLUSNUM], and [CLUSFAC] are set up to
+; start a search on the last directory
+; CL is zero if there is a bad name in the path
+; CL is non-zero if the name was simply not found
+; [ENTFREE] may have free spot in directory
+; [NAME1] is the name.
+; CL = 81H if '*'s or '?' in NAME1, 80H otherwise
+; Zero reset
+; File in middle of path or bad name in path or attribute mismatch
+; or path too long or malformed path
+; ELSE
+; [CurBuf] = -1 if root directory
+; [CURBUF] contains directory record with match
+; [CURBUF+2]:BX Points into [CURBUF] to start of entry
+; [CURBUF+2]:SI Points into [CURBUF] to dir_first field for entry
+; AH = device ID
+; bit 7 of AH set if device SI and BX
+; will point DOSGROUP relative The firclus
+; field of the device entry contains the device pointer
+; [NAME1] Has name looked for
+; If last element is a directory zero is set and:
+; [DIRSTART],[SECCLUSPOS],[DIRSEC],[CLUSNUM], and [CLUSFAC]
+; are set up to start a search on it.
+; unless [NoSetDir] is non zero in which case the return is
+; like that for a file (except for zero flag)
+; If last element is a file zero is reset
+; [DIRSEC],[CLUSNUM],[CLUSFAC],[NXTCLUSNUM],[SECCLUSPOS],
+; [LASTENT], [ENTLAST] are set to continue search of last
+; directory for furthur matches on NAME1 via the NEXTENT
+; entry point in FindEntry (or GETENT entry in GETENTRY in
+; which case [NXTCLUSNUM] and [SECCLUSPOS] need not be valid)
+; DS preserved, Others destroyed
+;---------------------------------------------------------------------------
+
+;hkn; called from delete.asm , finfo.asm, mknode.asm and rename.asm. DS
+;hkn; already set up at this point.
+
+ifdef 0
+procedure GETPATH,near
+ DOSAssume <DS>,"GetPath"
+
+ MOV WORD PTR CREATING,DIRFREE*256+0 ; Not Creating, not DEL *.*
+
+; Same as GetPath only CREATING and DELALL already set
+
+entry GetPathNoSet
+ MOV [EXTERR_LOCUS],errLOC_Disk
+ MOV WORD PTR CurBuf,-1 ; initial setting
+
+; See if the input indicates a device that has already been detected. If so,
+; go build the guy quickly. Otherwise, let findpath find the device.
+
+ MOV DI,Wfp_Start ; point to the beginning of the name
+ CMP WORD PTR [DI+1],'\' SHL 8 + ':'
+ JZ CrackIt
+
+; Let ChkDev find it in the device list
+
+ ADD DI,3
+ MOV SI,DI ; let CHKDEV see the original name
+ CALL CHKDEV
+ JC InternalError
+Build_devJ:
+ MOV AL,SAttrib
+ MOV Attrib,AL
+ MOV [EXTERR_LOCUS],errLOC_Unk ; In the particular case of
+ ; "finding" a char device
+ ; set LOCUS to Unknown. This makes
+ ; certain idiotic problems reported
+ ; by a certain 3 letter OEM go away.
+
+; Take name in name1 and pack it back into where wfp_start points. This
+; guarantees wfp_start pointing to a canonical representation of a device.
+; We are allowed to do this as GetPath is *ALWAYS* called before entering a
+; wfp into the share set.
+;
+; We copy chars from name1 to wfp_start remembering the position of the last
+; non-space seen +1. This position is kept in DX.
+
+
+;hkn; SS is DOSDATA
+ Context ES
+
+;hkn; NAME1 is in DOSDATA
+ mov si,offset DOSDATA:Name1
+
+ mov di,wfp_start
+ mov dx,di
+ mov cx,8 ; 8 chars in device name
+MoveLoop:
+ lodsb
+ stosb
+ cmp al," "
+ jz nosave
+ IFDEF DBCS ;AN000;;
+; cmp al,81h ;AN000;; 2/23/KK
+; jne notKanji ;AN000;; 2/23/KK
+; cmp cx,1 ;AN000; 2/23/KK
+; je notKanji ;AN000; 2/23/KK
+; cmp byte ptr [si],40h ;AN000; 2/23/KK
+; jne notKanji ;AN000;; 2/23/KK
+; lodsb ;AN000;; 2/23/KK
+; stosb ;AN000;; 2/23/KK
+; dec cx ;AN000;; 2/23/KK
+; jmp nosave ;AN000;; 2/23/KK
+;notKanji: ;AN000;; 2/23/KK
+ ENDIF
+ mov dx,di
+NoSave:
+ loop MoveLoop
+;
+; DX is the position of the last seen non-space + 1. We terminate the name
+; at this point.
+;
+ mov di,dx
+ mov byte ptr [di],0 ; end of string
+ invoke Build_device_ent ; Clears carry sets zero
+ INC AL ; reset zero
+ return
+
+ assume es:nothing
+
+InternalError:
+ JMP InternalError ; freeze
+
+
+; Start off at the correct spot. Optimize if the current dir part is valid.
+
+CrackIt:
+ MOV SI,[CURR_DIR_END] ; get current directory pointer
+ CMP SI,-1 ; valid?
+ JNZ LOOK_SING ; Yes, use it.
+ LEA SI,[DI+3] ; skip D:\
+LOOK_SING:
+ Assert ISDPB,<<WORD PTR THISDPB+2>,<WORD PTR THISDPB>>,"Crackit"
+ MOV Attrib,attr_directory+attr_system+attr_hidden
+ ; Attributes to search through Dirs
+ LES DI,THISCDS
+ MOV AX,-1
+ MOV BX,ES:[DI.curdir_ID]
+ MOV SI,[CURR_DIR_END]
+
+; AX = -1
+; BX = cluster number of current directory. THis number is -1 if the media
+; has been uncertainly changed.
+; SI = offset in DOSGroup into path to end of current directory text. This
+; may be -1 if no current directory part has been used.
+
+ CMP SI,AX ; if Current directory is not part
+ JZ NO_CURR_D ; then we must crack from root
+ CMP BX,AX ; is the current directory cluster valid
+
+; DOS 3.3 6/25/86
+ JZ NO_CURR_D ; no, crack form the root
+ TEST [FastOpenFlg],FastOpen_Set ; for fastopen ?
+ JZ GOT_SEARCH_CLUSTER ; no
+ PUSH ES ; save registers
+ PUSH DI
+ PUSH CX
+ PUSH [SI-1] ; save \ and 1st char of next element
+ PUSH SI
+ PUSH BX
+
+ MOV BYTE PTR [SI-1],0 ; call fastopen to look up cur dir info
+ MOV SI,[Wfp_Start]
+
+;hkn; FastOpenTable, Dir_Info_Buff & FastOpen_Ext_Info are in DOSDATA
+ MOV BX,OFFSET DOSDATA:FastOpenTable
+ MOV DI,OFFSET DOSDATA:Dir_Info_Buff
+ MOV CX,OFFSET DOSDATA:FastOpen_Ext_Info
+ MOV AL,FONC_look_up
+ PUSH DS
+ POP ES
+ CALL DWORD PTR [BX.FASTOPEN_NAME_CACHING]
+ JC GO_Chk_end1 ;fastopen not installed, or wrong drive. Go to Got_Srch_cluster
+ CMP BYTE PTR [SI],0 ;fastopen has current dir info?
+ JE GO_Chk_end ;yes. Go to got_serch_cluster
+ stc
+ jmp short GO_Chk_end ;Go to No_Curr_D
+GO_Chk_end1:
+ clc
+GO_Chk_end: ; restore registers
+ POP BX
+ POP SI
+ POP [SI-1]
+ POP CX
+ POP DI
+ POP ES
+ JNC GOT_SEARCH_CLUSTER ; crack based on cur dir
+
+; DOS 3.3 6/25/86
+;
+; We must cract the path beginning at the root. Advance pointer to beginning
+; of path and go crack from root.
+
+NO_CURR_D:
+ MOV SI,[WFP_START]
+ LEA SI,[SI+3] ; Skip "d:/"
+ LES BP,[THISDPB] ; Get ES:BP
+ JMP short ROOTPATH
+
+; We are able to crack from the current directory part. Go set up for search
+; of specified cluster.
+
+GOT_SEARCH_CLUSTER:
+ LES BP,[THISDPB] ; Get ES:BP
+ invoke SETDIRSRCH
+ JC SETFERR
+ JMP short FINDPATH
+
+SETFERR:
+ XOR CL,CL ; set zero
+ STC
+ Return
+
+EndProc GETPATH
+endif
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : ChkDev
+;
+; Check to see if the name at DS:DI is a device. Returns carry set if not a
+; device.
+; Blasts CX,SI,DI,AX,BX
+;---------------------------------------------------------------------------
+
+Procedure ChkDev,NEAR
+
+ MOV SI,DI
+ MOV DI,SS
+ MOV ES,DI
+
+;hkn; ASSUME ES:DOSGroup ; Now here is where ES is DOSGroup
+ ASSUME ES:DOSDATA ; Now here is where ES is DOSDATA
+
+
+;hkn; NAME1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:NAME1
+ MOV CX,9
+TESTLOOP:
+ invoke GETLET
+ IFDEF DBCS ;AN000;
+ invoke Testkanj ;AN000;; 2/13/KK
+ jz Notkanja ;AN000;; 2/13/KK
+ stosb ;AN000;; Skip second byte 2/13/KK
+ dec cx ;AN000;; 2/13/KK
+ jcxz notdev ;AN000;; 2/13/KK
+ lodsb ;AN000;; 2/13/KK
+ jmp short stowit ;AN000;; 2/13/KK
+Notkanja: ;AN000;
+ ENDIF ;AN000;
+ CMP AL,'.'
+ JZ TESTDEVICE
+ invoke PATHCHRCMP
+ JZ NOTDEV
+ OR AL,AL
+ JZ TESTDEVICE
+stowit:
+ STOSB
+ LOOP TESTLOOP
+NOTDEV:
+ STC
+ return
+
+TESTDEVICE:
+ ADD CX,2
+ MOV AL,' '
+ REP STOSB
+ MOV AX,SS
+ MOV DS,AX
+ invoke DEVNAME
+ return
+EndProc ChkDev
+
+ifdef 0
+Break <ROOTPATH, FINDPATH -- PARSE A PATH>
+;----------------------------------------------------------------------------
+;
+; Procedure Name : ROOTPATH,FINDPATH
+;
+; Inputs:
+; Same as FINDPATH but,
+; SI Points to asciz string of path which is assumed to start at
+; the root (no leading '/').
+; Function:
+; Search from root for path
+; Outputs:
+; Same as FINDPATH but:
+; If root directory specified, [CURBUF] and [NAME1] are NOT set, and
+; [NoSetDir] is ignored.
+;----------------------------------------------------------------------------
+
+procedure ROOTPATH,near
+ DOSAssume <DS>,"RootPath"
+
+ invoke SETROOTSRCH
+ CMP BYTE PTR [SI],0
+ JNZ FINDPATH
+
+; Root dir specified
+ MOV AL,SAttrib
+ MOV Attrib,AL
+ XOR AH,AH ; Sets "device ID" byte, sets zero
+ ; (dir), clears carry.
+ return
+
+; Inputs:
+; [ATTRIB] Set to get through directories
+; [SATTRIB] Set to find last element
+; ES:BP Points to DPB
+; SI Points to asciz string of path (no leading '/').
+; [SECCLUSPOS] = 0
+; [DIRSEC] = Phys sec # of first sector of directory
+; [CLUSNUM] = Cluster # of next cluster
+; [CLUSFAC] = Sectors per cluster
+; [NoSetDir] set
+; [CURR_DIR_END] Points to end of Current dir part of string
+; ( = -1 if current dir not involved, else
+; Points to first char after last "/" of current dir part)
+; [THISCDS] Points to CDS being used
+; [CREATING] and [DELALL] set
+; Function:
+; Parse path name
+; Outputs:
+; ID1 field of [THISCDS] updated appropriately
+; [ATTRIB] = [SATTRIB]
+; ES:BP Points to DPB
+; [THISDPB] = ES:BP
+; Carry set if bad path
+; SI Points to path element causing failure
+; Zero set
+; [DIRSTART],[DIRSEC],[CLUSNUM], and [CLUSFAC] are set up to
+; start a search on the last directory
+; CL is zero if there is a bad name in the path
+; CL is non-zero if the name was simply not found
+; [ENTFREE] may have free spot in directory
+; [NAME1] is the name.
+; CL = 81H if '*'s or '?' in NAME1, 80H otherwise
+; Zero reset
+; File in middle of path or bad name in path
+; or path too long or malformed path
+; ELSE
+; [CURBUF] contains directory record with match
+; [CURBUF+2]:BX Points into [CURBUF] to start of entry
+; [CURBUF+2]:SI Points to fcb_FIRCLUS field for entry
+; [NAME1] Has name looked for
+; AH = device ID
+; bit 7 of AH set if device SI and BX
+; will point DOSGROUP relative The firclus
+; field of the device entry contains the device pointer
+; If last element is a directory zero is set and:
+; [DIRSTART],[SECCLUSPOS],[DIRSEC],[CLUSNUM], and [CLUSFAC]
+; are set up to start a search on it,
+; unless [NoSetDir] is non zero in which case the return is
+; like that for a file (except for zero flag)
+; If last element is a file zero is reset
+; [DIRSEC],[CLUSNUM],[CLUSFAC],[NXTCLUSNUM],[SECCLUSPOS],
+; [LASTENT], [ENTLAST] are set to continue search of last
+; directory for furthur matches on NAME1 via the NEXTENT
+; entry point in FindEntry (or GETENT entry in GETENTRY in
+; which case [NXTCLUSNUM] and [SECCLUSPOS] need not be valid)
+; Destroys all other registers
+
+ entry FINDPATH
+ DOSAssume <DS>,"FindPath"
+ ASSUME ES:NOTHING
+
+ Assert ISDPB,<ES,BP>,"FindPath"
+ PUSH ES ; Save ES:BP
+ PUSH SI
+ MOV DI,SI
+ MOV CX,[DIRSTART] ; Get start clus of dir being searched
+ CMP [CURR_DIR_END],-1
+ JZ NOIDS ; No current dir part
+ CMP DI,[CURR_DIR_END]
+ JNZ NOIDS ; Not to current dir end yet
+ LES DI,THISCDS
+ MOV ES:[DI.curdir_ID],CX ; Set current directory currency
+NOIDS:
+
+; Parse the name off of DS:SI into NAME1. AL = 1 if there was a meta
+; character in the string. CX,DI may be destroyed.
+;
+; invoke NAMETRANS
+; MOV CL,AL
+;
+; The above is the slow method. The name has *already* been munged by
+; TransPath so no special casing needs to be done. All we do is try to copy
+; the name until ., \ or 0 is hit.
+
+ MOV AX,SS
+ MOV ES,AX
+
+;hkn; Name1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:Name1
+ MOV AX,' '
+ STOSB
+ STOSW
+ STOSW
+ STOSW
+ STOSW
+ STOSW
+
+;hkn; Name1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:Name1
+ XOR AH,AH ; bits for CL
+ IFDEF DBCS ;AN000;
+;-------------------------- Start of DBC;AN000;S 2/13/KK
+ XOR CL,CL ;AN000;; clear count for volume id
+ LODSB ;AN000;;IBMJ fix 9/04/86
+ CMP AL,05h ;AN000;;IBMJ fix 9/04/86
+ JNE GetNam2 ;AN000;;IBMJ fix 9/04/86
+ PUSH AX ;AN000; ;IBMJ fix 9/04/86
+ MOV AL,0E5h ;AN000;;IBMJ fix 9/04/86
+ Invoke TestKanj ;AN000;;IBMJ fix 9/04/86
+ POP AX ;AN000; ;IBMJ fix 9/04/86
+ JZ Notkanjb ;AN000; ;IBMJ fix 9/04/86
+ JMP SHORT GetNam3 ;AN000;;IBMJ fix 9/04/86
+;-------------------------- End of DBCS ;AN000;2/13/KK
+ ENDIF
+GetNam:
+ INC CL ;AN000; KK incrment volid count
+ LODSB
+ IFDEF DBCS ;AN000;
+GetNam2: ;AN000;; 2/13/KK
+ invoke Testkanj ;AN000;; 2/13/KK
+ jz Notkanjb ;AN000;; 2/13/KK
+GetNam3: ;AN000;; 2/13/KK
+ STOSB ;AN000;; 2/13/KK
+ INC CL ;AN000;; KK incrment volid count
+ LODSB ;AN000;; 2/13/KK
+ TEST [DOS34_FLAG],DBCS_VOLID ;AN000;; 2/13/KK
+ JZ notvol ;AN000;; 2/13/KK
+ CMP CL,8 ;AN000;; 2/13/KK
+ JNZ notvol ;AN000;; 2/13/KK
+ CMP AL,'.' ;AN000;; 2/13/KK
+ JNZ notvol ;AN000;; 2/13/KK
+ LODSB ;AN000;; 2/13/KK
+notvol: ;AN000;
+ jmp short StoNam ;AN000;; 2/13/KK
+Notkanjb: ;AN000;; 2/13/KK
+ ENDIF ;AN000;
+ CMP AL,'.'
+ JZ setExt
+ OR AL,AL
+ JZ GetDone
+ CMP AL,'\'
+ JZ GetDone
+ CMP AL,'?'
+ JNZ StoNam
+ OR AH,1
+StoNam: STOSB
+ JMP GetNam
+SetExt:
+
+;hkn; Name1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:Name1+8
+GetExt:
+ LODSB
+ IFDEF DBCS ;AN000;
+ invoke TestKanj ;AN000;; 2/13/KK
+ jz Notkanjc ;AN000;; 2/13/KK
+ STOSB ;AN000;; 2/13/KK
+ LODSB ;AN000;; 2/13/KK
+ jmp short StoExt ;AN000;; 2/13/KK
+Notkanjc: ;AN000;; 2/13/KK
+ ENDIF ;AN000;
+ OR AL,AL
+ JZ GetDone
+ CMP AL,'\'
+ JZ GetDone
+ CMP AL,'?'
+ JNZ StoExt
+ OR AH,1
+StoExt: STOSB
+ JMP GetExt
+GetDone:
+ DEC SI
+ MOV CL,AH
+
+
+ OR CL,80H
+ POP DI ; Start of this element
+ POP ES ; Restore ES:BP
+ CMP SI,DI
+ JNZ check_device
+ JMP BADPATH ; NUL parse (two delims most likely)
+check_device:
+ PUSH SI ; Start of next element
+ MOV AL,BYTE PTR [SI]
+ OR AL,AL
+ JNZ NOT_LAST
+
+
+; for last element of the path switch to the correct search attributes
+
+ MOV BH,SAttrib
+ MOV Attrib,BH
+NOT_LAST:
+
+
+; check name1 to see if we have a device...
+
+ PUSH ES ; Save ES:BP
+
+;hkn; SS is DOSDATA
+ context ES
+ invoke DevName ; blast BX
+ POP ES ; Restore ES:BP
+ ASSUME ES:NOTHING
+ JC FindFile ; Not a device
+ OR AL,AL ; Test next char again
+ JZ GO_BDEV
+ JMP FileInPath ; Device name in middle of path
+
+GO_BDEV:
+ POP SI ; Points to NUL at end of path
+ JMP Build_devJ
+
+FindFile:
+ ASSUME ES:NOTHING
+;;;; 7/28/86
+ CMP BYTE PTR [NAME1],0E5H ; if 1st char = E5
+ JNZ NOE5 ; no
+ MOV BYTE PTR [NAME1],05H ; change it to 05
+NOE5:
+
+;;;; 7/28/86
+ PUSH DI ; Start of this element
+ PUSH ES ; Save ES:BP
+ PUSH CX ; CL return from NameTrans
+;DOS 3.3 FastOPen 6/12/86 F.C.
+
+ CALL LookupPath ; call fastopen to get dir entry
+ JNC DIR_FOUND ; found dir entry
+
+;DOS 3.3 FastOPen 6/12/86 F.C.
+ invoke FINDENTRY
+DIR_FOUND:
+ POP CX
+ POP ES
+ POP DI
+ JNC LOAD_BUF
+ JMP BADPATHPOP
+
+LOAD_BUF:
+ LDS DI,[CURBUF]
+ASSUME DS:NOTHING
+ TEST BYTE PTR [BX+dir_attr],attr_directory
+ JNZ GO_NEXT ; DOS 3.3
+ JMP FileInPath ; Error or end of path
+
+; if we are not setting the directory, then check for end of string
+
+GO_NEXT:
+
+;hkn; SS override
+ CMP BYTE PTR [NoSetDir],0
+ JZ SetDir
+ MOV DX,DI ; Save pointer to entry
+ MOV CX,DS
+
+;hkn; SS is DOSDATA
+ context DS
+ POP DI ; Start of next element
+ TEST [FastOpenFlg],FastOpen_Set ;only DOSOPEN can take advantage of
+ JZ nofast ; the FastOpen
+ TEST [FastOpenFlg],Lookup_Success ; Lookup just happened
+ JZ nofast ; no
+ MOV DI,[Next_Element_Start] ; no need to insert it again
+nofast:
+ CMP BYTE PTR [DI],0
+ JNZ NEXT_ONE ; DOS 3.3
+ JMP SetRet ; Got it
+NEXT_ONE:
+ PUSH DI ; Put start of next element back on stack
+ MOV DI,DX
+ MOV DS,CX ; Get back pointer to entry
+ASSUME DS:NOTHING
+
+SetDir:
+ MOV DX,[SI] ; Dir_first
+
+;DOS 3.3 FastOPen 6/12/86 F.C.
+
+ PUSH DS ; save [curbuf+2]
+
+;hkn; SS is DOSDATA
+ context DS ; set DS Dosgroup
+ TEST [FastOpenFlg],Lookup_Success ;
+ JZ DO_NORMAL ; fastopen not in memory or path not
+ MOV BX,DX ; not found
+ MOV DI,[CLUSNUM] ; clusnum was set in LookupPath
+ PUSH AX ; save device id (AH)
+ invoke SETDIRSRCH
+ POP AX ; restore device id (AH)
+ ADD SP,2 ; pop ds in stack
+ JMP short FAST_OPEN_SKIP
+
+DO_NORMAL:
+ASSUME DS:NOTHING
+ POP DS ; DS = [curbuf + 2]
+;DOS 3.3 FastOPen 6/12/86 F.C.
+
+ SUB BX,DI ; Offset into sector of start of entry
+ SUB SI,DI ; Offset into sector of dir_first
+ PUSH BX
+ PUSH AX
+ PUSH SI
+ PUSH CX
+ PUSH WORD PTR [DI.buf_sector] ;AN000;>32mb
+ PUSH WORD PTR [DI.buf_sector+2] ;AN000;>32mb
+ MOV BX,DX
+
+;hkn; SS is DOSDATA
+ context DS
+ invoke SETDIRSRCH ; This uses UNPACK which might blow
+ ; the entry sector buffer
+ POP [HIGH_SECTOR]
+ POP DX
+ JC SKIP_GETB
+ MOV [ALLOWED],allowed_RETRY + allowed_FAIL
+ XOR AL,AL
+ invoke GETBUFFR ; Get the entry buffer back
+SKIP_GETB:
+ POP CX
+ POP SI
+ POP AX
+ POP BX
+ JNC SET_THE_BUF
+ POP DI ; Start of next element
+ MOV SI,DI ; Point with SI
+ JMP SHORT BADPATH
+
+SET_THE_BUF:
+ invoke SET_BUF_AS_DIR
+ MOV DI,WORD PTR [CURBUF]
+ ADD SI,DI ; Get the offsets back
+ ADD BX,DI
+; DOS 3.3 FasOpen 6/12/86 F.C.
+
+FAST_OPEN_SKIP:
+
+ POP DI ; Start of next element
+ CALL InsertPath ; insert dir entry info
+
+; DOS 3.3 FasOpen 6/12/86 F.C.
+
+
+ MOV AL,[DI]
+ OR AL,AL
+ JZ SETRET ; At end
+ INC DI ; Skip over "/"
+ MOV SI,DI ; Point with SI
+ invoke PATHCHRCMP
+ JNZ find_bad_name ; oops
+ JMP FINDPATH ; Next element
+
+find_bad_name:
+ DEC SI ; Undo above INC to get failure point
+BADPATH:
+ XOR CL,CL ; Set zero
+ JMP SHORT BADPRET
+
+FILEINPATH:
+ POP DI ; Start of next element
+
+;hkn; SS is DOSDATA
+ context DS ; Got to from one place with DS gone
+; DOS 3.3 FastOpen
+
+ TEST [FastOpenFlg],FastOpen_Set ; do this here is we don't want to
+ JZ NO_FAST ; device info to fastopen
+ TEST [FastOpenFlg],Lookup_Success
+ JZ NO_FAST
+ MOV DI,[Next_Element_Start] ; This takes care of one time lookup
+ ; success
+NO_FAST:
+
+; DOS 3.3 FastOpen
+
+ MOV AL,[DI]
+ OR AL,AL
+ JZ INCRET
+ MOV SI,DI ; Path too long
+ JMP SHORT BADPRET
+
+INCRET:
+; DOS 3.3 FasOpen 6/12/86 F.C.
+
+ CALL InsertPath ; insert dir entry info
+
+; DOS 3.3 FasOpen 6/12/86 F.C.
+ INC AL ; Reset zero
+SETRET:
+ return
+
+BADPATHPOP:
+ POP SI ; Start of next element
+ MOV AL,[SI]
+ MOV SI,DI ; Start of bad element
+ OR AL,AL ; zero if bad element is last, non-zero if path too long
+BADPRET:
+ MOV AL,SAttrib
+ MOV Attrib,AL ; Make sure return correct
+ STC
+ return
+EndProc ROOTPATH
+
+Break <STARTSRCH -- INITIATE DIRECTORY SEARCH>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : STARTDRCH
+;
+; Inputs:
+; [THISDPB] Set
+; Function:
+; Set up a search for GETENTRY and NEXTENTRY
+; Outputs:
+; ES:BP = Drive parameters
+; Sets up LASTENT, ENTFREE=ENTLAST=-1, VOLID=0
+; Destroys ES,BP,AX
+;--------------------------------------------------------------------------
+
+procedure StartSrch,NEAR
+ DOSAssume <DS>,"StartSrch"
+
+ Assert ISDPB,<<WORD PTR THISDPB+2>,<WORD PTR THISDPB>>,"StartSrch"
+ LES BP,[THISDPB]
+ XOR AX,AX
+ MOV [LASTENT],AX
+ MOV BYTE PTR [VOLID],AL ; No volume ID found
+ DEC AX
+ MOV [ENTFREE],AX
+ MOV [ENTLAST],AX
+ return
+EndProc StartSrch
+endif
+
+BREAK <MatchAttributes - the final check for attribute matching>
+;----------------------------------------------------------------------------
+; Procedure Name : MatchAttributes
+;
+; Input: [Attrib] = attribute to search for
+; CH = found attribute
+; Output: JZ <match>
+; JNZ <nomatch>
+; Registers modified: noneski
+;----------------------------------------------------------------------------
+
+procedure MatchAttributes,near
+ PUSH AX
+
+;hkn; SS override
+ MOV AL,Attrib ; AL <- SearchSet
+ NOT AL ; AL <- SearchSet'
+ AND AL,CH ; AL <- SearchSet' and FoundSet
+ AND AL,attr_all ; AL <- SearchSet' and FoundSet and Important
+;
+; the result is non-zero if an attribute is not in the search set
+; and in the found set and in the important set. This means that we do not
+; have a match. Do a JNZ <nomatch> or JZ <match>
+;
+ POP AX
+ return
+EndProc MatchAttributes
+
+Break <DevName - Look for name of device>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DevName
+;
+; Inputs:
+; DS,ES:DOSDATA
+; Filename in NAME1
+; ATTRIB set so that we can error out if looking for Volume IDs
+; Function:
+; Determine if file is in list of I/O drivers
+; Outputs:
+; Carry set if not a device
+; ELSE
+; Zero flag set
+; BH = Bit 7,6 = 1, bit 5 = 0 (cooked mode)
+; bits 0-4 set from low byte of attribute word
+; DEVPT = DWORD pointer to Device header of device
+; BX destroyed, others preserved
+;---------------------------------------------------------------------------
+
+procedure DEVNAME,NEAR
+ DOSAssume <ES,DS>,"DevName"
+
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ PUSH AX
+
+; E5 special code
+ PUSH WORD PTR [NAME1]
+ CMP [NAME1],5
+ JNZ NOKTR
+ MOV [NAME1],0E5H
+NOKTR:
+
+ TEST Attrib,attr_volume_id ; If looking for VOL id don't find devs
+ JNZ RET31
+
+;hkn; NULDEV is in DOSDATA
+ MOV SI,OFFSET DOSDATA:NULDEV
+LOOKIO:
+ASSUME DS:NOTHING
+ TEST [SI.SDEVATT],DEVTYP
+ JZ SKIPDEV ; Skip block devices (NET and LOCAL)
+ MOV AX,SI
+ ADD SI,SDEVNAME
+
+;hkn; NAME1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:NAME1
+ MOV CX,4 ; All devices are 8 letters
+ REPE CMPSW ; Check for name in list
+ MOV SI,AX
+ JZ IOCHK ; Found it?
+SKIPDEV:
+ LDS SI,DWORD PTR [SI] ; Get address of next device
+ CMP SI,-1 ; At end of list?
+ JNZ LOOKIO
+RET31: STC ; Not found
+RETNV: MOV CX,SS
+ MOV DS,CX
+
+;hkn; ASSUME DS:DOSGroup
+ ASSUME DS:DOSDATA
+
+ POP WORD PTR [NAME1]
+ POP AX
+ POP CX
+ POP DI
+ POP SI
+ RET
+
+IOCHK:
+ASSUME DS:NOTHING
+
+;hkn; SS override for DEVPT
+ MOV WORD PTR [DEVPT+2],DS ; Save pointer to device
+ MOV BH,BYTE PTR [SI.SDEVATT]
+ OR BH,0C0H
+ AND BH,NOT 020H ; Clears Carry
+ MOV WORD PTR [DEVPT],SI
+ JMP RETNV
+EndProc DevName
+
+BREAK <Build_device_ent - Make a Directory entry>
+;---------------------------------------------------------------------------
+; Procedure Name : Build_device_ent
+;
+; Inputs:
+; [NAME1] has name
+; BH is attribute field (supplied by DEVNAME)
+; [DEVPT] points to device header (supplied by DEVNAME)
+; Function:
+; Build a directory entry for a device at DEVFCB
+; Outputs:
+; BX points to DEVFCB
+; SI points to dir_first field
+; AH = input BH
+; AL = 0
+; dir_first = DEVPT
+; Zero Set, Carry Clear
+; DS,ES,BP preserved, others destroyed
+;--------------------------------------------------------------------------
+
+procedure Build_device_ent,near
+ DOSAssume <ES,DS>,"Build_Device_Ent"
+
+ MOV AX," "
+
+;hkn; DEVFCB is in DOSDATA
+ MOV DI,OFFSET DOSDATA:DEVFCB+8 ; Point to extent field
+
+; Fill dir_ext BUGBUG - use ERRNZs for this stuff!
+
+ STOSW
+ STOSB ; Blank out extent field
+ MOV AL,attr_device
+
+; Fill Dir_attr
+
+ STOSB ; Set attribute field
+ XOR AX,AX
+ MOV CX,10
+
+; Fill dir_pad
+
+ REP STOSW ; Fill rest with zeros
+; invoke DATE16
+
+;hkn; DEVFCB is in DOSDATA
+ MOV DI,OFFSET DOSDATA:DEVFCB+dir_time
+ XCHG AX,DX
+
+; Fill dir_time
+
+ STOSW
+ XCHG AX,DX
+
+; Fill dir_date
+
+ STOSW
+ MOV SI,DI ; SI points to dir_first field
+ MOV AX,WORD PTR [DEVPT]
+
+; Fill dir_first
+
+ STOSW ; Dir_first points to device
+ MOV AX,WORD PTR [DEVPT+2]
+;
+; Fill dir_size_l
+;
+ STOSW
+ MOV AH,BH ; Put device atts in AH
+
+;hkn; DEVFCB is in DOSDATA
+ MOV BX,OFFSET DOSDATA:DEVFCB
+ XOR AL,AL ; Set zero, clear carry
+ return
+EndProc Build_device_ent
+
+Break <ValidateCDS - given a CDS, validate the media and the current directory>
+;----------------------------------------------------------------------------
+;
+; ValidateCDS - Get current CDS. Splice it. Call FatReadCDS to check
+; media. If media has been changed, do DOS_Chdir to validate path. If
+; invalid, reset original CDS to root.
+;
+; Inputs: ThisCDS points to CDS of interest
+; SS:DI points to temp buffer
+; Outputs: The current directory string is validated on the appropriate
+; drive
+; ThisDPB changed
+; ES:DI point to CDS
+; Carry set if error (currently user FAILed to I 24)
+; Registers modified: all
+;----------------------------------------------------------------------------
+
+Procedure ValidateCDS,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ clc
+ return
+ifdef NTDOS
+Public DIR2001S,DIR2001E
+DIR2001S:
+ LocalVar Temp,WORD
+ LocalVar SaveCDS,DWORD
+DIR2001E:
+ Enter
+ MOV Temp,DI
+
+;hkn; SS override
+ LDS SI,ThisCDS
+ MOV SaveCDSL,SI
+ MOV SaveCDSH,DS
+ EnterCrit critDisk
+ TEST [SI].curdir_flags,curdir_isnet ; Clears carry
+ JZ DoSplice
+ JMP FatFail
+DoSplice:
+ XOR DL,DL
+ XCHG DL,NoSetDir
+
+;hkn; SS is DOSDATA
+ Context ES
+ Invoke FStrcpy
+ MOV SI,Temp
+
+;hkn; SS is DOSDATA
+ Context DS
+ Invoke Splice
+ ASSUME DS:NOTHING
+
+ ;hkn; SS is DOSDATA
+ Context DS ; FatReadCDS (ThisCDS);
+ MOV NoSetDir,DL
+ LES DI,ThisCDS
+ SAVE <BP>
+ Invoke FatRead_CDS
+ RESTORE <BP>
+ JC FatFail
+ LDS SI,ThisCDS ; if (ThisCDS->ID == -1) {
+ ASSUME DS:NOTHING
+ CMP [SI].curdir_ID,-1
+ JNZ RestoreCDS
+
+;hkn; SS is DOSDATA
+ Context ES
+
+;hkn; SS override
+ SAVE <wfp_Start> ; t = wfp_Start;
+ CMP SI,SaveCDSL ; if not spliced
+ JNZ DoChdir
+ MOV DI,Temp
+
+;hkn; SS override
+ MOV wfp_Start,DI ; wfp_start = d;
+ Invoke FStrCpy ; strcpy (d, ThisCDS->Text);
+DoChdir:
+
+;hkn; SS is DOSDATA
+ Context DS
+ SAVE <<WORD PTR SAttrib>,BP> ; c = DOSChDir ();
+ Invoke DOS_ChDir
+ RESTORE <BP,BX,wfp_start> ; wfp_Start = t;
+ MOV SAttrib,BL
+ LDS SI,SaveCDS
+ ASSUME DS:NOTHING
+ JNC SetCluster ; if (c == -1) {
+
+;hkn; SS override for THISCDS
+ MOV WORD PTR ThisCDS,SI ; ThisCDS = TmpCDS;
+ MOV WORD PTR ThisCDS+2,DS
+ XOR CX,CX ; TmpCDS->text[3] = c = 0;
+ MOV [SI+3],CL ; }
+SetCluster:
+ MOV [SI].curdir_ID,-1 ; TmpCDS->ID = -1;
+ LDS SI,ThisCDS ; ThisCDS->ID = c;
+ TEST [SI].curdir_flags,curdir_splice ;AN000;;MS. for Join and Subst
+ JZ setdirclus ;AN000;;MS.
+ MOV CX,-1 ;AN000;;MS.
+setdirclus:
+ MOV [SI].curdir_ID,CX ; }
+RestoreCDS:
+
+ LES DI,SaveCDS
+ MOV WORD PTR ThisCDS,DI
+ MOV WORD PTR ThisCDS+2,ES
+ CLC
+FatFail:
+ LeaveCrit critDisk
+
+ LES DI,SaveCDS
+ Leave
+ return
+endif
+EndProc ValidateCDS
+
+Break <CheckThisDevice - Check for being a device>
+;---------------------------------------------------------------------------
+;
+; CheckThisDevice - Examine the area at DS:SI to see if there is a valid
+; device specified. We will return carry if there is a device present. The
+; forms of devices we will recognize are:
+;
+; [path]device
+;
+; Note that the drive letter has *already* been removed. All other forms
+; are not considered to be devices. If such a device is found we change the
+; source pointer to point to the device component.
+;
+; Inputs: ES is DOSDATA
+; DS:SI contains name
+; Outputs: ES is DOSDATA
+; DS:SI point to name or device
+; Carry flag set if device was found
+; Carry flag reset otherwise
+; Registers Modified: all except ES:DI, DS
+;----------------------------------------------------------------------------
+Procedure CheckThisDevice,NEAR
+ DOSAssume <ES>,"CheckThisDevice"
+
+ mov dx, ax
+
+ SAVE <DI,SI>
+;
+; Advance to after the final path character.
+;
+ MOV DI,SI ; remember first character
+Y_PathSkip:
+ LODSB
+ OR AL,AL
+ JZ Y_FoundEnd
+IFDEF DBCS ;AN000;
+ invoke Testkanj ;AN000;; 2/13/KK
+ jz Notkanje ;AN000;; 2/13/KK
+ lodsb ;AN000;; 2/13/KK
+ or al,al ;AN000;; Skip second byte 2/13/KK removed
+ jz Y_FoundEnd ;AN000;; 2/13/KK removed
+ jmp Short Y_Pathskip ;AN000;; Ignore missing second byte for now.
+Y_NotKanje: ;AN000;
+ ENDIF ;AN000;
+;kanji load of next char too 2/13/KK
+IFDEF DBCS
+ kanji load of next char too
+ENDIF
+ invoke PathChrCmp ; is it a path char?
+ JNZ Y_PathSkip
+ MOV DI,SI
+ JMP Y_PathSkip
+Y_FoundEnd:
+ MOV SI,DI
+;
+; Parse the name
+;
+ SAVE <DS,SI> ; preserve the source pointer
+ push dx
+ invoke NameTrans ; advance DS:SI
+ pop dx
+ CMP BYTE PTR [SI],0 ; parse entire string?
+ STC ; simulate a Carry return from DevName
+ JNZ Y_SkipSearch ; no parse. simulate a file return.
+
+;hkn; SS is DOSDATA
+ Context DS
+ push dx
+ Invoke DevName
+ pop dx
+ ASSUME DS:NOTHING
+Y_SkipSearch:
+ RESTORE <SI,DS>
+;
+; DS:SI points to the beginning of the potential device. If we have a device
+; then we do not change SI. If we have a file, then we reset SI back to the
+; original value. At this point Carry set indicates FILE.
+;
+ RESTORE <DI> ; get original SI
+
+ JC Y_Check ; if not device
+ cmp SI, DI
+ jnz CheckCont1
+ xor dx, dx
+ jmp short Y_CheckDone
+
+CheckCont1:
+ MOV AL, BYTE PTR DS:[SI]
+ push ax
+ MOV BYTE PTR DS:[SI],0
+ SAVE <SI>
+
+ mov si, di
+ cmp dl, 0
+ jnz DO_SVC
+ mov dl, [CURDRV]
+DO_SVC:
+
+ HRDSVC SVC_DEMCHECKPATH
+
+ RESTORE <SI>
+ pop ax
+ MOV BYTE PTR DS:[SI],al
+
+ jnc Y_CheckDone
+ inc dx
+ clc
+Y_Check:
+ MOV SI,DI
+Y_CheckDone:
+ RESTORE <DI>
+
+ CMC
+ return
+EndProc CheckThisDevice
+
+ifdef 0
+BREAK <LookupPath - call fastopen to get dir entry info>
+;-----------------------------------------------------------------------------
+;
+; Procedure Name : LookupPath
+;
+; Output DS:SI -> path name,
+; ES:DI -> dir entry info buffer
+; ES:CX -> extended dir info buffer
+;
+; carry flag clear : tables pointed by ES:DI and ES:CX are filled by
+; FastOpen, DS:SI points to char just one after
+; the last char of path name which is fully or
+; partially found in FastOPen
+; carry flag set : FastOpen not in memory or path name not found
+;
+;----------------------------------------------------------------------------
+
+procedure LookupPath,NEAR
+
+; PUSH AX
+
+;hkn; SS override
+ TEST [FastOpenFlg],FastOpen_Set ; flg is set in DOSPEN
+ JNZ FASTINST ; and this routine is
+NOLOOK:
+ JMP NOLOOKUP ; executed once
+FASTINST:
+
+;hkn; SS override
+ TEST [FastOpenFlg],No_Lookup ; no more lookup?
+ JNZ NOLOOK ; yes
+
+ MOV BX,OFFSET DOSDATA:FastOpenTable ; get fastopen related tab
+
+;hkn; SS override
+ MOV SI,[Wfp_Start] ; si points to path name
+ MOV DI,OFFSET DOSDATA:Dir_Info_Buff
+ MOV CX,OFFSET DOSDATA:FastOpen_Ext_Info
+ MOV AL,FONC_look_up ; al = 1
+ PUSH DS
+ POP ES
+
+;hkn; SS override
+ CALL DWORD PTR [BX.FASTOPEN_NAME_CACHING] ;call fastopen
+ JC NOTFOUND ; fastopen not in memory
+
+ LEA BX,[SI-2]
+
+;hkn; SS override
+ CMP BX,[Wfp_Start] ; path found ?
+ JZ NOTFOUND ; no
+ ; fully or partially found
+ CMP BYTE PTR [SI],0 ;AN000;FO.
+ JNZ parfnd ;AN000;FO.; partiallyfound
+ PUSH CX ;AN000;FO.; is attribute matched ?
+
+;hkn; SS override for attrib/sattrib
+ MOV CL,Attrib ;AN000;FO.;
+ MOV CH,Sattrib ;AN000;FO.; attrib=sattrib
+ MOV Attrib,CH ;AN000;FO.;
+ MOV CH,ES:[DI.dir_attr] ;AN000;FO.;
+ invoke Matchattributes ;AN000;FO.;
+;;; MOV Attrib,CL ;AN001;FO.; retore attrib
+ POP CX ;AN000;FO.;
+ JNZ NOLOOKUP ;AN000;FO.; not matched
+parfnd:
+
+;hkn; SS override
+ MOV [Next_Element_Start],SI ; save si
+ MOV BX,CX
+ MOV AX,[BX.FEI_lastent] ;AN000;;FO. restore lastentry
+
+;hkn; SS override for LASTENT, DIRSTART, CLUSNUM
+ MOV [LASTENT],AX ;AN000;;FO.
+ MOV AX,[BX.FEI_dirstart] ;AN001;;FO. restore dirstart
+ MOV [DIRSTART],AX ;AN001;;FO.
+ MOV AX,[BX.FEI_clusnum] ; restore next cluster num
+ MOV [CLUSNUM],AX ;
+
+ PUSH ES ; save ES
+
+;hkn; SS override
+ LES BX,[THISDPB] ; put drive id
+ MOV AH,ES:[BX.dpb_drive] ; in AH for DOOPEN
+ POP ES ; pop ES
+;SR;
+; We cannot have a root dir if we have come here. So, we zero out CurBuf to
+;indicate it is not a root dir
+;
+ mov word ptr CurBuf,0 ;indicate not root dir
+
+ MOV WORD PTR [CURBUF+2],ES ; [curbuf+2].bx points to
+ MOV BX,DI ; start of entry
+ LEA SI,[DI.dir_first] ; [curbuf+2]:si points to
+ ; dir_first field in the
+ ; dir entry
+
+;hkn; SS override for FastOpenFlg
+ OR [FastOpenFlg],Lookup_Success + set_for_search
+; POP AX
+ RET
+NOTFOUND:
+ CMP AX,-1 ; not in memory ?
+ JNZ Partial_Success ; yes, in memory
+ MOV [FastOpenFlg],0 ; no more fastopen
+Partial_Success:
+ AND [FastOpenFlg],Special_Fill_Reset
+NOLOOKUP:
+; POP AX
+ STC
+ RET
+EndProc LookupPath
+
+BREAK <InsertPath - call fastopen to insert dir entry info>
+;-----------------------------------------------------------------------------
+;
+; Procedure Name : InsertPath
+; Input: FastOpen_Set flag set when from DOSOPEN otherwise 0
+; Lookup_Success flag set when got dir entry info from FASTOPEN
+; DS = DOSDATA
+; Output: FastOPen_Ext_Info is set and path dir info is inserted
+;
+;-----------------------------------------------------------------------------
+procedure InsertPath,NEAR
+
+ PUSHF
+
+;hkn; SS override for FastOpenFlag
+ TEST [FastOpenFlg],FastOpen_Set ;only DOSOPEN can take advantage of
+ JZ GET_NEXT_ELEMENT ; the FastOpen
+ TEST [FastOpenFlg],Lookup_Success ; Lookup just happened
+ JZ INSERT_DIR_INFO ; no
+ AND [FastOpenFlg],Lookup_Reset ; we got dir info from fastopen so
+ MOV DI,[Next_Element_Start] ; no need to insert it again
+ JMP short GET_NEXT2
+INSERT_DIR_INFO: ; save registers
+ PUSH DS
+ PUSH ES
+ PUSH BX
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ PUSH AX
+
+;hkn; SS override
+ LDS DI,[CURBUF] ; DS:DI -> buffer header
+ASSUME DS:NOTHING
+ MOV SI,OFFSET DOSDATA:FastOpen_Ext_Info
+ MOV AX,WORD PTR [DI.buf_sector] ; get directory sector
+ MOV WORD PTR SS:[SI.FEI_dirsec],AX ;AN000; >32mb save dir sector
+ MOV AX,WORD PTR [DI.buf_sector+2] ;AN000; >32mb
+
+;hkn; SS is DOSDATA
+ context DS
+ MOV WORD PTR [SI.FEI_dirsec+2],AX ;AN000;>32mb save high dir sector
+ MOV AX,[CLUSNUM] ; save next cluster number
+ MOV [SI.FEI_clusnum],AX
+ MOV AX,[LASTENT] ;AN000;FO. save lastentry for search first
+ MOV [SI.FEI_lastent],AX ;AN000;FO.
+ MOV AX,[DIRSTART] ;AN001;FO. save for search first
+ MOV [SI.FEI_dirstart],AX ;AN001;FO.
+
+ MOV AX,BX
+ ADD DI,BUFINSIZ ; DS:DI -> start of data in buffer
+ SUB AX,DI ; AX=BX relative to start of sector
+ MOV CL,SIZE dir_entry
+;invoke debug_DOS
+ DIV CL
+ MOV [SI.FEI_dirpos],AL ; save directory entry # in buffer
+
+ PUSH DS
+ POP ES
+
+ MOV DS,WORD PTR [CURBUF+2]
+ MOV DI,BX ; DS:DI -> dir entry info
+ASSUME DS:NOTHING
+ CMP DS:[DI.dir_first],0 ; never insert info when file is empty
+ JZ SKIP_INSERT ; e.g. newly created file
+
+ PUSH SI ; ES:BX -> extended info
+ POP BX
+
+ MOV AL,FONC_insert ; call fastopen insert operation
+ MOV SI,OFFSET DOSDATA:FastOpenTable
+ CALL DWORD PTR ES:[SI.FASTOPEN_NAME_CACHING]
+
+ CLC
+SKIP_INSERT:
+ POP AX
+ POP CX ; restore registers
+ POP DI
+ POP SI
+ POP BX
+ POP ES
+ POP DS
+GET_NEXT2:
+ OR [FastOpenFlg],No_Lookup ; we got dir info from fastopen so
+GET_NEXT_ELEMENT:
+ POPF
+ RET
+EndProc InsertPath
+endif
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/disk.asm b/private/mvdm/dos/v86/doskrnl/dos/disk.asm
new file mode 100644
index 000000000..8f52b5206
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/disk.asm
@@ -0,0 +1,877 @@
+ TITLE DISK - Disk utility routines
+ NAME Disk
+
+;** Low level Read and write routines for local SFT I/O on files and devs
+;
+; SWAPCON
+; SWAPBACK
+; DOS_READ
+; DOS_WRITE
+; get_io_sft
+;
+; Revision history:
+;
+; sudeepb 07-Mar-1991 Ported for DOSEm
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include mult.inc
+ include filemode.inc
+ .cref
+ .list
+
+Installed = TRUE
+
+ I_Need CONSft,DWORD ; SFT for swapped console In/Out
+ i_need CONSWAP,BYTE
+ i_need THISSFT,DWORD
+ i_need DMAADD,DWORD
+ i_need DEVCALL,BYTE
+ i_need CALLSCNT,WORD
+ i_need CALLXAD,DWORD
+ i_need CONTPOS,WORD
+ i_need NEXTADD,WORD
+ i_need CONBUF,BYTE
+ i_need ReadOp,BYTE
+ i_need EXTERR_LOCUS,BYTE
+ i_need PFLAG,BYTE
+ i_need CHARCO,BYTE
+ i_need CARPOS,BYTE
+
+;
+;Flag to indicate WIN386 presence
+;
+ I_need IsWin386,BYTE
+
+
+DOSCODE Segment
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ EXTRN CharHard:near
+ EXTRN DevIoCall:near
+ EXTRN DevIoCall2:near
+ EXTRN Outt:near
+
+
+Break <SwapCon, Swap Back - Old-style I/O to files>
+; * * * * Drivers for file input from devices * * * *
+;----------------------------------------------------------------------------
+; Indicate that ther is no more I/O occurring through another SFT outside of
+; handles 0 and 1
+;
+; Inputs: DS is DOSDATA
+; Outputs: CONSWAP is set to false.
+; Registers modified: none
+;----------------------------------------------------------------------------
+
+procedure SWAPBACK,NEAR
+
+ DOSAssume <DS>,"SwapBack"
+ MOV BYTE PTR [CONSWAP],0 ; signal no conswaps
+ return
+
+EndProc SWAPBACK
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : SWAPCON
+;
+; Copy ThisSFT to CONSFT for use by the 1-12 primitives.
+;
+; Inputs: ThisSFT as the sft of the desired file
+; DS is DOSDATA
+; Outputs: CONSWAP is set. CONSFT = ThisSFT.
+; Registers modified: none
+;--------------------------------------------------------------------------
+
+procedure SWAPCON,NEAR
+ DOSAssume <DS>,"SwapCon"
+
+ mov byte ptr [ConSwap], 1 ; ConSwap = TRUE
+
+ push ax
+ mov ax, word ptr ThisSFT
+ mov word ptr ConSFT, ax
+ mov ax, word ptr ThisSFT+2
+ mov word ptr ConSFT+2, ax
+ pop ax
+
+ return
+
+EndProc SWAPCON
+
+Break <DOS_READ -- DEVICE Read Routine>
+;-----------------------------------------------------------------------------
+;
+; Inputs:
+; ThisSFT set to the SFT for the file being used
+; [DMAADD] contains transfer address
+; CX = No. of bytes to read
+; DS = DOSDATA
+; Function:
+; Perform read operation
+; Outputs:
+; Carry clear
+; CX = No. of bytes read
+; ES:DI point to SFT
+; Carry set
+; AX is error code
+; CX = 0
+; ES:DI point to SFT
+; DS preserved, all other registers destroyed
+;
+;-----------------------------------------------------------------------------
+
+
+procedure DOS_READ,NEAR
+ DOSAssume <DS>,"DOS_Read"
+
+ LES DI,ThisSFT
+ Assert ISSFT,<ES,DI>,"DOS_Read"
+
+; We are reading from a device. Examine the status of the device to see if we
+; can short-circuit the I/O. If the device in the EOF state or if it is the
+; null device, we can safely indicate no transfer.
+
+READDEV:
+ DOSAssume <DS>,"ReadDev"
+ ASSUME ES:NOTHING
+ MOV ExtErr_Locus,errLOC_SerDev
+ MOV BL,BYTE PTR ES:[DI].SF_FLAGS
+ LES DI,[DMAADD]
+ test BL,devid_device_EOF ; End of file?
+ JZ ENDRDDEVJ3
+ test BL,devid_device_null ; NUL device?
+ JZ TESTRAW ; NO
+ XOR AL,AL ; Indicate EOF by setting zero
+ENDRDDEVJ3:
+ JMP ENDRDDEVJ2
+
+;
+; We need to hit the device. Figure out if we do a raw read or we do the
+; bizarre std_con_string_input.
+;
+TESTRAW:
+ test BL,devid_device_raw ; Raw mode?
+ JNZ DVRDRAW ; Yes, let the device do all local editing
+ test BL,devid_device_con_in ; Is it console device?
+ JZ NOTRDCON
+ JMP READCON
+
+DVRDRAW:
+ DOSAssume <DS>,"DvRdRaw" ; BUGBUG - wasted DOSASSUME?
+ PUSH ES
+ POP DS ; Xaddr to DS:DI
+ ASSUME DS:NOTHING
+
+
+;
+; NTVDM We don't do idling in ntdos we let softpc handle everything
+; thus NO support polled read for win386
+;
+; 04-Aug-1992 Jonle
+;
+;
+;;Check for win386 presence -- if present, do polled read of characters
+;
+;
+; test [IsWIN386],1
+; jz ReadRawRetry ;not present
+; test bl,devid_device_con_in ;is it console device
+; jz ReadRawRetry ;no, do normal read
+; jmp do_polling ;yes, do win386 polling loop
+
+ReadRawRetry:
+ MOV BX,DI ; DS:BX transfer addr
+ XOR AX,AX ; Media Byte, unit = 0
+ MOV DX,AX ; Start at 0
+ invoke SETREAD
+ PUSH DS ; Save Seg part of Xaddr
+
+ LDS SI,ThisSFT
+ Assert ISSFT,<DS,SI>,"DvRdRawR"
+ call DEVIOCALL
+ MOV DX,DI ; DS:DX is preserved by INT 24
+ MOV AH,86H ; Read error
+
+ MOV DI,[DEVCALL.REQSTAT]
+ .errnz STERR-8000h
+ or di,di
+ jns crdrok ; no errors
+ call CHARHARD
+ MOV DI,DX ; DS:DI is Xaddr
+
+ add di, callscnt ; update ptr and count to reflect the M065
+ sub cx, callscnt ; number of chars xferred M065
+
+ OR AL,AL
+ JZ CRDROK ; Ignore
+ CMP AL,3
+ JZ CRDFERR ; fail.
+ POP DS ; Recover saved seg part of Xaddr
+ JMP ReadRawRetry ; Retry
+
+;
+; We have encountered a device-driver error. We have informed the user of it
+; and he has said for us to fail the system call.
+;
+CRDFERR:
+ POP DI ; Clean stack
+DEVIOFERR:
+
+ LES DI,ThisSFT
+ Assert ISSFT,<ES,DI>,"DEVIOFERR"
+ transfer SET_ACC_ERR_DS
+
+CRDROK:
+ POP DI ; Chuck saved seg of Xaddr
+ MOV DI,DX
+
+ ADD DI,[CALLSCNT] ; Amount transferred
+IF DEBUG
+ JMP ENDRDDEVJ2
+ELSE
+ JMP SHORT ENDRDDEVJ2
+ENDIF
+
+
+; We are going to do a cooked read on some character device. There is a
+; problem here, what does the data look like? Is it a terminal device, line
+; CR line CR line CR, or is it file data, line CR LF line CR LF? Does it have
+; a ^Z at the end which is data, or is the ^Z not data? In any event we're
+; going to do this: Read in pieces up to CR (CRs included in data) or ^z (^z
+; included in data). this "simulates" the way con works in cooked mode
+; reading one line at a time. With file data, however, the lines will look
+; like, LF line CR. This is a little weird.
+
+NOTRDCON:
+ MOV AX,ES
+ MOV DS,AX
+ASSUME DS:NOTHING
+ MOV BX,DI
+ XOR DX,DX
+ MOV AX,DX
+ PUSH CX
+ MOV CX,1
+ invoke SETREAD
+ POP CX
+
+ LDS SI,ThisSFT
+ Assert ISSFT,<DS,SI>,"/NotRdCon"
+ LDS SI,[SI.sf_devptr]
+DVRDLP:
+ invoke DSKSTATCHK
+ call DEVIOCALL2
+ PUSH DI ; Save "count" done
+ MOV AH,86H
+
+ MOV DI,[DEVCALL.REQSTAT]
+ .errnz STERR-8000h
+ or di,di
+ jns CRDOK
+ call CHARHARD
+ POP DI
+
+ MOV [CALLSCNT],1
+ CMP AL,1
+ JZ DVRDLP ;Retry
+ CMP AL,3
+ JZ DEVIOFERR ; FAIL
+ XOR AL,AL ; Ignore, Pick some random character
+ JMP SHORT DVRDIGN
+
+CRDOK:
+ POP DI
+
+ CMP [CALLSCNT],1
+ JNZ ENDRDDEVJ2
+ PUSH DS
+
+ MOV DS,WORD PTR [CALLXAD+2]
+ MOV AL,BYTE PTR [DI] ; Get the character we just read
+ POP DS
+DVRDIGN:
+
+ INC WORD PTR [CALLXAD] ; Next character
+ MOV [DEVCALL.REQSTAT],0
+ INC DI ; Next character
+ CMP AL,1AH ; ^Z?
+ JZ ENDRDDEVJ2 ; Yes, done zero set (EOF)
+ CMP AL,c_CR ; CR?
+ LOOPNZ DVRDLP ; Loop if no, else done
+ INC AX ; Resets zero flag so NOT EOF, unless
+ ; AX=FFFF which is not likely
+ENDRDDEVJ2:
+ JMP SHORT ENDRDDEV
+
+
+
+;
+; NTVDM We don't do idling in ntdos we let softpc handle everything
+; thus NO support polled read for win386
+;
+; 04-Aug-1992 Jonle
+;
+;;Polling code for raw read on CON when WIN386 is present
+;;
+;;At this point -- ds:di is transfer address
+;; cx is count
+;;
+;
+;do_polling:
+; mov bx,di ;ds:bx is Xfer address
+; xor ax,ax
+; mov dx,ax
+; call setread ;prepare device packet
+;
+;do_io:
+;;
+;;Change read to a NON-DESTRUCTIVE READ, NO WAIT
+;;
+; mov byte ptr es:[bx+2],DEVRDND ;Change command code
+; push ds
+; lds si,[THISSFT] ;get device header
+; call deviocall ;call device driver
+; pop ds
+;
+; test es:[bx.REQSTAT],STERR ;check if error
+; jz check_busy ;no
+;
+; push ds
+; mov dx,di
+; invoke charhard ;invoke int 24h handler
+; mov di,dx
+; or al,al
+; jz pop_done_read ;ignore by user, assume read done
+; cmp al,3
+; jz devrderr ;user asked to fail
+; pop ds
+; jmp do_io ;user asked to retry
+;
+;check_busy:
+; test es:[bx.REQSTAT],0200h ;see if busy bit set
+; jnz no_char ;yes, no character available
+;;
+;;Character is available. Read in 1 character at a time until all characters
+;;are read in or no character is available
+;
+; mov byte ptr es:[bx+2],DEVRD ;command code is READ now
+; mov word ptr es:[bx+18],1 ;change count to 1 character
+; push ds
+; lds si,[THISSFT]
+; call deviocall
+;
+; mov dx,di
+; mov ah,86h
+; mov di,es:[bx.REQSTAT] ;get returned status
+; test di,STERR ;was there an error during read?
+; jz next_char ;no,read next character
+;
+; invoke charhard ;invoke int 24h handler
+; mov di,dx ;restore di
+; or al,al ;
+; jz pop_done_read ;ignore by user,assume read is done
+; cmp al,3
+; jz devrderr ;user issued a 'fail',indicate error
+; pop ds
+; jmp do_io ;user issued a retry
+;
+;next_char:
+; pop ds
+; mov di,dx
+; dec cx ;decrement count
+; jcxz done_read ;all characters read in
+; inc word ptr es:[bx+14] ;update transfer address
+; jmp do_io ;read next character in
+;
+;devrderr:
+; pop di ;discard segment address
+; les di,[THISSFT]
+; transfer SET_ACC_ERR_DS ;indicate error
+;
+;no_char:
+;
+;
+;;
+;;Since no character is available, we let win386 switch the VM out
+;;
+; push ax
+; mov ah,84h
+; int 2ah ;indicate idle to WIN386
+;;
+;;When control returns from WIN386, we continue the raw read
+;;
+; pop ax
+;
+; jmp do_io
+;
+;pop_done_read:
+; pop ds
+;done_read:
+; add di,[CALLSCNT]
+; jmp ENDRDDEVJ3 ;jump back to normal DOS raw read exit
+;
+
+
+ASSUME DS:NOTHING,ES:NOTHING
+
+TRANBUF:
+ LODSB
+ STOSB
+ CMP AL,c_CR ; Check for carriage return
+ JNZ NORMCH
+ MOV BYTE PTR [SI],c_LF
+NORMCH:
+ CMP AL,c_LF
+ LOOPNZ TRANBUF
+ JNZ ENDRDCON
+ XOR SI,SI ; Cause a new buffer to be read
+ call OUTT ; Transmit linefeed
+ OR AL,1 ; Clear zero flag--not end of file
+ENDRDCON:
+
+ Context DS
+ CALL SWAPBACK
+ MOV [CONTPOS],SI
+ENDRDDEV:
+
+ Context DS
+
+ MOV [NEXTADD],DI
+ JNZ SETSFTC ; Zero set if Ctrl-Z found in input
+ LES DI,ThisSFT
+ Assert ISSFT,<ES,DI>,"EndRdDev"
+ AND BYTE PTR ES:[DI].SF_FLAGS,NOT devid_device_EOF ; Mark as no more data available
+SETSFTC:
+ call SETSFT
+ return
+
+ASSUME DS:NOTHING,ES:NOTHING
+
+READCON:
+ DOSAssume <DS>,"ReadCon"
+ CALL SWAPCON
+ MOV SI,[CONTPOS]
+ OR SI,SI
+ JNZ TRANBUF
+ CMP BYTE PTR [CONBUF],128
+ JZ GETBUF
+ MOV WORD PTR [CONBUF],0FF80H ; Set up 128-byte buffer with no template
+GETBUF:
+ PUSH CX
+ PUSH ES
+ PUSH DI
+
+ MOV DX,OFFSET DOSDATA:CONBUF
+
+ invoke $STD_CON_STRING_INPUT ; Get input buffer
+ POP DI
+ POP ES
+ POP CX
+
+ MOV SI,2 + OFFSET DOSDATA:CONBUF
+
+ CMP BYTE PTR [SI],1AH ; Check for Ctrl-Z in first character
+ JNZ TRANBUF
+ MOV AL,1AH
+ STOSB
+ DEC DI
+ MOV AL,c_LF
+ call OUTT ; Send linefeed
+ XOR SI,SI
+ JMP ENDRDCON
+
+EndProc DOS_READ
+
+Break <DOS_WRITE -- DEVICE Write Routine>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DOS_WRITE
+;
+; Inputs:
+; ThisSFT set to the SFT for the file being used
+; [DMAADD] contains transfer address
+; CX = No. of bytes to write
+; Function:
+; Perform write operation
+; NOTE: If CX = 0 on input, file is truncated or grown
+; to current sf_position
+; Outputs:
+; Carry clear
+; CX = No. of bytes written
+; ES:DI point to SFT
+; Carry set
+; AX is error code
+; CX = 0
+; ES:DI point to SFT
+; DS preserved, all other registers destroyed
+;---------------------------------------------------------------------------
+
+procedure DOS_WRITE,NEAR
+ DOSAssume <DS>,"DOS_Write"
+
+ LES DI,ThisSFT
+ Assert ISSFT,<ES,DI>,"DosWrite"
+; BUGBUG sudeepb 12-Mar-1991 Take care of this RO Bullshit of FCBS in
+; appropriate FCB routines.
+;
+; NOTE: The following check for writting to a Read Only File is performed
+; ONLY on FCBs!!!!
+; We ALLOW writes to Read Only files via handles to allow a CREATE
+; of a read only file which can then be written to.
+; This is OK because we are NOT ALLOWED to OPEN a RO file via handles
+; for writting, or RE-CREATE an EXISTING RO file via handles. Thus,
+; CREATing a NEW RO file, or RE-CREATing an existing file which
+; is NOT RO to be RO, via handles are the only times we can write
+; to a read-only file.
+;
+;Check_FCB_RO:
+; TESTB ES:[DI.sf_mode],sf_isfcb
+; JZ WRITE_NO_MODE ; Not an FCB
+; TESTB ES:[DI].sf_attr,attr_read_only
+; JNZ BadMode ; Can't write to Read_Only files via FCB
+;WRITE_NO_MODE:
+; call SETUP
+; invoke IsSFTNet
+; JZ LOCAL_WRITE
+
+ JMP WRTDEV
+
+DVWRTRAW:
+ASSUME DS:NOTHING
+ XOR AX,AX ; Media Byte, unit = 0
+ invoke SETWRITE
+ PUSH DS ; Save seg of transfer
+
+;hkn; SS override
+ LDS SI,ThisSFT
+ Assert ISSFT,<DS,SI>,"DosWrite/DvWrtRaw"
+ call DEVIOCALL ; DS:SI -> DEVICE
+
+
+ MOV DX,DI ; Offset part of Xaddr saved in DX
+ MOV AH,87H
+
+;hkn; SS override
+ MOV DI,[DEVCALL.REQSTAT]
+ .errnz STERR-8000h
+ or di,di
+ jns CWRTROK
+ call CHARHARD
+
+ sub cx, callscnt ; update ptr & count to reflect M065
+ mov bx, dx ; number of chars xferred M065
+ add bx, callscnt ; M065
+ mov di, bx ; M065
+
+; MOV BX,DX ; Recall transfer addr M065
+
+ OR AL,AL
+ JZ CWRTROK ; Ignore
+ CMP AL,3
+ JZ CWRFERR
+ POP DS ; Recover saved seg of transfer
+ JMP DVWRTRAW ; Try again
+
+CWRFERR:
+ POP AX ; Chuck saved seg of transfer
+ JMP CRDFERR ; Will pop one more stack element
+
+CWRTROK:
+ POP AX ; Chuck saved seg of transfer
+ POP DS
+ DOSAssume <DS>,"DISK/CWrtOK"
+ MOV AX,[CALLSCNT] ; Get actual number of bytes transferred
+ENDWRDEV:
+ LES DI,ThisSFT
+ Assert ISSFT,<ES,DI>,"DosWrite/EndWrDev"
+ MOV CX,AX
+ call ADDREC
+ return
+
+WRTNUL:
+ MOV DX,CX ;Entire transfer done
+WrtCookJ:
+ JMP WRTCOOKDONE
+
+WRTDEV:
+ DOSAssume <DS>,"DISK/WrtDev"
+ MOV ExtErr_Locus,errLOC_SerDev
+ OR BYTE PTR ES:[DI].SF_FLAGS,devid_device_EOF ; Reset EOF for input
+ MOV BL,BYTE PTR ES:[DI].SF_FLAGS
+ XOR AX,AX
+ JCXZ ENDWRDEV ; problem of creating on a device.
+ PUSH DS
+ MOV AL,BL
+ LDS BX,[DMAADD] ; Xaddr to DS:BX
+ASSUME DS:NOTHING
+ MOV DI,BX ; Xaddr to DS:DI
+ XOR DX,DX ; Set starting point
+ test AL,devid_device_raw ; Raw?
+ JZ TEST_DEV_CON
+ JMP DVWRTRAW
+
+TEST_DEV_CON:
+ test AL,devid_device_con_out ; Console output device?
+ DLJNZ WRITECON
+ test AL,devid_device_null
+ JNZ WRTNUL
+ MOV AX,DX
+ CMP BYTE PTR [BX],1AH ; ^Z?
+ JZ WRTCOOKJ ; Yes, transfer nothing
+ PUSH CX
+ MOV CX,1
+ invoke SETWRITE
+ POP CX
+
+;hkn; SS override
+ LDS SI,ThisSFT
+;
+;SR; Removed X25 support from here
+;
+ LDS SI,[SI.sf_devptr]
+DVWRTLP:
+ invoke DSKSTATCHK
+ call DEVIOCALL2
+ PUSH DI
+ MOV AH,87H
+
+;hkn; SS override
+ MOV DI,[DEVCALL.REQSTAT]
+ .errnz STERR-8000h
+ or di,di
+ jns CWROK
+ call CHARHARD
+ POP DI
+
+;hkn; SS override
+ MOV [CALLSCNT],1
+ CMP AL,1
+ JZ DVWRTLP ; Retry
+ OR AL,AL
+ JZ DVWRTIGN ; Ignore
+ JMP CRDFERR ; Fail, pops one stack element
+
+CWROK:
+ POP DI
+
+;hkn; SS override
+ CMP [CALLSCNT],0
+ JZ WRTCOOKDONE
+DVWRTIGN:
+ INC DX
+
+;hkn; SS override for CALLXAD
+ INC WORD PTR [CALLXAD]
+ INC DI
+ PUSH DS
+ MOV DS,WORD PTR [CALLXAD+2]
+ CMP BYTE PTR [DI],1AH ; ^Z?
+ POP DS
+ JZ WRTCOOKDONE
+
+;hkn; SS override
+ MOV [DEVCALL.REQSTAT],0
+ LOOP DVWRTLP
+WRTCOOKDONE:
+ MOV AX,DX
+ POP DS
+ JMP ENDWRDEV
+
+WRITECON:
+ PUSH DS
+
+;hkn; SS is DOSDATA
+ Context DS
+ CALL SWAPCON
+ POP DS
+ ASSUME DS:NOTHING
+; Find possible CTRL-Z in the user's string
+ push ds
+ pop es
+ mov dx,bx ; ds:dx string, also es:di is pointing
+ ; to the same string
+ mov bx,cx ; save passed byte count
+ mov al,'Z'-'@' ; (AL) = CTRL-Z
+ repne scasb
+ jnz no_ctrlz
+ inc cx ; adjust for having passed CTRL-Z
+no_ctrlz:
+ neg cx ; (CX) = -(count remaining)
+ add cx,bx ; (CX) = original - (count remaining)
+ push cx
+ call Cons_String_Output ; ds:dx = string cx = count
+CONEOF:
+ POP AX ; Count
+ SUB AX,CX ; Amount actually written
+ POP DS
+ DOSAssume <DS>,"DISK/ConEOF"
+ CALL SWAPBACK
+ JMP ENDWRDEV
+
+EndProc DOS_WRITE
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : get_io_sft
+;
+; Convert JFN number in BX to sf_entry in DS:SI We get the normal SFT if
+; CONSWAP is FALSE or if the handle desired is 2 or more. Otherwise, we
+; retrieve the sft from ConSFT which is set by SwapCon.
+;
+;---------------------------------------------------------------------------
+
+procedure get_io_sft,near
+ cmp ConSwap,0 ;smr;SS Override
+ JNZ GetRedir
+GetNormal:
+
+;hkn; SS is DOSDATA
+ Context DS
+
+ PUSH ES
+ PUSH DI
+ invoke SFFromHandle
+ JC RET44P
+ MOV SI,ES
+ MOV DS,SI
+ASSUME DS:NOTHING
+ MOV SI,DI
+RET44P:
+ POP DI
+ POP ES
+ return
+GetRedir:
+ CMP BX,1
+ JA GetNormal
+
+;hkn; SS override
+ LDS SI,ConSFT
+ Assert ISSFT,<DS,SI>,"GetIOSft"
+ CLC
+ return
+EndProc get_io_sft
+
+Procedure SETSFT,near
+ DOSAssume <DS>,"SetSFT"
+ ASSUME ES:NOTHING
+
+ LES DI,[THISSFT]
+
+ ASSUME ES:NOTHING
+
+ MOV CX,[NEXTADD]
+ SUB CX,WORD PTR DMAAdd ; Number of bytes transfered
+
+entry AddRec
+ DOSAssume <DS>,"AddRec"
+
+ Assert ISSFT,<ES,DI>,"AddRec"
+
+ JCXZ RET28 ; If no records read, don't change position
+ ADD WORD PTR ES:[DI.sf_position],CX ; Update current position
+ ADC WORD PTR ES:[DI.sf_position+2],0
+RET28: CLC
+ return
+endproc SETSFT
+
+Procedure SET_ACC_ERR_DS,near
+ASSUME DS:NOTHING,ES:NOTHING
+
+ Context DS
+
+entry SET_ACC_ERR
+ DOSAssume <DS>,"SET_ACC_ERR"
+
+ XOR CX,CX
+ MOV AX,error_access_denied
+ STC
+ return
+endproc SET_ACC_ERR_DS
+
+; Sudeepb 28-Jul-1992: Following is the new routine to speed-up the DOS
+; console output. We are maintaining the absolute compatibility with
+; carpos,^p and the checking of ^c etc. We try to find as big a string
+; as possible without any Control characters. Then this string is
+; outputted in a shot. The control character still goes through outt
+; to maintain all sort of compatibility problems.
+
+csoMaxChars equ 255 ; maximum chars to output at one time in
+SCHK_COUNT equ 64 ; number of OUTs before a StatChk
+
+;** Cons_String_Output - print string given length
+;
+; Print the string on the console device
+;
+; ENTRY DS:DX Point to output string
+; CX number of characters in string
+;
+; EXIT None
+;
+; USES All
+
+Procedure Cons_String_Output,near
+ASSUME DS:NOTHING,ES:NOTHING
+ jcxz cso9 ; nothing to do?
+ MOV SI,DX ; get pointer to string
+ xor bx,bx ; zero character counter
+cso1:
+ LODSB
+ cmp al,' ' ; ASCII graphic?
+ jb cso3 ; no, write current string
+ cmp al,c_del
+ je cso3
+ cmp bx, csoMaxChars ; Is strlen at maximum block size
+ je cso3 ; Yes, output this block.
+ inc bx ; bump character counter
+cso2:
+ loop cso1 ; look at next
+cso3:
+ xchg bx,cx ; CX=char. count, BX=number remaining
+ jcxz cso7 ; no chars in string
+ SaveReg <ds,si,bx,ax>
+ TEST BYTE PTR [PFLAG],-1 ; printer echo on?
+ jnz cso4 ; yes, do it one char. at a time
+ push ds
+ invoke StatChk
+ mov bx,1
+ invoke Get_IO_SFT ; ds:si is CONSFT
+ pop es
+ mov di,dx ; es:di is the string
+ jc cso6
+ add CarPos,cl ; update position on line
+ mov ah,6 ; 6 = output string
+ invoke IOFunc ; print the string in ES:DI; CX = count
+ or CharCo,SCHK_COUNT-1 ; force a StatChk
+ ASSUME DS:NOTHING
+ jmp short cso6
+cso4:
+ mov si,dx ; Pflag set, let OUT to printer output
+cso5: lodsb
+ CALL OUTT
+ loop cso5
+cso6:
+ RestoreReg <ax,bx,si,ds>
+cso7:
+ xchg bx,cx
+ jcxz cso9 ; are we done?
+ push cx
+ push si
+ CALL OUTT
+ pop si
+ pop cx
+ mov dx,si ; update start of string
+ xor bx,bx
+ jmp cso2
+cso9:
+ xor ax,ax
+ ret
+Endproc Cons_String_Output
+
+DOSCODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dispatch.txt b/private/mvdm/dos/v86/doskrnl/dos/dispatch.txt
new file mode 100644
index 000000000..0f50ef026
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dispatch.txt
@@ -0,0 +1,214 @@
+; SCCSID = @(#)dispatch.asm 1.1 85/04/10
+; SCCSID = @(#)dispatch.asm 1.1 85/04/10
+;
+; Major dispatch code and table for MSDOS 2.X and above.
+;
+; Modification history:
+;
+; Created: MZ 30 March 1983
+;
+; The system calls are dispatched to in such a fashion as to have their entire
+; register set passed to them except for CS:IP and SS:SP. This reduces the
+; need for retreiving information from the user's stack.
+;
+; There are also critical sections that need to be observed when running in a
+; multitasking environment. These sections are:
+;
+; 1 critDisk any of the disk code that will twiddle the buffer cache
+; 2 critDevice all device drivers
+;
+; 4 critMem memory allocation stuff
+; 5 critNet network critical section
+;
+; The system calls below are noted as to which of these critical sections they
+; belong. The critical sections are noted in the source files by the macros
+; EnterCrit and LeaveCrit.
+;
+; The break-down of the individual system calls into source files is as
+; follows (* means done):
+;
+; * handle.asm: Close, Read, Write, LSeek, XDup, XDup2, FileTimes
+; IOCTL.INC: IOCTL
+; * file.asm: Open, Creat, ChMod, Unlink, Rename, CreateTemp,
+; CreateNew
+; * srvcall.asm: $ServerCall
+; * path.asm: MkDir, RmDir, ChDir, CurrentDir
+; * alloc.asm: $Alloc, $Dealloc, $SetBlock, $AllocOper
+; arena_free_process, arena_next -> LOW LEVEL <-
+; check_signature, Coalesce
+; * search.asm: DirSearchFirst, DirSearchNext, FindFirst, FindNext,
+; PackName -> LOW LEVEL <-
+; * proc.asm: Exec, Exit, Abort, Wait, KeepProcess
+; * cpmio.asm: StdConInput, StdConOutput, StdAuxInput, StdAuxOutput,
+; StdPrinterOutput, RawConIO, RawConInput,
+; StdConInputNoEcho, StdConStringInput,
+; StdConStringOutput, StdConInputStatus,
+; StdConInputFlush
+; OUT, BUFOUT, RAWOUT, RAWOUT2 -> LOW LEVEL <-
+; * fcbio.asm: FCBOpen, FCBClose, FCBDelete, FCBSeqRead, FCBSeqWrite,
+; FCBCreate, FCBRename, FCBRandomRead, FCBRandomWrite,
+; GetFCBFileLength, GetFCBPosition, FCBRandomReadBlock,
+; FCBRandomWriteBlock
+; * Time.asm: GetDate, SetDate, GetTime, SetTime
+; * Parse.asm: Parse_file_descriptor, PathParse
+; * GetSet.asm: GetInterruptVector, SetInterruptVector,
+; GetVerifyOnWrite, SetVerifyOnWrite, GetDMA, SetDMA,
+; GetVersion, SetCTRLCTrapping, GetDriveFreespace,
+; CharOper, International, SetDefaultDrive,
+; GetDefaultDrive
+; * Misc.asm: Sleazefunc, SleazefuncDL, GetDefaultDPB, GetDPB,
+; CreateProcessDataBlock, GetINDOSFlag, GetInVars,
+; SetDPB, DupPDB, DiskReset
+; StrCmp, StrCpy, Ucase -> LOW LEVEL <-
+;
+; STUB MODULES
+; Net.asm **** This will get broken down more???
+; * Share.asm Share_Check, Share_Violation
+; * Lock.asm $LockOper
+; DOS_LOCK,DOS_UNLOCK,Lock_Check, Lock_Violation
+
+; INTERNAL INTERFACE MODULES
+; * Lock.asm DOS_LOCK, DOS_UNLOCK -->> STUBS <<--
+; * Dinfo.asm DISK_INFO
+; * Finfo.asm GET_FILE_INFO, SET_FILE_ATTRIBUTE
+; * Create.asm DOS_CREATE, DOS_CREATE_NEW,
+; Set_Mknd_Err --> Low level routine <--
+; * Dup.asm DOS_DUP
+; * Open.asm DOS_OPEN,
+; SetBadPathError, --> Low level routines <--
+; Check_Access_AX, Share_Error, Set_SFT_Mode
+; * Close.asm DOS_CLOSE, DOS_COMMIT, DOS_CLOSE_GOT_SFT,
+; Free_SFT --> Low level routine <--
+; * Abort.asm DOS_ABORT
+; * ISearch.asm DOS_SEARCH_FIRST, DOS_SEARCH_NEXT,
+; RENAME_NEXT --> Low level routine <--
+; * Dircall.asm DOS_MKDIR, DOS_CHDIR, DOS_RMDIR
+; * Rename.asm DOS_RENAME
+; * Delete.asm DOS_DELETE,
+; REN_DEL_Check --> Low level routine <--
+; * Disk.asm DOS_READ, DOS_WRITE
+
+; LOW LEVEL MODULES
+; * Fat.asm UNPACK, PACK, MAPCLUSTER, FATREAD_SFT,
+; FATREAD_CDS, FAT_operation
+; * Ctrlc.asm --> STD/IBM versions <--
+; FATAL, FATAL1, reset_environment, DSKSTATCHK,
+; SPOOLINT, STATCHK, CNTCHAND, DIVOV, RealDivOv,
+; CHARHARD, HardErr
+; * Buf.asm SETVISIT, ScanPlace, PLACEBUF, PLACEHEAD, PointComp,
+; GETBUFFR, GETBUFFRB, FlushBuf, BufWrite,
+; SKIPVISIT
+; * Disk.asm SWAPBACK, SWAPCON, get_io_sft, DirRead, FATSecRd,
+; DskRead, SETUP, BREAKDOWN, DISKREAD, DISKWRITE,
+; FIRSTCLUSTER, DREAD, DWRITE, DSKWRITE,
+; READ_LOCK_VIOLATION, WRITE_LOCK_VIOLATION,
+; SETSFT, SETCLUS, AddRec
+; * Mknode.asm BUILDDIR, SETDOTENT, MakeNode, NEWENTRY, FREEENT,
+; NEWDIR, DOOPEN,RENAME_MAKE
+; * FCB.asm MakeFcb, NameTrans, PATHCHRCMP, GetLet, TESTKANJ,
+; NORMSCAN, CHK, DELIM
+; * Rom.asm GET_random_record, GETRRPOS1, GetRRPos, SKPCLP,
+; FNDCLUS, BUFSEC, BUFRD, BUFWRT, NEXTSEC,
+; OPTIMIZE, FIGREC, GETREC, ALLOCATE, RESTFATBYT,
+; RELEASE, RELBLKS, GETEOF
+; * Dev.asm IOFUNC, DEVIOCALL, SETREAD, SETWRITE, GOTDPB,
+; DEVIOCALL2, DEV_CLOSE_SFT, DEV_OPEN_SFT
+; * Dir.asm SEARCH, SETDIRSRCH, GETPATH, ROOTPATH, StartSrch,
+; MatchAttributes, DEVNAME, Build_device_ent,
+; FindEntry, Srch, NEXTENT, GETENTRY, GETENT,
+; NEXTENTRY, GetPathNoSet, FINDPATH
+;
+
+; critical section information for the system calls
+
+; System Call Who takes care of the reentrancy
+; Abort 0 (flushbuf) DOS_Close
+; Std_Con_Input 1 DOS_Read
+; Std_Con_Output 2 DOS_Write
+; Std_Aux_Input 3 DOS_Read
+; Std_Aux_Output 4 DOS_Write
+; Std_Printer_Output 5 DOS_Write
+; Raw_Con_IO 6 DOS_Read/DOS_Write
+; Raw_Con_Input 7 DOS_Read
+; Std_Con_Input_No_Echo 8 DOS_Read
+; Std_Con_String_Output 9 DOS_Write
+; Std_Con_String_Input A DOS_Read
+; Std_Con_Input_Status B DOS_Read
+; Std_Con_Input_Flush C DOS_Read
+; Disk_Reset D (FlushBuf, ScanPlace, SkipVisit)
+; Set_Default_Drive E *none*
+; FCB_Open F DOS_Open
+; FCB_Close 10 DOS_Close
+; Dir_Search_First 11 DOS_Search_First
+; Dir_Search_Next 12 DOS_Search_Next
+; FCB_Delete 13 DOS_Delete
+; FCB_Seq_Read 14 DOS_Read/DOS_Write
+; FCB_Seq_Write 15 DOS_Read/DOS_Write
+; FCB_Create 16 DOS_Create
+; FCB_Rename 17 DOS_rename
+; Get_Default_Drive 19 *none*
+; Set_DMA 1A *none*
+; Get_Default_DPB 1F *none*
+; FCB_Random_Read 21 DOS_Read/DOS_Write
+; FCB_Random_Write 22 DOS_Read/DOS_Write
+; Get_FCB_File_Length 23 Get_file_info
+; Get_FCB_Position 24 *none*
+; Set_Interrupt_Vector 25 *none*
+; Create_Process_Data_Block 26 *none*
+; FCB_Random_Read_Block 27 DOS_Read/DOS_Write
+; FCB_Random_Write_Block 28 DOS_Read/DOS_Write
+; Parse_File_Descriptor 29 *none*
+; Get_Date 2A DEVIOCALL
+; Set_Date 2B DEVIOCALL
+; Get_Time 2C DEVIOCALL
+; Set_Time 2D DEVIOCALL
+; Set_Verify_On_Write 2E *none*
+; Get_DMA 2F *none*
+; Get_Version 30 *none*
+; Keep_Process 31 $abort...
+; Get_DPB 32 *none*
+; Set_CTRL_C_Trapping 33 *none*
+; Get_InDOS_Flag 34 *none*
+; Get_Interrupt_Vector 35 *none*
+; Get_Drive_Freespace 36 Disk_Info
+; Char_Oper 37 *none*
+; International 38 *none*
+; MKDir 39 DOS_MkDir
+; RMDir 3A DOS_RmDir
+; CHDir 3B DOS_ChDir
+; Creat 3C DOS_Create
+; Open 3D DOS_Open
+; Close 3E DOS_Close
+; Read 3F DOS_Read
+; Write 40 DOS_Write
+; Unlink 41 DOS_Delete
+; LSeek 42 *none*
+; CHMod 43 Get_file_info, Set_File_Attribute
+; IOCtl 44 DEVIOCALL
+; XDup 45 *none*
+; XDup2 46 *none*
+; Current_Dir 47 $Current_Dir
+; Alloc 48 $Alloc
+; Dealloc 49 $Dealloc
+; Setblock 4A $SetBlock
+; Exec 4B
+; Exit 4C $abort...
+; Wait 4D *none*
+; Find_First 4E DOS_Search_First
+; Find_Next 4F DOS_Search_Next
+; Set_Current_PDB 50 *none*
+; Get_Current_PDB 51 *none*
+; Get_In_Vars 52 *none*
+; SetDPB 53 *none*
+; Get_Verify_On_Write 54 *none*
+; Dup_PDB 55
+; Rename 56 DOS_Rename
+; File_Times 57 *none*
+; AllocOper 58 *none*
+; GetExtendedError 59 *none*
+; CreateTempFile 5A DOS_Create_New
+; CreateNewFile 5B DOS_Create_New
+; LockOper 5C
+; ServerCall 5D
+; UserOper 5E
+; AssignOper 5F
diff --git a/private/mvdm/dos/v86/doskrnl/dos/divmes.inc b/private/mvdm/dos/v86/doskrnl/dos/divmes.inc
new file mode 100644
index 000000000..7054d438b
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/divmes.inc
@@ -0,0 +1,18 @@
+; THIS IS THE ONLY DOS "MESSAGE". IT DOES NOT NEED A TERMINATOR.
+ PUBLIC DIVMES
+Public DIVM001S,DIVM001E
+DIVM001S label byte
+
+include msdos.cl1
+
+ PUBLIC DivMesLen
+DivMesLen DW $-DivMes ; Length of the above message in bytes
+DIVM001E label byte
+
+;M018
+; Add VxD not found error message
+;
+ Public NoVxDErrMsg ;M018
+include msdos.cl4 ;M018
+ Public VXDMESLEN ;M018
+VxDMesLen equ $ - NoVxDErrMsg ;M018
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dos.tag b/private/mvdm/dos/v86/doskrnl/dos/dos.tag
new file mode 100644
index 000000000..4a395eebf
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dos.tag
@@ -0,0 +1,270 @@
+
+
+
+M000 7/9/90 HKN alloc.asm added support for allocing UMBs.
+ msproc.asm added support for loading programs into UMBs
+ msconst.asm added save_ax, umb_head and start_arena for
+ umb support
+
+M001 SR 07/16/90 Windows requires another instance table
+ which needs to be passed always even if we
+ patch ourselves. It gets User_Id offset from
+ this table.
+ Files: DOSTAB.ASM, MSCODE.ASM
+
+M002 SR 07/16/90 Numerous bug fixes for Windows:
+ 1. Enable critical sections
+ 2. Chain old instance data
+ 3. Chain on if not WIN386 (i.e WIN286 )
+ Files: MSCODE.ASM
+
+M003 7/18/90 HKN alloc.asm Added support for link/unlink UMBs
+ msconst.asm Added umbflag
+ arena.inc added LINKSTATE
+
+M004 7/30/90 HKN msdisp.asm Added support for MS PASCAL 3.2 problem with
+ msproc.asm dos running in HMA. See under TAG M003 in
+ getset.asm inc\dossym.inc for explanation.
+ msconst.asm added variable A20OFF_FLAG.
+
+M005 8/02/90 HKN msproc.asm Support for exe files that do not have a
+ STACK segment.
+ 9/26/90 HKN msproc.asm This support is fro programs with resident
+ size < 64K - 256 bytes.
+
+M006 8/06/90 HKN mstable.asm Fake_version call no longer suported.
+
+M007 8/6/90 MD getset.asm Change enhanced GetVersion it use function 33.
+ msdisp.asm Function 30 now returns BH = 1 for ROM DOS,
+ BH = 0 for disk DOS. This is required for
+ Win 3.0.
+
+M008 8/06/90 CAS misc.asm Added check to limit max_clusters to the
+ number that will actually fit in the fats
+
+M009 8/20/90 HKN alloc.asm Added error returns invalid function and
+ arena trashed in set link state call.
+
+M010 8/24/90 HKN alloc.asm Release UMB arenas allocated to current PDB
+ if UMB_HEAD is initialized.
+
+M011 8/24/90 SMR MSCTRLC.ASM Instead setting bit 1 at exit time, now we
+ maintain the bit 1 (to make sure that DOS
+ works on some hand held machines based on
+ NEC processor.
+
+M012 8/24/90 SR DOSTAB.ASM Added UMB_Head to Win386_DOSVars, which is
+ a table of offsets passed to Win386 on the
+ 1607 callout. This offset will be needed
+ for UMB support in Win 3.1. It will be
+ ignored by Win 3.0.
+
+
+M013 8/27/90 SMR MSCODE.ASM INT 25/26 will use AbsRdWr_SS & AbsRdWr_SP
+ to store user's SS&SP
+
+
+
+M014 8/28/90 HKN FAT.ASM if a request for pack\unpack cluster 0 is made
+ we write\read from CL0FATENTRY rather than
+ disk.
+ MSCONST.ASM added variable CL0FATENTRY
+ 9/27/90 HKN FAT.ASM return z from unpack if di=0
+
+
+M015 8/29/90 MD MACRO2.ASM Allocate even number of bytes on stack in
+ TransFCB.
+
+M016 8/31/90 HKN alloc.asm support for MACE utilities MKEYRATE version
+ 1.0. See under TAG M009 in dossym.inc
+
+M017 8/30/90 MD DISK3.ASM Rewrote SHR32 for better performance, and
+ removed a few bits of dead code.
+
+M018 9/5/90 SR DIVMES.ASM Added support to load the La20HMA VxD if
+ DOSTAB.ASM Win386 is started up. The code assumes that
+ MSCODE.ASM the VxD is located at the root of the boot
+ MSDOS.SKL drive.
+
+M019 9/5/90 SR MSINIT.ASM The instance table was updated to add offsets
+ for the UMB variables. Updated initialize
+ counter to new value.
+
+M020 9/5/90 SMR EXEPATCH.ASM Fix for 123 release 3 bug. Actually a Rational
+ MSINIT.ASM DOS extender bug. For details see exepatch.asm
+ MSPROC.ASM
+ LMSTUB.ASM
+
+M021 9/6/90 MRW EXEPATCH.ASM Remove the procedure Dos_High, and replace
+ MSCTRLC.ASM it with a new DOS variable called DosHasHMA.
+ MSDISP.ASM Also, put the pointers through which the
+ MSPROC.ASM exepatch and Rational patch bugfixes are
+ MSINIT.ASM done in the data segment instead of the
+ LMSTUB.ASM code segment.
+
+M022 9/7/90 MD FILE.ASM Removed obsolete IBMCOPYRIGHT directives
+ MSCODE.ASM
+ DISK2.ASM
+
+M023 9/7/90 SR MSCODE.ASM Fixed Share build problems with msdata. Due
+ MSDATA.ASM to 2 problems: 1. RetExePatch was an extrn
+ MSINIT.ASM 2. AltAh was an extern. Rearranged everything
+ MAKEFILE so that Share builds.
+
+M024 9/12/90 HKN msctrlc.asm suppressed fail and ignore options if not in
+ the middle of int 24 and if Ctrl P or ctrl
+ printscrn is pressed in routine charhard.
+
+M025 9/12/90 HKN finfo.asm Return access_denied if attempting to set
+ attribute of root directory.
+
+M026 9/17/90 HKN dir2.asm Set Attrib before invoking DevName.
+
+M027 9/21/90 HKN macro2.asm Set Sattrib in $nametrans.
+
+M028 9/22/90 SMR MSPROC.ASM 4B04 Implementation
+ EXEPATCH.ASM
+
+M029 10/2/90 SR MSPROC.ASM Bug #3028 fixed. Exe's without stack support
+ rewritten to be more compatible.
+
+M030 10/06/90 SMR MSPROC.ASM Fixing bug in EXEPACPATCH & changing 4b04
+ EXEPATCH.ASM to 4b05
+
+M031 10/08/90 PYS IOCTL.ASM Generic Ioctl refused due to lacking es:
+ overwrite.
+
+M032 10/08/90 HKN exepatch.asm set turnoff bit only if DOS in HMA.
+
+M033 10/10/90 HKN exepatch.asm if IP < 2 then not expacked
+
+M034 10/11/90 HKN open.asm The value in save_bx must be pushed on to
+ the stack for remote extended opens and not
+ save_cx.
+
+M035 10/11/90 HKN open.asm if open made from exec then we must set the
+ appropriate bits on the stack before calling
+ off to the redir, i.e., al = 023h =>
+ SHARING_DENY_WRITE+EXEC_OPEN
+
+M036 10/12/90 HKN dostab.asm put in patch for Port Of Entry to find offset
+ of errormode flag
+
+M037 10/16/90 SR mscode.asm On Aaron's request, changed check for VxD
+ load, to load VxD if Windows version is less
+ than 3.10.
+
+M038 10/16/90 SR abort.asm Fixed abort code to check for busy state of
+ SFT before freeing it. Fixes the problem of
+ SFT belonging to a process with same PSP
+ getting freed.
+
+M039 10/17/90 DB buf.asm Disk write optimization.
+ disk2.asm
+ disk3.asm
+
+M040 10/21/90 SR msproc.asm Bug #3052. The environment sizing code in
+ Exec was falling a byte short. It would flag
+ an error if the environment size was 32767
+ bytes. Changed it to allow 32768 bytes which
+ is the correct limit.
+
+M041 10/23/90 SMR MISC.ASM Throwing out the secondary cache at DISK_RESET
+
+M042 10/25/90 HKN open.asm Bit 11 of DOS34_FLAG set indicates that the
+ redir knows how to handle open from exec. In
+ this case set the appropriate bit else do not
+ msdisp.asm clear all bits except bit 11 of dos34_flag
+
+M043 10/31/90 HKN msdisp.asm initialize nss & nsp to user_ss and user_sp
+ unconditionally.
+
+M044 11/1/90 SR msconst.asm Bug #3869. Fixed win /r hang with UMBs by
+ dostab.asm hacking in code to save and restore the last
+ mscode.asm para of Windows memory which the switcher
+ fails to save because of a bug.
+
+M045 11/1/90 HKN msdisp.asm do not do xchg bp,sp to save bp, as this
+ prevents NMIs from being properly handled.
+
+M046 11/8/90 HKN exepatch.asm added support for a 4th version of exepacked
+ files.
+
+M047 11/14/90 HKN msproc.asm if a com file fails to load into a UMB
+ because it's too big de-allocate that UMB.
+ Also ensure 256 bytes of stack space for the
+ com file it it loads in a block < 64k
+
+M048 11/14/90 HKN misc2.asm acccess FILE_UCASE_TAB using DS.
+ mscode.asm set up ds using getdseg instead of context ds
+ in cal_lk
+ time.asm set up ds using getdseg instead of context ds
+ in date16.
+
+
+M049 12/3/90 HKN file.asm If access_denied is obtained whle trying to
+ create a temp file, check to see if this was
+ due to the network drive being read only.
+
+M050 12/18/90 SMR MSPROC.ASM Made Lie table search case insensitive.
+
+M060 01/02/90 JAH msinit.asm Removed lie table from kernal and use a
+ msproc.asm dword ptr in dosdata to locate it.
+
+M061 01/16/91 HKN alloc.asm In GetLastArena, if linking in UMBs check to
+ make sure that umb_head arena is valid and
+ also make sure that the previous arena is
+ pointing to umb_head.
+
+M062 01/22/91 HKN mscode.asm save and restore the umb_head arena at
+ dostab.asm win startup and exit time for win ver < 3.1.
+
+M063 01/23/91 HKN msproc.asm Modified UMB support. If the HIGH_ONLY bit is
+ set on entry do not try to load low if there
+ is no space in UMBs.
+ msconst.asm Variable AllocMsave.
+
+M064 01/23/91 HKN alloc.asm allow HIGH_ONLY bit to be set by a call to
+ set allloc strategy.
+ 02/04/91 HKN alloc.asm use STRAT_MASK to mask out bits 6 & 7 of
+ bx in AllocSetStrat.
+
+M065 01/24/91 SMR DISK.ASM B#5276. UPdated xfer address & xfer count
+ before retrying a raw read/write operation on
+ critical errors.
+
+M066 01/29/91 SMR MSCODE.ASM B#4984. Added SWITCHES=/W to suppress
+ mandatory loading of WINA20.386 from the
+ boot drive.
+
+M067 2/8/91 SR MSCODE.ASM Bug #5758. The VxD ptr was not getting nulled
+ out before a Windows startup request. So, if
+ one runs Win 3.0 and then runs Win 3.1, Win 3.1
+ will also be requested to load the Wina20
+ VxD unnecessarily. Now, we null out the ptr
+ whenever we get a Windows startup request and
+ set it only if version is less than Win 3.1.
+
+M068 01/13/91 HKN msdisp.asm Support for copy protected apps. Implemented
+ msproc.asm A20 turn off count mechanism.
+ msconst.asm Changed A20OFF_FLAG to A20OFF_COUNT. See M004
+ getset.asm Modified TURNOFF bit implentation to
+ alloc.asm A20OFF_COUNT implementation.
+ exepatch.asm Code to check for copy protected apps.
+ msinit.asm ChkCopyProt -> ret if DOS low.
+
+M069 2/14/91 SR file.asm Bug #5913. Changed the CreateTempFile function
+ to check for the value returned in EXTERR by
+ the redirector. We were previously checking
+ for the wrong value and so would hang on a
+ read-only share.
+
+M070 2/19/91 SR file.asm Bug #5943. Changed CreateTempFile function to
+ handle the case when the user fails on an
+ I24 e.g. on a write-protect error. We should
+ check for this extended error and not try to
+ create the file again.
+
+M071 02/20/91 HKN exepatch.asm use A20OFF_COUNT of 10 for copy protected
+ apps.
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dosmes.inc b/private/mvdm/dos/v86/doskrnl/dos/dosmes.inc
new file mode 100644
index 000000000..59967afea
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dosmes.inc
@@ -0,0 +1,288 @@
+; SCCSID = @(#)dosmes.asm 1.7 85/10/23
+; SCCSID = @(#)dosmes.asm 1.7 85/10/23
+;
+; Message file for Internationalized messages. There is
+; only one message here available for translation.
+;
+;
+; Revision history
+; A000 version 4.00 Jan. 1988
+;
+
+; -------- M I C R O S O F T K K ---------------------------------------------
+;
+; DOSMES.ASM - MODIFICATION LOG
+;
+;
+; Note: For more detailed information, see "MS-DOS 4.00 SOURCE CODE
+; MODIFICATION LOG"
+;
+; ------------------------------------------------------------------------------
+;
+; 01/11/89:MSKK01:yukini:dos-2:
+; default country information changed to JAPAN (from USA).
+;
+; -------- M I C R O S O F T K K ---------------------------------------------
+
+
+
+IFNDEF Rainbow
+Rainbow EQU FALSE
+ENDIF
+
+ .xlist
+ .xcref
+include dossym.inc
+include dosmac.inc
+include doscntry.inc
+ .cref
+ .list
+
+
+;hkn; moved to bottom of const2.asm to maintain offsets. previously in
+;hkn; CONSTANTS segment.
+;hkn;
+;hkn; CONSTANTS SEGMENT WORD PUBLIC 'CONST'
+;hkn;
+;hkn; PUBLIC UserNum, OEMNum
+;hkn; Public DMES001S,DMES001E
+;hkn; DMES001S Label byte
+;hkn; USERNUM DW ? ; 24 bit user number
+;hkn; DB ?
+;hkn; IF IBM
+;hkn; IF IBMCOPYRIGHT
+;hkn; OEMNUM DB 0 ; 8 bit OEM number
+;hkn; ELSE
+;hkn; OEMNUM DB 0FFH ; 8 bit OEM number
+;hkn; ENDIF
+;hkn; ELSE
+;hkn; OEMNUM DB 0FFH
+;hkn; ENDIF
+;hkn;
+;hkn;
+;hkn; DMES001E label byte
+;hkn; CONSTANTS ENDS
+
+DOSCODE Segment
+
+ Public DMES002S
+DMES002S label byte
+
+
+include divmes.inc
+include yesno.asm
+
+SUBTTL EDIT FUNCTION ASSIGNMENTS AND HEADERS
+PAGE
+; The following two tables implement the current buffered input editing
+; routines. The tables are pairwise associated in reverse order for ease
+; in indexing. That is; The first entry in ESCTAB corresponds to the last
+; entry in ESCFUNC, and the last entry in ESCTAB to the first entry in ESCFUNC.
+
+
+;hkn; TABLE SEGMENT
+ PUBLIC CANCHAR
+CANCHAR DB CANCEL ;Cancel line character
+ PUBLIC ESCCHAR
+ESCCHAR DB ESCCH ;Lead-in character for escape sequences
+ IF NOT Rainbow
+ESCTAB LABEL BYTE
+ IF NOT IBM
+ IF WANG
+ DB 0C0h ; ^Z inserter
+ DB 0C1H ; Copy one char
+ DB 0C1H ; Copy one char
+ DB 0C7H ; Skip one char
+ DB 08AH ; Copy to char
+ DB 088H ; Skip to char
+ DB 09AH ; Copy line
+ DB 0CBH ; Kill line (no change in template)
+ DB 08BH ; Reedit line (new template)
+ DB 0C3H ; Backspace
+ DB 0C6H ; Enter insert mode
+ DB 0D6H ; Exit insert mode
+ DB 0C6H ; Escape character
+ DB 0C6H ; End of table
+ ELSE
+ ; VT52 equivalences
+ DB "Z" ; ^Z inserter
+ DB "S" ; F1 Copy one char
+ DB "S" ; F1 Copy one char
+ DB "V" ; F4 Skip one char
+ DB "T" ; F2 Copy to char
+ DB "W" ; F5 Skip to char
+ DB "U" ; F3 Copy line
+ DB "E" ; SHIFT ERASE Kill line (no change in template)
+ DB "J" ; ERASE Reedit line (new template)
+ DB "D" ; LEFT Backspace
+ DB "P" ; BLUE Enter insert mode
+ DB "Q" ; RED Exit insert mode
+ DB "R" ; GRAY Escape character
+ DB "R" ; End of table
+ ENDIF
+ ENDIF
+ IF IBM
+ DB 64 ; Ctrl-Z - F6
+ DB 77 ; Copy one char - -->
+ DB 59 ; Copy one char - F1
+ DB 83 ; Skip one char - DEL
+ DB 60 ; Copy to char - F2
+ DB 62 ; Skip to char - F4
+ DB 61 ; Copy line - F3
+ DB 61 ; Kill line (no change to template ) - Not used
+ DB 63 ; Reedit line (new template) - F5
+ DB 75 ; Backspace - <--
+ DB 82 ; Enter insert mode - INS (toggle)
+ DB 82 ; Exit insert mode - INS (toggle)
+ DB 65 ; Escape character - F7
+ DB 65 ; End of table
+ ENDIF
+ESCEND LABEL BYTE
+ESCTABLEN EQU ESCEND-ESCTAB
+
+ESCFUNC LABEL WORD
+ short_addr GETCH ; Ignore the escape sequence
+ short_addr TWOESC
+ short_addr EXITINS
+ short_addr ENTERINS
+ short_addr BACKSP
+ short_addr REEDIT
+ short_addr KILNEW
+ short_addr COPYLIN
+ short_addr SKIPSTR
+ short_addr COPYSTR
+ short_addr SKIPONE
+ short_addr COPYONE
+ short_addr COPYONE
+ short_addr CTRLZ
+ ENDIF
+;hkn; TABLE ENDS
+
+;
+; OEMFunction key is expected to process a single function
+; key input from a device and dispatch to the proper
+; routines leaving all registers UNTOUCHED.
+;
+; Inputs: CS, SS are DOSGROUP
+; Outputs: None. This function is expected to JMP to one of
+; the following labels:
+;
+; GetCh - ignore the sequence
+; TwoEsc - insert an ESCChar in the buffer
+; ExitIns - toggle insert mode
+; EnterIns - toggle insert mode
+; BackSp - move backwards one space
+; ReEdit - reedit the line with a new template
+; KilNew - discard the current line and start from scratch
+; CopyLin - copy the rest of the template into the line
+; SkipStr - read the next character and skip to it in the template
+; CopyStr - read next char and copy from template to line until char
+; SkipOne - advance position in template one character
+; CopyOne - copy next character in template into line
+; CtrlZ - place a ^Z into the template
+; Registers that are allowed to be modified by this function are:
+; AX, CX, BP
+
+ASSUME CS:DOSCODE
+Procedure OEMFunctionKey,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING,SS:DOSDATA
+ IFDEF DBCS ;AN000;
+extrn IntCNE0:near ;AN000; 2/17/KK
+ CALL IntCNE0 ;AN000; 2/17/KK
+ ELSE ;AN000;
+ invoke $std_con_input_no_echo ; Get the second byte of the sequence
+ ENDIF ;AN000;
+ IF NOT Rainbow
+ MOV CL,ESCTABLEN ; length of table for scan
+ PUSH DI ; save DI (cannot change it!)
+
+;hkn; ESCTAB is in TABLE seg (DOSCODE)
+ MOV DI,OFFSET DOSCODE:ESCTAB ; offset of second byte table
+
+;hkn; ES should point to DOSCODE for the string scan
+;
+ push es
+ push cs
+ pop es
+
+ REPNE SCASB ; Look it up in the table
+;
+;hkn;Restore es
+ pop es
+
+ POP DI ; restore DI
+ SHL CX,1 ; convert byte offset to word
+ MOV BP,CX ; move to indexable register
+
+;hkn; ESCFUNC is in TABLE seg (DOSCODE)
+;hkn;Use CS override since bp contains an address in DOSCODE
+
+ JMP CS:[BP+OFFSET DOSCODE:ESCFUNC] ; Go to the right routine
+ ENDIF
+ IF Rainbow
+
+TransferIf MACRO value,address
+ local a
+ CMP AL,value
+ JNZ a
+ transfer address
+a:
+ENDM
+
+ CMP AL,'[' ; is it second lead char
+ JZ EatParm ; yes, go walk tree
+GoGetCh:
+ transfer GetCh ; no, ignore sequence
+EatParm:
+ invoke $std_con_input_no_echo ; get argument
+ CMP AL,'A' ; is it alphabetic arg?
+ JAE EatAlpha ; yes, go snarf one up
+ XOR BP,BP ; init digit counter
+ JMP InDigit ; jump into internal eat digit routine
+EatNum:
+ invoke $std_con_input_no_echo ; get next digit
+InDigit:
+ CMP AL,'9' ; still a digit?
+ JA CheckNumEnd ; no, go check for end char
+ SUB AL,'0' ; turn into potential digit
+ JL GoGetCh ; oops, not a digit, ignore
+ MOV CX,BP ; save BP for 10 multiply
+ CBW ; make AL into AX
+ SHL BP,1 ; 2*BP
+ SHL BP,1 ; 4*BP
+ ADD BP,CX ; 5*BP
+ SHL BP,1 ; 10*BP
+ ADD BP,AX ; 10*BP + digit
+ JMP EatNum ; continue with number
+CheckNumEnd:
+ CMP AL,7Eh ; is it end char ~
+ JNZ GoGetCh ; nope, ignore key sequence
+ MOV AX,BP
+ transferIf 1,SkipStr ; FIND key
+ transferIf 2,EnterIns ; INSERT HERE key
+ transferIf 3,SkipOne ; REMOVE
+ transferIf 4,CopyStr ; SELECT
+ transferIf 17,TwoEsc ; INTERRUPT
+ transferIf 18,ReEdit ; RESUME
+ transferIf 19,KilNew ; CANCEL
+ transferIf 21,CtrlZ ; EXIT
+ transferIf 29,CopyLin ; DO
+ JMP GoGetCh
+EatAlpha:
+ CMP AL,'O' ; is it O?
+ JA GoGetCh ; no, after assume bogus
+ JZ EatPQRS ; eat the rest of the bogus key
+ transferIf 'C',CopyOne ; RIGHT
+ transferIf 'D',BackSp ; LEFT
+ JMP GoGetCh
+EatPQRS:
+ invoke $std_con_input_no_echo ; eat char after O
+ JMP GoGetCh
+ ENDIF
+
+EndProc OEMFunctionKey
+
+DOSCODE ENDS
+
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dostab.asm b/private/mvdm/dos/v86/doskrnl/dos/dostab.asm
new file mode 100644
index 000000000..819102fd6
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dostab.asm
@@ -0,0 +1,853 @@
+;
+; Revision History
+; ================
+;
+; Sudeepb 12-Mar-1991 Ported for NTDOSEm
+;
+
+IFNDEF Rainbow
+Rainbow EQU FALSE
+ENDIF
+
+ .xlist
+ .xcref
+include dosmac.inc
+ .cref
+ .list
+
+DOSDATA Segment
+
+
+;
+; upper case table
+;
+UCASE_TAB label byte
+; ------------------------------------------------<MSKK01>----------------------
+ifdef DBCS
+ dw 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
+else
+ dw 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
+; ----------------------------------<MSKK01>----------------------
+endif
+
+;
+; file upper case table
+;
+FILE_UCASE_TAB label byte
+; ----------------------------------<MSKK01>----------------------
+ifdef DBCS
+ dw 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
+else
+ dw 128
+ db 128,154,069,065,142,065,143,128 ;M075
+ 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 ;M075
+ 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
+
+endif
+; ---------------------------------<MSKK01>----------------------
+
+;
+; file char list
+;
+FILE_CHAR_TAB label byte
+ dw 22 ; length
+ db 1,0,255 ; include all
+ db 0,0,20h ; exclude 0 - 20h
+ db 2,14,'."/\[]:|<>+=;,' ; exclude 14 special
+ db 24 dup (?) ; reserved
+;
+; collate table
+;
+COLLATE_TAB label byte
+; ---------------------------------<MSKK01>----------------------
+ifdef DBCS
+ ifdef JAPAN
+ dw 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
+ endif
+ ifdef TAIWAN
+ dw 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
+
+ endif
+ ifdef KOREA ;Keyl/MSCH
+ dw 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
+ endif
+else
+ dw 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
+endif
+
+
+; -------------------------------<MSKK01>----------------------
+
+;
+; dbcs is not supported in DOS 3.3
+; DBCS_TAB CC_DBCS <>
+;
+; DBCS for DOS 4.00 2/12/KK
+ PUBLIC DBCS_TAB
+DBCS_TAB label byte ;AN000; 2/12/KK
+; -------------------------------<MSKK01>----------------------
+ifdef DBCS
+ ifdef JAPAN
+ dw 6 ; <MSKK01>
+ db 081h,09fh ; <MSKK01>
+ db 0e0h,0fch ; <MSKK01>
+ db 0,0 ; <MSKK01>
+
+ db 0,0,0,0,0,0,0,0,0,0 ; <MSKK01>
+ endif
+ ifdef TAIWAN
+ dw 4 ; <TAIWAN>
+ db 081h,0FEh ; <TAIWAN>
+ db 0,0 ; <TAIWAN>
+
+ db 0,0,0,0,0,0,0,0,0,0,0,0
+ endif
+ ifdef KOREA ; Keyl
+ dw 4 ; <KOREA>
+ db 0A1h,0FEh ; <KOREA>
+ db 0,0 ; <KOREA>
+
+ db 0,0,0,0,0,0,0,0,0,0,0,0
+ endif
+else
+ dw 0 ;AN000; 2/12/KK max number
+ db 16 dup(0) ;AN000; 2/12/KK
+
+; dw 6 ; 2/12/KK
+; db 081h,09fh ; 2/12/KK
+; db 0e0h,0fch ; 2/12/KK
+; db 0,0 ; 2/12/KK
+;
+;
+endif
+; ---------------------------------<MSKK01>----------------------
+
+ASSUME CS:DOSDATA,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;CASE MAPPER ROUTINE FOR 80H-FFH character range, DOS 3.3
+; ENTRY: AL = Character to map
+; EXIT: AL = The converted character
+; Alters no registers except AL and flags.
+; The routine should do nothing to chars below 80H.
+;
+; Example:
+
+Procedure MAP_CASE,FAR
+ CMP AL,80H
+ JAE Map1 ;Map no chars below 80H ever
+ RET
+Map1:
+ SUB AL,80H ;Turn into index value
+ PUSH DS
+ PUSH BX
+ MOV BX,OFFSET DOSDATA:UCASE_TAB + 2
+FINISH:
+
+ PUSH CS ;Move to DS
+ POP DS
+ XLAT ds:[bx] ;Get upper case character
+ POP BX
+ POP DS
+L_RET: RET
+EndProc MAP_CASE
+
+
+
+;
+; The following pieces of data have been moved from the DOS 4 TABLE/CODE
+; segment and added at the end of the DOS data area.
+;
+
+
+; Moved from the TABLE segment in getset.asm
+
+ IF ALTVECT
+VECIN:
+; INPUT VECTORS
+Public GSET001S,GSET001E
+GSET001S label byte
+ DB 22H ; Terminate
+ DB 23H ; ^C
+ DB 24H ; Hard error
+ DB 28H ; Spooler
+LSTVEC DB ? ; ALL OTHER
+
+VECOUT:
+; GET MAPPED VECTOR
+ DB int_terminate
+ DB int_ctrl_c
+ DB int_fatal_abort
+ DB int_spooler
+LSTVEC2 DB ? ; Map to itself
+
+NUMVEC = VECOUT-VECIN
+GSET001E label byte
+ ENDIF
+
+; Moved from TABLE segment in ms_table.asm
+
+;---------------------------------------Start of Korean support 2/11/KK
+;
+; The varialbes for ECS version are moved here for the same data alignments
+; as IBM-DOS and MS-DOS.
+;
+
+ I_AM InterChar, byte ; Interim character flag ( 1= interim) ;AN000;
+ ;AN000;
+;------- NOTE: NEXT TWO BYTES SOMETIMES USED AS A WORD !! ---------------------
+DUMMY LABEL WORD ;AN000;
+ PUBLIC InterCon ; Console in Interim mode ( 1= interim) ;AN000;
+InterCon db 0 ;AN000;
+ PUBLIC SaveCurFlg ; Print, do not advance cursor flag ;AN000;
+SaveCurFlg db 0 ;AN000;
+;-----------------------------------------End of Korean support 2/11/KK
+
+
+ I_am TEMPSEG,WORD ;hkn; used to store ds.
+
+public redir_patch
+redir_patch db 0
+
+public Mark1
+ Mark1 label byte
+
+
+IF2
+ IF ((OFFSET MARK1) GT (OFFSET MSVERSION) )
+ %OUT !DATA CORRUPTION!MARK1 OFFSET TOO BIG. RE-ORGANIZE DATA.
+ ENDIF
+ENDIF
+
+;###########################################################################
+;
+; ** HACK FOR DOS 4.0 REDIR **
+;
+; The redir requires the following:
+;
+; MSVERS offset D12H
+; YRTAB offset D14H
+; MONTAB offset D1CH
+;
+; WARNING! WARNING!
+;
+; MARK1 SHOULD NOT BE >= 0D12H. IF SOME VARIABLE IS TO BE ADDED ABOVE DO SO
+; WITHOUT VIOLATING THIS AND UPDATE THE FOLL. LINE
+;
+; CURRENTLY MARK1 = 0D0DH
+;
+;##########################################################################
+
+ ORG 0d12h
+
+PUBLIC MSVERSION
+MSVERSION LABEL BYTE
+ DB MAJOR_VERSION
+ DB MINOR_VERSION
+
+; YRTAB & MONTAB moved from TABLE segment in ms_table.asm
+
+ I_am YRTAB,8,<200,166,200,165,200,165,200,165>
+ I_am MONTAB,12,<31,28,31,30,31,30,31,31,30,31,30,31>
+
+
+;----------------THE FOLL. BLOCK MOVED FROM TABLE SEG IN MS_TABLE.ASM-------
+
+; SYS init extended table, DOS 3.3 F.C. 5/29/86
+;
+ PUBLIC SysInitTable
+
+SysInitTable label byte
+ dw OFFSET DOSDATA:SYSINITVAR ; pointer to sysinit var
+ dw 0 ; segment
+ dw OFFSET DOSDATA:COUNTRY_CDPG ; pointer to country tabl
+ dw 0 ; segment of pointer
+
+
+;
+; DOS 3.3 F.C. 6/12/86
+; FASTOPEN communications area DOS 3.3 F.C. 5/29/86
+;
+ PUBLIC FastOpenTable
+ PUBLIC FastTable ; a better name
+ EXTRN FastRet:FAR ; defined in misc2.asm
+
+FastTable label byte ; a better name
+FastOpenTable label byte
+ dw 2 ; number of entries
+ dw OFFSET DOSCODE:FastRet ; pointer to ret instr.
+ dw 0 ; and will be modified by
+ dw OFFSET DOSCODE:FastRet ; FASTxxx when loaded in
+ dw 0
+;
+; DOS 3.3 F.C. 6/12/86
+;
+
+ PUBLIC FastFlg ; flags
+FastFlg label byte ; don't change the foll: order
+ I_am FastOpenFlg,BYTE,<0>
+; RMFS I_am FastSeekFlg,BYTE,<0>
+
+
+ PUBLIC FastOpen_Ext_Info
+
+; FastOpen_Ext_Info is used as a temporary storage for saving dirpos,dirsec
+; and clusnum which are filled by DOS 3.ncwhen calling FastOpen Insert
+; or filled by FastOPen when calling FastOpen Lookup
+
+FastOpen_Ext_Info label byte ;dirpos
+ db SIZE FASTOPEN_EXTENDED_INFO dup(0)
+
+; Dir_Info_Buff is a dir entry buffer which is filled by FastOPen
+; when calling FastOpen Lookup
+
+ PUBLIC Dir_Info_Buff
+
+Dir_Info_Buff label byte
+ db SIZE dir_entry dup (0)
+
+
+ I_am Next_Element_Start,WORD ; save next element start offset
+
+ I_am Del_ExtCluster,WORD ; for dos_delete
+
+
+; The following is a stack and its pointer for interrupt 2F which is uesd
+; by NLSFUNC. There is no significant use of this stack, we are just trying
+; not to destroy the INT 21 stack saved for the user.
+
+
+ PUBLIC USER_SP_2F
+
+USER_SP_2F LABEL WORD
+ dw OFFSET DOSDATA:FAKE_STACK_2F
+
+ PUBLIC Packet_Temp
+Packet_Temp label word ; temporary packet used by readtime
+ PUBLIC DOS_TEMP ; temporary word
+DOS_TEMP label word
+FAKE_STACK_2F dw 14 dup (0) ; 12 register temporary storage
+
+ PUBLIC Hash_Temp ; temporary word
+Hash_Temp label word
+ dw 4 dup (0) ; temporary hash table during config.sys
+
+ PUBLIC SCAN_FLAG ; flag to indicate key ALT_Q
+SCAN_FLAG label byte
+ db 0
+
+ PUBLIC DATE_FLAG
+DATE_FLAG label word ; flag to
+ dw 0 ; to update the date
+
+FETCHI_TAG label word ; OBSOLETE - no longer used
+ dw 0 ; formerly part of IBM's piracy protection
+
+
+ PUBLIC MSG_EXTERROR ; for system message addr
+MSG_EXTERROR label DWORD
+ dd 0 ; for extended error
+ dd 0 ; for parser
+ dd 0 ; for critical errror
+ dd 0 ; for IFS
+ dd 0 ; for code reduction
+
+ PUBLIC SEQ_SECTOR ; last sector read
+SEQ_SECTOR label DWORD
+ dd -1
+
+;; I_am ACT_PAGE,WORD,<-1> ; active EMS page
+ I_am SC_SECTOR_SIZE,WORD ; sector size for SC
+ I_am SC_DRIVE,BYTE ; drive # for secondary cache
+ I_am CurSC_DRIVE,BYTE,<-1> ; current SC drive
+ I_am CurSC_SECTOR,DWORD ; current SC starting sector
+ I_am SC_STATUS,WORD,<0> ; SC status word
+ I_am SC_FLAG,BYTE,<0> ; SC flag
+ I_am AbsDskErr,WORD,<0> ; Storage for Abs dsk read/write err
+
+ PUBLIC NO_NAME_ID
+NO_NAME_ID label byte
+ db 'NO NAME ' ; null media id
+
+;hkn; moved from TABLE segment in kstrin.asm
+
+Public KISTR001S,KISTR001E,LOOKSIZ ; 2/17/KK
+KISTR001S label byte ; 2/17/KK
+LOOKSIZ DB 0 ; 0 if byte, NZ if word 2/17/KK
+KISTR001E label byte ; 2/17/KK
+
+
+
+; the nul device driver used to be part of the code. However, since the
+; header is in the data, and the entry points are only given as an offset,
+; the strategy and interrupt entry points must also be in the data now.
+;
+
+procedure snuldev,far
+assume ds:nothing,es:nothing,ss:nothing, cs:dosdata
+ or es:[bx.reqstat],stdon ; set done bit
+entry inuldev
+ ret ; must not be a return!
+endproc snuldev
+
+;M044
+; Second part of save area for saving last para of Windows memory
+;
+public WinoldPatch2
+WinoldPatch2 db 8 dup (?) ; M044
+
+public UmbSave2, UmbSaveFlag ; M062
+UmbSave2 db 5 dup (?) ; M062
+UmbSaveFlag db 0 ; M062
+
+public Mark2
+ Mark2 label byte
+
+IF2
+ IF ((OFFSET MARK2) GT (OFFSET ERR_TABLE_21) )
+ %OUT !DATA CORRUPTION!MARK2 OFFSET TOO BIG. RE-ORGANIZE DATA.
+ ENDIF
+ENDIF
+
+
+;###########################################################################
+;
+; ** HACK FOR DOS 4.0 REDIR **
+;
+; The redir requires the following:
+;
+; ERR_TABLE_21 offset DDBH
+; ERR_TABLE_24 offset E5BH
+; ErrMap24 offset EABH
+;
+; WARNING! WARNING!
+;
+; MARK2 SHOULD NOT BE >= 0DDBH. IF SOME VARIABLE IS TO BE ADDED ABOVE DO SO
+; WITHOUT VIOLATING THIS AND UPDATE THE FOLL. LINE
+;
+; CURRENTLY MARK2 = 0DD0H
+;
+;##########################################################################
+
+
+
+ ORG 0ddbh
+;**
+;
+; The following table defines CLASS ACTION and LOCUS info for the INT 21H
+; errors. Each entry is 4 bytes long:
+;
+; Err#,Class,Action,Locus
+;
+; A value of 0FFh indicates a call specific value (ie. should already
+; be set). AN ERROR CODE NOT IN THE TABLE FALLS THROUGH TO THE CATCH ALL AT
+; THE END, IT IS ASSUMES THAT CLASS, ACTION, LOCUS IS ALREADY SET.
+;
+
+ErrTab Macro err,class,action,locus
+ifidn <locus>,<0FFh>
+ DB error_&err,errCLASS_&class,errACT_&action,0FFh
+ELSE
+ DB error_&err,errCLASS_&class,errACT_&action,errLOC_&locus
+ENDIF
+ENDM
+
+PUBLIC ERR_TABLE_21
+ERR_TABLE_21 LABEL BYTE
+ ErrTab invalid_function, Apperr, Abort, 0FFh
+ ErrTab file_not_found, NotFnd, User, Disk
+ ErrTab path_not_found, NotFnd, User, Disk
+ ErrTab too_many_open_files, OutRes, Abort, Unk
+ ErrTab access_denied, Auth, User, 0FFh
+ ErrTab invalid_handle, Apperr, Abort, Unk
+ ErrTab arena_trashed, Apperr, Panic, Mem
+ ErrTab not_enough_memory, OutRes, Abort, Mem
+ ErrTab invalid_block, Apperr, Abort, Mem
+ ErrTab bad_environment, Apperr, Abort, Mem
+ ErrTab bad_format, BadFmt, User, Unk
+ ErrTab invalid_access, Apperr, Abort, Unk
+ ErrTab invalid_data, BadFmt, Abort, Unk
+ ErrTab invalid_drive, NotFnd, User, Disk
+ ErrTab current_directory, Auth, User, Disk
+ ErrTab not_same_device, Unk, User, Disk
+ ErrTab no_more_files, NotFnd, User, Disk
+ ErrTab file_exists, Already, User, Disk
+ ErrTab sharing_violation, Locked, DlyRet, Disk
+ ErrTab lock_violation, Locked, DlyRet, Disk
+ ErrTab out_of_structures, OutRes, Abort, 0FFh
+ ErrTab invalid_password, Auth, User, Unk
+ ErrTab cannot_make, OutRes, Abort, Disk
+ ErrTab Not_supported, BadFmt, User, Net
+ ErrTab Already_assigned, Already, User, Net
+ ErrTab Invalid_Parameter, BadFmt, User, Unk
+ ErrTab FAIL_I24, Unk, Abort, Unk
+ ErrTab Sharing_buffer_exceeded,OutRes, Abort, Mem
+ ErrTab Handle_EOF, OutRes, Abort, Unk ;AN000;
+ ErrTab Handle_DISK_FULL, OutRes, Abort, Unk ;AN000;
+ ErrTab sys_comp_not_loaded, Unk, Abort, Disk ;AN001;
+ DB 0FFh, 0FFH, 0FFH, 0FFh
+
+;
+; The following table defines CLASS ACTION and LOCUS info for the INT 24H
+; errors. Each entry is 4 bytes long:
+;
+; Err#,Class,Action,Locus
+;
+; A Locus value of 0FFh indicates a call specific value (ie. should already
+; be set). AN ERROR CODE NOT IN THE TABLE FALLS THROUGH TO THE CATCH ALL AT
+; THE END.
+
+PUBLIC ERR_TABLE_24
+ERR_TABLE_24 LABEL BYTE
+ ErrTab write_protect, Media, IntRet, Disk
+ ErrTab bad_unit, Intrn, Panic, Unk
+ ErrTab not_ready, HrdFail, IntRet, 0FFh
+ ErrTab bad_command, Intrn, Panic, Unk
+ ErrTab CRC, Media, Abort, Disk
+ ErrTab bad_length, Intrn, Panic, Unk
+ ErrTab Seek, HrdFail, Retry, Disk
+ ErrTab not_DOS_disk, Media, IntRet, Disk
+ ErrTab sector_not_found, Media, Abort, Disk
+ ErrTab out_of_paper, TempSit, IntRet, SerDev
+ ErrTab write_fault, HrdFail, Abort, 0FFh
+ ErrTab read_fault, HrdFail, Abort, 0FFh
+ ErrTab gen_failure, Unk, Abort, 0FFh
+ ErrTab sharing_violation, Locked, DlyRet, Disk
+ ErrTab lock_violation, Locked, DlyRet, Disk
+ ErrTab wrong_disk, Media, IntRet, Disk
+ ErrTab not_supported, BadFmt, User, Net
+ ErrTab FCB_unavailable, Apperr, Abort, Unk
+ ErrTab Sharing_buffer_exceeded,OutRes, Abort, Mem
+ DB 0FFh, errCLASS_Unk, errACT_Panic, 0FFh
+
+;
+; We need to map old int 24 errors and device driver errors into the new set
+; of errors. The following table is indexed by the new errors
+;
+Public ErrMap24
+ErrMap24 Label BYTE
+ DB error_write_protect ; 0
+ DB error_bad_unit ; 1
+ DB error_not_ready ; 2
+ DB error_bad_command ; 3
+ DB error_CRC ; 4
+ DB error_bad_length ; 5
+ DB error_Seek ; 6
+ DB error_not_DOS_disk ; 7
+ DB error_sector_not_found ; 8
+ DB error_out_of_paper ; 9
+ DB error_write_fault ; A
+ DB error_read_fault ; B
+ DB error_gen_failure ; C
+ DB error_gen_failure ; D RESERVED
+ DB error_gen_failure ; E RESERVED
+ DB error_wrong_disk ; F
+
+Public ErrMap24End
+ErrMap24End LABEL BYTE
+
+
+
+ I_am FIRST_BUFF_ADDR,WORD ; first buffer address
+ I_am SPECIAL_VERSION,WORD,<0> ;AN006; used by INT 2F 47H
+ I_am FAKE_COUNT,<255> ;AN008; fake version count
+
+ I_am OLD_FIRSTCLUS,WORD ;AN011; save old first cluster for fastopen
+
+;----------------------------------------------------------------------------
+
+;SR;
+; WIN386 instance table for DOS
+;
+public Win386_Info
+Win386_Info db 3, 0
+ dd 0, 0, 0
+ dw offset dosdata:Instance_Table, 0
+
+
+public Instance_Table
+Instance_Table dw offset dosdata:contpos, 0, 2
+ dw offset dosdata:bcon, 0, 4
+ dw offset dosdata:carpos, 0, 106h
+ dw offset dosdata:charco, 0, 1
+ dw offset dosdata:exec_init_sp, 0, 24
+ dw offset dosdata:umbflag,0,1 ; M019
+ dw offset dosdata:umb_head,0,2 ; M019
+ dw 0, 0
+
+; M001; SR;
+; M001; On DOSMGR call ( cx == 0 ), we need to return a table of offsets of
+; M001; some DOS variables. Note that the only really important variable in
+; M001; this is User_Id. The other variables are needed only to patch stuff
+; M001; which does not need to be done in DOS 5.0.
+; M001;
+public Win386_DOSVars
+Win386_DOSVars db 5 ;Major version 5 ; M001
+ db 0 ;Minor version 0 ; M001
+ dw offset dosdata:SaveDS ; M001
+ dw offset dosdata:SaveBX ; M001
+ dw offset dosdata:Indos ; M001
+ dw offset dosdata:User_id ; M001
+ dw offset dosdata:CritPatch ; M001
+ dw offset dosdata:UMB_Head ; M012
+
+;SR;
+; Flag to indicate whether WIN386 is running or not
+;
+public IsWin386
+IsWin386 db 0
+
+;M018
+; This variable contains the path to the VxD device needed for Win386
+;
+public VxDpath ;M018
+VxDpath db 'c:\wina20.386',0 ;M018
+
+;
+;End WIN386 support
+;
+
+;SR;
+; These variables have been added for the special lie support for device
+;drivers.
+;
+ public DriverLoad
+ public BiosDataPtr
+DriverLoad db 1 ;initialized to do special handling
+BiosDataPtr dd ?
+
+
+;------------------------------------------------------------------------
+; Patch for Sidekick
+;
+; A documented method for finding the offset of the Errormode flag in the
+; dos swappable data area if for the app to scan in the dos segment (data)
+; for the following sequence of instructions.
+;
+; Ref: Part C, Artice 11, pg 356 of MSDOS Encyclopedia
+;
+; The Offset of Errormode flag is 0320h
+;
+;------------------------------------------------------------------------
+
+
+ db 036h, 0F6h, 06h, 020h, 03h, 0FFh ; test ss:[errormode], -1
+ db 075h, 0ch ; jnz NearLabel
+ db 036h, 0ffh, 036h, 058h, 03h ; push ss:[NearWord]
+ db 0cdh, 028h ; int 28h
+
+;--------------------------------------------------------------------------
+; Patch for PortOfEntry - M036
+;
+; PortOfEntry by Sector Technology uses an un documented way of determining
+; the offset of Errormode flag. The following patch is to support them in
+; DOS 5.0. The corresponding code is actually in msdisp.asm
+;
+;---------------------------------------------------------------------------
+
+ db 080h, 03eh, 020h, 03h, 00h ; cmp [errormode], 0
+ db 075h, 037h ; jnz NearLabel
+ db 0bch, 0a0h, 0ah ; mov sp, dosdata:iostack
+
+;
+;*** New FCB Implementation
+; This variable is used as a cache in the new FCB implementation to remember
+;the address of a local SFT that can be recycled for a regenerate operation
+;
+
+public LocalSFT
+LocalSFT dd 0 ;0 to indicate invalid pointer
+
+DOSDATA ENDS
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/dup.asm b/private/mvdm/dos/v86/doskrnl/dos/dup.asm
new file mode 100644
index 000000000..68a3b9b0b
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/dup.asm
@@ -0,0 +1,75 @@
+ TITLE DOS_DUP - Internal SFT DUP (for network SFTs)
+ NAME DOS_DUP
+
+;** Low level DUP routine for use by EXEC when creating a new process. Exports
+; the DUP to the server machine and increments the SFT ref count
+;
+; DOS_DUP
+;
+; Modification history:
+;
+; Created: ARR 30 March 1983
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ .cref
+ .list
+
+ i_need THISSFT,DWORD
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ allow_getdseg
+
+BREAK <DOS_DUP -- DUP SFT across network>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DOS_DUP
+;
+; Inputs:
+; [THISSFT] set to the SFT for the file being DUPed
+; (a non net SFT is OK, in this case the ref
+; count is simply incremented)
+; Function:
+; Signal to the devices that alogical open is occurring
+; Returns:
+; ES:DI point to SFT
+; Carry clear
+; SFT ref_count is incremented
+; Registers modified: None.
+; NOTE:
+; This routine is called from $CREATE_PROCESS_DATA_BLOCK at DOSINIT
+; time with SS NOT DOSGROUP. There will be no Network handles at
+; that time.
+
+procedure DOS_DUP,NEAR
+
+ ASSUME SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+ LES DI,ThisSFT
+ assume es:nothing
+
+ Entry Dos_Dup_Direct
+ Assert ISSFT,<ES,DI>,"DOSDup"
+ invoke IsSFTNet
+ JNZ DO_INC
+ invoke DEV_OPEN_SFT
+DO_INC:
+ Assert ISSFT,<ES,DI>,"DOSDup/DoInc"
+ INC ES:[DI.sf_ref_count] ; Clears carry (if this ever wraps
+ ; we're in big trouble anyway)
+ return
+
+EndProc DOS_DUP
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/exepatch.asm b/private/mvdm/dos/v86/doskrnl/dos/exepatch.asm
new file mode 100644
index 000000000..81ef58a8d
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/exepatch.asm
@@ -0,0 +1,1047 @@
+
+;** EXEPATCH.ASM
+;
+; Contains the foll:
+;
+; - code to find and overlay buggy unpack code
+; - new code to be overlayed on buggy unpack code
+; - old code sequence to identify buggy unpack code
+;
+; Revision history:
+;
+; Created: 5/14/90
+;
+;
+;
+;----------------------------------------------------------------------------
+;
+; M020 : Fix for rational bug - for details see routine header
+; M028 : 4b04 implementation
+; M030 : Fixing bug in EXEPACKPATCH (EXEC_CS is an un-relocated value)
+; M032 : set turnoff bit only if DOS in HMA.
+; M033 : if IP < 2 then not exepacked.
+; M046 : support for a 4th version of exepacked files.
+; M068 : support for copy protected apps.
+; M071 : use A20OFF_COUNT of 10.
+;
+;----------------------------------------------------------------------------
+;
+.XLIST
+.XCREF
+
+INCLUDE version.inc
+INCLUDE dosseg.inc
+INCLUDE DOSSYM.INC
+INCLUDE exe.inc
+INCLUDE PDB.INC
+
+.CREF
+.LIST
+
+
+ public exepatch
+ public RationalPatch ; M020
+ public IsCopyProt
+
+PATCH1_COM_OFFSET EQU 06CH
+PATCH1_OFFSET EQU 028H
+PATCH1_CHKSUM EQU 0EF4EH
+CHKSUM1_LEN EQU 11CH/2
+
+PATCH2_COM_OFFSET EQU 076H
+PATCH2_OFFSET EQU 032H
+
+ ; The strings that start at offset 076h have two possible
+ ; check sums that are defined as PATCH2_CHKSUM PATCH2A_CHKSUM
+
+PATCH2_CHKSUM EQU 78B2H
+CHKSUM2_LEN EQU 119H/2
+PATCH2A_CHKSUM EQU 1C47H ; M046
+CHKSUM2A_LEN EQU 103H/2 ; M046
+
+PATCH3_COM_OFFSET EQU 074H
+PATCH3_OFFSET EQU 032H
+PATCH3_CHKSUM EQU 4EDEH
+CHKSUM3_LEN EQU 117H/2
+
+
+
+
+DOSDATA SEGMENT
+
+; EXTRN exec_signature :WORD ; Must contain 4D5A (yay zibo!)
+
+; EXTRN exec_init_IP :WORD ; IP of entry
+; EXTRN exec_init_CS :WORD ; CS of entry
+
+ EXTRN UNPACK_OFFSET :WORD
+ EXTRN RatBugCode :FAR
+ EXTRN RationalPatchPtr:word
+ EXTRN fixexepatch :word ; M028
+ EXTRN Special_Version :word ; M028
+; EXTRN A20OFF_FLAG :byte
+ extrn DosHasHMA :byte
+ extrn A20OFF_COUNT :byte ; M068
+ extrn A20OFF_PSP :word ; M068
+ extrn DOS_FLAG :byte ; M068
+
+DOSDATA ENDS
+
+
+DOSCODE SEGMENT
+
+; M028 - BEGIN
+
+ EXTRN Scan_Execname1:near
+ EXTRN Scan_Special_Entries:near
+
+ ASSUME CS:DOSCODE, SS:DOSDATA
+
+ public ExecReady
+
+;-------------------------------------------------------------------------
+;
+; Procedure Name : ExecReady
+;
+; Input : DS:DX -> ERStruc (see exe.inc)
+;
+;--------------------------------------------------------------------------
+
+ExecReady proc near
+
+ mov si, dx ; move the pointer into a friendly one
+ test [si].ER_Flags, ER_EXE ; COM or EXE ?
+ jz er_setver ; only setver for .COM files
+
+ mov ax, [si].ER_PSP
+ add ax, 10h
+ mov es, ax
+
+ mov cx, word ptr ds:[si].ER_StartAddr ; M030
+ mov ax, word ptr ds:[si+2].ER_StartAddr ; M030
+
+ call [fixexepatch]
+er_setver:
+ ; Q: is this an overlay
+ test [si].ER_Flags, ER_OVERLAY
+ jnz er_chkdoshi ; Y: set A20OFF_COUNT if DOS high
+ ; N: set up lie version first
+ push ds
+ push si
+ lds si, [si].ER_ProgName
+ call Scan_Execname1
+ call Scan_Special_Entries
+ pop si
+ pop ds
+ mov es, [si].ER_PSP
+ mov ax, Special_Version
+ mov es:[0].PDB_Version, ax
+er_chkdoshi:
+ cmp [DosHasHMA], 0 ; M032: Q: is dos in HMA (M021)
+ je er_done ; M032: N: done
+
+ ; M068 - Start
+ mov ax, [si].ER_PSP ; ax = PSP
+
+ or [DOS_FLAG], EXECA20OFF ; Set bit to signal int 21
+ ; ah = 25 & ah= 49. See dossym.inc
+ ; under TAG M003 & M009 for
+ ; explanation
+
+ test [si].ER_Flags, ER_EXE ; Q: COM file
+ jnz er_setA20 ; N: inc a20off_count , set
+ ; a20off_psp and ret
+ push ds
+ mov ds, ax ; DS = load segment of com file.
+ call IsCopyProt ; check if copy protected
+ pop ds
+
+er_seta20:
+
+ ;
+ ; We need to inc the A20OFF_COUNT here. Note that if the count
+ ; is non-zero at this point it indicates that the A20 is to be
+ ; turned off for that many int 21 calls made by the app. In
+ ; addition the A20 has to be turned off when we exit from this
+ ; call. Hence the inc.
+ ;
+
+ inc [A20OFF_COUNT]
+ mov [A20OFF_PSP], ax ; set the PSP for which A20 is to be
+ ; turned OFF.
+er_done: ; M068 - End
+ xor ax, ax
+ ret
+ExecReady endp
+
+; M028 - END
+
+public exepatch_start
+exepatch_start label byte
+
+ ;
+ ; The following is the code that'll be layed over the buggy unpack
+ ; code.
+ ;
+str1 label byte
+
+ db 06h ;push es
+ db 8Ch, 0D8h ;mov ax,ds
+
+first_stop equ $ - str1
+
+ db 2Bh, 0C2h ;sub ax, dx
+
+first label byte
+
+ db 8Eh, 0D8h ;mov ds,ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh, 00h ;mov di,000FH
+ db 57h ;push di
+ db 0B9h, 10h, 00h ;mov cx,0010H
+ db 0B0h, 0FFh ;mov al,0FFH
+ db 0F3h, 0AEh ;repz scasb
+ db 47h ;inc di
+ db 8Bh, 0F7h ;mov si,di
+ db 5Fh ;pop di
+ db 58h ;pop ax
+
+second_stop equ $ - first
+
+ db 2Bh, 0C2h ;sub ax, dx
+
+second label byte
+
+ db 8Eh, 0C0h ;mov es,ax
+ ;NextRec:
+ db 0B9h, 04h, 02h ;mov cx, 0204h
+ ;norm_agn:
+ db 8Bh, 0C6h ;mov ax,si
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 13h ;jz SI_ok
+ db 8Ch, 0DAh ;mov dx,ds
+ db 83h, 0CEh, 0F0h ;or si,0FFF0H
+ db 2Bh, 0D0h ;sub dx,ax
+ db 73h, 08h ;jnc SItoDS
+ db 0F7h, 0DAh ;neg dx
+ db 0D3h, 0E2h ;shl dx,cl
+ db 2Bh, 0F2h ;sub si,dx
+ db 33h, 0D2h ;xor dx,dx
+ ;SItoDS:
+ db 8Eh, 0DAh ;mov ds,dx
+ ;SI_ok:
+ db 87h, 0F7h ;xchg si,di
+ db 1Eh ;push ds
+ db 06h ;push es
+ db 1Fh ;pop ds
+ db 07h ;pop es
+ db 0FEh, 0CDh ;dec ch
+ db 75h, 0DBh ;jnz norm_agn
+ db 0ACh ;lodsb
+ db 92h ;xchg dx,ax
+ db 4Eh ;dec si
+ db 0ADh ;lodsw
+ db 8Bh, 0C8h ;mov cx,ax
+ db 46h ;inc si
+ db 8Ah, 0C2h ;mov al,dl
+ db 24h, 0FEh ;and al,0FEH
+ db 3Ch, 0B0h ;cmp al,RPTREC
+ db 75h, 05h ;jne TryEnum
+ db 0ACh ;lodsb
+ db 0F3h, 0AAh ;rep stosb
+
+; db 0EBh, 07h, 90h ;jmp TryNext
+ db 0EBh, 06h ;jmp TryNext
+
+ ;TryEnum:
+ db 3Ch, 0B2h ;cmp al,ENMREC
+ db 75h, 6Ch ;jne CorruptExe
+ db 0F3h, 0A4h ;rep movsb
+ ;TryNext:
+
+ db 92h ;xchg dx,ax
+; db 8Ah, 0C2h ;mov al,dl
+
+ db 0A8h, 01h ;test al,1
+ db 74h, 0B9h ;jz NextRec
+ db 90h, 90h ;nop, nop
+
+
+last_stop equ $ - second
+size_str1 equ $-str1
+
+
+ ;
+ ; The following is the code that we need to look for in the exe
+ ; file.
+ ;
+scan_patch1 label byte
+
+ db 8Ch, 0C3h ;mov bx,es
+ db 8Ch, 0D8h ;mov ax,ds
+ db 2Bh, 0C2h ;sub ax, dx
+ db 8Eh, 0D8h ;mov ds,ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh,00h ;mov di,000FH
+ db 0B9h, 10h, 00h ;mov cx,0010H
+ db 0B0h, 0FFh ;mov al,0FFH
+ db 0F3h, 0AEh ;repz scasb
+ db 47h ;inc di
+ db 8Bh, 0F7h ;mov si,di
+ db 8Bh, 0C3h ;mov ax,bx
+ db 2Bh, 0C2h ;sub ax, dx
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0fh,00h ;mov di,000FH
+ ;NextRec:
+ db 0B1h, 04h ;mov cl,4
+ db 8Bh, 0C6h ;mov ax,si
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 09h ;jz SI_ok
+ db 8Ch, 0DAh ;mov dx,ds
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0DAh ;mov ds,dx
+ db 83h, 0CEh, 0F0h ;or si,0FFF0H
+ ;SI_ok:
+ db 8Bh, 0C7h ;mov ax,di
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 09h ;jz DI_ok
+ db 8Ch, 0C2h ;mov dx,es
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0C2h ;mov es,dx
+ db 83h, 0CFh, 0F0h ;or di,0FFF0H
+ ;DI_ok:
+
+size_scan_patch1 equ $-scan_patch1
+
+
+scan_patch2 label byte
+
+
+ db 8Ch, 0C3h ;mov bx,es
+ db 8Ch, 0D8h ;mov ax,ds
+ db 48h ;dec ax
+ db 8Eh, 0D8h ;mov ds,ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh, 00h ;mov di,000FH
+ db 0B9h, 10h, 00h ;mov cx,0010H
+ db 0B0h, 0FFh ;mov al,0FFH
+ db 0F3h, 0AEh ;repz scasb
+ db 47h ;inc di
+ db 8Bh, 0F7h ;mov si,di
+ db 8Bh, 0C3h ;mov ax,bx
+ db 48h ;dec ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh, 00h ;mov di,000FH
+ ;NextRec:
+ db 0B1h, 04h ;mov cl,4
+ db 8Bh, 0C6h ;mov ax,si
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 0Ah ;jz SI_ok
+ db 8Ch, 0DAh ;mov dx,ds
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0DAh ;mov ds,dx
+ db 81h, 0CEh, 0F0h, 0FFh
+ ;or si,0FFF0H
+ ;SI_ok:
+ db 8Bh, 0C7h ;mov ax,di
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 0Ah ;jz DI_ok
+ db 8Ch, 0C2h ;mov dx,es
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0C2h ;mov es,dx
+ db 81h, 0CFh, 0F0h, 0FFh
+ ;or di,0FFF0H
+ ;DI_ok:
+
+
+size_scan_patch2 equ $-scan_patch2
+
+
+scan_patch3 label byte
+
+
+ db 8Ch, 0C3h ;mov bx,es
+ db 8Ch, 0D8h ;mov ax,ds
+ db 48h ;dec ax
+ db 8Eh, 0D8h ;mov ds,ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh, 00h ;mov di,000FH
+ db 0B9h, 10h, 00h ;mov cx,0010H
+ db 0B0h, 0FFh ;mov al,0FFH
+ db 0F3h, 0AEh ;repz scasb
+ db 47h ;inc di
+ db 8Bh, 0F7h ;mov si,di
+ db 8Bh, 0C3h ;mov ax,bx
+ db 48h ;dec ax
+ db 8Eh, 0C0h ;mov es,ax
+ db 0BFh, 0Fh, 00h ;mov di,000FH
+ ;NextRec:
+ db 0B1h, 04h ;mov cl,4
+ db 8Bh, 0C6h ;mov ax,si
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 09h ;jz SI_ok
+ db 8Ch, 0DAh ;mov dx,ds
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0DAh ;mov ds,dx
+ db 83h, 0CEh, 0F0h ;or si,0FFF0H
+ ;SI_ok:
+ db 8Bh, 0C7h ;mov ax,di
+ db 0F7h, 0D0h ;not ax
+ db 0D3h, 0E8h ;shr ax,cl
+ db 74h, 09h ;jz DI_ok
+ db 8Ch, 0C2h ;mov dx,es
+ db 2Bh, 0D0h ;sub dx,ax
+ db 8Eh, 0C2h ;mov es,dx
+ db 83h, 0CFh, 0F0h ;or di,0FFF0H
+ ;DI_ok:
+
+
+size_scan_patch3 equ $-scan_patch3
+
+
+scan_com label byte
+
+ db 0ACh ;lodsb
+ db 8Ah, 0D0h ;mov dl,al
+ db 4Eh ;dec si
+ db 0ADh ;lodsw
+ db 8Bh, 0C8h ;mov cx,ax
+ db 46h ;inc si
+ db 8Ah, 0C2h ;mov al,dl
+ db 24h, 0FEh ;and al,0FEH
+ db 3Ch, 0B0h ;cmp al,RPTREC
+ db 75h, 06h ;jne TryEnum
+ db 0ACh ;lodsb
+ db 0F3h, 0AAh ;rep stosb
+ db 0EBh, 07h, 90h ;jmp TryNext
+ ;TryEnum:
+ db 3Ch, 0B2h ;cmp al,ENMREC
+ db 75h, 6Bh ;jne CorruptExe
+ db 0F3h, 0A4h ;rep movsb
+ ;TryNext:
+ db 8Ah, 0C2h ;mov al,dl
+ db 0A8h, 01h ;test al,1
+; db 74h, 0BAh ;jz NextRec
+
+size_scan_com equ $-scan_com
+
+ExePatch proc near
+ call ExePackPatch
+ call word ptr RationalPatchPtr
+ ret
+ExePatch endp
+
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : ExePackPatch
+;
+; Inputs : DS -> DOSDATA
+; ES:0 -> read in image
+; ax:cx = start cs:ip of program
+; Output :
+;
+; 1. If ES <= 0fffh
+; 2. if exepack signature ('RB') found
+; 3. if common code to patch compares (for 3 diff. versions)
+; 4. if rest of the code & checksum compares
+; 5. overlay buggy code with code in
+; doscode:str1.
+; 6. endif
+; 7. endif
+; 8. endif
+; 9. endif
+;
+;
+; Uses : NONE
+;
+;---------------------------------------------------------------------------
+
+
+ExePackPatch proc near
+
+ push bx
+ mov bx, es ; bx has load segment
+ cmp bx, 0fffh ; Q: is the load segment > 64K
+ jbe ep_cont ; N:
+ pop bx ; Y: no need to patch
+ ret
+
+ep_cont:
+ push ds
+ push es
+ push ax
+ push cx
+ push si
+ push di
+
+ ; M033 - start
+ ; exepacked prgrams have an IP of 12h (>=2)
+
+ sub cx, 2 ; Q: is IP >=2
+ ljc ep_notpacked ; N: exit
+ ; ax:cx now points to location of
+ ; 'RB' if this is an exepacked file.
+
+ ; M033 - end
+
+ mov di, cx
+ mov es, ax
+ mov [unpack_offset], di ; save pointer to 'RB' in
+ ; unpack_offset
+
+
+ cmp word ptr es:[di], 'BR'
+ ljne ep_notpacked
+
+ push cs
+ pop ds ; set ds to cs
+ assume ds:nothing
+
+ add di, PATCH1_COM_OFFSET ; es:di -> points to place in packed
+ ; file where we hope to find
+ ; scan string.
+
+ call chk_common_str ; check for match
+
+ jnz ep_chkpatch2 ; Q: does the patch match
+ ; N: check at patch2_offset
+ ; Y: check for rest of patch string
+
+ mov si, offset DOSCODE:scan_patch1
+ ; ds:si -> scan string
+ mov di, [unpack_offset] ; restore di to point to 'RB'
+
+ add di, PATCH1_OFFSET ; es:di -> points to place in packed
+ ; file where we hope to find
+ ; scan string.
+ mov cx, size_scan_patch1
+ mov bx, CHKSUM1_LEN
+ mov ax, PATCH1_CHKSUM
+ call chk_patchsum ; check if patch and chk sum compare
+ jc ep_done1 ; Q: did we pass the test
+ ; N: exit
+ ; Y: overlay code with new
+
+ mov si, offset DOSCODE:str1
+ mov cx, size_str1
+
+rep movsb
+
+
+ep_done1:
+ jmp ep_done
+
+
+ep_chkpatch2:
+ mov di, PATCH2_COM_OFFSET ; es:di -> possible loaction of patch
+ ; in another version of unpack
+ call chk_common_str ; check for match
+
+ jnz ep_chkpatch3 ; Q: does the patch match
+ ; N: check for patch3_offset
+ ; Y: check for rest of patch string
+
+ mov si, offset DOSCODE:scan_patch2
+ ; ds:si -> scan string
+
+ mov di, PATCH2_OFFSET ; es:di -> points to place in packed
+ ; file where we hope to find
+ ; scan string.
+ mov cx, size_scan_patch2
+ mov bx, CHKSUM2_LEN
+ mov ax, PATCH2_CHKSUM
+ call chk_patchsum ; check if patch and chk sum compare
+
+ ; M046 - Start
+ ; Q: did we pass the test
+ jnc ep_patchcode2 ; Y: overlay code with new
+ ; N: try with a different chksum
+
+
+ mov si, offset DOSCODE:scan_patch2
+ ; ds:si -> scan string
+ mov cx, size_scan_patch2
+ mov bx, CHKSUM2A_LEN
+ mov ax, PATCH2A_CHKSUM
+ call chk_patchsum ; check if patch and chk sum compare
+ ; Q: did we pass the test
+ jc ep_notpacked ; N: try with a different chksum
+ ; Y: overlay code with new
+
+ep_patchcode2: ; M046 - End
+ mov si, offset DOSCODE:str1
+ mov cx, first_stop
+
+rep movsb
+
+ mov ax, 4890h ; ax = opcodes for dec ax, nop
+ stosw
+ add si, 2
+
+ mov cx, second_stop
+
+rep movsb
+
+ stosw ; put in dec ax and nop
+ add si, 2
+
+ mov cx, last_stop
+
+rep movsb
+
+ jmp short ep_done
+
+ep_chkpatch3:
+
+ mov di, PATCH3_COM_OFFSET ; es:di -> possible loaction of patch
+ ; in another version of unpack
+ call chk_common_str ; check for match
+
+ jnz ep_notpacked ; Q: does the patch match
+ ; N: exit
+ ; Y: check for rest of patch string
+
+
+ mov si, offset DOSCODE:scan_patch3
+ ; ds:si -> scan string
+
+ mov di, PATCH3_OFFSET ; es:di -> points to place in packed
+ ; file where we hope to find
+ ; scan string.
+ mov cx, size_scan_patch3
+ mov bx, CHKSUM3_LEN
+ mov ax, PATCH3_CHKSUM
+ call chk_patchsum ; check if patch and chk sum compare
+ jc ep_notpacked ; Q: did we pass the test
+ ; N: exit
+ ; Y: overlay code with new
+
+ mov si, offset DOSCODE:str1
+ mov cx, first_stop
+
+rep movsb
+
+ mov al, 48h ; al = opcode for dec ax
+ stosb
+ add si, 2
+
+ mov cx, second_stop
+
+rep movsb
+
+ stosb ; put in dec ax
+ add si, 2
+
+ mov cx, last_stop
+
+rep movsb
+
+
+
+ep_notpacked:
+
+; stc
+;
+
+ep_done:
+
+ pop di
+ pop si
+ pop cx
+ pop ax
+ pop es
+ pop ds
+ pop bx
+ ret
+
+;-------------------------------------------------------------------------
+;
+; Procedure Name : chk_common_str
+;
+; Input : DS = DOSCODE
+; ; ES:DI points to string in packed file
+;
+; Output ; Z if match else NZ
+;
+;-----------------------------------------------------------------------
+
+chk_common_str proc near
+
+ mov si, offset DOSCODE:scan_com
+ ; ds:si -> scan string
+ mov cx, size_scan_com
+
+repe cmpsb
+
+ ; M046 - start
+ ; a fourth possible version of these exepacked programs have a
+ ; 056h instead of 06bh. See scan_com above
+ ;
+ ; db 75h, 6Bh ;jne CorruptExe
+ ;
+ ; If the mismatch at this point is due to a 56h instead of 6bh
+ ; we shall try to match the rest of the string
+ ;
+
+ jz ccs_done
+ cmp byte ptr es:[di-1], 56h
+ jnz ccs_done
+
+repe cmpsb
+
+ccs_done: ; M046 - end
+ ret
+
+chk_common_str endp
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : chk_patchsum
+;
+; Input : DS:SI -> string we're looking for
+; : ES:DI -> offset in packed file
+; : CX = scan length
+; : BX = length of check sum
+; : AX = value of check sum
+;
+; Output : if patch & check sum compare
+; NC
+; else
+; CY
+;
+; Uses : AX, BX, CX, SI
+;----------------------------------------------------------------------------
+
+chk_patchsum proc near
+
+ push di
+
+repe cmpsb
+
+ jnz cp_fail ; Q: does the patch match
+ ; N: exit
+ ; Y:
+
+
+ ; we do a check sum starting from the location of the
+ ; exepack signature 'RB' up to 11c/2 bytes, the end of the
+ ; unpacking code.
+
+
+ mov di, [unpack_offset] ; di -> start of unpack code
+ mov cx, bx ; cx = length of check sum
+
+ mov bx, ax ; save check sum passed to us in bx
+ xor ax, ax
+
+ep_chksum:
+ add ax, word ptr es:[di]
+ add di, 2
+ loop ep_chksum
+
+ pop di ; restore di
+
+ cmp ax, bx ; Q: does the check sum match
+ jnz cp_fail ; N: exit
+ ; Y:
+
+ clc
+ ret
+
+cp_fail:
+ stc
+ ret
+
+chk_patchsum endp
+
+
+ExePackPatch endp
+;
+; M020 : BEGIN
+;
+;----------------------------------------------------------------------------
+;
+; procedure : RationalPatch
+;
+; A routine (in Ration DOS extender) which is invoked at hardware interrupts
+; clobbers CX registeron 286 machines. (123 release 3 uses Rational DOS
+; extender). This routine identfies Buggy Rational EXEs and fixes the bug.
+;
+; THE BUG is in the following code sequence:
+;
+;8b 0e 10 00 mov cx, ds:[10h] ; delay count
+;90 even ; word align
+;e2 fe loop $ ; wait CLOBBERS CX
+;e8 xx xx call set_A20 ; enable A20
+;
+; This patch routine replaces the mov & the loop with a far call into a
+; routine in DOS data segment which is in low memory (because A20 line
+; is off). The routine (RatBugCode) in DOS data saves & restores CX around
+; a mov & loop.
+;
+; Identification of Buggy Rational EXE
+; ====================================
+;
+; (ALL OFFSETS ARE IN THE PROGRAM SECTION - EXCLUDING THE EXE HEADER)
+;
+; OFFSET Contains
+; ------ --------
+; 0000h 100 times Version number in binary
+; bug exists in version 3.48 thru 3.83 (both inclusive)
+;
+; 000ah the WORDS : 0000h, 0020h, 0000h, 0040h, 0001h
+;
+; 002ah offset where version number is stored in ASCII
+; e.g. '3.48A'
+;
+; 0030h offset of copyright string. Copyright strings either
+; start with "DOS/16M Copyright...." or
+; "Copyright.....". The string contains
+; "Rational Systems, Inc."
+;
+; 0020h word : Paragraph offset of the buggy code segment
+; from the program image
+; 0016h word : size of buggy code segment
+;
+; Buggy code is definite to start after offset 200h in its segment
+;
+;----------------------------------------------------------------------------
+;
+RScanPattern1 db 0, 0, 20h, 0, 0, 0, 40h, 0, 1, 0
+RLen1 equ $ - offset RScanPattern1
+
+RScanPattern2 db 8bh, 0eh, 10h, 00h, 90h, 0e2h, 0feh, 0e8h
+RLen2 equ $ - offset RScanPattern2
+
+RScanPattern3 db 8bh, 0eh, 10h, 00h, 0e2h, 0feh, 0e8h
+RLen3 equ $ - offset RScanPattern2
+;
+;----------------------------------------------------------------------------
+;
+; INPUT : ES = segment where program got loaded
+;
+;----------------------------------------------------------------------------
+RationalPatch proc near
+ cld
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di
+ push es
+ push ds ; we use all of them
+ mov di, 0ah ; look for pat1 at offset 0a
+ push cs
+ pop ds
+ assume ds:nothing
+ mov si, offset RScanPattern1
+ mov cx, RLen1
+ rep cmpsb ; do we have the pattern ?
+ jne rpexit
+ mov ax, es:[0]
+ cmp ax, 348 ; is it a buggy version ?
+ jb rpexit
+ cmp ax, 383 ; is it a buggy version
+ ja rpexit
+
+ call VerifyVersion
+ jne rpexit
+
+ mov cx, es:[16h] ; Length of buggy code seg
+ sub cx, 200h ; Length we search (we start
+ ; at offset 200h)
+ mov es, word ptr es:[20h] ; es=buggy code segment
+ mov si, offset RScanPattern2
+ mov dx, RLen2
+ call ScanCodeSeq ; look for code seq with nop
+ jz rpfound
+
+ mov si, offset RScanPattern3
+ mov dx, RLen3
+ call ScanCodeSeq ; look for code seq w/o nop
+ jnz rpexit
+rpfound:
+
+; we set up a far call into DOS data
+; dx has the length of the doce seq we were searching for
+
+ mov al, 9ah ; far call opcode
+ stosb
+ mov ax, offset RatBugCode
+ stosw
+ mov ax, ss
+ stosw
+ mov cx, dx
+ sub cx, 6 ; filler (with NOPs)
+ mov al, 90h
+ rep stosb
+rpexit:
+ pop ds
+ pop es
+ pop di
+ pop si
+ pop dx
+ pop cx
+ pop bx
+ pop ax
+ ret
+RationalPatch endp
+;
+;----------------------------------------------------------------------------
+;
+; ScanCodeSeq
+;
+; Looks for a pattern pointed to by DS:SI & len DX in ES:200 to ES:200+CX-1
+;
+; returns in ES:DI the start of the pattern if Zero flag is set
+;
+;----------------------------------------------------------------------------
+;
+ScanCodeSeq proc near
+ push cx
+ sub cx, dx
+ inc cx
+ mov di, 200h
+scsagain:
+ push si
+ push di
+ push cx
+ mov cx, dx
+ rep cmpsb
+ pop cx
+ pop di
+ pop si
+ je scsfound
+ inc di
+ loop scsagain
+scsfound:
+ pop cx
+ ret
+ScanCodeSeq endp
+
+;
+;----------------------------------------------------------------------------
+;
+; VerifyVersion
+;
+; Checks whther the binary version
+;----------------------------------------------------------------------------
+;
+VerifyVersion proc near
+ mov si, es:[2ah] ; offset of version number
+ ; in ascii
+ mov bl, 10
+ add si, 3 ; point to last digit
+
+ call VVDigit
+ jne vvexit
+ call VVDigit
+ jne vvexit
+ cmp byte ptr es:[si], '.'
+ jne vvexit
+ dec si
+ call VVDigit
+vvexit:
+ ret
+VerifyVersion endp
+
+VVDigit proc near
+ div bl
+ add ah, '0'
+ dec si
+ cmp es:[si+1], ah
+ mov ah, 0 ; do not xor or sub we need Z
+ ret
+VVDigit endp
+;
+; M020 END
+;
+
+;---------------------------------------------------------------------------
+;
+; M068
+;
+; Procedure Name : IsCopyProt
+;
+; Inputs : DS:100 -> start of com file just read in
+;
+; Outputs : sets the A20OFF_COUNT variable to 10 if
+; the program loaded in DS:100 uses a MICROSOFT
+; copy protect scheme that relies on the A20 line
+; being turned off for it's scheme to work.
+;
+; Note: The int 21 function dispatcher will turn
+; a20 off, if the A20OFF_COUNT is non-zero
+; and dec the A20OFF_COUNT before iretting
+; to the user.
+;
+; Uses : ES, DI, SI, CX
+;
+;---------------------------------------------------------------------------
+
+CPStartOffset EQU 0175h
+CPID1Offset EQU 011bh
+CPID2Offset EQU 0173h
+CPID3Offset EQU 0146h
+CPID4Offset EQU 0124h
+ID1 EQU 05343h
+ID2 EQU 05044h
+ID3 EQU 0F413h
+ID4 EQU 08000h
+
+CPScanPattern db 089h, 026h, 048h, 01h ; mov [148], sp
+ db 08ch, 0eh , 04ch, 01h ; mov [14c], cs
+ db 0c7h, 06h , 04ah, 01h, 0h, 01h ; mov [14a], 100h
+ db 08ch, 0eh , 013h, 01h ; mov [113], cs
+ db 0b8h, 020h, 01h ; mov ax, 120h
+ db 0beh, 00h , 01h ; mov si, 100h
+
+CPSPlen EQU $ - CPScanPattern
+
+IsCopyProt proc near
+
+ cmp ds:[CPID1Offset], ID1
+ jne CP_done
+
+ cmp ds:[CPID2Offset], ID2
+ jne CP_done
+
+ cmp ds:[CPID3Offset], ID3
+ jne CP_done
+
+ cmp ds:[CPID4Offset], ID4
+ jne CP_done
+
+ push cs
+ pop es
+ mov di, offset CPScanPattern ; es:di -> Pattern to find
+
+ mov si, CPStartOffset ; ds:si -> possible location
+ ; of pattern
+
+ mov cx, CPSPlen ; cx = length of pattern
+
+repe cmpsb
+
+ jnz CP_done
+ mov ss:[A20OFF_COUNT], 0AH ; M071
+CP_done:
+ ret
+
+IsCopyProt endp
+
+
+DOSCODE ENDS
+
+ END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/doskrnl/dos/fcb.asm b/private/mvdm/dos/v86/doskrnl/dos/fcb.asm
new file mode 100644
index 000000000..c9fc5d4c0
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/fcb.asm
@@ -0,0 +1,715 @@
+ TITLE FCB - FCB parse calls for MSDOS
+ NAME FCB
+
+
+;** FCB.ASM - Low level routines for parsing names into FCBs and analyzing
+; filename characters
+;
+; MakeFcb
+; NameTrans
+; PATHCHRCMP
+; GetLet
+; UCase
+; GetLet3
+; GetCharType
+; TESTKANJ
+; NORMSCAN
+; DELIM
+;
+; Revision history:
+;
+; Sudeep Bharati 19-Nov-1991 Ported for NT
+.xlist
+.xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include doscntry.inc ;AN000; 2/12/KK
+.cref
+.list
+
+ i_need Name1,BYTE
+ i_need Attrib,BYTE
+ i_need SpaceFlag,BYTE
+ i_need FILE_UCASE_TAB,byte ;DOS 3.3
+ i_need COUNTRY_CDPG,byte ;AN000; 2/12/KK
+ i_need DrvErr,BYTE ;AN000; 2/12/KK
+ i_need DOS34_FLAG,WORD ;AN000; 2/12/KK
+
+TableLook equ -1
+
+SCANSEPARATOR EQU 1
+DRVBIT EQU 2
+NAMBIT EQU 4
+EXTBIT EQU 8
+
+
+DOSCODE SEGMENT
+
+ allow_getdseg
+
+;
+;----------------------------------------------------------------------------
+;
+; Procedure : MakeFcb
+;
+;----------------------------------------------------------------------------
+;
+
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+procedure MakeFcb,NEAR
+
+;hkn; SS override
+ MOV BYTE PTR [SpaceFlag],0
+ XOR DL,DL ; Flag--not ambiguous file name
+ test AL,DRVBIT ; Use current drive field if default?
+ JNZ DEFDRV
+ MOV BYTE PTR ES:[DI],0 ; No - use default drive
+DEFDRV:
+ INC DI
+ MOV CX,8
+ test AL,NAMBIT ; Use current name fields as defualt?
+ XCHG AX,BX ; Save bits in BX
+ MOV AL," "
+ JZ FILLB ; If not, go fill with blanks
+ ADD DI,CX
+ XOR CX,CX ; Don't fill any
+FILLB:
+ REP STOSB
+ MOV CL,3
+ test BL,EXTBIT ; Use current extension as default
+ JZ FILLB2
+ ADD DI,CX
+ XOR CX,CX
+FILLB2:
+ REP STOSB
+ XCHG AX,CX ; Put zero in AX
+ STOSW
+ STOSW ; Initialize two words after to zero
+ SUB DI,16 ; Point back at start
+ test BL,SCANSEPARATOR; Scan off separators if not zero
+ JZ SKPSPC
+ CALL SCANB ; Peel off blanks and tabs
+ CALL DELIM ; Is it a one-time-only delimiter?
+ JNZ NOSCAN
+ INC SI ; Skip over the delimiter
+SKPSPC:
+ CALL SCANB ; Always kill preceding blanks and tabs
+NOSCAN:
+ CALL GETLET
+ JBE NODRV ; Quit if termination character
+ IFDEF DBCS ;AN000;
+ CALL TESTKANJ ;AN000;; 2/18/KK
+ JNE NODRV ;AN000;; 2/18/KK
+ ENDIF ;AN000;
+ CMP BYTE PTR[SI],":" ; Check for potential drive specifier
+ JNZ NODRV
+ INC SI ; Skip over colon
+ SUB AL,"@" ; Convert drive letter to drive number (A=1)
+ JBE BADDRV ; Drive letter out of range
+
+ PUSH AX
+ Invoke GetVisDrv
+ POP AX
+ JNC HavDrv
+
+;hkn; SS override
+ CMP [DrvErr],error_not_DOS_disk ; if not FAt drive ;AN000;
+ JZ HavDrv ; assume ok ;AN000;
+BADDRV:
+ MOV DL,-1
+HAVDRV:
+ STOSB ; Put drive specifier in first byte
+ INC SI
+ DEC DI ; Counteract next two instructions
+NODRV:
+ DEC SI ; Back up
+ INC DI ; Skip drive byte
+
+ entry NORMSCAN
+
+ MOV CX,8
+ CALL GETWORD ; Get 8-letter file name
+ CMP BYTE PTR [SI],"."
+ JNZ NODOT
+ INC SI ; Skip over dot if present
+
+;hkn; SS override
+ TESTB [DOS34_FLAG],DBCS_VOLID2 ;AN000;
+ JZ VOLOK ;AN000;
+ MOVSB ; 2nd byte of DBCS ;AN000;
+ MOV CX,2 ;AN000;
+ JMP SHORT contvol ;AN000;
+VOLOK:
+ MOV CX,3 ; Get 3-letter extension
+contvol:
+ CALL MUSTGETWORD
+NODOT:
+ MOV AL,DL
+
+ and [DOS34_FLAG],not DBCS_VOLID2 ; ### BUG FIX ###
+
+ return
+
+NONAM:
+ ADD DI,CX
+ DEC SI
+ return
+
+GETWORD:
+ CALL GETLET
+ JBE NONAM ; Exit if invalid character
+ DEC SI
+
+; UGH!!! Horrible bug here that should be fixed at some point:
+; If the name we are scanning is longer than CX, we keep on reading!
+
+MUSTGETWORD:
+ CALL GETLET
+
+; If spaceFlag is set then we allow spaces in a pathname
+
+IF NOT TABLELOOK
+ JB FILLNAM
+ENDIF
+ JNZ MustCheckCX
+
+;hkn; SS override
+ test BYTE PTR [SpaceFlag],0FFh
+ JZ FILLNAM
+ CMP AL," "
+ JNZ FILLNAM
+
+MustCheckCX:
+ JCXZ MUSTGETWORD
+ DEC CX
+ CMP AL,"*" ; Check for ambiguous file specifier
+ JNZ NOSTAR
+ MOV AL,"?"
+ REP STOSB
+NOSTAR:
+ STOSB
+
+ IFDEF DBCS ;AN000;
+ CALL TESTKANJ ;AN000;
+ JZ NOTDUAL3 ;AN000;
+ JCXZ BNDERR ; Attempt to straddle boundry ;AN000;
+ MOVSB ; Transfer second byte ;AN000;
+ DEC CX ;AN000;
+ JMP MUSTGETWORD ;AN000;
+BNDERR: ;AN000;
+
+;hkn; SS override for DOS34_FLAG
+ TESTB [DOS34_FLAG],DBCS_VOLID ;AN000;
+ JZ notvolumeid ;AN000;
+ TESTB [DOS34_FLAG],DBCS_VOLID2 ;AN000;
+ JNZ notvolumeid ;AN000;
+ OR [DOS34_FLAG],DBCS_VOLID2 ;AN000;
+ JMP MUSTGETWORD ;AN000;
+
+notvolumeid:
+;; INC CX ; Undo the store of the first byte
+ DEC DI
+ MOV AL," " ;PTM. ;AN000;
+ STOSB ;PTM. ;AN000;
+ INC SI ;PTM. ;AN000;
+ JMP MUSTGETWORD ;PTM. ;AN000;
+
+NOTDUAL3: ;AN000;
+ ENDIF ;AN000;
+
+ CMP AL,"?"
+ JNZ MUSTGETWORD
+ OR DL,1 ; Flag ambiguous file name
+ JMP MUSTGETWORD
+FILLNAM:
+ MOV AL," "
+ REP STOSB
+ DEC SI
+ return
+
+SCANB:
+ LODSB
+ CALL SPCHK
+ JZ SCANB
+ IFDEF DBCS ;AN000; ;AN000;
+ CMP AL,DB_SP_HI ;AN000;; 1ST BYTE OF DBCS BLANK 2/18/KK ;AN000;
+ JNE SCANB_EXIT ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ CALL TESTKANJ ;AN000;; 2/23/KK 3/31/KK revoved ;AN000;
+ JE SCANB_EXIT ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ CMP BYTE PTR [SI],DB_SP_LO;AN000;H ; 2ND BYTE OF DBCS BLANK 2/18/KK 3/31/KK revove;AN000;
+ JNE SCANB_EXIT ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ INC SI ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ JMP SCANB ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ SCANB_EXIT: ;AN000;; 2/18/KK 3/31/KK revoved ;AN000;
+ ENDIF ;AN000;
+ DEC SI
+ return
+EndProc MakeFCB
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : NameTrans
+;
+; NameTrans is used by FindPath to scan off an element of a path. We must
+; allow spaces in pathnames
+;
+; Inputs: DS:SI points to start of path element
+; Outputs: Name1 has unpacked name, uppercased
+; ES = DOSGroup
+; DS:SI advanced after name
+; Registers modified: DI,AX,DX,CX
+;
+;----------------------------------------------------------------------------
+
+procedure NameTrans,near
+ ASSUME SS:DOSDATA
+
+;hkn; SS override
+ MOV BYTE PTR [SpaceFlag],1
+ context ES
+
+;hkn; NAME1 is in DOSDATA
+ MOV DI,OFFSET DOSDATA:NAME1
+ PUSH DI
+ MOV AX,' '
+ MOV CX,5
+ STOSB
+ REP STOSW ; Fill "FCB" at NAME1 with spaces
+ XOR AL,AL ; Set stuff for NORMSCAN
+ MOV DL,AL
+ STOSB
+ POP DI
+
+ CALL NORMSCAN
+
+;hkn; SS override for NAME1
+IFDEF DBCS ;AN000;;KK.
+ MOV AL,[NAME1] ;AN000;;KK. check 1st char
+ call testkanj ;AN000;;KK. dbcs ?
+ JZ notdbcs ;AN000;;KK. no
+ return ;AN000;;KK. yes
+notdbcs: ;AN000;
+ENDIF ;AN000;
+ CMP [NAME1],0E5H
+ retnz
+ MOV [NAME1],5 ; Magic name translation
+ return
+
+EndProc nametrans
+
+Break <GETLET, DELIM -- CHECK CHARACTERS AND CONVERT>
+
+If TableLook
+
+;hkn; Table SEGMENT
+ PUBLIC CharType
+
+; Character type table for file name scanning
+; Table provides a mapping of characters to validity bits.
+; Four bits are provided for each character. Values 7Dh and above
+; have all bits set, so that part of the table is chopped off, and
+; the translation routine is responsible for screening these values.
+; The bit values are defined in DOSSYM.INC
+
+ ; ^A and NUL
+CharType db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^C and ^B
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^E and ^D
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^G and ^F
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; TAB and BS
+ db LOW ((NOT FFCB+FCHK+FDELIM+FSPCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^K and ^J
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^M and ^L
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^O and ^N
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^Q and ^P
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^S and ^R
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^U and ^T
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^W and ^V
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^Y and ^X
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ESC and ^Z
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^] and ^\
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ^_ and ^^
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; ! and SPACE
+ db LOW (NOT FCHK+FDELIM+FSPCHK)
+
+ ; # and "
+ db LOW (NOT FFCB+FCHK)
+
+ ; $ - )
+ db 3 dup (0FFh)
+
+ ; + and *
+ db LOW ((NOT FFCB+FCHK+FDELIM) SHL 4) OR 0Fh
+
+ ; - and '
+ db NOT (FFCB+FCHK+FDELIM)
+
+ ; / and .
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FCHK) AND 0Fh
+
+ ; 0 - 9
+ db 5 dup (0FFh)
+
+ ; ; and :
+ db LOW ((NOT FFCB+FCHK+FDELIM) SHL 4) OR LOW (NOT FFCB+FCHK+FDELIM) AND 0Fh
+
+ ; = and <
+ db LOW ((NOT FFCB+FCHK+FDELIM) SHL 4) OR LOW (NOT FFCB+FCHK+FDELIM) AND 0Fh
+
+ ; ? and >
+ db NOT FFCB+FCHK+FDELIM
+
+ ; A - Z
+ db 13 dup (0FFh)
+
+ ; \ and [
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR 0Fh
+
+ ; ^ and ]
+ db LOW ((NOT FFCB+FCHK) SHL 4) OR LOW (NOT FFCB+FCHK) AND 0Fh
+
+ ; _ - {
+ db 15 dup (0FFh)
+
+ ; } and |
+ db NOT FFCB+FCHK+FDELIM
+
+CharType_last equ ($ - CharType) * 2 ; This is the value of the last
+ ; character in the table
+
+;hkn; Table ENDS
+
+ENDIF
+
+;----------------------------------------------------------------------------
+;
+; Procedure Names : GetLet, UCase, GetLet3
+;
+; These routines take a character, convert it to upper case, and check
+; for delimiters. Three different entry points:
+; GetLet - DS:[SI] = character to convert
+; UCase - AL = character to convert
+; GetLet3 - AL = character
+; [BX] = translation table to use
+;
+; Exit (in all cases) : AL = upper case character
+; CY set if char is control char other than TAB
+; ZF set if char is a delimiter
+; Uses : AX, flags
+;
+; NOTE: This routine exists in a fast table lookup version, and a slow
+; inline version. Return with carry set is only possible in the inline
+; version. The table lookup version is the one in use.
+;
+;----------------------------------------------------------------------------
+
+
+; This entry point has character at [SI]
+
+procedure GetLet,NEAR
+ assume CS:DOSCODE,SS:DOSDATA
+ LODSB
+
+; This entry point has character in AL
+
+entry UCase
+ PUSH BX
+ MOV BX,OFFSET DOSDATA:FILE_UCASE_TAB+2
+
+; Convert the character in AL to upper case
+
+gl_0:
+ CMP AL,"a"
+ JB gl_2 ; Already upper case, go check type
+ CMP AL,"z"
+ JA gl_1
+ SUB AL,20H ; Convert to upper case
+
+; Map European character to upper case
+
+gl_1:
+ CMP AL,80H
+ JB gl_2 ; Not EuroChar, go check type
+ SUB AL,80H ; translate to upper case with this index
+
+ ; M048 - Start
+ ; Lantastic call Ucase thru int 2f without setting SS to DOSDATA.
+ ; So we shall set up DS and to access FILE_UCASE_TAB in BX and also
+ ; preserve it.
+ ;
+
+ push ds
+ getdseg <ds>
+
+ XLAT BYTE PTR [BX] ; ds as file_ucase_tab is in DOSDATA
+
+ pop ds
+ assume ds:nothing
+
+ ; M048 - End
+
+; Now check the type
+
+If TableLook
+
+gl_2:
+ PUSH AX
+ CALL GetCharType ; returns type flags in AL
+ TEST AL,FCHK ; test for normal character
+ POP AX
+ POP BX
+ RET
+
+; This entry has character in AL and lookup table in BX
+
+entry GetLet3
+ PUSH BX
+ JMP short gl_0
+
+ELSE
+
+gl_2:
+ POP BX
+ CMP AL,"."
+ retz
+ CMP AL,'"'
+ retz
+ CALL PATHCHRCMP
+ retz
+ CMP AL,"["
+ retz
+ CMP AL,"]"
+ retz
+ENDIF
+
+;---------------------------------------------------------------------
+;
+; DELIM - check if character is a delimiter
+; Entry : AX = character to check
+; Exit : ZF set if character is not a delimiter
+; Uses : Flags
+;
+;--------------------------------------------------------------------
+
+entry DELIM
+
+IF TableLook
+ PUSH AX
+
+ CALL GetCharType
+ TEST AL,FDELIM
+ POP AX
+ RET
+ELSE
+ CMP AL,":"
+ retz
+
+ CMP AL,"<"
+ retz
+ CMP AL,"|"
+ retz
+ CMP AL,">"
+ retz
+
+ CMP AL,"+"
+ retz
+ CMP AL,"="
+ retz
+ CMP AL,";"
+ retz
+ CMP AL,","
+ retz
+ENDIF
+
+;-------------------------------------------------------------------------
+;
+; SPCHK - checks to see if a character is a space or equivalent
+; Entry : AL = character to check
+; Exit : ZF set if character is a space
+; Uses : flags
+;
+;-------------------------------------------------------------------------
+
+entry SPCHK
+
+IF TableLook
+ PUSH AX
+ CALL GetCharType
+ TEST AL,FSPCHK
+ POP AX
+ RET
+ELSE
+ CMP AL,9 ; Filter out tabs too
+ retz
+; WARNING! " " MUST be the last compare
+ CMP AL," "
+ return
+ENDIF
+EndProc GetLet
+
+
+;-------------------------------------------------------------------------
+;
+; GetCharType - return flag bits indicating character type
+; Bits are defined in DOSSYM.INC. Uses lookup table
+; defined above at label CharType.
+;
+; Entry : AL = character to return type flags for
+; Exit : AL = type flags
+; Uses : AL, flags
+;
+;-------------------------------------------------------------------------
+
+Procedure GetCharType, Near
+
+ cmp al,CharType_last ; beyond end of table?
+ jae gct_90 ; return standard value
+
+ push bx
+ mov bx, offset DOSCODE:CharType ; load lookup table
+ shr al,1 ; adjust for half-byte table entry size
+ xlat cs:[bx] ; get flags
+ pop bx
+
+; carry clear from previous shift means we want the low nibble. Otherwise
+; we have to shift the flags down to the low nibble
+
+ jnc gct_80 ; carry clear, no shift needed
+
+ shr al,1 ; we want high nibble, shift it down
+ shr al,1
+ shr al,1
+ shr al,1
+
+gct_80:
+ and al,0Fh ; clear the unused nibble
+ ret
+
+gct_90:
+ mov al,0Fh ; set all flags
+ ret
+
+EndProc GetCharType
+
+
+;----------------------------------------------------------------------------
+;
+; Procedure : PATHCHRCMP
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure PATHCHRCMP,NEAR
+ CMP AL,'/'
+ JBE PathRet
+ CMP AL,'\'
+ return
+GotFor:
+ MOV AL,'\'
+ return
+PathRet:
+ JZ GotFor
+ return
+EndProc PathChrCMP
+
+
+ IFDEF DBCS
+;--------------------- 2/12/KK ------------------------------------------
+;
+; Procedure Name : TESTKANJ
+;
+; Function: Check if an input byte is in the ranges of DBCS vectors.
+;
+; Input: AL ; Code to be examined
+;
+; Output: ZF = 1 : AL is SBCS ZF = 0 : AL is a DBCS leading byte
+;
+; Register: All registers are unchanged except FL
+;
+;--------------------------------------------------------------------------
+
+procedure TESTKANJ,NEAR ;AN000;
+ call Chk_DBCS ;AN000;
+ jc TK_DBCS ;AN000;
+ cmp AL,AL ; set ZF ;AN000;
+ return ;AN000;
+TK_DBCS:
+ PUSH AX ;AN000;
+ XOR AX,AX ;Set ZF ;AN000;
+ INC AX ;Reset ZF ;AN000;
+ POP AX ;AN000;
+ return ;AN000;
+EndProc TESTKANJ ;AN000;
+;
+Chk_DBCS PROC ;AN000;
+ PUSH DS ;AN000;
+ PUSH SI ;AN000;
+ PUSH BX ;AN000;
+
+;hkn; SS is DOSDATA
+ Context DS
+
+;hkn; COUNTRY_CDPG is in DOSDATA
+ MOV BX,offset DOSDATA:COUNTRY_CDPG.ccSetDBCS ;AN000;
+ LDS SI,[BX+1] ; set EV address to DS:SI ;AN000;
+ ADD SI,2 ; Skip length ;AN000;
+DBCS_LOOP:
+ CMP WORD PTR [SI],0 ; terminator ? ;AN000;
+ JE NON_DBCS ; if yes, no DBCS ;AN000;
+ CMP AL,[SI] ; else ;AN000;
+ JB DBCS01 ; check if AL is ;AN000;
+ CMP AL,[SI+1] ; in a range of Ev ;AN000;
+ JA DBCS01 ; if yes, DBCS ;AN000;
+ STC ; else ;AN000;
+ JMP DBCS_EXIT ; try next DBCS Ev ;AN000;
+DBCS01:
+ ADD SI,2 ;AN000;
+ JMP DBCS_LOOP ;AN000;
+NON_DBCS:
+ CLC ;AN000;
+DBCS_EXIT:
+ POP BX ;AN000;
+ POP SI ;AN000;
+ POP DS ;AN000;
+ RET ;AN000;
+Chk_DBCS ENDP ;AN000;
+ ENDIF ;AN000;
+DOSCODE ENDS
+ END
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/fcbio.asm b/private/mvdm/dos/v86/doskrnl/dos/fcbio.asm
new file mode 100644
index 000000000..16388cdc9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/fcbio.asm
@@ -0,0 +1,1668 @@
+ TITLE FCBIO - FCB system calls
+ NAME FCBIO
+
+;** FCBIO.ASM - Ancient 1.0 1.1 FCB system calls
+;
+; $GET_FCB_POSITION
+; $FCB_DELETE
+; $GET_FCB_FILE_LENGTH
+; $FCB_CLOSE
+; $FCB_RENAME
+; SaveFCBInfo
+; ResetLRU
+; SetOpenAge
+; LRUFCB
+; FCBRegen
+; BlastSFT
+; CheckFCB
+; SFTFromFCB
+; FCBHardErr
+;
+; Revision history:
+;
+; Sudeep Bharati 19-Nov-1991 Ported for NT
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include cpmfcb.inc
+ include syscall.inc
+ include filemode.inc
+ include mult.inc
+ include bugtyp.inc
+ include dossvc.inc
+ .cref
+ .list
+
+
+ I_need OpenBuf,128 ; buffer for translating paths
+ I_need RenBuf,128 ; buffer for rename paths
+ i_need THISDPB,DWORD
+ i_need EXTERR,WORD
+ i_need ALLOWED,BYTE
+ I_need ThisSFT,DWORD ; SFT in use
+ I_need WFP_start,WORD ; pointer to canonical name
+ I_need Ren_WFP,WORD ; pointer to canonical name
+ I_need Attrib,BYTE ; Attribute for match attributes
+ I_need sftFCB,DWORD ; pointer to SFTs for FCB cache
+ I_need FCBLRU,WORD ; least recently used count
+ I_need Proc_ID,WORD ; current process ID
+ I_Need Name1,14 ; place for device names
+ I_need DEVPT,DWORD ; device pointer
+ I_need OpenLRU,WORD ; open age
+ I_need KeepCount,WORD ; number of fcbs to keep
+ I_need User_In_AX,WORD ; user input system call.
+ I_need JShare,DWORD ; share jump table
+ I_need FastOpenTable,BYTE ; DOS 3.3 fastopen
+ I_need ExtFCB,BYTE ; flag for extended FCBs
+ I_need Sattrib,BYTE ; attribute of search
+
+ I_need LocalSFT,DWORD ;added for new FCB implementation
+ i_need EXTERR_LOCUS,BYTE
+
+
+DOSCODE SEGMENT
+ ASSUME CS:DOSCODE
+
+; extrn CheckShare:near
+; extrn GetExtended:near
+ifdef DBCS
+ extrn TestKanj:near
+endif
+ extrn TransFCB:near
+ extrn GetExtended:near
+ extrn UCase:near
+
+ allow_getdseg
+
+
+Break <$Get_FCB_Position - set random record fields to current pos>
+;
+;----------------------------------------------------------------------------
+;
+; $Get_FCB_Position - look at an FCB, retrieve the current position from the
+; extent and next record field and set the random record field to point
+; to that record
+;
+; Inputs: DS:DX point to a possible extended FCB
+; Outputs: The random record field of the FCB is set to the current record
+; Registers modified: all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure $Get_FCB_Position,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ call GetExtended ; point to FCB
+ invoke GetExtent ; DX:AX is current record
+ MOV WORD PTR [SI.fcb_RR],AX ; drop in low order piece
+ MOV [SI+fcb_RR+2],DL ; drop in high order piece
+ CMP [SI.fcb_RECSIZ],64
+ JAE GetFCBBye
+ MOV [SI+fcb_RR+2+1],DH ; Set 4th byte only if record size < 64
+GetFCBBye:
+ transfer FCB_Ret_OK
+EndProc $GET_FCB_POSITION
+
+
+ Break <$FCB_Delete - remove several files that match the input FCB>
+;
+;----------------------------------------------------------------------------
+;
+;** $FCB_Delete - Delete from FCB Template
+;
+; given an FCB, remove all directory entries in the current
+; directory that have names that match the FCB's ? marks.
+;
+; ENTRY (DS:DX) = address of FCB
+; EXIT entries matching the FCB are deleted
+; (al) = ff iff no entries were deleted
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure $FCB_Delete,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV DI,OFFSET DOSDATA:OpenBuf
+
+ call TransFCB ; convert FCB to path
+ JC BadPath ; signal no deletions
+
+ mov si,OFFSET DOSDATA:OpenBuf
+ push es
+ push ds
+ invoke ChkDev ; Check if its a device
+ pop ds
+ pop es
+ jc short fdsvc
+ mov ax,error_access_denied
+ transfer FCB_Ret_Err ; let someone else signal the error
+
+fdsvc:
+ mov al,[ExtFCB]
+ mov dl,[Sattrib]
+ mov di,OFFSET DOSDATA:OpenBuf
+
+ HRDSVC SVC_DEMDELETEFCB ; es:di fcb,al IsExt, dl Sattrib
+
+ JC BadPath
+GoodPath:
+ transfer FCB_Ret_OK ; do a good return
+BadPath:
+
+ ;
+ ; Error code is in AX
+ ;
+
+ transfer FCB_Ret_Err ; let someone else signal the error
+
+EndProc $FCB_DELETE
+
+Break <$Get_FCB_File_Length - return the length of a file>
+;
+;----------------------------------------------------------------------------
+;
+; $Get_FCB_File_Length - set the random record field to the length of the
+; file in records (rounded up if partial).
+;
+; Inputs: DS:DX - point to a possible extended FCB
+; Outputs: Random record field updated to reflect the number of records
+; Registers modified: all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure $Get_FCB_File_Length,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ call GetExtended ; get real FCB pointer
+ ; DX points to Input FCB
+
+ ; OpenBuf is in DOSDATA
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+
+ SAVE <DS,SI> ; save pointer to true FCB
+ call TransFCB ; Trans name DS:DX, sets SATTRIB
+ RESTORE <SI,DS>
+ JC BadPath
+ SAVE <DS,SI> ; save pointer
+
+ Context DS ; SS is DOSDATA
+ mov si,WFP_START
+
+ HRDSVC SVC_DEMGETFILEINFO ; invoke get_file_info
+ RESTORE <SI,DS> ; get pointer back
+ JC BadPath ; invalid something
+ MOV DX,BX ; get high order size
+ MOV AX,DI ; get low order size
+ MOV BX,[SI.fcb_RECSIZ] ; get his record size
+ OR BX,BX ; empty record => 0 size for file
+ JNZ GetSize ; not empty
+ MOV BX,128
+GetSize:
+ MOV DI,AX ; save low order word
+ MOV AX,DX ; move high order for divide
+ XOR DX,DX ; clear out high
+ DIV BX ; wham
+ PUSH AX ; save dividend
+ MOV AX,DI ; get low order piece
+ DIV BX ; wham
+ MOV CX,DX ; save remainder
+ POP DX ; get high order dividend
+ JCXZ LengthStore ; no roundup
+ ADD AX,1
+ ADC DX,0 ; 32-bit increment
+LengthStore:
+ MOV WORD PTR [SI.FCB_RR],AX ; store low order
+ MOV [SI.FCB_RR+2],DL ; store high order
+ OR DH,DH
+ JZ GoodPath ; not storing insignificant zero
+ MOV [SI.FCB_RR+3],DH ; save that high piece
+GoodRet:
+ transfer FCB_Ret_OK
+EndProc $GET_FCB_FILE_LENGTH
+
+Break <$FCB_Close - close a file>
+
+;
+;----------------------------------------------------------------------------
+;
+; $FCB_Close - given an FCB, look up the SFN and close it. Do not free it
+; as the FCB may be used for further I/O
+;
+; Inputs: DS:DX point to FCB
+; Outputs: AL = FF if file was not found on disk
+; Registers modified: all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure $FCB_Close,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ XOR AL,AL ; default search attributes
+ call GetExtended ; DS:SI point to real FCB
+ JZ NoAttr ; not extended
+ MOV AL,[SI-1] ; get attributes
+
+ cmp al, 08H ; Set Label?
+ jz GoodRet
+
+NoAttr:
+ ; SS override
+ MOV [Attrib],AL ; stash away found attributes
+
+ invoke SFTFromFCB
+ JC GoodRet ; MZ 16 Jan Assume death
+
+ ;
+ ; If the sharer is present, then the SFT is not regenable. Thus,
+ ; there is no need to set the SFT's attribute.
+ ;
+
+ ;;; 9/8/86 F.C. save SFT attribute and restore it back when close is
+ ;;; done
+
+ MOV AL,ES:[DI].sf_attr
+ XOR AH,AH
+ PUSH AX
+
+ ;;; 9/8/86 F.C. save SFT attribute and restore it back when close is
+ ;;; done
+
+; call CheckShare
+; JNZ NoStash
+ MOV AL,Attrib
+ MOV ES:[DI].sf_attr,AL ; attempted attribute for close
+NoStash:
+ MOV AX,[SI].FCB_FDATE ; move in the time and date
+ MOV ES:[DI].sf_date,AX
+ MOV AX,[SI].FCB_FTIME
+ MOV ES:[DI].sf_time,AX
+ MOV AX,[SI].FCB_FilSiz
+ MOV WORD PTR ES:[DI].sf_size,AX
+ MOV AX,[SI].FCB_FilSiz+2
+ MOV WORD PTR ES:[DI].sf_size+2,AX
+ OR ES:[DI].sf_Flags,sf_close_nodate
+ push si
+ mov si,word ptr es:[di].sf_NTHandle
+ mov ax,word ptr es:[di].sf_NTHandle+2
+ mov word ptr es:[di].sf_NTHandle,0
+ mov word ptr es:[di].sf_NTHandle+2,0
+
+ ; SS is DOSDATA
+ Context DS ; let Close see variables
+
+ HRDSVC SVC_DEMCLOSEFCB ; ax:si is NT handle
+ pop si
+; LES DI,ThisSFT
+
+ ;;; 9/8/86 F.C. restore SFT attribute
+
+ POP CX
+ MOV ES:[DI].sf_attr,CL
+
+ DEC ES:[DI].sf_ref_count
+
+ ;;; 9/8/86 F.C. restore SFT attribute
+
+ PUSH AX
+ lahf
+ push ax
+ cmp ES:[DI.sf_ref_count],0 ; zero ref count gets blasted
+ JNZ CloseOK
+ MOV AL,'M'
+ call BlastSFT
+CloseOK:
+ POP AX
+ sahf
+ pop ax
+ JC fc_10a
+ jmp GoodRet
+fc_10a:
+ CMP AL,error_invalid_handle
+ JNZ fc_10
+ JMP GoodRet
+fc_10:
+ MOV AL,error_file_not_found
+ transfer FCB_Ret_Err
+EndProc $FCB_CLOSE
+
+;
+;----------------------------------------------------------------------------
+;
+;** $FCB_Rename - Rename a File
+;
+; $FCB_Rename - rename a file in place within a directory. Renames
+; multiple files copying from the meta characters.
+;
+; ENTRY DS:DX point to an FCB. The normal name field is the source
+; name of the files to be renamed. Starting at offset 11h
+; in the FCB is the destination name.
+; EXIT AL = 0 -> no error occurred and all files were renamed
+; AL = FF -> some files may have been renamed but:
+; rename to existing file or source file not found
+; USES ALL
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure $FCB_Rename,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ call GetExtended ; get pointer to real FCB
+ SAVE <DX>
+ MOV AL,[SI] ; get drive byte
+ ADD SI,10h ; point to destination
+
+ ; RenBuf is in DOSDATA
+ MOV DI,OFFSET DOSDATA:RenBuf ; point to destination buffer
+
+ SAVE <<WORD PTR DS:[SI]>,DS,SI> ; save source pointer for TransFCB
+ MOV DS:[SI],AL ; drop in real drive
+ MOV DX,SI ; let TransFCB know where the FCB is
+ call TransFCB ; munch this pathname
+ RESTORE <SI,DS,<WORD PTR DS:[SI]>> ; get path back
+ RESTORE <DX> ; Original FCB pointer
+ JC fren90 ; bad path -> error
+
+ or ax, ax
+ jnz cont1
+ mov al, error_access_denied
+ jmp short fren90
+
+cont1:
+ ; SS override for WFP_Start & Ren_WFP
+ MOV SI,WFP_Start ; get pointer
+ MOV Ren_WFP,SI ; stash it
+
+ ; OpenBuf is in DOSDATA
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate spot
+ call TransFCB ; wham
+ ; NOTE that this call is pointing
+ ; back to the ORIGINAL FCB so
+ ; SATTRIB gets set correctly
+ JC fren90 ; error
+
+ or ax, ax
+ jnz cont2
+ mov al, error_access_denied
+ jmp short fren90
+
+cont2:
+ invoke DOS_Rename
+
+ JC fren90
+ transfer FCB_Ret_OK
+
+fren90: transfer FCB_Ret_Err ; al = error code
+
+EndProc $FCB_RENAME
+
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : DOS_RENAME
+;
+; Inputs:
+; [WFP_START] Points to SOURCE WFP string ("d:/" must be first 3
+; chars, NUL terminated)
+; [CURR_DIR_END] Points to end of Current dir part of string [SOURCE]
+; ( = -1 if current dir not involved, else
+; Points to first char after last "/" of current dir part)
+; [REN_WFP] Points to DEST WFP string ("d:/" must be first 3
+; chars, NUL terminated)
+; [THISCDS] Points to CDS being used
+; (Low word = -1 if NUL CDS (Net direct request))
+; [SATTRIB] Is attribute of search, determines what files can be found
+; Function:
+; Rename the specified file(s)
+; NOTE: This routine uses most of AUXSTACK as a temp buffer.
+; Outputs:
+; CARRY CLEAR
+; OK
+; CARRY SET
+; AX is error code
+; error_file_not_found
+; No match for source, or dest path invalid
+; error_not_same_device
+; Source and dest are on different devices
+; error_access_denied
+; Directory specified (not simple rename),
+; Device name given, Destination exists.
+; NOTE: In third case some renames may have
+; been done if metas.
+; error_path_not_found
+; Bad path (not in curr dir part if present)
+; SOURCE ONLY
+; error_bad_curr_dir
+; Bad path in current directory part of path
+; SOURCE ONLY
+; error_sharing_violation
+; Deny both access required, generates an INT 24.
+; DS preserved, others destroyed
+;
+;----------------------------------------------------------------------------
+
+ procedure DOS_RENAME,NEAR
+
+;hkn; DOS_RENAME is called from file.asm and fcbio.asm. DS has been set up
+;hkn; at this point to DOSDATA.
+
+ DOSAssume <DS>,"DOS_Rename"
+ ASSUME ES:NOTHING
+
+LOCAL_RENAME:
+ MOV [EXTERR_LOCUS],errLOC_Disk
+ MOV SI,[WFP_START]
+ MOV DI,[REN_WFP]
+ MOV AL,BYTE PTR [SI]
+ MOV AH,BYTE PTR [DI]
+ OR AX,2020H ; Lower case
+ CMP AL,AH
+ JZ SAMEDRV
+ MOV AX,error_not_same_device
+ STC
+ return
+
+SAMEDRV:
+ Context ES
+ HRDSVC SVC_DEMRENAMEFCB
+ return
+
+EndProc DOS_RENAME
+
+
+
+
+Break <Misbehavior fixers>
+
+;
+; FCBs suffer from several problems. First, they are maintained in the
+; user's space so he may move them at will. Second, they have a small
+; reserved area that may be used for system information. Third, there was
+; never any "rules for behavior" for FCBs; there was no protocol for their
+; usage.
+;
+; This results in the following misbehavior:
+;
+; infinite opens of the same file:
+;
+; While (TRUE) { While (TRUE) {
+; FCBOpen (FCB); FCBOpen (FCB);
+; Read (FCB); Write (FCB);
+; } }
+;
+; infinite opens of different files:
+;
+; While (TRUE) { While (TRUE) {
+; FCBOpen (FCB[i++]); FCBOpen (FCB[i++]);
+; Read (FCB); Write (FCB);
+; } }
+;
+; multiple closes of the same file:
+;
+; FCBOpen (FCB);
+; while (TRUE)
+; FCBClose (FCB);
+;
+; I/O after closing file:
+;
+; FCBOpen (FCB);
+; while (TRUE) {
+; FCBWrite (FCB);
+; FCBClose (FCB);
+; }
+;
+; The following is am implementation of a methodology for emulating the
+; above with the exception of I/O after close. We are NOT attempting to
+; resolve that particular misbehavior. We will enforce correct behaviour in
+; FCBs when they refer to a network file or when there is file sharing on
+; the local machine.
+;
+; The reserved fields of the FCB (10 bytes worth) is divided up into various
+; structures depending on the file itself and the state of operations of the
+; OS. The information contained in this reserved field is enough to
+; regenerate the SFT for the local non-shared file. It is assumed that this
+; regeneration procedure may be expensive. The SFT for the FCB is
+; maintained in a LRU cache as the ONLY performance inprovement.
+;
+; No regeneration of SFTs is attempted for network FCBs.
+;
+; To regenerate the SFT for a local FCB, it is necessary to determine if the
+; file sharer is working. If the file sharer is present then the SFT is not
+; regenerated.
+;
+; Finally, if there is no local sharing, the full name of the file is no
+; longer available. We can make up for this by using the following
+; information:
+;
+; The Drive number (from the DPB).
+; The physical sector of the directory that contains the entry.
+; The relative position of the entry in the sector.
+; The first cluster field.
+; The last used SFT.
+; OR In the case of a device FCB
+; The low 6 bits of sf_flags (indicating device type)
+; The pointer to the device header
+;
+;
+; We read in the particular directory sector and examine the indicated
+; directory entry. If it matches, then we are kosher; otherwise, we fail.
+;
+; Some key items need to be remembered:
+;
+; Even though we are caching SFTs, they may contain useful sharing
+; information. We enforce good behavior on the FCBs.
+;
+; Network support must not treat FCBs as impacting the ref counts on
+; open VCs. The VCs may be closed only at process termination.
+;
+; If this is not an installed version of the DOS, file sharing will
+; always be present.
+;
+; We MUST always initialize lstclus to = firclus when regenerating a
+; file. Otherwise we start allocating clusters up the wazoo.
+;
+; Always initialize, during regeneration, the mode field to both isFCB
+; and open_for_both. This is so the FCB code in the sharer can find the
+; proper OI record.
+;
+; The test bits are:
+;
+; 00 -> local file
+; 40 -> sharing local
+; 80 -> network
+; C0 -> local device
+
+Break <SaveFCBInfo - store pertinent information from an SFT into the FCB>
+;
+;----------------------------------------------------------------------------
+;
+; SaveFCBInfo - given an FCB and its associated SFT, copy the relevant
+; pieces of information into the FCB.
+;
+; Inputs: ThisSFT points to a complete SFT.
+; DS:SI point to the FCB (not an extended one)
+; Outputs: The relevant reserved fields in the FCB are filled in.
+; DS:SI preserved
+; ES:DI point to sft
+; Registers modified: All
+;
+;
+;----------------------------------------------------------------------------
+;
+Procedure SaveFCBInfo,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ LES DI,ThisSFT ; SS override
+
+ Assert ISSFT,<ES,DI>,"SaveFCBInfo"
+
+ LEA AX,[DI-SFTable] ; Adjust for offset to table.
+ SUB AX,WORD PTR SftFCB ; SS override for SftFCB
+
+ MOV BL,SIZE sf_entry
+ DIV BL
+ MOV [SI].FCB_sfn,AL ; last used SFN
+
+ call UpdateLRU
+ return
+
+EndProc SaveFCBInfo
+
+Procedure UpdateLRU,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ LES DI,ThisSFT ; SS override
+ PUSH Proc_ID ; set process id
+ POP ES:[DI].sf_PID
+ MOV AX,FCBLRU ; get lru count
+ INC AX
+ MOV WORD PTR ES:[DI].sf_LRU,AX
+ JNZ SimpleStuff
+ ;
+ ; lru flag overflowed. Run through all FCB sfts and adjust:
+ ; LRU < 8000H get set to 0. Others -= 8000h. This LRU = 8000h
+ ;
+ MOV BX,sf_position
+ call ResetLRU
+
+ ; Set new LRU to AX
+
+SimpleStuff:
+ MOV FCBLRU,AX
+ return
+
+EndProc UpdateLRU
+
+
+Break <ResetLRU - reset overflowed lru counts>
+
+;
+;----------------------------------------------------------------------------
+;
+; ResetLRU - during lru updates, we may wrap at 64K. We must walk the
+; entire set of SFTs and subtract 8000h from their lru counts and truncate
+; at 0.
+;
+; Inputs: BX is offset into SFT field where lru firld is kept
+; ES:DI point to SFT currently being updated
+; Outputs: All FCB SFTs have their lru fields truncated
+; AX has 8000h
+; Registers modified: none
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure ResetLRU,NEAR
+
+ ; ResetLRU is only called from fcbio.asm. So SS can be assumed to be
+ ; DOSDATA
+
+ ASSUME CS:DOSCODE
+
+ DOSAssume <SS>, "ResetLRU"
+
+ Assert ISSFT,<ES,DI>,"ResetLRU"
+ MOV AX,8000h
+ SAVE <ES,DI>
+ LES DI,sftFCB ; get pointer to head
+ MOV CX,ES:[DI].sfCount
+ LEA DI,[DI].sfTable ; point at table
+ovScan:
+ SUB WORD PTR ES:[DI+BX],AX ; decrement lru count
+ JA ovLoop
+ MOV WORD PTR ES:[DI.BX],AX ; truncate at 0
+ovLoop:
+ ADD DI,SIZE SF_Entry ; advance to next
+ LOOP ovScan
+ RESTORE <DI,ES>
+ MOV ES:[DI+BX],AX
+ return
+
+EndProc ResetLRU
+
+IF 0 ; We dont need this routine any more.
+
+Break <SetOpenAge - update the open age of a SFT>
+
+;
+;----------------------------------------------------------------------------
+;
+; SetOpenAge - In order to maintain the first N open files in the FCB cache,
+; we keep the 'open age' or an LRU count based on opens. We update the
+; count here and fill in the appropriate field.
+;
+; Inputs: ES:DI point to SFT
+; Outputs: ES:DI has the open age field filled in.
+; If open age has wraparound, we will have subtracted 8000h
+; from all open ages.
+; Registers modified: AX
+;
+;----------------------------------------------------------------------------
+;
+
+
+Procedure SetOpenAge,NEAR
+
+ ; SetOpenAge is called from fcbio2.asm. SS can be assumed to be valid.
+
+ ASSUME CS:DOSCODE
+
+ DOSAssume <SS>, "SetOpenAge"
+
+ Assert ISSFT,<ES,DI>,"SetOpenAge"
+
+ MOV AX,OpenLRU ; SS override
+ INC AX
+ MOV ES:[DI].sf_OpenAge,AX
+ JNZ SetDone
+ MOV BX,sf_Position+2
+ call ResetLRU
+SetDone:
+ MOV OpenLRU,AX
+ return
+EndProc SetOpenAge
+
+ENDIF ; SetOpenAge no longer needed
+
+
+Break <LRUFCB - perform LRU on FCB sfts>
+
+;
+;----------------------------------------------------------------------------
+;
+; LRUFCB - find LRU fcb in cache. Set ThisSFT and return it. We preserve
+; the first keepcount sfts if they are network sfts or if sharing is
+; loaded. If carry is set then NO BLASTING is NECESSARY.
+;
+; Inputs: none
+; Outputs: ES:DI point to SFT
+; ThisSFT points to SFT
+; SFT is zeroed
+; Carry set of closes failed
+; Registers modified: none
+;
+;----------------------------------------------------------------------------
+;
+IF 0 ; rewritten this routine
+
+Procedure LRUFCB,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ Save_World
+ getdseg <ds> ; ds -> dosdata
+
+; Find nth oldest NET/SHARE FCB. We want to find its age for the second scan
+; to find the lease recently used one that is younger than the open age. We
+; operate be scanning the list n times finding the least age that is greater
+; or equal to the previous minimum age.
+;
+; BP is the count of times we need to go through this loop.
+; AX is the current acceptable minimum age to consider
+;
+ mov bp,KeepCount ; k = keepcount;
+ XOR AX,AX ; low = 0;
+;
+; If we've scanned the table n times, then we are done.
+;
+lru1:
+ CMP bp,0 ; while (k--) {
+ JZ lru75
+ DEC bp
+;
+; Set up for scan.
+;
+; AX is the minimum age for consideration
+; BX is the minimum age found during the scan
+; SI is the position of the entry that corresponds to BX
+;
+ MOV BX,-1 ; min = 0xffff;
+ MOV si,BX ; pos = 0xffff;
+ LES DI,SFTFCB ; for (CX=FCBCount; CX>0; CX--)
+ MOV CX,ES:[DI].sfCount
+ LEA DI,[DI].sfTable
+;
+; Innermost loop. If the current entry is free, then we are done. Or, if the
+; current entry is busy (indicating a previous aborted allocation), then we
+; are done. In both cases, we use the found entry.
+;
+lru2:
+ cmp es:[di].sf_ref_count,0
+ jz lru25
+ cmp es:[di].sf_ref_count,sf_busy
+ jnz lru3
+;
+; The entry is usable without further scan. Go and use it.
+;
+lru25:
+ MOV si,DI ; pos = i;
+ JMP short lru11 ; goto got;
+;
+; See if the entry is for the network or for the sharer.
+;
+; If for the sharer or network then
+; if the age < current minimum AND >= allowed minimum then
+; this entry becomes current minimum
+;
+lru3:
+ TESTB ES:[DI].sf_flags,sf_isnet ; if (!net[i]
+ JNZ lru35
+if installed
+ jmp lru5
+; call CheckShare ; && !sharing)
+; JZ lru5 ; else
+ENDIF
+;
+; This SFT is for the net or is for the sharer. See if it less than the
+; current minimum.
+;
+lru35:
+ MOV DX,ES:[DI].sf_OpenAge
+ CMP DX,AX ; if (age[i] >= low &&
+ JB lru5
+ CMP DX,BX
+ JAE lru5 ; age[i] < min) {
+;
+; entry is new minimum. Remember his age.
+;
+ mov bx,DX ; min = age[i];
+ mov si,di ; pos = i;
+;
+; End of loop. gp back for more
+;
+lru5:
+add di,size sf_entry
+ loop lru2 ; }
+;
+; The scan is complete. If we have successfully found a new minimum (pos != -1)
+; set then threshold value to this new minimum + 1. Otherwise, the scan is
+; complete. Go find LRU.
+;
+lru6: cmp si,-1 ; position not -1?
+ jz lru75 ; no, done with everything
+ lea ax,[bx+1] ; set new threshold age
+ jmp lru1 ; go and loop for more
+lru65: stc
+ jmp short lruDead ; return -1;
+;
+; Main loop is done. We have AX being the age+1 of the nth oldest sharer or
+; network entry. We now make a second pass through to find the LRU entry
+; that is local-no-share or has age >= AX
+;
+lru75:
+ mov bx,-1 ; min = 0xffff;
+ mov si,bx ; pos = 0xffff;
+ LES DI,SFTFCB ; for (CX=FCBCount; CX>0; CX--)
+ MOV CX,ES:[DI].sfCount
+ LEA DI,[DI].sfTable
+;
+; If this is is local-no-share then go check for LRU else if age >= threshold
+; then check for lru.
+;
+lru8:
+ TESTB ES:[DI].sf_flags,sf_isnet
+ jnz lru85 ; is for network, go check age
+; call CheckShare ; sharer here?
+; jz lru86 ; no, go check lru
+;
+; Network or sharer. Check age
+;
+;lru85:
+; cmp es:[di].sf_OpenAge,ax
+; jb lru9 ; age is before threshold, skip it
+;
+; Check LRU
+;
+lru86:
+ cmp es:[di].sf_LRU,bx ; is LRU less than current LRU?
+ jae lru9 ; no, skip this
+ mov si,di ; remember position
+ mov bx,es:[di].sf_LRU ; remember new minimum LRU
+;
+; Done with this entry, go back for more.
+;
+lru9:
+ add di,size sf_entry
+ loop lru8
+;
+; Scan is complete. If we found NOTHING that satisfied us then we bomb
+; out. The conditions here are:
+;
+; No local-no-shares AND all net/share entries are older than threshold
+;
+lru10:
+ cmp si,-1 ; if no one f
+ jz lru65 ; return -1;
+lru11:
+ mov di,si
+ MOV WORD PTR ThisSFT,DI ; set thissft
+ MOV WORD PTR ThisSFT+2,ES
+;
+; If we have sharing or thisSFT is a net sft, then close it until ref count
+; is 0.
+;
+ TESTB ES:[DI].sf_flags,sf_isNet
+ JNZ LRUClose
+IF INSTALLED
+ jmp LRUDone
+; call CheckShare
+; JZ LRUDone
+ENDIF
+;
+; Repeat close until ref count is 0
+;
+LRUClose:
+
+; DS already set up at beginnnig of proceure.
+; Context DS
+
+ LES DI,ThisSFT
+ CMP ES:[DI].sf_ref_count,0 ; is ref count still <> 0?
+ JZ LRUDone ; nope, all done
+
+; Message 1,"LRUFCB: closing "
+; MessageNum <WORD PTR THISSFT+2>
+; Message 1,":"
+; MessageNum <WORD PTR THISSFT>
+
+ Invoke DOS_Close
+ jnc LRUClose ; no error => clean up
+ cmp al,error_invalid_handle
+ jz LRUClose
+ stc
+ JMP short LRUDead
+LRUDone:
+ XOR AL,AL
+ call BlastSFT ; fill SFT with 0 (AL), 'C' cleared
+
+LRUDead:
+ Restore_World ; use macro
+
+ getdseg <es> ; es -> dosdata
+ LES DI,ES:ThisSFT
+ assume es:NOTHING
+
+ Assert ISSFT,<ES,DI>,"LRUFCB return"
+ retnc
+ MOV AL,error_FCB_unavailable
+ return
+EndProc LRUFCB
+
+ENDIF ; LRUFCB has been rewritten below.
+
+
+;******* LruFCB -- allocate the LRU SFT from the SFT Table. The LRU scheme
+; maintains separate counts for net/Share and local SFTs. We allocate a
+; net/Share SFT only if we do not find a local SFT. This helps keep
+; net/Share SFTs which cannot be regenerated for as long as possible. We
+; optimize regeneration operations by keeping track of the current local
+; SFT. This avoids scanning of the SFTs as long as we have at least one
+; local SFT in the SFT Block.
+;
+; Inputs: al = 0 => Regenerate SFT operation
+; = 1 => Allocate new SFT for Open/Create
+;
+; Outputs: Carry clear
+; es:di = Address of allocated SFT
+; ThisSFT = Address of allocated SFT
+;
+; carry set if closes of net/Share files failed
+; al = error_FCB_unavailable
+;
+; Registers affected: None
+;
+
+
+PUBLIC LruFCB
+LruFCB PROC NEAR
+ assume ds:nothing, es:nothing,ss:nothing
+
+ Save_world
+ getdseg <ds> ;ds = DOSDATA
+
+ or al,al ;Check if regenerate allocation
+ jnz lru1 ;Try to find SFT to use
+
+ ;
+ ; This is a regen call. If LocalSFT contains the address of a valid
+ ; local SFT, just return that SFT to reuse
+ ;
+
+ mov di,word ptr LocalSFT
+ or di,word ptr LocalSFT+2 ;is address == 0?
+ jz lru1 ;invalid local SFT, find one
+
+ ;
+ ; We have found a valid local SFT. Recycle this SFT
+ ;
+
+ les di,LocalSFT
+
+gotlocalSFT:
+ mov word ptr ThisSFT,di
+ mov word ptr ThisSFT+2,es
+ clc
+ jmp LRUDone ;clear up SFT and return
+
+lru1:
+ les di,SFTFCB ;es:di = SF Table for FCBs
+ mov cx,es:[di].sfCount ;cx = number of SFTs
+ lea di,[di].sfTable ;es:di = first SFT
+
+ ;
+ ; We scan through all the SFTs scanning for a free one. It also
+ ; remembers the LRU SFT for net/Share SFTs and local SFTs separately.
+ ; bx = min. LRU for local SFTs
+ ; si = pos. of local SFT with min. LRU
+ ; dx = min. LRU for net/Share SFTs
+ ; bp = pos. of net/Share SFT with min. LRU
+ ;
+
+ mov bx,-1 ; init. to 0xffff ( max. LRU value )
+ mov si,bx
+ mov dx,bx
+ mov bp,bx
+
+findSFT:
+ ;
+ ;See if this SFT is a free one. If so, return it
+ ;
+
+ or es:[di].sf_ref_count,0 ;reference count = 0 ?
+ jz gotSFT ;yes, SFT is free
+ cmp es:[di].sf_ref_count,sf_busy ;Is it busy?
+ jz gotSFT ;no, can use it
+
+ ;
+ ; Check if this SFT is local and store its address in LocalSFT. Can be
+ ; used for a later regen.
+ ;
+
+ test es:[di].sf_flags,sf_isnet ;network SFT?
+ jnz lru5 ;yes, get net/Share LRU
+IF installed
+; call CheckShare ;Share present?
+ENDIF
+; jnz lru5 ;yes, get net/Share LRU
+
+ ;
+ ;Local SFT, register its address
+ ;
+
+ ; !!HACK!!!
+ ; There is a slightly dirty hack out here in a desperate bid to save
+ ; code space. There is similar code duplicated at label 'gotSFT'. We
+ ; enter from there if al = 0, update the LocalSFT variable, and since
+ ; al = 0, we jump out of the loop to the exit point. I have commented
+ ; out the code that previously existed at label 'gotSFT'
+ ;
+
+hackpoint:
+ mov word ptr LocalSFT,di
+ mov word ptr LocalSFT+2,es ;store local SFT address
+
+ or al,al ;Is operation = REGEN?
+ jz gotlocalSFT ;yes, return this SFT for reuse
+
+ ;
+ ;Get LRU for local files
+ ;
+
+ cmp es:[di].sf_LRU,bx ;SFT.LRU < min?
+ jae lru4 ;no, skip
+
+ mov bx,es:[di].sf_LRU ;yes, store new minimum
+ mov si,di ;store SFT position
+
+lru4:
+ add di,SIZE sf_entry ;go to next SFT
+ loop findSFT
+
+ ;
+ ; Check whether we got a net/Share or local SFT. If local SFT
+ ; available, we will reuse it instead of net/Share LRU
+ ;
+
+ mov di,si
+ cmp si,-1 ;local SFT available?
+ jnz gotSFT ;yes, return it
+
+ ;
+ ;No local SFT, see if we got a net/Share SFT
+ ;
+
+ mov di,bp
+ cmp bp,-1 ;net/Share SFT available?
+ jnz gotnetSFT ;yes, return it
+noSFT:
+
+ ;
+ ; NB: This error should never occur. We always must have an LRU SFT.
+ ; This error can occur only if the SFT has been corrupted or the LRU
+ ; count is not maintained properly.
+ ;
+
+ jmp short errorbadSFT ;error, no FCB available.
+
+ ;
+ ; Handle the LRU for net/Share SFTs
+ ;
+
+lru5:
+ cmp es:[di].sf_LRU,dx ;SFT.LRU < min?
+ jae lru4 ;no, skip
+
+ mov dx,es:[di].sf_LRU ;yes, store new minimum
+ mov bp,di ;store SFT position
+ jmp short lru4 ;continue with next SFT
+
+gotSFT:
+ or al,al
+ jz hackpoint ;save es:di in LocalSFT
+
+ ;
+ ; HACK!!!
+ ; The code here differs from the code at 'hackpoint' only in the
+ ; order of the check for al. If al = 0, we can junp to 'hackpoint'
+ ; and then from there jump out to 'gotlocalSFT'. The original code
+ ; has been commented out below and replaced by the code just above.
+ ;
+
+;
+;If regen, then this SFT can be registered as a local one ( even if free ).
+;
+; or al,al ;Regen?
+; jnz notlocaluse ;yes, register it and return
+;
+;Register this SFT as a local one
+;
+; mov word ptr LocalSFT,di
+; mov word ptr LocalSFT+2,es
+; jmp gotlocalSFT ;return to caller
+;
+;notlocaluse:
+
+ ;
+ ; The caller is probably going to use this SFT for a net/Share file.
+ ; We will come here only on a Open/Create when the caller($FCB_OPEN)
+ ; does not really know whether it is a local file or not. We
+ ; invalidate LocalSFT if the SFT we are going to use was previously
+ ; registered as a local SFT that can be recycled.
+ ;
+
+ mov ax,es
+ cmp word ptr LocalSFT,di ;Offset same?
+ jnz notinvalid
+ cmp word ptr LocalSFT+2,ax ;Segments same?
+ jz zerolocalSFT ;no, no need to invalidate
+notinvalid:
+ jmp gotlocalSFT
+
+ ;
+ ; The SFT we are going to use was registered in the LocalSFT variable.
+ ; Invalidate this variable i.e LocalSFT = NULL
+ ;
+
+zerolocalSFT:
+ xor ax,ax
+ mov word ptr LocalSFT,ax
+ mov word ptr LocalSFT+2,ax
+
+ jmp gotlocalSFT
+
+gotnetSFT:
+
+ ;
+ ; We have an SFT that is currently net/Share. If it is going to be
+ ; used for a regen, we know it has to be a local SFT. Update the
+ ; LocalSFT variable
+ ;
+
+ or al,al
+ jnz closenet
+
+ mov word ptr LocalSFT,di
+ mov word ptr LocalSFT+2,es ;store local SFT address
+closenet:
+ mov word ptr ThisSFT,di ; set thissft
+ mov word ptr ThisSFT+2,es
+
+ ;
+ ; If we have sharing or thisSFT is a net sft, then close it until ref
+ ; count is 0.
+ ; NB: We come here only if it is a net/Share SFT that is going to be
+ ; recycled -- no need to check for this.
+ ;
+
+LRUClose:
+
+ cmp es:[di].sf_ref_count,0 ; is ref count still <> 0?
+ jz LRUDone ; nope, all done
+ push si
+ mov si,word ptr es:[di].sf_NTHandle
+ mov ax,word ptr es:[di].sf_NTHandle+2
+
+ HRDSVC SVC_DEMCLOSEFCB ; ax:si is NT handle
+ pop si
+ jnc LRUClose ; no error => clean up
+
+ ;
+ ; Bugbug: I dont know why we are trying to close after we get an
+ ; error closing. Seems like we could have a potential infinite loop
+ ; here. This has to be verified.
+ ;
+
+ cmp al,error_invalid_handle
+ jz LRUClose
+errorbadSFT:
+ stc
+ JMP short LRUDead
+LRUDone:
+ XOR AL,AL
+ call BlastSFT ; fill SFT with 0 (AL), 'C' cleared
+
+LRUDead:
+ Restore_World ; use macro
+
+ getdseg <es>
+ les di,es:ThisSFT ;es:di points at allocated SFT
+
+ retnc
+ MOV AL,error_FCB_unavailable
+ ret
+
+LruFCB ENDP
+
+if 0
+
+;**** RegenCopyName -- This function copies the filename from the FCB to
+; SFT and also to DOS local buffers. There was duplicate code in FCBRegen
+; to copy the name to different destinations
+;
+; Inputs: ds:si = source string
+; es:di = destination string
+; cx = length of string
+;
+; Outputs: String copied to destination
+;
+; Registers affected: cx,di,si
+;
+
+Procedure RegenCopyName NEAR
+
+CopyName:
+ lodsb ;load character
+
+ IFDEF DBCS
+ call testkanj
+ jz notkanj9
+ STOSB
+ DEC CX
+ JCXZ DoneName ; Ignore split kanji char error
+ LODSB
+ jmp short StuffChar2
+
+notkanj9:
+ ENDIF
+
+ call UCase ; convert char to upper case
+StuffChar2:
+ STOSB ;store converted character
+ LOOP CopyName ;
+DoneName:
+ ret
+
+EndProc RegenCopyName
+
+
+Break <FCBRegen - regenerate a sft from the info in the FCB>
+;
+;----------------------------------------------------------------------------
+;
+; FCBRegen - examine reserved field of FCB and attempt to generate the SFT
+; from it.
+;
+; Inputs: DS:SI point to FCB
+; Outputs: carry clear Filled in SFT
+; Carry set unrecoverable error
+; Registers modified: all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure FCBRegen,NEAR
+
+ ; called from SFTFromFCB. SS already DOSDATA
+
+ DOSAssume <SS>, "FCBRegen"
+
+ ; General data filling. Mode is sf_isFCB + open_for_both, date/time
+ ; we do not fill, size we do no fill, position we do not fill,
+ ; bit 14 of flags = TRUE, other bits = FALSE
+
+ MOV AL,[SI].fcb_l_drive
+
+ ; We discriminate based on the first two bits in the reserved field.
+
+ test AL,FCBSPECIAL ; check for no sharing test
+ JZ RegenNoSharing ; yes, go regen from no sharing
+
+ ;
+ ; The FCB is for a network or a sharing based system. At this point
+ ; we have already closed the SFT for this guy and reconnection is
+ ; impossible.
+ ;
+ ; Remember that he may have given us a FCB with bogus information in
+ ; it. Check to see if sharing is present or if the redir is present.
+ ; If either is around, presume that we have cycled out the FCB and
+ ; give the hard error. Otherwise, just return with carry set.
+ ;
+
+; call CheckShare ; test for sharer
+; JNZ RegenFail ; yep, fail this.
+ MOV AX,multNet SHL 8 ; install check on multnet
+ INT 2FH
+ OR AL,AL ; is it there?
+ JZ RegenDead ; no, just fail the operation
+RegenFail:
+ MOV AX,User_In_AX ; SS override
+ cmp AH,fcb_close
+ jz RegenDead
+ invoke FCBHardErr ; massive hard error.
+RegenDead:
+ STC
+ return ; carry set
+
+ ;
+ ; Local FCB without sharing. Check to see if sharing is loaded. If
+ ; so fail the operation.
+ ;
+RegenNoSharing:
+ call CheckShare ; Sharing around?
+ JNZ RegenFail
+ ;
+ ; Find an SFT for this guy.
+ ;
+ push ax
+ mov al,0 ;indicate it is a regen operation
+ invoke LRUFcb
+ pop ax
+
+ retc
+ MOV ES:[DI].sf_mode,SF_IsFCB + open_for_both + sharing_compat
+ AND AL,3Fh ; get drive number for flags
+ CBW
+ OR AX,sf_close_noDate ; normal FCB operation
+
+ ;
+ ; The bits field consists of the upper two bits (dirty and device)
+ ; from the SFT and the low 4 bits from the open mode.
+ ;
+
+ MOV CL,[SI].FCB_nsl_bits ; stick in dirty bits.
+ MOV CH,CL
+ AND CH,0C0h ; mask off the dirty/device bits
+ OR AL,CH
+ AND CL,access_mask ; get the mode bits
+ MOV BYTE PTR ES:[DI].sf_mode,CL
+ MOV ES:[DI].sf_flags,AX ; initial flags
+ MOV AX,Proc_ID ; SS override
+ MOV ES:[DI].sf_PID,AX
+ SAVE <DS,SI,ES,DI>
+ Context <es>
+
+ MOV DI,OFFSET DOSDATA:Name1 ; NAME1 is in DOSDATA
+
+ MOV CX,8
+ INC SI ; Skip past drive byte to name in FCB
+
+ call RegenCopyName ;copy the name to NAME1
+
+ context <ds> ; SS is DOSDATA
+
+ MOV [ATTRIB],attr_hidden + attr_system + attr_directory
+ ; Must set this to something interesting
+ ; to call DEVNAME.
+ Invoke DevName ; check for device
+ ASSUME DS:NOTHING,ES:NOTHING
+ RESTORE <DI,ES,SI,DS>
+ JC RegenFileNoSharing ; not found on device list => file
+
+ ;
+ ; Device found. We can ignore disk-specific info
+ ;
+
+ MOV BYTE PTR ES:[DI].sf_flags,BH ; device parms
+ MOV ES:[DI].sf_attr,0 ; attribute
+ ; SS override
+ LDS SI,DEVPT ; get device driver
+ MOV WORD PTR ES:[DI].sf_devptr,SI
+ MOV WORD PTR ES:[DI].sf_devptr+2,DS
+ ret ; carry is clear
+
+RegenDeadJ:
+ JMP RegenDead
+
+ ;
+ ; File found. Just copy in the remaining pieces.
+ ;
+
+RegenFileNoSharing:
+ MOV AX,ES:[DI].sf_flags
+ AND AX,03Fh
+ SAVE <DS,SI>
+ Invoke Find_DPB
+ MOV WORD PTR ES:[DI].sf_devptr,SI
+ MOV WORD PTR ES:[DI].sf_devptr+2,DS
+ RESTORE <SI,DS>
+ jc RegenDeadJ ; if find DPB fails, then drive
+ ; indicator was bogus
+ MOV AX,[SI].FCB_nsl_dirsec
+ MOV WORD PTR ES:[DI].sf_dirsec,AX
+
+ ; SR;
+ ; Update the higher word of the directory sector from the FCB
+ ;
+
+; MOV WORD PTR ES:[DI].sf_dirsec+2,0 ;AN000;>32mb
+
+ ; SR;
+ ; Extract the read-only and archive bits from the top 2 bits of the sector
+ ; number
+ ;
+
+ mov al,[si].fcb_sfn
+ and al,0c0h ;get the 2 attribute bits
+ mov ah,al
+ rol ah,1
+ shr al,1
+ or al,ah
+ and al,03fH ;mask off unused bits
+ mov es:[di].sf_attr,al
+
+ mov al,[si].fcb_sfn
+ and al,03fh ;mask off top 2 bits -- attr bits
+ sub ah,ah
+ mov word ptr es:[di].sf_dirsec+2,ax ;update high word
+
+ MOV AX,[SI].FCB_nsl_firclus
+ MOV ES:[DI].sf_firclus,AX
+ MOV ES:[DI].sf_lstclus,AX
+ MOV AL,[SI].FCB_nsl_dirpos
+ MOV ES:[DI].sf_dirpos,AL
+ INC ES:[DI].sf_ref_count ; Increment reference count.
+ ; Existing FCB entries would be
+ ; flushed unnecessarily because of
+ ; check in CheckFCB of the ref_count.
+ ; July 22/85 - BAS
+ LEA SI,[SI].FCB_name
+ LEA DI,[DI].sf_name
+ MOV CX,fcb_extent-fcb_name
+
+ call RegenCopyName ;copy name to SFT
+
+ clc
+ ret
+EndProc FCBRegen
+
+endif
+
+
+
+;** BlastSFT - FIll SFT with Garbage
+;
+; BlastSFT is used when an SFT is no longer needed; it's called with
+; various garbage values to put into the SFT. I don't know why,
+; presumably to help with debugging (jgl). We clear the few fields
+; necessary to show that the SFT is free after filling it.
+;
+; ENTRY (es:di) = address of SFT
+; (al) = fill character
+; EXIT (ax) = -1
+; 'C' clear
+; USES AX, CX, Flags
+
+
+Procedure BlastSFT,NEAR
+ INTTEST
+
+ push di
+ mov cx,size sf_entry
+ rep stosb
+ pop di
+ sub ax,ax ; clear 'C'-----------------;
+ mov es:[di].sf_ref_count,ax ; set ref count ;
+ mov es:[di].sf_lru,ax ; set lru ;
+ dec ax ;
+ mov es:[di].sf_openage,ax ; set open age to -1 ;
+ ret ; return with 'C' clear ;
+
+EndProc BlastSFT
+
+Break <CheckFCB - see if the SFT pointed to by the FCB is still OK>
+;
+;----------------------------------------------------------------------------
+;
+; CheckFCB - examine an FCB and its contents to see if it is OK.
+;
+; Inputs: DS:SI point to FCB (not extended)
+; AL is SFT index
+; Outputs: Carry Set - FCB is bad
+; Carry clear - FCB is OK. ES:DI point to SFT
+; Registers modified: AX and BX
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure CheckFCB,NEAR
+
+ ; called from $fcb_open and sftfromfcb. SS already set up to DOSDATA
+
+ DOSAssume <SS>, "CheckFCB"
+
+ LES DI,sftFCB ; SS override
+
+ CMP BYTE PTR ES:[DI].SFCount,AL
+ JC BadSFT
+ MOV BL,SIZE sf_entry
+ MUL BL
+ LEA DI,[DI].sftable
+ ADD DI,AX
+ MOV AX,Proc_ID ; SS override
+ CMP ES:[DI].sf_PID,AX
+ JNZ BadSFT ; must match process
+
+ CMP ES:[DI].sf_ref_count,0
+ JZ BadSFT ; must also be in use
+
+ cmp byte ptr ds:[si].fcb_res_dev,1 ; Is FCB for a device
+ je CheckFCBDevice
+
+ mov AX, word ptr ds:[si].fcb_res_Sig
+ cmp word ptr es:[di].sf_NTHandle, AX
+ jnz BadSFT
+
+ mov AX, word ptr ds:[si].fcb_res_Sig+2
+ cmp word ptr es:[di].sf_NTHandle+2, AX
+ jnz BadSFT
+
+
+GoodSFT:
+ CLC
+ ret ; carry is clear
+
+BadSFT: STC
+ ret ; carry is set
+
+CheckFCBDevice:
+ MOV BX,WORD PTR [SI].FCB_res_Sig
+ CMP BX,WORD PTR ES:[DI].sf_devptr
+ JNZ BadSFT
+ MOV BX,WORD PTR [SI].FCB_res_Sig + 2
+ CMP BX,WORD PTR ES:[DI].sf_devptr + 2
+ JNZ BadSFT
+ JMP GoodSFT
+
+EndProc CheckFCB
+
+Break <SFTFromFCB - take a FCB and obtain a SFT from it>
+
+;----------------------------------------------------------------------------
+;
+; SFTFromFCB - the workhorse of this compatability crap. Check to see if
+; the SFT for the FCB is Good. If so, make ThisSFT point to it. If not
+; good, get one from the cache and regenerate it. Overlay the LRU field
+; with PID
+;
+; Inputs: DS:SI point to FCB
+; Outputs: ThisSFT point to appropriate SFT
+; Carry clear -> OK ES:DI -> SFT
+; Carry set -> error in ax
+; Registers modified: ES,DI, AX
+;
+;----------------------------------------------------------------------------
+
+Procedure SFTFromFCB,NEAR
+
+ ; called from fcbio and $fcb_close. SS already set up to DOSDATA
+
+ DOSAssume <SS>, "SFTFromFCB"
+
+ SAVE <AX,BX>
+
+ MOV AL,[SI].fcb_sfn ; set SFN for check
+ invoke CheckFCB
+ RESTORE <BX,AX>
+
+ MOV WORD PTR ThisSFT,DI ; SS override
+ MOV WORD PTR ThisSFT+2,ES
+
+ JNC SetSFT ; no problems, just set thissft
+
+; Sudeepb 19-Nov-1991 We are'nt supporting Regen
+;
+; Save_World ; use macro
+; invoke FCBRegen
+; Restore_World ; use macro restore world
+
+ MOV AX,User_In_AX ; SS override
+ cmp AH,fcb_close
+ jz Retur
+
+ invoke FCBHardErr ; massive hard error.
+ mov ax, EXTERR
+
+Retur:
+ STC
+ return ; carry set
+
+; Message 1,<"FCBRegen Succeeded",13,10>
+
+SetSFT:
+ LES DI,ThisSFT ; SS override for THISSFT & PROC_ID
+ PUSH Proc_ID ; set process id
+ POP ES:[DI].sf_PID
+ clc
+ ret ; carry is clear
+EndProc SFTFromFCB
+
+Break <FCBHardErr - generate INT 24 for hard errors on FCBS>
+;
+;----------------------------------------------------------------------------
+;
+; FCBHardErr - signal to a user app that he is trying to use an
+; unavailable FCB.
+;
+; Inputs: none.
+; Outputs: none.
+; Registers modified: all
+;
+;----------------------------------------------------------------------------
+;
+
+Procedure FCBHardErr,NEAR
+ Assume SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+
+ MOV AX,error_FCB_Unavailable
+ MOV ES:[ALLOWED],allowed_FAIL
+; LES BP,ES:[THISDPB]
+ MOV DI,1 ; Fake some registers
+ MOV CX,DI
+; MOV DX,ES:[BP.dpb_first_sector]
+ invoke HARDERR
+ STC
+ return
+EndProc FCBHardErr
+
+DOSCODE ENDS
+END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/fcbio2.asm b/private/mvdm/dos/v86/doskrnl/dos/fcbio2.asm
new file mode 100644
index 000000000..7054321bf
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/fcbio2.asm
@@ -0,0 +1,844 @@
+; SCCSID = @(#)fcbio2.asm 1.2 85/07/23
+ TITLE FCBIO2 - FCB system calls
+ NAME FCBIO2
+
+;** FCBIO2.ASM - Ancient 1.0 1.1 FCB system calls
+;
+; GetRR
+; GetExtent
+; SetExtent
+; GetExtended
+; GetRecSize
+; FCBIO
+; $FCB_OPEN
+; $FCB_CREATE
+; $FCB_RANDOM_WRITE_BLOCK
+; $FCB_RANDOM_READ_BLOCK
+; $FCB_SEQ_READ
+; $FCB_SEQ_WRITE
+; $FCB_RANDOM_READ
+; $FCB_RANDOM_WRITE
+;
+; Revision history:
+;
+; Sudeep Bharati 19-Nov-1991 Ported on NT
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include cpmfcb.inc
+ include filemode.inc
+ include bugtyp.inc
+ include dossvc.inc
+ .cref
+ .list
+
+
+ I_need WFP_Start,WORD ; pointer to beginning of expansion
+ I_need DMAAdd,DWORD ; current user's DMA address
+ I_need OpenBuf,128 ; buffer for translating paths
+ I_need ThisSFT,DWORD ; SFT in use
+ I_need sftFCB,DWORD ; pointer to SFTs for FCB cache
+ I_need FCBLRU,WORD ; least recently used count
+ I_need DISK_FULL,BYTE ; flag for disk full
+
+ I_need LocalSFT,DWORD ;Cache for new FCB implementation
+
+; Defintions for FCBOp flags
+
+Random = 2 ; random operation
+FCBRead = 4 ; doing a read
+Block = 8 ; doing a block I/O
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+ EXTRN DOS_Read:NEAR, DOS_Write:NEAR
+ EXTRN DOS_Open:NEAR
+ EXTRN DOS_Create:NEAR
+
+
+ Break <GetRR - return the random record field in DX:AX>
+;---------------------------------------------------------------------------
+;
+;
+; GetRR - correctly load DX:AX with the random record field (3 or 4 bytes)
+; from the FCB pointed to by DS:SI
+;
+; Inputs: DS:SI point to an FCB
+; BX has record size
+; Outputs: DX:AX contain the contents of the random record field
+; Registers modified: none
+;---------------------------------------------------------------------------
+
+Procedure GetRR,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AX,WORD PTR [SI.FCB_RR] ; get low order part
+ MOV DX,WORD PTR [SI.FCB_RR+2] ; get high order part
+ CMP BX,64 ; ignore MSB of RR if recsiz > 64
+ JB GetRRBye
+ XOR DH,DH
+GetRRBye:
+ return
+EndProc GetRR
+
+Break <GetExtent - retrieve next location for sequential IO>
+;---------------------------------------------------------------------------
+;
+; GetExtent - Construct the next record to perform I/O from the EXTENT and
+; NR fields in the FCB.
+;
+; Inputs: DS:SI - point to FCB
+; Outputs: DX:AX contain the contents of the random record field
+; Registers modified: none
+;---------------------------------------------------------------------------
+
+Procedure GetExtent,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,[SI.fcb_NR] ; get low order piece
+ MOV DX,[SI.fcb_EXTENT] ; get high order piece
+ SHL AL,1
+ SHR DX,1
+ RCR AL,1 ; move low order bit of DL to high order of AH
+ MOV AH,DL
+ MOV DL,DH
+ XOR DH,DH
+ return
+EndProc GetExtent
+
+Break <SetExtent - update the extent/NR field>
+;---------------------------------------------------------------------------
+;
+; SetExtent - change the position of an FCB by filling in the extent/NR
+; fields
+;
+; Inputs: DS:SI point to FCB
+; DX:AX is a record location in file
+; Outputs: Extent/NR fields are filled in
+; Registers modified: CX
+;---------------------------------------------------------------------------
+
+Procedure SetExtent,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <AX,DX>
+ MOV CX,AX
+ AND AL,7FH ; next rec field
+ MOV [SI.fcb_NR],AL
+ AND CL,80H ; save upper bit
+ SHL CX,1
+ RCL DX,1 ; move high bit of CX to low bit of DX
+ MOV AL,CH
+ MOV AH,DL
+ MOV [SI.fcb_EXTENT],AX ; all done
+ RESTORE <DX,AX>
+ return
+EndProc SetExtent
+
+
+Break <GetExtended - find FCB in potential extended fcb>
+;---------------------------------------------------------------------------
+;
+; GetExtended - Make DS:SI point to FCB from DS:DX
+;
+; Inputs: DS:DX point to a possible extended FCB
+; Outputs: DS:SI point to the FCB part
+; zeroflag set if not extended fcb
+; Registers modified: SI
+;---------------------------------------------------------------------------
+
+Procedure GetExtended,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV SI,DX ; point to Something
+ CMP BYTE PTR DS:[SI],-1 ; look for extention
+ JNZ GetBye ; not there
+ ADD SI,7 ; point to FCB
+GetBye:
+ CMP SI,DX ; set condition codes
+ return
+EndProc GetExtended
+
+
+Break <GetRecSize - return in BX the FCB record size>
+;---------------------------------------------------------------------------
+;
+; GetRecSize - return in BX the record size from the FCB at DS:SI
+;
+; Inputs: DS:SI point to a non-extended FCB
+; Outputs: BX contains the record size
+; Registers modified: None
+;---------------------------------------------------------------------------
+
+Procedure GetRecSize,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV BX,[SI.fcb_RECSIZ] ; get his record size
+ OR BX,BX ; is it nul?
+ retnz
+ MOV BX,128 ; use default size
+ MOV [SI.fcb_RECSIZ],BX ; stuff it back
+ return
+EndProc GetRecSize
+
+BREAK <FCBIO - do internal FCB I/O>
+;---------------------------------------------------------------------------
+;
+; FCBIO - look at FCBOP and merge all FCB operations into a single routine.
+;
+; Inputs: FCBOP flags which operations need to be performed
+; DS:DX point to FCB
+; CX may have count of number of records to xfer
+; Outputs: AL has error code
+; Registers modified: all
+;---------------------------------------------------------------------------
+
+Procedure FCBIO,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+PUBLIC FCBIO001S,FCBIO001E
+FCBIO001S:
+ LocalVar FCBErr,BYTE
+ LocalVar cRec,WORD
+ LocalVar RecPos,DWORD
+ LocalVar RecSize,WORD
+ LocalVar bPos,DWORD
+ LocalVar cByte,WORD
+ LocalVar cResult,WORD
+ LocalVar cRecRes,WORD
+ LocalVar FCBOp,BYTE
+FCBIO001E:
+ Enter
+
+FEOF EQU 1
+FTRIM EQU 2
+ MOV FCBOp,AL
+ MOV FCBErr,0 ; FCBErr = 0;
+ invoke GetExtended ; FCB = GetExtended ();
+ TESTB FCBOp,BLOCK ; if ((OP&BLOCK) == 0)
+ JNZ GetPos
+ MOV CX,1 ; cRec = 1;
+GetPos:
+ MOV cRec,CX ;*Tail coalesce
+ invoke GetExtent ; RecPos = GetExtent ();
+ invoke GetRecSize ; RecSize = GetRecSize ();
+ MOV RecSize,BX
+ TESTB FCBOp,RANDOM ; if ((OP&RANDOM) <> 0)
+ JZ GetRec
+ invoke GetRR ; RecPos = GetRR ();
+GetRec:
+ MOV RecPosL,AX ;*Tail coalesce
+ MOV RecPosH,DX
+ invoke SetExtent ; SetExtent (RecPos);
+ MOV AX,RecPosH ; bPos = RecPos * RecSize;
+ MUL BX
+ MOV DI,AX
+ MOV AX,RecPosL
+ MUL BX
+ ADD DX,DI
+ MOV bPosL,AX
+ MOV bPosH,DX
+ MOV AX,cRec ; cByte = cRec * RecSize;
+ MUL BX
+ MOV cByte,AX
+
+ ADD AX,WORD PTR DMAAdd ; if (cByte+DMA > 64K) {
+ ADC DX,0
+ JZ DoOper
+ MOV FCBErr,FTRIM ; FCBErr = FTRIM;
+
+ MOV AX,WORD PTR DMAAdd ; cRec = (64K-DMA)/RecSize;
+ NEG AX
+ JNZ DoDiv
+ DEC AX
+DoDiv:
+ XOR DX,DX
+ DIV BX
+ MOV cRec,AX
+ MUL BX ; cByte = cRec * RecSize;
+ MOV cByte,AX ; }
+DoOper:
+ XOR BX,BX
+ MOV cResult,BX ; cResult = 0;
+ CMP cByte,BX ; if (cByte <> 0 ||
+ JNZ DoGetExt
+ TESTB FCBErr,FTRIM ; (FCBErr&FTRIM) == 0) {
+ JZ DoGetExt
+ JMP SkipOp
+
+DoGetExt:
+ invoke SFTFromFCB ; if (!SFTFromFCB (SFT,FCB))
+ JNC ContinueOp
+FCBDeath:
+ invoke FCB_Ret_Err ; signal error, map for extended
+ MOV cRecRes,0 ; no bytes transferred
+ MOV FCBErr,FEOF ; return FTRIM;
+ JMP FCBSave ; bam!
+ContinueOp:
+ Assert ISSFT,<ES,DI>,"ContinueOP"
+ MOV AX,WORD PTR [SI].fcb_filsiz
+ MOV WORD PTR ES:[DI].sf_size,AX
+ MOV AX,WORD PTR [SI].fcb_filsiz+2
+ MOV WORD PTR ES:[DI].sf_size+2,AX
+ MOV AX,bPosL
+ MOV DX,bPosH
+ MOV WORD PTR ES:[DI.sf_position],AX
+ XCHG WORD PTR ES:[DI.sf_position+2],DX
+ PUSH DX ; save away Open age.
+ MOV CX,cByte ; cResult =
+
+
+ mov ax,es:[dI].sf_flags
+ and ax, devid_device ; file or device
+ jnz FCBIODev
+
+FCBIOFile:
+; MOV AL,BYTE PTR ES:[DI.sf_mode]
+; AND AL,access_mask
+; TESTB FCBOp,FCBRead ; Is Read Operation
+; JNZ testread
+
+; CMP AL,open_for_write
+
+; JNE testok ;Is read or both
+;BadMode:
+; POP DX ; clean-up the stack
+; Leave
+; transfer SET_ACC_ERR
+
+;testread:
+; CMP AL,open_for_read
+; JNE Check_FCB_RO ;Is write or both
+; JMP BadMode ; Can't write to Read_Only files via FCB
+
+;
+; NOTE: The following check for writting to a Read Only File is performed
+; ONLY on FCBs!!!!
+; We ALLOW writes to Read Only files via handles to allow a CREATE
+; of a read only file which can then be written to.
+; This is OK because we are NOT ALLOWED to OPEN a RO file via handles
+; for writting, or RE-CREATE an EXISTING RO file via handles. Thus,
+; CREATing a NEW RO file, or RE-CREATing an existing file which
+; is NOT RO to be RO, via handles are the only times we can write
+; to a read-only file.
+;
+;Check_FCB_RO:
+; TESTB ES:[DI].sf_attr,attr_read_only
+; JNZ BadMode ; Can't write to Read_Only files via FCB
+;testok:
+ SAVE <BP,DI,SI>
+
+ MOV dx,bPosL
+ MOV si,bPosH ; si:dx is offset
+ mov bx,1 ; Assume Read operation
+ TESTB FCBOp,FCBRead ; Is Read Operation
+ JNZ FCBIOCommon
+ xor bx,bx ; write operation
+FCBIOCommon: ; Input:
+
+ mov bp,word ptr es:[di].sf_NTHandle
+ mov ax,word ptr es:[di].sf_NTHandle+2
+ mov di,si
+ HRDSVC SVC_DEMFCBIO ; BX = 1 if read, 0 if write operation
+ ; AX:BP is the NT Handle
+ ; DI:DX is offset
+ ; CX is count to read/write
+ ; Output:
+ ; CY Clear, CX is count;AX:BX is size
+ ; CY Set, CX =0 ; AX has error code
+ RESTORE <SI,DI,BP>
+ jmp devfile
+
+FCBIODev:
+ MOV DI,OFFSET DOSCODE:DOS_Read ; *(OP&FCBRead ? DOS_Read
+ TESTB FCBOp,FCBRead ; : DOS_Write)(cRec);
+ JNZ DoContext
+
+ MOV DI,OFFSET DOSCODE:DOS_Write
+DoContext:
+ SAVE <BP,DS,SI>
+
+ Context DS
+ CALL DI
+ RESTORE <SI,DS,BP>
+ ASSUME DS:NOTHING
+
+ JNC devcont
+ JMP FCBDeath
+devcont:
+ xor ax, ax ; AX:BX is size of file in FCBio10, but
+ xor bx, bx ; DOS_WRITE or DOS_READ destroys these regs(YST)
+
+ JMP short fcbio10
+
+devfile:
+ JNC fcbio10
+ JMP FCBDeath
+fcbio10:
+ MOV cResult,CX
+ SAVE <AX,BX>
+ invoke UpdateLRU ;Update LRU
+ RESTORE <BX,AX>
+; BUGBUG - why not just use the SF_OPENAGE symbol?
+ .errnz SF_POSITION+2-SF_OPENAGE
+ POP WORD PTR ES:[DI].sf_Position+2 ; restore open age
+ MOV WORD PTR [SI].fcb_filsiz,BX
+ MOV WORD PTR [SI].fcb_filsiz+2,AX
+SkipOp:
+ MOV AX,cResult ; cRecRes = cResult / RecSize;
+ XOR DX,DX
+ DIV RecSize
+ MOV cRecRes,AX
+ ADD RecPosL,AX ; RecPos += cRecResult;
+ ADC RecPosH,0
+;
+; If we have not gotten the expected number of records, we signal an EOF
+; condition. On input, this is EOF. On output this is usually disk full.
+; BUT... Under 2.0 and before, all device output IGNORED this condition. So
+; do we.
+;
+ CMP AX,cRec ; if (cRecRes <> cRec)
+ JZ TryBlank
+ TESTB FCBOp,FCBRead ; if (OP&FCBRead || !DEVICE)
+ JNZ SetEOF
+ TESTB ES:[DI].sf_flags,devid_device
+ JNZ TryBlank
+SetEOF:
+ MOV FCBErr,FEOF ; FCBErr = FEOF;
+TryBlank: ;
+ OR DX,DX ; if (cResult%RecSize <> 0) {
+ JZ SetExt
+ ADD RecPosL,1 ; RecPos++;
+ ADC RecPosH,0
+ TESTB FCBOp,FCBRead ; if(OP&FCBRead) <> 0) {
+ JZ SetExt
+ INC cRecRes ; cRecRes++;
+ MOV FCBErr,FTRIM + FEOF ; FCBErr = FTRIM | FEOF;
+ MOV CX,RecSize ; Blank (RecSize-cResult%RecSize,
+ SUB CX,DX ; DMA+cResult);
+ XOR AL,AL
+
+;hkn; SS override
+ LES DI,DMAAdd
+ ADD DI,cResult
+ REP STOSB ; } }
+SetExt:
+ MOV DX,RecPosH
+ MOV AX,RecPosL
+ TESTB FCBOp,RANDOM ; if ((OP&Random) == 0 ||
+ JZ DoSetExt
+ TESTB FCBOp,BLOCK ; (OP&BLOCK) <> 0)
+ JZ TrySetRR
+DoSetExt:
+ invoke SetExtent ; SetExtent (RecPos, FCB);
+TrySetRR:
+ TESTB FCBOp,BLOCK ; if ((op&BLOCK) <> 0)
+ JZ TryReturn
+ MOV WORD PTR [SI.FCB_RR],AX ; FCB->RR = RecPos;
+ MOV BYTE PTR [SI.FCB_RR+2],DL
+ CMP [SI.fcb_RECSIZ],64
+ JAE TryReturn
+ MOV [SI+fcb_RR+2+1],DH ; Set 4th byte only if record size < 64
+TryReturn:
+ TESTB FCBOP,FCBRead ; if (!(FCBOP & FCBREAD)) {
+ JNZ FCBSave
+ SAVE <DS> ; FCB->FDate = date;
+ SVC SVC_DEMDATE16 ; FCB->FTime = time;
+ RESTORE <DS>
+ MOV [SI].FCB_FDate,AX
+ MOV [SI].FCB_FTime,DX ; }
+FCBSave:
+ TESTB FCBOp,BLOCK ; if ((op&BLOCK) <> 0)
+ JZ DoReturn
+ MOV CX,cRecRes ; user_CX = cRecRes;
+ invoke Get_User_Stack
+ MOV [SI.User_CX],CX
+DoReturn:
+ MOV AL,FCBErr ; return (FCBERR);
+ Leave
+ return
+EndProc FCBIO
+
+Break <$FCB_Open - open an old-style FCB>
+;---------------------------------------------------------------------------
+;
+; $FCB_Open - CPM compatability file open. The user has formatted an FCB
+; for us and asked to have the rest filled in.
+;
+; Inputs: DS:DX point to an unopenned FCB
+; Outputs: AL indicates status 0 is ok FF is error
+; FCB has the following fields filled in:
+; Time/Date Extent/NR Size
+;---------------------------------------------------------------------------
+
+Procedure $FCB_Open,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AX,sharing_Compat+Open_For_Both
+
+;hkn; DOS_Open is in DOSCODE
+ MOV CX,OFFSET DOSCODE:DOS_Open
+;
+; The following is common code for Creation and openning of FCBs. AX is
+; either attributes (for create) or open mode (for open)... DS:DX points to
+; the FCB
+;
+DoAccess:
+ SAVE <DS,DX,CX,AX> ; save FCB pointer away
+
+ MOV DI,OFFSET DOSDATA:OpenBuf
+ invoke TransFCB ; crunch the fcb
+ mov bx,ax ; save dev/file/unc code; ax = 0 for devices
+ RESTORE <AX,CX,DX,DS> ; get fcb
+ JNC FindFCB ; everything seems ok
+FCBOpenErr:
+ transfer FCB_Ret_Err
+FindFCB:
+ push bx
+ invoke GetExtended ; DS:SI will point to FCB
+
+ push ax
+ mov al,1 ;indicate Open/Create operation
+ invoke LRUFCB ; get a sft entry (no error)
+ pop ax
+ pop bx ; BX has return code from TransFCB
+
+ JNC fcbo10
+ JMP HardMessage
+fcbo10:
+ ASSUME ES:NOTHING
+
+; Message 1,"Entering "
+; MessageNum ES
+; Message 1,":"
+; MessageNum DI
+; Message 1,<13,10>
+
+ MOV ES:[DI].sf_mode,sf_ISFCB
+ push bp
+ push dx
+ push ds
+ push si ;SAVE <DS,SI> save fcb pointer
+ MOV SI,CX
+
+;hkn; SS is DOSDATA
+ Context DS ; let DOS_Open see variables
+ or bx,bx ; IF BX == 0 Then its a device
+ jz DODeviceFCB
+
+; invoke DOS_Open_Checks
+; JC failopen
+ mov si,WFP_START
+ cmp cx,OFFSET DOSCODE:DOS_Create
+ jne OpenCallFCB
+
+ HRDSVC SVC_DEMCREATEFCB ; Input - AX = Create Modes,
+ ; DS:SI - PathName
+ ; Output- CY = 0 SUCCESS
+ ; AX:BP - NT handle
+ ; BX - Time
+ ; CX - Date
+ ; DX:SI - Size
+ jmp short commonFCB
+
+OpenCallFCB:
+
+ mov bx,ax ; AX = Open Modes
+ HRDSVC SVC_DEMOPENFCB ; Rest same as SVC_DEMCREATEFCB
+
+CommonFCB:
+
+ LES DI,ThisSFT
+ jc failopen
+ mov word ptr es:[di].sf_NTHandle,bp ; Store NT handle in SFT
+ mov word ptr es:[di].sf_NTHandle+2,ax
+ mov word ptr es:[di].sf_time,bx
+ mov word ptr es:[di].sf_date,cx
+ mov word ptr es:[di].sf_size,si
+ mov word ptr es:[di].sf_size+2,dx
+ and byte ptr es:[dI].sf_flags, not devid_device ; Mark it file
+ pop si
+ pop ds
+ mov word ptr ds:[si].fcb_res_Sig,bp
+ mov word ptr ds:[si].fcb_res_Sig+2,ax ; Store NT handle in FCB as a signature
+ mov byte ptr ds:[si].fcb_res_dev,0 ; FCB for a file
+ jmp FCBOK
+
+
+DODeviceFCB:
+ CALL SI ; go open the file
+ ASSUME DS:NOTHING
+
+;hkn; SS override
+ LES DI,ThisSFT ; get sf pointer
+ JC failopen
+ pop si
+ pop ds
+ mov byte ptr ds:[si].fcb_res_dev,1 ; FCB for a device
+ mov ax,word ptr es:[di].sf_devptr
+ mov word ptr ds:[si].fcb_res_Sig,ax
+ mov ax,word ptr es:[di].sf_devptr+2
+ mov word ptr ds:[si].fcb_res_Sig+2,ax
+ JMP short FCBOK
+
+failopen:
+ pop si
+ pop ds
+ pop dx
+ pop bp
+ PUSH AX
+ MOV AL,"R" ; clear out field (free sft)
+ invoke BlastSFT
+ POP AX
+ CMP AX,error_too_many_open_files
+ JZ HardMessage
+ CMP AX,error_sharing_buffer_exceeded
+ jnz DeadFCB
+HardMessage:
+ PUSH AX
+ invoke FCBHardErr
+ POP AX
+DeadFCB:
+ transfer FCB_Ret_Err
+
+FCBOK:
+ pop dx
+ pop bp
+ mov word ptr LocalSFT,di ;
+ mov word ptr LocalSFT+2,es ; Store the SFT address
+
+ INC ES:[DI].sf_ref_count ; increment reference count
+ invoke SaveFCBInfo
+ Assert ISSFT,<ES,DI>,"FCBOK"
+
+ TESTB ES:[DI].sf_flags,devid_device
+ JNZ FCBNoDrive ; do not munge drive on devices
+ MOV AL,DS:[SI] ; get drive byte
+ invoke GetThisDrv ; convert
+ INC AL
+ MOV DS:[SI],AL ; stash in good drive letter
+FCBNoDrive:
+ MOV [SI].FCB_RecSiz,80h ; stuff in default record size
+ MOV AX,ES:[DI].SF_Time ; set time
+ MOV [SI].FCB_FTime,AX
+ MOV AX,ES:[DI].SF_Date ; set date
+ MOV [SI].FCB_FDate,AX
+ MOV AX,WORD PTR ES:[DI].SF_Size ; set sizes
+ MOV [SI].FCB_FILSIZ,AX
+ MOV AX,WORD PTR ES:[DI].SF_Size+2
+ MOV [SI].FCB_FILSIZ+2,AX
+ XOR AX,AX ; convenient zero
+ MOV [SI].FCB_Extent,AX ; point to beginning of file
+;
+; We must scan the set of FCB SFTs for one that appears to match the current
+; one. We cheat and use CheckFCB to match the FCBs.
+;
+
+;hkn; SS override
+ LES DI,SFTFCB ; get the pointer to head of the list
+ MOV AH,BYTE PTR ES:[DI].sfCount ; get number of SFTs to scan bp
+OpenScan:
+ CMP AL,[SI].fcb_sfn ; don't compare ourselves
+ JZ SkipCheck
+ SAVE <AX> ; preserve count
+
+ invoke CheckFCB ; do they match
+ RESTORE <AX> ; get count back
+ JNC OpenFound ; found a match!
+SkipCheck:
+ INC AL ; advance to next FCB
+ CMP AL,AH ; table full?
+ JNZ OpenScan ; no, go for more
+OpenDone:
+ xor al,al ; return success
+ return
+;
+; The SFT at ES:DI is the one that is already in use for this FCB. We set the
+; FCB to use this one. We increment its ref count. We do NOT close it at all.
+; Consider:
+;
+; open (foo) delete (foo) open (bar)
+;
+; This causes us to recycle (potentially) bar through the same local SFT as
+; foo even though foo is no longer needed; this is due to the server closing
+; foo for us when we delete it. Unfortunately, we cannot see this closure.
+; If we were to CLOSE bar, the server would then close the only reference to
+; bar and subsequent I/O would be lost to the redirector.
+;
+; This gets solved by NOT closing the sft, but zeroing the ref count
+; (effectively freeing the SFT) and informing the sharer (if relevant) that
+; the SFT is no longer in use. Note that the SHARER MUST keep its ref counts
+; around. This will allow us to access the same file through multiple network
+; connections and NOT prematurely terminate when the ref count on one
+; connection goes to zero.
+;
+OpenFound:
+ MOV [SI].fcb_SFN,AL ; assign with this
+; INC ES:[DI].sf_ref_count ; remember this new invocation
+ MOV AX,FCBLRU ; update LRU counts
+ MOV ES:[DI].sf_LRU,AX
+;
+; We have an FCB sft that is now of no use. We release sharing info and then
+; blast it to prevent other reuse.
+;
+
+;hkn; SS is DOSDATA
+ context DS
+ LES DI,ThisSFT
+ mov si,word ptr es:[di].sf_NTHandle
+ mov ax,word ptr es:[di].sf_NTHandle+2
+ HRDSVC SVC_DEMCLOSEFCB
+
+ DEC ES:[DI].sf_ref_count ; free the newly allocated SFT
+; invoke ShareEnd
+ Assert ISSFT,<ES,DI>,"Open blasting"
+ MOV AL,'C'
+ invoke BlastSFT
+ JMP OpenDone
+EndProc $FCB_Open
+
+BREAK <$FCB_Create - create a new directory entry>
+;----------------------------------------------------------------------------
+;
+; $FCB_Create - CPM compatability file create. The user has formatted an
+; FCB for us and asked to have the rest filled in.
+;
+; Inputs: DS:DX point to an unopenned FCB
+; Outputs: AL indicates status 0 is ok FF is error
+; FCB has the following fields filled in:
+; Time/Date Extent/NR Size
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Create,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV CX,OFFSET DOSCODE:DOS_Create ; routine to call
+ XOR AX,AX ; attributes to create
+ invoke GetExtended ; get extended FCB
+ JZ DoAccessJ ; not an extended FCB
+ MOV AL,[SI-1] ; get attributes
+DoAccessJ:
+ JMP DoAccess ; do dirty work
+EndProc $FCB_Create
+
+BREAK <$FCB_Random_write_Block - write a block of records to a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Random_Write_Block - retrieve a location from the FCB, seek to it
+; and write a number of blocks from it.
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = 0 write was successful and the FCB position is updated
+; AL <> 0 Not enough room on disk for the output
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Random_Write_Block,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,Random+Block
+ JMP FCBIO
+
+EndProc $FCB_Random_Write_Block
+
+BREAK <$FCB_Random_Read_Block - read a block of records to a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Random_Read_Block - retrieve a location from the FCB, seek to it
+; and read a number of blocks from it.
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = error codes defined above
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Random_Read_Block,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,Random+FCBRead+Block
+ JMP FCBIO
+
+EndProc $FCB_Random_Read_Block
+
+BREAK <$FCB_Seq_Read - read the next record from a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Seq_Read - retrieve the next record from an FCB and read it into
+; memory
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = error codes defined above
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Seq_Read,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,FCBRead
+ JMP FCBIO
+
+EndProc $FCB_Seq_Read
+
+BREAK <$FCB_Seq_Write - write the next record to a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Seq_Write - retrieve the next record from an FCB and write it to the
+; file
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = error codes defined above
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Seq_Write,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,0
+ jmp FCBIO
+
+EndProc $FCB_SEQ_WRITE
+
+BREAK <$FCB_Random_Read - Read a single record from a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Random_Read - retrieve a location from the FCB, seek to it and read a
+; record from it.
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = error codes defined above
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Random_Read,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,Random+FCBRead
+ jmp FCBIO ; single block
+
+EndProc $FCB_RANDOM_READ
+
+BREAK <$FCB_Random_Write - write a single record to a file >
+;----------------------------------------------------------------------------
+;
+; $FCB_Random_Write - retrieve a location from the FCB, seek to it and write
+; a record to it.
+;
+; Inputs: DS:DX point to an FCB
+; Outputs: AL = error codes defined above
+;
+;----------------------------------------------------------------------------
+
+Procedure $FCB_Random_Write,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,Random
+ jmp FCBIO
+
+EndProc $FCB_RANDOM_WRITE
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/file.asm b/private/mvdm/dos/v86/doskrnl/dos/file.asm
new file mode 100644
index 000000000..7517571e1
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/file.asm
@@ -0,0 +1,906 @@
+ TITLE FILE - Pathname related system calls
+ NAME FILE
+
+;** FILE.ASM - Pathname Related System Calls
+;
+; $Open
+; $Creat
+; $ChMod
+; $Unlink
+; $Rename
+; $CreateTempFile
+; $CreateNewFile
+; $Extended_Open
+;
+; Revision history:
+;
+; sudeepb 06-Mar-1991 Ported for DOSEm.
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include sf.inc
+ include filemode.inc
+ include bugtyp.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ I_need WFP_Start,WORD ; pointer to beginning of expansion
+ I_Need ThisCDS,DWORD ; pointer to curdir in use
+ I_need ThisSft,DWORD ; SFT pointer for DOS_Open
+ I_need pJFN,DWORD ; temporary spot for pointer to JFN
+ I_need JFN,WORD ; word JFN for process
+ I_need SFN,WORD ; word SFN for process
+ I_Need OpenBuf,128 ; buffer for filename
+ I_Need RenBuf,128 ; buffer for filename in rename
+ I_need Sattrib,BYTE ; byte attribute to search for
+ I_need Ren_WFP,WORD ; pointer to real path
+ I_need cMeta,BYTE
+ I_need EXTERR,WORD ; extended error code
+ I_need EXTERR_LOCUS,BYTE ; Extended Error Locus
+ I_need EXTERR_CLASS,BYTE
+ I_need EXTERR_ACTION set
+ i_need JShare,DWORD ; share jump table
+ I_need fSharing,BYTE ; TRUE => via ServerDOSCall
+ I_need FastOpenTable,BYTE
+ I_need CPSWFLAG,BYTE ;AN000;FT. cpsw falg
+ I_need EXTOPEN_FLAG,WORD ;AN000;FT. extended file open flag
+ I_need EXTOPEN_ON,BYTE ;AN000;FT. extended open flag
+ I_need EXTOPEN_IO_MODE,WORD ;AN000;FT. IO mode
+ I_need SAVE_ES,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_DI,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_DS,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_SI,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_DX,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_BX,WORD ;AN000;;FT. for get/set XA
+ I_need SAVE_CX,WORD ;AN000;;FT. for get/set XA
+ I_need Temp_Var,WORD ;AN000;;
+ I_need DOS34_FLAG,WORD ;AN000;;
+ I_need Temp_Var2,WORD ;AN000;;
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+ EXTRN DOS_OPEN:NEAR
+ EXTRN DOS_Create:NEAR
+ EXTRN DOS_Create_New:NEAR
+
+ EXTRN SFNFree:near
+
+ BREAK <$Open - open a file from a path string>
+
+
+;** $OPen - Open a File
+;
+; given a path name in DS:DX and an open mode in AL, $Open opens the
+; file and and returns a handle
+;
+; ENTRY (DS:DX) = pointer to asciz name
+; (AL) = open mode
+; EXIT 'C' clear if OK
+; (ax) = file handle
+; 'C' set iff error
+; (ax) = error code
+; USES all
+
+Procedure $Open,NEAR
+ DOSAssume <SS>,"Open"
+
+ XOR AH,AH
+Entry $Open2 ;AN000;
+ mov ch,attr_hidden+attr_system+attr_directory
+ call SetAttrib
+ MOV CX,OFFSET DOSCODE:DOS_Open ; address of routine to call
+ SAVE <AX> ; Save mode on stack
+IFDEF DBCS ;AN000;
+ MOV Temp_Var,0 ;AN000;KK. set variable with 0;smr;SS Override
+ENDIF ;AN000;
+
+
+;* General file open/create code. The $CREATE call and the various
+; $OPEN calls all come here.
+;
+; We'll share a lot of the standard stuff of allocating SFTs, cracking
+; path names, etc., and then dispatch to our individual handlers.
+; WARNING - this info and list is just a guess, not definitive - jgl
+;
+; (TOS) = create mode
+; (CX) = address of routine to call to do actual function
+; (DS:DX) = ASCIZ name
+; SAttrib = Attribute mask
+
+; Get a free SFT and mark it "being allocated"
+
+AccessFile:
+IFDEF DBCS ;AN000;
+ TEST Temp_Var,ATTR_VOLUME_ID ; volume id bit set?
+ JZ novol
+ OR [DOS34_FLAG],DBCS_VOLID ; warn transpath about VOLID
+novol:
+ENDIF
+ call SFNFree ; get a free sfn
+ JC OpenFailJ ; oops, no free sft's
+ mov es:[di.sf_flags],0 ; Clear flags
+ MOV SFN,BX ; save the SFN for later;smr;SS Override
+ MOV WORD PTR ThisSFT,DI ; save the SF offset ;smr;SS Override
+ MOV WORD PTR ThisSFT+2,ES ; save the SF segment ;smr;SS Override
+
+; Find a free area in the user's JFN table.
+
+ invoke JFNFree ; get a free jfn
+ JNC SaveJFN
+OpenFailJ:
+ JMP OpenFail ; there were free JFNs... try SFN
+
+SaveJFN:MOV WORD PTR pJFN,DI ; save the jfn offset ;smr;SS Override
+ MOV WORD PTR pJFN+2,ES ; save the jfn segment ;smr;SS Override
+ MOV JFN,BX ; save the jfn itself ;smr;SS Override
+
+; We have been given an JFN. We lock it down to prevent other tasks from
+; reusing the same JFN.
+
+ MOV BX,SFN ;smr;SS Override
+ MOV ES:[DI],BL ; assign the JFN
+ MOV SI,DX ; get name in appropriate place
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+ SAVE <CX> ; save routine to call
+ invoke TransPath ; convert the path ; AX has return value
+ mov dx,ax
+ RESTORE <BX> ; (bx) = routine to call
+ LDS SI,ThisSFT ;smr;SS Override
+ ASSUME DS:NOTHING
+ JC OpenCleanJ ; no error, go and open file
+ CMP cMeta,-1 ;smr;SS Override
+ JZ SetSearch
+ MOV AL,error_file_not_found ; no meta chars allowed
+OpenCleanJ:
+ JMP OpenClean
+
+SetSearch:
+ RESTORE <AX> ; Mode (Open), Attributes (Create)
+
+; We need to get the new inheritance bits.
+
+ xor cx,cx
+ MOV [SI].sf_mode,cx ; initialize mode field to 0
+ CMP BX,OFFSET DOSCODE:DOS_OPEN
+ JNZ DoOper
+ TEST AL,sharing_no_inherit ; look for no inher
+ JZ DoOper
+ AND AL,07Fh ; mask off inherit bit
+ MOV CX,sf_no_inherit
+DoOper:
+
+;** Check if this is an extended open. If so you must set the
+; modes in sf_mode. Call Set_EXT_mode to do all this.
+
+ SAVE <di, es> ;M022 conditional removed here
+ push ds
+ pop es
+ push si
+ pop di ; (es:di) = SFT address
+ call Set_EXT_mode
+ RESTORE <es, di>
+
+ Context DS
+ or dx,dx ; IF DX == 0 Then its a device
+ jnz cont_bop
+ jmp DODevice
+cont_bop:
+ SAVE <BX,CX,DX> ; else its a file or UNC
+ mov si,WFP_START ; default operation. it will
+ ; come as 1 if pipe was opened.
+ push bp
+ xor dx,dx
+ cmp bx,OFFSET DOSCODE:DOS_Create
+ je CreateCall
+ cmp bx,OFFSET DOSCODE:DOS_Create_New
+ jne OpenCall
+ mov cx,ax ; cx = Create Modes
+ HRDSVC SVC_DEMCREATENEW ; Create New File
+ jmp short common
+CreateCall:
+ mov cx,ax ; CX = Create Modes
+ HRDSVC SVC_DEMCREATE ; Create File
+ jmp short common
+OpenCall:
+ mov bx,ax ; BX + Open Modes
+ xor ax,ax ; NO EAs
+ HRDSVC SVC_DEMOPEN ; Open File or UNC
+Common:
+ mov di,bp
+ pop bp
+ LDS SI,ThisSFT
+ jc err_tmp
+ mov word ptr [si].sf_NTHandle,di
+ mov word ptr [si].sf_NTHandle+2,ax
+ mov word ptr [si].sf_Position,0
+ mov word ptr [si].sf_Position+2,0
+ mov word ptr [si].sf_size,cx
+ mov word ptr [si].sf_size+2,bx
+ or dx,dx
+ jz not_a_Pipe
+ or [SI].sf_flags,sf_pipe
+not_a_pipe:
+ RESTORE <DX,CX,BX>
+ push ds
+ Context DS
+ mov di,WFP_START
+ cmp byte ptr ds:[di],'A'
+ jb no_drv
+ cmp byte ptr ds:[di],'Z'
+ ja no_drv
+ mov al,byte ptr ds:[di]
+ sub al,'A'
+ xor ah,ah
+ pop ds
+ or [SI].sf_flags,ax ; Mark the driv
+ jmp short drive_marked
+no_drv:
+ pop ds
+drive_marked:
+ and [SI].sf_flags, not (devid_device OR sf_nt_seek)
+ jmp OpenOK
+
+err_tmp:
+ RESTORE <DX,CX,BX>
+ jmp short OpenE
+
+DODevice:
+ cmp bx,OFFSET DOSCODE:DOS_Create_New
+ jne opCheck
+ mov ax,error_access_denied
+ jmp OpenE2
+opCheck:
+ cmp bx,OFFSET DOSCODE:DOS_Create
+ jne odev
+ mov bx,OFFSET DOSCODE:DOS_Open
+odev:
+ SAVE <CX>
+ CALL BX ; blam!
+ RESTORE <CX>
+ push AX
+ lahf
+ LDS SI,ThisSFT
+ ASSUME DS:NOTHING
+ or [SI].sf_flags, devid_device ; Mark it file
+ sahf
+ pop ax
+ JC OpenE2 ;AN000;FT. chek extended open hooks first
+
+; The SFT was successfully opened. Remove busy mark.
+
+OpenOK:
+ ASSUME DS:NOTHING
+ MOV [SI].sf_ref_count,1
+ OR [SI].sf_flags,CX ; set no inherit bit if necessary
+
+
+ MOV AX,JFN ; SS Override
+ MOV SFN,-1 ; clear out sfn pointer ;smr;SS Override
+ transfer Sys_Ret_OK ; bye with no errors
+;Extended Open hooks check
+OpenE2:
+ CMP AX,error_invalid_parameter ; IFS extended open ?
+ JNZ OpenE ; no.
+ JMP short OpenCritLeave ;AN000;;EO. keep handle
+
+; Extended Open hooks check
+;
+; AL has error code. Stack has argument to dos_open/dos_create.
+
+OpenClean:
+ RESTORE <bx> ; clean off stack
+OpenE:
+ MOV [SI.SF_Ref_Count],0 ; release SFT
+ LDS SI,pJFN ;smr;SS Override
+ MOV BYTE PTR [SI],0FFh ; free the SFN...
+ JMP SHORT OpenCritLeave
+
+OpenFail:
+ invoke DOSTI
+ RESTORE <CX> ; Clean stack
+OpenCritLeave:
+ MOV SFN,-1 ; remove mark.
+ CMP [EXTERR],error_Code_Page_Mismatched ;code page mismatch;smr;SS Override
+ JNZ NORERR ;no
+ transfer From_GetSet ;yes
+NORERR:
+
+;; File Tagging DOS 4.00
+ transfer Sys_Ret_Err ; no free, return error
+
+EndProc $Open, NoCheck
+
+
+ BREAK <$Creat - create a brand-new file>
+
+
+;** $Creat - Create a File
+;
+; $Creat creates the directory entry specified in DS:DX and gives it the
+; initial attributes contained in CX
+;
+; ENTRY (DS:DX) = ASCIZ path name
+; (CX) = initial attributes
+; EXIT 'C' set if error
+; (ax) = error code
+; 'C' clear if OK
+; (ax) = file handle
+; USES all
+
+Procedure $Creat,NEAR
+ DOSAssume <SS>,"Creat"
+
+IFDEF DBCS ;
+ MOV Temp_Var,CX ; set variable with attribute ;AN000;smr;SS Override
+ENDIF ;
+ SAVE <CX> ; Save attributes on stack
+ MOV CX,OFFSET DOSCODE:DOS_Create ; routine to call
+AccessSet:
+ mov SAttrib,attr_hidden+attr_system
+ JMP AccessFile ; use good ol' open
+
+EndProc $Creat, NoCheck
+
+
+ BREAK <$CHMOD - change file attributes>
+
+;** $CHMOD - Change File Attributes
+;
+; Assembler usage:
+; LDS DX, name
+; MOV CX, attributes
+; MOV AL,func (0=get, 1=set)
+; INT 21h
+; Error returns:
+; AX = error_path_not_found
+; AX = error_access_denied
+;
+
+procedure $CHMOD,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+ SAVE <AX,CX> ; save function and attributes
+ MOV SI,DX ; get things in appropriate places
+ invoke TransPathSet ; get correct path
+ mov dx,ax ; Return value
+ RESTORE <CX,AX> ; and get function and attrs back
+ JC ChModErr ; errors get mapped to path not found
+ Context DS ; set up for later possible calls
+ or dx,dx
+ jz ChModErr_d ; Chmode not allowed on devices
+ CMP cMeta,-1
+ JNZ ChModErr
+ cmp AL,1 ; fast way to discriminate
+ Jbe ChModGo ; 0 -> go get value
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus
+ error error_invalid_function ; bad value
+ChModGo:
+ push ax
+ mov dx,WFP_START ; ds:dx file path
+ HRDSVC SVC_DEMCHMOD
+ pop dx
+ jc ChModE
+ or dl,dl
+ jnz chOK
+ invoke Get_User_stack ; point to user saved vaiables
+ assume DS:NOTHING ;
+ MOV [SI.User_CX],CX ; return the attributes
+chOK:
+ transfer Sys_Ret_OK ; say sayonara
+
+ChModErr_d:
+ MOV AX,error_file_not_found
+ jmp short ChmodE
+
+ChModErr:
+ mov al,error_path_not_found
+ChmodE:
+ Transfer SYS_RET_ERR
+EndProc $ChMod
+
+ BREAK <$UNLINK - delete a file entry>
+
+;** $UNLINK - Delete a File
+;
+;
+; Assembler usage:
+; LDS DX, name
+; MOV AH, Unlink
+; INT 21h
+;
+; ENTRY (ds:dx) = path name
+; EXIT 'C' clear if no error
+; 'C' set if error
+; (ax) = error code
+; = error_file_not_found
+; = error_access_denied
+
+procedure $UNLINK,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV SI,DX ; Point at input string
+ MOV DI,OFFSET DOSDATA:OpenBuf ; temp spot for path
+ invoke TransPathSet ; go get normalized path
+ JNC unl05 ; Good path
+ mov al,error_path_not_found
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus
+ Transfer SYS_RET_ERR
+unl05:
+ or ax,ax
+ jz ChModErr ; Cant unlink device
+ CMP cMeta,-1 ; meta chars?
+ JNZ NotFound
+ Context DS
+ mov dx,WFP_START ; ds:dx is file name
+ HRDSVC SVC_DEMDELETE
+ JC UnlinkE ; error is there
+ xor ax,ax ; stupid DBASE does'nt look at CY
+ transfer Sys_Ret_OK ; okey doksy
+NotFound:
+ MOV AL,error_path_not_found
+UnlinkE:
+ transfer Sys_Ret_Err ; bye
+
+EndProc $UnLink
+
+BREAK <$RENAME - move directory entries around>
+;
+; Assembler usage:
+; LDS DX, source
+; LES DI, dest
+; MOV AH, Rename
+; INT 21h
+;
+; Error returns:
+; AX = error_file_not_found
+; = error_not_same_device
+; = error_access_denied
+
+procedure $RENAME,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <CX,DS,DX> ; save source and possible CX arg
+ PUSH ES
+ POP DS ; move dest to source
+ MOV SI,DI ; save for offsets
+ MOV DI,OFFSET DOSDATA:RenBuf
+
+
+ invoke TransPathSet ; munge the paths
+ PUSH WFP_Start ; get pointer ;smr;SS Override
+ POP Ren_WFP ; stash it ;smr;SS Override
+ RESTORE <SI,DS,CX> ; get back source and possible CX arg
+epjc2: JC ChModErr ; get old error
+ CMP cMeta,-1 ;smr;SS Override
+ JNZ NotFound
+ SAVE <CX> ; Save possible CX arg
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+ invoke TransPathSet ; wham
+ RESTORE <CX>
+ JC EPJC2
+ Context DS
+ CMP cMeta,-1
+ JB NotFound
+
+ PUSH WORD PTR [THISCDS] ;AN000;;MS.save thiscds
+ PUSH WORD PTR [THISCDS+2] ;AN000;;MS.
+ MOV DI,OFFSET DOSDATA:OpenBuf ;AN000;;MS.
+ PUSH SS ;AN000;;MS.
+ POP ES ;AN000;;MS.es:di-> source
+ XOR AL,AL ;AN000;;MS.scan all CDS
+rnloop: ;AN000;
+ invoke GetCDSFromDrv ;AN000;;MS.
+ JC dorn ;AN000;;MS. end of CDS
+ invoke StrCmp ;AN000;;MS. current dir ?
+ JZ rnerr ;AN000;;MS. yes
+ INC AL ;AN000;;MS. next
+ JMP rnloop ;AN000;;MS.
+rnerr: ;AN000;
+ ADD SP,4 ;AN000;;MS. pop thiscds
+ error error_current_directory ;AN000;;MS.
+dorn: ;AN000;
+ POP WORD PTR SS:[THISCDS+2] ;AN000;;MS.;PBUGBUG;SS REQD??
+ POP WORD PTR SS:[THISCDS] ;AN000;;MS.;PBUGBUG;SS REQD??
+ Context DS
+; mov ch,attr_directory+attr_hidden+attr_system; rename appropriate files
+; call SetAttrib
+ push ds
+ pop es
+ mov dx,offset dosdata:OpenBuf
+ mov di,offset dosdata:RenBuf
+ HRDSVC SVC_DEMRENAME ; do the deed
+ JC UnlinkE ; errors
+
+
+ transfer Sys_Ret_OK
+
+EndProc $Rename
+
+Break <$CreateNewFile - Create a new directory entry>
+
+;
+; CreateNew - Create a new directory entry. Return a file handle if there
+; was no previous directory entry, and fail if a directory entry with
+; the same name existed previously.
+;
+; Inputs: DS:DX point to an ASCIZ file name
+; CX contains default file attributes
+; Outputs: Carry Clear:
+; AX has file handle opened for read/write
+; Carry Set:
+; AX has error code
+; Registers modified: All
+
+Procedure $CreateNewFile,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+IFDEF DBCS ;AN000;
+ MOV Temp_Var,CX ;AN000;KK. set variable with attribute;smr;SS Override
+ENDIF ;AN000;
+ SAVE <CX> ; Save attributes on stack
+ MOV CX,OFFSET DOSCODE:DOS_Create_New ; routine to call
+ JMP AccessSet ; use good ol' open
+
+EndProc $CreateNewFile, NoCheck
+
+ Break <BinToAscii - convert a number to a string>
+
+;** BinToAscii - conver a number to a string.
+;
+; BinToAscii converts a 16 bit number into a 4 ascii characters.
+; This routine is used to generate temp file names so we don't spend
+; the time and code needed for a true hex number, we just use
+; A thorugh O.
+;
+; ENTRY (ax) = value
+; (es:di) = destination
+; EXIT (es:di) updated by 4
+; USES cx, di, flags
+
+Procedure BinToAscii,NEAR
+ mov cx,404h ; (ch) = digit counter, (cl) = shift cnt
+bta5: ROL AX,CL ; move leftmost nibble into rightmost
+ SAVE <AX> ; preserve remainder of digits
+ AND AL,0Fh ; grab low nibble
+ ADD AL,'A' ; turn into ascii
+ STOSB ; drop in the character
+ RESTORE <AX> ; (ax) = shifted number
+ dec ch
+ jnz bta5 ; process 4 digits
+ return
+
+EndProc BinToAscii
+
+Break <$CreateTempFile - create a unique name>
+
+;
+; $CreateTemp - given a directory, create a unique name in that directory.
+; Method used is to get the current time, convert to a name and attempt
+; a create new. Repeat until create new succeeds.
+;
+; Inputs: DS:DX point to a null terminated directory name.
+; CX contains default attributes
+; Outputs: Unique name is appended to DS:DX directory.
+; AX has handle
+; Registers modified: all
+
+Procedure $CreateTempFile,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+PUBLIC FILE001S,FILE001E
+FILE001S:
+ LocalVar EndPtr,DWORD
+ LocalVar FilPtr,DWORD
+ LocalVar Attr,WORD
+FILE001E:
+ Enter
+ TEST CX,NOT attr_changeable
+ JZ OKatts ; Ok if no non-changeable bits set
+;
+; We need this "hook" here to detect these cases (like user sets one both of
+; vol_id and dir bits) because of the structure of the or $CreateNewFile loop
+; below. The code loops on error_access_denied, but if one of the non
+; changeable attributes is specified, the loop COULD be infinite or WILL be
+; infinite because CreateNewFile will fail with access_denied always. Thus we
+; need to detect these cases before getting to the loop.
+;
+ MOV AX,error_access_denied
+ JMP SHORT SETTMPERR
+
+OKatts:
+ MOV attr,CX ; save attribute
+ MOV FilPtrL,DX ; pointer to file
+ MOV FilPtrH,DS
+ MOV EndPtrH,DS ; seg pointer to end of dir
+ PUSH DS
+ POP ES ; destination for nul search
+ MOV DI,DX
+ MOV CX,DI
+ NEG CX ; number of bytes remaining in segment
+ IFDEF DBCS ;AN000;
+Kloop: ;AN000;; 2/13/KK
+ MOV AL, BYTE PTR ES:[DI] ;AN000;; 2/13/KK
+ INC DI ;AN000;; 2/13/KK
+ OR AL,AL ;AN000;; 2/13/KK
+ JZ GOTEND ;AN000;; 2/13/KK
+ invoke testkanj ;AN000;; 2/13/KK
+ jz Kloop ;AN000;; 2/13/KK
+ inc di ;AN000;; Skip over second kanji byte 2/13/KK
+ CMP BYTE PTR ES:[DI],0 ;AN000;; 2/13/KK
+ JZ STOREPTH ;AN000; When char before NUL is sec Kanji byte
+ ;AN000; do not look for path char. 2/13/KK
+ jmp Kloop ;AN000; 2/13/KK
+GOTEND: ;AN000; 2/13/KK
+ ELSE ;AN000;
+ OR CX,CX ;AN000;MS. cx=0 ? ds:dx on segment boundary
+ JNZ okok ;AN000;MS. no
+ MOV CX,-1 ;AN000;MS.
+okok: ;AN000;
+ XOR AX,AX ;AN000;
+ REPNZ SCASB ;AN000;
+ ENDIF ;AN000;
+ DEC DI ; point back to the null
+ MOV AL,ES:[DI-1] ; Get char before the NUL
+ invoke PathChrCmp ; Is it a path separator?
+ JZ SETENDPTR ; Yes
+STOREPTH:
+ MOV AL,'\'
+ STOSB ; Add a path separator (and INC DI)
+SETENDPTR:
+ MOV EndPtrL,DI ; pointer to the tail
+CreateLoop:
+ Context DS ; let ReadTime see variables
+ SVC SVC_DEMQUERYTIME ; cx:dx = time
+;
+; Time is in CX:DX. Go drop it into the string.
+;
+ les di,EndPtr ; point to the string
+ mov ax,cx
+ call BinToAscii ; store upper word
+ mov ax,dx
+ call BinToAscii ; store lower word
+ xor al,al
+ STOSB ; nul terminate
+ LDS DX,FilPtr ; get name
+ASSUME DS:NOTHING
+ MOV CX,Attr ; get attr
+ SAVE <BP>
+ CALL $CreateNewFile ; try to create a new file
+ RESTORE <BP>
+ JNC CreateDone ; failed, go try again
+;
+; The operation failed and the error has been mapped in AX. Grab the extended
+; error and figure out what to do.
+;
+ ; M049 - start
+;; mov ax,ExtErr ;smr;SS Override
+;; cmp al,error_file_exists
+;; jz CreateLoop ; file existed => try with new name
+;; cmp al,error_access_denied
+;; jz CreateLoop ; access denied (attr mismatch)
+;;;;;;;; for NT
+ mov ax, ExtErr
+;;;;;;;;
+ CMP AL,error_file_exists ; Q: did file already exist
+ JZ CreateLoop ; Y: try again
+
+SETTMPERR:
+ STC
+CreateDone:
+ Leave
+ JC CreateFail
+ transfer Sys_Ret_OK ; success!
+CreateFail:
+ transfer Sys_Ret_Err
+EndProc $CreateTempFile
+
+Break <SetAttrib - set the search attrib>
+
+;
+; SetAttrib will set the search attribute (SAttrib) either to the normal
+; (CH) or to the value in CL if the current system call is through
+; serverdoscall.
+;
+; Inputs: fSharing == FALSE => set sattrib to CH
+; fSharing == TRUE => set sattrib to CL
+; Outputs: none
+; Registers changed: CX
+
+procedure SetAttrib,NEAR
+ assume SS:DOSDATA ;smr;
+ test fSharing,-1 ;smr;SS Override
+ jnz Set
+ mov cl,ch
+Set:
+ mov SAttrib,cl ;smr;SS Override
+ return
+EndProc SetAttrib
+
+
+Break <Extended_Open- Extended open the file>
+
+; Input: AL= 0 reserved AH=6CH
+; BX= mode
+; CL= create attribute CH=search attribute (from server)
+; DX= flag
+; DS:SI = file name
+; ES:DI = parm list
+; DD SET EA list (-1) null
+; DW n parameters
+; DB type (TTTTTTLL)
+; DW IOMODE
+; Function: Extended Open
+; Output: carry clear
+; AX= handle
+; CX=1 file opened
+; 2 file created/opened
+; 3 file replaced/opened
+; carry set: AX has error code
+;
+
+
+procedure $Extended_Open,NEAR ;AN000;
+
+ ASSUME CS:DOSCODE,SS:DOSDATA ;AN000;
+
+ MOV [EXTOPEN_FLAG],DX ;AN000;EO. save ext. open flag;smr;SS Override
+ MOV [EXTOPEN_IO_MODE],0 ;AN000;EO. initialize IO mode;smr;SS Override
+ TEST DX,reserved_bits_mask ;AN000;EO. reserved bits 0 ?
+ JNZ ext_inval2 ;AN000;EO. no
+ MOV AH,DL ;AN000;EO. make sure flag is right
+ CMP DL,0 ;AN000;EO. all fail ?
+ JZ ext_inval2 ;AN000;EO. yes, error
+ AND DL,exists_mask ;AN000;EO. get exists action byte
+ CMP DL,2 ;AN000;EO, > 02
+ JA ext_inval2 ;AN000;EO. yes ,error
+ AND AH,not_exists_mask ;AN000;EO. get no exists action byte
+ CMP AH,10H ;AN000;EO. > 10
+ JA ext_inval2 ;AN000;EO. yes error
+
+ MOV [SAVE_ES],ES ;AN000;EO. save API parms;smr;SS Override
+ MOV [SAVE_DI],DI ;AN000;EO.;smr;SS Override
+ PUSH [EXTOPEN_FLAG] ;AN000;EO.;smr;SS Override
+ POP [SAVE_DX] ;AN000;EO.;smr;SS Override
+ MOV [SAVE_CX],CX ;AN000;EO.;smr;SS Override
+ MOV [SAVE_BX],BX ;AN000;EO.;smr;SS Override
+ MOV [SAVE_DS],DS ;AN000;EO.;smr;SS Override
+ MOV [SAVE_SI],SI ;AN000;EO.;smr;SS Override
+ MOV DX,SI ;AN000;EO. ds:dx points to file name
+ MOV AX,BX ;AN000;EO. ax= mode
+
+ JMP SHORT goopen2 ;AN000;;EO. do nromal
+ext_inval2: ;AN000;;EO.
+ error error_Invalid_Function ;AN000;EO.. invalid function
+ext_inval_parm: ;AN000;EO..
+ POP CX ;AN000;EO.. pop up satck
+ POP SI ;AN000;EO..
+ error error_Invalid_data ;AN000;EO.. invalid parms
+error_return: ;AN000;EO.
+ ret ;AN000;EO.. return with error
+goopen2: ;AN000;
+ TEST BX,int_24_error ;AN000;EO.. disable INT 24 error ?
+ JZ goopen ;AN000;EO.. no
+ OR [EXTOPEN_ON],EXT_OPEN_I24_OFF ;AN000;EO.. set bit to disable;smr;SS Override
+
+goopen: ;AN000;
+ OR [EXTOPEN_ON],EXT_OPEN_ON ;AN000;EO.. set Extended Open active;smr;SS Override
+ AND [EXTOPEN_FLAG],0FFH ;AN000;EO.create new ?;smr;SS Override
+ CMP [EXTOPEN_FLAG],ext_exists_fail + ext_nexists_create ;AN000;FT.;smr;SS Override
+ JNZ chknext ;AN000;;EO. no
+ invoke $CreateNewFile ;AN000;;EO. yes
+ JC error_return ;AN000;;EO. error
+ CMP [EXTOPEN_ON],0 ;AN000;;EO. IFS does it;smr;SS Override
+ JZ ok_return2 ;AN000;;EO. yes
+ MOV [EXTOPEN_FLAG],action_created_opened ;AN000;EO. creted/opened;smr;SS Override
+ JMP setXAttr ;AN000;;EO. set XAs
+ok_return2:
+ transfer SYS_RET_OK ;AN000;;EO.
+chknext:
+ TEST [EXTOPEN_FLAG],ext_exists_open ;AN000;;EO. exists open;smr;SS Override
+ JNZ exist_open ;AN000;;EO. yes
+ invoke $Creat ;AN000;;EO. must be replace open
+ JC error_return ;AN000;;EO. return with error
+ CMP [EXTOPEN_ON],0 ;AN000;;EO. IFS does it;smr;SS Override
+ JZ ok_return2 ;AN000;;EO. yes
+ MOV [EXTOPEN_FLAG],action_created_opened ;AN000;EO. prsume create/open;smr;SS Override
+ TEST [EXTOPEN_ON],ext_file_not_exists ;AN000;;EO. file not exists ?;smr;SS Override
+ JNZ setXAttr ;AN000;;EO. no
+ MOV [EXTOPEN_FLAG],action_replaced_opened ;AN000;;EO. replaced/opened;smr;SS Override
+ JMP SHORT setXAttr ;AN000;;EO. set XAs
+error_return2:
+ STC ; Set Carry again to flag error ;AN001;
+ ret ;AN000;;EO. return with error
+ ;AN000;
+exist_open: ;AN000;
+ test fSharing,-1 ;AN000;;EO. server doscall?;smr;SS Override
+ jz noserver ;AN000;;EO. no
+ MOV CL,CH ;AN000;;EO. cl=search attribute
+
+noserver:
+ call $Open2 ;AN000;;EO. do open
+ JNC ext_ok ;AN000;;EO.
+ CMP [EXTOPEN_ON],0 ;AN000;;EO. error and IFS call;smr;SS Override
+ JZ error_return2 ;AN000;;EO. return with error
+local_extopen:
+
+ CMP AX,error_file_not_found ;AN000;;EO. file not found error
+ JNZ error_return2 ;AN000;;EO. no,
+ TEST [EXTOPEN_FLAG],ext_nexists_create;AN000;;EO. want to fail;smr;SS Override
+ JNZ do_creat ;AN000;;EO. yes
+ JMP short extexit ;AN000;;EO. yes
+do_creat:
+ MOV CX,[SAVE_CX] ;AN000;;EO. get ds:dx for file name;smr;SS Override
+ LDS SI,DWORD PTR [SAVE_SI] ;AN000;;EO. cx = attribute;smr;SS Override
+ MOV DX,SI ;AN000;;EO.
+ invoke $Creat ;AN000;;EO. do create
+ JC extexit ;AN000;;EO. error
+ MOV [EXTOPEN_FLAG],action_created_opened ;AN000;;EO. is created/opened;smr;SS Override
+ JMP SHORT setXAttr ;AN000;;EO. set XAs
+
+ext_ok:
+ CMP [EXTOPEN_ON],0 ;AN000;;EO. IFS call ?;smr;SS Override
+ JZ ok_return ;AN000;;EO. yes
+ MOV [EXTOPEN_FLAG],action_opened ;AN000;;EO. opened;smr;SS Override
+setXAttr:
+ PUSH AX ;AN000;;EO. save handle for final
+ invoke get_user_stack ;AN000;;EO.
+ MOV AX,[EXTOPEN_FLAG] ;AN000;;EO.;smr;SS Override
+ MOV [SI.USER_CX],AX ;AN000;;EO. set action code for cx
+ POP AX ;AN000;;EO.
+ MOV [SI.USER_AX],AX ;AN000;;EO. set handle for ax
+
+ok_return: ;AN000;
+ transfer SYS_RET_OK ;AN000;;EO.
+
+extexit2: ;AN000; ERROR RECOVERY
+
+ POP BX ;AN000;EO. close the handle
+ PUSH AX ;AN000;EO. save error code from set XA
+ CMP [EXTOPEN_FLAG],action_created_opened ;AN000;EO. from create;smr;SS Override
+ JNZ justopen ;AN000;EO.
+ LDS SI,DWORD PTR [SAVE_SI] ;AN000;EO. cx = attribute;smr;SS Override
+ LDS DX,DWORD PTR [SI] ;AN000;EO.
+ invoke $UNLINK ;AN000;EO. delete the file
+ JMP SHORT reserror ;AN000;EO.
+
+justopen: ;AN000;
+ invoke $close ;AN000;EO. pretend never happend
+reserror: ;AN000;
+ POP AX ;AN000;EO. retore error code from set XA
+ JMP SHORT extexit ;AN000;EO.
+
+
+ext_file_unfound: ;AN000;
+ MOV AX,error_file_not_found ;AN000;EO.
+ JMP SHORT extexit ;AN000;EO.
+ext_inval: ;AN000;
+ MOV AX,error_invalid_function;AN000;EO.
+extexit:
+ transfer SYS_RET_ERR ;AN000;EO.
+
+EndProc $Extended_Open ;AN000;
+
+procedure Set_EXT_mode,NEAR
+
+ TEST [EXTOPEN_ON],ext_open_on ;AN000;EO. from extnded open
+ JZ NOTEX ;AN000;EO. no, do normal
+ PUSH AX ;AN000;EO.
+
+ MOV AX,[SAVE_BX] ;AN000;EO.
+ OR ES:[DI.sf_mode],AX ;AN000;EO.
+ POP AX ;AN000;EO.
+ STC ;AN000;EO.
+NOTEX: ;AN000;
+ return ;AN000;EO.
+
+EndProc Set_EXT_mode ;AN000;
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/getset.asm b/private/mvdm/dos/v86/doskrnl/dos/getset.asm
new file mode 100644
index 000000000..5b8fbdf55
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/getset.asm
@@ -0,0 +1,1104 @@
+ TITLE GETSET - GETting and SETting MS-DOS system calls
+ NAME GETSET
+
+; ==========================================================================
+;** GETSET - System Calls which get and set various things
+;
+; $GET_VERSION
+; $GET_VERIFY_ON_WRITE
+; $SET_VERIFY_ON_WRITE
+; $INTERNATIONAL
+; $GET_DRIVE_FREESPACE
+; $GET_DMA
+; $SET_DMA
+; $GET_DEFAULT_DRIVE
+; $SET_DEFAULT_DRIVE
+; $GET_INTERRUPT_VECTOR
+; $SET_INTERRUPT_VECTOR
+; RECSET
+; $CHAR_OPER
+; $GetExtendedError DOS 3.3
+; Get_Global_CdPg DOS 4.0
+; $ECS_CALL DOS 4.0
+;
+; Revision history:
+;
+; sudeepb 13-Mar-1991 Ported for NT DOSEm
+; ==========================================================================
+
+.xlist
+.xcref
+ INCLUDE version.inc
+ INCLUDE dosseg.inc
+ INCLUDE dossym.inc
+ INCLUDE devsym.inc
+ INCLUDE doscntry.inc
+ INCLUDE mult.inc
+ INCLUDE pdb.inc
+ INCLUDE dossvc.inc
+ include bop.inc
+.cref
+.list
+
+IFNDEF ALTVECT
+ ALTVECT EQU 0 ; FALSE
+ENDIF
+
+; ==========================================================================
+
+DosData SEGMENT WORD PUBLIC 'DATA'
+
+ EXTRN USERNUM :WORD
+ EXTRN MSVERS :WORD
+ EXTRN VERFLG :BYTE
+ EXTRN CNTCFLAG :BYTE
+ EXTRN DMAADD :DWORD
+ EXTRN CURDRV :BYTE
+ EXTRN chSwitch :BYTE
+ EXTRN COUNTRY_CDPG :byte ;DOS 3.3
+ EXTRN CDSCount :BYTE
+ EXTRN ThisCDS :DWORD
+ EXTRN EXTERR :WORD
+ EXTRN EXTERR_ACTION :BYTE
+ EXTRN EXTERR_CLASS :BYTE
+ EXTRN EXTERR_LOCUS :BYTE
+ EXTRN EXTERRPT :DWORD
+ EXTRN UCASE_TAB :BYTE
+ EXTRN FILE_UCASE_TAB :BYTE
+ EXTRN InterCon :BYTE
+ EXTRN CURRENTPDB :WORD
+
+ EXTRN DBCS_TAB :BYTE
+ EXTRN NLS_YES :BYTE
+ EXTRN NLS_yes2 :BYTE
+ EXTRN NLS_NO :BYTE
+ EXTRN NLS_no2 :BYTE
+
+ EXTRN Special_version :WORD
+ EXTRN Fake_Count :BYTE
+ EXTRN A20OFF_COUNT :BYTE ; M068, M004
+ EXTRN DOS_FLAG :BYTE ; M068
+
+DosData ENDS
+
+; ==========================================================================
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ allow_getdseg
+
+ EXTRN CurrentPDB :WORD
+
+ EXTRN Get_User_Stack :NEAR ; return pointer to user stack
+
+BREAK <$Get_Version -- Return DOS version number>
+; =========================================================================
+; $Get_Version - Return DOS Version Number
+;
+; Fake_Count is used to lie about the version numbers to support
+; old binarys. See ms_table.asm for more info.
+;
+; ENTRY al = Information Format
+; EXIT (bl:cx) = user number (24 bits)
+; (al.ah) = version # (in binary)
+;
+; if input al = 00
+; (bh) = OEM number
+; else if input al = 01
+; (bh) = version flags
+;
+; bits 0-2 = DOS internal revision
+; bits 3-7 = DOS type flags
+; bit 3 = DOS is in ROM
+; bit 4 = DOS in in HMA
+; bits 5-7 = reserved
+; M007 change - only bit 3 is now valid. Other bits
+; are 0 when AL = 1
+
+; USES all
+; =========================================================================
+
+PROCEDURE $Get_Version ,NEAR
+
+ context DS ; SS is DOSDATA
+
+ mov BX,[UserNum + 2]
+ mov CX,[UserNum]
+
+ cmp AL,1
+ jnz Norm_Vers
+
+ xor bh,bh ; Otherwise return 0
+ ;
+norm_vers: ; MSVERS is a label in TABLE segment
+ push DS ; Get the version number from the
+ mov DS,CurrentPDB ; current app's PSP segment
+ mov AX,DS:[PDB_Version] ; AX = DOS version number
+ pop DS
+
+
+ call Get_User_Stack ; Returns DS:SI --> Caller's stack
+
+ ASSUME DS:NOTHING
+
+ mov [SI.User_AX],AX ; Put values for return registers
+ mov [SI.User_BX],BX ; in the proper place on the user's
+ mov [SI.User_CX],CX ; stack addressed by DS:SI
+
+ return
+
+ENDPROC $Get_Version
+
+; =========================================================================
+
+
+BREAK <$Get/Set_Verify_on_Write - return/set verify-after-write flag>
+; =========================================================================
+;** $Get_Verify_On_Write - Get Status of Verify on write flag
+;
+; ENTRY none
+; EXIT (al) = value of VERIFY flag
+; USES all
+; =========================================================================
+
+procedure $GET_VERIFY_ON_WRITE,NEAR
+
+;hkn; SS override
+ MOV AL,[VERFLG]
+ return
+
+EndProc $GET_VERIFY_ON_WRITE
+
+
+
+;** $Set_Verify_On_Write - Set Status of Verify on write flag
+;
+; ENTRY (al) = value of VERIFY flag
+; EXIT none
+; USES all
+
+procedure $SET_VERIFY_ON_WRITE,NEAR
+
+ AND AL,1
+;hkn; SS override
+ MOV [VERFLG],AL
+ return
+
+EndProc $SET_VERIFY_ON_WRITE
+
+BREAK <$International - return country-dependent information>
+;----------------------------------------------------------------------------
+;
+; Procedure Name : $INTERNATIONAL
+;
+; Inputs:
+; MOV AH,International
+; MOV AL,country (al = 0 => current country)
+; [MOV BX,country]
+; LDS DX,block
+; INT 21
+; Function:
+; give users an idea of what country the application is running
+; Outputs:
+; IF DX != -1 on input (get country)
+; AL = 0 means return current country table.
+; 0<AL<0FFH means return country table for country AL
+; AL = 0FF means return country table for country BX
+; No Carry:
+; Register BX will contain the 16-bit country code.
+; Register AL will contain the low 8 bits of the country code.
+; The block pointed to by DS:DX is filled in with the information
+; for the particular country.
+; BYTE Size of this table excluding this byte and the next
+; BYTE Country code represented by this table
+; A sequence of n bytes, where n is the number specified
+; by the first byte above and is not > internat_block_max,
+; in the correct order for being returned by the
+; INTERNATIONAL call as follows:
+; WORD Date format 0=mdy, 1=dmy, 2=ymd
+; 5 BYTE Currency symbol null terminated
+; 2 BYTE thousands separator null terminated
+; 2 BYTE Decimal point null terminated
+; 2 BYTE Date separator null terminated
+; 2 BYTE Time separator null terminated
+; 1 BYTE Bit field. Currency format.
+; Bit 0. =0 $ before # =1 $ after #
+; Bit 1. no. of spaces between # and $ (0 or 1)
+; 1 BYTE No. of significant decimal digits in currency
+; 1 BYTE Bit field. Time format.
+; Bit 0. =0 12 hour clock =1 24 hour
+; DWORD Call address of case conversion routine
+; 2 BYTE Data list separator null terminated.
+; Carry:
+; Register AX has the error code.
+; IF DX = -1 on input (set current country)
+; AL = 0 is an error
+; 0<AL<0FFH means set current country to country AL
+; AL = 0FF means set current country to country BX
+; No Carry:
+; Current country SET
+; Register AL will contain the low 8 bits of the country code.
+; Carry:
+; Register AX has the error code.
+;-----------------------------------------------------------------------------
+
+procedure $INTERNATIONAL,NEAR ; DOS 3.3
+
+
+ CMP AL,0FFH
+ JZ BX_HAS_CODE ; -1 means country code is in BX
+ MOV BL,AL ; Put AL country code in BX
+ XOR BH,BH
+BX_HAS_CODE:
+ PUSH DS
+ POP ES
+ PUSH DX
+ POP DI ; User buffer to ES:DI
+
+;hkn; SS is DOSDATA
+ context DS
+
+ CMP DI,-1
+ JZ international_set
+ OR BX,BX
+ JNZ international_find
+
+;hkn; country_cdpg is in DOSDATA segment.
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG
+
+ JMP SHORT international_copy
+
+international_find:
+ MOV BP,0 ; flag it for GetCntry only
+ CALL international_get
+ JC errtn
+ CMP BX,0 ; nlsfunc finished it ?
+ JNZ SHORT international_copy ; no, copy by myself
+ MOV BX,DX ; put country back
+ JMP SHORT international_ok3
+
+international_get:
+
+;hkn; country_cdpg is in DOSDATA segment.
+;hkn; use ss override to access COUNTRY_CDPG fields
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG
+ CMP BX,ss:[SI.ccDosCountry] ; = current country id;smr;SS Override
+
+ retz ; return if equal
+ MOV DX,BX
+ XOR BX,BX ; bx = 0, default code page
+ CallInstall NLSInstall,NLSFUNC,0 ; check if NLSFUNC in memory
+ CMP AL,0FFH
+ JNZ interr ; not in memory
+ or bp,bp ; GetCntry ?
+ JNZ stcdpg
+ CallInstall GetCntry,NLSFUNC,4 ; get country info
+ JMP short chkok
+stcdpg:
+ CallInstall SetCodePage,NLSFUNC,3 ; set country info
+chkok:
+ or al,al ; success ?
+ retz ; yes
+setcarry:
+ STC ; set carry
+ ret
+interr:
+ MOV AL,0FFH ; flag nlsfunc error
+ JMP setcarry
+
+international_copy:
+
+;hkn; country_cdpg is in DOSDATA segment.
+;hkn; use ss override to access COUNTRY_CDPG fields
+ MOV BX,ss:[SI.ccDosCountry] ; = current country id;smr;SS Override
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG.ccDFormat
+
+ MOV CX,OLD_COUNTRY_SIZE
+
+;hkn; must set up DS to SS so that international info can be copied
+ push ds
+ push ss ; cs -> ss
+ pop ds
+
+ REP MOVSB ;copy country info
+
+;hkn; restore ds
+ pop ds
+
+international_ok3:
+ call get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_BX],BX
+international_ok:
+ MOV AX,BX ; Return country code in AX too.
+ transfer SYS_RET_OK
+
+international_set:
+
+;hkn; ASSUME DS:DOSGROUP
+ASSUME DS:DOSDATA
+
+ MOV BP,1 ; flag it for SetCodePage only
+ CALL international_get
+ JNC international_ok
+errtn:
+ CMP AL,0FFH
+ JZ errtn2
+ transfer SYS_RET_ERR ; return what we got from NLSFUNC
+errtn2:
+ error error_Invalid_Function ; NLSFUNC not existent
+
+EndProc $INTERNATIONAL
+
+
+
+BREAK <$GetExtCntry - return extended country-dependent information>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : $GetExtCntry
+;
+; Inputs:
+; if AL >= 20H
+; AL= 20H capitalize single char, DL= char
+; 21H capitalize string ,CX= string length
+; 22H capitalize ASCIIZ string
+; 23H YES/NO check, DL=1st char DH= 2nd char (DBCS)
+; 80H bit 0 = use normal upper case table
+; 1 = use file upper case table
+; DS:DX points to string
+;
+; else
+;
+; MOV AH,GetExtCntry ; DOS 3.3
+; MOV AL,INFO_ID ( info type,-1 selects all)
+; MOV BX,CODE_PAGE ( -1 = active code page )
+; MOV DX,COUNTRY_ID ( -1 = active country )
+; MOV CX,SIZE ( amount of data to return)
+; LES DI,COUNTRY_INFO ( buffer for returned data )
+; INT 21
+; Function:
+; give users extended country dependent information
+; or capitalize chars
+; Outputs:
+; No Carry:
+; extended country info is succesfully returned
+; Carry:
+; Register AX has the error code.
+; AX=0, NO for YES/NO CHECK
+; 1, YES
+;-------------------------------------------------------------------------------
+
+procedure $GetExtCntry,NEAR ; DOS 3.3
+
+ CMP AL,CAP_ONE_CHAR ; < 20H ?
+ifdef DBCS
+ jnb capcap
+ jmp notcap
+else
+ JB notcap
+endif
+capcap: ;
+ TEST AL,UPPER_TABLE ; which upper case table
+ JNZ fileupper ; file upper case
+
+;hkn; UCASE_TAB in DOSDATA
+ MOV BX,OFFSET DOSDATA:UCASE_TAB+2 ; get normal upper case
+ JMP SHORT capit
+fileupper:
+
+;hkn; FILE_UCASE_TAB in DOSDATA
+ MOV BX,OFFSET DOSDATA:FILE_UCASE_TAB+2 ; get file upper case
+capit: ;
+ CMP AL,CAP_ONE_CHAR ; cap one char ?
+ JNZ chkyes ; no
+ MOV AL,DL ; set up AL
+ invoke GETLET3 ; upper case it
+ call get_user_stack ; get user stack
+ MOV byte ptr [SI.user_DX],AL; user's DL=AL
+ JMP SHORT nono ; done
+chkyes: ;
+ CMP AL,CHECK_YES_NO ; check YES or NO ?
+ JNZ capstring ; no
+ XOR AX,AX ; presume NO
+IFDEF DBCS ;
+ PUSH AX ;
+ MOV AL,DL ;
+ invoke TESTKANJ ; DBCS ?
+ POP AX ;
+ JNZ dbcs_char ; yes, return error
+ENDIF ;
+
+;hkn; NLS_YES, NLS_NO, NLS_yes2, NLS_no2 is defined in msdos.cl3 which is
+;hkn; included in yesno.asm in the DOSCODE segment.
+
+ CMP DL,cs:NLS_YES ; is 'Y' ?
+ JZ yesyes ; yes
+ CMP DL,cs:NLS_yes2 ; is 'y' ?
+ JZ yesyes ; yes
+ CMP DL,cs:NLS_NO ; is 'N'?
+ JZ nono ; no
+ CMP DL,cs:NLS_no2 ; is 'n' ?
+ JZ nono ; no
+dbcs_char: ;
+ INC AX ; not YES or NO
+yesyes: ;
+ INC AX ; return 1
+nono: ;
+ transfer SYS_RET_OK ; done
+capstring: ;
+ MOV SI,DX ; si=dx
+ CMP AL,CAP_STRING ; cap string ?
+ JNZ capascii ; no
+ OR CX,CX ; check count 0
+ JZ nono ; yes finished
+concap: ;
+ LODSB ; get char
+ IFDEF DBCS ;
+ invoke TESTKANJ ; DBCS ?
+ JZ notdbcs ; no
+ INC SI ; skip 2 chars
+ DEC CX ; bad input, one DBCS char at end
+ JNZ next99 ; yes
+
+notdbcs: ;
+ ENDIF ;
+
+ invoke GETLET3 ; upper case it
+ MOV byte ptr [SI-1],AL ; store back
+next99: ;
+ LOOP concap ; continue
+ JMP nono ; done
+capascii: ;
+ CMP AL,CAP_ASCIIZ ; cap ASCIIZ string ?
+ JNZ capinval ; no
+concap2: ;
+ LODSB ; get char
+ or al,al ; end of string ?
+ JZ nono ; yes
+ IFDEF DBCS ;
+ invoke TESTKANJ ; DBCS ?
+ JZ notdbcs2 ; no
+ CMP BYTE PTR [SI],0 ; bad input, one DBCS char at end
+ JZ nono ; yes
+ INC SI ; skip 2 chars
+ JMP concap2 ;
+notdbcs2: ;
+ ENDIF ;
+ invoke GETLET3 ; upper case it
+ MOV byte ptr [SI-1],AL ; store back
+ JMP concap2 ; continue
+
+
+notcap:
+ CMP CX,5 ; minimum size is 5
+ jb short sizeerror
+
+GEC_CONT:
+;hkn; SS is DOSDATA
+ context DS
+
+;hkn; COUNTRY_CDPG is in DOSDATA
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG
+
+ CMP DX,-1 ; active country ?
+ JNZ GETCDPG ; no
+
+;hkn; use DS override to accesss country_cdpg fields
+ MOV DX,[SI.ccDosCountry] ; get active country id;smr;use DS
+
+GETCDPG:
+ CMP BX,-1 ; active code page?
+ JNZ CHKAGAIN ; no, check again
+
+;hkn; use DS override to accesss country_cdpg fields
+ MOV BX,[SI.ccDosCodePage] ; get active code page id;smr;Use DS
+
+CHKAGAIN:
+ CMP DX,[SI.ccDosCountry] ; same as active country id?;smr;use DS
+ JNZ CHKNLS ; no
+ CMP BX,[SI.ccDosCodePage] ; same as active code pg id?;smr;use DS
+ JNZ CHKNLS ; no
+CHKTYPE:
+ MOV BX,[SI.ccSysCodePage] ; bx = sys code page id;smr;use DS
+; CMP AL,SetALL ; select all?
+; JNZ SELONE
+; MOV SI,OFFSET DOSGROUP:COUNTRY_CDPG.ccNumber_of_entries
+SELONE:
+ PUSH CX ; save cx
+ MOV CX,[SI.ccNumber_of_entries] ;smr;use DS
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG.ccSetUcase;smr;CDPG in DOSDATA
+NXTENTRY:
+ CMP AL,[SI] ; compare info type;smr;use DS
+ JZ FOUNDIT
+ ADD SI,5 ; next entry
+ LOOP NXTENTRY
+ POP CX
+capinval:
+ error error_Invalid_Function ; info type not found
+FOUNDIT:
+
+ MOVSB ; move info id byte
+ POP CX ; retsore char count
+ CMP AL,SetCountryInfo ; select country info type ?
+ JZ setsize
+ MOV CX,4 ; 4 bytes will be moved
+ MOV AX,5 ; 5 bytes will be returned in CX
+OK_RETN:
+
+ REP MOVSB ; copy info
+ MOV CX,AX ; CX = actual length returned
+ MOV AX,BX ; return sys code page in ax
+GETDONE:
+ call get_user_stack ; return actual length to user's CX
+ MOV [SI.user_CX],CX
+ transfer SYS_RET_OK
+setsize:
+ SUB CX,3 ; size after length field
+ CMP WORD PTR [SI],CX ; less than table size;smr;use ds
+ JAE setsize2 ; no
+ MOV CX,WORD PTR [SI] ; truncate to table size;smr;use ds
+setsize2:
+ MOV ES:[DI],CX ; copy actual length to user's
+ ADD DI,2 ; update index
+ ADD SI,2
+ MOV AX,CX
+ ADD AX,3 ; AX has the actual length
+ JMP OK_RETN ; go move it
+CHKNLS:
+ XOR AH,AH
+ PUSH AX ; save info type
+ POP BP ; bp = info type
+ CallInstall NLSInstall,NLSFUNC,0 ; check if NLSFUNC in memory
+ CMP AL,0FFH
+ JZ NLSNXT ; in memory
+sizeerror:
+ error error_Invalid_Function
+NLSNXT: CallInstall GetExtInfo,NLSFUNC,2 ;get extended info
+ CMP AL,0 ; success ?
+ JNZ NLSERROR
+ MOV AX,[SI.ccSysCodePage] ; ax = sys code page id;smr;use ds;BUGBUG;check whether DS is OK after the above calls
+ JMP GETDONE
+NLSERROR:
+ transfer SYS_RET_ERR ; return what is got from NLSFUNC
+EndProc $GetExtCntry
+
+BREAK <$GetSetCdPg - get or set global code page>
+
+;** $GetSetCdPg - Get or Set Global Code Pagech
+;
+; System call format:
+;
+; MOV AH,GetSetCdPg ; DOS 3.3
+; MOV AL,n ; n = 1 : get code page, n = 2 : set code page
+; MOV BX,CODE_PAGE ( set code page only)
+; INT 21
+;
+; ENTRY (al) = n
+; (bx) = code page
+; EXIT 'C' clear
+; global code page is set (set global code page)
+; (BX) = active code page id (get global code page)
+; (DX) = system code page id (get global code page)
+; 'C' set
+; (AX) = error code
+
+procedure $GetSetCdPg,NEAR ; DOS 3.3
+
+;hkn; SS is DOSDATA
+ context DS
+
+;hkn; COUNTRY_CDPG is in DOSDATA
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG
+
+ CMP AL,1 ; get global code page
+ JNZ setglpg ; set global cod epage
+ MOV BX,[SI.ccDosCodePage] ; get active code page id;smr;use ds
+ MOV DX,[SI.ccSysCodePage] ; get sys code page id;smr;use ds
+ call get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_BX],BX ; update returned bx
+ MOV [SI.user_DX],DX ; update returned dx
+OK_RETURN:
+ transfer SYS_RET_OK
+;hkn; ASSUME DS:DOSGROUP
+ASSUME DS:DOSDATA
+
+setglpg:
+ CMP AL,2
+ JNZ nomem
+;;;;;;; CMP BX,[SI.ccDosCodePage] ; same as active code page
+;;;;;;; JZ OK_RETURN ; yes
+ MOV DX,[SI.ccDosCountry] ;smr;use ds
+ CallInstall NLSInstall,NLSFUNC,0 ; check if NLSFUNC in memory
+ CMP AL,0FFH
+ JNZ nomem ; not in memory
+ CallInstall SetCodePage,NLSFUNC,1 ;set the code page
+ or al,al ; success ?
+ JZ OK_RETURN ; yes
+ CMP AL,65 ; set device code page failed
+ JNZ seterr
+ MOV AX,65
+ MOV [EXTERR],AX
+ MOV [EXTERR_ACTION],errACT_Ignore
+ MOV [EXTERR_CLASS],errCLASS_HrdFail
+ MOV [EXTERR_LOCUS],errLOC_SerDev
+ transfer From_GetSet
+
+seterr:
+ transfer SYS_RET_ERR
+nomem:
+ error error_Invalid_Function ; function not defined
+;
+ifdef NTDOS
+ SVC SVC_DEMGSETCDPG
+ transfer SYS_RET_ERR
+endif
+EndProc $GetSetCdPg
+
+
+BREAK <$Get_Drive_Freespace -- Return bytes of free disk space on a drive>
+
+
+;** $Get_Drive_Freespace - Return amount of drive free space
+;
+; $Get_Drive_Freespace returns the # of free allocation units on a
+; drive.
+;
+; This call returns the same info in the same registers (except for the
+; FAT pointer) as the old FAT pointer calls
+;
+; ENTRY DL = Drive number
+; EXIT AX = Sectors per allocation unit
+; = -1 if bad drive specified
+; On User Stack
+; BX = Number of free allocation units
+; DX = Total Number of allocation units on disk
+; CX = Sector size
+
+procedure $GET_DRIVE_FREESPACE,NEAR
+
+;hkn; SS is DOSDATA
+ context DS
+
+ MOV AL,DL
+ invoke GetThisDrv ; Get drive
+SET_AX_RET:
+ JC BADFDRV
+ HRDSVC SVC_DEMGETDRIVEFREESPACE
+ jc badfdrv
+ mov ax,si ; AX = sectors per allocation unit
+DoSt:
+ call get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_DX],DX
+ MOV [SI.user_CX],CX
+ MOV [SI.user_BX],BX
+ MOV [SI.user_AX],AX
+ return
+BADFDRV:
+; MOV AL,error_invalid_drive ; Assume error
+ invoke FCB_RET_ERR
+ MOV AX,-1
+ JMP DoSt
+EndProc $GET_DRIVE_FREESPACE
+
+ BREAK <$Get_DMA, $Set_DMA -- Get/Set current DMA address>
+
+
+;** $Get_DMA - Get Disk Transfer Address
+;
+; ENTRY none
+; EXIT ES:BX is current transfer address
+; USES all
+
+procedure $GET_DMA,NEAR
+
+;hkn; ss override for DMAADD
+ MOV BX,WORD PTR [DMAADD]
+ MOV CX,WORD PTR [DMAADD+2]
+ call get_user_stack
+ ASSUME DS:nothing
+ MOV [SI.user_BX],BX
+ MOV [SI.user_ES],CX
+ return
+
+EndProc $GET_DMA
+
+
+
+;** $Set_DMA - Set Disk Transfer Address
+;
+; ENTRY DS:DX is current transfer address
+; EXIT none
+; USES all
+
+procedure $SET_DMA,NEAR
+;hkn; ss override for DMAADD
+ MOV WORD PTR [DMAADD],DX
+ MOV WORD PTR [DMAADD+2],DS
+ return
+
+EndProc $SET_DMA
+
+ BREAK <$Get_Default_Drive, $Set_Default_Drive -- Set/Get default drive>
+
+;** $Get_Default_Drive - Get Current Default Drive
+;
+; ENTRY none
+; EXIT (AL) = drive number
+; USES all
+
+procedure $GET_DEFAULT_DRIVE,NEAR
+
+;hkn; SS override
+ MOV AL,[CURDRV]
+ return
+
+EndProc $GET_DEFAULT_DRIVE
+
+
+;** $Set_Default_Drive - Specify new Default Drive
+;
+; $Set_Default_Drive sets a new default drive.
+;
+; ENTRY (DL) = Drive number for new default drive
+; EXIT (AL) = Number of drives, NO ERROR RETURN IF DRIVE NUMBER BAD
+;
+; NTVDM EXIT (al) = 26 always!
+; return max possible as we only have one CDS for all network drives.
+; ntio.sys ignores "lastdrive=" command 18-Aug-1992 Jonle
+;
+
+procedure $SET_DEFAULT_DRIVE,NEAR
+
+ push dx
+ mov al, dl
+ inc al ; A=1, b=2...
+ invoke GetVisDrv ; see if visible drive
+ jc nsetret ; errors do not set
+ mov [curdrv],al
+
+nsetret:
+ pop dx
+ mov al, 26 ; Max num drives possible!
+ return
+
+if 0
+ MOV AL,[CDSCOUNT] ; let user see the count
+ cmp al,5
+ jae sdd_go
+ mov al,5 ; We have to return at least 5
+sdd_go:
+ return
+SETRET:
+ MOV [CURDRV],AL ; no, set
+; LDS SI,ThisCDS ; get current director string
+ POP DX
+
+; SVC SVC_DEMSETDEFAULTDRIVE
+
+ MOV AL,[CDSCOUNT] ; let user see what the count really is
+ cmp al,5
+ jae sdd_go
+ mov al,5 ; We have to return at least 5
+ return
+endif
+
+EndProc $SET_DEFAULT_DRIVE
+
+BREAK <$Get/Set_Interrupt_Vector - Get/Set interrupt vectors>
+
+
+;** $Get_Interrupt_Vector - Get Interrupt Vector
+;
+; $Get_Interrupt_Vector is the official way for user pgms to get the
+; contents of an interrupt vector.
+;
+; ENTRY (AL) = interrupt number
+; EXIT (ES:BX) = current interrupt vector
+
+procedure $GET_INTERRUPT_VECTOR,NEAR
+
+ CALL RECSET
+ LES BX,DWORD PTR ES:[BX]
+ call get_user_stack
+ MOV [SI.user_BX],BX
+ MOV [SI.user_ES],ES
+ return
+
+EndProc $GET_INTERRUPT_VECTOR
+
+
+
+;** $Set_Interrupt_Vector - Set Interrupt Vector
+;
+; $Set_Interrupt_Vector is the official way for user pgms to set the
+; contents of an interrupt vector.
+;
+; M004, M068: Also set A20OFF_COUNT to 1 if EXECA20OFF bit has been set
+; and if A20OFF_COUNT is non-zero. See under tag M003 in inc\dossym.inc
+; for explanation.
+;
+; ENTRY (AL) = interrupt number
+; (ds:dx) = desired new vector value
+; EXIT none
+; USES all
+
+procedure $SET_INTERRUPT_VECTOR,NEAR
+
+ CALL RECSET
+ invoke DOCLI ; Watch out!!!!! Folks sometimes use
+ MOV ES:[BX],DX ; this for hardware ints (like timer).
+ MOV ES:[BX+2],DS
+ invoke DOSTI
+ ; M004, M068 - Start
+ test [DOS_FLAG], EXECA20OFF
+ ; Q: was the previous call an int 21
+ ; exec call
+ jnz @f ; Y: go set count
+ return ; N: return
+
+@@:
+ cmp [A20OFF_COUNT], 0 ; Q: is count 0
+ jne @f ; N: done
+ mov [A20OFF_COUNT], 1 ; Y: set it to 1 to indicate to dos
+ ; dispatcher to turn A20 Off before
+ ; returning to user.
+@@:
+ ret ; M004, M068 - End
+
+EndProc $SET_INTERRUPT_VECTOR
+
+
+procedure RECSET,NEAR
+
+ IF ALTVECT
+ context ES
+
+;hkn; SS override for LSTVEC and LSTVEC2
+ MOV [LSTVEC],AL ; Terminate list with real vector
+ MOV [LSTVEC2],AL ; Terminate list with real vector
+ MOV CX,NUMVEC ; Number of possible translations
+
+;hkn; VECIN is in DOSDATA
+ MOV DI,OFFSET DOSDATA:VECIN ; Point to vectors
+
+ REPNE SCASB
+ MOV AL,ES:[DI+NUMVEC-1] ; Get translation
+ ENDIF
+
+ XOR BX,BX
+ MOV ES,BX
+ MOV BL,AL
+ SHL BX,1
+ SHL BX,1
+ return
+EndProc recset
+
+ BREAK <$Char_Oper - hack on paths, switches so that xenix can look like PCDOS>
+
+
+;** $Char_Oper - Manipulate Switch Character
+;
+; This function was put in to facilitate XENIX path/switch compatibility
+;
+; ENTRY AL = function:
+; 0 - read switch char
+; 1 - set switch char (char in DL)
+; 2 - read device availability
+; Always returns available
+; 3 - set device availability
+; No longer supported (NOP)
+; EXIT (al) = 0xff iff error
+; (al) != 0xff if ok
+; (dl) = character/flag, iff "read switch char" subfunction
+; USES AL, DL
+;
+; NOTE This already obsolete function has been deactivated in DOS 5.0
+; The character / is always returned for subfunction 0,
+; subfunction 2 always returns -1, all other subfunctions are ignored.
+
+procedure $CHAR_OPER,NEAR
+
+ or al,al ; get switch?
+ mov dl,'/' ; assume yes
+ jz chop_1 ; jump if yes
+ cmp al,2 ; check device availability?
+ mov dl,-1 ; assume yes
+ jz chop_1 ; jump if yes
+ return ; otherwise just quit
+
+; subfunctions requiring return of value to user come here. DL holds
+; value to return
+
+chop_1:
+ call Get_User_Stack
+ ASSUME DS:Nothing
+ mov [si].User_DX,dx ; store value for user
+ return
+
+
+EndProc $CHAR_OPER
+
+BREAK <$GetExtendedError - Return Extended DOS error code>
+
+
+;** $GetExtendedError - Return Extended error code
+;
+; This function reads up the extended error info from the static
+; variables where it was stored.
+;
+; ENTRY none
+; EXIT AX = Extended error code (0 means no extended error)
+; BL = recommended action
+; BH = class of error
+; CH = locus of error
+; ES:DI = may be pointer
+; USES ALL
+
+procedure $GetExtendedError,NEAR
+
+;hkn; SS is DOSDATA
+ Context DS
+ MOV AX,[EXTERR]
+ LES DI,[EXTERRPT]
+ MOV BX,WORD PTR [EXTERR_ACTION] ; BL = Action, BH = Class
+ MOV CH,[EXTERR_LOCUS]
+ call get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_DI],DI
+ MOV [SI.user_ES],ES
+ MOV [SI.user_BX],BX
+ MOV [SI.user_CX],CX
+ transfer SYS_RET_OK
+
+EndProc $GetExtendedError
+
+BREAK <$Get_Global_CdPg - Return Global Code Page>
+;---------------------------------------------------------------------------
+;
+; input: None
+; output: AX = Global Code Page
+;
+;---------------------------------------------------------------------------
+
+Procedure Get_Global_CdPg,NEAR
+ PUSH SI
+
+;hkn; COUNTRY_CDPG is in DOSDATA
+ MOV SI,OFFSET DOSDATA:COUNTRY_CDPG
+ MOV AX,SS:[SI.ccDosCodePage] ;smr;CS->SS
+ POP SI
+ return
+
+EndProc Get_Global_CdPg
+
+;-------------------------------Start of DBCS 2/13/KK
+BREAK <ECS_call - Extended Code System support function>
+
+;---------------------------------------------------------------------------
+; Inputs:
+; AL = 0 get lead byte table
+; on return DS:SI has the table location
+;
+; AL = 1 set / reset interim console flag
+; DL = flag (00H or 01H)
+; no return
+;
+; AL = 2 get interim console flag
+; on return DL = current flag value
+;
+; AL = OTHER then error, and returns with:
+; AX = error_invalid_function
+;
+; NOTE: THIS CALL DOES GUARANTEE THAT REGISTER OTHER THAN
+; SS:SP WILL BE PRESERVED!
+;---------------------------------------------------------------------------
+
+procedure $ECS_call,NEAR
+
+ IFDEF DBCS ;AN000;
+ ;AN000;
+ or al, al ; AL = 0 (get table)? ;AN000;
+ je get_lbt ;AN000;
+ cmp al, SetInterimMode ; AL = 1 (set / reset interim flag)? ;AN000;
+ je set_interim ;AN000;
+ cmp al, GetInterimMode ; AL = 2 (get interim flag)? ;AN000;
+ je get_interim ;AN000;
+ error error_invalid_function ;AN000;
+ ;AN000;
+get_lbt: ; get lead byte table ;AN000;
+ push ax ;AN000;
+ push bx ;AN000;
+ push ds ;AN000;
+
+;hkn; SS is DOSDATA
+ context DS ;AN000;
+ MOV BX,offset DOSDATA:COUNTRY_CDPG.ccSetDBCS ;AN000;
+ MOV AX,[BX+1] ; set EV address to DS:SI ;AN000;smr;use ds
+ MOV BX,[BX+3] ;AN000;smr;use ds
+ ADD AX,2 ; Skip Lemgth ;AN000;
+ call get_user_stack ;AN000;
+ assume ds:nothing ;AN000;
+ MOV [SI.user_SI], AX ;AN000;
+ MOV [SI.user_DS], BX ;AN000;
+ pop ds ;AN000;
+ pop bx ;AN000;
+ pop ax ;AN000;
+ transfer SYS_RET_OK ;AN000;
+
+set_interim: ; Set interim console flag ;AN000;
+ push dx ;AN000;
+ and dl,01 ; isolate bit 1 ;AN000;
+
+;hkn; SS override
+ mov [InterCon], dl ;AN000;
+ push ds
+;hkn; SS override
+ mov ds, [CurrentPDB] ;AN000;
+ mov byte ptr ds:[PDB_InterCon], dl ; update value in pdb ;AN000;
+ pop ds ;AN000;
+ pop dx ;AN000;
+ transfer SYS_RET_OK ;AN000;
+
+get_interim: ;AN000;
+ push dx ;AN000;
+ push ds ;AN000;
+;hkn; SS override
+ mov dl,[InterCon] ;AN000;
+ call get_user_stack ; get interim console flag ;AN000;
+ assume ds:nothing ;AN000;
+ mov [SI.user_DX],DX ;AN000;
+ pop ds ;AN000;
+ pop dx ;AN000;
+ transfer SYS_RET_OK ;AN000;
+ ELSE ;AN000;
+ or al, al ; AL = 0 (get table)?
+ jnz okok
+get_lbt:
+ call get_user_stack
+ assume ds:nothing
+
+;hkn; dbcs_table moved low to dosdata
+ MOV [SI.user_SI], Offset DOSDATA:DBCS_TAB+2
+
+ push es
+ getdseg <es> ; es = DOSDATA
+ assume es:nothing
+ MOV [SI.user_DS], es
+ pop es
+
+okok:
+ transfer SYS_RET_OK ;
+
+ ENDIF
+
+$ECS_call endp
+
+DOSCODE ENDS
+ END
+
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/handle.asm b/private/mvdm/dos/v86/doskrnl/dos/handle.asm
new file mode 100644
index 000000000..a12dc7809
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/handle.asm
@@ -0,0 +1,966 @@
+ TITLE HANDLE - Handle-related system calls
+ NAME HANDLE
+
+;** Handle related system calls for MSDOS 2.X. Only top-level system calls
+; are present. I/O specs are defined in DISPATCH. The system calls are:
+;
+; $Close written
+; $Commit written DOS 3.3 F.C. 6/4/86
+; $ExtHandle written DOS 3.3 F.C. 6/4/86
+; $Read written
+; Align_Buffer DOS 4.00
+; $Write written
+; $LSeek written
+; $FileTimes written
+; $Dup written
+; $Dup2 written
+;
+; Revision history:
+;
+; sudeepb 13-Mar-1991 Ported For NT DOSEm
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include sf.inc
+ include mult.inc
+ include pdb.inc
+ include filemode.inc
+ include syscall.inc
+ include bugtyp.inc
+ include dossvc.inc
+ include vint.inc
+ .cref
+ .list
+
+
+DOSDATA Segment
+
+ extrn ThisSFT:dword ; pointer to SFT entry
+ extrn DMAAdd:dword ; old-style DMA address
+ extrn EXTERR_LOCUS:byte ; Extended Error Locus
+ extrn FailErr:byte ; failed error flag
+ extrn User_ID:word ; current effective user_id
+ extrn JShare:dword ; jump table
+ extrn CurrentPDB:word ; current process data block
+ extrn EXTOPEN_ON:byte ; flag for extended open
+ extrn THISCDS:dword
+ extrn DUMMYCDS:byte
+ extrn SAVE_ES:word ; saved ES
+ extrn SAVE_DI:word ; saved DI
+ extrn SAVE_DS:word ; saved DS
+ extrn SAVE_SI:word ; saved SI
+ extrn SAVE_CX:word ; saved CX
+
+; Flag to indicate WIN386 presence
+;
+ extrn IsWin386:byte
+
+DOSDATA ENDS
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ EXTRN DOS_Read:NEAR
+ EXTRN DOS_Write:NEAR
+ EXTRN pJfnFromHandle:near
+ EXTRN SFFromHandle:near
+
+
+ BREAK <$Close - return a handle to the system>
+
+
+;** $Close - Close a file Handle
+;
+; BUGBUG - close gets called a LOT with invalid handles - sizzle that
+; path
+;
+; Assembler usage:
+; MOV BX, handle
+; MOV AH, Close
+; INT int_command
+;
+; ENTRY (bx) = handle
+; EXIT <normal INT21 return convention>
+; USES all
+
+Procedure $Close,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+; Grab the SFT pointer from the JFN.
+
+ call SFFromHandle ; get system file entry
+ DLJC CloseError ; error return
+ context DS ; For DOS_CLOSE
+ MOV WORD PTR [ThisSFT],DI ; save offset of pointer
+ MOV WORD PTR [ThisSFT+2],ES ; save segment value
+
+; ES:DI point to SFT
+;
+; We now examine the user's JFN entry; If the file was a 70-mode file (network
+; FCB, we examine the ref count on the SFT; if it was 1, we free the JFN.
+; If the file was not a net FCB, we free the JFN too.
+
+; CMP ES:[DI].sf_ref_count,1 ; will the SFT become free?
+; JZ FreeJFN ; yes, free JFN anyway.
+; MOV AL,BYTE PTR ES:[DI].sf_mode
+; AND AL,sharing_mask
+; CMP AL,sharing_net_fcb
+; JZ PostFree ; 70-mode and big ref count => free it
+
+; The JFN must be freed. Get the pointer to it and replace the contents with
+; -1.
+
+FreeJFN:
+ call pJFNFromHandle ; d = pJFN (handle);
+ MOV BYTE PTR ES:[DI],0FFh ; release the JFN
+PostFree:
+
+; ThisSFT is correctly set, we have DS = DOSDATA. Looks OK for a DOS_CLOSE!
+ LES DI,[THISSFT]
+ call Free_SFT
+ test es:[di.sf_flags],devid_device
+ jnz short devclose
+
+ cmp ax,1
+ jne CloseOK
+ test es:[di.sf_flags],sf_nt_seek
+ mov cx,0ffffh
+ mov dx,0ffffh
+ jz short close_no_seek
+ mov dx,word ptr es:[di.sf_position]
+ mov cx,word ptr es:[di.sf_position+2] ; cx:dx is position
+close_no_seek:
+ push bp
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov ax,word ptr es:[di.sf_NTHandle+2]
+ HRDSVC SVC_DEMCLOSE
+ pop bp
+ mov word ptr es:[di.sf_ref_count],0
+ jc CloseError
+ jmp CloseOK
+
+CloseError:
+ ASSUME DS:NOTHING
+ transfer Sys_Ret_Err
+
+CloseOK:
+ MOV AH,close ; MZ Bogus multiplan fix
+ transfer Sys_Ret_OK
+
+devclose:
+ push ax
+ invoke DEV_Close_SFT
+ pop ax
+ cmp ax,1
+ jne CloseOK
+ mov word ptr es:[di.sf_ref_count],0
+ jmp CloseOK
+
+EndProc $Close
+
+Procedure FREE_SFT,NEAR
+ DOSAssume <DS>,"Free_SFT"
+
+; sudeepb 22-Dec-1992 removed a pair of costly pushf/popf with lahf/sahf
+
+ push bx
+ lahf
+ push ax
+ MOV AX,ES:[DI.sf_ref_count]
+ DEC AX
+ JNZ SetCount
+ DEC AX
+SetCount:
+ XCHG AX,ES:[DI.sf_ref_count]
+ mov bx,ax
+ pop ax
+ sahf
+ mov ax,bx
+ pop bx
+ return
+
+EndProc Free_SFT
+
+ BREAK <$Commit - commit the file>
+
+;** $Commit - Commit a File
+;
+; $Commit "commits" a file to disk - all of it's buffers are
+; flushed out. BUGBUG - I'm pretty sure that $Commit doesn't update
+; the directory entry, etc., so this commit is pretty useless. check
+; and fix this!! jgl
+;
+; Assembler usage:
+; MOV BX, handle
+; MOV AH, Commit
+; INT int_command
+;
+; ENTRY (bx) = handle
+; EXIT none
+; USES all
+
+Procedure $Commit,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+; Grab the SFT pointer from the JFN.
+
+ call SFFromHandle ; get system file entry
+ DLJC CommitError ; error return
+ context DS ; For DOS_CLOSE
+ MOV WORD PTR [ThisSFT],DI ; save offset of pointer
+ MOV WORD PTR [ThisSFT+2],ES ; save segment value
+
+; ES:DI point to SFT
+ TEST WORD PTR ES:[DI.sf_flags], devid_device + devid_file_clean
+ jne CommitOk
+ MOV BP, WORD PTR ES:[DI.sf_NTHandle]
+ MOV AX, WORD PTR ES:[DI.sf_NTHandle + 2]
+ SVC SVC_DEMCOMMIT
+ jc CommitError
+
+CommitOk:
+ mov AH, Commit
+ transfer SYS_RET_OK
+
+CommitError:
+ ASSUME DS:NOTHING
+ transfer SYS_RET_ERR
+
+EndProc $Commit
+
+
+ BREAK <$ExtHandle - extend handle count>
+
+;** $ExtHandle - Extend Handle Count
+;
+; Assembler usage:
+; MOV BX, Number of Opens Allowed (MAX=65534;66535 is
+; MOV AX, 6700H reserved to mark SFT
+; INT int_command busy )
+;
+; ENTRY (bx) = new number of handles
+; EXIT 'C' clear if OK
+; 'C' set iff err
+; (ax) = error code
+; AX = error_not_enough_memory
+; error_too_many_open_files
+; USES all
+
+Procedure $ExtHandle,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ XOR BP,BP ; 0: enlarge 1: shrink 2:psp
+ CMP BX,FilPerProc
+ JAE exth2 ; Don't set less than FilPerProcno
+ MOV BX,FilPerProc
+
+exth2: MOV ES,CurrentPDB ; get user process data block;smr;SS Override
+ MOV CX,ES:PDB_JFN_Length ; get number of handle allowed
+ CMP BX,CX ; the requested == current
+ JE ok_done ; yes and exit
+ JA larger ; go allocate new table
+
+; We're going to shrink the # of handles available
+
+ MOV BP,1 ; shrink
+ MOV DS,WORD PTR ES:[PDB_JFN_Pointer+2] ;
+ MOV SI,BX ;
+ SUB CX,BX ; get difference
+
+; BUGBUG - code a SCASB here, should be a bit smaller
+chck_handles:
+ CMP BYTE PTR DS:[SI],-1 ; scan through handles to ensure close
+ JNZ too_many_files ; status
+ INC SI
+ LOOP chck_handles
+ CMP BX,FilPerProc ; = 20
+ JA larger ; no
+
+ MOV BP,2 ; psp
+ MOV DI,PDB_JFN_Table ; es:di -> jfn table in psp
+ PUSH BX
+ JMP short movhandl
+
+larger:
+ CMP BX,-1 ; 65535 is not allowed
+ JZ invalid_func
+ CLC
+ PUSH BX ; save requested number
+ ADD BX,0FH ; adjust to paragraph boundary
+ MOV CL,4
+ RCR BX,CL ; DOS 4.00 fix ;AC000;
+ AND BX,1FFFH ; clear most 3 bits
+
+ PUSH BP
+ invoke $ALLOC ; allocate memory
+ POP BP
+ JC no_memory ; not enough meory
+
+ MOV ES,AX ; es:di points to new table memory
+ XOR DI,DI
+movhandl:
+ MOV DS,[CurrentPDB] ; get user PDB address ;smr;SS Override
+
+ test BP,3 ; enlarge ?
+ JZ enlarge ; yes
+ POP CX ; cx = the amount you shrink
+ PUSH CX
+ JMP short copy_hand
+
+; Done. 'C' clear
+
+ok_done:transfer Sys_Ret_OK
+
+too_many_files:
+ MOV AL,error_too_many_open_files
+ transfer Sys_Ret_Err
+
+
+enlarge:
+ MOV CX,DS:[PDB_JFN_Length] ; get number of old handles
+copy_hand:
+ MOV DX,CX
+ LDS SI,DS:[PDB_JFN_Pointer] ; get old table pointer
+ASSUME DS:NOTHING
+ REP MOVSB ; copy infomation to new table
+
+ POP CX ; get new number of handles
+ PUSH CX ; save it again
+ SUB CX,DX ; get the difference
+ MOV AL,-1 ; set availability to handles
+ REP STOSB
+
+ MOV DS,[CurrentPDB] ; get user process data block;smr;SS Override
+ CMP WORD PTR DS:[PDB_JFN_Pointer],0 ; check if original table pointer
+ JNZ update_info ; yes, go update PDB entries
+ PUSH BP
+ PUSH DS ; save old table segment
+ PUSH ES ; save new table segment
+ MOV ES,WORD PTR DS:[PDB_JFN_Pointer+2] ; get old table segment
+ invoke $DEALLOC ; deallocate old table meomory
+ POP ES ; restore new table segment
+ POP DS ; restore old table segment
+ POP BP
+
+update_info:
+ test BP,2 ; psp?
+ JZ non_psp ; no
+ MOV WORD PTR DS:[PDB_JFN_Pointer],PDB_JFN_Table ; restore
+ JMP short final
+non_psp:
+ MOV WORD PTR DS:[PDB_JFN_Pointer],0 ; new table pointer offset always 0
+final:
+ MOV WORD PTR DS:[PDB_JFN_Pointer+2],ES ; update table pointer segment
+ POP DS:[PDB_JFN_Length] ; restore new number of handles
+ transfer Sys_Ret_Ok
+no_memory:
+ POP BX ; clean stack
+ MOV AL,error_not_enough_memory
+ transfer Sys_Ret_Err
+invalid_func:
+ MOV AL,error_invalid_function
+ transfer Sys_Ret_Err
+
+EndProc $ExtHandle
+
+ BREAK <$READ - Read from a file handle>
+
+;** $Read - Read from a File Handle
+;
+; Assembler usage:
+;
+; LDS DX, buf
+; MOV CX, count
+; MOV BX, handle
+; MOV AH, Read
+; INT int_command
+; AX has number of bytes read
+;
+; ENTRY (bx) = file handle
+; (cx) = byte count
+; (ds:dx) = buffer address
+; EXIT Through system call return so that to user:
+; 'C' clear if OK
+; (ax) = bytes read
+; 'C' set if error
+; (ax) = error code
+
+procedure $READ,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ fmt TypSysCall,LevArgs,<" Handle $x Cnt $x Buf $x:$x\n">,<BX,CX,DS,DX>
+
+ MOV SI,OFFSET DOSCODE:DOS_Read
+ReadDo: call pJFNFromHandle
+ JC ReadError
+ MOV AL,ES:[DI]
+ invoke SFFromHandle
+ jc readError ; retc
+ JMP short ReadSetup ; no errors do the operation
+
+; Have an error. 'C' set
+
+ReadError:
+ transfer SYS_RET_ERR ; go to error traps
+
+ReadSetup:
+ MOV WORD PTR [ThisSFT],DI ; save offset of pointer;smr;SS Override
+ MOV WORD PTR [ThisSFT+2],ES ; save segment value ;smr;SS Override
+;; Extended Open
+ TESTB ES:[DI.sf_mode],INT_24_ERROR ;need i24
+ JZ needi24 ;yes
+ OR [EXTOPEN_ON],EXT_OPEN_I24_OFF ;set it off;smr;SS Override
+needi24: ;
+
+
+ SAVE <<WORD PTR [DMAAdd]>, <WORD PTR [DMAAdd+2]>>;smr;SS Override
+
+ ;
+ ; Align the users buffer and adjust the byte count
+ ; ensuring that it will fit in the segment
+ ;
+
+ CALL Align_Buffer
+
+ mov ax, cx ; byte count
+ add ax, dx ; + buff offset must be < 64K
+ jnc rdsOK
+ mov ax, word ptr [DMAAdd] ; if more than 64K
+ neg ax ; use whats left
+ jnz rdsNoDec
+ dec ax
+rdsNoDec:
+
+ mov cx, ax ; can do this much
+ or cx, cx
+ jnz rdsOK
+ jmp READ_ERR ; Silly user gave offset of ffff
+rdsOK:
+
+ test es:[di.sf_flags],devid_device
+ jz cont_file
+ jmp devread
+cont_file:
+ push bp
+ push bx
+ mov ax, si
+ mov si,word ptr es:[di.sf_position]
+ mov bx,word ptr es:[di.sf_position+2] ; bx:si is the current position
+
+ cmp ax, offset DOSCODE:DOS_Write
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov ax,word ptr es:[di.sf_NTHandle+2]
+ je short dowrite
+do_read:
+ call FastOrSlow
+ jc do_slowr
+ test es:[di.sf_flags],sf_nt_seek ;set ZF for emulation
+ SVC SVC_DEMFASTREAD
+ jnc short dor2
+do_slowr:
+ test es:[di.sf_flags],sf_nt_seek ;set ZF for emulation
+ HRDSVC SVC_DEMREAD
+ jnc dor2
+ jmp do_err
+dor2:
+ add word ptr es:[di.sf_position],ax
+ adc word ptr es:[di.sf_position+2],0
+ xchg ax, cx ;cx = bytes read, ax=bytes to read
+ or cx, cx
+ jne dow25
+ test es:[di.sf_flags], sf_nt_pipe_in ;read 0 bytes on pipe?
+ je dow25
+;; the file is for piping. guard for EOF
+ mov cx, ax ;restore bytesto read
+ jmp pipe_wait_data_eof
+
+dowrite:
+ push cx
+ call FastOrSlow
+ jc do_sloww
+ test es:[di.sf_flags],sf_nt_seek ;set ZF for emulation
+ SVC SVC_DEMFASTWRITE
+ jnc short do_w1
+do_sloww:
+ test es:[di.sf_flags],sf_nt_seek ;set ZF for emulation
+ HRDSVC SVC_DEMWRITE
+do_w1:
+ pop cx
+ jnc dow0
+ jmp short do_err
+dow0:
+ jcxz wr_special
+ mov cx,ax
+ add word ptr es:[di.sf_position],ax
+ adc word ptr es:[di.sf_position+2],0
+ mov ax,word ptr es:[di.sf_position]
+ mov bx,word ptr es:[di.sf_position+2]
+ push ax
+ push bx
+ sub ax,word ptr es:[di.sf_size]
+ sbb bx,word ptr es:[di.sf_size+2]
+ pop bx
+ pop ax
+ jb dow25
+ mov word ptr es:[di.sf_size],ax
+ mov word ptr es:[di.sf_size+2],bx
+dow25:
+ and word ptr es:[di.sf_flags],NOT sf_nt_seek
+dow3:
+ pop bx
+ pop bp
+
+READ_OK:
+ RESTORE <<WORD PTR [DMAAdd+2]>, <WORD PTR [DMAAdd]>>
+ MOV AX,CX ; get correct return in correct reg
+ transfer sys_ret_ok ; successful return
+
+do_err:
+ pop bx
+ pop bp
+
+READ_ERR:
+ RESTORE <<WORD PTR [DMAAdd+2]>, <WORD PTR [DMAAdd]>>
+ jmp READERROR
+
+wr_special:
+ mov bx,word ptr es:[di.sf_position]
+ mov word ptr es:[di.sf_size],bx
+ mov bx,word ptr es:[di.sf_position+2]
+ mov word ptr es:[di.sf_size+2],bx
+ jmp short dow3
+
+;; we got nothing, try to make sure it is a real EOF.
+pipe_wait_data_eof:
+ mov bp,word ptr es:[di.sf_NTHandle] ;set up NT handle again
+ mov ax,word ptr es:[di.sf_NTHandle+2]
+ SVC SVC_DEMPIPEFILEDATAEOF ;probe for new data or EOF
+ jz pipe_wait_data_eof ;not eof, no new data, wait
+ jnc pipe_read_new_data ;new data, not eof, read it
+;; EOF encounter, mask off sf_nt_pipe_in so we will treat it as an ordinary file
+ and word ptr es:[di.sf_flags], NOT(sf_nt_pipe_in)
+ mov word ptr es:[di.sf_size], bp
+ mov word ptr es:[di.sf_size + 2], ax ;update the file size
+pipe_read_new_data:
+ mov bp,word ptr es:[di.sf_NTHandle] ;NT file handle
+ mov ax,word ptr es:[di.sf_NTHandle+2]
+ mov si,word ptr es:[di.sf_position]
+ mov bx,word ptr es:[di.sf_position+2] ; bx:si is the current position
+ jmp do_read ;read it again
+
+;; Extended Open
+devread:
+ context DS ; go for DOS addressability
+ CALL SI ; indirect call to operation
+ jnc READ_OK
+ jmp short READ_ERR
+EndProc $READ
+
+
+Procedure FastOrSlow,near
+ test es:[di.sf_flags],sf_pipe
+ jnz fos_slow
+ push ds
+ push ax
+ mov ax,40h
+ mov ds,ax
+ test word ptr ds:FIXED_NTVDMSTATE_REL40, MIPS_BIT_MASK
+ pop ax
+ pop ds
+ jz fos_fast
+fos_slow:
+ stc
+fos_fast:
+ ret
+Endproc FastOrSlow
+
+;
+; Input: DS:DX points to user's buffer addr
+; Function: rearrange segment and offset for READ/WRITE buffer
+; Output: [DMAADD] set
+;
+;
+
+procedure Align_Buffer,NEAR ;AN000;
+ ASSUME CS:DOSCODE,SS:DOSDATA ;AN000;
+ SAVE <BX, CX> ; don't stomp on count and handle
+ MOV BX,DX ; copy offset
+ MOV CL,4 ; bits to shift bytes->para
+ SHR BX,CL ; get number of paragraphs
+ MOV AX,DS ; get original segment
+ ADD AX,BX ; get new segment
+ MOV DS,AX ; in seg register
+ AND DX,0Fh ; normalize offset
+ MOV WORD PTR [DMAAdd],DX ; use user DX as offset ;smr;SS Override
+ MOV WORD PTR [DMAAdd+2],DS ; use user DS as segment for DMA;smr;SS Override
+ RESTORE <CX, BX> ; get count and handle back
+ return ;AN000;
+EndProc Align_Buffer ;AN000;
+
+BREAK <$WRITE - write to a file handle>
+
+;
+; Assembler usage:
+; LDS DX, buf
+; MOV CX, count
+; MOV BX, handle
+; MOV AH, Write
+; INT int_command
+; AX has number of bytes written
+; Errors:
+; AX = write_invalid_handle
+; = write_access_denied
+;
+; Returns in register AX
+
+procedure $WRITE,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ fmt TypSysCall,LevArgs,<" Handle $x Cnt $x Buf $x:$x\n">,<BX,CX,DS,DX>
+ MOV SI,OFFSET DOSCODE:DOS_Write
+ JMP ReadDo
+EndProc $Write
+
+BREAK <$LSEEK - move r/w pointer>
+
+;
+; Assembler usage:
+; MOV DX, offsetlow
+; MOV CX, offsethigh
+; MOV BX, handle
+; MOV AL, method
+; MOV AH, LSeek
+; INT int_command
+; DX:AX has the new location of the pointer
+; Error returns:
+; AX = error_invalid_handle
+; = error_invalid_function
+; Returns in registers DX:AX
+
+procedure $LSEEK,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ call SFFromHandle ; get system file entry
+ jnc CHKOWN_OK
+LSeekError:
+ JNC CHKOWN_OK ;AN002;
+ JMP ReadError ;AN002; error return
+
+CHKOWN_OK:
+
+ test es:[di.sf_flags],devid_device
+ jz lseekcheckpipe
+ jmp devseek
+lseekcheckpipe:
+ CMP AL,2 ; is the seek value correct?
+ ja lseekfile_error
+ test es:[di.sf_flags], sf_nt_pipe_in;seek in pipe?
+ je lseekDisp ;no, regular stuff
+ jmp lseekpipe ;yes, do pipe speical
+lseekfile_error:
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus ;smr;SS Override
+ error error_invalid_function ; invalid method
+
+LSeekDisp:
+ CMP AL,1 ; best way to dispatch; check middle
+ JB LSeekStore ; just store CX:DX
+ JA LSeekEOF ; seek from end of file
+ ADD DX,WORD PTR ES:[DI.SF_Position]
+ ADC CX,WORD PTR ES:[DI.SF_Position+2]
+LSeekStore:
+ MOV AX,CX ; AX:DX
+ XCHG AX,DX ; DX:AX is the correct value
+LSeekSetpos:
+ push WORD PTR ES:[DI.SF_Position+2]
+ MOV WORD PTR ES:[DI.SF_Position+2],DX
+ push WORD PTR ES:[DI.SF_Position]
+ MOV WORD PTR ES:[DI.SF_Position],AX
+
+ pop bx
+ cmp ax,bx
+ pop bx
+ jne io_with_seek
+ cmp dx,bx
+ jne io_with_seek
+seek_ret:
+ invoke Get_user_stack
+ MOV DS:[SI.User_DX],DX ; return DX:AX
+ transfer SYS_RET_OK ; successful return
+
+LSeekEOF:
+ mov bl,al
+ push bp
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov ax,word ptr es:[di.sf_NTHandle+2] ; AX:BP is 32bit handle
+ push dx ; Save loword of offset
+ HRDSVC SVC_DEMCHGFILEPTR ; Result comes back in DX:AX
+ pop bx ; CX:BX is the offset desired
+ pop bp
+ jnc lseekeof1
+ jmp ReadError
+lseekeof1:
+ MOV WORD PTR ES:[DI.SF_Position+2],DX ; Update pointer
+ MOV WORD PTR ES:[DI.SF_Position],AX
+ MOV WORD PTR ES:[DI.SF_Size+2],DX ; Size may change
+ MOV WORD PTR ES:[DI.SF_Size],AX
+ sub WORD PTR ES:[DI.SF_Size],bx ; Get the size from
+ sbb WORD PTR ES:[DI.SF_Size+2],cx ; current pointer and
+ ; given offset.
+ and word ptr es:[di.sf_flags], NOT sf_nt_seek ; No seek needed.
+ JMP LSeekOK
+
+io_with_seek:
+ or word ptr es:[di.sf_flags],sf_nt_seek
+ jmp short seek_ret
+
+ifdef not_needed_any_more
+do_pipe:
+ mov bl,al
+ push bp
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov ax,word ptr es:[di.sf_NTHandle+2]
+ HRDSVC SVC_DEMCHGFILEPTR
+ pop bp
+ jnc LseekOK
+ JMP ReadError
+endif
+
+devseek:
+ xor ax,ax
+ mov dx,ax
+LseekOK:
+ invoke Get_user_stack
+ MOV DS:[SI.User_DX],DX ; return DX:AX
+ transfer SYS_RET_OK ; successful return
+
+lseekpipe:
+ push ax
+ push cx
+ push dx
+ cmp al, 2 ;seek from EOF?
+ je lseekpipe_wait_eof ;yes, must wait for EOF
+ cmp al, 1 ;seek from current position?
+ jne lseekpipe_00 ;no, must seek from the head
+;;lseek from current position.
+;;if current position + offset > file size, wait for EOF
+ add dx, word ptr es:[di.sf_position] ; new absolute position
+ adc cx, word ptr es:[di.sf_position + 2]
+lseekpipe_00:
+;;lseek from the beginning of the file
+;;if the new position is beyond file size, wait for EOF
+;;
+ cmp cx, word ptr es:[di.sf_size + 2] ;make sure the new position
+ ja lseekpipe_wait_eof ;is within the current file size
+ cmp dx, word ptr es:[di.sf_size]
+ ja lseekpipe_wait_eof
+ mov ax, cx ; return (DX:AX) as the new position
+ xchg dx, ax
+ mov word ptr es:[di.sf_position], ax ;; update new position to SFT
+ mov word ptr es:[di.sf_position + 2], dx
+ add sp, 6 ;throw away saved registers
+ jmp short lseekOK
+
+lseekpipe_wait_eof:
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov ax,word ptr es:[di.sf_NTHandle+2] ; AX:BP is 32bit handle
+ SVC SVC_DEMPIPEFILEEOF
+ jnc lseekpipe_wait_eof ;not eof, wait
+ mov word ptr es:[di.sf_size], bp ;file size
+ mov word ptr es:[di.sf_size + 2], ax
+ and word ptr es:[di.sf_flags], NOT(sf_nt_pipe_in);becomes an ordinary file
+ pop dx
+ pop cx
+ pop ax
+ jmp lseekDisp
+
+EndProc $LSeek
+
+BREAK <FileTimes - modify write times on a handle>
+
+
+;----------------------------------------------------------------------------
+; Assembler usage:
+; MOV AH, FileTimes (57H)
+; MOV AL, func
+; MOV BX, handle
+; ; if AL = 1 then then next two are mandatory
+; MOV CX, time
+; MOV DX, date
+; INT 21h
+; ; if AL = 0 then CX/DX has the last write time/date
+; ; for the handle.
+;
+; AL=02 get extended attributes
+; BX=handle
+; CX=size of buffer (0, return max size )
+; DS:SI query list (si=-1, selects all EA)
+; ES:DI buffer to hold EA list
+;
+; AL=03 get EA name list
+; BX=handle
+; CX=size of buffer (0, return max size )
+; ES:DI buffer to hold name list
+;
+; AL=04 set extended attributes
+; BX=handle
+; ES:DI buffer of EA list
+;
+;
+;
+;
+; Error returns:
+; AX = error_invalid_function
+; = error_invalid_handle
+;----------------------------------------------------------------------------
+
+procedure $File_Times,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ cmp al, 2 ; correct subfunction ?
+ jae inval_func
+
+ call SFFromHandle ; get sft
+ jnc cont_ft
+ jmp LSeekError ; bad handle
+cont_ft:
+ test es:[di.sf_flags],devid_device
+
+ jz yst_contin ; (YST)
+ cmp al, 1 ; (YST)
+ jz ret_ok ; (YST)
+ mov al, 2 ; (YST)
+
+yst_contin:
+ push ax ;save ax for success case
+ push bp
+ mov bp, word ptr es:[di.sf_NTHandle]
+ mov bl,al
+ mov ax, word ptr es:[di.sf_NTHandle+2]
+ HRDSVC SVC_DEMFILETIMES
+ pop bp
+ jnc short timesok
+ add sp,2 ;ax=return code
+ transfer Sys_Ret_Err
+
+timesok:
+ pop ax ;restore caller's ax
+ cmp bl, 1 ; (YST)
+ jz ret_ok ; (YST)
+
+ invoke Get_User_Stack
+ mov [si].user_CX, cx
+ mov [si].user_DX, dx
+ret_ok:
+ transfer SYS_RET_OK
+
+inval_func:
+ mov ExtErr_Locus,errLoc_Unk ; Extended Error Locus ;SS Override
+ error error_invalid_function ; give bad return
+
+EndProc $File_Times
+
+BREAK <$DUP - duplicate a jfn>
+;
+; Assembler usage:
+; MOV BX, fh
+; MOV AH, Dup
+; INT int_command
+; AX has the returned handle
+; Errors:
+; AX = dup_invalid_handle
+; = dup_too_many_open_files
+
+Procedure $DUP,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AX,BX ; save away old handle in AX
+ invoke JFNFree ; free handle? into ES:DI, new in BX
+DupErrorCheck:
+ JC DupErr ; nope, bye
+ SAVE <ES,DI> ; save away JFN
+ RESTORE <SI,DS> ; into convenient place DS:SI
+ XCHG AX,BX ; get back old handle
+ call SFFromHandle ; get sft in ES:DI
+ JC DupErr ; errors go home
+ invoke DOS_Dup_Direct
+ call pJFNFromHandle ; get pointer
+ MOV BL,ES:[DI] ; get SFT number
+ MOV DS:[SI],BL ; stuff in new SFT
+ transfer SYS_RET_OK ; and go home
+DupErr: transfer SYS_RET_ERR
+
+EndProc $Dup
+
+BREAK <$DUP2 - force a dup on a particular jfn>
+;
+; Assembler usage:
+; MOV BX, fh
+; MOV CX, newfh
+; MOV AH, Dup2
+; INT int_command
+; Error returns:
+; AX = error_invalid_handle
+
+Procedure $Dup2,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <BX,CX> ; save source
+ MOV BX,CX ; get one to close
+ invoke $Close ; close destination handle
+ RESTORE <BX,AX> ; old in AX, new in BX
+ call pJFNFromHandle ; get pointer
+ JMP DupErrorCheck ; check error and do dup
+EndProc $Dup2
+
+Break <CheckOwner - verify ownership of handles from server>
+
+;
+; CheckOwner - Due to the ability of the server to close file handles for a
+; process without the process knowing it (delete/rename of open files, for
+; example), it is possible for the redirector to issue a call to a handle
+; that it soes not rightfully own. We check here to make sure that the
+; issuing process is the owner of the SFT. At the same time, we do a
+; SFFromHandle to really make sure that the SFT is good.
+;
+; ENTRY BX has the handle
+; User_ID is the current user
+; EXIT Carry Clear => ES:DI points to SFT
+; Carry Set => AX has error code
+; USES none
+
+ifdef 0
+Procedure CheckOwner,NEAR
+; Procedue not needed
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ invoke SFFromHandle
+ jc ret_label ; retc
+ push ax
+
+;SR;
+;SR; WIN386 patch - Do not check for USER_ID for using handles since these
+;SR; are shared across multiple VMs in win386.
+;SR;
+ test [IsWin386],1
+ jz no_win386 ;win386 is not present
+ xor ax,ax ;set the zero flag
+ jmp short skip_win386
+
+no_win386:
+
+ mov ax,user_id ;smr;SS Override
+ cmp ax,es:[di].sf_UID
+
+skip_win386:
+
+ pop ax
+ retz
+ mov al,error_invalid_handle
+ stc
+
+ret_label:
+ return
+EndProc CheckOwner
+endif
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/ioctl.asm b/private/mvdm/dos/v86/doskrnl/dos/ioctl.asm
new file mode 100644
index 000000000..c8ea3472c
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/ioctl.asm
@@ -0,0 +1,786 @@
+ PAGE ,132
+
+ TITLE IOCTL - IOCTL system call
+ NAME IOCTL
+
+;** IOCTL system call.
+;
+; $IOCTL
+;
+; Summary of DOS IOCTL support on NT:
+;
+; 0 IOCTL_GET_DEVICE_INFO Supported Truely
+; 1 IOCTL_SET_DEVICE_INFO Supported Truely
+; 2 IOCTL_READ_HANDLE Supported Truely
+; 3 IOCTL_WRITE_HANDLE Supported Truely
+; 4 IOCTL_READ_DRIVE Not Supported (invlid function)
+; 5 IOCTL_WRITE_DRIVE Not Supported (invlid function)
+; 6 IOCTL_GET_INPUT_STATUS Supported Truely
+; 7 IOCTL_GET_OUTPUT_STATUS Supported Truely
+; 8 IOCTL_CHANGEABLE? Supported Truely
+; 9 IOCTL_DeviceLocOrRem? Always returns Local
+; a IOCTL_HandleLocOrRem? Always returns Local
+; b IOCTL_SHARING_RETRY Supported Truely
+; c GENERIC_IOCTL_HANDLE Supported Truely
+; d GENERIC_IOCTL Not Supported (invlid function)
+; e IOCTL_GET_DRIVE_MAP Always returns one letter assigned
+; f IOCTL_SET_DRIVE_MAP Not Supported (invlid function)
+; 10 IOCTL_QUERY_HANDLE Supported Truely
+; 11 IOCTL_QUERY_BLOCK Not Supported (invlid function)
+;
+; Revision history:
+;
+; sudeepb 06-Mar-1991 Ported for NT
+;
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include mult.inc
+ include sf.inc
+ include vector.inc
+ include curdir.inc
+ include ioctl.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ i_need THISCDS,DWORD
+ i_need IOCALL,BYTE
+ i_need IOSCNT,WORD
+ i_need IOXAD,DWORD
+ I_need RetryCount,WORD
+ I_need RetryLoop,WORD
+ I_need EXTERR_LOCUS,BYTE
+ I_need OPENBUF,BYTE
+ I_need ExtErr,WORD
+ I_need DrvErr,BYTE
+ I_need USER_IN_AX,WORD ;AN000;
+ I_need Temp_Var2,WORD ;AN000;
+
+ EXTRN CURDRV:BYTE
+ extrn GetThisDrv:near
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+BREAK <IOCTL - munge on a handle to do device specific stuff>
+;---------------------------------------------------------------------------
+;
+; Assembler usage:
+; MOV BX, Handle
+; MOV DX, Data
+;
+; (or LDS DX,BUF
+; MOV CX,COUNT)
+;
+; MOV AH, Ioctl
+; MOV AL, Request
+; INT 21h
+;
+; AH = 0 Return a combination of low byte of sf_flags and device driver
+; attribute word in DX, handle in BX:
+; DH = high word of device driver attributes
+; DL = low byte of sf_flags
+; 1 Set the bits contained in DX to sf_flags. DH MUST be 0. Handle
+; in BX.
+; 2 Read CX bytes from the device control channel for handle in BX
+; into DS:DX. Return number read in AX.
+; 3 Write CX bytes to the device control channel for handle in BX from
+; DS:DX. Return bytes written in AX.
+; 4 Read CX bytes from the device control channel for drive in BX
+; into DS:DX. Return number read in AX.
+; 5 Write CX bytes to the device control channel for drive in BX from
+; DS:DX. Return bytes written in AX.
+; 6 Return input status of handle in BX. If a read will go to the
+; device, AL = 0FFh, otherwise 0.
+; 7 Return output status of handle in BX. If a write will go to the
+; device, AL = 0FFh, otherwise 0.
+; 8 Given a drive in BX, return 1 if the device contains non-
+; removable media, 0 otherwise.
+; 9 Return the contents of the device attribute word in DX for the
+; drive in BX. 0200h is the bit for shared. 1000h is the bit for
+; network. 8000h is the bit for local use.
+; A Return 8000h if the handle in BX is for the network or not.
+; B Change the retry delay and the retry count for the system. BX is
+; the count and CX is the delay.
+;
+; Error returns:
+; AX = error_invalid_handle
+; = error_invalid_function
+; = error_invalid_data
+;
+;-------------------------------------------------------------------------------
+;
+; This is the documentation copied from DOS 4.0 it is much better
+; than the above
+;
+; There are several basic forms of IOCTL calls:
+;
+;
+; ** Get/Set device information: **
+;
+; ENTRY (AL) = function code
+; 0 - Get device information
+; 1 - Set device information
+; (BX) = file handle
+; (DX) = info for "Set Device Information"
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (DX) = info for "Get Device Information"
+; USES ALL
+;
+;
+; ** Read/Write Control Data From/To Handle **
+;
+; ENTRY (AL) = function code
+; 2 - Read device control info
+; 3 - Write device control info
+; (BX) = file handle
+; (CX) = transfer count
+; (DS:DX) = address for data
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (AX) = count of bytes transfered
+; USES ALL
+;
+;
+; ** Read/Write Control Data From/To Block Device **
+;
+; ENTRY (AL) = function code
+; 4 - Read device control info
+; 5 - Write device control info
+; (BL) = Drive number (0=default, 1='A', 2='B', etc)
+; (CX) = transfer count
+; (DS:DX) = address for data
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (AX) = count of bytes transfered
+; USES ALL
+;
+;
+; ** Get Input/Output Status **
+;
+; ENTRY (AL) = function code
+; 6 - Get Input status
+; 7 - Get Output Status
+; (BX) = file handle
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (AL) = 00 if not ready
+; (AL) = FF if ready
+; USES ALL
+;
+;
+; ** Get Drive Information **
+;
+; ENTRY (AL) = function code
+; 8 - Check for removable media
+; 9 - Get device attributes
+; (BL) = Drive number (0=default, 1='A', 2='B', etc)
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (AX) = 0/1 media is removable/fixed (func. 8)
+; (DX) = device attribute word (func. 9)
+; USES ALL
+;
+;
+; ** Get Redirected bit **
+;
+; ENTRY (AL) = function code
+; 0Ah - Network stuff
+; (BX) = file handle
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (DX) = SFT flags word, 8000h set if network file
+; USES ALL
+;
+;
+; ** Change sharer retry parameters **
+;
+; ENTRY (AL) = function code
+; 0Bh - Set retry parameters
+; (CX) = retry loop count
+; (DX) = number of retries
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; USES ALL
+;
+;
+; =================================================================
+;
+; ** New Standard Control **
+;
+; ALL NEW IOCTL FACILITIES SHOULD USE THIS FORM. THE OTHER
+; FORMS ARE OBSOLETE.
+;
+; =================================================================
+;
+; ENTRY (AL) = function code
+; 0Ch - Control Function subcode
+; (BX) = File Handle
+; (CH) = Category Indicator
+; (CL) = Function within category
+; (DS:DX) = address for data, if any
+; (SI) = Passed to device as argument, use depends upon function
+; (DI) = Passed to device as argument, use depends upon function
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (SI) = Return value, meaning is function dependent
+; (DI) = Return value, meaning is function dependent
+; (DS:DX) = Return address, use is function dependent
+; USES ALL
+;
+; ============== Generic IOCTL Definitions for DOS 3.2 ============
+; (See inc\ioctl.inc for more info)
+;
+; ENTRY (AL) = function code
+; 0Dh - Control Function subcode
+; (BL) = Drive Number (0 = Default, 1= 'A')
+; (CH) = Category Indicator
+; (CL) = Function within category
+; (DS:DX) = address for data, if any
+; (SI) = Passed to device as argument, use depends upon function
+; (DI) = Passed to device as argument, use depends upon function
+;
+; EXIT 'C' set if error
+; (AX) = error code
+; 'C' clear if OK
+; (DS:DX) = Return address, use is function dependent
+; USES ALL
+;
+;---------------------------------------------------------------------------
+
+TABENT macro ORDINAL, handler_address
+
+; .errnz $-IOCTLJMPTABLE-2*ORDINAL
+ DW handler_address
+
+ endm
+
+IOCTLJMPTABLE label word
+ TABENT IOCTL_GET_DEVICE_INFO , ioctl_getset_data ; 0
+ TABENT IOCTL_SET_DEVICE_INFO , ioctl_getset_data ; 1
+ TABENT IOCTL_READ_HANDLE , ioctl_control_string ; 2
+ TABENT IOCTL_WRITE_HANDLE , ioctl_control_string ; 3
+ TABENT IOCTL_READ_DRIVE , ioctl_invalid ; 4
+ TABENT IOCTL_WRITE_DRIVE , ioctl_invalid ; 5
+ TABENT IOCTL_GET_INPUT_STATUS , ioctl_status ; 6
+ TABENT IOCTL_GET_OUTPUT_STATUS , ioctl_status ; 7
+ TABENT IOCTL_CHANGEABLE? , ioctl_removable_media ; 8
+ TABENT IOCTL_DeviceLocOrRem? , Ioctl_is_remote ; 9
+ TABENT IOCTL_HandleLocOrRem? , IOCTL_Handle_Redir ; a
+ TABENT IOCTL_SHARING_RETRY , Set_Retry_Parameters ; b
+ TABENT GENERIC_IOCTL_HANDLE , GENERICIOCTLHANDLE ; c
+ TABENT GENERIC_IOCTL , GENERICIOCTL ; d
+ TABENT IOCTL_GET_DRIVE_MAP , ioctl_get_logical ; e
+ TABENT IOCTL_SET_DRIVE_MAP , ioctl_set_logical ; f
+ TABENT IOCTL_QUERY_HANDLE , query_handle_support ; 10
+ TABENT IOCTL_QUERY_BLOCK , query_device_support ; 11
+
+ procedure $IOCTL,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING
+
+
+ MOV SI,DS ; Stash DS for calls 2,3,4 and 5
+ context DS ;hkn; SS is DOSDATA
+
+ cmp al, 11h ; al must be between 0 & 11h
+ ja ioctl_bad_funj2 ; if not bad function #
+
+ push AX ; Need to save AL for generic IOCTL
+ mov di, ax ; di NOT a PARM
+ and di, 0ffh ; di = al
+ shl di, 1 ; di = index into jmp table
+ pop AX ; Restore AL for generic IOCTL
+
+ jmp word ptr cs:[IOCTLJMPTABLE+di]
+
+
+ioctl_bad_funj2:
+ JMP ioctl_bad_fun
+
+
+ioctl_invalid:
+ JMP ioctl_bad_fun
+;--------------------------------------------------------------------------
+;
+; IOCTL: AL= 0,1
+;
+; ENTRY : DS = DOSDATA
+;
+;---------------------------------------------------------------------
+
+ioctl_getset_data:
+
+ invoke SFFromHandle ; ES:DI -> SFT
+ JNC ioctl_check_permissions ; have valid handle
+ioctl_bad_handle:
+ error error_invalid_handle
+
+ioctl_check_permissions:
+ CMP AL,0
+ MOV AL,BYTE PTR ES:[DI].SF_FLAGS; Get low byte of flags
+ JZ ioctl_read ; read the byte
+
+;**RMFHFE** test dh, 0feh ;AN000;MS.allow dh=1
+
+ or dh, dh
+ JZ ioctl_check_device ; can I set with this data?
+ error error_invalid_data ; no DH <> 0
+
+ioctl_check_device:
+ test AL,devid_device ; can I set this handle?
+
+;**RMFHFE** JZ do_exception ; no, it is a file.
+
+ jz ioctl_bad_funj2
+ OR DL,devid_device ; Make sure user doesn't turn off the
+ ; device bit!! He can muck with the
+ ; others at will.
+ MOV [EXTERR_LOCUS],errLOC_SerDev
+ MOV BYTE PTR ES:[DI].SF_FLAGS,DL ;AC000;MS.; Set flags
+
+
+;**RMFHFE**do_exception:
+;**RMFHFE** OR BYTE PTR ES:[DI.sf_flags+1],DH;AN000;MS.;set 100H bit for disk full
+
+ transfer SYS_RET_OK
+
+
+
+ioctl_read:
+ MOV [EXTERR_LOCUS],errLOC_Disk
+ XOR AH,AH
+ test AL,devid_device ; Should I set high byte
+ JZ ioctl_no_high ; no
+ MOV [EXTERR_LOCUS],errLOC_SerDev
+ LES DI,ES:[DI.sf_devptr] ; Get device pointer
+ MOV AH,BYTE PTR ES:[DI.SDEVATT+1] ; Get high byte
+ jmp short dev_cont
+ioctl_no_high:
+dev_cont:
+ MOV DX,AX
+ invoke get_user_stack
+ MOV [SI.user_DX],DX
+ transfer SYS_RET_OK
+
+
+;--------------------------------------------------------------------------
+;
+; IOCTL: 2,3
+;
+; ENTRY : DS = DOSDATA
+; Si = user's DS
+;
+;--------------------------------------------------------------------------
+
+ioctl_control_string:
+
+ invoke SFFromHandle ; ES:DI -> SFT
+ JC ioctl_bad_handle ; invalid handle
+ TESTB ES:[DI].SF_FLAGS,devid_device ; can I?
+ jz ioctl_bad_funj2 ; No it is a file
+ MOV [EXTERR_LOCUS],errLOC_SerDev
+ LES DI,ES:[DI.sf_devptr] ; Get device pointer
+ XOR BL,BL ; Unit number of char dev = 0
+ JMP ioctl_do_string
+
+
+;--------------------------------------------------------------------------
+;
+; IOCTL: AL = 6,7
+;
+; ENTRY: DS = DOSDATA
+;
+;--------------------------------------------------------------------------
+
+ioctl_status:
+
+ MOV AH,1
+ SUB AL,6 ; 6=0,7=1
+ JZ ioctl_get_status
+ MOV AH,3
+ioctl_get_status:
+ PUSH AX
+ invoke GET_IO_SFT
+ POP AX
+ JNC DO_IOFUNC
+ JMP ioctl_bad_handle ; invalid SFT
+
+DO_IOFUNC:
+ invoke IOFUNC
+ MOV AH,AL
+ MOV AL,0FFH
+ JNZ ioctl_status_ret
+ INC AL
+ioctl_status_ret:
+ transfer SYS_RET_OK
+
+;--------------------------------------------------------------------------
+;
+; IOCTL: AL = 8,9,e
+;
+; ENTRY: DS = DOSDATA
+;
+;--------------------------------------------------------------------------
+
+ioctl_get_logical:
+ xor al,al
+ jmp short icm_ok
+
+ioctl_removable_media:
+ioctl_is_remote:
+ push ax
+ or bl,bl
+ jnz icm_drvok
+ mov bl,CurDrv ; bl = drive (0=a;1=b ..etc)
+ inc bl
+icm_drvok:
+ dec bl
+ HRDSVC SVC_DEMIOCTL ; bl is zero based drive,
+ ; al is subfunction
+
+ pop bx ; bx is the sub-function
+ jc icm_err
+ cmp bl,8 ; if function 9 then only change DX
+ je icm_ok
+
+ invoke get_user_stack
+ MOV [SI.user_DX],DX ; Pass back the DX value too.
+
+icm_ok:
+ transfer Sys_Ret_Ok ; Done
+icm_err:
+ transfer Sys_Ret_Err
+
+
+ioctl_set_logical:
+ invoke get_user_stack
+ mov [SI.user_AX], 0
+ transfer Sys_Ret_Ok
+
+;------------------------------------------------------------------------
+;
+; IOCTL: AL = B
+;
+; ENTRY: DS = DOSDATA
+;
+;-------------------------------------------------------------------------
+
+Set_Retry_Parameters:
+ MOV RetryLoop,CX ; 0 retry loop count allowed
+ OR DX,DX ; zero retries not allowed
+ JZ IoCtl_Bad_Fun
+ MOV RetryCount,DX ; Set new retry count
+doneok:
+ transfer Sys_Ret_Ok ; Done
+
+;--------------------------------------------------------------------------
+;
+; Generic IOCTL entry point. AL = C, D, 10h, 11h
+;
+; here we invoke the Generic IOCTL using the IOCTL_Req structure.
+; SI:DX -> Users Device Parameter Table
+; IOCALL -> IOCTL_Req structure
+;
+; If on entry AL >= IOCTL_QUERY_HANDLE the function is a
+; QueryIOCtlSupport call ELSE it's a standard generic IOCtl
+; call.
+;
+; BUGBUG: Don't push anything on the stack between GENERIOCTL: and
+; the call to Check_If_Net because Check_If_Net gets our
+; return address off the stack if the drive is invalid.
+;
+;----------------------------------------------------------------------------
+
+query_handle_support: ; Entry point for handles
+GENERICIOCTLHANDLE:
+
+ invoke SFFromHandle ; Get SFT for device.
+ jc ioctl_bad_handlej
+
+ TESTB ES:[DI].SF_FLAGS,sf_isnet ; M031;
+ jnz ioctl_bad_fun ; Cannot do this over net.
+
+ test ES:[DI].SF_FLAGS,devid_device ; Fail it if its a file
+ JZ ioctl_bad_fun
+
+ mov [EXTERR_LOCUS],ErrLOC_Serdev
+ les di,es:[di.sf_devptr] ; Get pointer to device.
+ jmp short Do_GenIOCTL
+
+Do_GenIOCTL:
+
+ TESTB ES:[DI.SDEVATT],DEV320 ; Can device handle Generic IOCTL funcs
+ jz ioctl_bad_fun
+
+ mov byte ptr IOCALL.ReqFunc,GENIOCTL ;Assume real Request
+ cmp AL,IOCTL_QUERY_HANDLE ; See if this is just a query
+ jl SetIOCtlBlock
+
+ TESTB ES:[DI.SDEVATT],IOQUERY ; See if device supports a query
+ jz ioctl_bad_fun ; No support for query
+
+ mov byte ptr IOCALL.ReqFunc,IOCTL_QUERY ; Just a query (5.00)
+
+SetIOCtlBlock:
+ PUSH ES ; DEVIOCALL2 expects Device header block
+ PUSH DI ; in DS:SI
+ ; Setup Generic IOCTL Request Block
+ mov byte ptr IOCALL.ReqLen,(size IOCTL_Req)
+ MOV byte ptr IOCALL.ReqUnit,BL
+ MOV byte ptr IOCALL.MajorFunction,CH
+ MOV byte ptr IOCALL.MinorFunction,CL
+ MOV word ptr IOCALL.Reg_SI,SI
+ MOV word ptr IOCALL.Reg_DI,DI
+ MOV word ptr IOCALL.GenericIOCTL_Packet,DX
+ MOV word ptr IOCALL.GenericIOCTL_Packet + 2,SI
+
+;hkn; IOCALL is in DOSDATA
+ MOV BX,offset DOSDATA:IOCALL
+
+ PUSH SS
+ POP ES
+
+ASSUME DS:NOTHING ; DS:SI -> Device header.
+ POP SI
+ POP DS
+ jmp ioctl_do_IO ; Perform Call to device driver
+
+ioctl_bad_fun:
+ error error_invalid_function
+
+ioctl_bad_handlej:
+ jmp ioctl_bad_handle
+
+ioctl_set_DX:
+ invoke get_user_stack
+ MOV [SI.user_DX],DX
+ transfer SYS_RET_OK
+
+ioctl_drv_err:
+
+ error error_invalid_drive
+
+query_device_support:
+GENERICIOCTL:
+ mov [EXTERR_LOCUS],ErrLOC_Disk
+ cmp ch,IOC_DC
+ jne ioctl_bad_fun
+ cmp cl,73h
+ je ioctl_bad_fun
+ or bl,bl
+ jz disk_ioctl_getcd
+ dec bl
+ jmp disk_ioctl_bop
+disk_ioctl_getcd:
+ mov bl, CurDrv
+disk_ioctl_bop:
+ HRDSVC SVC_DEMIOCTL
+ jc disk_ioctl_error
+ transfer SYS_RET_OK
+
+disk_ioctl_error:
+ mov di, ax
+ invoke SET_I24_EXTENDED_ERROR
+;hkn; uss SS override
+;hkn; mov ax, cs:extErr
+ mov ax, ss:extErr
+ transfer SYS_RET_ERR
+
+;--------------------------------------------------------------------------
+; IOCTL: AL = A
+;
+; ENTRY: DS = DOSDATA
+;
+;--------------------------------------------------------------------------
+
+Ioctl_Handle_redir:
+ invoke SFFromHandle ; ES:DI -> SFT
+ JNC ioctl_got_sft ; have valid handle
+ jmp ioctl_bad_handle
+
+ioctl_got_sft:
+ MOV DX,ES:[DI].SF_FLAGS ; Get flags
+ JMP ioctl_set_DX ; pass dx to user and return
+
+ioctl_bad_funj:
+ JMP ioctl_bad_fun
+
+;--------------------------------------------------------------------------
+;
+; IOCTL: AL= 4,5
+;
+; ENTRY: DS = DOSDATA
+; SI = user's DS
+;
+;
+; BUGBUG: Don't push anything on the stack between ioctl_get_dev: and
+; the call to Check_If_Net because Check_If_Net gets our
+; return address off the stack if the drive is invalid.
+;
+;-------------------------------------------------------------------------
+
+ifdef 0 ; Subfunction 4,5 are not supported on NT
+
+ioctl_get_dev:
+
+ DOSAssume <DS>,"IOCtl_Get_Dev"
+
+ CALL Check_If_Net
+ JNZ ioctl_bad_funj ; There are no "net devices", and they
+ ; certainly don't know how to do this
+ ; call.
+endif
+
+ioctl_do_string:
+ TESTB ES:[DI.SDEVATT],DEVIOCTL; See if device accepts control
+ JZ ioctl_bad_funj ; NO
+ ; assume IOCTL read
+ MOV [IOCALL.REQFUNC],DEVRDIOCTL
+
+ TEST AL, 1 ; is it func. 4/5 or 2/3
+ JZ ioctl_control_call ; it is read. goto ioctl_control_call
+
+ ; it is an IOCTL write
+ MOV [IOCALL.REQFUNC],DEVWRIOCTL
+
+ioctl_control_call:
+ MOV AL,DRDWRHL
+ioctl_setup_pkt:
+ MOV AH,BL ; Unit number
+ MOV WORD PTR [IOCALL.REQLEN],AX
+ XOR AX,AX
+ MOV [IOCALL.REQSTAT],AX
+; MOV [IOMED],AL
+ MOV [IOSCNT],CX
+ MOV WORD PTR [IOXAD],DX
+ MOV WORD PTR [IOXAD+2],SI
+ PUSH ES
+ POP DS
+ASSUME DS:NOTHING
+ MOV SI,DI ; DS:SI -> driver
+ PUSH SS
+ POP ES
+
+ MOV BX,OFFSET DOSDATA:IOCALL ; ES:BX -> Call header
+ioctl_do_IO:
+ invoke DEVIOCALL2
+
+ TESTB [IOCALL.REQSTAT],STERR ;Error?
+ JNZ Ioctl_string_err
+
+ MOV AX,[IOSCNT] ; Get actual bytes transferred
+ transfer SYS_RET_OK
+
+Ioctl_string_err:
+ MOV DI,[IOCALL.REQSTAT] ;Get Error
+device_err:
+ AND DI,STECODE ; mask out irrelevant bits
+ MOV AX,DI
+ invoke SET_I24_EXTENDED_ERROR
+
+ mov ax, ss:extErr
+ transfer SYS_RET_ERR
+
+;--------------------------------------------------------------------------
+; Proc name : Get_Driver_BL
+;
+; DS is DOSDATA
+; BL is drive number (0=default)
+; Returns pointer to device in ES:DI, unit number in BL if carry clear
+; No regs modified
+;
+;---------------------------------------------------------------------------
+
+ifdef 0
+Get_Driver_BL:
+
+ DOSAssume <DS>,"Get_Driver_BL"
+ ASSUME ES:NOTHING
+
+ PUSH AX
+ MOV AL,BL ; Drive
+ invoke GETTHISDRV
+ jc ioctl_bad_drv
+ XOR BL,BL ; Unit zero on Net device
+ MOV [EXTERR_LOCUS],errLOC_Net
+ LES DI,[THISCDS]
+ TESTB ES:[DI.curdir_flags],curdir_isnet
+ LES DI,ES:[DI.curdir_devptr]; ES:DI -> Dpb or net dev
+ JNZ got_dev_ptr ; Is net
+ MOV [EXTERR_LOCUS],errLOC_Disk
+ MOV BL,ES:[DI.dpb_UNIT] ; Unit number
+ LES DI,ES:[DI.dpb_driver_addr] ; Driver addr
+got_dev_ptr:
+ CLC
+ioctl_bad_drv:
+ POP AX
+ return
+
+;-------------------------------------------------------------------------
+; Proc Name : Check_If_Net:
+;
+;
+; Checks if the device is over the net or not. Returns result in ZERO flag.
+; If no device is found, the return address is popped off the stack, and a
+; jump is made to ioctl_drv_err.
+;
+; On Entry:
+; Registers same as those for Get_Driver_BL
+;
+; On Exit:
+; ZERO flag - set if not a net device
+; - reset if net device
+; ES:DI -> the device
+;
+;
+; BUGBUG: This function assumes the following stack setup on entry
+;
+; SP+2 -> Error return address
+; SP -> Normal return address
+;
+;-------------------------------------------------------------------------
+
+Check_If_Net:
+ CALL Get_Driver_BL
+ JC ioctl_drv_err_pop ; invalid drive letter
+ PUSH ES
+ PUSH DI
+ LES DI,[THISCDS]
+ TESTB ES:[DI.curdir_flags],curdir_isnet
+ POP DI
+ POP ES
+ ret
+
+ioctl_drv_err_pop:
+ pop ax ; pop off return address
+ jmp ioctl_drv_err
+endif
+
+ioctl_bad_funj3:
+ jmp ioctl_bad_fun
+
+ioctl_string_errj:
+ jmp ioctl_string_err
+
+EndProc $IOCTL
+
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/kstrin.asm b/private/mvdm/dos/v86/doskrnl/dos/kstrin.asm
new file mode 100644
index 000000000..18254bdbb
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/kstrin.asm
@@ -0,0 +1,758 @@
+; SCCSID = @(#)strin.asm 1.2 85/04/18
+;
+; Revision history:
+; A000 version 4.00 Jan. 1988
+;
+Break
+
+; Inputs:
+; DS:DX Point to an input buffer
+; Function:
+; Fill buffer from console input until CR
+; Returns:
+; None
+
+ procedure $STD_CON_STRING_INPUT,NEAR ;System call 10
+ASSUME DS:NOTHING,ES:NOTHING
+
+ MOV AX,SS
+ MOV ES,AX
+ MOV SI,DX
+ XOR CH,CH
+ LODSW
+
+;hkn; use ss override
+ mov ss:Temp_Var,si ;AN000; ; 3/31/KK
+;
+; AL is the buffer length
+; AH is the template length
+;
+ OR AL,AL
+ retz ;Buffer is 0 length!!?
+ MOV BL,AH ;Init template counter
+ MOV BH,CH ;Init template counter
+ ;
+ ; BL is the number of bytes in the template
+ ;
+ CMP AL,BL
+ JBE NOEDIT ;If length of buffer inconsistent with contents
+ CMP BYTE PTR [BX+SI],c_CR
+ JZ EDITON ;If CR correctly placed EDIT is OK
+;
+; The number of chars in the template is >= the number of chars in buffer or
+; there is no CR at the end of the template. This is an inconsistant state
+; of affairs. Pretend that the template was empty:
+;
+NOEDIT:
+ MOV BL,CH ;Reset buffer
+EDITON:
+ MOV DL,AL
+ DEC DX ;DL is # of bytes we can put in the buffer
+;
+; Top level. We begin to read a line in.
+;
+NEWLIN:
+
+;hkn; SS override
+ MOV AL,[CARPOS]
+ MOV [STARTPOS],AL ;Remember position in raw buffer
+ PUSH SI
+
+;hkn; INBUF is in DOSDATA
+ MOV DI,OFFSET DOSDATA:INBUF ;Build the new line here
+
+;hkn; SS override
+ MOV [INSMODE],CH ;Insert mode off
+ MOV BH,CH ;No chars from template yet
+ MOV DH,CH ;No chars to new line yet
+ call IntCNE0 ;AN000; Get first char 2/17/KK
+ jz SavCh ;AN000; if ZF set then interim character 2/17/KK
+ CMP AL,c_LF ;Linefeed
+ JNZ GOTCH ;Filter out LF so < works
+;
+; This is the main loop of reading in a character and processing it.
+;
+; BH is the index of the next byte in the template
+; BL is the length of the template
+; DH is the number of bytes in the buffer
+; DL is the length of the buffer
+;
+entry GETCH
+ call IntCNE0 ;AN000;; 2/17/KK
+ jz SavCh ;AN000;; if ZF set then interim character 2/17/KK
+GOTCH:
+;
+; ^F ignored in case BIOS did not flush the input queue.
+;
+ CMP AL,"F"-"@"
+ JZ GETCH
+;
+; If the leading char is the function-key lead byte
+;
+
+;hkn; ESCCHAR is in TABLE seg (DOSCODE)
+ CMP AL,[ESCCHAR]
+ JNZ ARM03 ;AN000;; 2/17/KK
+ Jmp ESCC ;AN000;; 2/17/KK
+ARM03: ;AN000;; 2/17/KK
+;
+; Rubout and ^H are both destructive backspaces.
+;
+ CMP AL,c_DEL
+ JZ BACKSPJ0 ;AN000; 2/17/KK
+ CMP AL,c_BS
+ JNZ ARM04 ;AN000;; 2/17/KK
+BACKSPJ0: ;AN000;; 2/17/KK
+ Jmp BACKSPJ ;AN000;; 2/17/KK
+ARM04: ;AN000;; 2/17/KK
+;
+; ^W deletes backward once and then backs up until a letter is before the
+; cursor
+;
+ CMP AL,"W" - "@"
+; The removal of the comment characters before the jump statement will
+; cause ^W to backup a word.
+;*** JZ WordDel
+ifdef JAPAN ; MSKK01 07/14/89
+ jnz NotWordDel
+ jmp WordDel
+NotWordDel:
+else
+ NOP
+ NOP
+endif
+ CMP AL,"U" - "@"
+; The removal of the comment characters before the jump statement will
+; cause ^U to clear a line.
+;*** JZ LineDel
+ifdef JAPAN ; MSKK01 07/14/89
+ jnz NotLineDel
+ jmp LineDel
+NotLineDel:
+else
+ NOP
+ NOP
+endif
+
+;
+; CR terminates the line.
+;
+ CMP AL,c_CR
+ JNZ ARM01 ;AN000;; 2/17/KK
+ Jmp ENDLIN ;AN000;; 2/17/KK
+ARM01: ;AN000;; 2/17/KK
+;
+; LF goes to a new line and keeps on reading.
+;
+ CMP AL,c_LF
+ JNZ ARM00 ;AN000;; 2/17/KK
+ Jmp PHYCRLF ;AN000;; 2/17/KK
+ARM00: ;AN000;; 2/17/KK
+;
+; ^X (or ESC) deletes the line and starts over
+;
+
+
+;hkn; CANCHAR is in TABLE seg (DOSCODE), so CS override
+ CMP AL,[CANCHAR]
+ JNZ SAVCH ;AN000;; 2/13/KK
+ JMP KILNEW ;AN000;; 2/13/KK
+InterLoop: ;AN000;; 2/17/KK
+ call IntCNE0 ;AN000;; Get another interim character 2/17/KK
+;
+; Otherwise, we save the input character.
+;
+SAVCH:
+ pushf ;AN000; 2/17/KK
+ CMP DH,DL
+ JAE BUFFUL ; buffer is full.
+;----------------------------- Start of DBCS 2/13/KK
+
+ invoke TESTKANJ ;AN000;
+ JZ ISNORM ;AN000;
+ INC DH ;AN000;
+ CMP DH,DL ;AN000;
+ JB GOTROOM ;AN000;
+ DEC DH ;AN000;; No room for second byte
+ call IntCNE0 ;AN000;; Get second byte
+ JMP SHORT BUFFUL ;AN000;
+ ;AN000;
+GOTROOM: ;AN000;
+ STOSB ;AN000;; Store first byte
+ popf ;AN000;
+ call outchax ;AN000;
+ call IntCNE0 ;AN000;; Get second byte
+ pushf ;AN000;
+ STOSB ;AN000;; Store second byte
+ INC DH ;AN000;
+ popf ;AN000;
+ call outchax ;AN000;
+ jnz ContIn1 ;AN000;; interim character?
+ call InterCheck ;AN000;
+ call InterCheck ;AN000;
+ jmp short InterLoop ;AN000;; not interim skip another check
+
+ISNORM:
+;----------------------------- End of DBCS 2/13/KK
+ STOSB ;AN000;
+ INC DH ;AN000;; increment count in buffer.
+ popf ;AN000;; 2/17/KK
+ invoke BUFOUTx ;AN000;; Print control chars nicely 2/17/KK
+ jnz ContIn1 ;AN000;; 2/17/KK
+ call InterCheck ;AN000;; 2/17/KK
+ jmp short InterLoop ;AN000;; 2/17/KK
+CONTIN1: ;AN000;; 2/13/KK
+;;;CONTIN: ;AN000;; 2/13/KK
+
+;hkn; SS override
+ CMP BYTE PTR [INSMODE],0
+ JNZ GETCH0 ; insertmode => don't advance template
+ CMP BH,BL
+ JAE GETCH0 ; no more characters in template
+ INC SI ; Skip to next char in template
+ INC BH ; remember position in template
+
+ PUSH AX ;
+ MOV AL,BYTE PTR [SI-1] ;AN000;; 2/13/KK
+ invoke TESTKANJ ;AN000;; 2/13/KK
+ POP AX ;AN000;; 2/13/KK
+ JZ GETCH0 ;AN000;; Wasn't a dual byte 2/13/KK
+ INC SI ;AN000;; Was a dual byte, 2/13/KK
+ INC BH ;AN000;; skip one more 2/13/KK
+GETCH0: ;AN000;; 2/17/KK
+ JMP GETCH ;AN000;; 2/17/KK
+
+BACKSPJ: JMP SHORT BACKSP
+
+BUFFUL:
+ popf ;AN000;; 2/17/KK
+ MOV AL,7 ;AN000;; Bell to signal full buffer
+ invoke OUTT
+ JMP GETCH
+; 2/17/KK
+; Reduce character count, reduce pointer 2/17/KK
+; 2/17/KK
+InterCheck: ;AN000;; 2/17/KK
+ dec dh ;AN000;; adjust count 2/17/KK
+ dec di ;AN000;; adjust buffer pointer 2/17/KK
+ ret ;AN000;; 2/17/KK
+
+ESCC:
+ transfer OEMFunctionKey ; let the OEM's handle the key dispatch
+
+ENDLIN:
+ STOSB ; Put the CR in the buffer
+ invoke OUTT ; Echo it
+ POP DI ; Get start of user buffer
+ MOV [DI-1],DH ; Tell user how many bytes
+ INC DH ; DH is length including CR
+COPYNEW:
+ SAVE <DS,ES>
+ RESTORE <DS,ES> ; XCHG ES,DS
+
+;hkn; INBUF is in DOSDATA
+ MOV SI,OFFSET DOSDATA:INBUF
+ MOV CL,DH ; set up count
+ REP MOVSB ; Copy final line to user buffer
+ return
+;
+; Output a CRLF to the user screen and do NOT store it into the buffer
+;
+PHYCRLF:
+ invoke CRLF
+ JMP GETCH
+
+;
+; Delete the previous line
+;
+LineDel:
+ OR DH,DH
+ JNZ bridge00 ;AN000;; 2/13/KK
+ JMP GetCh ;AN000;; 2/13/KK
+bridge00: ;AN000;; 2/13/KK
+ Call BackSpace
+ JMP LineDel
+
+;
+; delete the previous word.
+;
+WordDel:
+WordLoop:
+ Call BackSpace ; backspace the one spot
+ OR DH,DH
+ JZ GetChJ
+ MOV AL,ES:[DI-1]
+ cmp al,'0'
+ jb GetChj
+ cmp al,'9'
+ jbe WordLoop
+ OR AL,20h
+ CMP AL,'a'
+ JB GetChJ
+ CMP AL,'z'
+ JBE WordLoop
+GetChJ:
+ JMP GetCh
+;
+; The user wants to throw away what he's typed in and wants to start over. We
+; print the backslash and then go to the next line and tab to the correct spot
+; to begin the buffered input.
+;
+ entry KILNEW
+ MOV AL,"\"
+ invoke OUTT ;Print the CANCEL indicator
+ POP SI ;Remember start of edit buffer
+PUTNEW:
+ invoke CRLF ;Go to next line on screen
+
+;hkn; SS override
+ MOV AL,[STARTPOS]
+ invoke TAB ;Tab over
+ JMP NEWLIN ;Start over again
+
+
+;
+; Destructively back up one character position
+;
+entry BackSp
+ Call BackSpace
+ JMP GetCh
+
+BackSpace:
+ OR DH,DH
+ JZ OLDBAK ;No chars in line, do nothing to line
+ CALL BACKUP ;Do the backup
+ MOV AL,ES:[DI] ;Get the deleted char
+ invoke TESTKANJ ;AN000;2/13/KK
+ JNZ OLDBAK ;AN000; Was a dual byte, done 2/13/KK
+ CMP AL," "
+ JAE OLDBAK ;Was a normal char
+ CMP AL,c_HT
+ JZ BAKTAB ;Was a tab, fix up users display
+ifdef JAPAN ; MSKK02 07/14/89
+
+; ^U and ^T backspace 2 characters in KANJI VERSION
+
+else
+;; 9/27/86 fix for ctrl-U backspace
+ CMP AL,"U"-"@" ; ctrl-U is a section symbol not ^U
+ JZ OLDBAK
+ CMP AL,"T"-"@" ; ctrl-T is a paragraphs symbol not ^T
+ JZ OLDBAK
+;; 9/27/86 fix for ctrl-U backspace
+endif
+ CALL BACKMES ;Was a control char, zap the '^'
+OLDBAK:
+
+;hkn; SS override
+ CMP BYTE PTR [INSMODE],0
+ retnz ;In insert mode, done
+ OR BH,BH
+ retz ;Not advanced in template, stay where we are
+ DEC BH ;Go back in template
+ DEC SI
+;-------------------------- Start of DBCS 2/13/KK
+ OR BH,BH ;AN000;
+ retz ;AN000;; If we deleted one char and it was the only
+ ;AN000;; one, could not have dual byte
+;;;; POP AX ;AN000;; Get start of template
+;;;; PUSH AX ;AN000;; Put it back on stack
+
+;hkn; SS override
+ mov ax,ss:Temp_Var ;AN000;; 3/31/KK
+ XCHG AX,SI ;AN000;
+LOOKDUAL: ;AN000;
+ CMP SI,AX ;AN000;
+ JAE ATLOC ;AN000;
+ PUSH AX ;AN000;
+ MOV AL,BYTE PTR [SI];AN000;
+ invoke TESTKANJ ;AN000;
+ POP AX ;AN000;
+ JZ ONEINC ;AN000;
+ INC SI ;AN000;
+ONEINC: ;AN000;
+ INC SI ;AN000;
+ JMP SHORT LOOKDUAL ;AN000;
+ ;AN000;
+ATLOC: ;AN000;
+ retz ;AN000;; Correctly pointing to start of single byte
+ DEC AX ;AN000;; Go back one more to correctly point at start
+ DEC BH ;AN000; ; of dual byte
+ MOV SI,AX ;AN000;
+ return ;AN000;
+;-------------------------- End of DBCS 2/13/KK
+
+BAKTAB:
+ PUSH DI
+ DEC DI ;Back up one char
+ STD ;Go backward
+ MOV CL,DH ;Number of chars currently in line
+ MOV AL," "
+ PUSH BX
+ MOV BL,7 ;Max
+ JCXZ FIGTAB ;At start, do nothing
+FNDPOS:
+ SCASB ;Look back
+ JNA CHKCNT
+ CMP BYTE PTR ES:[DI+1],9
+ JZ HAVTAB ;Found a tab
+ DEC BL ;Back one char if non tab control char
+CHKCNT:
+ LOOP FNDPOS
+FIGTAB:
+
+;hkn; SS override
+ SUB BL,[STARTPOS]
+HAVTAB:
+ SUB BL,DH
+ ADD CL,BL
+ AND CL,7 ;CX has correct number to erase
+ CLD ;Back to normal
+ POP BX
+ POP DI
+ JZ OLDBAK ;Nothing to erase
+TABBAK:
+ invoke BACKMES
+ LOOP TABBAK ;Erase correct number of chars
+ JMP SHORT OLDBAK
+
+BACKUP:
+ DEC DH ;Back up in line
+ DEC DI
+;-------------------------Start of DBCS 2/13/KK
+ OR DH,DH ;AN000;
+ JZ BACKMES ;AN000;; If deleted one and got only, no dual
+ MOV AX,DI ;AN000;
+
+;hkn; INBUF is in DOSDATA
+ MOV DI,OFFSET DOSDATA:INBUF;AN000;
+LOOKDUAL2: ;AN000;
+ CMP DI,AX ;AN000;
+ JAE ATLOC2 ;AN000;
+ PUSH AX ;AN000;
+ MOV AL,BYTE PTR ES:[DI] ;AN000;
+ invoke TESTKANJ ;AN000;
+ POP AX ;AN000;
+ JZ ONEINC2 ;AN000;
+ INC DI ;AN000;
+ONEINC2: ;AN000;
+ INC DI ;AN000;
+ JMP SHORT LOOKDUAL2 ;AN000;
+ ;AN000;
+ATLOC2: ;AN000;
+ JE BACKMES ;AN000;; Correctly deleted single byte
+ DEC AX ;AN000; Go back one more to correctly delete dual byte
+ DEC DH ;AN000;
+ MOV DI,AX ;AN000;
+ CALL BACKMES ;AN000;
+;---------------------------End of DBCS 2/13/KK
+BACKMES:
+ MOV AL,c_BS ;Backspace
+ invoke OUTT
+ MOV AL," " ;Erase
+ invoke OUTT
+ MOV AL,c_BS ;Backspace
+ JMP OUTT ;Done
+
+;User really wants an ESC character in his line
+ entry TwoEsc
+
+;hkn; ESCCHAR is in DOSCODE so CS override
+ MOV AL,[ESCCHAR]
+ JMP SAVCH
+
+;Copy the rest of the template
+ entry COPYLIN
+ MOV CL,BL ;Total size of template
+ SUB CL,BH ;Minus position in template, is number to move
+ JMP SHORT COPYEACH
+
+ entry CopyStr
+ invoke FINDOLD ;Find the char
+ JMP SHORT COPYEACH ;Copy up to it
+
+;Copy one char from template to line
+ entry COPYONE
+ MOV CX,1 ;AN000;; 2/13/KK
+ MOV AL,[SI] ;AN000;; get char 2/13/KK
+ invoke TestKanj ;AN000;; is it kanji? 2/13/KK
+ JZ CopyEach ;AN000;; no, go do copy2/13/KK
+ INC CX ;AN000;; do 2 byte copy2/13/KK
+
+;Copy CX chars from template to line
+COPYEACH:
+
+;hkn; SS override
+ MOV BYTE PTR [INSMODE],0 ;All copies turn off insert mode
+ CMP DH,DL
+ JZ GETCH2 ;At end of line, can't do anything
+ CMP BH,BL
+ JZ GETCH2 ;At end of template, can't do anything
+ LODSB
+ STOSB
+;----------------------------- Start of DBCS 2/13/KK
+ INC BH ;AN000;; Ahead in template
+ INC DH ;AN000;; Ahead in line
+ CALL TestKanj ;AN000;; 2 byte character?
+ JZ CopyLoop ;AN000;; no, go copy next
+ CMP DH,DL ;AN000;; over boundary?
+ JNZ CopyBoth ;AN000;; no, move both
+ DEC BH ;AN000;; yes, backup template
+ DEC DH ;AN000;; back up line
+ DEC SI ;AN000;; patch (from Dohhaku)
+ DEC DI ;AN000;; remember to backup after previous move
+ JMP GetCh ;AN000;; go get next char
+ ;AN000;
+CopyBoth: ;AN000;
+ invoke BUFOUT ;AN000;; output the first byte
+ LODSB ;AN000;; get the second
+ STOSB ;AN000;; move the second
+ INC BH ;AN000;; bump template
+ INC DH ;AN000;; bump line
+ DEC CX ;AN000;; dump byte count
+CopyLoop: ;AN000;
+ invoke BUFOUT ;AN000;
+ LOOP COPYEACH ;AN000;
+;;;;; invoke BUFOUT
+;;;;; INC BH ;Ahead in template
+;;;;; INC DH ;Ahead in line
+;;;;; LOOP COPYEACH
+;----------------------------- End of DBCS 2/13/KK
+GETCH2:
+ JMP GETCH
+
+;Skip one char in template
+ entry SKIPONE
+ CMP BH,BL
+ JZ GETCH2 ;At end of template
+ INC BH ;Ahead in template
+ INC SI
+ PUSH AX ;AN000;; 2/13/KK
+ MOV AL,BYTE PTR [SI-1] ;AN000;; 2/13/KK
+ invoke TESTKANJ ;AN000;; 2/13/KK
+ POP AX ;AN000;; 2/13/KK
+ JZ GETCH2 ;AN000;; 2/13/KK
+ INC BH ;AN000;; 2/13/KK
+ INC SI ;AN000;; 2/13/KK
+ JMP GETCH
+
+ entry SKIPSTR
+ invoke FINDOLD ;Find out how far to go
+ ADD SI,CX ;Go there
+ ADD BH,CL
+ JMP GETCH
+
+;Get the next user char, and look ahead in template for a match
+;CX indicates how many chars to skip to get there on output
+;NOTE: WARNING: If the operation cannot be done, the return
+; address is popped off and a jump to GETCH is taken.
+; Make sure nothing extra on stack when this routine
+; is called!!! (no PUSHes before calling it).
+
+;hkn; LOOKSIZ has been moved to DATA seg (ms_data.asm)
+;hkn; TABLE SEGMENT ;AN000;; 2/17/KK
+;hkn; Public KISTR001S,KISTR001E ;AN000;; 2/17/KK
+;hkn; KISTR001S label byte ;AN000;; 2/17/KK
+;hkn; LOOKSIZ DB 0 ;AN000;; 0 if byte, NZ if word 2/17/KK
+;hkn; KISTR001E label byte ;AN000;; 2/17/KK
+;hkn; TABLE ENDS ;AN000;; 2/17/KK
+
+extrn LOOKSIZ : byte
+
+FINDOLD:
+
+;hkn; SS override
+ MOV [LOOKSIZ],0 ;AN000;; Initialize to byte 2/13/KK
+ call IntCNE1 ;AN000;; 2/17/KK
+
+;hkn; ESCCHAR is in DOSCODE so CS override
+ CMP AL,[ESCCHAR] ;AN000;; did he type a function key?
+;;;;; JNZ FindSetup ;AN000;; no, set up for scan 2/13/KK
+ JNZ TryKanj ;AN000;; no, continue testing 2/13/KK
+ call IntCNE1 ;AN000;; 2/17/KK
+ JMP NotFnd ; go try again
+;;;;;;;FindSetup: ;AN000;; 2/13/KK
+TryKanj: ;AN000;; 2/13/KK
+ invoke TESTKANJ ;AN000;; 2/13/KK
+ JZ GOTLSIZ ;AN000;; 2/13/KK
+
+;hkn; SS override
+ INC [LOOKSIZ] ;AN000;; Gonna look for a word 2/13/KK
+ PUSH AX ;AN000;; Save first byte 2/13/KK
+ call IntCNE1 ;AN000;; 2/17/KK
+ POP CX ;AN000;; 2/13/KK
+ MOV AH,AL ;AN000;; 2/13/KK
+ MOV AL,CL ;AN000;; AX is dual byte sequence to look for
+ XOR CX,CX ;AN000;; Re-zero CH 2/13/KK
+GOTLSIZ:
+ MOV CL,BL
+ SUB CL,BH ;CX is number of chars to end of template
+ JZ NOTFND ;At end of template
+ DEC CX ;Cannot point past end, limit search
+ JZ NOTFND ;If only one char in template, forget it
+ PUSH AX ;AN000;; 2/13/KK
+ MOV AL,BYTE PTR [SI] ;AN000;; 2/13/KK
+ invoke TESTKANJ ;AN000;; 2/13/KK
+ POP AX ;AN000;; 2/13/KK
+ JZ NOTDUAL5 ;AN000;; 2/13/KK
+ DEC CX ;AN000;; And one more besides 2/13/KK
+ JZ NOTFND ;AN000;; If only one char in template, forget it
+NOTDUAL5: ;AN000;; 2/13/KK
+ PUSH ES
+ PUSH DS
+ POP ES
+ PUSH DI
+ MOV DI,SI ;Template to ES:DI
+;;;; INC DI 2/13/KK
+;;;; REPNE SCASB ;Look 2/13/KK
+;--------------------- Start of DBCS 2/13/KK
+ PUSH AX ;AN000;
+ MOV AL,BYTE PTR ES:[DI] ;AN000;
+ invoke TESTKANJ ;AN000;
+ POP AX ;AN000;
+ JZ ONEINC5 ;AN000;
+ INC DI ;AN000;; We will skip at least something
+ONEINC5: ;AN000;
+ INC DI ;AN000;
+
+;hkn; SS override
+ CMP [LOOKSIZ],0 ;AN000;
+ JNZ LOOKWORD ;AN000;
+LOOKBYTE: ;AN000;
+ PUSH AX ;AN000;
+ MOV AL,BYTE PTR ES:[DI] ;AN000;
+ invoke TESTKANJ ;AN000;
+ POP AX ;AN000;
+ JZ TESTITB ;AN000;
+ INC DI ;AN000;
+ INC DI ;AN000;
+ DEC CX ;AN000;
+ LOOP LOOKBYTE ;AN000;
+ JMP SHORT ATNOTFND ;AN000;
+ ;AN000;
+TESTITB: ;AN000;
+ DEC CX ;AN000;
+ CMP AL,ES:[DI] ;AN000;
+ JZ ATSPOT ;AN000;
+ INC DI ;AN000;
+ INC CX ;AN000;; Counter next instruction
+ LOOP LOOKBYTE ;AN000;
+ATNOTFND: ;AN000;
+ XOR AL,AL ;AN000;
+ INC AL ;AN000;; Set NZ
+ATSPOT: ; 2/13/K;AN000;K
+;--------------------- End of DBCS 2/13/KK
+ POP DI
+ POP ES
+ JNZ NOTFND ;Didn't find the char
+ NOT CL ;Turn how far to go into how far we went
+ ADD CL,BL ;Add size of template
+ SUB CL,BH ;Subtract current pos, result distance to skip
+ return
+
+NOTFND:
+ POP BP ;Chuck return address
+ JMP GETCH
+;------------------------- Start of DBCS 2/13/KK
+LOOKWORD: ;AN000;
+ PUSH AX ;AN000;
+ MOV AL,BYTE PTR ES:[DI] ;AN000;
+ invoke TESTKANJ ;AN000;
+ POP AX ;AN000;
+ JNZ TESTITW ;AN000;
+ INC DI ;AN000;
+ LOOP LOOKWORD ;AN000;
+ JMP SHORT ATNOTFND ;AN000;
+ ;AN000;
+TESTITW: ;AN000;
+ DEC CX ;AN000;
+ CMP AX,ES:[DI] ;AN000;
+ JZ ATSPOT ;AN000;
+ INC DI ;AN000;
+ INC DI ;AN000;
+ LOOP LOOKWORD ;AN000; ; Performs second DEC of CX
+ JMP SHORT ATNOTFND ;AN000;
+;------------------------- End of DBCS 2/13/KK
+
+entry REEDIT
+ MOV AL,"@" ;Output re-edit character
+ invoke OUTT
+ POP DI
+ PUSH DI
+ PUSH ES
+ PUSH DS
+ invoke COPYNEW ;Copy current line into template
+ POP DS
+ POP ES
+ POP SI
+ MOV BL,DH ;Size of line is new size template
+ JMP PUTNEW ;Start over again
+
+ entry EXITINS
+ entry ENTERINS
+
+;hkn; SS override
+ NOT BYTE PTR [INSMODE]
+ JMP GETCH
+
+;Put a real live ^Z in the buffer (embedded)
+ entry CTRLZ
+ MOV AL,"Z"-"@"
+ JMP SAVCH
+
+;Output a CRLF
+ entry CRLF
+ MOV AL,c_CR
+ invoke OUTT
+ MOV AL,c_LF
+ JMP OUTT
+
+EndProc $STD_CON_STRING_INPUT
+
+;-------------- Start of DBCS 2/17/KK
+PUBLIC IntCNE0 ;AN000;
+procedure IntCNE0,near ;AN000;
+
+;hkn SS override for InterCon
+ push word ptr [InterCon] ;AN000;
+ mov [InterCon],01 ;AN000;
+get_com: ;AN000;
+ invoke INTER_CON_INPUT_NO_ECHO ;AN000;; get a byte character
+ pop word ptr [InterCon] ;AN000;
+ ret ;AN000;
+IntCNE0 endp ;AN000;
+ ;AN000;
+procedure IntCNE1,near ;AN000;
+ push word ptr [InterCon] ;AN000;
+ mov [InterCon],00 ;AN000;
+ jmp short get_com ;AN000;
+IntCNE1 endp ;AN000;
+ ;AN000;
+ procedure outchax,near ;AN000;
+
+;hkn; SS override for SaveCurFlag
+ pushf ;AN000;
+ mov [SaveCurFlg],0 ;AN000;
+ jnz sj1 ;AN000;
+ mov [SaveCurFlg],1 ;AN000;
+sj1: ;AN000;
+ CALL OUTCHA ;AN000;
+ mov [SaveCurFlg],0 ;AN000;
+ popf ;AN000;
+ ret ;AN000;
+outchax endp ;AN000;
+ ;AN000;
+ procedure bufoutx,near ;AN000;
+ pushf ;AN000;
+ mov [SaveCurFlg],0 ;AN000;
+ jnz sj2 ;AN000;
+ mov [SaveCurFlg],1 ;AN000;
+sj2: ;AN000;
+ invoke BUFOUT ;AN000;
+ mov [SaveCurFlg],0 ;AN000;
+ popf ;AN000;
+ ret ;AN000;
+bufoutx endp ;AN000;
+;-------------- End of DBCS 2/17/KK
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/doskrnl/dos/lock.asm b/private/mvdm/dos/v86/doskrnl/dos/lock.asm
new file mode 100644
index 000000000..e2032c7b4
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/lock.asm
@@ -0,0 +1,218 @@
+ TITLE LOCK ROUTINES - Routines for file locking
+ NAME LOCK
+
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;** LOCK.ASM - File Locking Routines
+;
+; LOCK_CHECK
+; LOCK_VIOLATION
+; $LockOper
+;
+; Revision history:
+; A000 version 4.00 Jan. 1988
+; SudeepB 07-Aug-1992 Ported for NT
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include lock.inc
+ include mult.inc
+ include sf.inc
+ include dossvc.inc
+ .cref
+ .list
+
+AsmVars <IBM, Installed>
+
+Installed = TRUE
+
+ i_need THISSFT,DWORD
+ i_need THISDPB,DWORD
+ i_need EXTERR,WORD
+ i_need ALLOWED,BYTE
+ i_need RetryCount,WORD
+ I_need fShare,BYTE
+ I_Need EXTERR_LOCUS,BYTE ; Extended Error Locus
+ i_need JShare,DWORD
+ i_need Lock_Buffer,DWORD ; DOS 4.00
+ i_need Temp_Var,WORD ; DOS 4.00
+
+
+DOSCODE SEGMENT
+
+ allow_getdseg
+
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+BREAK <$LockOper - Lock Calls>
+
+;
+; Assembler usage:
+; MOV BX, Handle (DOS 3.3)
+; MOV CX, OffsetHigh
+; MOV DX, OffsetLow
+; MOV SI, LengthHigh
+; MOV DI, LengthLow
+; MOV AH, LockOper
+; MOV AL, Request
+; INT 21h
+;
+; Error returns:
+; AX = error_invalid_handle
+; = error_invalid_function
+; = error_lock_violation
+;
+; Assembler usage:
+; MOV AX, 5C?? (DOS 4.00)
+;
+; 0? lock all
+; 8? lock write
+; ?2 lock multiple
+; ?3 unlock multiple
+; ?4 lock/read
+; ?5 write/unlock
+; ?6 add (lseek EOF/lock/write/unlock)
+; MOV BX, Handle
+; MOV CX, count or size
+; LDS DX, buffer
+; INT 21h
+;
+; Error returns:
+; AX = error_invalid_handle
+; = error_invalid_function
+; = error_lock_violation
+
+ procedure $LockOper,NEAR
+ CMP AL,1
+ JA lock_bad_func
+
+ PUSH DI ; Save LengthLow
+ invoke SFFromHandle ; ES:DI -> SFT
+ JNC lock_do ; have valid handle
+ POP DI ; Clean stack
+ error error_invalid_handle
+lock_bad_func:
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus;smr;SS Override
+ error error_invalid_function
+
+lock_do:
+ mov bp,word ptr es:[di.sf_NTHandle]
+ mov bx,word ptr es:[di.sf_NTHandle+2]
+ pop di
+
+ HRDSVC SVC_DEMLOCKOPER ; BX:BP = NT handle
+ ; cx:dx = offset
+ ; si:di = length
+ ; al = lock/unlock
+ JNC Lock_OK
+ transfer SYS_RET_ERR
+Lock_OK:
+ MOV AX,[Temp_VAR] ;AN000;;MS. AX= number of bytes;smr;SS Override
+ transfer SYS_Ret_OK
+
+EndProc $LockOper
+
+if 0
+
+; Inputs:
+; Outputs of SETUP
+; [USER_ID] Set
+; [PROC_ID] Set
+; Function:
+; Check for lock violations on local I/O
+; Retries are attempted with sleeps in between
+; Outputs:
+; Carry clear
+; Operation is OK
+; Carry set
+; A lock violation detected
+; Outputs of SETUP preserved
+
+procedure LOCK_CHECK,NEAR
+ DOSAssume <DS>,"Lock_Check"
+
+ MOV BX,RetryCount ; Number retries
+LockRetry:
+ SAVE <BX,AX> ; save regs
+if installed
+ call JShare + 8 * 4
+else
+ Call chk_block ;PBUGBUG
+endif
+ RESTORE <AX,BX> ; restrore regs
+ jnc ret_label ; There are no locks (retnc)
+ Invoke Idle ; wait a while
+ DEC BX ; remember a retry
+ JNZ LockRetry ; more retries left...
+ STC
+
+ret_label:
+ return
+EndProc LOCK_CHECK
+
+; Inputs:
+; [THISDPB] set
+; [READOP] indicates whether error on read or write
+; Function:
+; Handle Lock violation on compatibility (FCB) mode SFTs
+; Outputs:
+; Carry set if user says FAIL, causes error_lock_violation
+; Carry clear if user wants a retry
+;
+; DS, ES, DI, CX preserved, others destroyed
+
+procedure LOCK_VIOLATION,NEAR
+ DOSAssume <DS>,"Lock_Violation"
+
+ PUSH DS
+ PUSH ES
+ PUSH DI
+ PUSH CX
+ MOV AX,error_lock_violation
+ MOV [ALLOWED],allowed_FAIL + allowed_RETRY
+ LES BP,[THISDPB]
+ MOV DI,1 ; Fake some registers
+ MOV CX,DI
+ MOV DX,ES:[BP.dpb_first_sector]
+ invoke HARDERR
+ POP CX
+ POP DI
+ POP ES
+ POP DS
+ CMP AL,1
+ retz ; 1 = retry, carry clear
+ STC
+ return
+
+EndProc LOCK_VIOLATION
+
+IF INSTALLED
+
+; do a retz to return error
+
+Procedure CheckShare,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ push ds ;smr;
+ getdseg <ds> ; ds -> dosdata
+ CMP fShare,0
+ pop ds ;smr;
+ ASSUME DS:NOTHING ;smr;
+ return
+EndProc CheckShare
+
+ENDIF
+
+endif
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/macro.asm b/private/mvdm/dos/v86/doskrnl/dos/macro.asm
new file mode 100644
index 000000000..32366858c
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/macro.asm
@@ -0,0 +1,434 @@
+ TITLE MACRO - Pathname and macro related internal routines
+ NAME MACRO
+
+;** MACRO.ASM
+;
+; $AssignOper
+; InitCDS
+; $UserOper
+; GetVisDrv
+; GetThisDrv
+; GetCDSFromDrv
+;
+; Modification History
+;
+; sudeepb 11-Mar-1991 Ported for NT DOSEm.
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include mult.inc
+ include curdir.inc
+ include cmdsvc.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ I_need ThisCDS,DWORD ; pointer to CDS used
+ I_need CDSAddr,DWORD ; pointer to CDS table
+ I_need CDSCount,BYTE ; number of CDS entries
+ I_need SCS_ToSync,BYTE ; Flag which tells to validate CDSs
+ I_need CurDrv,BYTE ; current macro assignment (old
+ ; current drive)
+ I_need NUMIO,BYTE ; Number of physical drives
+ I_need fSharing,BYTE ; TRUE => no redirection allowed
+ I_need DummyCDS,curdirLen ; buffer for dummy cds
+ I_need NetCDS,curdirLen ; buffer for Net cds
+ I_need DIFFNAM,BYTE ; flag for MyName being set
+ I_need MYNAME,16 ; machine name
+ I_need MYNUM,WORD ; machine number
+ I_need EXTERR_LOCUS,BYTE ; Extended Error Locus
+ I_need DrvErr,BYTE ; drive error
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+BREAK <$AssignOper -- Set up a Macro>
+
+; Inputs:
+; AL = 00 get assign mode (ReturnMode)
+; AL = 01 set assign mode (SetMode)
+; AL = 02 get attach list entry (GetAsgList)
+; AL = 03 Define Macro (attch start)
+; BL = Macro type
+; = 0 alias
+; = 1 file/device
+; = 2 drive
+; = 3 Char device -> network
+; = 4 File device -> network
+; DS:SI -> ASCIZ source name
+; ES:DI -> ASCIZ destination name
+; AL = 04 Cancel Macro
+; DS:SI -> ASCIZ source name
+; AL = 05 Modified get attach list entry
+; AL = 06 Get ifsfunc item
+; AL = 07 set in_use of a drive's CDS
+; DL = drive number, 0=default 0=A,,
+; AL = 08 reset in_use of a drive's CDS
+; DL = drive number, 0=A, 1=B,,,
+; Function:
+; Do macro stuff
+; Returns:
+; Std Xenix style error return
+
+procedure $AssignOper,NEAR
+
+ CMP AL,7 ; set in_use ? ;AN000;
+ JNZ chk08 ; no ;AN000;
+srinuse: ;AN000;
+ PUSH AX ; save al ;AN000;
+ MOV AL,DL ; AL= drive id ;AN000;
+ CALL GetCDSFromDrv ; ds:si -> cds ;AN000;
+ POP AX ; ;AN000;
+ JC baddrv ; bad drive ;AN000;
+;
+; RLF 09/10/91
+; No curdir_devptr - therefore no point checking it?
+;
+; CMP WORD PTR [SI.curdir_devptr],0 ; dpb ptr =0 ? ;AN000;
+; JZ baddrv ; no ;AN000;
+;
+; RLF 09/10/91
+;
+ CMP AL,7 ; set ? ;AN000;
+ JNZ resetdrv ; no ;AN000;
+ OR [SI.curdir_flags],curdir_inuse; set in_use ;AN000;
+ JMP SHORT okdone ; ;AN000;
+resetdrv: ;AN000;
+ AND [SI.curdir_flags],NOT curdir_inuse; reset in_use ;AN000;
+ JMP SHORT okdone ; ;AN000;
+baddrv: ;AN000;
+ MOV AX,error_invalid_drive ; error ;AN000;
+ JMP SHORT ASS_ERR ; ;AN000;
+chk08: ;AN000;
+ CMP AL,8 ; reset inuse ? ;AN000;
+ JZ srinuse ; yes ;AN000;
+
+ IF NOT INSTALLED
+ transfer NET_ASSOPER
+ ELSE
+ PUSH AX
+ MOV AX,(multnet SHL 8) OR 30
+ INT 2FH
+ POP BX ; Don't zap error code in AX
+ JC ASS_ERR
+okdone:
+ transfer SYS_RET_OK
+
+ASS_ERR:
+ transfer SYS_RET_ERR
+ ENDIF
+
+EndProc $AssignOper
+
+ Break <InitCDS - set up an empty CDS>
+
+
+;** InitCDS - Setup an Empty CDS
+;
+; ENTRY ThisCDS points to CDS
+; AL has uppercase drive letter
+; EXIT ThisCDS is now empty
+; (ES:DI) = CDS
+; 'C' set if no DPB associated with drive
+; USES AH,ES,DI, Flags
+
+Procedure InitCDS,NEAR
+ DOSASSUME <SS>,"InitCDS"
+ ASSUME CS:DOSCODE
+
+ SAVE <ax> ; save (AL) for caller
+ LES DI,THISCDS ; (es:di) = CDS address
+ MOV ES:[DI].curdir_flags,0 ; "free" CDS
+
+ ; On NT we allow any valid drive letter for network drives
+ ; CMP NUMIO,AL ; smr;SS Override
+ ; JC icdsx ; Drive does not map a physical drive
+ cmp al, 25 + "A"
+ ja icdsErr
+
+ MOV AH,':'
+ MOV WORD PTR ES:[DI.curdir_text],AX ; set "x:"
+ MOV WORD PTR ES:[DI.curdir_text+2],"\" ; NUL terminate
+ .errnz CURDIR_INUSE-4000h
+ OR byte ptr ES:[DI].curdir_flags+1,curdir_inuse SHR 8
+ mov al,2
+ MOV ES:[DI].curdir_END,ax
+icdsx: RESTORE <ax>
+ return
+
+icdsErr:
+ stc
+ jmp short icdsx
+
+EndProc InitCDS
+
+Break <$UserOper - get/set current user ID (for net)>
+
+;
+; $UserOper - retrieve or initiate a user id string. MSDOS will only
+; maintain this string and do no verifications.
+;
+; Inputs: AL has function type (0-get 1-set 2-printer-set 3-printer-get
+; 4-printer-set-flags,5-printer-get-flags)
+; DS:DX is user string pointer (calls 1,2)
+; ES:DI is user buffer (call 3)
+; BX is assign index (calls 2,3,4,5)
+; CX is user number (call 1)
+; DX is flag word (call 4)
+; Outputs: If AL = 0 then the current user string is written to DS:DX
+; and user CX is set to the user number
+; If AL = 3 then CX bytes have been put at input ES:DI
+; If AL = 5 then DX is flag word
+;
+; NOTES for NT: sudeepb 01-Mar-1993
+; We ignore setting of the computer name although we succeed.
+; Functions realted to printer info are handled the same way
+; as DOS i.e. by an int2f, but redir does'nt do anything about
+; it as remote printing is'nt handled by redir. I dont
+; know what could potentially be broken because of this.
+
+
+Procedure $UserOper,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ PUSH AX
+ SUB AL,1 ; quick dispatch on 0,1
+ POP AX
+ JB UserGet ; return to user the string
+ JZ UserSet ; set the current user
+ CMP AL,5 ; test for 2,3,4 or 5
+ JBE UserPrint ; yep
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus ;smr;SS Override
+ error error_Invalid_Function ; not 0,1,2,3
+
+UserGet:
+ SVC SVC_DEMGETCOMPUTERNAME ; DS:DX is the user buffer
+ invoke get_user_stack
+ MOV [SI.User_CX],CX ; Set number return
+UserBye:
+ transfer sys_ret_ok ; no errors here
+
+UserSet:
+ASSUME DS:NOTHING
+; Transfer DS:DX to MYNAME
+; CX to MYNUM
+ MOV [MYNUM],CX ;smr;SS Override
+if 0
+ MOV SI,DX ; user space has source
+ Context ES
+ MOV DI,OFFSET DOSDATA:MyName ; point dest to user string
+ INC [DiffNam] ; signal change ;smr;SS Override
+ JMP UserMove
+else
+ transfer sys_ret_ok ; On NT we only take MyNum
+endif
+
+UserPrint:
+ ASSUME ES:NOTHING
+IF NOT Installed
+ transfer PRINTER_GETSET_STRING
+ELSE
+ PUSH AX
+ MOV AX,(multNET SHL 8) OR 31
+ INT 2FH
+ POP DX ; Clean stack
+ JNC OKPA
+ transfer SYS_RET_ERR
+
+OKPA:
+ transfer SYS_RET_OK
+ENDIF
+
+
+EndProc $UserOper
+
+Break <GetVisDrv - return visible drive>
+
+;
+; GetVisDrv - correctly map non-spliced inuse drives
+;
+; Inputs: AL has drive identifier (0=default)
+; Outputs: Carry Set - invalid drive/macro
+; Carry Clear - AL has physical drive (0=A)
+; ThisCDS points to CDS
+; Registers modified: AL
+
+Procedure GetVisDrv,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ CALL GetThisDrv ; get inuse drive
+ retc
+ SAVE <DS,SI>
+ LDS SI,ThisCDS ;smr;SS Override
+ TEST [SI].curdir_flags,curdir_splice
+ RESTORE <SI,DS>
+ retz ; if not spliced, return OK
+ MOV [DrvErr],error_invalid_drive ;IFS. ;AN000;smr;SS Override
+ STC ; signal error
+ return
+EndProc GetVisDrv
+
+Break <Getthisdrv - map a drive designator (0=def, 1=A...)>
+
+;
+; GetThisDrv - look through a set of macros and return the current drive and
+; macro pointer
+;
+; Inputs: AL has drive identifier (1=A, 0=default)
+; Outputs:
+; Carry Set - invalid drive/macro
+; Carry Clear - AL has physical drive (0=A)
+; ThisCDS points to macro
+; Registers modified: AL
+
+Procedure GetThisDrv,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ OR AL,AL ; are we using default drive?
+ JNZ gtd10 ; no, go get the CDS pointers
+ MOV AL,[CurDrv] ; get the current drive
+ INC ax ; Counteract next instruction
+gtd10: DEC ax ; 0 = A
+ SAVE <DS,SI> ; save world
+ mov [EXTERR_LOCUS],errLOC_Disk ;smr;SS Override
+ TEST fSharing,-1 ; Logical or Physical? ;smr;SS Override
+ JZ gtd20 ; Logical
+ SAVE <AX,ES,DI>
+ MOV WORD PTR ThisCDS,OFFSET DOSDATA:DummyCDS ;smr;SS Override
+ MOV WORD PTR ThisCDS+2,SS ; ThisCDS = &DummyCDS;smr;
+ ADD AL,'A'
+ CALL InitCDS ; InitCDS(c);
+ TEST ES:[DI.curdir_flags],curdir_inuse ; Clears carry
+ RESTORE <DI,ES,AX>
+ JZ gtd30 ; Not a physical drive.
+ JMP SHORT gtdx ; carry clear
+
+gtd20: invoke GetCDSFromDrv
+ JC gtd30 ; Unassigned CDS -> return error already set
+ TEST [SI.curdir_flags],curdir_inuse ; Clears Carry
+ JNZ gtdx ; carry clear
+gtd30: MOV AL,error_invalid_drive ; invalid FAT drive
+ MOV [DrvErr],AL ; save this for IOCTL
+ mov [EXTERR_LOCUS],errLOC_UNK
+ STC
+gtdx: RESTORE <SI,DS> ; restore world
+ return
+
+EndProc GetThisDrv
+
+Break <GetCDSFromDrv - convert a drive number to a CDS pointer>
+
+;
+; GetCDSFromDrv - given a physical drive number, convert it to a CDS
+; pointer, returning an error if the drive number is greater than the
+; number of CDS's
+;
+; Inputs: AL is physical unit # A=0...
+; Outputs: Carry Set if Bad Drive
+; Carry Clear
+; DS:SI -> CDS
+; [THISCDS] = DS:SI
+; Registers modified: DS,SI
+
+Procedure GetCDSFromDrv,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+; Sudeepb 20-Dec-1991 ; Added for redirected drives
+; We always sync the redirected drives. Local drives are sync
+; as per the curdir_tosync flag and SCS_toSync.
+
+ cmp [SCS_ToSync],0
+ je no_sync
+
+ SAVE <BX,CX>
+ LDS SI,[CDSAddr] ; get pointer to table ;smr;SS Override
+ mov cl,[CDSCount]
+ xor ch,ch
+sync_loop:
+ or word ptr ds:[si.CURDIR_FLAGS],CURDIR_tosync
+ MOV BX,SIZE CurDir_list
+ ADD SI,bx
+ loop sync_loop
+ RESTORE <CX,BX>
+ mov [SCS_ToSync],0
+ mov si,OFFSET DOSDATA:NetCDS
+ push ss
+ pop ds
+ or word ptr ds:[si.CURDIR_FLAGS],CURDIR_tosync OR CURDIR_NT_FIX
+no_sync:
+ CMP AL,[CDSCount] ; is this a valid designator;smr;SS Override
+ JB GetCDS ; yes, go get the macro
+
+
+ cmp al,25
+ ja gcds_err
+
+ mov si,OFFSET DOSDATA:NetCDS
+ .errnz CURDIR_TEXT
+ push ss
+ pop ds
+
+ ; If its the first time, sync NetCDS
+
+ test word ptr ds:[si.CURDIR_FLAGS],CURDIR_tosync
+ jnz net_first
+
+ ; Check if the NetCDS is already for the same drive. If so dont sync.
+ ; Be safe. Dont assume that drive letter in CDS will allways be upper
+ ; case. Check for both upper and lower case.
+
+ push ax
+ add al,'A'
+ cmp al,byte ptr ds:[si.CURDIR_TEXT]
+ je net_in_sync
+ add al,20h ; 'A' is 41h and 'a' is 61h
+ cmp al,byte ptr ds:[si.CURDIR_TEXT]
+ je net_in_sync
+ pop ax
+
+net_first:
+ push ax
+ CMDSVC SVC_CMDGETCURDIR ; ds:si is buffer to get current dir
+
+net_in_sync:
+ pop ax
+ jc gcds_err
+
+ MOV [si.curdir_END],2
+ mov [si.CURDIR_FLAGS], CURDIR_inuse OR CURDIR_NT_FIX
+ jmp gcds_comm
+
+gcds_err:
+ STC ; signal error
+ return ; bye
+
+GetCDS:
+ SAVE <BX,AX>
+ LDS SI,[CDSAddr] ; get pointer to table ;smr;SS Override
+ MOV BL,SIZE CurDir_list ; size in convenient spot
+ MUL BL ; get net offset
+ ADD SI,AX ; convert to true pointer
+ RESTORE <AX,BX>
+ test word ptr ds:[si.CURDIR_FLAGS],CURDIR_tosync
+ jz gcds_comm
+ push ax
+ CMDSVC SVC_CMDGETCURDIR ; ds:si is buffer to get current dir
+ ; al = drive
+ pop ax
+ jc gcds_err
+ and word ptr ds:[si.CURDIR_FLAGS],NOT CURDIR_tosync
+gcds_comm:
+ MOV WORD PTR [ThisCDS],SI ; store convenient offset;smr;SS Override
+ MOV WORD PTR [ThisCDS+2],DS ; store convenient segment;smr;SS Override
+CDSX:
+ CLC ; no error
+ return ; bye!
+EndProc GetCDSFromDrv
+
+DOSCODE ends
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/macro2.asm b/private/mvdm/dos/v86/doskrnl/dos/macro2.asm
new file mode 100644
index 000000000..839fe1476
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/macro2.asm
@@ -0,0 +1,1172 @@
+ TITLE MACRO2 - Pathname and macro related internal routines
+ NAME MACRO2
+
+;** MACRO2.ASM
+;
+; TransFCB
+; TransPath
+; TransPathSet
+; TransPathNoSet
+; Canonicalize
+; PathSep
+; SkipBack
+; CopyComponent
+; Splice
+; $NameTrans
+; DriveFromText
+; TextFromDrive
+; PathPref
+; ScanPathChar
+;
+; Revision history:
+;
+; Sudeepb 11-Mar-1991 Ported for NT DOSEm
+;
+;
+; MSDOS performs several types of name translation. First, we maintain for
+; each valid drive letter the text of the current directory on that drive.
+; For invalid drive letters, there is no current directory so we pretend to
+; be at the root. A current directory is either the raw local directory
+; (consisting of drive:\path) or a local network directory (consisting of
+; \\machine\path. There is a limit on the point to which a .. is allowed.
+;
+; Given a path, MSDOS will transform this into a real from-the-root path
+; without . or .. entries. Any component that is > 8.3 is truncated to
+; this and all * are expanded into ?'s.
+;
+; The second part of name translation involves subtree aliasing. A list of
+; subtree pairs is maintained by the external utility SUBST. The results of
+; the previous 'canonicalization' are then examined to see if any of the
+; subtree pairs is a prefix of the user path. If so, then this prefix is
+; replaced with the other subtree in the pair.
+;
+; A third part involves mapping this "real" path into a "physical" path. A
+; list of drive/subtree pairs are maintained by the external utility JOIN.
+; The output of the previous translation is examined to see if any of the
+; subtrees in this list are a prefix of the string. If so, then the prefix
+; is replaced by the appropriate drive letter. In this manner, we can
+; 'mount' one device under another.
+;
+; The final form of name translation involves the mapping of a user's
+; logical drive number into the internal physical drive. This is
+; accomplished by converting the drive number into letter:CON, performing
+; the above translation and then converting the character back into a drive
+; number.
+;
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include mult.inc
+ include curdir.inc
+ .cref
+ .list
+
+ I_need Splices,BYTE ; TRUE => splices are being done.
+ I_need WFP_Start,WORD ; pointer to beginning of expansion
+ I_need Curr_Dir_End,WORD ; offset to end of current dir
+ I_need ThisCDS,DWORD ; pointer to CDS used
+ I_need NAME1,11 ; Parse output of NameTrans
+ I_need OpenBuf,128 ; ususal destination of strings
+ I_need ExtFCB,BYTE ; flag for extended FCBs
+ I_need Sattrib,BYTE ; attribute of search
+ I_need fSplice,BYTE ; TRUE => do splice after canonicalize
+ I_need fSharing,BYTE ; TRUE => no redirection allowed
+ I_Need NoSetDir,BYTE ; TRUE => syscall is interested in
+ ; entry, not contents. We splice only
+ ; inexact matches
+ I_Need cMeta,BYTE ; count of meta chars in path
+ I_Need Temp_Var,WORD ;AN000; variable for temporary use 3/31/KK
+ I_Need DOS34_FLAG,WORD ;AN000; variable for dos34
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ifdef DBCS
+ EXTRN TestKanj:near
+endif
+ EXTRN PathChrCmp:near
+
+BREAK <TransFCB - convert an FCB into a path, doing substitution>
+
+;
+; TransFCB - Copy an FCB from DS:DX into a reserved area doing all of the
+; gritty substitution.
+;
+; Inputs: DS:DX - pointer to FCB
+; ES:DI - point to destination
+; Outputs: Carry Set - invalid path in final map
+; Carry Clear - FCB has been mapped into ES:DI
+; Sattrib is set from possibly extended FCB
+; ExtFCB set if extended FCB found
+; ax= 0 means local device found
+; ES:DI - points to WFP_START
+; ax = -1 means file or UNC
+; ES:DI points to WFP_START
+; Registers modified: most
+
+Procedure TransFCB,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+PUBLIC MACRO001S,MACRO001E
+MACRO001S:
+ LocalVar FCBTmp,16 ; M015 - allocate even number of bytes on stack
+MACRO001E:
+ Enter
+ Context ES ; get DOSDATA addressability
+ SAVE <ES,DI> ; save away final destination
+ LEA DI,FCBTmp ; point to FCB temp area
+ MOV [ExtFCB],0 ; no extended FCB found ;smr;SS Override
+ MOV [Sattrib],0 ; default search attributes;smr;SS Override
+ invoke GetExtended ; get FCB, extended or not
+ JZ GetDrive ; not an extended FCB, get drive
+ MOV AL,[SI-1] ; get attributes
+ MOV [SAttrib],AL ; store search attributes;smr;SS Override
+ MOV [ExtFCB],-1 ; signal extended FCB ;smr;SS Override
+GetDrive:
+ LODSB ; get drive byte
+ invoke GetThisDrv
+ jc BadPack
+ CALL TextFromDrive ; convert 0-based drive to text
+;
+; Scan the source to see if there are any illegal chars
+;
+ IFDEF DBCS ;
+;----------------------------- Start of DBCS 2/13/KK
+ SAVE <SI> ; back over name, ext
+ MOV CX,8 ; 8 chars in main part of name
+FCBScan:LODSB ; get a byte
+ call TestKanj ;
+ jz notkanj2 ;
+ DEC CX ;
+ JCXZ VolidChck ; Kanji half char screw up
+ LODSB ; second kanji byte
+ jmp short Nextch
+VolidChck:
+ TEST [SAttrib],attr_volume_id ; volume id ? ;smr;SS Override
+ JZ Badpack ; no, error
+ OR [DOS34_FLAG],DBCS_VOLID ; no, error ;smr;SS Override
+ DEC CX ; cx=-1
+ INC SI ; next char
+ JMP SHORT FCBScango
+notkanj2:
+ invoke GetCharType ;get bits;smr;
+ TEST AL,fFCB
+ JZ BadPack
+NextCh:
+ LOOP FCBScan
+FCBScango:
+ ADD CX,3 ; Three chars in extension
+FCBScanE:
+ LODSB
+ call TestKanj
+ jz notkanj3
+ DEC CX
+ JCXZ BadPack ; Kanji half char problem
+ LODSB ; second kanji byte
+ jmp short NextChE
+notkanj3:
+ invoke GetCharType ;get bits;smr;
+ TEST AL,fFCB
+ JZ BadPack
+NextChE:
+ LOOP FCBScanE
+;----------------------------- End of DBCS 2/13/KK
+ ELSE
+
+ MOV CX,11
+ SAVE <SI> ; back over name, ext
+FCBScan:LODSB ; get a byte
+ invoke GetCharType ;get bits;smr;
+ TEST AL,fFCB
+ JZ BadPack
+NextCh: LOOP FCBScan
+ ENDIF
+ RESTORE <SI>
+ MOV BX,DI
+ invoke PackName ; crunch the path
+ RESTORE <DI,ES> ; get original destination
+ Context DS ; get DS addressability
+ LEA SI,FCBTmp ; point at new pathname
+ CMP BYTE PTR [BX],0
+ JZ BadPack
+ SAVE <BP>
+ CALL TransPathSet ; convert the path
+ RESTORE <BP>
+ JNC FCBRet ; bye with transPath error code
+BadPack:
+ STC
+ MOV AL,error_path_not_found
+FCBRet: Leave
+ return
+EndProc TransFCB,NoCheck
+
+BREAK <TransPath - copy a path, do string sub and put in current dir>
+
+;
+; TransPath - copy a path from DS:SI to ES:DI, performing component string
+; substitution, insertion of current directory and fixing . and ..
+; entries. Perform splicing. Allow input string to match splice
+; exactly.
+;
+; TransPathSet - Same as above except No splicing is performed if input path
+; matches splice.
+;
+; TransPathNoSet - No splicing/local using is performed at all.
+;
+; The following anomalous behaviour is required:
+;
+; Drive letters on devices are ignored. (set up DummyCDS)
+; Paths on devices are ignored. (truncate to 0-length)
+; Raw net I/O sets ThisCDS => NULL.
+; fSharing => dummyCDS and no subst/splice. Only canonicalize.
+;
+; Other behaviour:
+;
+; ThisCDS set up.
+; ValidateCDS done on local CDS.
+;
+; Brief flowchart:
+;
+; if fSharing then
+; set up DummyCDS (ThisCDS)
+; canonicalize (sets cMeta)
+; splice
+; return
+; if \\ or d:\\ lead then
+; set up null CDS (ThisCDS)
+; canonicalize (sets cMeta)
+; return
+; if device then
+; set up dummyCDS (ThisCDS)
+; canonicalize (sets cMeta)
+; return
+; if file then
+; getCDS (sets (ThisCDS) from name)
+; validateCDS (may reset current dir)
+; Copy current dir
+; canonicalize (set cMeta)
+; splice
+; generate correct CDS (ThisCDS)
+; if local then
+; return
+;
+; Inputs: DS:SI - point to ASCIZ string path
+; DI - point to buffer in DOSDATA
+; Outputs: Carry Set
+; invalid path specification: too many .., bad
+; syntax, etc. or user FAILed to I 24. DS:SI may be modified
+; Carry Clear
+; ax= 0 means local device found
+; ES:DI - points to WFP_START
+; ax = -1 means file or UNC
+; ES:DI points to WFP_START
+; DS - DOSDATA
+; Registers modified: most
+;
+; **** WARNING **** 14-Jan-1994 Jonle **** NTVDM port
+; Transpath does not verify that the path\drive actually exists, which
+; means that dos file apis which rely on Transpath for this validation
+; will not get a error_path_not_found error from transpath, and if special
+; handling is not done an incorrect error code will be generated
+; (usually error_access_denied). See $Mkdir,$Rmdir for an example of proper
+; error handling.
+;
+
+Procedure TransPath,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ XOR AL,AL
+ JMP SHORT SetSplice
+ Entry TransPathSet
+ MOV AL,-1
+SetSplice:
+ MOV NoSetDir,AL ; NoSetDir = !fExact; ;smr;SS Override
+ MOV AL,-1
+ Entry TransPathNoSet
+
+ MOV fSplice,AL ; fSplice = TRUE; ;smr;SS Override
+ MOV cMeta,-1 ;smr;SS Override
+ MOV WFP_Start,DI ;smr;SS Override
+ MOV Curr_Dir_End,-1 ; crack from start ;smr;SS Override
+ Context ES
+ LEA BP,[DI+TEMPLEN] ; end of buffer
+;
+; At this point the name is either a UNC-style name (prefixed with two leading
+; \\s) or is a local file/device.
+;
+ CALL DriveFromText ; eat drive letter
+ PUSH AX ; save it
+ MOV AX,WORD PTR [SI] ; get first two bytes of path
+ call PathChrCmp ; convert to normal form
+ XCHG AH,AL ; swap for second byte
+ call PathChrCmp ; convert to normal form
+ JNZ CheckDevice ; not a path char
+ CMP AH,AL ; are they same?
+ JNZ CheckDevice ; nope
+;
+; We have a UNC request.
+ POP AX
+ MOVSW ; get the lead \\
+UNCCpy: LODSB ; get a byte
+ IFDEF DBCS ;AN000;
+;----------------------------- Start of DBCS 2/23/KK
+ call TestKanj ;AN000;
+ jz notkanj1 ;AN000;
+ STOSB ;AN000;
+ LODSB ;AN000;
+ OR AL,AL ;AN000;
+ JZ UNCTerm ;AN000;; Ignore half kanji error for now
+ STOSB ;AN000;
+ jmp UNCCpy ;AN000;
+notkanj1: ;AN000;
+;----------------------------- End of DBCS 2/23/KK
+ ENDIF ;AN000;
+ invoke UCase ;AN000;; convert the char
+ OR AL,AL
+ JZ UNCTerm ; end of string. All done.
+ STOSB
+ JMP UNCCpy ; no, go copy
+UNCTerm:
+ STOSB ;AN000;
+ mov ax,-1 ;No Carry and ax = -1
+ ret
+
+
+CheckDevice:
+;
+; Check DS:SI for device. First eat any path stuff
+;
+ POP AX ; retrieve drive info
+ CMP BYTE PTR DS:[SI],0 ; check for null file
+ JNZ CheckPath
+ MOV AL,error_file_not_found ; bad file error
+ STC ; signal error on null input
+ RETURN ; bye!
+CheckPath:
+ SAVE <AX,BP> ; save drive number
+ Invoke CheckThisDevice ; snoop for device
+ RESTORE <BP,AX> ; get drive letter back
+ JNC DoFile ; yes we have a file.
+;
+; We have a device. AX has drive letter. At this point we may fake a CDS ala
+; sharing DOS call.
+;
+; If DX != 0 then path not found
+
+ or dx, dx
+ jz DEV_CONT2
+DEV_Err:
+ MOV AL,error_path_not_found
+ STC ; signal error on null input
+ RETURN ; bye!
+
+DEV_CONT2:
+ MOV fSharing,-1 ; simulate sharing dos call;smr;SS Override
+ invoke GetThisDrv ; set ThisCDS and init DUMMYCDS
+ MOV fSharing,0 ;
+ jc DEV_Err
+
+;
+; Now that we have noted that we have a device, we put it into a form that
+; getpath can understand. Normally getpath requires d:\ to begin the input
+; string. We relax this to state that if the d:\ is present then the path
+; may be a file. If D:/ (note the forward slash) is present then we have
+; a device.
+;
+ CALL TextFromDrive
+ MOV AL,'/' ; path sep.
+ STOSB
+
+ invoke StrCpy ; Copy Device Name to Buffer
+ xor ax,ax ; Clear Carry and ax = 0
+ Context DS ; remainder of OK stuff
+ return
+;
+; We have a file. Get the raw CDS.
+;
+DoFile:
+ ASSUME DS:NOTHING
+ invoke GetVisDrv ; get proper CDS
+ MOV AL,error_path_not_found ; Set up for possible bad file error
+ retc ; CARRY set -> bogus drive/spliced
+;
+; ThisCDS has correct CDS. DS:SI advanced to point to beginning of path/file.
+; Make sure that CDS has valid directory; ValidateCDS requires a temp buffer
+; Use the one that we are going to use (ES:DI).
+;
+; SAVE <DS,SI,ES,DI> ; save all string pointers.
+; invoke ValidateCDS ; poke CDS amd make everything OK
+; RESTORE <DI,ES,SI,DS> ; get back pointers
+; MOV AL,error_path_not_found ; Set up for possible bad path error
+; retc ; someone failed an operation
+;
+; ThisCDS points to correct CDS. It contains the correct text of the
+; current directory. Copy it in.
+;
+ SAVE <DS,SI>
+ LDS SI,ThisCDS ; point to CDS ;smr;SS Override
+ MOV BX,DI ; point to destination
+ ADD BX,[SI].curdir_end ; point to backup limit
+; LEA SI,[SI].curdir_text ; point to text
+ LEA BP,[DI+TEMPLEN] ; regenerate end of buffer
+ IFDEF DBCS ;AN000;
+;------------------------ Start of DBCS 2/13/KK
+Kcpylp: ;AN000;
+ LODSB ;AN000;
+ call TestKanj ;AN000;
+ jz Notkanjf ;AN000;
+ STOSB ;AN000;
+ MOVSB ;AN000;
+ CMP BYTE PTR [SI],0 ;AN000;
+ JNZ Kcpylp ;AN000;
+ MOV AL, '\' ;AN000;
+ STOSB ;AN000;
+ JMP SHORT GetOrig ;AN000;
+Notkanjf: ;AN000;
+ STOSB ;AN000;
+ OR AL,AL ;AN000;
+ JNZ Kcpylp ;AN000;
+ DEC DI ;AN000;; point to NUL byte
+
+;------------------------ End of DBCS 2/13/KK
+ ELSE ;AN000;
+ invoke FStrCpy ; copy string. ES:DI point to end
+ DEC DI ; point to NUL byte
+ ENDIF ;AN000;
+;
+; Make sure that there is a path char at end.
+;
+ MOV AL,'\'
+ CMP ES:[DI-1],AL
+ JZ GetOrig
+ STOSB
+;
+; Now get original string.
+;
+GetOrig:
+ DEC DI ; point to path char
+ RESTORE <SI,DS>
+;
+; BX points to the end of the root part of the CDS (at where a path char
+; should be) . Now, we decide whether we use this root or extend it with the
+; current directory. See if the input string begins with a leading \
+;
+ CALL PathSep ; is DS:SI a path sep?
+ JNZ PathAssure ; no, DI is correct. Assure a path char
+ OR AL,AL ; end of string?
+ JZ DoCanon ; yes, skip.
+;
+; The string does begin with a \. Reset the beginning of the canonicalization
+; to this root. Make sure that there is a path char there and advance the
+; source string over all leading \'s.
+;
+ MOV DI,BX ; back up to root point.
+SkipPath:
+ LODSB
+ call PathChrCmp
+ JZ SkipPath
+ DEC SI
+ OR AL,AL
+ JZ DoCanon
+;
+; DS:SI start at some file name. ES:DI points at some path char. Drop one in
+; for yucks.
+;
+PathAssure:
+ MOV AL,'\'
+ STOSB
+;
+; ES:DI point to the correct spot for canonicalization to begin.
+; BP is the max extent to advance DI
+; BX is the backup limit for ..
+;
+DoCanon:
+ CALL Canonicalize ; wham.
+ retc ; badly formatted path.
+;
+; The string has been moved to ES:DI. Reset world to DOS context, pointers
+; to wfp_start and do string substitution. BP is still the max position in
+; buffer.
+;
+ Context DS
+ MOV DI,wfp_start ; DS:SI point to string
+ LDS SI,ThisCDS ; point to CDS
+ ASSUME DS:NOTHING
+; LEA SI,[SI].curdir_text ; point to text
+ CALL PathPref ; is there a prefix?
+ JNZ DoSplice ; no, do splice
+;
+; We have a match. Check to see if we ended in a path char.
+;
+ IFDEF DBCS ;AN000;
+;---------------------------- Start of DBCS 2/13/KK
+ PUSH BX ;AN000;
+ MOV BX,SI ;AN000;
+ MOV SI,WORD PTR ThisCDS ;AN000;; point to CDS ;smr;SS Override
+LOOKDUAL: ;AN000;
+ MOV AL,BYTE PTR [SI] ;AN000;
+ call TestKanj ;AN000;
+ JZ ONEINC ;AN000;
+ INC SI ;AN000;
+ INC SI ;AN000;
+ CMP SI,BX ;AN000;
+ JB LOOKDUAL ;AN000;
+ POP BX ;AN000;; Last char was KANJI, don't look back
+ JMP SHORT Pathline ;AN000;; for path sep, there isn't one.
+ ;AN000;
+ONEINC: ;AN000;
+ INC SI ;AN000;
+ CMP SI,BX ;AN000;
+ JB LOOKDUAL ;AN000;
+ POP BX ;AN000;
+;------------------------ End of DBCS 2/13/KK
+ ENDIF ;AN000;
+ MOV AL,DS:[SI-1] ; last char to match
+ call PathChrCmp ; did we end on a path char? (root)
+ JZ DoSplice ; yes, no current dir here.
+Pathline: ; 2/13/KK
+ CMP BYTE PTR ES:[DI],0 ; end at NUL?
+ JZ DoSplice
+ INC DI ; point to after current path char
+ MOV Curr_Dir_End,DI ; point to correct spot ;smr;SS Override
+;
+; Splice the result.
+;
+DoSplice:
+ Context DS ; back to DOSDATA
+ MOV SI,wfp_Start ; point to beginning of string
+ XOR CX,CX
+ TEST fSplice,-1
+ JZ SkipSplice
+ CALL Splice ; replaces in place.
+SkipSplice:
+ ASSUME DS:NOTHING
+ Context DS
+; LES DI,ThisCDS ; point to correct drive
+; TEST ES:[DI].curdir_flags,curdir_isnet
+; JNZ Done ; net (retnz)
+; JCXZ Done
+; MOV AL,error_path_not_found ; Set up for possible bad path error
+ mov ax,-1
+ clc
+Done: return ; any errors in carry flag.
+EndProc TransPath
+
+BREAK <Canonicalize - copy a path and remove . and .. entries>
+
+;
+; Canonicalize - copy path removing . and .. entries.
+;
+; Inputs: DS:SI - point to ASCIZ string path
+; ES:DI - point to buffer
+; BX - backup limit (offset from ES) points to slash
+; BP - end of buffer
+; Outputs: Carry Set - invalid path specification: too many .., bad
+; syntax, etc.
+; Carry Clear -
+; DS:DI - advanced to end of string
+; ES:DI - advanced to end of canonicalized form after nul
+; Registers modified: AX CX DX (in addition to those above)
+
+Procedure Canonicalize,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+;
+; We copy all leading path separators.
+;
+ LODSB ; while (PathChr (*s))
+ call PathChrCmp
+ IFDEF DBCS
+ JNZ CanonDec0 ; 2/19/KK
+ ELSE
+ JNZ CanonDec
+ ENDIF
+ CMP DI,BP ; if (d > dlim)
+ JAE CanonBad ; goto error;
+ STOSB
+ JMP Canonicalize ; *d++ = *s++;
+ IFDEF DBCS ;AN000;
+CanonDec0: ;AN000; 2/19/KK
+; mov cs:Temp_Var,di ;AN000; 3/31/KK
+ ENDIF ;AN000;
+CanonDec:
+ DEC SI
+;
+; Main canonicalization loop. We come here with DS:SI pointing to a textual
+; component (no leading path separators) and ES:DI being the destination
+; buffer.
+;
+CanonLoop:
+;
+; If we are at the end of the source string, then we need to check to see that
+; a potential drive specifier is correctly terminated with a path sep char.
+; Otherwise, do nothing
+;
+ XOR AX,AX
+ CMP [SI],AL ; if (*s == 0) {
+ JNZ DoComponent
+ IFDEF DBCS ;AN000;
+ call chk_last_colon ;AN000; 2/18/KK
+ ELSE ;AN000;
+ CMP BYTE PTR ES:[DI-1],':' ; if (d[-1] == ':')
+ ENDIF ;AN000;
+; JNZ DoTerminate
+
+ jz Do_Colon
+;BUGBUG DBCS???
+ CMP BYTE PTR ES:[DI-1],'\'
+ JNZ DoTerminate
+ jmp short CanonBad
+
+Do_Colon:
+ MOV AL,'\' ; *d++ = '\';
+ STOSB
+ MOV AL,AH
+DoTerminate:
+ STOSB ; *d++ = 0;
+ CLC ; return (0);
+ return
+ IFDEF DBCS ;AN000;
+;---------------- Start of DBCS 2/18/KK
+chk_last_colon proc ;AN000;
+ push si ;AN000;
+ push ax ;AN000;
+ push bx ;AN000;
+ mov si,[WFP_START] ;AN000;;PTM. for cd .. use beginning of buf;smr;SS Override
+ cmp si,di ;AN000;; no data stored ?
+ jb CLC02 ;AN000;;PTM. for cd ..
+ inc si ;AN000;; make NZ flag
+ JMP SHORT CLC09 ;AN000;
+CLC02: ;AN000;
+ mov bx,di ;AN000;
+ dec bx ;AN000;
+CLC_lop: ;AN000;
+ cmp si,bx ;AN000;
+ jb CLC00 ;AN000;
+ jne CLC09 ;AN000;
+CLC01: ;AN000;
+ CMP BYTE PTR ES:[DI-1],':' ;AN000;; if (d[-1] == ':')
+ jmp CLC09 ;AN000;
+CLC00: ;AN000;
+ mov al,es:[si] ;AN000;
+ inc si ;AN000;
+ call TestKanj ;AN000;
+ je CLC_lop ;AN000;
+ inc si ;AN000;
+ jmp CLC_lop ;AN000;
+CLC09: ;AN000;
+ pop bx ;AN000;
+ pop ax ;AN000;
+ pop si ;AN000;
+ ret ;AN000;
+chk_last_colon endp ;AN000;
+;---------------- Endt of DBCS 2/18/KK
+ ENDIF ;AN000;
+
+CanonBad:
+ CALL ScanPathChar ; check for path chars in rest of string
+ MOV AL,error_path_not_found ; Set up for bad path error
+ JZ PathEnc ; path character encountered in string
+ MOV AL,error_file_not_found ; Set bad file error
+PathEnc:
+ STC
+ return
+;
+; We have a textual component that we must copy. We uppercase it and truncate
+; it to 8.3
+;
+DoComponent: ; }
+ CALL CopyComponent ; if (!CopyComponent (s, d))
+ retc ; return (-1);
+;
+; We special case the . and .. cases. These will be backed up.
+;
+ CMP WORD PTR ES:[DI],'.' + (0 SHL 8)
+ JZ Skip1
+ CMP WORD PTR ES:[DI],'..'
+ JNZ CanonNormal
+ DEC DI ; d--;
+Skip1: CALL SkipBack ; SkipBack ();
+ MOV AL,error_path_not_found ; Set up for possible bad path error
+ retc
+ JMP short CanonPath ; }
+;
+; We have a normal path. Advance destination pointer over it.
+;
+CanonNormal: ; else
+ ADD DI,CX ; d += ct;
+;
+; We have successfully copied a component. We are now pointing at a path
+; sep char or are pointing at a nul or are pointing at something else.
+; If we point at something else, then we have an error.
+;
+CanonPath:
+ CALL PathSep
+ JNZ CanonBad ; something else...
+;
+; Copy the first path char we see.
+;
+ LODSB ; get the char
+ call PathChrCmp ; is it path char?
+ JNZ CanonDec ; no, go test for nul
+ CMP DI,BP ; beyond buffer end?
+ JAE CanonBad ; yep, error.
+ STOSB ; copy the one byte
+;
+; Skip all remaining path chars
+;
+CanonPathLoop:
+ LODSB ; get next byte
+ call PathChrCmp ; path char again?
+ JZ CanonPathLoop ; yep, grab another
+ DEC SI ; back up
+ JMP CanonLoop ; go copy component
+EndProc Canonicalize
+
+BREAK <PathSep - determine if char is a path separator>
+
+;
+; PathSep - look at DS:SI and see if char is / \ or NUL
+; Inputs: DS:SI - point to a char
+; Outputs: AL has char from DS:SI (/ => \)
+; Zero set if AL is / \ or NUL
+; Zero reset otherwise
+; Registers modified: AL
+
+Procedure PathSep,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV AL,[SI] ; get the character
+ entry PathSepGotCh ; already have character
+ OR AL,AL ; test for zero
+ retz ; return if equal to zero (NUL)
+ call PathChrCmp ; check for path character
+ return ; and return HIS determination
+EndProc PathSep
+
+BREAK <SkipBack - move backwards to a path separator>
+
+;
+; SkipBack - look at ES:DI and backup until it points to a / \
+; Inputs: ES:DI - point to a char
+; BX has current directory back up limit (point to a / \)
+; Outputs: ES:DI backed up to point to a path char
+; AL has char from output ES:DI (path sep if carry clear)
+; Carry set if illegal backup
+; Carry Clear if ok
+; Registers modified: DI,AL
+
+Procedure SkipBack,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ IFDEF DBCS ;AN000;
+;-------------------------- Start of DBCS 2/13/KK
+ PUSH DS ;AN000;
+ PUSH SI ;AN000;
+ PUSH CX ;AN000;
+ PUSH ES ;AN000;
+ POP DS ;AN000;
+ MOV SI,BX ;AN000;; DS:SI -> start of ES:DI string
+ MOV CX,DI ;AN000;; Limit of forward scan is input DI
+ MOV AL,[SI] ;AN000;
+ call PathChrCmp ;AN000;
+ JNZ SkipBadP ;AN000;; Backup limit MUST be path char
+ CMP DI,BX ;AN000;
+ JBE SkipBadP ;AN000;
+ MOV DI,BX ;AN000;; Init backup point to backup limit
+Skiplp: ;AN000;
+ CMP SI,CX ;AN000;
+ JAE SkipOK ;AN000;; Done, DI is correct backup point
+ LODSB ;AN000;
+ call TestKanj ;AN000;
+ jz Notkanjv ;AN000;
+ lodsb ;AN000;; Skip over second kanji byte
+ JMP Skiplp ;AN000;
+NotKanjv: ;AN000;
+ call PathChrCmp ;AN000;
+ JNZ Skiplp ;AN000;; New backup point
+ MOV DI,SI ;AN000;; DI point to path sep
+ DEC DI ;AN000;
+ jmp Skiplp ;AN000;
+SkipOK: ;AN000;
+ MOV AL,ES:[DI] ;AN000;; Set output AL
+ CLC ;AN000;; return (0);
+ POP CX ;AN000;
+ POP SI ;AN000;
+ POP DS ;AN000;
+ return ;AN000;
+ ;AN000;
+SkipBadP: ;AN000;
+ POP CX ;AN000;
+ POP SI ;AN000;
+ POP DS ;AN000;
+;-------------------------- End of DBCS 2/13/KK
+ ELSE ;AN000;
+ CMP DI,BX ; while (TRUE) {
+ JB SkipBad ; if (d < dlim)
+ DEC DI ; goto err;
+ MOV AL,ES:[DI] ; if (pathchr (*--d))
+ call PathChrCmp ; break;
+ JNZ SkipBack ; }
+ CLC ; return (0);
+ return ;
+ ENDIF ;AN000;
+SkipBad: ;err:
+ MOV AL,error_path_not_found ; bad path error
+ STC ; return (-1);
+ return ;
+EndProc SkipBack
+
+Break <CopyComponent - copy out a file path component>
+
+;
+; CopyComponent - copy a file component from a path string (DS:SI) into ES:DI
+;
+; Inputs: DS:SI - source path
+; ES:DI - destination
+; ES:BP - end of buffer
+; Outputs: Carry Set - too long
+; Carry Clear - DS:SI moved past component
+; CX has length of destination
+; Registers modified: AX,CX,DX
+
+Procedure CopyComponent,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+CopyBP EQU WORD PTR [BP]
+CopyD EQU DWORD PTR [BP+2]
+CopyDoff EQU WORD PTR [BP+2]
+CopyS EQU DWORD PTR [BP+6]
+CopySoff EQU WORD PTR [BP+6]
+CopyTemp EQU BYTE PTR [BP+10]
+ SUB SP,14 ; room for temp buffer
+ SAVE <DS,SI,ES,DI,BP>
+ MOV BP,SP
+ MOV AH,'.'
+ LODSB
+ STOSB
+ CMP AL,AH ; if ((*d++=*s++) == '.') {
+ JNZ NormalComp
+ CALL PathSep ; if (!pathsep(*s))
+ JZ NulTerm
+TryTwoDot:
+ LODSB ; if ((*d++=*s++) != '.'
+ STOSB
+ CMP AL,AH
+ JNZ CopyBad
+ CALL PathSep
+ JNZ CopyBad ; || !pathsep (*s))
+NulTerm: ; return -1;
+ XOR AL,AL ; *d++ = 0;
+ STOSB
+ MOV CopySoff,SI
+ JMP SHORT GoodRet ; }
+NormalComp: ; else {
+ MOV SI,CopySoff
+ Invoke NameTrans ; s = NameTrans (s, Name1);
+ CMP SI,CopySOff ; if (s == CopySOff)
+ JZ CopyBad ; return (-1);
+ TEST fSharing,-1 ; if (!fSharing) {;smr;SS Override
+ JNZ DoPack
+ AND DL,1 ; cMeta += fMeta;
+ ADD cMeta,DL ; if (cMeta > 0);smr;SS Override
+ JG CopyBad ; return (-1);
+ JNZ DoPack ; else
+ OR DL,DL ; if (cMeta == 0 && fMeta == 0)
+ JZ CopyBadPath ; return (-1);
+DoPack: ; }
+ MOV CopySoff,SI
+ Context DS
+ MOV SI,OFFSET DOSDATA:NAME1
+ LEA DI,CopyTemp
+ SAVE <DI>
+ Invoke PackName ; PackName (Name1, temp);
+ RESTORE <DI>
+ Invoke StrLen ; if (strlen(temp)+d > bp)
+ DEC CX
+ ADD CX,CopyDoff
+ CMP CX,CopyBP
+ JAE CopyBad ; return (-1);
+ MOV SI,DI ; strcpy (d, temp);
+ LES DI,CopyD
+ Invoke FStrCpy
+GoodRet: ; }
+ CLC
+ JMP SHORT CopyEnd ; return 0;
+CopyBad:
+ STC
+ CALL ScanPathChar ; check for path chars in rest of string
+ MOV AL,error_file_not_found ; Set up for bad file error
+ JNZ CopyEnd
+CopyBadPath:
+ STC
+ MOV AL,error_path_not_found ; Set bad path error
+CopyEnd:
+ RESTORE <BP,DI,ES,SI,DS>
+ LAHF
+ ADD SP,14 ; reclaim temp buffer
+ Invoke Strlen
+ DEC CX
+ SAHF
+ return
+EndProc CopyComponent,NoCheck
+
+Break <Splice - pseudo mount by string substitution>
+
+;
+; Splice - take a string and substitute a prefix if one exists. Change
+; ThisCDS to point to physical drive CDS.
+; Inputs: DS:SI point to string
+; NoSetDir = TRUE => exact matches with splice fail
+; Outputs: DS:SI points to thisCDS
+; String at DS:SI may be reduced in length by removing prefix
+; and substituting drive letter.
+; CX = 0 If no splice done
+; CX <> 0 otherwise
+; ThisCDS points to proper CDS if spliced, otherwise it is
+; left alone
+; Registers modified: DS:SI, ES:DI, BX,AX,CX
+
+Procedure Splice,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ TEST Splices,-1 ;smr;SS Override
+ JZ AllDone
+ SAVE <<WORD PTR ThisCDS>,<WORD PTR ThisCDS+2>> ; TmpCDS = ThisCDS;smr;SS Override
+ SAVE <DS,SI>
+ RESTORE <DI,ES>
+ XOR AX,AX ; for (i=1; s = GetCDSFromDrv (i); i++)
+SpliceScan:
+ invoke GetCDSFromDrv
+ JC SpliceDone
+ INC AL
+ TEST [SI.curdir_flags],curdir_splice
+ JZ SpliceScan ; if ( Spliced (i) ) {
+ SAVE <DI>
+ CALL PathPref ; if (!PathPref (s, d))
+ JZ SpliceFound ;
+SpliceSkip:
+ RESTORE <DI>
+ JMP SpliceScan ; continue;
+SpliceFound:
+ CMP BYTE PTR ES:[DI],0 ; if (*s || NoSetDir) {
+ JNZ SpliceDo
+ TEST NoSetDir,-1 ;smr;SS Override
+ JNZ SpliceSkip
+SpliceDo:
+ MOV SI,DI ; p = src + strlen (p);
+ SAVE <ES>
+ RESTORE <DS,DI>
+ CALL TextFromDrive1 ; src = TextFromDrive1(src,i);
+ MOV AX,Curr_Dir_End ;smr;SS Override
+ OR AX,AX
+ JS NoPoke
+ ADD AX,DI ; curdirend += src-p;
+ SUB AX,SI
+ MOV Curr_Dir_End,AX ;smr;SS Override
+NoPoke:
+ CMP BYTE PTR [SI],0 ; if (*p)
+ JNZ SpliceCopy ; *src++ = '\\';
+ MOV AL,"\"
+ STOSB
+SpliceCopy: ; strcpy (src, p);
+ invoke FStrCpy
+ ADD SP,4 ; throw away saved stuff
+ OR CL,1 ; signal splice done.
+ JMP SHORT DoSet ; return;
+SpliceDone: ; }
+ ASSUME DS:NOTHING ; ThisCDS = TmpCDS;
+ RESTORE <<WORD PTR ThisCDS+2>,<WORD PTR ThisCDS>> ;smr;SS Override
+AllDone:
+ XOR CX,CX
+DoSet:
+ LDS SI,ThisCDS ;
+ return
+
+EndProc Splice, NoCheck
+
+Break <$NameTrans - partially process a name>
+
+;
+; $NameTrans - allow users to see what names get mapped to. This call
+; performs only string substitution and canonicalization, not splicing. Due
+; to Transpath playing games with devices, we need to insure that the output
+; has drive letter and : in it.
+;
+; Inputs: DS:SI - source string for translation
+; ES:DI - pointer to buffer
+; Outputs:
+; Carry Clear
+; Buffer at ES:DI is filled in with data
+; ES:DI point byte after nul byte at end of dest string in buffer
+; Carry Set
+; AX = error_path_not_found
+; Registers modified: all
+
+Procedure $NameTrans,Near
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <DS,SI,ES,DI,CX>
+
+; M027 - Start
+;
+; Sattrib must be set up with default values here. Otherwise, the value from
+; a previous DOS call is used for attrib and DevName thinks it is not a
+; device if the old call set the volume attribute bit. Note that devname in
+; dir2.asm gets ultimately called by Transpath. See also M026. Also save
+; and restore CX.
+;
+
+ mov ch,attr_hidden+attr_system+attr_directory
+ invoke SetAttrib
+
+; M027 - End
+
+ MOV DI,OFFSET DOSDATA:OpenBuf
+ CALL TransPath ; to translation (everything)
+ RESTORE <CX,DI,ES,SI,DS>
+ JNC TransOK
+ transfer SYS_Ret_Err
+TransOK:
+ MOV SI,OFFSET DOSDATA:OpenBuf
+ Context DS
+GotText:
+ Invoke FStrCpy
+ Transfer SYS_Ret_OK
+EndProc $NameTrans
+
+Break <DriveFromText - return drive number from a text string>
+
+;
+; DriveFromText - examine DS:SI and remove a drive letter, advancing the
+; pointer.
+;
+; Inputs: DS:SI point to a text string
+; Outputs: AL has drive number
+; DS:SI advanced
+; Registers modified: AX,SI.
+
+Procedure DriveFromText,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ XOR AL,AL ; drive = 0;
+ CMP BYTE PTR [SI],0 ; if (*s &&
+ retz
+ CMP BYTE PTR [SI+1],':' ; s[1] == ':') {
+ retnz
+ IFDEF DBCS ;AN000;
+;--------------------- Start of DBCS 2/18/KK
+ push ax ;AN000;
+ mov al,[si] ;AN000;
+ call TestKanj ;AN000;
+ pop ax ;AN000;
+ retnz ;AN000;
+;--------------------- End of DBCS 2/18/KK
+ ENDIF ;AN000;
+ LODSW ; drive = (*s | 020) - 'a'+1;
+ OR AL,020h
+ SUB AL,'a'-1 ; s += 2;
+ retnz
+ MOV AL,-1 ; nuke AL...
+ return ; }
+EndProc DriveFromText
+
+Break <TextFromDrive - convert a drive number to a text string>
+
+;
+; TextFromDrive - turn AL into a drive letter: and put it at es:di with
+; trailing :. TextFromDrive1 takes a 1-based number.
+;
+; Inputs: AL has 0-based drive number
+; Outputs: ES:DI advanced
+; Registers modified: AX
+
+Procedure TextFromDrive,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ INC AL
+ Entry TextFromDrive1
+ ADD AL,'A'-1 ; *d++ = drive-1+'A';
+ MOV AH,":" ; strcat (d, ":");
+ STOSW
+ return
+EndProc TextFromDrive
+
+Break <PathPref - see if one path is a prefix of another>
+
+;
+; PathPref - compare DS:SI with ES:DI to see if one is the prefix of the
+; other. Remember that only at a pathchar break are we allowed to have a
+; prefix: A:\ and A:\FOO
+;
+; Inputs: DS:SI potential prefix
+; ES:DI string
+; Outputs: Zero set => prefix found
+; DI/SI advanced past matching part
+; Zero reset => no prefix, DS/SI garbage
+; Registers modified: CX
+
+Procedure PathPref,NEAR
+ Invoke DStrLen ; get length
+ DEC CX ; do not include nul byte
+ IFDEF DBCS ;AN000;
+;----------------------- Start of DBCS 2/13/KK
+ SAVE <AX> ;AN000;; save char register
+CmpLp: ;AN000;
+ MOV AL,[SI] ;AN000;
+ call TestKanj ;AN000;
+ jz NotKanj9 ;AN000;
+ CMPSW ;AN000;
+ JNZ Prefix ;AN000;
+ DEC CX ;AN000;
+ LOOP CmpLp ;AN000;
+ JMP SHORT NotSep ;AN000;
+NotKanj9: ;AN000;
+ CMPSB ;AN000;
+ JNZ Prefix ;AN000;
+ LOOP CmpLp ;AN000;
+;----------------------- End of DBCS 2/13/KK
+ ELSE ;AN000;
+ REPZ CMPSB ; compare
+ retnz ; if NZ then return NZ
+ SAVE <AX> ; save char register
+ ENDIF ;AN000;
+ MOV AL,[SI-1] ; get last byte to match
+ call PathChrCmp ; is it a path char (Root!)
+ JZ Prefix ; yes, match root (I hope)
+NotSep: ; 2/13/KK
+ MOV AL,ES:[DI] ; get next char to match
+ CALL PathSepGotCh ; was it a pathchar?
+Prefix:
+ RESTORE <AX> ; get back original
+ return
+EndProc PathPref
+
+Break <ScanPathChar - see if there is a path character in a string>
+
+;
+; ScanPathChar - search through the string (pointed to by DS:SI) for
+; a path separator.
+;
+; Input: DS:SI target string (null terminated)
+; Output: Zero set => path separator encountered in string
+; Zero clear => null encountered
+; Registers modified: SI
+
+Procedure ScanPathChar,NEAR
+ LODSB ; fetch a character
+ IFDEF DBCS ;AN000;
+ call TestKanj ;AN000;; 2/13/KK
+ jz NotKanjr ;AN000;; 2/13/KK
+ LODSB ;AN000;; 2/13/KK
+ OR AL,AL ;AN000;; 2/13/KK 3/31/removed
+ JNZ ScanPathChar ;AN000;; 2/13/KK 3/31/removed
+ INC AL ;AN000;; 2/13/KK
+ return ;AN000;; 2/13/KK
+ ;AN000;
+NotKanjr: ;AN000;; 2/13/KK
+ ENDIF ;AN000;
+ call PathSepGotCh
+ JNZ ScanPathChar ; not \, / or NUL => go back for more
+ call PathChrCmp ; path separator?
+ return
+EndProc ScanPathChar
+
+DOSCODE ends
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/makedos.cmd b/private/mvdm/dos/v86/doskrnl/dos/makedos.cmd
new file mode 100644
index 000000000..6efda15d7
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/makedos.cmd
@@ -0,0 +1,6 @@
+rem this is writen so that STRIPZ will work with NMK
+
+out -f ..\inc\bdsize.inc
+getsize
+nmake
+in -f -c "update size" ..\inc\bdsize.inc
diff --git a/private/mvdm/dos/v86/doskrnl/dos/makefile b/private/mvdm/dos/v86/doskrnl/dos/makefile
new file mode 100644
index 000000000..91d6a074e
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/makefile
@@ -0,0 +1,323 @@
+#*************************** Makefile for DOS ***************************
+
+include ..\..\make.inc
+dest =ntdos.sys
+
+#
+###################### Dependencies begin here ##########################
+#
+
+
+all: $(dest)
+ binplace $(dest)
+ binplace ntdos.map
+ binplace ntdos.sym
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist ntdos.sys del ntdos.sys
+
+msdos.cl1: msdos.skl \
+ $(msg)\$(COUNTRY).msg
+
+msdos.cl2: msdos.skl \
+ $(msg)\$(COUNTRY).msg
+
+
+dossym.inc: $(inc)\dosmac.inc $(inc)\bpb.inc \
+ $(inc)\buffer.inc $(inc)\sysvar.inc $(inc)\vector.inc \
+ $(inc)\mult.inc $(inc)\dirent.inc $(cinc)\curdir.inc \
+ $(inc)\cpmfcb.inc $(inc)\find.inc $(inc)\pdb.inc $(inc)\exe.inc \
+ $(inc)\sf.inc $(inc)\arena.inc $(inc)\intnat.inc $(inc)\mi.inc \
+ $(inc)\filemode.inc $(inc)\error.inc $(inc)\syscall.inc
+ echo "touch dossym.inc; files that are in ..\inc"
+
+msdata.obj: msdata.asm \
+ mssw.asm \
+ $(inc)\ARENA.INC \
+ $(cinc)\CURDIR.INC \
+ $(inc)\DEVSYM.INC \
+ $(inc)\FIND.INC \
+ $(inc)\MI.INC \
+ $(inc)\PDB.INC \
+ $(inc)\SF.INC \
+ $(inc)\VECTOR.INC \
+ $(inc)\VERSIONA.INC \
+ $(inc)\buffer.INC \
+ $(inc)\dbcs.sw \
+ $(inc)\dirent.INC \
+ $(inc)\doscntry.inc \
+ $(inc)\dosmac.INC \
+ $(inc)\dosseg.inc \
+ $(inc)\dossym.inc \
+ $(inc)\error.INC \
+ $(inc)\fastopen.inc \
+ $(inc)\ms_data.asm \
+ $(inc)\lmstub.asm \
+ $(inc)\version.inc \
+ $(inc)\xmm.inc \
+ dostab.asm \
+ $(inc)\const2.asm \
+ msconst.asm \
+ $(inc)\mshead.asm \
+ $(inc)\BUGTYP.INC \
+ $(inc)\ORIGIN.INC \
+ $(inc)\bdsize.inc \
+ $(inc)\wpatch.inc \
+ $(inc)\msbdata.inc \
+ $(cinc)\dossvc.inc \
+ $(cinc)\vint.inc \
+ $(cinc)\doswow.inc \
+ msdos.cl2
+
+msdosme.obj: msdosme.asm \
+ dosmes.inc \
+ msdos.cl1 \
+ mssw.asm \
+ $(inc)\VERSIONA.INC \
+ $(inc)\buffer.INC \
+ $(inc)\dbcs.sw \
+ $(inc)\dirent.INC \
+ divmes.inc \
+ $(inc)\doscntry.inc \
+ $(inc)\dosmac.INC \
+ $(inc)\dosmac.inc \
+ $(inc)\dosseg.inc \
+ $(inc)\dossym.inc \
+ $(inc)\error.INC \
+ $(inc)\version.inc \
+ $(inc)\yesno.asm
+
+abort.obj abort.lst: abort.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/mult.inc $(inc)/pdb.inc $(inc)/sf.inc \
+ $(cinc)/dossvc.inc
+
+alloc.obj alloc.lst: alloc.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/arena.inc $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC
+
+cpmio.obj cpmio.lst: cpmio.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/doscntry.inc $(inc)/dosmac.INC \
+ $(inc)/dosseg.inc $(inc)/error.INC $(inc)/sf.inc $(inc)/vector.inc \
+ kstrin.asm
+
+cpmio2.obj cpmio2.lst: cpmio2.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/sf.inc
+
+dev.obj dev.lst: dev.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/sf.inc $(inc)/version.inc \
+ $(cinc)/dossvc.inc
+
+dir2.obj dir2.lst: dir2.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/devsym.inc $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/dossym.inc \
+ $(inc)/error.INC $(inc)/fastopen.inc
+
+disk.obj disk.lst: disk.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/filemode.inc \
+ $(inc)/mult.inc $(inc)/sf.inc $(inc)/version.inc
+
+dup.obj dup.lst: dup.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/sf.inc $(inc)/version.inc
+
+fcb.obj fcb.lst: fcb.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(inc)/dbcs.sw $(inc)/devsym.inc $(inc)/dirent.INC \
+ $(inc)/doscntry.inc $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/dossym.inc $(inc)/error.INC
+
+fcbio.obj fcbio.lst: fcbio.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/bugtyp.inc \
+ $(inc)/cpmfcb.inc $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC \
+ $(inc)/dosseg.inc $(inc)/error.INC $(inc)/filemode.inc \
+ $(inc)/mult.inc $(inc)/sf.inc $(inc)/syscall.inc $(inc)/version.inc \
+ $(cinc)/dossvc.inc
+
+fcbio2.obj fcbio2.lst: fcbio2.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/bugtyp.inc \
+ $(inc)/cpmfcb.inc $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC \
+ $(inc)/dosseg.inc $(inc)/error.INC $(inc)/filemode.inc $(inc)/sf.inc \
+ $(inc)/version.inc $(cinc)/dossvc.inc
+
+file.obj file.lst: file.asm $(inc)/EA.inc $(inc)/VERSIONA.INC \
+ $(inc)/buffer.INC $(inc)/bugtyp.inc $(inc)/dbcs.sw $(inc)/devsym.inc \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/dossym.inc $(inc)/error.INC $(inc)/filemode.inc $(inc)/sf.inc \
+ $(inc)/version.inc $(cinc)/dossvc.inc
+
+getset.obj getset.lst: getset.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(inc)/dbcs.sw $(inc)/devsym.inc $(inc)/dirent.INC \
+ $(inc)/doscntry.inc $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/dossym.inc $(inc)/error.INC $(inc)/mult.inc $(cinc)/dossvc.inc \
+ $(cinc)/vint.inc
+
+handle.obj handle.lst: handle.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/EA.inc $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/bugtyp.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/filemode.inc $(inc)/mult.inc $(inc)/pdb.inc \
+ $(inc)/sf.inc $(inc)/syscall.inc $(inc)/version.inc $(cinc)/dossvc.inc \
+ $(cinc)/vint.inc
+
+ioctl.obj ioctl.lst: ioctl.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC \
+ $(inc)/dosseg.inc $(inc)/error.INC $(cinc)/dossvc.inc \
+ $(inc)/ioctl.inc $(inc)/mult.inc $(inc)/sf.inc $(inc)/vector.inc
+
+lock.obj lock.lst: lock.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/lock.inc $(inc)/mult.inc $(inc)/sf.inc \
+ $(inc)/version.inc $(cinc)/dossvc.inc
+
+macro.obj macro.lst: macro.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(cinc)/curdir.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/mult.inc $(cinc)/cmdsvc.inc $(cinc)/dossvc.inc
+
+macro2.obj macro2.lst: macro2.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(cinc)/curdir.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/mult.inc
+
+misc.obj misc.lst: misc.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(inc)/bugtyp.inc $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/error.INC \
+ $(inc)/filemode.inc $(inc)/mi.inc $(inc)/mult.inc $(inc)/pdb.inc \
+ $(inc)/sf.inc $(inc)/vector.inc $(inc)/version.inc $(cinc)/dossvc.inc
+
+misc2.obj misc2.lst: misc2.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(inc)/bugtyp.inc $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/dossym.inc \
+ $(inc)/error.INC $(inc)/fastxxxx.inc $(inc)/sf.inc $(inc)/sysvar.inc \
+ $(inc)/version.inc
+
+mscode.obj mscode.lst: mscode.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/devsym.inc $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/dossym.inc \
+ $(inc)/error.INC $(inc)/fastopen.inc $(inc)/fastxxxx.inc \
+ $(inc)/mi.inc $(inc)/msbdata.inc $(inc)/mult.inc \
+ $(inc)/vector.inc $(inc)/version.inc mssw.asm $(inc)\win386.inc \
+ $(cinc)/dossvc.inc $(cinc)/vint.inc
+
+msctrlc.obj msctrlc.lst: msctrlc.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/bugtyp.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/exe.inc $(inc)/filemode.inc \
+ $(inc)/mi.inc $(inc)/mult.inc $(inc)/pdb.inc $(inc)/sf.inc \
+ $(inc)/syscall.inc $(inc)/vector.inc $(inc)/version.inc mssw.asm \
+ $(cinc)/dossvc.inc
+
+msdisp.obj msdisp.lst: msdisp.asm $(inc)/DOSSYM.INC $(inc)/VERSIONA.INC \
+ $(inc)/buffer.INC $(inc)/bugtyp.inc $(inc)/dbcs.sw $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/error.INC $(inc)/mi.inc \
+ $(inc)/pdb.inc $(inc)/syscall.inc $(inc)/vector.inc $(cinc)/dbgsvc.inc \
+ $(inc)/version.inc mssw.asm scnam.inc $(cinc)/dossvc.inc $(cinc)/vint.inc
+
+msinit.obj msinit.lst: msinit.asm $(inc)/arena.inc $(inc)/buffer.inc \
+ $(cinc)/curdir.inc $(inc)/devsym.inc $(inc)/dirent.inc \
+ $(inc)/doscntry.inc $(inc)/dosmac.inc $(inc)/dosseg.inc \
+ $(inc)/fastopen.inc $(inc)/find.inc $(inc)/mi.inc \
+ $(inc)/pdb.inc $(inc)/sf.inc $(inc)/sysvar.inc $(inc)/vector.inc \
+ $(inc)/version.inc $(inc)/xmm.inc mssw.asm $(inc)/dossym.inc \
+ $(inc)/bugtyp.inc $(inc)\win386.inc $(cinc)/dossvc.inc \
+ $(cinc)/cmdsvc.inc $(cinc)/doswow.inc
+
+open.obj open.lst: open.asm $(inc)/VERSIONA.INC $(inc)/buffer.INC \
+ $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/devsym.inc $(inc)/dirent.INC \
+ $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/dossym.inc \
+ $(inc)/error.INC $(inc)/fastopen.inc $(inc)/fastxxxx.inc \
+ $(inc)/filemode.inc $(inc)/mult.inc $(inc)/sf.inc
+
+origin.obj origin.lst: origin.asm $(inc)/DOSSEG.INC $(inc)/ORIGIN.INC \
+ $(inc)/dossym.inc $(inc)/bdsize.inc
+
+parse.obj parse.lst: parse.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC
+
+path.obj path.lst: path.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(cinc)/curdir.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/filemode.inc $(inc)/mult.inc \
+ $(inc)/version.inc $(cinc)/dossvc.inc
+
+msproc.obj proc.lst: msproc.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/EA.INC $(inc)/VERSIONA.INC $(inc)/arena.inc $(inc)/buffer.INC \
+ $(cinc)/curdir.inc $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC \
+ $(inc)/dosseg.inc $(inc)/error.INC $(inc)/exe.inc $(inc)/pdb.inc \
+ $(inc)/sf.inc $(inc)/syscall.inc $(inc)/vector.inc $(inc)/version.inc \
+ $(cinc)/dossvc.inc $(cinc)/vint.inc $(cinc)/dbgsvc.inc
+
+exepatch.obj exepatch.lst: exepatch.asm $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/dosseg.inc $(inc)/exe.inc \
+ $(inc)/version.inc
+
+search.obj search.lst: search.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/fastopen.inc $(inc)/fastxxxx.inc \
+ $(cinc)/dossvc.inc
+
+segcheck.obj segcheck.lst: segcheck.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/version.inc $(inc)/sf.inc \
+ $(inc)/int2a.inc
+
+srvcall.obj srvcall.lst: srvcall.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc $(inc)/dpl.asm \
+ $(inc)/error.INC $(inc)/mult.inc $(inc)/sf.inc
+
+time.obj time.lst: time.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/dbcs.sw \
+ $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/version.inc $(cinc)/dossvc.inc
+
+util.obj util.lst: util.asm $(inc)/DEVSYM.INC $(inc)/DOSSYM.INC \
+ $(inc)/VERSIONA.INC $(inc)/buffer.INC $(inc)/bugtyp.inc \
+ $(inc)/dbcs.sw $(inc)/dirent.INC $(inc)/dosmac.INC $(inc)/dosseg.inc \
+ $(inc)/error.INC $(inc)/pdb.inc $(inc)/sf.inc $(inc)/version.inc
+
+mstable.obj mstable.lst: mstable.asm mssw.asm \
+ $(inc)\EA.inc $(inc)\VERSIONA.INC $(inc)\buffer.INC \
+ $(inc)\copyrigh.inc $(inc)\dbcs.sw $(inc)\dirent.INC \
+ $(inc)\dosmac.INC $(inc)\dosseg.inc $(inc)\dossym.inc \
+ $(inc)\error.INC $(inc)\fastopen.inc $(inc)\syscall.inc \
+ $(inc)\version.inc
+
+ntdos.bin: msdos.cl1 msdos.cl2 exepatch.obj \
+ msdata.obj mscode.obj msdosme.obj time.obj getset.obj \
+ parse.obj misc.obj misc2.obj cpmio.obj cpmio2.obj \
+ mstable.obj msdisp.obj fcbio.obj fcbio2.obj segcheck.obj \
+ search.obj path.obj ioctl.obj dup.obj open.obj \
+ abort.obj disk.obj dir2.obj dev.obj fcb.obj msctrlc.obj \
+ msproc.obj alloc.obj srvcall.obj util.obj macro.obj macro2.obj \
+ handle.obj file.obj lock.obj msinit.obj origin.obj \
+ makefile msdos.lnk
+ link16 $(link_opts) @msdos.lnk
+ mapsym ntdos
+ reloc ntdos.exe ntdos.bin
+ del ntdos.exe
+
+$(dest): ntdos.bin
+ stripz ntdos.bin $(dest)
diff --git a/private/mvdm/dos/v86/doskrnl/dos/misc.asm b/private/mvdm/dos/v86/doskrnl/dos/misc.asm
new file mode 100644
index 000000000..4ae3151d3
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/misc.asm
@@ -0,0 +1,965 @@
+ TITLE MISC - Miscellanious routines for MS-DOS
+ NAME MISC
+
+;** Miscellaneous system calls most of which are CAVEAT
+;
+; $SLEAZEFUNC
+; $SLEAZEFUNCDL
+; $GET_INDOS_FLAG
+; $GET_IN_VARS
+; $GET_DEFAULT_DPB
+; $GET_DPB
+; $DISK_RESET
+; $SETDPB
+; $Dup_PDB
+; $CREATE_PROCESS_DATA_BLOCK
+; SETMEM
+; FETCHI_CHECK
+; $GSetMediaID
+;
+; Revision history:
+;
+; sudeepb 14-Mar-1991 Ported for NT DOSEm
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include mult.inc
+ include pdb.inc
+ include dpb.inc
+ include bpb.inc
+ include vector.inc
+ include sf.inc
+ include filemode.inc
+ include mi.inc
+ include curdir.inc
+ include bugtyp.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ i_need LASTBUFFER,DWORD
+ i_need INDOS,BYTE
+ i_need SYSINITVAR,BYTE
+ i_need CurrentPDB,WORD
+ i_need CreatePDB,BYTE
+ i_need FATBYTE,BYTE
+ i_need THISCDS,DWORD
+ i_need THISSFT,DWORD
+ i_need HIGH_SECTOR,WORD ;AN000; high word of sector #
+ i_need DOS34_FLAG,WORD ;AN000;
+ i_need SC_STATUS,WORD ; M041
+ I_need JFN,WORD
+ I_need SFN,WORD
+
+ EXTRN CURDRV :BYTE
+
+DosData SEGMENT WORD PUBLIC 'DATA'
+ allow_getdseg
+ EXTRN SCS_TSR :BYTE
+ EXTRN SCS_CMDPROMPT :BYTE
+ EXTRN SCS_DOSONLY :BYTE
+ EXTRN FAKE_NTDPB :BYTE
+ EXTRN SCS_FDACCESS :WORD
+DosData ENDS
+
+DOSCODE SEGMENT
+
+ EXTRN pJfnFromHandle:near
+ EXTRN SFFromHandle:near
+ EXTRN SFNFree:near
+ EXTRN JFNFree:near
+
+ allow_getdseg
+
+
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ENTRYPOINTSEG EQU 0CH
+MAXDIF EQU 0FFFH
+SAVEXIT EQU 10
+WRAPOFFSET EQU 0FEF0h
+
+
+ BREAK <SleazeFunc -- get a pointer to media byte>
+;
+;----------------------------------------------------------------------------
+;
+;** $SLEAZEFUNC - Get a Pointer to the Media Byte
+;
+; Return Stuff sort of like old get fat call
+;
+; ENTRY none
+; EXIT DS:BX = Points to FAT ID byte (IBM only)
+; GOD help anyone who tries to do ANYTHING except
+; READ this ONE byte.
+; DX = Total Number of allocation units on disk
+; CX = Sector size
+; AL = Sectors per allocation unit
+; = -1 if bad drive specified
+; USES all
+;
+;** $SLEAZEFUNCDL - Get a Pointer to the Media Byte
+;
+; Identical to $SLEAZEFUNC except (dl) = drive
+;
+; ENTRY (dl) = drive (0=default, 1=A, 2=B, etc.)
+; EXIT DS:BX = Points to FAT ID byte (IBM only)
+; GOD help anyone who tries to do ANYTHING except
+; READ this ONE byte.
+; DX = Total Number of allocation units on disk
+; CX = Sector size
+; AL = Sectors per allocation unit
+; = -1 if bad drive specified
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+
+procedure $SLEAZEFUNC,NEAR
+
+ MOV DL,0
+
+entry $SLEAZEFUNCDL
+ context DS
+
+ MOV AL,DL
+ invoke GETTHISDRV ; Get CDS structure
+SET_AL_RET:
+; MOV AL,error_invalid_drive ; Assume error ;AC000;
+ JC BADSLDRIVE
+ HRDSVC SVC_DEMGETDRIVEFREESPACE
+ JC SET_AL_RET ; User FAILed to I 24
+ mov [FATBYTE],al
+sl05:
+; NOTE THAT A FIXED MEMORY CELL IS USED --> THIS CALL IS NOT
+; RE-ENTRANT. USERS BETTER GET THE ID BYTE BEFORE THEY MAKE THE
+; CALL AGAIN
+
+;; save the sectors per cluster returned from 32bits
+;; this is done because get_user_stack will destroy si
+ mov ax, si
+
+;hkn; FATBYTE is in DATA seg (DOADATA)
+ MOV DI,OFFSET DOSDATA:FATBYTE
+ invoke get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_CX],CX
+ MOV [SI.user_DX],DX
+ MOV [SI.user_BX],DI
+ MOV [SI.user_AX],AX
+
+;hkn; Use SS as pointer to DOSDATA
+ mov [si.user_DS],SS
+; MOV [SI.user_DS],CS ; stash correct pointer
+
+ return
+BADSLDRIVE:
+ transfer FCB_Ret_ERR
+
+
+EndProc $SleazeFunc
+
+ BREAK <$Get_INDOS_Flag -- Return location of DOS critical-section flag>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Get_INDOS_Flag - Return location of DOS Crit Section Flag
+;
+; Returns location of DOS status for interrupt routines
+; ;
+; ENTRY none
+; EXIT (es:bx) = flag location
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $GET_INDOS_FLAG,NEAR
+
+ invoke get_user_stack
+
+;hkn; INDOS is in DATA seg (DOSDATA)
+ MOV [SI.user_BX],OFFSET DOSDATA:INDOS
+
+ MOV [SI.user_ES],SS
+ return
+
+EndProc $GET_INDOS_FLAG
+
+
+ BREAK <$Get_IN_VARS -- Return a pointer to DOS variables>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Get_IN_Vars - Return Pointer to DOS Variables
+;
+; Return a pointer to interesting DOS variables This call is version
+; dependent and is subject to change without notice in future versions.
+; Use at risk.
+;
+; ENTRY none
+; EXIT (es:bx) = address of SYSINITVAR
+; uses ALL
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $GET_IN_VARS,NEAR
+
+ invoke get_user_stack
+ ASSUME DS:nothing
+;hkn; SYSINITVAR is in CONST seg (DOSDATA)
+ MOV [SI.user_BX],OFFSET DOSDATA:SYSINITVAR
+
+ MOV [SI.user_ES],SS
+ return
+EndProc $GET_IN_VARS
+
+
+BREAK <$Get_Default_DPB,$Get_DPB -- Return pointer to DPB>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Get_Default_DPB - Return a pointer to the Default DPB
+;
+; Return pointer to drive parameter table for default drive
+;
+; ENTRY none
+; EXIT (ds:bx) = DPB address
+; USES all
+;
+;** $Get_DPB - Return a pointer to a specified DPB
+;
+; Return pointer to a specified drive parameter table
+;
+; ENTRY (dl) = drive # (0 = default, 1=A, 2=B, etc.)
+; EXIT (al) = 0 iff ok
+; (ds:bx) = DPB address
+; (al) = -1 if bad drive
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $GET_DEFAULT_DPB,NEAR
+ MOV DL,0
+
+ entry $GET_DPB
+
+ context DS
+
+ MOV AL,DL
+ invoke GETTHISDRV ; Get CDS structure
+ JNC gd01 ; no valid drive
+ JMP ISNODRV ; no valid drive
+gd01:
+ LES DI,[THISCDS] ; check for net CDS
+ TESTB ES:[DI.curdir_flags],curdir_isnet
+ JNZ ISNODRV ; No DPB to point at on NET stuff
+ mov di, offset DOSDATA:FAKE_NTDPB
+ HRDSVC SVC_DEMGETDPB
+
+ JC ISNODRV ; User FAILed to I 24, only error we
+ invoke get_user_stack
+ASSUME DS:NOTHING
+ MOV [SI.user_BX],DI
+ MOV [SI.user_DS],SS
+ XOR AL,AL
+ return
+
+ISNODRV:
+ MOV AL,-1
+ return
+
+EndProc $GET_Default_dpb
+
+
+ BREAK <$Disk_Reset -- Flush out all dirty buffers>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Disk_Reset - Flush out Dirty Buffers
+;
+; $DiskReset flushes and invalidates all buffers. BUGBUG - do
+; we really invalidate? SHould we? THis screws non-removable
+; caching. Maybe CHKDSK relies upon it, though....
+;
+; ENTRY none
+; EXIT none
+; USES all
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $DISK_RESET,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ cmp word ptr ss:[SCS_FDACCESS],0
+ je res_ret
+
+ HRDSVC SVC_DEMDISKRESET
+
+res_ret:
+ clc
+ return
+
+EndProc $DISK_RESET
+
+ BREAK <$SetDPB - Create a valid DPB from a user-specified BPB>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $SetDPB - Create a DPB
+;
+; SetDPB Creates a valid DPB from a user-specified BPB
+;
+; ENTRY eS:BP Points to DPB
+; DS:SI Points to BPB
+;
+; NT DOSEM is using this function for its sleazy purposes.
+; Most of these defined ordinals are for SCS purposes.
+; If BP ==0 && SI == 0 implies MVDM sleaz functions
+; with function number in AL. Increment max_sleaze_func below
+; when adding more sub-functions.
+;
+; AL = 0 => Allocate SCS console
+; Entry
+; BX:CX is the 32bit NT handle
+; DX:DI = file size
+; Exit
+; CY clear means success => AX = JFN
+; CY set means error
+;
+; AL = 1 => Free SCS console
+; Entry
+; BX = JFN
+; Exit
+; CY clear means success
+; CY set means trouble
+;
+; AL = 2 => Query TSR presence bit
+; Entry
+; None
+; Exit
+; CY clear means no TSR is present
+; CY set means TSR is present
+; TSR bit is reset always after this call
+; AL = 3 => Query standard handles
+; Entry
+; BX = handle (0-stdin, 1-stdout, 2-stderr)
+; Exit
+; Success - Carry clear (NT handle in BX:CX)
+; Failure - Carry set (fails if std handle is local device).
+; AL = 4 => NTCMDPROMPT command was set in config.nt
+; Entry
+; None
+; Exit
+; None
+;
+; AL = 5 => Query NTCMDPROMPT state
+; Entry
+; None
+; Exit
+; al = 1 means NTCMDPROMPT bit was present in config.nt
+; al = 0 means NTCMDPROMPT bit was not present in config.nt
+; AL = 6 => DOSONLY command was set in config.nt
+; Entry
+; None
+; Exit
+; None
+;
+; AL = 7 => Query DOSONLY state
+; Entry
+; None
+; Exit
+; al = 1 means DOSONLY bit was present in config.nt
+; al = 0 means DOSONLY bit was not present in config.nt
+;
+; EXIT DPB setup
+; USES ALL but BP, DS, ES
+;
+;----------------------------------------------------------------------------
+;
+word3 dw 3 ; M008 -- word value for divides
+max_sleaze_scs equ 7 ; MAXIMUM scs SLEAZE functions
+
+procedure $SETDPB,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ or bp,bp
+ jz check_more
+ jmp real_setdpb
+check_more:
+ or si,si
+ jz some_more
+ jmp real_setdpb
+some_more:
+ cmp al,max_sleaze_scs
+ jbe check_done
+ jmp setdpb
+check_done:
+
+ or al,al
+ jz alloc_con ; al =0
+ dec al
+ jz free_con ; al =1
+ dec al
+ jz q_tsr ; al =2
+ dec al
+ jnz do_prmpt
+ jmp query_con ; al =3
+do_prmpt:
+ dec al
+ jnz q_prmpt
+ mov byte ptr ss:[scs_cmdprompt],1
+ jmp ok_ret
+q_prmpt:
+ dec al
+ jnz dosonly
+ mov al, byte ptr ss:[scs_cmdprompt]
+ jmp ok_ret
+
+dosonly:
+ dec al
+ jnz q_dosonly
+ mov byte ptr ss:[scs_dosonly],1
+ jmp ok_ret
+q_dosonly:
+ mov al, byte ptr ss:[scs_dosonly]
+ jmp ok_ret
+
+q_tsr:
+ cmp byte ptr ss:[SCS_TSR],0
+ mov byte ptr [SCS_TSR],0
+ jz q_ret
+ jmp setdpb
+q_ret:
+ jmp ok_ret
+
+ ; free scs console
+free_con:
+ call SFFromHandle ; get system file entry in es:di
+ jnc fc_10
+ jmp setdpb
+fc_10:
+ test es:[di.sf_flags],sf_scs_console
+ jnz fc_15
+ jmp setdpb
+fc_15:
+ MOV ES:[DI.sf_ref_count],0 ; free sft
+ call pJFNFromHandle ; es:di = pJFN (handle);
+ jnc fc_20
+ jmp setdpb
+fc_20:
+ MOV BYTE PTR ES:[DI],0FFh ; release the JFN
+ jmp ok_ret
+
+alloc_con:
+ push bx
+ push cx
+ push dx ; save file size
+ push di
+ call SFNFree ; get a free sfn
+ JNC ac_5 ; oops, no free sft's
+ JMP alloc_err ; oops, no free sft's
+ac_5:
+ MOV SFN,BX ; save the SFN for later
+ MOV WORD PTR ThisSFT,DI ; save the SF offset
+ MOV WORD PTR ThisSFT+2,ES ; save the SF segment
+ invoke JFNFree ; get a free jfn
+ JC alloc_err ; No need to free SFT; DOS is robust enough for this
+ MOV JFN,BX ; save the jfn itself
+ MOV BX,SFN
+ MOV ES:[DI],BL ; assign the JFN
+ mov di,WORD PTR ThisSFT
+ MOV es,WORD PTR ThisSFT+2
+ mov es:[di.sf_ref_count],1
+ MOV BYTE PTR ES:[DI.sf_mode],0
+ MOV BYTE PTR ES:[DI.sf_attr],0
+ mov word ptr ES:[DI.SF_Position],0
+ mov word ptr ES:[DI.SF_Position+2],0
+ pop word ptr ES:[DI.SF_Size]
+ pop word ptr ES:[DI.SF_Size + 2]
+ mov word ptr ES:[DI.SF_flags], sf_scs_console
+ cmp JFN, 0 ;STDIN?
+ jne ac_6
+ or word ptr ES:[DI.sf_flags], sf_nt_pipe_in ;special case for
+ac_6:
+ pop cx
+ pop bx
+ mov word ptr es:[di.sf_NTHandle],cx
+ mov word ptr es:[di.sf_NTHandle+2],bx
+ mov ax,JFN
+ MOV SFN,-1 ; clear out sfn pointer ;smr;SS Override
+ok_ret:
+ transfer Sys_Ret_OK ; bye with no errors
+
+alloc_err:
+ pop di
+ pop dx
+ pop cx
+ pop bx
+setdpb:
+ error error_invalid_function
+
+query_con:
+ call SFFromHandle ; get system file entry in es:di
+ jnc qc_10
+ jmp setdpb
+qc_10:
+ test es:[di.sf_flags],devid_device
+ jnz setdpb
+ mov cx,word ptr es:[di.sf_NTHandle]
+ mov bx,word ptr es:[di.sf_NTHandle+2] ; bx:cx is NT handle
+ invoke Get_user_stack
+ MOV DS:[SI.User_CX],CX
+ MOV DS:[SI.User_BX],BX
+ jmp short ok_ret
+EndProc $SETDPB
+
+real_setdpb:
+ MOV DI,BP
+ ADD DI,2 ; Skip over dpb_drive and dpb_UNIT
+ LODSW
+ STOSW ; dpb_sector_size
+ CMP BYTE PTR [SI.BPB_NUMBEROFFATS-2],0 ; FAT file system drive ;AN000;
+ JNZ yesfat ; yes ;AN000;
+ MOV BYTE PTR ES:[DI.dpb_FAT_count-4],0
+ JMP short setend ; NO ;AN000;
+yesfat:
+ MOV DX,AX
+ LODSB
+ DEC AL
+ STOSB ; dpb_cluster_mask
+ INC AL
+ XOR AH,AH
+LOG2LOOP:
+ test AL,1
+ JNZ SAVLOG
+ INC AH
+ SHR AL,1
+ JMP SHORT LOG2LOOP
+SAVLOG:
+ MOV AL,AH
+ STOSB ; dpb_cluster_shift
+ MOV BL,AL
+ MOVSW ; dpb_first_FAT Start of FAT (# of reserved sectors)
+ LODSB
+ STOSB ; dpb_FAT_count Number of FATs
+; OR AL,AL ; NONFAT ? ;AN000;
+; JZ setend ; yes, don't do anything ;AN000;
+ MOV BH,AL
+ LODSW
+ STOSW ; dpb_root_entries Number of directory entries
+ MOV CL,5
+ SHR DX,CL ; Directory entries per sector
+ DEC AX
+ ADD AX,DX ; Cause Round Up
+ MOV CX,DX
+ XOR DX,DX
+ DIV CX
+ MOV CX,AX ; Number of directory sectors
+ INC DI
+ INC DI ; Skip dpb_first_sector
+ MOVSW ; Total number of sectors in DSKSIZ (temp as dpb_max_cluster)
+ LODSB
+ MOV ES:[BP.dpb_media],AL ; Media byte
+ LODSW ; Number of sectors in a FAT
+ STOSW ;AC000;;>32mb dpb_FAT_size
+ MOV DL,BH ;AN000;;>32mb
+ XOR DH,DH ;AN000;;>32mb
+ MUL DX ;AC000;;>32mb Space occupied by all FATs
+ ADD AX,ES:[BP.dpb_first_FAT]
+ STOSW ; dpb_dir_sector
+ ADD AX,CX ; Add number of directory sectors
+ MOV ES:[BP.dpb_first_sector],AX
+
+ MOV CL,BL ;F.C. >32mb ;AN000;
+ CMP WORD PTR ES:[BP.DSKSIZ],0 ;F.C. >32mb ;AN000;
+ JNZ normal_dpb ;F.C. >32mb ;AN000;
+ XOR CH,CH ;F.C. >32mb ;AN000;
+ MOV BX,WORD PTR [SI+BPB_BigTotalSectors-BPB_SectorsPerTrack] ;AN000;
+ MOV DX,WORD PTR [SI+BPB_BigTotalSectors-BPB_SectorsPerTrack+2] ;AN000;
+ SUB BX,AX ;AN000;;F.C. >32mb
+ SBB DX,0 ;AN000;;F.C. >32mb
+ OR CX,CX ;AN000;;F.C. >32mb
+ JZ norot ;AN000;;F.C. >32mb
+rott: ;AN000;;F.C. >32mb
+ CLC ;AN000;;F.C. >32mb
+ RCR DX,1 ;AN000;;F.C. >32mb
+ RCR BX,1 ;AN000;;F.C. >32mb
+ LOOP rott ;AN000;;F.C. >32mb
+norot: ;AN000;
+ MOV AX,BX ;AN000;;F.C. >32mb
+ JMP short setend ;AN000;;F.C. >32mb
+normal_dpb:
+ SUB AX,ES:[BP.DSKSIZ]
+ NEG AX ; Sectors in data area
+;; MOV CL,BL ; dpb_cluster_shift
+ SHR AX,CL ; Div by sectors/cluster
+setend:
+
+; M008 - CAS
+;
+ INC AX ; +2 (reserved), -1 (count -> max)
+;
+; There has been a bug in our fatsize calculation for so long
+; that we can't correct it now without causing some user to
+; experience data loss. There are even cases where allowing
+; the number of clusters to exceed the fats is the optimal
+; case -- where adding 2 more fat sectors would make the
+; data field smaller so that there's nothing to use the extra
+; fat sectors for.
+;
+; Note that this bug had very minor known symptoms. CHKDSK would
+; still report that there was a cluster left when the disk was
+; actually full. Very graceful failure for a corrupt system
+; configuration. There may be worse cases that were never
+; properly traced back to this bug. The problem cases only
+; occurred when partition sizes were very near FAT sector
+; rounding boundaries, which were rare cases.
+;
+; Also, it's possible that some third-party partition program might
+; create a partition that had a less-than-perfect FAT calculation
+; scheme. In this hypothetical case, the number of allocation
+; clusters which don't actually have FAT entries to represent
+; them might be larger and might create a more catastrophic
+; failure. So we'll provide the safeguard of limiting the
+; max_cluster to the amount that will fit in the FATs.
+;
+; ax = maximum legal cluster, ES:BP -> dpb
+
+; make sure the number of fat sectors is actually enough to
+; hold that many clusters. otherwise, back the number of
+; clusters down
+
+ mov bx,ax ; remember calculated # clusters
+ mov ax,ES:[BP.dpb_fat_size]
+ mul ES:[BP.dpb_sector_size] ; how big is the FAT?
+ cmp bx,4096-10 ; test for 12 vs. 16 bit fat
+ jb setend_fat12
+ shr dx,1
+ rcr ax,1 ; find number of entries
+ cmp ax,4096-10+1 ; would this truncation move us
+; ; into 12-bit fatland?
+ jb setend_faterr ; then go ahead and let the
+; ; inconsistency pass through
+; ; rather than lose data by
+; ; correcting the fat type
+ jmp short setend_fat16
+
+setend_fat12:
+ add ax,ax ; (fatsiz*2)/3 = # of fat entries
+ adc dx,dx
+ div cs:word ptr word3
+
+setend_fat16:
+ dec ax ; limit at 1
+ cmp ax,bx ; is fat big enough?
+ jbe setend_fat ; use max value that'll fit
+
+setend_faterr:
+ mov ax,bx ; use calculated value
+
+setend_fat:
+
+; now ax = maximum legal cluster
+
+; end M008
+
+ MOV ES:[BP.dpb_max_cluster],AX
+ MOV ES:[BP.dpb_next_free],0 ; Init so first ALLOC starts at
+ ; begining of FAT
+ MOV ES:[BP.dpb_free_cnt],-1 ; current count is invalid.
+ return
+
+
+BREAK <$Create_Process_Data_Block,SetMem -- Set up process data block>
+
+;
+;----------------------------------------------------------------------------
+;
+;** $Dup_PDB
+;
+; Inputs: DX is new segment address of process
+; SI is end of new allocation block
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $Dup_PDB,NEAR
+ ASSUME SS:NOTHING
+
+;hkn; CreatePDB would have a CS override. This is not valid.
+;hkn; Must set up ds in order to acess CreatePDB. Also SS is
+;hkn; has been assumed to be NOTHING. It may not have DOSDATA.
+
+ getdseg <ds> ; ds -> dosdata
+
+ MOV CreatePDB,0FFH ; indicate a new process
+ MOV DS,CurrentPDB
+ PUSH SI
+ JMP SHORT CreateCopy
+EndProc $Dup_PDB
+
+;
+;----------------------------------------------------------------------------
+;
+; Inputs:
+; DX = Segment number of new base
+; Function:
+; Set up program base and copy term and ^C from int area
+; Returns:
+; None
+; Called at DOS init
+;
+;----------------------------------------------------------------------------
+;
+
+procedure $CREATE_PROCESS_DATA_BLOCK,NEAR
+ ASSUME SS:NOTHING
+
+ CALL get_user_stack
+ MOV DS,[SI.user_CS]
+ PUSH DS:[PDB_Block_len]
+CreateCopy:
+ MOV ES,DX
+
+ XOR SI,SI ; copy entire PDB
+ MOV DI,SI
+ MOV CX,80H
+ REP MOVSW
+; DOS 3.3 7/9/86
+
+
+ MOV CX,FilPerProc ; copy handles in case of
+ MOV DI,PDB_JFN_Table ; Set Handle Count has been issued
+ PUSH DS
+ LDS SI,DS:[PDB_JFN_Pointer]
+ REP MOVSB
+ POP DS
+
+; DOS 3.3 7/9/86
+
+ ;hkn;CreatePDB would have a CS override. This is not valid.
+ ;hkn;Must set up ds in order to acess CreatePDB. Also SS is
+ ;hkn;has been assumed to be NOTHING. It may not have DOSDATA.
+
+ getdseg <ds> ; ds -> dosdata
+
+ cmp CreatePDB,0 ; Shall we create a process?
+ JZ Create_PDB_cont ; nope, old style call
+;
+; Here we set up for a new process...
+;
+
+;hkn; PUSH CS ; Called at DOSINIT time, NO SS
+;hkn; POP DS
+
+;hkn; must set up DS to DOSDATA
+
+ getdseg <ds> ; ds -> dosdata
+
+ DOSAssume <DS>,"Create PDB"
+ XOR BX,BX ; dup all jfns
+ MOV CX,FilPerProc ; only 20 of them
+
+Create_dup_jfn:
+ PUSH ES ; save new PDB
+ invoke SFFromHandle ; get sf pointer
+ MOV AL,-1 ; unassigned JFN
+ JC CreateStash ; file was not really open
+ TESTB ES:[DI].sf_flags,sf_no_inherit
+ JNZ CreateStash ; if no-inherit bit is set, skip dup.
+;
+; We do not inherit network file handles.
+;
+ MOV AH,BYTE PTR ES:[DI].sf_mode
+ AND AH,sharing_mask
+ CMP AH,sharing_net_fcb
+ jz CreateStash
+;
+; The handle we have found is duplicatable (and inheritable). Perform
+; duplication operation.
+;
+ MOV WORD PTR [THISSFT],DI
+ MOV WORD PTR [THISSFT+2],ES
+ invoke DOS_DUP ; signal duplication
+;
+; get the old sfn for copy
+;
+ invoke pJFNFromHandle ; ES:DI is jfn
+ MOV AL,ES:[DI] ; get sfn
+;
+; Take AL (old sfn or -1) and stash it into the new position
+;
+CreateStash:
+ POP ES
+ MOV ES:[BX].PDB_JFN_Table,AL; copy into new place!
+ INC BX ; next jfn...
+ LOOP create_dup_jfn
+
+ MOV BX,CurrentPDB ; get current process
+ MOV ES:[PDB_Parent_PID],BX ; stash in child
+ MOV [CurrentPDB],ES
+ ASSUME DS:NOTHING
+ MOV DS,BX
+;
+; end of new process create
+;
+Create_PDB_cont:
+
+;hkn; It comes to this point from 2 places. So, change to DOSDATA temporarily
+ push ds
+ getdseg <ds> ; ds -> dosdata
+
+ MOV BYTE PTR [CreatePDB],0h ; reset flag
+ pop ds
+
+ POP AX
+
+ entry SETMEM
+ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+;---------------------------------------------------------------------------
+; Inputs:
+; AX = Size of memory in paragraphs
+; DX = Segment
+; Function:
+; Completely prepares a program base at the
+; specified segment.
+; Called at DOS init
+; Outputs:
+; DS = DX
+; ES = DX
+; [0] has INT int_abort
+; [2] = First unavailable segment
+; [5] to [9] form a long call to the entry point
+; [10] to [13] have exit address (from int_terminate)
+; [14] to [17] have ctrl-C exit address (from int_ctrl_c)
+; [18] to [21] have fatal error address (from int_fatal_abort)
+; DX,BP unchanged. All other registers destroyed.
+;---------------------------------------------------------------------------
+
+ XOR CX,CX
+ MOV DS,CX
+ MOV ES,DX
+ MOV SI,addr_int_terminate
+ MOV DI,SAVEXIT
+ MOV CX,6
+ REP MOVSW
+ MOV ES:[2],AX
+ SUB AX,DX
+ CMP AX,MAXDIF
+ JBE HAVDIF
+ MOV AX,MAXDIF
+HAVDIF:
+ SUB AX,10H ; Allow for 100h byte "stack"
+ MOV BX,ENTRYPOINTSEG ; in .COM files
+ SUB BX,AX
+ MOV CL,4
+ SHL AX,CL
+ MOV DS,DX
+
+ ;
+ ; The address in BX:AX will be F01D:FEF0 if there is 64K or more
+ ; memory in the system. This is equivalent to 0:c0 if A20 is OFF.
+ ; If DOS is in HMA this equivalence is no longer valid as A20 is ON.
+ ; But the BIOS which now resides in FFFF:30 has 5 bytes in FFFF:D0
+ ; (F01D:FEF0) which is the same as the ones in 0:C0, thereby
+ ; making this equvalnce valid for this particular case. If however
+ ; there is less than 64K remaining the address in BX:AX will not
+ ; be the same as above. We will then stuff 0:c0 , the call 5 address
+ ; into the PSP.
+ ;
+ ; Therefore for the case where there is less than 64K remaining in
+ ; the system old CPM Apps that look at PSP:6 to determine memory
+ ; requirements will not work. Call 5, however will continue to work
+ ; for all cases.
+ ;
+
+ MOV WORD PTR DS:[PDB_CPM_Call+1],AX
+ MOV WORD PTR DS:[PDB_CPM_Call+3],BX
+
+ cmp ax, WRAPOFFSET ; Q: does the system have >= 64k of
+ ; memory left
+ je addr_ok ; Y: the above calculated address is
+ ; OK
+ ; N:
+
+
+ MOV WORD PTR DS:[PDB_CPM_Call+1],0c0h
+ MOV WORD PTR DS:[PDB_CPM_Call+3],0
+
+addr_ok:
+
+ MOV DS:[PDB_Exit_Call],(int_abort SHL 8) + mi_INT
+ MOV BYTE PTR DS:[PDB_CPM_Call],mi_Long_CALL
+ MOV WORD PTR DS:[PDB_Call_System],(int_command SHL 8) + mi_INT
+ MOV BYTE PTR DS:[PDB_Call_System+2],mi_Long_RET
+ MOV WORD PTR DS:[PDB_JFN_Pointer],PDB_JFN_Table
+ MOV WORD PTR DS:[PDB_JFN_Pointer+2],DS
+ MOV WORD PTR DS:[PDB_JFN_Length],FilPerProc
+;
+; The server runs several PDB's without creating them VIA EXEC. We need to
+; enumerate all PDB's at CPS time in order to find all references to a
+; particular SFT. We perform this by requiring that the server link together
+; for us all sub-PDB's that he creates. The requirement for us, now, is to
+; initialize this pointer.
+;
+ MOV word ptr DS:[PDB_Next_PDB],-1
+ MOV word ptr DS:[PDB_Next_PDB+2],-1
+
+ ; Set the real version number in the PSP - 5.00
+ mov ES:[PDB_Version],(MINOR_VERSION SHL 8)+MAJOR_VERSION
+
+ return
+
+EndProc $CREATE_PROCESS_DATA_BLOCK
+
+
+BREAK <$GSetMediaID -- get set media ID>
+;---------------------------------------------------------------------------
+; Inputs:
+; BL= drive number as defined in IOCTL (a=1;b=2..etc)
+; AL= 0 get media ID
+; 1 set media ID
+; DS:DX= buffer containing information
+; DW 0 info level (set on input)
+; DD ? serial #
+; DB 11 dup(?) volume id
+; DB 8 dup(?) file system type
+; Function:
+; Get or set media ID
+; Returns:
+; carry clear, DS:DX is filled
+; carry set, error
+;---------------------------------------------------------------------------
+
+procedure $GSetMediaID,NEAR ;AN000;
+
+ or bl,bl
+ jnz misvc
+ push ds
+ context DS
+ mov bl,CurDrv ; bl = drive (0=a;1=b ..etc)
+ pop DS
+ inc bl
+misvc:
+ dec bl ; bl = drive (0=a;1=b ..etc)
+ HRDSVC SVC_DEMGSETMEDIAID
+ return
+
+EndProc $GSetMediaID ;AN000;
+
+DOSCODE ENDS
+END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/misc2.asm b/private/mvdm/dos/v86/doskrnl/dos/misc2.asm
new file mode 100644
index 000000000..6a06d30a5
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/misc2.asm
@@ -0,0 +1,657 @@
+ TITLE MISC2 - Miscellanious routines for MS-DOS
+ NAME MISC2
+
+;** MISC2.ASM - Miscellaneous useful routines
+;
+; StrCpy
+; StrCmp
+; StrLen
+; DStrLen
+; Idle
+; TableDispatch
+; FastInit ; DOS 4.0
+; FastRet ; DOS 4.0
+; NLS_OPEN ; DOS 4.0
+; NLS_LSEEK ; DOS 4.0
+; Fake_User_Stack ; DOS 4.0
+; GetDevList ; DOS 4.0
+; NLS_IOCTL ; DOS 4.0
+; NLS_GETEXT ; DOS 4.0
+; MSG_RETRIEVAL ; DOS 4.0
+; Fake_Version ; DOS 4.0
+;
+; Revision history:
+;
+; Created: ARR 30 March 1983
+;
+; A000 version 4.0 Jan. 1988
+; A001 DCR 486 - Share installation for >32mb drives
+; A006 DCR 503 - fake version number for IBMCACHE
+; DOS 5.00 Moved fake version to caller's PSP
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include sysvar.inc
+ include sf.inc
+ include curdir.inc
+ include fastxxxx.inc
+ include bugtyp.inc
+ .cref
+ .list
+
+ i_need THISCDS,DWORD
+ I_Need RetryLoop,WORD
+ I_need fSharing,BYTE ; TRUE => server-issued call
+ I_need FastTable,BYTE ;AN000;
+ I_need FastFlg,BYTE ;AN000;
+ I_need User_SP_2F,WORD ;AN000;
+ I_need User_SP,WORD ;AN000;
+ I_need User_SS,WORD ;AN000;
+ I_need SysInitTable,BYTE ;AN000;
+ I_need EXTERR,WORD ;AN000;
+ I_need MSG_EXTERROR,DWORD ;AN000;
+ I_need fshare,byte ;AN001;
+ I_need Special_version,WORD ;AN006;
+
+DOSCODE SEGMENT
+
+ allow_getdseg
+
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+
+Break <STRCMP - compare two ASCIZ strings DS:SI to ES:DI>
+;----------------------------------------------------------------------------
+;
+; Strcmp - compare ASCIZ DS:SI to ES:DI. Case INSENSITIVE. '/' = '\'
+; Strings of different lengths don't match.
+; Inputs: DS:SI - pointer to source string ES:DI - pointer to dest string
+; Outputs: Z if strings same, NZ if different
+; Registers modified: NONE
+;----------------------------------------------------------------------------
+
+Procedure StrCmp,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <SI,DI,AX>
+Cmplp:
+ LODSB
+ IFDEF DBCS ;AN000;
+ invoke testkanj ;AN000;; 2/13/KK
+ jz notkanj1 ;AN000;; 2/13/KK
+ dec si ;AN000;; Do source again 2/13/KK
+ cmpsb ;AN000;; First byte 2/13/KK
+ JNZ PopRet ;AN000;; Strings dif 2/13/KK
+ cmpsb ;AN000;; Second byte of kanji char 2/13/KK
+ JNZ PopRet ;AN000;; Strings dif 2/13/KK
+ mov al,byte ptr [SI-1] ;AN000;; Need last byte in AL 2/13/KK
+ jmp short Tend ;AN000;
+notkanj1: ;AN000;; 2/13/KK
+ ENDIF ;AN000;
+ invoke UCase ; convert to upper case
+ Invoke PathChrCmp ; convert / to \
+ MOV AH,AL
+ MOV AL,ES:[DI]
+ INC DI
+ invoke UCase ; convert to upper case
+ Invoke PathChrCmp ; convert / to \
+ CMP AH,AL
+ JNZ PopRet ; Strings dif
+Tend:
+ OR AL,AL
+ JNZ Cmplp ; More string
+PopRet:
+ RESTORE <AX,DI,SI>
+ return
+EndProc StrCmp
+
+Break <STRCPY - copy ASCIZ string from DS:SI to ES:DI>
+;----------------------------------------------------------------------------
+;
+; Strcpy - copy an ASCIZ string from DS:SI to ES:DI and make uppercase
+; FStrcpy - copy an ASCIZ string from DS:SI to ES:DI. no modification of
+; characters.
+;
+; Inputs: DS:SI - pointer to source string
+; ES:DI - pointer to destination string
+; Outputs: ES:DI point byte after nul byte at end of dest string
+; DS:SI point byte after nul byte at end of source string
+; Registers modified: SI,DI
+;----------------------------------------------------------------------------
+
+Procedure StrCpy,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <AX>
+CPYLoop:
+ LODSB
+ IFDEF DBCS ;AN000;
+ invoke testkanj ;AN000;; 2/13/KK
+ jz notkanj2 ;AN000;; 2/13/KK
+ STOSB ;AN000;; 2/13/KK
+ LODSB ;AN000;; 2/13/KK
+ STOSB ;AN000;; 2/13/KK
+ jmp short CPYLoop ;AN000;; 3/31/KK
+
+notkanj2: ;AN000;; 2/13/KK
+ ENDIF ;AN000;
+ invoke UCase ; convert to upper case
+ Invoke PathChrCmp ; convert / to \
+ STOSB
+Tend2:
+ OR AL,AL
+ JNZ CPYLoop
+ RESTORE <AX>
+ return
+EndProc StrCpy
+
+;----------------------------------------------------------------------------
+; Procedure Name : FStrCpy
+;----------------------------------------------------------------------------
+
+Procedure FStrCpy,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <AX>
+FCPYLoop:
+ LODSB
+ STOSB
+ OR AL,AL
+ JNZ FCPYLoop
+ RESTORE <AX>
+ return
+EndProc FStrCpy
+
+ Break <StrLen - compute length of string ES:DI>
+
+;** StrLen - Compute Length of String
+;
+; StrLen computes the length of a string, including the trailing 00
+;
+; ENTRY (es:di) = address of string
+; EXIT (cx) = size of string
+; USES cx, flags
+
+Procedure StrLen,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ SAVE <di, ax>
+ MOV CX,-1
+ XOR AL,AL
+ REPNE SCASB
+ NOT CX
+ RESTORE <ax, di>
+ return
+
+EndProc StrLen
+
+
+;** DStrLen - Compute Length of String
+;
+; ENTRY (ds:si) = address of string
+; EXIT (cx) = size of string, including trailing NUL
+; USES cx, flags
+
+Procedure DStrLen,NEAR ; BUGBUG - this guy is a pig, who uses him?
+ CALL XCHGP
+ CALL StrLen
+ CALL XCHGP
+ return
+EndProc DStrLen
+
+
+ Break <XCHGP - exchange source and destination pointers>
+
+;** XCHGP - Exchange Pointers
+;
+; XCHGP exchanges (DS:SI) and (ES:DI)
+;
+; ENTRY none
+; EXIT pairs exchanged
+; USES SI, DI, DS, ES
+
+Procedure XCHGP,NEAR
+
+ SAVE <DS,ES>
+ RESTORE <DS,ES>
+ XCHG SI,DI
+ return
+
+EndProc XCHGP
+
+
+Break <Idle - wait for a specified amount of time>
+;----------------------------------------------------------------------------
+;
+; Idle - when retrying an operation due to a lock/sharing violation, we spin
+; until RetryLoop is exhausted.
+;
+; Inputs: RetryLoop is the number of times we spin
+; Outputs: Wait
+; Registers modified: none
+;----------------------------------------------------------------------------
+Procedure Idle,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+;hkn; SS override
+ cmp fSharing,0
+ retnz
+ SAVE <CX>
+
+;hkn; SS override
+ MOV CX,RetryLoop
+ JCXZ Idle3
+Idle1: PUSH CX
+ XOR CX,CX
+Idle2: LOOP Idle2
+ POP CX
+ LOOP Idle1
+Idle3: RESTORE <CX>
+ return
+EndProc Idle
+
+Break <TableDispatch - dispatch to a table>
+;----------------------------------------------------------------------------
+;
+; TableDispatch - given a table and an index, jmp to the approptiate
+; routine. Preserve all input registers to the routine.
+;
+; Inputs: Push return address
+; Push Table address
+; Push index (byte)
+; Outputs: appropriate routine gets jumped to.
+; return indicates invalid index
+; Registers modified: none.
+;----------------------------------------------------------------------------
+TableFrame STRUC
+OldBP DW ?
+OldRet DW ?
+Index DB ?
+Pad DB ?
+Tab DW ?
+NewRet DW ?
+TableFrame ENDS
+
+procedure TableDispatch,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ PUSH BP
+ MOV BP,SP
+ PUSH BX ; save BX
+ MOV BX,[BP.Tab] ; get pointer to table
+ MOV BL,CS:[BX] ; maximum index
+ CMP [BP.Index],BL ; table error?
+ JAE TableError ; yes
+ MOV BL,[BP.Index] ; get desired table index
+ XOR BH,BH ; convert to word
+ SHL BX,1 ; convert to word pointer
+ INC BX ; point past first length byte
+ ADD BX,[BP.Tab] ; get real offset
+ MOV BX,CS:[BX] ; get contents of table entry
+ MOV [BP.Tab],BX ; put table entry into return address
+ POP BX ; restore BX
+ POP BP ; restore BP
+ ADD SP,4 ; clean off Index and our return addr
+ return ; do operation
+TableError:
+ POP BX ; restore BX
+ POP BP ; restore BP
+ RET 6 ; clean off Index, Table and RetAddr
+EndProc TableDispatch
+
+Break <TestNet - determine if a CDS is for the network>
+;----------------------------------------------------------------------------
+;
+; TestNet - examine CDS pointed to by ThisCDS and see if it indicates a
+; network CDS. This will handle NULL cds also.
+;
+; Inputs: ThisCDS points to CDS or NULL
+; Outputs: ES:DI = ThisCDS
+; carry Set => network
+; carry Clear => local
+; Registers modified: none.
+;----------------------------------------------------------------------------
+
+Procedure TestNet,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+ LES DI,ThisCDS
+ assume es:NOTHING
+
+ CMP DI,-1
+ JZ CMCRet ; UNC? carry is clear
+ TESTB ES:[DI].curdir_flags,curdir_isnet
+ JNZ CMCret ; jump has carry clear
+ return ; carry is clear
+CMCRet: CMC
+ return
+
+EndProc TestNet
+
+Break <IsSFTNet - see if an sft is for the network>
+;----------------------------------------------------------------------------
+;
+; IsSFTNet - examine SF pointed to by ES:DI and see if it indicates a
+; network file.
+;
+; Inputs: ES:DI point to SFT
+; Outputs: Zero set if not network sft
+; zero reset otherwise
+; Carry CLEAR!!!
+; Registers modified: none.
+;----------------------------------------------------------------------------
+
+Procedure IsSFTNet,NEAR
+
+ ASSUME CS:DOSCODE,SS:NOTHING
+ TESTB ES:[DI].sf_flags,sf_isnet
+ return
+
+EndProc IsSFTNet
+
+Break <FastInit - Initialize FastTable entries >
+;----------------------------------------------------------------------------
+; DOS 4.00 2/9/87
+; FastInit - initialize the FASTXXX routine entry
+; in the FastTable
+;
+; Inputs: BX = FASTXXX ID ( 1=fastopen )
+; DS:SI = address of FASTXXX routine entry
+; SI = -1 for query only
+; Outputs: Carry flag clear, if success
+; Carry flag set, if failure
+;
+;
+;----------------------------------------------------------------------------
+
+Procedure FastInit,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+;hkn; set up es to dosdataseg.
+
+ push es
+ getdseg <es> ; es -> dosdata
+
+;hkn; FastTable is in DOSDATA
+ MOV DI,OFFSET DOSDATA:FastTable + 2 ;AN000;FO. points to fastxxx entry
+ DEC BX ;AN000;FO.;; decrement index
+ MOV DX,BX ;AN000;FO.;; save bx
+ SHL BX,1 ;AN000;FO.;; times 4 , each entry is DWORD
+ SHL BX,1 ;AN000;FO.
+ ADD DI,BX ;AN000;FO. index to the entry
+ MOV AX,WORD PTR ES:[DI+2] ;AN000;FO. get entry segment
+fcheck: ;AN000;
+ MOV CX,CS ;AN000;FO.;; get DOS segment
+ CMP AX,CX ;AN000;FO.;; first time installed ?
+ JZ ok_install ;AN000;FO.;; yes
+ OR AX,AX ;AN000;FO.;
+ JZ ok_install ;AN000;FO.;
+ STC ;AN000;FO.;; already installed !
+ JMP SHORT FSret ;AN000;FO. set carry
+ok_install: ;AN000;
+ CMP SI,-1 ;AN000;FO.; Query only ?
+ JZ FSret ;AN000;FO.; yes
+ MOV CX,DS ;AN000;FO.; get FASTXXX entry segment
+ MOV WORD PTR ES:[DI+2],CX ;AN000;FO.; initialize routine entry
+ MOV WORD PTR ES:[DI],SI ;AN000;FO.; initialize routine offset
+
+;hkn; FastFlg moved to DOSDATA
+ MOV DI,OFFSET DOSDATA:FastFlg ;AN000;FO.; get addr of FASTXXX flags
+ ADD DI,DX ;AN000;FO.; index to a FASTXXX flag
+ OR byte ptr ES:[DI],Fast_yes ;AN000;FO.; indicate installed
+
+FSret: ;AN000;
+ pop es
+ return ;AN000;FO.
+EndProc FastInit ;AN000;FO.
+
+ Break <FastRet - initial routine in FastOpenTable >
+
+;----------------------------------------------------------------------------
+; DOS 3.3 6/10/86
+; FastRet - indicate FASTXXXX not in memory
+;
+; Inputs: None
+; Outputs: AX = -1 and carry flag set
+;
+; Registers modified: none.
+;----------------------------------------------------------------------------
+
+Procedure FastRet,FAR
+ STC
+ sbb ax,ax ; (ax) = -1, 'C' set
+ RET
+EndProc FastRet
+
+Break <NLS_OPEN - do $open for NLSFUNC >
+;----------------------------------------------------------------------------
+; DOS 3.3 6/10/86
+; NLS_OPEN - call $OPEN for NLSFUNC
+;
+; Inputs: Same input as $OPEN except CL = mode
+; Outputs: same output as $OPEN
+;
+;----------------------------------------------------------------------------
+
+;hkn; NOTE! SS MUST HAVE BEEN SET UP TO DOSDATA BY THE TIME THESE
+;hkn; NLS FUNCTIONS ARE CALLED!!! THERE FORE WE WILL USE SS OVERRIDES
+;hkn; IN ORDER TO ACCESS DOS DATA VARIABLES!
+
+Procedure NLS_OPEN,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+; MOV BL,[CPSWFLAG] ; disable code page matching logic
+; MOV [CPSWFLAG],0
+; PUSH BX ; save current state
+
+ MOV AL,CL ; set up correct interface for $OPEN
+ invoke $OPEN
+
+ ; POP BX ; restore current state
+ ; MOV [CPSWFLAG],BL
+ RET
+EndProc NLS_OPEN
+
+Break <NLS_LSEEK - do $LSEEK for NLSFUNC >
+;----------------------------------------------------------------------------
+; DOS 3.3 6/10/86
+; NLS_LSEEK - call $LSEEK for NLSFUNC
+;
+; Inputs: BP = open mode
+; Outputs: same output as $LSEEK
+;
+;----------------------------------------------------------------------------
+
+Procedure NLS_LSEEK,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ PUSH ss:[user_SP] ; save user stack
+ PUSH ss:[user_SS]
+ CALL Fake_User_Stack
+ MOV AX,BP ; set up correct interface for $LSEEK
+ invoke $LSEEK
+ POP ss:[user_SS] ; restore user stack
+ POP ss:[user_SP]
+ RET
+EndProc NLS_LSEEK
+
+
+Break <Fake_User_Stack - save user stack >
+
+;----------------------------------------------------------------------------
+; DOS 3.3 6/10/86
+; Fake_User_Stack - save user stack pointer
+;
+;----------------------------------------------------------------------------
+
+Procedure Fake_User_Stack,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ MOV AX,ss:[User_SP_2F] ; replace with INT 2F stack
+ MOV ss:[user_SP],AX
+
+;hkn; MOV AX,CS
+
+ mov ax, ss
+ MOV ss:[user_SS],AX ; DOSGROUP
+
+ RET
+EndProc Fake_User_Stack
+
+;
+Break <GetDevList - get device header list pointer>
+
+;----------------------------------------------------------------------------
+; DOS 3.3 7/25/86
+; GetDevList - get device header list pointer
+;
+; Output: AX:BX points to the device header list
+;----------------------------------------------------------------------------
+
+Procedure GetDevList,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV SI,OFFSET DOSDATA:SysInitTable
+
+;hkn; set up ds to point to DOSDATA
+ getdseg <ds> ; ds -> dosdata
+
+ LDS SI,[SI.SYSI_InitVars]
+
+ MOV AX,WORD PTR DS:[SI.SYSI_DEV]
+ MOV BX,WORD PTR DS:[SI.SYSI_DEV+2]
+
+ RET
+EndProc GetDevList
+
+Break <NLS_IOCTL - do $IOCTL for NLSFUNC >
+;----------------------------------------------------------------------------
+; DOS 3.3 7/25/86
+; NLS_IOCTL - call $IOCTL for NLSFUNC
+;
+; Inputs: BP = function code 0CH
+; Outputs: same output as generic $IOCTL
+;
+;----------------------------------------------------------------------------
+
+Procedure NLS_IOCTL,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ PUSH ss:[user_SP] ; save user stack
+ PUSH ss:[user_SS]
+ CALL Fake_User_Stack
+ MOV AX,BP ; set up correct interface for $LSEEK
+ invoke $IOCTL
+ POP ss:[user_SS] ; restore user stack
+ POP ss:[user_SP]
+ RET
+EndProc NLS_IOCTL
+
+Break <NLS_GETEXT- get extended error for NLSFUNC>
+;----------------------------------------------------------------------------
+; DOS 3.3 7/25/86
+; NLS_GETEXT -
+;
+; Inputs: none
+; Outputs: AX = extended error
+;
+;----------------------------------------------------------------------------
+
+Procedure NLS_GETEXT,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ MOV AX,SS:[EXTERR] ; return extended error
+ RET
+
+EndProc NLS_GETEXT
+
+Break <MSG_RETRIEVAL- get beginning addr of system and parser messages>
+;----------------------------------------------------------------------------
+; DOS 4.00
+;
+; Inputs: DL=0 get extended error message addr
+; =1 set extended error message addr
+; =2 get parser error message addr
+; =3 set parser error message addr
+; =4 get critical error message addr
+; =5 set critical error message addr
+; =6 get file system error message addr
+; =7 set file system error message addr
+; =8 get address for code reduction
+; =9 set address for code reduction
+; Function: get/set message address
+; Outputs: ES:DI points to addr when get
+;----------------------------------------------------------------------------
+
+Procedure MSG_RETRIEVAL,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+
+;; NOTE: This function lives in command.com resident code now.
+;; If the int 2F ever gets this far, we'll return registers
+;; unchanged, which produces the same result as before, if
+;; command.com wasn't present (and therefore no messages available).
+;;
+;; I didn't point the entry in the 2F table to No_Op because
+;; No_Op zeroes AL.
+;;
+;;;hkn; set up ds to point to DOSDATA
+;; push ds
+;; getdseg <ds> ; ds -> dosdata
+;;
+;; PUSH AX ;AN000;;MS. save regs
+;; PUSH SI ;AN000;;MS. save regs
+;; MOV AX,DX ;AN000;;MS.
+;; MOV SI,OFFSET DOSDATA:MSG_EXTERROR ;AN000;;MS.
+;; test AL,1 ;AN000;;MS. get ?
+;; JZ toget ;AN000;;MS. yes
+;; DEC AL ;AN000;;MS.
+;;toget: ;AN000;
+;; SHL AL,1 ;AN000;;MS. times 2
+;; XOR AH,AH ;AN000;;MS.
+;; ADD SI,AX ;AN000;;MS. position to the entry
+;; test DL,1 ;AN000;;MS. get ?
+;; JZ getget ;AN000;;MS. yes
+;; MOV WORD PTR DS:[SI],DI ;AN000;;MS. set MSG
+;; MOV WORD PTR DS:[SI+2],ES ;AN000;;MS. address to ES:DI
+;; JMP SHORT MSGret ;AN000;;MS. exit
+;;getget: ;AN000;
+;; LES DI,DWORD PTR DS:[SI] ;AN000;;MS. get msg addr
+;;MSGret: ;AN000;
+;; POP SI ;AN000;;MS.
+;; POP AX ;AN000;;MS.
+;;
+;; pop ds
+ return ;AN000;;MS. exit
+
+EndProc MSG_RETRIEVAL ;AN000;
+
+
+;***Break <Fake_version - set/reset version flag>
+;***;----------------------------------------------------------------------------
+;***;
+;***; Inputs: DL=0 current version number
+;***; <>0 special version number
+;***; Function: set special version number
+;***; Outputs: version number is changed
+;***;
+;***;----------------------------------------------------------------------------
+;***
+;***Procedure Fake_version,NEAR
+;*** ASSUME CS:DOSCODE,SS:NOTHING
+;***
+;***;hkn; set up ds to point to DOSDATA
+;*** push ds
+;*** getdseg <ds> ; ds -> dosdata
+;*** MOV [Special_version],DX ;AN006;MS.
+;*** pop ds
+;*** return ;AN006;;MS. exit
+;***
+;***EndProc Fake_version ;AN006;;MS.
+
+
+DOSCODE ENDS
+ END
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/mscode.asm b/private/mvdm/dos/v86/doskrnl/dos/mscode.asm
new file mode 100644
index 000000000..e609c66d9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/mscode.asm
@@ -0,0 +1,1428 @@
+ TITLE MISC DOS ROUTINES - Int 25 and 26 handlers and other
+ NAME IBMCODE
+
+;** MSCODE.ASM - System Call Dispatch Code
+;
+; Revision History
+; ================
+; Sudeepb 14-Mar-1991 Ported for NT DOSEm
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include mssw.asm
+ .cref
+ .list
+
+;** MSCODE.ASM -- MSDOS code
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dossym.inc
+ include devsym.inc
+ include dosseg.inc
+ include fastopen.inc
+ include fastxxxx.inc
+ include mult.inc
+ include vector.inc
+ include curdir.inc
+ include mi.inc
+
+ include win386.inc ;Win386 constants
+ include syscall.inc ;M018
+ include dossvc.inc ;M018
+ include bop.inc
+
+ .cref
+ .list
+
+AsmVars <Debug>
+
+ I_need InDos,BYTE ; TRUE => we are in dos, no interrupt
+ I_need OpenBuf,128 ; temp name buffer
+ I_need ExtErr,WORD ; extended error code
+ I_need AbsRdWr_SS,WORD ; stack segment from user M013
+ I_need AbsRdWr_SP,WORD ; stack pointer from user M013
+ I_need DskStack,BYTE ; stack segment inside DOS
+ I_need ThisCDS,DWORD ; Currently referenced CDS pointer
+ I_need ThisDPB,DWORD ; Currently referenced DPB pointer
+ I_need Err_Table_21 ; allowed return map table for errors
+ I_need FailErr,BYTE ; TRUE => system call is being failed
+ I_need ExtErr_Action,BYTE ; recommended action
+ I_need ExtErr_Class,BYTE ; error classification
+ I_need ExtErr_Locus,BYTE ; error location
+ I_need User_In_AX,WORD ; initial input user AX
+ I_need HIGH_SECTOR,WORD ; >32mb
+ I_need AbsDskErr,WORD ; >32mb
+ I_need FastOpenFlg,BYTE ;
+
+
+ I_need CURSC_DRIVE,BYTE ;
+ I_need TEMPSEG,WORD ; hkn; used to store ds temporarily
+;
+;These needed for code to flush buffers when doing absolute writes(int 26h)
+;added by SR - 3/25/89
+;
+ I_need FIRST_BUFF_ADDR,WORD ;DOS 4.0
+ I_need SC_CACHE_COUNT,WORD ;DOS 4.0
+ I_need SC_DRIVE,BYTE ;DOS 4.0
+
+;
+; SR;
+; Needed for WIN386 support
+;
+ I_need IsWin386,byte ; flag indicating Win386 presence
+ I_need Win386_Info,byte ; DOS instance table for Win386
+
+;
+; M001; New table for WIN386 giving offsets of some DOS vars
+;
+ I_need Win386_DOSVars ; Table of DOS offsets ; M001
+ I_need Redir_Patch ; Crit section flag ; M002
+
+;
+; Win386 2.xx instance table
+;
+ I_need OldInstanceJunk
+
+ I_need BootDrive,byte ; M018
+ I_need VxDpath, byte ; M018
+
+
+ I_need TEMP_VAR,WORD ; M039
+ I_need TEMP_VAR2,WORD ; M039
+
+ I_need CurrentPDB,WORD ; M044
+ I_need WinoldPatch1,BYTE ; M044
+ I_need WinoldPatch2,BYTE ; M044
+
+ I_need UmbSave1,BYTE ; M062
+ I_need UmbSave2,BYTE ; M062
+ I_need UmbSaveFlag,BYTE ; M062
+
+ I_need umb_head,WORD
+
+ I_need Dos_Flag,BYTE ; M066
+
+;
+; Include bios data segment declaration. Used for accessing DOS data segment
+; at 70:3 & bios int 2F entry point at 70:5
+;
+
+BData segment at 70H ; M023
+
+ extrn bios_i2f:far ; M023
+
+BData ends ; M023
+
+
+DOSCODE SEGMENT
+ ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ extrn FOO:WORD ; return address for dos 2f dispatch
+ extrn DTAB:WORD ; dos 2f dispatch table
+ extrn I21_Map_E_Tab:BYTE ; mapping extended error table
+
+ extrn NoVxDErrMsg:BYTE ; no VxD error message ;M018
+ extrn VXDMESLEN:ABS ; length of above message ;M018
+
+ extrn DosDseg:word
+
+
+BREAK <NullDev -- Driver for null device>
+
+
+BREAK <AbsDRD, AbsDWRT -- INT int_disk_read, int_disk_write handlers>
+
+Public MSC001S,MSC001E
+MSC001S label byte
+ IF IBM
+; Codes returned by BIOS
+ERRIN:
+ DB 2 ; NO RESPONSE
+ DB 6 ; SEEK FAILURE
+ DB 12 ; GENERAL ERROR
+ DB 4 ; BAD CRC
+ DB 8 ; SECTOR NOT FOUND
+ DB 0 ; WRITE ATTEMPT ON WRITE-PROTECT DISK
+ERROUT:
+; DISK ERRORS RETURNED FROM INT 25 and 26
+ DB 80H ; NO RESPONSE
+ DB 40H ; Seek failure
+ DB 2 ; Address Mark not found
+ DB 10H ; BAD CRC
+ DB 4 ; SECTOR NOT FOUND
+ DB 3 ; WRITE ATTEMPT TO WRITE-PROTECT DISK
+
+NUMERR EQU $-ERROUT
+ ENDIF
+MSC001E label byte
+
+;---330------------------------------------------------------------------------
+;
+; Procedure Name : ABSDRD
+;
+; Interrupt 25 handler. Performs absolute disk read.
+; Inputs: AL - 0-based drive number
+; DS:BX point to destination buffer
+; CX number of logical sectors to read
+; DX starting logical sector number (0-based)
+; Outputs: Original flags still on stack
+; Carry set
+; AH error from BIOS
+; AL same as low byte of DI from INT 24
+;
+;---------------------------------------------------------------------------
+
+procedure ABSDRD,FAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ invoke DOCLI
+
+; set up ds to point to DOSDATA
+
+ push ax ; preserve AX value
+ mov ax, ds ; store DS value in AX
+ getdseg <ds>
+ mov [TEMPSEG], ax ; store DS value in TEMPSEG
+ pop ax ; restore AX value
+
+ ;
+ ; M072:
+ ; We shall save es on the user stack here. We need to use ES in
+ ; order to access the DOSDATA variables AbsRdWr_SS/SP at exit
+ ; time in order to restore the user stack.
+ ;
+
+ push es ; M072
+
+ MOV [AbsRdWr_SS],SS ; M013
+ MOV [AbsRdWr_SP],SP ; M013
+
+ PUSH CS
+ POP SS
+
+;
+; set up ss to point to DOSDATA
+;
+; NOTE! Due to an obscure bug in the 80286, you cannot use the ROMDOS
+; version of the getdseg macro with the SS register! An interrupt will
+; sneak through.
+
+ifndef ROMDOS
+ getdseg <ss> ; cli in entry of routine
+else
+ mov ds, cs:[BioDataSeg]
+ assume ds:bdata
+
+ mov ss, ds:[DosDataSg]
+ assume ss:DOSDATA
+
+endif ; ROMDOS
+
+ MOV SP,OFFSET DOSDATA:DSKSTACK
+
+ ; SS override
+ mov ds, [TEMPSEG] ; restore DS value
+ assume ds:nothing
+
+ ; use macro
+ Save_World ;>32mb save all regs
+
+ PUSH ES
+;;; CALL AbsSetup
+;;; JC ILEAVE
+ ;M022 conditional removed here
+ ;
+ ; Here is a gross temporary fix to get around a serious design flaw in
+ ; the secondary cache. The secondary cache does not check for media
+ ; changed (it should). Hence, you can change disks, do an absolute
+ ; read, and get data from the previous disk. To get around this,
+ ; we just won't use the secondary cache for absolute disk reads.
+ ; -mw 8/5/88
+
+;; EnterCrit critDisk
+;; MOV [CURSC_DRIVE],-1 ; invalidate SC ;AN000;
+;; LeaveCrit critDisk
+;;;;;; invoke DSKREAD
+
+ SVC SVC_DEMABSDRD
+;M039
+;; jnz ERR_LEAVE ;Jump if read unsuccessful.
+ jc ERR_LEAVE
+;; mov cx,di
+ mov WORD PTR [TEMP_VAR2],ds
+ mov WORD PTR [TEMP_VAR],bx
+
+; CX = # of contiguous sectors read. (These constitute a block of
+; sectors, also termed an "Extent".)
+; [HIGH_SECTOR]:DX = physical sector # of first sector in extent.
+; [TEMP_VAR2]:[TEMP_VAR] = Transfer address (destination data address).
+; ES:BP -> Drive Parameter Block (DPB).
+;
+; The Buffer Queue must now be scanned: the contents of any dirty
+; buffers must be "read" into the transfer memory block, so that the
+; transfer memory reflects the most recent data.
+;;;;
+;;;; invoke DskRdBufScan ;This trashes DS, but don't care.
+ jmp short ILEAVE
+;M039
+
+TLEAVE:
+; JZ ILEAVE
+ jnc ILEAVE
+ERR_LEAVE: ;M039
+ IF IBM
+ PUSH ES
+ PUSH CS
+ POP ES
+ XOR AH,AH ; Nul error code
+ MOV CX,NUMERR ; Number of possible error conditions
+
+ ; ERRIN is defined in DOSCODE
+ MOV DI,OFFSET DOSCODE:ERRIN ; Point to error conditions
+
+ REPNE SCASB
+ JNZ LEAVECODE ; Not found
+ MOV AH,ES:[DI+NUMERR-1] ; Get translation
+LEAVECODE:
+ POP ES
+ ENDIF
+ ; SS override
+ MOV AbsDskErr,AX ;>32mb save error
+ STC
+ILEAVE:
+ POP ES
+ ;use macro
+ Restore_World
+
+ invoke DOCLI
+
+ MOV AX,AbsDskErr ;>32mb restore error;AN000;
+
+; SS override for INDOS, AbsRdWr_sp & AbsRdWr_ss ; M013
+ DEC INDOS
+
+ push ss ; M072 - Start
+ pop es ; es - dosdata
+ mov ss, es:[AbsRdWr_ss] ; M013
+ mov sp, es:[AbsRdWr_sp] ; M013
+
+;; mov sp, [AbsRdWr_sp] ; M013
+;; mov ss, [AbsRdWr_ss] ; M013
+ assume ss:nothing
+
+ pop es ; Note es was saved on user
+ ; stack at entry
+ ; M072 - End
+
+ invoke DOSTI
+ RET ; This must not be a RETURN
+
+EndProc ABSDRD
+;--------------------------------------------------------------------------
+;
+; Procedure Name : ABSDWRT
+;
+; Interrupt 26 handler. Performs absolute disk write.
+; Inputs: AL - 0-based drive number
+; DS:BX point to source buffer
+; CX number of logical sectors to write
+; DX starting logical sector number (0-based)
+; Outputs: Original flags still on stack
+; Carry set
+; AH error from BIOS
+; AL same as low byte of DI from INT 24
+;
+; 10-Aug-1992 Jonle , ALWAYS returns ERROR_I24_BAD_UNIT as we
+; don't support direct disk access
+;
+;---------------------------------------------------------------------------
+
+procedure ABSDWRT,FAR
+ ASSUME SS:NOTHING
+
+ invoke DOCLI
+
+; set up ds to point to DOSDATA
+
+ push ax
+ mov ax, ds
+ getdseg <ds>
+ mov [TEMPSEG], ax
+ pop ax
+
+
+ ; M072:
+ ; We shall save es on the user stack here. We need to use ES in
+ ; order to access the DOSDATA variables AbsRdWr_SS/SP at exit
+ ; time in order to restore the user stack.
+ ;
+
+ push es ; M072
+
+ MOV [AbsRdWr_SS],SS ; M013
+ MOV [AbsRdWr_SP],SP ; M013
+
+ PUSH CS
+ POP SS
+
+ ;
+ ; set up ss to point to DOSDATA
+ ;
+ ; NOTE! Due to an obscure bug in the 80286, you cannot use the
+ ; ROMDOS version of the getdseg macro with the SS register!
+ ; An interrupt will sneak through.
+ ;
+
+ifndef ROMDOS
+ getdseg <ss> ; cli in entry of routine
+else
+ mov ds, cs:[BioDa165taSeg]
+ assume ds:bdata
+
+ mov ss, ds:[DosDataSg]
+ ASSUME SS:DOSDATA
+
+endif ; ROMDOS
+
+ MOV SP,OFFSET DOSDATA:DSKSTACK
+ ; we are now switched to DOS's disk stack
+
+ mov ds, [TEMPSEG] ; restore user's ds
+ assume ds:nothing
+
+ ; use macro
+ Save_World ;>32mb save all regs ;AN000;
+
+ PUSH ES
+;;; CALL AbsSetup
+;;; JC ILEAVE
+
+;;; EnterCrit critDisk
+
+ ; SS override
+;;; MOV [CURSC_DRIVE],-1 ; invalidate SC ;AN000;
+;;; CALL Fastxxx_Purge ; purge fatopen ;AN000;
+;;; LeaveCrit critDisk
+
+;M039
+; DS:BX = transfer address (source data address).
+; CX = # of contiguous sectors to write. (These constitute a block of
+; sectors, also termed an "Extent".)
+; [HIGH_SECTOR]:DX = physical sector # of first sector in extent.
+; ES:BP -> Drive Parameter Block (DPB).
+; [CURSC_DRIVE] = -1 (invalid drive).
+;
+; Free any buffered sectors which are in Extent; they are being over-
+; written. Note that all the above registers are preserved for
+; DSKWRITE.
+
+;;;;; push ds
+;;;;; invoke DskWrtBufPurge ;This trashes DS.
+;;;;; pop ds
+;M039
+
+;;;;; invoke DSKWRITE
+ SVC SVC_DEMABSDWRT
+ JMP TLEAVE
+
+EndProc ABSDWRT
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : GETBP
+;
+; Inputs:
+; AL = Logical unit number (A = 0)
+; Function:
+; Find Drive Parameter Block
+; Outputs:
+; ES:BP points to DPB
+; [THISDPB] = ES:BP
+; Carry set if unit number bad or unit is a NET device.
+; Later case sets extended error error_I24_not_supported
+; No other registers altered
+;
+;----------------------------------------------------------------------------
+
+if 0
+Procedure GETBP,NEAR
+ DOSAssume <DS>,"GetBP"
+
+ PUSH AX
+ ADD AL,1 ; No increment; need carry flag
+ JC SkipGet
+ invoke GetThisDrv
+ JNC SkipGet ;PM. good drive ;AN000;
+ XOR AH,AH ;DCR. ax= error code ;AN000;
+ CMP AX,error_not_dos_disk ;DCR. is unknown media ? ;AN000;
+ JZ SkipGet ;DCR. yes, let it go ;AN000;
+ STC ;DCR. ;AN000;
+ MOV ExtErr,AX ;PM. invalid drive or Non DOS drive ;AN000;
+ mov AbsDskErr, 201h
+SkipGet:
+ POP AX
+ retc
+ LES BP,[THISCDS]
+ TEST ES:[BP.curdir_flags],curdir_isnet ; Clears carry
+ JZ GETBP_CDS
+ MOV ExtErr,error_not_supported
+ STC
+ return
+
+GETBP_CDS:
+ LES BP,ES:[BP.curdir_devptr]
+
+entry GOTDPB
+ DOSAssume <DS>,"GotDPB"
+
+; Load THISDPB from ES:BP
+
+ MOV WORD PTR [THISDPB],BP
+ MOV WORD PTR [THISDPB+2],ES
+ return
+EndProc GetBP
+endif
+
+BREAK <SYS_RET_OK SYS_RET_ERR CAL_LK ETAB_LK set system call returns>
+
+ASSUME SS:DOSDATA
+;----------------------------------------------------------------------------
+;
+; Procedure Name : SYS_RETURN
+;
+; These are the general system call exit mechanisms. All internal system
+; calls will transfer (jump) to one of these at the end. Their sole purpose
+; is to set the user's flags and set his AX register for return.
+;
+;---------------------------------------------------------------------------
+
+procedure SYS_RETURN,NEAR
+entry SYS_RET_OK
+ invoke get_user_stack
+ AND [SI.user_F],NOT f_Carry ; turn off user's carry flag
+ JMP SHORT DO_RET ; carry is now clear
+
+entry SYS_RET_ERR
+ XOR AH,AH ; hack to allow for smaller error rets
+ invoke ETAB_LK ; Make sure code is OK, EXTERR gets set
+ CALL ErrorMap
+entry From_GetSet
+ invoke get_user_stack
+ OR [SI.user_F],f_Carry ; signal carry to user
+ STC ; also, signal internal error
+DO_RET:
+ MOV [SI.user_AX],AX ; Really only sets AH
+ return
+
+ entry FCB_RET_OK
+ entry NO_OP ; obsolete system calls dispatch to here
+ XOR AL,AL
+ return
+
+ entry FCB_RET_ERR
+ XOR AH,AH
+ mov exterr,AX
+ CALL ErrorMap
+ MOV AL,-1
+ return
+
+ entry errorMap
+ PUSH SI
+
+ ; ERR_TABLE_21 is now in DOSDATA
+ MOV SI,OFFSET DOSDATA:ERR_TABLE_21
+
+ ; SS override for FAILERR and EXTERR
+ CMP [FAILERR],0 ; Check for SPECIAL case.
+ JZ EXTENDED_NORMAL ; All is OK.
+ MOV [EXTERR],error_FAIL_I24 ; Ooops, this is the REAL reason
+EXTENDED_NORMAL:
+ invoke CAL_LK ; Set CLASS,ACTION,LOCUS for EXTERR
+ POP SI
+ return
+
+EndProc SYS_RETURN
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : CAL_LK
+;
+; Inputs:
+; SI is OFFSET in DOSDATA of CLASS,ACTION,LOCUS Table to use
+; (DS NEED not be DOSDATA)
+; [EXTERR] is set with error
+; Function:
+; Look up and set CLASS ACTION and LOCUS values for GetExtendedError
+; Outputs:
+; [EXTERR_CLASS] set
+; [EXTERR_ACTION] set
+; [EXTERR_LOCUS] set (EXCEPT on certain errors as determined by table)
+; Destroys SI, FLAGS
+;
+;--------------------------------------------------------------------------
+
+procedure CAL_LK,NEAR
+
+ PUSH DS
+ PUSH AX
+ PUSH BX
+
+;M048 Context DS ; DS:SI -> Table
+;
+; Since this function can be called thru int 2f we shall not assume that SS
+; is DOSDATA
+
+ getdseg <ds> ; M048: DS:SI -> Table
+
+ MOV BX,[EXTERR] ; Get error in BL
+TABLK1:
+ LODSB
+
+ CMP AL,0FFH
+ JZ GOT_VALS ; End of table
+ CMP AL,BL
+ JZ GOT_VALS ; Got entry
+ ADD SI,3 ; Next table entry
+ JMP TABLK1
+
+GOT_VALS:
+ LODSW ; AL is CLASS, AH is ACTION
+
+ CMP AH,0FFH
+ JZ NO_SET_ACT
+ MOV [EXTERR_ACTION],AH ; Set ACTION
+NO_SET_ACT:
+ CMP AL,0FFH
+ JZ NO_SET_CLS
+ MOV [EXTERR_CLASS],AL ; Set CLASS
+NO_SET_CLS:
+ LODSB ; Get LOCUS
+
+ CMP AL,0FFH
+ JZ NO_SET_LOC
+ MOV [EXTERR_LOCUS],AL
+NO_SET_LOC:
+ POP BX
+ POP AX
+ POP DS
+ return
+EndProc CAL_LK
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : ETAB_LK
+;
+; Inputs:
+; AX is error code
+; [USER_IN_AX] has AH value of system call involved
+; Function:
+; Make sure error code is appropriate to this call.
+; Outputs:
+; AX MAY be mapped error code
+; [EXTERR] = Input AX
+; Destroys ONLY AX and FLAGS
+;
+;---------------------------------------------------------------------------
+
+procedure ETAB_LK,NEAR
+
+ PUSH DS
+ PUSH SI
+ PUSH CX
+ PUSH BX
+
+ Context DS ; SS is DOSDATA
+ MOV [EXTERR],AX ; Set EXTERR with "real" error
+
+ ; I21_MAP_E_TAB is now in DOSCODE
+ MOV SI,OFFSET DOSCODE:I21_MAP_E_TAB
+ MOV BH,AL ; Real code to BH
+ MOV BL,BYTE PTR [USER_IN_AX + 1] ; Sys call to BL
+TABLK2:
+;hkn; LODSW
+ LODS word ptr cs:[si]
+
+ CMP AL,0FFH ; End of table?
+ JZ NOT_IN_TABLE ; Yes
+ CMP AL,BL ; Found call?
+ JZ GOT_CALL ; Yes
+ XCHG AH,AL ; Count to AL
+ XOR AH,AH ; Make word for add
+ ADD SI,AX ; Next table entry
+ JMP TABLK2
+
+NOT_IN_TABLE:
+ MOV AL,BH ; Restore original code
+ JMP SHORT NO_MAP
+
+GOT_CALL:
+ MOV CL,AH
+ XOR CH,CH ; Count of valid err codes to CX
+CHECK_CODE:
+;hkn; LODSB
+ LODS byte ptr cs:[si]
+
+ CMP AL,BH ; Code OK?
+ JZ NO_MAP ; Yes
+ LOOP CHECK_CODE
+NO_MAP:
+ XOR AH,AH ; AX is now valid code
+ POP BX
+ POP CX
+ POP SI
+ POP DS
+ return
+
+EndProc ETAB_LK
+
+BREAK <DOS 2F Handler and default NET 2F handler>
+
+IF installed
+;----------------------------------------------------------------------------
+;
+; Procedure Name : SetBad
+;
+; SetBad sets up info for bad functions
+;
+;--------------------------------------------------------------------------
+
+Procedure SetBad,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ MOV AX,error_invalid_function ; ALL NET REQUESTS get inv func
+
+; set up ds to point to DOSDATA
+
+ push ds
+ getdseg <ds>
+
+ MOV ExtErr_LOCUS,errLoc_UNK
+
+ pop ds ;hkn; restore ds
+ assume ds:nothing
+
+ STC
+ ret
+EndProc SetBad
+
+;--------------------------------------------------------------------------
+;
+; Procedure Name : BadCall
+;
+; BadCall is the initial routine for bad function calls
+;
+;--------------------------------------------------------------------------
+
+procedure BadCall,FAR
+ call SetBad
+ ret
+EndProc BadCall
+
+;--------------------------------------------------------------------------
+;
+; OKCall always sets carry to off.
+;
+;-----------------------------------------------------------------------
+
+Procedure OKCall,FAR
+
+ ASSUME CS:DOSCODE,SS:NOTHING
+ CLC
+ ret
+
+EndProc OKCall
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : INT2F
+;
+; INT 2F handler works as follows:
+; PUSH AX
+; MOV AX,multiplex:function
+; INT 2F
+; POP ...
+; The handler itself needs to make the AX available for the various routines.
+;
+;----------------------------------------------------------------------------
+
+PUBLIC Int2F
+INT2F PROC FAR
+
+INT2FNT:
+ ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+ invoke DOSTI
+ CMP AH,multNET
+ JNZ INT2FSHR
+TestInstall:
+ OR AL,AL
+ JZ Leave2F
+BadFunc:
+ CALL SetBad
+ entry Leave2F
+ RET 2 ; long return + clear flags off stack
+
+INT2FSHR:
+ ; Sudeepb 07-Aug-1992; As we dont have a true share.exe we
+ ; are putting its int2f support here.
+
+ CMP AH,multSHARE ; is this a share request
+ JNZ INT2FNLS ; no, check next
+ or al,al
+ jnz BadFunc
+ mov al,0ffh ; Indicate share is loaded
+ jmp short Leave2f
+
+INT2FNLS:
+ CMP AH,NLSFUNC ; is this a DOS 3.3 NLSFUNC request
+ JZ TestInstall ; yes check for installation
+
+INT2FDOS:
+ ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+ CMP AH,multDOS
+ JNZ check_win ;check if win386 broadcast
+ jmp DispatchDOS
+
+check_win:
+ cmp ah,multWIN386 ; Is this a broadcast from Win386?
+ je Win386_Msg
+
+ ;
+ ; M044
+ ; Check if the callout is from Winoldap indicating swapping out or in
+ ; of Windows. If so, do special action of going and saving last para
+ ; of the Windows memory arena which Winoldap does not save due to a
+ ; bug
+ ;
+
+ cmp ah,WINOLDAP ; from Winoldap?
+ jne next_i2f ; no, chain on
+ jmp Winold_swap ; yes, do desired action
+
+next_i2f:
+ jmp bios_i2f
+
+
+; IRET ; This assume that we are at the head
+ ; of the list
+INT2F ENDP
+
+;
+; We have received a message from Win386. There are three possible
+; messages we could get from Win386:
+;
+; Init - for this, we set the IsWin386 flag and return a pointer
+; to the Win386 startup info structure.
+; Exit - for this, we clear the IsWin386 flag.
+; DOSMGR query - for this, we need to indicate that instance data
+; has already been handled. this is indicated by setting
+; CX to a non-zero value.
+;
+
+Win386_Msg:
+
+ push ds
+
+ getdseg <DS> ; ds is DOSDATA
+
+ ;
+ ; For WIN386 2.xx instance data
+ ;
+
+ cmp al,03 ;win386 2.xx instance data call?
+ lje OldWin386Init ;yes, return instance data
+
+ cmp al, Win386_Exit ; is it an exit call?
+ lje Win386_Leaving
+ cmp al, Win386_Devcall ; is it call from DOSMGR?
+ lje Win386_Query
+ cmp al, Win386_Init ; is it an init call?
+ ljne win_nexti2f ; no, return
+
+Win386_Starting:
+ test dx, 1 ; is this really win386?
+ jz @f ; YES! go and handle it
+ jmp win_nexti2f ; NO! It's win 286 dos extender! M002
+@@:
+
+ ;
+ ; M018 -- start of block changes
+ ; The VxD needs to be loaded only for Win 3.0. If version is greater
+ ; than 030ah, we skip the VxD presence check
+ ;
+
+;M067 -- Begin changes
+; If Win 3.0 is run, the VxD ptr has been initialized. If Win 3.1 is now
+;run, it tries to unnecesarily load the VxD even though it is not needed.
+;So, we null out the VxD ptr before the check.
+;
+ mov word ptr Win386_Info.SIS_Virt_Dev_File_Ptr, 0
+ mov word ptr Win386_Info.SIS_Virt_Dev_File_Ptr+2, 0
+;
+;M067 -- End changes
+;
+
+ifdef JAPAN
+ cmp di,0300h ; version >= 300 i.e 3.10 ;M037
+else
+ cmp di,030ah ; version >= 30a i.e 3.10 ;M037
+endif
+ ljae noVxD31 ; yes, VxD not needed ;M037
+
+
+ push ax
+ push bx
+ push cx
+ push dx
+ push si
+ push di ; save regs !!dont change order!!
+
+ mov bx, [umb_head] ; M062 - Start
+ cmp bx, 0ffffh ; Q: have umbs been initialized
+ je Vxd31 ; N: continue
+ ; Y: save arena associated with
+ ; umb_head
+
+ mov [UmbSaveFlag], 1 ; indicate that we're saving
+ ; umb_arena
+ push ds
+ push es
+
+ mov ax, ds
+ mov es, ax ; es - > dosdata
+
+ mov ds, bx
+ xor si, si ; ds:si -> umb_head
+
+ cld
+
+ mov di, offset dosdata:UmbSave1
+ mov cx, 0bh
+rep movsb
+
+ mov di, offset dosdata:UmbSave2
+ mov cx, 05h
+rep movsb
+
+ pop es
+ pop ds ; M062 - End
+
+Vxd31:
+ test Dos_Flag, SUPPRESS_WINA20 ; M066
+ jz Dont_Supress ; M066
+ pop di ; M066
+ pop si ; M066
+ pop dx ; M066
+ pop cx ; M066
+ pop bx ; M066
+ pop ax ; M066
+ jmp short NoVxd31 ; M066
+
+ ;
+ ; We check here if the VxD is available in the root of the boot drive.
+ ; We do an extended open to suppress any error messages
+ ;
+Dont_Supress:
+ mov al,BootDrive
+ add al,'A' - 1 ; get drive letter
+ mov byte ptr VxDpath,al ; path is root of bootdrive
+ mov ah,EXTOPEN ; extended open
+ mov al,0 ; no extended attributes
+ mov bx,2080h ; read access, compatibility mode
+ ; no inherit, suppress crit err
+ mov cx,7 ; hidden,system,read-only attr
+ mov dx,1 ; fail if file does not exist
+ mov si,offset DOSDATA:VxDpath
+ ; path of VxD file
+ mov di,0ffffh ; no extended attributes
+
+ int 21h ; do extended open
+ pop di
+ pop si
+ pop dx
+ pop cx
+ jnc VxDthere ; we found the VxD, go ahead
+
+ ;
+ ; We could not find the VxD. Cannot let windows load. Return cx != 0
+ ; to indicate error to Windows after displaying message to user that
+ ; VxD needs to be present to run Windows in enhanced mode.
+ ;
+
+ push dx
+ push ds
+ push si
+ mov si,offset DOSCODE:NoVxDErrMsg
+ push cs
+ pop ds
+ mov cx,VXDMESLEN ;
+ mov ah,02 ; write char to console
+ cld
+vxdlp:
+ lodsb
+ xchg dl,al ; get char in dl
+ int 21h
+ loop vxdlp
+
+ pop si
+ pop ds
+ pop dx
+ pop bx
+ pop ax ;all registers restored
+ inc cx ;cx != 0 to indicate error
+ jmp win_nexti2f ;chain on
+
+VxDthere:
+ mov bx,ax
+ mov ah,CLOSE
+ int 21h ;close the file
+
+ ;
+ ; Update the VxD ptr in the instance data structure with path to VxD
+ ;
+ mov bx,offset DOSDATA:Win386_Info
+ mov word ptr [bx].SIS_Virt_Dev_File_Ptr, offset DOSDATA:VxDpath
+ mov word ptr [bx].SIS_Virt_Dev_File_Ptr+2, ds ;
+
+ pop bx
+ pop ax
+NoVxD31:
+
+ ;
+ ; M018; End of block changes
+ ;
+
+ or ds:IsWIN386,1 ; Indicate WIN386 present
+ or ds:redir_patch,1 ; Enable critical sections; M002
+
+ ; M002;
+ ; Save the previous es:bx (instance data ptr) into our instance table
+ ;
+
+ push dx ; M002
+ mov dx,bx ; M002
+ ; point ES:BX to Win386_Info ; M002
+ mov bx, offset dosdata:Win386_Info
+ mov word ptr [bx+2],dx ; M002
+ mov word ptr [bx+4],es ; M002
+ pop dx ; M002
+ push ds ; M002
+ pop es ; M002
+ jmp win_nexti2f ; M002
+
+Win386_Leaving:
+ test dx, 1 ; is this really win386?
+ ljnz win_nexti2f ; NO! It's win 286 dos extender! M002
+
+ ; M062 - Start
+ cmp ds:[UmbSaveFlag], 1 ; Q: was umb_arena saved at win start
+ ; up.
+ jne noumb ; N: not saved
+ mov ds:[UmbSaveFlag], 0 ; Y: clear UmbSaveFlag and restore
+ ; previously saved umb_head
+ push ax
+ push es
+ push cx
+ push si
+ push di
+
+ mov ax, [umb_head]
+ mov es, ax
+ xor di, di ; es:di -> umb_head
+
+ cld
+
+ mov si, offset dosdata:UmbSave1
+ mov cx, 0bh
+rep movsb
+ mov si, offset dosdata:UmbSave2
+ mov cx, 05h
+rep movsb
+
+ pop di
+ pop si
+ pop cx
+ pop es
+ pop ax
+noumb: ; M062 - End
+
+ and ds:[IsWIN386],0 ; Win386 is gone
+ and ds:redir_patch,0 ; Disable critical sections ; M002
+ jmp short win_nexti2f
+
+Win386_Query:
+ cmp bx, Win386_DOSMGR ; is this from DOSMGR?
+ jne win_nexti2f ; no, ignore it & chain to next
+ or cx, cx ; is it an instance query?
+ jne dosmgr_func ; no, some DOSMGR query
+ inc cx ; indicate that data is instanced
+
+;
+; M001; We were previously returning a null ptr in es:bx. This will not work.
+; M001; WIN386 needs a ptr to a table in es:bx with the following offsets:
+; M001;
+; M001; OFFSETS STRUC
+; M001; Major_version db ?
+; M001; Minor_version db ?
+; M001; SaveDS dw ?
+; M001; SaveBX dw ?
+; M001; Indos dw ?
+; M001; User_id dw ?
+; M001; CritPatch dw ?
+; M001; OFFSETS ENDS
+; M001;
+; M001; User_Id is the only variable really important for proper functioning
+; M001; of Win386. The other variables are used at init time to patch stuff
+; M001; out. In DOS 5.0, we do the patching ourselves. But we still need to
+; M001; pass this table because Win386 depends on this table to get the
+; M001; User_Id offset.
+; M001;
+ mov bx,offset Win386_DOSVars; M001
+ push ds ; M001
+ pop es ; es:bx points at offset table ; M001
+ jmp short PopIret ; M001
+
+ ;
+ ; Code to return Win386 2.xx instance table
+ ;
+OldWin386Init:
+ pop ax ; discard ds pushed on stack
+ mov si,offset dosdata:OldInstanceJunk
+ ; ds:si = instance table
+ mov ax, 5248h ; indicate instance data present
+ jmp next_i2f
+
+
+dosmgr_func:
+ dec cx
+ jz win386_patch ; call to patch DOS
+ dec cx
+ jz PopIret ; remove DOS patches, ignore
+ dec cx
+ jz win386_size ; get size of DOS data structures
+ dec cx
+ jz win386_inst ; instance more data
+ dec cx
+ jnz PopIret ; no functions above this
+
+ ;
+ ; Get DOS device driver size -- es:di points at device driver header
+ ; In DOS 4.x, the para before the device header contains an arena
+ ; header for the driver.
+ ;
+ mov ax,es ; ax = device header segment
+
+ ;
+ ; We check to see if we have a memory arena for this device driver.
+ ; The way to do this would be to look at the previous para to see if
+ ; it has a 'D' marking it as an arena and also see if the owner-field
+ ; in the arena is the same as the device header segment. These two
+ ; checks together should take care of all cases
+ ;
+
+ dec ax ; get arena header
+ push es
+ mov es,ax ; arena header for device driver
+
+ cmp byte ptr es:[di],'D' ; is it a device arena?
+ jnz cantsize ; no, cant size this driver
+ inc ax ; get back device header segment
+ cmp es:[di+1],ax ; owner field pointing at driver?
+ jnz cantsize ; no, not a proper arena
+
+ mov ax,es:[di+3] ; get arena size in paras
+ pop es
+
+ ;
+ ; We have to multiply by 16 to get the number of bytes in (bx:cx)
+ ; Speed is not critical and so we choose the shortest method
+ ; -- use "mul"
+ ;
+ mov bx,16
+ mul bx
+ mov cx,ax
+ mov bx,dx
+ jmp short win386_done ; return with device driver size
+cantsize:
+ pop es
+ xor ax,ax
+ xor dx,dx ; ask DOSMGR to use its methods
+ jmp short PopIret ; return
+
+win386_patch:
+
+ ;
+ ; dx contains bits marking the patches to be applied. We return
+ ; the field with all bits set to indicate that all patches have been
+ ; done
+ ;
+
+ mov bx,dx ; move patch bitfield to bx
+ jmp short win386_done ; done, return
+
+win386_size:
+
+ ;
+ ;Return the size of DOS data structures -- currently only CDS size
+ ;
+
+ test dx,1 ; check for CDS size bit
+ jz PopIret ; no, unknown structure -- return
+
+ mov cx,size CURDIR_LIST ; cx = CDS size
+ jmp short win386_done ; return with the size
+
+win386_inst:
+
+ ;
+ ; WIN386 check to see if DOS has identified the CDS,SFT and device
+ ; chain as instance data. Currently, we let the WIN386 DOSMGR handle
+ ; this by returning a status of not previously instanced. The basic
+ ; structure of these things have not changed and so the current
+ ; DOSMGR code should be able to work it out
+ ;
+ xor dx,dx ; make sure dx has a not done value
+ jmp short PopIret ; skip done indication
+
+win386_done:
+
+ mov ax,WIN_OP_DONE ;
+ mov dx,DOSMGR_OP_DONE ;
+PopIret:
+ pop ds
+ assume ds:nothing
+ iret ; return back up the chain
+
+win_nexti2f:
+ pop ds
+ assume ds:nothing
+ jmp next_i2f ; go to BIOS i2f handler
+
+;
+;End WIN386 support
+;
+
+;M044; Start of changes
+; Winoldap has a bug in that its calculations for the Windows memory image
+; to save is off by 1 para. This para can happen to be a Windows arena if the
+; DOS top of memory happens to be at an odd boundary (as is the case when
+; UMBs are present). This is because Windows builds its arenas only at even
+; para boundaries. This arena now gets trashed when Windows is swapped back
+; in leading to a crash. Winoldap issues callouts when it swaps WIndows out
+; and back in. We sit on these callouts. On the Windows swapout, we save the
+; last para of the Windows memory block and then restore this para on the
+; Windows swapin callout.
+;
+
+getwinlast proc near
+ assume ds:DOSDATA
+
+ mov si,CurrentPDB
+ dec si
+ mov es,si
+ add si,es:[3]
+ ret
+getwinlast endp
+
+winold_swap:
+ push ds
+ push es
+ push si
+ push di
+ push cx
+ getdseg <ds> ;ds = DOSDATA
+
+ cmp al,01 ;swap Windows out call
+ jne swapin ;no, check if Swap in call
+ call getwinlast
+ push ds
+ pop es
+ mov ds,si ;ds = memory arena of Windows
+ assume ds:nothing
+ xor si,si
+ mov di,offset DOSDATA:WinoldPatch1
+ mov cx,8
+ cld
+ push cx
+ rep movsb ;save first 8 bytes
+ pop cx
+ mov di,offset DOSDATA:WinoldPatch2
+ rep movsb ;save next 8 bytes
+ jmp short winold_done
+swapin:
+ cmp al,02 ;swap Windows in call?
+ jne winold_done ;no, something else, pass it on
+ assume ds:DOSDATA
+ call getwinlast
+ mov es,si
+ xor di,di
+ mov si,offset DOSDATA:WinoldPatch1
+ mov cx,8
+ cld
+ push cx
+ rep movsb ;restore first 8 bytes
+ pop cx
+ mov si,offset DOSDATA:WinoldPatch2
+ rep movsb ;restore next 8 bytes
+winold_done:
+ pop cx
+ pop di
+ pop si
+ pop es
+ pop ds
+ assume ds:nothing
+ jmp next_i2f ;chain on
+
+;
+;M044; End of changes
+;
+
+
+DispatchDOS:
+ PUSH FOO ; push return address
+ PUSH DTab ; push table address
+ PUSH AX ; push index
+ PUSH BP
+ MOV BP,SP
+; stack looks like:
+; 0 BP
+; 2 DISPATCH
+; 4 TABLE
+; 6 RETURN
+; 8 LONG-RETURN
+; c FLAGS
+; e AX
+
+ MOV AX,[BP+0Eh] ; get AX value
+ POP BP
+ Invoke TableDispatch
+ JMP BadFunc ; return indicates invalid function
+
+Procedure INT2F_etcetera,NEAR
+ entry DosGetGroup
+
+;SR; Cannot use CS now
+;
+; PUSH CS
+; POP DS
+
+ getdseg <ds>
+ return
+
+ entry DOSInstall
+ MOV AL,0FFh
+ return
+EndProc INT2F_etcetera
+
+ENDIF
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : RW32_CONVERT
+;
+;Input: same as ABSDRD and ABSDWRT
+; ES:BP -> DPB
+;Functions: convert 32bit absolute RW input parms to 16bit input parms
+;Output: carry set when CX=-1 and drive is less then 32mb
+; carry clear, parms ok
+;
+;---------------------------------------------------------------------------
+
+ifdef 0
+Procedure RW32_CONVERT,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ CMP CX,-1 ;>32mb new format ? ;AN000;
+ JZ new32format ;>32mb yes ;AN000;
+ PUSH AX ;>32mb save ax ;AN000;
+ PUSH DX ;>32mb save dx ;AN000;
+ MOV AX,ES:[BP.dpb_max_cluster] ;>32mb get max cluster # ;AN000;
+ MOV DL,ES:[BP.dpb_cluster_mask] ;>32mb ;AN000;
+ CMP DL,0FEH ;>32mb removable ? ;AN000;
+ JZ letold ;>32mb yes ;AN000;
+ INC DL ;>32mb ;AN000;
+ XOR DH,DH ;>32mb dx = sector/cluster ;AN000;
+ MUL DX ;>32mb dx:ax= max sector # ;AN000;
+ OR DX,DX ;>32mb > 32mb ? ;AN000;
+letold:
+ POP DX ;>32mb retore dx ;AN000;
+ POP AX ;>32mb restore ax ;AN000;
+ JZ old_style ;>32mb no ;AN000;
+
+ push ds
+ getdseg <ds>
+ mov AbsDskErr, 207h ;>32mb bad address mark
+ pop ds
+
+ STC ;>32mb ;AN000;
+ return ;>32mb ;AN000;
+new32format:
+
+ assume ds:nothing
+ MOV DX,WORD PTR [BX.SECTOR_RBA+2];>32mb ;AN000;
+
+ push ds ; set up ds to DOSDATA
+ getdseg <ds>
+
+ MOV [HIGH_SECTOR],DX ;>32mb ;AN000;
+
+ pop ds
+ assume ds:nothing
+
+ MOV DX,WORD PTR [BX.SECTOR_RBA] ;>32mb ;AN000;
+ MOV CX,[BX.ABS_RW_COUNT] ;>32mb ;AN000;
+ LDS BX,[BX.BUFFER_ADDR] ;>32mb ;AN000;
+old_style: ;>32mb ;AN000;
+ CLC ;>32mb ;AN000;
+ return ;>32mb ;AN000;
+EndProc RW32_CONVERT
+endif
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : Fastxxx_Purge
+;
+; Input: None
+; Functions: Purge Fastopen/ Cache Buffers
+; Output: None
+;
+;------------------------------------------------------------------------
+
+ifdef 0
+Procedure Fastxxx_Purge,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ PUSH AX ; save regs. ;AN000;
+ PUSH SI ;AN000;
+ PUSH DX ;AN000;
+
+topen:
+
+ push ds ; set up ds to DOSDATA
+ getdseg <ds>
+
+ TEST FastOpenflg,Fast_yes ; fastopen installed ? ;AN000;
+
+ pop ds
+ assume ds:nothing
+
+ JZ nofast ; no ;AN000;
+ MOV AH,FastOpen_ID ; AN000;
+dofast:
+ MOV AL,FONC_purge ; purge ;AN000;
+ MOV DL,ES:[BP.dpb_drive] ; set up drive number ;AN000;
+ invoke Fast_Dispatch ; call fastopen/seek ;AN000;
+nofast:
+ POP DX ;AN000;
+ POP SI ; restore regs ;AN000;
+ POP AX ; ;AN000;
+
+ return ; exit ;AN000;
+
+EndProc Fastxxx_Purge
+endif
+
+DOSCODE ENDS
+
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msconst.asm b/private/mvdm/dos/v86/doskrnl/dos/msconst.asm
new file mode 100644
index 000000000..7f5f3d428
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msconst.asm
@@ -0,0 +1,263 @@
+;** MSCONST.ASM
+;
+; Revision history
+; AN000 version 4.00 Jan. 1988
+; AN007 fake version check for IBMCACHE.COM
+;
+; M000 added save_ax, umb_head and start_arena for umb support
+; 7/9/90
+; M003 added umbflag for link/unlink UMB support. 7/18/90
+; M004 added PAS32_FLAG for MS PASCAL 3.2 comaptibility support
+; 7/30/90
+; M014 added CL0FATENTRY. see pack/unpack in fat.asm for usage.
+; 8/28/90
+; M044 bug #3869. Added WinoldPatch1, save area for the first
+; 8 0f 16 bytes to be saved.
+;
+; M063 added variable allocmsave for temporarily saving
+; allocmethod in msproc.asm.
+;
+; M068 support for copy protected apps. Added ChkCopyProt,
+; A20OFF_PSP and changed A20OFF_FLAG to A20OFF_COUNT
+;
+
+include mshead.asm
+
+DOSCODE SEGMENT
+ Extrn LeaveDOS:NEAR
+ Extrn BadCall:FAR, OKCall:FAR
+
+ PUBLIC BugTyp,BugLev
+if DEBUG
+ DB "BUG " ; THIS FIELD MUST BE EVEN # OF BYTES
+BugTyp DW TypSyscall
+BugLev DW LevLog
+else
+BugTyp label word
+BugLev label word
+endif
+
+include bugtyp.inc ; put this after BUGTYP definition
+
+DOSCODE ENDS
+
+Break <Initialized data and data used at DOS initialization>
+
+;
+; We need to identify the parts of the data area that are relevant to tasks
+; and those that are relevant to the system as a whole. Under 3.0, the system
+; data will be gathered with the system code. The process data under 2.x will
+; be available for swapping and under 3.0 it will be allocated per-process.
+;
+; The data that is system data will be identified by [SYSTEM] in the comments
+; describing that data item.
+;
+
+ AsmVars <Debug, Redirector, ShareF>
+
+DOSDATA SEGMENT
+
+ ORG 0
+
+;hkn; add 4 bytes to get correct offsets since jmp has been removed in START
+
+ db 4 dup (?)
+
+ EVEN
+;
+; WANGO!!! The following word is used by SHARE and REDIR to determin data
+; area compatability. This location must be incremented EACH TIME the data
+; area here gets mucked with.
+;
+; Also, do NOT change this position relative to DOSDATA:0.
+;
+Public MSCT001S,MSCT001E
+MSCT001S LABEL BYTE
+ I_am DataVersion,WORD,<1> ;AC000; [SYSTEM] version number for DOS DATA
+
+;hkn; add 8 bytes to get correct offsets since BugTyp, BugLev and "BUG " has
+;hkn; been removed to DOSCODE above
+
+;M044
+; First part of save area for saving last para of Window memory
+;
+public WinoldPatch1
+WinoldPatch1 db 8 dup (?) ;M044
+
+ I_am MYNUM,WORD,<0> ; [SYSTEM] A number that goes with MYNAME
+ I_am FCBLRU,WORD,<0> ; [SYSTEM] LRU count for FCB cache
+ I_am OpenLRU,WORD,<0> ; [SYSTEM] LRU count for FCB cache opens
+; NOTE: We include the decl of OEM_HANDLER in IBM DOS even though it is not used.
+; This allows the REDIRector to work on either IBM or MS-DOS.
+ PUBLIC OEM_HANDLER
+OEM_HANDLER DD -1 ; [SYSTEM] Pointer to OEM handler code
+; BUGBUG - who uses LeaveAddr? What if we want to rework the
+;; way that we leave DOS???? - jgl
+ I_am LeaveAddr,WORD,<<OFFSET DOSCODE:LeaveDOS>> ; [SYSTEM]
+ I_am RetryCount,WORD,<3> ; [SYSTEM] Share retries
+ I_am RetryLoop,WORD,<1> ; [SYSTEM] Share retries
+ I_am LastBuffer,DWORD,<-1,-1>; [SYSTEM] Buffer queue recency pointer
+ I_am CONTPOS,WORD ; [SYSTEM] location in buffer of next read
+ I_am arena_head,WORD ; [SYSTEM] Segment # of first arena in memory
+; The following block of data is used by SYSINIT. Do not change the order or
+; size of this block
+ PUBLIC SYSINITVAR ; [SYSTEM]
+SYSINITVAR LABEL WORD ; [SYSTEM]
+ I_am DPBHEAD,DWORD ; [SYSTEM] Pointer to head of DPB-FAT list
+ I_am sft_addr,DWORD,<<OFFSET DOSDATA:sfTabl>,?> ; [SYSTEM] Pointer to first SFT table
+ I_am BCLOCK,DWORD ; [SYSTEM] The CLOCK device
+ I_am BCON,DWORD ; [SYSTEM] Console device entry points
+ I_am MAXSEC,WORD,<128> ; [SYSTEM] Maximum allowed sector size
+ I_am BUFFHEAD,DWORD ; [SYSTEM] Pointer to head of buffer queue
+ I_am CDSADDR,DWORD ; [SYSTEM] Pointer to curdir structure table
+ I_am sftFCB,DWORD ; [SYSTEM] pointer to FCB cache table
+ I_am KeepCount,WORD ; [SYSTEM] count of FCB opens to keep
+ I_am NUMIO,BYTE ; [SYSTEM] Number of disk tables
+ I_am CDSCOUNT,BYTE ; [SYSTEM] Number of CDS structures in above
+; A fake header for the NUL device
+ I_am NULDEV,DWORD ; [SYSTEM] Link to rest of device list
+ DW DEVTYP OR ISNULL ; [SYSTEM] Null device attributes
+ dw offset dosdata:SNULDEV ; [SYSTEM] Strategy entry point
+ dw offset dosdata:INULDEV ; [SYSTEM] Interrupt entry point
+ DB "NUL " ; [SYSTEM] Name of null device
+ I_am Splices,BYTE,<0> ; [SYSTEM] TRUE => splices being done
+ I_am Special_Entries,WORD,<0>; [SYSTEM] address of specail entries ;AN000;
+ I_am UU_IFS_DOS_CALL,DWORD ; [SYSTEM] entry for IFS DOS service ;AN000;
+
+;*** I_am UU_IFS_HEADER,DWORD ; [SYSTEM] IFS header chain ;AN000;
+
+ I_am ChkCopyProt, WORD ; M068
+ I_am A20OFF_PSP, WORD ; M068
+
+ I_am BUFFERS_PARM1,WORD,<0> ; [SYSTEM] value of BUFFERS= ,m ;AN000;
+ I_am BUFFERS_PARM2,WORD,<0> ; [SYSTEM] value of BUFFERS= ,n ;AN000;
+ I_am BOOTDRIVE,BYTE ; [SYSTEM] the boot drive ;AN000;
+ I_am DDMOVE,BYTE,<0> ; [SYSTEM] 1 if we need DWORD move ;AN000;
+ I_am EXT_MEM_SIZE,WORD,<0> ; [SYSTEM] extended memory size ;AN000;
+
+ PUBLIC HASHINITVAR ; [SYSTEM] ;AN000;
+HASHINITVAR LABEL WORD ; [SYSTEM] ;AN000;
+;
+; Replaced by next two declarations
+;
+; I_am UU_BUF_HASH_PTR,DWORD ; [SYSTEM] buffer Hash table
+ ; addr
+; I_am UU_BUF_HASH_COUNT,WORD,<1> ; [SYSTEM] number of Hash
+ ; entries
+
+ I_am BufferQueue,DWORD ; [SYSTEM] Head of the buffer
+ ; Queue
+ I_am DirtyBufferCount,WORD,<0> ; [SYSTEM] Count of Dirty
+ ; buffers in the Que
+ ; BUGBUG ---- change to byte
+
+ I_am SC_CACHE_PTR,DWORD ; [SYSTEM] secondary cache
+ ; pointer
+ I_am SC_CACHE_COUNT,WORD,<0> ; [SYSTEM] secondary cache
+ ; count
+ I_am BuffInHMA,byte,<0> ; Flag to indicate that buffs
+ ; are in HMA
+ I_am LoMemBuff,dword ; Ptr to intermediate buffer
+ ; in Low mem when buffs
+ ; are in HMA
+
+;
+; All variables which have UU_ as prefix can be reused for other
+; purposes and can be renamed. All these variables were used for
+; EMS support of Buffer Manager. Now they are useless for Buffer
+; manager ---- MOHANS
+;
+
+ I_am UU_BUF_EMS_FIRST_PAGE,3,<0,0,0>
+ ; holds the first page above
+ ; 640K
+;** I_am UU_BUF_EMS_NPA640,WORD,<0> ; holds the number of pages
+ ; above 640K
+
+ I_am CL0FATENTRY, WORD,<-1> ; M014: Holds the data that
+ ; is used in pack/unpack rts.
+ ; in fat.asm if cluster 0
+ ; is specified.
+
+ ; SR;
+ I_am IoStatFail,BYTE,<0> ; IoStatFail has been added to
+ ; record a fail on an I24
+ ; issued from IOFUNC on a
+ ; status call.
+
+;*** I_am UU_BUF_EMS_MODE,BYTE,<-1> ; [SYSTEM] EMS mode ;AN000;
+;*** I_am UU_BUF_EMS_HANDLE,BYTE ; [SYSTEM] buffer EMS handle ;AN000;
+;*** I_am UU_BUF_EMS_PAGE_FRAME,WORD ,<-1>; [SYSTEM] EMS page frame # ;AN000;
+;*** I_am UU_BUF_EMS_SEG_CNT,WORD,<1> ; [SYSTEM] EMS seg count ;AN000;
+;*** I_am UU_BUF_EMS_PFRAME,WORD ; [SYSTEM] EMS page frame seg address ;AN000;
+;*** I_am UU_BUF_EMS_RESERV,WORD,<0> ; [SYSTEM] reserved ;AN000;
+
+;*** I_am UU_BUF_EMS_MAP_BUFF,1,<0> ; this is not used to save the
+ ; state of the buffers page.
+ ; This one byte is retained to
+ ; keep the size of this data
+ ; block the same.
+
+ I_am ALLOCMSAVE,BYTE,<0> ; M063: temp var. used to
+ ; M063: save alloc method in
+ ; M063: msproc.asm
+
+ I_am A20OFF_COUNT,BYTE,<0> ; M068: indiactes the # of
+ ; M068: int 21 calls for
+ ; M068: which A20 is off
+
+
+ I_am DOS_FLAG,BYTE,<0> ; see DOSSYM.INC for Bit
+ ; definitions
+
+ I_am UNPACK_OFFSET,WORD,<0> ; saves pointer to the start
+ ; of unpack code in exepatch.
+ ; asm.
+
+ I_am UMBFLAG,BYTE,<0> ; M003: bit 0 indicates the
+ ; M003: link state of the UMBs
+ ; M003: whether linked or not
+ ; M003: to the DOS arena chain
+
+
+ I_am SAVE_AX,WORD,<0> ; M000: temp varibale to store ax
+ ; M000: in msproc.asm
+
+ I_am UMB_HEAD,WORD,<-1> ; M000: this is initialized to
+ ; M000: the first umb arena by
+ ; M000: BIOS sysinit.
+
+ I_am START_ARENA,WORD,<1> ; M000: this is the first arena
+ ; M000: from which DOS will
+ ; M000: start its scan for alloc.
+
+ .errnz ($ - SYSINITVAR) - 6ah ; kernel31 depends on this
+ dw OFFSET DOSDATA:DosWowDataStart
+
+; End of SYSINITVar block
+
+;
+; Sharer jump table
+;
+PUBLIC JShare
+ EVEN
+JShare LABEL DWORD
+ DW OFFSET DOSCODE:BadCall, 0
+ DW OFFSET DOSCODE:OKCall, 0 ; 1 MFT_enter
+ DW OFFSET DOSCODE:OKCall, 0 ; 2 MFTClose
+ DW OFFSET DOSCODE:BadCall, 0 ; 3 MFTclU
+ DW OFFSET DOSCODE:BadCall, 0 ; 4 MFTCloseP
+ DW OFFSET DOSCODE:BadCall, 0 ; 5 MFTCloN
+ DW OFFSET DOSCODE:BadCall, 0 ; 6 set_block
+ DW OFFSET DOSCODE:BadCall, 0 ; 7 clr_block
+ DW OFFSET DOSCODE:OKCall, 0 ; 8 chk_block
+ DW OFFSET DOSCODE:BadCall, 0 ; 9 MFT_get
+ DW OFFSET DOSCODE:BadCall, 0 ; 10 ShSave
+ DW OFFSET DOSCODE:BadCall, 0 ; 11 ShChk
+ DW OFFSET DOSCODE:OKCall , 0 ; 12 ShCol
+ DW OFFSET DOSCODE:BadCall, 0 ; 13 ShCloseFile
+ DW OFFSET DOSCODE:BadCall, 0 ; 14 ShSU
+
+MSCT001E LABEL BYTE
+DOSDATA ENDS
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msctrlc.asm b/private/mvdm/dos/v86/doskrnl/dos/msctrlc.asm
new file mode 100644
index 000000000..e98a4280e
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msctrlc.asm
@@ -0,0 +1,1206 @@
+;** MSCTRLC.ASM - ^C and error handler for MSDOS
+;
+; Revision History:
+; Sudeepb 14-Mar-1991 Ported for NT DOSEm
+;
+ .xlist
+ .xcref
+ include version.inc
+ include mssw.asm
+ .cref
+ .list
+
+ TITLE Control C detection, Hard error and EXIT routines
+ NAME IBMCTRLC
+
+
+;** Low level routines for detecting special characters on CON input,
+; the ^C exit/int code, the Hard error INT 24 code, the
+; process termination code, and the INT 0 divide overflow handler.
+;
+; FATAL
+; FATAL1
+; reset_environment
+; DSKSTATCHK
+; SPOOLINT
+; STATCHK
+; CNTCHAND
+; DIVOV
+; CHARHARD
+; HardErr
+;
+; Revision history:
+;
+; AN000 version 4.0 Jan 1988
+; A002 PTM -- dir >lpt3 hangs
+; A003 PTM 3957- fake version for IBMCAHE.COM
+
+ .xlist
+ include dosseg.inc
+ .xcref
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include mult.inc
+ include pdb.inc
+ include exe.inc
+ include sf.inc
+ include vector.inc
+ include filemode.inc
+ include mi.inc
+ include syscall.inc
+ include bugtyp.inc
+ include dossvc.inc
+ include vint.inc
+ .cref
+ .list
+
+ I_need SFN,WORD
+ I_NEED pJFN,DWORD
+ i_need DevIOBuf,BYTE
+ i_need DidCTRLC,BYTE
+ i_need INDOS,BYTE
+ i_need DSKSTCOM,BYTE
+ i_need DSKSTCALL,BYTE
+ i_need DSKSTST,WORD
+ i_need THISSFT,DWORD
+ i_need VIRTUAL_OPEN
+ i_need BCON,DWORD
+ i_need DSKCHRET,BYTE
+ i_need DSKSTCNT,WORD
+ i_need IDLEINT,BYTE
+ i_need CONSWAP,BYTE
+ i_need user_SS,WORD
+ i_need user_SP,WORD
+ i_need User_In_AX,WORD
+ i_need ERRORMODE,BYTE
+ i_need ConC_spsave,WORD
+ i_need Exit_type,BYTE
+ i_need PFLAG,BYTE
+ i_need ExitHold,DWORD
+ i_need WPErr,BYTE
+ i_need ReadOp,BYTE
+ i_need CONTSTK,WORD
+ i_need Exit_Code,WORD
+ i_need CurrentPDB,WORD
+ i_need DIVMES,BYTE
+ i_need ALLOWED,BYTE
+ i_need FAILERR,BYTE
+ i_need EXTERR,WORD
+ i_need ERR_TABLE_24,BYTE
+ I_need ErrMap24,BYTE
+ I_need ErrMap24End,BYTE
+ I_need fAborting,BYTE
+ I_need AUXStack,BYTE
+ I_need SCAN_FLAG,BYTE
+ I_need EXTOPEN_ON,BYTE ;AN000; DOS 4.0
+ I_need InterCon,BYTE ;AN000; DOS 4.0
+ I_need DOS34_FLAG,WORD ;AN000; DOS 4.0
+ I_need Special_Version,WORD ;AN007; DOS 4.0
+ I_need vheVDM,BYTE
+ I_need vheDev,BYTE
+ I_need TEMPSEG, WORD
+ I_need DosHasHMA,byte ; M021
+
+
+
+
+DOSDATA SEGMENT
+ extrn LowInt23:near
+ extrn LowInt24:near
+ extrn LowInt28:near
+DOSDATA ENDS
+
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ extrn DivMesLen:WORD
+
+ allow_getdseg
+
+
+ public LowInt23Addr
+LowInt23Addr LABEL DWORD
+ DW offset DOSDATA:LowInt23, 0
+
+ public LowInt24Addr
+LowInt24Addr LABEL DWORD
+ DW offset DOSDATA:LowInt24, 0
+
+ public LowInt28Addr
+LowInt28Addr LABEL DWORD
+ DW offset DOSDATA:LowInt28, 0
+
+
+
+Break <Checks for ^C in CON I/O>
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DSKSTATCHK
+;
+; Check for ^C if only one level in
+;
+;---------------------------------------------------------------------------
+
+procedure DSKSTATCHK,NEAR
+
+ CMP BYTE PTR InDos,1 ; SS override
+ retnz ; Do NOTHING
+ DOSAssume <SS>,"DskStatChk"
+ PUSH CX
+ PUSH ES
+ PUSH BX
+ PUSH DS
+ PUSH SI
+
+ MOV BX, SS ; SS is DOSDATA. ES:BX must be set up
+ MOV ES, BX ; for deviocall2
+ assume es:nothing
+ MOV DS, BX
+ MOV BYTE PTR DskStCom,DEVRDND
+ MOV BYTE PTR DskStCall,DRDNDHL
+ MOV DskStSt,0
+ IFDEF DBCS ;AN000;
+ MOV AL, InterCon ;AN000; get type of status read 2/13/KK
+ MOV BYTE PTR DskChRet,AL ;AN000; load interim flag into packet
+ ENDIF ;AN000;
+
+ ; DSKSTCALL is in DOSDATA
+ MOV BX,OFFSET DOSDATA:DSKSTCALL
+ LDS SI,BCon
+ASSUME DS:NOTHING
+ invoke DEVIOCALL2
+ TESTB DSKSTST,STBUI ; SS override
+ JZ GotCh ; No characters available
+ XOR AL,AL ; Set zero
+RET36:
+ POP SI
+ POP DS
+ POP BX
+ POP ES
+ POP CX
+ return
+
+GotCh:
+
+ MOV AL,BYTE PTR DskChRet ; SS override
+DSK1:
+ CMP AL,"C"-"@"
+ JNZ RET36
+
+ ; SS used for next 5 instructions
+ MOV BYTE PTR DskStCom,DEVRD
+ MOV BYTE PTR DskStCall,DRDWRHL
+ MOV BYTE PTR DskChRet,CL
+ MOV DskStSt,0
+ MOV DskStCnt,1
+ invoke DEVIOCALL2 ; Eat the ^C
+ POP SI
+ POP DS
+ POP BX ; Clean stack
+ POP ES
+ POP CX
+ JMP CNTCHAND
+
+NOSTOP:
+ CMP AL,"P"-"@"
+ JNZ check_next
+
+ ; SS override
+ CMP BYTE PTR Scan_Flag,0 ; ALT_Q ?
+ JZ INCHKJ ; no
+ return
+check_next:
+ IF NOT TOGLPRN
+ CMP AL,"N"-"@"
+ JZ INCHKJ
+ ENDIF
+
+ CMP AL,"C"-"@"
+ JZ INCHKJ
+check_end:
+ return
+
+INCHKJ:
+ JMP INCHK
+
+EndProc DSKSTATCHK
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : SpoolInt
+;
+; SpoolInt - signal processes that the DOS is truly idle. We are allowed to
+; do this ONLY if we are working on a 1-12 system call AND if we are not in
+; the middle of an INT 24.
+;
+;----------------------------------------------------------------------------
+
+procedure SPOOLINT,NEAR
+ PUSH ax
+ lahf
+ push ax
+ cmp IdleInt,0 ; SS override for IdleInt & ErrorMode
+ je POPFRet
+ cmp ErrorMode,0
+ jnz POPFRet
+
+ ;
+ ; Note that we are going to allow an external program to issue system
+ ; calls at this time. We MUST preserve IdleInt across this.
+ ;
+
+ PUSH WORD PTR IdleInt
+
+ cmp [DosHasHMA], 0 ; Q: is dos running in HMA (M021)
+ jne do_low_int28 ; Y: the int must be done from low mem
+ INT int_spooler ; N: Execute user int 28 handler
+ jmp short spool_ret_addr
+
+do_low_int28:
+ call dword ptr LowInt28Addr
+
+spool_ret_addr:
+
+ POP WORD PTR IdleInt
+POPFRET:
+ pop ax
+ sahf
+ pop ax
+ return
+EndProc SPOOLINT
+
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : STATCHK
+;
+;----------------------------------------------------------------------------
+
+ procedure STATCHK,NEAR
+
+ invoke DSKSTATCHK ; Allows ^C to be detected under
+ ; input redirection
+ PUSH BX
+ XOR BX,BX
+ invoke GET_IO_SFT
+ POP BX
+ retc
+ MOV AH,1
+ invoke IOFUNC
+ JZ SPOOLINT
+ CMP AL,"S"-"@"
+ JNZ NOSTOP
+
+ ; SS override
+ CMP BYTE PTR Scan_Flag,0 ; AN000; ALT_R ?
+ JNZ check_end ; AN000; yes
+ XOR AH,AH
+ invoke IOFUNC ; Eat Cntrl-S
+ JMP SHORT PAUSOSTRT
+PRINTOFF:
+PRINTON:
+
+ NOT BYTE PTR PFlag ; SS override
+ PUSH BX
+ MOV BX,4
+ invoke GET_IO_SFT
+ POP BX
+ retc
+ PUSH ES
+ PUSH DI
+ PUSH DS
+ POP ES
+ MOV DI,SI ; ES:DI -> SFT
+ TESTB ES:[DI].SF_FLAGS,sf_net_spool
+ JZ NORM_PR ; Not redirected, echo is OK
+ Callinstall NetSpoolEchoCheck,MultNet,38,<AX>,<AX> ; See if allowed
+ JNC NORM_PR ; Echo is OK
+
+ ; SS override
+ MOV BYTE PTR PFlag,0 ; If not allowed, disable echo
+ Callinstall NetSpoolClose,MultNet,36,<AX>,<AX> ; and close
+ JMP SHORT RETP6
+
+NORM_PR:
+ CMP BYTE PTR PFlag,0 ; SS override
+ JNZ PRNOPN
+ invoke DEV_CLOSE_SFT
+ JMP SHORT RETP6
+
+PRNOPN:
+ invoke DEV_OPEN_SFT
+RETP6:
+ POP DI
+ POP ES
+ return
+
+PAUSOLP:
+ CALL SPOOLINT
+PAUSOSTRT:
+ MOV AH,1
+ invoke IOFUNC
+ JZ PAUSOLP
+INCHK:
+ PUSH BX
+ XOR BX,BX
+ invoke GET_IO_SFT
+ POP BX
+ retc
+ XOR AH,AH
+ invoke IOFUNC
+ CMP AL,"P"-"@"
+
+ ;;;;; 7/14/86 ALT_Q key fix
+
+ JZ PRINTON ; no! must be CTRL_P
+
+NOPRINT:
+
+ ;;;;; 7/14/86 ALT_Q key fix
+
+ IF NOT TOGLPRN
+ CMP AL,"N"-"@"
+ JZ PRINTOFF
+ ENDIF
+ CMP AL,"C"-"@"
+ retnz
+EndProc STATCHK
+
+; !! NOTE: FALL THROUGH !!
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : CNTHAND ( CTRLC_C HANDLER )
+;
+; "^C" and CR/LF is printed. Then the user registers are restored and the
+; user CTRL-C handler is executed. At this point the top of the stack has 1)
+; the interrupt return address should the user CTRL-C handler wish to allow
+; processing to continue; 2) the original interrupt return address to the code
+; that performed the function call in the first place. If the user CTRL-C
+; handler wishes to continue, it must leave all registers unchanged and RET
+; (not IRET) with carry CLEAR. If carry is SET then an terminate system call
+; is simulated.
+;
+;---------------------------------------------------------------------------
+
+procedure CNTCHAND,NEAR
+
+ ; SS override
+ ; AN002; from RAWOUT
+ TESTB Dos34_Flag,CTRL_BREAK_FLAG
+ JNZ around_deadlock ; AN002;
+ MOV AL,3 ; Display "^C"
+ invoke BUFOUT
+ invoke CRLF
+around_deadlock: ;AN002;
+ Context DS ; SS is DOSDATA
+ CMP BYTE PTR ConSwap,0
+ JZ NOSWAP
+ invoke SWAPBACK
+NOSWAP:
+ call DOCLI ; Prepare to play with stack
+ MOV SS,User_SS ; User stack now restored
+ASSUME SS:NOTHING
+ MOV SP,User_SP
+
+ ; use macro for restore_world
+ restore_world ; User registers now restored
+
+ ;
+ ; CS was used to address these variables. We have to use DOSDATA
+ ;
+ push ds
+ getdseg <ds> ; ds -> dosdata
+
+ MOV BYTE PTR InDos,0 ; Go to known state
+ MOV BYTE PTR ErrorMode,0
+ MOV ConC_Spsave,SP ; save his SP
+
+
+ ; User SP has changed because of push. Adjust for it
+
+ add ConC_Spsave,2
+
+ cmp [DosHasHMA], 0 ; Q: is dos running in HMA (M021)
+ pop ds ;restore ds
+ assume ds:NOTHING
+
+ jne do_low_int23 ; Y: the int must be done from low mem
+ CLC
+ INT int_ctrl_c ; N: Execute user Ctrl-C handler
+ jmp short ctrlc_ret_addr
+
+do_low_int23:
+ clc
+ call dword ptr LowInt23Addr
+
+ctrlc_ret_addr:
+
+
+;
+; The user has returned to us. The circumstances we allow are:
+;
+; IRET We retry the operation by redispatching the system call
+; CLC/RETF POP the stack and retry
+; ... Exit the current process with ^C exit
+;
+; User's may RETURN to us and leave interrupts on. Turn 'em off just to be
+; sure
+;
+ call DOCLI
+
+ ;
+ ; We have to use DOSDATA for these variables. Previously CS was used
+ ;
+
+ push ax
+ mov ax, ds
+ getdseg <ds> ; ds -> dosdata
+
+ mov TempSeg, ax
+ pop ax
+
+ MOV User_In_AX,ax ; save the AX
+ PUSHF ; and the flags (maybe new call)
+ POP AX
+
+ ;
+ ; See if the input stack is identical to the output stack
+ ;
+
+ CMP SP,ConC_Spsave
+ JNZ ctrlc_try_new ; current SP not the same as saved SP
+
+ ;
+ ; Repeat the operation by redispatching the system call.
+ ;
+
+ctrlc_repeat:
+ MOV AX,User_In_AX ; ds still points to dosdata
+
+
+ mov ds, TempSeg ; restore ds and original sp
+ assume ds:NOTHING
+
+ transfer COMMAND
+
+ ;
+ ; The current SP is NOT the same as the input SP. Presume that he
+ ; RETF'd leaving some flags on the stack and examine the input
+ ;
+
+ctrlc_try_new:
+ ADD SP,2 ; pop those flags
+ TESTB AX,f_carry ; did he return with carry?
+ JZ Ctrlc_Repeat ; no carry set, just retry
+
+
+ assume ds:DOSDATA ;restore ds
+ mov ds, TempSeg
+ assume ds:NOTHING
+
+ ;
+ ; Well... time to abort the user. Signal a ^C exit and use the EXIT
+ ; system call..
+ ;
+
+ctrlc_abort:
+ MOV AX,(EXIT SHL 8) + 0
+
+ push ds
+ getdseg <ds> ; ds -> dosdata
+
+ MOV DidCTRLC,-1
+
+ pop ds
+ assume ds:NOTHING
+
+ transfer COMMAND ; give up by faking $EXIT
+
+EndProc CNTCHAND
+
+Break <DIVISION OVERFLOW INTERRUPT>
+;----------------------------------------------------------------------------
+;
+; Procedure Name : DIVOV
+;
+; Default handler for division overflow trap
+;
+;----------------------------------------------------------------------------
+
+procedure DIVOV,NEAR
+ ASSUME SS:NOTHING
+
+ ; DIVMES is in DOSCODE
+ MOV SI,OFFSET DOSCODE:DIVMES
+ MOV BX,DivMesLen
+
+ ; Point SS to dosdata
+ getdseg <ss> ; we are in an ISR flag is CLI
+
+ ; AUXSTACK is in DOSDATA
+ ; Enough stack for interrupts
+ MOV SP,OFFSET DOSDATA:AUXSTACK
+ CALL OutMes
+ JMP ctrlc_abort ; Use Ctrl-C abort on divide overflow
+EndProc DIVOV
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : OutMes
+;
+;
+; OutMes: perform message output
+; Inputs: SS:SI points to message
+; BX has message length
+; Outputs: message to BCON
+;
+;Actually, cs:si points to the message now. The segment address is filled in
+;at init. time ([dskchret+2]). This will be temporarily changed to DOSCODE.
+;NB. This procedure is called only from DIVOV. -SR
+;
+;---------------------------------------------------------------------------
+
+procedure OutMes,NEAR
+
+ Context ES ; get ES addressability
+ Context DS ; get DS addressability
+
+ MOV BYTE PTR DskStCom,DevWrt
+ MOV BYTE PTR DskStCall,DRdWrHL
+ MOV DskStSt,0
+ MOV DskStCnt,BX
+
+ ; DSKSTCALL is in DOSDATA
+ MOV BX,OFFSET DOSDATA:DskStCall
+ MOV WORD PTR [DskChRet+1],SI; transfer address (need an EQU)
+
+
+ ; CS is used for string, fill in
+ ; segment address
+ MOV WORD PTR [DskChRet+3],CS
+
+ LDS SI,BCon
+
+ASSUME DS:NOTHING
+ invoke DEVIOCALL2
+ ; ES still points to DOSDATA. ES is
+ ; not destroyed by deviocall2. So use
+ ; ES override.
+
+ ; DEVIOBUF is in DOSDATA
+ MOV WORD PTR ES:[DskChRet+1],OFFSET DOSDATA:DevIOBuf
+ MOV ES:[DskStCnt],1
+ return
+EndProc OutMes
+
+Break <CHARHRD,HARDERR,ERROR -- HANDLE DISK ERRORS AND RETURN TO USER>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : CHARHARD
+;
+;
+; Character device error handler
+; Same function as HARDERR
+;
+;---------------------------------------------------------------------------
+
+procedure CHARHARD,NEAR
+ ASSUME SS:DOSDATA
+
+ ; M024 - start
+ cmp byte ptr [ErrorMode], 0 ; Q: are we in the middle of int 24
+ jne @f ; Y: allow fail
+
+ OR AH, allowed_RETRY ; assume ctrl p
+
+ test byte ptr [PFLAG], -1 ; Q: has ctrl p been pressed
+ jnz ctrlp ; Y:
+@@: ; M024 - end
+
+ OR AH,allowed_FAIL + allowed_IGNORE + allowed_RETRY
+
+ctrlp: ; M024
+
+ ; SS override for Allowed and EXITHOLD
+ MOV Allowed,AH
+ MOV WORD PTR EXITHOLD+2,ES
+ MOV WORD PTR EXITHOLD,BP
+ PUSH SI
+ AND DI,STECODE
+ MOV BP,DS ; Device pointer is BP:SI
+ CALL FATALC
+ POP SI
+ return
+EndProc CHARHARD
+
+
+procedure TestHrdErr,NEAR
+ ; SS override
+thr_strt:
+ cmp DOSDATA:[vheVDM.vhe_fbInt24], 0
+ stc
+ jnz thr_herr
+ ret
+
+thr_herr:
+ mov al, DOSDATA:[vheVDM.vhe_HrdErrCode]
+ push ax
+ mov Allowed, allowed_FAIL + allowed_RETRY
+ invoke HardErr
+ cmp al,1
+ je thr_retry
+ pop ax
+ add ax,19 ; convert to normal error codes
+ stc
+ ret
+thr_retry:
+ pop ax
+ SVC SVC_DEMRETRY
+ jc short thr_strt
+ ret
+
+EndProc TestHrdErr
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : HardErr
+;
+; Hard disk error handler. Entry conditions:
+; DS:BX = Original disk transfer address
+; DX = Original logical sector number
+; CX = Number of sectors to go (first one gave the error)
+; AX = Hardware error code
+; DI = Original sector transfer count
+; ES:BP = Base of drive parameters
+; [READOP] = 0 for read, 1 for write
+; Allowed Set with allowed responses to this error (other bits MUST BE 0)
+; Output:
+; [FAILERR] will be set if user responded FAIL
+;
+;--------------------------------------------------------------------------
+
+procedure HardErr,NEAR
+
+
+
+ XCHG AX,DI ; Error code in DI, count in AX
+ AND DI,STECODE ; And off status bits
+ xor AH,AH ; DISK IO error
+
+ OR AH,Allowed ; Set the allowed_ bits
+ entry FATAL
+ mov al, DOSDATA:[vheVDM.vhe_bDriveNum] ; Get drive number
+
+ ;
+ ; NTVDM file reads\writes to network drives also come in here
+ ; if remote drive set to char device type for apps sanity
+ ;
+ mov DOSDATA:[vheDev.sdevatt], 0h
+ cmp al, -1
+ jne not_remote
+ or ah, 80h
+ or DOSDATA:[vheDev.sdevatt], 8000h
+not_remote:
+
+ entry FATAL1
+ MOV WORD PTR EXITHOLD+2,ES
+ MOV WORD PTR EXITHOLD,BP ; The only things we preserve
+ mov si, offset DOSDATA:vheDev
+ mov bp, ss ; BP:SI points to the fake device
+
+ ;
+ ; DI has the INT-24-style extended error. We now map the error code
+ ; for this into the normalized get extended error set by using the
+ ; ErrMap24 table as a translate table. Note that we translate ONLY
+ ; the device returned codes and leave all others beyond the look up
+ ; table alone.
+ ;
+
+FATALC:
+ call SET_I24_EXTENDED_ERROR
+ CMP DI,error_I24_gen_failure
+ JBE GOT_RIGHT_CODE ; Error codes above gen_failure get
+ MOV DI,error_I24_gen_failure; mapped to gen_failure. Real codes
+ ; Only come via GetExtendedError
+
+
+
+
+;**
+;
+; Entry point used by REDIRector on Network I 24 errors.
+;
+; ASSUME DS:NOTHING,ES:NOTHING,SS:DOSDATA
+;
+; ALL I 24 regs set up. ALL Extended error info SET. ALLOWED Set.
+; EXITHOLD set for restore of ES:BP.
+;
+
+ entry NET_I24_ENTRY
+
+GOT_RIGHT_CODE:
+
+ ; SS override
+ CMP BYTE PTR ErrorMode,0 ; No INT 24s if already INT 24
+ JZ NoSetFail
+ MOV AL,3
+IF DEBUG
+ JMP FailRet
+ELSE
+ JMP short FailRet
+ENDIF
+NoSetFail:
+
+ ; SS override
+ MOV CONTSTK,SP
+ Context ES
+ fmt TypINT24,LevLog,<"INT 24: AX = $x DI = $x\n">,<AX,DI>
+
+ ;
+ ; Wango!!! We may need to free some user state info... In
+ ; particular, we may have locked down a JFN for a user and he may
+ ; NEVER return to us. Thus,we need to free it here and then
+ ; reallocate it when we come back.
+ ;
+
+ ; SS override for SFN and pJFN
+ CMP SFN,-1
+ JZ NoFree
+ SAVE <DS,SI>
+ LDS SI,pJFN
+ MOV BYTE PTR [SI],0FFH
+ RESTORE <SI,DS>
+NoFree:
+ call DOCLI ; Prepare to play with stack
+
+ ; SS override for ERRORMODE, INDOS,
+ ; DOS34_FLAG, EXTOPEN_ON
+ INC BYTE PTR ErrorMode ; Flag INT 24 in progress
+ DEC BYTE PTR InDos ; INT 24 handler might not return
+
+ MOV SS,User_SS
+ASSUME SS:NOTHING
+ MOV SP,ES:User_SP ; User stack pointer restored
+
+ cmp [DosHasHMA], 0 ; Q: is dos running in HMA (M021)
+ jne do_low_int24 ; Y: the int must be done from low mem
+ INT int_fatal_abort ; Fatal error interrupt vector,
+ ; must preserve ES
+ jmp short criterr_ret_addr
+
+do_low_int24:
+ call dword ptr LowInt24Addr
+
+criterr_ret_addr:
+ MOV ES:User_SP,SP ; restore our stack
+ MOV ES:User_SS,SS
+ MOV BP,ES
+ MOV SS,BP
+ASSUME SS:DOSDATA
+passi24: ; AN000;
+
+ ; SS override for nect 3 instructions.
+ MOV SP,CONTSTK
+ INC BYTE PTR InDos ; Back in the DOS
+ MOV BYTE PTR ErrorMode,0 ; Back from INT 24
+ call DOSTI
+ fmt TypINT24,LevLog,<"INT 24: User reply = $x\n">,<AX>
+FAILRET:
+
+ LES BP,EXITHOLD ; SS override
+ASSUME ES:NOTHING
+
+ ;
+ ; Triage the user's reply.
+ ;
+ CMP AL,1
+ JB CheckIgnore ; 0 => ignore
+ JZ CheckRetry ; 1 => retry
+ CMP AL,3 ; 3 => fail
+ JNZ DoAbort ; 2, invalid => abort
+
+ ;
+ ; The reply was fail. See if we are allowed to fail.
+ ;
+
+ ; SS override for ALLOWED, EXTOPEN_ON,
+ ; ALLOWED, FAILERR, WpErr, SFN, pJFN
+ TESTB Allowed,allowed_FAIL ; Can we?
+ JZ DoAbort ; No, do abort
+DoFail:
+ MOV AL,3 ; just in case...
+ ; AN000;EO. I24 error disabled
+ TESTB EXTOPEN_ON,EXT_OPEN_I24_OFF
+ JNZ cleanup ; AN000;EO. no
+ INC FAILERR ; Tell everybody
+CleanUp:
+ MOV WpErr,-1
+ CMP SFN,-1
+ retz
+ SAVE <DS,SI,AX>
+ MOV AX,SFN
+ LDS SI,pJFN
+ MOV [SI],AL
+ RESTORE <AX,SI,DS>
+ return
+
+ ;
+ ; The reply was IGNORE. See if we are allowed to ignore.
+ ;
+
+CheckIgnore:
+ TESTB Allowed,allowed_IGNORE ; Can we?
+ JZ DoFail ; No, do fail
+ JMP CleanUp
+
+ ;
+ ; The reply was RETRY. See if we are allowed to retry.
+ ;
+
+CheckRetry:
+ TESTB Allowed,allowed_RETRY ; Can we?
+ JZ DoFail ; No, do fail
+ JMP CleanUp
+
+ ;
+ ; The reply was ABORT.
+ ;
+
+DoAbort:
+ Context DS
+ CMP BYTE PTR ConSwap,0
+ JZ NOSWAP2
+ invoke SWAPBACK
+NOSWAP2:
+
+ ;
+ ; See if we are to truly abort. If we are in the process of aborting,
+ ; turn this abort into a fail.
+ ;
+
+ cmp fAborting,0
+ JNZ DoFail
+
+ ;
+ ; Set return code
+ ;
+
+ MOV BYTE PTR [exit_Type],Exit_hard_error
+ XOR AL,AL
+
+ ;
+ ; we are truly aborting the process. Go restore information from
+ ; the PDB as necessary.
+ ;
+
+ Transfer exit_inner
+;**
+;
+; reset_environment checks the DS value against the CurrentPDB. If they are
+; different, then an old-style return is performed. If they are the same,
+; then we release jfns and restore to parent. We still use the PDB at DS:0 as
+; the source of the terminate addresses.
+;
+; Some subtlety: We are about to issue a bunch of calls that *may* generate
+; INT 24s. We *cannot* allow the user to restart the abort process; we may
+; end up aborting the wrong process or turn a terminate/stay/resident into a
+; normal abort and leave interrupt handlers around. What we do is to set a
+; flag that will indicate that if any abort code is seen, we just continue the
+; operation. In essence, we dis-allow the abort response.
+;
+; output: none.
+;
+ entry reset_environment
+ ASSUME DS:NOTHING,ES:NOTHING
+
+;*** invoke Reset_Version ; AN007;MS. reset version number
+ PUSH DS ; save PDB of process
+
+
+; NTVDM - we don't do any crit\sect stuff
+; 04-Aug-1992 Jonle
+;
+; ;
+; ; There are no critical sections in force. Although we may enter
+; ; here with critical sections locked down, they are no longer
+; ; relevant. We may safely free all allocated resources.
+; ;
+;
+; MOV AH,82h
+; INT int_IBM
+
+ ; SS override
+ MOV fAborting,-1 ; signal abort in progress
+
+ ; DOS 4.00 doesn't need it
+ CallInstall NetResetEnvironment, multNet, 34
+ ; Allow REDIR to clear some stuff
+ ; On process exit.
+ MOV AL,int_Terminate
+ invoke $Get_interrupt_vector ; and who to go to
+
+ POP CX ; get ThisPDB
+
+ SAVE <ES,BX> ; save return address
+
+ MOV BX,[CurrentPDB] ; get currentPDB
+ MOV DS,BX
+ MOV AX,DS:[PDB_Parent_PID] ; get parentPDB
+
+ ;
+ ; AX = parentPDB, BX = CurrentPDB, CX = ThisPDB
+ ; Only free handles if AX <> BX and BX = CX and [exit_code].upper
+ ; is not Exit_keep_process
+ ;
+
+ CMP AX,BX
+ JZ reset_return ; parentPDB = CurrentPDB
+ CMP BX,CX
+ JNZ reset_return ; CurrentPDB <> ThisPDB
+ PUSH AX ; save parent
+
+ ; SS override
+ CMP BYTE PTR [exit_type],Exit_keep_process
+ JZ reset_to_parent ; keeping this process
+
+ ;
+ ; We are truly removing a process. Free all allocation blocks
+ ; belonging to this PDB
+ ;
+
+ ; Call DEM to close the search handles for this PDB
+ SVC SVC_PDBTERMINATE ; BX is the PDB
+
+
+ invoke arena_free_process
+
+ ;
+ ; Kill off remainder of this process. Close file handles and signal
+ ; to relevant network folks that this process is dead. Remember that
+ ; CurrentPDB is STILL the current process!
+ ;
+
+ invoke DOS_ABORT
+
+reset_to_parent:
+ ; SS override
+ POP [CurrentPDB] ; set up process as parent
+
+reset_return: ; come here for normal return
+
+ Context DS ; DS is used to refer to DOSDATA
+
+ MOV AL,-1
+
+ ;
+ ; make sure that everything is clean In this case ignore any errors,
+ ; we cannot "FAIL" the abort, the program being aborted is dead.
+ ;
+
+; EnterCrit critDisk
+; invoke FLUSHBUF
+; LeaveCrit critDisk
+
+ ;
+ ; Decrement open ref. count if we had done a virtual open earlier.
+ ;
+
+ invoke CHECK_VIRT_OPEN
+ call DOCLI
+ MOV BYTE PTR InDos,0 ; Go to known state
+ MOV BYTE PTR [WPERR],-1 ; Forget about WP error
+ MOV fAborting,0 ; let aborts occur
+ POP WORD PTR ExitHold
+ POP WORD PTR ExitHold+2
+
+ ;
+ ; Snake into multitasking... Get stack from CurrentPDB person
+ ;
+
+ MOV DS,[CurrentPDB]
+ ASSUME DS:NOTHING
+ MOV SS,WORD PTR DS:[PDB_user_stack+2]
+ MOV SP,WORD PTR DS:[PDB_user_stack]
+
+ ASSUME SS:NOTHING
+ restore_world ; use macro
+
+ ASSUME ES:NOTHING
+
+
+ push ax ; set up ds, but save ds in TEMPSEG
+ mov ax, ds ; and not on stack.
+ getdseg <ds> ; ds ->dosdata
+ mov TempSeg, ax
+ pop ax
+ ; set up ds to DOSDATA
+ MOV User_SP,AX
+
+ POP AX ; suck off CS:IP of interrupt...
+ POP AX
+ POP AX
+
+; M011 : BEGIN
+
+; MOV AX,0F202h ; STI
+
+ LAHF
+ XCHG AH, AL
+ AND AL, 02
+ MOV AH, 0F2h
+
+; M011 : END
+
+ PUSH AX
+
+
+ PUSH WORD PTR [EXITHOLD+2]
+ PUSH WORD PTR [EXITHOLD]
+
+ MOV AX,User_SP
+
+ mov ds,TempSeg ; restore ds
+ assume ds:NOTHING
+
+ jmp DOIRET ; Long return back to user terminate address
+EndProc HardErr,NoCheck
+
+Procedure DOCLI,near
+ FCLI
+ ret
+EndProc DOCLI
+
+Procedure DOSTI,near
+ FSTI
+ ret
+EndProc DOSTI
+
+ public DOIRET
+DOIRET:
+ FIRET
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : CHECK_VIRT_OPEN
+;
+; CHECK_VIRT_OPEN checks to see if we had performed a "virtual open" (by
+; examining the flag [VIRTUAL_OPEN] to see if it is 1). If we did, then
+; it calls Dev_Close_SFT to decrement the ref. count. It also resets the
+; flag [VIRTUAL_OPEN].
+; No registers affected (including flags).
+; On input, [THISSFT] points to current SFT.
+;
+;---------------------------------------------------------------------------
+
+Procedure CHECK_VIRT_OPEN,NEAR
+ DOSAssume <DS>,"Check_Virt_Open"
+
+ PUSH AX
+ lahf ; preserve flags
+ CMP [VIRTUAL_OPEN],0
+ JZ ALL_CLOSED
+ mov [VIRTUAL_OPEN],0 ; reset flag
+ SAVE <ES,DI>
+ LES DI,[THISSFT]
+ INVOKE DEV_CLOSE_SFT
+ RESTORE <DI,ES>
+
+ALL_CLOSED:
+ sahf ; restore flags
+ POP AX
+ return
+
+EndProc CHECK_VIRT_OPEN
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : SET_I24_EXTENDED_ERROR
+;
+; This routine handles extended error codes.
+; Input : DI = error code from device
+; Output: All EXTERR fields are set
+;
+;--------------------------------------------------------------------------
+
+Procedure SET_I24_EXTENDED_ERROR,NEAR
+ PUSH AX
+
+ ; ErrMap24End is in DOSDATA
+ MOV AX,OFFSET DOSDATA:ErrMap24End
+ SUB AX,OFFSET DOSDATA:ErrMap24
+
+ ; Change to dosdata to access
+ ; ErrMap24 and EXTERR -SR
+ push ds
+ getdseg <ds> ; ds ->dosdata
+
+ ;
+ ; AX is the index of the first unavailable error. Do not translate
+ ; if greater or equal to AX.
+ ;
+
+ CMP DI,AX
+ MOV AX,DI
+ JAE NoTrans
+
+ MOV AL,ErrMap24[DI]
+ XOR AH,AH
+NoTrans:
+
+ MOV [EXTERR],AX
+ pop ds
+ assume ds:nothing
+ POP AX
+
+ ;
+ ; Now Extended error is set correctly. Translate it to get correct
+ ; error locus class and recommended action.
+ ;
+
+ PUSH SI
+
+ ; ERR_TABLE_24 is in DOSCODE
+ MOV SI,OFFSET DOSDATA:ERR_TABLE_24
+ invoke CAL_LK ; Set other extended error fields
+ POP SI
+ ret
+EndProc SET_I24_EXTENDED_ERROR
+
+
+;--------------------------------------------------------------------------
+;
+; Proc. name : dos_high
+;
+; ENTRY: CS = current doscode segment
+;
+; EXIT: if CS >=F000 (DOS is in HMA)
+; CY stc
+; else (DOS is LOW)
+; NC clc
+;
+; USED: nothing
+;
+;-------------------------------------------------------------------------
+;
+;public dos_high
+;dos_high proc near
+;
+; push ax
+; mov ax, cs
+; cmp ax, 0f000h ; Q: is current cs >= f000
+; pop ax
+; cmc ; clc if dos is low
+; ; stc if dos is high
+; ret
+;
+;dos_high endp
+;
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msdata.asm b/private/mvdm/dos/v86/doskrnl/dos/msdata.asm
new file mode 100644
index 000000000..cda2038d0
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msdata.asm
@@ -0,0 +1,42 @@
+;
+; DATA Segment for DOS.
+;
+
+.xlist
+.xcref
+include version.inc
+include mssw.asm
+include dosseg.inc
+include dossym.inc
+INCLUDE sf.inc
+INCLUDE curdir.inc
+INCLUDE arena.inc
+INCLUDE vector.inc
+INCLUDE devsym.inc
+INCLUDE pdb.inc
+INCLUDE find.inc
+INCLUDE mi.inc
+include doscntry.inc
+include fastopen.inc
+include xmm.inc
+.cref
+.list
+
+TITLE IBMDATA - DATA segment for DOS
+NAME IBMDATA
+
+installed = TRUE
+
+include vint.inc
+include msbdata.inc
+include msconst.asm ; This includes mshead.asm whihc has DOS entry point
+include const2.asm
+include ms_data.asm
+include dostab.asm
+include lmstub.asm
+include wpatch.inc ; BUGBUG sudeepb 06-Mar-1991 Do we need this?
+include bop.inc
+
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msdisp.asm b/private/mvdm/dos/v86/doskrnl/dos/msdisp.asm
new file mode 100644
index 000000000..0f020ea09
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msdisp.asm
@@ -0,0 +1,924 @@
+
+PAGE ,132
+; ==========================================================================
+;
+; TITLE MS DOS DISPATCHER - System call dispatch code
+; NAME DISP
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+; System call dispatch code
+; System call entry points and dispatcher
+;
+; Revision History:
+; Sudeepb 14-Mar-1991 Ported for NT DOSEm
+
+
+.XLIST
+.XCREF
+
+INCLUDE version.inc
+INCLUDE mssw.asm
+INCLUDE dossym.inc
+INCLUDE devsym.inc ; M042
+INCLUDE dosseg.inc
+INCLUDE pdb.inc
+INCLUDE vector.inc
+INCLUDE syscall.inc
+INCLUDE mi.inc
+INCLUDE bugtyp.inc
+
+include dossvc.inc
+include bop.inc
+include vint.inc
+include dbgsvc.inc
+
+.CREF
+.LIST
+
+
+AsmVars <Debug>
+
+; ==========================================================================
+; ==========================================================================
+
+DosData SEGMENT
+
+ EXTRN AuxStack :BYTE
+ EXTRN BootDrive :BYTE
+ EXTRN ConSwap :BYTE
+ EXTRN CntCFlag :BYTE
+ EXTRN CpswFlag :BYTE
+ EXTRN CpswSave :BYTE
+
+;**RMFHFE** EXTRN Disk_Full :BYTE
+
+ EXTRN DskStack :BYTE
+ EXTRN ErrorMode :BYTE
+ EXTRN ExtOpen_On :BYTE
+ EXTRN Exterr_Locus :BYTE
+ EXTRN FailErr :BYTE
+ EXTRN fSharing :BYTE
+ EXTRN IdleInt :BYTE
+ EXTRN InDos :BYTE
+ EXTRN IoStack :BYTE
+ EXTRN InterCon :BYTE
+ EXTRN IsWin386 :BYTE
+ EXTRN NoSetDir :BYTE
+ EXTRN Printer_Flag :BYTE
+ EXTRN WpErr :BYTE
+
+ EXTRN CurrentPDB :WORD
+
+ EXTRN Dispatch :WORD
+
+ EXTRN Dos34_Flag :WORD
+ EXTRN Nsp :WORD
+ EXTRN Nss :WORD
+ EXTRN Proc_ID :WORD
+ EXTRN Restore_Tmp :WORD
+ EXTRN SaveDS :WORD
+ EXTRN SaveBX :WORD
+ EXTRN User_In_AX :WORD
+ EXTRN User_ID :WORD
+ EXTRN User_SP :WORD
+ EXTRN User_SS :WORD
+
+ EXTRN disa20_iret :WORD
+ EXTRN A20OFF_COUNT :BYTE ; M004
+ extrn DosHasHMA :byte ; M021
+ EXTRN DOS_FLAG :byte ; M068
+ EXTRN A20OFF_PSP :word ; M068
+ifdef NTVDMDBG
+ EXTRN SCS_ISDEBUG :byte
+endif
+
+IF NOT IBM
+EXTRN OEM_HANDLER:DWORD
+ENDIF
+
+DosData ENDS
+
+; ==========================================================================
+; ==========================================================================
+
+
+; ==========================================================================
+; ==========================================================================
+
+DosCode SEGMENT
+
+ allow_getdseg
+
+ EXTRN MaxCall :ABS
+ EXTRN MaxCom :ABS
+
+IF DEBUG
+ INCLUDE scnam.inc
+ENDIF
+
+ ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;M007 - New version of this routine
+; ==========================================================================
+;
+; $Set_CTRL_C_Trapping
+;
+; Function:
+; Enable disable ^C checking in dispatcher
+;
+; Inputs:
+; AL = 0 read ^C status
+; AL = 1 Set ^C status, DL = 0/1 for ^C off/on
+; AL = 2 Set ^C status to contents of DL. Output is old state.
+; AL = 5 get DOS boot drive
+; AL = 6 Get version number
+; RETURNS:
+; BH = Minor version number
+; BL = Major version number
+; DL = DOS internal revision
+; DH = DOS type flags
+; Bit 3 - DOS in ROM
+; Bit 4 - DOS in HMA
+; Bit 0-2, 5-7 - Reserved
+; Outputs:
+; If AL = 0 then DL = 0/1 for ^C off/on
+;
+; History:
+; removed AL = 3 Get CPSW state to DL DOS 3.4
+; removed AL = 4 Set CPSW state from DL DOS 3.4
+; ==========================================================================
+ PUBLIC $Set_Ctrl_C_Trapping
+$Set_Ctrl_C_Trapping PROC NEAR
+ ASSUME SS:NOTHING
+
+ cmp AL, 6 ; Is this a valid subfunction?
+ jbe scct_1 ; If yes continue processing
+
+ mov AL, 0ffh ; Else set AL to -1 and
+
+ jmp iret_com
+
+scct_1:
+ push DS
+
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+
+ push AX ; DL only register that can change
+ push SI
+
+ mov SI, OFFSET CntCFlag ; DS:SI --> Ctrl C Status byte
+ xor AH, AH ; Clear high byte of AX
+ or AX, AX ; Check for subfunction 0
+ jnz scct_2 ; If not 0 jmp to next check
+
+ mov DL, [SI] ; Else move current ctrl C status
+ jmp SHORT scct_9s ; into DL and jmp to exit
+
+scct_2:
+ dec AX ; Now dec AX and see if it was 1
+ jnz scct_3 ; If not 0 it wasn't 1 so do next chk
+
+ and DL, 1 ; Else mask off bit 0 of DL and
+ mov [SI], DL ; save it as new Ctrl C status
+ jmp SHORT scct_9s ; Jmp to exit
+
+scct_3:
+ dec AX ; Dec AX again to see if it was 2
+ jnz scct_4 ; If not 0 wasn't 2 so go to next chk
+
+ and DL, 1 ; Else mask off bit 0 of DL and
+ xchg [SI], DL ; Exchange DL with old status byte
+ jmp SHORT scct_9s ; Jump to exit (returning old status)
+
+scct_4:
+ cmp AX,3 ; Test for 5 after it was dec twice
+ jne scct_5 ; If not equal then not get boot drv
+ mov DL, BootDrive ; Else return boot drive in DL
+ jmp SHORT scct_9s ; Jump to exit (returning boot drive)
+
+scct_5:
+ cmp AX,4 ; Test for 6 after it was dec twice
+ jne scct_9s ; If not equal then not get version
+
+ mov BX,(Minor_Version_NT SHL 8) + Major_Version
+ mov DL, DOSREVNM
+
+ xor dh, dh ; assume vanilla DOS
+ cmp [DosHasHMA], 0 ; is DOS in HMA? (M021)
+ je @F
+ or DH, DOSINHMA
+@@:
+
+ifdef ROMDOS
+ or DH, DOSINROM
+endif ; ROMDOS
+
+scct_9s:
+ pop SI
+ pop AX
+ pop DS
+
+scct_9f:
+ jmp iret_com
+
+;M007 end
+
+SetCtrlShortEntry: ; This allows a conditional entry
+ ; from main dispatch code
+ jmp SHORT $Set_Ctrl_C_Trapping
+
+$Set_Ctrl_C_Trapping ENDP
+
+; ==========================================================================
+; ;
+; The following two routines are dispatched to directly with ints disabled
+; immediately after the int 21h entry. no DIS state is set.
+;
+; $Set_current_PDB takes BX and sets it to be the current process
+; *** THIS FUNCTION CALL IS SUBJECT TO CHANGE!!! ***
+;
+; ==========================================================================
+
+ PUBLIC $Set_Current_PDB
+$Set_Current_PDB PROC NEAR
+ ASSUME SS:NOTHING
+
+ push DS
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ mov CurrentPDB,BX ; Set new PSP segment from caller's BX
+ pop DS
+ jmp iret_com
+
+EndProc $Set_Current_PDB
+
+; ==========================================================================
+;
+; $get_current_PDB returns in BX the current process
+; *** THIS FUNCTION CALL IS SUBJECT TO CHANGE!!! ***
+;
+; ==========================================================================
+
+ PUBLIC $Get_Current_PDB
+$Get_Current_PDB PROC NEAR
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ push DS
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ mov BX,CurrentPDB ; Return current PSP segment in BX
+ pop DS
+ jmp iret_com
+
+$Get_Current_PDB ENDP
+
+; ==========================================================================
+;
+; Sets the Printer Flag to whatever is in AL.
+; NOTE: THIS PROCEDURE IS SUBJECT TO CHANGE!!!
+;
+; ==========================================================================
+
+ PUBLIC $Set_Printer_Flag
+$Set_Printer_Flag PROC NEAR
+ ASSUME SS:NOTHING
+
+ push ds
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ mov Printer_Flag,AL ; Set printer flag from caller's AL
+ pop ds
+ jmp iret_com
+
+$Set_Printer_Flag ENDP
+
+; ==========================================================================
+;
+; The Quit entry point is where all INT 20h's come from. These are old- style
+; exit system calls. The CS of the caller indicates which Process is dying.
+; The error code is presumed to be 0. We simulate an ABORT system call.
+;
+; ==========================================================================
+
+ PUBLIC System_Call
+System_Call PROC NEAR
+
+ PUBLIC Quit
+Quit: ; entry QUIT
+ xor AH,AH
+ jmp SHORT SavRegs
+
+ ; The system call in AH is out of the range that we know how
+ ; to handle. We arbitrarily set the contents of AL to 0 and
+ ; IRET. Note that we CANNOT set the carry flag to indicate an
+ ; error as this may break some programs compatability.
+
+BadCall:
+ xor AL,AL
+
+ PUBLIC Irett
+Irett:
+ jmp iret_com
+
+ ; An alternative method of entering the system is to perform a
+ ; CALL 5 in the program segment prefix with the contents of CL
+ ; indicating what system call the user would like. A subset of
+ ; the possible system calls is allowed here only the
+ ; CPM-compatible calls may get dispatched.
+
+
+ PUBLIC Call_Entry ; entry Call_Entry
+Call_Entry: ; System call entry point and dispatcher
+ push DS
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ pop SaveDs ; Save original DS
+
+ pop AX ; IP from the long call at 5
+ pop AX ; Segment from the long call at 5
+ pop User_SP ; IP from the CALL 5
+
+ ; Re-order the stack to simulate an
+ ; interrupt 21.
+ pushf ; Start re-ordering the stack
+ invoke DOCLI
+ push AX ; Save segment
+ push User_SP ; Stack now ordered as if INT used
+
+ push SaveDS
+ pop DS
+
+ ASSUME DS:NOTHING
+
+ cmp CL,MaxCall ; Max old style CPM call number
+
+ ja BadCall
+
+ mov AH,CL
+ jmp SHORT SavRegs
+
+ ; This is the normal INT 21 entry point. We first perform a
+ ; quick test to see if we need to perform expensive DOS-entry
+ ; functions. Certain system calls are done without interrupts
+ ; being enabled.
+
+
+ entry COMMAND ; Interrupt call entry point (int 21h)
+
+IF NOT IBM
+
+ cmp AH,SET_OEM_HANDLER
+ jb @F
+
+ jmp $Set_Oem_Handler
+
+@@:
+
+ENDIF
+ invoke DOCLI
+
+ cmp AH,MaxCom ; Max int 21h function call number
+ ja BadCall
+
+ ; The following set of calls are issued by the server at
+ ; *arbitrary* times and, therefore, must be executed on
+ ; the user's entry stack and executed with interrupts off.
+
+SAVREGS:
+
+ifdef NTVDMDBG
+ ; *spagetti*
+ ; WE want to send register info to ntdvm right here
+ ; but can't do it here 'cause jmps in this block
+ ; become out of range
+
+ jmp short DOSDispCall1
+DOSDispCall0:
+endif
+
+ cmp AH,SET_CTRL_C_TRAPPING ; Check Minimum special case #
+ jb SaveAllRegs ; Not special case so continue
+ jnz sch01
+ jmp SetCtrlShortEntry
+sch01:
+
+ cmp AH,SET_PRINTER_FLAG ; Check Max case number
+ ja SaveAllRegs ; Not special case so continue
+ jz $Set_Printer_Flag ; If equal jmp directly to function
+
+ cmp AH,GET_CURRENT_PDB ; Is this a Get PSP call (51h)?
+ jnz gcp01 ; Yes, jmp directly to function
+ jmp $Get_Current_PDB ; Yes, jmp directly to function
+gcp01:
+
+ cmp AH,GETCURRENTPSP ; Is this a Get PSP call (62h)?
+ jnz ddc0 ; Yes, jmp directly to function
+ jmp $GET_CURRENT_PDB ; Yes, jmp directly to function
+ddc0:
+ cmp AH,SET_CURRENT_PDB ; Is this a Set PSP call (50h) ?
+ jnz cmndI ; Yes, jmp directly to function
+ jmp $Set_Current_PDB ; Yes, jmp directly to function
+cmndI:
+
+
+ifdef NTVDMDBG
+ ; put scnam[ah] on the 16 bit stack for demDOSDispCall
+ jmp SaveAllRegs
+
+DOSDispCall1:
+ push ds
+ getdseg <DS>
+ test [SCS_ISDEBUG],ISDBG_SHOWSVC ;special trace flag on?
+ pop ds
+ je DOSDispCall0
+ SVC SVC_DEMDOSDISPCALL
+ jmp short DOSDispCall0
+endif
+
+
+
+SaveAllRegs:
+ push ES
+ push DS
+ push BP
+ push DI
+ push SI
+ push DX
+ push CX
+ push BX
+ push AX
+
+
+ mov AX,DS
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ mov SaveDS, AX ; save caller's DS
+ mov SaveBX,BX
+
+
+ ; M043
+ ; Note: Nsp and Nss have to be unconditionally initialized here
+ ; even if InDOS is zero. Programs like CROSSTALK 3.7 depend on
+ ; this!!!
+ ;
+
+ mov AX,User_SP ; Provide one level of reentrancy for
+ mov Nsp,AX ; int 24 recallability.
+ mov AX,User_SS
+ mov Nss,AX
+
+ xor AX,AX
+ mov fSharing,AL ; allow redirection
+
+ test IsWIN386,1 ; WIN386 patch. Do not update USER_ID
+ jnz @F ; if win386 present
+ mov User_Id,AX
+@@:
+ inc InDos ; Flag that we're in the DOS
+
+ mov User_SP,SP ; Save user's stack
+ mov User_SS,SS
+
+ mov AX,CurrentPDB
+ mov Proc_Id,AX
+ mov DS,AX
+ pop AX
+ push AX
+
+ ASSUME DS:NOTHING
+ mov WORD PTR DS:PDB_User_stack,SP ; for later returns (possibly
+ mov WORD PTR DS:PDB_User_stack+2,SS ; from EXEC)
+
+ getdseg <ss> ; ss -> dosdat, already flag is CLI
+
+ PUBLIC Redisp
+Redisp: ; Entry REDISP
+
+ mov SP,OFFSET DosData:AuxStack ; Enough stack for interrupts
+ invoke DOSTI ; stack is in our space now...
+
+
+ IFDEF DBCS
+ mov BH, BYTE PTR DS:PDB_InterCon ; Get interim mode
+ mov SS:InterCon, BH
+ ENDIF
+
+ mov BX,SS
+ mov DS,BX
+
+ xchg BX,AX
+
+ xor AX,AX
+
+;**RMFHFE** mov Disk_Full,AL ; No disk full
+
+ mov ExtOpen_On,AL ; Clear extended open flag
+
+;; mov Dos34_Flag,AX ; Clear common flag
+ and DOS34_Flag, EXEC_AWARE_REDIR
+ ; M042: clear all bits except bit 11
+
+ mov ConSwap,AL ; random clean up of possibly mis-set flags
+ mov BYTE PTR NoSetDir,AL ; set directories on search
+ mov BYTE PTR FailErr,AL ; FAIL not in progress
+
+ inc AX ; AL = 1
+ mov IdleInt,AL ; presume that we can issue INT 28
+
+ xchg AX,BX ; Restore AX and BX = 1
+
+ mov BL,AH
+ shl BX,1 ; 2 bytes per call in table
+
+ cld
+ ; Since the DOS maintains mucho state information across system
+ ; calls, we must be very careful about which stack we use.
+ ; First, all abort operations must be on the disk stack. This
+ ; is due to the fact that we may be hitting the disk (close
+ ; operations, flushing) and may need to report an INT 24.
+
+ or AH,AH
+ jz DskROut ; ABORT
+
+ ; Second, PRINT and PSPRINT and the server issue
+ ; GetExtendedError calls at INT 28 and INT 24 time.
+ ; This call MUST, therefore, use the AUXSTACK.
+
+ cmp AH,GetExtendedError
+ jz DISPCALL
+
+ ; Old 1-12 system calls may be either on the IOSTACK (normal
+ ; operation) or on the AUXSTACK (at INT 24 time).
+
+ cmp AH,12
+ ja DskROut
+ cmp ErrorMode,0 ; Are we in an INT 24?
+ jnz DispCall ; Stay on AUXSTACK if INT 24.
+ mov SP,OFFSET DosData:IoStack
+ jmp SHORT DispCall
+
+ ; We are on a system call that is classified as "the rest".
+ ; We place ourselves onto the DSKSTACK and away we go. We
+ ; know at this point:
+ ;
+ ; o An INT 24 cannot be in progress. Therefore we reset
+ ; ErrorMode and WpErr
+ ; o That there can be no critical sections in effect. We
+ ; signal the server to remove all the resources.
+
+DskROut:
+ mov User_In_AX,AX ; Remember what user is doing
+ mov ExtErr_Locus,ErrLoc_Unk ; Default
+ mov ErrorMode,0 ; Cannot make non 1-12 calls in
+ mov WpErr,-1 ; error mode, so good place to make
+
+
+; NTVDM - we don't do any critical section stuff
+; 04-Aug-1992 Jonle
+;
+; push AX ; Release all resource information
+; mov AH,82h
+; int Int_IBM
+; pop AX
+;
+
+ ; Since we are going to be running on the DSKStack and since
+ ; INT 28 people will use the DSKStack, we must turn OFF the
+ ; generation of INT 28's.
+
+ mov IdleInt,0
+ mov SP,OFFSET DosData:DskStack
+ test CntCFlag,-1
+ jz DispCall ; Extra ^C checking is disabled
+ push AX
+ invoke DskStatChk
+ pop AX
+
+DispCall:
+ mov BX,CS:Dispatch[BX]
+ xchg BX,SaveBX
+ mov DS,SaveDS
+
+ ASSUME DS:NOTHING
+
+ if DEBUG
+ call PrintCall ; debug print system call
+ endif
+
+ call SS:SaveBX
+
+ ;
+ ; M068
+ ;
+ ; The EXEXA20OFF bit of DOS_FLAG will now be unconditionally cleared
+ ; here. Please see under M003, M009 and M068 tags in dossym.inc
+ ; for explanation. Also NOTE that a call to ExecReady (ax=4b05) will
+ ; return to LeaveDos and hence will not clear this bit. This is
+ ; because this bit is used to indicate to the next int 21 call that
+ ; the previous int 21 was an exec.
+ ;
+ ; So do not add any code between the call above and the label
+ ; LeaveDOS if it needs to be executed even for ax=4b05
+ ;
+
+ and [DOS_FLAG], NOT EXECA20OFF
+
+
+ PUBLIC LeaveDos ; Exit from a system call.
+LeaveDos:
+
+ ASSUME SS:NOTHING ; User routines may misbehave
+ invoke DOCLI
+
+ if DEBUG
+ call PrintRet
+ endif
+
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+
+ ; M004, M068
+ cmp [A20OFF_COUNT], 0 ; M068: Q: is count 0
+ je la2 ; M068: N: dec count and turn a20 off
+ jmp disa20 ; M068: N: dec count and turn a20 off
+la2:
+
+LeaveA20On:
+ dec InDos
+ mov SS,User_SS
+ mov SP,User_SP
+ mov BP,SP
+ mov BYTE PTR [BP.User_AX],AL
+ mov AX,Nsp
+ mov User_SP,AX
+ mov AX,Nss
+ mov User_SS,AX
+
+ pop AX
+ pop BX
+ pop CX
+ pop DX
+ pop SI
+ pop DI
+ pop BP
+ pop DS
+ pop ES
+
+ifdef NTVDMDBG
+ push ds
+ getdseg <DS>
+ test [SCS_ISDEBUG],ISDBG_SHOWSVC ;special trace flag on?
+ pop ds
+ je no_dbg_msg
+ SVC SVC_DEMDOSDISPRET
+no_dbg_msg:
+endif
+iret_com:
+ transfer DOIRET
+
+disa20: ; M068 - Start
+ mov bx, [A20OFF_PSP] ; bx = PSP for which a20 to be off'd
+ cmp bx, [CurrentPDB] ; Q: do the PSP's match
+ je la3 ; N: don't clear bit and don't turn
+ jmp LeaveA20On ; N: don't clear bit and don't turn
+la3:
+ ; a20 off
+ ; Y: turn a20 off and dec a20off_count
+ dec [A20OFF_COUNT] ; M068 - End
+
+ ; Start - M004
+ push ds ; segment of stub
+ mov bx, offset disa20_iret ; offset in stub
+ push bx
+ retf ; go to stub
+ ; End - M004
+
+
+
+System_Call ENDP
+
+; ==========================================================================
+;
+; Restore_World restores all registers ('cept SS:SP, CS:IP, flags) from
+; the stack prior to giving the user control
+;
+; ==========================================================================
+
+procedure Restore_User_World,NEAR
+ ASSUME SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+
+ pop restore_tmp
+ pop AX
+ pop BX
+ pop CX
+ pop DX
+ pop SI
+ pop DI
+ pop BP
+ pop DS
+
+ jmp Restore_Tmp
+
+EndProc restore_User_world
+
+; ==========================================================================
+;
+; Save_World saves complete registers on the stack
+;
+; ==========================================================================
+
+procedure Save_User_World ,NEAR
+ ASSUME SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+
+ pop restore_tmp
+
+ push DS
+ push BP
+ push DI
+ push SI
+ push DX
+ push CX
+ push BX
+ push AX
+
+ push restore_tmp
+
+; cli ; M045 - start
+; xchg BP, SP
+; mov ES, [BP+18]
+; assume ES:NOTHING
+; xchg SP,BP
+; sti
+
+ push BP
+ mov BP, SP
+ mov ES, [BP+20] ; es was pushed before call
+ assume ES:NOTHING
+ pop BP ; M045 - end
+
+ ret
+
+EndProc save_user_world
+
+; ==========================================================================
+;
+; Get_User_Stack returns the user's stack (and hence registers) in DS:SI
+;
+; ==========================================================================
+
+procedure Get_User_Stack,NEAR
+
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+ lds SI,DWORD PTR User_SP
+ return
+
+EndProc Get_User_Stack
+
+; ==========================================================================
+;
+; Set_OEM_Handler -- Set OEM sys call address and handle OEM Calls
+; Inputs:
+; User registers, User Stack, INTS disabled
+; If CALL F8, DS:DX is new handler address
+; Function:
+; Process OEM INT 21 extensions
+; Outputs:
+; Jumps to OEM_HANDLER if appropriate
+;
+; ==========================================================================
+IF NOT IBM
+
+$Set_Oem_Handler:
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+
+ push es
+ getdseg <es> ; es -> dosdata
+
+ jne Do_Oem_Func ; If above F8 try to jump to handler
+ mov WORD PTR Oem_Handler,DX ; Set Handler
+ mov WORD PTR Oem_Handler+2,DS
+
+ pop ES
+ jmp iret_com ; Quick return, Have altered no registers
+
+
+DO_OEM_FUNC:
+ cmp WORD PTR Oem_Handler,-1
+ jnz Oem_Jmp
+
+ pop ES
+ jmp BadCall ; Handler not initialized
+
+OEM_JMP:
+ push ES
+ pop DS
+ pop ES
+
+ ASSUME DS:DosData
+
+ jmp Oem_Handler
+
+ENDIF
+
+
+
+; ==========================================================================
+;
+; PrintCall - Debug Printout of System Call
+;
+; If system call printout is turned on, print
+;
+; S:<name> ax bx cx dx si di bp ds es
+;
+; ENTRY registers as from user program
+; EXIT none
+; USES flags
+;
+; ==========================================================================
+
+IF DEBUG
+
+ ASSUME DS:nothing,ES:nothing,SS:DOSDATA
+ DPUBLIC PrintCall
+PrintCall PROC Near
+
+ test BugTyp,TypSyscall
+ retz
+ ; Going to print the sucker out.
+ ; Lookup the name string
+ SAVE <BX>
+ sub BX,BX
+ mov BL,AH
+ add BX,BX
+ mov BX,scptrs[BX] ; (cs:bx) = address of name string
+ FMT TypSyscall, LevLog, <"S:$S">,<cs, bx>
+ RESTORE <BX>
+ FMT TypSyscall, LevLog, <" a-d=$x $x $x $x">,<AX,BX,CX,DX>
+ FMT TypSyscall, LevLog, <" sd=$x $x de=$x $x\n">,<si,di,ds,es>
+prcalx: ret
+
+PrintCall ENDP
+
+; ==========================================================================
+;
+; PrintRet - Debug Printout of System Call Return
+;
+; If system call printout is turned on, print
+;
+; " OK: ax bx cx dx si di" -or-
+; " ERROR: ax bx cx dx si di"
+;
+; ENTRY registers as from user program
+; EXIT none
+; USES none
+; ==========================================================================
+
+ DPUBLIC PrintRet
+
+ ASSUME DS:nothing,ES:nothing,SS:nothing
+PrintRet PROC NEAR
+ pushf
+
+ getdseg <DS> ; DS -> DosData, ASSUME DS:DosSeg
+
+ test BugTyp,TypSyscall
+ LJZ pretx
+
+ SAVE <ds, si> ; Am to print return code
+ call Get_User_Stack
+
+ ASSUME DS:nothing
+
+ test [SI.user_F],f_Carry ; signal carry to user
+ jnz pret2 ; have error
+ FMT TypSyscall, LevLog, <" OK: ">
+ jmp SHORT Pret4
+
+Pret2: FMT TypSyscall, LevLog, <" ERROR: ">
+
+Pret4: FMT TypSyscall, LevLog, <" $x $x $x">,<User_AX[si],User_BX[si],User_CX[si]>
+ FMT TypSyscall, LevLog, <" $x $x $x\n">,<User_DX[si],User_SI[si],User_DI[si]>
+ RESTORE <SI, DS>
+Pretx: popf
+ ret
+
+PRINTRET ENDP
+
+endif
+
+
+; ==========================================================================
+
+DOSCODE ENDS
+
+; ==========================================================================
+
+ END
+
+; ==========================================================================
+
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msdos.lnk b/private/mvdm/dos/v86/doskrnl/dos/msdos.lnk
new file mode 100644
index 000000000..db0855039
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msdos.lnk
@@ -0,0 +1,41 @@
+ origin.obj +
+ msdata.obj +
+ mstable.obj +
+ msdisp.obj +
+ mscode.obj +
+ msdosme.obj +
+ time.obj +
+ getset.obj +
+ parse.obj +
+ misc.obj +
+ misc2.obj +
+ cpmio.obj +
+ cpmio2.obj +
+ fcbio.obj +
+ fcbio2.obj +
+ search.obj +
+ path.obj +
+ ioctl.obj +
+ dup.obj +
+ open.obj +
+ abort.obj +
+ disk.obj +
+ dir2.obj +
+ dev.obj +
+ fcb.obj +
+ msctrlc.obj +
+ msproc.obj +
+ alloc.obj +
+ srvcall.obj +
+ segcheck.obj +
+ util.obj +
+ handle.obj +
+ macro.obj +
+ macro2.obj +
+ file.obj +
+ lock.obj +
+ exepatch.obj +
+ msinit.obj
+NTDOS.EXE
+NTDOS.MAP;
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msdos.skl b/private/mvdm/dos/v86/doskrnl/dos/msdos.skl
new file mode 100644
index 000000000..c47c2e25c
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msdos.skl
@@ -0,0 +1,32 @@
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+:class 1
+; This was taken from DEVMES.INC IN G:USA\ ...
+; DIVMES DB 13,10,"Divide overflow",13,10
+
+:use 001 msdos DIVMES
+
+:class 2
+
+:use 004 msdos XMMERRMSG
+
+:class 3
+
+;This is for Yes No check
+:use 005 msdos NLS_YES
+:use 006 msdos NLS_NO
+:use 002 msdos NLS_yes2
+:use 003 msdos NLS_no2
+
+:class 4
+
+; New error message if Windows VxD is not found ; M018
+
+:use 007 msdos NoVxDErrMsg
+:end
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msdosme.asm b/private/mvdm/dos/v86/doskrnl/dos/msdosme.asm
new file mode 100644
index 000000000..bfe761ea9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msdosme.asm
@@ -0,0 +1,16 @@
+;** Standard device IO for MSDOS (first 12 function calls)
+;
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include mssw.asm
+ include dosseg.inc
+ .cref
+ .list
+
+ TITLE IBMDOSMES - DOS OEM dependancies
+ NAME IBMDOSMES
+
+include dosmes.inc
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msinit.asm b/private/mvdm/dos/v86/doskrnl/dos/msinit.asm
new file mode 100644
index 000000000..aa2bee8e3
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msinit.asm
@@ -0,0 +1,1382 @@
+;** msinit.asm -- ms-dos initialization code
+;
+; an000 version 4.0 jan. 1988
+; an007 ptm 3957 - fake version for ibmcache.com
+; an008 ptm 4070 - fake version for ms windows
+;
+;
+;
+;
+;
+; Revision History
+; ================
+;
+; M019 SR 08/30/90 Changed number of instance items for
+; Win 3.1 UMB support.
+;
+; M020 : Fix for Rational bug for details see exepatch.asm
+;
+; M023 SR 09/7/90 Initialize exepatch & Rational patch
+; ptrs here. Previous init in lmstub.asm
+; causes extrn problems when msdata is
+; linked in by other utilities e.g.Share
+;
+; M068 - support for copy protected apps.
+;
+; sudeepb 06-Mar-1991 Ported for DOSEm
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dossym.inc
+ include mssw.asm
+ include dosseg.inc
+ include sf.inc
+ include curdir.inc
+ include arena.inc
+ include vector.inc
+ include devsym.inc
+ include pdb.inc
+ include find.inc
+ include mi.inc
+ include xmm.inc
+ include dossvc.inc
+ include cmdsvc.inc
+ include dbgsvc.inc
+ include dpb.inc
+ installed = true
+
+
+ include sysvar.inc
+ include doscntry.inc
+ include fastopen.inc
+ include bugtyp.inc
+ include cputype.inc ; M020
+
+ include win386.inc ;Win386 constants
+ include doswow.inc
+
+ .cref
+ .list
+
+
+
+
+BData segment at 70h
+
+ extrn DosDataSg:word ; using this to access the data seg
+
+
+BData ends
+
+;
+; This macro gets the DOS data segment value and puts it in the specified
+; segment register. This is the init segment version of GetDseg in dosmac
+;
+
+InitGetdseg macro r
+
+ mov r, cs:[DosDseg]
+ assume r:dosdata
+endm
+
+
+
+
+DOSDATA SEGMENT
+ extrn SCS_Is_Dos_Binary:byte
+ extrn SCS_FDACCESS:word
+ extrn DosWowDataStart:dword
+ extrn vheVDM:byte
+ extrn SCS_COMSPEC:byte
+ extrn EXTERR_LOCUS:byte
+ extrn dmaadd:dword ; current dma address
+ extrn DPBHead:dword ; long pointer to dpb chain(NT:always -1)
+ extrn sft_addr:dword ; pointer to open file list
+ extrn numio:byte ; number of physical drives
+ extrn endmem:word ; first unavailable address in memory
+ extrn currentpdb:word ; current process id
+ extrn createpdb:byte ; true => create a new pdb
+ extrn arena_head:word ; paragraph address of head of arena
+ extrn sftabl:byte ; internal file table
+ extrn sysinitvar:byte ; label for internal structures
+ extrn nuldev:dword ; long pointer to device chain
+ extrn bcon:dword ; pointer to console device
+ extrn bclock:dword ; pointer to clock device
+ extrn callunit:byte ; unit field in dd packet
+ extrn callbpb:dword ; returned bpb from dd
+ extrn maxsec:word
+ extrn dskchret:byte
+ extrn devcall:byte
+ extrn jshare:dword
+ extrn country_cdpg:byte ; country info table, dos 3.3
+ extrn sysinittable:byte ; sys init table for sysinit
+ extrn fastopentable:byte ; table for fastopen
+ extrn special_entries:word ; address of special entries ;an007;
+ extrn hashinitvar:word ; hash table variables ;an000;
+ extrn packet_temp:word ; used for initial hash table;an000;
+
+
+ extrn user_ss:word
+ extrn user_sp:word
+
+ extrn msdat001e:byte ; end of dosdata segment
+ extrn msct001s:byte ; start of dosdata segment
+
+ extrn XMMcontrol:dword ; entry into BIOS xmm driver
+ extrn dosinttable:dword ; int vec table for DOS
+
+ extrn dskstack:byte
+ extrn temp_dosloc:word ; stores the temp. location of DOS seg
+
+; WIN386 instance table variables
+
+ extrn Win386_Info:byte, Instance_Table:word
+
+;Win386 2.xx instance table
+
+ extrn OldInstanceJunk: word
+
+
+ extrn i0patch:word
+ extrn i20patch:word
+ extrn i21patch:word
+ extrn i25patch:word
+ extrn i26patch:word
+ extrn i27patch:word
+ extrn i2fpatch:word
+ extrn cpmpatch:word
+ extrn BiosDataPtr:dword ;ptr to BIOS data exchange block
+ extrn DosHasHMA:byte ; M021
+ extrn RationalPatchPtr:word ; M020
+ extrn fixexepatch:word
+ extrn ChkCopyProt:word ; M068
+ extrn SCS_ISDEBUG:byte
+
+DOSDATA ENDS
+
+
+DOSCODE SEGMENT
+
+ extrn irett:near
+ extrn int2f:near
+ extrn call_entry:near
+ extrn quit:near
+ extrn command:near
+ extrn absdrd:near
+ extrn absdwrt:near
+ extrn divov:near
+ extrn stay_resident:near
+
+ extrn lirett:near
+ extrn lint2f:near
+ extrn lcall_entry:near
+ extrn lquit:near
+ extrn lcommand:near
+ extrn labsdrd:near
+ extrn labsdwrt:near
+ extrn ldivov:near
+ extrn lstay_resident:near
+
+ extrn $startcode:word
+ extrn header:byte
+
+
+ extrn exepatch:near ; Routine in exepatch.asm
+ extrn exepatch_start:byte ; in exepatch.asm
+ extrn RationalPatch:near ; M020
+ extrn RetExePatch:near ; M023
+ extrn IsCopyProt:near ; M068
+
+ extrn LowInt23Addr:dword
+ extrn LowInt24Addr:dword
+ extrn LowInt28Addr:dword
+
+ extrn dosdseg:word ; used by InitGetDseg macro
+
+
+ public sysbuf
+
+sysbuf label word
+
+ ASSUME cs:doscode,ds:nothing,es:nothing,ss:nothing
+
+
+; temp iret instruction
+
+initiret:
+ IRET
+
+; pointer to the BIOS data segment that will be available just to the
+; initialization code
+
+InitBioDataSeg dw 70H
+
+
+; Convert AX from a number of bytes to a number of paragraphs (round up).
+ParaRound proc near
+ add ax, 15
+ rcr ax, 1
+ shr ax, 1
+ shr ax, 1
+ shr ax, 1
+ ret
+ParaRound endp
+
+
+;
+; MAIN ENTRY FOR DOS INITIALIZATION
+;
+
+ ENTRY DosInit
+
+ invoke DOCLI
+ cld
+
+; save parameters from BIOS
+
+ push dx ; dx = memory size
+ push si ; ds:si = device list
+ push ds ; es:di = BiosComBlock
+ push di
+ mov bx,es ;bx:di = ptr to BiosComBlock
+
+
+; First, move the DOS data segment to its final location in low memory
+;
+; BUGBUG sudeepb 06-Mar-1991: Rather than using cs:[memstrt] below as
+; the source address use [memstrt>>4]:0. Allows bigger data segment.
+
+ mov ax, offset memstrt ; get offset of end of init code
+
+ add ax, 15 ; round to nearest paragraph
+ and ax, not 15 ; boudary
+
+ mov si, ax ; si = offset of DOSDATA in current
+ ; code segment
+ mov ax, cs
+ mov ds, ax ; ds = current code segment
+ ; DS:SI now points to dosdata
+
+ mov es, cs:[InitBioDataSeg] ; First access to DosDataSg in
+ ; BData segment. Cannot use
+ ; getdseg macro here!!!
+ assume es:BData
+ mov es, es:[DosDataSg] ; Get free location in low memory
+ assume es:nothing
+ xor di, di ; ES:DI now points to RAM data
+
+ mov cx, offset MSDAT001e ; get end of dosdata = size of dosdata
+ rep movsb ; move data to final location
+
+
+ pop di ;restore ptr to BiosComBlock
+ pop ds ; restore parms from BIOS
+ pop si
+ pop dx
+
+ push es
+ push ds
+ pop es ; es:si -> device chain
+ pop ds ; ds points to dosdata
+
+ assume ds:dosdata
+
+ push es
+ mov es, bx
+ mov al, byte ptr es:[di+1] ; DemInfoFlag from BiosComBlock
+ mov [SCS_ISDEBUG],al
+ pop es
+
+ SVC SVC_DEMGETDRIVES
+ mov [numio],al
+
+ test [SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je @f
+ SAVEREG <ax,bx,dx,di,es>
+ mov bx, cs ; current base of DOS
+ xor cx, cx
+ mov dx, offset memstrt ; get offset of end of code
+ add dx, offset MSDAT001e ; add in length of data segment
+ adc cx, 0 ; cx:dx now size
+
+ mov ax, SYMOP_LOAD SHL 8 + ID_NTDOS
+ SVC SVC_DEMSYSTEMSYMBOLOP
+
+ mov bx, 2 ; bugbug: Hardcoded segment number
+ mov es, es:[DosDataSg] ; Get location of dos data
+
+ mov ax, SYMOP_MOVE SHL 8 + ID_NTDOS
+ SVC SVC_DEMSYSTEMSYMBOLOP
+
+ RESTOREREG <es,di,dx,bx,ax>
+@@:
+
+ push dx
+ mov ax, offset DOSDATA:DMAADD
+ mov dx, offset DOSDATA:CurrentPDB
+
+; RLF 10/16/92
+; Need to set EXTERR info from 32-bit side when reading named pipes. The reason
+; for this is a 'hack' fix to the real 16-bit redir which needs to indicate more
+; data received to 16-bit apps. The way they do this is to reset the extended
+; error information for a successful read, and set it to more data error if the
+; app's buffer is not large enough for all the available data
+
+ push cx ; for good measure
+ mov cx,offset dosdata:EXTERR_LOCUS
+ push si
+ mov si,offset dosdata:DosWowDataStart ; ds:si ->DosWowData
+ SVC SVC_DEMSETDTALOCATION ; ds:ax is the address of DMAADD
+ ; ds:dx is CurrentPDB
+ ; ds:cx is EXTERR_LOCUS
+ pop si
+ ;pop cx
+
+ mov dx, offset dosdata:vheVDM
+
+ push bx
+ mov bx, offset dosdata:nuldev
+
+ SVC SVC_DEMSETHARDERRORINFO ; ds:dx is VHE
+ ; ds:bx is device chain
+
+
+ mov dx, offset dosdata:SCS_COMSPEC
+ mov bx, offset dosdata:SCS_Is_Dos_Binary
+ mov cx, offset dosdata:SCS_FDACCESS
+
+ CMDSVC SVC_CMDSETINFO ; ds:dx is pointer to SCSINFO structure
+ ; DS:BX is pointer to SCS_Is_Dos_Binary
+ ; DS:CX is pointer to SCS_FDACCESS
+ pop bx
+ pop cx
+ pop dx
+
+;We get a ptr to the BIOS exchange data block. This has been setup right
+;now so that the EXEC call knows when SysInit is present to do the special
+;lie table handling for device drivers. This can be expanded later on to
+;establish a communication block from the BIOS to the DOS.
+;
+
+ mov word ptr BiosDataPtr,di ;save ptr to BiosComBlock
+ mov word ptr BiosDataPtr+2,bx
+
+
+ mov [dosdseg], ds ; set pointer to dosdata in code seg
+
+ ;
+ ; Set the segment of Lowint23/24/28Addr in msctrlc.asm to dosdata
+ ;
+
+ mov word ptr [LowInt23Addr+2], ds ; set pointers in code seg
+ mov word ptr [LowInt24Addr+2], ds
+ mov word ptr [LowInt28Addr+2], ds
+
+
+ mov [endmem],dx
+ mov [user_sp],sp
+ mov [user_ss],ss
+
+ mov ax,ds ; set up ss:sp to dosdata:dskstack
+ mov ss,ax
+ assume ss:dosdata
+
+ mov sp,offset dosdata:dskstack
+
+;M023
+; Init patch ptrs to default values
+;
+ mov FixExePatch, offset DOSCODE:RetExePatch ; M023
+ mov [RationalPatchPtr], offset DOSCODE:RetExePatch ; M023
+ mov [ChkCopyProt], offset DOSCODE:RetExePatch ; M068
+
+ ; Set up the variable temp_dosloc to point to the dos code segment
+
+ mov ax, cs ; ax = current segment of DOS code
+
+ ; ax now holds segment of DOS code
+ mov [temp_dosloc], ax ; store temp location of DOS
+
+
+ mov word ptr [nuldev+2],es ; nuldev -> points to device chain
+ mov word ptr [nuldev],si
+
+; There are some locations in the Win386 instance data structures
+; which need to be set up with the DOS data segment. First, initialize
+; the segment part of the instance table pointer in the SIS.
+
+ mov word ptr [Win386_Info + SIS_Instance_Data_Ptr + 2], ds
+
+; Now initialize the segment part of the pointer to the data in each
+; instance table entry.
+
+ push si ; preserve pointer to device chain
+ mov cx, 7 ; There are 7 entries in the instance table
+ ; M019
+ mov si, (offset dosdata:Instance_Table) + 2 ; point si to segment field
+Instance_init_loop:
+ mov word ptr ds:[si], ds ; set offset in instance entry
+ add si, (size Win386_IIS) ; move on to next entry
+ loop Instance_init_loop
+
+
+;Initialize the WIN386 2.xx instance table with the DOS data segment value
+
+ mov cx, 5 ; There are five entries in the instance table
+ mov si, (offset dosdata:OldInstanceJunk) + 6
+ ; point si to segment field
+OldInstance_init_loop:
+ mov word ptr ds:[si], ds ; set offset in instance entry
+ add si, 6 ; move on to next entry
+ loop OldInstance_init_loop
+ pop si ; restore pointer to device chain
+;
+;End of WIN386 2.xx compatibility bullshit
+
+ push es
+ pop ds
+ assume ds:nothing ; ds:si points to console device
+
+
+ ; need crit vector inited to use deviocall
+ push ds ; preserve segment of device chain
+ xor ax,ax
+ mov ds,ax ; point DS to int vector table
+ mov ax,offset initiret
+ mov word ptr ds:[addr_int_ibm],ax
+ mov ax,cs
+ mov word ptr ds:[addr_int_ibm+2],ax
+ pop ds ; restore segment of device chain
+
+ call charinit ; initialize console driver
+ push si ; save pointer to header
+
+ push ss ; move pointer to dos data...
+ pop es ; ...into ES
+ assume es:dosdata
+
+ ;initialize sft for file 0 (CON)
+
+ mov di,offset dosdata:sftabl + sftable
+ mov ax,3
+ stosw ; refcount
+ dec al
+ .errnz sf_mode-(sf_ref_count+2)
+ stosw ; access rd/wr, compatibility
+ xor al,al
+ .errnz sf_attr-(sf_mode+2)
+ stosb ; attribute
+ mov al,devid_device_eof or devid_device or iscin or iscout
+ .errnz sf_flags-(sf_attr+1)
+ stosw ; flags
+ mov ax,si
+ .errnz sf_devptr-(sf_flags+2)
+ stosw ; device pointer in devptr
+ mov ax,ds
+ stosw
+ xor ax,ax
+ .errnz sf_time-(sf_devptr+4)
+ stosw ; time
+ .errnz sf_date-(sf_time+2)
+ stosw ; date
+ dec ax
+ .errnz sf_size-(sf_date+2)
+ stosw ; size
+ stosw
+ inc ax
+ .errnz sf_position-(sf_size+4)
+ stosw ; position
+ stosw
+ pop si ; get back pointer to header
+
+ ; mark device as CON I/O
+ or byte ptr [si.sdevatt],iscin or iscout
+ mov word ptr [bcon],si
+ mov word ptr [bcon+2],ds
+
+ ; initialize each device until the clock device is found
+
+char_init_loop:
+ lds si,dword ptr [si] ; aux device
+ call charinit
+ test byte ptr [si.sdevatt],isclock
+ jz char_init_loop
+
+ mov word ptr [bclock],si ; bclock -> clock device
+ mov word ptr [bclock+2],ds
+
+ mov bp,offset MSDAT001e ; bp = pointer to free mem
+ mov word ptr DPBHead, bp
+ mov word ptr DPBHead + 2,es
+
+perdrv:
+ lds si,SDEVNEXT [si] ; next device
+ cmp si,-1 ; Q: any more devices
+ je continit ; N: goto continit
+ call charinit ; Y: initialize the device
+ jmp short perdrv ; Scan device list more
+
+
+continit:
+
+ SVC SVC_DEMGETDPBLIST
+
+ cmp bp,offset MSDAT001e
+ jne dpblistok
+
+ mov word ptr DPBHead, -1 ; no dpbs
+ mov word ptr DPBHead + 2, -1
+
+dpblistok:
+
+ push ss
+ pop ds
+
+ assume ds:dosdata
+
+ mov ax,bp
+ call ParaRound ; round up to segment
+
+ mov dx,ds ; dx = dosdata segment
+ add dx,ax ; dx = ds+ax first free segment
+ mov bx,0fh
+ mov cx,[endmem]
+
+
+ ; set seg inpacketto dosdata
+ mov word ptr [dskchret+3],ds
+
+
+; Patch in the segments of the interrupt vectors with current code segment.
+; Also patch in the segment of the pointers in the dosdata area.
+;
+; Note: Formerly, temp_dosloc was initialized to -1 until after these
+; calls were done. The procedure patch_misc_segments is called multiple
+; times, and relies on temp_dosloc being initialized to -1 as a flag
+; for the first invocation. Thus, we must set it to -1 for this call.
+
+
+ push dx ; preserve first free segment
+ mov ax, [temp_dosloc] ; ax = segment to patch in
+ mov es, ax ; es = segment of DOS
+ mov [temp_dosloc], -1 ; -1 means first call to patch_misc_segments
+
+ call patch_vec_segments ; uses AX as doscode segment
+ call patch_misc_segments ; patch in segments for sharer and
+ ; other tables with seg in ES.
+ mov [temp_dosloc], es ; put back segment of dos code
+
+ pop dx ; restore first free segment
+
+
+;
+; We shall now proceed to set the offsets of the interrupt vectors handled
+; by DOS to their appropriate values in DOSCODE. In case the DOS loads in
+; HIMEM the offsets also will be patched to their appropriate values in the
+; low_mem_stub by seg_reinit.
+;
+
+ xor ax,ax
+ mov ds,ax
+ mov es,ax
+assume ds:nothing,es:nothing
+
+ ; set the segment of int 24 vector that was
+ ; left out by patch_vec_segments above.
+
+ mov di, 4 * int_fatal_abort
+ mov ax, [temp_dosloc]
+ mov [di+2], ax
+ mov di,intbase+2
+
+ ; set default divide trap offset
+
+ mov word ptr ds:[0],offset doscode:divov
+
+ ; set vectors 20-28 and 2a-3f to point to iret.
+
+ mov di,intbase
+ mov ax,offset doscode:irett
+ mov cx,9 ; set 9 offsets (skip 2 between each)
+ ; sets offsets for ints 20h-28h
+iset1:
+ stosw
+ add di,2
+ loop iset1
+
+ add di,4 ; skip vector 29h
+
+ mov cx,6 ; set 6 offsets (skip 2 between each)
+ ; sets offsets for ints 2ah-2fh
+iset2:
+ stosw
+ add di,2
+ loop iset2
+
+; 30h & 31H is the CPM call entry point whose segment address is set up by
+; patch_vec_segments above. So skip it.
+
+ add di,8 ; skip vector 30h & 31h
+
+
+ mov cx,14 ; set 14 offsets (skip 2 between each)
+ ; sets offsets for ints 32h-3fh
+iset3:
+ stosw
+ add di,2
+ loop iset3
+
+
+if installed
+ ; set the offset of int2f handler
+ mov word ptr ds:[02fh * 4],offset doscode:int2f
+ ; set segment to doscode as we we have to do int 2f to check for XMS
+ mov ax, [temp_dosloc] ; get segment of doscode
+ mov word ptr ds:[(02fh * 4) + 2], ax
+endif
+
+ ; set up entry point call at vectors 30-31h. Note the segment of the
+ ; long jump will be patched in by seg_reinit
+
+ mov byte ptr ds:[entrypoint],mi_long_jmp
+ mov word ptr ds:[entrypoint+1],offset doscode:call_entry
+
+
+ mov word ptr ds:[addr_int_abort],offset doscode:quit
+ mov word ptr ds:[addr_int_command],offset doscode:command
+ mov word ptr ds:[addr_int_terminate],100h
+ mov word ptr ds:[addr_int_terminate+2],dx
+ mov word ptr ds:[addr_int_disk_read],offset doscode:absdrd
+ mov word ptr ds:[addr_int_disk_write],offset doscode:absdwrt
+ mov word ptr ds:[addr_int_keep_process],offset doscode:stay_resident
+
+ push ss
+ pop ds
+ push ss
+ pop es
+assume ds:dosdata,es:dosdata
+
+ push dx ; remember address of arena
+
+ inc dx ; leave room for arena header
+ mov [currentpdb], dx ; set current pdb
+
+ xor di, di ; point es:di at end of memory
+ mov es, dx ; ...where psp will be
+ assume es:nothing
+ xor ax, ax
+ mov cx, 80h ; psp is 128 words
+ rep stosw ; zero out psp area
+ mov ax,[endmem]
+
+ invoke setmem ; build psp at dx; ax is memory size
+
+ ; ds, es now point to PSP
+
+ assume ds:nothing,es:nothing
+
+ push ss
+ pop ds
+ assume ds:dosdata
+
+ mov di,pdb_jfn_table ; es:di -> pdb_jfn_table in psp
+ xor ax,ax
+ stosw
+ stosb ; 0,1 and 2 are con device
+ mov al,0ffh
+ mov cx,filperproc - 3
+ rep stosb ; rest are unused
+
+ push ss
+ pop es
+ assume es:dosdata
+ ; must be set to print messages
+ mov word ptr [sft_addr+2],ds
+
+
+; after this point the char device functions for con will work for
+; printing messages
+
+ if (not ibm) or (debug)
+ mov si,offset doscode:header
+outmes:
+ lods cs:byte ptr [si]
+ cmp al,"$"
+ jz outdone
+ invoke outt
+ jmp short outmes
+outdone:
+ push ss ; out stomps on segments
+ pop ds
+ push ss
+ pop es
+ endif
+
+if DEBUG
+ mov ax,11100011b
+ sub dx,dx
+ int 14h ; init serial port, 9600 baud
+endif
+ fmt TypSysCall,LevLog,<"Start Boot - CS=$x\n">,<CS>
+
+ ; at this point es is dosdata
+
+ ; Fill in the segment addresses of sysinitvar and country_cdpg
+ ; in sysinittable (ms_data.asm)
+
+ mov si,offset dosdata:sysinittable
+ mov word ptr es:[si.sysi_country_tab + 2],es
+ mov word ptr es:[si.sysi_initvars + 2],es
+
+ pop dx ; restore address of arena
+
+ mov word ptr [dmaadd+2],dx
+
+ mov es:[arena_head],dx
+ mov ds, dx
+ assume ds:nothing
+
+ mov ds:[arena_signature],arena_signature_end
+ mov ds:[arena_owner],arena_owner_system
+ mov ax, [endmem]
+ sub ax, dx
+ dec ax
+ mov ds:[arena_size],ax
+
+ ; point to sft 0
+
+ mov di,offset dosdata:sftabl + sftable
+ mov ax,3
+ stosw ; adjust refcount
+
+ ; es:di is shared data area i.e., es:di -> dosdata:sysinttable
+
+ mov di,offset dosdata:sysinittable
+
+ inc dx ; advance dx from arena to psp
+ mov ds, dx ; point ds to psp
+
+ if not installed
+ invoke netwinit
+ endif
+
+ ; pass the address os seg_reinit
+ ; in dx
+ mov dx, offset seg_reinit
+ mov cx, offset doscode:exepatch_start
+ sub cx, offset $startcode ; cx = (doscode - exepatch) - dosinit
+ mov ax, offset doscode:sysbuf
+ sub ax, offset $startcode ; ax=size of doscode - dosinit
+
+
+ mov sp,[user_sp] ; use ss override for next 2
+ mov ss,[user_ss]
+ assume ss:nothing
+
+ retf
+
+;
+; END OF DOSINIT
+;
+;--------------------------------------------------------------------------
+
+
+
+ assume ds:nothing,es:nothing,ss:dosdata
+charinit:
+ ; ds:si points to device header
+ mov [devcall.reqlen],dinithl
+ mov [devcall.requnit],0
+ mov [devcall.reqfunc],devinit
+ mov [devcall.reqstat],0
+ push es
+ push bx
+ push ax
+ mov bx,offset dosdata:devcall
+ push ss
+ pop es
+ invoke deviocall2
+ pop ax
+ pop bx
+ pop es
+ ret
+
+
+
+;-----------------------------------------------------------------------------
+;
+; check_XMM: routine to check presence of XMM driver
+;
+; Exit: Sets up the XMM entry point in XMMcontrol in DOSDATA
+;
+; USED: none
+;
+;-----------------------------------------------------------------------------
+
+check_XMM proc near
+;
+; determine whether or not an XMM driver is installed
+;
+ push ax
+ mov ax,XMM_MULTIPLEX SHL 8 + XMM_INSTALL_CHECK
+ int 2Fh
+ cmp al,80h ; Q: installed
+ jne short cXMM_no_driver ; N: set error, quit
+;
+; get the XMM control functions entry point, save it, we
+; need to call it later.
+;
+ push bx
+ push dx
+ push ds
+ push es
+ mov ax,XMM_MULTIPLEX SHL 8 + XMM_FUNCTION_ADDR
+ int 2Fh
+
+ InitGetdseg <ds>
+
+ mov word ptr [XMMcontrol], bx
+ mov word ptr [XMMcontrol+2],es
+
+cXMMexit:
+ clc
+ pop es
+ pop ds
+ pop dx
+ pop bx
+ pop ax
+ ret ; done
+;
+; set carry if XMM driver not present
+;
+cXMM_no_driver:
+ stc
+ pop ax
+ ret
+
+check_XMM endp
+
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : seg_reinit
+;
+; Inputs : ES has final dos code location
+; AX = 0 / 1
+;
+; Outputs : Patch in the sharer and other tables with seg in ES
+; if AX =0
+; if first entry
+; patch segment & offset of vectors with stub
+; and stub with segment in ES
+; else
+; patch stub with segment in ES
+;
+; else if AX = 1
+; patch segment of vectors with segment in ES
+;
+; NOTE : This routine can be called at most twice!
+;
+; Regs Mod. : es, ax, di, cx, bx
+;-----------------------------------------------------------------------------
+
+num_entry db 0 ; keeps track of the # of times this routine
+ ; has been called. (0 or 1)
+seg_reinit proc far
+
+ push ds
+
+ InitGetdseg <ds>
+ assume ds:DOSDATA
+;
+; Symbol file support
+;
+ cmp num_entry, 0
+ jz @f
+ test [SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je @f
+ SAVEREG <ax,bx>
+ mov bx, 1 ; bugbug: Hardcoded segment number
+ mov ax, (SYMOP_MOVE + SYMOP_CLEANUP) SHL 8 + ID_NTDOS
+ SVC SVC_DEMSYSTEMSYMBOLOP ; segment already in es
+ RESTOREREG <bx,ax>
+@@:
+
+ call patch_misc_segments ; patch in segments for sharer and
+ ; other tables with seg in ES.
+
+ cmp ax, 0
+ je short no_patch
+ jmp patch_vec_seg ; patch vectors with segment in es
+
+no_patch:
+
+ cmp num_entry, 0 ; Q: is it the first call to this
+ jne second_entry ; N: just patch the stub with
+ ; segment in ES
+ ; Y: patch the vectors with stub
+ mov ax, ds
+ call patch_vec_segments ; patch the segment of vectors
+ call patch_offset ; patch the offsets of vectors
+ ; with those in the stub.
+
+second_entry:
+ mov ax, es ; patch the stub with segment in es
+
+ mov di, OFFSET DOSDATA:DOSINTTABLE
+ mov cx, 9
+ push ds
+ pop es ; es:di -> DOSINTTABLE
+
+dosinttabloop:
+ add di, 2
+ stosw
+ loop dosinttabloop
+
+ cmp ax, 0f000h ; Q: is the DOS running in the HMA
+ jb short sr_done ; N: done
+ call check_XMM ; Y: set up the XMS entry point
+ jc sr_done ; failed to set up XMS do not do
+ ; A20 toggling in the stub.
+ call patch_in_nops ; enable the stub to check A20 state
+
+; M021-
+ mov [DosHasHMA], 1 ; set flag telling DOS control of HMA
+
+ ; set pointer to the routine that
+ ; patches buggy exepacked code.
+ mov [fixexepatch], offset DOSCODE:exepatch
+
+ ; M068: set pointer to the routine
+ ; M068: that detects copy protected
+ ; M068: apps
+ mov [ChkCopyProt], offset DOSCODE:IsCopyProt
+
+; M020 - begin
+
+ get_cpu_type
+ cmp al, 1
+ jne sr_done ; we need Rational Patch only
+ ; on 286 systems
+ mov [RationalPatchPtr], offset DOSCODE:RationalPatch
+
+; M020 - end
+
+ jmp short sr_done
+
+
+patch_vec_seg: ; patch vectors with segment in es
+
+ mov ax, es
+ call patch_vec_segments ; patch in DOSCODE for the segments
+ ; NOTE we don't have to patch the
+ ; offsets as they have been already
+ ; set to the doscode offsets at
+ ; DOSINIT.
+
+sr_done:
+ mov num_entry, 1
+ pop ds
+ ret
+
+seg_reinit endp
+
+
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : patch_vec_segments
+;
+; Inputs : ax -> has segment address to patch in
+; ds -> DOSDATA
+;
+; Outputs : Patches in AX as the segment for the following vectors:
+;
+; 0,20-28,3a-3f
+;
+; Regs. Mod. : DI,CX,DX,AX
+;
+;----------------------------------------------------------------------------
+
+patch_vec_segments proc near
+
+ push es
+
+ xor cx,cx
+ mov es,cx
+assume es:nothing
+
+ mov di,intbase+2 ; di -> segment of int 20 vector
+
+ mov es:[2],ax ; segment of default divide trap handler
+
+ ; set vectors 20 & 21
+
+ mov cx, 2
+ps_set1:
+ stosw
+ add di, 2
+ loop ps_set1
+
+ add di, 4 ; skip int 22h vector
+
+ stosw ; set int 23h
+ add di, 6 ; skip int 24h
+
+ ; set vectors 25-28 and 2a-3f
+
+ mov cx, 4 ; set 4 segments
+ps_set2:
+ stosw
+ add di, 2
+ loop ps_set2
+
+ add di,4 ; skip int 29h vector (fast con) as it may
+ ; already be set.
+
+
+ mov cx,6 ; set 6 segs (skip 2 between each)
+ ; set segs for ints 2ah-2fh
+ps_set3:
+ stosw
+ add di,2
+ loop ps_set3
+
+; 30h & 31H is the CPM call entry point whose segment address is set up by
+; below. So skip it.
+
+ add di,8 ; skip vector 30h & 31h
+
+
+ mov cx,14 ; set 14 segs (skip 2 between each)
+ ; sets segs for ints 32h-3fh
+ps_set4:
+ stosw
+ add di,2
+ loop ps_set4
+
+
+
+; set offset of int2f
+
+if installed
+; mov word ptr es:[02fh * 4],offset doscode:int2f
+endif
+
+ mov word ptr es:[entrypoint+3],ax
+
+ pop es
+ ret
+
+patch_vec_segments endp
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : patch_misc_segments
+;
+; Inputs : es = segment to patch in
+; ds = dosdata
+;
+; outputs : patches in the sharer and other tables in the dos
+; with right dos code segment in es
+;
+; Regs Mod : DI,SI,CX
+;
+;---------------------------------------------------------------------------
+patch_misc_segments proc near
+
+ push bx
+ push es
+ push ax
+
+ mov ax, es ; ax - > DOS segment
+
+ push ds
+ pop es ; es -> DOSDATA
+
+
+;
+; initialize the jump table for the sharer...
+;
+ mov di,offset dosdata:jshare
+ mov bx, [temp_dosloc] ; bx = location to which the share
+ ; table was patched during the first
+ ; call to this routine
+ mov cx,15
+jumptabloop:
+ add di,2 ; skip offset
+ cmp bx, -1 ; Q: is this called for the 1st time
+ je share_patch ; Y: patch in sharer table
+ ; N:
+ cmp bx, es:[di] ; Q: has share been installed
+ jne no_share_patch ; Y: don't patch in sharer table
+
+share_patch:
+ stosw ; drop in segment
+
+no_share_patch:
+ loop jumptabloop
+
+ ; BUGBUG patching the country info
+ ; with dosdata can be done inline
+ ; in .dosinit.
+ ; for dos 3.3 country info
+ ; table address
+ mov si,offset dosdata:country_cdpg
+
+ ; initialize double word
+ ; pointers with dosdata in ds
+ mov word ptr [si.ccucase_ptr + 2],ds
+ mov word ptr [si.ccfileucase_ptr + 2],ds
+ mov word ptr [si.ccfilechar_ptr + 2],ds
+ mov word ptr [si.cccollate_ptr + 2],ds
+ mov word ptr [si.ccmono_ptr + 2],ds
+ mov word ptr [si.ccdbcs_ptr + 2],ds
+
+ ; fastopen routines are in doscode
+ ; so patch with doscode seg in ax
+
+ mov si,offset dosdata:fastopentable
+
+ cmp [temp_dosloc], -1 ; Q: first time
+ je fast_patch ; Y: patch segment
+ mov cx, [temp_dosloc]
+ ; Q: has fastopen patched in it's
+ ; segment
+ cmp cx, word ptr [si.fastopen_name_caching + 2]
+ jne no_fast_patch ; Y: don't patch in doscode seg
+
+fast_patch:
+ mov word ptr [si.fastopen_name_caching + 2],ax
+no_fast_patch:
+
+;
+; put the final dosdata segment in the following pointers
+;
+ mov si,offset dosdata:DosWowDataStart
+ mov word ptr [si.DWD_lpCDSCount + 2],ds
+ mov word ptr [si.DWD_lpCDSFixedTable + 2],ds
+ mov word ptr [si.DWD_lpCDSBuffer + 2],ds
+ mov word ptr [si.DWD_lpCurDrv + 2],ds
+ mov word ptr [si.DWD_lpCurPDB + 2],ds
+ mov word ptr [si.DWD_lpDrvErr + 2],ds
+ mov word ptr [si.DWD_lpExterrLocus + 2],ds
+ mov word ptr [si.DWD_lpSCS_ToSync + 2],ds
+ mov word ptr [si.DWD_lpSftAddr + 2],ds
+
+ pop ax
+ pop es
+ pop bx
+
+ ret
+
+patch_misc_segments endp
+
+;--------------------------------------------------------------------------
+;
+; Procedure Name : patch_offset
+;
+; Inputs : NONE
+;
+; Outputs : Patches in the offsets in the low_mem_stub for vectors
+; 0,20-28,3a-3f, and 30,31
+;
+;
+; Regs. Mod : AX,DI,CX
+;--------------------------------------------------------------------------
+patch_offset proc near
+
+ push es ; preserve es
+
+ xor ax,ax
+ mov es,ax
+assume ds:nothing,es:nothing
+
+ ; set default divide trap address
+ mov word ptr es:[0],offset dosdata:ldivov
+
+ mov di,intbase ; di-> offset of int 20 handler
+ mov ax,offset dosdata:lirett
+
+ ; set vectors 20 & 21 to point to iret.
+ mov cx,2 ; set 2 offsets (skip 2 between each)
+
+po_iset1:
+ stosw
+ add di, 2
+ loop po_iset1
+
+ add di, 4 ; skip vector 22h
+
+ stosw ; set offset of 23h
+ add di, 6 ; skip 24h
+
+ ; set vectors 25-28 and 2a-3f to iret.
+ mov cx,4 ; set 4 offsets (skip 2 between each)
+ ; sets offsets for ints 25h-28h
+po_iset2:
+ stosw
+ add di,2
+ loop po_iset2
+
+ add di,4 ; skip vector 29h
+
+
+ mov cx,6 ; set 6 offsets (skip 2 between each)
+ ; sets offsets for ints 2ah-2fh
+po_iset3:
+ stosw
+ add di,2
+ loop po_iset3
+
+; 30h & 31H is the CPM call entry point whose offset address is set up by
+; below. So skip it.
+
+ add di,8 ; skip vector 30h & 31h
+
+
+ mov cx,14 ; set 14 offsets (skip 2 between each)
+ ; sets offsets for ints 32h-3fh
+po_iset4:
+ stosw
+ add di,2
+ loop po_iset4
+
+
+if installed
+ mov word ptr es:[02fh * 4],offset dosdata:lint2f
+endif
+
+
+; set up entry point call at vectors 30-31h
+ mov byte ptr es:[entrypoint],mi_long_jmp
+ mov word ptr es:[entrypoint+1],offset dosdata:lcall_entry
+
+
+ mov word ptr es:[addr_int_abort],offset dosdata:lquit
+ mov word ptr es:[addr_int_command],offset dosdata:lcommand
+ mov word ptr es:[addr_int_disk_read],offset dosdata:labsdrd
+ mov word ptr es:[addr_int_disk_write],offset dosdata:labsdwrt
+ mov word ptr es:[addr_int_keep_process],offset dosdata:lstay_resident
+
+ pop es ; restore es
+ ret
+
+patch_offset endp
+
+;--------------------------------------------------------------------------
+;
+; Procedure Name : patch_in_nops
+;
+; Entry : ES -> DOSDATA
+;
+; Regs Mod : cx, di
+;
+; Description:
+; This routine patches in 2 nops at the offsets specifed in
+; patch_table. This basically enables the low mem stub to start
+; making XMS calls.
+;
+;--------------------------------------------------------------------------
+
+patch_table label byte
+ dw offset dosdata:i0patch
+ dw offset dosdata:i20patch
+ dw offset dosdata:i21patch
+ dw offset dosdata:i25patch
+ dw offset dosdata:i26patch
+ dw offset dosdata:i27patch
+ dw offset dosdata:i2fpatch
+ dw offset dosdata:cpmpatch
+patch_table_size equ ($ - patch_table) / 2
+
+patch_in_nops proc near
+
+ push ax
+ push si
+ mov si, offset patch_table
+ mov ax, 09090h
+ mov cx, patch_table_size
+
+pin_loop:
+ mov di, cs:[si]
+ stosw
+ add si, 2
+ loop pin_loop
+ pop si
+ pop ax
+ ret
+
+patch_in_nops endp
+
+
+public msini002s,msini002e
+msini002s label byte
+
+;M060;;the following entries don't expect version 4.0
+;M060; ;the entry format: name_length, name, expected version
+;M060; ;dw ?
+;M060; ;db "SPECIAL ENTRIES TABLE",0 ;an007 tiltle
+;M060;
+;M060; PUBLIC LIE_TABLE_OFFSET
+;M060; LIE_TABLE_OFFSET EQU $
+;M060;
+;M060; version_fake_table: ; starting address for special
+;M060; db 10,"WIN200.BIN" ,3,40 ; windows 2.x
+;M060; db 10,"WIN100.BIN" ,3,40 ; win 1.x
+;M060; db 11,"WINWORD.EXE" ,4,10 ; winword 1.0
+;M060; db 9, "EXCEL.EXE" ,4,10 ; excel 2.x
+;M060; db 11,"HITACHI.SYS" ,4,00 ; CDROMS
+;M060; db 10,"MSCDEX.EXE" ,4,00 ; CDROMS
+;M060; db 10,"REDIR4.EXE" ,4,00 ; Banyan networks
+;M060; db 7, "NET.EXE" ,4,00 ; 3+ Open
+;M060; db 7, "NET.COM" ,3,30 ; IBM PCLP
+;M060; db 12,"NETWKSTA.EXE" ,4,00 ; 3+ Open
+;M060; db 12,"DXMA0MOD.SYS" ,3,30 ; Token ring
+;M060; db 7, "BAN.EXE" ,4,00 ; Banyan
+;M060; db 7, "BAN.COM" ,4,00 ; Banyan
+;M060; db 11,"MSREDIR.EXE" ,4,00 ; LanMan
+;M060; db 9, "METRO.EXE" ,3,31 ; Lotus Metro
+;M060; db 12,"IBMCACHE.SYS" ,3,40 ; IBM CHACHE Program
+;M060; db 11,"REDIR40.EXE" ,4,00 ; IBM PCLP 1.3/4 redirector
+;M060; db 6, "DD.EXE" ,4,01 ; Laplink III software
+;M060; db 6, "DD.BIN" ,4,01 ; Laplink III software
+;M060; db 7, "LL3.EXE" ,4,01 ; Laplink III software
+;M060; db 9, "REDIR.EXE" ,4,00 ; DOS 4 redir
+;M060; db 9, "SYQ55.SYS" ,4,00 ; Removable SCSII drive from Syquest
+;M060; db 12,"SSTDRIVE.SYS" ,4,00 ; Columbia SCSI driver
+;M060; db 8, "ZDRV.SYS" ,4,01 ; Unisys CD-ROM B#4734
+;M060; db 8, "ZFMT.SYS" ,4,01 ; Unisys CD-ROM B#4734
+;M060;
+;M060; db (512 - ($ - version_fake_table)) dup (0)
+;M060;
+;M060; PUBLIC LIE_TABLE_LEN
+;M060; LIE_TABLE_LEN EQU ($ - LIE_TABLE_OFFSET)
+
+ public memstrt
+
+memstrt label word
+
+msini002e label byte
+
+
+doscode ends
+
+
+ DPUBLIC <ParaRound, cXMM_no_driver, cXMMexit, char_init_loop, charinit>
+ DPUBLIC <check_XMM, continit, dosinttabloop, endlist>
+ DPUBLIC <initiret, iset1, iset2, jumptabloop, nxtentry>
+ DPUBLIC <notmax, patch_offset, perdrv>
+ DPUBLIC <perunit, po_iset1, po_iset2, po_iset3>
+ DPUBLIC <ps_set1, ps_set2, ps_set3, seg_reinit>
+ DPUBLIC <sr_done, version_fake_table, xxx>
+
+ end
+
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msioctl.asm b/private/mvdm/dos/v86/doskrnl/dos/msioctl.asm
new file mode 100644
index 000000000..2117f412f
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msioctl.asm
@@ -0,0 +1,5 @@
+; SCCSID = @(#)IBMIOCTL.INC 1.1 85/04/10
+IBM EQU 0FFFFH ;TRUE
+
+INCLUDE IOCTL.INC
+ SCCSID = @(#)IBMIOCTL.INC 1.1 85/04/10
diff --git a/private/mvdm/dos/v86/doskrnl/dos/msproc.asm b/private/mvdm/dos/v86/doskrnl/dos/msproc.asm
new file mode 100644
index 000000000..4e3a1699f
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/msproc.asm
@@ -0,0 +1,1973 @@
+;
+; EXEC system call for DOS
+;
+; =========================================================================
+
+.cref
+.list
+
+ TITLE MSPROC - process maintenance
+ NAME MSPROC
+ PAGE ,132
+
+;$WAIT
+;$EXEC
+;$Keep_process
+;Stay_resident
+;$EXIT
+;$ABORT
+;abort_inner
+;
+;Modification history:
+; Sudeepb 11-Mar-1991 Ported for NT DOSEm
+
+.XLIST
+.XCREF
+
+INCLUDE version.inc
+INCLUDE dosseg.inc
+INCLUDE DOSSYM.INC
+INCLUDE DEVSYM.INC
+INCLUDE exe.inc
+INCLUDE sf.inc
+INCLUDE curdir.inc
+INCLUDE syscall.inc
+INCLUDE arena.inc
+INCLUDE pdb.inc
+INCLUDE vector.inc
+INCLUDE cmdsvc.inc
+include dossvc.inc
+include bop.inc
+include vint.inc
+include dbgsvc.inc
+
+
+
+.CREF
+.LIST
+
+public retexepatch
+
+; =========================================================================
+
+DosData SEGMENT WORD PUBLIC 'DATA'
+
+ EXTRN CreatePDB :BYTE
+ EXTRN DidCtrlC :BYTE
+ EXTRN Exit_type :BYTE
+ EXTRN ExtErr_Locus :BYTE ; Extended Error Locus
+ EXTRN InDos :BYTE
+
+ EXTRN OpenBuf :BYTE
+; EXTRN OpenBuf :128
+
+ EXTRN CurrentPDB :WORD
+ EXTRN Exit_code :WORD
+
+ EXTRN DmaAdd :DWORD
+
+
+ ; the following includes & i_needs are for exec.asm
+ ; which is included in this source
+
+ ; **** Fake_count to commented out
+
+ EXTRN Fake_Count :BYTE ; Fake version count
+
+ EXTRN Special_Entries :WORD ; Address of special entries
+ EXTRN Special_Version :WORD ; Special version number
+ EXTRN Temp_Var2 :WORD ; File type from $open
+
+ ; following i_needs are becuse of moving these vars from
+ ; exec.asm to ../inc/ms_data.asm
+
+ EXTRN exec_init_SP :WORD
+ EXTRN exec_init_SS :WORD
+ EXTRN exec_init_IP :WORD
+ EXTRN exec_init_CS :WORD
+
+
+ EXTRN exec_signature :WORD ; Must contain 4D5A (yay zibo!)
+ EXTRN exec_len_mod_512:WORD ; Low 9 bits of length
+ EXTRN exec_pages :WORD ; Number of 512b pages in file
+ EXTRN exec_rle_count :WORD ; Count of reloc entries
+ EXTRN exec_par_dir :WORD ; Number of paragraphs before image
+ EXTRN exec_min_BSS :WORD ; Minimum number of para of BSS
+ EXTRN exec_max_BSS :WORD ; Max number of para of BSS
+ EXTRN exec_SS :WORD ; Stack of image
+ EXTRN exec_SP :WORD ; SP of image
+ EXTRN exec_chksum :WORD ; Checksum of file (ignored)
+ EXTRN exec_IP :WORD ; IP of entry
+ EXTRN exec_CS :WORD ; CS of entry
+ EXTRN exec_rle_table :WORD ; Byte offset of reloc table
+ EXTRN Exec_NE_Offset :WORD
+
+ EXTRN DOS_FLAG :BYTE ; flag to indicate to redir that open
+ ; came from exec.
+
+
+ EXTRN AllocMethod :BYTE ; how to alloc first(best)last
+ EXTRN SAVE_AX :WORD ; temp to save ax
+ EXTRN AllocMsave :BYTE ; M063: temp to save AllocMethod
+
+ EXTRN UU_IFS_DOS_CALL :DWORD ; M060 Ptr to version table
+
+ EXTRN A20OFF_PSP :WORD ; M068
+ EXTRN A20OFF_COUNT :BYTE ; M068
+
+; =========================================================================
+
+ EXTRN Disa20_Xfer :WORD
+
+ allow_getdseg
+
+ EXTRN DriverLoad :BYTE
+ EXTRN BiosDataPtr :DWORD
+ extrn DosHasHMA :byte ; M021
+ extrn fixexepatch :word
+ extrn ChkCopyProt :word ; M068
+ extrn LeaveDos :word ; M068
+ extrn SCS_TSR :byte
+ extrn SCS_Is_Dos_Binary:byte
+ EXTRN SCS_CMDPROMPT :byte
+ EXTRN SCS_DOSONLY :byte
+
+ EXTRN SCS_ISDEBUG :byte
+
+DosData ENDS
+
+; =========================================================================
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+ EXTRN ExecReady:near
+ EXTRN UCase:near ; M050
+
+
+SAVEXIT EQU 10
+
+ BREAK <$WAIT - return previous process error code>
+
+; =========================================================================
+; $WAIT - Return previous process error code.
+;
+; Assembler usage:
+;
+; MOV AH, WaitProcess
+; INT int_command
+;
+; ENTRY none
+; EXIT (ax) = exit code
+; USES all
+; =========================================================================
+
+ ASSUME DS:NOTHING,ES:NOTHING
+
+PROCEDURE $Wait ,NEAR
+
+ xor AX,AX
+ xchg AX,exit_code
+ transfer Sys_Ret_OK
+
+ENDPROC $Wait
+
+
+; =========================================================================
+;BREAK <$exec - load/go a program>
+; EXEC.ASM - EXEC System Call
+;
+;
+; Assembler usage:
+; lds DX, Name
+; les BX, Blk
+; mov AH, Exec
+; mov AL, FUNC
+; int INT_COMMAND
+;
+; AL Function
+; -- --------
+; 0 Load and execute the program.
+; 1 Load, create the program header but do not
+; begin execution.
+; 3 Load overlay. No header created.
+;
+; AL = 0 -> load/execute program
+;
+; +---------------------------+
+; | WORD segment address of |
+; | environment. |
+; +---------------------------+
+; | DWORD pointer to ASCIZ |
+; | command line at 80h |
+; +---------------------------+
+; | DWORD pointer to default |
+; | FCB to be passed at 5Ch |
+; +---------------------------+
+; | DWORD pointer to default |
+; | FCB to be passed at 6Ch |
+; +---------------------------+
+;
+; AL = 1 -> load program
+;
+; +---------------------------+
+; | WORD segment address of |
+; | environment. |
+; +---------------------------+
+; | DWORD pointer to ASCIZ |
+; | command line at 80h |
+; +---------------------------+
+; | DWORD pointer to default |
+; | FCB to be passed at 5Ch |
+; +---------------------------+
+; | DWORD pointer to default |
+; | FCB to be passed at 6Ch |
+; +---------------------------+
+; | DWORD returned value of |
+; | CS:IP |
+; +---------------------------+
+; | DWORD returned value of |
+; | SS:IP |
+; +---------------------------+
+;
+; AL = 3 -> load overlay
+;
+; +---------------------------+
+; | WORD segment address where|
+; | file will be loaded. |
+; +---------------------------+
+; | WORD relocation factor to |
+; | be applied to the image. |
+; +---------------------------+
+;
+; Returns:
+; AX = error_invalid_function
+; = error_bad_format
+; = error_bad_environment
+; = error_not_enough_memory
+; = error_file_not_found
+; =========================================================================
+;
+; Revision history:
+;
+; A000 version 4.00 Jan. 1988
+;
+; =========================================================================
+
+ EXTRN Exec_Header_Len :ABS
+ EXTRN Exec_Header_Len_NE:ABS
+
+Exec_Internal_Buffer EQU OpenBuf
+Exec_Internal_Buffer_Size EQU (128+128+53+curdirLEN)
+
+; =========================================================================
+
+;IF1 ; warning message on buffers
+;%out Please make sure that the following are contiguous and of the
+;%out following sizes:
+;%out
+;%out OpenBuf 128
+;%out RenBuf 128
+;%out SearchBuf 53
+;%out DummyCDS CurDirLen
+;ENDIF
+
+; =========================================================================
+
+
+; =========================================================================
+;
+; =========================================================================
+
+procedure $Exec,NEAR
+
+ PUBLIC EXEC001S
+EXEC001S:
+
+ LocalVar Exec_Blk ,DWORD
+ LocalVar Exec_Func ,BYTE
+ LocalVar Exec_Load_High ,BYTE
+ LocalVar Exec_FH ,WORD
+ LocalVar Exec_Rel_Fac ,WORD
+ LocalVar Exec_Res_Len_Para ,WORD
+ LocalVar Exec_Environ ,WORD
+ LocalVar Exec_Size ,WORD
+ LocalVar Exec_Load_Block ,WORD
+ LocalVar Exec_DMA ,WORD
+ LocalVar ExecNameLen ,WORD
+ LocalVar ExecName ,DWORD
+
+ LocalVar Exec_DMA_Save ,WORD
+ LocalVar Exec_NoStack ,BYTE
+ LocalVar ExecFlag ,BYTE
+ LocalVar ExecWord ,WORD
+;;
+;;williamh change BEGIN
+; 0 if we are not loading a COM file as overlay
+; 1 if we are loading a COM file as overlay
+ LocalVar Exec_ComOverlay ,BYTE
+;; williamh change END
+
+ LocalVar Exec_Res_Len ,DWORD
+
+
+ ; ==================================================================
+ ; validate function
+ ; ==================================================================
+
+ PUBLIC EXEC001E
+EXEC001E:
+
+
+ ;
+ ; M068 - Start
+ ;
+ ; Reset the A20OFF_COUNT to 0. This is done as there is a
+ ; possibility that the count may not be decremented all the way to
+ ; 0. A typical case is if the program for which we intended to keep
+ ; the A20 off for a sufficiently long time (A20OFF_COUNT int 21
+ ; calls), exits pre-maturely due to error conditions.
+ ;
+
+
+ mov [A20OFF_COUNT], 0
+
+ ;
+ ; If al=5 (ExecReady) we'll change the return address on the stack
+ ; to be LeaveDos in msdisp.asm. This ensures that the EXECA20OFF
+ ; bit set in DOS_FLAG by ExceReady is not cleared in msdisp.asm
+ ;
+ cmp al, 5 ; Q: is this ExecReady call
+ jne @f ; N: continue
+ ; Y: change ret addr. to LeaveDos.
+ pop cx ; Note CX is not input to ExecReady
+ mov cx, offset DOSCODE:LeaveDos
+ push cx
+@@:
+ ;
+ ; M068 - End
+ ;
+
+ Enter
+
+;;williamh change BEGIN
+ mov Exec_ComOverlay, 0
+;;williamh changed END
+
+ cmp AL,5 ; only 0, 1, 3 or 5 are allowed ;M028
+ ; M030
+ jna exec_check_2
+
+Exec_Bad_Fun:
+ mov ExtErr_Locus,ErrLoc_Unk ; Extended Error Locus ;smr;SS Override
+ mov al,Error_Invalid_Function
+
+Exec_Ret_Err:
+ Leave
+ transfer SYS_RET_ERR
+ExecReadyJ:
+ call ExecReady ; M028
+ jmp norm_ovl ; do a Leave & xfer sysret_OK ; M028
+
+Exec_Check_2:
+ cmp AL,2
+ jz Exec_Bad_Fun
+
+ cmp al, 4 ; 2 & 4 are not allowed
+ je Exec_Bad_Fun
+
+ cmp al, 5 ; M028 ; M030
+ je ExecReadyJ ; M028
+
+ mov Exec_Func,AL
+
+ or al,al
+ jne scs1
+ xchg al, SS:[SCS_Is_Dos_Binary] ; get and reset the flag
+;; if we already know the binary type(from command.com and GetNextCommand
+;; just execute it
+ or al, al
+ jne scs1
+
+ mov ExecFlag, 1 ;check new header
+ call get_binary_type ;get the binary type
+ jc Exec_ret_err ;file read error ?
+ cmp al, 0ffh ;type unknown?
+ jnz exec_got_binary_type
+
+; sudeepb ; This code support NTCMDPROMPT and DOSONLY commands of config.nt
+
+ cmp byte ptr ss:[SCS_CMDPROMPT],1
+ jz go_checkbin ; means cmd prompt supported
+ cmp byte ptr ss:[SCS_DOSONLY],0
+ jz go_checkbin
+ jmp short scs1 ; means on command.com prompt we are
+ ; suppose to disallow 32bit binaries
+
+go_checkbin:
+;; unknown bindary type found, ask NTVDM for help.
+;;
+
+ CMDSVC SVC_CMDCHECKBINARY ; Check if the binary is 32bit
+
+ ; 32 bit binary handling added for SCS.
+ ; SVC_DEMCHECKBINARY will return updated ds:dx to point to
+ ; %COMSPEC% . ds:dx will be pointing to a scratch buffer
+ ; the address of which was passed to 32bit side at the time
+ ; of DOS initialization. SVC handler will also add /z switch to
+ ; command tail. If command tail does'nt have enough space to allow
+ ; adding /z, it will return error_not_enough_memory.
+
+ ;lds SI,[SI.exec0_com_line] ; command line
+ ;mov al,byte ptr ds:[si]
+ ;cmp al,125 ; 3 chars for /z<space>
+ ;pop ax
+ ;jbe scs1
+ ;mov ax,error_not_enough_memory
+ ;jmp Exec_Ret_Err
+
+ jc Exec_Ret_Err
+
+scs1:
+ mov ExecFlag, 0 ;don't check new header
+ call get_binary_type ;get binary again
+ jc Exec_ret_err
+exec_got_binary_type:
+ mov ExecFlag, al ;binary type
+ mov Exec_BlkL,BX ; stash args
+ mov Exec_BlkH,ES
+ mov Exec_Load_high,0
+ mov execNameL,DX ; set up length of exec name
+ mov execNameH,DS
+ mov SI,DX ; move pointer to convenient place
+ invoke DStrLen
+ mov ExecNameLen,CX ; save length
+
+ mov al, [AllocMethod] ; M063: save alloc method in
+ mov [AllocMsave], al ; M063: AllocMsave
+
+Exec_Check_Environ:
+ mov Exec_Load_Block,0
+ mov Exec_Environ,0
+ ; overlays... no environment
+ test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
+ jnz Exec_Save_Start
+
+ lds SI,Exec_Blk ; get block
+ mov AX,[SI].Exec1_Environ ; address of environ
+ or AX,AX
+ jnz exec_scan_env
+
+ mov DS,CurrentPDB ;smr;SS Override
+ mov AX,DS:[PDB_environ]
+
+;---------------------------------------------BUG 92 4/30/90-----------------
+;
+; Exec_environ is being correctly initialized after the environment has been
+; allocated and copied form the parent's env. It must not be initialized here.
+; Because if the call to $alloc below fails Exec_dealloc will deallocate the
+; parent's environment.
+; mov Exec_Environ,AX
+;
+;----------------------------------------------------------------------------
+
+ or AX,AX
+ jz Exec_Save_Start
+
+Exec_Scan_Env:
+ mov ES,AX
+ xor DI,DI
+ mov CX,8000h ; at most 32k of environment ;M040
+ xor AL,AL
+
+Exec_Get_Environ_Len:
+ repnz scasb ; find that nul byte
+ jnz BadEnv
+
+ dec CX ; Dec CX for the next nul byte test
+ js BadEnv ; gone beyond the end of the environment
+
+ scasb ; is there another nul byte?
+ jnz Exec_Get_Environ_Len ; no, scan some more
+
+ push DI
+ lea BX,[DI+0Fh+2]
+ add BX,ExecNameLen ; BX <- length of environment
+ ; remember argv[0] length
+ ; round up and remember argc
+ mov CL,4
+ shr BX,CL ; number of paragraphs needed
+ push ES
+ invoke $Alloc ; can we get the space?
+ pop DS
+ pop CX
+ jnc Exec_Save_Environ
+
+ jmp SHORT Exec_No_Mem ; nope... cry and sob
+
+Exec_Save_Environ:
+ mov ES,AX
+ mov Exec_Environ,AX ; save him for a rainy day
+ xor SI,SI
+ mov DI,SI
+ rep movsb ; copy the environment
+ mov AX,1
+ stosw
+ lds SI,ExecName
+ mov CX,ExecNameLen
+ rep movsb
+
+Exec_Save_Start:
+ Context DS
+ cmp ExecFlag, 0
+ je Exec_exe_file
+ jmp Exec_Com_File
+Exec_exe_file:
+ test Exec_Max_BSS,-1 ; indicate load high?
+ jnz Exec_Check_Size
+
+ mov Exec_Load_High,-1
+Exec_Check_Size:
+ mov AX,Exec_Pages ; get 512-byte pages ;rms;NSS
+ mov CL,5 ; convert to paragraphs
+ shl AX,CL
+ sub AX,Exec_Par_Dir ; AX = size in paragraphs;rms;NSS
+ mov Exec_Res_Len_Para,AX
+
+ ; Do we need to allocate memory?
+ ; Yes if function is not load-overlay
+
+ test BYTE PTR exec_func,exec_func_overlay
+ jz exec_allocate ; allocation of space
+
+ ; get load address from block
+
+ les DI,Exec_Blk
+ mov AX,ES:[DI].Exec3_Load_Addr
+ mov exec_dma,AX
+ mov AX,ES:[DI].Exec3_Reloc_Fac
+ mov Exec_Rel_Fac,AX
+
+ jmp Exec_Find_Res ; M000
+
+
+BadEnv:
+ mov AL,ERROR_BAD_ENVIRONMENT
+ jmp Exec_Bomb
+
+Exec_No_Mem:
+ mov AL,Error_Not_Enough_Memory
+ jmp SHORT Exec_Bomb
+
+Exec_Bad_File:
+ mov AL,Error_Bad_Format
+
+Exec_Bomb:
+ ASSUME DS:NOTHING,ES:NOTHING
+
+ mov BX,Exec_fh
+ call Exec_Dealloc
+ LeaveCrit CritMem
+ save <AX,BP>
+ invoke $CLOSE
+ restore <BP,AX>
+ jmp Exec_Ret_Err
+
+
+Exec_Chk_Mem:
+ ; M063 - Start
+ mov al, [AllocMethod] ; save current alloc method in ax
+ mov bl, [AllocMsave]
+ mov [AllocMethod], bl ; restore original allocmethod
+ test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
+ jnz Exec_No_Mem ; Y: no space in UMBs. Quit
+ ; N: continue
+
+ test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
+ jz Exec_No_Mem ; N: no memory
+ mov ax, [save_ax] ; Y: restore ax and
+ jmp short Exec_Norm_Alloc ; Try again
+ ; M063 - End
+
+Exec_Allocate:
+ DOSAssume <DS>,"exec_allocate"
+
+
+ ; M005 - START
+ ; If there is no STACK segment for this exe file and if this
+ ; not an overlay and the resident size is less than 64K -
+ ; 256 bytes we shall add 256bytes bytes to the programs
+ ; resident memory requirement and set Exec_SP to this value.
+
+ mov Exec_NoStack,0
+ cmp Exec_SS, 0 ; Q: is there a stack seg
+ jne @f ; Y: continue normal processing
+ cmp Exec_SP, 0 ; Q: is there a stack ptr
+ jne @f ; Y: continue normal processing
+
+ inc Exec_NoStack
+ cmp ax, 01000h-10h ; Q: is this >= 64K-256 bytes
+ jae @f ; Y: don't set Exec_SP
+
+ add ax, 010h ; add 10h paras to mem requirement
+@@:
+
+ ; M005 - END
+
+ ; M000 - start
+ test byte ptr [AllocMethod], HIGH_FIRST
+ ; Q: is the alloc strat high_first
+ jz Exec_Norm_Alloc ; N: normal allocate
+ ; Y: set high_only bit
+ or byte ptr [AllocMethod], HIGH_ONLY
+ ; M000 - end
+
+Exec_Norm_Alloc:
+
+ mov [save_ax], ax ; M000: save ax for possible 2nd
+ ; M000: attempt at allocating memory
+; push ax ; M000
+
+ mov BX,0ffffh ; see how much room in arena
+ push DS
+ invoke $Alloc ; should have carry set and BX has max
+ pop DS
+
+ mov ax, [save_ax] ; M000
+; pop AX ; M000
+
+ add AX,10h ; room for header
+ cmp BX,11h ; enough room for a header
+
+ jb Exec_Chk_Mem ; M000
+; jb Exec_No_Mem ; M000
+
+
+ cmp AX,BX ; is there enough for bare image?
+
+ ja Exec_Chk_Mem ; M000
+; ja Exec_No_Mem ; M000
+
+ test Exec_Load_High,-1 ; if load high, use max
+ jnz Exec_BX_Max ; use max
+
+ add AX,Exec_Min_BSS ; go for min allocation;rms;NSS
+
+ jc Exec_Chk_Mem ; M000
+; jc Exec_No_Mem ; M000: oops! carry
+
+ cmp AX,BX ; enough space?
+
+ ja Exec_Chk_Mem ; M000: nope...
+; ja Exec_No_Mem ; M000: nope...
+
+
+ sub AX,Exec_Min_BSS ; rms;NSS
+ add AX,Exec_Max_BSS ; go for the MAX
+ jc Exec_BX_Max
+
+ cmp AX,BX
+ jbe Exec_Got_Block
+
+Exec_BX_Max:
+ mov AX,BX
+
+Exec_Got_Block:
+ push DS
+ mov BX,AX
+ mov exec_size,BX
+ invoke $Alloc ; get the space
+ pop DS
+
+ ljc exec_chk_mem ; M000
+
+ mov cl, [AllocMsave] ; M063:
+ mov [AllocMethod], cl ; M063: restore allocmethod
+
+
+;M029; Begin changes
+; This code does special handling for programs with no stack segment. If so,
+;check if the current block is larger than 64K. If so, we do not modify
+;Exec_SP. If smaller than 64K, we make Exec_SP = top of block. In either
+;case Exec_SS is not changed.
+;
+ cmp Exec_NoStack,0
+ je @f
+
+ cmp bx,1000h ; Q: >= 64K memory block
+ jae @f ; Y: Exec_SP = 0
+
+;
+;Make Exec_SP point at the top of the memory block
+;
+ mov cl,4
+ shl bx,cl ; get byte offset
+ sub bx,100h ; take care of PSP
+ mov Exec_SP,bx ; Exec_SP = top of block
+@@:
+;
+;M029; end changes
+;
+
+ mov exec_load_block,AX
+ add AX,10h
+ test exec_load_high,-1
+ jz exec_use_ax ; use ax for load info
+
+ add AX,exec_size ; go to end
+ sub AX,exec_res_len_para ; drop off header
+ sub AX,10h ; drop off pdb
+
+Exec_Use_AX:
+ mov Exec_Rel_Fac,AX ; new segment
+ mov Exec_Dma,AX ; beginning of dma
+
+ ; Determine the location in the file of the beginning of
+ ; the resident
+
+Exec_Find_Res:
+
+
+
+ ; Save info needed for bopping to debugger
+ ; Exec_Res_Len contains len of image in bytes
+
+ test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je e_nodbg0
+
+ mov ax, Exec_Res_Len_Para
+ mov bx, ax
+ mov cl, 4
+ shl ax, cl
+ mov Exec_Res_LenL, ax
+ mov cl, 12
+ shr bx, cl
+ mov Exec_Res_LenH, bx
+e_nodbg0:
+
+
+
+
+ mov DX, exec_dma
+ mov exec_dma_save, DX
+
+ mov DX,Exec_Par_Dir
+ push DX
+ mov CL,4
+ shl DX,CL ; low word of location
+ pop AX
+ mov CL,12
+ shr AX,CL ; high word of location
+ mov CX,AX ; CX <- high
+
+ ; Read in the resident image (first, seek to it)
+
+ mov BX,Exec_FH
+ push DS
+ xor AL,AL
+ invoke $Lseek ; Seek to resident
+ pop DS
+ jnc exec_big_read
+
+ jmp exec_bomb
+
+Exec_Big_Read: ; Read resident into memory
+ mov BX,Exec_Res_Len_Para
+ cmp BX,1000h ; Too many bytes to read?
+ jb Exec_Read_OK
+
+ mov BX,0fe0h ; Max in one chunk FE00 bytes
+
+Exec_Read_OK:
+ sub Exec_Res_Len_Para,BX ; We read (soon) this many
+ push BX
+ mov CL,4
+ shl BX,CL ; Get count in bytes from paras
+ mov CX,BX ; Count in correct register
+ push DS
+ mov DS,Exec_DMA ; Set up read buffer
+
+ ASSUME DS:NOTHING
+
+ xor DX,DX
+ push CX ; Save our count
+ call ExecRead
+ pop CX ; Get old count to verify
+ pop DS
+ jc Exec_Bad_FileJ
+
+ DOSAssume <DS>,"exec_read_ok"
+
+ cmp CX,AX ; Did we read enough?
+ pop BX ; Get paragraph count back
+ jz ExecCheckEnd ; and do reloc if no more to read
+
+ ; The read did not match the request. If we are off by 512
+ ; bytes or more then the header lied and we have an error.
+
+ sub CX,AX
+ cmp CX,512
+ jae Exec_Bad_FileJ
+
+ ; We've read in CX bytes... bump DTA location
+
+ExecCheckEnd:
+ add Exec_DMA,BX ; Bump dma address
+ test Exec_Res_Len_Para,-1
+ jnz Exec_Big_Read
+
+ ; The image has now been read in. We must perform relocation
+ ; to the current location.
+
+exec_do_reloc:
+ mov CX,Exec_Rel_Fac
+ mov AX,Exec_SS ; get initial SS ;rms;NSS
+ add AX,CX ; and relocate him
+ mov Exec_Init_SS,AX ; rms;NSS
+
+ mov AX,Exec_SP ; initial SP ;rms;NSS
+ mov Exec_Init_SP,AX ; rms;NSS
+
+
+
+ les AX,DWORD PTR exec_IP ; rms;NSS
+ mov Exec_Init_IP,AX ; rms;NSS
+ mov AX,ES ; rms;NSS
+ add AX,CX ; relocated...
+ mov Exec_Init_CS,AX ; rms;NSS
+
+ xor CX,CX
+ mov DX,Exec_RLE_Table ; rms;NSS
+ mov BX,Exec_FH
+ push DS
+ xor AX,AX
+ invoke $Lseek
+ pop DS
+
+ jnc Exec_Get_Entries
+
+exec_bad_filej:
+ jmp Exec_Bad_File
+
+exec_get_entries:
+ mov DX,Exec_RLE_Count ; Number of entries left ;rms;NSS
+
+exec_read_reloc:
+ ASSUME DS:NOTHING
+
+ push DX
+ mov DX,OFFSET DOSDATA:Exec_Internal_Buffer
+ mov CX,((EXEC_INTERNAL_BUFFER_SIZE)/4)*4
+ push DS
+ call ExecRead
+ pop ES
+ pop DX
+ jc Exec_Bad_FileJ
+
+ mov CX,(EXEC_INTERNAL_BUFFER_SIZE)/4
+ ; Pointer to byte location in header
+ mov DI,OFFSET DOSDATA:exec_internal_buffer
+ mov SI,Exec_Rel_Fac ; Relocate a single address
+
+exec_reloc_one:
+ or DX,DX ; Any more entries?
+ je Exec_Set_PDBJ
+
+exec_get_addr:
+ lds BX,DWORD PTR ES:[DI] ; Get ra/sa of entry
+ mov AX,DS ; Relocate address of item
+
+;;;;;; add AX,SI
+ add AX, exec_dma_save
+
+ mov DS,AX
+ add [BX],SI
+ add DI,4
+ dec DX
+ loop Exec_Reloc_One ; End of internal buffer?
+
+ ; We've exhausted a single buffer's worth. Read in the next
+ ; piece of the relocation table.
+
+ push ES
+ pop DS
+ jmp Exec_Read_Reloc
+
+Exec_Set_PDBJ:
+
+ ;
+ ; We now determine if this is a buggy exe packed file and if
+ ; so we patch in the right code. Note that fixexepatch will
+ ; point to a ret if dos loads low. The load segment as
+ ; determined above will be in exec_dma_save
+ ;
+
+ push es
+ push ax ; M030
+ push cx ; M030
+ mov es, exec_dma_save
+ mov ax, exec_init_CS ; M030
+ mov cx, exec_init_IP ; M030
+ call word ptr [fixexepatch]
+ pop cx ; M030
+ pop ax ; M030
+ pop es
+
+ jmp Exec_Set_PDB
+
+Exec_No_Memj:
+ jmp Exec_No_Mem
+
+ ; we have a .COM file. First, determine if we are merely
+ ; loading an overlay.
+
+Exec_Com_File:
+ test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
+ jz Exec_Alloc_Com_File
+ lds SI,Exec_Blk ; get arg block
+ lodsw ; get load address
+ mov Exec_DMA,AX
+;;williamh change BEGIN
+;; this instruction is commentted out because it doesn't work under
+;; NT(we may have invalid address space within(Exec_DMA:0 + Exec_DMA:0xffff)
+;;
+;;;;;; mov AX,0ffffh
+;; figure out the bare image size
+ mov bx, Exec_FH ;the file handle
+ xor cx, cx
+ mov dx, cx
+ mov ax, 2
+ invoke $Lseek ;move file to the end
+ mov Exec_ComOverlay, 1 ;we are loading COM file as an overlay
+;;williamh change END
+ jmp SHORT Exec_Read_Block ; read it all!
+
+
+
+Exec_Chk_Com_Mem:
+ ; M063 - Start
+ mov al, [AllocMethod] ; save current alloc method in ax
+ mov bl, [AllocMsave]
+ mov [AllocMethod], bl ; restore original allocmethod
+ test bl, HIGH_ONLY ; Q: was the HIGH_ONLY bit already set
+ jnz Exec_No_Memj ; Y: no space in UMBs. Quit
+ ; N: continue
+
+ test al, HIGH_ONLY ; Q: did we set the HIGH_ONLY bit
+ jz Exec_No_Memj ; N: no memory
+
+ mov ax, exec_load_block ; M047: ax = block we just allocated
+ xor bx, bx ; M047: bx => free arena
+ call ChangeOwner ; M047: free this block
+
+ jmp short Exec_Norm_Com_Alloc
+ ; M063 - End
+
+ ; We must allocate the max possible size block (ick!)
+ ; and set up CS=DS=ES=SS=PDB pointer, IP=100, SP=max
+ ; size of block.
+
+Exec_Alloc_Com_File:
+ ; M000 -start
+ test byte ptr [AllocMethod], HIGH_FIRST
+ ; Q: is the alloc strat high_first
+ jz Exec_Norm_Com_Alloc ; N: normal allocate
+ ; Y: set high_only bit
+ or byte ptr [AllocMethod], HIGH_ONLY
+ ; M000 - end
+
+
+Exec_Norm_Com_Alloc: ; M000
+
+ mov BX,0FFFFh
+ invoke $Alloc ; largest piece available as error
+ or BX,BX
+
+ jz Exec_Chk_Com_Mem ; M000
+; jz Exec_No_Memj ; M000
+
+ mov Exec_Size,BX ; save size of allocation block
+ push BX
+ invoke $ALLOC ; largest piece available as error
+ pop BX ; get size of block...
+ mov Exec_Load_Block,AX
+ add AX,10h ; increment for header
+ mov Exec_DMA,AX
+ xor AX,AX ; presume 64K read...
+ cmp BX,1000h ; 64k or more in block?
+ jae Exec_Read_Com ; yes, read only 64k
+
+ mov AX,BX ; convert size to bytes
+ mov CL,4
+ shl AX,CL
+ cmp AX,100h ; enough memory for PSP?
+
+ jbe Exec_Chk_Com_Mem ; M000: jump if not
+; jbe Exec_No_Memj ; M000: jump if not
+
+ ; M047: size of the block is < 64K
+ sub ax, 100h ; M047: reserve 256 bytes for stack
+
+Exec_Read_Com:
+ sub AX,100h ; remember size of psp
+
+Exec_Read_Block:
+ push AX ; save number to read
+ mov BX,Exec_FH ; of com file
+ xor CX,CX ; but seek to 0:0
+ mov DX,CX
+ xor AX,AX ; seek relative to beginning
+ invoke $Lseek ; back to beginning of file
+ pop CX ; number to read
+ mov DS,Exec_DMA
+ xor DX,DX
+ push CX
+ call ExecRead
+ pop SI ; get number of bytes to read
+ jnc OkRead
+
+ jmp Exec_Bad_File
+
+OkRead:
+;; williamh change BEGIN
+ cmp Exec_ComOverlay, 0
+ jne OkLoad
+;; williamh change END
+
+ cmp AX,SI ; did we read them all?
+
+ ljz Exec_Chk_Com_Mem ; M00: exactly the wrong number...no
+; ljz Exec_No_Memj ; M00: exactly the wrong number...
+
+;;williamh change BEGIN
+OkLoad:
+;;williamh change END
+
+ test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je e_nodbg1
+
+
+ ; Save info needed for bopping to debugger
+ ; Exec_Res_Len contains len of image
+ ; Exec_Rel_Fac contains start addr\reloc factor
+ ;
+ push ax
+ mov Exec_Res_LenL, ax
+ mov Exec_Res_LenH, 0
+ mov ax, Exec_DMA
+ mov Exec_Rel_Fac, ax
+ pop ax
+e_nodbg1:
+
+ mov bl, [AllocMsave] ; M063
+ mov [AllocMethod], bl ; M063: restore allocmethod
+
+ test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
+ jnz Exec_Set_PDB ; no starto, chumo!
+
+ mov AX,Exec_DMA
+ sub AX,10h
+ mov Exec_Init_CS,AX
+ mov Exec_Init_IP,100h ; initial IP is 100
+
+ ; SI is AT MOST FF00h. Add FE to account for PSP - word
+ ; of 0 on stack.
+
+ add SI,0feh ; make room for stack
+
+ cmp si, 0fffeh ; M047: Q: was there >= 64K available
+ je Exec_St_Ok ; M047: Y: stack is fine
+ add si, 100h ; M047: N: add the xtra 100h for stack
+
+Exec_St_Ok:
+ mov Exec_Init_SP,SI ; max value for read is also SP!;smr;SS Override
+ mov Exec_Init_SS,AX ;smr;SS Override
+ mov DS,AX
+ mov WORD PTR [SI],0 ; 0 for return
+
+ ;
+ ; M068
+ ;
+ ; We now determine if this is a Copy Protected App. If so the
+ ; A20OFF_COUNT is set to 6. Note that ChkCopyProt will point to a
+ ; a ret if DOS is loaded low. Also DS contains the load segment.
+
+ call word ptr [ChkCopyProt]
+
+Exec_Set_PDB:
+ mov BX,Exec_FH ; we are finished with the file.
+ call Exec_Dealloc
+ push BP
+ invoke $Close ; release the jfn
+ pop BP
+ call Exec_Alloc
+
+ test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je e_nodbg2
+ SAVEREG <ax,bx,dx,di>
+ ; bop to debugger for all ExeTypes to signal LOAD symbols
+ ; BX - Start Address or relocation factor
+ ; DX:AX - Size of exe resident image
+ ; ES:DI - Name of exe image
+ mov bx, WORD PTR Exec_Rel_Fac
+ mov dx, Exec_Res_LenH
+ mov ax, Exec_Res_LenL
+ les di, ExecName
+
+ SVC SVC_DEMLOADDOSAPPSYM
+ RESTOREREG <di,dx,bx,ax>
+e_nodbg2:
+
+ test BYTE PTR Exec_Func,EXEC_FUNC_OVERLAY
+ jz Exec_Build_Header
+
+ call Scan_Execname
+ call Scan_Special_Entries
+
+;SR;
+;The current lie strategy uses the PSP to store the lie version. However,
+;device drivers are loaded as overlays and have no PSP. To handle them, we
+;use the Sysinit flag provided by the BIOS as part of a structure pointed at
+;by BiosDataPtr. If this flag is set, the overlay call has been issued from
+;Sysinit and therefore must be a device driver load. We then get the lie
+;version for this driver and put it into the Sysinit PSP. When the driver
+;issues the version check, it gets the lie version until the next overlay
+;call is issued.
+;
+ cmp DriverLoad,0 ;was Sysinit processing done?
+ je norm_ovl ;yes, no special handling
+ push si
+ push es
+ les si,BiosDataPtr ;get ptr to BIOS data block
+ cmp byte ptr es:[si],0 ;in Sysinit?
+ je sysinit_done ;no, Sysinit is finished
+
+ mov es,CurrentPDB ;es = current PSP (Sysinit PSP)
+ push Special_Version
+ pop es:PDB_Version ;store lie version in Sysinit PSP
+ jmp short setver_done
+sysinit_done:
+ mov DriverLoad,0 ;Sysinit done,special handling off
+setver_done:
+ pop es
+ pop si
+norm_ovl:
+
+ leave
+ transfer Sys_Ret_OK ; overlay load -> done
+
+Exec_Build_Header:
+
+ mov DX,Exec_Load_Block
+ ; assign the space to the process
+ mov SI,Arena_Owner ; pointer to owner field
+ mov AX,Exec_Environ ; get environ pointer
+ or AX,AX
+ jz No_Owner ; no environment
+
+ dec AX ; point to header
+ mov DS,AX
+ mov [SI],DX ; assign ownership
+
+No_Owner:
+ mov AX,Exec_Load_Block ; get load block pointer
+ dec AX
+ mov DS,AX ; point to header
+ mov [SI],DX ; assign ownership
+
+ push DS ;AN000;MS. make ES=DS
+ pop ES ;AN000;MS.
+ mov DI,Arena_Name ;AN000;MS. ES:DI points to destination
+ call Scan_Execname ;AN007;MS. parse execname
+ ; ds:si->name, cx=name length
+ push CX ;AN007;;MS. save for fake version
+ push SI ;AN007;;MS. save for fake version
+
+MoveName: ;AN000;
+ lodsb ;AN000;;MS. get char
+ cmp AL,'.' ;AN000;;MS. is '.' ,may be name.exe
+ jz Mem_Done ;AN000;;MS. no, move to header
+ ;AN000;
+ stosb ;AN000;;MS. move char
+ ; MSKK bug fix - limit length copied
+ cmp di,16 ; end of memory arena block?
+ jae mem_done ; jump if so
+
+ loop movename ;AN000;;MS. continue
+Mem_Done: ;AN000;
+ xor AL,AL ;AN000;;MS. make ASCIIZ
+ cmp DI,SIZE ARENA ;AN000;MS. if not all filled
+ jae Fill8 ;AN000;MS.
+
+ stosb ;AN000;MS.
+
+Fill8: ;AN000;
+ pop SI ;AN007;MS. ds:si -> file name
+ pop CX ;AN007;MS.
+
+ call Scan_Special_Entries ;AN007;MS.
+
+ push DX
+ mov SI,exec_size
+ add SI,DX
+ push ax
+ mov ax,1
+ call set_exec_bit
+ pop ax
+ Invoke $Dup_PDB ; ES is now PDB
+ push ax
+ xor ax,ax
+ call set_exec_bit
+ pop ax
+ pop DX
+
+ push exec_environ
+ pop ES:[PDB_environ]
+ ; *** Added for DOS 5.00
+ ; version number in PSP
+ push [Special_Version] ; Set the DOS version number to
+ pop ES:[PDB_Version] ; to be used for this application
+
+ ; set up proper command line stuff
+ lds SI,Exec_Blk ; get the block
+ push DS ; save its location
+ push SI
+ lds SI,[SI.EXEC0_5C_FCB] ; get the 5c fcb
+
+ ; DS points to user space 5C FCB
+
+ mov CX,12 ; copy drive, name and ext
+ push CX
+ mov DI,5Ch
+ mov BL,[SI]
+ rep movsb
+
+ ; DI = 5Ch + 12 = 5Ch + 0Ch = 68h
+
+ xor AX,AX ; zero extent, etc for CPM
+ stosw
+ stosw
+
+ ; DI = 5Ch + 12 + 4 = 5Ch + 10h = 6Ch
+
+ pop CX
+ pop SI ; get block
+ pop DS
+ push DS ; save (again)
+ push SI
+ lds SI,[SI.exec0_6C_FCB] ; get 6C FCB
+
+ ; DS points to user space 6C FCB
+
+ mov BH,[SI] ; do same as above
+ rep movsb
+ stosw
+ stosw
+ pop SI ; get block (last time)
+ pop DS
+ lds SI,[SI.exec0_com_line] ; command line
+
+ ; DS points to user space 80 command line
+
+ or CL,80h
+ mov DI,CX
+ rep movsb ; Wham!
+
+ ; Process BX into default AX (validity of drive specs on args).
+ ; We no longer care about DS:SI.
+
+ dec CL ; get 0FFh in CL
+ mov AL,BH
+ xor BH,BH
+ invoke GetVisDrv
+ jnc Exec_BL
+
+ mov BH,CL
+
+Exec_BL:
+ mov AL,BL
+ xor BL,BL
+ invoke GetVisDrv
+ jnc exec_Set_Return
+
+ mov BL,CL
+
+Exec_Set_Return:
+ invoke get_user_stack ; get his return address
+ push [SI.user_CS] ; suck out the CS and IP
+ push [SI.user_IP]
+ push [SI.user_CS] ; suck out the CS and IP
+ push [SI.user_IP]
+ pop WORD PTR ES:[PDB_Exit]
+ pop WORD PTR ES:[PDB_Exit+2]
+ xor AX,AX
+ mov DS,AX
+ ; save them where we can get them
+ ; later when the child exits.
+ pop DS:[ADDR_INT_TERMINATE]
+ pop DS:[ADDR_INT_TERMINATE+2]
+ mov WORD PTR DMAADD,80h ; SS Override
+ mov DS,CurrentPDB ; SS Override
+ mov WORD PTR DMAADD+2,DS ; SS Override
+ test BYTE PTR exec_func,exec_func_no_execute
+ jz exec_go
+
+ lds SI,DWORD PTR Exec_Init_SP ; get stack SS Override
+ les DI,Exec_Blk ; and block for return
+ mov ES:[DI].EXEC1_SS,DS ; return SS
+
+ dec SI ; 'push' default AX
+ dec SI
+ mov [SI],BX ; save default AX reg
+ mov ES:[DI].Exec1_SP,SI ; return 'SP'
+
+ lds AX,DWORD PTR Exec_Init_IP ; SS Override
+ mov ES:[DI].Exec1_CS,DS ; initial entry stuff
+
+ mov ES:[DI].Exec1_IP,AX
+ leave
+ transfer Sys_Ret_OK
+
+exec_go:
+ lds SI,DWORD PTR Exec_Init_IP ; get entry point SS Override
+ les DI,DWORD PTR Exec_Init_SP ; new stack SS Override
+ mov AX,ES
+
+ cmp [DosHasHMA], 0 ; Q: is dos in HMA (M021)
+ je Xfer_To_User ; N: transfer control to user
+
+ push ds ; Y: control must go to low mem stub
+ getdseg <ds> ; where we disable a20 and Xfer
+ ; control to user
+
+ or [DOS_FLAG], EXECA20OFF ; M068:
+ ; M004: Set bit to signal int 21
+ ; ah = 25 & ah= 49. See dossym.inc
+ ; under TAG M003 & M009 for
+ ; explanation
+ mov [A20OFF_PSP], dx ; M068: set the PSP for which A20 is
+ ; M068: going to be turned OFF.
+
+ mov ax, ds ; ax = segment of low mem stub
+ pop ds
+ assume ds:nothing
+
+ push ax ; ret far into the low mem stub
+ mov ax, OFFSET Disa20_Xfer
+ push ax
+ mov AX,ES ; restore ax
+ retf
+
+Xfer_To_User:
+
+
+
+ ; DS:SI points to entry point
+ ; AX:DI points to initial stack
+ ; DX has PDB pointer
+ ; BX has initial AX value
+
+ SVC SVC_DEMENTRYDOSAPP
+
+
+ invoke DOCLI
+ mov BYTE PTR InDos,0 ; SS Override
+
+ ASSUME SS:NOTHING
+
+ mov SS,AX ; set up user's stack
+ mov SP,DI ; and SP
+ STI ; took out DOSTI as SP may be bad
+
+ push DS ; fake long call to entry
+ push SI
+ mov ES,DX ; set up proper seg registers
+ mov DS,DX
+ mov AX,BX ; set up proper AX
+
+ retf
+
+EndProc $Exec
+
+; =========================================================================
+;
+; =========================================================================
+
+Procedure ExecRead,NEAR
+ CALL exec_dealloc
+ MOV bx,exec_fh
+ PUSH BP
+ invoke $READ
+ POP BP
+ CALL exec_alloc
+ return
+EndProc ExecRead
+
+; =========================================================================
+;
+; =========================================================================
+
+procedure exec_dealloc,near
+
+ push BX
+ .errnz arena_owner_system
+ sub BX,BX ; (bx) = ARENA_OWNER_SYSTEM
+ EnterCrit CritMEM
+ call ChangeOwners
+ pop BX
+ return
+
+EndProc exec_dealloc
+
+; =========================================================================
+;
+; =========================================================================
+
+procedure exec_alloc,near
+ ASSUME SS:DOSDATA
+
+ push BX
+ mov BX,CurrentPDB ; SS Override
+ call ChangeOwners
+ LeaveCrit CritMEM
+ pop BX
+ return
+
+EndProc exec_alloc
+
+; =========================================================================
+;
+; =========================================================================
+
+PROCEDURE ChangeOwners,NEAR
+
+ push AX
+ lahf
+ push AX
+ mov AX,exec_environ
+ call ChangeOwner
+ mov AX,exec_load_block
+ call ChangeOwner
+ pop AX
+ sahf
+ pop ax
+ return
+
+ENDPROC ChangeOwners
+
+; =========================================================================
+;
+; =========================================================================
+
+PROCEDURE ChangeOwner,NEAR
+
+ or AX,AX ; is area allocated?
+ retz ; no, do nothing
+ dec AX
+ push DS
+ mov DS,AX
+ mov DS:[ARENA_OWNER],BX
+ pop DS
+ return
+
+EndProc ChangeOwner
+
+; =========================================================================
+;
+; =========================================================================
+
+Procedure Scan_Execname,near
+ ASSUME SS:DosData
+
+ lds SI,ExecName ; DS:SI points to name
+Entry Scan_Execname1 ; M028
+Save_Begin: ;
+ mov CX,SI ; CX= starting addr
+Scan0: ;
+ lodsb ; get char
+
+IFDEF DBCS ; MSKK01 07/14/89
+ invoke TESTKANJ ; Is Character lead byte of DBCS?
+ jz @F ; jump if not
+ lodsb ; skip over DBCS character
+ jmp short scan0 ; do scan again
+@@:
+ENDIF
+
+ cmp AL,':' ; is ':' , may be A:name
+ jz save_begin ; yes, save si
+ cmp AL,'\' ; is '\', may be A:\name
+ jz save_begin ; yes, save si
+ cmp AL,0 ; is end of name
+ jnz scan0 ; no, continue scanning
+ sub SI,CX ; get name's length
+ xchg SI,CX ; cx= length, si= starting addr
+
+ return
+
+EndProc Scan_Execname
+
+; =========================================================================
+;
+; =========================================================================
+
+Procedure Scan_Special_Entries,near
+ assume SS:DOSDATA
+
+ dec CX ; cx= name length
+;M060 mov DI,[Special_Entries] ; es:di -> addr of special entries
+ ;reset to current version
+ mov [Special_Version],(Minor_Version SHL 8) + Major_Version
+;*** call Reset_Version
+
+;M060 push SS
+;M060 pop ES
+
+ les DI,SS:UU_IFS_DOS_CALL ;M060; ES:DI --> Table in SETVER.SYS
+ mov AX,ES ;M060; First do a NULL ptr check to
+ or AX,DI ;M060; be sure the table exists
+ jz End_List ;M060; If ZR then no table
+
+GetEntries:
+ mov AL,ES:[DI] ; end of list
+ or AL,AL
+ jz End_List ; yes
+
+ mov [Temp_Var2],DI ; save di
+ cmp AL,CL ; same length ?
+ jnz SkipOne ; no
+
+ inc DI ; es:di -> special name
+ push CX ; save length and name addr
+ push SI
+
+;
+; M050 - BEGIN
+;
+ push ax ; save len
+sse_next_char:
+ lodsb
+ call UCase
+ scasb
+ jne Not_Matched
+ loop sse_next_char
+
+;
+; repz cmpsb ; same name ?
+;
+; jnz Not_Matched ; no
+;
+ pop ax ; take len off the stack
+;
+; M050 - END
+;
+ mov AX,ES:[DI] ; get special version
+ mov [Special_Version],AX ; save it
+
+;*** mov AL,ES:[DI+2] ; get fake count
+;*** mov [Fake_Count],AL ; save it
+
+ pop SI
+ pop CX
+ jmp SHORT end_list
+
+Not_Matched:
+ pop ax ; get len from stack ; M050
+ pop SI ; restore si,cx
+ pop CX
+
+SkipOne:
+ mov DI,[Temp_Var2] ; restore old di use SS Override
+ xor AH,AH ; position to next entry
+ add DI,AX
+
+ add DI,3 ; DI -> next entry length
+;*** add DI,4 ; DI -> next entry length
+
+ jmp Getentries
+
+End_List:
+ return
+
+EndProc Scan_Special_Entries
+
+; =========================================================================
+;
+; =========================================================================
+;
+;Procedure Reset_Version,near
+; assume SS:DOSDATA
+;
+; cmp [Fake_Count],0ffh
+; jnz @F
+; mov [Special_Version],0 ;reset to current version
+;@@:
+; return
+;
+;EndProc Reset_Version,near
+
+PAGE
+; =========================================================================
+;SUBTTL Terminate and stay resident handler
+;
+; Input: DX is an offset from CurrentPDB at which to
+; truncate the current block.
+;
+; output: The current block is truncated (expanded) to be [DX+15]/16
+; paragraphs long. An exit is simulated via resetting CurrentPDB
+; and restoring the vectors.
+;
+; =========================================================================
+PROCEDURE $Keep_process ,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
+
+ push AX ; keep exit code around
+ mov BYTE PTR Exit_type,EXIT_KEEP_PROCESS
+ mov BYTE PTR SCS_TSR,1
+ mov ES,CurrentPDB
+ cmp DX,6h ; keep enough space around for system
+ jae Keep_shrink ; info
+
+ mov DX,6h
+
+Keep_Shrink:
+ mov BX,DX
+ push BX
+ push ES
+ invoke $SETBLOCK ; ignore return codes.
+ pop DS
+ pop BX
+ jc keep_done ; failed on modification
+
+ mov AX,DS
+ add AX,BX
+ mov DS:PDB_block_len,AX ;PBUGBUG
+
+Keep_Done:
+ pop AX
+ jmp SHORT exit_inner ; and let abort take care of the rest
+
+EndProc $Keep_process
+
+; =========================================================================
+;
+; =========================================================================
+
+PROCEDURE Stay_Resident,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+ mov AX,(Keep_process SHL 8) + 0 ; Lower part is return code;PBUGBUG
+ add DX,15
+ rcr DX,1
+ mov CL,3
+ shr DX,CL
+
+ transfer COMMAND
+
+ENDPROC Stay_resident
+
+
+PAGE
+; =========================================================================
+;SUBTTL $EXIT - return to parent process
+; Assembler usage:
+; MOV AL, code
+; MOV AH, Exit
+; INT int_command
+; Error return:
+; None.
+;
+; =========================================================================
+
+PROCEDURE $Exit ,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING,SS:DosData
+
+ xor AH,AH
+ xchg AH,BYTE PTR DidCtrlC
+ or AH,AH
+ mov BYTE PTR Exit_Type,EXIT_TERMINATE
+ jz exit_inner
+ mov BYTE PTR Exit_type,exit_ctrl_c
+
+ entry Exit_inner
+
+ invoke get_user_stack ;PBUGBUG
+
+ ASSUME DS:NOTHING
+
+ push CurrentPDB
+ pop [SI.User_CS] ;PBUGBUG
+ jmp SHORT Abort_Inner
+
+EndProc $EXIT
+
+BREAK <$ABORT -- Terminate a process>
+; =========================================================================
+; Inputs:
+; user_CS:00 must point to valid program header block
+; Function:
+; Restore terminate and Cntrl-C addresses, flush buffers and transfer to
+; the terminate address
+; Returns:
+; TO THE TERMINATE ADDRESS
+; =========================================================================
+
+PROCEDURE $Abort ,NEAR
+ ASSUME DS:NOTHING,ES:NOTHING ;PBUGBUG
+
+ xor AL,AL
+ mov exit_type,exit_abort
+
+ ; abort_inner must have AL set as the exit code! The exit type
+ ; is retrieved from exit_type. Also, the PDB at user_CS needs
+ ; to be correct as the one that is terminating.
+
+ PUBLIC Abort_Inner
+Abort_Inner:
+
+ mov AH,Exit_Type
+ mov Exit_Code,AX
+
+ test ss:[SCS_ISDEBUG],ISDBG_DEBUGGEE
+ je Abt_EndBopFree
+
+ test ah, EXIT_KEEP_PROCESS ; no unload, tsr staying in memory
+ jnz Abt_EndBopFree
+
+ ; go to end of env (double NULL)
+ ; get address of exe image name
+ mov es, CurrentPDB
+ mov es, es:PDB_environ
+ xor di, di
+ xor al, al
+ mov cx, 8000h ; at most 32k of environment
+ cld
+
+Abt_SearchName:
+ repnz scasb ; look for null byte
+ jnz Abt_EndBopFree ; end not found, give up
+ dec cx ; Dec CX for the next nul byte test
+ jz Abt_EndBopFree ; end not found, give up
+ scasb ; is there another nul byte?
+ jnz Abt_SearchName ; no, scan some more
+
+ ; adv di past next word
+ dec cx
+ jcxz Abt_EndBopFree
+ inc di
+ dec cx
+ jcxz Abt_EndBopFree
+ inc di
+
+ ; es:di points to FullyQualiedFileName of this exe image
+ ; Bop to debugger, to notify Free Symbols
+ SVC SVC_DEMFREEDOSAPPSYM
+
+Abt_EndBopFree:
+
+ invoke Get_User_Stack
+
+ ASSUME DS:NOTHING
+
+ mov DS,[SI.User_CS] ; set up old interrupts ;PBUGBUG
+ xor AX,AX
+ mov ES,AX
+ mov SI,SavExit
+ mov DI,Addr_Int_Terminate
+ movsw
+ movsw
+ movsw
+ movsw
+ movsw
+ movsw
+ transfer reset_environment
+
+ENDPROC $ABORT
+
+;==========================================================================
+;
+; fixexepatch will poin to this is DOS loads low.
+;
+;=========================================================================
+retexepatch proc near
+
+ ret
+
+retexepatch endp
+
+set_exec_bit proc
+ push ds
+ or ax,ax
+ mov ax,40h
+ mov ds,ax
+ jz seb_clear
+ lock or word ptr ds:[FIXED_NTVDMSTATE_REL40], EXEC_BIT_MASK
+ jmp short seb_done
+seb_clear:
+ lock and word ptr ds:[FIXED_NTVDMSTATE_REL40], NOT EXEC_BIT_MASK
+seb_done:
+ pop ds
+ ret
+set_exec_bit endp
+
+;===========================================================================
+;determine the given binary type
+; input: ds:dx = lpszExecName
+; ExecFlag = 1 if new header checking is necessary
+; ExecFlag = 0 if new header checking is not necessary
+; output: CY -> file opening/reading error, (AL) has error code
+; else
+; (AL) = 0 if .exe file, Exec_Fh contains the file handle
+; (AL) = 1 if .com file, Exec_Fh contains the file handle
+; (AL) = 0ffh if unknown
+;
+; modified: AX, CX
+;
+; note: use the caller's local var frame(addressed by BP)
+;===========================================================================
+get_binary_type proc
+
+ExecSignature_NE equ "EN" ;; signature for win16 or os/2 bound
+ExecSignature_PE equ "EP" ;; nt image
+ExecSignature_LE equ "EL" ;; os/2
+
+ push ds
+ push es
+ push bx
+ push dx
+ xor AL,AL ; open for reading
+ push BP
+
+ or [DOS_FLAG], EXECOPEN ; this flag is set to indicate to
+ ; the redir that this open call is
+ ; due to an exec.
+ invoke $OPEN ; is the file there?
+
+; sudeepb 22-Dec-1992 removed a costly pair of pushf/popf
+ push ax
+ lahf
+ and [DOS_FLAG], not EXECOPEN; reset flag
+ sahf
+ pop ax
+
+ pop BP
+ jc GBT_jmp_exit ;can not find the file
+
+ mov Exec_Fh,AX ;save the file handle
+ mov BX,AX
+ xor AL,AL
+ invoke $Ioctl
+ jc GBT_Bomb
+
+ test DL,DEVID_ISDEV
+ jz GBT_check_header
+
+ mov AL,ERROR_FILE_NOT_FOUND
+ jmp GBT_bomb
+
+GBT_Bad_File:
+ mov AL,Error_Bad_Format
+GBT_Bomb:
+ push BP
+ invoke $CLOSE
+ pop bp
+ stc
+GBT_jmp_exit:
+ jmp GBT_exit
+
+GBT_check_header:
+ Context DS
+ mov CX,Exec_Header_Len ; old header size
+ cmp ExecFlag, 0
+ je GBT_read_header
+ mov cx, Exec_Header_Len_NE
+GBT_read_header:
+ mov DX,OFFSET DosData:Exec_Signature
+ push ES
+ push DS
+ push BP
+ invoke $READ
+ pop bp
+ pop DS
+ pop ES
+ jc GBT_Bad_File
+
+ or AX,AX
+ jz GBT_Bad_File
+ cmp AX,EXEC_HEADER_LEN ; at least the size should be this size
+ jl GBT_com_file ; if no, it is a .com file
+
+ mov CX,Exec_Signature ; get the singnature from the file
+ cmp CX,Exe_Valid_Signature ;
+ jz GBT_check_new_header ; assume com file if no signature
+
+ cmp CX,exe_valid_Old_Signature ; ???????????????????
+ jne GBT_com_file ; assume com file if no signature
+
+GBT_check_new_header:
+ cmp ExecFlag, 0
+ je GBT_exe_file
+ cmp ax, Exec_header_len_NE ;if we don't read in what we expect,
+ jne GBT_exe_file ; it is an ordinary dos exe
+ mov cx, Exec_NE_offset ;get the offset to the new header
+ jcxz GBT_exe_file ;if no new header at all, it is a dos exe
+ mov dx, cx
+ xor cx, cx
+ xor ax, ax
+ push ds
+ push bp
+ invoke $lseek ;move file pointer
+ pop bp
+ pop ds
+ mov bx, Exec_Fh
+ lea dx, ExecWord ;read the first two bytes from new header
+ mov cx, 2
+ push BP
+ push ds
+ call $READ
+ pop ds
+ pop bp
+ jc GBT_exe_file
+ cmp ax, 2
+ jne GBT_exe_file
+ mov ax, ExecWord
+ cmp ax, ExecSignature_NE ;win16, os/2 bound ?
+ je GBT_unknown
+ cmp ax, ExecSignature_PE ;nt?
+ je GBT_unknown
+ cmp ax, ExecSignature_LE ;os/2?
+ je GBT_unknown
+
+GBT_exe_file:
+ mov al, 0
+ clc
+ jmp short GBT_Exit
+
+
+GBT_com_file:
+ mov al, 1
+ clc
+ jmp short GBT_exit
+
+GBT_unknown:
+ push bp
+ call $CLOSE
+ pop bp
+ mov al, 0ffh
+ clc
+GBT_Exit:
+ pop dx
+ pop bx
+ pop es
+ pop ds
+ ret
+
+get_binary_type endp
+; =========================================================================
+
+DOSCODE ENDS
+
+; =========================================================================
+
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/mssw.asm b/private/mvdm/dos/v86/doskrnl/dos/mssw.asm
new file mode 100644
index 000000000..a13853a95
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/mssw.asm
@@ -0,0 +1,25 @@
+; SCCSID = @(#)ibmsw.asm 1.1 85/04/10
+
+
+IBM EQU ibmver
+WANG EQU FALSE
+
+; Set this switch to cause DOS to move itself to the end of memory
+HIGHMEM EQU FALSE
+
+; Turn on switch below to allow testing disk code with DEBUG. It sets
+; up a different stack for disk I/O (functions > 11) than that used for
+; character I/O which effectively makes the DOS re-entrant.
+
+ IF IBM
+ESCCH EQU 0 ; character to begin escape seq.
+CANCEL EQU 27 ;Cancel with escape
+TOGLPRN EQU TRUE ;One key toggles printer echo
+ZEROEXT EQU TRUE
+ ELSE
+ESCCH EQU 1BH
+CANCEL EQU "X"-"@" ;Cancel with Ctrl-X
+TOGLPRN EQU FALSE ;Separate keys for printer echo on
+ ;and off
+ZEROEXT EQU TRUE
+ ENDIF
diff --git a/private/mvdm/dos/v86/doskrnl/dos/mstable.asm b/private/mvdm/dos/v86/doskrnl/dos/mstable.asm
new file mode 100644
index 000000000..ac724d4ba
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/mstable.asm
@@ -0,0 +1,466 @@
+; SCCSID = @(#)ibmtable.asm 1.1 85/04/10
+;
+; Table Segment for DOS
+;
+
+.xlist
+.xcref
+include version.inc
+include mssw.asm
+.cref
+.list
+
+TITLE IBMTABLE - Table segment for DOS
+NAME IBMTABLE
+
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+; ==========================================================================
+
+
+
+;** MS_TABLE.ASM
+;
+; Revision history:
+; A000 version 4.0 Jan. 1988
+; A001 DCR 486 - Share installation for >32mb drives
+; A006 DCR 503 - fake version for IBMCACHE
+; A008 PTM 4070 - fake version for MS WINDOWS
+; M006 Fake Version call no longer supported. 8/6/90
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include fastopen.inc
+ include dossym.inc
+ include syscall.inc
+ .cref
+ .list
+
+ AsmVars <Debug, Redirector, ShareF>
+
+DOSCODE SEGMENT
+
+TableZero LABEL BYTE
+
+ PUBLIC MSVERS
+PUBLIC MSTAB001s,MSTAB001e
+MSTAB001S label byte
+
+MSVERS EQU THIS WORD ; MS-DOS version in hex for $GET_VERSION
+MSMAJOR DB MAJOR_VERSION
+MSMINOR DB MINOR_VERSION
+
+;hkn YRTAB & MONTAB moved to DOSDATA in ms_data.asm
+; I_am YRTAB,8,<200,166,200,165,200,165,200,165> ; [SYSTEM]
+; I_am MONTAB,12,<31,28,31,30,31,30,31,31,30,31,30,31> ; [SYSTEM]
+
+;
+; This is the error code mapping table for INT 21 errors. This table defines
+; those error codes which are "allowed" for each system call. If the error
+; code ABOUT to be returned is not "allowed" for the call, the correct action
+; is to return the "real" error via Extended error, and one of the allowed
+; errors on the actual call.
+;
+; The table is organized as follows:
+;
+; Each entry in the table is of variable size, but the first
+; two bytes are always:
+;
+; Call#,Cnt of bytes following this byte
+;
+; EXAMPLE:
+; Call 61 (OPEN)
+;
+; DB 61,5,12,3,2,4,5
+;
+; 61 is the AH INT 21 call value for OPEN.
+; 5 indicates that there are 5 bytes after this byte (12,3,2,4,5).
+; Next five bytes are those error codes which are "allowed" on OPEN.
+; The order of these values is not important EXCEPT FOR THE LAST ONE (in
+; this case 5). The last value will be the one returned on the call if
+; the "real" error is not one of the allowed ones.
+;
+; There are a number of calls (for instance all of the FCB calls) for which
+; there is NO entry. This means that NO error codes are returned on this
+; call, so set up an Extended error and leave the current error code alone.
+;
+; The table is terminated by a call value of 0FFh
+
+PUBLIC I21_MAP_E_TAB
+I21_MAP_E_TAB LABEL BYTE
+ DB International,2,error_invalid_function,error_file_not_found
+ DB MKDir,3,error_path_not_found,error_file_not_found,error_access_denied
+ DB RMDir,4,error_current_directory,error_path_not_found
+ DB error_file_not_found,error_access_denied
+ DB CHDir,2,error_file_not_found,error_path_not_found
+ DB Creat,4,error_path_not_found,error_file_not_found
+ DB error_too_many_open_files
+ DB error_access_denied
+ DB Open,6,error_path_not_found,error_file_not_found,error_invalid_access
+ DB error_too_many_open_files
+ DB error_not_dos_disk,error_access_denied
+ DB Close,1,error_invalid_handle
+ DB Read,2,error_invalid_handle,error_access_denied
+ DB Write,2,error_invalid_handle,error_access_denied
+ DB Unlink,3,error_path_not_found,error_file_not_found,error_access_denied
+ DB LSeek,2,error_invalid_handle,error_invalid_function
+ DB CHMod,4,error_path_not_found,error_file_not_found,error_invalid_function
+ DB error_access_denied
+ DB IOCtl,5,error_invalid_drive,error_invalid_data,error_invalid_function
+ DB error_invalid_handle,error_access_denied
+ DB XDup,2,error_invalid_handle,error_too_many_open_files
+ DB XDup2,2,error_invalid_handle,error_too_many_open_files
+ DB Current_Dir,2,error_not_DOS_disk,error_invalid_drive
+ DB Alloc,2,error_arena_trashed,error_not_enough_memory
+ DB Dealloc,2,error_arena_trashed,error_invalid_block
+ DB Setblock,3,error_arena_trashed,error_invalid_block,error_not_enough_memory
+ DB Exec,8,error_path_not_found,error_invalid_function,error_file_not_found
+ DB error_too_many_open_files,error_bad_format,error_bad_environment
+ DB error_not_enough_memory,error_access_denied
+ DB Find_First,3,error_path_not_found,error_file_not_found,error_no_more_files
+ DB Find_Next,1,error_no_more_files
+ DB Rename,5,error_not_same_device,error_path_not_found,error_file_not_found
+ DB error_current_directory,error_access_denied
+ DB File_Times,4,error_invalid_handle,error_not_enough_memory
+ DB error_invalid_data,error_invalid_function
+ DB AllocOper,1,error_invalid_function
+ DB CreateTempFile,4,error_path_not_found,error_file_not_found
+ DB error_too_many_open_files,error_access_denied
+ DB CreateNewFile,5,error_file_exists,error_path_not_found
+ DB error_file_not_found,error_too_many_open_files,error_access_denied
+; DB LockOper,4,error_invalid_handle,error_invalid_function
+; DB error_sharing_buffer_exceeded,error_lock_violation
+ DB GetExtCntry,2,error_invalid_function,error_file_not_found ;DOS 3.3
+ DB GetSetCdPg,2,error_invalid_function,error_file_not_found ;DOS 3.3
+ DB Commit,1,error_invalid_handle ;DOS 3.3
+ DB ExtHandle,3,error_too_many_open_files,error_not_enough_memory
+ DB error_invalid_function
+ DB ExtOpen,10
+ DB error_path_not_found,error_file_not_found,error_invalid_access
+ DB error_too_many_open_files,error_file_exists,error_not_enough_memory
+ DB error_not_dos_disk,error_invalid_data
+ DB error_invalid_function,error_access_denied
+ DB GetSetMediaID,4,error_invalid_drive,error_invalid_data
+ DB error_invalid_function,error_access_denied
+ DB 0FFh
+
+
+ PUBLIC DISPATCH
+
+;MAXCALL EQU VAL1
+;MAXCOM EQU VAL2
+
+; Standard Functions
+DISPATCH LABEL WORD
+ short_addr $ABORT ; 0 0
+ short_addr $STD_CON_INPUT ; 1 1
+ short_addr $STD_CON_OUTPUT ; 2 2
+ short_addr $STD_AUX_INPUT ; 3 3
+ short_addr $STD_AUX_OUTPUT ; 4 4
+ short_addr $STD_PRINTER_OUTPUT ; 5 5
+ short_addr $RAW_CON_IO ; 6 6
+ short_addr $RAW_CON_INPUT ; 7 7
+ short_addr $STD_CON_INPUT_NO_ECHO ; 8 8
+ short_addr $STD_CON_STRING_OUTPUT ; 9 9
+ short_addr $STD_CON_STRING_INPUT ; 10 A
+ short_addr $STD_CON_INPUT_STATUS ; 11 B
+ short_addr $STD_CON_INPUT_FLUSH ; 12 C
+ short_addr $DISK_RESET ; 13 D
+ short_addr $SET_DEFAULT_DRIVE ; 14 E
+ short_addr $FCB_OPEN ; 15 F
+ short_addr $FCB_CLOSE ; 16 10
+ short_addr $DIR_SEARCH_FIRST ; 17 11
+ short_addr $DIR_SEARCH_NEXT ; 18 12
+ short_addr $FCB_DELETE ; 19 13
+ short_addr $FCB_SEQ_READ ; 20 14
+ short_addr $FCB_SEQ_WRITE ; 21 15
+ short_addr $FCB_CREATE ; 22 16
+ short_addr $FCB_RENAME ; 23 17
+ short_addr NO_OP ; 24 18
+ short_addr $GET_DEFAULT_DRIVE ; 25 19
+ short_addr $SET_DMA ; 26 1A
+
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $SLEAZEFUNC ; 27 1B
+ short_addr $SLEAZEFUNCDL ; 28 1C
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+
+ short_addr NO_OP ; 29 1D
+ short_addr NO_OP ; 30 1E
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $GET_DEFAULT_DPB ; 31 1F
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr NO_OP ; 32 20
+ short_addr $FCB_RANDOM_READ ; 33 21
+ short_addr $FCB_RANDOM_WRITE ; 34 22
+ short_addr $GET_FCB_FILE_LENGTH ; 35 23
+ short_addr $GET_FCB_POSITION ; 36 24
+
+
+VAL1 = ($-DISPATCH)/2 - 1
+
+ PUBLIC MAXCALL
+MaxCall = VAL1
+
+; Extended Functions
+ short_addr $SET_INTERRUPT_VECTOR ; 37 25
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $CREATE_PROCESS_DATA_BLOCK ; 38 26
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr $FCB_RANDOM_READ_BLOCK ; 39 27
+ short_addr $FCB_RANDOM_WRITE_BLOCK ; 40 28
+ short_addr $PARSE_FILE_DESCRIPTOR ; 41 29
+ short_addr $GET_DATE ; 42 2A
+ short_addr $SET_DATE ; 43 2B
+ short_addr $GET_TIME ; 44 2C
+ short_addr $SET_TIME ; 45 2D
+ short_addr $SET_VERIFY_ON_WRITE ; 46 2E
+
+; Extended functionality group
+ short_addr $GET_DMA ; 47 2F
+ short_addr $GET_VERSION ; 48 30
+ short_addr $Keep_Process ; 49 31
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $GET_DPB ; 50 32
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr $SET_CTRL_C_TRAPPING ; 51 33
+ short_addr $GET_INDOS_FLAG ; 52 34
+ short_addr $GET_INTERRUPT_VECTOR ; 53 35
+ short_addr $GET_DRIVE_FREESPACE ; 54 36
+ short_addr $CHAR_OPER ; 55 37
+ short_addr $INTERNATIONAL ; 56 38
+; XENIX CALLS
+; Directory Group
+ short_addr $MKDIR ; 57 39
+ short_addr $RMDIR ; 58 3A
+ short_addr $CHDIR ; 59 3B
+; File Group
+ short_addr $CREAT ; 60 3C
+ short_addr $OPEN ; 61 3D
+ short_addr $CLOSE ; 62 3E
+ short_addr $READ ; 63 3F
+ short_addr $WRITE ; 64 40
+ short_addr $UNLINK ; 65 41
+ short_addr $LSEEK ; 66 42
+ short_addr $CHMOD ; 67 43
+ short_addr $IOCTL ; 68 44
+ short_addr $DUP ; 69 45
+ short_addr $DUP2 ; 70 46
+ short_addr $CURRENT_DIR ; 71 47
+; Memory Group
+ short_addr $ALLOC ; 72 48
+ short_addr $DEALLOC ; 73 49
+ short_addr $SETBLOCK ; 74 4A
+; Process Group
+ short_addr $EXEC ; 75 4B
+ short_addr $EXIT ; 76 4C
+ short_addr $WAIT ; 77 4D
+ short_addr $FIND_FIRST ; 78 4E
+; Special Group
+ short_addr $FIND_NEXT ; 79 4F
+; SPECIAL SYSTEM GROUP
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $SET_CURRENT_PDB ; 80 50
+ short_addr $GET_CURRENT_PDB ; 81 51
+ short_addr $GET_IN_VARS ; 82 52
+ short_addr $SETDPB ; 83 53
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr $GET_VERIFY_ON_WRITE ; 84 54
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $DUP_PDB ; 85 55
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr $RENAME ; 86 56
+ short_addr $FILE_TIMES ; 87 57
+ short_addr $AllocOper ; 88 58
+; Network extention system calls
+ short_addr $GetExtendedError ; 89 59
+ short_addr $CreateTempFile ; 90 5A
+ short_addr $CreateNewFile ; 91 5B
+ short_addr $LockOper ; 92 5C
+ short_addr $ServerCall ; 93 5D
+ short_addr $UserOper ; 94 5E
+ short_addr $AssignOper ; 95 5F
+ short_addr $NameTrans ; 96 60
+ short_addr NO_OP ; 97 61
+ short_addr $Get_Current_PDB ; 98 62
+; the next call is reserved for hangool sys call
+ short_addr $ECS_Call ; 99 63
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ short_addr $Set_Printer_Flag ; 100 64
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ short_addr $GetExtCntry ; 101 65
+ short_addr $GetSetCdPg ; 102 66
+ short_addr $ExtHandle ; 103 67
+ short_addr $Commit ; 104 68
+ short_addr $GSetMediaID ; 105 69 ;AN000;
+ short_addr $Commit ; 106 6A ;AN000;
+ short_addr NO_OP ; 107 6B
+ ; IFS_IOCTL no longer
+ ; supported
+ short_addr $Extended_Open ; 108 6C ;AN000;
+
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+ifdef ROMEXEC
+ short_addr $ROM_FIND_FIRST ; 109 6D
+ short_addr $ROM_FIND_NEXT ; 110 6E
+endif
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+
+
+
+
+VAL2 = ($-DISPATCH)/2 - 1
+
+ PUBLIC MAXCOM
+MaxCom = VAL2
+
+ If Installed
+
+PUBLIC FOO
+FOO LABEL WORD
+ Short_addr Leave2F
+DTab DW OFFSET DOSCODE:DOSTable
+ PUBLIC FOO,DTAB
+
+; BUGBUG sudeepb 15-Mar-1991 All the NO_OP below are to be scrutinized
+
+DOSTable LABEL WORD
+ DB (DOSTableEnd-DOSTable-1)/2
+ Short_addr DOSInstall ; 0 install check
+ Short_addr NO_OP ; 1 DOS_CLOSE
+ Short_addr RECSET ; 2 RECSET
+ Short_addr DOSGetGroup ; 3 Get DOSGROUP
+ Short_addr PATHCHRCMP ; 4 PATHCHRCMP
+ Short_addr OUTT ; 5 OUT
+ Short_addr NET_I24_ENTRY ; 6 NET_I24_ENTRY
+ Short_addr NO_OP ; 7 PLACEBUF
+ Short_addr FREE_SFT ; 8 FREE_SFT
+ Short_addr NO_OP ; 9 BUFWRITE
+ Short_addr NO_OP ; 10 SHARE_VIOLATION
+ Short_addr SHARE_ERROR ; 11 SHARE_ERROR
+ Short_addr SET_SFT_MODE ; 12 SET_SFT_MODE
+ Short_addr NO_OP ; 13 DATE16
+ Short_addr idle ; 14 empty slot
+ Short_addr NO_OP ; 15 SCANPLACE
+ Short_addr idle ; 16 empty slot
+ Short_addr StrCpy ; 17 StrCpy
+ Short_addr StrLen ; 18 StrLen
+ Short_addr Ucase ; 19 Ucase
+ Short_addr NO_OP ; 20 POINTCOMP
+ Short_addr NO_OP ; 21 CHECKFLUSH
+ Short_addr SFFromSFN ; 22 SFFromSFN
+ Short_addr GetCDSFromDrv ; 23 GetCDSFromDrv
+ Short_addr Get_User_Stack ; 24 Get_User_Stack
+ Short_addr GetThisDrv ; 25 GetThisDrv
+ Short_addr DriveFromText ; 26 DriveFromText
+ Short_addr NO_OP ; 27 SETYEAR
+ Short_addr NO_OP ; 28 DSUM
+ Short_addr NO_OP ; 29 DSLIDE
+ Short_addr StrCmp ; 30 StrCmp
+ Short_addr InitCDS ; 31 initcds
+ Short_addr pJFNFromHandle ; 32 pJfnFromHandle
+ Short_addr $NameTrans ; 33 $NameTrans
+ Short_addr CAL_LK ; 34 CAL_LK
+ Short_addr DEVNAME ; 35 DEVNAME
+ Short_addr Idle ; 36 Idle
+ Short_addr DStrLen ; 37 DStrLen
+ Short_addr NLS_OPEN ; 38 NLS_OPEN DOS 3.3
+ Short_addr $CLOSE ; 39 $CLOSE DOS 3.3
+ Short_addr NLS_LSEEK ; 40 NLS_LSEEK DOS 3.3
+ Short_addr $READ ; 41 $READ DOS 3.3
+ Short_addr FastInit ; 42 FastInit DOS 3.4 ;AN000;
+ Short_addr NLS_IOCTL ; 43 NLS_IOCTL DOS 3.3
+ Short_addr GetDevList ; 44 GetDevList DOS 3.3
+ Short_addr NLS_GETEXT ; 45 NLS_GETEXT DOS 3.3
+ Short_addr MSG_RETRIEVAL ; 46 MSG_RETRIEVAL DOS 4.0 ;AN000;
+
+ Short_addr NO_OP ; M006: 47 no longer supported
+;*** Short_addr Fake_Version ; 47 Fake_Version DOS 4.0 ;AN006;
+
+DOSTableEnd LABEL BYTE
+
+ ENDIF
+
+; NOTE WARNING: This declaration of HEADER must be THE LAST thing in this
+; module. The reason is so that the data alignments are the same in
+; IBM-DOS and MS-DOS up through header.
+
+
+ PUBLIC HEADER
+Header LABEL BYTE
+ IF DEBUG
+ DB 13,10,"Debugging DOS version "
+ DB MAJOR_VERSION + "0"
+ DB "."
+ DB (MINOR_VERSION / 10) + "0"
+ DB (MINOR_VERSION MOD 10) + "0"
+ ENDIF
+
+ IF NOT IBM
+ DB 13,10,"MS-DOS version "
+ DB MAJOR_VERSION + "0"
+ DB "."
+ DB (MINOR_VERSION / 10) + "0"
+ DB (MINOR_VERSION MOD 10) + "0"
+
+ IF HIGHMEM
+ DB "H"
+ ENDIF
+
+ DB 13,10, "Copyright 1981,82,83,84,88 Microsoft Corp.",13,10,"$"
+ ENDIF
+
+IF DEBUG
+ DB 13,10,"$"
+ENDIF
+
+MSTAB001E label byte
+
+include copyrigh.inc
+
+
+DOSCODE ENDS
+
+; ==========================================================================
+
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/open.asm b/private/mvdm/dos/v86/doskrnl/dos/open.asm
new file mode 100644
index 000000000..7a4324ba9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/open.asm
@@ -0,0 +1,383 @@
+ TITLE DOS_OPEN - Internal OPEN call for MS-DOS
+ NAME DOS_OPEN
+
+;** OPEN.ASM - File Open
+;
+; Low level routines for openning a file from a file spec.
+; Also misc routines for sharing errors
+;
+; DOS_Open
+; Check_Access_AX
+; SHARE_ERROR
+; SET_SFT_MODE
+; Code_Page_Mismatched_Error ; DOS 4.00
+;
+; Revision history:
+;
+; Created: ARR 30 March 1983
+; A000 version 4.00 Jan. 1988
+;
+; M034 - The value in save_bx must be pushed on to the stack for
+; remote extended opens and not save_cx.
+;
+; M035 - if open made from exec then we must set the appropriate bits
+; on the stack before calling off to the redir.
+; M042 - Bit 11 of DOS34_FLAG set indicates that the redir knows how
+; to handle open from exec. In this case set the appropriate bit
+; else do not.
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include fastopen.inc
+ include fastxxxx.inc
+ include sf.inc
+ include mult.inc
+ include filemode.inc
+ include curdir.inc
+
+ .cref
+ .list
+
+Installed = TRUE
+
+ i_need NoSetDir,BYTE
+ i_need THISSFT,DWORD
+ i_need THISCDS,DWORD
+ i_need CURBUF,DWORD
+ i_need CurrentPDB,WORD
+ i_need CURR_DIR_END,WORD
+ I_need RetryCount,WORD
+ I_need Open_Access,BYTE
+ I_need fSharing,BYTE
+ i_need JShare,DWORD
+ I_need FastOpenFlg,byte
+ I_need EXTOPEN_ON,BYTE ;AN000;; DOS 4.00
+ I_need ALLOWED,BYTE ;AN000;; DOS 4.00
+ I_need EXTERR,WORD ;AN000;; DOS 4.00
+ I_need EXTERR_LOCUS,BYTE ;AN000;; DOS 4.00
+ I_need EXTERR_ACTION,BYTE ;AN000;; DOS 4.00
+ I_need EXTERR_CLASS,BYTE ;AN000;; DOS 4.00
+ I_need CPSWFLAG,BYTE ;AN000;; DOS 4.00
+ I_need EXITHOLD,DWORD ;AN000;; DOS 4.00
+ I_need THISDPB,DWORD ;AN000;; DOS 4.00
+ I_need SAVE_CX,WORD ;AN000;; DOS 4.00
+ I_need SAVE_BX,WORD ;M034
+ i_need DEVPT,DWORD
+
+ I_need DOS_FLAG,BYTE
+ I_need DOS34_FLAG,WORD ;M042
+
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+Break <DOS_Open - internal file access>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : DOS_Open
+;
+; Inputs:
+; [WFP_START] Points to WFP string ("d:/" must be first 3 chars, NUL
+; terminated)
+; [CURR_DIR_END] Points to end of Current dir part of string
+; ( = -1 if current dir not involved, else
+; Points to first char after last "/" of current dir part)
+; [THISCDS] Points to CDS being used
+; (Low word = -1 if NUL CDS (Net direct request))
+; [THISSFT] Points to SFT to fill in if file found
+; (sf_mode field set so that FCB may be detected)
+; [SATTRIB] Is attribute of search, determines what files can be found
+; AX is Access and Sharing mode
+; High NIBBLE of AL (Sharing Mode)
+; sharing_compat file is opened in compatibility mode
+; sharing_deny_none file is opened Multi reader, Multi writer
+; sharing_deny_read file is opened Only reader, Multi writer
+; sharing_deny_write file is opened Multi reader, Only writer
+; sharing_deny_both file is opened Only reader, Only writer
+; Low NIBBLE of AL (Access Mode)
+; open_for_read file is opened for reading
+; open_for_write file is opened for writing
+; open_for_both file is opened for both reading and writing.
+;
+; For FCB SFTs AL should = sharing_compat + open_for_both
+; (not checked)
+; Function:
+; Try to open the specified file
+; Outputs:
+; sf_ref_count is NOT altered
+; CARRY CLEAR
+; THISSFT filled in.
+; CARRY SET
+; AX is error code
+; error_file_not_found
+; Last element of path not found
+; error_path_not_found
+; Bad path (not in curr dir part if present)
+; error_bad_curr_dir
+; Bad path in current directory part of path
+; error_invalid_access
+; Bad sharing mode or bad access mode or bad combination
+; error_access_denied
+; Attempt to open read only file for writting, or
+; open a directory
+; error_sharing_violation
+; The sharing mode was correct but not allowed
+; generates an INT 24 on compatibility mode SFTs
+; DS preserved, others destroyed
+;----------------------------------------------------------------------------
+
+procedure DOS_Open,NEAR
+
+ ; DS has been set up to DOSDATA in file.asm and fcbio2.asm.
+
+ DOSAssume <DS>,"DOS_Open"
+
+ MOV [NoSetDir],0
+ CALL Check_Access_AX
+ retc
+ LES DI,[THISSFT]
+ XOR AH,AH
+
+ ; sleaze! move only access/sharing mode in. Leave sf_isFCB unchanged
+
+ MOV BYTE PTR ES:[DI.sf_mode],AL ; For moment do this on FCBs too
+
+LOCAL_OPEN:
+ ; sudeepb - we rely on the fact that DEVPT is pointing to the right
+ ; device header as set by TransPath in $open.
+
+ push ds
+ lds si,dword ptr [DEVPT]
+ mov word ptr es:[di.sf_devptr],si
+ mov word ptr es:[di.sf_devptr+2],ds
+ mov bl,byte ptr ds:[si.sdevatt]
+ or bl,0c0H
+ and bl,not 020h
+ OR bl,devid_file_clean
+ mov byte ptr es:[di.sf_flags],bl
+ pop ds
+ MOV AX,[CurrentPDB]
+ MOV ES:[DI.sf_PID],AX
+ xor ax,ax
+ mov byte ptr es:[di.sf_attr],al
+ mov word ptr es:[di.sf_size],ax
+ mov word ptr es:[di.sf_size+2],ax
+ mov word ptr es:[di.sf_time],ax
+ mov word ptr es:[di.sf_date],ax
+ mov word ptr es:[di.sf_position],ax
+ mov word ptr es:[di.sf_position+2],ax
+ invoke DEV_OPEN_SFT
+ return
+
+EndProc DOS_Open,NoCheck
+
+procedure DOS_Open_Checks,NEAR
+
+ DOSAssume <DS>,"DOS_Open"
+
+ MOV [NoSetDir],0
+ CALL Check_Access_AX
+ JC ret_label ; retc
+ LES DI,[THISSFT]
+ XOR AH,AH
+
+ ; sleaze! move only access/sharing mode in. Leave sf_isFCB unchanged
+
+ MOV BYTE PTR ES:[DI.sf_mode],AL ; For moment do this on FCBs too
+ CLC
+ret_label:
+ return ;FT. ;AN000;
+EndProc DOS_Open_Checks,NoCheck
+
+;---------------------------------------------------------------------------
+; DOS_Create, DOS_CreateNEW
+;
+; These are dummy procedures and no body calls them. They are just used
+; to make life easy in $open to dispatch to right SVC.
+;
+
+PROCEDURE DOS_CREATE_NEW,NEAR
+ ret
+ENDPROC DOS_CREATE_NEW
+
+PROCEDURE DOS_CREATE,NEAR
+ ret
+ENDPROC DOS_CREATE
+
+;----------------------------------------------------------------------------
+; Procedure Name : SET_SFT_MODE
+;
+; Finish SFT initialization for new reference. Set the correct mode.
+;
+; Inputs:
+; ThisSFT points to SFT
+;
+; Outputs:
+; Carry clear
+; Registers modified: AX.
+;---------------------------------------------------------------------------
+
+;hkn; called from create. DS already set up to DOSDATA.
+
+PROCEDURE Set_SFT_Mode,NEAR
+
+ DOSAssume <DS>,"Set_SFT_Mode"
+ LES DI,ThisSFT
+ invoke DEV_OPEN_SFT
+ TEST ES:[DI.sf_mode],sf_isfcb; Clears carry
+ JZ Clear_FastOpen ; sf_mode correct (retz)
+ MOV AX,[CurrentPDB]
+ MOV ES:[DI.sf_PID],AX ; For FCB sf_PID=PDB
+
+Clear_FastOpen:
+ return ;;;;; DOS 3.3
+
+ENDPROC Set_SFT_MODE
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : SHARE_ERROR
+;
+; Called on sharing violations. ES:DI points to SFT. AX has error code
+; If SFT is FCB or compatibility mode gens INT 24 error.
+; Returns carry set AX=error_sharing_violation if user says ignore (can't
+; really ignore). Carry clear
+; if user wants a retry. ES, DI, DS preserved
+;---------------------------------------------------------------------------
+
+procedure SHARE_ERROR,NEAR
+ DOSAssume <DS>,"Share_Error"
+; BUGBUG sudeep 15-Mar-1991 Sharing errors to be handled
+
+ ifdef NTDOS
+ TEST ES:[DI.sf_mode],sf_isfcb
+ JNZ HARD_ERR
+ MOV CL,BYTE PTR ES:[DI.sf_mode]
+ AND CL,sharing_mask
+ CMP CL,sharing_compat
+ JNE NO_HARD_ERR
+HARD_ERR:
+ invoke SHARE_VIOLATION
+ retnc ; User wants retry
+NO_HARD_ERR:
+ MOV AX,error_sharing_violation
+ STC
+ return
+else
+ int 3
+ return
+endif
+
+EndProc SHARE_ERROR
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : DO_SHARE_CHECK
+;
+; Input: THISDPB, WFP_Start, THISSFT set
+; Functions: check file sharing mode is valid
+; Output: carry set, error
+; carry clear, share ok
+;----------------------------------------------------------------------------
+
+procedure DO_SHARE_CHECK,NEAR
+ DOSAssume <DS>,"DO_SHARE__CHECK"
+; BUGBUG sudeep 15-Mar-1991 Sharing errors to be handled
+ifdef NTDOS
+OPN_RETRY:
+ MOV CX,RetryCount ; Get # tries to do
+OpenShareRetry:
+ SAVE <CX> ; Save number left to do
+ invoke SHARE_CHECK ; Final Check
+ RESTORE <CX> ; CX = # left
+ JNC Share_Ok2 ; No problem with access
+ Invoke Idle
+ LOOP OpenShareRetry ; One more retry used up
+OpenShareFail:
+ LES DI,[ThisSft]
+ invoke SHARE_ERROR
+ JNC OPN_RETRY ; User wants more retry
+Share_Ok2:
+ return
+else
+ int 3
+ return
+endif
+
+EndProc DO_SHARE_CHECK
+
+;-----------------------------------------------------------------------------
+;
+; Procedure Name : Check_Access
+;
+; Inputs:
+; AX is mode
+; High NIBBLE of AL (Sharing Mode)
+; sharing_compat file is opened in compatibility mode
+; sharing_deny_none file is opened Multi reader, Multi writer
+; sharing_deny_read file is opened Only reader, Multi writer
+; sharing_deny_write file is opened Multi reader, Only writer
+; sharing_deny_both file is opened Only reader, Only writer
+; Low NIBBLE of AL (Access Mode)
+; open_for_read file is opened for reading
+; open_for_write file is opened for writing
+; open_for_both file is opened for both reading and writing.
+; Function:
+; Check this access mode for correctness
+; Outputs:
+; [open_access] = AL input
+; Carry Clear
+; Mode is correct
+; AX unchanged
+; Carry Set
+; Mode is bad
+; AX = error_invalid_access
+; No other registers effected
+;----------------------------------------------------------------------------
+
+procedure Check_Access_AX
+ DOSAssume <DS>,"Check_Access"
+
+ MOV Open_Access,AL
+ PUSH BX
+
+; If sharing, then test for special sharing mode for FCBs
+
+ MOV BL,AL
+ AND BL,sharing_mask
+ CMP fSharing,-1
+ JNZ CheckShareMode ; not through server call, must be ok
+ CMP BL,sharing_NET_FCB
+ JZ CheckAccessMode ; yes, we have an FCB
+CheckShareMode:
+ CMP BL,40h ; is this a good sharing mode?
+ JA Make_Bad_Access
+CheckAccessMode:
+ MOV BL,AL
+ AND BL,access_mask
+ CMP BL,2
+ JA Make_Bad_Access
+ POP BX
+ CLC
+ return
+
+make_bad_access:
+ MOV AX,error_invalid_access
+ POP BX
+ STC
+ return
+
+EndProc Check_Access_AX
+
+
+DOSCODE ENDS
+ END
+
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/origin.asm b/private/mvdm/dos/v86/doskrnl/dos/origin.asm
new file mode 100644
index 000000000..c1b74e226
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/origin.asm
@@ -0,0 +1,27 @@
+
+
+;-------------------------------------------------------------------------
+;
+; This is the first file to be linked in the DOS. It contains the appropriate
+; offset to which the DOS is to be ORG'd.
+;
+; See ..\inc\origin.inc for description
+;
+;---------------------------------------------------------------------------
+
+include version.inc
+include dosseg.inc
+include dossym.inc
+include origin.inc
+
+DOSCODE SEGMENT
+
+ dw PARASTART ; for stripz utility
+
+ org PARASTART
+
+
+DOSCODE ENDS
+
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/parse.asm b/private/mvdm/dos/v86/doskrnl/dos/parse.asm
new file mode 100644
index 000000000..82bbf8a5c
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/parse.asm
@@ -0,0 +1,60 @@
+ TITLE PARSE - Parsing system calls for MS-DOS
+ NAME PARSE
+
+
+; System calls for parsing command lines
+;
+; $PARSE_FILE_DESCRIPTOR
+;
+; Modification history:
+;
+; Created: ARR 30 March 1983
+; EE PathParse 10 Sept 1983
+;
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ .cref
+ .list
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+BREAK <$Parse_File_Descriptor -- Parse an arbitrary string into an FCB>
+;---------------------------------------------------------------------------
+; Inputs:
+; DS:SI Points to a command line
+; ES:DI Points to an empty FCB
+; Bit 0 of AL = 1 At most one leading separator scanned off
+; = 0 Parse stops if separator encountered
+; Bit 1 of AL = 1 If drive field blank in command line - leave FCB
+; = 0 " " " " " " - put 0 in FCB
+; Bit 2 of AL = 1 If filename field blank - leave FCB
+; = 0 " " " - put blanks in FCB
+; Bit 3 of AL = 1 If extension field blank - leave FCB
+; = 0 " " " - put blanks in FCB
+; Function:
+; Parse command line into FCB
+; Returns:
+; AL = 1 if '*' or '?' in filename or extension, 0 otherwise
+; DS:SI points to first character after filename
+;---------------------------------------------------------------------------
+
+ procedure $PARSE_FILE_DESCRIPTOR,NEAR
+ASSUME DS:NOTHING,ES:NOTHING
+
+ invoke MAKEFCB
+ PUSH SI
+ invoke get_user_stack
+ POP [SI.user_SI]
+ return
+EndProc $PARSE_FILE_DESCRIPTOR
+
+
+DOSCODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/path.asm b/private/mvdm/dos/v86/doskrnl/dos/path.asm
new file mode 100644
index 000000000..ffa717930
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/path.asm
@@ -0,0 +1,431 @@
+ TITLE PATH - Directory related system calls
+ NAME PATH
+
+;** Directory related system calls. These will be passed direct text of the
+; pathname from the user. They will need to be passed through the macro
+; expander prior to being sent through the low-level stuff. I/O specs are
+; defined in DISPATCH. The system calls are:
+;
+; $CURRENT_DIR Written
+; $RMDIR Written
+; $CHDIR Written
+; $MKDIR Written
+;
+;
+; Modification history:
+;
+; Created: ARR 4 April 1983
+; MZ 10 May 1983 CurrentDir implemented
+; MZ 11 May 1983 RmDir, ChDir, MkDir implemented
+; EE 19 Oct 1983 RmDir no longer allows you to delete a
+; current directory.
+; MZ 19 Jan 1983 Brain damaged applications rely on success
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include curdir.inc
+ include filemode.inc
+ include mult.inc
+ include dossvc.inc
+ .cref
+ .list
+
+ I_Need ThisCDS,DWORD ; pointer to Current CDS
+ I_Need WFP_Start,WORD ; pointer to beginning of directory text
+ I_Need Curr_Dir_End,WORD ; offset to end of directory part
+ I_Need OpenBuf,128 ; temp spot for translated name
+ I_need fSplice,BYTE ; TRUE => do splice
+ I_Need NoSetDir,BYTE ; TRUE => no exact match on splice
+ I_Need cMeta,BYTE
+ I_Need DrvErr,BYTE ;AN000;
+
+
+DOSCODE SEGMENT
+
+ allow_getdseg
+
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+BREAK <$CURRENT_DIR - dump the current directory into user space>
+;---------------------------------------------------------------------------
+; Procedure Name : $CURRENT_DIR
+;
+; Assembler usage:
+; LDS SI,area
+; MOV DL,drive
+; INT 21h
+; ; DS:SI is a pointer to 64 byte area that contains drive
+; ; current directory.
+; Error returns:
+; AX = error_invalid_drive
+;
+;---------------------------------------------------------------------------
+
+procedure $CURRENT_DIR,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+ EnterCrit critDisk
+ MOV AL,DL ; get drive number (0=def, 1=A)
+ Invoke GetVisDrv ; grab it
+ JNC CurrentValidate ; no error -> go and validate dir
+
+CurdirErr:
+ LeaveCrit critDisk
+
+;hkn; Set up DS to access DrvErr
+ push ds
+ getdseg <ds> ; ds -> dosdata
+
+ MOV AL,[DrvErr] ;IFS. ;AN000;
+
+ pop ds
+ assume ds:nothing
+
+ transfer SYS_RET_ERR ;IFS. make noise ;AN000;
+
+CurrentValidate:
+ SAVE <DS,SI> ; save destination
+
+;hkn; Set up DS to access ThisCDS
+ getdseg <ds> ; ds -> dosdata
+
+ LDS SI,ThisCDS
+
+ assume ds:nothing
+
+; Dont validate FIXED drives which include FIXED DISK. NETWORK DRIVES and
+; CDROM. This is compaitable with DOS5. Sudeepb 23-Dec-1993
+
+ test WORD PTR DS:[SI.CURDIR_FLAGS],CURDIR_NT_FIX
+ jnz noquery
+ HRDSVC SVC_DEMQUERYCURRENTDIR
+noquery:
+
+ RESTORE <DI,ES> ; get real destination
+ JC CurdirErr
+ ADD SI,curdir_text
+ ADD SI,[SI.curdir_END]
+ CMP BYTE PTR [SI],'\' ; root or subdirs present?
+ JNZ CurrentCopy
+ INC SI
+CurrentCopy:
+; Invoke FStrCpy
+;; 10/29/86 E5 char
+ PUSH AX
+ LODSB ; get char
+ OR AL,AL
+ JZ FOK
+ CMP AL,05
+ JZ FCHANGE
+ JMP short FFF
+FCPYNEXT:
+ LODSB ; get char
+FFF:
+ CMP AL,'\' ; beginning of directory
+ JNZ FOK ; no
+
+ invoke UCase
+
+ STOSB ; put into user's buffer
+ LODSB ; 1st char of dir is 05?
+ CMP AL,05H
+ JNZ FOK ; no
+FCHANGE:
+ MOV AL,0E5H ; make it E5
+FOK:
+ invoke UCase
+
+ STOSB ; put into user's buffer
+ OR AL,AL ; final char
+ JNZ FCPYNEXT ; no
+ POP AX
+
+;; 10/29/86 E5 char
+ xor AL,AL ; MZ 19 Jan 84
+ LeaveCrit critDisk
+ transfer Sys_Ret_OK ; no more, bye!
+
+EndProc $Current_Dir
+
+
+BREAK <$ChDir -- Change current directory on a drive>
+;----------------------------------------------------------------------------
+;
+; $ChDir - Top-level change directory system call. This call is responsible
+; for setting up the CDS for the specified drive appropriately. There are
+; several cases to consider:
+;
+; o Local, simple CDS. In this case, we take the input path and convert
+; it into a WFP. We verify the existance of this directory and then
+; copy the WFP into the CDS and set up the ID field to point to the
+; directory cluster.
+; o Net CDS. We form the path from the root (including network prefix)
+; and verify its existance (via DOS_Chdir). If successful, we copy the
+; WFP back into the CDS.
+; o SUBST'ed CDS. This is no different than the local, simple CDS.
+; o JOIN'ed CDS. This is trouble as there are two CDS's at work. If we
+; call TransPath, we will get the PHYSICAL CDS that the path refers to
+; and the PHYSICAL WFP that the input path refers to. This is perfectly
+; good for the validation but not for currency. We call TransPathNoSet
+; to process the path but to return the logical CDS and the logical
+; path. We then copy the logical path into the logical CDS.
+;
+; Inputs:
+; DS:DX Points to asciz name
+; Returns:
+; STD XENIX Return
+; AX = chdir_path_not_found if error
+;----------------------------------------------------------------------------
+
+procedure $CHDIR,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+;hkn; OpenBuf is in DOSDATA
+ MOV DI,OFFSET DOSDATA:OpenBuf ; spot for translated name
+ MOV SI,DX ; get source
+ Invoke TransPath ; go munge the path and get real CDS
+ JNC ChDirCrack ; no errors, try path
+ChDirErrP:
+ MOV AL,error_path_not_found
+ChdirErr:
+ transfer SYS_Ret_Err ; oops!
+
+ChDirCrack:
+
+ Assume DS:DOSDATA
+
+ CMP cMeta,-1 ; No meta chars allowed.
+ JNZ ChDirErrP
+ or ax,ax
+ jz ChDirErrp ; Device name
+;
+; We cannot do a ChDir (yet) on a raw CDS. This is treated as a path not
+; found.
+;
+ LES DI,ThisCDS
+ CMP DI,-1 ; if (ThisCDS == NULL)
+ JZ ChDirErrP ; error ();
+ TEST ES:[DI].curdir_flags,curdir_splice
+ JZ GotCDS
+;
+; The CDS was joined. Let's go back and grab the logical CDS.
+;
+ SAVE <ES,DI,CX> ; save CDS and cluster...
+ Invoke Get_User_Stack ; get original text
+ ASSUME DS:NOTHING
+ MOV DI,[SI.User_DX]
+ MOV DS,[SI.User_DS]
+
+;hkn; OpenBuf is in DOSDATA
+ MOV SI,OFFSET DOSDATA:OpenBuf ; spot for translated name
+
+ XCHG SI,DI
+ XOR AL,AL ; do no splicing
+ SAVE <DI>
+ Invoke TransPathNoSet ; Munge path
+ RESTORE <SI>
+;hkn; Assume DS:DOSGroup
+
+ Assume DS:DOSDATA
+;
+; There should NEVER be an error here.
+;
+IF FALSE
+ JNC SKipErr
+ fmt <>,<>,<"$p: Internal CHDIR error\n">
+SkipErr:
+ENDIF
+ LES DI,ThisCDS ; get new CDS
+; MOV ES:[DI].curdir_ID,-1 ; no valid cluster here...
+ RESTORE <CX,DI,ES>
+;
+; ES:DI point to the physical CDS, CX is the ID (local only)
+;
+GotCDS:
+;
+; wfp_start points to the text. See if it is long enough
+;
+ CALL Check_PathLen ;PTM. ;AN000;
+ JA ChDirErrP
+ Context <DS>
+ mov dx,wfp_start
+ mov si,dx
+ HRDSVC SVC_DEMSETCURRENTDIR
+ jnc UpdateCDS
+ jmp ChDirErrP
+UpdateCDS:
+ LES DI,ThisCDS ; get logical CDS
+SkipRecency:
+ invoke FStrCpy
+ XOR AL,AL
+ transfer Sys_Ret_OK
+EndProc $CHDIR
+
+BREAK <$MkDir - Make a directory entry>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : $MkDir
+; Inputs:
+; DS:DX Points to asciz name
+; Function:
+; Make a new directory
+; Returns:
+; STD XENIX Return
+; AX = mkdir_path_not_found if path bad
+; AX = mkdir_access_denied If
+; Directory cannot be created
+; Node already exists
+; Device name given
+; Disk or directory(root) full
+;---------------------------------------------------------------------------
+
+procedure $MKDIR,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV DI,OFFSET DOSDATA:OpenBuf ; spot for translated name
+
+ MOV SI,DX ; get source
+ Invoke TransPath ; go munge the path
+ JNC MkDirCrack ; no errors, try path
+MkErrP:
+ MOV AL,error_Path_Not_Found ; oops!
+MkErr:
+ stc
+ transfer Sys_Ret_Err
+MkDirCrack:
+
+;hkn; SS override
+ CMP cMeta,-1
+ JNZ MkErrP
+ or ax,ax
+ jz MkErrP ; No device allowed
+
+ CALL Check_PathLen ;PTM. check path len > 67 ? ;AN000;
+ JBE pathok ;PTM. ;AN000;
+ MOV AL,error_Access_Denied ;PTM. ops!
+ transfer Sys_Ret_Err ;PTM.
+pathok:
+ Context <DS>
+ mov dx,wfp_start
+ xor bx,bx
+ xor si,si
+ HRDSVC SVC_DEMCREATEDIR
+ ASSUME ES:NOTHING
+ JC MkErrCheck ; no errors
+ transfer Sys_Ret_OK
+
+
+ ; NTVDM - 14-Jan-1994 Jonle
+ ; Both RmDir and MkDir use this common error code remapping
+ ; of error_not_ready to error_path_not_found.
+ ;
+ ; The Ntvdm version of TransPath does not verify that
+ ; the drive\path actually exists. The error is supposed to be
+ ; error_path_not_found, but will become error_access_denied
+ ; because error_not_ready is not a valid error code for MkDir\RmDir
+MkErrCheck:
+ cmp al, error_not_ready
+ jz MkErrP
+ jmp short MkErr
+
+EndProc $MKDIR
+
+
+BREAK <$RmDir -- Remove a directory>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : $RmDir
+;
+; Inputs:
+; DS:DX Points to asciz name
+; Function:
+; Delete directory if empty
+; Returns:
+; STD XENIX Return
+; AX = error_path_not_found If path bad
+; AX = error_access_denied If
+; Directory not empty
+; Path not directory
+; Root directory specified
+; Directory malformed (. and .. not first two entries)
+; User tries to delete a current directory
+; AX = error_current_directory
+;----------------------------------------------------------------------------
+
+procedure $RMDIR,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ push dx ; Save ptr to name
+ push ds
+ mov si,dx ; Load ptr into si
+
+;hkn; OpenBuf is in DOSDATA
+ mov di,offset DOSDATA:OpenBuf ; di = ptr to buf for trans name
+ push di
+ Invoke TransPathNoSet ; Translate the name
+ pop di ; di = ptr to buf for trans name
+ jnc rmlset ; If transpath succeeded, continue
+rmle:
+ pop ds
+ pop dx ; Restore the name
+ error error_path_not_found ; Otherwise, return an error
+
+rmlset:
+
+;hkn; SS override
+ CMP cMeta,-1 ; if (cMeta >= 0)
+ Jnz rmerr ; return (-1);
+ or ax,ax
+ jz rmle ; cannot delete a device
+ pop ds
+ pop dx
+ push es
+ pop ds
+ mov dx,wfp_start ; ds:dx is the path
+ HRDSVC SVC_DEMDELETEDIR
+ jc MkErrCheck
+ transfer Sys_Ret_OK
+rmerr:
+ pop ds
+ pop dx ; Restore the name
+ error error_current_directory ; error
+
+EndProc $RMDIR
+
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : Check_PathLen
+;
+; Inputs:
+; nothing
+; Function:
+; check if final path length greater than 67
+; Returns:
+; Above flag set if > 67
+;---------------------------------------------------------------------------
+
+procedure Check_PathLen,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+;hkn; SS override
+ MOV SI,Wfp_Start
+ entry Check_PathLen2
+
+;hkn; SS is DOSDATA
+ Context <DS>
+
+ SAVE <CX>
+ invoke DStrLen
+ CMP CX,DirStrLen
+ RESTORE <CX>
+ ret
+
+EndProc Check_PathLen
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/scnam.inc b/private/mvdm/dos/v86/doskrnl/dos/scnam.inc
new file mode 100644
index 000000000..b2993bba0
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/scnam.inc
@@ -0,0 +1,221 @@
+
+SCnm_0 DB "Abort",0
+SCnm_1 DB "Std_Con_Input",0
+SCnm_2 DB "Std_Con_Output",0
+SCnm_3 DB "Std_Aux_Input",0
+SCnm_4 DB "Std_Aux_Output",0
+SCnm_5 DB "Std_Printer_Output",0
+SCnm_6 DB "Raw_Con_IO",0
+SCnm_7 DB "Raw_Con_Input",0
+SCnm_8 DB "Std_Con_Input_No_Echo",0
+SCnm_9 DB "Std_Con_String_Output",0
+SCnm_10 DB "Std_Con_String_Input",0
+SCnm_11 DB "Std_Con_Input_Status",0
+SCnm_12 DB "Std_Con_Input_Flush",0
+SCnm_13 DB "Disk_Reset",0
+SCnm_14 DB "Set_Default_Drive",0
+SCnm_15 DB "FCB_Open",0
+SCnm_16 DB "FCB_Close",0
+SCnm_17 DB "Dir_Search_First",0
+SCnm_18 DB "Dir_Search_Next",0
+SCnm_19 DB "FCB_Delete",0
+SCnm_20 DB "FCB_Seq_Read",0
+SCnm_21 DB "FCB_Seq_Write",0
+SCnm_22 DB "FCB_Create",0
+SCnm_23 DB "FCB_Rename",0
+SCnm_24 DB "===24===",0
+SCnm_25 DB "Get_Default_Drive",0
+SCnm_26 DB "Set_DMA",0
+SCnm_27 DB "===27===",0
+SCnm_28 DB "===28===",0
+SCnm_29 DB "===29===",0
+SCnm_30 DB "===30===",0
+SCnm_31 DB "Get_Default_DPB",0
+SCnm_32 DB "===32===",0
+SCnm_33 DB "FCB_Random_Read",0
+SCnm_34 DB "FCB_Random_Write",0
+SCnm_35 DB "Get_FCB_File_Length",0
+SCnm_36 DB "Get_FCB_Position",0
+SCnm_37 DB "Set_Interrupt_Vector",0
+SCnm_38 DB "Create_Process_Data_Block",0
+SCnm_39 DB "FCB_Random_Read_Block",0
+SCnm_40 DB "FCB_Random_Write_Block",0
+SCnm_41 DB "Parse_File_Descriptor",0
+SCnm_42 DB "Get_Date",0
+SCnm_43 DB "Set_Date",0
+SCnm_44 DB "Get_Time",0
+SCnm_45 DB "Set_Time",0
+SCnm_46 DB "Set_Verify_On_Write",0
+SCnm_47 DB "Get_DMA",0
+SCnm_48 DB "Get_Version",0
+SCnm_49 DB "Keep_Process",0
+SCnm_50 DB "Get_DPB",0
+SCnm_51 DB "Set_CTRL_C_Trapping",0
+SCnm_52 DB "Get_InDOS_Flag",0
+SCnm_53 DB "Get_Interrupt_Vector",0
+SCnm_54 DB "Get_Drive_Freespace",0
+SCnm_55 DB "Char_Oper",0
+SCnm_56 DB "International",0
+SCnm_57 DB "MKDir",0
+SCnm_58 DB "RMDir",0
+SCnm_59 DB "CHDir",0
+SCnm_60 DB "Creat",0
+SCnm_61 DB "Open",0
+SCnm_62 DB "Close",0
+SCnm_63 DB "Read",0
+SCnm_64 DB "Write",0
+SCnm_65 DB "Unlink",0
+SCnm_66 DB "LSeek",0
+SCnm_67 DB "CHMod",0
+SCnm_68 DB "IOCtl",0
+SCnm_69 DB "XDup",0
+SCnm_70 DB "XDup2",0
+SCnm_71 DB "Current_Dir",0
+SCnm_72 DB "Alloc",0
+SCnm_73 DB "Dealloc",0
+SCnm_74 DB "Setblock",0
+SCnm_75 DB "Exec",0
+SCnm_76 DB "Exit",0
+SCnm_77 DB "WaitProcess",0
+SCnm_78 DB "Find_First",0
+SCnm_79 DB "Find_Next",0
+SCnm_80 DB "Set_Current_PDB",0
+SCnm_81 DB "Get_Current_PDB",0
+SCnm_82 DB "Get_In_Vars",0
+SCnm_83 DB "SetDPB",0
+SCnm_84 DB "Get_Verify_On_Write",0
+SCnm_85 DB "Dup_PDB",0
+SCnm_86 DB "Rename",0
+SCnm_87 DB "File_Times",0
+SCnm_88 DB "AllocOper",0
+SCnm_89 DB "GetExtendedError",0
+SCnm_90 DB "CreateTempFile",0
+SCnm_91 DB "CreateNewFile",0
+SCnm_92 DB "LockOper",0
+SCnm_93 DB "ServerCall",0
+SCnm_94 DB "UserOper",0
+SCnm_95 DB "AssignOper",0
+SCnm_96 DB "xNameTrans",0
+SCnm_97 DB "PathParse",0
+SCnm_98 DB "GetCurrentPSP",0
+SCnm_99 DB "ECS_CALL",0
+SCnm_100 DB "Set_Printer_Flag",0
+SCnm_101 DB "GetExtCntry",0
+SCnm_102 DB "GetSetCdPg",0
+SCnm_103 DB "ExtHandle",0
+SCnm_104 DB "Commit",0
+SCnm_105 DB "GetSetMediaID",0
+SCnm_106 DB "===106===",0
+SCnm_107 DB "IFS_IOCTL",0
+SCnm_108 DB "ExtOpen",0
+
+
+scptrs DW offset DOSCODE:SCnm_0
+ DW offset DOSCODE:SCnm_1
+ DW offset DOSCODE:SCnm_2
+ DW offset DOSCODE:SCnm_3
+ DW offset DOSCODE:SCnm_4
+ DW offset DOSCODE:SCnm_5
+ DW offset DOSCODE:SCnm_6
+ DW offset DOSCODE:SCnm_7
+ DW offset DOSCODE:SCnm_8
+ DW offset DOSCODE:SCnm_9
+ DW offset DOSCODE:SCnm_10
+ DW offset DOSCODE:SCnm_11
+ DW offset DOSCODE:SCnm_12
+ DW offset DOSCODE:SCnm_13
+ DW offset DOSCODE:SCnm_14
+ DW offset DOSCODE:SCnm_15
+ DW offset DOSCODE:SCnm_16
+ DW offset DOSCODE:SCnm_17
+ DW offset DOSCODE:SCnm_18
+ DW offset DOSCODE:SCnm_19
+ DW offset DOSCODE:SCnm_20
+ DW offset DOSCODE:SCnm_21
+ DW offset DOSCODE:SCnm_22
+ DW offset DOSCODE:SCnm_23
+ DW offset DOSCODE:SCnm_24
+ DW offset DOSCODE:SCnm_25
+ DW offset DOSCODE:SCnm_26
+ DW offset DOSCODE:SCnm_27
+ DW offset DOSCODE:SCnm_28
+ DW offset DOSCODE:SCnm_29
+ DW offset DOSCODE:SCnm_30
+ DW offset DOSCODE:SCnm_31
+ DW offset DOSCODE:SCnm_32
+ DW offset DOSCODE:SCnm_33
+ DW offset DOSCODE:SCnm_34
+ DW offset DOSCODE:SCnm_35
+ DW offset DOSCODE:SCnm_36
+ DW offset DOSCODE:SCnm_37
+ DW offset DOSCODE:SCnm_38
+ DW offset DOSCODE:SCnm_39
+ DW offset DOSCODE:SCnm_40
+ DW offset DOSCODE:SCnm_41
+ DW offset DOSCODE:SCnm_42
+ DW offset DOSCODE:SCnm_43
+ DW offset DOSCODE:SCnm_44
+ DW offset DOSCODE:SCnm_45
+ DW offset DOSCODE:SCnm_46
+ DW offset DOSCODE:SCnm_47
+ DW offset DOSCODE:SCnm_48
+ DW offset DOSCODE:SCnm_49
+ DW offset DOSCODE:SCnm_50
+ DW offset DOSCODE:SCnm_51
+ DW offset DOSCODE:SCnm_52
+ DW offset DOSCODE:SCnm_53
+ DW offset DOSCODE:SCnm_54
+ DW offset DOSCODE:SCnm_55
+ DW offset DOSCODE:SCnm_56
+ DW offset DOSCODE:SCnm_57
+ DW offset DOSCODE:SCnm_58
+ DW offset DOSCODE:SCnm_59
+ DW offset DOSCODE:SCnm_60
+ DW offset DOSCODE:SCnm_61
+ DW offset DOSCODE:SCnm_62
+ DW offset DOSCODE:SCnm_63
+ DW offset DOSCODE:SCnm_64
+ DW offset DOSCODE:SCnm_65
+ DW offset DOSCODE:SCnm_66
+ DW offset DOSCODE:SCnm_67
+ DW offset DOSCODE:SCnm_68
+ DW offset DOSCODE:SCnm_69
+ DW offset DOSCODE:SCnm_70
+ DW offset DOSCODE:SCnm_71
+ DW offset DOSCODE:SCnm_72
+ DW offset DOSCODE:SCnm_73
+ DW offset DOSCODE:SCnm_74
+ DW offset DOSCODE:SCnm_75
+ DW offset DOSCODE:SCnm_76
+ DW offset DOSCODE:SCnm_77
+ DW offset DOSCODE:SCnm_78
+ DW offset DOSCODE:SCnm_79
+ DW offset DOSCODE:SCnm_80
+ DW offset DOSCODE:SCnm_81
+ DW offset DOSCODE:SCnm_82
+ DW offset DOSCODE:SCnm_83
+ DW offset DOSCODE:SCnm_84
+ DW offset DOSCODE:SCnm_85
+ DW offset DOSCODE:SCnm_86
+ DW offset DOSCODE:SCnm_87
+ DW offset DOSCODE:SCnm_88
+ DW offset DOSCODE:SCnm_89
+ DW offset DOSCODE:SCnm_90
+ DW offset DOSCODE:SCnm_91
+ DW offset DOSCODE:SCnm_92
+ DW offset DOSCODE:SCnm_93
+ DW offset DOSCODE:SCnm_94
+ DW offset DOSCODE:SCnm_95
+ DW offset DOSCODE:SCnm_96
+ DW offset DOSCODE:SCnm_97
+ DW offset DOSCODE:SCnm_98
+ DW offset DOSCODE:SCnm_99
+ DW offset DOSCODE:SCnm_100
+ DW offset DOSCODE:SCnm_101
+ DW offset DOSCODE:SCnm_102
+ DW offset DOSCODE:SCnm_103
+ DW offset DOSCODE:SCnm_104
+ DW offset DOSCODE:SCnm_105
+ DW offset DOSCODE:SCnm_106
+ DW offset DOSCODE:SCnm_107
+ DW offset DOSCODE:SCnm_108
diff --git a/private/mvdm/dos/v86/doskrnl/dos/search.asm b/private/mvdm/dos/v86/doskrnl/dos/search.asm
new file mode 100644
index 000000000..58cd7e6a9
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/search.asm
@@ -0,0 +1,353 @@
+ TITLE SEARCH - Directory scan system calls
+ NAME SEARCH
+
+;** Search.asm
+;
+; Directory search system calls. These will be passed direct text of the
+; pathname from the user. They will need to be passed through the macro
+; expander prior to being sent through the low-level stuff. I/O specs are
+; defined in DISPATCH. The system calls are:
+;
+;
+; $Dir_Search_First written
+; $Dir_Search_Next written
+; $Find_First written
+; $Find_Next written
+; PackName written
+;
+; Modification history:
+;
+; Created: ARR 4 April 1983
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ INCLUDE fastopen.inc
+ INCLUDE fastxxxx.inc
+ include dossvc.inc
+ .cref
+ .list
+
+
+ i_need SEARCHBUF,53
+ i_need SATTRIB,BYTE
+ I_Need OpenBuf,128
+ I_need DMAAdd,DWORD
+ I_need THISFCB,DWORD
+ I_need CurDrv,BYTE
+ I_need EXTFCB,BYTE
+ I_need Fastopenflg,BYTE
+ I_need DOS34_FLAG,WORD
+ I_Need WFP_Start,WORD
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ EXTRN TransFCB:NEAR
+ EXTRN TransPathSet:NEAR
+
+;----------------------------------------------------------------------------
+; Procedure Name : $DIR_SEARCH_FIRST
+;
+; Inputs:
+; DS:DX Points to unopenned FCB
+; Function:
+; Directory is searched for first matching entry and the directory
+; entry is loaded at the disk transfer address
+; Returns:
+; AL = -1 if no entries matched, otherwise 0
+;----------------------------------------------------------------------------
+
+procedure $DIR_SEARCH_FIRST,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ MOV WORD PTR THISFCB,DX
+ MOV WORD PTR THISFCB+2,DS
+ MOV SI,DX
+ CMP BYTE PTR [SI],0FFH
+ JNZ NORMFCB4
+ ADD SI,7 ; Point to drive select byte
+NORMFCB4:
+ SAVE <[SI]> ; Save original drive byte for later
+
+ Context ES ; get es to address DOSGroup
+
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+ call TransFCB ; convert the FCB, set SATTRIB EXTFCB
+ JNC SearchIt ; no error, go and look
+ RESTORE <BX> ; Clean stack
+
+ transfer FCB_Ret_Err ; error code in AX
+
+SearchIt:
+
+ Context DS ; get ready for search
+ push DS
+ pop ds
+ mov al,[EXTFCB]
+ mov dl,[SAttrib]
+ mov si, OFFSET DOSDATA:SEARCHBUF ; Return all the info here
+ mov di, OFFSET DOSDATA:OpenBuf ; Full path
+ HRDSVC SVC_DEMFINDFIRSTFCB
+ JNC SearchSet ; no error, transfer info
+ RESTORE <BX> ; Clean stack
+
+ transfer FCB_Ret_Err ; Error Code is in AX
+
+; The search was successful (or the search-next). We store the information
+; into the user's FCB for continuation.
+
+SearchSet:
+
+ MOV SI,OFFSET DOSDATA:SEARCHBUF
+ LES DI,THISFCB ; point to the FCB
+ TEST EXTFCB,0FFH ;
+ JZ NORMFCB1
+ ADD DI,7 ; Point past the extension
+NORMFCB1:
+ RESTORE <BX> ; Get original drive byte
+ OR BL,BL
+ JNZ SearchDrv
+ MOV BL,CurDrv
+ INC BL
+SearchDrv:
+ INC SI
+; LODSB ; Get correct search contin drive byte
+; XCHG AL,BL ; Search byte to BL, user byte to AL
+ INC DI
+; STOSB ; Store the correct "user" drive byte
+ ; at the start of the search info
+; MOV CX,20/2
+; REP MOVSW ; Rest of search cont info, SI -> entry
+ add di,20
+ add si,20
+ mov al,bl
+; XCHG AL,BL ; User drive byte back to BL, search
+ ; byte to AL
+ STOSB ; Search contin drive byte at end of
+ ; contin info
+; Sudeepb : This "dec si" is a hack to overcome the problem
+; dword alignment in DEm DLL of SRCHBUF.
+ dec si
+ LES DI,DMAAdd
+ TEST EXTFCB,0FFH
+ JZ NORMFCB2
+ MOV AL,0FFH
+ STOSB
+ INC AL
+ MOV CX,5
+ REP STOSB
+ MOV AL,SATTRIB
+ STOSB
+NORMFCB2:
+ MOV AL,BL ; User Drive byte
+ STOSB
+ IFDEF DBCS ;AN000;
+ MOVSW ; 2/13/KK ;AN000;
+ CMP BYTE PTR ES:[DI-2],5 ; 2/13/KK ;AN000;
+ JNZ NOTKTRAN ; 2/13/KK ;AN000;
+ MOV BYTE PTR ES:[DI-2],0E5H ; 2/13/KK ;AN000;
+NOTKTRAN: ; 2/13/KK ;AN000;
+ MOV CX,15 ; 2/13/KK ;AN000;
+ ELSE ;AN000;
+ MOV CX,16 ; 32 / 2 words of dir entry ;AN000;
+ ENDIF ;AN000;
+ REP MOVSW
+ transfer FCB_Ret_OK
+
+EndProc $DIR_SEARCH_FIRST, NoCheck
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : $DIR_SEARCH_NEXT
+;
+; Inputs:
+; DS:DX points to unopenned FCB returned by $DIR_SEARCH_FIRST
+; Function:
+; Directory is searched for the next matching entry and the directory
+; entry is loaded at the disk transfer address
+; Returns:
+; AL = -1 if no entries matched, otherwise 0
+;----------------------------------------------------------------------------
+
+procedure $DIR_SEARCH_NEXT,NEAR
+
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ MOV WORD PTR THISFCB,DX
+ MOV WORD PTR THISFCB+2,DS
+ MOV SATTRIB,0
+ MOV EXTFCB,0
+
+ Context ES
+
+ MOV DI,OFFSET DOSDATA:SEARCHBUF
+
+ MOV SI,DX
+ CMP BYTE PTR [SI],0FFH
+ JNZ NORMFCB6
+ ADD SI,6
+ LODSB
+
+ MOV SATTRIB,AL
+ DEC EXTFCB
+NORMFCB6:
+ LODSB ; Get original user drive byte
+ SAVE <AX> ; Put it on stack
+ MOV AL,[SI+20] ; Get correct search contin drive byte
+ STOSB ; Put in correct place
+ MOV CX,20/2
+ REP MOVSW ; Transfer in rest of search contin info
+
+ Context DS
+
+ mov al,[EXTFCB]
+ mov dl,[SAttrib]
+ mov si, OFFSET DOSDATA:SEARCHBUF ; Return all the info here
+ HRDSVC SVC_DEMFINDNEXTFCB ; Find next match
+ JC SearchNoMore
+ JMP SearchSet ; Ok set return
+
+SearchNoMore:
+ LES DI,THISFCB
+ TEST EXTFCB,0FFH
+ JZ NORMFCB8
+ ADD DI,7 ; Point past the extension
+NORMFCB8:
+ RESTORE <BX> ; Get original drive byte
+ MOV ES:[DI],BL ; Store the correct "user" drive byte
+ ; at the right spot
+ transfer FCB_Ret_Err ; Error code in ax
+
+EndProc $DIR_SEARCH_NEXT
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : $FIND_FIRST
+;
+; Assembler usage:
+; MOV AH, FindFirst
+; LDS DX, name
+; MOV CX, attr
+; INT 21h
+; ; DMA address has datablock
+;
+; Error Returns:
+; AX = error_path_not_found
+; = error_no_more_files
+;---------------------------------------------------------------------------
+
+procedure $FIND_FIRST,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+ SAVE <CX>
+ MOV SI,DX ; get name in appropriate place
+
+ MOV SATTRIB,CL ; Search attribute to correct loc
+
+ MOV DI,OFFSET DOSDATA:OpenBuf ; appropriate buffer
+
+ call TransPathSet ; convert the path
+ RESTORE <CX>
+ JNC Find_it ; no error, go and look
+FindError:
+
+ error error_path_not_found ; error and map into one.
+Find_it:
+
+ Context DS
+ mov dx,wfp_start
+ HRDSVC SVC_DEMFINDFIRST
+ JNC FindSet ; no error, transfer info
+ transfer Sys_Ret_Err
+FindSet:
+; BUGBUG Sudeepb 15-sept-91 This xor ax,ax is done for stupid PageMaker 4.0
+; which trusts ax value more than carry even for success cases.
+ xor ax,ax
+ transfer Sys_Ret_OK ; bye with no errors
+EndProc $FIND_FIRST
+
+
+;---------------------------------------------------------------------------
+;
+; Procedure Name : $FIND_NEXT
+;
+; Assembler usage:
+; ; dma points at area returned by find_first
+; MOV AH, findnext
+; INT 21h
+; ; next entry is at dma
+;
+; Error Returns:
+; AX = error_no_more_files
+;---------------------------------------------------------------------------
+
+procedure $FIND_NEXT,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+ HRDSVC SVC_DEMFINDNEXT
+ jnc fnok
+ transfer Sys_Ret_Err
+fnok:
+; BUGBUG 13-Jun-1992 Jonle This xor ax,ax is done for stupid list.com,
+; sidekick which trusts ax value more than carry even for success cases.
+ xor ax,ax
+ transfer Sys_Ret_OK ; bye with no errors
+
+EndProc $FIND_NEXT
+
+ Break <PackName - convert file names from FCB to ASCIZ>
+
+
+;** PackName - Convert name to ASCIZ format.
+;
+; PackName transfers a file name from DS:SI to ES:DI and converts it to
+; the ASCIZ format.
+;
+; ENTRY (DS:SI) = 11 character FCB or dir entry name
+; (ES:DI) = destination area (13 bytes)
+; EXIT (ds:SI) and (es:DI) advancedn
+; USES al, CX, SI, DI, Flags (BUGBUG - not verified - jgl)
+
+Procedure PackName,NEAR
+ ASSUME CS:DOSCODE,SS:DOSDATA
+
+; Move over 8 characters to cover the name component, then trim it's
+; trailing blanks.
+
+ MOV CX,8 ; Pack the name
+ REP MOVSB ; Move all of it
+main_kill_tail:
+ CMP BYTE PTR ES:[DI-1]," "
+ JNZ find_check_dot
+ DEC DI ; Back up over trailing space
+ INC CX
+ CMP CX,8
+ JB main_kill_tail
+find_check_dot:
+ CMP WORD PTR [SI],(" " SHL 8) OR " "
+ JNZ got_ext ; Some chars in extension
+ CMP BYTE PTR [SI+2]," "
+ JZ find_done ; No extension
+got_ext:
+ MOV AL,"."
+ STOSB
+ MOV CX,3
+ REP MOVSB
+ext_kill_tail:
+ CMP BYTE PTR ES:[DI-1]," "
+ JNZ find_done
+ DEC DI ; Back up over trailing space
+ JMP ext_kill_tail
+find_done:
+ XOR AX,AX
+ STOSB ; NUL terminate
+ return
+EndProc PackName
+
+
+DOSCODE ENDS
+ END
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/segcheck.asm b/private/mvdm/dos/v86/doskrnl/dos/segcheck.asm
new file mode 100644
index 000000000..a3e44b13d
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/segcheck.asm
@@ -0,0 +1,309 @@
+ TITLE SegCheck - internal consistency check
+ NAME SegCheck
+
+ .xlist
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include sf.inc
+ include int2a.inc
+ .list
+
+
+AsmVars <NET, DEBUG>
+
+DOSCODE SEGMENT
+ ASSUME CS:DOSCODE
+
+if DEBUG
+ allow_getdseg
+
+
+ BREAK <SegCheck - validate segments in MSDOS>
+
+
+zfmt MACRO fmts,args
+local a,b
+ PUSH AX
+ PUSH BP
+ MOV BP,SP
+If (not sharef) and (not redirector)
+DOSDATA segment
+a db fmts,0
+DOSDATA ends
+ MOV AX,OFFSET DOSDATA:a
+else
+ jmp short b
+a db fmts,0
+if sharef
+b: mov ax,offset share:a
+else
+b: mov ax,offset netwrk:a
+endif
+endif
+ PUSH AX
+cargs = 2
+IRP item,<args>
+IFIDN <AX>,<item>
+ MOV AX,[BP+2]
+ELSE
+ MOV AX,item
+ENDIF
+ PUSH AX
+cargs = cargs + 2
+ENDM
+ invoke PFMT
+ ADD SP,Cargs
+ POP BP
+ POP AX
+ENDM
+
+
+;** SegCheck - assure that segments are correctly set up
+;
+; calling sequence:
+; call Segcheck
+; jmp short l1
+; DB flags
+; DB asciz error message string
+; l1:
+;
+; flag values: 04 - check ES
+; 02 - check DS
+; 01 - check SS
+;
+; ENTRY As above
+; EXIT returns if OK, prints and traps if error
+; USES none
+
+Procedure SegCheck,NEAR
+ ASSUME SS:NOTHING
+ SAVE <BP>
+ MOV BP,SP ; set up addressing
+ PUSHF ; Following code depends upon this order
+ SAVE <AX,BX,CX,DX,DS> ; " " " " "
+ GETDSEG DS
+ mov dx,ds ; (dx) = DOSDATA segment
+ mov bx,2[bp] ; (bx) = return address
+ mov al,cs:2[bx] ; (al) = flag byte
+ add bx,3
+ TEST AL,1
+ JZ schk5 ; don't check SS
+ mov cx,ss
+ cmp cx,dx
+ je schk5 ; OK
+ zfmt <"Assumed SS invalid $S\n">,<cs,bX>
+ TRAP
+
+schk5: test al,2 ; see if DS to be checked
+ jz schk10 ; don't check DS
+ mov cx,-12[bp]
+ cmp cx,dx
+ je schk10 ; no problem
+ zfmt <"Assumed DS invalid $S\n">,<cs,bX>
+ TRAP
+
+schk10: test al,4 ; see if ES to be checked
+ jz schk15 ; don't check ES
+ mov cx,es
+ cmp cx,dx
+ je schk15 ; no problem
+ zfmt <"Assumed ES invalid $S\n">,<cs,bX>
+ TRAP
+
+schk15: RESTORE <DS,DX,CX,BX,AX>
+ POPF
+ RESTORE <BP>
+ ret
+
+EndProc SegCheck
+
+
+I_need DPBHead,DWORD
+I_need BufferQueue,DWORD
+I_need sftFCB,DWORD
+I_need AuxStack,BYTE
+I_need IOStack,BYTE
+I_need renbuf,byte
+I_need CurrentPDB,WORD
+I_need User_In_AX,WORD
+
+extrn ECritDisk:NEAR
+
+CritNOP label byte
+ RET
+
+AstFrame STRUC
+Astbp dw ?
+Astip dw ?
+Astmes dw ?
+Astarg dd ?
+AstFrame ENDS
+
+ifdef 0
+
+;** DPBCheck - Validate A DPB Pointer
+;
+; DPBCheck checks to see if a supplied pointer points to a DPB
+; as it's supposed to.
+;
+; ENTRY
+; EXIT returns if OK, message and trap if error
+; USES none
+
+Procedure DPBCheck,NEAR
+ assume SS:nothing
+ SAVE <BP>
+ MOV BP,SP
+ PUSHF
+ SAVE <AX,BX,DS,SI,ES,DI>
+ GETDSEG DS
+ LES DI,DPBHead
+ LDS SI,[BP].Astarg
+ ASSUME DS:nothing
+DPBLoop:CMP DI,-1
+ JZ DPBNotFound
+ invoke PointComp
+ JZ DPBRet
+ LES DI,ES:[DI.dpb_next_dpb]
+ JMP DPBLoop
+
+DPBNotFound:
+ MOV AX,[BP].Astmes
+ zfmt <"DPB assertion failed: $x:$x $s\n">,<ds,si,AX>
+ TRAP
+ JMP $ ; hang here
+
+DPBRet: RESTORE <DI,ES,SI,DS,BX,AX> ; Done:
+ POPF
+ RESTORE <BP>
+ RET 6
+
+EndProc DPBCheck
+
+
+
+;** SFTCheck - Validate an SFT Pointer
+;
+; SFTCheck verifies that a pointer points to an SFT
+;
+; ENTRY BUGBUG
+; EXIT returns if no error, traps w/message if error
+; USES none
+
+Procedure SFTCheck,NEAR
+ assume SS:nothing
+
+ SAVE <BP>
+ MOV BP,SP
+ PUSHF
+ SAVE <AX,BX,DS,SI,ES,DI>
+ LDS SI,[BP].Astarg
+ XOR BX,BX ; i = 0;
+SFTLoop:
+ SAVE <BX>
+ invoke SFFromSFN ; while ((d=SF(i)) != NULL)
+ RESTORE <BX>
+ JC Sft1
+ invoke PointComp
+ JZ DPBRet ; goto Done;
+SFTNext:INC BX ; else
+ JMP SFTLoop ; i++;
+
+
+SFT1: GETDSEG DS
+ LES DI,sftFCB
+ ASSUME DS:nothing
+ MOV BX,ES:[DI.sfCount]
+ LEA DI,[DI.sfTable]
+sft2: invoke PointComp
+ JZ DPBRet
+ ADD DI,SIZE sf_entry
+ DEC BX
+ JNZ SFT2
+
+; The SFT is not in the allocated tables. See if it is one of the static
+; areas.
+
+ GETDSEG ES
+ MOV DI,OFFSET DOSDATA:AUXSTACK - SIZE SF_ENTRY
+ Invoke PointComp
+ JZ DPBRet
+ MOV DI,OFFSET DOSDATA:RenBuf
+ Invoke PointComp
+ LJZ DPBRet
+
+
+ MOV AX,[BP].Astmes
+ zfmt <"SFT assertion failed: $x:$x $s\n">,<ds,si,AX>
+ TRAP
+ JMP $ ; hang here
+
+EndProc SFTCheck,NoCheck
+
+
+;** BUFCheck - Validate a BUF Pointer
+;
+; BUFCheck makes sure that a supposed BUF pointer is valid.
+;
+; ENTRY BUGBUG
+; EXIT returns if OK, traps if error
+; USES none
+
+Procedure BUFCheck,NEAR
+ assume SS:nothing
+ SAVE <BP>
+ MOV BP,SP
+ PUSHF
+ SAVE <AX,BX,DS,SI,ES,DI>
+
+; CheckDisk - make sure that we are in the disk critical section...
+
+ GETDSEG DS
+ MOV AL,BYTE PTR ECritDisk
+ CMP AL,CritNOP
+ JZ CheckDone
+ifdef NEVER ; BUGBUG - turn this back on sometime?
+ MOV AX,CurrentPDB
+
+ CMP SectPDB + 2 * critDisk,AX
+ MOV AX,[BP].astmes
+ JZ CheckRef
+ zfmt <"$p: $x $s critDisk owned by $x\n">,<User_In_AX,AX,SectPDB+2*critDisk>
+CheckRef:
+ CMP SectRef + 2 * critDisk,0
+ JNZ CheckDone
+ zfmt <"$p: $x $s critDisk ref count is 0\n">,<User_In_AX,AX>
+ENDIF
+CheckDone:
+
+ LES DI,BufferQueue
+ LDS SI,[BP].Astarg
+ ASSUME DS:nothing
+BUFLoop:CMP DI,-1
+ JZ BufNotFound
+ invoke PointComp
+ LJZ DPBRet
+ mov di,es:buf_next[di]
+ JMP BUFLoop
+
+BufNotFound:
+ MOV AX,[BP].Astmes
+ zfmt <"BUF assertion failed: $x:$x $s\n">,<ds,si,AX>
+ TRAP
+ JMP $ ; hang here
+
+ DPUBLIC <DPBLoop, DPBNotFound, DPBRet>
+ DPUBLIC <SFTLoop, SFTNext, SFT1, sft2, BUFLoop, BufNotFound>
+ DPUBLIC <schk5, schk10, schk15>
+
+EndProc BUFCheck,NoCheck
+
+endif
+
+ENDIF
+
+DOSCODE ENDS
+
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/srvcall.asm b/private/mvdm/dos/v86/doskrnl/dos/srvcall.asm
new file mode 100644
index 000000000..a6a7751d1
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/srvcall.asm
@@ -0,0 +1,263 @@
+ TITLE SRVCALL - Server DOS call
+ NAME SRVCALL
+
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;** SRVCALL.ASM - Server DOS call functions
+;
+;
+; $ServerCall
+;
+; Modification history:
+;
+; Created: ARR 08 August 1983
+; SudeepB 07-Aug-1992 Ported For NT DOS
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include mult.inc
+ include sf.inc
+ .cref
+ .list
+
+AsmVars <Installed>
+
+include dpl.asm
+
+Installed = TRUE
+
+ i_need USER_ID,WORD
+ i_need PROC_ID,WORD
+ i_need SaveBX,WORD
+ i_need SaveDS,WORD
+ i_need SWAP_START,BYTE
+ i_need SWAP_ALWAYS,BYTE
+ i_need SWAP_END,BYTE
+ I_Need ThisSFT,DWORD
+ I_need fSharing,BYTE
+ i_need OpenBuf,128
+ I_Need ExtErr,WORD
+ I_Need ExtErr_Action,BYTE
+ I_Need ExtErrPt,DWORD
+ I_Need EXTERR_LOCUS,BYTE ; Extended Error Locus
+ i_need JShare,DWORD
+;SR;
+; Win386 presence flag
+;
+ I_need IsWin386,byte
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+
+BREAK <ServerCall -- Server DOS call>
+
+;hkn; TABLE SEGMENT
+Public SRVC001S,SRVC001E
+SRVC001S label byte
+
+ServerTab DW DOSCODE:Server_Disp
+SERVERLEAVE DW DOSCODE:ServerReturn
+SERVER_DISP DB (SERVER_DISP_END-SERVER_DISP-1)/2
+ DW OFFSET DOSCODE:SRV_CALL ; 0
+ DW OFFSET DOSCODE:SC_NO_OP ; 1
+ DW OFFSET DOSCODE:SC_NO_OP ; 2
+ DW OFFSET DOSCODE:SC_NO_OP ; 3
+ DW OFFSET DOSCODE:SC_NO_OP ; 4
+ DW OFFSET DOSCODE:SC_ERROR ; 5
+ DW OFFSET DOSCODE:GET_DOS_DATA ; 6
+ DW OFFSET DOSCODE:SPOOL_OPER ; 7
+ DW OFFSET DOSCODE:SPOOL_OPER ; 8
+ DW OFFSET DOSCODE:SPOOL_OPER ; 9
+ DW OFFSET DOSCODE:$setExtendedError ; 10
+SERVER_DISP_END LABEL BYTE
+
+SRVC001E label byte
+
+;hkn; TABLE ENDS
+
+;----------------------------------------------------------------------------
+;
+; Procedure Name : $ServerCall
+;
+; Inputs:
+; DS:DX -> DPL (except calls 7,8,9)
+; Function:
+; AL=0 Server DOS call
+; AL=1 Commit All files
+; AL=2 Close file by name (SHARING LOADED ONLY) DS:DX in DPL -> name
+; AL=3 Close all files for DPL_UID
+; AL=4 Close all files for DPL_UID/PID_PID
+; AL=5 Get open file list entry
+; IN: BX File Index
+; CX User Index
+; OUT:ES:DI -> Name
+; BX = UID
+; CX = # locked blocks held by this UID
+; AL=6 Get DOS data area
+; OUT: DS:SI -> Start
+; CX size in bytes of swap if indos
+; DX size in bytes of swap always
+; AL=7 Get truncate flag
+; AL=8 Set truncate flag
+; AL=9 Close all spool files
+; AL=10 SetExtendedError
+;
+;----------------------------------------------------------------------------
+
+procedure $ServerCall,NEAR
+ CMP AL,7
+ JB SET_STUFF
+ CMP AL,9
+ JBE NO_SET_ID ; No DPL on calls 7,8,9
+SET_STUFF:
+ MOV SI,DX ; Point to DPL with DS:SI
+ MOV BX,[SI.DPL_UID]
+
+;SR;
+; WIN386 updates the USER_ID itself. If WIN386 is present we skip the updating
+; of USER_ID
+;
+ test [IsWin386],1
+ jnz skip_win386
+
+;hkn; SS override for user_id and proc_id
+ MOV [USER_ID],BX ; Set UID
+
+skip_win386:
+
+ MOV BX,[SI.DPL_PID]
+ MOV [PROC_ID],BX ; Set process ID
+NO_SET_ID:
+ PUSH SERVERLEAVE ; push return address
+ PUSH ServerTab ; push table address
+ PUSH AX
+ Invoke TableDispatch
+
+;hkn; SS override
+ MOV EXTERR_LOCUS,errLoc_Unk ; Extended Error Locus
+ error error_invalid_function
+ServerReturn:
+ return
+
+
+SC_NO_OP:
+ASSUME DS:NOTHING,ES:NOTHING
+ transfer Sys_Ret_OK
+
+SC_ERROR:
+ transfer SYS_RET_ERR
+
+SRV_CALL:
+ASSUME DS:NOTHING,ES:NOTHING
+ POP AX ; get rid of call to $srvcall
+ SAVE <DS,SI>
+ invoke GET_USER_STACK
+ RESTORE <DI,ES>
+;
+; DS:SI point to stack
+; ES:DI point to DPL
+;
+ invoke XCHGP
+;
+; DS:SI point to DPL
+; ES:DI point to stack
+;
+; We now copy the registers from DPL to save stack
+;
+ SAVE <SI>
+ MOV CX,6
+ REP MOVSW ; Put in AX,BX,CX,DX,SI,DI
+ INC DI
+ INC DI ; Skip user_BP
+ MOVSW ; DS
+ MOVSW ; ES
+ RESTORE <SI> ; DS:SI -> DPL
+ MOV AX,[SI.DPL_AX]
+ MOV BX,[SI.DPL_BX]
+ MOV CX,[SI.DPL_CX]
+ MOV DX,[SI.DPL_DX]
+ MOV DI,[SI.DPL_DI]
+ MOV ES,[SI.DPL_ES]
+ PUSH [SI.DPL_SI]
+ MOV DS,[SI.DPL_DS]
+ POP SI
+
+;hkn; SS override for next 3
+ MOV [SaveDS],DS
+ MOV [SaveBX],BX
+ ;MOV fSharing,-1 ; set no redirect flag
+ transfer REDISP
+
+GET_DOS_DATA:
+ ASSUME DS:NOTHING,ES:NOTHING
+ Context ES
+ MOV DI,OFFSET DOSDATA:SWAP_START
+ MOV CX,OFFSET DOSDATA:SWAP_END
+ MOV DX,OFFSET DOSDATA:Swap_Always
+ SUB CX,DI
+ SUB DX,DI
+ SHR CX,1 ; div by 2, remainder in carry
+ ADC CX,0 ; div by 2 + round up
+ SHL CX,1 ; round up to 2 boundary.
+ invoke GET_USER_STACK
+ MOV [SI.user_DS],ES
+ MOV [SI.user_SI],DI
+ MOV [SI.user_DX],DX
+ MOV [SI.user_CX],CX
+ transfer SYS_RET_OK
+
+SPOOL_OPER:
+ASSUME DS:NOTHING,ES:NOTHING
+ CallInstall NETSpoolOper,multNet,37,AX,BX
+ JC func_err2
+ transfer SYS_RET_OK
+func_err2:
+ transfer SYS_RET_ERR
+
+Break <$SetExtendedError - set extended error for later retrieval>
+;--------------------------------------------------------------------------
+;
+; Procedure Name : $SetExtendedError
+;
+; $SetExtendedError takes extended error information and loads it up for the
+; next extended error call. This is used by interrupt-level proccessors to
+; mask their actions.
+;
+; Inputs: DS:SI points to DPL which contains all registers
+; Outputs: none
+;
+;---------------------------------------------------------------------------
+
+$SetExtendedError:
+
+;hkn; SS override for all variables used
+
+ ASSUME DS:NOTHING,ES:NOTHING
+ MOV AX,[SI].dpl_AX
+ MOV [EXTERR],AX
+ MOV AX,[SI].dpL_di
+ MOV WORD PTR ExtErrPt,AX
+ MOV AX,[SI].dpL_ES
+ MOV WORD PTR ExtErrPt+2,AX
+ MOV AX,[SI].dpL_BX
+ MOV WORD PTR [EXTERR_ACTION],AX
+ MOV AX,[SI].dpL_CX
+ MOV [EXTERR_LOCUS],AH
+ return
+EndProc $ServerCall, NoCheck
+
+DOSCODE ENDS
+ END
+
+
diff --git a/private/mvdm/dos/v86/doskrnl/dos/state.rst b/private/mvdm/dos/v86/doskrnl/dos/state.rst
new file mode 100644
index 000000000..5efe18c56
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/state.rst
@@ -0,0 +1,11 @@
+[edit-]
+screen=80 53
+toggles=1 1 0 1 0 0
+srch=setsft
+src=
+rpl=
+file=g:\src\dos500\dos\disk2.asm 1 696 20 696
+[brief]
+file=g:\src\dos500\dos\disk2.asm 1 696 20 696 1 50 78 1 c=0
+[shared-]
+pmark=g:\src\dos500\dos\disk2.asm 20 696
diff --git a/private/mvdm/dos/v86/doskrnl/dos/time.asm b/private/mvdm/dos/v86/doskrnl/dos/time.asm
new file mode 100644
index 000000000..62682ac0e
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/time.asm
@@ -0,0 +1,293 @@
+ TITLE TIME - time and date functions
+ NAME TIME
+
+;** TIME.ASM - System Calls and low level routines for DATE and TIME
+;
+; $GET_DATE
+; $SET_DATE
+; $GET_TIME
+; $SET_TIME
+;
+; Modification history:
+;
+; Sudeepb 12-Mar-1991 Ported For NT DOSEm
+
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ include dossym.inc
+ include devsym.inc
+ include dossvc.inc
+ .cref
+ .list
+
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ allow_getdseg
+
+
+ BREAK <DATE AND TIME - SYSTEM CALLS 42,43,44,45>
+
+;** $GET_DATE - Get Current Date
+;
+; ENTRY none
+; EXIT (cx:dx) = current date
+; USES all
+
+procedure $GET_DATE,NEAR
+
+ Context DS
+ SVC SVC_DEMQUERYDATE
+ invoke get_user_stack ;Get pointer to user registers
+ ASSUME DS:NOTHING
+ MOV [SI.user_DX],DX ;DH=month, DL=day
+ MOV [SI.user_CX],CX ;CX=year
+
+ return
+
+EndProc $GET_DATE
+
+
+
+
+;** $SET_DATE - Set Current Date
+;
+; ENTRY (cx:dx) = current date
+; EXIT (al) = -1 iff bad date
+; (al) = 0 if ok
+; USES all
+
+procedure $SET_DATE,NEAR ;System call 43
+
+ SVC SVC_DEMSETDATE
+ ret
+
+EndProc $SET_DATE
+
+
+ifdef FASTINT1A
+;** FastInt1a - same parameters as int 1ah bios fn
+; - calls direct avoiding int instruction
+;
+
+FastInt1a proc near
+
+ push es
+ push bx
+
+ mov bx, ax ; stash ax
+ xor ax, ax ; use es to addr IVT
+ mov es, ax
+ lahf ; set up fake flags
+ or al, 2 ; set interrupt bit
+ xchg ah, al
+
+ push ax
+ mov ax, bx ; restore ax
+ call dword ptr es:[1ah*4]
+
+ pop bx
+ pop es
+ return
+
+FastInt1a endp
+endif
+
+TTTicks proc near
+
+ ret
+TTTicks endp
+
+
+;** $GET_TIME - Get Current Time
+;
+; ENTRY none
+; EXIT (cx:dx) = current time
+; USES all
+
+procedure $GET_TIME,NEAR ; System call 44
+
+ xor ax,ax ; int1a fn 0
+ifdef FASTINT1A
+ call FastInt1a
+else
+ int 1ah
+endif
+
+
+; we now need to convert the time in tick to the time in 100th of
+; seconds. the relation between tick and seconds is:
+;
+; 65536 seconds
+; ----------------
+; 1,193,180 tick
+;
+; to get to 100th of second we need to multiply by 100. the equation is:
+;
+; ticks from clock * 65536 * 100
+; --------------------------------- = time in 100th of seconds
+; 1,193,180
+;
+; fortunately this fromula simplifies to:
+;
+; ticks from clock * 5 * 65,536
+; --------------------------------- = time in 100th of seconds
+; 59,659
+;
+; the calculation is done by first multipling tick by 5. next we divide by
+; 59,659. in this division we multiply by 65,536 by shifting the dividend
+; my 16 bits to the left.
+;
+; start with ticks in cx:dx
+; multiply by 5
+
+ mov ax,cx
+ mov bx,dx
+ shl dx,1
+ rcl cx,1 ;times 2
+ shl dx,1
+ rcl cx,1 ;times 4
+ add dx,bx
+ adc ax,cx ;times 5
+ xchg ax,dx
+
+
+; now have ticks * 5 in dx:ax
+; we now need to multiply by 65,536 and divide by 59659 d.
+
+ mov cx,59659 ; get divisor
+ div cx
+ ; dx now has remainder
+ ; ax has high word of final quotient
+ mov bx,ax ; put high work if safe place
+ xor ax,ax ; this is the multiply by 65536
+ div cx ; bx:ax now has time in 100th of seconds
+
+
+;rounding based on the remainder may be added here
+;the result in bx:ax is time in 1/100 second.
+
+ mov dx,bx
+ mov cx,200 ;extract 1/100's
+
+;division by 200 is necessary to ensure no overflow--max result
+;is number of seconds in a day/2 = 43200.
+
+ div cx
+ cmp dl,100 ;remainder over 100?
+ jb noadj
+ sub dl,100 ;keep 1/100's less than 100
+noadj:
+ cmc ;if we subtracted 100, carry is now set
+ mov bl,dl ;save 1/100's
+
+;to compensate for dividing by 200 instead of 100, we now multiply
+;by two, shifting a one in if the remainder had exceeded 100.
+
+ rcl ax,1
+ mov dl,0
+ rcl dx,1
+ mov cx,60 ;divide out seconds
+ div cx
+ mov bh,dl ;save the seconds
+ div cl ;break into hours and minutes
+ xchg al,ah
+
+;time is now in ax:bx (hours, minutes, seconds, 1/100 sec)
+
+ Context DS
+ invoke get_user_stack ;Get pointer to user registers
+ MOV [SI.user_DX],BX
+ MOV [SI.user_CX],AX
+ XOR AL,AL
+RET26: return
+
+EndProc $GET_TIME
+
+
+
+;** $SET_TIME - Set Current Time
+;
+; ENTRY (cx:dx) = time
+; EXIT (al) = 0 if 0k
+; (al) = -1 if invalid
+; USES ALL
+
+procedure $SET_TIME,NEAR ;System call 45
+
+ ; verify time is valid
+ mov al, -1 ;Flag in case of error
+ cmp ch, 24 ;Check hours
+ jae RET26
+ cmp cl, 60 ;Check minutes
+ jae RET26
+ cmp dh, 60 ;Check seconds
+ jae RET26
+ cmp dl, 100 ;Check 1/100's
+ jae RET26
+
+ ; On Nt the cmos is actually system time
+ ; Since dos apps rarely know what is real time
+ ; we do not set the cmos clock\system time like dos 5.0
+
+ ; convert time to 100th of secs
+ mov al,60
+ mul ch ;hours to minutes
+ mov ch,0
+ add ax,cx ;total minutes
+ mov cx,6000 ;60*100
+ mov bx,dx ;get out of the way of the multiply
+ mul cx ;convert to 1/100 sec
+ mov cx,ax
+ mov al,100
+ mul bh ;convert seconds to 1/100 sec
+ add cx,ax ;combine seconds with hours and min.
+ adc dx,0 ;ripple carry
+ mov bh,0
+ add cx,bx ;combine 1/100 sec
+ adc dx,0 ;dx:cx is time in 1/100 sec
+
+ ;convert 100th of secs to ticks
+ xchg ax,dx
+ xchg ax,cx ;now time is in cx:ax
+ mov bx,59659
+ mul bx ;multiply low half
+ xchg dx,cx
+ xchg ax,dx ;cx->ax, ax->dx, dx->cx
+ mul bx ;multiply high half
+ add ax,cx ;combine overlapping products
+ adc dx,0
+ xchg ax,dx ;ax:dx=time*59659
+ mov bx,5
+ div bl ;divide high half by 5
+ mov cl,al
+ mov ch,0
+ mov al,ah ;remainder of divide-by-5
+ cbw
+ xchg ax,dx ;use it to extend low half
+ div bx ;divde low half by 5
+ mov dx,ax ;cx:dx is now number of ticks in time
+
+
+ ; set the bios tic count
+ mov ah, 1 ; set bios tick count
+ifdef FASTINT1A
+ call FastInt1a
+else
+ int 1ah
+endif
+
+ xor al,al
+ clc
+ return
+
+EndProc $SET_TIME
+
+
+DOSCODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/dos/util.asm b/private/mvdm/dos/v86/doskrnl/dos/util.asm
new file mode 100644
index 000000000..fe74fe2ec
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/dos/util.asm
@@ -0,0 +1,284 @@
+ TITLE UTIL - Handle utilities
+ NAME UTIL
+
+;** Handle related utilities for MSDOS 2.X.
+;
+; pJFNFromHandle written
+; SFFromHandle written
+; SFFromSFN written
+; JFNFree written
+; SFNFree written
+;
+; Modification history:
+;
+; Created: MZ 1 April 1983
+
+ .xlist
+ .xcref
+ include version.inc
+ include dosseg.inc
+ INCLUDE DOSSYM.INC
+ INCLUDE DEVSYM.INC
+ include pdb.inc
+ include sf.inc
+ include bugtyp.inc
+ .cref
+ .list
+
+
+ I_need CurrentPDB,WORD ; current process data block location
+ I_need SFT_Addr,DWORD ; pointer to beginning of table
+ I_Need PROC_ID,WORD ; current process ID
+ I_Need USER_ID,WORD ; current user ID
+
+
+DOSCODE SEGMENT
+ ASSUME SS:DOSDATA,CS:DOSCODE
+
+ allow_getdseg
+
+ BREAK <pJFNFromHandle - return pointer to JFN table entry>
+
+
+;** pJFNFromHandle - Translate Handle to Pointer to JFN
+;
+; pJFNFromHandle takes a file handle and turns that into a pointer to
+; the JFN entry (i.e., to a byte holding the internal file handle #)
+;
+; NOTE:
+; This routine is called from $CREATE_PROCESS_DATA_BLOCK which is called
+; at DOSINIT time with SS NOT DOSGROUP
+;
+; ENTRY (bx) = handle
+; EXIT 'C' clear if ok
+; (es:di) = address of JFN value
+; 'C' set if error
+; (ax) = error code
+; USES AX, DI, ES, Flags
+
+procedure pJFNFromHandle,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ getdseg <es> ; es -> dosdata
+ MOV ES,CurrentPDB ; get user process data block
+ ASSUME ES:NOTHING
+
+ CMP BX,ES:PDB_JFN_Length ; is handle greater than allocated
+ JB pjfn10 ; no, get offset
+ fmt TypAccess,LevSFN,<"$p: Illegal JFN %x\n">,<BX>
+ MOV AL,error_invalid_handle ; appropriate error
+ReturnCarry:
+ STC ; signal error
+ return ; go back
+
+pjfn10: LES DI,ES:PDB_JFN_Pointer ; get pointer to beginning of table
+ ADD DI,BX ; add in offset, clear 'C'
+ return
+
+EndProc pJFNFromHandle
+
+
+BREAK <SFFromHandle - return pointer (or error) to SF entry from handle>
+;---------------------------------------------------------------------------
+;
+; Procedure Name : SFFromHandle
+;
+; SFFromHandle - Given a handle, get JFN and then index into SF table
+;
+; Input: BX has handle
+; Output: Carry Set
+; AX has error code
+; Carry Reset
+; ES:DI has pointer to SF entry
+; Registers modified: If error, AX,ES, else ES:DI
+; NOTE:
+; This routine is called from $CREATE_PROCESS_DATA_BLOCK which is called
+; at DOSINIT time with SS NOT DOSGROUP
+;
+;----------------------------------------------------------------------------
+
+procedure SFFromHandle,NEAR
+ ASSUME CS:DOSCODE,SS:NOTHING
+
+ CALL pJFNFromHandle ; get jfn pointer
+ retc ; return if error
+ CMP BYTE PTR ES:[DI],-1 ; unused handle
+ JNZ GetSF ; nope, suck out SF
+ fmt TypAccess,LevSFN,<"$p: Illegal SFN $x:$x\n">,<ES,DI>
+ MOV AL,error_invalid_handle ; appropriate error
+ jump ReturnCarry ; signal it
+GetSF:
+ SAVE <BX> ; save handle
+ MOV BL,BYTE PTR ES:[DI] ; get SFN
+ XOR BH,BH ; ignore upper half
+ CALL SFFromSFN ; get real sf spot
+ RESTORE <BX> ; restore
+ return ; say goodbye
+EndProc SFFromHandle
+
+BREAK <SFFromSFN - index into SF table for SFN>
+
+
+;** SFFromSFN - Get an SF Table entry from an SFN
+;
+; SFFromSfn uses an SFN to index an entry into the SF table. This
+; is more than just a simple index instruction because the SF table
+; can be made up of multiple pieces chained together. We follow the
+; chain to the right piece and then do the index operation.
+;
+; NOTE:
+; This routine is called from SFFromHandle which is called
+; at DOSINIT time with SS NOT DOSGROUP
+;
+; ENTRY BX has SF index
+; EXIT 'C' clear if OK
+; ES:DI points to SF entry
+; 'C' set if index too large
+; USES BX, DI, ES
+
+procedure SFFromSFN,NEAR
+ ASSUME SS:NOTHING
+
+ getdseg <es> ; address DOSDATA
+ LES DI,SFT_Addr ; (es:di) = start of SFT table
+ ASSUME ES:NOTHING
+
+sfsfn5: CMP BX,ES:[DI].SFCount ; is handle in this table?
+ JB sfsfn7 ; yes, go grab it
+ SUB BX,ES:[DI].SFCount
+ LES DI,ES:[DI].SFLink ; get next table segment
+ CMP DI,-1 ; end of tables?
+ JNZ sfsfn5 ; no, try again
+ STC
+ ret ; return with error, not found
+
+sfsfn7: SAVE <AX>
+ MOV AX,SIZE SF_Entry ; put it in a nice place
+ MUL BL ; (ax) = offset into this SF block
+ ADD DI,AX ; add base of SF block
+ RESTORE <AX>
+ ADD DI,SFTable ; offset into structure, 'C' cleared
+ return ; return with 'C' clear
+
+EndProc SFFromSFN
+
+ BREAK <JFNFree - return a jfn pointer if one is free>
+
+;** JFNFree - Find a Free JFN Slot
+;
+;
+; JFNFree scansthrough the JFN table and returnsa pointer to a free slot
+;
+; ENTRY (ss) = DOSDATA
+; EXIT 'C' clear if OK
+; (bx) = new handle
+; (es:di) = pointer to JFN slot
+; 'C' set if error
+; (al) = error code
+; USES bx, di, es, flags
+
+procedure JFNFree,NEAR
+ DOSASSUME <ss>,"JFNFree"
+
+ XOR BX,BX ; (bx) = initial JFN to try
+jfnf1: CALL pJFNFromHandle ; get the appropriate handle
+ JC jfnf5 ; no more handles
+ CMP BYTE PTR ES:[DI],-1 ; free?
+ je jfnfx ; yes, carry is clear
+ INC BX ; no, next handle
+ JMP jfnf1 ; and try again
+
+; Error. 'C' set
+
+jfnf5: MOV AL,error_too_many_open_files
+
+jfnfx: return ; bye
+
+EndProc JFNFree
+
+ BREAK <SFNFree - Allocate a free SFN>
+
+
+;** SFNFree - Allocate a Free SFN/SFT
+;
+; SFNFree scans through the sf table looking for a free entry
+; If it finds one it partially allocates it by setting SFT_REF_COUNT = -1
+;
+; The problem is that we want to mark the SFT busy so that other threads
+; can't allocate the SFT before we're finished marking it up. However,
+; we can't just mark it busy because we may get blown out of our open
+; by INT24 and leave the thing orphaned. To solve this we mark it
+; "allocation in progress" by setting SFT_REF_COUNT = -1. If we see
+; an SFT with this value we look to see if it belongs to this user
+; and process. If it does belong to us then it must be an orphan
+; and we reclaim it.
+;
+; BUGBUG - improve the performance. I guess it's smaller to call SFFromSFN
+; over and over, but we could at least set a high water mark...
+; cause an N^2 loop calling slow SFFromSFN is real slow, too slow
+; even though this is not a frequently called routine - jgl
+;
+; ENTRY (ss) = DOSDATA
+; EXIT 'C' clear if no error
+; (bx) = SFN
+; (es:di) = pointer to SFT
+; es:[di].SFT_REF_COUNT = -1
+; 'C' set if error
+; (al) = error code
+; USES bx, di, se, Flags
+
+Procedure SFNFree,NEAR
+ DOSASSUME <SS>,"SFNFree"
+
+ SAVE <ax>
+ xor bx,bx ; (bx) = SFN to consider
+sfnf5: SAVE <bx>
+ call SFFromSFN ; get the potential handle
+ RESTORE <bx>
+ DLJC sfnf95 ; no more free SFNs
+ cmp es:[DI.sf_Ref_Count],0 ; free?
+ je sfnf20 ; yep, got one
+ cmp es:[DI.sf_ref_count],sf_busy
+ je sfnf10 ; special busy mark
+sfnf7: inc bx ; try the next one
+ jmp sfnf5
+
+; The SFT has the special "busy" mark; if it belongs to us then
+; it was abandoned during a earlier call and we can use it.
+;
+; (bx) = SFN
+; (es:di) = pointer to SFT
+; (TOS) = caller's (ax)
+
+sfnf10:
+ mov ax,Proc_ID
+ cmp es:[DI].SF_PID,ax
+ jnz sfnf7 ; can't use this one, try the next
+
+; We have an SFT to allocate
+;
+; (bx) = SFN
+; (es:di) = pointer to SFT
+; (TOS) = caller's (ax)
+
+sfnf20:
+ mov es:[DI.sf_ref_count],sf_busy ; make sure that this is allocated
+ mov ax,Proc_ID
+ mov es:[DI].SF_PID,ax
+ RESTORE <ax>
+ clc
+ return ; return with no error
+
+
+;** Error - no more free SFNs
+;
+; 'C' set
+; (TOS) = saved ax
+
+sfnf95: pop ax
+ mov al,error_too_many_open_files
+ ret ; return with 'C' and error
+
+EndProc SFNFree
+DOSCODE ENDS
+ END
diff --git a/private/mvdm/dos/v86/doskrnl/makefile b/private/mvdm/dos/v86/doskrnl/makefile
new file mode 100644
index 000000000..7f53b1580
--- /dev/null
+++ b/private/mvdm/dos/v86/doskrnl/makefile
@@ -0,0 +1,24 @@
+# DOSKRNL root-level makefile
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 22-Apr-1991 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\make.inc
+
+all:
+ cd dos
+ $(MAKE)
+ cd ..\bios
+ $(MAKE)
+ cd ..
+
+clean:
+ cd dos
+ $(MAKE) clean
+ cd ..\bios
+ $(MAKE) clean
+ cd ..
diff --git a/private/mvdm/dos/v86/h/assert.h b/private/mvdm/dos/v86/h/assert.h
new file mode 100644
index 000000000..3a9809fb4
--- /dev/null
+++ b/private/mvdm/dos/v86/h/assert.h
@@ -0,0 +1,35 @@
+/***
+*assert.h - define the assert macro
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Defines the assert(exp) macro.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef _ASSERT_DEFINED
+
+#ifndef NDEBUG
+
+static char _assertstring[] = "Assertion failed: %s, file %s, line %d\n";
+
+#define assert(exp) { \
+ if (!(exp)) { \
+ fprintf(stderr, _assertstring, #exp, __FILE__, __LINE__); \
+ fflush(stderr); \
+ abort(); \
+ } \
+ }
+
+#else
+
+#define assert(exp)
+
+#endif /* NDEBUG */
+
+#define _ASSERT_DEFINED
+
+#endif /* _ASSERT_DEFINED */
diff --git a/private/mvdm/dos/v86/h/bios.h b/private/mvdm/dos/v86/h/bios.h
new file mode 100644
index 000000000..08448572d
--- /dev/null
+++ b/private/mvdm/dos/v86/h/bios.h
@@ -0,0 +1,181 @@
+/***
+*bios.h - declarations for bios interface functions and supporting definitions
+*
+* Copyright (c) 1987-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file declares the constants, structures, and functions
+* used for accessing and using various BIOS interfaces.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+/* manifest constants for BIOS serial communications (RS-232) support */
+
+/* serial port services */
+
+#define _COM_INIT 0 /* init serial port */
+#define _COM_SEND 1 /* send character */
+#define _COM_RECEIVE 2 /* receive character */
+#define _COM_STATUS 3 /* get serial port status */
+
+/* serial port initializers. One and only one constant from each of the
+ * following four groups - character size, stop bit, parity, and baud rate -
+ * must be specified in the initialization byte.
+ */
+
+/* character size initializers */
+
+#define _COM_CHR7 2 /* 7 bits characters */
+#define _COM_CHR8 3 /* 8 bits characters */
+
+/* stop bit values - on or off */
+
+#define _COM_STOP1 0 /* 1 stop bit */
+#define _COM_STOP2 4 /* 2 stop bits */
+
+/* parity initializers */
+
+#define _COM_NOPARITY 0 /* no parity */
+#define _COM_ODDPARITY 8 /* odd parity */
+#define _COM_EVENPARITY 24 /* even parity */
+
+/* baud rate initializers */
+
+#define _COM_110 0 /* 110 baud */
+#define _COM_150 32 /* 150 baud */
+#define _COM_300 64 /* 300 baud */
+#define _COM_600 96 /* 600 baud */
+#define _COM_1200 128 /* 1200 baud */
+#define _COM_2400 160 /* 2400 baud */
+#define _COM_4800 192 /* 4800 baud */
+#define _COM_9600 224 /* 9600 baud */
+
+
+/* manifest constants for BIOS disk support */
+
+/* disk services */
+
+#define _DISK_RESET 0 /* reset disk controller */
+#define _DISK_STATUS 1 /* get disk status */
+#define _DISK_READ 2 /* read disk sectors */
+#define _DISK_WRITE 3 /* write disk sectors */
+#define _DISK_VERIFY 4 /* verify disk sectors */
+#define _DISK_FORMAT 5 /* format disk track */
+
+/* struct used to send/receive information to/from the BIOS disk services */
+
+#ifndef NO_EXT_KEYS /* extensions must be enabled */
+
+#ifndef _DISKINFO_T_DEFINED
+
+struct diskinfo_t {
+ unsigned drive;
+ unsigned head;
+ unsigned track;
+ unsigned sector;
+ unsigned nsectors;
+ void far *buffer;
+ };
+
+#define _DISKINFO_T_DEFINED
+
+#endif
+
+#endif /* NO_EXT_KEYS */
+
+
+/* manifest constants for BIOS keyboard support */
+
+/* keyboard services */
+
+#define _KEYBRD_READ 0 /* read next character from keyboard */
+#define _KEYBRD_READY 1 /* check for keystroke */
+#define _KEYBRD_SHIFTSTATUS 2 /* get current shift key status */
+
+
+/* manifest constants for BIOS printer support */
+
+/* printer services */
+
+#define _PRINTER_WRITE 0 /* write character to printer */
+#define _PRINTER_INIT 1 /* intialize printer */
+#define _PRINTER_STATUS 2 /* get printer status */
+
+
+/* manifest constants for BIOS time of day support */
+
+/* time of day services */
+
+#define _TIME_GETCLOCK 0 /* get current clock count */
+#define _TIME_SETCLOCK 1 /* set current clock count */
+
+
+#ifndef _REGS_DEFINED
+
+/* word registers */
+
+struct WORDREGS {
+ unsigned int ax;
+ unsigned int bx;
+ unsigned int cx;
+ unsigned int dx;
+ unsigned int si;
+ unsigned int di;
+ unsigned int cflag;
+ };
+
+/* byte registers */
+
+struct BYTEREGS {
+ unsigned char al, ah;
+ unsigned char bl, bh;
+ unsigned char cl, ch;
+ unsigned char dl, dh;
+ };
+
+/* general purpose registers union -
+ * overlays the corresponding word and byte registers.
+ */
+
+union REGS {
+ struct WORDREGS x;
+ struct BYTEREGS h;
+ };
+
+/* segment registers */
+
+struct SREGS {
+ unsigned int es;
+ unsigned int cs;
+ unsigned int ss;
+ unsigned int ds;
+ };
+
+#define _REGS_DEFINED
+
+#endif /* _REGS_DEFINED */
+
+
+/* function prototypes */
+
+unsigned _CDECL _bios_equiplist(void);
+unsigned _CDECL _bios_keybrd(unsigned);
+unsigned _CDECL _bios_memsize(void);
+unsigned _CDECL _bios_printer(unsigned, unsigned, unsigned);
+unsigned _CDECL _bios_serialcom(unsigned, unsigned, unsigned);
+unsigned _CDECL _bios_timeofday(unsigned, long *);
+int _CDECL int86(int, union REGS *, union REGS *);
+int _CDECL int86x(int, union REGS *, union REGS *, struct SREGS *);
+
+#ifndef NO_EXT_KEYS /* extensions must be enabled */
+
+unsigned _CDECL _bios_disk(unsigned, struct diskinfo_t *);
+
+#endif /* NO_EXT_KEYS */
diff --git a/private/mvdm/dos/v86/h/bios.inc b/private/mvdm/dos/v86/h/bios.inc
new file mode 100644
index 000000000..3d757210c
--- /dev/null
+++ b/private/mvdm/dos/v86/h/bios.inc
@@ -0,0 +1,166 @@
+; BIOS Interface Macros - Version 1.0 - for Microsoft Macro Assembler 5.0
+; (C) Copyright Microsoft Corporation, 1987.
+
+.XCREF
+.XLIST
+IF1
+; 0Fh
+@GetMode MACRO
+ mov ah,0Fh
+ int 10h
+ ENDM
+; 00h
+@SetMode MACRO mode
+ mov al,mode
+ xor ah,ah
+ int 10h
+ ENDM
+; 0Bh
+@SetColor MACRO color
+ sub bh,bh
+ mov bl,color
+ mov ah,0Bh
+ int 10h
+ ENDM
+; 0Bh
+@SetPalet MACRO color
+ mov bh,1
+ mov bl,color
+ mov ah,0Bh
+ int 10h
+ ENDM
+; 05h
+@SetPage MACRO page
+ mov al,page
+ mov ah,05h
+ int 10h
+ ENDM
+; 03h
+@GetCur MACRO page
+ IFNB <page>
+ mov bh,page
+ ELSE
+ xor bh,bh
+ ENDIF
+ mov ah,03h
+ int 10h
+ ENDM
+; 02h
+@SetCurPos MACRO column,row,page
+ IFNB <column>
+ mov dl,column
+ ENDIF
+ IFNB <row>
+ mov dh,row
+ ENDIF
+ IFNB <page>
+ mov bh,page
+ ELSE
+ xor bh,bh
+ ENDIF
+ mov ah,02h
+ int 10h
+ ENDM
+; 01h
+@SetCurSz MACRO first,last
+ mov ch,first
+ mov cl,last
+ mov ah,01h
+ int 10h
+ ENDM
+; 08h
+@GetChAtr MACRO page
+ IFNB <page>
+ mov bh,page
+ ELSE
+ sub bh,bh
+ ENDIF
+ mov ah,08h
+ int 10h
+ ENDM
+; 09h
+@PutChAtr MACRO char,atrib,page,repeat
+ IFNB <char>
+ mov al,char
+ ENDIF
+ IFNB <atrib>
+ mov bl,atrib
+ ENDIF
+ IFNB <page>
+ mov bh,page
+ ELSE
+ xor bh,bh
+ ENDIF
+ IFNB <repeat>
+ mov cx,repeat
+ ELSE
+ mov cx,1
+ ENDIF
+ mov ah,09h
+ int 10h
+ ENDM
+; 0Ah
+@PutCh MACRO char,atrib,page,repeat
+ IFNB <char>
+ mov al,char
+ ENDIF
+ IFNB <atrib>
+ mov bl,atrib
+ ENDIF
+ IFNB <page>
+ mov bh,page
+ ELSE
+ xor bh,bh
+ ENDIF
+ IFNB <repeat>
+ mov cx,repeat
+ ELSE
+ mov cx,1
+ ENDIF
+ mov ah,0Ah
+ int 10h
+ ENDM
+; 06h and 07h
+@Scroll MACRO distance,atrib,upcol,uprow,downcol,downrow
+ IFDEF upcol
+ mov cl,upcol
+ ENDIF
+ IFDEF uprow
+ mov ch,uprow
+ ENDIF
+ IFDEF upcol
+ mov dl,upcol
+ ENDIF
+ IFDEF updownrow
+ mov dh,downrow
+ ENDIF
+ IFDEF atrib
+ mov bh,atrib
+ ELSE
+ mov bh,07h
+ ENDIF
+ IF distance LE 0
+ mov ax,0600h + (-(distance) AND 0FFh)
+ ELSE
+ mov ax,0700h + (distance AND 0FFh)
+ ENDIF
+ int 10h
+ ENDM
+; 08h, 06h, and 02h
+@Cls MACRO
+ @GetChAtr
+ mov bl,bh
+ mov bh,ah
+ sub cx,cx
+ mov dx,184Fh
+ mov ax,0600h
+ int 10h
+ mov bh,bl
+ sub dx,dx
+ mov ah,02h
+ int 10h
+ ENDM
+ENDIF
+.CREF
+.LIST
+
diff --git a/private/mvdm/dos/v86/h/conio.h b/private/mvdm/dos/v86/h/conio.h
new file mode 100644
index 000000000..7941e2e0b
--- /dev/null
+++ b/private/mvdm/dos/v86/h/conio.h
@@ -0,0 +1,34 @@
+/***
+*conio.h - console and port I/O declarations
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for
+* the MS C V2.03 compatible console and port I/O routines.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+/* function prototypes */
+
+char * _CDECL cgets(char *);
+int _CDECL cprintf(char *, ...);
+int _CDECL cputs(char *);
+int _CDECL cscanf(char *, ...);
+int _CDECL getch(void);
+int _CDECL getche(void);
+int _CDECL inp(unsigned int);
+unsigned _CDECL inpw(unsigned int);
+int _CDECL kbhit(void);
+int _CDECL outp(unsigned int, int);
+unsigned _CDECL outpw(unsigned int, unsigned int);
+int _CDECL putch(int);
+int _CDECL ungetch(int);
+
diff --git a/private/mvdm/dos/v86/h/copyrigh.h b/private/mvdm/dos/v86/h/copyrigh.h
new file mode 100644
index 000000000..8d295ddf5
--- /dev/null
+++ b/private/mvdm/dos/v86/h/copyrigh.h
@@ -0,0 +1,4 @@
+//M000 - Updated copyright message
+char *copyright1 = "MS DOS Version 5.00 (C)Copyright 1981-1991 Microsoft Corp ";
+char *copyright2 = "Licensed Material - Property of Microsoft ";
+char *copyright3 = "All rights reserved ";
diff --git a/private/mvdm/dos/v86/h/ctype.h b/private/mvdm/dos/v86/h/ctype.h
new file mode 100644
index 000000000..c65d021c2
--- /dev/null
+++ b/private/mvdm/dos/v86/h/ctype.h
@@ -0,0 +1,66 @@
+/***
+*ctype.h - character conversion macros and ctype macros
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Defines macros for character classification/conversion.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+/*
+ * This declaration allows the user access to the ctype look-up
+ * array _ctype defined in ctype.obj by simply including ctype.h
+ */
+
+extern unsigned char _NEAR _CDECL _ctype[];
+
+/* set bit masks for the possible character types */
+
+#define _UPPER 0x1 /* upper case letter */
+#define _LOWER 0x2 /* lower case letter */
+#define _DIGIT 0x4 /* digit[0-9] */
+#define _SPACE 0x8 /* tab, carriage return, newline, */
+ /* vertical tab or form feed */
+#define _PUNCT 0x10 /* punctuation character */
+#define _CONTROL 0x20 /* control character */
+#define _BLANK 0x40 /* space char */
+#define _HEX 0x80 /* hexadecimal digit */
+
+/* the character classification macro definitions */
+
+#define isalpha(c) ( (_ctype+1)[c] & (_UPPER|_LOWER) )
+#define isupper(c) ( (_ctype+1)[c] & _UPPER )
+#define islower(c) ( (_ctype+1)[c] & _LOWER )
+#define isdigit(c) ( (_ctype+1)[c] & _DIGIT )
+#define isxdigit(c) ( (_ctype+1)[c] & _HEX )
+#define isspace(c) ( (_ctype+1)[c] & _SPACE )
+#define ispunct(c) ( (_ctype+1)[c] & _PUNCT )
+#define isalnum(c) ( (_ctype+1)[c] & (_UPPER|_LOWER|_DIGIT) )
+#define isprint(c) ( (_ctype+1)[c] & (_BLANK|_PUNCT|_UPPER|_LOWER|_DIGIT) )
+#define isgraph(c) ( (_ctype+1)[c] & (_PUNCT|_UPPER|_LOWER|_DIGIT) )
+#define iscntrl(c) ( (_ctype+1)[c] & _CONTROL )
+
+#define toupper(c) ( (islower(c)) ? _toupper(c) : (c) )
+#define tolower(c) ( (isupper(c)) ? _tolower(c) : (c) )
+
+#define _tolower(c) ( (c)-'A'+'a' )
+#define _toupper(c) ( (c)-'a'+'A' )
+
+#define isascii(c) ( (unsigned)(c) < 0x80 )
+#define toascii(c) ( (c) & 0x7f )
+
+/* MS C version 2.0 extended ctype macros */
+
+#define iscsymf(c) (isalpha(c) || ((c) == '_'))
+#define iscsym(c) (isalnum(c) || ((c) == '_'))
diff --git a/private/mvdm/dos/v86/h/direct.h b/private/mvdm/dos/v86/h/direct.h
new file mode 100644
index 000000000..2e2ebde13
--- /dev/null
+++ b/private/mvdm/dos/v86/h/direct.h
@@ -0,0 +1,24 @@
+/***
+*direct.h - function declarations for directory handling/creation
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for the library
+* functions related to directory handling and creation.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+/* function prototypes */
+
+int _CDECL chdir(char *);
+char * _CDECL getcwd(char *, int);
+int _CDECL mkdir(char *);
+int _CDECL rmdir(char *);
diff --git a/private/mvdm/dos/v86/h/dos.h b/private/mvdm/dos/v86/h/dos.h
new file mode 100644
index 000000000..55391560c
--- /dev/null
+++ b/private/mvdm/dos/v86/h/dos.h
@@ -0,0 +1,220 @@
+/***
+*dos.h - definitions for MS-DOS interface routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Defines the structs and unions used for the direct DOS interface
+* routines; includes macros to access the segment and offset
+* values of far pointers, so that they may be used by the routines; and
+* provides function prototypes for direct DOS interface functions.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+#ifndef _REGS_DEFINED
+
+/* word registers */
+
+struct WORDREGS {
+ unsigned int ax;
+ unsigned int bx;
+ unsigned int cx;
+ unsigned int dx;
+ unsigned int si;
+ unsigned int di;
+ unsigned int cflag;
+ };
+
+
+/* byte registers */
+
+struct BYTEREGS {
+ unsigned char al, ah;
+ unsigned char bl, bh;
+ unsigned char cl, ch;
+ unsigned char dl, dh;
+ };
+
+
+/* general purpose registers union -
+ * overlays the corresponding word and byte registers.
+ */
+
+union REGS {
+ struct WORDREGS x;
+ struct BYTEREGS h;
+ };
+
+
+/* segment registers */
+
+struct SREGS {
+ unsigned int es;
+ unsigned int cs;
+ unsigned int ss;
+ unsigned int ds;
+ };
+
+#define _REGS_DEFINED
+
+#endif
+
+
+/* dosexterror structure */
+
+#ifndef _DOSERROR_DEFINED
+
+struct DOSERROR {
+ int exterror;
+ char class;
+ char action;
+ char locus;
+ };
+
+#define _DOSERROR_DEFINED
+
+#endif
+
+
+/* _dos_findfirst structure */
+
+#ifndef _FIND_T_DEFINED
+
+struct find_t {
+ char reserved[21];
+ char attrib;
+ unsigned wr_time;
+ unsigned wr_date;
+ long size;
+ char name[13];
+ };
+
+#define _FIND_T_DEFINED
+
+#endif
+
+
+/* _dos_getdate/_dossetdate and _dos_gettime/_dos_settime structures */
+
+#ifndef _DATETIME_T_DEFINED
+
+struct dosdate_t {
+ unsigned char day; /* 1-31 */
+ unsigned char month; /* 1-12 */
+ unsigned int year; /* 1980-2099 */
+ unsigned char dayofweek; /* 0-6, 0=Sunday */
+ };
+
+struct dostime_t {
+ unsigned char hour; /* 0-23 */
+ unsigned char minute; /* 0-59 */
+ unsigned char second; /* 0-59 */
+ unsigned char hsecond; /* 0-99 */
+ };
+
+#define _DATETIME_T_DEFINED
+
+#endif
+
+
+/* _dos_getdiskfree structure */
+
+#ifndef _DISKFREE_T_DEFINED
+
+struct diskfree_t {
+ unsigned total_clusters;
+ unsigned avail_clusters;
+ unsigned sectors_per_cluster;
+ unsigned bytes_per_sector;
+ };
+
+#define _DISKFREE_T_DEFINED
+
+#endif
+
+
+/* manifest constants for _hardresume result parameter */
+
+#define _HARDERR_IGNORE 0 /* Ignore the error */
+#define _HARDERR_RETRY 1 /* Retry the operation */
+#define _HARDERR_ABORT 2 /* Abort program issuing Interrupt 23h */
+#define _HARDERR_FAIL 3 /* Fail the system call in progress */
+ /* _HARDERR_FAIL is not supported on DOS 2.x */
+
+/* File attribute constants */
+
+#define _A_NORMAL 0x00 /* Normal file - No read/write restrictions */
+#define _A_RDONLY 0x01 /* Read only file */
+#define _A_HIDDEN 0x02 /* Hidden file */
+#define _A_SYSTEM 0x04 /* System file */
+#define _A_VOLID 0x08 /* Volume ID file */
+#define _A_SUBDIR 0x10 /* Subdirectory */
+#define _A_ARCH 0x20 /* Archive file */
+
+/* macros to break MS C "far" pointers into their segment and offset
+ * components
+ */
+
+#define FP_SEG(fp) (*((unsigned *)&(fp) + 1))
+#define FP_OFF(fp) (*((unsigned *)&(fp)))
+
+
+/* external variable declarations */
+
+extern unsigned int _NEAR _CDECL _osversion;
+
+
+/* function prototypes */
+
+int _CDECL bdos(int, unsigned int, unsigned int);
+void _CDECL _disable(void);
+unsigned _CDECL _dos_allocmem(unsigned, unsigned *);
+unsigned _CDECL _dos_close(int);
+unsigned _CDECL _dos_creat(char *, unsigned, int *);
+unsigned _CDECL _dos_creatnew(char *, unsigned, int *);
+unsigned _CDECL _dos_findfirst(char *, unsigned, struct find_t *);
+unsigned _CDECL _dos_findnext(struct find_t *);
+unsigned _CDECL _dos_freemem(unsigned);
+void _CDECL _dos_getdate(struct dosdate_t *);
+void _CDECL _dos_getdrive(unsigned *);
+unsigned _CDECL _dos_getdiskfree(unsigned, struct diskfree_t *);
+unsigned _CDECL _dos_getfileattr(char *, unsigned *);
+unsigned _CDECL _dos_getftime(int, unsigned *, unsigned *);
+void _CDECL _dos_gettime(struct dostime_t *);
+void _CDECL _dos_keep(unsigned, unsigned);
+unsigned _CDECL _dos_open(char *, unsigned, int *);
+unsigned _CDECL _dos_setblock(unsigned, unsigned, unsigned *);
+unsigned _CDECL _dos_setdate(struct dosdate_t *);
+void _CDECL _dos_setdrive(unsigned, unsigned *);
+unsigned _CDECL _dos_setfileattr(char *, unsigned);
+unsigned _CDECL _dos_setftime(int, unsigned, unsigned);
+unsigned _CDECL _dos_settime(struct dostime_t *);
+int _CDECL dosexterr(struct DOSERROR *);
+void _CDECL _enable(void);
+void _CDECL _hardresume(int);
+void _CDECL _hardretn(int);
+int _CDECL intdos(union REGS *, union REGS *);
+int _CDECL intdosx(union REGS *, union REGS *, struct SREGS *);
+int _CDECL int86(int, union REGS *, union REGS *);
+int _CDECL int86x(int, union REGS *, union REGS *, struct SREGS *);
+void _CDECL segread(struct SREGS *);
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+void _CDECL _chain_intr(void (_CDECL interrupt far *)());
+void (_CDECL interrupt far * _CDECL _dos_getvect(unsigned))();
+unsigned _CDECL _dos_read(int, void far *, unsigned, unsigned *);
+void _CDECL _dos_setvect(unsigned, void (_CDECL interrupt far *)());
+unsigned _CDECL _dos_write(int, void far *, unsigned, unsigned *);
+void _CDECL _harderr(void (far *)());
+#endif /* NO_EXT_KEYS */
diff --git a/private/mvdm/dos/v86/h/dos.inc b/private/mvdm/dos/v86/h/dos.inc
new file mode 100644
index 000000000..593b7c29c
--- /dev/null
+++ b/private/mvdm/dos/v86/h/dos.inc
@@ -0,0 +1,524 @@
+; DOS Interface Macros - Version 1.0 - for Microsoft Macro Assembler 5.0
+; (C) Copyright Microsoft Corporation, 1987, 1988.
+
+.XCREF
+.XLIST
+IF1
+; Internal
+__LdAdr MACRO reg, adr
+ IF (.TYPE (adr)) AND 00010000b ;; Register
+ mov reg, adr
+ ELSEIF (.TYPE (adr)) AND 00000100b ;; Constant
+ mov reg, adr
+ ELSEIF TYPE (adr) EQ 1 ;; Bytes
+ mov reg, OFFSET adr
+ ELSEIF TYPE (adr) EQ 2 ;; Near pointer
+ mov reg, adr
+ ELSEIF TYPE (adr) EQ 4 ;; Far pointer
+ lds reg, adr
+ ELSE
+ .ERR
+ %OUT Illegal argument
+ ENDIF
+ENDM
+
+; Internal
+__LdSeg MACRO dest, src
+ IFIDNI <src>, <es> ;; Segment register
+ mov ax, src
+ mov dest, ax
+ ELSEIFIDNI <src>, <ss>
+ mov ax, src
+ mov dest, ax
+ ELSEIFIDNI <src>, <ds>
+ mov ax, src
+ mov dest, ax
+ ELSEIFIDNI <src>, <ds>
+ mov ax, src
+ mov dest, ax
+ ELSEIF (.TYPE (src)) AND 00000100b ;; Constant
+ mov ax, src
+ mov dest, ax
+ ELSE ;; Memory or general register
+ mov dest, src
+ ENDIF
+ENDM
+
+; 01h, 07h, 08h, 0Ch
+@GetKey MACRO echo, cc, clear
+ LOCAL funct, disp
+ IFDIF <echo>, <0>
+ IFDIF <cc>, <0>
+ funct = 01h
+ ELSE
+ funct = 07h
+ disp = 02h
+ ENDIF
+ ELSE
+ IFDIF <cc>, <0>
+ funct = 08h
+ ELSE
+ funct = 07h
+ ENDIF
+ ENDIF
+ IFB <clear>
+ mov ah, funct
+ ELSE
+ IFIDN <clear>, <0>
+ mov ah, funct
+ ELSE
+ mov ah, 0Ch
+ mov al, funct
+ ENDIF
+ ENDIF
+ int 21h
+ IFDEF disp
+ mov dl, al
+ mov ah, disp
+ int 21h
+ ENDIF
+ENDM
+
+; 0Ah
+@GetStr MACRO ofset, terminator, limit, segmnt
+ __LdAdr dx, <ofset>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 0Ah
+ mov si, dx
+ IFNB <limit>
+ mov BYTE PTR [si], limit
+ ENDIF
+ int 21h
+ inc si
+ mov bl, [si]
+ sub bh, bh
+ inc si
+ IFNB <terminator>
+ mov BYTE PTR [bx+si], terminator
+ ENDIF
+ENDM
+
+; 02h
+@DispCh MACRO ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10
+ mov ah, 02h
+ IRP char, <ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10>
+ IFB <char>
+ EXITM
+ ENDIF
+ mov dl, char
+ int 21h
+ ENDM
+ENDM
+
+; 05h
+@PrtCh MACRO ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10
+ mov ah, 05h
+ IRP char, <ch1, ch2, ch3, ch4, ch5, ch6, ch7, ch8, ch9, ch10>
+ IFB <char>
+ EXITM
+ ENDIF
+ mov dl, char
+ int 21h
+ ENDM
+ENDM
+
+; 09h
+@DispStr MACRO ofset, segmnt
+ __LdAdr dx, <ofset>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 9
+ int 21h
+ENDM
+
+; 3Fh
+@Read MACRO ofset, bytes, handle, segmnt
+ IFNB <handle>
+ mov bx, handle
+ ELSE
+ sub bx, bx
+ ENDIF
+ mov cx, bytes
+ __LdAdr dx, <ofset>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 3Fh
+ int 21h
+ENDM
+
+; 40h
+@Write MACRO ofset, bytes, handle, segmnt
+ IFNB <handle>
+ mov bx, handle
+ ELSE
+ mov bx, 1
+ ENDIF
+ mov cx, bytes
+ __LdAdr dx, <ofset>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 40h
+ int 21h
+ENDM
+
+; 3Ch
+@MakFil MACRO path, atrib, segmnt, kind
+ IFB <atrib>
+ sub cx, cx
+ ELSE
+ mov cx, atrib
+ ENDIF
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ IFIDNI <kind>, <tmp>
+ mov ah, 5Ah
+ ELSEIFIDNI <kind>, <new>
+ mov ah, 5Bh
+ ELSE
+ mov ah, 3Ch
+ ENDIF
+ int 21h
+ENDM
+
+; 3Dh
+@OpenFil MACRO path, access, segmnt
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ax, 3D00h + (access AND 0FFh)
+ int 21h
+ENDM
+
+; 3Eh
+@ClosFil MACRO handle
+ mov bx, handle
+ mov ah, 3Eh
+ int 21h
+ENDM
+
+; 41h
+@DelFil MACRO path, segmnt
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 41h
+ int 21h
+ENDM
+
+; 56h
+@MoveFil MACRO old, new, segold, segnew
+ __LdAdr dx, <old>
+ __LdAdr di, <new>
+ IFNB <segold>
+ __LdSeg ds, <segold>
+ ENDIF
+ IFNB <segnew>
+ __LdSeg es, <segnew>
+ ENDIF
+ mov ah, 56h
+ int 21h
+ENDM
+
+; 4Eh
+@GetFirst MACRO path, atrib, segmnt
+ IFNB <atrib>
+ mov cx, atrib
+ ELSE
+ sub cx, cx
+ ENDIF
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 4Eh
+ int 21h
+ENDM
+
+; 4Fh
+@GetNext MACRO
+ mov ah, 4Fh
+ int 21h
+ENDM
+
+; 2Fh
+@GetDTA MACRO
+ mov ah, 2Fh
+ int 21h
+ENDM
+
+; 1Ah
+@SetDTA MACRO buffer, segmnt
+ __LdAdr dx, <buffer>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 1Ah
+ int 21h
+ENDM
+
+; Internal
+__LdDub MACRO dub
+ IF TYPE (dub) EQ 2
+ sub cx, cx
+ mov dx, dub
+ ELSEIF TYPE (dub) EQ 4
+ mov cx, dub[2]
+ mov dx, dub[0]
+ ELSEIF TYPE (dub) EQ 0
+ sub cx, cx
+ mov dx, dub
+ ELSE
+ .ERR
+ %OUT Illegal argument
+ ENDIF
+ENDM
+
+; 42h
+@GetFilSz MACRO handle
+ mov bx, handle
+ sub cx, cx
+ sub dx, dx
+ mov ax, 4202h
+ int 21h
+ push dx
+ push ax
+ sub dx, dx
+ mov ax, 4200h
+ int 21h
+ pop ax
+ pop dx
+ENDM
+
+; 42h
+@MovePtrAbs MACRO handle, distance
+ IFNB <distance>
+ __LdDub <distance>
+ ENDIF
+ mov bx, handle
+ mov ax, 4200h
+ int 21h
+ENDM
+
+; 42h
+@MovePtrRel MACRO handle, distance
+ IFNB <distance>
+ __LdDub <distance>
+ ENDIF
+ mov bx, handle
+ mov ax, 4201h
+ int 21h
+ENDM
+
+; 39h
+@MkDir MACRO path, segmnt
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 39h
+ int 21h
+ENDM
+
+; 3Ah
+@RmDir MACRO path, segmnt
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 3Ah
+ int 21h
+ENDM
+
+; 3Bh
+@ChDir MACRO path, segmnt
+ __LdAdr dx, <path>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 3Bh
+ int 21h
+ENDM
+
+; 47h
+@GetDir MACRO buffer, drive, segmnt
+ IFNB <drive>
+ mov dl, drive
+ ELSE
+ sub dl, dl
+ ENDIF
+ __LdAdr si, <buffer>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ mov ah, 47h
+ int 21h
+ENDM
+
+; 19h
+@GetDrv MACRO
+ mov ah, 19h
+ int 21h
+ENDM
+
+; 0Eh
+@SetDrv MACRO drive
+ mov dl, drive
+ mov ah, 0Eh
+ int 21h
+ENDM
+
+; 36h
+@ChkDrv MACRO drive
+ IFNB <drive>
+ mov dl, drive
+ ELSE
+ sub dl, dl
+ ENDIF
+ mov ah, 36h
+ int 21h
+ENDM
+
+; 4Ch
+@Exit MACRO return
+ IFB <return>
+ mov ah, 4Ch
+ ELSE
+ mov ax, 4C00h + (return AND 0FFh)
+ ENDIF
+ int 21h
+ENDM
+
+; 4Bh
+@Exec MACRO path, parms, segpath, segparms, overlay
+ __LdAdr dx, <path>
+ __LdAdr bx, <parms>
+ IFNB <segpath>
+ __LdSeg ds, <segpath>
+ ENDIF
+ IFNB <segparms>
+ __LdSeg es, <segparms>
+ ENDIF
+ IFB <overlay>
+ mov ax, 4B00h
+ ELSE
+ mov ax, 4B03h
+ ENDIF
+ int 21h
+ENDM
+
+; 4Dh
+@GetRet MACRO
+ mov ah, 4Dh
+ int 21h
+ENDM
+
+; 31h
+@TSR MACRO paragraphs, return
+ mov dx, paragraphs
+ IFB <return>
+ mov ah, 31h
+ ELSE
+ mov ax, 3100h + (return AND 0FFh)
+ ENDIF
+ int 21h
+ENDM
+
+; 49h
+@FreeBlok MACRO segmnt
+ IFNB <segmnt>
+ __LdSeg es, <segmnt>
+ ENDIF
+ mov ah, 49h
+ int 21h
+ENDM
+
+; 48h
+@GetBlok MACRO graphs
+ LOCAL tryit
+ mov bx, graphs
+ tryit: mov ah, 48h
+ int 21h
+ jc tryit
+ENDM
+
+; 4Ah
+@ModBlok MACRO graphs, segmnt
+ IFNB <segmnt>
+ __LdSeg es, <segmnt>
+ ENDIF
+ mov bx, graphs
+ mov ah, 4Ah
+ int 21h
+ENDM
+
+; 2Ah
+@GetDate MACRO
+ mov ah, 2Ah
+ int 21h
+ENDM
+
+; 2Bh
+@SetDate MACRO month, day, year
+ mov cx, year
+ mov dh, month
+ mov dl, day
+ mov ah, 2Bh
+ int 21h
+ENDM
+
+; 2Ch
+@GetTime MACRO
+ mov ah, 2Ch
+ int 21h
+ENDM
+
+; 2Dh
+@SetTime MACRO hour, minutes, seconds, hundredths
+ mov ch, hour
+ mov cl, minutes
+ mov dh, seconds
+ mov dl, hundredths
+ mov ah, 2Dh
+ int 21h
+ENDM
+
+; 30h
+@GetVer MACRO
+ mov ah, 30h
+ int 21h
+ENDM
+
+; 35h
+@GetInt MACRO interrupt
+ mov ax, 3500h + (interrupt AND 0FFh)
+ int 21h
+ENDM
+
+; 25h
+@SetInt MACRO interrupt, vector, segmnt
+ IF TYPE (vector) GE 0FFFEh
+ mov dx, OFFSET vector
+ mov ax, SEG vector
+ mov ds, ax
+ ELSE
+ __LdAdr dx, <vector>
+ IFNB <segmnt>
+ __LdSeg ds, <segmnt>
+ ENDIF
+ ENDIF
+ mov ax, 2500h + (interrupt AND 0FFh)
+ int 21h
+ENDM
+
+ENDIF ; Pass 1
+.CREF
+.LIST
diff --git a/private/mvdm/dos/v86/h/errno.h b/private/mvdm/dos/v86/h/errno.h
new file mode 100644
index 000000000..092533837
--- /dev/null
+++ b/private/mvdm/dos/v86/h/errno.h
@@ -0,0 +1,50 @@
+/***
+*errno.h - system wide error numbers (set by system calls)
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the system-wide error numbers (set by
+* system calls). Conforms to the XENIX standard. Extended
+* for compatibility with Uniforum standard.
+* [System V]
+*
+*******************************************************************************/
+
+#define EZERO 0
+#define EPERM 1
+#define ENOENT 2
+#define ESRCH 3
+#define EINTR 4
+#define EIO 5
+#define ENXIO 6
+#define E2BIG 7
+#define ENOEXEC 8
+#define EBADF 9
+#define ECHILD 10
+#define EAGAIN 11
+#define ENOMEM 12
+#define EACCES 13
+#define EFAULT 14
+#define ENOTBLK 15
+#define EBUSY 16
+#define EEXIST 17
+#define EXDEV 18
+#define ENODEV 19
+#define ENOTDIR 20
+#define EISDIR 21
+#define EINVAL 22
+#define ENFILE 23
+#define EMFILE 24
+#define ENOTTY 25
+#define ETXTBSY 26
+#define EFBIG 27
+#define ENOSPC 28
+#define ESPIPE 29
+#define EROFS 30
+#define EMLINK 31
+#define EPIPE 32
+#define EDOM 33
+#define ERANGE 34
+#define EUCLEAN 35
+#define EDEADLOCK 36
diff --git a/private/mvdm/dos/v86/h/fcntl.h b/private/mvdm/dos/v86/h/fcntl.h
new file mode 100644
index 000000000..08ad54915
--- /dev/null
+++ b/private/mvdm/dos/v86/h/fcntl.h
@@ -0,0 +1,35 @@
+/***
+*fcntl.h - file control options used by open()
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines constants for the file control options used
+* by the open() function.
+* [System V]
+*
+*******************************************************************************/
+
+#define O_RDONLY 0x0000 /* open for reading only */
+#define O_WRONLY 0x0001 /* open for writing only */
+#define O_RDWR 0x0002 /* open for reading and writing */
+#define O_APPEND 0x0008 /* writes done at eof */
+
+#define O_CREAT 0x0100 /* create and open file */
+#define O_TRUNC 0x0200 /* open and truncate */
+#define O_EXCL 0x0400 /* open only if file doesn't already exist */
+
+/* O_TEXT files have <cr><lf> sequences translated to <lf> on read()'s,
+** and <lf> sequences translated to <cr><lf> on write()'s
+*/
+
+#define O_TEXT 0x4000 /* file mode is text (translated) */
+#define O_BINARY 0x8000 /* file mode is binary (untranslated) */
+
+/* macro to translate the C 2.0 name used to force binary mode for files */
+
+#define O_RAW O_BINARY
+
+/* Open handle inherit bit */
+
+#define O_NOINHERIT 0x0080 /* child process doesn't inherit file */
diff --git a/private/mvdm/dos/v86/h/float.h b/private/mvdm/dos/v86/h/float.h
new file mode 100644
index 000000000..2d73f85f7
--- /dev/null
+++ b/private/mvdm/dos/v86/h/float.h
@@ -0,0 +1,137 @@
+/***
+*float.h - constants for floating point values
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains defines for a number of implementation dependent
+* values which are commonly used by sophisticated numerical (floating
+* point) programs.
+* [ANSI]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+#define DBL_DIG 15 /* # of decimal digits of precision */
+#define DBL_EPSILON 2.2204460492503131e-016 /* smallest such that 1.0+DBL_EPSILON != 1.0 */
+#define DBL_MANT_DIG 53 /* # of bits in mantissa */
+#define DBL_MAX 1.7976931348623158e+308 /* max value */
+#define DBL_MAX_10_EXP 308 /* max decimal exponent */
+#define DBL_MAX_EXP 1024 /* max binary exponent */
+#define DBL_MIN 2.2250738585072014e-308 /* min positive value */
+#define DBL_MIN_10_EXP -307 /* min decimal exponent
+#define DBL_MIN_EXP -1021 /* min binary exponent */
+#define DBL_RADIX 2 /* exponent radix */
+#define DBL_ROUNDS 0 /* addition rounding: chops */
+
+#define FLT_DIG 6 /* # of decimal digits of precision */
+#define FLT_EPSILON 1.192092896e-07 /* smallest such that 1.0+FLT_EPSILON != 1.0 */
+#define FLT_GUARD 0
+#define FLT_MANT_DIG 24 /* # of bits in mantissa */
+#define FLT_MAX 3.402823466e+38 /* max value */
+#define FLT_MAX_10_EXP 38 /* max decimal exponent */
+#define FLT_MAX_EXP 128 /* max binary exponent */
+#define FLT_MIN 1.175494351e-38 /* min positive value */
+#define FLT_MIN_10_EXP -37 /* min decimal exponent */
+#define FLT_MIN_EXP -125 /* min binary exponent */
+#define FLT_NORMALIZE 0
+#define FLT_RADIX 2 /* exponent radix */
+#define FLT_ROUNDS 0 /* addition rounding: chops */
+
+#define LDBL_DIG DBL_DIG /* # of decimal digits of precision */
+#define LDBL_EPSILON DBL_EPSILON /* smallest such that 1.0+LDBL_EPSILON != 1.0 */
+#define LDBL_MANT_DIG DBL_MANT_DIG /* # of bits in mantissa */
+#define LDBL_MAX DBL_MAX /* max value */
+#define LDBL_MAX_10_EXP DBL_MAX_10_EXP /* max decimal exponent */
+#define LDBL_MAX_EXP DBL_MAX_EXP /* max binary exponent */
+#define LDBL_MIN DBL_MIN /* min positive value */
+#define LDBL_MIN_10_EXP DBL_MIN_10_EXP /* min deimal exponent
+#define LDBL_MIN_EXP DBL_MIN_EXP /* min binary exponent */
+#define LDBL_RADIX DBL_RADIX /* exponent radix */
+#define LDBL_ROUNDS DBL_ROUNDS /* addition rounding: chops */
+
+
+/*
+ * 8087/80287 math control information
+ */
+
+
+/* User Control Word Mask and bit definitions.
+ * These definitions match the 8087/80287
+ */
+
+#define MCW_EM 0x003f /* interrupt Exception Masks */
+#define EM_INVALID 0x0001 /* invalid */
+#define EM_DENORMAL 0x0002 /* denormal */
+#define EM_ZERODIVIDE 0x0004 /* zero divide */
+#define EM_OVERFLOW 0x0008 /* overflow */
+#define EM_UNDERFLOW 0x0010 /* underflow */
+#define EM_INEXACT 0x0020 /* inexact (precision) */
+
+#define MCW_IC 0x1000 /* Infinity Control */
+#define IC_AFFINE 0x1000 /* affine */
+#define IC_PROJECTIVE 0x0000 /* projective */
+
+#define MCW_RC 0x0c00 /* Rounding Control */
+#define RC_CHOP 0x0c00 /* chop */
+#define RC_UP 0x0800 /* up */
+#define RC_DOWN 0x0400 /* down */
+#define RC_NEAR 0x0000 /* near */
+
+#define MCW_PC 0x0300 /* Precision Control */
+#define PC_24 0x0000 /* 24 bits */
+#define PC_53 0x0200 /* 53 bits */
+#define PC_64 0x0300 /* 64 bits */
+
+
+/* initial Control Word value */
+
+#define CW_DEFAULT ( IC_AFFINE + RC_NEAR + PC_64 + EM_DENORMAL + EM_UNDERFLOW + EM_INEXACT )
+
+
+/* user Status Word bit definitions */
+
+#define SW_INVALID 0x0001 /* invalid */
+#define SW_DENORMAL 0x0002 /* denormal */
+#define SW_ZERODIVIDE 0x0004 /* zero divide */
+#define SW_OVERFLOW 0x0008 /* overflow */
+#define SW_UNDERFLOW 0x0010 /* underflow */
+#define SW_INEXACT 0x0020 /* inexact (precision) */
+
+
+/* invalid subconditions (SW_INVALID also set) */
+
+#define SW_UNEMULATED 0x0040 /* unemulated instruction */
+#define SW_SQRTNEG 0x0080 /* square root of a neg number */
+#define SW_STACKOVERFLOW 0x0200 /* FP stack overflow */
+#define SW_STACKUNDERFLOW 0x0400 /* FP stack underflow */
+
+
+/* Floating point error signals and return codes */
+
+#define FPE_INVALID 0x81
+#define FPE_DENORMAL 0x82
+#define FPE_ZERODIVIDE 0x83
+#define FPE_OVERFLOW 0x84
+#define FPE_UNDERFLOW 0x85
+#define FPE_INEXACT 0x86
+
+#define FPE_UNEMULATED 0x87
+#define FPE_SQRTNEG 0x88
+#define FPE_STACKOVERFLOW 0x8a
+#define FPE_STACKUNDERFLOW 0x8b
+
+#define FPE_EXPLICITGEN 0x8c /* raise( SIGFPE ); */
+
+/* function prototypes */
+
+unsigned int _CDECL _clear87(void);
+unsigned int _CDECL _control87(unsigned int,unsigned int);
+void _CDECL _fpreset(void);
+unsigned int _CDECL _status87(void);
diff --git a/private/mvdm/dos/v86/h/graph.h b/private/mvdm/dos/v86/h/graph.h
new file mode 100644
index 000000000..7b69c5152
--- /dev/null
+++ b/private/mvdm/dos/v86/h/graph.h
@@ -0,0 +1,216 @@
+/***
+*graph.h - declare constants and functions for graphics library
+*
+* Copyright (c) 1987-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file declares the graphics library functions and
+* the manifest constants that are used with them.
+*
+*******************************************************************************/
+
+/* user-visible declarations for Quick-C Graphics Library */
+
+#ifndef _GRAPH_T_DEFINED
+
+/* structure for _getvideoconfig() as visible to user */
+struct videoconfig {
+ short numxpixels; /* number of pixels on X axis */
+ short numypixels; /* number of pixels on Y axis */
+ short numtextcols; /* number of text columns available */
+ short numtextrows; /* number of text rows available */
+ short numcolors; /* number of actual colors */
+ short bitsperpixel; /* number of bits per pixel */
+ short numvideopages; /* number of available video pages */
+ short mode; /* current video mode */
+ short adapter; /* active display adapter */
+ short monitor; /* active display monitor */
+ short memory; /* adapter video memory in K bytes */
+};
+
+/* return value of _setlogorg(), etc. */
+struct xycoord {
+ short xcoord;
+ short ycoord;
+};
+
+/* structure for text position */
+struct rccoord {
+ short row;
+ short col;
+};
+
+#define _GRAPH_T_DEFINED
+
+#endif
+
+
+/* SETUP AND CONFIGURATION */
+
+short far cdecl _setvideomode(short);
+
+/* arguments to _setvideomode() */
+#define _DEFAULTMODE -1 /* restore screen to original mode */
+#define _TEXTBW40 0 /* 40 x 25 text, 16 grey */
+#define _TEXTC40 1 /* 40 x 25 text, 16/8 color */
+#define _TEXTBW80 2 /* 80 x 25 text, 16 grey */
+#define _TEXTC80 3 /* 80 x 25 text, 16/8 color */
+#define _MRES4COLOR 4 /* 320 x 200, 4 color */
+#define _MRESNOCOLOR 5 /* 320 x 200, 4 grey */
+#define _HRESBW 6 /* 640 x 200, BW */
+#define _TEXTMONO 7 /* 80 x 25 text, BW */
+#define _HERCMONO 8 /* 720 x 348, BW for HGC */
+#define _MRES16COLOR 13 /* 320 x 200, 16 color */
+#define _HRES16COLOR 14 /* 640 x 200, 16 color */
+#define _ERESNOCOLOR 15 /* 640 x 350, BW */
+#define _ERESCOLOR 16 /* 640 x 350, 4 or 16 color */
+#define _VRES2COLOR 17 /* 640 x 480, BW */
+#define _VRES16COLOR 18 /* 640 x 480, 16 color */
+#define _MRES256COLOR 19 /* 320 x 200, 256 color */
+
+short far cdecl _setactivepage(short);
+short far cdecl _setvisualpage(short);
+
+/* videoconfig adapter values */
+/* these manifest constants can be used to determine the type of monitor in */
+/* use, using either simple comparisons or the bitwise-AND operator (&) */
+#define _MDPA 0x0001 /* Monochrome Display Adapter (MDPA) */
+#define _CGA 0x0002 /* Color Graphics Adapter (CGA) */
+#define _EGA 0x0004 /* Enhanced Graphics Adapter (EGA) */
+#define _VGA 0x0008 /* Video Graphics Array (VGA) */
+#define _MCGA 0x0010 /* MultiColor Graphics Array (MCGA) */
+#define _HGC 0x0020 /* Hercules Graphics Card (HGC) */
+
+/* videoconfig monitor values */
+/* these manifest constants can be used to determine the type of the active */
+/* adapter, using either simple comparisons or the bitwise-AND operator (&) */
+#define _MONO 0x0001 /* Monochrome */
+#define _COLOR 0x0002 /* Color (or Enhanced emulating color) */
+#define _ENHCOLOR 0x0004 /* Enhanced Color */
+#define _ANALOG 0x0018 /* Analog */
+
+struct videoconfig far * far cdecl _getvideoconfig(struct videoconfig far *);
+
+
+/* COORDINATE SYSTEMS */
+
+struct xycoord far cdecl _setlogorg(short, short);
+struct xycoord far cdecl _getlogcoord(short, short);
+struct xycoord far cdecl _getphyscoord(short, short);
+
+void far cdecl _setcliprgn(short, short, short, short);
+void far cdecl _setviewport(short, short, short, short);
+
+
+/* OUTPUT ROUTINES */
+
+/* control parameters for Rectangle, Ellipse and Pie */
+#define _GBORDER 2 /* draw outline only */
+#define _GFILLINTERIOR 3 /* fill using current fill mask */
+
+#define _GCLEARSCREEN 0
+#define _GVIEWPORT 1
+#define _GWINDOW 2
+
+void far cdecl _clearscreen(short);
+
+struct xycoord far cdecl _moveto(short, short);
+struct xycoord far cdecl _getcurrentposition(void);
+
+short far cdecl _lineto(short, short);
+short far cdecl _rectangle(short, short, short, short, short);
+short far cdecl _ellipse(short, short, short, short, short);
+short far cdecl _arc(short, short, short, short, short, short, short, short);
+short far cdecl _pie(short, short, short, short, short, short, short, short, short);
+
+short far cdecl _setpixel(short, short);
+short far cdecl _getpixel(short, short);
+short far cdecl _floodfill(short, short, short);
+
+
+/* PEN COLOR, LINE STYLE, FILL PATTERN */
+
+short far cdecl _setcolor(short);
+short far cdecl _getcolor(void);
+
+void far cdecl _setlinestyle(unsigned short);
+unsigned short far cdecl _getlinestyle(void);
+
+void far cdecl _setfillmask(unsigned char far *);
+unsigned char far * far cdecl _getfillmask(unsigned char far *);
+
+/* COLOR SELECTION */
+
+long far cdecl _setbkcolor(long);
+long far cdecl _getbkcolor(void);
+
+long far cdecl _remappalette(short, long);
+short far cdecl _remapallpalette(long far *);
+short far cdecl _selectpalette(short);
+
+
+/* TEXT */
+#define _GCURSOROFF 0
+#define _GCURSORON 1
+
+#define _GWRAPOFF 0
+#define _GWRAPON 1
+
+void far cdecl _settextwindow(short, short, short, short);
+void far cdecl _outtext(char far *);
+short far cdecl _wrapon(short);
+short far cdecl _displaycursor(short);
+
+struct rccoord far cdecl _settextposition(short, short);
+struct rccoord far cdecl _gettextposition(void);
+
+short far cdecl _settextcolor(short);
+short far cdecl _gettextcolor(void);
+
+
+/* SCREEN IMAGES */
+
+void far cdecl _getimage(short, short, short, short, char far *);
+void far cdecl _putimage(short, short, char far *, short);
+long far cdecl _imagesize(short, short, short, short);
+
+/* "action verbs" for _putimage() */
+#define _GPSET 3
+#define _GPRESET 2
+#define _GAND 1
+#define _GOR 0
+#define _GXOR 4
+
+/* universal color values: */
+#define _BLACK 0x000000L
+#define _BLUE 0x2a0000L
+#define _GREEN 0x002a00L
+#define _CYAN 0x2a2a00L
+#define _RED 0x00002aL
+#define _MAGENTA 0x2a002aL
+#define _BROWN 0x00152aL
+#define _WHITE 0x2a2a2aL
+#define _GRAY 0x151515L
+#define _LIGHTBLUE 0x3F1515L
+#define _LIGHTGREEN 0x153f15L
+#define _LIGHTCYAN 0x3f3f15L
+#define _LIGHTRED 0x15153fL
+#define _LIGHTMAGENTA 0x3f153fL
+#define _LIGHTYELLOW 0x153f3fL
+#define _BRIGHTWHITE 0x3f3f3fL
+
+/* mono mode F color values: */
+#define _MODEFOFF 0L
+#define _MODEFOFFTOON 1L
+#define _MODEFOFFTOHI 2L
+#define _MODEFONTOOFF 3L
+#define _MODEFON 4L
+#define _MODEFONTOHI 5L
+#define _MODEFHITOOFF 6L
+#define _MODEFHITOON 7L
+#define _MODEFHI 8L
+
+/* mono mode 7 color values: */
+#define _MODE7OFF 0L
+#define _MODE7ON 1L
+#define _MODE7HI 2L
diff --git a/private/mvdm/dos/v86/h/io.h b/private/mvdm/dos/v86/h/io.h
new file mode 100644
index 000000000..7261295f0
--- /dev/null
+++ b/private/mvdm/dos/v86/h/io.h
@@ -0,0 +1,43 @@
+/***
+*io.h - declarations for low-level file handling and I/O functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the function declarations for the low-level
+* file handling and I/O functions.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+/* function prototypes */
+
+int _CDECL access(char *, int);
+int _CDECL chmod(char *, int);
+int _CDECL chsize(int, long);
+int _CDECL close(int);
+int _CDECL creat(char *, int);
+int _CDECL dup(int);
+int _CDECL dup2(int, int);
+int _CDECL eof(int);
+long _CDECL filelength(int);
+int _CDECL isatty(int);
+int _CDECL locking(int, int, long);
+long _CDECL lseek(int, long, int);
+char * _CDECL mktemp(char *);
+int _CDECL open(char *, int, ...);
+int _CDECL read(int, char *, unsigned int);
+int _CDECL remove(const char *);
+int _CDECL rename(const char *, const char *);
+int _CDECL setmode(int, int);
+int _CDECL sopen(char *, int, int, ...);
+long _CDECL tell(int);
+int _CDECL umask(int);
+int _CDECL unlink(const char *);
+int _CDECL write(int, char *, unsigned int);
diff --git a/private/mvdm/dos/v86/h/limits.h b/private/mvdm/dos/v86/h/limits.h
new file mode 100644
index 000000000..21e907fae
--- /dev/null
+++ b/private/mvdm/dos/v86/h/limits.h
@@ -0,0 +1,32 @@
+/***
+*limits.h - implementation dependent values
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* contains defines for a number of implementation dependent values
+* which are commonly used in C programs.
+* [ANSI]
+*
+*******************************************************************************/
+
+#ifndef _CHAR_UNSIGNED
+#define CHAR_MAX 127 /* maximum char value */
+#define CHAR_MIN -127 /* mimimum char value */
+#else
+#define CHAR_MAX 255
+#define CHAR_MIN 0
+#endif
+#define SCHAR_MAX 127 /* maximum signed char value */
+#define SCHAR_MIN -127 /* minimum signed char value */
+#define UCHAR_MAX 255 /* maximum unsigned char value */
+#define CHAR_BIT 8 /* number of bits in a char */
+#define USHRT_MAX 0xffff /* maximum unsigned short value */
+#define SHRT_MAX 32767 /* maximum (signed) short value */
+#define SHRT_MIN -32767 /* minimum (signed) short value */
+#define UINT_MAX 0xffff /* maximum unsigned int value */
+#define ULONG_MAX 0xffffffff /* maximum unsigned long value */
+#define INT_MAX 32767 /* maximum (signed) int value */
+#define INT_MIN -32767 /* minimum (signed) int value */
+#define LONG_MAX 2147483647 /* maximum (signed) long value */
+#define LONG_MIN -2147483647 /* minimum (signed) long value */
diff --git a/private/mvdm/dos/v86/h/malloc.h b/private/mvdm/dos/v86/h/malloc.h
new file mode 100644
index 000000000..e2aa979ff
--- /dev/null
+++ b/private/mvdm/dos/v86/h/malloc.h
@@ -0,0 +1,124 @@
+/***
+*malloc.h - declarations and definitions for memory allocation functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* Contains the function declarations for memory allocation functions;
+* also defines manifest constants and types used by the heap routines.
+* [System V]
+*
+*******************************************************************************/
+
+
+#define _HEAPEMPTY -1
+#define _HEAPOK -2
+#define _HEAPBADBEGIN -3
+#define _HEAPBADNODE -4
+#define _HEAPEND -5
+#define _HEAPBADPTR -6
+#define _FREEENTRY 0
+#define _USEDENTRY 1
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#if (!defined(NO_EXT_KEYS))
+
+#ifndef _HEAPINFO_DEFINED
+typedef struct _heapinfo {
+ int far * _pentry;
+ size_t _size;
+ int _useflag;
+ } _HEAPINFO;
+#define _HEAPINFO_DEFINED
+#endif
+
+#else /* NO_EXT_KEYS */
+#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
+
+#ifndef _HEAPINFO_DEFINED
+
+typedef struct _heapinfo {
+ int * _pentry;
+ size_t _size;
+ int _useflag;
+ } _HEAPINFO;
+
+#define _HEAPINFO_DEFINED
+#endif
+
+#endif /* M_I86CM || M_I86LM || M_I86HM */
+
+#endif /* NO_EXT_KEYS */
+
+
+#if (defined(M_I86SM) || defined(M_I86MM))
+#define _heapchk _nheapchk
+#define _heapset _nheapset
+#define _heapwalk _nheapwalk
+#endif
+#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
+#define _heapchk _fheapchk
+#define _heapset _fheapset
+#define _heapwalk _fheapwalk
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* external variable declarations */
+extern unsigned int _NEAR _CDECL _amblksiz;
+
+/* function prototypes */
+
+void * _CDECL alloca(size_t);
+void * _CDECL calloc(size_t, size_t);
+void * _CDECL _expand(void *, size_t);
+int _CDECL _fheapchk(void);
+int _CDECL _fheapset(unsigned int);
+unsigned int _CDECL _freect(size_t);
+void _CDECL free(void *);
+void * _CDECL malloc(size_t);
+size_t _CDECL _memavl(void);
+size_t _CDECL _memmax(void);
+size_t _CDECL _msize(void *);
+int _CDECL _nheapchk(void);
+int _CDECL _nheapset(unsigned int);
+void * _CDECL realloc(void *, size_t);
+void * _CDECL sbrk(int);
+size_t _CDECL stackavail(void);
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+
+void cdecl _ffree(void far *);
+void far * cdecl _fmalloc(size_t);
+size_t cdecl _fmsize(void far *);
+#ifndef _QC
+void huge * cdecl halloc(long, size_t);
+void cdecl hfree(void huge *);
+#endif
+void cdecl _nfree(void near *);
+void near * cdecl _nmalloc(size_t);
+size_t cdecl _nmsize(void near *);
+int cdecl _nheapwalk(struct _heapinfo *);
+int cdecl _fheapwalk(struct _heapinfo *);
+
+#else
+#if (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
+
+int _nheapwalk(struct _heapinfo *);
+int _fheapwalk(struct _heapinfo *);
+
+#endif /* M_I86CM || M_I86LM || M_I86HM */
+
+#endif /* NO_EXT_KEYS */
diff --git a/private/mvdm/dos/v86/h/math.h b/private/mvdm/dos/v86/h/math.h
new file mode 100644
index 000000000..9c0e701b8
--- /dev/null
+++ b/private/mvdm/dos/v86/h/math.h
@@ -0,0 +1,112 @@
+/***
+*math.h - definitions and declarations for math library
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains constant definitions and external subroutine
+* declarations for the math subroutine library.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+
+/* definition of exception struct - this struct is passed to the matherr
+ * routine when a floating point exception is detected
+ */
+
+#ifndef _EXCEPTION_DEFINED
+struct exception {
+ int type; /* exception type - see below */
+ char *name; /* name of function where error occured */
+ double arg1; /* first argument to function */
+ double arg2; /* second argument (if any) to function */
+ double retval; /* value to be returned by function */
+ } ;
+#define _EXCEPTION_DEFINED
+#endif
+
+
+/* definition of a complex struct to be used by those who use cabs and
+ * want type checking on their argument
+ */
+
+#ifndef _COMPLEX_DEFINED
+struct complex {
+ double x,y; /* real and imaginary parts */
+ } ;
+#define _COMPLEX_DEFINED
+#endif
+
+
+/* Constant definitions for the exception type passed in the exception struct
+ */
+
+#define DOMAIN 1 /* argument domain error */
+#define SING 2 /* argument singularity */
+#define OVERFLOW 3 /* overflow range error */
+#define UNDERFLOW 4 /* underflow range error */
+#define TLOSS 5 /* total loss of precision */
+#define PLOSS 6 /* partial loss of precision */
+
+#define EDOM 33
+#define ERANGE 34
+
+
+/* definitions of HUGE and HUGE_VAL - respectively the XENIX and ANSI names
+ * for a value returned in case of error by a number of the floating point
+ * math routines
+ */
+
+extern double HUGE;
+#define HUGE_VAL HUGE
+
+
+
+/* function prototypes */
+
+int _CDECL abs(int);
+double _CDECL acos(double);
+double _CDECL asin(double);
+double _CDECL atan(double);
+double _CDECL atan2(double, double);
+double _CDECL atof(const char *);
+double _CDECL cabs(struct complex);
+double _CDECL ceil(double);
+double _CDECL cos(double);
+double _CDECL cosh(double);
+int _CDECL dieeetomsbin(double *, double *);
+int _CDECL dmsbintoieee(double *, double *);
+double _CDECL exp(double);
+double _CDECL fabs(double);
+int _CDECL fieeetomsbin(float *, float *);
+double _CDECL floor(double);
+double _CDECL fmod(double, double);
+int _CDECL fmsbintoieee(float *, float *);
+double _CDECL frexp(double, int *);
+double _CDECL hypot(double, double);
+double _CDECL j0(double);
+double _CDECL j1(double);
+double _CDECL jn(int, double);
+long _CDECL labs(long);
+double _CDECL ldexp(double, int);
+double _CDECL log(double);
+double _CDECL log10(double);
+int _CDECL matherr(struct exception *);
+double _CDECL modf(double, double *);
+double _CDECL pow(double, double);
+double _CDECL sin(double);
+double _CDECL sinh(double);
+double _CDECL sqrt(double);
+double _CDECL tan(double);
+double _CDECL tanh(double);
+double _CDECL y0(double);
+double _CDECL y1(double);
+double _CDECL yn(int, double);
diff --git a/private/mvdm/dos/v86/h/memory.h b/private/mvdm/dos/v86/h/memory.h
new file mode 100644
index 000000000..519b71d12
--- /dev/null
+++ b/private/mvdm/dos/v86/h/memory.h
@@ -0,0 +1,34 @@
+/***
+*memory.h - declarations for buffer (memory) manipulation routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for the
+* buffer (memory) manipulation routines.
+* [System V]
+*
+*******************************************************************************/
+
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+
+/* function prototypes */
+
+void * _CDECL memccpy(void *, void *, int, unsigned int);
+void * _CDECL memchr(const void *, int, size_t);
+int _CDECL memcmp(const void *, const void *, size_t);
+void * _CDECL memcpy(void *, const void *, size_t);
+int _CDECL memicmp(void *, void *, unsigned int);
+void * _CDECL memset(void *, int, size_t);
+void _CDECL movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
diff --git a/private/mvdm/dos/v86/h/mixed.inc b/private/mvdm/dos/v86/h/mixed.inc
new file mode 100644
index 000000000..cbfff2a4e
--- /dev/null
+++ b/private/mvdm/dos/v86/h/mixed.inc
@@ -0,0 +1,167 @@
+; High-Level-Language Interface Macros - Version 2.0
+; for Microsoft Macro Assembler 5.10
+; (C) Copyright Microsoft Corporation, 1987.
+
+; Syntax Purpose
+; ------ -------
+;
+; setModel Sets model from text equate
+;
+; hProc <name [NEAR|FAR]> [,<USES reglist>] [,arg[:type] [,arg[:type]]]...
+; Starts a procedure with optional stack arguments
+;
+; hLocal var[:type] [,var[:type]]...
+; Defines local stack variables
+;
+; hRet Returns from the current procedure
+;
+; hEndp Ends the current procedure
+;
+; ifFP statement Assembles statement if far data
+;
+; FPoperand Conditionally provides ES override for data
+;
+; pLes register,address Conditionally loads data through ES
+;
+; pLds register,address Conditionally loads data through DS
+
+;if1
+
+; Translate command-line arguments
+
+
+; Initialize procName
+
+ procName equ <foo>
+
+; Set model passed from command line
+
+setModel macro mod
+
+ ifdef cLang
+ .model mod, C
+ lang EQU <C>
+ elseifdef BASIC
+ .model mod, Basic
+ elseifdef FORTRAN
+ .model mod, FORTRAN
+ elseifdef Pascal
+ .model mod, Pascal
+ endif
+
+; FP - supply far pointer ES overide as needed - must be inside for setModel
+
+ if @DataSize
+ FP equ <es:>
+ else
+ FP equ <>
+ endif
+
+endm
+
+; FP - supply far pointer ES overide as needed - must be outside for .MODEL
+
+ifdef @DataSize
+ if @DataSize
+ FP equ <es:>
+ else
+ FP equ <>
+ endif
+endif
+
+; Declare high level routine and parameters
+
+hProc macro funName, a,b,c,d,e,f,g,h,i,j
+; LOCAL argstr
+
+ ii instr <funName>,< >
+ if ii
+ procName subStr <funName>,1,ii
+ nearFar subStr <funName>,ii
+ else
+ procName equ <funName>
+ nearFar equ <>
+ endif
+
+ argstr equ <a>
+ irp arg,<b,c,d,e,f,g,h,i,j>
+ ifnb <arg>
+ argstr catstr argstr,<, arg>
+ else
+ exitm
+ endif
+ endm
+defineProc %nearFar, %argstr
+endm
+
+defineProc Macro size,args
+procName proc size args
+endm
+
+; Declare local stack variables
+
+hLocal macro a,b,c,d,e,f,g,h,i,j
+; LOCAL argstr
+ argstr EQU <a>
+ irp arg,<b,c,d,e,f,g,h,i,j>
+ ifnb <arg>
+ argstr catstr argstr,<, arg>
+ else
+ exitm
+ endif
+ endm
+defineLocal %argstr
+endm
+
+defineLocal macro args
+ &local args
+endm
+
+; Generate high level return
+
+hRet macro
+ ret
+endm
+
+; End a high level procedure
+
+hEndp macro
+ procName endp
+endm
+
+; Execute instruction if far data
+
+ifFP macro a,b,c,d,e,f,g,h,i,j
+
+ if @DataSize
+ a b c d e f g h i j
+ endif
+endm
+
+; Load 16/32 bit pointers into [ES:] reg
+
+pLes macro reg, address
+
+ if @DataSize
+
+ les reg,address
+ else
+ mov reg,address
+
+ endif
+endm
+
+;Load 16/32 bit pointers into [DS:] reg
+
+pLds macro reg, address
+
+ if @DataSize
+
+ lds reg,address
+ else
+ mov reg,address
+
+ endif
+endm
+
+;endif ; Pass 1 only
diff --git a/private/mvdm/dos/v86/h/process.h b/private/mvdm/dos/v86/h/process.h
new file mode 100644
index 000000000..f0c85f304
--- /dev/null
+++ b/private/mvdm/dos/v86/h/process.h
@@ -0,0 +1,65 @@
+/***
+*process.h - definition and declarations for process control functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the modeflag values for spawnxx calls. Only
+* P_WAIT and P_OVERLAY are currently implemented on DOS 2 & 3.
+* P_NOWAIT is also enabled on DOS 4. Also contains the function
+* argument declarations for all process control related routines.
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* modeflag values for spawnxx routines */
+
+extern int _NEAR _CDECL _p_overlay;
+
+#define P_WAIT 0
+#define P_NOWAIT 1
+#define P_OVERLAY _p_overlay
+#define OLD_P_OVERLAY 2
+#define P_NOWAITO 3
+
+
+/* Action Codes used with Cwait() */
+
+#define WAIT_CHILD 0
+#define WAIT_GRANDCHILD 1
+
+
+/* function prototypes */
+
+void _CDECL abort(void);
+int _CDECL cwait(int *, int, int);
+int _CDECL execl(char *, char *, ...);
+int _CDECL execle(char *, char *, ...);
+int _CDECL execlp(char *, char *, ...);
+int _CDECL execlpe(char *, char *, ...);
+int _CDECL execv(char *, char * *);
+int _CDECL execve(char *, char * *, char * *);
+int _CDECL execvp(char *, char * *);
+int _CDECL execvpe(char *, char * *, char * *);
+void _CDECL exit(int);
+void _CDECL _exit(int);
+int _CDECL getpid(void);
+int _CDECL spawnl(int, char *, char *, ...);
+int _CDECL spawnle(int, char *, char *, ...);
+int _CDECL spawnlp(int, char *, char *, ...);
+int _CDECL spawnlpe(int, char *, char *, ...);
+int _CDECL spawnv(int, char *, char * *);
+int _CDECL spawnve(int, char *, char * *, char * *);
+int _CDECL spawnvp(int, char *, char * *);
+int _CDECL spawnvpe(int, char *, char * *, char * *);
+int _CDECL system(const char *);
+int _CDECL wait(int *);
diff --git a/private/mvdm/dos/v86/h/search.h b/private/mvdm/dos/v86/h/search.h
new file mode 100644
index 000000000..88ea97607
--- /dev/null
+++ b/private/mvdm/dos/v86/h/search.h
@@ -0,0 +1,31 @@
+/***
+*search.h - declarations for searcing/sorting routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the declarations for the sorting and
+* searching routines.
+* [System V]
+*
+*******************************************************************************/
+
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+
+/* function prototypes */
+
+char * _CDECL lsearch(char *, char *, unsigned int *, unsigned int, int (_CDECL *)(void *, void *));
+char * _CDECL lfind(char *, char *, unsigned int *, unsigned int, int (_CDECL *)(void *, void *));
+void * _CDECL bsearch(const void *, const void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
+void _CDECL qsort(void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
diff --git a/private/mvdm/dos/v86/h/setjmp.h b/private/mvdm/dos/v86/h/setjmp.h
new file mode 100644
index 000000000..6f747935c
--- /dev/null
+++ b/private/mvdm/dos/v86/h/setjmp.h
@@ -0,0 +1,35 @@
+/***
+*setjmp.h - definitions/declarations for setjmp/longjmp routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the machine-dependent buffer used by
+* setjmp/longjmp to save and restore the program state, and
+* declarations for those routines.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+
+/* define the buffer type for holding the state information */
+
+#define _JBLEN 9 /* bp, di, si, sp, ret addr, ds */
+
+#ifndef _JMP_BUF_DEFINED
+typedef int jmp_buf[_JBLEN];
+#define _JMP_BUF_DEFINED
+#endif
+
+
+/* function prototypes */
+
+int _CDECL setjmp(jmp_buf);
+void _CDECL longjmp(jmp_buf, int);
diff --git a/private/mvdm/dos/v86/h/share.h b/private/mvdm/dos/v86/h/share.h
new file mode 100644
index 000000000..2a34f71ec
--- /dev/null
+++ b/private/mvdm/dos/v86/h/share.h
@@ -0,0 +1,15 @@
+/***
+*share.h - defines file sharing modes for sopen
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the file sharing modes for sopen().
+*
+*******************************************************************************/
+
+#define SH_COMPAT 0x00 /* compatibility mode */
+#define SH_DENYRW 0x10 /* deny read/write mode */
+#define SH_DENYWR 0x20 /* deny write mode */
+#define SH_DENYRD 0x30 /* deny read mode */
+#define SH_DENYNO 0x40 /* deny none mode */
diff --git a/private/mvdm/dos/v86/h/signal.h b/private/mvdm/dos/v86/h/signal.h
new file mode 100644
index 000000000..18b8f1035
--- /dev/null
+++ b/private/mvdm/dos/v86/h/signal.h
@@ -0,0 +1,59 @@
+/***
+*signal.h - defines signal values and routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the signal values and declares the signal functions.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+#ifndef _SIG_ATOMIC_T_DEFINED
+typedef int sig_atomic_t;
+#define _SIG_ATOMIC_T_DEFINED
+#endif
+
+
+#define NSIG 23 /* maximum signal number + 1 */
+
+/* signal types */
+/* SIGINT, SIGFPE, SIGILL, SIGSEGV, and SIGABRT are recognized on DOS 3.x */
+
+#define SIGINT 2 /* interrupt - corresponds to DOS 3.x int 23H */
+#define SIGILL 4 /* illegal instruction - invalid function image */
+#define SIGFPE 8 /* floating point exception */
+#define SIGSEGV 11 /* segment violation */
+#define SIGTERM 15 /* Software termination signal from kill */
+#define SIGUSR1 16 /* User defined signal 1 */
+#define SIGUSR2 17 /* User defined signal 2 */
+#define SIGUSR3 20 /* User defined signal 3 */
+#define SIGBREAK 21 /* Ctrl-Break sequence */
+#define SIGABRT 22 /* abnormal termination triggered by abort call */
+
+
+/* signal action codes */
+/* SIG_DFL and SIG_IGN are recognized on DOS 3.x */
+
+#define SIG_DFL (void (*)())0 /* default signal action */
+#define SIG_IGN (void (*)())1 /* ignore */
+#define SIG_SGE (void (*)())3 /* signal gets error */
+#define SIG_ACK (void (*)())4 /* error if handler not setup */
+
+
+/* signal error value (returned by signal call on error) */
+
+#define SIG_ERR (void (*)())-1 /* signal error value */
+
+
+/* function prototypes */
+
+void (_CDECL * _CDECL signal(int, void (_CDECL *)()))();
+int _CDECL raise(int);
diff --git a/private/mvdm/dos/v86/h/stdarg.h b/private/mvdm/dos/v86/h/stdarg.h
new file mode 100644
index 000000000..d261cfa4a
--- /dev/null
+++ b/private/mvdm/dos/v86/h/stdarg.h
@@ -0,0 +1,20 @@
+/***
+*stdarg.h - defines ANSI-style macros for variable argument functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines ANSI-style macros for accessing arguments
+* of functions which take a variable number of arguments.
+* [ANSI]
+*
+*******************************************************************************/
+
+#ifndef _VA_LIST_DEFINED
+typedef char *va_list;
+#define _VA_LIST_DEFINED
+#endif
+
+#define va_start(ap,v) ap = (va_list)&v + sizeof(v)
+#define va_arg(ap,t) ((t *)(ap += sizeof(t)))[-1]
+#define va_end(ap) ap = NULL
diff --git a/private/mvdm/dos/v86/h/stddef.h b/private/mvdm/dos/v86/h/stddef.h
new file mode 100644
index 000000000..b9637b056
--- /dev/null
+++ b/private/mvdm/dos/v86/h/stddef.h
@@ -0,0 +1,48 @@
+/***
+*stddef.h - definitions/declarations for common constants, types, variables
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains definitions and declarations for some commonly
+* used constants, types, and variables.
+* [ANSI]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* define NULL pointer value */
+
+#if (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#elif (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
+#define NULL 0L
+#endif
+
+
+/* declare reference to errno */
+
+extern int _NEAR _CDECL errno;
+
+
+/* define the implementation dependent size types */
+
+#ifndef _PTRDIFF_T_DEFINED
+typedef int ptrdiff_t;
+#define _PTRDIFF_T_DEFINED
+#endif
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
diff --git a/private/mvdm/dos/v86/h/stdio.h b/private/mvdm/dos/v86/h/stdio.h
new file mode 100644
index 000000000..0c7f7b3a5
--- /dev/null
+++ b/private/mvdm/dos/v86/h/stdio.h
@@ -0,0 +1,165 @@
+/***
+*stdio.h - definitions/declarations for standard I/O routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines the structures, values, macros, and functions
+* used by the level 2 I/O ("standard I/O") routines.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef _VA_LIST_DEFINED
+typedef char *va_list;
+#define _VA_LIST_DEFINED
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* buffered I/O macros */
+
+#define BUFSIZ 512
+#define _NFILE 20
+#define EOF (-1)
+
+#ifndef _FILE_DEFINED
+#define FILE struct _iobuf
+#define _FILE_DEFINED
+#endif
+
+/* P_tmpnam: Directory where temporary files may be created.
+ * L_tmpnam size = size of P_tmpdir
+ * + 1 (in case P_tmpdir does not end in "\\")
+ * + 6 (for the temp number string)
+ * + 1 (for the null terminator)
+ */
+
+#define P_tmpdir "\\"
+#define L_tmpnam sizeof(P_tmpdir)+8
+
+#define SEEK_CUR 1
+#define SEEK_END 2
+#define SEEK_SET 0
+
+#define SYS_OPEN 20
+#define TMP_MAX 32767
+
+
+/* define NULL pointer value */
+
+#if (defined(M_I86SM) || defined(M_I86MM))
+#define NULL 0
+#elif (defined(M_I86CM) || defined(M_I86LM) || defined(M_I86HM))
+#define NULL 0L
+#endif
+
+
+/* define file control block */
+
+#ifndef _IOB_DEFINED
+extern FILE {
+ char *_ptr;
+ int _cnt;
+ char *_base;
+ char _flag;
+ char _file;
+ } _NEAR _CDECL _iob[];
+#define _IOB_DEFINED
+#endif
+
+#define fpos_t long /* file position variable */
+
+#define stdin (&_iob[0])
+#define stdout (&_iob[1])
+#define stderr (&_iob[2])
+#define stdaux (&_iob[3])
+#define stdprn (&_iob[4])
+
+#define _IOREAD 0x01
+#define _IOWRT 0x02
+
+#define _IOFBF 0x0
+#define _IOLBF 0x40
+#define _IONBF 0x04
+
+#define _IOMYBUF 0x08
+#define _IOEOF 0x10
+#define _IOERR 0x20
+#define _IOSTRG 0x40
+#define _IORW 0x80
+
+#define getc(f) (--(f)->_cnt >= 0 ? 0xff & *(f)->_ptr++ : _filbuf(f))
+#define putc(c,f) (--(f)->_cnt >= 0 ? 0xff & (*(f)->_ptr++ = (char)(c)) \
+ : _flsbuf((c),(f)))
+#define getchar() getc(stdin)
+#define putchar(c) putc((c),stdout)
+
+#define feof(f) ((f)->_flag & _IOEOF)
+#define ferror(f) ((f)->_flag & _IOERR)
+#define fileno(f) ((f)->_file)
+
+
+/* function prototypes */
+
+int _CDECL _filbuf(FILE *);
+int _CDECL _flsbuf(int, FILE *);
+void _CDECL clearerr(FILE *);
+int _CDECL fclose(FILE *);
+int _CDECL fcloseall(void);
+FILE * _CDECL fdopen(int, char *);
+int _CDECL fflush(FILE *);
+int _CDECL fgetc(FILE *);
+int _CDECL fgetchar(void);
+int _CDECL fgetpos(FILE *, fpos_t *);
+char * _CDECL fgets(char *, int, FILE *);
+int _CDECL flushall(void);
+FILE * _CDECL fopen(const char *, const char *);
+int _CDECL fprintf(FILE *, const char *, ...);
+int _CDECL fputc(int, FILE *);
+int _CDECL fputchar(int);
+int _CDECL fputs(const char *, FILE *);
+size_t _CDECL fread(void *, size_t, size_t, FILE *);
+FILE * _CDECL freopen(const char *, const char *, FILE *);
+int _CDECL fscanf(FILE *, const char *, ...);
+int _CDECL fsetpos(FILE *, const fpos_t *);
+int _CDECL fseek(FILE *, long, int);
+long _CDECL ftell(FILE *);
+size_t _CDECL fwrite(const void *, size_t, size_t, FILE *);
+char * _CDECL gets(char *);
+int _CDECL getw(FILE *);
+void _CDECL perror(const char *);
+int _CDECL printf(const char *, ...);
+int _CDECL puts(const char *);
+int _CDECL putw(int, FILE *);
+int _CDECL remove(const char *);
+int _CDECL rename(const char *, const char *);
+void _CDECL rewind(FILE *);
+int _CDECL rmtmp(void);
+int _CDECL scanf(const char *, ...);
+void _CDECL setbuf(FILE *, char *);
+int _CDECL setvbuf(FILE *, char *, int, size_t);
+int _CDECL sprintf(char *, const char *, ...);
+int _CDECL sscanf(const char *, const char *, ...);
+char * _CDECL tempnam(char *, char *);
+FILE * _CDECL tmpfile(void);
+char * _CDECL tmpnam(char *);
+int _CDECL ungetc(int, FILE *);
+int _CDECL unlink(const char *);
+int _CDECL vfprintf(FILE *, const char *, va_list);
+int _CDECL vprintf(const char *, va_list);
+int _CDECL vsprintf(char *, const char *, va_list);
+
diff --git a/private/mvdm/dos/v86/h/stdlib.h b/private/mvdm/dos/v86/h/stdlib.h
new file mode 100644
index 000000000..5fb67d7b5
--- /dev/null
+++ b/private/mvdm/dos/v86/h/stdlib.h
@@ -0,0 +1,151 @@
+/***
+*stdlib.h - declarations/definitions for commonly used library functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This include file contains the function declarations for
+* commonly used library functions which either don't fit somewhere
+* else, or, like toupper/tolower, can't be declared in the normal
+* place (ctype.h in the case of toupper/tolower) for other reasons.
+* [ANSI]
+*
+*******************************************************************************/
+
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* definition of the return type for the onexit() function */
+
+#ifndef _ONEXIT_T_DEFINED
+typedef int (_CDECL * _CDECL onexit_t)();
+#define _ONEXIT_T_DEFINED
+#endif
+
+
+/* Data structure definitions for div and ldiv runtimes. */
+
+#ifndef _DIV_T_DEFINED
+
+typedef struct {
+ int quot;
+ int rem;
+} div_t;
+
+typedef struct {
+ long quot;
+ long rem;
+} ldiv_t;
+
+#define _DIV_T_DEFINED
+#endif
+
+/* Maximum value that can be returned by the rand function. */
+
+#define RAND_MAX 0x7fff
+
+
+/* min and max macros */
+
+#define max(a,b) (((a) > (b)) ? (a) : (b))
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+
+
+/* sizes for buffers used by the _makepath() and _splitpath() functions.
+ * note that the sizes include space for 0-terminator
+ */
+
+#define _MAX_PATH 144 /* max. length of full pathname */
+#define _MAX_DRIVE 3 /* max. length of drive component */
+#define _MAX_DIR 130 /* max. length of path component */
+#define _MAX_FNAME 9 /* max. length of file name component */
+#define _MAX_EXT 5 /* max. length of extension component */
+
+/* external variable declarations */
+
+extern int _NEAR _CDECL errno; /* XENIX style error number */
+extern int _NEAR _CDECL _doserrno; /* MS-DOS system error value */
+extern char * _NEAR _CDECL sys_errlist[]; /* perror error message table */
+extern int _NEAR _CDECL sys_nerr; /* # of entries in sys_errlist table */
+
+extern char ** _NEAR _CDECL environ; /* pointer to environment table */
+
+extern unsigned int _NEAR _CDECL _psp; /* Program Segment Prefix */
+
+extern int _NEAR _CDECL _fmode; /* default file translation mode */
+
+/* DOS major/minor version numbers */
+
+extern unsigned char _NEAR _CDECL _osmajor;
+extern unsigned char _NEAR _CDECL _osminor;
+
+#define DOS_MODE 0 /* Real Address Mode */
+#define OS2_MODE 1 /* Protected Address Mode */
+
+extern unsigned char _NEAR _CDECL _osmode;
+
+
+/* function prototypes */
+
+double _CDECL atof(const char *);
+double _CDECL strtod(const char *, char * *);
+ldiv_t _CDECL ldiv(long, long);
+
+void _CDECL abort(void);
+int _CDECL abs(int);
+int _CDECL atexit(void (_CDECL *)(void));
+int _CDECL atoi(const char *);
+long _CDECL atol(const char *);
+void * _CDECL bsearch(const void *, const void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
+void * _CDECL calloc(size_t, size_t);
+div_t _CDECL div(int, int);
+char * _CDECL ecvt(double, int, int *, int *);
+void _CDECL exit(int);
+void _CDECL _exit(int);
+char * _CDECL fcvt(double, int, int *, int *);
+void _CDECL free(void *);
+char * _CDECL gcvt(double, int, char *);
+char * _CDECL getenv(const char *);
+char * _CDECL itoa(int, char *, int);
+long _CDECL labs(long);
+unsigned long _CDECL _lrotl(unsigned long, int);
+unsigned long _CDECL _lrotr(unsigned long, int);
+char * _CDECL ltoa(long, char *, int);
+void _CDECL _makepath(char *, char *, char *, char *, char *);
+void * _CDECL malloc(size_t);
+onexit_t _CDECL onexit(onexit_t);
+void _CDECL perror(const char *);
+int _CDECL putenv(char *);
+void _CDECL qsort(void *, size_t, size_t, int (_CDECL *)(const void *, const void *));
+unsigned int _CDECL _rotl(unsigned int, int);
+unsigned int _CDECL _rotr(unsigned int, int);
+int _CDECL rand(void);
+void * _CDECL realloc(void *, size_t);
+void _CDECL _searchenv(char *, char *, char *);
+void _CDECL _splitpath(char *, char *, char *, char *, char *);
+void _CDECL srand(unsigned int);
+long _CDECL strtol(const char *, char * *, int);
+unsigned long _CDECL strtoul(const char *, char * *, int);
+void _CDECL swab(char *, char *, int);
+int _CDECL system(const char *);
+char * _CDECL ultoa(unsigned long, char *, int);
+
+#ifndef tolower /* tolower has been undefined - use function */
+int _CDECL tolower(int);
+#endif /* tolower */
+
+#ifndef toupper /* toupper has been undefined - use function */
+int _CDECL toupper(int);
+#endif /* toupper */
diff --git a/private/mvdm/dos/v86/h/string.h b/private/mvdm/dos/v86/h/string.h
new file mode 100644
index 000000000..834068822
--- /dev/null
+++ b/private/mvdm/dos/v86/h/string.h
@@ -0,0 +1,61 @@
+/***
+*string.h - declarations for string manipulation functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file contains the function declarations for the string
+* manipulation functions.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef _SIZE_T_DEFINED
+typedef unsigned int size_t;
+#define _SIZE_T_DEFINED
+#endif
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+#else /* extensions not enabled */
+ #define _CDECL
+#endif /* NO_EXT_KEYS */
+
+
+/* function prototypes */
+
+void * _CDECL memccpy(void *, void *, int, unsigned int);
+void * _CDECL memchr(const void *, int, size_t);
+int _CDECL memcmp(const void *, const void *, size_t);
+int _CDECL memicmp(void *, void *, unsigned int);
+void * _CDECL memcpy(void *, const void *, size_t);
+void * _CDECL memmove(void *, const void *, size_t);
+void * _CDECL memset(void *, int, size_t);
+void _CDECL movedata(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int);
+
+char * _CDECL strcat(char *, const char *);
+char * _CDECL strchr(const char *, int);
+int _CDECL strcmp(const char *, const char *);
+int _CDECL strcmpi(const char *, const char *);
+int _CDECL stricmp(const char *, const char *);
+char * _CDECL strcpy(char *, const char *);
+size_t _CDECL strcspn(const char *, const char *);
+char * _CDECL strdup(const char *);
+char * _CDECL _strerror(char *);
+char * _CDECL strerror(int);
+size_t _CDECL strlen(const char *);
+char * _CDECL strlwr(char *);
+char * _CDECL strncat(char *, const char *, size_t);
+int _CDECL strncmp(const char *, const char *, size_t);
+int _CDECL strnicmp(const char *, const char *, size_t);
+char * _CDECL strncpy(char *, const char *, size_t);
+char * _CDECL strnset(char *, int, size_t);
+char * _CDECL strpbrk(const char *, const char *);
+char * _CDECL strrchr(const char *, int);
+char * _CDECL strrev(char *);
+char * _CDECL strset(char *, int);
+size_t _CDECL strspn(const char *, const char *);
+char * _CDECL strstr(const char *, const char *);
+char * _CDECL strtok(char *, const char *);
+char * _CDECL strupr(char *);
diff --git a/private/mvdm/dos/v86/h/time.h b/private/mvdm/dos/v86/h/time.h
new file mode 100644
index 000000000..d9a1681d0
--- /dev/null
+++ b/private/mvdm/dos/v86/h/time.h
@@ -0,0 +1,75 @@
+/***
+*time.h - definitions/declarations for time routines
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file has declarations of time routines and defines
+* the structure returned by the localtime and gmtime routines and
+* used by asctime.
+* [ANSI/System V]
+*
+*******************************************************************************/
+
+
+#ifndef NO_EXT_KEYS /* extensions enabled */
+ #define _CDECL cdecl
+ #define _NEAR near
+#else /* extensions not enabled */
+ #define _CDECL
+ #define _NEAR
+#endif /* NO_EXT_KEYS */
+
+
+/* define the implementation defined time type */
+
+#ifndef _TIME_T_DEFINED
+typedef long time_t; /* time value */
+#define _TIME_T_DEFINED /* avoid multiple def's of time_t */
+#endif
+
+#ifndef _CLOCK_T_DEFINED
+typedef long clock_t;
+#define _CLOCK_T_DEFINED
+#endif
+
+#ifndef _TM_DEFINED
+struct tm {
+ int tm_sec; /* seconds after the minute - [0,59] */
+ int tm_min; /* minutes after the hour - [0,59] */
+ int tm_hour; /* hours since midnight - [0,23] */
+ int tm_mday; /* day of the month - [1,31] */
+ int tm_mon; /* months since January - [0,11] */
+ int tm_year; /* years since 1900 */
+ int tm_wday; /* days since Sunday - [0,6] */
+ int tm_yday; /* days since January 1 - [0,365] */
+ int tm_isdst; /* daylight savings time flag */
+ };
+#define _TM_DEFINED
+#endif
+
+#define CLK_TCK 1000
+
+
+/* extern declarations for the global variables used by the ctime family of
+ * routines.
+ */
+
+extern int _NEAR _CDECL daylight; /* non-zero if daylight savings time is used */
+extern long _NEAR _CDECL timezone; /* difference in seconds between GMT and local time */
+extern char * _NEAR _CDECL tzname[2]; /* standard/daylight savings time zone names */
+
+
+/* function prototypes */
+
+char * _CDECL asctime(const struct tm *);
+char * _CDECL ctime(const time_t *);
+clock_t _CDECL clock(void);
+double _CDECL difftime(time_t, time_t);
+struct tm * _CDECL gmtime(const time_t *);
+struct tm * _CDECL localtime(const time_t *);
+time_t _CDECL mktime(struct tm *);
+char * _CDECL _strdate(char *);
+char * _CDECL _strtime(char *);
+time_t _CDECL time(time_t *);
+void _CDECL tzset(void);
diff --git a/private/mvdm/dos/v86/h/varargs.h b/private/mvdm/dos/v86/h/varargs.h
new file mode 100644
index 000000000..e96d04e58
--- /dev/null
+++ b/private/mvdm/dos/v86/h/varargs.h
@@ -0,0 +1,21 @@
+/***
+*varargs.h - XENIX style macros for variable argument functions
+*
+* Copyright (c) 1985-1988, Microsoft Corporation. All rights reserved.
+*
+*Purpose:
+* This file defines XENIX style macros for accessing arguments of a
+* function which takes a variable number of arguments.
+* [System V]
+*
+*******************************************************************************/
+
+#ifndef _VA_LIST_DEFINED
+typedef char *va_list;
+#define _VA_LIST_DEFINED
+#endif
+
+#define va_dcl va_list va_alist;
+#define va_start(ap) ap = (va_list)&va_alist
+#define va_arg(ap,t) ((t *)(ap += sizeof(t)))[-1]
+#define va_end(ap) ap = NULL
diff --git a/private/mvdm/dos/v86/h/version.h b/private/mvdm/dos/v86/h/version.h
new file mode 100644
index 000000000..a2fa4655a
--- /dev/null
+++ b/private/mvdm/dos/v86/h/version.h
@@ -0,0 +1,116 @@
+/*
+ * Microsoft Confidential
+ * Copyright (C) Microsoft Corporation 1991
+ * All Rights Reserved.
+ */
+
+/* --------------------------------------------------------------------------
+ * Use the switch below to produce the standard Microsoft version *
+ * or the IBM version of the operating system *
+ * *
+ * *
+ * Use the switches below to produce the standard Microsoft version *
+ * or the IBMversion of the operating system *
+ * *
+ * The below chart will indicate how to set the switches to build *
+ * the various versions *
+ * *
+ * IBMVER IBMCOPYRIGHT *
+ * -------------------------------------------------------- *
+ * IBM Version | TRUE TRUE *
+ * -------------------------------------------------------- *
+ * MS Version | FALSE FALSE *
+ * -------------------------------------------------------- *
+ * Clone Version | TRUE FALSE *
+ -------------------------------------------------------------------------- */
+
+#define IBMVER 1
+#define IBMCOPYRIGHT 0
+
+#ifndef MSVER
+#define MSVER 1-IBMVER /* MSVER = NOT IBMVER */
+#endif
+#define IBM IBMVER
+
+/*
+*****************************************************************************
+
+ <<< Followings are the DBCS relating Definition >>>
+
+
+ To build DBCS version, Define DBCS by using CL option via
+ Dos environment.
+
+ ex. set CL=-DDBCS
+
+
+
+ To build Country depend version, Define JAPAN, KOREA or TAIWAN
+ by using CL option via Dos environment.
+
+ ex. set CL=-DJAPAN
+ set CL=-DKOREA
+ set CL=-DTAIWAN
+
+*****************************************************************************
+*/
+
+#define BUGFIX 1
+
+
+/* #define IBMJAPVER 0 */ /* If TRUE define DBCS also */
+#define IBMJAPAN 0
+
+
+
+/* -------------------- Set DBCS Blank constant ------------------- */
+
+#ifndef DBCS
+#define DB_SPACE 0x2020
+#define DB_SP_HI 0x20
+#define DB_SP_LO 0x20
+#else
+ #ifdef JAPAN
+ #define DB_SPACE 0x8140
+ #define DB_SP_HI 0x81
+ #define DB_SP_LO 0x40
+ #endif
+
+ #ifdef TAIWAN
+ #define DB_SPACE 0x8130
+ #define DB_SP_HI 0x81
+ #define DB_SP_LO 0x30
+ #endif
+
+ #ifdef KOREA
+ #define DB_SPACE 0xA1A1
+ #define DB_SP_HI 0xA1
+ #define DB_SP_LO 0xA1
+ #endif
+#endif
+
+#ifndef altvect /* avoid jerking off vector.inc */
+#define ALTVECT 0 /* Switch to build ALTVECT version */
+#endif
+
+
+#if BUGFIX
+#pragma message( "BUGFIX switch ON" )
+#endif
+
+#ifdef DBCS
+#pragma message( "DBCS version build switch ON" )
+
+ #ifdef JAPAN
+ #pragma message( "JAPAN version build switch ON" )
+ #endif
+
+ #ifdef TAIWAN
+ #pragma message( "TAIWAN version build switch ON" )
+ #endif
+
+ #ifdef KOREA
+ #pragma message( "KOREA version build switch ON" )
+ #endif
+#endif
+
diff --git a/private/mvdm/dos/v86/h/versionc.h b/private/mvdm/dos/v86/h/versionc.h
new file mode 100644
index 000000000..d0b9d40d3
--- /dev/null
+++ b/private/mvdm/dos/v86/h/versionc.h
@@ -0,0 +1,24 @@
+/*
+ * Microsoft Confidential
+ * Copyright (C) Microsoft Corporation 1991
+ * All Rights Reserved.
+ */
+
+
+#define EXPECTED_VERSION_MAJOR 5 /* DOS Major Version 4 */
+#define EXPECTED_VERSION_MINOR 00 /* DOS Minor Version 00 */
+
+ /********************************************/
+ /*Each C program should: */
+ /* */
+ /* if ((EXPECTED_VERSION_MAJOR != _osmajor) */
+ /* | (EXPECTED_VERSION_MINOR != _osminor))*/
+ /* exit(incorrect_dos_version); */
+ /* */
+ /********************************************/
+
+
+/* DOS location bits, for use with GetVersion call */
+
+#define DOSHMA 0x10 /* DOS running in HMA */
+#define DOSROM 0x08 /* DOS running in ROM */
diff --git a/private/mvdm/dos/v86/inc/_parse.asm b/private/mvdm/dos/v86/inc/_parse.asm
new file mode 100644
index 000000000..0ed10e4c0
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/_parse.asm
@@ -0,0 +1,117 @@
+page 60,132
+name _parse
+title C to PARSER interface
+;-------------------------------------------------------------------
+;
+; MODULE: _parse
+;
+; PURPOSE: Supplies an interface between C programs and
+; the DOS 3.30 parser
+;
+; CALLING FORMAT:
+; parse(&inregs,&outregs);
+;
+; DATE: 5-21-87
+;
+;-------------------------------------------------------------------
+
+; extrn sysparse:far
+
+ public _parse
+
+;-------------------------------------------------------------------
+
+; SET FOR SUBST
+; -------------
+
+FarSW equ 0 ; make sysparse be a NEAR proc
+TimeSW equ 0 ; Check time format
+FileSW equ 1 ; Check file specification
+CAPSW equ 1 ; Perform CAPS if specified
+CmpxSW equ 0 ; Check complex list
+NumSW equ 0 ; Check numeric value
+KeySW equ 0 ; Support keywords
+SwSW equ 1 ; Support switches
+Val1SW equ 0 ; Support value definition 1
+Val2SW equ 0 ; Support value definition 2
+Val3SW equ 0 ; Support value definition 3
+DrvSW equ 1 ; Support drive only format
+QusSW equ 0 ; Support quoted string format
+;-------------------------------------------------------------------
+
+_DATA segment byte public 'DATA'
+_DATA ends
+
+_TEXT segment byte public 'CODE'
+
+ ASSUME CS: _TEXT
+ ASSUME DS: _DATA
+
+;-------------------------------------------------------------------
+include parse.asm ; include the parser
+;-------------------------------------------------------------------
+
+_parse proc near
+
+ push bp ; save user's base pointer
+ mov bp,sp ; set bp to current sp
+ push di ; save some registers
+ push si
+
+; copy C inregs into proper registers
+
+ mov di,[bp+4] ; fix di (arg 0)
+
+;-------------------------------------------------------------------
+
+ mov ax,[di+0ah] ; load di
+ push ax ; the di value from inregs is now on stack
+
+ mov ax,[di+00] ; get inregs.x.ax
+ mov bx,[di+02] ; get inregs.x.bx
+ mov cx,[di+04] ; get inregs.x.cx
+ mov dx,[di+06] ; get inregs.x.dx
+ mov si,[di+08] ; get inregs.x.si
+ pop di ; get inregs.x.di from stack
+
+ push bp ; save base pointer
+
+; int 3 ; debugger
+
+;-------------------------------------------------------------------
+ call sysparse ; call the parser
+;-------------------------------------------------------------------
+
+; int 3 ; debugger
+
+ pop bp ; restore base pointer
+ push di ; the di value from call is now on stack
+ mov di,[bp+6] ; fix di (arg 1)
+
+ mov [di+00],ax ; load outregs.x.ax
+ mov [di+02],bx ; load outregs.x.bx
+ mov [di+04],cx ; load outregs.x.cx
+ mov [di+06],dx ; load outregs.x.dx
+ mov [di+08],si ; load outregs.x.si
+
+ xor ax,ax ; clear ax
+ lahf ; get flags into ax
+ mov [di+0ch],ax ; load outregs.x.cflag
+
+ pop ax ; get di from stack
+ mov [di+0ah],ax ; load outregs.x.di
+
+;-------------------------------------------------------------------
+
+ pop si ; restore registers
+ pop di
+ mov sp,bp ; restore sp
+ pop bp ; restore user's bp
+ ret
+
+_parse endp
+
+_TEXT ends ; end code segment
+ end
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/arena.inc b/private/mvdm/dos/v86/inc/arena.inc
new file mode 100644
index 000000000..3514d3fad
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/arena.inc
@@ -0,0 +1,53 @@
+ BREAK <Memory arena structure>
+
+;
+; Revision History:
+;
+; M001 - added equates for UMB allocation
+; M002 - added equate for LINK/UNLINK state of UMBs
+; M026 - STRAT_MASK should be HF_MASK AND HO_MASK
+
+;** Arena Header
+;
+
+arena STRUC
+arena_signature DB ? ; 4D for valid item, 5A for last item
+arena_owner DW ? ; owner of arena item
+arena_size DW ? ; size in paragraphs of item
+arena_reserved DB 3 DUP(?) ; reserved
+arena_name DB 8 DUP(?) ; owner file name
+arena ENDS
+
+;
+; CAUTION: The routines in ALLOC.ASM rely on the fact that arena_signature
+; and arena_owner_system are all equal to zero and are contained in DI. Change
+; them and change ALLOC.ASM.
+;
+; I think I have all of these covered via .errnz - JGL
+
+
+arena_owner_system EQU 0 ; free block indication
+
+arena_signature_normal EQU 4Dh ; valid signature, not end of arena
+arena_signature_end EQU 5Ah ; valid signature, last block in arena
+
+
+FIRST_FIT EQU 00000000B
+BEST_FIT EQU 00000001B
+LAST_FIT EQU 00000010B
+
+LOW_FIRST EQU 00000000B ; M001
+HIGH_FIRST EQU 10000000B ; M001
+HIGH_ONLY EQU 01000000B ; M001
+
+LINKSTATE EQU 00000001B ; M002
+
+HF_MASK EQU NOT HIGH_FIRST ; M001
+HO_MASK EQU NOT HIGH_ONLY ; M001
+
+STRAT_MASK EQU HF_MASK AND HO_MASK ; M001;
+ ; M026: used to mask of bits
+ ; M026: 6 & 7 of AllocMethod
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/bdsize.inc b/private/mvdm/dos/v86/inc/bdsize.inc
new file mode 100644
index 000000000..a85a6fef5
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/bdsize.inc
@@ -0,0 +1,3 @@
+BIODATASIZ EQU 00300H
+BIOCODESIZ EQU 00450H
+DOSDATASIZ EQU 01436H
diff --git a/private/mvdm/dos/v86/inc/bpb.inc b/private/mvdm/dos/v86/inc/bpb.inc
new file mode 100644
index 000000000..9b7891df2
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/bpb.inc
@@ -0,0 +1,49 @@
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+
+;** BIOS PARAMETER BLOCK DEFINITION
+;
+; The BPB contains information about the disk structure. It dates
+; back to the earliest FAT systems and so FAT information is
+; intermingled with physical driver information.
+;
+; A boot sector contains a BPB for its device; for other disks
+; the driver creates a BPB. DOS keeps copies of some of this
+; information in the DPB.
+;
+; The BDS structure contains a BPB within it.
+;
+
+
+
+A_BPB STRUC
+BPB_BYTESPERSECTOR DW ?
+BPB_SECTORSPERCLUSTER DB ?
+BPB_RESERVEDSECTORS DW ?
+BPB_NUMBEROFFATS DB ?
+BPB_ROOTENTRIES DW ?
+BPB_TOTALSECTORS DW ?
+BPB_MEDIADESCRIPTOR DB ?
+BPB_SECTORSPERFAT DW ?
+BPB_SECTORSPERTRACK DW ?
+BPB_HEADS DW ?
+BPB_HIDDENSECTORS DW ?
+ DW ?
+BPB_BIGTOTALSECTORS DW ?
+ DW ?
+ DB 6 DUP(?) ; NOTE: many times these
+; ; 6 bytes are omitted
+; ; when BPB manipulations
+; ; are performed!
+A_BPB ENDS
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/buffer.inc b/private/mvdm/dos/v86/inc/buffer.inc
new file mode 100644
index 000000000..03d23e687
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/buffer.inc
@@ -0,0 +1,76 @@
+ BREAK <Disk I/O Buffer Header>
+
+
+;** BUFFER.INC
+;
+; Field definition for I/O buffer information
+
+BUFFINFO STRUC
+buf_next DW ? ; Pointer to next buffer in list
+buf_prev DW ? ; Pointer to prev buffer in list
+buf_ID DB ? ; Drive of buffer (bit 7 = 0)
+ ; SFT table index (bit 7 = 1)
+ ; = FFH if buffer free
+buf_flags DB ? ; Bit 7 = 1 if Remote file buffer
+ ; = 0 if Local device buffer
+ ; Bit 6 = 1 if buffer dirty
+ ; Bit 5 = Reserved
+ ; Bit 4 = Search bit (bit 7 = 1)
+ ; Bit 3 = 1 if buffer is DATA
+ ; Bit 2 = 1 if buffer is DIR
+ ; Bit 1 = 1 if buffer is FAT
+ ; Bit 0 = Reserved
+buf_sector DD ? ; Sector number of buffer (bit 7 = 0)
+; The next two items are often refed as a word (bit 7 = 0)
+buf_wrtcnt DB ? ; For FAT sectors, # times sector written out
+buf_wrtcntinc DW ? ; " " " , # sectors between each write
+buf_DPB DD ? ; Pointer to drive parameters
+buf_fill DW ? ; How full buffer is (bit 7 = 1)
+buf_reserved DB ? ; make DWORD boundary for 386
+BUFFINFO ENDS
+
+buf_offset EQU DWORD PTR buf_sector
+ ;For bit 7 = 1, this is the byte
+ ;offset of the start of the buffer in
+ ;the file pointed to by buf_ID. Thus
+ ;the buffer starts at location
+ ;buf_offset in the file and contains
+ ;buf_fill bytes.
+
+BUFINSIZ EQU SIZE BUFFINFO
+ ; Size of structure in bytes
+
+buf_Free EQU 0FFh ; buf_id of free buffer
+
+;Flag byte masks
+buf_isnet EQU 10000000B
+buf_dirty EQU 01000000B
+;***
+buf_visit EQU 00100000B
+;***
+buf_snbuf EQU 00010000B
+
+buf_isDATA EQU 00001000B
+buf_isDIR EQU 00000100B
+buf_isFAT EQU 00000010B
+buf_type_0 EQU 11110001B ; AND sets type to "none"
+
+buf_NetID EQU BUFINSIZ
+
+;
+; Buffer Hash Entry Structure
+;
+;BUFFER_HASH_ENTRY STRUC ; DOS 4.00
+;EMS_PAGE_NUM DW -1 ; logical page number for EMS handle
+;BUFFER_BUCKET DD ? ; pointer to buffers
+;DIRTY_COUNT DB 0 ; number of dirty buffers
+;BUFFER_RESERVED DB 0 ; reserved
+;BUFFER_HASH_ENTRY ENDS
+;
+;MaxBuffinBucket EQU 15 ; Max number of buffers per bucket
+;MaxBucketinPage EQU 2 ; Max number of buckets per 16kb page
+;
+;
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
diff --git a/private/mvdm/dos/v86/inc/bugtyp.inc b/private/mvdm/dos/v86/inc/bugtyp.inc
new file mode 100644
index 000000000..5c742a4f6
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/bugtyp.inc
@@ -0,0 +1,59 @@
+;** BUGTYP.INC - Debugging types and levels for MSDOS
+;
+
+
+TypAccess EQU 0001h
+ LevSFN EQU 0000h
+ LevBUSY EQU 0001h
+
+TypShare EQU 0002h
+ LevShEntry EQU 0000h
+ LevMFTSrch EQU 0001h
+
+TypSect EQU 0004h
+ LevEnter EQU 0000h
+ LevLeave EQU 0001h
+ LevReq EQU 0002h
+
+TypSMB EQU 0008h
+ LevSMBin EQU 0000h
+ LevSMBout EQU 0001h
+ LevParm EQU 0002h
+ LevASCIZ EQU 0003h
+ LevSDB EQU 0004h
+ LevVarlen EQU 0005h
+
+TypNCB EQU 0010h
+ LevNCBin EQU 0000h
+ LevNCBout EQU 0001h
+
+TypSeg EQU 0020h
+ LevAll EQU 0000h
+
+TypSyscall EQU 0040h
+ LevLog EQU 0000h
+ LevArgs EQU 0001h
+ LevErr EQU 0002h
+
+TypInt24 EQU 0080h
+ LevLog EQU 0000h
+
+TypProlog EQU 0100h
+ LevLog EQU 0000h
+
+TypInt EQU 0200h
+ LevLog equ 0000h
+
+typFCB equ 0400h
+ LevLog equ 0000h
+ LevCheck equ 0001h
+
+
+ifndef BugLev
+
+ DOSCODE SEGMENT
+ EXTRN BugLev:word
+ EXTRN BugTyp:word
+ DOSCODE ENDS
+
+endif
diff --git a/private/mvdm/dos/v86/inc/chkcpu.inc b/private/mvdm/dos/v86/inc/chkcpu.inc
new file mode 100644
index 000000000..47ad1f0c6
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/chkcpu.inc
@@ -0,0 +1,70 @@
+
+chkcpu macro
+
+ jmp begn
+ msg db 13,10,"This copy of MS-DOS will run only on an 8086",13,10
+ db "or 8088 CPU based computer. This computer is not ",13,10
+ db "based on an 8086 or 8088 CPU. ",13,10
+ db 13,10,"Insert a copy of the appropriate MS-DOS system disk ",13,10
+ db "and press any key to re-boot.",13,10,0
+
+begn:
+;------GET_CPU_TYPE------------------------------------------------------------May, 88 by M.Williamson
+; Returns: AX = 0 if 8086 or 8088
+; = 1 if 80286
+; = 2 if 80386
+;
+ pushf
+ push bx ; preserve bx
+ xor bx, bx ; init bx to zero
+
+ xor ax,ax ; 0000 into AX
+ push ax ; put it on the stack...
+ popf ; ...then shove it into the flags
+ pushf ; get it back out of the flags...
+ pop ax ; ...and into ax
+ and ax,0F000h ; mask off high four bits
+ cmp ax,0F000h ; was it all 1's?
+ je scpu_8086 ; aye; it's an 8086 or 8088
+
+ mov ax,0F000h ; now try to set the high four bits..
+ push ax
+ popf
+ pushf
+ pop ax ; ...and see what happens
+ and ax,0F000h ; any high bits set ?
+ jz scpu_286 ; nay; it's an 80286
+
+scpu_386: ; bx starts as zero
+ inc bx ; inc twice if 386
+scpu_286: ; just inc once if 286
+ inc bx
+scpu_8086: ; don't inc at all if 086
+ mov ax, bx ; put CPU type value in ax
+ pop bx ; restore original bx
+ popf
+
+ cmp ax, 0000
+ je cpu_ok
+ push cs
+ pop ds
+ mov si, offset msg
+prnt: lodsb
+ or al, al
+ jz prnt_done
+ mov ah, 14
+ mov bx, 7
+ int 10h
+ jmp prnt
+
+prnt_done:
+ xor ah, ah
+ int 16h
+
+ int 19h
+cpu_ok:
+ endm
+
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/cmacros.inc b/private/mvdm/dos/v86/inc/cmacros.inc
new file mode 100644
index 000000000..d81960cc2
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/cmacros.inc
@@ -0,0 +1,932 @@
+comment $
+cmacros - assembly macros for interfacing to HHLs
+(C)Copyright 1984, 1988 Microsoft Corporation
+$
+if1
+outif MACRO name,defval,onmsg,offmsg
+ ifndef name
+ ifb <defval>
+ name=0
+ else
+ name=defval
+ endif
+ endif
+ if name
+ name=1
+ ifnb <onmsg>
+ %out ! onmsg
+ endif
+ else
+ ifnb <offmsg>
+ %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,<Small Model>
+outif memM,0,<Medium Model>
+outif memL,0,<Large Model>
+outif memC,0,<Compact Model>
+outif memH,0,<Huge Model>
+memMOD= memS + memM + memL + memC + memH
+if memMOD ne 1
+if memMOD eq 0
+memS= 1
+outif memS,0,<Small Model>
+else
+error <Must have only 1 memory model selected>
+endif
+endif
+sizeC= memM + memL + memH
+sizeD= memL + memC + (memH*2)
+outif ?DF,0,<No segments or groups will be defined>
+outif ?WIN,0,<Windows Support>
+outif ?PLM,0,<PLM calling convention>
+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,<ax,bx,cx,dx,si,di,es,ds,bp,sp,ss,cs>
+if rV AND ?&&x
+push x
+endif
+endm
+endm
+mpop macro rV
+irp x,<cs,ss,sp,bp,ds,es,di,si,dx,cx,bx,ax>
+if rV AND ?&&x
+pop x
+endif
+endm
+endm
+SAVE macro rL
+?RSL = 0
+?RI ?RSL,<rL>
+endm
+smashes macro n,rL
+ .xcref
+ .xcref ?SM&n
+ .cref
+?SM&n = 0
+?RI ?SM&n,<rL>
+endm
+?RI macro n,rL
+irp x,<rL>
+ifdef ?&&x
+n = n or ?&&x
+endif
+endm
+endm
+parmB macro nl
+?pp <&nL>,<byte>,2,1
+endm
+parmW macro nl
+?pp <&nL>,<word>,2,2
+endm
+parmD macro nl
+ife ?PLM
+irp x,<nL>
+?pp <&&x>,<DWORD>,0,4
+?pp <Off_&&x>,<WORD>,2,2
+?pp <Seg_&&x>,<WORD>,2,2
+endm
+else
+irp x,<nL>
+?pp <Seg_&&x>,<WORD>,2,2
+?pp <Off_&&x>,<WORD>,2,2
+?pp <&&x>,<DWORD>,0,4
+endm
+endif
+endm
+parmQ macro nl
+?pp <&nL>,<QWORD>,8,8
+endm
+parmT macro nl
+?pp <&nL>,<TBYTE>,10,10
+endm
+if sizeC
+parmCP macro nl
+parmD <nl>
+endm
+else
+parmCP macro nl
+parmW <nl>
+endm
+endif
+if sizeD
+parmDP macro nl
+parmD <nl>
+endm
+else
+parmDP macro nl
+parmW <nl>
+endm
+endif
+?pp macro nL,t,l,s
+if ?CPD
+ .xcref
+ife ?PLM
+irp x,<nL>
+?pp1 x,<t>,%?PO,%?adj,%(?PO+?adj)
+?PO = ?PO + l
+ .xcref ?T&&x
+?T&&x = s
+endm
+else
+irp x,<nL>
+?PO = ?PO + l
+?pp1 x,<t>,%?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>,<BYTE ptr>,1,1,0
+endm
+localW macro nL
+?aLoc <&nL>,<WORD PTR>,2,2,1
+endm
+localD macro nL
+irp x,<nL>
+?aLoc <Seg_&&x>,<WORD PTR>,2,2,1
+?aLoc <Off_&&x>,<WORD PTR>,2,2,1
+?aLoc <&&x>,<DWORD PTR>,0,4,1
+endm
+endm
+localQ macro nL
+?aLoc <&nL>,<QWORD PTR>,8,8,1
+endm
+localT macro nL
+?aLoc <&nL>,<TBYTE PTR>,10,10,1
+endm
+if sizeC
+localCP macro nL
+localD <nL>
+endm
+else
+localCP macro nL
+localW <nL>
+endm
+endif
+if sizeD
+localDP macro nL
+localD <nL>
+endm
+else
+localDP macro nL
+localW <nL>
+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,<nL>
+?aL1 x,<t>,%???
+ .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 <n>,1
+?dd n,1,<BYTE>,<DB>,<i>,<s>
+endm
+globalW macro n,i,s
+?aD <n>,2
+?dd n,1,<WORD>,<DW>,<i>,<s>
+endm
+globalD macro n,i,s
+?aD <n>,4
+?dd n,1,<DWORD>,<DD>,<i>,<s>
+endm
+globalQ macro n,i,s
+?aD <n>,8
+?dd n,1,<QWORD>,<DQ>,<i>,<s>
+endm
+globalT macro n,i,s
+?aD <n>,10
+?dd n,1,<TBYTE>,<DT>,<i>,<s>
+endm
+if sizeC
+globalCP macro n,i,s
+globalD n,<i>,<s>
+endm
+else
+globalCP macro n,i,s
+globalW n,<i>,<s>
+endm
+endif
+if sizeD
+globalDP macro n,i,s
+globalD n,<i>,<s>
+endm
+else
+globalDP macro n,i,s
+globalW n,<i>,<s>
+endm
+endif
+staticB macro n,i,s
+?aD <n>,1
+?dd n,0,<BYTE>,<DB>,<i>,<s>
+endm
+staticW macro n,i,s
+?aD <n>,2
+?dd n,0,<WORD>,<DW>,<i>,<s>
+endm
+staticD macro n,i,s
+?aD <n>,4
+?dd n,0,<DWORD>,<DD>,<i>,<s>
+endm
+staticQ macro n,i,s
+?aD <n>,8
+?dd n,0,<QWORD>,<DQ>,<i>,<s>
+endm
+staticT macro n,i,s
+?aD <n>,10
+?dd n,0,<TBYTE>,<DT>,<i>,<s>
+endm
+if sizeC
+staticCP macro n,i,s
+staticD n,<i>,<s>
+endm
+else
+staticCP macro n,i,s
+staticW n,<i>,<s>
+endm
+endif
+if sizeD
+staticDP macro n,i,s
+staticD n,<i>,<s>
+endm
+else
+staticDP macro n,i,s
+staticW n,<i>,<s>
+endm
+endif
+?dd macro n,p,t,d,i,s
+ife ?PLM
+n label t
+?dd1 _&n,p,<d>,<i>,<s>
+else
+?dd1 n,p,<d>,<i>,<s>
+endif
+endm
+?dd1 macro n,p,d,i,s
+if p
+PUBLIC n
+endif
+ifb <s>
+n d i
+else
+ifb <i>
+n d s DUP (?)
+else
+n d s DUP (i)
+endif
+endif
+endm
+externB macro nL
+?ex1 <&nL>,1,<BYTE>
+endm
+externW macro nL
+?ex1 <&nL>,2,<WORD>
+endm
+externD macro nL
+?ex1 <&nL>,4,<DWORD>
+endm
+externQ macro nL
+?ex1 <&nL>,8,<QWORD>
+endm
+externT macro nL
+?ex1 <&nL>,10,<TBYTE>
+endm
+externNP macro nL
+?ex1 <&nL>,2,<NEAR>
+endm
+externFP macro nL
+?ex1 <&nL>,4,<FAR>
+endm
+if sizeC
+externP macro nL
+?ex1 <&nL>,4,<FAR>
+endm
+else
+externP macro nL
+?ex1 <&nL>,2,<NEAR>
+endm
+endif
+if sizeC
+externCP macro nL
+?ex1 <&nL>,4,<DWORD>
+endm
+else
+externCP macro nL
+?ex1 <&nL>,2,<WORD>
+endm
+endif
+if sizeD
+externDP macro nL
+?ex1 <&nL>,4,<DWORD>
+endm
+else
+externDP macro nL
+?ex1 <&nL>,2,<WORD>
+endm
+endif
+?ex1 macro nL,s,d
+irp x,<nL>
+ .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,<BYTE>
+endm
+labelW macro nL
+?lb1 <&nL>,2,<WORD>
+endm
+labelD macro nL
+?lb1 <&nL>,4,<DWORD>
+endm
+labelQ macro nL
+?lb1 <&nL>,8,<QWORD>
+endm
+labelT macro nL
+?lb1 <&nL>,10,<TBYTE>
+endm
+labelNP macro nL
+?lb1 <&nL>,2,<NEAR>
+endm
+labelFP macro nL
+?lb1 <&nL>,4,<FAR>
+endm
+if sizeC
+labelP macro nL
+?lb1 <&nL>,4,<FAR>
+endm
+else
+labelP macro nL
+?lb1 <&nL>,2,<NEAR>
+endm
+endif
+if sizeC
+labelCP macro nL
+?lb1 <&nL>,4,<DWORD>
+endm
+else
+labelCP macro nL
+?lb1 <&nL>,2,<WORD>
+endm
+endif
+if sizeD
+labelDP macro nL
+?lb1 <&nL>,4,<DWORD>
+endm
+else
+labelDP macro nL
+?lb1 <&nL>,2,<WORD>
+endm
+endif
+?lb1 macro nL,s,d
+?lblpu = 0
+irp x,<nL>
+ifidn <x>,<PUBLIC>
+?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 <nL>
+endm
+else
+defCP macro nL
+defW <nL>
+endm
+endif
+if sizeD
+defDP macro nL
+defD <nL>
+endm
+else
+defDP macro nL
+defW <nL>
+endm
+endif
+?aD macro nL,s
+irp x,<nL>
+ .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,<aL>
+?argc = ?argc + 1
+?Atal <x>,%?argc
+endm
+endm
+?Atal macro n,i
+ .xcref
+ .xcref ?ALI&i
+ .cref
+?ALI&i &macro
+?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 <a>
+Arg <a>
+endif
+ifdef ?SM&n
+?RSL = ?RSL AND ?SM&n
+endif
+mpush %?RSL
+?argl = 0
+?ACB = ?argc
+rept ?argc
+uconcat <?ALI>,%?ACB
+uconcat <purge>,,<?ALI>,%?ACB
+?ACB = ?ACB - 1
+endm
+ife ?PLM
+ifb <sleaze>
+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 <a>
+Arg <a>
+endif
+ifdef ?SM&n
+?RSL = ?RSL AND ?SM&n
+endif
+mpush %?RSL
+?argl = 0
+?ACB = 1
+rept ?argc
+uconcat <?ALI>,%?ACB
+uconcat <purge>,,<?ALI>,%?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,<cl>,<s>,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 <a>
+?RI ?PAS,<a>
+endif
+?PC = sizeC
+irp x,<c>
+ifidn <x>,<FAR>
+?PC = 1
+endif
+ifidn <x>,<NEAR>
+?PC = 0
+endif
+ifidn <x>,<PUBLIC>
+?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 <n>,%?PU,%?PC,%?PAS
+endif
+endm
+?pg macro n,p,c,a
+ .xcref
+ cBegin &macro g
+ .xcref
+ ?pg1 <n>,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 <g>,<nogen>
+ if ???+?PO+a
+ %out <cBegin - possible invalid use of nogen>
+ 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 &macro
+ %out Unterminated Procedure Definition: "&n"
+ &endm
+endm
+
+?pg1 macro n,c,a,o
+ .xcref
+ cEnd &macro g
+ .xcref
+ ?BA = 0
+ ifidn <g>,<nogen>
+ if o+a
+ %out <cEnd - possible invalid use of nogen>
+ 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 <code>,<g>
+?cas <s>
+assumed = 1
+endif
+ifidn <CODE>,<g>
+?cas <s>
+assumed = 1
+endif
+ifidn <data>,<g>
+assume s&:dgroup
+assumed = 1
+endif
+ifidn <DATA>,<g>
+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 <grp>
+ifidn <grp>,<IGROUP>
+ife sizeC
+addSeg IGROUP,n
+endif
+else
+addSeg grp,n
+endif
+endif
+ifnb <cl>
+n segment a co '&cl'
+else
+n segment a co
+endif
+n ends
+?cs1 <n>,<ln>
+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 &macro s
+in_&grp <seg>,s
+&endm
+in_&grp &macro sl,s
+ifb <s>
+grp group sl
+else
+add_&grp &macro ns
+in_&grp <sl,s>,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 &macro
+?cs2 <n>
+n segment
+&endm
+endm
+
+?cs2 macro n
+ sEnd &macro
+ 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>,%(x)
+ endif
+ endif
+endm
+
+errnz1 macro x1,x2
+ = *ERRNZ* x1 = x2
+endm
+
+errn$ macro l,x
+ errnz <OFFSET $ - OFFSET l x>
+endm
diff --git a/private/mvdm/dos/v86/inc/const2.asm b/private/mvdm/dos/v86/inc/const2.asm
new file mode 100644
index 000000000..f7de02d7e
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/const2.asm
@@ -0,0 +1,254 @@
+; SCCSID = @(#)const2.asm 1.4 85/07/24
+
+
+Break <Initialized data and data used at DOS initialization>
+
+;
+; We need to identify the parts of the data area that are relevant to tasks
+; and those that are relevant to the system as a whole. Under 3.0, the system
+; data will be gathered with the system code. The process data under 2.x will
+; be available for swapping and under 3.0 it will be allocated per-process.
+;
+; The data that is system data will be identified by [SYSTEM] in the comments
+; describing that data item.
+;
+
+include dossvc.inc
+
+; On NT SFT Size is smaller than DOS so we have to pad some space to maintain
+; the offsets in data segmeents. Below FILLSPACE is pad. 59 is the size of
+; DOS5.0 sft entry.
+
+FILLSPACE equ (sf_default_number * (59 - (SIZE sf_entry)))
+
+ AsmVars <Debug, Redirector, ShareF>
+
+DOSDATA SEGMENT WORD PUBLIC 'DATA'
+
+;
+; Table of routines for assignable devices
+;
+; MSDOS allows assignment if the following standard devices:
+; stdin (usually CON input)
+; stdout (usually CON output)
+; auxin (usually AUX input)
+; auxout (usually AUX output)
+; stdlpt (usually PRN output)
+;
+; SPECIAL NOTE:
+; Status of a file is a strange idea. We choose to handle it in this
+; manner: If we're not at end-of-file, then we always say that we have a
+; character. Otherwise, we return ^Z as the character and set the ZERO
+; flag. In this manner we can support program written under the old DOS
+; (they use ^Z as EOF on devices) and programs written under the new DOS
+; (they use the ZERO flag as EOF).
+
+; Default SFTs for boot up
+
+Public CONST001S,CONST001E
+CONST001s label byte
+ PUBLIC sftabl
+sftabl LABEL DWORD ; [SYSTEM] file table
+ DW -1 ; [SYSTEM] link to next table
+ DW -1 ; [SYSTEM] link seg to next table
+ DW sf_default_number ; [SYSTEM] Number of entries in table
+ DB sf_default_number DUP ( (SIZE sf_entry) DUP (0)); [SYSTEM]
+
+ DB FILLSPACE DUP (0) ; PAD to maintain correct offsets
+
+; the next two variables relate to the position of the logical stdout/stdin
+; cursor. They are only meaningful when stdin/stdout are assigned to the
+; console.
+ I_am CARPOS,BYTE ; [SYSTEM] cursor position in stdin
+ I_am STARTPOS,BYTE ; [SYSTEM] position of cursor at beginning of buffered input call
+ I_am INBUF,128 ; [SYSTEM] general device input buffer
+ I_am CONBUF,131 ; [SYSTEM] The rest of INBUF and console buffer
+
+ I_am PFLAG,BYTE ; [SYSTEM] printer echoing flag
+ I_am VERFLG,BYTE ; [SYSTEM] Initialize with verify off
+ I_am CharCo,BYTE,<00000011B> ; [SYSTEM] Allows statchks every 4 chars...
+ I_am chSwitch,BYTE,<'/'> ; UNUSED - obsolete datum, can be reused
+ I_am AllocMethod,BYTE ; [SYSTEM] how to alloc first(best)last
+ I_am fShare,BYTE,<0> ; [SYSTEM] TRUE => sharing installed
+ I_am DIFFNAM,BYTE,<1> ; [SYSTEM] Indicates when MYNAME has
+ ; changed
+ I_am MYNAME,16,<32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32>
+ ; [SYSTEM] My network name
+
+
+;
+; The following table is a list of addresses that the sharer patches to be
+; PUSH AX to enable the critical sections
+;
+PUBLIC CritPatch
+CritPatch LABEL WORD
+IRP sect,<critDisk,critDevice>
+IF (NOT REDIRECTOR) AND (NOT SHAREF)
+;
+;SR; Change code patch address to a variable in data segment
+;
+ dw OFFSET DOSDATA: redir_patch
+ dw OFFSET DOSDATA: redir_patch
+
+;hkn Short_Addr E&sect
+;hkn Short_Addr L&sect
+
+ELSE
+ DW 0
+ DW 0
+ENDIF
+ENDM
+ DW 0
+
+;
+; WARNING!!! PRINT and PSPRINT *REQUIRE* ErrorMode to precede INDOS.
+; Also, IBM server 1.0 requires this also.
+;
+ EVEN ; Force swap area to start on word boundry
+PUBLIC SWAP_START
+SWAP_START LABEL BYTE
+ I_am ErrorMode,BYTE ; Flag for INT 24 processing
+ I_am INDOS,BYTE,<0> ; DOS status for interrupt processing
+ I_am WPErr,BYTE,<-1> ; Write protect error flag
+ I_am EXTERR_LOCUS,BYTE ; Extended Error Locus
+ I_am EXTERR,WORD,<0> ; Extended Error code
+
+;WARNING Following two bytes Accessed as word in $GetExtendedError
+ I_am EXTERR_ACTION,BYTE ; Extended Error Action
+ I_am EXTERR_CLASS,BYTE ; Extended Error Class
+; end warning
+
+ I_am EXTERRPT,DWORD ; Extended Error pointer
+ I_am DMAADD,DWORD,<80h,?> ; User's disk transfer address (disp/seg)
+ I_am CurrentPDB,WORD ; Current process identifier
+ I_am ConC_spsave,WORD ; saved SP before ^C
+ I_am exit_code,WORD ; exit code of last proc.
+ I_am CURDRV,BYTE ; Default drive (init A)
+ I_am CNTCFLAG,BYTE,<0> ; ^C check in dispatch disabled
+ ; F.C. 2/17/86
+ I_am CPSWFLAG,BYTE,<0> ; Code Page Switching Flag DOS 4.00
+ I_am CPSWSAVE,BYTE,<0> ; copy of above in case of ABORT
+ EVEN
+ PUBLIC Swap_Always
+ Swap_Always LABEL BYTE
+ I_am USER_IN_AX,WORD ; User INPUT AX value (used for
+ ; extended error type stuff. NOTE:
+ ; does not have Correct value on
+ ; 1-12, OEM, Get/Set CurrentPDB,
+ ; GetExtendedError system calls
+ I_am PROC_ID,WORD,<0> ; PID for sharing (0 = local)
+ I_am USER_ID,WORD,<0> ; Machine for sharing (0 = local)
+ I_am FirstArena,WORD ; first free block found
+ I_am BestArena,WORD ; best free block found
+ I_am LastArena,WORD ; last free block found
+ I_am EndMem,WORD ; End of memory used in DOSINIT
+ I_am LASTENT,WORD ; Last entry for directory search
+
+ I_am FAILERR,BYTE,<0> ; NZ if user did FAIL on I 24
+ I_am ALLOWED,BYTE,<0> ; Allowed I 24 answers (see allowed_)
+ I_am NoSetDir,BYTE ; true -> do not set directory
+ I_am DidCTRLC,BYTE ; true -> we did a ^C exit
+ I_am SpaceFlag,BYTE ; true -> embedded spaces are allowed in FCB
+; Warning! The following items are accessed as a WORD in TIME.ASM
+ EVEN
+ I_am DAY,BYTE,<0> ; Day of month
+ I_am MONTH,BYTE,<0> ; Month of year
+ I_am YEAR,WORD,<0> ; Year (with century)
+ I_am DAYCNT,WORD,<-1> ; Day count from beginning of year
+ I_am WEEKDAY,BYTE,<0> ; Day of week
+; end warning
+ I_am CONSWAP,BYTE ; TRUE => console was swapped during device read
+ I_am IDLEINT,BYTE,<1> ; TRUE => idle int is allowed
+ I_am fAborting,BYTE,<0> ; TRUE => abort in progress
+
+; Combination of all device call parameters
+ PUBLIC DEVCALL ;
+DEVCALL SRHEAD <> ; basic header for disk packet
+ PUBLIC CALLUNIT
+CALLUNIT LABEL BYTE ; unit number for disk
+CALLFLSH LABEL WORD ;
+ I_am CALLMED,BYTE ; media byte
+CALLBR LABEL DWORD ;
+ PUBLIC CALLXAD ;
+CALLXAD LABEL DWORD ;
+ I_am CALLRBYT,BYTE ;
+ PUBLIC CALLVIDM ;
+CALLVIDM LABEL DWORD ;
+ DB 3 DUP(?) ;
+ PUBLIC CallBPB ;
+CALLBPB LABEL DWORD ;
+ I_am CALLSCNT,WORD ;
+ PUBLIC CALLSSEC
+CALLSSEC LABEL WORD ;
+ DW ? ;
+ I_am CALLVIDRW,DWORD ;
+ ;
+ I_am CALLNEWSC,DWORD ; starting sector for >32mb
+ I_am CALLDEVAD,DWORD ; stash for device entry point
+ ;
+; Same as above for I/O calls ;
+ ;
+ PUBLIC IOCall ;
+IOCALL SRHEAD <> ;
+IOFLSH LABEL WORD ;
+ PUBLIC IORCHR ;
+IORCHR LABEL BYTE ;
+ I_am IOMED,BYTE ;
+ I_am IOXAD,DWORD ;
+ I_am IOSCNT,WORD ;
+ I_am IOSSEC,WORD ;
+; Call struct for DSKSTATCHK ;
+ I_am DSKSTCALL,2,<DRDNDHL,0> ;
+ I_am DSKSTCOM,1,<DEVRDND> ;
+ I_am DSKSTST,WORD ;
+ DB 8 DUP (0) ;
+ I_am DSKCHRET,BYTE ;
+
+;hkn; short_addr has been changed to provide offset in DOSCODE.
+;hkn; deviobuf is in DATA seg (DOSDATA)
+;hkn short_addr DEVIOBUF ;
+
+ DW offset DOSDATA:DEVIOBUF
+
+ DW ? ; DOS segment set at Init
+ I_AM DSKSTCNT,WORD,<1> ;
+ DW 0 ;
+
+ I_am CreatePDB,BYTE ; flag for creating a process
+ PUBLIC Lock_Buffer ;
+Lock_Buffer LABEL DWORD ;MS. DOS Lock Buffer for Ext Lock
+ DD ? ;MS. position
+ DD ? ;MS. length
+CONST001e label byte
+
+
+ PUBLIC vheDev
+vheDev SYSDEV <-1,0,0,0,>
+
+;hkn; the foll. was moved from dosmes.asm.
+
+ EVEN ; needed to maintain offsets
+
+ PUBLIC UserNum, OEMNum
+ Public DMES001S,DMES001E
+DMES001S Label byte
+USERNUM DW ? ; 24 bit user number
+ DB ?
+IF IBM
+ IF IBMCOPYRIGHT
+ OEMNUM DB 0 ; 8 bit OEM number
+ ELSE
+ OEMNUM DB 0FFH ; 8 bit OEM number
+ ENDIF
+ELSE
+OEMNUM DB 0FFH
+ENDIF
+
+
+DMES001E label byte
+
+
+DOSDATA ENDS
+
+
+
diff --git a/private/mvdm/dos/v86/inc/copyrigh.inc b/private/mvdm/dos/v86/inc/copyrigh.inc
new file mode 100644
index 000000000..0bdf92481
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/copyrigh.inc
@@ -0,0 +1,7 @@
+;M00 - changed to DOS 5.0 copyright - MD 9 Jul 90
+;M031 - changed copyright to 1991
+
+ DB "MS DOS Version 5.00 (C)Copyright 1981-1991 Microsoft Corp "
+ DB "Licensed Material - Property of Microsoft "
+ DB "All rights reserved "
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/cpmfcb.inc b/private/mvdm/dos/v86/inc/cpmfcb.inc
new file mode 100644
index 000000000..bbf91b895
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/cpmfcb.inc
@@ -0,0 +1,81 @@
+; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
+; SCCSID = @(#)cpmfcb.asm 1.1 85/04/10
+;BREAK <File Control Block definition>
+
+;
+; Field definition for FCBs
+; The FCB has the following structure:
+;
+; +---------------------------+
+; | Drive indicator(byte) |
+; +---------------------------+
+; | Filename (8 chars) |
+; +---------------------------+
+; | Extension (3 chars) |
+; +---------------------------+
+; | Current Extent(word) |
+; +---------------------------+
+; | Record size (word) |
+; +---------------------------+
+; | File Size (2 words) |
+; +---------------------------+
+; | Date of write |
+; +---------------------------+
+; | Time of write |
+; +---------------------------+
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+; +---------------------------+
+; | 8 bytes reserved |
+; +---------------------------+
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; | next record number |
+; +---------------------------+
+; | random record number |
+; +---------------------------+
+;
+
+sys_fcb STRUC
+fcb_drive DB ?
+fcb_name DB 8 DUP (?)
+fcb_ext DB 3 DUP (?)
+fcb_EXTENT DW ?
+fcb_RECSIZ DW ? ; Size of record (user settable)
+fcb_FILSIZ DW ? ; Size of file in bytes; used with the
+ ; following word
+fcb_DRVBP DW ? ; BP for SEARCH FIRST and SEARCH NEXT
+fcb_FDATE DW ? ; Date of last writing
+fcb_FTIME DW ? ; Time of last writing
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+fcb_reserved DB 8 DUP (?) ; RESERVED
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+fcb_NR DB ? ; Next record
+fcb_RR DB 4 DUP (?) ; Random record
+sys_fcb ENDS
+
+FILDIRENT = fcb_FILSIZ ; Used only by SEARCH FIRST and SEARCH
+ ; NEXT
+
+; FCB's reserve area is interpreted on NT as follows.
+
+fcb_sfn EQU BYTE PTR fcb_reserved ; SFN
+fcb_res_dev EQU BYTE PTR fcb_reserved+1 ; 1 if local device
+fcb_res_dummy EQU BYTE PTR fcb_reserved+2 ; Not using in NT
+fcb_res_dummy2 EQU BYTE PTR fcb_reserved+3 ; Not using in NT
+fcb_res_Sig EQU DWORD PTR fcb_reserved+4 ; Using as a check
+
+
+; fcb_nsl_Sig is a signature to check if the FCB-SFT association is valid.
+;
+; for a local device this field contains the devptr. sft's field devptr
+; is checked against it.
+;
+; for a file/UNC/pipe etc this field contains an NT handle. sft's NThandle
+; field is checked against it.
diff --git a/private/mvdm/dos/v86/inc/cputype.inc b/private/mvdm/dos/v86/inc/cputype.inc
new file mode 100644
index 000000000..ead71f017
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/cputype.inc
@@ -0,0 +1,59 @@
+; Note: this must be a macro, and not a subroutine in the BIOS since
+; it is called from both CODE and SYSINITSEG.
+;
+;------GET_CPU_TYPE------------------------------------------------------------May, 88 by M.Williamson
+; Returns: AX = 0 if 8086 or 8088
+; = 1 if 80286
+; = 2 if 80386
+;
+; sudeepb 24-Mar-1993 Modified for NT such that on x86 we return 386
+; and on non-x86 we do the old style macro.
+; Using original macro on X86 is pretty costly
+; because of trapping instructions.
+
+include vint.inc
+
+Get_CPU_Type macro
+ local nonx86,getout
+ push ds
+ mov ax,40h
+ mov ds,ax
+ lahf
+ test word ptr ds:FIXED_NTVDMSTATE_REL40, MIPS_BIT_MASK
+ pop ds
+ sahf
+ jnz nonx86
+ mov ax,2
+ jmp short getout
+nonx86:
+ pushf
+ push bx ; preserve bx
+ xor bx, bx ; init bx to zero
+
+ xor ax,ax ; 0000 into AX
+ push ax ; put it on the stack...
+ popf ; ...then shove it into the flags
+ pushf ; get it back out of the flags...
+ pop ax ; ...and into ax
+ and ax,0F000h ; mask off high four bits
+ cmp ax,0F000h ; was it all 1's?
+ je cpu_8086 ; aye; it's an 8086 or 8088
+
+ mov ax,0F000h ; now try to set the high four bits..
+ push ax
+ popf
+ pushf
+ pop ax ; ...and see what happens
+ and ax,0F000h ; any high bits set ?
+ jz cpu_286 ; nay; it's an 80286
+
+cpu_386: ; bx starts as zero
+ inc bx ; inc twice if 386
+cpu_286: ; just inc once if 286
+ inc bx
+cpu_8086: ; don't inc at all if 086
+ mov ax, bx ; put CPU type value in ax
+ pop bx ; restore original bx
+ popf
+getout:
+ endm
diff --git a/private/mvdm/dos/v86/inc/dbcs.sw b/private/mvdm/dos/v86/inc/dbcs.sw
new file mode 100644
index 000000000..30af55dfa
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dbcs.sw
@@ -0,0 +1,15 @@
+;***********************************************************************;
+; ;
+; To build DBCS version, Define DBCS by using MASM option via ;
+; Dos environment. ;
+; ;
+; ex. set MASM=-DDBCS ;
+; ;
+;***********************************************************************;
+
+if1
+ ifdef DBCS
+%OUT DBCS Version Build Switch ON
+ endif
+endif
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/devsym.inc b/private/mvdm/dos/v86/inc/devsym.inc
new file mode 100644
index 000000000..b09be7d47
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/devsym.inc
@@ -0,0 +1,227 @@
+;** DevSym.inc - Device Symbols
+;
+; Revision History:
+;
+; M018 - defined bit 11 of DOS34_FLAG. See M041 in dos.tag for
+; explanation.
+;
+
+
+; 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 ' ' ;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 - Must be 0 to support current versions of Mace Utilities
+; 7 -> SUPPORTS DEVICE QUERY
+; 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 - Must be 0 to support current versionso of Mace Utilities
+; 7 -> SUPPORTS DEVICE QUERY
+; 6 -> IF DEVICE HAS SUPPORT FOR GETMAP/SETMAP OF LOGICAL DRIVES.
+; IF THE DEVICE UNDERSTANDS GENERIC IOCTL FUNCTION CALLS.
+; 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,..).
+
+; M017 IOQUERY EQU 0100H ;Bit 8 - Supports generic IOCtl query
+IOQUERY EQU 080H ;Bit 7 - Supports generic IOCtl query M017
+
+
+DEV320 EQU 0040H ;BIT 6 - FOR BLOCK DEVICES, THIS
+ ;DEVICE SUPPORTS SET/GET MAP OF
+ ;LOGICAL DRIVES, AND SUPPORTS
+ ;GENERIC IOCTL CALLS.
+ ;FOR CHARACTER DEVICES, THIS
+ ;DEVICE SUPPORTS GENERIC IOCTL.
+ ;THIS IS A DOS 3.2 DEVICE DRIVER.
+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.
+EXTDRVR EQU 0002H ;BIT 1 - BLOCK DEVICE EXTNDED DRIVER
+
+
+
+;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
+; 2/12/KK
+; Interim character identifier 2/12/KK
+Ddkey EQU 0000010000000000B ; 2/12/KK
+
+;FUNCTION CODES
+DINITHL EQU 26 ;SIZE OF INIT HEADER
+DMEDHL EQU 15 ;SIZE OF MEDIA CHECK HEADER
+DBPBHL EQU 22 ;SIZE OF GET BPB HEADER
+DRDWRHL EQU 22 ;SIZE OF RD/WR HEADER
+DRDNDHL EQU 14 ;SIZE OF NON DESTRUCTIVE READ HEADER
+DSTATHL EQU 13 ;SIZE OF STATUS HEADER
+DFLSHL EQU 15 ;SIZE OF FLUSH HEADER
+
+DEVINIT EQU 0 ;INITIALIZATION
+DEVMDCH EQU 1 ;MEDIA CHECK
+DEVBPB EQU 2 ;GET BPB
+DEVRDIOCTL EQU 3 ;IOCTL READ
+DEVRD EQU 4 ;READ
+DEVRDND EQU 5 ;NON DESTRUCTIVE READ NO WAIT (CHARACTER DEVS)
+DEVIST EQU 6 ;INPUT STATUS
+DEVIFL EQU 7 ;INPUT FLUSH
+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
+GENIOCTL EQU 19
+
+; THE NEXT THREE ARE USED IN DOS 4.0
+; 20
+; 21
+; 22
+
+DEVGETOWN EQU 23 ;GET DEVICE OWNER
+DEVSETOWN EQU 24 ;SET DEVICE OWNER
+IOCTL_QUERY EQU 25 ;Query generic ioctl support
+
+OWNHL EQU 13 ;SIZE OF DEVICE OWNER HEADER
+
+DEVOUT EQU 16 ; OUTPUT UNTIL BUSY.
+
+DEVOUTL EQU DEVWRT ; LENGTH OF OUTPUT UNTIL BUSY
+
+; ADDED FOR DOS 5.00
+;
+
+
+; GENERIC IOCTL REQUEST STRUCTURE
+; SEE THE DOS 4.0 DEVICE DRIVER SPEC FOR FURTHER ELABORATION.
+;
+IOCTL_REQ STRUC
+ DB (SIZE SRHEAD) DUP(?)
+ ; GENERIC IOCTL ADDITION.
+MAJORFUNCTION DB ? ;FUNCTION CODE
+MINORFUNCTION DB ? ;FUNCTION CATEGORY
+REG_SI DW ?
+REG_DI DW ?
+GENERICIOCTL_PACKET DD ? ; POINTER TO DATA BUFFER
+IOCTL_REQ ENDS
+
+; DEFINITIONS FOR IOCTL_REQ.MINORFUNCTION
+GEN_IOCTL_WRT_TRK EQU 40H
+GEN_IOCTL_RD_TRK EQU 60H
+GEN_IOCTL_FN_TST EQU 20H ; USED TO DIFF. BET READS AND WRTS
+
+;; 32-bit absolute read/write input list structure
+
+ABS_32RW STRUC
+SECTOR_RBA DD ? ; relative block address
+ABS_RW_COUNT DW ? ; number of sectors to be transferred
+BUFFER_ADDR DD ? ; data addrress
+ABS_32RW ENDS
+
+;; media ID info
+
+MEDIA_ID_INFO STRUC
+MEDIA_level DW 0 ; info level
+MEDIA_Serial DD 0 ; serial #
+MEDIA_Label DB 11 dup (' ') ;volume label
+MEDIA_System DB 8 dup (' ') ;system type
+MEDIA_ID_INFO ENDS
+
+;; equates for DOS34_FLAG
+;
+; BUGBUG: why are bits 0,1,3 and 4 not defined.
+;
+
+FROM_DISK_RESET EQU 000000000100b ;from disk reset
+Force_I24_Fail EQU 000000100000b ;form IFS CALL BACK
+Disable_EOF_I24 EQU 000001000000b ;disable EOF int24 for input status
+DBCS_VOLID EQU 000010000000b ;indicate from volume id
+DBCS_VOLID2 EQU 000100000000b ;indicate 8th char is DBCS
+CTRL_BREAK_FLAG EQU 001000000000b ;indicate control break is input
+SEARCH_FASTOPEN EQU 010000000000b ;set fastopen flag for search
+EXEC_AWARE_REDIR EQU 100000000000b ;M018: this bit is set by a redir
+ ;M018: that knows how to handle
+ ;M018: open for exec
+
+NO_FROM_DISK_RESET EQU NOT FROM_DISK_RESET ;not from disk reset
+NO_Force_I24_Fail EQU NOT Force_I24_Fail ;not form IFS CALL BACK
+NO_Disable_EOF_I24 EQU NOT Disable_EOF_I24
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/dirent.inc b/private/mvdm/dos/v86/inc/dirent.inc
new file mode 100644
index 000000000..a35896e3d
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dirent.inc
@@ -0,0 +1,75 @@
+;** Break <Directory entry>
+
+; NOTE: These offsets are also used in the DTA for
+; extended FCB SearchFirst/Next. DIR_NAME lines up
+; with the FCB filename field, and the rest of the
+; DIR_ENTRY fields follow. -DavidOls
+
+;** DIRENT.INC - FAT Directory Entry Definition
+;
+; +---------------------------+
+; | (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_CODEPG dw ? ; code page DOS 4.00
+DIR_EXTCLUSTER dw ? ; extended attribute starting cluster
+DIR_ATTR2 db ? ; reserved
+DIR_PAD db 5 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
+
+; Caution: An extended FCB SearchFirst/Next on a network
+; drive under Novell Netware 286 or 386 returns the time/date
+; in the SIZE fields for subdirectory files. Ordinarily,
+; this field is zero for subdirectory files.
+
+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
+
+
+DIRFREE equ 0E5h ; stored in dir_name[0] to indicate free slot
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/doscntry.inc b/private/mvdm/dos/v86/inc/doscntry.inc
new file mode 100644
index 000000000..b32cac3b3
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/doscntry.inc
@@ -0,0 +1,109 @@
+;
+;Equates for COUNTRY INFORMATION.
+SetCountryInfo EQU 1 ;country info
+SetUcase EQU 2 ;uppercase table
+SetLcase EQU 3 ;lowercase table (Reserved)
+SetUcaseFile EQU 4 ;uppercase file spec table
+SetFileList EQU 5 ;valid file character list
+SetCollate EQU 6 ;collating sequence
+SetDBCS EQU 7 ;double byte character set
+SetALL EQU -1 ;all the entries
+
+
+;DOS country and code page information table structure.
+;Internally, DOS gives a pointer to this table.
+;IBMBIO, MODE and NLSFUNC modules communicate with DOS through
+;this structure.
+DOS_country_cdpg_info struc
+ccInfo_reserved db 8 dup (?) ;reserved for internal use
+ccPath_CountrySys db 64 dup (0);path and filename for country info
+ccSysCodePage dw 0 ;system code page id
+ccNumber_of_entries dw 6 ; 6 entries
+ccSetUcase db SetUcase
+ccUcase_ptr dd ? ;pointer to Ucase table
+
+ccSetUcaseFile db SetUcaseFile
+ccFileUcase_ptr dd ? ;pointer to File Ucase table
+
+ccSetFileList db SetFileList
+ccFileChar_ptr dd ? ;pointer to File char list table
+
+ccSetCollate db SetCollate
+ccCollate_ptr dd ? ;pointer to collate table
+
+ccSetDBCS db SetDBCS
+ccDBCS_ptr dd ? ;pointer to DBCS table
+
+ccSetCountryInfo db SetCountryInfo
+ccCountryInfoLen dw ? ;length of country info
+ccDosCountry dw ? ;active country code id
+ccDosCodePage dw ? ;active code page id
+ccDFormat dw ? ;date format
+ccCurSymbol db " ",0;5 byte of (currency symbol+0)
+cc1000Sep db " ",0 ;2 byte of (1000 sep. + 0)
+ccDecSep db " ",0 ;2 byte of (Decimal sep. + 0)
+ccDateSep db " ",0 ;2 byte of (date sep. + 0)
+ccTimeSep db " ",0 ;2 byte of (time sep. + 0)
+ccCFormat db ? ;currency format flags
+ccCSigDigits db ? ;# of digits in currency
+ccTFormat db ? ;time format
+ccMono_Ptr dd ? ;monocase routine entry point
+ccListSep db " ",0 ;data list separator
+ccReserved_area dw 5 dup(?);reserved
+
+DOS_country_cdpg_info ends
+
+;Ucase table
+CC_UCASE_TAB struc
+ccUcase_leng dw 128
+ccUcase_data db 128 dup (?)
+CC_UCASE_TAB ends
+
+;File Ucase table
+CC_FILE_UCASE_TAB struc
+ccFileucase_leng dw 128
+ccFileucase_data db 128 dup (?)
+CC_FILE_UCASE_TAB ends
+
+;File char list
+CC_FILE_CHAR_TAB struc
+ccFilechar_leng dw ?
+ccFilechar_data db 46 dup (?)
+CC_FILE_CHAR_TAB ends
+
+;collate table
+CC_COLLATE_TAB struc
+ccCollate_leng dw 256
+ccCollate_data db 256 dup (?)
+CC_COLLATE_TAB ends
+
+;DBCS table - for DOS 4.00
+CC_DBCS_TAB struc
+ccDBCS_leng dw 6
+ccDBCS_data db 6 dup (?)
+CC_DBCS_TAB ends
+
+; 2/12/KK
+; Define subfunctions of ECS_call ( 63H ) 2/12/KK
+; 2/12/KK
+GetLeadBTBL EQU 0 ; 2/12/KK
+SetInterimMode EQU 1 ; 2/12/KK
+GetInterimMode EQU 2 ; 2/12/KK
+ ; 2/12/KK
+NonInterimMode EQU 0 ; 2/12/KK
+InterimMode EQU 1 ; 2/12/KK
+
+OLD_COUNTRY_SIZE equ (size DOS_country_cdpg_info - ccDFormat - 10)
+NEW_COUNTRY_SIZE equ (size DOS_country_cdpg_info - ccDosCountry)
+
+;CAPITALIZATION equates
+CAP_ONE_CHAR equ 20H
+CAP_STRING equ 21H
+CAP_ASCIIZ equ 22H
+CHECK_YES_NO equ 23H
+UPPER_TABLE equ 80H
+
+;NLS_YES equ 59H
+;NLS_yes2 equ 79H
+;NLS_NO equ 4EH
+;NLS_no2 equ 6EH
diff --git a/private/mvdm/dos/v86/inc/dosmac.inc b/private/mvdm/dos/v86/inc/dosmac.inc
new file mode 100644
index 000000000..ceb0577dc
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dosmac.inc
@@ -0,0 +1,1197 @@
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;** Macro definitions for MSDOS.
+;
+; Revision history:
+; M019 DB 10/26/90 - Added Cmp32 macro.
+
+TRUE EQU 0FFFFh
+FALSE EQU 0
+
+SUBTTL BREAK a listing into pages and give new subtitles
+PAGE
+BREAK MACRO subtitle
+ SUBTTL subtitle
+ PAGE
+ENDM
+.xcref break
+
+BREAK <ASMVAR - handle assembly variables once and for all>
+
+AsmVars Macro varlist
+IRP var,<varlist>
+AsmVar var
+ENDM
+ENDM
+
+AsmVar Macro var
+IFNDEF var
+var = FALSE
+ENDIF
+ENDM
+
+BREAK <I_NEED: declare a variable external, if necessary, and allocate a size>
+
+;
+; declare a variable external and allocate a size
+;
+AsmVar InstalledData
+I_NEED MACRO sym,len
+IF NOT InstalledData
+ DOSDATA SEGMENT WORD PUBLIC 'DATA'
+ IFIDN <len>,<WORD>
+ EXTRN &sym:WORD
+ ELSE
+ IFIDN <len>,<DWORD>
+ EXTRN &sym:DWORD
+ ELSE
+ EXTRN &sym:BYTE
+ ENDIF
+ ENDIF
+ DOSDATA ENDS
+ENDIF
+ENDM
+ .xcref I_need
+
+
+; call a procedure that may be external. The call will be short.
+
+invoke MACRO name
+.xcref
+ IF2
+ IFNDEF name
+ EXTRN name:NEAR
+ ENDIF
+ ENDIF
+.cref
+ CALL name
+ENDM
+.xcref invoke
+
+PAGE
+;
+; jump to a label that may be external. The jump will be near.
+;
+transfer MACRO name
+.xcref
+ IF2
+ IFNDEF name
+ EXTRN name:NEAR
+ ENDIF
+ ENDIF
+.cref
+ JUMP name
+ENDM
+.xcref transfer
+
+;
+; get a short address in a word
+;
+short_addr MACRO name
+ IFDIF <name>,<?>
+.xcref
+ IF2
+ IFNDEF name
+ EXTRN name:NEAR
+ ENDIF
+ ENDIF
+.cref
+ DW OFFSET DOSCODE:name
+ ELSE
+ DW ?
+ ENDIF
+ENDM
+.xcref short_addr
+
+;
+; get a long address in a dword
+;
+long_addr MACRO name
+.xcref
+ IF2
+ IFNDEF name
+ EXTRN name:NEAR
+ ENDIF
+ ENDIF
+.cref
+ DD name
+ENDM
+.xcref long_addr
+
+;
+; declare a PROC near or far but PUBLIC nonetheless
+;
+.xcref ?frame
+.xcref ?aframe
+.xcref ?stackdepth
+.xcref ?initstack
+?frame = 0 ; initial
+?aframe = 0 ; initial
+?stackdepth = 0 ; initial stack size
+?initstack = 0 ; initial stack size
+
+procedure MACRO name,distance
+ ?frame = 0
+ ?aframe = 2 ;; remember the pushed BP
+ PUBLIC name
+name PROC distance
+ ASSUME DS:nothing,ES:nothing
+ ?initstack = ?stackdepth ;; beginning of procedure
+ENDM
+.xcref procedure
+
+
+; end a procedure and check that stack depth is preserved
+
+EndProc MACRO name, chk
+ IFDIF <chk>,<NoCheck> ;; check the stack size
+ IF2
+ IF ?initstack NE ?stackdepth ;; is it different?
+ %OUT ***** Possible stack size error in name *****
+ ENDIF
+ ENDIF
+ ENDIF
+name ENDP
+ENDM
+.xcref endproc
+PAGE
+;
+; define a data item to be public and of an appropriate size/type
+;
+
+I_AM MACRO name,size,init
+;; declare the object public
+ PUBLIC name
+;; declare the type of the object
+ IFIDN <size>,<WORD>
+name LABEL WORD
+ I_AM_SIZE = 1
+ I_AM_LEN = 2
+ ELSE
+ IFIDN <size>,<DWORD>
+name LABEL DWORD
+ I_AM_SIZE = 2
+ I_AM_LEN = 2
+ ELSE
+ IFIDN <size>,<BYTE>
+name LABEL BYTE
+ I_AM_SIZE = 1
+ I_AM_LEN = 1
+ ELSE
+name LABEL BYTE
+ I_AM_SIZE = size
+ I_AM_LEN = 1
+ ENDIF
+ ENDIF
+ ENDIF
+;; if no initialize then allocate blank storage
+ IFB <init>
+ DB I_AM_SIZE*I_AM_LEN DUP (?)
+ ELSE
+IF NOT InstalledData
+ IRP itm,<init>
+ IF I_AM_LEN EQ 1
+ DB itm
+ ELSE
+ DW itm
+ ENDIF
+ I_AM_SIZE = I_AM_SIZE - 1
+ ENDM
+ IF I_AM_SIZE NE 0
+ %out ***** initialization of name not complete *****
+ ENDIF
+ELSE
+ DB I_AM_SIZE*I_AM_LEN DUP (?)
+ENDIF
+ ENDIF
+ENDM
+.xcref I_AM
+.xcref I_AM_SIZE
+.xcref I_AM_LEN
+I_AM_SIZE = 0
+I_AM_LEN = 0
+
+PAGE
+
+;
+; define an entry in a procedure
+;
+entry macro name
+ PUBLIC name
+name:
+endm
+.xcref entry
+
+BREAK <ERROR - store an error code then jump to a label>
+
+error macro code
+.xcref
+ MOV AL,code
+ transfer SYS_RET_ERR
+.cref
+ENDM
+.xcref error
+
+BREAK <JUMP - real jump that links up shortwise>
+;
+; given a label <lbl> either 2 byte jump to another label <lbl>_J
+; if it is near enough or 3 byte jump to <lbl>
+;
+
+jump macro lbl
+ local a
+.xcref
+
+ ifndef lbl&_J ;; is this the first invocation
+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 ;; do the short one...
+ ENDIF
+ ENDIF
+ lbl&_j = a
+.cref
+endm
+.xcref jump
+
+BREAK <RETURN - return from a function>
+
+return macro x
+ local a
+.xcref
+a:
+ RET
+ret_l = a
+.cref
+endm
+.xcref return
+
+BREAK <CONDRET - conditional return>
+
+condret macro cc,ncc
+ local a
+.xcref
+.xcref a
+.cref
+ ifdef ret_l ;; if ret_l is defined
+ if (($ - ret_l) le 126) and ($ gt ret_l)
+ ;; if ret_l is near enough then
+ a: j&cc ret_l ;; a: j<CC> to ret_l
+ ret_&cc = a ;; define ret_<CC> to be a:
+ exitm
+ endif
+ endif
+ ifdef ret_&cc ;; if ret_<CC> defined
+ if (($ - ret_&cc) le 126) and ($ gt ret_&cc)
+ ;; if ret_<CC> is near enough
+ a: j&cc ret_&cc ;; a: j<CC> to ret_<CC>
+ ret_&cc = a ;; define ret_<CC> to be a:
+ exitm
+ endif
+ endif
+ j&ncc a ;; j<NCC> a:
+ return ;; return
+ a: ;; a:
+ ret_&cc = ret_l ;; define ret_<CC> to be ret_l
+endm
+.xcref condret
+
+BREAK <RETZ - return if zero, links up shortwise if necessary>
+
+retz macro
+ condret z,nz
+endm
+.xcref retz
+
+BREAK <RETNZ - return if not zero, links up shortwise if necessary>
+
+retnz macro
+ condret nz,z
+endm
+.xcref retnz
+
+BREAK <RETC - return if carry set, links up shortwise if necessary>
+
+retc macro
+ condret c,nc
+endm
+.xcref retc
+
+BREAK <RETNC - return if not carry, links up shortwise if necessary>
+
+retnc macro
+ condret nc,c
+endm
+.xcref retnc
+
+BREAK <CONTEXT - set the DOS context to a particular register>
+
+context macro r
+ PUSH SS
+ POP r
+ ASSUME r:DOSDATA
+endm
+.xcref context
+
+BREAK <SaveReg - save a set of registers>
+
+SaveReg MACRO reglist ;; push those registers
+IRP reg,<reglist>
+ ?stackdepth = ?stackdepth + 1
+ PUSH reg
+ENDM
+ENDM
+.xcref SaveReg
+
+Save MACRO arglist ;; push those arguments
+IRP arg,<arglist>
+ ?stackdepth = ?stackdepth + 1
+ PUSH arg
+ENDM
+ENDM
+.xcref Save
+
+BREAK <RestoreReg - unsave some registers>
+
+RestoreReg MACRO reglist ;; pop those registers
+IRP reg,<reglist>
+ ?stackdepth = ?stackdepth - 1
+ POP reg
+ENDM
+ENDM
+.xcref RestoreReg
+
+Restore MACRO arglist ;; pop those arguments
+IRP arg,<arglist>
+ ?stackdepth = ?stackdepth - 1
+ POP arg
+ENDM
+ENDM
+.xcref Restore
+
+BREAK <Critical section macros>
+
+EnterCrit MACRO section
+; Invoke E&section
+ENDM
+
+LeaveCrit MACRO section
+; Invoke L&section
+ENDM
+
+Break <message - display a message>
+
+AsmVars <ShareF,Cargs,Redirector>
+
+if debug
+fmt MACRO typ,lev,fmts,args
+local a,b,c
+ PUSHF
+IFNB <typ>
+ TEST BugTyp,typ
+ JZ c
+ CMP BugLev,lev
+ JB c
+ENDIF
+ PUSH AX
+ PUSH BP
+ MOV BP,SP
+If (not sharef) and (not redirector)
+DOSDATA segment
+a db fmts,0
+DOSDATA ends
+ MOV AX,OFFSET DOSDATA:a
+else
+ jmp short b
+a db fmts,0
+if sharef
+b: mov ax,offset share:a
+else
+b: mov ax,offset netwrk:a
+endif
+endif
+ PUSH AX
+cargs = 2
+IRP item,<args>
+IFIDN <AX>,<item>
+ push [bp+2]
+ ; MOV AX,[BP+2]
+ELSE
+ ; MOV AX,item
+ push item
+ENDIF
+ ; PUSH AX
+cargs = cargs + 2
+ENDM
+ invoke PFMT
+ ADD SP,Cargs
+ POP BP
+ POP AX
+c:
+ POPF
+ENDM
+else
+fmt macro
+endm
+endif
+
+Break <DOSAssume - validate assumes>
+
+AsmVar Debug,$temp
+
+;** DOSAssume - Check that a register addresses DOSSEG
+;
+; DOSAssume reglist, message
+
+
+IF debug
+DOSAssume Macro reglist,message
+local a,b
+ $temp = 0
+ IRP r,<reglist>
+ IFIDN <r>,<DS>
+ $temp = $temp OR 2
+ ELSE
+ IFIDN <r>,<ES>
+ $temp = $temp OR 4
+ ELSE
+ IFIDN <r>,<SS>
+ $temp = $temp OR 1
+ ELSE
+ %out ***** Invalid register reg in DOSAssume *****
+ ENDIF
+ ENDIF
+ ENDIF
+ ENDM
+ Invoke SegCheck
+ jmp short a
+ db $temp
+ db message,0
+a:
+
+ IRP r,<reglist>
+ ASSUME r:DOSDATA
+ ENDM
+ENDM
+
+ELSE
+
+DOSAssume Macro reglist,message
+IRP r,<reglist>
+ ASSUME r:DOSDATA
+ENDM
+ENDM
+ENDIF
+
+BREAK <ASSERT - make assertions about registers>
+
+IF DEBUG
+Assert MACRO kind, objs, message
+ LOCAL a,b
+ IFIDN <kind>,<Z>
+ CMP objs,0
+ JZ a
+ fmt <>,<>,<message>
+a:
+ ELSE
+ IFIDN <kind>,<NZ>
+ CMP objs,0
+ JNZ a
+ fmt <>,<>,<message>
+a:
+ ELSE
+ PUSH AX
+ IRP obj,<objs>
+ PUSH obj
+ ENDM
+ IF SHAREF
+ MOV AX,OFFSET b
+ ELSE
+ MOV AX,OFFSET DOSDATA:b
+ ENDIF
+ PUSH AX
+ IFIDN <kind>,<ISBUF>
+ Invoke BUFCheck
+ ENDIF
+ IFIDN <kind>,<ISSFT>
+ Invoke SFTCheck
+ ENDIF
+ IFIDN <kind>,<ISDPB>
+ Invoke DPBCheck
+ ENDIF
+ POP AX
+ IF SHAREF
+ JMP SHORT a
+b DB Message,0
+a:
+ ELSE
+DOSDATA segment
+b db Message,0
+DOSDATA ends
+ ENDIF
+ ENDIF
+ ENDIF
+ENDM
+ELSE
+Assert Macro
+ENDM
+ENDIF
+
+Break <CallInstall - hook to installable pieces>
+
+CallInstall MACRO name,mpx,fn,save,restore
+IF Installed
+ IFNB <save>
+ SaveReg <save>
+ ENDIF
+ MOV AX,(mpx SHL 8) + fn
+ INT 2Fh
+ IFNB <restore>
+ RestoreReg <restore>
+ ENDIF
+ELSE
+ Invoke name
+ENDIF
+ENDM
+
+Break <Stack frame manipulators>
+
+localvar macro name,length
+local a
+ ifidn <length>,<BYTE>
+ ?frame = ?frame + 1
+ a = ?frame
+ name EQU BYTE PTR [BP-a]
+ else
+ ifidn <length>,<WORD>
+ ?frame = ?frame + 2
+ a = ?frame
+ name EQU WORD PTR [BP-a]
+ else
+ ifidn <length>,<DWORD>
+ ?frame = ?frame + 4
+ a = ?frame
+ name EQU DWORD PTR [BP-a]
+ name&l EQU WORD PTR [BP-a]
+ name&h EQU WORD PTR [BP-a+2]
+ else
+ ?frame = ?frame + length
+ a = ?frame
+ name EQU BYTE PTR [BP-a]
+ endif
+ endif
+ endif
+endm
+
+enter macro
+ push bp
+ mov bp,sp
+ sub sp,?frame
+endm
+
+leave macro
+ mov sp,bp
+ pop bp
+endm
+
+Argvar macro name,length
+local a
+ ifidn <length>,<BYTE>
+ a = ?aframe
+ ?aframe = ?aframe + 1
+ name EQU BYTE PTR [BP+a]
+ else
+ ifidn <length>,<WORD>
+ a = ?aframe
+ ?aframe = ?aframe + 2
+ name EQU WORD PTR [BP+a]
+ else
+ ifidn <length>,<DWORD>
+ a = ?aframe
+ ?aframe = ?aframe + 4
+ name EQU DWORD PTR [BP+a]
+ name&l EQU WORD PTR [BP+a]
+ name&h EQU WORD PTR [BP+a+2]
+ else
+ a = ?aframe
+ ?aframe = ?aframe + length
+ name EQU BYTE PTR [BP+a]
+ endif
+ endif
+ endif
+endm
+
+
+save_world macro
+
+ push es
+ invoke save_user_world
+
+endm
+
+restore_world macro
+
+ invoke restore_user_world
+ pop es
+
+endm
+
+;
+; This macro gets the DOS data segment value and puts it in the specified
+; segment register. This can only be used in the DOSCODE segment.
+;
+
+getdseg macro r
+
+ mov r, cs:[DosDseg]
+ assume r:dosdata
+endm
+
+;
+; This macro does the necessary extrns to allow use of the getdseg macro.
+;
+allow_getdseg macro
+
+ifdef ROMDOS
+ extrn BioDataSeg:word
+ bdata segment at 70H
+ extrn DosDataSg:word
+ bdata ends
+else
+ extrn DosDseg:word
+endif
+
+endm
+
+
+
+BREAK <LJcc - Long Conditional Jumps>
+
+LJE macro l
+ LJ JE JNE l
+endm
+
+LJNE macro l
+ LJ jne JE l
+endm
+
+LJZ macro l
+ LJE l
+endm
+
+LJNZ macro l
+ LJNE l
+endm
+
+LJC macro l
+ LJ jc JNC l
+endm
+
+LJNC macro l
+ LJ jnc JC l
+endm
+
+LJA macro l
+ LJ ja JNA l
+endm
+
+LJNA macro l
+ LJ jna JA l
+endm
+
+LJB macro l
+ LJ jb JNB l
+endm
+
+LJNB macro l
+ LJ jnb JB l
+endm
+
+LJS macro l
+ LJ js JNS l
+endm
+
+LJNS macro l
+ LJ jns JS l
+endm
+
+LJAE macro l
+ LJ jae JNAE l
+endm
+
+LJBE macro l
+ LJ jbe JNBE l
+endm
+
+LJL macro l
+ LJ jl JNL l
+endm
+
+LJG macro l
+ LJ jg JNG l
+endm
+
+LJLE macro l
+ LJ jle JNLE l
+endm
+
+DLJE macro l
+ DLJ JE JNE l
+endm
+
+DLJNE macro l
+ DLJ jne JE l
+endm
+
+DLJZ macro l
+ DLJE l
+endm
+
+DLJNZ macro l
+ DLJNE l
+endm
+
+DLJC macro l
+ DLJ jc JNC l
+endm
+
+DLJNC macro l
+ DLJ jnc JC l
+endm
+
+DLJA macro l
+ DLJ ja JNA l
+endm
+
+DLJNA macro l
+ DLJ jna JA l
+endm
+
+DLJB macro l
+ DLJ jb JNB l
+endm
+
+DLJNB macro l
+ DLJ jnb JB l
+endm
+
+DLJS macro l
+ DLJ js JNS l
+endm
+
+DLJNS macro l
+ DLJ jns JS l
+endm
+
+DLJAE macro l
+ DLJ jae JNAE l
+endm
+
+DLJBE macro l
+ DLJ jbe JNBE l
+endm
+
+DLJG macro l
+ DLJ jg JNG l
+endm
+
+DLJL macro l
+ DLJ jl JNL l
+endm
+
+DLJLE macro l
+ DLJ jle JNLE l
+endm
+
+
+;* LJ - generate long conditional jump
+;
+; if target preceeds us and is in range just use a short jump
+; else use a long jump
+;
+; LJ <direct jmp>,<skip jmp>,<label>
+
+LJ MACRO dirop,idirop,l
+ local a
+ IF ((.TYPE l) XOR 20h) AND 0A0h
+ idirop a ;; not defined or is external
+ jmp l
+a:
+ ELSE ;; is local definied
+ IF (($-l) LT 124) AND ($ GT l)
+ dirop l ;; is before and within range
+ ELSE
+ idirop a ;; is out of range or forward (pass 2)
+ jmp l
+a:
+ ENDIF
+ ENDIF
+ENDM
+
+
+;* DLJ - generate debug long conditional jump
+;
+; If DEBUG is defined then we generate a long jump, else a short
+; one.
+;
+; DLJ <direct jmp>,<skip jmp>,<label>
+
+DLJ MACRO dirop,idirop,l
+ local a
+ IF DEBUG
+ idirop a
+ jmp l
+a:
+ ELSE
+ dirop l
+ ENDIF
+ENDM
+
+.xcref LJE, LJNE, LJZ, LJNZ, LJC, LJNC, LJA, LJNA
+.xcref LJB, LJNB, LJS, LJNS, LJAE, LJBE, LJG, LJL, LJLE
+.xcref DLJE, DLJNE, DLJZ, DLJNZ, DLJC, DLJNC, DLJA, DLJNA
+.xcref DLJB, DLJNB, DLJS, DLJNS, DLJAE, DLJBE, DLJG, DLJL, DLJLE
+.xcref LJ,DLJ
+
+
+
+;** SHORT offset macro
+;
+; expands to SHORT if non debug, to nul if debug.
+;
+; this allows us to code
+;
+; jmp SHRT foobar
+;
+; and get a long form if debugging is turned on (because the extra
+; debug code puts the target out of range)
+
+if DEBUG
+ SHRT EQU <>
+else
+ SHRT EQU SHORT
+endif
+
+
+;** FALLTHRU - Verifies Fallthrough Validity
+
+FALLTHRU MACRO labl
+; BUGBUG - restore align when we make code segment word aligned
+; align 2 ; don't have errnz fail due to alignment
+ IF2 ; of following label
+ .errnz labl-$
+ ENDIF
+ ENDM
+
+
+;** INTTEST - Generate an INT 3 for testing
+
+INTTEST MACRO
+if DEBUG
+ int 3
+endif
+ ENDM
+
+
+;** DPUBLIC - Make a public symbol for debugging
+
+DPUBLIC MACRO arg
+if DEBUG
+ public arg
+endif
+ ENDM
+
+;* Debug Traps
+;
+; These are removed as the code is exercised
+
+TRAP macro ; Like INTTEST but is normally left in during
+ int 3 ; debugging; indicates "should not occur"
+ ENDM
+
+TRAPC macro
+ local l
+ jnc short l
+ int 3
+l:
+ ENDM
+
+TRAPNC macro
+ local l
+ jc short l
+ int 3
+l:
+ ENDM
+
+TRAPA macro
+ local l
+ jna short l
+ int 3
+l:
+ ENDM
+
+TRAPNA macro
+ local l
+ ja short l
+ int 3
+l:
+ ENDM
+
+TRAPZ macro
+ local l
+ jnz short l
+ int 3
+l:
+ ENDM
+
+TRAPNZ macro
+ local l
+ jz short l
+ int 3
+l:
+ ENDM
+
+
+
+ BREAK <Structure Field Macros>
+
+
+;** Follows - Verify that a field follows another
+;
+; FOLLOWS field1, field2 [, size]
+;
+; This macro generates an error if "field1" doesn't immeidately
+; follow "field2". If "size" is specified then an error is generated
+; if Field1 is not of the proper size.
+
+FOLLOWS macro field1, field2, fldsiz
+ .errnz field1 - size field2 - field2
+IFNB <fldsiz>
+ .errnz size field1 - fldsiz
+ENDIF
+ ENDM
+
+
+
+;** LAST - Verify that a field is the last field in a structure
+;
+; LAST fieldname, structname
+;
+; Generates an error if fieldname is not last in structname.
+
+LAST macro fldnam, strunam
+ .errnz size strunam - fldnam - size fldnam
+ endm
+
+
+
+;** TESTB - Use Byte form for Word TESTS, when possible
+;
+; TESTB is used in place of 16-bit TEST instructions. It substitutes
+; a smaller 8-bit test when possible.
+
+TESTB macro targ,mask,thirdarg
+ local mask2,delta
+
+ifnb <thirdarg>
+ .err mask must be enclosed in brackets
+endif
+
+ifidn <targ>,<[bx]>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<[si]>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<[di]> ; don't process these operands specially
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<[BX]>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<[SI]>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<[DI]>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<SI>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<DI>
+ test targ,mask
+ exitm
+endif
+ifidn <targ>,<BP>
+ test targ,mask
+ exitm
+endif
+delta = 0
+mask2 = mask
+
+ if mask2 AND 0ff00h
+; have a mask bit in the high half
+ if mask2 AND 0ffh
+ test targ,mask
+ exitm
+ endif
+ mask2 = mask2 SHR 8
+ delta = 1
+ endif
+
+ifidn <targ>,<AX>
+ if delta
+ test targ,mask
+ else
+ test AL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<BX>
+ if delta
+ test BH,mask2
+ else
+ test BL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<CX>
+ if delta
+ test CH,mask2
+ else
+ test CL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<DX>
+ if delta
+ test DH,mask2
+ else
+ test DL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<ax>
+ if delta
+ test targ,mask
+ else
+ test AL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<bx>
+ if delta
+ test BH,mask2
+ else
+ test BL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<cx>
+ if delta
+ test CH,mask2
+ else
+ test CL,mask2
+ endif
+ exitm
+endif
+ifidn <targ>,<dx>
+ if delta
+ test DH,mask2
+ else
+ test DL,mask2
+ endif
+ exitm
+endif
+
+ test byte ptr targ+delta,mask2
+ endm
+
+
+;
+; Some old versions of the 80286 have a bug in the chip. The popf
+; instruction will enable interrupts. Therefore in a section of code with
+; interrupts disabled and you need a popf instruction use the 'popff'
+; macro instead.
+;
+
+POPFF macro
+ jmp $+3
+ iret
+ push cs
+ call $-2
+ endm
+
+Break <Cmp32 - 32-bit compare>
+;----------------------------------------------------------------------------
+;
+; Macro Name : Cmp32
+;
+; Inputs:
+; msw1 -- 1st operand, most significant word; MUST BE REGISTER.
+; lsw1 -- 1st operand, least significant word; MUST BE REGISTER.
+; msw2 -- 2nd operand, most significant word.
+; lsw2 -- 2nd operand, least significant word.
+; Function:
+; Compare 2 32-bit operands. Implemented as a macro.
+; Outputs:
+; CF = 1 if 1st operand < 2nd operand
+; = 0 if 1st operand >= 2nd operand
+; ZF = 1 if 1st operand == 2nd operand
+; = 0 if 1st operand <> 2nd operand
+;-----------------------------------------------------------------------------
+;M019: Created.
+
+Cmp32 MACRO msw1,lsw1,msw2,lsw2
+ LOCAL cmp32x
+
+ cmp msw1,msw2
+ jne cmp32x
+ cmp lsw1,lsw2
+cmp32x:
+ ENDM
+
+Break <HRDSVC - SVC call where hard error is possible>
+;----------------------------------------------------------------------------
+;
+; Macro Name : HRDSVC
+;
+; Inputs:
+; iSVC -- SVC index
+; Function:
+; Make a DEM SVC. If hard error happens handle it.
+; Outputs:
+; CF = 1 if operation failed
+; = 0 if operation successful
+;-----------------------------------------------------------------------------
+
+HRDSVC MACRO iSVC
+ LOCAL hs_nerr,hs_fail,hs_retry
+
+ SVC iSVC
+ jnc hs_nerr
+
+ ; Check if hard err to be handled . If no harderr then it
+ ; will come back without effecting any reg or carry flags.
+ ; Else it will do an int24. If user chooses retry it
+ ; will retry the SVC call. On fail or abort it will
+ ; come back with usual dos style setup.
+ ; If user chose "Abort" it wont come back
+
+ invoke TestHrdErr
+hs_nerr:
+ ENDM
+
diff --git a/private/mvdm/dos/v86/inc/dosseg.inc b/private/mvdm/dos/v86/inc/dosseg.inc
new file mode 100644
index 000000000..96dfd0811
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dosseg.inc
@@ -0,0 +1,23 @@
+;** segment ordering for MSDOS
+;
+;
+
+; There are just two (real) segments, DOSCODE and DOSDATA.
+; All the initialization and startup code in in the
+; DOSCODE segment.
+;
+
+
+DOSCODE SEGMENT BYTE PUBLIC 'CODE'
+DOSCODE ENDS
+
+DUM SEGMENT PARA PUBLIC 'DUM'
+DUM ENDS
+
+DOSDATA SEGMENT WORD PUBLIC 'DATA'
+DOSDATA ENDS
+
+DOSDATALAST SEGMENT WORD PUBLIC 'DATA'
+DOSDATALAST ENDS
+
+DOSGRP GROUP DOSDATA,DOSDATALAST
diff --git a/private/mvdm/dos/v86/inc/dossym.inc b/private/mvdm/dos/v86/inc/dossym.inc
new file mode 100644
index 000000000..869f17e3c
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dossym.inc
@@ -0,0 +1,178 @@
+; PAGE 80,132
+ .xall
+
+; Revision History:
+;
+; M003 - added A20OFF_FLAG for MS PASCAL 3.2 compatibility support
+; for DOS5.X running in HMA.
+;
+; M004 - added bit definition SETSSSP for DOS_FLAG for supporting
+; exe files without stack segment.
+; This is no longer needed as we modify SP only. Removing
+; this equate. 9/26/90
+;
+; M009 - addded comments relating to mace mkeyrate ver 1.0 support
+; with DOS in HMA.
+;
+; M025 - Added SWITCHES=/W for suppressing mandatory loading
+; of WINA20.386
+;
+; M027 - Support for copy protected apps. Defined bit 2 of DOS_FLAG
+;
+
+TRUE EQU 0FFFFh
+FALSE EQU 0
+
+Installed = TRUE
+IFNDEF DEBUG
+ DEBUG = FALSE
+ENDIF
+
+include dbcs.sw
+include dosmac.INC
+include VERSIONA.INC
+include VERSION.INC
+
+
+BREAK <Control character definitions>
+
+c_DEL EQU 7Fh ; ASCII rubout or delete previous char
+c_BS EQU 08h ; ^H ASCII backspace
+c_CR EQU 0Dh ; ^M ASCII carriage return
+c_LF EQU 0Ah ; ^J ASCII linefeed
+c_ETB EQU 17h ; ^W ASCII end of transmission
+c_NAK EQU 15h ; ^U ASCII negative acknowledge
+c_ETX EQU 03h ; ^C ASCII end of text
+c_HT EQU 09h ; ^I ASCII tab
+
+BREAK <Read This and Weep>
+
+include buffer.INC
+
+BREAK <User stack inside of system call and SysVars>
+; Location of user registers relative user stack pointer
+
+user_environ STRUC
+user_AX DW ? ; 00 hex offsets to
+user_BX DW ? ; 02 facilitate debugging
+user_CX DW ? ; 04
+user_DX DW ? ; 06
+user_SI DW ? ; 08
+user_DI DW ? ; 0A
+user_BP DW ? ; 0C
+user_DS DW ? ; 0E
+user_ES DW ? ; 10
+user_IP DW ? ; 12
+user_CS DW ? ; 14
+user_F DW ? ; 16
+user_environ ENDS
+
+
+ BREAK <Disk map>
+
+; MSDOS partitions the disk into 4 sections:
+;
+; phys sector 0: +-------------------+
+; | | boot/reserved |
+; | +-------------------+
+; | | File allocation |
+; v | table(s) |
+; | (multiple copies |
+; | are kept) |
+; +-------------------+
+; | Directory |
+; +-------------------+
+; | File space |
+; +-------------------+
+; | Unaddressable |
+; | (to end of disk) |
+; +-------------------+
+;
+; All partition boundaries are sector boundaries. The size of the FAT is
+; adjusted to maximize the file space addressable.
+
+include dirent.INC
+
+BREAK <File allocation Table information>
+;
+; The File Allocation Table uses a 12-bit entry for each allocation unit on
+; the disk. These entries are packed, two for every three bytes. The contents
+; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
+; to the base address of the Allocation Table; 3) fetching the 16-bit word
+; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
+; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
+; number zero is used as an end-of-file trap in the OS and is passed to the
+; BIOS to help determine disk format. Entry 1 is reserved for future use.
+; The first available allocation unit is assigned entry number two, and even
+; though it is the first, is called cluster 2. Entries greater than 0FF8H
+; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
+; are unallocated. Otherwise, the contents of a FAT entry is the number of
+; the next cluster in the file.
+;
+; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
+; do because these clusters show as allocated, but are not part of any
+; allocation chain and thus will never be allocated to a file. A particular
+; number is selected so that disk checking programs know what to do (ie. a
+; cluster with entry FF7H which is not in a chain is not an error).
+
+
+
+
+;** Character Type Flags
+;
+; These flags are used in a lookup table indexed by the character code.
+; They're used to quickly classify characters when parsing paths.
+; I think that these are only used to parse FCBs - jgl
+
+FCHK equ 1 ; I think this means "normal name char, no chks needed" -jgl
+FDELIM equ 2 ; is a delimiter
+FSPCHK equ 4 ; set if character is not a space or equivalent
+FFCB equ 8 ; is valid in an FCB
+
+
+ include error.INC
+
+;** Bit definitions for DOS_FLAG
+;
+; Bit 0 - this is set when a $open call is made from $exec. This is used in
+; $open to indicate to the redirector that this open is being made
+; by an exec call.
+;
+; Bit 2
+;
+; M003, M027:
+;
+; The start up code of MS PASCAL 3.2 programs depend on the 1M address wrap
+; if they load below 64K. This is a likely possiblity in DOS 5.x with DOS in
+; the HMA. By default DOS will turn A20 OFF before Xferring control to the
+; user program in the case of an Exec call. The next call to DOS will turn
+; A20 line ON. It has been observed that MS PASCAL 3.2 start up does an int
+; 21 ah=25h call before executing the faulty code. This will turn A20 On.
+; In order to support this we will set Bit 2 of this flag in the DOS exec
+; call (msproc.asm) if DOS is running in the HMA. In $set_interrupt_vector in
+; getset.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
+; by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
+; is non zero then A20 will be turned OFF before returning to the user.
+; Bit 2 will be unconditionally cleared here.
+;
+; M009, M027:
+;
+; Mace utilities MKEYRATE.COM version 1.0 copyright 1987 is an execpacked
+; program converted to a com file. Therefore if DOS is loaded high and if
+; this program is loaded below 64K it will blurt out "packed file is corrupt".
+; This program does an int 21 ah=49h before executing the buggy execpacked
+; code. This int21 call turns a20 on and hence the problem. In $dealloc
+; alloc.asm A20OFF_COUNT is set to 1 if bit 2 of DOS_FLAG was previously set
+; by a call to exec and if A20OFF_COUNT is 0. In msdisp.asm, if A20OFF_COUNT
+; is non zero then A20 will be turned OFF before returning to the user.
+; Bit 2 will be unconditionally cleared here.
+;
+;
+;
+
+EXECOPEN EQU 00000001b ; bit 0 of DOS_FLAG
+SUPPRESS_WINA20 EQU 00000010b ; M025
+EXECA20OFF EQU 00000100b ; bit 2 of DOS_FLAG
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/dpb.inc b/private/mvdm/dos/v86/inc/dpb.inc
new file mode 100644
index 000000000..f9357a717
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dpb.inc
@@ -0,0 +1,51 @@
+ BREAK <DPB structure>
+
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;** DPB - Drive Parameter Block
+;
+; BUGBUG - this isn't authorative - it's my probably incomplete and
+; possibly inaccurate deductions from code study... - jgl
+;
+; The DPB is DOS's main structure for describing block devices.
+; It contains info about the "Drive" intermingled with info about
+; the FAT file system which is presumably on the drive. I don't know
+; how those fields are used if it's not the FAT file system - BUGBUG
+;
+; The DPBs are statically allocated and chained off of DPBHead.
+; Users scan this chain looking for a match on DPB_DRIVE.
+; The DPBs are built at init time from info in the SYSDEV structure.
+
+
+DPB STRUC
+
+DPB_DRIVE DB ? ; Logical drive # assoc with DPB (A=0,B=1,...)
+DPB_UNIT DB ? ; Driver unit number of DPB
+DPB_SECTOR_SIZE DW ? ; Size of physical sector in bytes
+DPB_CLUSTER_MASK DB ? ; Sectors/cluster - 1
+DPB_CLUSTER_SHIFT DB ? ; Log2 of sectors/cluster
+DPB_FIRST_FAT DW ? ; Starting record of FATs
+DPB_FAT_COUNT DB ? ; Number of FATs for this drive
+DPB_ROOT_ENTRIES DW ? ; Number of directory entries
+DPB_FIRST_SECTOR DW ? ; First sector of first cluster
+DPB_MAX_CLUSTER DW ? ; Number of clusters on drive + 1
+DPB_FAT_SIZE DW ? ; Number of records occupied by FAT
+DPB_DIR_SECTOR DW ? ; Starting record of directory
+DPB_DRIVER_ADDR DD ? ; Pointer to driver
+DPB_MEDIA DB ? ; Media byte
+DPB_FIRST_ACCESS DB ? ; This is initialized to -1 to force a media
+ ; check the first time this DPB is used
+DPB_NEXT_DPB DD ? ; Pointer to next Drive parameter block
+DPB_NEXT_FREE DW ? ; Cluster # of last allocated cluster
+DPB_FREE_CNT DW ? ; Count of free clusters, -1 if unknown
+
+DPB ENDS
+
+DPBSIZ EQU SIZE DPB ; Size of the structure in bytes
+
+DSKSIZ = DPB_max_CLUSTER ; Size of disk (temp used during init only)
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/dpl.asm b/private/mvdm/dos/v86/inc/dpl.asm
new file mode 100644
index 000000000..cf29b91fb
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dpl.asm
@@ -0,0 +1,15 @@
+; SCCSID = @(#)dpl.asm 1.1 85/04/10
+; SCCSID = @(#)dpl.asm 1.1 85/04/10
+DPL STRUC
+DPL_AX DW ? ; AX register
+DPL_BX DW ? ; BX register
+DPL_CX DW ? ; CX register
+DPL_DX DW ? ; DX register
+DPL_SI DW ? ; SI register
+DPL_DI DW ? ; DI register
+DPL_DS DW ? ; DS register
+DPL_ES DW ? ; ES register
+DPL_reserved DW ? ; Reserved
+DPL_UID DW ? ; User (Machine) ID (0 = local macine)
+DPL_PID DW ? ; Process ID (0 = local user PID)
+DPL ENDS
diff --git a/private/mvdm/dos/v86/inc/dseg.inc b/private/mvdm/dos/v86/inc/dseg.inc
new file mode 100644
index 000000000..8a527badb
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/dseg.inc
@@ -0,0 +1,208 @@
+;---Revised 8-17-84 FOR KBX (ADDED ADDITIONAL KEYBOARD FLAG - KB_FLAG_3)
+;----------------------------------------
+; 0286 INTERRUPT LOCATIONS (READ):
+;----------------------------------------
+ABS0 SEGMENT AT 0
+STG_LOC0 LABEL BYTE
+ ORG 2*4
+NMI_PTR LABEL WORD
+ ORG 5*4
+INT5_PTR LABEL WORD
+ ORG 8*4
+INT_ADDR LABEL WORD
+INT_PTR LABEL DWORD
+ ORG 10H*4
+VIDEO_INT LABEL WORD
+ ORG 13H*4 ; NEW FDISK
+ORG_VECTOR LABEL DWORD
+ ORG 18H*4
+BASIC_PTR LABEL WORD
+ ORG 19H*4
+BOOT_VEC LABEL DWORD
+BOOT_VECTOR LABEL DWORD
+ ORG 1DH*4
+PARM_PTR LABEL DWORD ; POINTER TO VIDEO PARMS
+ ORG 1EH*4
+DISK_POINTER LABEL DWORD
+ ORG 01FH*4
+EXT_PTR LABEL DWORD
+ ORG 40H*4 ; DISKETTE POINTER
+DISK_VECTOR LABEL DWORD
+ ORG 41H*4
+HF_TBL_VEC LABEL DWORD
+ ORG 46H*4
+HF1_TBL_VEC LABEL DWORD
+ ORG 70H*4
+SLAVE_INT_PTR LABEL DWORD
+RTC_INT_VEC LABEL DWORD ; REAL TIME CLOCK INT
+ ORG 76H*4 ; FIXED DISK INTERRUPT VECTOR
+HDISK_INT LABEL DWORD
+ ORG 400H
+DATA_AREA LABEL BYTE ;ABSOLUTE LOCATION OF DATA SEGMENT
+DATA_WORD LABEL WORD
+ ORG 0500H
+MFG_TEST_RTN LABEL FAR
+ ORG 7C00H
+BOOT_LOCN LABEL FAR
+ABS0 ENDS
+PAGE
+;------------------------------------------------
+; STACK -- USED DURING INITIALIZATION ONLY :
+;------------------------------------------------
+STACK SEGMENT AT 30H
+ DW 128 DUP(?)
+TOS LABEL WORD
+STACK ENDS
+;----------------------------------------
+; ROM BIOS DATA AREAS :
+;----------------------------------------
+DATA SEGMENT AT 40H
+;DATA_BASE LABEL BYTE
+RS232_BASE DW 4 DUP(?) ; ADDRESSES OF RS232 ADAPTERS
+PRINTER_BASE DW 4 DUP(?) ; ADDRESSES OF PRINTERS
+EQUIP_FLAG DW 1 DUP(?) ; INSTALLED HARDWARE
+MFG_TST DB 1 DUP(?) ; INITIALIZATION FLAG
+MEMORY_SIZE DW 1 DUP(?) ; MEMORY SIZE IN K BYTES
+MFG_ERR_FLAG DB 1 DUP(?) ; SCRATCHPAD FOR MANUFACTURING
+ DB 1 DUP(?) ; ERROR CODES
+PAGE
+;----------------------------------------
+; KEYBOARD DATA AREAS :
+;----------------------------------------
+KB_FLAG DB 1 DUP(?)
+KB_FLAG_1 DB 1 DUP(?) ; SECOND BYTE OF KEYBOARD STATUS
+ALT_INPUT DB 1 DUP(?) ; STORAGE FOR ALTERNATE KEYPAD ENTRY
+BUFFER_HEAD DW 1 DUP(?) ; POINTER TO HEAD OF KEYBOARD BUFFER
+BUFFER_TAIL DW 1 DUP(?) ; POINTER TO TAIL OF KEYBOARD BUFFER
+KB_BUFFER DW 16 DUP(?) ; ROOM FOR 15 ENTRIES
+KB_BUFFER_END LABEL WORD
+
+;------ HEAD = TAIL INDICATES THAT THE BUFFER IS EMPTY
+
+;----------------------------------------
+; DISKETTE DATA AREAS :
+;----------------------------------------
+SEEK_STATUS DB 1 DUP(?) ; DRIVE RECALIBRATION STATUS
+ ; BIT 3-0 = DRIVE 3-0 NEEDS RECAL
+ ; BEFORE NEXT SEEK IF BIT IS = 0
+MOTOR_STATUS DB 1 DUP(?) ; MOTOR STATUS
+ ; BIT 3-0 = DRIVE 3-0 IS CURRENTLY
+ ; RUNNING
+ ; BIT 7 = CURRENT OPERATION IS A WRITE,
+ ; REQUIRES DELAY
+MOTOR_COUNT DB 1 DUP(?) ; TIME OUT COUNTER FOR DRIVE TURN OFF
+DISKETTE_STATUS DB 1 DUP(?) ; RETURN CODE STATUS BYTE
+CMD_BLOCK LABEL BYTE
+HD_ERROR LABEL BYTE
+NEC_STATUS DB 7 DUP(?) ; STATUS BYTES FROM NEC
+PAGE
+;----------------------------------------
+; VIDEO DISPLAY DATA AREA :
+;----------------------------------------
+CRT_MODE DB 1 DUP(?) ; CURRENT CRT MODE
+CRT_COLS DW 1 DUP(?) ; NUMBER OF COLUMNS ON SCREEN
+CRT_LEN DW 1 DUP(?) ; LENGTH OF REGEN IN BYTES
+CRT_START DW 1 DUP(?) ; STARTING ADDRESS IN REGEN BUFFER
+CURSOR_POSN DW 8 DUP(?) ; CURSOR FOR EACH OF UP TO 8 PAGES
+CURSOR_MODE DW 1 DUP(?) ; CURRENT CURSOR MODE SETTING
+ACTIVE_PAGE DB 1 DUP(?) ; CURRENT PAGE BEING DISPLAYED
+ADDR_6845 DW 1 DUP(?) ; BASE ADDRESS FOR ACTIVE DISPLAY CARD
+CRT_MODE_SET DB 1 DUP(?) ; CURRENT SETTING OF THE 3X8 REGISTER
+CRT_PALLETTE DB 1 DUP(?) ; CURRENT PALLETTE SETTING COLOR CARD
+PAGE
+;----------------------------------------
+; POST DATA AREA :
+;----------------------------------------
+IO_ROM_INIT DW 1 DUP(?) ; PNTR TO OPTIONAL I/O ROM INIT ROUTINE
+IO_ROM_SEG DW 1 DUP(?) ; POINTER TO IO ROM SEGMENT
+INTR_FLAG DB 1 DUP(?) ; FLAG TO INDICATE AN INTERRUPT HAPPEND
+;----------------------------------------
+; TIMER DATA AREA :
+;----------------------------------------
+TIMER_LOW DW 1 DUP(?) ; LOW WORD OF TIMER COUNT
+TIMER_HIGH DW 1 DUP(?) ; HIGH WORD OF TIMER COUNT
+TIMER_OFL DB 1 DUP(?) ; TIMER HAS ROLLED OVER SINCE LAST READ
+;----------------------------------------
+; SYSTEM DATA AREA :
+;----------------------------------------
+BIOS_BREAK DB 1 DUP(?) ; BIT 7=1 IF BREAK KEY HAS BEEN HIT
+RESET_FLAG DW 1 DUP(?) ; WORD=1234H IF KEYBOARD RESET UNDERWAY
+PAGE
+;----------------------------------------
+; HARD FILE DATA AREAS :
+;----------------------------------------
+DISK_STATUS1 DB 1 DUP(?)
+HF_NUM DB 1 DUP(?)
+CONTROL_BYTE DB 1 DUP(?)
+PORT_OFF DB 1 DUP(?)
+;------------------------------------------------------
+; PRINTER AND RS232 TIME-OUT VARIABLES :
+;------------------------------------------------------
+PRINT_TIM_OUT DB 4 DUP(?)
+RS232_TIM_OUT DB 4 DUP(?)
+;----------------------------------------
+; ADDITIONAL KEYBOARD DATA AREA :
+;----------------------------------------
+BUFFER_START DW 1 DUP(?)
+BUFFER_END DW 1 DUP(?)
+;---------------------------------------
+; ADDITIONAL FLOPPY DATA ;
+;---------------------------------------
+ ORG 8BH
+LASTRATE DB 1 DUP(?) ; LAST DATA RATE SELECTED
+PAGE
+;---------------------------------------
+; ADDITIONAL HARD FILE DATA :
+;---------------------------------------
+ ORG 8CH
+HF_STATUS DB 1 DUP(?) ; STATUS REGISTER
+HF_ERROR DB 1 DUP(?) ; ERROR REGISTER
+HF_INT_FLAG DB 1 DUP(?) ; HARD FILE INTERRUPT FLAG
+HF_CNTRL DB 1 DUP(?) ; COMBO HARD FILE/FLOPPY CARD BIT 0=1
+;----------------------------------------
+; ADDITIONAL DISKETTE AREA :
+;----------------------------------------
+ ORG 90H
+DSK_STATE LABEL BYTE
+ DB 1 DUP(?) ; DRIVE 0 MEDIA STATE
+ DB 1 DUP(?) ; DRIVE 1 MEDIA STATE
+ DB 1 DUP(?) ; DRIVE 0 OPERATION START STATE
+ DB 1 DUP(?) ; DRIVE 1 OPERATION START STATE
+DSK_TRK DB 1 DUP(?) ; DRIVE 0 PRESENT CYLINDER
+ DB 1 DUP(?) ; DRIVE 1 PRESENT CYLINDER
+ DB 1 DUP(?) ; RESERVED
+;---------------------------------------- AEV
+; ADDITIONAL KEYBOARD FLAG FOR KBX: AEV
+;---------------------------------------- AEV
+ ORG 96H ; AEV
+KB_FLAG_3 DB 1 DUP(?) ; AEV
+;----------------------------------------
+; ADDITIONAL KEYBOARD LED FLAG :
+;----------------------------------------
+ ORG 97H
+KB_FLAG_2 DB 1 DUP(?)
+PAGE
+;----------------------------------------
+; REAL TIME CLOCK DATA AREA :
+;----------------------------------------
+ ORG 98H
+USER_FLAG DW 1 DUP(?) ; OFFSET ADDR OF USERS WAIT FLAG
+USER_FLAG_SEG DW 1 DUP(?) ; SEG ADDR OF USER WAIT FLAG
+RTC_LOW DW 1 DUP(?) ; LOW WORD OF USER WAIT FLAG
+RTC_HIGH DW 1 DUP(?) ; HIGH WORD OF USER WAIT FLAG
+RTC_WAIT_FLAG DB 1 DUP(?) ; WAIT ACTIVE FLAG
+DATA ENDS
+;----------------------------------------
+; EXTRA DATA AREA :
+;----------------------------------------
+XXDATA SEGMENT AT 50H
+STATUS_BYTE DB 1 DUP(?)
+XXDATA ENDS
+;----------------------------------------
+; VIDEO DISPLAY BUFFER :
+;----------------------------------------
+VIDEO_RAM SEGMENT AT 0B800H
+REGEN LABEL BYTE
+REGENW LABEL WORD
+ DB 16384 DUP(?)
+VIDEO_RAM ENDS
diff --git a/private/mvdm/dos/v86/inc/ea.inc b/private/mvdm/dos/v86/inc/ea.inc
new file mode 100644
index 000000000..c77cde272
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/ea.inc
@@ -0,0 +1,72 @@
+
+;Get/Set Extended Attrbute Equates
+
+;The following equates are for EA types
+
+EAISUNDEF equ 00H ; undefined
+EAISLOGICAL equ 01H ; logical (0 or 1), 1 byte
+EAISBINARY equ 02H ; binary integer 1, 2, or 4 bytes
+EAISASCII equ 03H ; ASCII , 0 to 128 bytes
+EAISDATE equ 04H ; DOS file date format, 2 bytes
+EAISTIME equ 05H ; DOS file time format, 2 bytes
+
+;The following equates are for EA flags
+
+EASYSTEM equ 8000H ; system defined, bultin
+EAREADONLY equ 4000H ; read-only , cannot be changed
+EAHIDDEN equ 2000H ; hidden from ATTRIB
+EACREATEONLY equ 1000H ; settable only at create time
+
+;The following equates are for EA failure reason code (set by DOS)
+
+EARCSUCCESS equ 00H ; success
+EARCNOTFOUND equ 01H ; name not found
+EARCNOSPACE equ 02H ; no space to hold name or value
+EARCNOTNOW equ 03H ; name can't be set on this function
+EARCNOTEVER equ 04H ; name can't be set
+EARCUNDEF equ 05H ; name known to IFS but not supported
+EARCDEFBAD equ 06H ; EA definition bad (type,length, etc)
+EARCACCESS equ 07H ; EA access denied
+EARCBADVAL equ 08H ; bad value
+EARCDEVERROR equ 09H ; device error
+EARCUNKNOWN equ 0FFFFH ; unknown cause
+
+
+;The following equates are for EA file type
+
+EAEXISTING equ 00H ; existing file
+EARTL equ 02H ; right to left
+EAEXECUTABLE equ 03H ; executable program
+EAINSTALLABLE equ 04H ; installable executable program
+EAOVERLAY equ 05H ; program overlay
+EADEV_DRIVER equ 06H ; device driver
+EAIFS_DRIVER equ 07H ; ifs deriver
+
+
+
+
+By_Create equ 0000010B ; set by Extended Open (create)
+BY_XA equ 0000100B ; set by Get/Set XA by Handle
+
+;Extended Attribute Structure
+
+EA STRUC ; extended attribute list
+EA_TYPE DB ? ; type
+EA_FLAGS DW ? ; flags
+EA_RC DB ? ; reason code
+EA_NAMELEN DB ? ; name length
+EA_VALLEN DW ? ; value length
+EA_NAME DB ? ; name
+EA ENDS
+
+
+;Query Extended Attribute list
+
+QEA STRUC ; extended attribute list
+QEA_TYPE DB ? ; type
+QEA_FLAGS DW ? ; flags
+QEA_NAMELEN DB ? ; name length
+QEA_NAME DB ? ; name
+QEA ENDS
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/error.inc b/private/mvdm/dos/v86/inc/error.inc
new file mode 100644
index 000000000..3929aa8c0
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/error.inc
@@ -0,0 +1,169 @@
+ BREAK <DOS error codes>
+
+;** ERROR.INC - DOS Error Codes
+;
+; The newer (DOS 2.0 and above) "XENIX-style" calls
+; return error codes through AX. If an error occurred then
+; the carry bit will be set and the error code is in AX. If no error
+; occurred then the carry bit is reset and AX contains returned info.
+;
+; Since the set of error codes is being extended as we extend the operating
+; system, we have provided a means for applications to ask the system for a
+; recommended course of action when they receive an error.
+;
+; The GetExtendedError system call returns a universal error, an error
+; location and a recommended course of action. The universal error code is
+; a symptom of the error REGARDLESS of the context in which GetExtendedError
+; is issued.
+
+
+; 2.0 error codes
+
+error_invalid_function EQU 1
+error_file_not_found EQU 2
+error_path_not_found EQU 3
+error_too_many_open_files EQU 4
+error_access_denied EQU 5
+error_invalid_handle EQU 6
+error_arena_trashed EQU 7
+error_not_enough_memory EQU 8
+error_invalid_block EQU 9
+error_bad_environment EQU 10
+error_bad_format EQU 11
+error_invalid_access EQU 12
+error_invalid_data EQU 13
+;**** reserved EQU 14 ; *****
+error_invalid_drive EQU 15
+error_current_directory EQU 16
+error_not_same_device EQU 17
+error_no_more_files EQU 18
+
+; These are the universal int 24 mappings for the old INT 24 set of errors
+
+error_write_protect EQU 19
+error_bad_unit EQU 20
+error_not_ready EQU 21
+error_bad_command EQU 22
+error_CRC EQU 23
+error_bad_length EQU 24
+error_Seek EQU 25
+error_not_DOS_disk EQU 26
+error_sector_not_found EQU 27
+error_out_of_paper EQU 28
+error_write_fault EQU 29
+error_read_fault EQU 30
+error_gen_failure EQU 31
+
+; the new 3.0 error codes reported through INT 24
+
+error_sharing_violation EQU 32
+error_lock_violation EQU 33
+error_wrong_disk EQU 34
+error_FCB_unavailable EQU 35
+error_sharing_buffer_exceeded EQU 36
+error_Code_Page_Mismatched EQU 37 ; DOS 4.00 ;AN000;
+error_handle_EOF EQU 38 ; DOS 4.00 ;AN000;
+error_handle_Disk_Full EQU 39 ; DOS 4.00 ;AN000;
+
+; New OEM network-related errors are 50-79
+
+error_not_supported EQU 50
+
+error_net_access_denied EQU 65 ;M028
+
+; End of INT 24 reportable errors
+
+error_file_exists EQU 80
+error_DUP_FCB EQU 81 ; *****
+error_cannot_make EQU 82
+error_FAIL_I24 EQU 83
+
+; New 3.0 network related error codes
+
+error_out_of_structures EQU 84
+error_Already_assigned EQU 85
+error_invalid_password EQU 86
+error_invalid_parameter EQU 87
+error_NET_write_fault EQU 88
+error_sys_comp_not_loaded EQU 90 ; DOS 4.00 ;AN000;
+
+
+
+
+ BREAK <Interrupt 24 error codes>
+
+;** Int24 Error Codes
+
+error_I24_write_protect EQU 0
+error_I24_bad_unit EQU 1
+error_I24_not_ready EQU 2
+error_I24_bad_command EQU 3
+error_I24_CRC EQU 4
+error_I24_bad_length EQU 5
+error_I24_Seek EQU 6
+error_I24_not_DOS_disk EQU 7
+error_I24_sector_not_found EQU 8
+error_I24_out_of_paper EQU 9
+error_I24_write_fault EQU 0Ah
+error_I24_read_fault EQU 0Bh
+error_I24_gen_failure EQU 0Ch
+; NOTE: Code 0DH is used by MT-DOS.
+error_I24_wrong_disk EQU 0Fh
+
+
+; THE FOLLOWING ARE MASKS FOR THE AH REGISTER ON Int 24
+;
+; NOTE: ABORT is ALWAYS allowed
+
+Allowed_FAIL EQU 00001000B
+Allowed_RETRY EQU 00010000B
+Allowed_IGNORE EQU 00100000B
+
+I24_operation EQU 00000001B ;Z if READ,NZ if Write
+I24_area EQU 00000110B ; 00 if DOS
+ ; 01 if FAT
+ ; 10 if root DIR
+ ; 11 if DATA
+I24_class EQU 10000000B ;Z if DISK, NZ if FAT or char
+
+
+ BREAK <GetExtendedError CLASSes ACTIONs LOCUSs>
+
+;** The GetExtendedError call takes an error code and returns CLASS,
+; ACTION and LOCUS codes to help programs determine the proper action
+; to take for error codes that they don't explicitly understand.
+
+
+; Values for error CLASS
+
+errCLASS_OutRes EQU 1 ; Out of Resource
+errCLASS_TempSit EQU 2 ; Temporary Situation
+errCLASS_Auth EQU 3 ; Permission problem
+errCLASS_Intrn EQU 4 ; Internal System Error
+errCLASS_HrdFail EQU 5 ; Hardware Failure
+errCLASS_SysFail EQU 6 ; System Failure
+errCLASS_Apperr EQU 7 ; Application Error
+errCLASS_NotFnd EQU 8 ; Not Found
+errCLASS_BadFmt EQU 9 ; Bad Format
+errCLASS_Locked EQU 10 ; Locked
+errCLASS_Media EQU 11 ; Media Failure
+errCLASS_Already EQU 12 ; Collision with Existing Item
+errCLASS_Unk EQU 13 ; Unknown/other
+
+; Values for error ACTION
+
+errACT_Retry EQU 1 ; Retry
+errACT_DlyRet EQU 2 ; Delay Retry, retry after pause
+errACT_User EQU 3 ; Ask user to regive info
+errACT_Abort EQU 4 ; abort with clean up
+errACT_Panic EQU 5 ; abort immediately
+errACT_Ignore EQU 6 ; ignore
+errACT_IntRet EQU 7 ; Retry after User Intervention
+
+; Values for error LOCUS
+
+errLOC_Unk EQU 1 ; No appropriate value
+errLOC_Disk EQU 2 ; Random Access Mass Storage
+errLOC_Net EQU 3 ; Network
+errLOC_SerDev EQU 4 ; Serial Device
+errLOC_Mem EQU 5 ; Memory
diff --git a/private/mvdm/dos/v86/inc/exe.inc b/private/mvdm/dos/v86/inc/exe.inc
new file mode 100644
index 000000000..5d8f309db
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/exe.inc
@@ -0,0 +1,113 @@
+ BREAK <EXEC and EXE file structures>
+
+;
+;----------------------------------------------------------------------------
+;
+; M00x : 4b04 implementation
+;
+;----------------------------------------------------------------------------
+;
+
+;** EXE.INC - Definitions for the EXEC command and EXE files
+;
+; The following get used as arguments to the EXEC system call. They indicate
+; whether or not the program is executed or whether or not a program header
+; gets created.
+
+EXEC_FUNC_NO_EXECUTE EQU 1 ; no execute bit
+EXEC_FUNC_OVERLAY EQU 2 ; overlay bit
+
+EXEC0 STRUC
+EXEC0_ENVIRON dw ? ; seg addr of environment
+EXEC0_COM_LINE dd ? ; pointer to asciz command line
+EXEC0_5C_FCB dd ? ; default fcb at 5C
+EXEC0_6C_FCB dd ? ; default fcb at 6C
+EXEC0 ENDS
+
+EXEC1 STRUC
+EXEC1_ENVIRON dw ? ; seg addr of environment
+EXEC1_COM_LINE dd ? ; pointer to asciz command line
+EXEC1_5C_FCB dd ? ; default fcb at 5C
+EXEC1_6C_FCB dd ? ; default fcb at 6C
+EXEC1_SP dw ? ; stack pointer of program
+EXEC1_SS dw ? ; stack seg register of program
+EXEC1_IP dw ? ; entry point IP
+EXEC1_CS dw ? ; entry point CS
+EXEC1 ENDS
+
+EXEC3 STRUC
+EXEC3_LOAD_ADDR DW ? ; seg address of load point
+EXEC3_RELOC_FAC DW ? ; relocation factor
+EXEC3 ENDS
+
+
+;** Exit codes (in upper byte) for terminating programs
+
+EXIT_TERMINATE EQU 0
+EXIT_ABORT EQU 0
+EXIT_CTRL_C EQU 1
+EXIT_HARD_ERROR EQU 2
+EXIT_KEEP_PROCESS EQU 3
+
+
+
+;** EXE File Header Description
+;
+
+EXE_FILE STRUC
+
+EXE_SIGNATURE dw ? ; must contain 4D5A (yay zibo!)
+EXE_LEN_MOD_512 dw ? ; low 9 bits of length
+EXE_PAGES dw ? ; number of 512b pages in file
+EXE_RLE_COUNT dw ? ; count of reloc entries
+EXE_PAR_DIR dw ? ; number of paragraphs before image
+EXE_MIN_BSS dw ? ; minimum number of para of BSS
+EXE_MAX_BSS dw ? ; max number of para of BSS
+EXE_SS dw ? ; stack of image
+EXE_SP dw ? ; SP of image
+EXE_CHKSUM dw ? ; checksum of file (ignored)
+EXE_IP dw ? ; IP of entry
+EXE_CS dw ? ; CS of entry
+EXE_RLE_TABLE dw ? ; byte offset of reloc table
+EXE_IOV dw ? ; overlay number (0 for root)
+EXE_SYM_TAB dd ? ; offset of symbol table in file
+
+EXE_FILE ENDS
+
+EXE_VALID_SIGNATURE EQU 5A4Dh
+EXE_VALID_OLD_SIGNATURE EQU 4D5Ah
+
+
+;** EXE file symbol info definitions
+
+SYMBOL_ENTRY STRUC
+SYM_VALUE dd ?
+SYM_TYPE dw ?
+SYM_LEN db ?
+SYM_NAME db 255 dup (?)
+SYMBOL_ENTRY ENDS
+
+
+;
+; M00x - BEGIN
+;
+;** Data structure passed for ExecReady call
+
+ERStruc STRUC
+ ER_Reserved dw ? ; reserved, should be zero
+ ER_Flags dw ?
+ ER_ProgName dd ? ; ptr to ASCIIZ str of prog name
+ ER_PSP dw ? ; PSP of the program
+ ER_StartAddr dd ? ; Start CS:IP of the program
+ ER_ProgSize dd ? ; Program size including PSP
+ERStruc ENDS
+
+;** bit fields in ER_Flags
+
+ER_EXE equ 0001h
+ER_OVERLAY equ 0002h
+
+;
+; M00x - END
+;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/fastopen.inc b/private/mvdm/dos/v86/inc/fastopen.inc
new file mode 100644
index 000000000..caace2fd8
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/fastopen.inc
@@ -0,0 +1,150 @@
+;
+; EXPORT DATE: 9/11
+;Equates for FASTOPEN.
+
+;FASTOPEN NAME CACHING Subfunctions
+FONC_Look_up equ 1
+FONC_insert equ 2
+FONC_delete equ 3
+FONC_update equ 4
+FONC_purge equ 5 ;reserved for the future use.
+FONC_Rename equ 6 ;AN001
+
+;FASTOPEN EXTENT CACHING Subfunctions
+FSK_Open equ 11 ;AN000;
+FSK_Close equ 12 ;AN000;
+FSK_Delete equ 13 ;AN000;
+FSK_Lookup equ 14 ;AN000;
+FSK_Insert equ 15 ;AN000;
+FSK_Trunc equ 16 ;AN000;
+
+HeaderSize equ 8 ; size of file header (8 bytes) ;AN000;
+ExtendSize equ 8 ; size of extend (8 bytes) ;AN000;
+Num_Of_Pages equ 1 ; number of pages ;AN000;
+Num_Of_Segs equ 2 ; number of frame segments ;AN000;
+Stayresident equ 04ch ; terminate and stay resident function code
+
+
+;Equates used in DOS.
+FastOpen_Set equ 00000001B
+FastOpen_Reset equ 11111110B
+Lookup_Success equ 00000010B
+Lookup_Reset equ 11111101B
+Special_Fill_Set equ 00000100B
+Special_Fill_Reset equ 11111011B
+No_Lookup equ 00001000B
+Set_For_Search equ 00010000B ;DCR 167
+
+
+;============= FastOpen Data Structures =====================
+
+Fastopen_Entry STRUC ;Fastopen Entry pointer in DOS
+Fastopen_Entry_size dw 4 ;size of the following
+Fastopen_Name_Caching dd ?
+;Fastopen_FatChain_Caching dd ? ;reserved for future use
+Fastopen_Entry ENDS
+;
+
+
+CMPCT_DIR_INFO STRUC ;compact version of Dir Info.
+CDI_file_name db 11 dup (' ')
+CDI_file_attr db ?
+CDI_codepage dw ?
+CDI_extcluster dw ?
+CDI_attr2 db ?
+CDI_time dw ?
+CDI_date dw ?
+CDI_cluster dw ?
+CDI_filesize dd ?
+CMPCT_DIR_INFO ENDS
+;
+
+ORIG_DIR_INFO STRUC
+ODI_head db 17 dup (?)
+ODI_skip db 5 dup (0) ;reserved for DOS. FASTOPEN does not
+ODI_tail db 10 dup (?) ; use ODI_skip part.
+ORIG_DIR_INFO ENDS
+;
+
+ODI_head_leng equ 17
+ODI_skip_leng equ 5
+ODI_tail_leng equ 10
+;
+
+FASTOPEN_EXTENDED_INFO STRUC
+FEI_dirpos db 0
+FEI_dirsec dd 0
+FEI_clusnum dw 0
+FEI_lastent dw 0 ; for search first
+FEI_dirstart dw 0 ; for search first
+FASTOPEN_EXTENDED_INFO ENDS
+;
+
+NAME_RECORD STRUC
+nLRU_ptr dw -1
+nMRU_ptr dw -1 ;reverse of nLRU_ptr
+nChild_ptr dw -1
+nSibling_ptr dw -1
+nBackward_ptr dw -1 ;points to preceding node
+nCmpct_Dir_Info db size Cmpct_Dir_Info dup (' ')
+nExtended_Info db size Fastopen_Extended_Info dup (?)
+NAME_RECORD ENDS
+;
+
+DRIVE_CACHE_HEADER STRUC ;drive cache header
+DCH_LRU_ROOT dw 0 ;Header of the LRU chain of this drive
+DCH_MRU_ROOT dw 0 ;offset to the last entry of LRU chain
+DCH_Child_ptr dw -1 ;the first child in Name cache seg.
+DCH_Sibling_ptr dw -1 ;points to the next drive cache header
+DCH_Drive_letter db 'C' ;drive letter
+DCH_Num_Entries dw 0 ;Number of entries in the Name cache.
+DCH_Name_Buff dw 0 ;pointer to name cahe buffer
+DRIVE_CACHE_HEADER ENDS
+;
+
+
+
+
+
+;======== FAST SEEK FUNCTION DATA STRUCTURES =======================
+
+DRIVE_HEADER STRUC ; Drive header structure ;AN000;
+Drive_Number dw 0 ; drive number ;AN000;
+Extent_Count dw 0 ; reserved for debugging
+MRU_Hdr_Ptr dw 0 ; pointer to OPEN Queue
+Free_ptr dw 0 ; pointer to FREE buffer ;AN000;
+Close_Ptr dw 0 ; pointer to CLOSE Queue ;AN000;
+Buff_Size dw 0 ; cache buffer size including header ;AN000;
+Free_Size dw 0 ; size of Free area in bytes
+Next_Drv_Hdr_Ptr dw 0 ; pointer to next drive header
+DRIVE_HEADER ENDS
+
+
+
+FILE_HEADER STRUC ; File header structure ;AN000;
+FH_Phys_Clus_Num dw 0 ; starting physcial clustnum of file ;AN000;
+FH_Refer_Count dw 0 ; reference count ;AN000;
+FH_Next_Extn_Ptr dw 0 ; pointer to first extent of the file;AN000;
+FH_Next_Hdr_Ptr dw 0 ; pointer to next file header ;AN000;
+FH_MRU_Extn_Ptr dw 0 ; pointer to MRU extent
+ dw 0
+ dw 0
+ dw 0
+FILE_HEADER ENDS ;AN000;
+
+
+
+EXTENT_HEADER STRUC ; extend header structure ;AN000;
+EH_Logic_Clus_Num dw 0 ; starting logical clus num of extent;AN000;
+EH_Phys_Clus_Num dw 0 ; starting physical clus numof extnt;AN000;
+EH_Count dw 0 ; range of logical clusnum in the extnt
+EH_Next_Extn_Ptr dw 0 ; pointer to next extent ;AN000;
+EH_Prev_Extn_Ptr dw 0 ; pointer to previous extent ;AN000;
+EH_Next_LRU_Ptr dw 0 ; pointer to next LRU extent
+EH_Prev_LRU_Ptr dw 0 ; pointer tp previous LRU extent
+ dw 0
+EXTENT_HEADER ENDS
+
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/fastxxxx.inc b/private/mvdm/dos/v86/inc/fastxxxx.inc
new file mode 100644
index 000000000..97a91632a
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/fastxxxx.inc
@@ -0,0 +1,12 @@
+; Fastxxx equates
+FastOpen_ID equ 1
+FastSeek_ID equ 2
+Fast_yes equ 10000000B ; fastxxx flag
+
+;Structure definitions
+;
+Fasttable_Entry struc ; Fastxxx Entry pointer in DOS
+Fast_Entry_Num dw 2 ; number of entries
+FastOpen_Seek dd ? ; fastopen & fastseek entry address
+Fasttable_Entry ends
+;
diff --git a/private/mvdm/dos/v86/inc/filemode.inc b/private/mvdm/dos/v86/inc/filemode.inc
new file mode 100644
index 000000000..f34bbe94a
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/filemode.inc
@@ -0,0 +1,90 @@
+ BREAK <FILEMODE.INC - Misc. File API Values>
+;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1991
+; All Rights Reserved.
+;
+
+;** FILEMODE.INC - Misc. File API Values
+;
+; These values are all visable to the client program as part of
+; an API.
+
+
+;** Standard I/O file handles
+;
+
+STDIN equ 0
+STDOUT equ 1
+STDERR equ 2
+STDAUX equ 3
+STDPRN equ 4
+
+
+
+;** File Modes
+
+ACCESS_MASK equ 0Fh
+OPEN_FOR_READ equ 00h
+OPEN_FOR_WRITE equ 01h
+OPEN_FOR_BOTH equ 02h
+EXEC_OPEN equ 03h ; access code of 3 indicates that open was
+ ; made from exec
+
+SHARING_MASK equ 0F0h
+SHARING_COMPAT equ 000h
+SHARING_DENY_BOTH equ 010h
+SHARING_DENY_WRITE equ 020h
+SHARING_DENY_READ equ 030h
+SHARING_DENY_NONE equ 040h
+SHARING_NET_FCB equ 070h
+SHARING_NO_INHERIT equ 080h
+
+
+
+;** Extended Open Definitions
+;
+
+RESERVED_BITS_MASK equ 0FE00h ; reserved bits for extended open flags
+EXISTS_MASK equ 0Fh ; "file exists" action field
+NOT_EXISTS_MASK equ 0F0h
+
+
+;* SF_MODE values
+
+AUTO_COMMIT_WRITE equ 4000h
+INT_24_ERROR equ 2000h
+
+
+;* Flags in EXTOPEN_ON
+
+EXT_OPEN_ON equ 01h
+EXT_FILE_NOT_EXISTS equ 04h
+EXT_OPEN_I24_OFF equ 02h
+
+
+;* Flags in EXTOPEN_FLAG
+
+ACTION_OPENED equ 01h
+ACTION_CREATED_OPENED equ 02h
+ACTION_REPLACED_OPENED equ 03h
+EXT_EXISTS_OPEN equ 01h
+EXT_EXISTS_FAIL equ 00h
+EXT_NEXISTS_CREATE equ 10h
+
+
+;** Extended Open Structure
+;
+
+EXT_OPEN_PARM struc
+EXT_SET_LIST dd ?
+EXT_NUM_OF_PARM dw ?
+EXT_OPEN_PARM ends
+
+
+;* Unused. should be deleted
+
+
+; NO_CODE_PAGE_CHECK equ 0100h
+; IO_MODE_ID equ 00000010b
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/find.inc b/private/mvdm/dos/v86/inc/find.inc
new file mode 100644
index 000000000..c539fb7ec
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/find.inc
@@ -0,0 +1,24 @@
+ Break <find first/next buffer>
+
+;** Findfirst/FindNext Record
+;
+; Client programs see this structure. Some if it is defined,
+; clients probably use undefined parts too.
+
+
+FIND_BUF STRUC
+
+FIND_BUF_DRIVE DB ? ; drive of search
+FIND_BUF_NAME DB 11 DUP (?) ; formatted name
+FIND_BUF_SATTR DB ? ; attribute of search
+FIND_BUF_LASTENT DW ? ; LastEnt
+FIND_BUF_DIRSTART DW ? ; DirStart
+FIND_BUF_NETID DB 4 DUP (?) ; Reserved for NET
+FIND_BUF_ATTR DB ? ; attribute found
+FIND_BUF_TIME DW ? ; time
+FIND_BUF_DATE DW ? ; date
+FIND_BUF_SIZE_L DW ? ; low(size)
+FIND_BUF_SIZE_H DW ? ; high(size)
+FIND_BUF_PNAME DB 13 DUP (?) ; packed name
+
+FIND_BUF ENDS
diff --git a/private/mvdm/dos/v86/inc/inc.tag b/private/mvdm/dos/v86/inc/inc.tag
new file mode 100644
index 000000000..2e7f24487
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/inc.tag
@@ -0,0 +1,95 @@
+; tagfile for INC directory
+
+; M00 - change to COPYRIGH.INC - changed copyright to DOS 5.0, 1990
+; M001 - 7/10/90 HKN - arena.inc - added equates for UMB allocation
+; M002 - 7/18/90 HKN - arena.inc - added LINKSTATE equate.
+; M003 - 7/30/90 HKN - dossym.inc - added A20OFF_FLAG for MSPASCAL 3.2
+; lmstub.asm compatibility support.
+; M004 - 8/2/90 HKN - dossym.inc - added support for exe files without
+; STACK segment
+; 9/26/90 HKN - dossym.inc - removed equate SETSSSP
+; M005 - 8/9/90 SA - parse.asm - prevented recognition of '=' signs within
+; strings as keywords.
+; M006 - 8/23/90 HKN - lmstub.asm - print A20 Hardware error using int 10.
+
+M007 SR 08/24/90 Fixed bug #1818 -- Ctrl-Z not being copied
+ to file.
+ Files: MSGSERV.ASM
+
+M008 SMR 08/27/90 Renamed Callback_SS & Callback_SP to
+ AbsRdWr_SS & AbsRdWr_SP for using in INT 25/26
+ Also renamed Callback_flag to UU_Callbackflag
+ to mark it as unused.
+ File : MS_DATA.ASM
+
+M009 08/31/90 HKN dossym.inc added comments explaining support for mace
+ utilities mkeyrate.com version 1.0
+
+M010 8/31/90 MD Added definition for INT 2A AH = 5
+ INT2A.INC.
+
+M011 9/06/90 HKN lmstub.asm check for wrap rather than do an XMS query
+ A20 after int 23,24 and 28
+
+M012 9/7/90 SR lmstub.asm Rearranged stuff to fix Share build problems
+ msbdata.inc with msdata.
+
+M013 9/12/90 SR msgserv.asm Removed SetStdIo code to turn critical error
+ on on operations after EOF. These routines
+ were using an undocumented IOCTL interface.
+
+M014 9/22/90 SMR EXE.INC 4B04 Implementation
+
+M015 9/26/90 SMR MSBDS.INC Added Form factor type 9 for 2.88 MB drives
+
+M016 10/14/90 SR MSGSERV.ASM Bug #3380 fixed. The message structure is in
+ TranSpace and had some initialized data
+ which was not getting reinitialized on every
+ command cycle.
+
+M017 10/17/90 SMR DEVSYM.INC changed IOQUERY to bit 7 from bit 8
+
+M018 10/25/90 HKN devsym.inc defined bit 11 of DOS34_FLAG. See M041 in
+ dos.tag for explanation.
+M019 10/26/90 DB ms_data.asm Disk read/write optimization. See M039 in
+ dosmac.inc dos.tag.
+
+M020 10/26/90 SR msgserv.asm Bug #3380. Some more data variables had to be
+ intialized. This whole thing is a giant mess.
+
+M021 11/1/90 SR win386.inc Bug #3869. Added WINOLDAP (46h) multiplex
+ number for Winoldap Windows switching API.
+
+M022 01/02/90 JAH mshead.asm Remove lie table from kernal
+
+M023 01/22/91 HKN lmstub.asm Added variable UmbSave1 for preserving
+ umb_head arena across win /3 session for
+ win ver < 3.1.
+
+M024 01/28/91 MD postequ.inc Added new keyboard controller commands from
+ IBM Japan.
+
+M025 01/29/91 SMR DOSSYM.INC B#4984. Added a bit field in DOS_FLAG to
+ support SWITCHES=/W.
+
+M026 02/04/91 HKN arena.inc changed strat_mask to hf_mask and ho_mask.
+
+M027 02/13/91 HKN dossym.inc support for copy protected apps.
+
+M028 02/14/91 SR error.inc Bug #5913. Added an equate for
+ Error_net_access_denied returned by the redir
+ when trying to create files on a read-only
+ share.
+
+M029 02/15/91 SR parse.asm Bug #5699. This happened to be another data
+ psdata.inc structure in the non-checksum region that
+ contains initialized data. Added code so
+ that we reinitialize it everytime we enter
+ SysParse since the table is accessed only
+ by the parse routines.
+
+M030 02/20/91 CAS keybshar.inc Added common .inc file for KEYBOARD.SYS
+ and KEYB.COM w/Kermit extensions.
+
+M031 02/21/91 MD copyrigh.inc Updated copyright notice.
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/int2a.inc b/private/mvdm/dos/v86/inc/int2a.inc
new file mode 100644
index 000000000..d5034b7c3
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/int2a.inc
@@ -0,0 +1,70 @@
+ BREAK <Int 2A Definitions>
+
+;** Int 2A functions
+;
+; Int 2A is an interface to the network code; it's also overloaded
+; as a critical section handler since critical sections
+; were originally created to support the net.
+
+
+;** This table was created by examining the source and may not be
+; complete or completely accurate - JGL
+;
+; M010 MD 8/31/90 - Added definition for AH = 5
+
+; (ah) = 0 installation check
+; (returns ah !=0 if installed)
+; (ah) = 1 cooked net bios call
+; (ah) = 3 query drive shared
+; (ds:si) = "n:" asciz string
+; (ah) = 4 net bios
+; (al) = 0 cooked net bios call
+; (al) = 1 raw net bios call
+; (al) = 2 ???
+;
+; (ah) = 5 Get Net Adaptor Resources. CX returns the number of
+; NCBs available/outstanding. DX returns the number of
+; sessions. Supposedly, this is documented in an old
+; IBM PC-LAN reference. Lotus Notes uses it. DOS LAN
+; Manager 2.0 Enhanced responds to it. But it should
+; not be used, as it is a hack, only to get Lotus
+; Notes running.
+;
+; (ah) = 80h enter critical section
+; (ah) = 81h leave critical section
+; (ah) = 82h free all critical sections (Leave-all)
+; (ah) = 84h entering idle loop (don't understand how this works)
+
+
+ Break <Critical sections>
+
+
+;** Critical section definitions
+;
+; Although DOS is not designed to be reentrant there are some hacks
+; which various programs use to make it so, in a limited fashion.
+; Both WIN386 and some servers block copy a section of the DOS data
+; area so that DOS can be reentered on behalf of another thread/program.
+; DOS's global data structures, such as the memory arena, are not
+; in this area, so critical section indicators are used to protect
+; those areas. DOS flags a critical section by issuing an INT_IBM
+; (int 2Ah) at each critical section entry and exit. Some clients
+; (such as WIN386) just don't "context switch" the DOS when one
+; of these is in effect, others, such as the IBM server, go ahead
+; and reenter the DOS and if they get an int 2A to reenter the same
+; critical section they then switch away from that second thread and
+; let the first one finish and exit the section.
+;
+; These below are subject to leave-all sections
+
+critDisk EQU 1 ; Disk I/O critical section
+critShare EQU 1 ; Sharer I/O critical section
+critMem EQU 1 ; memory maintenance critical section
+critSFT EQU 1 ; sft table allocation
+critDevice EQU 2 ; Device I/O critical section
+critNet EQU 5 ; network critical section
+critIFS EQU 6 ; ifsfunc critical section
+
+; These below are not subject to leave-all sections
+
+critASSIGN EQU 8 ; Assign has munged a system call
diff --git a/private/mvdm/dos/v86/inc/intnat.inc b/private/mvdm/dos/v86/inc/intnat.inc
new file mode 100644
index 000000000..125484d8d
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/intnat.inc
@@ -0,0 +1,39 @@
+; SCCSID = @(#)intnat.asm 1.1 85/04/10
+BREAK <International data structure format>
+
+;
+; Current structure of the data returned by the international call
+;
+internat_block STRUC
+Date_tim_format DW ? ; 0-USA, 1-EUR, 2-JAP
+Currency_sym DB ? ; Currency Symbol 5 bytes
+ DB ?
+ DB ?
+ DB ?
+ DB ?
+Thous_sep DB ? ; Thousands separator 2 bytes
+ DB ?
+Decimal_sep DB ? ; Decimal separator 2 bytes
+ DB ?
+Date_sep DB ? ; Date separator 2 bytes
+ DB ?
+Time_sep DB ? ; Decimal separator 2 bytes
+ DB ?
+Bit_field DB ? ; Bit values
+ ; Bit 0 = 0 if currency symbol first
+ ; = 1 if currency symbol last
+ ; Bit 1 = 0 if No space after currency symbol
+ ; = 1 if space after currency symbol
+Currency_cents DB ? ; Number of places after currency dec point
+Time_24 DB ? ; 1 if 24 hour time, 0 if 12 hour time
+Map_call DW ? ; Address of case mapping call (DWORD)
+ DW ? ; THIS IS TWO WORDS SO IT CAN BE INITIALIZED
+ ; in pieces.
+Data_sep DB ? ; Data list separator character
+ DB ?
+internat_block ENDS
+
+;
+; Max size of the block returned by the INTERNATIONAL call
+;
+internat_block_max EQU 32
diff --git a/private/mvdm/dos/v86/inc/ioctl.inc b/private/mvdm/dos/v86/inc/ioctl.inc
new file mode 100644
index 000000000..bb83e4834
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/ioctl.inc
@@ -0,0 +1,214 @@
+
+; %OUT IOCTL.INC...
+; THESE ARE ALL THE IMPORTANT STRUCTURES AND EQUATES FOR IOCTL
+;==============================================================================
+;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; D241 Provide support of Multi-track Format/Verify 9/23/87 J.K.
+;AN002; P1535 Unformatted hard file problem 10/15/87 J.K.
+;AN003; D490 IOCTL subfunction 63h,43h,64h,44h conflicts with OS2 2/26/88 J.K.
+;==============================================================================
+
+;*** J.K.
+;General Guide -
+;Category Code:
+; 0... .... DOS Defined
+; 1... .... User defined
+; .xxx xxxx Code
+
+;Function Code:
+; 0... .... Return error if unsupported
+; 1... .... Ignore if unsupported
+; .0.. .... Intercepted by DOS
+; .1.. .... Passed to driver
+; ..0. .... Sends data/commands to device
+; ..1. .... Quries data/info from device
+; ...x .... Subfunction
+;
+; Note that "Sends/queries" data bit is intended only to regularize the
+; function set. It plays no critical role; some functions may contain both
+; command and query elements. The convention is that such commands are
+; defined as "sends data".
+
+;*****************************;*
+; BLOCK DRIVERS ;*
+;*****************************;*
+
+; IOCTL SUB-FUNCTIONS
+IOCTL_GET_DEVICE_INFO EQU 0
+IOCTL_SET_DEVICE_INFO EQU 1
+IOCTL_READ_HANDLE EQU 2
+IOCTL_WRITE_HANDLE EQU 3
+IOCTL_READ_DRIVE EQU 4
+IOCTL_WRITE_DRIVE EQU 5
+IOCTL_GET_INPUT_STATUS EQU 6
+IOCTL_GET_OUTPUT_STATUS EQU 7
+IOCTL_CHANGEABLE? EQU 8
+IOCTL_DeviceLocOrRem? EQU 9
+IOCTL_HandleLocOrRem? EQU 0Ah ;10
+IOCTL_SHARING_RETRY EQU 0Bh ;11
+GENERIC_IOCTL_HANDLE EQU 0Ch ;12
+GENERIC_IOCTL EQU 0Dh ;13
+IOCTL_GET_DRIVE_MAP EQU 0Eh ;14
+IOCTL_SET_DRIVE_MAP EQU 0Fh ;15
+IOCTL_QUERY_HANDLE EQU 10h ;16
+IOCTL_QUERY_BLOCK EQU 11h ;17
+
+
+; GENERIC IOCTL CATEGORY CODES
+IOC_OTHER EQU 0 ; Other device control J.K. 4/29/86
+IOC_SE EQU 1 ; SERIAL DEVICE CONTROL
+IOC_TC EQU 2 ; TERMINAL CONTROL
+IOC_SC EQU 3 ; SCREEN CONTROL
+IOC_KC EQU 4 ; KEYBOARD CONTROL
+IOC_PC EQU 5 ; PRINTER CONTROL
+IOC_DC EQU 8 ; DISK CONTROL (SAME AS RAWIO)
+
+; GENERIC IOCTL SUB-FUNCTIONS
+RAWIO EQU 8
+
+; RAWIO SUB-FUNCTIONS
+GET_DEVICE_PARAMETERS EQU 60H
+SET_DEVICE_PARAMETERS EQU 40H
+READ_TRACK EQU 61H
+WRITE_TRACK EQU 41H
+VERIFY_TRACK EQU 62H
+FORMAT_TRACK EQU 42H
+GET_MEDIA_ID EQU 66h ;AN000;AN003;changed from 63h
+SET_MEDIA_ID EQU 46h ;AN000;AN003;changed from 43h
+GET_ACCESS_FLAG EQU 67h ;AN002;AN003;Unpublished function.Changed from 64h
+SET_ACCESS_FLAG EQU 47h ;AN002;AN003;Unpublished function.Changed from 44h
+SENSE_MEDIA_TYPE EQU 68H ;Added for 5.00
+
+
+; SPECIAL FUNCTION FOR GET DEVICE PARAMETERS
+BUILD_DEVICE_BPB EQU 000000001B
+
+; SPECIAL FUNCTIONS FOR SET DEVICE PARAMETERS
+INSTALL_FAKE_BPB EQU 000000001B
+ONLY_SET_TRACKLAYOUT EQU 000000010B
+TRACKLAYOUT_IS_GOOD EQU 000000100B
+
+; SPECIAL FUNCTION FOR FORMAT TRACK
+STATUS_FOR_FORMAT EQU 000000001B
+DO_FAST_FORMAT equ 000000010B ;AN001;
+; CODES RETURNED FROM FORMAT STATUS CALL
+FORMAT_NO_ROM_SUPPORT EQU 000000001B
+FORMAT_COMB_NOT_SUPPORTED EQU 000000010B
+
+; DEVICETYPE VALUES
+MAX_SECTORS_IN_TRACK EQU 63 ; MAXIMUM SECTORS ON A DISK.(Was 40 in DOS 3.2)
+DEV_5INCH EQU 0
+DEV_5INCH96TPI EQU 1
+DEV_3INCH720KB EQU 2
+DEV_8INCHSS EQU 3
+DEV_8INCHDS EQU 4
+DEV_HARDDISK EQU 5
+DEV_OTHER EQU 7
+DEV_3INCH1440KB EQU 7
+DEV_3INCH2880KB EQU 9
+
+MAX_DEV_TYPE EQU 9 ; MAXIMUM DEVICE TYPE THAT WE
+ ; CURRENTLY SUPPORT.
+
+A_SECTORTABLE STRUC
+ST_SECTORNUMBER DW ?
+ST_SECTORSIZE DW ?
+A_SECTORTABLE ENDS
+
+;A_DEVICEPARAMETERS STRUC
+;DP_SPECIALFUNCTIONS DB ?
+;DP_DEVICETYPE DB ?
+;DP_DEVICEATTRIBUTES DW ?
+;DP_CYLINDERS DW ?
+;DP_MEDIATYPE DB ?
+;DP_BPB DB SIZE A_BPB DUP (?)
+;DP_TRACKTABLEENTRIES DW ?
+;DP_SECTORTABLE DB MAX_SECTORS_IN_TRACK * SIZE A_SECTORTABLE DUP (?)
+;A_DEVICEPARAMETERS ENDS
+
+;A_TRACKREADWRITEPACKET STRUC
+;TRWP_SPECIALFUNCTIONS DB ?
+;TRWP_HEAD DW ?
+;TRWP_CYLINDER DW ?
+;TRWP_FIRSTSECTOR DW ?
+;TRWP_SECTORSTOREADWRITE DW ?
+;TRWP_TRANSFERADDRESS DD ?
+;A_TRACKREADWRITEPACKET ENDS
+
+;AN001; - FP_TRACKCOUNT is only meaningful when FP_SPECIALFUNCTIONS bit 1 = 1.
+A_FORMATPACKET STRUC
+FP_SPECIALFUNCTIONS DB ?
+FP_HEAD DW ?
+FP_CYLINDER DW ?
+FP_TRACKCOUNT DW 1
+A_FORMATPACKET ENDS
+
+A_VERIFYPACKET STRUC
+VP_SPECIALFUNCTIONS DB ?
+VP_HEAD DW ?
+VP_CYLINDER DW ?
+A_VERIFYPACKET ENDS
+
+A_MEDIA_ID_INFO STRUC
+MI_LEVEL DW 0 ;J.K. 87 Info. level
+MI_SERIAL DD ? ;J.K. 87 Serial #
+MI_LABEL DB 11 DUP (' ') ;J.K. 87 volume label
+MI_SYSTEM DB 8 DUP (' ') ;J.K. 87 File system type
+A_MEDIA_ID_INFO ENDS
+
+A_DISKACCESS_CONTROL STRUC ;AN002; Unpublished function. Only for Hard file.
+DAC_SPECIALFUNCTIONS DB 0 ;AN002; Always 0
+DAC_ACCESS_FLAG DB 0 ;AN002; Non Zero - allow disk I/O to unformatted hard file
+A_DISKACCESS_CONTROL ENDS ;AN002; 0 - Disallow disk I/O to unformatted hard file
+
+
+A_MEDIA_SENSE STRUC ; Media sense structure added 5.00
+MS_ISDEFAULT DB ? ; If 1 type returned is drv default
+MS_DEVICETYPE DB ? ; Drive type
+MS_RESERVED1 DB ? ; RESERVED
+MS_RESERVED2 DB ? ; RESERVED
+A_MEDIA_SENSE ENDS
+
+;********************************;*
+; CHARACTER DEVICES (PRINTERS) ;*
+;********************************;*
+
+;RAWIO SUB-FUNCTIONS
+GET_RETRY_COUNT EQU 65H
+SET_RETRY_COUNT EQU 45H
+
+A_RETRYCOUNT STRUC
+RC_COUNT DW ?
+A_RETRYCOUNT ENDS
+
+;********************************;* ;J.K. 4/29/86
+; CHARACTER DEVICES (SCREEN) ;*
+;********************************;* ;J.K. 4/29/86
+;
+;SC_MODE_INFO struc
+;SC_INFO_LENGTH DW 9
+;SC_MODE DB 0
+;SC_COLORS DW 0
+;SC_WIDTH DW 0
+;SC_LENGTH DW 0
+;SC_MODE_INFO ends
+;
+;SC_INFO_PACKET_LENGTH EQU 9 ;LENGTH OF THE INFO PACKET.
+
+;SUBFUNCTIONS FOR CON$GENIOCTL
+;GET_SC_MODE EQU 60h
+;SET_SC_MODE EQU 40h
+;The following subfunctions are reserved for installable CODE PAGE switch
+;console devices. - J.K. 4/29/86
+;Get_active_codepage equ 6Ah
+;Invoke_active_codepage equ 4Ah
+;Start_designate_codepage equ 4Ch
+;End_designate_codepage equ 4Dh
+;Get_list_of_designated_codepage equ 6Bh
+;J.K. 4/29/86 *** End of Con$genioctl equates & structures
+
+
diff --git a/private/mvdm/dos/v86/inc/keybshar.inc b/private/mvdm/dos/v86/inc/keybshar.inc
new file mode 100644
index 000000000..5bf790274
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/keybshar.inc
@@ -0,0 +1,322 @@
+.XLIST
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; (C) Copyright Microsoft Corp. 1987-1991
+;; MS-DOS 5.00 - NLS Support - KEYB Command
+;;
+;; 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:
+;; ---------------
+;;
+;; ;jwg ; - Feb 1990 For 4.03.
+;; ;AN007; - Add Patriot/Sebring determination code for HOT Replug
+;; so that INT 9 handler can alter keyboard Scan Code set.
+;; ;M030 Merged IBM (Kermit - JP), KEYBOARD.SYS and KEYB.COM
+;; versions of this file into one.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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 ;; M030 Merged back for kdfcf.asm
+JR_KB equ 8000h ;; M030 Merged back for kdfcf.asm
+ ;; Some useful scan codes:
+F1_SCAN EQU 59 ;; F1
+F2_SCAN EQU 60 ;; F2
+ ;;
+ ;; SYSTEM_FLAG / Hardware equates:
+ ;; INT 16h and remote support
+EXT_16 EQU 8000H ;; extended INT 16h support is there
+EXT_122 EQU 4000H ;; extended INT 16h for 122 is there
+; EQU 2000H ;; unused
+PC_NET EQU 1000H ;; flag PC Net is installed
+ ;; System type/hardware support flags
+PC_81 EQU 0800H ;; flag for Original PC
+PC_XT EQU 0400H ;; code for PC, PC/XT, PORTABLE
+PC_LAP EQU 0200H ;; code for Convertiable (p-12)
+PC_PAL EQU 0080H ;; code for Model 30 (PALACE)
+PC_AT EQU 0040H ;; code for PC-AT with 8042
+PC_386 EQU 0020H ;; code for PS/2's with 8042 (WRANGLER)
+PS_8042 EQU 0010H ;; 8042 is a Patriot/Sebring type array;AN007;jwg
+ ;; or system set translate OFF (SCS=01)
+SECURITY_ACTIVE EQU 0008h ; M030 ;; Server password mode is active
+; ; M030 ;; This bit becomes off from on when
+; ; M030 ;; correct password is entered JP9010
+ ;;
+ ;; 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
+ dd 0 ;; reserved
+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
+ db 5 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
+INVOKED_KBD_ID DW 0 ;; WGR invoked keyboard id. ;AN000
+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 ;;
+XT_KB EQU 4000H ;;
+AT_KB EQU 2000H ;;
+G_KB EQU 1000H ;;
+P_KB EQU 0800H ;;
+P12_KB EQU 0400H ;;
+DBCS_OLD_A_KB EQU 0080H ; M030 ;; JP9009
+DBCS_OLD_P_KB EQU 0040H ; M030 ;; JP9009
+DBCS_OLD_G_KB EQU 0020H ; M030 ;; JP9009
+DBCS_OLD_KB EQU 00C0H ; M030 ;; JP9009
+DBCS_KB EQU 0020H ; M030 ;; JP9009
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; 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
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/lmstub.asm b/private/mvdm/dos/v86/inc/lmstub.asm
new file mode 100644
index 000000000..5b9d601c7
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/lmstub.asm
@@ -0,0 +1,946 @@
+
+;===========================================================================
+;
+; TITLE Low Memory Stub for DOS when DOS runs in HMA
+;
+;
+; Revision History:
+;
+; M003 - MS PASCAL 3.2 support. Please see under tag M003 in dossym.inc
+; 7/30/90
+;
+; M006 - print A20 Hardware error using int 10.
+;
+; M020 - Fix for Rational Bug - see exepatch.asm for details
+;
+; M011 - check for wrap rather than do an XMS query
+; A20 after int 23,24 and 28
+;
+; M012 - Rearranged stuff to make Share build with msdata
+;
+; M023 - Added variable UmbSave1 for preserving umb_head arena across
+; win /3 session for win ver < 3.1
+;
+;
+;============================================================================
+
+
+
+DOSDATA SEGMENT WORD PUBLIC 'DATA'
+ assume cs:DOSDATA
+
+
+;----------------------------------------------------------------------------
+;
+; P U B L I C S
+;
+;----------------------------------------------------------------------------
+
+ PUBLIC DOSINTTABLE
+
+ public ldivov
+ public lquit
+ public lcommand
+ public labsdrd
+ public labsdwrt
+ public lStay_resident
+ public lint2f
+ public lcall_entry
+ public lirett
+
+
+ public i0patch
+ public i20patch
+ public i21patch
+ public i25patch
+ public i26patch
+ public i27patch
+ public i2fpatch
+ public cpmpatch
+
+
+
+;----------------------------------------------------------------------------
+;
+; D A T A
+;
+;----------------------------------------------------------------------------
+
+ EVEN
+DOSINTTABLE LABEL DWORD
+
+ DW OFFSET DOSCODE:DIVOV , 0
+ DW OFFSET DOSCODE:QUIT , 0
+ DW OFFSET DOSCODE:COMMAND , 0
+ DW OFFSET DOSCODE:ABSDRD , 0
+ DW OFFSET DOSCODE:ABSDWRT , 0
+ DW OFFSET DOSCODE:Stay_resident , 0
+ DW OFFSET DOSCODE:INT2F , 0
+ DW OFFSET DOSCODE:CALL_ENTRY , 0
+ DW OFFSET DOSCODE:IRETT , 0
+
+ SS_Save DW ? ; save user's stack segment
+ SP_Save DW ? ; save user's stack offset
+
+
+
+;-------------------------------------------------------------------------
+;
+; LOW MEM STUB:
+;
+; The low mem stub contains the entry points into DOS for all interrupts
+; handled by DOS. This stub is installed if the user specifies that the
+; DOS load in HIMEM. Each entry point does this.
+;
+;
+; 1. if jmp to 8 has been patched out
+; 2. if A20 OFF
+; 3. Enable A20
+; 4. else
+; 5. just go to dos entry
+; 6. endif
+; 7. else
+; 8. just go to dos entry
+; 9. endif
+;
+;
+;--------------------------------------------------------------------------
+ assume cs:dosdata
+
+;--------------------------------------------------------------------------
+;
+; DIVIDE BY 0 handler
+;
+;--------------------------------------------------------------------------
+
+ldivov:
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i0patch:
+ jmp short divov_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+divov_cont:
+ jmp dword ptr DOSINTTABLE ; jmp to DOS
+
+;------------------------------------------------------------------------
+;
+; INT 20 Handler
+;
+; Here we do not have to set up the stack to return here as the abort call
+; will return to the address after the int 21 ah=4b call. This would be the
+; common exit point if A20 had been OFF (for TOGGLE DOS) and the A20 line
+; will be restored then.
+;
+;-------------------------------------------------------------------------
+
+lquit:
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i20patch:
+ jmp short quit_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+quit_cont:
+ jmp dword ptr DOSINTTABLE+4 ; jump to DOS
+
+;--------------------------------------------------------------------------
+;
+; INT 21 Handler
+;
+;--------------------------------------------------------------------------
+
+lcommand:
+
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i21patch:
+ jmp short command_cont
+
+ call WEnsureA20ON ; we must turn on A20 if OFF
+
+
+command_cont:
+ jmp dword ptr DOSINTTABLE+8 ; jmp to DOS
+
+;------------------------------------------------------------------------
+;
+; INT 25
+;
+;----------------------------------------------------------------------------
+
+labsdrd:
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i25patch:
+ jmp short absdrd_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+absdrd_cont:
+ jmp dword ptr DOSINTTABLE+12; jmp to DOS
+
+;-------------------------------------------------------------------------
+;
+; INT 26
+;
+;-----------------------------------------------------------------------
+
+labsdwrt:
+
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i26patch:
+ jmp short absdwrt_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+absdwrt_cont:
+ jmp dword ptr DOSINTTABLE+16; jmp to DOS
+
+;------------------------------------------------------------------------
+;
+; INT 27
+;
+;-----------------------------------------------------------------------
+
+lStay_resident:
+
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i27patch:
+ jmp short sr_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+sr_cont:
+ jmp dword ptr DOSINTTABLE+20; jmp to DOS
+
+;-----------------------------------------------------------------------------
+;
+; INT 2f
+;
+;-------------------------------------------------------------------------
+
+lint2f:
+
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+i2fpatch:
+ jmp short int2f_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+int2f_cont:
+ jmp dword ptr DOSINTTABLE+24; jmp to DOS
+
+;-----------------------------------------------------------------------------
+;
+; CPM entry
+;
+;------------------------------------------------------------------------
+
+lcall_entry:
+
+ ;
+ ; The following jump, skipping the XMS calls will be patched to
+ ; NOPS by SEG_REINIT if DOS successfully loads high. This jump is
+ ; needed because the stub is installed even before the XMS driver
+ ; is loaded if the user specifies dos=high in the config.sys
+ ;
+cpmpatch:
+ jmp short callentry_cont
+
+ call EnsureA20ON ; we must turn on A20 if OFF
+
+callentry_cont:
+ jmp dword ptr DOSINTTABLE+28; jmp to DOS
+
+
+;--------------------------------------------------------------------------
+
+lirett: jmp DOIRET
+
+;---------------------------------------------------------------------------
+;
+; LowIntXX:
+;
+; Interrupts from DOS that pass control to a user program must be done from
+; low memory, as the user program may change the state of the A20 line or
+; they may require that the A20 line be OFF. The following piece of code is
+; far call'd from the following places in DOS:
+;
+; 1. msctrlc.asm where dos issues an int 23h (ctrlc)
+; 2. msctrlc.asm where dos issues an int 24h (critical error)
+; 3. msctrlc.asm where dos issues an int 28h (idle int)
+;
+; The int 23 and int 24 handlers may decide to do a far return instead of an
+; IRET ane leave the flags on the stack. Therefore we save the return address
+; before doing the ints and then do a far junp back into DOS.
+;
+;---------------------------------------------------------------------------
+
+
+public DosRetAddr23, DosRetAddr24
+public LowInt23, LowInt24, LowInt28
+
+DosRetAddr23 DD ?
+DosRetAddr24 DD ?
+DosRetAddr28 DD ?
+
+ ;
+ ; Execute int 23h from low memory
+ ;
+
+LowInt23:
+ ; save the return address that is on
+ ; the stack
+ pop word ptr cs:[DosRetAddr23]
+ pop word ptr cs:[DosRetAddr23+2]
+
+ int 23h ; ctrl C
+ ; turn on A20 it has been turned OFF
+ ; by int 28/23/24 handler.
+
+ call EnsureA20ON ; M011: we must turn on A20 if OFF
+
+ jmp dword ptr DosRetAddr23 ; jump back to DOS
+
+
+
+ ;
+ ; Execute int 24h from low memory
+ ;
+
+LowInt24:
+ ; save the return address that is on
+ ; the stack
+ pop word ptr cs:[DosRetAddr24]
+ pop word ptr cs:[DosRetAddr24+2]
+
+ int 24h ; crit error
+ ; turn on A20 it has been turned OFF
+ ; by int 28/23/24 handler.
+
+ call EnsureA20ON ; M011: we must turn on A20 if OFF
+
+ jmp dword ptr DosRetAddr24 ; jump back to DOS
+
+
+ ;
+ ; Execute int 23h from low memory
+ ;
+
+LowInt28:
+
+ int 28h ; idle int
+ ; turn on A20 it has been turned OFF
+ ; by int 28/23/24 handler.
+
+ call EnsureA20ON ; M011: we must turn on A20 if OFF
+
+ retf
+
+;-------------------------------------------------------------------------
+;
+; int 21 ah=4b (exec) call will jump to the following label before xferring
+; control to the exec'd program. We turn of A20 inorder to allow programs
+; that have been packed by the faulty exepack utility to unpack correctly.
+; This is so because exepac'd programs rely on address wrap.
+;
+;-------------------------------------------------------------------------
+
+public disa20_xfer
+disa20_xfer:
+ call XMMDisableA20 ; disable A20
+
+ ;
+ ; Look at msproc.asm at label exec_go for understanding the following:
+ ;
+
+ ; DS:SI points to entry point
+ ; AX:DI points to initial stack
+ ; DX has PDB pointer
+ ; BX has initial AX value
+ SVC SVC_DEMENTRYDOSAPP
+
+ call DOCLI
+ mov BYTE PTR InDos,0 ; SS Override
+
+ ASSUME SS:NOTHING
+
+ mov SS,AX ; set up user's stack
+ mov SP,DI ; and SP
+ sti ; took out DOSTI as sp may be bad
+ push DS ; fake long call to entry
+ push SI
+ mov ES,DX ; set up proper seg registers
+ mov DS,DX
+ mov AX,BX ; set up proper AX
+ retf
+
+
+
+;-------------------------------------------------------------------------
+;
+; M003:
+;
+; If an int 21 ah=25 call is made immediately after an exec call, DOS will
+; come here, turn A20 OFF restore user stack and registers before returning
+; to user. This is done in dos\msdisp.asm. This has been done to support
+; programs complied with MS PASCAL 3.2. See under TAG M003 in DOSSYM.INC for
+; more info.
+;
+; Also at this point DS is DOSDATA. So we can assume DS DOSDATA. Note that
+; SS is also DOS stack. It is important that we do the XMS call on DOS's
+; stack to avoid additional stack overhead for the user.
+;
+; -------------------------------------------------------------------------
+public disa20_iret
+disa20_iret:
+
+ assume ds:DOSDATA
+
+ call XMMDisableA20
+ dec InDos
+ mov SS,User_SS ; restore user stack
+ mov SP,User_SP
+ mov BP,SP
+ mov BYTE PTR [BP.User_AX],AL
+ mov AX,Nsp
+ mov User_SP,AX
+ mov AX,Nss
+ mov User_SS,AX
+
+ pop AX ; restore user regs
+ pop BX
+ pop CX
+ pop DX
+ pop SI
+ pop DI
+ pop BP
+ pop DS
+ pop ES
+
+ifdef NTVDMDBG
+ SVC SVC_DEMDOSDISPRET
+endif
+ jmp DOIRET
+
+ assume ds:NOTHING
+
+;*****************************************************************************
+;*** XMMDisableA20 - switch 20th address line
+;
+; This routine is used to disable the 20th address line in
+; the system using XMM calls.
+;
+; ENTRY none ;ds = _DATA
+; EXIT A20 line disabled
+; USES NOTHING
+;
+;*****************************************************************************
+
+
+XMMDisableA20 proc near
+
+ push bx
+ push ax
+ mov ah, XMM_LOCAL_DISABLE_A20
+ call cs:[XMMcontrol]
+ pop ax
+ pop bx
+ ret
+
+XMMDisableA20 endp
+
+
+; The entry point in the BIOS XMS driver is defined here.
+public XMMcontrol
+ XMMcontrol DD ?
+
+
+;---------------------------------------------------------------------------
+;
+;*** EnsureA20ON - Ensures that A20 is ON
+;
+; This routine is used to query the A20 state in
+; the system using XMM calls.
+;
+; ENTRY: none
+;
+; EXIT : A20 will be ON
+;
+;
+; USES : NONE
+;
+;---------------------------------------------------------------------------
+
+
+LowMemory label dword ; Set equal to 0000:0080
+ dw 00080h
+ dw 00000h
+
+HighMemory label dword
+ dw 00090h ; Set equal to FFFF:0090
+ dw 0FFFFh
+
+; sudeepb 07-Dec-1992 Created WEnsureA20ON so that costly pushf/popf
+
+; can be avoided in those entry points which dont care for flags
+
+
+EnsureA20ON proc near
+ pushf
+ call WEnsureA20ON
+ popf
+ ret
+EnsureA20ON endp
+
+WEnsureA20ON proc near
+
+ push ds
+ push es
+ push cx
+ push si
+ push di
+
+ lds si,cs:LowMemory ; Compare the 4 words at 0000:0080
+ les di,cs:HighMemory ; with the 4 at FFFF:0090
+ mov cx,4
+ cld
+ repe cmpsw
+
+ jz EA20_OFF
+
+EA20_RET:
+
+ pop di
+ pop si
+ pop cx
+ pop es
+ pop ds
+ ret
+
+EA20_OFF:
+
+ ;
+ ; We are going to do the XMS call on the DOS's AuxStack. NOTE: ints
+ ; are disabled at this point.
+ ;
+
+ push bx
+ push ax
+
+ mov ax, ss ; save user's stack pointer
+ mov cs:[SS_Save],ax
+ mov cs:[SP_Save],sp
+ mov ax, cs
+ mov ss, ax
+ mov sp, OFFSET DOSDATA:AuxStack
+ ; ss:sp -> DOSDATA:AuxStack
+
+ mov ah, XMM_LOCAL_ENABLE_A20
+ call cs:[XMMcontrol]
+ or ax, ax
+ jz XMMerror ; AX = 0 fatal error
+
+
+ mov ax, cs:[SS_Save] ; restore user stack
+ mov ss, ax
+ mov sp, cs:[SP_Save]
+
+ pop ax
+ pop bx
+
+ jmp short EA20_RET
+
+
+WEnsureA20ON endp
+
+
+XMMerror: ; M006 - Start
+
+ mov ah, 0fh ; get video mode
+ int 10h
+ cmp al, 7 ; Q: are we an MDA
+ je XMMcont ; Y: do not change mode
+ xor ah, ah ; set video mode
+ mov al, 02h ; 80 X 25 text
+ int 10h
+XMMcont:
+ mov ah, 05h ; set display page
+ xor al, al ; page 0
+ int 10h
+
+ mov si, offset XMMERRMSG
+ push cs
+ pop ds
+ cld ; clear direction flag
+
+XMMprnt:
+ lodsb
+ cmp al, '$' ; indicates end of XMMERRMSG
+ jz XMMStall ; function 0eh
+ mov ah, 14
+ mov bx, 7
+ int 10h
+ jmp short XMMprnt
+
+XMMStall:
+ call DOSTI ; allow the user to warm boot
+ jmp XMMStall ; M006 - End
+
+
+
+; M021-
+;
+; DosHasHMA - This flag is set by seg_reinit when the DOS actually
+; takes control of the HMA. When running, this word is a reliable
+; indicator that the DOS is actually using HMA. You can't just use
+; CS, because ROMDOS uses HMA with CS < F000.
+
+public DosHasHMA
+ DosHasHMA db 0
+
+public fixexepatch, RationalPatchPtr
+ fixexepatch dw ? ; M012
+ RationalPatchPtr dw ? ; M012
+
+; End M021
+
+
+;
+; M020 Begin
+;
+ public RatBugCode
+RatBugCode proc far
+ push cx
+ mov cx, word ptr ds:[10h]
+ loop $
+ pop cx
+ ret
+RatBugCode endp
+;
+; M020 End
+;
+
+
+public UmbSave1 ; M023
+UmbSave1 db 0bh dup (?) ; M023
+
+public Mark3
+ Mark3 label byte
+
+IF2
+ IF ((OFFSET MARK3) GT (OFFSET COUNTRY_CDPG) )
+ .ERR
+ %OUT !DATA CORRUPTION!MARK3 OFFSET TOO BIG. RE-ORGANIZE DATA.
+ ENDIF
+ENDIF
+
+;############################################################################
+;
+; ** HACK FOR DOS 4.0 REDIR **
+;
+; The dos 4.X redir requires that country_cdpg is at offset 0122ah. Any new
+; data variable that is to be added to DOSDATA must go in between Mark3
+; COUNTRY_CDPG if it can.
+;
+; MARK3 SHOULD NOT BE > 122AH
+;
+; As of 9/6/90, this area is FULL!
+;
+;############################################################################
+
+ ORG 0122ah
+
+; The following table is used for DOS 3.3
+;DOS country and code page information is defined here for DOS 3.3.
+;The initial value for ccDosCountry is 1 (USA).
+;The initial value for ccDosCodepage is 850.
+;
+;
+ PUBLIC UCASE_TAB,FILE_UCASE_TAB,DBCS_TAB
+ PUBLIC FILE_CHAR_TAB,COLLATE_TAB
+
+PUBLIC COUNTRY_CDPG
+
+;
+; country and code page infomation
+;
+COUNTRY_CDPG label byte
+
+ db 0,0,0,0,0,0,0,0 ; reserved words
+ db '\COUNTRY.SYS',0 ; path name of country.sys
+ db 51 dup (?)
+; ------------------------------------------------<MSKK01>----------------------
+ifdef DBCS
+ ifdef JAPAN
+ dw 932 ; system code page id (JAPAN)
+ endif
+ ifdef TAIWAN
+ dw 938 ; system code page id (TAIWAN)
+ endif
+ ifdef KOREA
+ dw 934 ; system code page id (KOREA IBM)
+ endif
+else
+ dw 437 ; system code page id
+endif
+; ------------------------------------------------<MSKK01>----------------------
+ dw 6 ; number of entries
+ db SetUcase ; Ucase type
+ dw OFFSET DOSDATA:UCASE_TAB ;pointer to upper case table
+ dw 0 ; segment of poiter
+ db SetUcaseFile ; Ucase file char type
+ dw OFFSET DOSDATA:FILE_UCASE_TAB ;pointer to file upper case table
+ dw 0 ; segment of poiter
+ db SetFileList ; valid file chars type
+ dw OFFSET DOSDATA:FILE_CHAR_TAB ;pointer to valid file char tab
+ dw 0 ; segment of poiter
+ db SetCollate ; collate type
+ dw OFFSET DOSDATA:COLLATE_TAB ;pointer to collate table
+ dw 0 ; segment of poiter
+ db SetDBCS ;AN000; DBCS Ev 2/12/KK
+ dw OFFSET DOSDATA:DBCS_TAB ;AN000;;pointer to DBCS Ev table 2/12/KK
+ dw 0 ;AN000; segment of poiter 2/12/KK
+ db SetCountryInfo ; country info type
+ dw NEW_COUNTRY_SIZE ; extended country info size
+; ------------------------------------------------<MSKK01>----------------------
+ifdef DBCS
+ ifdef JAPAN
+ dw 81 ; <MSKK01> JAPAN country id
+ dw 932 ; <MSKK01> JAPAN system code page id
+ dw 2 ; <MSKK01> date format (YMD)
+ db '\',0,0,0,0 ; <MSKK01> currency symbol (YEN)
+ db ',',0 ; thousand separator
+ db '.',0 ; decimal separator
+ db '-',0 ; date separator
+ db ':',0 ; time separator
+ db 0 ; currency format flag
+ db 0 ; <MSKK01> # of disgit in currency
+ db 1 ; <MSKK01> time format (HR24)
+ dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
+ dw 0 ; segment of entry point
+ db ',',0 ; data list separator
+ dw 0,0,0,0,0 ; reserved
+ endif
+ ifdef TAIWAN
+ dw 88 ; TAIWAN country id
+ dw 938 ; TAIWAN system code page id
+ dw 0 ; date format (MDY)
+ db 'N','T','$',0,0 ; currency symbol
+ db ',',0 ; thousand separator
+ db '.',0 ; decimal separator
+ db '-',0 ; date separator
+ db ':',0 ; time separator
+ db 0 ; currency format flag
+ db 2 ; # of disgit in currency
+ db 1 ; time format (HR24)
+ dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
+ dw 0 ; segment of entry point
+ db ',',0 ; data list separator
+ dw 0,0,0,0,0 ; reserved
+ endif
+ ifdef KOREA
+ dw 82 ; <MSCH> KOREA country id
+ dw 934 ; <MSCH> KOREA system code page id
+ dw 2 ; <MSCH> date format (YMD)
+ db '\',0,0,0,0 ; <MSCH> currency symbol (WON)
+ db ',',0 ; thousand separator
+ db '.',0 ; decimal separator
+ db '-',0 ; date separator
+ db ':',0 ; time separator
+ db 0 ; currency format flag
+ db 0 ; <MSCH> # of disgit in currency
+ db 1 ; <MSCH> time format (HR24)
+ dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
+ dw 0 ; segment of entry point
+ db ',',0 ; data list separator
+ dw 0,0,0,0,0 ; reserved
+ endif
+else
+ dw 1 ; USA country id
+ dw 437 ; USA system code page id
+ dw 0 ; date format
+ db '$',0,0,0,0 ; currency symbol
+ db ',',0 ; thousand separator
+ db '.',0 ; decimal separator
+ db '-',0 ; date separator
+ db ':',0 ; time separator
+ db 0 ; currency format flag
+ db 2 ; # of disgit in currency
+ db 0 ; time format
+ dw OFFSET DOSDATA:MAP_CASE ;mono case routine entry point
+ dw 0 ; segment of entry point
+ db ',',0 ; data list separator
+ dw 0,0,0,0,0 ; reserved
+endif
+; ------------------------------------------------<MSKK01>----------------------
+
+;
+;This has been put in for WIN386 2.XX support. The format of the instance
+;table was different for this. Segments will be patched in at init time.
+;
+public OldInstanceJunk
+OldInstanceJunk dw 70h ;segment of BIOS
+ dw 0 ;indicate stacks in SYSINIT area
+ dw 6 ;5 instance items
+
+ dw 0,offset dosdata:contpos, 2
+ dw 0,offset dosdata:bcon, 4
+ dw 0,offset dosdata:carpos,106h
+ dw 0,offset dosdata:charco, 1
+ dw 0,offset dosdata:exec_init_sp, 24
+ dw 070h,offset BData:altah, 1 ; altah byte in bios
+
+
+
+
+
+include msdos.cl2 ; XMMERRMSG
+
+ PUBLIC vheVDM
+vheVDM db (size vhe_s) dup (0)
+
+ PUBLIC SCS_COMSPEC
+SCS_COMSPEC db 64 dup (?) ; Buffer for %COMSPEC% /z
+
+ PUBLIC SCS_CMDTAIL
+SCS_CMDTAIL db 128 dup (?) ; Buffer for Command Tail
+IF 2
+.errnz SCS_CMDTAIL-SCS_COMSPEC-64
+ENDIF
+
+ PUBLIC SCS_PBLOCK
+SCS_PBLOCK db 14 dup (?) ; Buffer for parameter block
+IF 2
+.errnz SCS_PBLOCK-SCS_CMDTAIL-128
+ENDIF
+
+ PUBLIC SCS_ToSync ; TRUE after receiving a new command
+SCS_ToSync db 0 ; from scs.
+IF 2
+.errnz SCS_ToSync-SCS_PBLOCK-14
+ENDIF
+
+ PUBLIC SCS_TSR
+SCS_TSR db 0
+
+ PUBLIC SCS_Is_Dos_Binary
+SCS_Is_Dos_Binary db 0
+
+ PUBLIC SCS_CMDPROMPT
+SCS_CMDPROMPT db 0
+
+ PUBLIC SCS_DOSONLY
+SCS_DOSONLY db 0
+
+ PUBLIC SCS_FDACCESS
+ EVEN
+SCS_FDACCESS dw 0
+
+include dpb.inc
+
+ PUBLIC FAKE_NTDPB
+FAKE_NTDPB db (size DPB) dup (0)
+
+; This and NetCDS data structures are used by NT DOSEm for redirected drives.
+ I_am NetCDS,curdirLen ; CDS for redirected drives
+
+
+
+;; williamh, moved from dostab.asm because it broke MARK3
+;smr; moved from TABLE segment in exec.asm
+
+EXEC_NEWHEADER_OFFSET equ 03Ch
+
+ I_am exec_init_SP,WORD
+ I_am exec_init_SS,WORD
+ I_am exec_init_IP,WORD
+ I_am exec_init_CS,WORD
+
+ I_am exec_signature,WORD ; must contain 4D5A (yay zibo!)
+ I_am exec_len_mod_512,WORD ; low 9 bits of length
+ I_am exec_pages,WORD ; number of 512b pages in file
+ I_am exec_rle_count,WORD ; count of reloc entries
+ I_am exec_par_dir,WORD ; number of paragraphs before image
+ I_am exec_min_BSS,WORD ; minimum number of para of BSS
+ I_am exec_max_BSS,WORD ; max number of para of BSS
+ I_am exec_SS,WORD ; stack of image
+ I_am exec_SP,WORD ; SP of image
+ I_am exec_chksum,WORD ; checksum of file (ignored)
+ I_am exec_IP,WORD ; IP of entry
+ I_am exec_CS,WORD ; CS of entry
+ I_am exec_rle_table,WORD ; byte offset of reloc table
+
+ public Exec_header_len
+Exec_header_len EQU $-Exec_Signature ;PBUGBUG
+ db (EXEC_NEWHEADER_OFFSET - Exec_header_len) dup(?)
+
+ I_am exec_NE_offset, WORD
+ public Exec_header_len_NE
+Exec_header_len_NE equ EXEC_NEWHEADER_OFFSET + 2
+;smr; eom
+
+
+
+
+
+ifdef NTVDMDBG
+ PUBLIC SCS_ISDEBUG
+SCS_ISDEBUG db 0
+endif
+
+ include doswow.inc
+ EVEN
+ PUBLIC DosWowDataStart
+DosWowDataStart Label word
+ DOSWOWDATA <OFFSET DOSDATA:CDSCOUNT,OFFSET DOSDATA:CDSADDR, \
+ OFFSET DOSDATA:NetCDS, \
+ OFFSET DOSDATA:CURDRV,OFFSET DOSDATA:CurrentPDB, \
+ OFFSET DOSDATA:DrvErr,OFFSET DOSDATA:EXTERR_LOCUS, \
+ OFFSET DOSDATA:SCS_ToSync, OFFSET DOSDATA:sfTabl>
+
+DOCLI:
+ FCLI
+ ret
+
+DOSTI:
+ FSTI
+ ret
+
+DOIRET:
+ FIRET
+
+DOSDATA ends
diff --git a/private/mvdm/dos/v86/inc/lock.inc b/private/mvdm/dos/v86/inc/lock.inc
new file mode 100644
index 000000000..e8e955ec8
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/lock.inc
@@ -0,0 +1,25 @@
+;** LOCK.INC - Definitions for Record Locking
+;
+
+
+;** LOCK functions
+;
+
+LOCK_ALL equ 0
+UNLOCK_ALL equ 1
+LOCK_MUL_RANGE equ 2
+UNLOCK_MUL_RANGE equ 3
+LOCK_READ equ 4
+WRITE_UNLOCK equ 5
+LOCK_ADD equ 6
+
+
+
+;** Structure for Lock buffer
+
+LockBuf STRUC
+
+ Lock_position DD ? ; file position for LOCK
+ Lock_length DD ? ; number of bytes to LOCK
+
+LockBuf ENDS
diff --git a/private/mvdm/dos/v86/inc/macro.def b/private/mvdm/dos/v86/inc/macro.def
new file mode 100644
index 000000000..d58a3daf6
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/macro.def
@@ -0,0 +1,18 @@
+ PAGE
+;***************************************************************************;
+; MACRO DEFINITION ;
+;***************************************************************************;
+
+PRINT MACRO MESSAGE
+ MOV DX,OFFSET MESSAGE&_PTR
+ PUSH DX
+ PUSH CS
+ CALL PRINTF
+ENDM
+
+
+
+INPUT MACRO MESSAGE
+ PRINT MESSAGE
+ CALL PROMPT
+ENDM
diff --git a/private/mvdm/dos/v86/inc/mft.inc b/private/mvdm/dos/v86/inc/mft.inc
new file mode 100644
index 000000000..0359f80b2
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mft.inc
@@ -0,0 +1,176 @@
+BREAK <MFT Definitions>
+
+;** MSDOS MFT definitions
+;
+; The Master File Table (MFT) associates the cannonicalized pathnames, lock
+; records and SFTs for all files open on this machine.
+;
+; The MFT implementation employs a single memory buffer which is used from
+; both ends. This gives the effect (at least until they run into each
+; other) of two independent buffers.
+;
+; MFT buffer
+; ==========
+; The MFT buffer contains MFT name records and free space. It uses a
+; classic heap architecture: freed name records are marked free and
+; conglomerated with any adjacent free space. When one is to create a name
+; entry the free list is searched first-fit. The list of name and free
+; records is always terminated by a single END record.
+;
+; LOCK buffer
+; ===========
+; The lock buffer contains fixed format records containing record locking
+; information. Since they are fixed format the space is handled as a series
+; of chains: one for each MFT name record and one for the free list. No
+; garbage collection is necessary.
+;
+; Space allocation
+; ================
+; The MFT is managed as a heap. Empty blocks are allocated on a first-fit
+; basis. If there is no single large enough empty block the list is garbage
+; collected.
+;
+; MFT name records:
+;
+; 8 16 8 16 32 16 n
+; |------|-----|-----|------|------|------|---------~~~~~~---------|
+; | FLAG | LEN | SUM | LPTR | SPTR | SERL | <.asciz string> |
+; --------------------------------------------------~~~~~~----------
+;
+; FLAG = record type flag
+; LEN = total byte length of record.
+; SUM = sum of bytes in asciz string. Used to speed
+; searches
+; LPTR= pointer to first record in lock chain segment
+; is MFT segment
+; SPTR= pointer to first sft in sft chain
+; SERL= serial number
+; <string> = name string, zero-byte terminated. There
+; may be garbage bytes following the 00 byte;
+; these are counted in the LEN field.
+;
+;
+; MFT free records
+;
+; 8 16
+; |------|-----|----~~~~~~~~~~~~~~~~~~~~~~~~~~~---------|
+; | FLAG | LEN | free |
+; ------------------~~~~~~~~~~~~~~~~~~~~~~~~~~~----------
+;
+; FLAG = record type flag
+; LEN = total byte length of record.
+;
+;
+; MFT END records
+;
+; 8
+; |------|
+; | FLAG |
+; --------
+;
+; FLAG = record type flag
+
+;** MFT definitions
+;*
+;* NOTE: the flag and length fields are identical for all record types
+;* (except the END type has no length) This must remain so as
+;* some code depends upon it.
+;*
+;* NOTE: Many routines check for "n-1" of the N flag values and if no
+;* match is found assume the flag value must be the remaining
+;* possibility. If you add or remove flag values you must check
+;* all references to mft_flag.
+
+MFT_entry STRUC
+
+mft_flag DB ? ; flag/len field
+mft_len DW ?
+mft_sum DB ? ; string sum word
+mft_lptr DW ? ; LCK pointer
+mft_sptr DD ? ; sft pointer
+mft_serl DW ? ; serial number
+mft_name DB ? ; offset to start of name
+
+MFT_entry ENDS
+
+MFLG_NAM EQU 1 ; min value for name record
+MFLG_FRE EQU 0 ; free record
+MFLG_END EQU -1 ; end record
+
+;* Record Lock Record (RLR):
+;
+; 16 32 32 32
+; |-------|--------|--------|--------|
+; | NEXT | FBA | LBA | SPTR |
+; | | lo hi | lo hi | |
+; ------------|--------|--------------
+;
+; CHAIN = pointer to next RLR. 0 if end
+; FBA = offset of 1st byte of locked region
+; LBA = offset of last byte of locked region
+; SPTR = pointer to SFT lock was issued on
+
+RLR_entry STRUC
+
+rlr_next DW ? ; chain to next RLR, 0 if end
+rlr_fba DW ? ; first byte addr (offset) of reigion
+ DW ?
+rlr_lba DW ? ; last byte addr of region
+ DW ?
+rlr_sptr DD ? ; SFT pointer
+rlr_pid dw ? ; process id of issuer
+rlr_type dw ? ; lock type
+RLR_entry ENDS
+
+rlr_lall equ 00h ; lock all ops
+rlr_lwr equ 01h ; lock write ops
+
+;
+; A pictorial diagram for the linkages is as follows:
+;
+; +---sptr------+
+; V |
+; +---+<----------|---sptr------+------------+
+; |SFT+----+ | | |
+; +-+-+ | +-+-+ +--+-+ +--+-+
+; V +--->|MFT+-lptr->-|LOCK+-next->|LOCK+->0
+; +---+ | +---+ +----+ +----+
+; |SFT+----+ ^
+; +-+-+ |
+; | |
+; +-------------+
+;
+;
+
+;**
+;
+; Interesting behavior should be noted:
+;
+; The sharer must maintain information on files in three forms:
+;
+; local/remote handles. These are normal handles and behave in no
+; strange manner. They are identified by SF_mode not having the
+; sfIsFCB flag nor by having the sf_mode = 70. No problems with
+; locking. No problems with open. No problems with close.
+; CloseByName will iterate closes until the mft disappears.
+; CloseUser will iterate closes until no SFT for the particular user
+; appears. CloseProcess will iterate closes until no SFT for the
+; particular user/process appears.
+;
+; local FCBs. There are no corresponding SFT's for these as the SFTs
+; are cached but will be valid for the particular file. There is
+; one SFT for each open on a file by a specific process. These are
+; identified the sfIsFCB flag in the sf_mode field. When multiple
+; opens occur, we merely find the sf pertinent to the file and
+; process. Close decrements the ref count. CloseByName, CloseUser,
+; CloseProcess will iterate closes until no more SFTs exist.
+;
+; handles with mode 70. These represent FCB's open across the network.
+; As such, identical sfts may have been collapsed by the $open code.
+; This results in a reuse of the same SFT. The $Open code must
+; correctly set the ref-count for the sft to reflect the number of
+; collapses that have occurred. These are identified by a 70 in the
+; SF_mode field. There can be no locking on these SFTs. Open must
+; scan the list of SFTs for the file and increment its ref count
+; appropriately.
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/mi.inc b/private/mvdm/dos/v86/inc/mi.inc
new file mode 100644
index 000000000..89e26bb2d
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mi.inc
@@ -0,0 +1,19 @@
+; SCCSID = @(#)mi.asm 1.1 85/04/10
+BREAK <Machine instruction, flag definitions and character types>
+
+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/private/mvdm/dos/v86/inc/ms_data.asm b/private/mvdm/dos/v86/inc/ms_data.asm
new file mode 100644
index 000000000..0460211e1
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/ms_data.asm
@@ -0,0 +1,241 @@
+; SCCSID = @(#)msdata.asm 1.8 85/09/12
+
+;
+;----------------------------------------------------------------------------
+;
+; M008 : Renamed callback_ss & callback_sp to AbsRdWr_SS & AbsRdWr_SP
+; To be used in Absolute Read/Write DISK routines
+; M019 DB 10/26/90 - Disk write optimization: removed HIGH_SECTOR_TEMP.
+;
+;----------------------------------------------------------------------------
+;
+ AsmVars <Debug, Redirector, ShareF>
+
+;
+;smr;--- These extrns should be in DOSCODE segment
+;
+DOSCODE SEGMENT BYTE PUBLIC 'CODE'
+;hkn; extrn ucase_tab:byte
+;hkn; extrn file_ucase_tab:byte
+;hkn; extrn file_char_tab:byte
+;hkn; extrn collate_tab:byte
+;hkn; extrn dbcs_tab:byte
+;hkn; extrn map_case:byte
+
+ extrn DIVOV:near
+ extrn QUIT:near
+ extrn COMMAND:near
+ extrn ABSDRD:near
+ extrn ABSDWRT:near
+ extrn Stay_resident:near
+ extrn INT2F:near
+ extrn CALL_ENTRY:near
+ extrn IRETT:near
+
+DOSCODE ENDS
+;
+Break <Uninitialized data overlayed by initialization code>
+
+DOSDATA SEGMENT WORD PUBLIC 'DATA'
+; Init code overlaps with data area below
+
+; ORG 0
+PUBLIC MSDAT001S,MSDAT001E
+MSDAT001S label byte
+
+ I_am TIMEBUF,6 ; Time read from clock device
+ I_am DEVIOBUF,2 ; Buffer for I/O under file assignment
+;
+; The following areas are used as temp buffer in EXEC system call
+;
+ I_am OPENBUF,128 ; buffer for name operations
+ I_am RenBuf,128 ; buffer for rename destination
+; Buffer for search calls
+ I_am SEARCHBUF,53 ; internal search buffer
+ I_am DummyCDS,curdirLen
+;
+; End of contiguous buffer
+;
+; Temporary directory entry for use by many routines. Device directory
+; entries (bogus) are built here.
+;
+ PUBLIC DevFCB
+DEVFCB LABEL BYTE ; Uses NAME1, NAME2, combined
+; WARNING.. do not alter position of NAME1 relative to DEVFCB
+; without first examining BUILD_DEVICE_ENT. Look carefully at DOS_RENAME
+; as well as it is the only guy who uses NAME2 and DESTSTART.
+ I_am NAME1,12 ; File name buffer
+ I_am NAME2,13 ;
+ I_am DESTSTART,WORD ;
+ DB ((SIZE DIR_ENTRY) - ($ - DEVFCB)) DUP (?)
+;
+; End Temporary directory entry.
+;
+ I_am ATTRIB,BYTE ; storage for file attributes
+ I_am EXTFCB,BYTE ; TRUE => extended FCB in use
+ I_am SATTRIB,BYTE ; Storage for search attributes
+ I_AM open_access,BYTE ; access of open system call
+ I_am FoundDel,BYTE ; true => file was deleted
+ I_am Found_dev,BYTE ; true => search found a device
+ I_am fSplice,BYTE ; true => do a splice in transpath
+ I_am fSharing,BYTE ; TRUE => no redirection
+ I_am SECCLUSPOS,BYTE ; Position of first sector within cluster
+ I_am TRANS,BYTE ;
+ I_am READOP,BYTE ;
+ I_am THISDRV,BYTE ;
+ I_am CLUSFAC,BYTE ;
+ I_am CLUSSPLIT,BYTE ;
+ I_am INSMODE,BYTE ; true => insert mode in buffered read
+ I_am cMeta,BYTE ; count of meta'ed components found
+ I_am VOLID,BYTE ;
+ I_am exit_type,BYTE ; type of exit...
+
+ EVEN
+
+; WARNING - the following two items are accessed as a word
+ I_am CREATING,BYTE ; true => creating a file
+ I_am DELALL,BYTE ; = 0 iff BUGBUG
+ ; = DIRFREE iff BUGBUG
+ I_am EXITHOLD,DWORD ; Temp location for proc terminate
+ I_am user_SP,WORD ; User SP for system call
+ I_am user_SS,WORD ; User SS for system call
+ I_am CONTSTK,WORD ;
+ I_am THISDPB,DWORD ;
+ I_am CLUSSAVE,WORD ;
+ I_am CLUSSEC,DWORD ;>32mb AC0000
+ I_am PREREAD,WORD ; 0 means preread; 1 means optional
+ I_am FATBYT,WORD ; Used by ALLOCATE
+ I_am FATBYTE,WORD ; Used by $SLEAZEFUNC
+ I_am DEVPT,DWORD ;
+ I_am THISSFT,DWORD ; Address of user SFT
+ I_am THISCDS,DWORD ; Address of current CDS
+ I_am THISFCB,DWORD ; Address of user FCB
+ I_am SFN,WORD,<-1> ; SystemFileNumber found for accessfile
+ I_am JFN,WORD ; JobFileNumber found for accessfile
+ I_am PJFN,DWORD ; PointerJobFileNumber found for accessfile
+ I_am WFP_START,WORD ;
+ I_am REN_WFP,WORD ;
+ I_am CURR_DIR_END,WORD ;
+ I_am NEXTADD,WORD ;
+ I_am LASTPOS,WORD ;
+ I_am CLUSNUM,WORD ;
+ I_am DIRSEC,DWORD ;>32mb AC0000
+ I_am DIRSTART,WORD ;
+ I_am SECPOS,DWORD ;>32mb Position of first sector accessed
+ I_am VALSEC,DWORD ;>32mb Number of valid (previously written)
+ ; sectors
+ I_am BYTSECPOS,WORD ; Position of first byte within sector
+ I_am BYTPOS,4 ; Byte position in file of access
+ I_am BYTCNT1,WORD ; No. of bytes in first sector
+ I_am BYTCNT2,WORD ; No. of bytes in last sector
+ I_am SECCNT,WORD ; No. of whole sectors
+ I_am ENTFREE,WORD ;
+ I_am ENTLAST,WORD ;
+ I_am NXTCLUSNUM,WORD ;
+ I_am GROWCNT,DWORD ;
+ I_am CURBUF,DWORD ;
+ I_am CONSft,DWORD ; SFT of console swapped guy.
+ I_am SaveBX,WORD ;
+ I_am SaveDS,WORD ;
+ I_am restore_tmp,WORD ; return address for restore world
+ I_am NSS,WORD
+ I_am NSP,WORD
+ I_am EXTOPEN_FLAG,WORD,<0> ;FT. extended open input flag ;AN000;
+ I_am EXTOPEN_ON,BYTE,<0> ;FT. extended open conditional flag ;AN000;
+ I_am EXTOPEN_IO_MODE,WORD,<0>;FT. extende open io mode ;AN000;
+ I_am SAVE_DI,WORD ;FT. extende open saved DI ;AN000;
+ I_am SAVE_ES,WORD ;FT. extende open saved ES ;AN000;
+ I_am SAVE_DX,WORD ;FT. extende open saved DX ;AN000;
+ I_am SAVE_CX,WORD ;FT. extende open saved CX ;AN000;
+ I_am SAVE_BX,WORD ;FT. extende open saved BX ;AN000;
+ I_am SAVE_SI,WORD ;FT. extende open saved SI ;AN000;
+ I_am SAVE_DS,WORD ;FT. extende open saved DS ;AN000;
+
+; HIGH_SECTOR is a hack to allow passing 32-bit sector numbers where
+; we used to just pass 16 bits in a register. Now High_SECTOR holds
+; the high 16, the low 16 are still in the register.
+
+ I_am HIGH_SECTOR,WORD,<0> ;>32mb higher sector # ;AN000;
+
+ I_am UU_HIGH_SECTOR_TEMP,WORD,<0> ;M019: Unused
+
+ I_am DISK_FULL,BYTE ;>32mb indicating disk full when 1 ;AN000;
+ I_am TEMP_VAR,WORD ; temporary variable for everyone ;AN000;
+ I_am TEMP_VAR2,WORD ; temporary variable 2 for everyone ;AN000;
+ I_am DrvErr,BYTE ; used to save drive error ;AN000;
+ I_am DOS34_FLAG,WORD,<0> ; common flag for DOS 3.4 ;AN000;
+ I_am NO_FILTER_PATH,DWORD ; pointer to orignal path ;AN000;
+ I_am NO_FILTER_DPATH,DWORD ; pointer to orignal path of destination;AN000;
+; M008
+ I_am AbsRdWr_SS,WORD ; INT 25/26 user stack segment
+ I_am AbsRdWr_SP,WORD ; INT 25/26 user stack offset
+ I_am UU_Callback_flag,BYTE,<0> ; Unused
+; M008
+
+
+; make those pushes fast!!!
+EVEN
+StackSize = 180h ; gross but effective
+;;;StackSize = 300h ; This is a "trial" change IBM hasn't
+;;; ; made up their minds about
+
+;
+; WARNING!!!! DskStack may grow into AUXSTACK due to interrupt service.
+; This is NO problem as long as AUXSTACK comes immediately before DSKSTACK
+;
+
+ PUBLIC RENAMEDMA,AuxStack,DskStack,IOStack
+RENAMEDMA LABEL BYTE ; See DOS_RENAME
+
+ DB StackSize DUP (?) ;
+AuxStack LABEL BYTE
+
+ DB StackSize DUP (?) ;
+DskStack LABEL BYTE
+
+ DB StackSize DUP (?) ;
+IOStack LABEL BYTE
+
+
+; patch space for Boca folks.
+; Say What????!!! This does NOT go into the swappable area!
+; NOTE: We include the decl of ibmpatch in ms-dos even though it is not needed.
+; This allows the REDIRector to work on either IBM or MS-DOS.
+
+PUBLIC IBMPATCH
+IBMPATCH label byte
+ I_am PRINTER_FLAG,BYTE,<0> ; [SYSTEM] status of PRINT utility
+ I_am VOLCHNG_FLAG,BYTE,<0> ; [SYSTEM] true if volume label created
+ I_am VIRTUAL_OPEN,BYTE,<0> ; [SYSTEM] non-zero if we opened a virtual file
+
+; Following 4 variables moved to MSDATA.asm from MSTABLE.asm (P4986)
+ I_am FSeek_drive,BYTE ;AN000; fastseek drive #
+ I_am FSeek_firclus,WORD ;AN000; fastseek first cluster #
+ I_am FSeek_logclus,WORD ;AN000; fastseek logical cluster #
+ I_am FSeek_logsave,WORD ;AN000; fastseek returned log clus #
+; I_am UU_ACT_PAGE,WORD,<-1> ;;;;;;; ;BL ; active EMS page ;AN000;
+ I_am TEMP_DOSLOC,WORD,<-1> ;stores the temporary location of dos
+ ;at SYSINIT time.
+
+
+SWAP_END LABEL BYTE
+PUBLIC SWAP_END
+
+; THE FOLLOWING BYTE MUST BE HERE, IMMEDIATELY FOLLOWING SWAP_END. IT CANNOT
+; BE USED. If the size of the swap data area is ODD, it will be rounded up
+; to include this byte.
+ DB ?
+
+;hkn; DB (512+80+32-(SWAP_END-ibmpatch)) DUP (?)
+
+
+DOSDATA ENDS
+
+
+
+DOSDATALAST SEGMENT
+
+MSDAT001e label byte
+
+DOSDATALAST ENDS
+
diff --git a/private/mvdm/dos/v86/inc/msbdata.inc b/private/mvdm/dos/v86/inc/msbdata.inc
new file mode 100644
index 000000000..b74996454
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msbdata.inc
@@ -0,0 +1,54 @@
+; MSBDATA.INC
+;
+; This file defines some locations in the BIOS data segment that are
+; accessed by code outside the BIOS, e.g. by the DOS and by the ROMDOS
+; loader.
+;
+
+
+ ifndef In_Bios ; if we're actually running in the BIOS,
+; ; then our segment is already open and
+; ; we'll actually generate code
+
+Bdata segment at 70h
+ assume cs:Bdata
+ org 3 ; fixed location in Bios_Data segment
+int_2f = 0 ; define dummy so msbdata will assemble
+
+ endif
+
+ public dosdatasg
+DosDataSg dw 0 ; Let DOS find it's data segment through here
+ ; Note: this value is set by the ROMDOS loader
+ ; to tell where the DOS data and init code
+ ; has been loaded into RAM
+
+
+; dos's int 2f handler will exit via a jump through here. This is
+; how the BIOS hooks int2f
+
+ public bios_i2f ; M012
+bios_i2f proc far
+; jmp int_2f ; assembler won't generate forward
+; ; reference to a far label
+ db 0eah
+ dd int_2f ; generate manual far jump
+bios_i2f endp
+
+ public romstartaddr
+romstartaddr dw 0 ; The start address for the romfind routines
+ ; is obtained from here (70:A)
+
+; This is a byte used for special key handling in the resident
+; console device driver. It must be here so that it can be included
+; in the WIN386 instance table (in INC\LMSTUB.ASM).
+
+ public altah
+
+altah db 0 ;special key handling
+
+
+ ifndef In_Bios
+Bdata ends
+ endif
+
diff --git a/private/mvdm/dos/v86/inc/msdata2.asm b/private/mvdm/dos/v86/inc/msdata2.asm
new file mode 100644
index 000000000..2eb35e4a7
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msdata2.asm
@@ -0,0 +1,31 @@
+; SCCSID = @(#)ibmdata.asm 1.1 85/04/10
+;
+; DATA Segment for DOS
+;
+
+.xlist
+.xcref
+include dosseg.inc
+include dossym.inc
+include version.inc
+include mssw.asm
+INCLUDE SF.INC
+INCLUDE CURDIR.INC
+INCLUDE DPB.INC
+INCLUDE ARENA.INC
+INCLUDE VECTOR.INC
+INCLUDE DEVSYM.INC
+INCLUDE PDB.INC
+INCLUDE FIND.INC
+INCLUDE MI.INC
+.cref
+.list
+
+TITLE IBMDATA - DATA segment for DOS
+NAME IBMDATA
+
+installed = TRUE
+
+include msdata.asm
+include msinit.asm
+ END
diff --git a/private/mvdm/dos/v86/inc/msgdcl.inc b/private/mvdm/dos/v86/inc/msgdcl.inc
new file mode 100644
index 000000000..52f3d77dc
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msgdcl.inc
@@ -0,0 +1,108 @@
+; This Macro was removed from sysmsg.inc. We had to remove this
+; macro and put it into it's own include file in order to clear up
+; some assembly errors. MS MASM will not allow a public declaration
+; during the second pass of the assembler. IBM MASM will allow this.
+;
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_DECLARE Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_DECLARE macro numcls ;
+ $M_DCOUNT = 0 ;
+ REPT numcls ;
+ $M_DCOUNT = $M_DCOUNT + 1 ;
+ $M_DECLARE2 %$M_DCOUNT ;
+ ENDM ;
+
+ IF COMR
+ IFNDEF $M_RT2 ; If Resident table is not in this assembly,
+ EXTRN $M_RT2:BYTE ; Must be external
+ ELSE
+ PUBLIC $M_RT2
+ ENDIF ;
+ ELSE
+ IFNDEF $M_RT ; If Resident table is not in this assembly,
+ EXTRN $M_RT:BYTE ; Must be external
+ ELSE
+ PUBLIC $M_RT
+ ENDIF ;
+ ENDIF
+
+ $M_CHECK $M_GET_MSG_ADDRESS ; If this subroutine is not in this assembly,
+ $M_CHECK $M_MSGSERV_1 ; If this subroutine is not in this assembly,
+ $M_CHECK $M_MSGSERV_2 ; If this subroutine is not in this assembly,
+
+ENDM ;
+ ;
+$M_DECLARE2 macro innum ;
+ IF NOT COMR ; IF Not resident COMMAND.COM
+ IF NOT COMT ; IF Not transient COMMAND.COM
+ IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+ IF FARmsg ;
+ EXTRN $M_CLS_&innum:FAR ; Must be external
+ ELSE ;
+ EXTRN $M_CLS_&innum:NEAR ; Must be external
+ ENDIF ;
+ ELSE ; ELSE
+ PUBLIC $M_CLS_&innum ; Label PUBLIC
+ ENDIF ;
+ ELSE ; ELSE
+ IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
+ IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
+ IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+ IF FARmsg ;
+ EXTRN $M_CLS_&innum:FAR ; Must be external
+ ELSE ;
+ EXTRN $M_CLS_&innum:NEAR ; Must be external
+ ENDIF ;
+ ELSE ; ELSE
+ PUBLIC $M_CLS_&innum ; Label PUBLIC
+ ENDIF ;
+ ENDIF ;
+ ENDIF ;
+ ENDIF ;
+ ELSE ; ELSE
+ IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
+ IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
+ IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+ IF FARmsg ;
+ EXTRN $M_CLS_&innum:FAR ; Must be external
+ ELSE ;
+ EXTRN $M_CLS_&innum:NEAR ; Must be external
+ ENDIF ;
+ ELSE ; ELSE
+ PUBLIC $M_CLS_&innum ; Label PUBLIC
+ ENDIF ;
+ ENDIF ;
+ ENDIF ;
+ ENDIF ;
+ENDM ;
+ ;
+$M_CHECK macro parm ;
+ IFNDEF parm ; IF class is not in this assembly,
+ IF FARmsg ;
+ EXTRN parm:FAR ; Must be external
+ ELSE ;
+ EXTRN parm:NEAR ; Must be external
+ ENDIF ;
+ ELSE
+ IF COMR
+ ELSE
+ PUBLIC parm
+ ENDIF
+ ENDIF ;
+ENDM ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+IF1 ;
+ $M_DECLARE %$M_NUM_CLS ; Declare any class not in this assembly
+ENDIF ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/msghan.inc b/private/mvdm/dos/v86/inc/msghan.inc
new file mode 100644
index 000000000..4834f06e4
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msghan.inc
@@ -0,0 +1,154 @@
+ IF1 ;AN000;
+ ;%OUT INCLUDING MSGHAN.INC...;AN000;
+ ENDIF ;AN000;
+;THIS IS A COMMONLY INCLUDED FILE, USED BY (AT LEAST) THE FOLLOWING COMPONENTS:
+;TREE, GRAFTABL, DISKCOMP, DISKCOPY, COMP - WRITTEN OR Revised BY E.K.
+
+; VALUES FOR THE MSG_DESC CONTROL BLOCK
+ONE_SUBS EQU 1 ;AN000;ONE VARIABLE FIELD IN MESSAGE
+TWO_SUBS EQU 2 ;AN000;TWO VARIABLE FIELDS IN MESSAGE
+THREE_SUBS EQU 3 ;AN000;THREE VARIABLE FIELDS IN MESSAGE
+CLASS_1 EQU EXT_ERR_CLASS ;AN000;CLASS 1 (DOS EXTENDED ERRORS)
+CLASS_2 EQU PARSE_ERR_CLASS ;AN000;CLASS 2 (PARSE ERRORS)
+CLASS_A EQU UTILITY_MSG_CLASS ;AN000;CLASS A TYPE MESSAGE
+
+;THIS MESSAGE DESCRIPTOR CONTROL BLOCK IS GENERATED, ONE PER MESSAGE,
+;TO DEFINE THE SEVERAL PARAMETERS THAT ARE EXPECTED TO BE PASSED IN
+;CERTAIN REGISTERS WHEN THE SYSDISPMSG FUNCTION IS TO BE INVOKED.
+
+MSG_DESC STRUC ;AN000;
+MSG_NUM DW 0 ;AN000;MESSAGE NUMBER (TO AX)
+MSG_HANDLE DW STDOUT ;AN000;HANDLE OF OUTPUT DEVICE (TO BX)
+MSG_SUBLIST DW 0 ;AN000;POINTER TO SUBLIST (TO SI)
+MSG_COUNT DW 0 ;AN000;SUBSTITUTION COUNT (TO CX)
+MSG_CLASS DW CLASS_A SHL 8 ;AN000;MESSAGE CLASS (IN HIGH BYTE, TO DH)
+ ; LOW BYTE HAS 0 (FUNCTION "NO INPUT", TO DL)
+MSG_DESC ENDS ;AN000;
+
+; VALUES FOR THE SUBLIST CONTROL BLOCK
+PC_ID_0 EQU 0 ;AN000;ID OF " - " TRAILER TO MESSAGE
+PC_ID_1 EQU 1 ;AN000;ID OF PERCENT VARIABLE FIELD
+PC_ID_2 EQU 2 ;AN000;ID OF PERCENT VARIABLE FIELD
+PC_ID_3 EQU 3 ;AN000;ID OF PERCENT VARIABLE FIELD
+MAX_0 EQU 0 ;AN000;MAXIMUM WIDTH OF STRING FIELD (0=NO LIMIT)
+MIN_1 EQU 1 ;AN000;MINIMUM WIDTH OF STRING FIELD
+PAD_BLK EQU " " ;AN000;CHAR FOR PAD FIELD
+FILL_OFF EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL OFFSET
+FILL_SEG EQU 0 ;AN000;TO BE REPLACED WITH ACTUAL SEG ID
+
+;THIS SUBLIST CONTROL BLOCK, POINTED TO BY SI WHEN SYSDISPMSG IS CALLED
+;FURTHER DESCRIBES THE MESSAGE AND THE VARIABLE FIELDS THE MSG MAY CONTAIN.
+;THERE IS ONE OF THESE CONTROL BLOCKS PER VARIABLE FIELD. ADDITIONAL
+;VARIABLE FIELDS ARE DEFINED IN ADDITIONAL "SUBLIST" CONTROL BLOCKS,
+;CONSECUTIVE AND CONTIGUOUS WITH THIS ONE. THE NUMBER OF THESE CONTROL
+;BLOCKS IS THE SUBSTITUTION COUNT, PASSED IN CS TO SYSDISPMSG, AS DEFINED
+;IN THE ABOVE "MSC_DESC" CONTROL BLOCK.
+
+SUBLIST STRUC ;AN000;
+SUB_SIZE DB 11 ;AN000;SUBLIST SIZE (POINTER TO NEXT SUBLIST)
+SUB_RES DB 0 ;AN000;RESERVED
+ ;NEXT FIELD IS TO BE USED AS A DOUBLE WORD
+SUB_VALUE DW 0 ;AN000;TIME, DATE, OR PTR TO DATA ITEM
+SUB_VALUE_SEG DW 0 ;AN000;SEG ID OF PTR
+ ;(ABOVE FIELD MUST BE FILLED AT EXECUTION TIME
+ ; IF THIS IS A .COM FILE)
+SUB_ID DB 0 ;AN000;N OF %N
+SUB_FLAGS DB 0 ;AN000;DATA TYPE FLAGS
+SUB_MAX_WIDTH DB MAX_0 ;AN000;MAXIMUM FIELD WIDTH (0=UNLIMITED)
+SUB_MIN_WIDTH DB 0 ;AN000;MINIMUM FIELD WIDTH
+SUB_PAD_CHAR DB PAD_BLK ;AN000;CHARACTER FOR PAD FIELD
+ ; CAN BE " ", "0" OR ",".
+ ; "," CAUSES INSERTION OF THE ACTIVE
+ ; THOUSANDS SEPARATOR BETWEEN EVERY 3 DIGITS.
+SUBLIST ENDS ;AN000;
+
+; BITS DEFINED FOR SUB_FLAGS ABOVE
+; FORMAT = A0SSTTTT
+; ++ + +--- FIELD TYPE
+; || +--- DATA VARIABLE SIZE
+; |+--- RESERVED, MUST BE ZERO
+; +--- ALIGNMENT INDICATOR
+SF_BITS RECORD F_ALIGN:1,F_RES:1=0,F_SIZE:2,F_TYPE:4;AN000;
+
+; F_ALIGN FIELD, ALIGNMENT INDICATOR
+SF_LEFT EQU 0 ;AN000;LEFT ALIGN
+SF_RIGHT EQU 1 ;AN000;RIGHT ALIGN
+
+; F_RES FIELD, RESERVED, SHOULD BE ZERO
+
+; F_TYPE FIELD, FIELD TYPE
+SF_CHAR EQU 0000B ;AN000;TYPE IS CHARACTER
+; F_SIZE FIELD,
+SF_CH EQU 00B ;AN000;SINGLE CHARACTER
+SF_ASCIIZ EQU 01B ;AN000;ASCIIZ STRING
+
+; F_TYPE FIELD, FIELD TYPE
+SF_UN_BD EQU 0001B ;AN000;UNSIGNED BINARY TO DECIMAL CHARACTER
+; F_SIZE FIELD,
+SF_BYTE EQU 01B ;AN000;DATA IS BYTE SIZED
+SF_WORD EQU 10B ;AN000;DATA IS WORD SIZED
+SF_DWORD EQU 11B ;AN000;DATA IS DOUBLE WORD SIZED
+
+; F_TYPE FIELD, FIELD TYPE
+SF_SIN_BD EQU 0010B ;AN000;SIGNED BINARY TO DECIMAL CHARACTER
+; F_SIZE FIELD,
+;SF_BYTE EQU 01B ;DATA IS BYTE SIZED
+;SF_WORD EQU 10B ;DATA IS WORD SIZED
+;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED
+
+; F_TYPE FIELD, FIELD TYPE
+SF_UN_BH EQU 0011B ;AN000;UNSIGNED BINARY TO HEXADECIMAL CHARACTER
+; F_SIZE FIELD,
+;SF_BYTE EQU 01B ;DATA IS BYTE SIZED
+;SF_WORD EQU 10B ;DATA IS WORD SIZED
+;SF_DWORD EQU 11B ;DATA IS DOUBLE WORD SIZED
+
+; F_TYPE FIELD, FIELD TYPE
+SF_DATE EQU 0100B ;AN000;DATE TO CHARACTER,
+ ; USING CURRENT COUNTRY FORMAT
+ ;SUB_VALUE HIGH=YEAR
+ ;SUB_VALUE LOW=MMDD
+; F_SIZE FIELD,
+SF_MD EQU 01B ;AN000;MONTH AND DAY ONLY
+SF_MDY2 EQU 10B ;AN000;MONTH,DAY AND YEAR (2 DIGITS)
+SF_MDY4 EQU 11B ;AN000;MONTH,DAY AND YEAR (4 DIGITS)
+
+; F_TYPE FIELD, FIELD TYPE
+SF_TIME_12 EQU 0101B ;AN000;TIME TO CHARACTER, 12 HOUR FORMAT
+ ; USING CURRENT COUNTRY FORMAT
+ ;SUB_VALUE HIGH=HHMM
+ ;SUB_VALUE LOW=SSHH
+; F_SIZE FIELD,
+SF_HHMM EQU 00B ;AN000;HH:MM (ACTIVE TIME FORMAT)
+SF_HHMMSS EQU 01B ;AN000;HH:MM:SS (ACTIVE TIME FORMAT)
+SF_HHMMSSHH EQU 10B ;AN000;HH:MM:SS:HH
+
+; F_TYPE FIELD, FIELD TYPE
+SF_TIME_24 EQU 0110B ;AN000;TIME TO CHARACTER, 24 HOUR FORMAT
+ ; USING CURRENT COUNTRY FORMAT
+ ;SUB_VALUE HIGH=HHMM
+ ;SUB_VALUE LOW=SSHH
+; F_SIZE FIELD,
+;SF_HHMM EQU 00B ;HH:MM (ACTIVE TIME FORMAT)
+;SF_HHMMSS EQU 01B ;HH:MM:SS (ACTIVE TIME FORMAT)
+;SF_HHMMSSHH EQU 10B ;HH:MM:SS:HH
+
+; THE NEXT GROUP ARE ALL CLASS "1" MESSAGES
+
+ PUBLIC MSGNUM_EXTERR;AN000;
+MSGNUM_EXTERR MSG_DESC <,STDERR,,,CLASS_1 SHL 8> ;AN000;ALL EXTENDED DOS ERRORS
+ ;ERROR NUMBER WILL NEED TO BE FILLED IN
+
+; THE NEXT GROUP ARE ALL CLASS "2" MESSAGES
+
+ PUBLIC MSGNUM_PARSE ;AN000;SO PARSE DRIVER CAN FIND IT
+MSGNUM_PARSE MSG_DESC <,STDERR,,,CLASS_2 SHL 8> ;AN000;ALL PARSING ERRORS
+ ;ERROR NUMBER WILL NEED TO BE FILLED IN
+
+; THE NEXT GROUP ARE ALL CLASS "A" MESSAGES
+; THESE ARE THE "CANNED" MESSAGES ALWAYS PRESENT
+
+ PUBLIC MSGNUM_VER ;AN000;
+MSGNUM_VER MSG_DESC <1,STDERR> ;AN000;"Incorrect DOS Version"
+;end of MSGHAN.INC
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/msgserv.asm b/private/mvdm/dos/v86/inc/msgserv.asm
new file mode 100644
index 000000000..e4687e982
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msgserv.asm
@@ -0,0 +1,3258 @@
+; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * *
+;
+; MODULE NAME: MSGSERV.SAL
+;
+; DESCRIPTIVE NAME: Message Services SALUT file
+;
+; FUNCTION: This module incorporates all the messages services and
+; is called upon at build time to INCLUDE the code requested
+; by a utility. Code is requested using the macro MSG_SERVICES.
+;
+; ENTRY POINT: Since this a collection of subroutines, entry point is at
+; requested procedure.
+;
+; INPUT: Since this a collection of subroutines, input is dependent on function
+; requested.
+;
+; EXIT-NORMAL: In all cases, CARRY FLAG = 0
+;
+; EXIT-ERROR: In all cases, CARRY FLAG = 1
+;
+; INTERNAL REFERENCES: (list of included subroutines)
+;
+; - SYSLOADMSG
+; - SYSDISPMSG
+; - SYSGETMSG
+;
+;
+; EXTERNAL REFERENCES: None
+;
+; NOTES: At build time, some modules must be included. These are only included
+; once using assembler switches. Other logic is included at the request
+; of the utility.
+;
+; COMR and COMT are assembler switches to conditionally assemble code
+; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident
+; storage and multiple EQUates.
+;
+; REVISION HISTORY: Created MAY 1987
+;
+; Label: DOS - - Message Retriever
+; (c) Copyright 1988 Microsoft
+;
+;
+; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * *
+; Page
+
+;
+; Revision History
+; ================
+;
+; M007 SR 08/24/90 Fixed bug #1818 -- changed
+; $M_DISPLAY_H_STRING to properly
+; handle Ctrl-Z being passed
+;
+; M013 SR 9/12/90 Make SETSTDIO flag false so that all
+; these routines are no longer assembled.
+;
+; M016 SR 10/14/90 Bug #3380. Changed SYSLOADMSG so that
+; CR-LF string also gets reinitialized
+; on every cycle.
+;
+; M020 SR 10/26/90 Bug #3380 again. Initialize $M_DIVISOR
+; & $_MSG_NUM also in SYSLOADMSG.
+;
+
+
+
+; $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting
+
+IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN
+ $M_STRUC = FALSE ;;AN000;; Let the assembler know that we have
+ ;;AN000;; and include them
+
+ PAGE
+ SUBTTL DOS - Message Retriever - MSGSTR.INC Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_SUBLIST_STRUC
+;;
+;; Replacable parameters are described by a sublist structure
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_SUBLIST_STRUC STRUC ;;AN000;;
+ ;;
+ $M_S_SIZE DB 11 ;;AN000;; SUBLIST size (PTR to next SUBLIST)
+ $M_S_RESV DB 0 ;;AN000;; RESERVED
+ $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item
+ $M_S_ID DB ? ;;AN000;; n of %n
+ $M_S_FLAG DB ? ;;AN000;; Data-type flags
+ $M_S_MAXW DB ? ;;AN000;; Maximum field width
+ $M_S_MINW DB ? ;;AN000;; Minimum field width
+ $M_S_PAD DB ? ;;AN000;; Character for Pad field
+ ;;
+$M_SUBLIST_STRUC ENDS ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_CLASS_ID
+;;
+;; Each class will be defined by this structure.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CLASS_ID STRUC ;;AN000;;
+ ;;
+ $M_CLS_ID DB -1 ;;AN000;; Class identifer
+ $M_COMMAND_VER DW EXPECTED_VERSION ;;AN003;; COMMAND.COM version check
+ $M_NUM_CLS_MSG DB 0 ;;AN000;; Total number of message in class
+ ;;
+$M_CLASS_ID ENDS ;;
+ ;;AN000;;
+ $M_CLASS_ID_SZ EQU SIZE $M_CLASS_ID ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_ID_STRUC
+;;
+;; Each message will be defined by this structure.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_ID STRUC ;;AN000;;
+ ;;
+ $M_NUM DW -1 ;;AN000;; Message Number
+ $M_TXT_PTR DW ? ;;AN000;; Pointer to message text
+ ;;
+$M_ID ENDS ;;AN000;;
+ ;;AN000;; Status Flag Values:
+ $M_ID_SZ EQU SIZE $M_ID ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_RES_ADDRS
+;;
+;; Resident data area definition of variables
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_RES_ADDRS STRUC ;;AN000;;
+ ;;
+ $M_EXT_ERR_ADDRS DD 0 ;;AN000;; Allow pointers to THREE Extended error locations
+ $M_EXT_FILE DD 0 ;;AN001;;
+ $M_EXT_COMMAND DD 0 ;;AN000;;
+ $M_EXT_TERM DD -1 ;;AN000;;
+ $M_PARSE_COMMAND DD 0 ;;AN000;;
+ $M_PARSE_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Parse error locations
+ $M_PARSE_TERM DD -1 ;;AN000;;
+ $M_CRIT_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Critical error locations
+ $M_CRIT_COMMAND DD 0 ;;AN000;;
+ $M_CRIT_TERM DD -1 ;;AN000;;
+ $M_DISK_PROC_ADDR DD -1 ;;AN004;; Address of READ_DISK_PROC
+ $M_CLASS_ADDRS DD $M_NUM_CLS DUP(0) ;;AN000;; Allow pointers to specified classes
+ $M_CLS_TERM DD -1 ;;AN000;;
+ $M_DBCS_VEC DD 0 ;;AN000;; Save DBCS vector
+ $M_HANDLE DW ? ;;AN000;;
+ $M_SIZE DB 0 ;;AN000;;
+ $M_CRLF DB 0DH,0AH ;;AN004;; CR LF message
+ $M_CLASS DB ? ;;AN004;; Saved class
+ $M_RETURN_ADDR DW ? ;;AN000;;
+ $M_MSG_NUM DW $M_NULL ;;AN000;;
+ $M_DIVISOR DW 10 ;;AN000;; Default = 10 (must be a WORD for division)
+ $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP("$") ;;AN000;; Temporary buffer
+ $M_BUF_TERM DB "$" ;;AN000;;
+
+$M_RES_ADDRS ENDS ;;AN000;;
+ ;;
+$M_RES_ADDRS_SZ EQU SIZE $M_RES_ADDRS ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_COUNTRY_INFO
+;;
+;; Important fields of the Get Country Information call
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation
+ ;;
+ $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc
+ $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format
+ $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;;
+ $M_THOU_SEPARA DB ?,0 ;;AN000;; <------- Thou Separator
+ $M_DECI_SEPARA DB ?,0 ;;AN000;; <------- Decimal Separator
+ $M_DATE_SEPARA DB ?,0 ;;AN000;; <------- Date Separator
+ $M_TIME_SEPARA DB ?,0 ;;AN000;; <------- Time Separator
+ $M_CURR_FORMAT DB ? ;;AN000;;
+ $M_SIG_DIGS_CU DB ? ;;AN000;;
+ $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format
+ ;;
+$M_COUNTRY_INFO ENDS ;;AN000;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ELSE ;;AN000;; ELSE if we have already included the STRUCTURES
+;
+; $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section
+
+ IF MSGDATA ;;AN000;; IF this is a request to include the data area
+ MSGDATA = FALSE ;;AN000;; Let the assembler know not to include it again
+ ;;AN000;; and include it
+ PAGE
+ SUBTTL DOS - Message Retriever - MSGRES.TAB Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; DATA NAME: $M_RES_TABLE
+;;
+;; REFERENCE LABEL: $M_RT
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF COMR ;;AN000;; Since COMMAND.COM includes this twice
+ $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no
+ $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur
+ $M_ALTLABEL = TRUE ;;AN000;; Flag that label was changed
+ELSE ;;AN000;;
+ $M_RT LABEL BYTE ;;AN000;;
+ENDIF ;;AN000;;
+ $M_RES_ADDRS <> ;;AN000;; Resident addresses
+ ;;
+ include COPYRIGH.INC ;;AN001;; Include Copyright 1988 Microsoft
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of Data table
+
+;
+ IF NOT $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN
+ ;; don't include any more code
+ ;;AN000;; Figure out what other code to include
+ IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code
+ IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it)
+ $M_RT EQU $M_RT2 ;;AN003;;
+ ENDIF
+ DISK_PROC = FALSE ;;AN003;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - DISK_PROC Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: DISK_PROC
+;;
+;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended
+;; errors from disk\diskette
+;; INPUTS: AX has the message number
+;; DX has the message class
+;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is
+;; assumed to be set!!
+;;
+;; OUTPUTS: ES:DI points to message length (BYTE) followed by text
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC READ_DISK_PROC ;;
+ ;;
+READ_DISK_PROC PROC FAR ;;AN003;;
+
+ PUSH AX ;;AN003;; Save everything
+ PUSH BX ;;AN003;;
+ PUSH DX ;;AN003;;
+ PUSH SI ;;AN003;;
+ PUSH BP ;;AN003;;
+ PUSH DS ;;AN003;;
+ PUSH DI ;;AN003;;
+ MOV BP,AX ;;AN003;; Save message number
+ MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function
+ LEA SI,RESGROUP:COMSPEC ;;AN003;; Get addressibilty to COMMAND.COM
+ PUSH CS ;;AN003;;
+ POP DS ;;AN003;;
+ MOV DI,-1 ;;AN003;; No extended attribute list
+ MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error
+ MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag
+ INT 21H ;;AN003;; Open the file
+ POP DI ;;AN003;; Retreive LSEEK pointer
+ ;;AN003;; Error ?
+; $IF NC,LONG ;;AN003;; No,
+ JNC $MXL1
+ JMP $MIF1
+$MXL1:
+ PUSH DI ;;AN003;; Save LSEEK pointer
+ MOV BX,AX ;;AN003;; Set handle in BX
+ MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors
+ XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
+ MOV DX,DI ;;AN003;;
+ INT 21H ;;AN003;; LSEEK the file
+ POP DX ;;AN003;; Retreive LSEEK pointer
+ ;;AN003;; Error ?
+; $IF NC ;;AN003;; No,
+ JC $MIF2
+ INC CX ;;AN003;; Set flag to first pass
+; $DO ;;AN003;;
+$MDO3:
+ PUSH DX ;;AN003;; Save LSEEK pointer
+ PUSH CX ;;AN003;; Save first pass flag
+ PUSH AX ;;AN003;; Save number of messages (if set yet)
+ XOR SI,SI ;;AN003;; Reset buffer index
+ MOV AH,DOS_READ_BYTE ;;AN003;; Read
+ MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
+ INT 21H ;;AN003;; Read it
+ MOV DI,DX ;;AN003;;
+ POP AX ;;AN003;;
+ POP CX ;;AN003;;
+ OR CX,CX ;;AN003;;
+; $IF NZ ;;AN003;;
+ JZ $MIF4
+ XOR CX,CX ;;AN003;; Set flag to second pass
+ XOR AH,AH ;;AN003;; Get number of messages in class
+ MOV AL,DS:[DI].$M_NUM_CLS_MSG ;;AN003;;
+ MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index
+ CMP DS:[DI].$M_COMMAND_VER,EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM?
+; $ENDIF ;;AN003;;
+$MIF4:
+ POP DX ;;AN003;;
+; $IF Z ;;AN003;; Yes,
+ JNZ $MIF6
+; $SEARCH ;;AN003;;
+$MDO7:
+ CMP BP,WORD PTR $M_RT.$M_TEMP_BUF[SI] ;;AN003;; Is this the message I'm looking for?
+; $EXITIF Z ;;AN003;; Yes, (ZF=1)
+ JNZ $MIF7
+ CLC ;;AN003;; Reset carry, exit search
+; $ORELSE ;;AN003;; No, (ZF=0)
+ JMP SHORT $MSR7
+$MIF7:
+ ADD SI,$M_ID_SZ ;;AN003;; Increment index
+ ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header
+ DEC AX ;;AN003;; Decrement # of messages left
+; $LEAVE Z ;;AN003;; Have we exhausted all messages?
+ JZ $MEN7
+ CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer?
+; $ENDLOOP A ;;AN003;; No, Check next message (ZF=1)
+ JNA $MDO7
+$MEN7:
+ STC ;;AN003;; Yes, (ZF=0) set error (ZF=0)
+; $ENDSRCH ;;AN003;;
+$MSR7:
+; $ELSE ;;AN003;; No,
+ JMP SHORT $MEN6
+$MIF6:
+ XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop
+ STC ;;AN003;; Set Carry
+; $ENDIF ;;AN003;;
+$MEN6:
+; $ENDDO Z ;;AN003;; Get next buffer full if needed
+ JNZ $MDO3
+ ;;AN003;; Error ?
+; $IF NC ;;AN003;; No,
+ JC $MIF16
+ MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message
+ XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
+ ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header
+ ADD DX,WORD PTR $M_RT.$M_TEMP_BUF[SI]+2 ;;AN003;; Add offset from msg structure
+ INT 21H ;;AN003;; LSEEK the file
+ MOV AH,DOS_READ_BYTE ;;AN003;; Read
+ MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
+ INT 21H ;;AN003;; Read it
+ MOV DI,DX ;;AN003;; into the temp buffer
+ PUSH DS ;;AN003;; into the temp buffer
+ POP ES ;;AN003;; into the temp buffer
+; $ENDIF ;;AN003;;
+$MIF16:
+; $ENDIF ;;AN003;;
+$MIF2:
+ PUSHF ;;AN003;; Close file handle
+ MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle
+ INT 21H ;;AN003;;
+ $M_POPF ;;AN003;;
+; $ENDIF ;;AN003;; Yes there was an error,
+$MIF1:
+ POP DS ;;AN003;;
+ POP BP ;;AN003;;
+ POP SI ;;AN003;;
+ POP DX ;;AN003;;
+ POP BX ;;AN003;;
+ POP AX ;;AN003;;
+ ;;AN003;; abort everything
+ RET ;;AN003;;
+
+READ_DISK_PROC ENDP ;;AN003;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN003;; END of include for DISK_PROC
+;
+
+SETSTDIO = FALSE ; M013
+ IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO
+ SETSTDIO = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - SETSTDIO Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: SETSTDIO
+;;
+;; FUNCTION:
+;; INPUTS:
+;;
+;; OUPUTS:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;AN001;
+ SETSTDINON PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDINON PROC NEAR ;AN001;
+ENDIF ;AN001;
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+ ;AN001;
+ SETSTDINON ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDINOFF PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDINOFF PROC NEAR ;AN001;
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDINOFF ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDOUTON PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDOUTON PROC NEAR ;AN001;
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDOUTON ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDOUTOFF PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDOUTOFF PROC NEAR
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDOUTOFF ENDP ;AN001;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include for SETSTDIO
+;
+ IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF
+ LOADmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - LOADMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: SYSLOADMSG
+;;
+;; FUNCTION:
+;; INPUTS:
+;;
+;; OUPUTS:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSLOADMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSLOADMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ PUSH AX ;;AN000;
+ PUSH BX ;;AN000;
+ PUSH DX ;;AN000;
+ PUSH ES ;;AN000;
+ PUSH DI ;;AN000;
+ XOR CX,CX ;;AN000; Reset to zero
+ MOV ES,CX ;;AN000;
+ XOR DI,DI ;;AN000;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_EXT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_COMMAND,DI ;;AN000;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_PARSE_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_PARSE_COMMAND,DI ;;AN000;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_CRIT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_CRIT_COMMAND,DI ;;AN000;;
+
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
+ MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE
+ INT 2FH ;;AN001;; Private interface
+ MOV WORD PTR $M_RT.$M_EXT_FILE+2,ES ;;AN001;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_FILE,DI ;;AN001;;
+
+IF COMR ;; ** Special case for RESIDENT COMMAND.COM
+ IF2
+ IFNDEF READ_DISK_INFO ;;AN003;;
+ Extrn READ_DISK_PROC:Far ;;AN003;;
+ ENDIF ;;AN003;;
+ ENDIF ;;AN003;;
+ELSE ;;
+ IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
+ ELSE ;;AN000;;
+ CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
+ ENDIF ;;AN000;;
+ MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS,DI ;;AN000;;
+ MOV WORD PTR $M_RT.$M_CRIT_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_CRIT_ADDRS,DI ;;AN000;;
+ ;;
+ IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
+ ELSE ;;AN000;;
+ CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
+ ENDIF ;;AN000;;
+ MOV WORD PTR $M_RT.$M_PARSE_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_PARSE_ADDRS,DI ;;AN000;;
+ENDIF ;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
+ MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM
+ INT 2FH ;;AN001;; Private interface
+ MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR+2,ES ;;AN001;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR,DI ;;AN001;;
+
+;M016; M020
+; Reinitialize the CR-LF string. Also, reinit the buffer terminator just to
+;be safe. Initialize $M_MSG_NUM and $M_DIVISOR also.
+;
+ mov word ptr $M_RT.$M_CRLF,0a0dh ; Reinit CR-LF ;M016
+ mov byte ptr $M_RT.$M_BUF_TERM,'$' ; Reinit buffer end;M016
+ mov word ptr $M_RT.$M_MSG_NUM,$M_NULL ; M020
+ mov word ptr $M_RT.$M_DIVISOR,$M_BASE10 ; M020
+
+ $M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes
+ ;;AN000;;
+ CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector
+
+IF NOT NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed
+ CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK
+ENDIF ;;AN000;;
+ ;;AN000;;
+IF NOT NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed
+ CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK
+ENDIF ;;AN000;;
+ ;;AN000;;
+IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
+ CLC ;;AN000;; Make sure carry is clear
+ELSE ;;AN000;; ELSE
+ PUSH CX ;;AN000;;
+ CALL $M_VERSION_CHECK ;;AN000;; Check Version
+ENDIF ;;AN000;;
+ ;; Error ?
+; $IF NC ;;AN000;; No.
+ JC $MIF20
+IF NOT NOVERCHECKmsg ;;AN000;; IF version check was not supressed
+ POP CX ;;AN000;; Reset stack
+ENDIF ;;AN000;;
+ POP DI ;;AN000;; Restore REGS
+ POP ES ;;AN000;;
+ POP DX ;;AN000;;
+ POP BX ;;AN000;;
+ POP AX ;;AN000;;
+; $ELSE ;;AN000;; Yes,
+ JMP SHORT $MEN20
+$MIF20:
+IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
+ ADD SP,10 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ELSE ;;AN000;; IF version check is to be supressed
+ ADD SP,12 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ENDIF ;;AN000;; IF version check is to be supressed
+; $ENDIF ;;AN000;;
+$MEN20:
+ RET ;;AN000;;
+ ;;
+ SYSLOADMSG ENDP ;;AN000;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_GET_DBCS_VEC
+;;
+;; Function: Get the DBCS vector and save it for later use
+;;
+;; Inputs: None
+;;
+;; Outputs: None
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_GET_DBCS_VEC PROC NEAR ;;AN000;;
+ ;;
+ PUSH AX ;;AN000;; Save character to check
+ PUSH SI ;;AN000;;
+ PUSH DS ;;AN000;;
+ MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment
+ INT 21H ;;AN000;; Get environment pointer
+ PUSH DS ;;AN000;; Get environment pointer
+ POP ES ;;AN000;; Get environment pointer
+ POP DS ;;AN000;; Get environment pointer
+; $IF NC ;;AN000;;
+ JC $MIF23
+ MOV WORD PTR $M_RT.$M_DBCS_VEC,SI ;;AN000;; Save DBCS Vector
+ MOV WORD PTR $M_RT.$M_DBCS_VEC+2,ES ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF23:
+ POP SI ;;AN000;;
+ POP AX ;;AN000;; Retrieve character to check
+ RET ;;AN000;; Return
+ ;;
+$M_GET_DBCS_VEC ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ?
+ ELSE ;AN001; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_CHECKSTDIN
+;;
+;; Function:
+;;
+;; Inputs: None
+;;
+;; Outputs:
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHECKSTDIN PROC NEAR ;AN001;
+
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ AND DH,1 ;clear top 7 bits
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+
+ RET ;AN001;
+
+$M_CHECKSTDIN ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;AN001; END of include for EOF Check
+ IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full?
+ ELSE ;AN001; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_CHECKSTDOUT
+;;
+;; Function:
+;;
+;; Inputs: None
+;;
+;; Outputs:
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHECKSTDOUT PROC NEAR ;AN001;
+
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+
+ RET ;AN001;
+
+$M_CHECKSTDOUT ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;AN001; END of include for Disk Full Check
+ IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check?
+ ELSE ;;AN000;; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_VERSION_CHECK
+;;
+;; Function: Determine if DOS version is within allowable limits
+;;
+;; Inputs: None
+;;
+;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version
+;; Registers set for SYSDISPMSG
+;; CARRY_FLAG = 0 if Correct DOS version
+;;
+;; Regs Changed: AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_VERSION_CHECK PROC NEAR ;;AN000;;
+ ;;
+ MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC
+ INT 21H ;;AN000;;
+ ;;
+ CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct
+; $IF E ;;AN000;;
+ JNE $MIF25
+ CLC ;;AN000;; Clear the carry flag
+; $ELSE ;;AN000;; ELSE
+ JMP SHORT $MEN25
+$MIF25:
+IF NOT COMR ;; ** Special case for RESIDENT COMMAND.COM
+ CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH
+; $IF B ;;AN000;; No,
+ JNB $MIF27
+ MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support)
+; $ELSE ;;AN000;; Yes,
+ JMP SHORT $MEN27
+$MIF27:
+ MOV BX,STDERR ;;AN000;; Standard Error
+; $ENDIF ;;AN000;;
+$MEN27:
+ELSE
+ MOV BX,NO_HANDLE ;;AN000;; No handle
+ENDIF
+ MOV AX,1 ;;AN000;; Set message # 1
+ MOV CX,NO_REPLACE ;;AN000;; No replacable parms
+ MOV DL,NO_INPUT ;;AN000;; No input
+ MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message
+ STC ;;AN000;; Set Carry Flag
+; $ENDIF ;;AN000;;
+$MEN25:
+ ;;
+ RET ;;AN000;; Return
+ ;;
+$M_VERSION_CHECK ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include for DOS version check
+ ENDIF ;;AN000;; END of include for SYSLOADMSG
+;
+ IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF ;;AN000;;
+ GETmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - GETMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: SYSGETMSG
+;;
+;; Function: The GET service returns the segment, offset and size of the
+;; message text to the caller based on a message number.
+;; The GET function will not display the message thus assumes
+;; caller will handle replaceable parameters.
+;;
+;; Inputs:
+;;
+;; Outputs:
+;;
+;; Psuedocode:
+;; Call $M_GET_MSG_ADDRESS
+;; IF MSG_NUM exists THEN
+;; Set DS:SI = MSG_TXT_PTR + 1
+;; CARRY_FLAG = 0
+;; ELSE
+;; CARRY_FLAG = 1
+;; ENDIF
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSGETMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSGETMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+;; Save registers needed later
+
+ PUSH AX ;;AN000;; Save changed regs
+ PUSH ES ;;AN000;;
+ PUSH DI ;;AN000;;
+ PUSH BP ;;AN000;;
+ ;;
+IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ELSE ;;AN000;;
+ CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ENDIF ;;AN000;; Return message in ES:DI
+; $IF NC ;;AN000;; Message found?
+ JC $MIF31
+ CMP DH,UTILITY_MSG_CLASS
+ CLC ;;AN000;;
+; $IF NE
+ JE $MIF32
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Return message in DS:SI
+; $ELSE
+ JMP SHORT $MEN32
+$MIF32:
+IF FARmsg ;;AN000;; Yes,
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Return message in DS:SI
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;; Return message in DS:SI
+ POP DS ;;AN000;;
+ENDIF ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN32:
+ MOV SI,DI ;;AN000;; Return message in DS:SI
+; $ENDIF ;;AN000;;
+$MIF31:
+ ;;
+ POP BP ;;AN000;; Restore changed regs
+ POP DI ;;AN000;;
+ POP ES ;;AN000;;
+ POP AX ;;AN000;;
+ ;;
+ RET ;;AN000;; Return
+ ;;
+ SYSGETMSG ENDP ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
+ $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_MSG_ADDRESS
+;;
+;; FUNCTION: To scan thru classes to return pointer to the message header
+;; INPUTS: Access to $M_RES_ADDRESSES
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to the specified message
+;; REGS CHANGED: ES,DI,CX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+ PUSH SI ;;AN000;;
+ PUSH BX ;;AN000;;
+ XOR SI,SI ;;AN000;; Use SI as an index
+ XOR CX,CX ;;AN000;; Use CX as an size
+; $DO ;;AN000;;
+$MDO36:
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF37
+ IF FARmsg ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ ELSE ;;AN000;;
+ MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,DI ;;AN000;
+ ENDIF ;;AN000;;
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN37
+$MIF37:
+ TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
+; $IF NE ;;AN000;; Yes,
+ JE $MIF39
+ LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ELSE ;;AN000;; No, extended errors were specified
+ JMP SHORT $MEN39
+$MIF39:
+ CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
+; $IF AE,AND ;;AN000;;
+ JNAE $MIF41
+ CMP AX,$M_CRIT_HI ;;AN000;;
+; $IF BE ;;AN000;; Yes,
+ JNBE $MIF41
+ LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN41
+$MIF41:
+ LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ENDIF ;;AN000;;
+$MEN41:
+; $ENDIF ;;AN000;;
+$MEN39:
+; $ENDIF ;;AN000;;
+$MEN37:
+ ;;
+ CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF46
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF47
+ STC ;;AN000;; Set the carry flag
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN47
+$MIF47:
+ MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
+ MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
+ MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
+ XOR SI,SI ;;AN000;; Reset the SI index to start again
+ CLC ;;AN000;;
+; $ENDIF ;;AN000;; No,
+$MEN47:
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN46
+$MIF46:
+ CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
+; $IF NE ;;AN001;; Yes,
+ JE $MIF51
+ CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
+; $ENDIF ;;AN000;;
+$MIF51:
+ ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
+ CLC ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN46:
+; $LEAVE C ;;AN000;;
+ JC $MEN36
+ OR CX,CX ;;AN000;; Was the message found?
+; $ENDDO NZ,LONG ;;AN000;;
+ JNZ $MXL2
+ JMP $MDO36
+$MXL2:
+$MEN36:
+
+ PUSHF ;;AN006;; Save the flag state
+ CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
+; $IF E ;;AN006;; Yes,
+ JNE $MIF56
+ PUSH DX ;;AN006;; Save all needed registers
+ PUSH BP ;;AN006;;
+ PUSH CX ;;AN006;;
+ PUSH ES ;;AN006;;
+ PUSH DI ;;AN006;;
+ PUSH AX ;;AN006;;
+
+ MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
+ INT 2FH ;;AN006;;
+ CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
+ POP AX ;;AN006;; Restore msg number
+; $IF E ;;AN006;; Yes,
+ JNE $MIF57
+ MOV BX,AX ;;AN006;; BX is the extended error number
+ MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
+ INT 2FH ;;AN006;; Call IFSFUNC
+; $ELSE ;;AN006;; No,
+ JMP SHORT $MEN57
+$MIF57:
+ STC ;;AN006;; Carry conditon
+; $ENDIF ;;AN006;;
+$MEN57:
+
+; $IF C ;;AN006;; Was there an update?
+ JNC $MIF60
+ POP DI ;;AN006;; No,
+ POP ES ;;AN006;; Restore old pointer
+ POP CX ;;AN006;;
+; $ELSE ;;AN006;; Yes
+ JMP SHORT $MEN60
+$MIF60:
+ ADD SP,6 ;;AN006;; Throw away old pointer
+ CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
+; $ENDIF ;;AN006;;
+$MEN60:
+ POP BP ;;AN006;; Restore other Regs
+ POP DX ;;AN006;;
+; $ENDIF ;;AN006;;
+$MIF56:
+ $M_POPF ;;AN006;; Restore the flag state
+
+ POP BX ;;AN000;;
+ POP SI ;;AN000;;
+ RET ;;AN000;; Return ES:DI pointing to the message
+ ;;
+$M_GET_MSG_ADDRESS ENDP ;;
+ ;;
+$M_SET_LEN_IN_CX PROC NEAR ;;
+ ;;
+ PUSH DI ;;AN006;; Save position
+ PUSH AX ;;AN006;;
+ MOV CX,-1 ;;AN006;; Set CX for decrements
+ XOR AL,AL ;;AN006;; Prepare compare register
+ REPNE SCASB ;;AN006;; Scan for zero
+ NOT CX ;;AN006;; Change decrement into number
+ DEC CX ;;AN006;; Don't include the zero
+ POP AX ;;AN006;;
+ POP DI ;;AN006;; Restore position
+ RET ;;AN006;;
+ ;;
+$M_SET_LEN_IN_CX ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FIND_SPECIFIED_MSG
+;;
+;; FUNCTION: To scan thru message headers until message is found
+;; INPUTS: ES:DI points to beginning of msg headers
+;; CX contains the number of messages in class
+;; DH contains the message class
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to header of specified message
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
+ ;;
+ CMP BX,1 ;;AN004;; Do we have an address to CALL?
+; $IF E,AND ;;AN004;; Yes,
+ JNE $MIF64
+ CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
+; $IF NE ;;AN004;; Yes,
+ JE $MIF64
+ CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
+; $IF E ;;AN004;; . . . and . . .
+ JNE $MIF65
+ PUSH AX ;;AN004;; Reset the special message number
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ POP AX ;;AN004;; Reset the special message number
+; $ELSE ;;AN004;; Get the old message number
+ JMP SHORT $MEN65
+$MIF65:
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+; $ENDIF ;;AN004;; Get the old message number
+$MEN65:
+; $ELSE ;;AN004;;
+ JMP SHORT $MEN64
+$MIF64:
+ XOR CX,CX ;;AN002;; CX = 0 will allow us to
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+; $IF NE ;;AN001;;
+ JE $MIF69
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
+; $ELSE ;;AN001;;
+ JMP SHORT $MEN69
+$MIF69:
+IF FARmsg ;;AN001;;
+ CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ELSE
+ CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ENDIF
+; $IF E ;;AN002;; pointer (hopefully)
+ JNE $MIF71
+IF FARmsg ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ELSE
+ MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ENDIF
+; $ENDIF ;;AN002;; go on to the next class
+$MIF71:
+; $ENDIF ;;AN001;;
+$MEN69:
+ ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
+ STC ;;AN004;; Flag that we haven't found anything yet
+; $ENDIF ;;AN004;;
+$MEN64:
+
+; $IF C ;;AN004;; Have we found anything yet?
+ JNC $MIF75
+ CLC ;;AN004;; No, reset carry
+; $SEARCH ;;AN000;;
+$MDO76:
+ OR CX,CX ;;AN000;; Do we have any to check?
+; $LEAVE Z ;;AN000;; No, return with CX = 0
+ JZ $MEN76
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+; $IF NE ;;AN001;;
+ JE $MIF78
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
+; $ELSE ;;AN001;;
+ JMP SHORT $MEN78
+$MIF78:
+IF FARmsg ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ELSE
+ CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ENDIF
+; $ENDIF
+$MEN78:
+; $EXITIF E ;;AN000;;
+ JNE $MIF76
+; $ORELSE ;;AN000;
+ JMP SHORT $MSR76
+$MIF76:
+ DEC CX ;;AN000;; No, well do we have more to check?
+; $LEAVE Z ;;AN000;; No, return with CX = 0
+ JZ $MEN76
+ ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
+; $ENDLOOP ;;AN000;;
+ JMP SHORT $MDO76
+$MEN76:
+ STC ;;AN000;;
+; $ENDSRCH ;;AN000;; Check next message
+$MSR76:
+; $IF NC ;;AN000;; Did we find the message?
+ JC $MIF86
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
+ CLC ;;AN001;;
+; $IF E ;;AN001;;
+ JNE $MIF87
+IF FARmsg ;;AN001;;
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;;
+ POP ES ;;AN000;; Return ES:DI pointing to the message
+ENDIF
+; $ENDIF ;;AN001;;
+$MIF87:
+ ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
+; $ENDIF ;;AN004;;
+$MIF86:
+; $ENDIF ;;AN004;;
+$MIF75:
+ ;; Yes, great we can return with CX > 0
+
+; $IF NC ;;AN000;; Did we find the message?
+ JC $MIF91
+ XOR CH,CH ;;AN000;;
+ MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
+ INC DI ;;AN000;; Increment past length
+; $ENDIF ;;AN004;;
+$MIF91:
+
+ MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
+ RET ;;AN000;; Return
+ ;;
+$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of common subroutines
+ ENDIF ;;AN000;; END of include of SYSGETMSG
+;
+ IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF ;;AN000;;
+ DISPLAYmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - DISPMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: SYSDISPMSG
+;;
+;; Function: The DISPLAY service will output a defined message to a handle
+;; requested by the caller. It also provides function to display
+;; messages when handles are not applicable (ie. DOS function calls
+;; 00h to 0Ah) Replaceable parameters are allowed and are
+;; defined previous to entry.
+;;
+;; It is assumes that a PRELOAD function has already determined
+;; the addressibilty internally to the message retriever services.
+;; Inputs:
+;;
+;; Outputs:
+;;
+;; Psuedocode:
+;; Save registers needed later
+;; Get address of the message requested
+;; IF Message number exists THEN
+;; IF replacable parameters were specified THEN
+;; Display message with replacable parms
+;; ELSE
+;; Display string without replacable parms
+;; ENDIF
+;; IF character input was requested THEN
+;; Wait for character input
+;; ENDIF
+;; Clear CARRY FLAG
+;; ELSE
+;; Set CARRY FLAG
+;; ENDIF
+;; Return
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSDISPMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSDISPMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+;; Save registers and values needed later
+
+ PUSH AX ;;AN000;; Save changed REGs
+ PUSH BX ;;AN000;;
+ PUSH CX ;;AN000;;
+ PUSH BP ;;AN000;;
+ PUSH DI ;;AN000;; Save pointer to input buffer (offset)
+ PUSH ES ;;AN000;; Save pointer to input buffer (segment)
+ PUSH DX ;;AN000;; Save Input/Class request
+
+ MOV BP,CX ;;AN000;; Use BP to hold replace count
+ MOV WORD PTR $M_RT.$M_HANDLE,BX ;;AN000;; Save handle
+ MOV BYTE PTR $M_RT.$M_CLASS,DH ;;AN004;; Save class
+
+;; Get address of the message requested
+
+IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ELSE ;;AN000;;
+ CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ENDIF ;;AN000;;
+ OR CX,CX ;;AN000;; Was message found?
+; $IF NZ ;;AN000;; YES, Message address in ES:DI
+ JZ $MIF93
+
+;; Test if replacable parameters were specified
+
+ OR BP,BP ;;AN000;; Were replacable parameters requested
+; $IF Z ;;AN000;;
+ JNZ $MIF94
+
+;; Display string without replacable parms
+
+ CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN94
+$MIF94:
+IF $M_REPLACE ;;AN000;;
+
+;; Display message with replacable parms
+
+ CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions
+ENDIF ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN94:
+; $IF NC
+ JC $MIF97
+
+ POP DX ;;AN000;; Get Input/Class request
+
+ CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars.
+
+ POP ES ;;AN000;; Get location of input buffer (if specified)
+ POP DI ;;AN000;;
+
+;; Test if character input was requested
+
+IF INPUTmsg ;;AN000;;
+ OR DL,DL ;;AN000;; Was Wait-For-Input requested?
+; $IF NZ ;;AN000;;
+ JZ $MIF98
+ CALL $M_WAIT_FOR_INPUT ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF98:
+ENDIF ;;AN000;;
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN97
+$MIF97:
+ ADD SP,6 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+; $ENDIF ;;AN000;;
+$MEN97:
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN93
+$MIF93:
+ POP ES ;;AN000;; Get pointer to input buffer (segment)
+ POP DI ;;AN000;; Get base pointer to first sublist (offset)
+ POP DX ;;AN000;; Get base pointer to first sublist (segment)
+ STC ;;AN000;; Set carry flag
+; $ENDIF ;;AN000;;
+$MEN93:
+ ;;
+; $IF NC ;;AN000;; Was there an error?
+ JC $MIF104
+ POP BP ;;AN000;; No,
+ POP CX ;;AN000;;
+ POP BX ;;AN000;;
+IF INPUTmsg ;;AN000;;
+ ADD SP,2 ;;AN000;;
+ELSE ;AN000;
+ POP AX ;;AN000;;
+ENDIF ;;AN000;;
+; $ELSE ;;AN000;; Yes,
+ JMP SHORT $MEN104
+$MIF104:
+ ADD SP,8 ;;AN000;; Eliminate from stack
+ STC ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN104:
+ ;;
+ RET ;;AN000;; Return
+ ;;
+ SYSDISPMSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;
+;; PROC NAME: $M_DISPLAY_STRING
+;;
+;; FUNCTION: Will display or write string
+;; INPUTS: ES:DI points to beginning of message
+;; CX contains the length of string to write (if applicable)
+;; OUTPUTS: None
+;; REGS Revised: None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_STRING PROC NEAR ;;AN000;;
+ ;;
+ PUSH AX ;;AN000;;
+ PUSH BX ;;AN000;;
+ PUSH DX ;;AN000;;
+ ;;
+ MOV BX,$M_RT.$M_HANDLE ;;AN000;; Retrieve handle
+ ;;
+IF COMR ;; ** Special case for RESIDENT COMMAND.COM
+ CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
+ELSE
+ CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
+; $IF E ;;AN000;;
+ JNE $MIF107
+ CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN107
+$MIF107:
+ CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle
+; $ENDIF ;;AN000;;
+$MEN107:
+ ;AN001;
+; $IF C ;;AN000;; Was there an error?
+ JNC $MIF110
+ MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes,
+ MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error
+ INT 21H ;;AN000;;
+ XOR AH,AH ;;AN000;; Clear AH
+ ADD SP,6 ;;AN000;; Clean up stack
+ STC ;;AN000;; Flag that there was an error
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN110
+$MIF110:
+ CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
+; $IF NE ;;AN000;;
+ JE $MIF112
+ CMP AX,CX ;AN001; Was it ALL written?
+; $IF NE ;AN001; No,
+ JE $MIF113
+ CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error
+ ADD SP,6 ;AN001; Clean up stack
+ STC ;AN001; Flag that there was an error
+; $ENDIF ;AN001;
+$MIF113:
+; $ENDIF ;AN001;
+$MIF112:
+; $ENDIF ;;AN000;;
+$MEN110:
+ENDIF
+; $IF NC ;;AN000;; Was there ANY error?
+ JC $MIF117
+ POP DX ;;AN000;; Restore regs
+ POP BX ;;AN000;;
+ POP AX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF117:
+ RET ;;AN000;; Return
+ ;;
+$M_DISPLAY_STRING ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_$_STRING
+;;
+;; FUNCTION: Will display a $ terminated string
+;; INPUTS: ES:DI points to beginning of message text (not the length)
+;; OUPUTS: None
+;; REGS USED: AX,DX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_$_STRING PROC NEAR ;;AN000;;
+ ;;
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+IF NOT COMR
+ CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF119
+ MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
+ MOV DL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ INT 21H ;;AN000;; Write character
+ POP DS ;;AN000;; Set DS to segment of message text
+ MOV AL,DL ;;AN000;; Get the character in AL
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+; $IF C ;;AN000;; Yes,
+ JNC $MIF120
+ MOV DL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
+ INT 21H ;;AN000;; Write character
+ CLC ;;AN000;; Clear the DBCS indicator
+; $ENDIF ;;AN000;;
+$MIF120:
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN119
+$MIF119:
+ENDIF
+ MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
+; $DO ;;AN002;; No,
+$MDO123:
+ OR CX,CX ;;AN002;; Are there any left to display?
+; $LEAVE Z ;;AN002;; Yes,
+ JZ $MEN123
+ MOV DL,BYTE PTR ES:[DI] ;;AN002;; Get the character
+ INT 21H ;;AN002;; Display the character
+ INC DI ;;AN002;; Set pointer to next character
+ DEC CX ;;AN002;; Count this character
+; $ENDDO Z ;;AN002;; No,
+ JNZ $MDO123
+$MEN123:
+IF NOT COMR
+; $ENDIF ;;AN000;;
+$MEN119:
+ENDIF
+ CLC ;;AN000;; Char functions used don't return carry as error
+ POP DS ;;AN000;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_$_STRING ENDP ;;AN000;;
+ ;;
+IF NOT COMR
+
+
+;
+;Scan_ctrlZ : This routine looks through the string to be printed and
+;truncates it at the Ctrl-Z if any present.
+;
+; ENTRY: ds:dx = String to be displayed
+; cx = number of chars to be displayed
+;
+; EXIT: cx = number of chars to be displayed
+;
+
+Scan_CtrlZ proc near
+
+ push di
+ push ax
+ push es
+ push bx
+
+ mov di,dx
+ push ds
+ pop es ;es:di points at string
+
+ mov bx,cx ;save current count
+
+ mov al,1ah
+ cld
+ repne scasb ;find first Ctrl-Z
+ jnz noCtrlZ ;no CtrlZ found in string
+
+ sub bx,cx
+ dec bx ;bx = new count to display
+
+noCtrlZ:
+ mov cx,bx ;cx = actual display count
+
+ pop bx
+ pop es
+ pop ax
+ pop di
+
+ ret
+
+Scan_CtrlZ endp
+
+
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_H_STRING
+;;
+;; FUNCTION: Will display a string to a specified handle
+;; INPUTS: ES:DI points to beginning of message
+;; CX contains the number of bytes to write
+;; BX contains the handle to write to
+;; OUPUTS: None
+;; REGS USED: AX,DX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_H_STRING PROC NEAR ;;AN000;;
+ ;;
+ XOR AX,AX ;;AN002;; Set number of bytes written to 0
+ OR CX,CX ;;AN002;; For performance, don't write if not necessary
+; $IF NZ ;;AN002;; Any chars to write?
+ JZ $MIF127
+ PUSH DS ;;AN000;; Yes,
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+ MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
+ MOV DX,DI ;;AN000;; Pointer to data to write
+ CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF128
+ INT 21H ;;AN000;; Write character
+ POP DS ;;AN000;; Set DS to segment of message text
+ PUSH AX ;;AN000;;
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+ POP AX ;;AN000;; Set DS to segment of message text
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+; $IF C ;;AN000;; Yes,
+ JNC $MIF129
+ CLC ;;AN000;; Clear the DBCS indicator
+ MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
+ INC DX ;;AN000;; Point to next character
+ INT 21H ;;AN000;; Write character
+; $ENDIF ;;AN000;;
+$MIF129:
+;SR;
+; If the single char happened to be a Ctrl-Z, the dos write would return
+;0 chars written making the caller think there was an error writing. To
+;avoid this, we check if the single char was a Ctrl-Z and if so, return that
+;the char was written, thus fooling the caller.
+;
+ pushf ;save flags
+ cmp byte ptr es:[di],1ah ;is char a Ctrl-Z?
+ jnz @f ;no, continue
+
+ mov ax,cx ;yes, fake as if it was written
+@@:
+ $M_Popf ;restore flags
+
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN128
+$MIF128:
+;SR;
+; Prescan the string looking for Ctrl-Z. We terminate the message the moment
+;we hit a Ctrl-Z. cx will contain the number of characters to be printed.
+;
+ push bp ; M007
+ push cx
+ call scan_ctrlZ ;cx = count without Ctrl-Z
+ mov bp,cx ;store no ^Z count in bp ;M007
+ pop cx ;get old count back ;M007
+
+ INT 21H ;;AN000;; Write String at DS:SI to handle
+ jnc chk_count ;no error, adjust return count
+
+ jmp short m_cnt_ok ;error, return with carry set;M007
+;M007
+; If we are writing to con and there is a Ctrl-Z in the string, the
+;return count will be much less and if this returns to the caller we can get
+;spurious error messages. We check here if the count returned is same as
+;original count or same as the count if we stop at Ctrl-Z. In the second
+;case, we fake it as if all bytes have been written. If the return count
+;does not match either count, then we had some other disk error (such as
+;insufficient disk space) and we pass it through
+;
+chk_count:
+ cmp cx,ax ;have all bytes been written?;M007
+ je m_cnt_ok ;there was an error writing ;M007
+ cmp bp,ax ;count = Ctrl-Z count? ;M007
+ clc ;no error either way ;M007
+ jne m_cnt_ok ;no, pass it through ;M007
+ mov ax,cx ;return old count ;M007
+m_cnt_ok: ; M007
+ pop bp ; M007
+
+; $ENDIF ;;AN000;;
+$MEN128:
+ POP DS ;;AN000;;
+; $ENDIF ;;AN002;;
+$MIF127:
+ ;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_H_STRING ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_EXT_ERR_39
+;;
+;; FUNCTION: Will set registers for extended error #39
+;; INPUTS: None
+;; OUPUTS: AX,BX,CX set
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_GET_EXT_ERR_39 PROC NEAR ;AN001;
+ ;;
+ MOV AX,EXT_ERR_39 ;AN001; Set AX=39
+ MOV BX,(ERROR_CLASS_39 SHR 8) + ACTION_39 ;AN001; Set BH=1 BL=4
+ MOV CH,LOCUS_39 ;AN001; Set CH=1
+ ;AN001;
+ RET ;AN001;
+ ;;
+$M_GET_EXT_ERR_39 ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ENDIF
+;;
+;; PROC NAME: $M_ADD_CRLF
+;;
+;; FUNCTION: Will decide whether to display a CRLF
+;; INPUTS: DX contains the Input/Class requested
+;; OUTPUTS: None
+;; REGS Revised: CX,ES,DI
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_ADD_CRLF PROC NEAR ;;AN004;;
+ ;;
+ CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
+; $IF NE ;;AN004;; No,
+ JE $MIF134
+ TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF?
+; $IF Z ;;AN004;; No,
+ JNZ $MIF135
+ PUSH DS ;;AN004;;
+ POP ES ;;AN004;; Set ES to data segment
+ LEA DI,$M_RT.$M_CRLF ;;AN004;; Point at CRLF message
+ MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size
+ CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF
+; $ENDIF ;;AN004;;
+$MIF135:
+; $ENDIF ;;AN004;;
+$MIF134:
+ RET ;;AN004;; Return
+ ;;
+$M_ADD_CRLF ENDP ;;AN004;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_IS_IT_DBCS
+;;
+;; FUNCTION: Will decide whether character is Single or Double Byte
+;; INPUTS: AL contains the byte to be checked
+;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range
+;; Carry flag = 1 if byte IS in DBCS range
+;; REGS USED: All restored
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_IS_IT_DBCS PROC NEAR ;;AN000;;
+ ;;
+ PUSH ES ;;AN000;; Save Extra segment register
+ PUSH DI ;;AN000;; Save SI register
+ ;;
+ LES DI,$M_RT.$M_DBCS_VEC ;;AN000;;
+ OR DI,DI ;;AN000;; Was the DBCS vector set?
+; $IF NZ ;;AN000;;
+ JZ $MIF138
+; $DO ;;AN000;;
+$MDO139:
+ CMP WORD PTR ES:[DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag?
+ CLC ;;AN000;;
+; $LEAVE E ;;AN000;;
+ JE $MEN139
+ ;; No,
+ CMP AL,BYTE PTR ES:[DI] ;;AN000;; Does the character fall in the DBCS range?
+; $IF AE,AND ;;AN000;;
+ JNAE $MIF141
+ CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Does the character fall in the DBCS range?
+; $IF BE ;;AN000;;
+ JNBE $MIF141
+ STC ;;AN000;; Yes,
+; $ENDIF ;;AN000;; Set carry flag
+$MIF141:
+ INC DI ;;AN000;; No,
+ INC DI ;;AN000;; Go to next vector
+; $ENDDO ;;AN000;;
+ JMP SHORT $MDO139
+$MEN139:
+; $ENDIF ;;AN000;;
+$MIF138:
+
+ POP DI ;;AN000;;
+ POP ES ;;AN000;; Restore SI register
+ RET ;;AN000;; Return
+ ;;
+$M_IS_IT_DBCS ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_CONVERT2ASC
+;;
+;; FUNCTION: Convert a binary number to a ASCII string
+;; INPUTS: DX:AX contains the number to be converted
+;; $M_RT_DIVISOR contains the divisor
+;; OUPUTS: CX contains the number of characters
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CONVERT2ASC PROC NEAR ;;AN000;;
+ ;;
+ POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Save Return Address
+ XOR BX,BX ;;AN000;; Use BP as a swapping register
+ ;;
+ XCHG BX,AX ;;AN000;; Initialize - Low Word in BP
+ XCHG AX,DX ;;AN000;; - High Word in AX
+; $DO ;;AN000;; DO UNTIL Low Word becomes zero
+$MDO145:
+ DIV $M_RT.$M_DIVISOR ;;AN000;; Divide High Word by divisor
+ XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder
+ ;; and save reduced High Word in BP
+ DIV $M_RT.$M_DIVISOR ;;AN000;; Divide Low Word by divisor
+ CMP DX,9 ;;AN000;; Make a digit of the remainder
+; $IF A ;;AN000;; IF 10 to 15,
+ JNA $MIF146
+ ADD DL,55 ;;AN000;; Make A to F ASCII
+; $ELSE ;;AN000;; IF 0 to 9,
+ JMP SHORT $MEN146
+$MIF146:
+ ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII
+; $ENDIF ;;AN000;;
+$MEN146:
+ PUSH DX ;;AN000;; Save the digit on the stack
+ INC CX ;;AN000;; Count that digit
+ OR AX,AX ;;AN000;; Are we done?
+; $LEAVE Z,AND ;;AN000;;
+ JNZ $MLL149
+ OR BX,BX ;;AN000;; AX and BX must be ZERO!!
+; $LEAVE Z ;;AN000;; No,
+ JZ $MEN145
+$MLL149:
+IF NOT COMR
+ CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark
+; $IF E ;;AN000;; Yes,
+ JNE $MIF150
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF151
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF151:
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN150
+$MIF150:
+ CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark
+; $IF E ;;AN000;; Yes,
+ JNE $MIF154
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF155
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF155:
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN154
+$MIF154:
+ CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark
+; $IF E ;;AN000;; Yes,
+ JNE $MIF158
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF159
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF159:
+; $ENDIF ;;AN000;;
+$MIF158:
+; $ENDIF ;;AN000;;
+$MEN154:
+; $ENDIF ;;AN000;;
+$MEN150:
+ENDIF
+ XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word
+ ;;AN000;; and Revised Low Word
+ XOR DX,DX ;;AN000;; Reset remainder
+; $ENDDO ;;AN000;; NEXT
+ JMP SHORT $MDO145
+$MEN145:
+ ;;AN000;; Yes,
+ XOR DX,DX ;;AN000;; Reset remainder
+ XOR AX,AX ;;AN000;; Reset remainder
+ PUSH [$M_RT.$M_RETURN_ADDR] ;;AN000;; Restore Return Address
+ RET ;;AN000;; Return
+ ;;
+$M_CONVERT2ASC ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_MESSAGE
+;;
+;; FUNCTION: Will display or write entire message (with replacable parameters)
+;; INPUTS: ES:DI points to beginning of message
+;; DS:SI points to first sublist structure in chain
+;; BX contains the handle to write to (if applicable)
+;; CX contains the length of string to write (before substitutions)
+;; BP contains the count of replacables
+;;
+;; OUTPUTS:
+;; REGS USED: All
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_MESSAGE PROC NEAR ;;AN000;;
+ ;;
+; $DO ;;AN000;; Note: DS:SI -> message
+$MDO165:
+ XOR DX,DX ;;AN000;; Set size = 0
+ OR CX,CX ;;AN000;; Are we finished the message yet?
+; $IF NZ ;;AN000;; No,
+ JZ $MIF166
+ MOV AH,"%" ;;AN000;; Prepare to scan for %
+ MOV AL,0 ;;AN004;;
+ ;;
+; $DO ;;AN000;; Scan through string until %
+$MDO167:
+ CMP BYTE PTR ES:[DI],AH ;;AN000;; Is this character NOT a %
+; $LEAVE E,AND ;;AN000;; No,
+ JNE $MLL168
+ CMP BYTE PTR ES:[DI+1],AH ;;AN000;; Is the next character also a %
+; $LEAVE NE,AND ;;AN000;; No,
+ JE $MLL168
+ CMP AL,AH ;;AN000;; Was the character before a %
+; $LEAVE NE ;;AN000;; No, GREAT found it
+ JNE $MEN167
+$MLL168:
+ MOV AL,BYTE PTR ES:[DI] ;;AN004;; Yes, (to any of the above)
+ CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS?
+; $IF C ;;AN004;; Yes,
+ JNC $MIF169
+ INC DI ;;AN004;; Increment past second part
+; $ENDIF ;;AN004;;
+$MIF169:
+ INC DI ;;AN000;; Next character in string
+ INC DX ;;AN000;; Size = Size + 1
+ DEC CX ;;AN000;; Decrement total size
+; $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line
+ JNZ $MDO167
+$MEN167:
+; $ENDIF ;;AN000;;
+$MIF166:
+ ;;
+ PUSH SI ;;AN000;; Save beginning of sublists
+ XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX)
+ OR BP,BP ;;AN000;; Do we have any replacables to do?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF173
+ DEC BP ;;AN000;; Decrement number of replacables
+
+;; Search through sublists to find applicable one
+
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+; $IF E ;;AN000;; No,
+ JNE $MIF174
+; $SEARCH ;;AN000;;
+$MDO175:
+ MOV AL,$M_SL.$M_S_ID ;;AN000;; Get ID byte
+ ADD AL,30H ;;AN000;; Convert to ASCII
+ CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Is this the right sublist?
+; $EXITIF E ;;AN000;;
+ JNE $MIF175
+; $ORELSE ;;AN000;; No,
+ JMP SHORT $MSR175
+$MIF175:
+ CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0
+; $LEAVE E,AND ;;AN000;; Yes,
+ JNE $MLL178
+ OR DX,DX ;;AN000;; Are we at the end of the message?
+; $LEAVE Z ;;AN000;; No,
+ JZ $MEN175
+$MLL178:
+ ADD SI,WORD PTR $M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST
+; $ENDLOOP ;;AN000;; Yes,
+ JMP SHORT $MDO175
+$MEN175:
+ CMP $M_RT.$M_CLASS,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
+; $IF E ;;AN004;; Yes,
+ JNE $MIF180
+ INC DX ;;AN000;; Remember to display CR,LF
+ INC DX ;;AN000;; at the end of the message
+ DEC CX ;;AN000;; Adjust message length
+ DEC CX ;;AN000;;
+ DEC DI ;;AN000;; Adjust ending address of message
+ DEC DI ;;AN000;;
+; $ELSE ;;AN004;; No,
+ JMP SHORT $MEN180
+$MIF180:
+ MOV DX,-1 ;;AN004;; Set special case
+; $ENDIF ;;AN004;;
+$MEN180:
+; $ENDSRCH ;;AN000;;
+$MSR175:
+; $ENDIF ;;AN000;;
+$MIF174:
+; $ENDIF ;;AN000;;
+$MIF173:
+
+;; Prepare and display this part of message
+
+ PUSH DI ;;AN000;; Save pointer to replace number
+ SUB DI,CX ;;AN000;; Determine beginning of string
+ CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end)
+ POP DI ;;AN000;; Get back pointer to replace number
+ POP CX ;;AN000;; Clean up stack in case error
+; $LEAVE C,LONG ;;AN000;; Fail if carry was set
+ JNC $MXL3
+ JMP $MEN165
+$MXL3:
+ PUSH CX ;;AN000;;
+
+;; Save and reset pointer registers
+
+ MOV CX,DX ;;AN000;; Get the size of the rest of the message
+ CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case?
+; $IF NE ;;AN000;; No,
+ JE $MIF187
+ OR CX,CX ;;AN000;; Are we finished the whole message?
+; $IF NZ ;;AN000;; No,
+ JZ $MIF188
+ DEC CX ;;AN000;; Decrement total size (%)
+ DEC CX ;;AN000;; Decrement total size (#)
+ INC DI ;;AN000;; Go past %
+ INC DI ;;AN000;; Go past replace number
+; $ELSE ;;AN000;; Yes, (Note this will not leave because INC)
+ JMP SHORT $MEN188
+$MIF188:
+ POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
+; $ENDIF ;;AN000;; Yes, Note this will not leave because INC
+$MEN188:
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN187
+$MIF187:
+ OR CX,CX ;;AN000;; Are we finished the whole message?
+; $IF Z ;;AN004;; No,
+ JNZ $MIF192
+ POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN192
+$MIF192:
+ CMP CX,-1 ;;AN004;; Are we at the end of the message?
+; $IF Z ;;AN004;; No,
+ JNZ $MIF194
+ XOR CX,CX ;;AN004;;
+; $ENDIF ;;AN000;;
+$MIF194:
+ OR DI,DI ;;AN004;; Turn ZF off
+; $ENDIF ;;AN000;;
+$MEN192:
+; $ENDIF ;;AN000;; Note this will not leave because INC
+$MEN187:
+; $LEAVE Z ;;AN000;;
+ JZ $MEN165
+ PUSH BP ;;AN000;; Save the replace count
+ PUSH DI ;;AN000;; Save location to complete message
+ PUSH ES ;;AN000;;
+ PUSH CX ;;AN000;; Save size of the rest of the message
+ XOR CX,CX ;;AN000;; Reset CX used for character count
+
+;; Determine what action is required on parameter
+
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+; $IF E ;;AN000;;
+ JNE $MIF199
+
+IF CHARmsg ;;AN000;; Was Char specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z ;;AN000;;
+ JNZ $MIF200
+
+;; Character type requested
+ ;;AN000;;
+ LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
+ CALL $M_CHAR_REPLACE ;;AN000;;
+; $ELSE ;;AN000;; Get the rest of the message to display
+ JMP SHORT $MEN200
+$MIF200:
+ENDIF ;;AN000;;
+IF NUMmsg ;;AN000;; Was Nnmeric type specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z,OR ;;AN000;;
+ JZ $MLL202
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z,OR ;;AN000;;
+ JZ $MLL202
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Bin_Hex_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z ;;AN000;;
+ JNZ $MIF202
+$MLL202:
+
+;; Numeric type requested
+
+ LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
+ CALL $M_BIN2ASC_REPLACE ;;AN000;;
+; $ELSE ;;AN000;; Get the rest of the message to display
+ JMP SHORT $MEN202
+$MIF202:
+ENDIF ;;AN000;;
+IF DATEmsg ;;AN000;; Was date specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Date_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF E ;;AN000;;
+ JNE $MIF204
+
+;; Date type requested
+
+ CALL $M_DATE_REPLACE ;;AN000;;
+; $ELSE ;;AN000;; Get the rest of the message to display
+ JMP SHORT $MEN204
+$MIF204:
+ENDIF ;;AN000;;
+IF TIMEmsg ;;AN000;; Was time (12 hour format) specified?
+
+;; Time type requested (Default if we have not matched until here)
+
+ CALL $M_TIME_REPLACE ;;AN000;;
+ENDIF ;;AN000;;
+
+IF DATEmsg ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN204:
+ENDIF ;;AN000;;
+IF NUMmsg ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN202:
+ENDIF ;;AN000;;
+IF CHARmsg ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN200:
+ENDIF ;;AN000;;
+
+IF $M_REPLACE ;;AN000;;
+;; With the replace information of the Stack, display the replaceable field
+
+ CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace
+ENDIF ;;AN000;;
+;; None of the above - Extended/Parse replace
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN199
+$MIF199:
+IF NOT COMR
+ CALL $M_EXT_PAR_REPLACE ;;AN000;;
+ENDIF
+; $ENDIF ;;AN000;;
+$MEN199:
+
+;; We must go back and complete the message after the replacable parameter if there is any left
+
+; $IF NC ;;AN000;; IF there was an error displaying then EXIT
+ JC $MIF211
+ POP CX ;;AN000;; Get size of the rest of the message
+ POP ES ;;AN000;; Get address of the rest of the message
+ POP DI ;;AN000;;
+ POP BP ;;AN000;; Get replacment count
+ POP SI ;;AN000;; ELSE get address of first sublist structure
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN211
+$MIF211:
+ ADD SP,10 ;;AN000;; Clean up stack if error
+ STC ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN211:
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+; $ENDDO NE,OR ;;AN000;;
+ JNE $MLL214
+; $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message
+ JC $MXL4
+ JMP $MDO165
+$MXL4:
+$MLL214:
+$MEN165:
+ ;; IF there was an error displaying then EXIT
+ MOV $M_RT.$M_MSG_NUM,0 ;;AN000;; Reset message number to null
+ RET ;;AN000;; Return
+ ;;
+$M_DISPLAY_MESSAGE ENDP ;;AN000;;
+IF NOT COMR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_EXT_PAR_REPLACE
+;;
+;; FUNCTION:
+;; INPUTS:
+;; OUPUTS:
+;;
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_EXT_PAR_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN000;; Prepare for get binary value (LOW)
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ ;;
+ CALL $M_CONVERT2ASC ;;AN000;;
+ ;;
+; $DO ;;AN000;;
+$MDO215:
+ POP AX ;;AN000;; Get character in register
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF216
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+; $ENDIF ;;AN000;;
+$MIF216:
+ DEC CL ;;AN000;; Have we completed replace?
+; $ENDDO Z ;;AN000;;
+ JNZ $MDO215
+ ;;
+ MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer
+ MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],AX ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ INC BX ;;AN000;; Increase buffer count
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ RET ;;AN000::
+ ;;
+$M_EXT_PAR_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ENDIF
+ IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
+ $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_MSG_ADDRESS
+;;
+;; FUNCTION: To scan thru classes to return pointer to the message header
+;; INPUTS: Access to $M_RES_ADDRESSES
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN DS:SI points to the specified message
+;; REGS CHANGED: ES,DI,CX,DS,SI
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+ PUSH SI ;;AN000;;
+ PUSH BX ;;AN000;;
+ XOR SI,SI ;;AN000;; Use SI as an index
+ XOR CX,CX ;;AN000;; Use CX as an size
+; $DO ;;AN000;;
+$MDO219:
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF220
+ IF FARmsg ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ ELSE ;;AN000;;
+ MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,DI ;;AN000;
+ ENDIF ;;AN000;;
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN220
+$MIF220:
+ TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
+; $IF NE ;;AN000;; Yes,
+ JE $MIF222
+ LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ELSE ;;AN000;; No, extended errors were specified
+ JMP SHORT $MEN222
+$MIF222:
+ CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
+; $IF AE,AND ;;AN000;;
+ JNAE $MIF224
+ CMP AX,$M_CRIT_HI ;;AN000;;
+; $IF BE ;;AN000;; Yes,
+ JNBE $MIF224
+ LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN224
+$MIF224:
+ LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+; $ENDIF ;;AN000;;
+$MEN224:
+; $ENDIF ;;AN000;;
+$MEN222:
+; $ENDIF ;;AN000;;
+$MEN220:
+ ;;
+ CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF229
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF230
+ STC ;;AN000;; Set the carry flag
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN230
+$MIF230:
+ MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
+ MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
+ MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
+ XOR SI,SI ;;AN000;; Reset the SI index to start again
+ CLC ;;AN000;;
+; $ENDIF ;;AN000;; No,
+$MEN230:
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN229
+$MIF229:
+ CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
+; $IF NE ;;AN001;; Yes,
+ JE $MIF234
+ CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
+; $ENDIF ;;AN000;;
+$MIF234:
+ ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
+ CLC ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN229:
+; $LEAVE C ;;AN000;;
+ JC $MEN219
+ OR CX,CX ;;AN000;; Was the message found?
+; $ENDDO NZ,LONG ;;AN000;;
+ JNZ $MXL5
+ JMP $MDO219
+$MXL5:
+$MEN219:
+
+ PUSHF ;;AN006;; Save the flag state
+ CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
+; $IF E ;;AN006;; Yes,
+ JNE $MIF239
+ PUSH DX ;;AN006;; Save all needed registers
+ PUSH BP ;;AN006;;
+ PUSH CX ;;AN006;;
+ PUSH ES ;;AN006;;
+ PUSH DI ;;AN006;;
+ PUSH AX ;;AN006;;
+
+ MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
+ INT 2FH ;;AN006;;
+ CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
+ POP AX ;;AN006;; Restore msg number
+; $IF E ;;AN006;; Yes,
+ JNE $MIF240
+ MOV BX,AX ;;AN006;; BX is the extended error number
+ MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
+ INT 2FH ;;AN006;; Call IFSFUNC
+; $ELSE ;;AN006;; No,
+ JMP SHORT $MEN240
+$MIF240:
+ STC ;;AN006;; Carry conditon
+; $ENDIF ;;AN006;;
+$MEN240:
+
+; $IF C ;;AN006;; Was there an update?
+ JNC $MIF243
+ POP DI ;;AN006;; No,
+ POP ES ;;AN006;; Restore old pointer
+ POP CX ;;AN006;;
+; $ELSE ;;AN006;; Yes
+ JMP SHORT $MEN243
+$MIF243:
+ ADD SP,6 ;;AN006;; Throw away old pointer
+ CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
+; $ENDIF ;;AN006;;
+$MEN243:
+ POP BP ;;AN006;; Restore other Regs
+ POP DX ;;AN006;;
+; $ENDIF ;;AN006;;
+$MIF239:
+ $M_POPF ;;AN006;; Restore the flag state
+
+ POP BX ;;AN000;;
+ POP SI ;;AN000;;
+ RET ;;AN000;; Return ES:DI pointing to the message
+ ;;
+$M_GET_MSG_ADDRESS ENDP ;;
+ ;;
+$M_SET_LEN_IN_CX PROC NEAR ;;
+ ;;
+ PUSH DI ;;AN006;; Save position
+ PUSH AX ;;AN006;;
+ MOV CX,-1 ;;AN006;; Set CX for decrements
+ XOR AL,AL ;;AN006;; Prepare compare register
+ REPNE SCASB ;;AN006;; Scan for zero
+ NOT CX ;;AN006;; Change decrement into number
+ DEC CX ;;AN006;; Don't include the zero
+ POP AX ;;AN006;;
+ POP DI ;;AN006;; Restore position
+ RET ;;AN006;;
+ ;;
+$M_SET_LEN_IN_CX ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FIND_SPECIFIED_MSG
+;;
+;; FUNCTION: To scan thru message headers until message is found
+;; INPUTS: ES:DI points to beginning of msg headers
+;; CX contains the number of messages in class
+;; DH contains the message class
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to header of specified message
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
+ ;;
+ CMP BX,1 ;;AN004;; Do we have an address to CALL?
+; $IF E,AND ;;AN004;; Yes,
+ JNE $MIF247
+ CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
+; $IF NE ;;AN004;; Yes,
+ JE $MIF247
+ CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
+; $IF E ;;AN004;; . . . and . . .
+ JNE $MIF248
+ PUSH AX ;;AN004;; Reset the special message number
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ POP AX ;;AN004;; Reset the special message number
+; $ELSE ;;AN004;; Get the old message number
+ JMP SHORT $MEN248
+$MIF248:
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+; $ENDIF ;;AN004;; Get the old message number
+$MEN248:
+; $ELSE ;;AN004;;
+ JMP SHORT $MEN247
+$MIF247:
+ XOR CX,CX ;;AN002;; CX = 0 will allow us to
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+; $IF NE ;;AN001;;
+ JE $MIF252
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
+; $ELSE ;;AN001;;
+ JMP SHORT $MEN252
+$MIF252:
+IF FARmsg ;;AN001;;
+ CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ELSE
+ CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ENDIF
+; $IF E ;;AN002;; pointer (hopefully)
+ JNE $MIF254
+IF FARmsg ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ELSE
+ MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ENDIF
+; $ENDIF ;;AN002;; go on to the next class
+$MIF254:
+; $ENDIF ;;AN001;;
+$MEN252:
+ ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
+ STC ;;AN004;; Flag that we haven't found anything yet
+; $ENDIF ;;AN004;;
+$MEN247:
+
+; $IF C ;;AN004;; Have we found anything yet?
+ JNC $MIF258
+ CLC ;;AN004;; No, reset carry
+; $SEARCH ;;AN000;;
+$MDO259:
+ OR CX,CX ;;AN000;; Do we have any to check?
+; $LEAVE Z ;;AN000;; No, return with CX = 0
+ JZ $MEN259
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+; $IF NE ;;AN001;;
+ JE $MIF261
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
+; $ELSE ;;AN001;;
+ JMP SHORT $MEN261
+$MIF261:
+IF FARmsg ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ELSE
+ CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ENDIF
+; $ENDIF
+$MEN261:
+; $EXITIF E ;;AN000;;
+ JNE $MIF259
+; $ORELSE ;;AN000;
+ JMP SHORT $MSR259
+$MIF259:
+ DEC CX ;;AN000;; No, well do we have more to check?
+; $LEAVE Z ;;AN000;; No, return with CX = 0
+ JZ $MEN259
+ ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
+; $ENDLOOP ;;AN000;;
+ JMP SHORT $MDO259
+$MEN259:
+ STC ;;AN000;;
+; $ENDSRCH ;;AN000;; Check next message
+$MSR259:
+; $IF NC ;;AN000;; Did we find the message?
+ JC $MIF269
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
+ CLC ;;AN001;;
+; $IF E ;;AN001;;
+ JNE $MIF270
+IF FARmsg ;;AN001;;
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;;
+ POP ES ;;AN000;; Return ES:DI pointing to the message
+ENDIF
+; $ENDIF ;;AN001;;
+$MIF270:
+ ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
+; $ENDIF ;;AN004;;
+$MIF269:
+; $ENDIF ;;AN004;;
+$MIF258:
+ ;; Yes, great we can return with CX > 0
+
+; $IF NC ;;AN000;; Did we find the message?
+ JC $MIF274
+ XOR CH,CH ;;AN000;;
+ MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
+ INC DI ;;AN000;; Increment past length
+; $ENDIF ;;AN004;;
+$MIF274:
+
+ MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
+ RET ;;AN000;; Return
+ ;;
+$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of common subroutines
+;
+ IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms
+ $M_REPLACE = FALSE ;;AN000;; Tell the assembler we did
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+$M_DISPLAY_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ XOR BX,BX ;;AN000;; Use BX for buffer count
+IF NOT COMR
+ CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII)
+; $IF E ;;AN000;; Yes,
+ JNE $MIF276
+ MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE_HYP ;;AN000;; Move in a " -"
+ INC BX ;;AN000;; Increment count
+ INC BX ;;AN000;; Increment count
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE ;;AN000;; Move in a " "
+ INC BX ;;AN000;; Increment count
+ CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case
+; $ENDIF ;;AN000;; If it fails we will catch it later
+$MIF276:
+ENDIF
+
+ POP BP ;;AN000;; Remember the return address
+ XOR BX,BX ;;AN000;; Use BX for buffer count
+ XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack
+
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save size to later clear stack
+ MOV AL,BYTE PTR $M_SL.$M_S_MINW ;;AN000;; Get the minimum width
+ ;;
+ CMP AL,CL ;;AN000;; Do we need pad chars added?
+; $IF A ;;AN000;; Yes,
+ JNA $MIF278
+ SUB AL,CL ;;AN000;; Calculate how many pad chars are needed.
+ MOV DH,AL ;;AN000;; Save the number of pad characters
+ TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be right aligned?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF279
+; $DO ;;AN000;; Begin filling buffer with pad chars
+$MDO280:
+ MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
+ INC BX ;;AN000;;
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF281
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+; $ENDIF ;;AN000;;
+$MIF281:
+ DEC DH ;;AN000;; Have we filled with enough pad chars?
+; $ENDDO Z ;;AN000;; No, next pad character
+ JNZ $MDO280
+; $ENDIF ;;AN000;;
+$MIF279:
+; $ENDIF ;;AN000;; Yes,
+$MIF278:
+ ;;
+ CMP BYTE PTR $M_SL.$M_S_MAXW,$M_UNLIM_W ;;AN000;; Is maximum width unlimited?
+; $IF NE ;;AN000;;
+ JE $MIF286
+ CMP BYTE PTR $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width?
+; $IF B ;;AN000;; Yes,
+ JNB $MIF287
+ SUB CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars
+ MOV DL,CL ;;AN000;; Remember how many chars to pop off
+ MOV CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Set new string length
+; $ENDIF ;;AN000;;
+$MIF287:
+; $ENDIF ;;AN000;;
+$MIF286:
+ OR CX,CX ;;AN000;;
+; $IF NZ ;;AN000;;
+ JZ $MIF290
+; $DO ;;AN000;; Begin filling buffer with string
+$MDO291:
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z,AND ;;AN000;;
+ JNZ $MIF292
+ TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ; Is this replace a ASCIIZ string?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF292
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get first character from string
+ INC DI ;;AN000;; Next character in string
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN292
+$MIF292:
+ POP AX ;;AN000;; Get character in register
+; $ENDIF ;;AN000;;
+$MEN292:
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF295
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+; $ENDIF ;;AN000;;
+$MIF295:
+ DEC CL ;;AN000;; Have we completed replace?
+; $ENDDO Z ;;AN000;; Test again
+ JNZ $MDO291
+; $ENDIF ;;AN000;;
+$MIF290:
+ ;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be left aligned?
+; $IF Z ;;AN000;; Yes,
+ JNZ $MIF299
+ OR DH,DH ;;AN000;; Do we need pad chars added?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF300
+; $DO ;;AN000;; Begin filling buffer with pad chars
+$MDO301:
+ MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
+ INC BX ;;AN000;;
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF302
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+; $ENDIF ;;AN000;;
+$MIF302:
+ DEC DH ;;AN000;; Have we filled with enough pad chars?
+; $ENDDO Z ;;AN000;; Test again
+ JNZ $MDO301
+; $ENDIF ;;AN000;;
+$MIF300:
+; $ENDIF ;;AN000;;
+$MIF299:
+ ;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+; $IF Z,AND ;;AN000;;
+ JNZ $MIF307
+ TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF307
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN307
+$MIF307:
+ OR DL,DL ;;AN000;;
+; $IF NE ;;AN000;;
+ JE $MIF309
+; $DO ;;AN000;;
+$MDO310:
+ POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable
+ DEC DL ;;AN000;; Are we done?
+; $ENDDO Z ;;AN000;;
+ JNZ $MDO310
+; $ENDIF ;;AN000;;
+$MIF309:
+; $ENDIF ;;AN000;;
+$MEN307:
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time
+ PUSH BP ;;AN000;; Restore the return address
+ ;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FLUSH_BUFFER
+;;
+;; FUNCTION: Display the contents of the temporary buffer
+;; INPUTS: DI contains the number of bytes to display
+;; OUTPUTS: BX reset to zero
+;;
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FLUSH_BUF PROC NEAR ;;AN000;;
+ ;;
+ PUSH CX ;;AN000;; Save changed regs
+ PUSH ES ;;AN000;;
+ PUSH DI ;;AN000;;
+ PUSH DS ;;AN000;; Set ES pointing to buffer
+ POP ES ;;AN000;;
+ ;;
+ MOV CX,BX ;;AN000;; Set number of bytes to display
+ XOR BX,BX ;;AN000;; Reset buffer counter
+ LEA DI,$M_RT.$M_TEMP_BUF ;;AN000;; Reset buffer location pointer
+ CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer
+ ;;
+; $IF NC ;;AN000;; Error?
+ JC $MIF314
+ POP DI ;;AN000;; No, Restore changed regs
+ POP ES ;;AN000;;
+ POP CX ;;AN000;;
+; $ELSE ;;AN000;; Yes,
+ JMP SHORT $MEN314
+$MIF314:
+ ADD SP,6 ;;AN000;; Fix stack
+ STC ;;AN000;;
+; $ENDIF ;;AN000;; Error?
+$MEN314:
+ ;;
+ RET ;;AN000;; Return
+ ;;
+$M_FLUSH_BUF ENDP ;;AN000;;
+ ;;
+ ;;
+ IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = TRUE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_CHAR_REPLACE
+;;
+;; FUNCTION: Will prepare a single char or ASCIIZ string for replace
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI contains the VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;;
+;; OTHER REGS Revised: AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHAR_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ TEST $M_SL.$M_S_FLAG,NOT Char_Field_Char AND $M_SIZE_MASK ;;AN000;; Was Character specified?
+; $IF Z ;;AN000;; Yes,
+ JNZ $MIF317
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ PUSH AX ;;AN000;; Put it on the stack
+ INC CX ;;AN000;; Increase the count
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+; $IF C ;;AN000;; Yes,
+ JNC $MIF318
+ MOV AL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
+ PUSH AX ;;AN000;; Put it on the stack
+ CLC ;;AN000;; Clear the carry
+; $ENDIF ;;AN000;;
+$MIF318:
+; $ELSE ;;AN000;; No, it was an ASCIIZ string
+ JMP SHORT $MEN317
+$MIF317:
+; $DO ;;AN000;;
+$MDO321:
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ OR AL,AL ;;AN000;; Is it the NULL?
+; $LEAVE Z ;;AN000;; No,
+ JZ $MEN321
+ INC DI ;;AN000;; Next character
+ INC CX ;;AN000;; Increment the count
+; $ENDDO ;;AN000;; Yes,
+ JMP SHORT $MDO321
+$MEN321:
+ SUB DI,CX ;;AN000;; Set SI at the beginning of the string
+; $ENDIF ;;AN000;;
+$MEN317:
+ ;;AN000;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_CHAR_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of CHAR replace code
+;
+ IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_BIN2ASC_REPLACE
+;;
+;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string
+;; and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI contains the VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; OTHER REGS Revised: BX,DX,AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_BIN2ASC_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ ;;
+ XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
+ XOR AX,AX ;;AN000;; Prepare for get binary value (LOW)
+ MOV $M_RT.$M_DIVISOR,$M_BASE16 ;;AN000;; Set default divisor
+ XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable)
+IF NOT COMR
+ TEST $M_SL.$M_S_FLAG,NOT $M_BYTE AND $M_SIZE_MASK ;;AN000;; Was BYTE specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF325
+ MOV AL, BYTE PTR ES:[DI] ;;AN000;; Setup byte in AL
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF326
+ TEST AL,10000000b ;;AN000;; Is this number negative?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF327
+ INC BX ;;AN000;; Remember that it was negative
+ AND AL,01111111b ;;AN000;; Make it positive
+; $ENDIF ;;AN000;;
+$MIF327:
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF326:
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF330
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF330:
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN325
+$MIF325:
+ENDIF
+ TEST $M_SL.$M_S_FLAG,NOT $M_WORD AND $M_SIZE_MASK ;;AN000;; Was WORD specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF333
+ MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup byte in AL
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;; AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF334
+ TEST AH,10000000b ;;AN000;; Is this number negative?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF335
+ INC BX ;;AN000;; Remember that it was negative
+ AND AH,01111111b ;;AN000;; Make it positive
+; $ENDIF ;;AN000;;
+$MIF335:
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF334:
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF338
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF338:
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN333
+$MIF333:
+IF NOT COMR
+ MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup Double word in DX:AX
+ MOV DX, WORD PTR ES:[DI]+2 ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF341
+ TEST DH,10000000b ;;AN000;; Is this number negative?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF342
+ INC BX ;;AN000;; Remember that it was negative
+ AND DH,01111111b ;;AN000;; Make it positive
+; $ENDIF ;;AN000;;
+$MIF342:
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF341:
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF345
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF345:
+ENDIF
+; $ENDIF ;;AN000;;
+$MEN333:
+; $ENDIF ;;AN000;;
+$MEN325:
+ ;;
+ CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string
+IF NOT COMR
+ OR BX,BX ;;AN000;;
+; $IF NZ ;;AN000;; Was number negative?
+ JZ $MIF349
+ XOR DX,DX ;;AN000;; Yes,
+ MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number
+ PUSH DX ;;AN000;;
+; $ENDIF ;;AN000;; No,
+$MIF349:
+ENDIF
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_BIN2ASC_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of NUM replace code
+;
+ IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DATE_REPLACE
+;;
+;; FUNCTION: Convert a date to a decimal ASCII string using current
+;; country format and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI points at VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; OTHER REGS Revised: DX, AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DATE_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT
+ ;;AN000;; All O.K.?
+ XOR DX,DX ;;AN000;; Reset DX value
+ XOR AX,AX ;;AN000;; Reset AX value
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,0 ;;AN000;; USA Date Format
+; $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ JNE $MIF351
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;; Increment count
+ XOR AX,AX ;;AN000;; Reset AX value
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;; Increment count
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+; $ENDIF ;;AN000;;
+$MIF351:
+ ;;
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,1 ;;AN000;; EUROPE Date Format
+; $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ JNE $MIF353
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ XOR AX,AX ;;AN000;; Reset AX
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+; $ENDIF ;;AN000;;
+$MIF353:
+ ;;
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,2 ;;AN000;; JAPAN Date Format
+; $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ JNE $MIF355
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+; $ENDIF ;;AN000;;
+$MIF355:
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_DATE_REPLACE ENDP ;;AN000;;
+ ;;
+$M_GET_DATE PROC NEAR ;;AN000;;
+ MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
+ MOV AL,0 ;;AN000;; Get current country info
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
+ INT 21H ;;AN000;;
+; $IF C ;;AN000;; No,
+ JNC $MIF357
+ MOV WORD PTR $M_RT.$M_DATE_FORMAT,$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH)
+ MOV BYTE PTR $M_RT.$M_DATE_SEPARA,$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL)
+; $ENDIF ;;AN000;;
+$MIF357:
+ RET ;;AN000;;
+$M_GET_DATE ENDP ;;AN000;;
+ ;;
+$M_YEAR PROC NEAR ;;AN000;;
+ MOV AX,WORD PTR $M_SL.$M_S_VALUE ;;AN000;; Get Year
+ TEST $M_SL.$M_S_FLAG,Date_MDY_4 AND $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified?
+; $IF Z ;;AN000;;
+ JNZ $MIF359
+ CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year
+; $IF A ;;AN000;;
+ JNA $MIF360
+ MOV AX,$M_MAX_2_YEAR ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF360:
+; $ENDIF ;;AN000;;
+$MIF359:
+ RET ;;AN000;;
+$M_YEAR ENDP ;;AN000;;
+ ;;
+$M_CONVERTDATE PROC NEAR ;;AN000;;
+ POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
+ DEC CX ;;AN000;; Test if size only grew by 1
+ CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
+; $IF E ;;AN000;; Yes,
+ JNE $MIF363
+ MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
+ PUSH AX ;;AN000;; Save it
+ INC CX ;;AN000;; Count it
+; $ENDIF ;;AN000;;
+$MIF363:
+ INC CX ;;AN000;; Restore CX
+ PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ RET ;;AN000;;
+$M_CONVERTDATE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of DATE replace code
+;
+ IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_TIME_REPLACE
+;;
+;; FUNCTION: Convert a time to a decimal ASCII string
+;; and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI points at VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; REGS USED: BP,CX,AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_TIME_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ CALL $M_GET_TIME ;;AN000;; All O.K.?
+ TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF365
+ CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF366
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
+ CMP AL,12 ;;AN000;; Is hour 12 or less?
+; $IF L,OR ;;AN000;; or
+ JL $MLL367
+ CMP AL,23 ;;AN000;; Is hour 24 or greater?
+; $IF G ;;AN000;; Yes,
+ JNG $MIF367
+$MLL367:
+ MOV AL,$M_AM ;;AN000;;
+ PUSH AX ;;AN000;; Push an "a" to represent AM.
+ INC CX ;;AN000;;
+; $ELSE ;;AN000;; No,
+ JMP SHORT $MEN367
+$MIF367:
+ MOV AL,$M_PM ;;AN000;;
+ PUSH AX ;;AN000;; Push an "p" to represent PM.
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MEN367:
+; $ENDIF ;;AN000;;
+$MIF366:
+; $ENDIF ;;AN000;;
+$MIF365:
+ ;;
+ XOR AX,AX ;;AN000;;
+ XOR DX,DX ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
+; $IF NZ ;;AN000;;
+ JZ $MIF372
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Hundreds
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_DECI_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF372:
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
+; $IF NZ,OR ;;AN000;;
+ JNZ $MLL374
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified?
+; $IF NZ ;;AN000;;
+ JZ $MIF374
+$MLL374:
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Seconds
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+; $ENDIF ;;AN000;;
+$MIF374:
+ ;; Do Hour/Min (12 Hour)
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+1 ;;AN000;; Get Minutes
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ ;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
+ TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
+; $IF NZ ;;AN000;; Yes,
+ JZ $MIF376
+ CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF377
+ CMP AL,13 ;;AN000;; Is hour less than 12?
+; $IF GE ;;AN000;; Yes,
+ JNGE $MIF378
+ SUB AL,12 ;;AN000;; Set to a 12 hour value
+; $ENDIF ;;AN000;;
+$MIF378:
+ CMP AL,0 ;;AN000;; Is hour less than 12?
+; $IF E ;;AN000;; Yes,
+ JNE $MIF380
+ MOV AL,12 ;;AN000;; Set to a 12 hour value
+; $ENDIF ;;AN000;;
+$MIF380:
+; $ENDIF ;;AN000;;
+$MIF377:
+; $ENDIF ;;AN000;;
+$MIF376:
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_TIME_REPLACE ENDP ;;AN000;;
+ ;;
+$M_GET_TIME PROC NEAR ;;AN000;;
+ MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
+ MOV AL,0 ;;AN000;; Get current country info
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
+ INT 21H ;;AN000;;
+; $IF C ;;AN000;; No,
+ JNC $MIF384
+ MOV WORD PTR $M_RT.$M_TIME_FORMAT,$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH)
+ MOV BYTE PTR $M_RT.$M_TIME_SEPARA,$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL)
+ MOV BYTE PTR $M_RT.$M_DECI_SEPARA,$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL)
+; $ENDIF ;;AN000;;
+$MIF384:
+ RET ;;AN000;;
+$M_GET_TIME ENDP ;;AN000;;
+ ;;
+$M_CONVERTTIME PROC NEAR ;;AN000;;
+ POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
+ DEC CX ;;AN000;; Test if size only grew by 1
+ CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
+; $IF E ;;AN000;; Yes,
+ JNE $MIF386
+ MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
+ PUSH AX ;;AN000;; Save it
+ INC CX ;;AN000;; Count it
+; $ENDIF ;;AN000;;
+$MIF386:
+ INC CX ;;AN000;; Restore CX
+ PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ RET ;;AN000;;
+$M_CONVERTTIME ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of TIME replace
+ ENDIF ;;AN000;; END of include of Replacement common code
+;
+ IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace?
+ INPUTmsg = FALSE ;;AN000;; Yes, THEN include it and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_WAIT_FOR_INPUT
+;;
+;; FUNCTION: To accept keyed input and return extended key value
+;; in AX register
+;; INPUTS: DL contains the DOS function requested for input
+;; OUPUTS: AX contains the extended key value that was read
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_WAIT_FOR_INPUT PROC NEAR ;;AN000;;
+ ;;
+ PUSH CX ;;AN000;; Save CX
+ PUSH DX ;;AN000;; Save DX
+ PUSH DS ;;AN000;; Save Data segment
+ ;;
+ CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer?
+; $IF A ;;AN001;; Yes,
+ JNA $MIF388
+ MOV AL,DL ;;AN001;; Mov function into AL
+ AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble
+ MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function
+; $ELSE ;;AN001;; No,
+ JMP SHORT $MEN388
+$MIF388:
+ MOV AH,DL ;;AN000;; Put DOS function in AH
+; $ENDIF ;;AN001;;
+$MEN388:
+ PUSH ES ;;AN000;; Get output buffer segment
+ POP DS ;;AN000;;
+ MOV DX,DI ;;AN000;; Get output buffer offset in case needed
+ INT 21H ;;AN000;; Get keyboard input
+ POP DS ;;AN000;;
+
+ CMP DL,DOS_BUF_KEYB_INP ;;AN000;;
+ CLC ;;AN000;;
+; $IF NE ;;AN000;; If character input
+ JE $MIF391
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS?
+; $IF C ;;AN000;;
+ JNC $MIF392
+ MOV CL,AL ;;AN000;; Save first character
+ MOV AH,DL ;;AN001;; Get back function
+ INT 21H ;;AN000;; Get keyboard input
+ MOV AH,CL ;;AN000;; Retreive first character AX = xxxx
+ CLC ;;AN000;; Clear carry condition
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN392
+$MIF392:
+ MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS
+; $ENDIF ;;AN000;;
+$MEN392:
+; $ENDIF ;;AN000;;
+$MIF391:
+ ;;
+; $IF NC ;;AN000;;
+ JC $MIF396
+ POP DX ;;AN000;;
+ POP CX ;;AN000;;
+; $ELSE ;;AN000;;
+ JMP SHORT $MEN396
+$MIF396:
+ ADD SP,4 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+; $ENDIF ;;AN000;;
+$MEN396:
+ RET ;;AN000;; Return
+ ;;
+$M_WAIT_FOR_INPUT ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of Wait for Input
+ ENDIF ;;AN000;; END of include of SYSDISPMSG
+ ENDIF ;;AN000;; END of include of MSG_DATA_ONLY
+ENDIF ;;AN000;; END of include of Structure only
+
diff --git a/private/mvdm/dos/v86/inc/msgserv.sa b/private/mvdm/dos/v86/inc/msgserv.sa
new file mode 100644
index 000000000..08560cc6a
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/msgserv.sa
@@ -0,0 +1,2629 @@
+; * * * * * * * * * * * * START OF SPECIFICATIONS * * * * * * * * * * * * * * *
+;
+; MODULE NAME: MSGSERV.SAL
+;
+; DESCRIPTIVE NAME: Message Services SALUT file
+;
+; FUNCTION: This module incorporates all the messages services and
+; is called upon at build time to INCLUDE the code requested
+; by a utility. Code is requested using the macro MSG_SERVICES.
+;
+; ENTRY POINT: Since this a collection of subroutines, entry point is at
+; requested procedure.
+;
+; INPUT: Since this a collection of subroutines, input is dependent on function
+; requested.
+;
+; EXIT-NORMAL: In all cases, CARRY FLAG = 0
+;
+; EXIT-ERROR: In all cases, CARRY FLAG = 1
+;
+; INTERNAL REFERENCES: (list of included subroutines)
+;
+; - SYSLOADMSG
+; - SYSDISPMSG
+; - SYSGETMSG
+;
+;
+; EXTERNAL REFERENCES: None
+;
+; NOTES: At build time, some modules must be included. These are only included
+; once using assembler switches. Other logic is included at the request
+; of the utility.
+;
+; COMR and COMT are assembler switches to conditionally assemble code
+; for RESIDENT COMMAND.COM and TRANSIENT COMMAND.COM to reduce resident
+; storage and multiple EQUates.
+;
+; REVISION HISTORY: Created MAY 1987
+;
+; Label: DOS - - Message Retriever
+; (c) Copyright 1988 Microsoft
+;
+;
+; * * * * * * * * * * * * END OF SPECIFICATIONS * * * * * * * * * * * * * * * *
+; Page
+
+ $SALUT $M (2,5,22,62) ;;AN000;; Set SALUT formatting
+
+IF $M_STRUC ;;AN000;; IF we haven't included the structures yet THEN
+ $M_STRUC = FALSE ;;AN000;; Let the assembler know that we have
+ ;;AN000;; and include them
+
+ PAGE
+ SUBTTL DOS - Message Retriever - MSGSTR.INC Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_SUBLIST_STRUC
+;;
+;; Replacable parameters are described by a sublist structure
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_SUBLIST_STRUC STRUC ;;AN000;;
+ ;;
+ $M_S_SIZE DB 11 ;;AN000;; SUBLIST size (PTR to next SUBLIST)
+ $M_S_RESV DB 0 ;;AN000;; RESERVED
+ $M_S_VALUE DD ? ;;AN000;; Time, Date or PTR to data item
+ $M_S_ID DB ? ;;AN000;; n of %n
+ $M_S_FLAG DB ? ;;AN000;; Data-type flags
+ $M_S_MAXW DB ? ;;AN000;; Maximum field width
+ $M_S_MINW DB ? ;;AN000;; Minimum field width
+ $M_S_PAD DB ? ;;AN000;; Character for Pad field
+ ;;
+$M_SUBLIST_STRUC ENDS ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_CLASS_ID
+;;
+;; Each class will be defined by this structure.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CLASS_ID STRUC ;;AN000;;
+ ;;
+ $M_CLS_ID DB -1 ;;AN000;; Class identifer
+ $M_COMMAND_VER DW EXPECTED_VERSION ;;AN003;; COMMAND.COM version check
+ $M_NUM_CLS_MSG DB 0 ;;AN000;; Total number of message in class
+ ;;
+$M_CLASS_ID ENDS ;;
+ ;;AN000;;
+ $M_CLASS_ID_SZ EQU SIZE $M_CLASS_ID ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_ID_STRUC
+;;
+;; Each message will be defined by this structure.
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_ID STRUC ;;AN000;;
+ ;;
+ $M_NUM DW -1 ;;AN000;; Message Number
+ $M_TXT_PTR DW ? ;;AN000;; Pointer to message text
+ ;;
+$M_ID ENDS ;;AN000;;
+ ;;AN000;; Status Flag Values:
+ $M_ID_SZ EQU SIZE $M_ID ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_RES_ADDRS
+;;
+;; Resident data area definition of variables
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_RES_ADDRS STRUC ;;AN000;;
+ ;;
+ $M_EXT_ERR_ADDRS DD 0 ;;AN000;; Allow pointers to THREE Extended error locations
+ $M_EXT_FILE DD 0 ;;AN001;;
+ $M_EXT_COMMAND DD 0 ;;AN000;;
+ $M_EXT_TERM DD -1 ;;AN000;;
+ $M_PARSE_COMMAND DD 0 ;;AN000;;
+ $M_PARSE_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Parse error locations
+ $M_PARSE_TERM DD -1 ;;AN000;;
+ $M_CRIT_ADDRS DD 0 ;;AN000;; Allow pointers to TWO Critical error locations
+ $M_CRIT_COMMAND DD 0 ;;AN000;;
+ $M_CRIT_TERM DD -1 ;;AN000;;
+ $M_DISK_PROC_ADDR DD -1 ;;AN004;; Address of READ_DISK_PROC
+ $M_CLASS_ADDRS DD $M_NUM_CLS DUP(0) ;;AN000;; Allow pointers to specified classes
+ $M_CLS_TERM DD -1 ;;AN000;;
+ $M_DBCS_VEC DD 0 ;;AN000;; Save DBCS vector
+ $M_HANDLE DW ? ;;AN000;;
+ $M_SIZE DB 0 ;;AN000;;
+ $M_CRLF DB 0DH,0AH ;;AN004;; CR LF message
+ $M_CLASS DB ? ;;AN004;; Saved class
+ $M_RETURN_ADDR DW ? ;;AN000;;
+ $M_MSG_NUM DW $M_NULL ;;AN000;;
+ $M_DIVISOR DW 10 ;;AN000;; Default = 10 (must be a WORD for division)
+ $M_TEMP_BUF DB $M_TEMP_BUF_SZ DUP("$") ;;AN000;; Temporary buffer
+ $M_BUF_TERM DB "$" ;;AN000;;
+
+$M_RES_ADDRS ENDS ;;AN000;;
+ ;;
+$M_RES_ADDRS_SZ EQU SIZE $M_RES_ADDRS ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; STRUCTURE: $M_COUNTRY_INFO
+;;
+;; Important fields of the Get Country Information call
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_COUNTRY_INFO STRUC ;;AN000;; Expected Country infomation
+ ;;
+ $M_HEADER DB $M_RES_ADDRS_SZ-$M_TEMP_BUF_SZ-1 DUP(?) ;;AN000;; Go past first part of struc
+ $M_DATE_FORMAT DW ? ;;AN000;; <------- Date Format
+ $M_CURR_SEPARA DB 5 DUP(?) ;;AN000;;
+ $M_THOU_SEPARA DB ?,0 ;;AN000;; <------- Thou Separator
+ $M_DECI_SEPARA DB ?,0 ;;AN000;; <------- Decimal Separator
+ $M_DATE_SEPARA DB ?,0 ;;AN000;; <------- Date Separator
+ $M_TIME_SEPARA DB ?,0 ;;AN000;; <------- Time Separator
+ $M_CURR_FORMAT DB ? ;;AN000;;
+ $M_SIG_DIGS_CU DB ? ;;AN000;;
+ $M_TIME_FORMAT DB ? ;;AN000;; <------- Time Format
+ ;;
+$M_COUNTRY_INFO ENDS ;;AN000;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ELSE ;;AN000;; ELSE if we have already included the STRUCTURES
+;
+ $SALUT $M (2,5,13,62) ;;AN000;; Set SALUT formatting for code section
+
+ IF MSGDATA ;;AN000;; IF this is a request to include the data area
+ MSGDATA = FALSE ;;AN000;; Let the assembler know not to include it again
+ ;;AN000;; and include it
+ PAGE
+ SUBTTL DOS - Message Retriever - MSGRES.TAB Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; DATA NAME: $M_RES_TABLE
+;;
+;; REFERENCE LABEL: $M_RT
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF COMR ;;AN000;; Since COMMAND.COM includes this twice
+ $M_RT EQU $M_RT2 ;;AN000;; we must redefine the label so no
+ $M_RT2 LABEL BYTE ;;AN000;; assembly errors occur
+ $M_ALTLABEL = TRUE ;;AN000;; Flag that label was changed
+ELSE ;;AN000;;
+ $M_RT LABEL BYTE ;;AN000;;
+ENDIF ;;AN000;;
+ $M_RES_ADDRS <> ;;AN000;; Resident addresses
+ ;;
+ include COPYRIGH.INC ;;AN001;; Include Copyright 1988 Microsoft
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of Data table
+
+;
+ IF NOT $M_MSGDATA_ONLY ;;AN000;; IF this was a request for only the data table THEN
+ ;; don't include any more code
+ ;;AN000;; Figure out what other code to include
+ IF DISK_PROC ;;AN003;; Is the request to include the READ_DISK code
+ IF COMR ;;AN003;; (Only Resident COMMAND.COM should ask for it)
+ $M_RT EQU $M_RT2 ;;AN003;;
+ ENDIF
+ DISK_PROC = FALSE ;;AN003;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - DISK_PROC Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: DISK_PROC
+;;
+;; FUNCTION: Used in COMMAND.COM if we need to access the Parse or Extended
+;; errors from disk\diskette
+;; INPUTS: AX has the message number
+;; DX has the message class
+;; AND ... the COMMAND.COM Variable RESGROUP:COMSPEC is
+;; assumed to be set!!
+;;
+;; OUTPUTS: ES:DI points to message length (BYTE) followed by text
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+ PUBLIC READ_DISK_PROC ;;
+ ;;
+READ_DISK_PROC PROC FAR ;;AN003;;
+
+ PUSH AX ;;AN003;; Save everything
+ PUSH BX ;;AN003;;
+ PUSH DX ;;AN003;;
+ PUSH SI ;;AN003;;
+ PUSH BP ;;AN003;;
+ PUSH DS ;;AN003;;
+ PUSH DI ;;AN003;;
+ MOV BP,AX ;;AN003;; Save message number
+ MOV AX,DOS_EXTENDED_OPEN ;;AN003;; Set INT 21 function
+ LEA SI,RESGROUP:COMSPEC ;;AN003;; Get addressibilty to COMMAND.COM
+ PUSH CS ;;AN003;;
+ POP DS ;;AN003;;
+ MOV DI,-1 ;;AN003;; No extended attribute list
+ MOV BX,NO_CRIT_OPEN ;;AN003;; Don't generate critical error
+ MOV DX,NOT_EX_FAIL_EX_OPEN ;;AN003;; Open Flag
+ INT 21H ;;AN003;; Open the file
+ POP DI ;;AN003;; Retreive LSEEK pointer
+ ;;AN003;; Error ?
+ $IF NC,LONG ;;AN003;; No,
+ PUSH DI ;;AN003;; Save LSEEK pointer
+ MOV BX,AX ;;AN003;; Set handle in BX
+ MOV AX,DOS_LSEEK_FILE ;;AN003;; LSEEK to the errors
+ XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
+ MOV DX,DI ;;AN003;;
+ INT 21H ;;AN003;; LSEEK the file
+ POP DX ;;AN003;; Retreive LSEEK pointer
+ ;;AN003;; Error ?
+ $IF NC ;;AN003;; No,
+ INC CX ;;AN003;; Set flag to first pass
+ $DO ;;AN003;;
+ PUSH DX ;;AN003;; Save LSEEK pointer
+ PUSH CX ;;AN003;; Save first pass flag
+ PUSH AX ;;AN003;; Save number of messages (if set yet)
+ XOR SI,SI ;;AN003;; Reset buffer index
+ MOV AH,DOS_READ_BYTE ;;AN003;; Read
+ MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the first part of the header
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
+ INT 21H ;;AN003;; Read it
+ MOV DI,DX ;;AN003;;
+ POP AX ;;AN003;;
+ POP CX ;;AN003;;
+ OR CX,CX ;;AN003;;
+ $IF NZ ;;AN003;;
+ XOR CX,CX ;;AN003;; Set flag to second pass
+ XOR AH,AH ;;AN003;; Get number of messages in class
+ MOV AL,DS:[DI].$M_NUM_CLS_MSG ;;AN003;;
+ MOV SI,$M_CLASS_ID_SZ ;;AN003;; Initialize index
+ CMP DS:[DI].$M_COMMAND_VER,EXPECTED_VERSION ;;AN003;; Is this the right version of COMMAND.COM?
+ $ENDIF ;;AN003;;
+ POP DX ;;AN003;;
+ $IF Z ;;AN003;; Yes,
+ $SEARCH ;;AN003;;
+ CMP BP,WORD PTR $M_RT.$M_TEMP_BUF[SI] ;;AN003;; Is this the message I'm looking for?
+ $EXITIF Z ;;AN003;; Yes, (ZF=1)
+ CLC ;;AN003;; Reset carry, exit search
+ $ORELSE ;;AN003;; No, (ZF=0)
+ ADD SI,$M_ID_SZ ;;AN003;; Increment index
+ ADD DX,$M_ID_SZ ;;AN003;; Add offset of first header
+ DEC AX ;;AN003;; Decrement # of messages left
+ $LEAVE Z ;;AN003;; Have we exhausted all messages?
+ CMP SI,$M_TEMP_BUF_SZ-1 ;;AN003;; No, Have we exhausted the buffer?
+ $ENDLOOP A ;;AN003;; No, Check next message (ZF=1)
+ STC ;;AN003;; Yes, (ZF=0) set error (ZF=0)
+ $ENDSRCH ;;AN003;;
+ $ELSE ;;AN003;; No,
+ XOR CX,CX ;;AN003;; Set Zero flag to exit READ Loop
+ STC ;;AN003;; Set Carry
+ $ENDIF ;;AN003;;
+ $ENDDO Z ;;AN003;; Get next buffer full if needed
+ ;;AN003;; Error ?
+ $IF NC ;;AN003;; No,
+ MOV AX,DOS_LSEEK_FILE ;;AN003;; Prepare to LSEEK to the specific message
+ XOR CX,CX ;;AN003;; Value has been set by COMMAND.COM
+ ADD DX,$M_CLASS_ID_SZ ;;AN003;; Add offset of first header
+ ADD DX,WORD PTR $M_RT.$M_TEMP_BUF[SI]+2 ;;AN003;; Add offset from msg structure
+ INT 21H ;;AN003;; LSEEK the file
+ MOV AH,DOS_READ_BYTE ;;AN003;; Read
+ MOV CX,$M_TEMP_BUF_SZ ;;AN003;; the message
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN003;; into the temp buffer
+ INT 21H ;;AN003;; Read it
+ MOV DI,DX ;;AN003;; into the temp buffer
+ PUSH DS ;;AN003;; into the temp buffer
+ POP ES ;;AN003;; into the temp buffer
+ $ENDIF ;;AN003;;
+ $ENDIF ;;AN003;;
+ PUSHF ;;AN003;; Close file handle
+ MOV AH,DOS_CLOSE_FILE ;;AN003;; Close file handle
+ INT 21H ;;AN003;;
+ $M_POPF ;;AN003;;
+ $ENDIF ;;AN003;; Yes there was an error,
+ POP DS ;;AN003;;
+ POP BP ;;AN003;;
+ POP SI ;;AN003;;
+ POP DX ;;AN003;;
+ POP BX ;;AN003;;
+ POP AX ;;AN003;;
+ ;;AN003;; abort everything
+ RET ;;AN003;;
+
+READ_DISK_PROC ENDP ;;AN003;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN003;; END of include for DISK_PROC
+;
+
+ IF SETSTDIO ;;AN000;; Is the request to include the code for SETSTDIO
+ SETSTDIO = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - SETSTDIO Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: SETSTDIO
+;;
+;; FUNCTION:
+;; INPUTS:
+;;
+;; OUPUTS:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;AN001;
+ SETSTDINON PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDINON PROC NEAR ;AN001;
+ENDIF ;AN001;
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+ ;AN001;
+ SETSTDINON ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDINOFF PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDINOFF PROC NEAR ;AN001;
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDINOFF ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDOUTON PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDOUTON PROC NEAR ;AN001;
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDOUTON ENDP ;AN001;
+
+IF FARmsg ;AN001;
+ SETSTDOUTOFF PROC FAR ;AN001;
+ELSE ;AN001;
+ SETSTDOUTOFF PROC NEAR
+ENDIF ;AN001;
+
+ PUSH AX ;AN002; Save changed regs
+ PUSH BX ;AN002;
+ PUSH DX ;AN002;
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ AND DH,NOT $M_CRIT_ERR_MASK ;AN001; Turn off bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+ POP DX ;AN002; Restore Regs
+ POP BX ;AN002;
+ POP AX ;AN002;
+
+ RET ;AN001;
+
+ SETSTDOUTOFF ENDP ;AN001;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include for SETSTDIO
+;
+ IF LOADmsg ;;AN000;; Is the request to include the code for SYSLOADMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF
+ LOADmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - LOADMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: SYSLOADMSG
+;;
+;; FUNCTION:
+;; INPUTS:
+;;
+;; OUPUTS:
+;;
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSLOADMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSLOADMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ PUSH AX ;;AN000;
+ PUSH BX ;;AN000;
+ PUSH DX ;;AN000;
+ PUSH ES ;;AN000;
+ PUSH DI ;;AN000;
+ XOR CX,CX ;;AN000; Reset to zero
+ MOV ES,CX ;;AN000;
+ XOR DI,DI ;;AN000;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_EXTENDED ;;AN000;; Where are the Extended errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_EXT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_COMMAND,DI ;;AN000;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_PARSE ;;AN000;; Where are the Parse errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_PARSE_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_PARSE_COMMAND,DI ;;AN000;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN000;; 2FH Interface
+ MOV DL,DOS_GET_CRITICAL ;;AN000;; Where are the Critical errors in COMMAND.COM
+ INT 2FH ;;AN000;; Private interface
+ MOV WORD PTR $M_RT.$M_CRIT_COMMAND+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_CRIT_COMMAND,DI ;;AN000;;
+
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
+ MOV DL,DOS_GET_FILE ;;AN001;; Where are the FILE dependant in IFSFUNC.EXE
+ INT 2FH ;;AN001;; Private interface
+ MOV WORD PTR $M_RT.$M_EXT_FILE+2,ES ;;AN001;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_FILE,DI ;;AN001;;
+
+IF COMR ;; ** Special case for RESIDENT COMMAND.COM
+ IF2
+ IFNDEF READ_DISK_INFO ;;AN003;;
+ Extrn READ_DISK_PROC:Far ;;AN003;;
+ ENDIF ;;AN003;;
+ ENDIF ;;AN003;;
+ELSE ;;
+ IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
+ ELSE ;;AN000;;
+ CALL $M_MSGSERV_1 ;;AN000;; Get addressibilty to MSGSERV CLASS 1 (EXTENDED Errors)
+ ENDIF ;;AN000;;
+ MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_EXT_ERR_ADDRS,DI ;;AN000;;
+ MOV WORD PTR $M_RT.$M_CRIT_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_CRIT_ADDRS,DI ;;AN000;;
+ ;;
+ IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
+ ELSE ;;AN000;;
+ CALL $M_MSGSERV_2 ;;AN000;; Get addressibilty to MSGSERV CLASS 2 (PARSE Errors)
+ ENDIF ;;AN000;;
+ MOV WORD PTR $M_RT.$M_PARSE_ADDRS+2,ES ;;AN000;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_PARSE_ADDRS,DI ;;AN000;;
+ENDIF ;;
+ ;;
+ MOV AX,DOS_GET_EXT_PARSE_ADD ;;AN001;; 2FH Interface
+ MOV DL,DOS_GET_ADDR ;;AN001;; Where is the READ_DISK_PROC in COMMAND.COM
+ INT 2FH ;;AN001;; Private interface
+ MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR+2,ES ;;AN001;; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_DISK_PROC_ADDR,DI ;;AN001;;
+
+ $M_BUILD_PTRS %$M_NUM_CLS ;;AN000;; Build all utility classes
+ ;;AN000;;
+ CALL $M_GET_DBCS_VEC ;;AN000;; Save the DBCS vector
+
+IF NOT NOCHECKSTDIN ;;AN000;; IF EOF check is not to be suppressed
+ CALL $M_CHECKSTDIN ;;AN000;; Set EOF CHECK
+ENDIF ;;AN000;;
+ ;;AN000;;
+IF NOT NOCHECKSTDOUT ;;AN000;; IF Disk Full check is not to be suppressed
+ CALL $M_CHECKSTDOUT ;;AN000;; Set Disk Full CHECK
+ENDIF ;;AN000;;
+ ;;AN000;;
+IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
+ CLC ;;AN000;; Make sure carry is clear
+ELSE ;;AN000;; ELSE
+ PUSH CX ;;AN000;;
+ CALL $M_VERSION_CHECK ;;AN000;; Check Version
+ENDIF ;;AN000;;
+ ;; Error ?
+ $IF NC ;;AN000;; No.
+IF NOT NOVERCHECKmsg ;;AN000;; IF version check was not supressed
+ POP CX ;;AN000;; Reset stack
+ENDIF ;;AN000;;
+ POP DI ;;AN000;; Restore REGS
+ POP ES ;;AN000;;
+ POP DX ;;AN000;;
+ POP BX ;;AN000;;
+ POP AX ;;AN000;;
+ $ELSE ;;AN000;; Yes,
+IF NOVERCHECKmsg ;;AN000;; IF version check is to be supressed
+ ADD SP,10 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ELSE ;;AN000;; IF version check is to be supressed
+ ADD SP,12 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ENDIF ;;AN000;; IF version check is to be supressed
+ $ENDIF ;;AN000;;
+ RET ;;AN000;;
+ ;;
+ SYSLOADMSG ENDP ;;AN000;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_GET_DBCS_VEC
+;;
+;; Function: Get the DBCS vector and save it for later use
+;;
+;; Inputs: None
+;;
+;; Outputs: None
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_GET_DBCS_VEC PROC NEAR ;;AN000;;
+ ;;
+ PUSH AX ;;AN000;; Save character to check
+ PUSH SI ;;AN000;;
+ PUSH DS ;;AN000;;
+ MOV AX,DOS_GET_DBCS_INFO ;;AN000;; DOS function to get DBSC environment
+ INT 21H ;;AN000;; Get environment pointer
+ PUSH DS ;;AN000;; Get environment pointer
+ POP ES ;;AN000;; Get environment pointer
+ POP DS ;;AN000;; Get environment pointer
+ $IF NC ;;AN000;;
+ MOV WORD PTR $M_RT.$M_DBCS_VEC,SI ;;AN000;; Save DBCS Vector
+ MOV WORD PTR $M_RT.$M_DBCS_VEC+2,ES ;;AN000;;
+ $ENDIF ;;AN000;;
+ POP SI ;;AN000;;
+ POP AX ;;AN000;; Retrieve character to check
+ RET ;;AN000;; Return
+ ;;
+$M_GET_DBCS_VEC ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IF NOCHECKSTDIN ;AN001; Are we suppose to include the code for Checking EOF ?
+ ELSE ;AN001; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_CHECKSTDIN Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_CHECKSTDIN
+;;
+;; Function:
+;;
+;; Inputs: None
+;;
+;; Outputs:
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHECKSTDIN PROC NEAR ;AN001;
+
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDIN ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+
+ RET ;AN001;
+
+$M_CHECKSTDIN ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;AN001; END of include for EOF Check
+ IF NOCHECKSTDOUT ;AN001; Are we suppose to include the code for Checking Disk Full?
+ ELSE ;AN001; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_CHECKSTDOUT Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_CHECKSTDOUT
+;;
+;; Function:
+;;
+;; Inputs: None
+;;
+;; Outputs:
+;;
+;; Regs Changed:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHECKSTDOUT PROC NEAR ;AN001;
+
+ MOV AX,DOS_IOCTL_GET_INFO ;AN001; Get info using IOCTL
+ MOV BX,STDOUT ;AN001;
+ XOR DX,DX ;AN001;
+ INT 21H ;AN001;
+
+ OR DH,$M_CRIT_ERR_MASK ;AN001; Turn on bit
+ MOV AX,DOS_IOCTL_SET_INFO ;AN001; Set info using IOCTL
+ INT 21H ;AN001;
+
+ RET ;AN001;
+
+$M_CHECKSTDOUT ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;AN001; END of include for Disk Full Check
+ IF NOVERCHECKmsg ;;AN000;; Are we suppose to include the code for DOS version check?
+ ELSE ;;AN000;; Yes, THEN include it
+ PAGE
+ SUBTTL DOS - Message Retriever - $M_VERSION_CHECK Proc
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: $M_VERSION_CHECK
+;;
+;; Function: Determine if DOS version is within allowable limits
+;;
+;; Inputs: None
+;;
+;; Outputs: CARRY_FLAG = 1 if Incorrect DOS version
+;; Registers set for SYSDISPMSG
+;; CARRY_FLAG = 0 if Correct DOS version
+;;
+;; Regs Changed: AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_VERSION_CHECK PROC NEAR ;;AN000;;
+ ;;
+ MOV AH,DOS_GET_VERSION ;;AN000;; Check that version matches VERSIONA.INC
+ INT 21H ;;AN000;;
+ ;;
+ CMP AX,EXPECTED_VERSION ;;AN000;; IF DOS_MAJOR is correct
+ $IF E ;;AN000;;
+ CLC ;;AN000;; Clear the carry flag
+ $ELSE ;;AN000;; ELSE
+IF NOT COMR ;; ** Special case for RESIDENT COMMAND.COM
+ CMP AX,LOWEST_4CH_VERSION ;;AN000;; Does this version support AH = 4CH
+ $IF B ;;AN000;; No,
+ MOV BX,NO_HANDLE ;;AN000;; No handle (version doesn't support)
+ $ELSE ;;AN000;; Yes,
+ MOV BX,STDERR ;;AN000;; Standard Error
+ $ENDIF ;;AN000;;
+ELSE
+ MOV BX,NO_HANDLE ;;AN000;; No handle
+ENDIF
+ MOV AX,1 ;;AN000;; Set message # 1
+ MOV CX,NO_REPLACE ;;AN000;; No replacable parms
+ MOV DL,NO_INPUT ;;AN000;; No input
+ MOV DH,UTILITY_MSG_CLASS ;;AN000;; Utility class message
+ STC ;;AN000;; Set Carry Flag
+ $ENDIF ;;AN000;;
+ ;;
+ RET ;;AN000;; Return
+ ;;
+$M_VERSION_CHECK ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include for DOS version check
+ ENDIF ;;AN000;; END of include for SYSLOADMSG
+;
+ IF GETmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF ;;AN000;;
+ GETmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - GETMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: SYSGETMSG
+;;
+;; Function: The GET service returns the segment, offset and size of the
+;; message text to the caller based on a message number.
+;; The GET function will not display the message thus assumes
+;; caller will handle replaceable parameters.
+;;
+;; Inputs:
+;;
+;; Outputs:
+;;
+;; Psuedocode:
+;; Call $M_GET_MSG_ADDRESS
+;; IF MSG_NUM exists THEN
+;; Set DS:SI = MSG_TXT_PTR + 1
+;; CARRY_FLAG = 0
+;; ELSE
+;; CARRY_FLAG = 1
+;; ENDIF
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSGETMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSGETMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+;; Save registers needed later
+
+ PUSH AX ;;AN000;; Save changed regs
+ PUSH ES ;;AN000;;
+ PUSH DI ;;AN000;;
+ PUSH BP ;;AN000;;
+ ;;
+IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ELSE ;;AN000;;
+ CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ENDIF ;;AN000;; Return message in ES:DI
+ $IF NC ;;AN000;; Message found?
+ CMP DH,UTILITY_MSG_CLASS
+ CLC ;;AN000;;
+ $IF NE
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Return message in DS:SI
+ $ELSE
+IF FARmsg ;;AN000;; Yes,
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Return message in DS:SI
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;; Return message in DS:SI
+ POP DS ;;AN000;;
+ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ MOV SI,DI ;;AN000;; Return message in DS:SI
+ $ENDIF ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Restore changed regs
+ POP DI ;;AN000;;
+ POP ES ;;AN000;;
+ POP AX ;;AN000;;
+ ;;
+ RET ;;AN000;; Return
+ ;;
+ SYSGETMSG ENDP ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
+ $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_MSG_ADDRESS
+;;
+;; FUNCTION: To scan thru classes to return pointer to the message header
+;; INPUTS: Access to $M_RES_ADDRESSES
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to the specified message
+;; REGS CHANGED: ES,DI,CX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+ PUSH SI ;;AN000;;
+ PUSH BX ;;AN000;;
+ XOR SI,SI ;;AN000;; Use SI as an index
+ XOR CX,CX ;;AN000;; Use CX as an size
+ $DO ;;AN000;;
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
+ $IF E ;;AN000;; Yes,
+ IF FARmsg ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ ELSE ;;AN000;;
+ MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,DI ;;AN000;
+ ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
+ $IF NE ;;AN000;; Yes,
+ LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ELSE ;;AN000;; No, extended errors were specified
+ CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
+ $IF AE,AND ;;AN000;;
+ CMP AX,$M_CRIT_HI ;;AN000;;
+ $IF BE ;;AN000;; Yes,
+ LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ELSE ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
+ $IF E ;;AN000;; Yes,
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
+ $IF E ;;AN000;; Yes,
+ STC ;;AN000;; Set the carry flag
+ $ELSE ;;AN000;; No,
+ MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
+ MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
+ MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
+ XOR SI,SI ;;AN000;; Reset the SI index to start again
+ CLC ;;AN000;;
+ $ENDIF ;;AN000;; No,
+ $ELSE ;;AN000;;
+ CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
+ $IF NE ;;AN001;; Yes,
+ CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
+ $ENDIF ;;AN000;;
+ ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
+ CLC ;;AN000;;
+ $ENDIF ;;AN000;;
+ $LEAVE C ;;AN000;;
+ OR CX,CX ;;AN000;; Was the message found?
+ $ENDDO NZ,LONG ;;AN000;;
+
+ PUSHF ;;AN006;; Save the flag state
+ CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
+ $IF E ;;AN006;; Yes,
+ PUSH DX ;;AN006;; Save all needed registers
+ PUSH BP ;;AN006;;
+ PUSH CX ;;AN006;;
+ PUSH ES ;;AN006;;
+ PUSH DI ;;AN006;;
+ PUSH AX ;;AN006;;
+
+ MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
+ INT 2FH ;;AN006;;
+ CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
+ POP AX ;;AN006;; Restore msg number
+ $IF E ;;AN006;; Yes,
+ MOV BX,AX ;;AN006;; BX is the extended error number
+ MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
+ INT 2FH ;;AN006;; Call IFSFUNC
+ $ELSE ;;AN006;; No,
+ STC ;;AN006;; Carry conditon
+ $ENDIF ;;AN006;;
+
+ $IF C ;;AN006;; Was there an update?
+ POP DI ;;AN006;; No,
+ POP ES ;;AN006;; Restore old pointer
+ POP CX ;;AN006;;
+ $ELSE ;;AN006;; Yes
+ ADD SP,6 ;;AN006;; Throw away old pointer
+ CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
+ $ENDIF ;;AN006;;
+ POP BP ;;AN006;; Restore other Regs
+ POP DX ;;AN006;;
+ $ENDIF ;;AN006;;
+ $M_POPF ;;AN006;; Restore the flag state
+
+ POP BX ;;AN000;;
+ POP SI ;;AN000;;
+ RET ;;AN000;; Return ES:DI pointing to the message
+ ;;
+$M_GET_MSG_ADDRESS ENDP ;;
+ ;;
+$M_SET_LEN_IN_CX PROC NEAR ;;
+ ;;
+ PUSH DI ;;AN006;; Save position
+ PUSH AX ;;AN006;;
+ MOV CX,-1 ;;AN006;; Set CX for decrements
+ XOR AL,AL ;;AN006;; Prepare compare register
+ REPNE SCASB ;;AN006;; Scan for zero
+ NOT CX ;;AN006;; Change decrement into number
+ DEC CX ;;AN006;; Don't include the zero
+ POP AX ;;AN006;;
+ POP DI ;;AN006;; Restore position
+ RET ;;AN006;;
+ ;;
+$M_SET_LEN_IN_CX ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FIND_SPECIFIED_MSG
+;;
+;; FUNCTION: To scan thru message headers until message is found
+;; INPUTS: ES:DI points to beginning of msg headers
+;; CX contains the number of messages in class
+;; DH contains the message class
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to header of specified message
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
+ ;;
+ CMP BX,1 ;;AN004;; Do we have an address to CALL?
+ $IF E,AND ;;AN004;; Yes,
+ CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
+ $IF NE ;;AN004;; Yes,
+ CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
+ $IF E ;;AN004;; . . . and . . .
+ PUSH AX ;;AN004;; Reset the special message number
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ POP AX ;;AN004;; Reset the special message number
+ $ELSE ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ $ENDIF ;;AN004;; Get the old message number
+ $ELSE ;;AN004;;
+ XOR CX,CX ;;AN002;; CX = 0 will allow us to
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+ $IF NE ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
+ $ELSE ;;AN001;;
+IF FARmsg ;;AN001;;
+ CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ELSE
+ CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ENDIF
+ $IF E ;;AN002;; pointer (hopefully)
+IF FARmsg ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ELSE
+ MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ENDIF
+ $ENDIF ;;AN002;; go on to the next class
+ $ENDIF ;;AN001;;
+ ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
+ STC ;;AN004;; Flag that we haven't found anything yet
+ $ENDIF ;;AN004;;
+
+ $IF C ;;AN004;; Have we found anything yet?
+ CLC ;;AN004;; No, reset carry
+ $SEARCH ;;AN000;;
+ OR CX,CX ;;AN000;; Do we have any to check?
+ $LEAVE Z ;;AN000;; No, return with CX = 0
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+ $IF NE ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
+ $ELSE ;;AN001;;
+IF FARmsg ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ELSE
+ CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ENDIF
+ $ENDIF
+ $EXITIF E ;;AN000;;
+ $ORELSE ;;AN000;
+ DEC CX ;;AN000;; No, well do we have more to check?
+ $LEAVE Z ;;AN000;; No, return with CX = 0
+ ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
+ $ENDLOOP ;;AN000;;
+ STC ;;AN000;;
+ $ENDSRCH ;;AN000;; Check next message
+ $IF NC ;;AN000;; Did we find the message?
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
+ CLC ;;AN001;;
+ $IF E ;;AN001;;
+IF FARmsg ;;AN001;;
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;;
+ POP ES ;;AN000;; Return ES:DI pointing to the message
+ENDIF
+ $ENDIF ;;AN001;;
+ ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
+ $ENDIF ;;AN004;;
+ $ENDIF ;;AN004;;
+ ;; Yes, great we can return with CX > 0
+
+ $IF NC ;;AN000;; Did we find the message?
+ XOR CH,CH ;;AN000;;
+ MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
+ INC DI ;;AN000;; Increment past length
+ $ENDIF ;;AN004;;
+
+ MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
+ RET ;;AN000;; Return
+ ;;
+$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of common subroutines
+ ENDIF ;;AN000;; END of include of SYSGETMSG
+;
+ IF DISPLAYmsg ;;AN000;; Is the request to include the code for SYSGETMSG ?
+ IF COMR ;;AN000;;
+ $M_RT EQU $M_RT2 ;;AN000;;
+ ENDIF ;;AN000;;
+ DISPLAYmsg = FALSE ;;AN000;; Yes, THEN include it and reset flag
+ PAGE
+ SUBTTL DOS - Message Retriever - DISPMSG.ASM Module
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Proc Name: SYSDISPMSG
+;;
+;; Function: The DISPLAY service will output a defined message to a handle
+;; requested by the caller. It also provides function to display
+;; messages when handles are not applicable (ie. DOS function calls
+;; 00h to 0Ah) Replaceable parameters are allowed and are
+;; defined previous to entry.
+;;
+;; It is assumes that a PRELOAD function has already determined
+;; the addressibilty internally to the message retriever services.
+;; Inputs:
+;;
+;; Outputs:
+;;
+;; Psuedocode:
+;; Save registers needed later
+;; Get address of the message requested
+;; IF Message number exists THEN
+;; IF replacable parameters were specified THEN
+;; Display message with replacable parms
+;; ELSE
+;; Display string without replacable parms
+;; ENDIF
+;; IF character input was requested THEN
+;; Wait for character input
+;; ENDIF
+;; Clear CARRY FLAG
+;; ELSE
+;; Set CARRY FLAG
+;; ENDIF
+;; Return
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ SYSDISPMSG PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ SYSDISPMSG PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+;; Save registers and values needed later
+
+ PUSH AX ;;AN000;; Save changed REGs
+ PUSH BX ;;AN000;;
+ PUSH CX ;;AN000;;
+ PUSH BP ;;AN000;;
+ PUSH DI ;;AN000;; Save pointer to input buffer (offset)
+ PUSH ES ;;AN000;; Save pointer to input buffer (segment)
+ PUSH DX ;;AN000;; Save Input/Class request
+
+ MOV BP,CX ;;AN000;; Use BP to hold replace count
+ MOV WORD PTR $M_RT.$M_HANDLE,BX ;;AN000;; Save handle
+ MOV BYTE PTR $M_RT.$M_CLASS,DH ;;AN004;; Save class
+
+;; Get address of the message requested
+
+IF FARmsg ;;AN000;;
+ CALL FAR PTR $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ELSE ;;AN000;;
+ CALL $M_GET_MSG_ADDRESS ;;AN000;; Scan thru classes to find message
+ENDIF ;;AN000;;
+ OR CX,CX ;;AN000;; Was message found?
+ $IF NZ ;;AN000;; YES, Message address in ES:DI
+
+;; Test if replacable parameters were specified
+
+ OR BP,BP ;;AN000;; Were replacable parameters requested
+ $IF Z ;;AN000;;
+
+;; Display string without replacable parms
+
+ CALL $M_DISPLAY_STRING ;;AN000;; No, great . . . Display message
+ $ELSE ;;AN000;;
+IF $M_REPLACE ;;AN000;;
+
+;; Display message with replacable parms
+
+ CALL $M_DISPLAY_MESSAGE ;;AN000;; Display the message with substitutions
+ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $IF NC
+
+ POP DX ;;AN000;; Get Input/Class request
+
+ CALL $M_ADD_CRLF ;;AN004;; Check if we need to add the CR LF chars.
+
+ POP ES ;;AN000;; Get location of input buffer (if specified)
+ POP DI ;;AN000;;
+
+;; Test if character input was requested
+
+IF INPUTmsg ;;AN000;;
+ OR DL,DL ;;AN000;; Was Wait-For-Input requested?
+ $IF NZ ;;AN000;;
+ CALL $M_WAIT_FOR_INPUT ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF ;;AN000;;
+ $ELSE ;;AN000;;
+ ADD SP,6 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ POP ES ;;AN000;; Get pointer to input buffer (segment)
+ POP DI ;;AN000;; Get base pointer to first sublist (offset)
+ POP DX ;;AN000;; Get base pointer to first sublist (segment)
+ STC ;;AN000;; Set carry flag
+ $ENDIF ;;AN000;;
+ ;;
+ $IF NC ;;AN000;; Was there an error?
+ POP BP ;;AN000;; No,
+ POP CX ;;AN000;;
+ POP BX ;;AN000;;
+IF INPUTmsg ;;AN000;;
+ ADD SP,2 ;;AN000;;
+ELSE ;AN000;
+ POP AX ;;AN000;;
+ENDIF ;;AN000;;
+ $ELSE ;;AN000;; Yes,
+ ADD SP,8 ;;AN000;; Eliminate from stack
+ STC ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ RET ;;AN000;; Return
+ ;;
+ SYSDISPMSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;
+;;
+;; PROC NAME: $M_DISPLAY_STRING
+;;
+;; FUNCTION: Will display or write string
+;; INPUTS: ES:DI points to beginning of message
+;; CX contains the length of string to write (if applicable)
+;; OUTPUTS: None
+;; REGS Revised: None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_STRING PROC NEAR ;;AN000;;
+ ;;
+ PUSH AX ;;AN000;;
+ PUSH BX ;;AN000;;
+ PUSH DX ;;AN000;;
+ ;;
+ MOV BX,$M_RT.$M_HANDLE ;;AN000;; Retrieve handle
+ ;;
+IF COMR ;; ** Special case for RESIDENT COMMAND.COM
+ CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
+ELSE
+ CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
+ $IF E ;;AN000;;
+ CALL $M_DISPLAY_$_STRING ;;AN000;; No, display $ terminated string
+ $ELSE ;;AN000;;
+ CALL $M_DISPLAY_H_STRING ;;AN000;; Yes, display string to handle
+ $ENDIF ;;AN000;;
+ ;AN001;
+ $IF C ;;AN000;; Was there an error?
+ MOV AH,DOS_GET_EXT_ERROR ;;AN000;; Yes,
+ MOV BX,DOS_GET_EXT_ERROR_BX ;;AN000;; Get extended error
+ INT 21H ;;AN000;;
+ XOR AH,AH ;;AN000;; Clear AH
+ ADD SP,6 ;;AN000;; Clean up stack
+ STC ;;AN000;; Flag that there was an error
+ $ELSE ;;AN000;; No,
+ CMP BX,$M_NO_HANDLE ;;AN000;; Was there a handle specified?
+ $IF NE ;;AN000;;
+ CMP AX,CX ;AN001; Was it ALL written?
+ $IF NE ;AN001; No,
+ CALL $M_GET_EXT_ERR_39 ;AN001; Set Extended error
+ ADD SP,6 ;AN001; Clean up stack
+ STC ;AN001; Flag that there was an error
+ $ENDIF ;AN001;
+ $ENDIF ;AN001;
+ $ENDIF ;;AN000;;
+ENDIF
+ $IF NC ;;AN000;; Was there ANY error?
+ POP DX ;;AN000;; Restore regs
+ POP BX ;;AN000;;
+ POP AX ;;AN000;;
+ $ENDIF ;;AN000;;
+ RET ;;AN000;; Return
+ ;;
+$M_DISPLAY_STRING ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_$_STRING
+;;
+;; FUNCTION: Will display a $ terminated string
+;; INPUTS: ES:DI points to beginning of message text (not the length)
+;; OUPUTS: None
+;; REGS USED: AX,DX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_$_STRING PROC NEAR ;;AN000;;
+ ;;
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+IF NOT COMR
+ CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
+ $IF E ;;AN000;; Yes,
+ MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
+ MOV DL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ INT 21H ;;AN000;; Write character
+ POP DS ;;AN000;; Set DS to segment of message text
+ MOV AL,DL ;;AN000;; Get the character in AL
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+ $IF C ;;AN000;; Yes,
+ MOV DL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
+ INT 21H ;;AN000;; Write character
+ CLC ;;AN000;; Clear the DBCS indicator
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ENDIF
+ MOV AH,DOS_DISP_CHAR ;;AN000;; DOS Function to display CHARACTER
+ $DO ;;AN002;; No,
+ OR CX,CX ;;AN002;; Are there any left to display?
+ $LEAVE Z ;;AN002;; Yes,
+ MOV DL,BYTE PTR ES:[DI] ;;AN002;; Get the character
+ INT 21H ;;AN002;; Display the character
+ INC DI ;;AN002;; Set pointer to next character
+ DEC CX ;;AN002;; Count this character
+ $ENDDO Z ;;AN002;; No,
+IF NOT COMR
+ $ENDIF ;;AN000;;
+ENDIF
+ CLC ;;AN000;; Char functions used don't return carry as error
+ POP DS ;;AN000;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_$_STRING ENDP ;;AN000;;
+ ;;
+IF NOT COMR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_H_STRING
+;;
+;; FUNCTION: Will display a string to a specified handle
+;; INPUTS: ES:DI points to beginning of message
+;; CX contains the number of bytes to write
+;; BX contains the handle to write to
+;; OUPUTS: None
+;; REGS USED: AX,DX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_H_STRING PROC NEAR ;;AN000;;
+ ;;
+ XOR AX,AX ;;AN002;; Set number of bytes written to 0
+ OR CX,CX ;;AN002;; For performance, don't write if not necessary
+ $IF NZ ;;AN002;; Any chars to write?
+ PUSH DS ;;AN000;; Yes,
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+ MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
+ MOV DX,DI ;;AN000;; Pointer to data to write
+ CMP CX,$M_SINGLE_CHAR ;;AN000;; Is this a single character?
+ $IF E ;;AN000;; Yes,
+ INT 21H ;;AN000;; Write character
+ POP DS ;;AN000;; Set DS to segment of message text
+ PUSH AX ;;AN000;;
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+ POP AX ;;AN000;; Set DS to segment of message text
+ PUSH DS ;;AN000;;
+ PUSH ES ;;AN000;;
+ POP DS ;;AN000;; Set DS to segment of message text
+ $IF C ;;AN000;; Yes,
+ CLC ;;AN000;; Clear the DBCS indicator
+ MOV AH,DOS_WRITE_HANDLE ;;AN000;; DOS function to write to a handle
+ INC DX ;;AN000;; Point to next character
+ INT 21H ;;AN000;; Write character
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ INT 21H ;;AN000;; Write String at DS:SI to handle
+ $ENDIF ;;AN000;;
+ POP DS ;;AN000;;
+ $ENDIF ;;AN002;;
+ ;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_H_STRING ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_EXT_ERR_39
+;;
+;; FUNCTION: Will set registers for extended error #39
+;; INPUTS: None
+;; OUPUTS: AX,BX,CX set
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_GET_EXT_ERR_39 PROC NEAR ;AN001;
+ ;;
+ MOV AX,EXT_ERR_39 ;AN001; Set AX=39
+ MOV BX,(ERROR_CLASS_39 SHR 8) + ACTION_39 ;AN001; Set BH=1 BL=4
+ MOV CH,LOCUS_39 ;AN001; Set CH=1
+ ;AN001;
+ RET ;AN001;
+ ;;
+$M_GET_EXT_ERR_39 ENDP ;AN001;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ENDIF
+;;
+;; PROC NAME: $M_ADD_CRLF
+;;
+;; FUNCTION: Will decide whether to display a CRLF
+;; INPUTS: DX contains the Input/Class requested
+;; OUTPUTS: None
+;; REGS Revised: CX,ES,DI
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_ADD_CRLF PROC NEAR ;;AN004;;
+ ;;
+ CMP DH,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
+ $IF NE ;;AN004;; No,
+ TEST DH,$M_NO_CRLF_MASK ;;AN004;; Are we to supress the CR LF?
+ $IF Z ;;AN004;; No,
+ PUSH DS ;;AN004;;
+ POP ES ;;AN004;; Set ES to data segment
+ LEA DI,$M_RT.$M_CRLF ;;AN004;; Point at CRLF message
+ MOV CX,$M_CRLF_SIZE ;;AN004;; Set the message size
+ CALL $M_DISPLAY_STRING ;;AN004;; Display the CRLF
+ $ENDIF ;;AN004;;
+ $ENDIF ;;AN004;;
+ RET ;;AN004;; Return
+ ;;
+$M_ADD_CRLF ENDP ;;AN004;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_IS_IT_DBCS
+;;
+;; FUNCTION: Will decide whether character is Single or Double Byte
+;; INPUTS: AL contains the byte to be checked
+;; OUPUTS: Carry flag = 0 if byte is NOT in DBCS range
+;; Carry flag = 1 if byte IS in DBCS range
+;; REGS USED: All restored
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_IS_IT_DBCS PROC NEAR ;;AN000;;
+ ;;
+ PUSH ES ;;AN000;; Save Extra segment register
+ PUSH DI ;;AN000;; Save SI register
+ ;;
+ LES DI,$M_RT.$M_DBCS_VEC ;;AN000;;
+ OR DI,DI ;;AN000;; Was the DBCS vector set?
+ $IF NZ ;;AN000;;
+ $DO ;;AN000;;
+ CMP WORD PTR ES:[DI],$M_DBCS_TERM ;;AN000;; Is this the terminating flag?
+ CLC ;;AN000;;
+ $LEAVE E ;;AN000;;
+ ;; No,
+ CMP AL,BYTE PTR ES:[DI] ;;AN000;; Does the character fall in the DBCS range?
+ $IF AE,AND ;;AN000;;
+ CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Does the character fall in the DBCS range?
+ $IF BE ;;AN000;;
+ STC ;;AN000;; Yes,
+ $ENDIF ;;AN000;; Set carry flag
+ INC DI ;;AN000;; No,
+ INC DI ;;AN000;; Go to next vector
+ $ENDDO ;;AN000;;
+ $ENDIF ;;AN000;;
+
+ POP DI ;;AN000;;
+ POP ES ;;AN000;; Restore SI register
+ RET ;;AN000;; Return
+ ;;
+$M_IS_IT_DBCS ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_CONVERT2ASC
+;;
+;; FUNCTION: Convert a binary number to a ASCII string
+;; INPUTS: DX:AX contains the number to be converted
+;; $M_RT_DIVISOR contains the divisor
+;; OUPUTS: CX contains the number of characters
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CONVERT2ASC PROC NEAR ;;AN000;;
+ ;;
+ POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Save Return Address
+ XOR BX,BX ;;AN000;; Use BP as a swapping register
+ ;;
+ XCHG BX,AX ;;AN000;; Initialize - Low Word in BP
+ XCHG AX,DX ;;AN000;; - High Word in AX
+ $DO ;;AN000;; DO UNTIL Low Word becomes zero
+ DIV $M_RT.$M_DIVISOR ;;AN000;; Divide High Word by divisor
+ XCHG BX,AX ;;AN000;; Setup to divide Low Word using remainder
+ ;; and save reduced High Word in BP
+ DIV $M_RT.$M_DIVISOR ;;AN000;; Divide Low Word by divisor
+ CMP DX,9 ;;AN000;; Make a digit of the remainder
+ $IF A ;;AN000;; IF 10 to 15,
+ ADD DL,55 ;;AN000;; Make A to F ASCII
+ $ELSE ;;AN000;; IF 0 to 9,
+ ADD DL,'0' ;;AN000;; Make 0 to 9 ASCII
+ $ENDIF ;;AN000;;
+ PUSH DX ;;AN000;; Save the digit on the stack
+ INC CX ;;AN000;; Count that digit
+ OR AX,AX ;;AN000;; Are we done?
+ $LEAVE Z,AND ;;AN000;;
+ OR BX,BX ;;AN000;; AX and BX must be ZERO!!
+ $LEAVE Z ;;AN000;; No,
+IF NOT COMR
+ CMP CX,$M_FIRST_THOU ;;AN000;; Are we at the first thousands mark
+ $IF E ;;AN000;; Yes,
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+ $IF E ;;AN000;; Yes,
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ CMP CX,$M_SECOND_THOU ;;AN000;; Are we at the first thousands mark
+ $IF E ;;AN000;; Yes,
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+ $IF E ;;AN000;; Yes,
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ CMP CX,$M_THIRD_THOU ;;AN000;; Are we at the first thousands mark
+ $IF E ;;AN000;; Yes,
+ CMP $M_SL.$M_S_PAD,$M_COMMA ;;AN000;; Is the pad character a comma?
+ $IF E ;;AN000;; Yes,
+ PUSH WORD PTR $M_RT.$M_THOU_SEPARA ;;AN000;; Insert a thousand separator
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF
+ XCHG AX,BX ;;AN000;; Setup to divide the reduced High Word
+ ;;AN000;; and Revised Low Word
+ XOR DX,DX ;;AN000;; Reset remainder
+ $ENDDO ;;AN000;; NEXT
+ ;;AN000;; Yes,
+ XOR DX,DX ;;AN000;; Reset remainder
+ XOR AX,AX ;;AN000;; Reset remainder
+ PUSH [$M_RT.$M_RETURN_ADDR] ;;AN000;; Restore Return Address
+ RET ;;AN000;; Return
+ ;;
+$M_CONVERT2ASC ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DISPLAY_MESSAGE
+;;
+;; FUNCTION: Will display or write entire message (with replacable parameters)
+;; INPUTS: ES:DI points to beginning of message
+;; DS:SI points to first sublist structure in chain
+;; BX contains the handle to write to (if applicable)
+;; CX contains the length of string to write (before substitutions)
+;; BP contains the count of replacables
+;;
+;; OUTPUTS:
+;; REGS USED: All
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DISPLAY_MESSAGE PROC NEAR ;;AN000;;
+ ;;
+ $DO ;;AN000;; Note: DS:SI -> message
+ XOR DX,DX ;;AN000;; Set size = 0
+ OR CX,CX ;;AN000;; Are we finished the message yet?
+ $IF NZ ;;AN000;; No,
+ MOV AH,"%" ;;AN000;; Prepare to scan for %
+ MOV AL,0 ;;AN004;;
+ ;;
+ $DO ;;AN000;; Scan through string until %
+ CMP BYTE PTR ES:[DI],AH ;;AN000;; Is this character NOT a %
+ $LEAVE E,AND ;;AN000;; No,
+ CMP BYTE PTR ES:[DI+1],AH ;;AN000;; Is the next character also a %
+ $LEAVE NE,AND ;;AN000;; No,
+ CMP AL,AH ;;AN000;; Was the character before a %
+ $LEAVE NE ;;AN000;; No, GREAT found it
+ MOV AL,BYTE PTR ES:[DI] ;;AN004;; Yes, (to any of the above)
+ CALL $M_IS_IT_DBCS ;;AN004;; Is this character the first part of a DBCS?
+ $IF C ;;AN004;; Yes,
+ INC DI ;;AN004;; Increment past second part
+ $ENDIF ;;AN004;;
+ INC DI ;;AN000;; Next character in string
+ INC DX ;;AN000;; Size = Size + 1
+ DEC CX ;;AN000;; Decrement total size
+ $ENDDO Z ;;AN000;; Exit scan if we're at the end of the line
+ $ENDIF ;;AN000;;
+ ;;
+ PUSH SI ;;AN000;; Save beginning of sublists
+ XCHG CX,DX ;;AN000;; Get size of message to display (tot sz in DX)
+ OR BP,BP ;;AN000;; Do we have any replacables to do?
+ $IF NZ ;;AN000;; Yes,
+ DEC BP ;;AN000;; Decrement number of replacables
+
+;; Search through sublists to find applicable one
+
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+ $IF E ;;AN000;; No,
+ $SEARCH ;;AN000;;
+ MOV AL,$M_SL.$M_S_ID ;;AN000;; Get ID byte
+ ADD AL,30H ;;AN000;; Convert to ASCII
+ CMP AL,BYTE PTR ES:[DI]+1 ;;AN000;; Is this the right sublist?
+ $EXITIF E ;;AN000;;
+ $ORELSE ;;AN000;; No,
+ CMP AL,$M_SPECIAL_CASE ;;AN000;; Does this sublist have ID = 0
+ $LEAVE E,AND ;;AN000;; Yes,
+ OR DX,DX ;;AN000;; Are we at the end of the message?
+ $LEAVE Z ;;AN000;; No,
+ ADD SI,WORD PTR $M_SL.$M_S_SIZE ;;AN000;; Next SUBLIST
+ $ENDLOOP ;;AN000;; Yes,
+ CMP $M_RT.$M_CLASS,UTILITY_MSG_CLASS ;;AN004;; Is it a utility message?
+ $IF E ;;AN004;; Yes,
+ INC DX ;;AN000;; Remember to display CR,LF
+ INC DX ;;AN000;; at the end of the message
+ DEC CX ;;AN000;; Adjust message length
+ DEC CX ;;AN000;;
+ DEC DI ;;AN000;; Adjust ending address of message
+ DEC DI ;;AN000;;
+ $ELSE ;;AN004;; No,
+ MOV DX,-1 ;;AN004;; Set special case
+ $ENDIF ;;AN004;;
+ $ENDSRCH ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+
+;; Prepare and display this part of message
+
+ PUSH DI ;;AN000;; Save pointer to replace number
+ SUB DI,CX ;;AN000;; Determine beginning of string
+ CALL $M_DISPLAY_STRING ;;AN000;; Display string until % (or end)
+ POP DI ;;AN000;; Get back pointer to replace number
+ POP CX ;;AN000;; Clean up stack in case error
+ $LEAVE C,LONG ;;AN000;; Fail if carry was set
+ PUSH CX ;;AN000;;
+
+;; Save and reset pointer registers
+
+ MOV CX,DX ;;AN000;; Get the size of the rest of the message
+ CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the %0 case?
+ $IF NE ;;AN000;; No,
+ OR CX,CX ;;AN000;; Are we finished the whole message?
+ $IF NZ ;;AN000;; No,
+ DEC CX ;;AN000;; Decrement total size (%)
+ DEC CX ;;AN000;; Decrement total size (#)
+ INC DI ;;AN000;; Go past %
+ INC DI ;;AN000;; Go past replace number
+ $ELSE ;;AN000;; Yes, (Note this will not leave because INC)
+ POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
+ $ENDIF ;;AN000;; Yes, Note this will not leave because INC
+ $ELSE ;;AN000;;
+ OR CX,CX ;;AN000;; Are we finished the whole message?
+ $IF Z ;;AN004;; No,
+ POP SI ;;AN000;; Get back pointer to beginning of SUBLISTs
+ $ELSE ;;AN000;; No,
+ CMP CX,-1 ;;AN004;; Are we at the end of the message?
+ $IF Z ;;AN004;; No,
+ XOR CX,CX ;;AN004;;
+ $ENDIF ;;AN000;;
+ OR DI,DI ;;AN004;; Turn ZF off
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;; Note this will not leave because INC
+ $LEAVE Z ;;AN000;;
+ PUSH BP ;;AN000;; Save the replace count
+ PUSH DI ;;AN000;; Save location to complete message
+ PUSH ES ;;AN000;;
+ PUSH CX ;;AN000;; Save size of the rest of the message
+ XOR CX,CX ;;AN000;; Reset CX used for character count
+
+;; Determine what action is required on parameter
+
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+ $IF E ;;AN000;;
+
+IF CHARmsg ;;AN000;; Was Char specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z ;;AN000;;
+
+;; Character type requested
+ ;;AN000;;
+ LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
+ CALL $M_CHAR_REPLACE ;;AN000;;
+ $ELSE ;;AN000;; Get the rest of the message to display
+ENDIF ;;AN000;;
+IF NUMmsg ;;AN000;; Was Nnmeric type specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z,OR ;;AN000;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z,OR ;;AN000;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Bin_Hex_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z ;;AN000;;
+
+;; Numeric type requested
+
+ LES DI,DWORD PTR $M_SL.$M_S_VALUE ;;AN000;; Load pointer to replacing parameter
+ CALL $M_BIN2ASC_REPLACE ;;AN000;;
+ $ELSE ;;AN000;; Get the rest of the message to display
+ENDIF ;;AN000;;
+IF DATEmsg ;;AN000;; Was date specified?
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Date_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF E ;;AN000;;
+
+;; Date type requested
+
+ CALL $M_DATE_REPLACE ;;AN000;;
+ $ELSE ;;AN000;; Get the rest of the message to display
+ENDIF ;;AN000;;
+IF TIMEmsg ;;AN000;; Was time (12 hour format) specified?
+
+;; Time type requested (Default if we have not matched until here)
+
+ CALL $M_TIME_REPLACE ;;AN000;;
+ENDIF ;;AN000;;
+
+IF DATEmsg ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF ;;AN000;;
+IF NUMmsg ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF ;;AN000;;
+IF CHARmsg ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF ;;AN000;;
+
+IF $M_REPLACE ;;AN000;;
+;; With the replace information of the Stack, display the replaceable field
+
+ CALL $M_DISPLAY_REPLACE ;;AN000;; Display the replace
+ENDIF ;;AN000;;
+;; None of the above - Extended/Parse replace
+ $ELSE ;;AN000;;
+IF NOT COMR
+ CALL $M_EXT_PAR_REPLACE ;;AN000;;
+ENDIF
+ $ENDIF ;;AN000;;
+
+;; We must go back and complete the message after the replacable parameter if there is any left
+
+ $IF NC ;;AN000;; IF there was an error displaying then EXIT
+ POP CX ;;AN000;; Get size of the rest of the message
+ POP ES ;;AN000;; Get address of the rest of the message
+ POP DI ;;AN000;;
+ POP BP ;;AN000;; Get replacment count
+ POP SI ;;AN000;; ELSE get address of first sublist structure
+ $ELSE ;;AN000;;
+ ADD SP,10 ;;AN000;; Clean up stack if error
+ STC ;;AN000;;
+ $ENDIF ;;AN000;;
+ CMP $M_RT.$M_MSG_NUM,$M_NULL ;;AN000;; Is this an Extended/Parse case
+ $ENDDO NE,OR ;;AN000;;
+ $ENDDO C,LONG ;;AN000;; Go back and display the rest of the message
+ ;; IF there was an error displaying then EXIT
+ MOV $M_RT.$M_MSG_NUM,0 ;;AN000;; Reset message number to null
+ RET ;;AN000;; Return
+ ;;
+$M_DISPLAY_MESSAGE ENDP ;;AN000;;
+IF NOT COMR
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_EXT_PAR_REPLACE
+;;
+;; FUNCTION:
+;; INPUTS:
+;; OUPUTS:
+;;
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_EXT_PAR_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN000;; Prepare for get binary value (LOW)
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ ;;
+ CALL $M_CONVERT2ASC ;;AN000;;
+ ;;
+ $DO ;;AN000;;
+ POP AX ;;AN000;; Get character in register
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+ $IF E ;;AN000;; Yes,
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ $ENDIF ;;AN000;;
+ DEC CL ;;AN000;; Have we completed replace?
+ $ENDDO Z ;;AN000;;
+ ;;
+ MOV AX,$M_CR_LF ;;AN000;; Move char into the buffer
+ MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],AX ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ INC BX ;;AN000;; Increase buffer count
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ RET ;;AN000::
+ ;;
+$M_EXT_PAR_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ENDIF
+ IF $M_SUBS ;;AN000;; Include the common subroutines if they haven't yet
+ $M_SUBS = FALSE ;;AN000;; No, then include and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_GET_MSG_ADDRESS
+;;
+;; FUNCTION: To scan thru classes to return pointer to the message header
+;; INPUTS: Access to $M_RES_ADDRESSES
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN DS:SI points to the specified message
+;; REGS CHANGED: ES,DI,CX,DS,SI
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+IF FARmsg ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC FAR ;;AN000;;
+ELSE ;;AN000;;
+ $M_GET_MSG_ADDRESS PROC NEAR ;;AN000;;
+ENDIF ;;AN000;;
+ ;;
+ PUSH SI ;;AN000;;
+ PUSH BX ;;AN000;;
+ XOR SI,SI ;;AN000;; Use SI as an index
+ XOR CX,CX ;;AN000;; Use CX as an size
+ $DO ;;AN000;;
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Were utility messages requested?
+ $IF E ;;AN000;; Yes,
+ IF FARmsg ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ ELSE ;;AN000;;
+ MOV DI,WORD PTR $M_RT.$M_CLASS_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,DI ;;AN000;
+ ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No,
+ TEST DH,PARSE_ERR_CLASS ;;AN000;; Were parse errors requested?
+ $IF NE ;;AN000;; Yes,
+ LES DI,DWORD PTR $M_RT.$M_PARSE_COMMAND[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ELSE ;;AN000;; No, extended errors were specified
+ CMP AX,$M_CRIT_LO ;;AN000;; Is this a critical error?
+ $IF AE,AND ;;AN000;;
+ CMP AX,$M_CRIT_HI ;;AN000;;
+ $IF BE ;;AN000;; Yes,
+ LES DI,DWORD PTR $M_RT.$M_CRIT_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ELSE ;;AN000;;
+ LES DI,DWORD PTR $M_RT.$M_EXT_ERR_ADDRS[SI] ;;AN000;; Get address of class
+ MOV BX,ES ;;AN000;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ CMP BX,$M_TERMINATING_FLAG ;;AN000;; Are we finished all classes?
+ $IF E ;;AN000;; Yes,
+ CMP DH,UTILITY_MSG_CLASS ;;AN000;; Was it a UTILITY class?
+ $IF E ;;AN000;; Yes,
+ STC ;;AN000;; Set the carry flag
+ $ELSE ;;AN000;; No,
+ MOV $M_RT.$M_MSG_NUM,AX ;;AN000;; Save message number
+ MOV AX,$M_SPECIAL_MSG_NUM ;;AN000;; Set special message number
+ MOV BP,$M_ONE_REPLACE ;;AN000;; Set one replace in message
+ XOR SI,SI ;;AN000;; Reset the SI index to start again
+ CLC ;;AN000;;
+ $ENDIF ;;AN000;; No,
+ $ELSE ;;AN000;;
+ CMP BX,$M_CLASS_NOT_EXIST ;;AN000;; Does this class exist?
+ $IF NE ;;AN001;; Yes,
+ CALL $M_FIND_SPECIFIED_MSG ;;AN000;; Try to find the message
+ $ENDIF ;;AN000;;
+ ADD SI,$M_ADDR_SZ_FAR ;;AN000;; Get next class
+ CLC ;;AN000;;
+ $ENDIF ;;AN000;;
+ $LEAVE C ;;AN000;;
+ OR CX,CX ;;AN000;; Was the message found?
+ $ENDDO NZ,LONG ;;AN000;;
+
+ PUSHF ;;AN006;; Save the flag state
+ CMP DH,EXT_ERR_CLASS ;;AN006;; Was an extended error requested?
+ $IF E ;;AN006;; Yes,
+ PUSH DX ;;AN006;; Save all needed registers
+ PUSH BP ;;AN006;;
+ PUSH CX ;;AN006;;
+ PUSH ES ;;AN006;;
+ PUSH DI ;;AN006;;
+ PUSH AX ;;AN006;;
+
+ MOV AX,IFSFUNC_INSTALL_CHECK ;;AN006;; Check if IFSFUNC is installed
+ INT 2FH ;;AN006;;
+ CMP AL,IFSFUNC_INSTALLED ;;AN006;; Is it installed?
+ POP AX ;;AN006;; Restore msg number
+ $IF E ;;AN006;; Yes,
+ MOV BX,AX ;;AN006;; BX is the extended error number
+ MOV AX,IFS_GET_ERR_TEXT ;;AN006;; AX is the muliplex number
+ INT 2FH ;;AN006;; Call IFSFUNC
+ $ELSE ;;AN006;; No,
+ STC ;;AN006;; Carry conditon
+ $ENDIF ;;AN006;;
+
+ $IF C ;;AN006;; Was there an update?
+ POP DI ;;AN006;; No,
+ POP ES ;;AN006;; Restore old pointer
+ POP CX ;;AN006;;
+ $ELSE ;;AN006;; Yes
+ ADD SP,6 ;;AN006;; Throw away old pointer
+ CALL $M_SET_LEN_IN_CX ;;AN006;; Get the length of the ASCIIZ string
+ $ENDIF ;;AN006;;
+ POP BP ;;AN006;; Restore other Regs
+ POP DX ;;AN006;;
+ $ENDIF ;;AN006;;
+ $M_POPF ;;AN006;; Restore the flag state
+
+ POP BX ;;AN000;;
+ POP SI ;;AN000;;
+ RET ;;AN000;; Return ES:DI pointing to the message
+ ;;
+$M_GET_MSG_ADDRESS ENDP ;;
+ ;;
+$M_SET_LEN_IN_CX PROC NEAR ;;
+ ;;
+ PUSH DI ;;AN006;; Save position
+ PUSH AX ;;AN006;;
+ MOV CX,-1 ;;AN006;; Set CX for decrements
+ XOR AL,AL ;;AN006;; Prepare compare register
+ REPNE SCASB ;;AN006;; Scan for zero
+ NOT CX ;;AN006;; Change decrement into number
+ DEC CX ;;AN006;; Don't include the zero
+ POP AX ;;AN006;;
+ POP DI ;;AN006;; Restore position
+ RET ;;AN006;;
+ ;;
+$M_SET_LEN_IN_CX ENDP ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FIND_SPECIFIED_MSG
+;;
+;; FUNCTION: To scan thru message headers until message is found
+;; INPUTS: ES:DI points to beginning of msg headers
+;; CX contains the number of messages in class
+;; DH contains the message class
+;; OUPUTS: IF CX = 0 THEN Message was not found
+;; IF CX > 1 THEN ES:DI points to header of specified message
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FIND_SPECIFIED_MSG PROC NEAR ;;AN000;;
+ ;;
+ CMP BX,1 ;;AN004;; Do we have an address to CALL?
+ $IF E,AND ;;AN004;; Yes,
+ CMP WORD PTR $M_RT.$M_DISK_PROC_ADDR,-1 ;;AN004;; Do we have an address to CALL?
+ $IF NE ;;AN004;; Yes,
+ CMP AX,$M_SPECIAL_MSG_NUM ;;AN004;; Are we displaying a default Ext Err?
+ $IF E ;;AN004;; . . . and . . .
+ PUSH AX ;;AN004;; Reset the special message number
+ MOV AX,$M_RT.$M_MSG_NUM ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ POP AX ;;AN004;; Reset the special message number
+ $ELSE ;;AN004;; Get the old message number
+ CALL DWORD PTR $M_RT.$M_DISK_PROC_ADDR ;;AN004;; Call the READ_DISK_PROC to get error text
+ $ENDIF ;;AN004;; Get the old message number
+ $ELSE ;;AN004;;
+ XOR CX,CX ;;AN002;; CX = 0 will allow us to
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+ $IF NE ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN001;; Get number of messages in class
+ $ELSE ;;AN001;;
+IF FARmsg ;;AN001;;
+ CMP BYTE PTR ES:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ELSE
+ CMP BYTE PTR CS:[DI].$M_CLASS_ID,DH ;;AN002;; Check if class still exists at
+ENDIF
+ $IF E ;;AN002;; pointer (hopefully)
+IF FARmsg ;;AN001;;
+ MOV CL,BYTE PTR ES:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ELSE
+ MOV CL,BYTE PTR CS:[DI].$M_NUM_CLS_MSG ;;AN000;; Get number of messages in class
+ENDIF
+ $ENDIF ;;AN002;; go on to the next class
+ $ENDIF ;;AN001;;
+ ADD DI,$M_CLASS_ID_SZ ;;AN000;; Point past the class header
+ STC ;;AN004;; Flag that we haven't found anything yet
+ $ENDIF ;;AN004;;
+
+ $IF C ;;AN004;; Have we found anything yet?
+ CLC ;;AN004;; No, reset carry
+ $SEARCH ;;AN000;;
+ OR CX,CX ;;AN000;; Do we have any to check?
+ $LEAVE Z ;;AN000;; No, return with CX = 0
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;;
+ $IF NE ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN001;; Is this the message requested?
+ $ELSE ;;AN001;;
+IF FARmsg ;;AN001;;
+ CMP AX,WORD PTR ES:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ELSE
+ CMP AX,WORD PTR CS:[DI].$M_NUM ;;AN000;; Is this the message requested?
+ENDIF
+ $ENDIF
+ $EXITIF E ;;AN000;;
+ $ORELSE ;;AN000;
+ DEC CX ;;AN000;; No, well do we have more to check?
+ $LEAVE Z ;;AN000;; No, return with CX = 0
+ ADD DI,$M_ID_SZ ;;AN000;; Yes, skip past msg header
+ $ENDLOOP ;;AN000;;
+ STC ;;AN000;;
+ $ENDSRCH ;;AN000;; Check next message
+ $IF NC ;;AN000;; Did we find the message?
+ CMP DH,UTILITY_MSG_CLASS ;;AN001;; Yes, is it a utility message?
+ CLC ;;AN001;;
+ $IF E ;;AN001;;
+IF FARmsg ;;AN001;;
+ELSE ;;AN000;;
+ PUSH CS ;;AN000;;
+ POP ES ;;AN000;; Return ES:DI pointing to the message
+ENDIF
+ $ENDIF ;;AN001;;
+ ADD DI,WORD PTR ES:[DI].$M_TXT_PTR ;;AN000;; Prepare ES:DI pointing to the message
+ $ENDIF ;;AN004;;
+ $ENDIF ;;AN004;;
+ ;; Yes, great we can return with CX > 0
+
+ $IF NC ;;AN000;; Did we find the message?
+ XOR CH,CH ;;AN000;;
+ MOV CL,BYTE PTR ES:[DI] ;;AN000;; Move size into CX
+ INC DI ;;AN000;; Increment past length
+ $ENDIF ;;AN004;;
+
+ MOV $M_RT.$M_SIZE,$M_NULL ;;AN004;; Reset variable
+ RET ;;AN000;; Return
+ ;;
+$M_FIND_SPECIFIED_MSG ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of common subroutines
+;
+ IF $M_REPLACE ;;AN000;; Is the request to include the code for replaceable parms
+ $M_REPLACE = FALSE ;;AN000;; Tell the assembler we did
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+$M_DISPLAY_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ XOR BX,BX ;;AN000;; Use BX for buffer count
+IF NOT COMR
+ CMP $M_SL.$M_S_ID,$M_SPECIAL_CASE-30H ;;AN000;; Is this the special case (convert to ASCII)
+ $IF E ;;AN000;; Yes,
+ MOV WORD PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE_HYP ;;AN000;; Move in a " -"
+ INC BX ;;AN000;; Increment count
+ INC BX ;;AN000;; Increment count
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],$M_SPACE ;;AN000;; Move in a " "
+ INC BX ;;AN000;; Increment count
+ CALL $M_FLUSH_BUF ;;AN000;; Write out " - " to prepare for special case
+ $ENDIF ;;AN000;; If it fails we will catch it later
+ENDIF
+
+ POP BP ;;AN000;; Remember the return address
+ XOR BX,BX ;;AN000;; Use BX for buffer count
+ XOR DX,DX ;;AN000;; Use DX for count of parms taken off the stack
+
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save size to later clear stack
+ MOV AL,BYTE PTR $M_SL.$M_S_MINW ;;AN000;; Get the minimum width
+ ;;
+ CMP AL,CL ;;AN000;; Do we need pad chars added?
+ $IF A ;;AN000;; Yes,
+ SUB AL,CL ;;AN000;; Calculate how many pad chars are needed.
+ MOV DH,AL ;;AN000;; Save the number of pad characters
+ TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be right aligned?
+ $IF NZ ;;AN000;; Yes,
+ $DO ;;AN000;; Begin filling buffer with pad chars
+ MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
+ INC BX ;;AN000;;
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+ $IF E ;;AN000;; Yes,
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ $ENDIF ;;AN000;;
+ DEC DH ;;AN000;; Have we filled with enough pad chars?
+ $ENDDO Z ;;AN000;; No, next pad character
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;; Yes,
+ ;;
+ CMP BYTE PTR $M_SL.$M_S_MAXW,$M_UNLIM_W ;;AN000;; Is maximum width unlimited?
+ $IF NE ;;AN000;;
+ CMP BYTE PTR $M_SL.$M_S_MAXW,CL ;;AN000;; Will we exceed maximum width?
+ $IF B ;;AN000;; Yes,
+ SUB CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Calculate how many extra chars
+ MOV DL,CL ;;AN000;; Remember how many chars to pop off
+ MOV CL,BYTE PTR $M_SL.$M_S_MAXW ;;AN000;; Set new string length
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ OR CX,CX ;;AN000;;
+ $IF NZ ;;AN000;;
+ $DO ;;AN000;; Begin filling buffer with string
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z,AND ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ; Is this replace a ASCIIZ string?
+ $IF NZ ;;AN000;; Yes,
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get first character from string
+ INC DI ;;AN000;; Next character in string
+ $ELSE ;;AN000;; No,
+ POP AX ;;AN000;; Get character in register
+ $ENDIF ;;AN000;;
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move char into the buffer
+ INC BX ;;AN000;; Increase buffer count
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+ $IF E ;;AN000;; Yes,
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ $ENDIF ;;AN000;;
+ DEC CL ;;AN000;; Have we completed replace?
+ $ENDDO Z ;;AN000;; Test again
+ $ENDIF ;;AN000;;
+ ;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,Right_Align ;;AN000;; Was replaceable parm to be left aligned?
+ $IF Z ;;AN000;; Yes,
+ OR DH,DH ;;AN000;; Do we need pad chars added?
+ $IF NZ ;;AN000;; Yes,
+ $DO ;;AN000;; Begin filling buffer with pad chars
+ MOV AL,BYTE PTR $M_SL.$M_S_PAD ;;AN000;;
+ MOV BYTE PTR $M_RT.$M_TEMP_BUF[BX],AL ;;AN000;; Move in a pad char
+ INC BX ;;AN000;;
+ CMP BX,$M_TEMP_BUF_SZ ;;AN000;; Is buffer full?
+ $IF E ;;AN000;; Yes,
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer
+ $ENDIF ;;AN000;;
+ DEC DH ;;AN000;; Have we filled with enough pad chars?
+ $ENDDO Z ;;AN000;; Test again
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ TEST BYTE PTR $M_SL.$M_S_FLAG,NOT Char_Type AND $M_TYPE_MASK ;;AN000;;
+ $IF Z,AND ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Char_field_ASCIIZ AND $M_SIZE_MASK ;;AN000;; Is this replace a ASCIIZ string?
+ $IF NZ ;;AN000;; Yes,
+ $ELSE ;;AN000;;
+ OR DL,DL ;;AN000;;
+ $IF NE ;;AN000;;
+ $DO ;;AN000;;
+ POP [$M_RT.$M_RETURN_ADDR] ;;AN000;; Clean Up stack using spare variable
+ DEC DL ;;AN000;; Are we done?
+ $ENDDO Z ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ CALL $M_FLUSH_BUF ;;AN000;; Flush the buffer for the final time
+ PUSH BP ;;AN000;; Restore the return address
+ ;;
+ RET ;;AN000;;
+ ;;
+$M_DISPLAY_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_FLUSH_BUFFER
+;;
+;; FUNCTION: Display the contents of the temporary buffer
+;; INPUTS: DI contains the number of bytes to display
+;; OUTPUTS: BX reset to zero
+;;
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_FLUSH_BUF PROC NEAR ;;AN000;;
+ ;;
+ PUSH CX ;;AN000;; Save changed regs
+ PUSH ES ;;AN000;;
+ PUSH DI ;;AN000;;
+ PUSH DS ;;AN000;; Set ES pointing to buffer
+ POP ES ;;AN000;;
+ ;;
+ MOV CX,BX ;;AN000;; Set number of bytes to display
+ XOR BX,BX ;;AN000;; Reset buffer counter
+ LEA DI,$M_RT.$M_TEMP_BUF ;;AN000;; Reset buffer location pointer
+ CALL $M_DISPLAY_STRING ;;AN000;; Display the buffer
+ ;;
+ $IF NC ;;AN000;; Error?
+ POP DI ;;AN000;; No, Restore changed regs
+ POP ES ;;AN000;;
+ POP CX ;;AN000;;
+ $ELSE ;;AN000;; Yes,
+ ADD SP,6 ;;AN000;; Fix stack
+ STC ;;AN000;;
+ $ENDIF ;;AN000;; Error?
+ ;;
+ RET ;;AN000;; Return
+ ;;
+$M_FLUSH_BUF ENDP ;;AN000;;
+ ;;
+ ;;
+ IF CHARmsg ;;AN000;; Is the request to include the code for CHAR replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = TRUE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_CHAR_REPLACE
+;;
+;; FUNCTION: Will prepare a single char or ASCIIZ string for replace
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI contains the VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;;
+;; OTHER REGS Revised: AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_CHAR_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ TEST $M_SL.$M_S_FLAG,NOT Char_Field_Char AND $M_SIZE_MASK ;;AN000;; Was Character specified?
+ $IF Z ;;AN000;; Yes,
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ PUSH AX ;;AN000;; Put it on the stack
+ INC CX ;;AN000;; Increase the count
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this the first byte of a DB character
+ $IF C ;;AN000;; Yes,
+ MOV AL,BYTE PTR ES:[DI]+1 ;;AN000;; Get the next character
+ PUSH AX ;;AN000;; Put it on the stack
+ CLC ;;AN000;; Clear the carry
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;; No, it was an ASCIIZ string
+ $DO ;;AN000;;
+ MOV AL,BYTE PTR ES:[DI] ;;AN000;; Get the character
+ OR AL,AL ;;AN000;; Is it the NULL?
+ $LEAVE Z ;;AN000;; No,
+ INC DI ;;AN000;; Next character
+ INC CX ;;AN000;; Increment the count
+ $ENDDO ;;AN000;; Yes,
+ SUB DI,CX ;;AN000;; Set SI at the beginning of the string
+ $ENDIF ;;AN000;;
+ ;;AN000;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_CHAR_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of CHAR replace code
+;
+ IF NUMmsg ;;AN000;; Is the request to include the code for NUM replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_BIN2ASC_REPLACE
+;;
+;; FUNCTION: Convert a signed or unsigned binary number to an ASCII string
+;; and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI contains the VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; OTHER REGS Revised: BX,DX,AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_BIN2ASC_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ ;;
+ XOR DX,DX ;;AN000;; Prepare for get binary value (HIGH)
+ XOR AX,AX ;;AN000;; Prepare for get binary value (LOW)
+ MOV $M_RT.$M_DIVISOR,$M_BASE16 ;;AN000;; Set default divisor
+ XOR BX,BX ;;AN000;; Use BP as the NEG flag (if applicable)
+IF NOT COMR
+ TEST $M_SL.$M_S_FLAG,NOT $M_BYTE AND $M_SIZE_MASK ;;AN000;; Was BYTE specified?
+ $IF Z ;;AN000;;
+ MOV AL, BYTE PTR ES:[DI] ;;AN000;; Setup byte in AL
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ TEST AL,10000000b ;;AN000;; Is this number negative?
+ $IF NZ ;;AN000;; Yes,
+ INC BX ;;AN000;; Remember that it was negative
+ AND AL,01111111b ;;AN000;; Make it positive
+ $ENDIF ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;;
+ENDIF
+ TEST $M_SL.$M_S_FLAG,NOT $M_WORD AND $M_SIZE_MASK ;;AN000;; Was WORD specified?
+ $IF Z ;;AN000;;
+ MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup byte in AL
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;; AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ TEST AH,10000000b ;;AN000;; Is this number negative?
+ $IF NZ ;;AN000;; Yes,
+ INC BX ;;AN000;; Remember that it was negative
+ AND AH,01111111b ;;AN000;; Make it positive
+ $ENDIF ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ELSE ;;AN000;;
+IF NOT COMR
+ MOV AX, WORD PTR ES:[DI] ;;AN000;; Setup Double word in DX:AX
+ MOV DX, WORD PTR ES:[DI]+2 ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,NOT Sgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ TEST DH,10000000b ;;AN000;; Is this number negative?
+ $IF NZ ;;AN000;; Yes,
+ INC BX ;;AN000;; Remember that it was negative
+ AND DH,01111111b ;;AN000;; Make it positive
+ $ENDIF ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,NOT Unsgn_Bin_Type AND $M_TYPE_MASK ;;AN000;; Was Signed binary specified?
+ $IF Z ;;AN000;;
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;;
+ $ENDIF ;;AN000;;
+ENDIF
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ CALL $M_CONVERT2ASC ;;AN000;; Convert to ASCII string
+IF NOT COMR
+ OR BX,BX ;;AN000;;
+ $IF NZ ;;AN000;; Was number negative?
+ XOR DX,DX ;;AN000;; Yes,
+ MOV DL,$M_NEG_SIGN ;;AN000;; Put "-" on the stack with the number
+ PUSH DX ;;AN000;;
+ $ENDIF ;;AN000;; No,
+ENDIF
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_BIN2ASC_REPLACE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of NUM replace code
+;
+ IF DATEmsg ;;AN000;; Is the request to include the code for DATE replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_DATE_REPLACE
+;;
+;; FUNCTION: Convert a date to a decimal ASCII string using current
+;; country format and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI points at VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; OTHER REGS Revised: DX, AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_DATE_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ CALL $M_GET_DATE ;;AN000;; Set date format/separator in $M_RT
+ ;;AN000;; All O.K.?
+ XOR DX,DX ;;AN000;; Reset DX value
+ XOR AX,AX ;;AN000;; Reset AX value
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,0 ;;AN000;; USA Date Format
+ $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;; Increment count
+ XOR AX,AX ;;AN000;; Reset AX value
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;; Increment count
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ $ENDIF ;;AN000;;
+ ;;
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,1 ;;AN000;; EUROPE Date Format
+ $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ XOR AX,AX ;;AN000;; Reset AX
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ $ENDIF ;;AN000;;
+ ;;
+ CMP WORD PTR $M_RT.$M_DATE_FORMAT,2 ;;AN000;; JAPAN Date Format
+ $IF E ;;AN000;; Beginning from end: (saved on the stack)
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Day
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Month
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ PUSH WORD PTR $M_RT.$M_DATE_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ CALL $M_YEAR ;;AN000;; Get Year
+ CALL $M_CONVERTDATE ;;AN000;; Convert it to an ASCII string
+ $ENDIF ;;AN000;;
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_DATE_REPLACE ENDP ;;AN000;;
+ ;;
+$M_GET_DATE PROC NEAR ;;AN000;;
+ MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
+ MOV AL,0 ;;AN000;; Get current country info
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
+ INT 21H ;;AN000;;
+ $IF C ;;AN000;; No,
+ MOV WORD PTR $M_RT.$M_DATE_FORMAT,$M_DEF_DATE_FORM ;;AN000;; Set default date format (BH)
+ MOV BYTE PTR $M_RT.$M_DATE_SEPARA,$M_DEF_DATE_SEP ;;AN000;; Set default date separator (BL)
+ $ENDIF ;;AN000;;
+ RET ;;AN000;;
+$M_GET_DATE ENDP ;;AN000;;
+ ;;
+$M_YEAR PROC NEAR ;;AN000;;
+ MOV AX,WORD PTR $M_SL.$M_S_VALUE ;;AN000;; Get Year
+ TEST $M_SL.$M_S_FLAG,Date_MDY_4 AND $M_DATE_MASK ;;AN000;; Was Month/Day/Year (2 Digits) specified?
+ $IF Z ;;AN000;;
+ CMP AX,$M_MAX_2_YEAR ;;AN000;; Get Year
+ $IF A ;;AN000;;
+ MOV AX,$M_MAX_2_YEAR ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ RET ;;AN000;;
+$M_YEAR ENDP ;;AN000;;
+ ;;
+$M_CONVERTDATE PROC NEAR ;;AN000;;
+ POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
+ DEC CX ;;AN000;; Test if size only grew by 1
+ CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
+ $IF E ;;AN000;; Yes,
+ MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
+ PUSH AX ;;AN000;; Save it
+ INC CX ;;AN000;; Count it
+ $ENDIF ;;AN000;;
+ INC CX ;;AN000;; Restore CX
+ PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ RET ;;AN000;;
+$M_CONVERTDATE ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of DATE replace code
+;
+ IF TIMEmsg ;;AN000;; Is the request to include the code for TIME replace?
+ $M_REPLACE = TRUE ;;AN000;; Yes, THEN include it and flag that we will need common
+ $M_CHAR_ONLY = FALSE ;;AN000;; replacement code later
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_TIME_REPLACE
+;;
+;; FUNCTION: Convert a time to a decimal ASCII string
+;; and prepare to display
+;; INPUTS: DS:SI points at corresponding SUBLIST
+;; ES:DI points at VALUE from SUBLIST
+;; OUTPUTS: CX contains number of characters on stack
+;; Top of stack --> Last character
+;; . . .
+;; Bot of stack --> First character
+;; REGS USED: BP,CX,AX
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_TIME_REPLACE PROC NEAR ;;AN000;;
+ ;;
+ POP BP ;;AN000;; Save return address
+ MOV $M_RT.$M_DIVISOR,$M_BASE10 ;;AN000;; Set default divisor
+ CALL $M_GET_TIME ;;AN000;; All O.K.?
+ TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
+ $IF NZ ;;AN000;; Yes,
+ CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
+ $IF E ;;AN000;; Yes,
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
+ CMP AL,12 ;;AN000;; Is hour 12 or less?
+ $IF L,OR ;;AN000;; or
+ CMP AL,23 ;;AN000;; Is hour 24 or greater?
+ $IF G ;;AN000;; Yes,
+ MOV AL,$M_AM ;;AN000;;
+ PUSH AX ;;AN000;; Push an "a" to represent AM.
+ INC CX ;;AN000;;
+ $ELSE ;;AN000;; No,
+ MOV AL,$M_PM ;;AN000;;
+ PUSH AX ;;AN000;; Push an "p" to represent PM.
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ XOR AX,AX ;;AN000;;
+ XOR DX,DX ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
+ $IF NZ ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+3 ;;AN000;; Get Hundreds
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_DECI_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSSHH_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec/Hunds (12 Hour) specified?
+ $IF NZ,OR ;;AN000;;
+ TEST $M_SL.$M_S_FLAG,Time_HHMMSS_Cty AND $M_SIZE_MASK ;;AN000;; Was Hour/Min/Sec (12 Hour) specified?
+ $IF NZ ;;AN000;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+2 ;;AN000;; Get Seconds
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;; Do Hour/Min (12 Hour)
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE+1 ;;AN000;; Get Minutes
+ CALL $M_CONVERTTIME ;;AN000;;
+ PUSH WORD PTR $M_RT.$M_TIME_SEPARA ;;AN000;;
+ INC CX ;;AN000;;
+ ;;
+ MOV AL,BYTE PTR $M_SL.$M_S_VALUE ;;AN000;; Get Hours
+ TEST $M_SL.$M_S_FLAG,Time_Cty_Type AND $M_TIME_MASK ;;AN000;; Is this a request for current country info?
+ $IF NZ ;;AN000;; Yes,
+ CMP BYTE PTR $M_RT.$M_TIME_FORMAT,0 ;;AN000;; Is the current country format 12 Hour?
+ $IF E ;;AN000;; Yes,
+ CMP AL,13 ;;AN000;; Is hour less than 12?
+ $IF GE ;;AN000;; Yes,
+ SUB AL,12 ;;AN000;; Set to a 12 hour value
+ $ENDIF ;;AN000;;
+ CMP AL,0 ;;AN000;; Is hour less than 12?
+ $IF E ;;AN000;; Yes,
+ MOV AL,12 ;;AN000;; Set to a 12 hour value
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to ASCII
+ ;;
+ PUSH BP ;;AN000;; Restore return address
+ RET ;;AN000;; Return
+ ;;
+$M_TIME_REPLACE ENDP ;;AN000;;
+ ;;
+$M_GET_TIME PROC NEAR ;;AN000;;
+ MOV AH,DOS_GET_COUNTRY ;;AN000;; Call DOS for country dependant info
+ MOV AL,0 ;;AN000;; Get current country info
+ LEA DX,$M_RT.$M_TEMP_BUF ;;AN000;; Set up addressibility to buffer
+ INT 21H ;;AN000;;
+ $IF C ;;AN000;; No,
+ MOV WORD PTR $M_RT.$M_TIME_FORMAT,$M_DEF_TIME_FORM ;;AN000;; Set default time format (BH)
+ MOV BYTE PTR $M_RT.$M_TIME_SEPARA,$M_DEF_TIME_SEP ;;AN000;; Set default time separator (BL)
+ MOV BYTE PTR $M_RT.$M_DECI_SEPARA,$M_DEF_DECI_SEP ;;AN000;; Set default time separator (BL)
+ $ENDIF ;;AN000;;
+ RET ;;AN000;;
+$M_GET_TIME ENDP ;;AN000;;
+ ;;
+$M_CONVERTTIME PROC NEAR ;;AN000;;
+ POP WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ MOV $M_RT.$M_SIZE,CL ;;AN000;; Save the size before conversion
+ CALL $M_CONVERT2ASC ;;AN000;; Convert it to an ASCII string
+ DEC CX ;;AN000;; Test if size only grew by 1
+ CMP CL,$M_RT.$M_SIZE ;;AN000;; Did size only grow by one
+ $IF E ;;AN000;; Yes,
+ MOV AX,$M_TIMEDATE_PAD ;;AN000;; Get a pad character (0)
+ PUSH AX ;;AN000;; Save it
+ INC CX ;;AN000;; Count it
+ $ENDIF ;;AN000;;
+ INC CX ;;AN000;; Restore CX
+ PUSH WORD PTR $M_RT.$M_TEMP_BUF ;;AN000;; Save return address
+ RET ;;AN000;;
+$M_CONVERTTIME ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of TIME replace
+ ENDIF ;;AN000;; END of include of Replacement common code
+;
+ IF INPUTmsg ;;AN000;; Is the request to include the code for NUM replace?
+ INPUTmsg = FALSE ;;AN000;; Yes, THEN include it and reset the flag
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; PROC NAME: $M_WAIT_FOR_INPUT
+;;
+;; FUNCTION: To accept keyed input and return extended key value
+;; in AX register
+;; INPUTS: DL contains the DOS function requested for input
+;; OUPUTS: AX contains the extended key value that was read
+;; REGS USED:
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+$M_WAIT_FOR_INPUT PROC NEAR ;;AN000;;
+ ;;
+ PUSH CX ;;AN000;; Save CX
+ PUSH DX ;;AN000;; Save DX
+ PUSH DS ;;AN000;; Save Data segment
+ ;;
+ CMP DL,DOS_CLR_KEYB_BUF_MASK ;;AN001;; Are we to clear the keyboard buffer?
+ $IF A ;;AN001;; Yes,
+ MOV AL,DL ;;AN001;; Mov function into AL
+ AND AL,LOW_NIB_MASK ;;AN001;; Mask out the C in high nibble
+ MOV AH,DOS_CLR_KEYB_BUF ;;AN001;; Set input function
+ $ELSE ;;AN001;; No,
+ MOV AH,DL ;;AN000;; Put DOS function in AH
+ $ENDIF ;;AN001;;
+ PUSH ES ;;AN000;; Get output buffer segment
+ POP DS ;;AN000;;
+ MOV DX,DI ;;AN000;; Get output buffer offset in case needed
+ INT 21H ;;AN000;; Get keyboard input
+ POP DS ;;AN000;;
+
+ CMP DL,DOS_BUF_KEYB_INP ;;AN000;;
+ CLC ;;AN000;;
+ $IF NE ;;AN000;; If character input
+ CALL $M_IS_IT_DBCS ;;AN000;; Is this character DBCS?
+ $IF C ;;AN000;;
+ MOV CL,AL ;;AN000;; Save first character
+ MOV AH,DL ;;AN001;; Get back function
+ INT 21H ;;AN000;; Get keyboard input
+ MOV AH,CL ;;AN000;; Retreive first character AX = xxxx
+ CLC ;;AN000;; Clear carry condition
+ $ELSE ;;AN000;;
+ MOV AH,0 ;;AN000;; AX = 00xx where xx is SBCS
+ $ENDIF ;;AN000;;
+ $ENDIF ;;AN000;;
+ ;;
+ $IF NC ;;AN000;;
+ POP DX ;;AN000;;
+ POP CX ;;AN000;;
+ $ELSE ;;AN000;;
+ ADD SP,4 ;;AN000;;
+ STC ;;AN000;; Reset carry flag
+ $ENDIF ;;AN000;;
+ RET ;;AN000;; Return
+ ;;
+$M_WAIT_FOR_INPUT ENDP ;;AN000;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ENDIF ;;AN000;; END of include of Wait for Input
+ ENDIF ;;AN000;; END of include of SYSDISPMSG
+ ENDIF ;;AN000;; END of include of MSG_DATA_ONLY
+ENDIF ;;AN000;; END of include of Structure only
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/mshalo.asm b/private/mvdm/dos/v86/inc/mshalo.asm
new file mode 100644
index 000000000..65b46d587
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mshalo.asm
@@ -0,0 +1,247 @@
+; SCCSID = @(#)ibmhalo.asm 1.1 85/04/10
+; On 2K (800h) boundaries beginning at address C0000h and ending at EF800h
+; there is a header that describes a block of rom program. This header
+; contains information needed to initialize a module and to provide PCDOS
+; with a set of reserved names for execution.
+;
+; This header has the following format:
+;
+; rom_header STRUC
+; Signature1 DB 55h
+; Signature2 DB AAh
+; rom_length DB ? ; number of 512 byte pieces
+; init_jmp DB 3 dup (?)
+; name_list name_struc <>
+; rom_header ENDS
+;
+; name_struc STRUC
+; name_len DB ?
+; name_text DB ? DUP (?)
+; name_jmp DB 3 DUP (?)
+; name_struc ENDS
+;
+; The name list is a list of names that are reserved by a particular section
+; of a module. This list of names is terminated by a null name (length
+; is zero).
+;
+; Consider now, the PCDOS action when a user enters a command:
+;
+; COMMAND.COM has control.
+; o If location FFFFEh has FDh then
+; o Start scanning at C0000h, every 800h for a byte 55h followed
+; by AAh, stop scan if we get above or = F0000H
+; o When we've found one, compare the name entered by the user
+; with the one found in the rom. If we have a match, then
+; set up the environment for execution and do a long jump
+; to the near jump after the found name.
+; o If no more names in the list, then continue scanning the module
+; for more 55h followed by AAh.
+; o We get to this point only if there is no matching name in the
+; rom. We now look on disk for the command.
+;
+; This gives us the flexibility to execute any rom cartridge without having
+; to 'hard-code' the name of the cartridge into PCDOS. Rom modules that
+; want to be invisible to the DOS should not have any names in their lists
+; (i.e. they have a single null name).
+;
+; Consider a new release of BASIC, say, that patches bugs in the ROM version.
+; Clearly this version will be available on disk. How does a user actually
+; invoke this new BASIC?? He cannot call it BASIC on the disk because the
+; EXEC loader will execute the ROM before it even looks at the disk! Only
+; solution:
+;
+; o Keep things consistent and force the user to have his software named
+; differently from the ROM names (BASIC1, BASIC2, etc).
+
+rom_header STRUC
+ Signature1 DB ?
+ Signature2 DB ?
+ rom_length DB ?
+ init_jmp DB 3 dup (?)
+ name_list DB ?
+rom_header ENDS
+
+name_struc STRUC
+ name_len DB ?
+ name_text DB 1 DUP (?)
+ name_jmp DB 3 DUP (?)
+name_struc ENDS
+
+ASSUME CS:TRANGROUP,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+;
+; Check for IBM PC Jr rom cartrides. DS:DX is a pointer to name
+;
+ROM_SCAN:
+ PUSH ES
+ PUSH SI
+ PUSH DI
+ PUSH CX
+ PUSH AX
+ PUSH BX
+;
+; check for PC Jr signature in rom
+;
+ MOV AX,0F000h
+ MOV ES,AX
+ CMP BYTE PTR ES:[0FFFEh],0FDh
+ JZ SCAN_IT
+NO_ROM:
+ CLC
+ROM_RET:
+ POP BX
+ POP AX
+ POP CX
+ POP DI
+ POP SI
+ POP ES
+ RET
+SCAN_IT:
+;
+; start scanning at C000
+;
+ MOV AX,0C000h
+SCAN_ONE:
+ MOV ES,AX
+ XOR DI,DI
+SCAN_MODULE:
+;
+; check for a valid header
+;
+ CMP WORD PTR ES:[DI],0AA55h
+ JZ SCAN_LIST
+ ADD AX,080h
+SCAN_END:
+ CMP AX,0F000h
+ JB SCAN_ONE
+ JMP NO_ROM
+;
+; trundle down list of names
+;
+SCAN_LIST:
+ MOV BL,ES:[DI].rom_length ; number of 512-byte jobbers
+ XOR BH,BH ; nothing in the high byte
+ SHL BX,1
+ SHL BX,1 ; number of paragraphs
+ ADD BX,7Fh
+ AND BX,0FF80h ; round to 2k
+
+ MOV DI,name_list
+SCAN_NAME:
+ MOV CL,ES:[DI] ; length of name
+ INC DI ; point to name
+ XOR CH,CH
+ OR CX,CX ; zero length name
+ JNZ SCAN_TEST ; nope... compare
+ ADD AX,BX ; yep, skip to next block
+ JMP SCAN_END
+;
+; compare a single name
+;
+SCAN_TEST:
+ MOV SI,DX
+ INC SI
+ REPE CMPSB ; compare name
+ JZ SCAN_FOUND ; success!
+SCAN_NEXT:
+ ADD DI,CX ; failure, next name piece
+ ADD DI,3
+ JMP SCAN_NAME
+;
+; found a name. save entry location
+;
+SCAN_FOUND:
+ CMP BYTE PTR DS:[SI],'?'
+ JZ SCAN_SAVE
+ CMP BYTE PTR DS:[SI],' '
+ JNZ SCAN_NEXT
+SCAN_SAVE:
+ MOV [rom_cs],ES
+ MOV [ROM_ip],DI
+ STC
+ JMP ROM_RET
+
+;
+; execute a rom-placed body of code. allocate largest block
+;
+ROM_EXEC:
+ MOV BX,0FFFFh
+ MOV AH,ALLOC
+ INT int_command
+ MOV AH,ALLOC
+ INT int_command
+ PUSH BX
+ PUSH AX
+;
+; set terminate addresses
+;
+ MOV AX,(set_interrupt_vector SHL 8) + int_terminate
+ PUSH DS
+ MOV DS,[RESSEG]
+ ASSUME DS:RESGROUP
+ MOV DX,OFFSET RESGROUP:EXEC_WAIT
+ INT int_command
+ MOV DX,DS
+ MOV ES,DX
+ ASSUME ES:RESGROUP
+ POP DS
+ ASSUME DS:NOTHING
+;
+; and create program header and dup all jfn's
+;
+ POP DX
+ MOV AH,DUP_PDB
+ INT int_command
+;
+; set up dma address
+;
+ MOV DS,DX
+ MOV DX,080h
+ MOV AH,SET_DMA
+ INT int_command
+;
+; copy in environment info
+;
+ MOV AX,[ENVIRSEG]
+ MOV DS:[PDB_environ],AX
+;
+; set up correct size of block
+;
+ POP BX ; BX has size, DS has segment
+ MOV DX,DS
+ ADD DX,BX
+ MOV DS:[PDB_block_len],DX
+;
+; change ownership of block
+;
+ MOV DX,DS
+ DEC DX
+ MOV DS,DX
+ INC DX
+ MOV DS:[arena_owner],DX
+ MOV DS,DX
+;
+; set up correct stack
+;
+ CMP BX,1000h
+ JB GOT_STACK
+ XOR BX,BX
+GOT_STACK:
+ MOV CL,4
+ SHL BX,CL
+ MOV DX,DS
+ MOV SS,DX
+ MOV SP,BX
+ XOR AX,AX
+ PUSH AX
+;
+; set up initial registers and go to the guy
+;
+ NOT AX
+ PUSH [ROM_CS]
+ PUSH [ROM_IP]
+ MOV ES,DX
+ASSUME ES:NOTHING
+FOOBAR PROC FAR
+ RET
+FOOBAR ENDP
diff --git a/private/mvdm/dos/v86/inc/mshead.asm b/private/mvdm/dos/v86/inc/mshead.asm
new file mode 100644
index 000000000..f4a95b4ff
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mshead.asm
@@ -0,0 +1,68 @@
+; TITLE MSHEAD.ASM -- MS-DOS DEFINITIONS
+PAGE
+
+
+; NTDOS.SYS entry point.
+;
+; Modification History
+;
+; sudeepb 06-Mar-1991 Ported for DOSEm.
+
+include origin.inc
+
+
+Break <SEGMENT DECLARATIONS>
+
+; The following are all of the segments used. They are declared in the order
+; that they should be placed in the executable
+
+;
+; segment ordering for MSDOS
+;
+
+include dosseg.inc
+
+AsmVar <Installed>
+
+
+DOSCODE SEGMENT BYTE PUBLIC 'CODE'
+
+PUBLIC $STARTCODE
+$STARTCODE LABEL WORD
+
+ ASSUME CS:DOSCODE,DS:NOTHING,ES:NOTHING,SS:NOTHING
+
+; the entry point at initialization time will be to right here.
+; A jump will be made to the initialization code, which is at
+; the end of the code segment. Also, a word here (at offset 3)
+; contains the offset within the DOSCODE segment of the beginning of the
+; DOS code.
+;
+
+ Extrn DOSINIT:NEAR
+
+ JMP near ptr DOSINIT
+
+; The next word contains the ORG value to which the DOS has been ORGd
+; See origin.inc for description.
+
+ dw PARASTART ; For BIOS to know the ORG value
+
+
+; Segment address of BIOS data segment in RAM
+ PUBLIC BioDataSeg
+BioDataSeg dw 70h ;Bios data segment fixed at 70h
+
+
+;
+; DosDSeg is a data word in the DOSCODE segment that is loaded with
+; the segment address of DOSDATA. This is purely an optimization, that
+; allows getting the DOS data segment without going through the
+; BIOS data segment. It is used by the "getdseg" macro.
+;
+
+ public DosDSeg
+DosDSeg dw ?
+
+DOSCODE ENDS
+
diff --git a/private/mvdm/dos/v86/inc/mstable.asm b/private/mvdm/dos/v86/inc/mstable.asm
new file mode 100644
index 000000000..124302ca6
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mstable.asm
@@ -0,0 +1,17 @@
+; SCCSID = @(#)ibmtable.asm 1.1 85/04/10
+;
+; Table Segment for DOS
+;
+
+.xlist
+.xcref
+include version.inc
+include mssw.asm
+.cref
+.list
+
+TITLE IBMTABLE - Table segment for DOS
+NAME IBMTABLE
+
+include ms_table.asm
+ END
diff --git a/private/mvdm/dos/v86/inc/mult.inc b/private/mvdm/dos/v86/inc/mult.inc
new file mode 100644
index 000000000..60dd64bc5
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/mult.inc
@@ -0,0 +1,240 @@
+; SCCSID = @(#)mult.asm 1.2 85/04/12
+ Break <Multiplex channels>
+
+; The current set of defined multiplex channels is (* means documented):
+;
+; Channel(h) Issuer Receiver Function
+; 00 server PSPRINT print job control
+; *01 print/apps PRINT Queueing of files
+; 02 BIOS REDIR signal open/close of printers
+;
+; 05 command REDIR obtain text of net int 24 message
+; *06 server/assign ASSIGN Install check
+;
+; 08 external driver IBMBIO interface to internal routines
+;
+; 10 sharer/server Sharer install check
+; 11 DOS/server Redir install check/redirection funcs
+; 12 sharer/redir DOS dos functions and structure maint
+; 13 MSNET MSNET movement of NCBs
+; 13 external driver IBMBIO Reset_Int_13, allows installation
+; of alternative INT_13 drivers after
+; boot_up
+; 14 (IBM) DOS NLSFUNC down load NLS country info,DOS 3.3
+; 14 (MS) APPS POPUP MSDOS 4 popup screen functions
+; 15 APPS MSCDEX CD-ROM extensions interface
+; 16 WIN386 WIN386 Windows communications
+; 17 Clipboard WINDOWS Clipboard interface
+; *18 Applications MS-Manger Toggle interface to manager
+; 19 Shell
+; 1A Ansi.sys
+; 1B Fastopen,Vdisk IBMBIO EMS INT 67H stub handler
+;
+; 40h OS/2
+; 41h Lanman
+; 42h Lanman
+; 43h Himem
+; AL = 20h reserved for Mach 20 Himem support
+; AL = 30h reserved for Himem external A20 code
+; 44h Dosextender
+; 45H Windows profiler
+; 46h Windows/286 DOS extender
+; 47h Basic Compiler Vn. 7.0
+; 48h Doskey
+; 49h DOS 5.x install
+; 4ah Multi Purpose
+; multMULTSWPDSK 0 - Swap Disk in drive A (BIOS)
+; multMULTGETHMAPTR 1 - Get available HMA & ptr
+; multMULTALLOCHMA 2 - Allocate HMA (bx == no of bytes)
+; multMULTTASKSHELL 5 - Shell/switcher API
+; multMULTRPLTOM 6 - Top Of Memory for RPL support
+; 4bh Task Switcher API
+;
+; 4ch APPS APM Advanced power management
+; 4dh Kana Kanji Converter, MSKK
+;
+; 55h COMMAND.COM
+; multCOMFIRST 0 - API to determine whether 1st
+; instance of command.com
+; AB Unspecified IBM use
+; AC Graphics
+; AD NLS (toronto)
+; AE
+; AF Mode
+; B0 GRAFTABL GRAFTABL
+;
+; D7 Banyan VINES
+
+
+;MUX 00-3F reserverd for IBM
+;MUX 80-BF reserverd for IBM
+
+;MUX 40-7F reserved for Microsoft
+
+;MUX C0-FF users
+
+
+
+MultSHARE EQU 10h ; sharer
+ ; 1 MFT_enter
+ ; 2 MFTClose
+ ; 3 MFTclU
+ ; 4 MFTCloseP
+ ; 5 MFTCloN
+ ; 6 set_block
+ ; 7 clr_block
+ ; 8 chk_block
+ ; 9 MFT_get
+ ; 10 ShSave
+ ; 11 ShChk
+ ; 12 ShCol
+ ; 13 ShCloseFile
+
+MultNET EQU 11h ; Network support
+MultIFS EQU 11h ; Network support
+ ; 1 IFS_RMDIR
+ ; 2 IFS_SEQ_RMDIR
+ ; 3 IFS_MKDIR
+ ; 4 IFS_SEQ_MKDIR
+ ; 5 IFS_CHDIR
+ ; 6 IFS_CLOSE
+ ; 7 IFS_COMMIT
+ ; 8 IFS_READ
+ ; 9 IFS_WRITE
+ ; 10 IFS_LOCK
+ ; 11 IFS_UNLOCK
+ ; 12 IFS_DISK_INFO
+ ; 13 IFS_SET_FILE_ATTRIBUTE
+ ; 14 IFS_SEQ_SET_FILE_ATTRIBUTE
+ ; 15 IFS_GET_FILE_INFO
+ ; 16 IFS_SEQ_GET_FILE_INFO
+ ; 17 IFS_RENAME
+ ; 18 IFS_SEQ_RENAME
+ ; 19 IFS_DELETE
+ ; 20 IFS_SEQ_DELETE
+ ; 21 IFS_OPEN
+ ; 22 IFS_SEQ_OPEN
+ ; 23 IFS_CREATE
+ ; 24 IFS_SEQ_CREATE
+ ; 25 IFS_SEQ_SEARCH_FIRST
+ ; 26 IFS_SEQ_SEARCH_NEXT
+ ; 27 IFS_SEARCH_FIRST
+ ; 28 IFS_SEARCH_NEXT
+ ; 29 IFS_ABORT
+ ; 30 IFS_ASSOPER
+ ; 31 Printer_SET_STRING
+ ; 32 IFSFlushBuf
+ ; 33 IFSBufWrite
+ ; 34 IFSResetEnvironment
+ ; 35 IFSSpoolCheck
+ ; 36 IFSSpoolClose
+ ; 37 IFSDeviceOper
+ ; 38 IFSSpoolEchoCheck
+ ; 39 - - - Unused - - -
+ ; 40 - - - Unused - - -
+ ; 41 - - - Unused - - -
+ ; 42 SERVER_DOSCALL_CLOSEFILES_FOR_UID
+ ; 43 DEVICE_IOCTL
+ ; 44 IFS_UPDATE_CB
+ ; 45 IFS_FILE_XATTRIBUTES
+ ; 46 IFS_XOPEN
+ ; 47 IFS_DEPENDENT_IOCTL
+
+MultDOS EQU 12h ; DOS call back
+ ; 1 DOS_CLOSE
+ ; 2 RECSET
+ ; 3 Get DOSGROUP
+ ; 4 PATHCHRCMP
+ ; 5 OUT
+ ; 6 NET_I24_ENTRY
+ ; 7 PLACEBUF
+ ; 8 FREE_SFT
+ ; 9 BUFWRITE
+ ; 10 SHARE_VIOLATION
+ ; 11 SHARE_ERROR
+ ; 12 SET_SFT_MODE
+ ; 13 DATE16
+ ; 14 Unused (was SETVISIT)
+ ; 15 SCANPLACE
+ ; 16 Unused (was SKIPVISIT)
+ ; 17 StrCpy
+ ; 18 StrLen
+ ; 19 Ucase
+ ; 20 POINTCOMP
+ ; 21 CHECKFLUSH
+ ; 22 SFFromSFN
+ ; 23 GetCDSFromDrv
+ ; 24 Get_User_Stack
+ ; 25 GetThisDrv
+ ; 26 DriveFromText
+ ; 27 SETYEAR
+ ; 28 DSUM
+ ; 29 DSLIDE
+ ; 30 StrCmp
+ ; 31 initcds
+ ; 32 pjfnfromhandle
+ ; 33 $NameTrans
+ ; 34 CAL_LK
+ ; 35 DEVNAME
+ ; 36 Idle
+ ; 37 DStrLen
+ ; 38 NLS_OPEN DOS 3.3
+ ; 39 $CLOSE DOS 3.3
+ ; 40 NLS_LSEEK DOS 3.3
+ ; 41 $READ DOS 3.3
+ ; 42 FastInit DOS 4.0
+ ; 43 NLS_IOCTL DOS 3.3
+ ; 44 GetDevList DOS 3.3
+ ; 45 NLS_GETEXT DOS 3.3
+ ; 46 MSG_RETRIEVAL DOS 4.0
+ ; 47 FAKE_VERSION DOS 4.0
+ ;
+NLSFUNC EQU 14h ; NLSFUNC CALL , DOS 3.3
+ ; 0 NLSInstall
+ ; 1 ChgCodePage
+ ; 2 GetExtInfo
+ ; 3 SetCodePage
+ ; 4 GetCntry
+ ;
+
+multANSI EQU 1Ah ; ANSI multiplex number
+ ; 0 INSTALL_CHECK ; install check for ANSI
+ ; 1 IOCTL_2F ; 2F interface to IOCTL
+ ; 2 DA_INFO_2F ; J.K. Information passing to ANSI.
+
+multMULT EQU 4ah
+ multMULTRPLTOM EQU 06h
+
+ ; 0 swap disk function for single floppy drive m/cs
+ ; BIOS broadcasts with cx==0, and apps who handle
+ ; swap disk messaging set cx == -1. BIOS sets dl == requested
+ ; drive
+ ;
+ ; 1 Get available HMA & pointer to it. Returns in BX & ES:DI
+ ; 2 Allocate HMA. BX == number of bytes in HMA to be allocated
+ ; returns pointer in ES:DI
+ ;
+ ; 3-4 currently used by nobody
+ ; 5 Switcher API
+ ; 6 Top of Memory for RPL.
+ ; BIOS issues INT 2f AX=4a06 & DX = Top of Mem and any RPL
+ ; code present in TOM should respond with a new TOM in DX
+ ; to protect itself from MSLOAD & SYSINIT tromping over it.
+ ; SYSINIT builds an arena with owner type 8 & name 'RPL' to
+ ; protect the RPL code from COMMAND.COM transient protion.
+ ; It is the responsibility of RPL program to release the mem.
+ ; 7 Reserved for PROTMAN support.
+
+MultAPM EQU 4ch
+ ; 00h APM_VER_CHK
+ ; 01h APM_SUS_SYS_REQ
+ ; FFh APM_SUS_RES_BATT_NOTIFY
+
+;FASTOPEN is not chained through INT 2F ; DOS 3.3 F.C.
+; it calls Multdos 42 to set up an entry routine address
+ ; 0 Install status (reserved)
+ ; 1 Lookup
+ ; 2 Insert
+ ; 3 Delete
+ ; 4 Purge (reserved)
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/oemnum.inc b/private/mvdm/dos/v86/inc/oemnum.inc
new file mode 100644
index 000000000..e2b763712
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/oemnum.inc
@@ -0,0 +1,17 @@
+; DOS OEM number assignments.
+; This file is for documentation purposes only. It lists the currently
+; assigned OEM numbers, for use with the DOS GetVersion call.
+;
+; Some numbers are assigned for use with Win/386 device ID numbers, and
+; are not true OEM numbers
+;
+; IBM DOS (00)
+; Compaq DOS (01)
+; MS Packaged Product (02)
+; AT&T DOS (04)
+; Zenith DOS (05)
+; HP DOS (06)
+; Olivetti DOS (23)
+; Novell (33) ; used for Win/386 device IDs only
+; MS Multimedia Systems (34) ; " " " " " "
+; " " " " (35) ; " " " " " "
diff --git a/private/mvdm/dos/v86/inc/origin.inc b/private/mvdm/dos/v86/inc/origin.inc
new file mode 100644
index 000000000..285225225
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/origin.inc
@@ -0,0 +1,78 @@
+;-------------------------------------------------------------------------
+;
+; FILE : ORIGIN.INC
+;
+; This is included in origin.asm and mshead.asm. Contains the equate that
+; is used for ORGing the DOS code.
+;
+; Brief Description of the necessacity of this ORG:
+; -------------------------------------------------
+;
+; A special problem exits when running out of the HMA. The HMA starts at
+; address FFFF:10. There is no place in the HMA with an offset of zero.
+; This means programs running out off the HMA must use non-zero offset base
+; addresses. It also means that if we're running multiple programs from the
+; HMA, the base offset of each segment must atleast be as big as all of the
+; HMA segments that precede it.
+;
+; One solution to this problem to ORG each module at 64K minus its size.
+; For instance a code segment 1234h bytes in length would org'd at edcbh.
+; This gives max. flexibility regarding it's location in the HMA. By
+; selecting segment values between f124h and ffffh it could be located
+; anywhere in the HMA. The problem with this is that programs with such
+; high ORGs would not be able to run in low RAM.
+;
+; A comporomise solution is to set the ORG address somewhere between 0010h
+; and ffffh - their size. In the particular case of the BIOS and the DOS
+; the folloowing solution has been implemented:
+;
+; The Bios Code segment will have a very small offset and run at the very
+; front of the HMA, after the VDISK header. THE Dos Code segment will have
+; a base offset of (700+<min. size off RAM based BIOS>+<min. size of the DOS
+; DATA segment when DOS is running low>). This will reflect the lowest
+; possible physical address at which DOS code will run, while still providing
+; max. possible flexibility in HMA positioning. This offset MUST NOT be
+; smaller then that 20+size of Bios Code segment when running high. This is
+; mostly true.
+;
+; Also this ORG'd value must be communicated to the BIOS. This is done by
+; putting this value after the first jmp instruction in the DOS code in
+; mshead.asm.
+;
+; In order for the stripz utility to know how many zeroes to be stripped
+; out, this value is placed at the beginning of the binary in origin.asm.
+;
+; Revision History:
+;
+; Currently this is being done manually. Therefore any change in the DOS DATA
+; Size or the BIOS size should be reflected here. --- Feb 90
+;
+; BDSIZE.INC contains the equates for BIODATASIZE, BIOCODESIZ and DOSDATASIZ.
+; A utility called getsize will obtain the corresponding values from msdos
+; and msbio.map and update the values in BDSIZ.INC if they are different.
+; DOS should now be built using the batch file makedos.bat which invokes this
+; utility. The FORMAT of BDSIZE.INC should not be changed as getsize is
+; dependant on that. --- Apr 3 '90
+;
+; For ROMDOS, however, there is no need to org the doscode to any location
+; other than zero. Therefore the stripz utility will not need to be used,
+; so the offset will not need to be included at the beginning of the code
+; segment. Also, the BIOS can just assume that the resident code begins
+; at offset zero within the segment.
+;
+;
+;--------------------------------------------------------------------------
+
+;
+
+BIODATASTART EQU 00700h
+include bdsize.inc ; this sets the values:
+ ; BIODATASIZ
+ ; BIOCODESIZ
+ ; DOSDATASIZ
+
+
+BYTSTART EQU BIODATASTART+BIODATASIZ+BIOCODESIZ+DOSDATASIZ
+PARASTART EQU ((BYTSTART + 0FH) AND (NOT 0FH)) - 40h
+
+
diff --git a/private/mvdm/dos/v86/inc/parse.asm b/private/mvdm/dos/v86/inc/parse.asm
new file mode 100644
index 000000000..c7f6fa076
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/parse.asm
@@ -0,0 +1,3013 @@
+ PAGE ;AN000;
+; $SALUT (4,4,8,41)
+;(deleted).XLIST
+;(deleted)INCLUDE STRUC.INC ;AN020;structured macro definitions for .IF,.ELSE etc.
+;(deleted).LIST
+;
+;Revision History
+;================
+;
+; M029 02/15/91 SR Bug #5699. In SysParse, reinitialize $P_FileSp_Char
+; everytime because this is in the non-checksum region
+; and can get corrupted without the checksum region
+; getting corrupted. Yet another data structure that
+; should have been in the checksum region but isnt.
+;
+
+
+;
+; NOTE: basesw must be set properly to allow the PARSER to access psdata.
+; - basesw undefined means CS seg. override for psdata access.
+; - basesw = 1 means DS seg. override for psdata access &
+; DS must point to psdata.
+; - basesw = 0 means ES seg. override for psdata access &
+; ES must point to psdata.
+;
+;
+IFNDEF basesw ;AN022;
+ psdata_seg EQU CS ;AN022;
+ELSE ;AN022;
+ IF basesw ;AN022;IF "basesw EQU 1" specified by caller THEN
+ psdata_seg EQU DS ;AN022;
+ ELSE ;AN022;
+ psdata_seg EQU ES ;AN022;ELSE only other choice is ES (basesw EQU 0)
+ ENDIF ;AN022;
+ENDIF ;AN022;
+
+ifndef incsw ;AN000; (tm03) Someone doesn't want to include psdata
+ incsw equ 1 ;AN000; include psdata.inc (tm03)
+endif ;AN000; (tm03)
+if incsw ;AN000; If incsw = 1 then (tm03)
+ include psdata.inc ;AN000; include psdata.inc (tm03)
+endif ;AN000; endif (tm03)
+ PAGE ;AN000;
+IF1 ;AN000;
+; %OUT INCLUDING COMP=COMMON DSN=PARSE.ASM...;AN000;
+ENDIF ;AN000;
+;***********************************************************************
+; SysParse;
+;
+; Function : Parser Entry
+;
+; Input: DS:SI -> command line
+; ES:DI -> parameter block
+; psdata_seg -> psdata.inc
+; CX = operand ordinal
+;
+; Note: ES is the segment containing all the control blocks defined
+; by the caller, except for the DOS COMMAND line parms, which
+; is in DS.
+;
+; Output: CY = 1 error of caller, means invalid parameter block or
+; invalid value list. But this parser does NOT implement
+; this feature. Therefore CY always zero.
+;
+; CY = 0 AX = return code
+; BL = terminated delimiter code
+; CX = new operand ordinal
+; SI = set past scaned operand
+; DX = selected result buffer
+;
+; Use: $P_Skip_Delim, $P_Chk_EOL, $P_Chk_Delim, $P_Chk_DBCS
+; $P_Chk_Swtch, $P_Chk_Pos_Control, $P_Chk_Key_Control
+; $P_Chk_Sw_Control, $P_Fill_Result
+;
+; Vars: $P_Ordinal(RW), $P_RC(RW), $P_SI_Save(RW), $P_DX(R), $P_Terminator(R)
+; $P_SaveSI_Cmpx(W), $P_Flags(RW), $P_Found_SYNONYM(R), $P_Save_EOB(W)
+;
+;-------- Modification History -----------------------------------------
+;
+; 4/04/87 : Created by K. K,
+; 4/28/87 : $P_Val_YH assemble error (tm01)
+; : JMP SHORT assemble error (tm02)
+; 5/14/87 : Someone doesn't want to include psdata (tm03)
+; 6/12/87 : $P_Bridge is missing when TimeSw equ 0 and (CmpxSw equ 1 or
+; DateSW equ 1) (tm04)
+; 6/12/87 : $P_SorD_Quote is missing when QusSw equ 0 and CmpxSW equ 1
+; (tm05) in PSDATA.INC
+; 6/12/87 : $P_FileSp_Char and $P_FileSP_Len are missing
+; when FileSW equ 0 and DrvSW equ 1 (tm06) in PSDATA.INC
+; 6/18/87 : $VAL1 and $VAL3, $VAL2 and $VAL3 can be used in the same
+; value-list block (tm07)
+; 6/20/87 : Add $P_SW to check if there's an omiting parameter after
+; switch (keyword) or not. If there is, backup si for next call
+; (tm08)
+; 6/24/87 : Complex Item checking does not work correctly when CmpSW equ 1
+; and DateSW equ 0 and TimeSW equ 0 (tm09)
+; 6/24/87 : New function flag $P_colon_is_not_necessary for switch
+; /+15 and /+:15 are allowed for user (tm10)
+; 6/29/87 : ECS call changes DS register but it causes the address problem
+; in user's routines. $P_Chk_DBCS (tm11)
+; 7/10/87 : Switch with no_match flag (0x0000H) does not work correctly
+; (tm12)
+; 7/10/87 : Invalid switch/keyword does not work correctly
+; (tm13)
+; 7/10/87 : Drive_only breaks 3 bytes after the result buffer
+; (tm14)
+; 7/12/87 : Too_Many_Operands sets DX=0 as the PARSE result
+; (tm15)
+; 7/24/87 : Negative lower bound on numeric ranges cause trouble
+
+; 7/24/87 : Quoted strings being returned with quotes.
+
+; 7/28/87 : Kerry S (;AN018;)
+; Non optional value on switch (match flags<>0 and <>1) not flagged
+; as an error when missing. Solution: return error 2. Modules
+; affected: $P_Chk_SW_Control.
+
+; 7/29/87 : Kerry S (;AN019;)
+; Now allow the optional bit in match flags for switches. This
+; allows the switch to be encountered with a value or without a
+; value and no error is returned.
+;
+
+; 8/28/87 : Ed K, Kerry S (;AN020;)
+; 9/14/87 In PROC $P_Get_DecNum, when checking for field separators
+; within a date response, instead of checking just for the one
+; character defined by the COUNTRY DEPENDENT INFO, check for
+; all three chars, "-", "/", and ".". Change $P_Chk_Switch to allow
+; slashes in date strings when DateSw (assembler switch) is set.
+
+; 9/1/87 : Kerry S (;AN021)
+; In PROC $P_String_Comp, when comparing the switch or keyword on
+; the command line with the string in the control block the
+; comparing was stopping at a colon (switch) or equal (keyword)
+; on the command line and assuming a match. This allowed a shorter
+; string on the command line than in the synonym list in the control
+; block. I put in a test for a null in the control block so the
+; string in the control block must be the same length as the string
+; preceeding the colon or equal on the command line.
+
+; 8/28/87 : Kerry S (;AN022;)
+; All references to data in PSDATA.INC had CS overrides. This caused
+; problems for people who included it themselves in a segment other
+; than CS. Added switch to allow including PSDATA.INC in any
+; segment.
+
+; 9/16/87 : Ed K (;AN023;) PTM1040
+; in $p_set_cdi PROC, it assumes CS points to psdata. Change Push CS
+; into PUSH PSDATA_SEG. In $P_Get_DecNum PROC, fix AN020
+; forced both TIME and DATE to use the delims, "-","/",".".
+; Created FLag, in $P_time_Format PROC, to request the delim in
+; BL be used if TIME is being parsed.
+
+; 9/24/87 : Ed K
+; Removed the include to STRUC.INC. Replaced the STRUC macro
+; invocations with their normally expanded code; made comments
+; out of the STRUC macro invocation statements to maintain readability.
+
+; 9/24/87 : Ed K (;AN024;) PTM1222
+; When no CONTROL for a keyword found, tried to fill in RESULT
+; pointed to by non-existant CONTROL.
+
+; 10/15/87 : Ed K (;AN025;) PTM1672
+; A quoted text string can be framed only by double quote. Remove
+; support to frame quoted text string with single quote.
+; (apostrophe) $P_SorD_Quote is removed from PSDATA.INC.
+; $P_SQuote EQU also removed from PSDATA.INC. Any references to
+; single quote in PROC prologues are left as is for history reasons.
+
+; This fixes another bug, not mentioned in p1672, in that two
+; quote chars within a quoted string is supposed to be reported as
+; one quote character, but is reported as two quotes. This changed
+; two instructions in PROC $P_Quoted_Str.
+
+; Also fixed are several JMP that caused a NOP, these changed to
+; have the SHORT operator to avoid the unneeded NOP.
+
+; The code and PSDATA.INC have been aligned for ease of reading.
+
+; 10/26/87 : Ed K (;AN026;) PTM2041, DATE within SWITCH, BX reference to
+; psdata buffer should have psdata_seg.
+
+; 10/27/87 : Ed K (;AN027;) PTM2042 comma between keywords implies
+; positional missing.
+
+; 11/06/87 : Ed K (;AN028;) PTM 2315 Parser should not use line feed
+; as a line delimiter, should use carriage return.
+; Define switch: LFEOLSW, if on, accept LF as end of line char.
+
+; 11/11/87 : Ed K (;AN029;) PTM 1651 GET RID OF WHITESPACE AROUND "=".
+
+; 11/18/87 : Ed K (;AN030;) PTM 2551 If filename is just "", then
+; endless loop since SI is returned still pointing to start
+; of that parm.
+
+; 11/19/87 : Ed K (;AN031;) PTM 2585 date & time getting bad values.
+; Vector to returned string has CS instead of Psdata_Seg, but
+; when tried to fix it on previous version, changed similar
+; but wrong place.
+
+; 12/09/87 : Bill L (;AN032;) PTM 2772 colon and period are now valid
+; delimiters between hours, minutes, seconds for time. And period
+; and comma are valid delimiters between seconds and 100th second.
+
+; 12/14/87 : Bill L (;AN033;) PTM 2722 if illegal delimiter characters
+; in a filespec, then flag an error.
+
+; 12/22/87 : Bill L (;AN034;) All local data to parser is now
+; indexed off of the psdata_seg equate instead of the DS register.
+; Using this method, DS can point to the segment of PSP or to psdata
+; --> local parser data. Why were some references to local data changed
+; to do this before, but not all ?????
+
+; 02/02/88 : Ed K (;AC035;) INSPECT utility, suggests optimizations.
+
+; 02/05/88 : Ed K (;AN036;) P3372-UPPERCASE TRANSLATION, PSDATA_SEG HOSED.
+;
+; 02/08/88 : Ed K (;AN037;) P3410-AVOID POP OF CS, CHECK BASESW FIRST.
+
+; 02/19/88 : Ed K (;AN038;) p3524 above noon and "am" should be error
+
+; 02/23/88 : Ed K (;AN039;) p3518 accept "comma" and "period" as decimal
+; separator in TIME before hundredths field.
+;
+; 08/09/90 : SA M005 Prevented parser from recognizing '=' signs within
+; strings as keywords.
+;
+;***********************************************************************
+IF FarSW ;AN000;(Check if need far return)
+SysParse proc far ;AN000;
+ELSE ;AN000;
+SysParse proc near ;AN000;
+ENDIF ;AN000;(of FarSW)
+; $SALUT (4,9,17,41)
+ mov psdata_seg:$P_Flags,0 ;AC034; Clear all internal flags
+IF TimeSw ;AN039; FOR TIME ONLY
+ MOV PSDATA_SEG:$P_ORIG_ORD,CX ;AN039; ORIGINAL ORDINAL FROM CX
+ MOV PSDATA_SEG:$P_ORIG_STACK,SP ;AN039; ORIGINAL VALUE OF STACK FROM SP
+ MOV PSDATA_SEG:$P_ORIG_SI,SI ;AN039; ORIGINAL START PARSE POINTER FROM SI
+$P_REDO_TIME: ;AN039; try to parse time again
+ENDIF ;AN039; FOR TIME ONLY
+ cld ;AN000; confirm forward direction
+ mov psdata_seg:$P_ordinal,cx ;AC034; save operand ordinal
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; Assume no error
+ mov psdata_seg:$P_Found_SYNONYM,0 ;AC034; initalize synonym pointer
+
+ mov word ptr psdata_seg:$P_DX,0 ;AC034; (tm15)
+
+;M029 -- Begin changes
+; The table of special chars $P_FileSp_Char should be initialized on every
+;entry to SysParse. This is in the non-checksum region and any program that
+;corrupts this table but does not corrupt the checksum region will leave
+;command.com parsing in an inconsistent state.
+; NB: The special characters string has been hardcoded here. If any change
+;is made to it in psdata.inc, a corresponding change needs to be made here.
+;
+IF FileSW + DrvSW
+
+ mov word ptr psdata_seg:$P_FileSp_Char, ']['
+ mov word ptr psdata_seg:$P_FileSp_Char+2, '<|'
+ mov word ptr psdata_seg:$P_FileSp_Char+4, '+>'
+ mov word ptr psdata_seg:$P_FileSp_Char+6, ';='
+
+ENDIF
+;
+;M029 -- End of changes
+;
+
+IF KeySW ;AN029;
+;IN CASE THE USER PUT OPTIONAL WHITESPACE CHARS AROUND THE "=" USED IN
+;KEYWORD DEFINITIONS, SCAN THE COMMAND LINE AND COMPRESS OUT ANY WHITESPACES
+;NEXT TO "=" BEFORE STARTING THE USUAL PARSING.
+ push cx ;AN029;
+ push dx ;AN029;
+ push di ;AN029;
+
+ push si ;AN029; remember where command line starts
+ mov cx,-1 ;AN029; init counter
+; $do
+$P_loc_eol: ;AN029;
+ inc cx ;AN029; bump counter of chars up to EOL
+ lodsb ;AN029; get a char from command line
+ CALL $P_Chk_EOL ;AN029; see if AL is EOL char
+
+; enddo z
+ jnz $P_loc_EOL ;AN029; not found that EOL char
+
+ mov psdata_seg:$P_count_to_EOL,cx ;AN029;AC034;; save count of chars up to EOL
+ pop si ;AN029; restore start of command line
+
+;scan command string for combinations including "=",
+; and replace each with just the simple "="
+
+;REPEAT UNTIL ONE PASS IS MADE WHEREIN NO CHANGES WERE MADE
+; $do
+$P_DO1: ;AN029;
+ push si ;AN029; remember where string started
+ MOV CX,psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;; set count to no. chars in string,
+ ;AN029; not counting the EOL char
+ XOR BX,BX ;AN029;SET $P_REG_BL_DQ_SW TO "NOT IN QUOTES", AND...
+ ;AN029;SET $P_REG_BH_CG_SW TO "NO CHANGES MADE"
+;MAKE ONE PASS THRU THE STRING, LOOKING AT EACH CHARACTER
+; $do ;AN029;
+$P_DO2: ;AN029;
+ cmp BYTE PTR [SI],$P_double_quote ;AN029;
+; $if e ;AN029;if a double quote was found
+ JNE $P_IF3 ;AN029;
+ NOT $P_REG_BL_DQ_SW ;AN029;TOGGLE THE DOUBLE QUOTE STATE SWITCH
+; $endif ;AN029;
+$P_IF3: ;AN029;
+ OR $P_REG_BL_DQ_SW,$P_REG_BL_DQ_SW ;AN029;IS THE DOUBLE QUOTE SWITCH SET?
+; $if Z ;AN029;IF NOT IN DOUBLE QUOTES
+ JNZ $P_IF5 ;AN029;
+ mov ax,word ptr [si] ;AN029; get pair to be checked out
+ cmp ax,$P_BL_EQ ;AN029;" ="
+; $if e,or ;AN029;
+ JE $P_LL6 ;AN029;
+ cmp ax,$P_EQ_BL ;AN029;"= "
+; $if e,or ;AN029;
+ JE $P_LL6 ;AN029;
+ cmp ax,$P_EQ_TB ;AN029; "=<tab>"
+; $if e,or ;AN029;
+ JE $P_LL6 ;AN029;
+ cmp ax,$P_TB_EQ ;AN029;"<tab>="
+; $if e ;AN029;if this pair to be replaced with a single "="
+ JNE $P_IF6 ;AN029;
+$P_LL6: ;AN029;
+ mov BYTE PTR [SI],$P_Keyword ;AN029; "="
+ inc si ;AN029;point to next char after the new "="
+ mov di,si ;AN029;move target right after new "="
+
+ push si ;AN029;remember where i am, right after new "="
+ PUSH CX ;AN029;SAVE CURRENT COUNT
+ inc si ;AN029;source is one beyond that
+ push es ;AN029;remember the extra segment
+ push ds ;AN029;temporarily, set source seg and
+ pop es ;AN029; target seg to the command line seg
+ rep movsb ;AN029;move chars left one position
+ pop es ;AN029;restore the extra segment
+ POP CX ;AN029;RESTORE CURRENT COUNT
+ pop si ;AN029;back to where I was
+
+ DEC SI ;AN029;LOOK AT FIRST CHAR JUST MOVED
+ MOV $P_REG_BH_CG_SW,-1 ;AN029;set switch to say "a change was made"
+ DEC psdata_seg:$P_COUNT_TO_EOL ;AN029;AC034;;because just threw away a char
+ dec CX ;AN029;DITTO
+; $endif ;AN029;comparand pair found?
+$P_IF6: ;AN029;
+; $endif ;AN029;double quote switch?
+$P_IF5: ;AN029;
+ inc si ;AN029;bump index to look at next char in command string
+ dec CX ;AN029;one less char to look at
+;(deleted ;AC035;) CMP CX,0 ;AN029;is char count all gone yet?
+; $enddo LE ;AN029;quit if no more chars
+ JNLE $P_DO2 ;AN029;
+ pop si ;AN029;remember where string started
+ OR $P_REG_BH_CG_SW,$P_REG_BH_CG_SW ;AN029;WAS "A CHANGE MADE"?
+; $enddo Z ;AN029;QUIT when no changes were made
+ JNZ $P_DO1 ;AN029;
+ pop di ;AN029;
+ pop dx ;AN029;
+ pop cx ;AN029;
+
+;NOW THAT ALL WHITESPACE SURROUNDING "=" HAVE BEEN COMPRESSED OUT,
+;RESUME NORMAL PARSING...
+ENDIF ;AN029; KEYWORDS SUPPORTED?
+ call $P_Skip_Delim ;AN000; Move si to 1st non white space
+ jnc $P_Start ;AN000; If EOL is not encountered, do parse
+
+;--------------------------- End of Line
+ mov ax,$P_RC_EOL ;AN000; set exit code to -1
+ push bx ;AN000;
+ mov bx,es:[di].$P_PARMSX_Address ;AN000; Get the PARMSX address to
+ cmp cl,es:[bx].$P_MinP ;AN000; check ORDINAL to see if the minimum
+ jae $P_Fin ;AN000; positional found.
+
+ mov ax,$P_Op_Missing ;AN000; If no, set exit code to missing operand
+$P_Fin: ;AN000;
+ pop bx ;AN000;
+ jmp $P_Single_Exit ;AN000; return to the caller
+
+;---------------------------
+$P_Start: ;AN000;
+ mov psdata_seg:$P_SaveSI_Cmpx,si ;AN000;AC034; save ptr to command line for later use by complex,
+ push bx ;AN000; quoted string or file spec.
+ push di ;AN000;
+ push bp ;AN000;
+ lea bx,psdata_seg:$P_STRING_BUF ;AC034; set buffer to copy from command string
+ test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 extra delimiter encountered ?
+ jne $P_Pack_End ;AN000; 3/9 if yes, no need to copy
+
+$P_Pack_Loop: ;AN000;
+ lodsb ;AN000; Pick a operand from buffer
+ call $P_Chk_Switch ;AN000; Check switch character
+ jc $P_Pack_End_BY_EOL ;AN020; if carry set found delimiter type slash, need backup si, else continue
+
+ call $P_Chk_EOL ;AN000; Check EOL character
+ je $P_Pack_End_BY_EOL ;AN000; need backup si
+
+ call $P_Chk_Delim ;AN000; Check delimiter
+ jne $P_PL01 ;AN000; If no, process next byte
+
+ test psdata_seg:$P_Flags2,$P_Extra ;AC034; 3/9 If yes and white spec,
+; (tm08)jne $P_Pack_End ;AN000; 3/9 then
+ jne $P_Pack_End_backup_si ;AN000; (tm08)
+
+ call $P_Skip_Delim ;AN000; skip subsequent white space,too
+ jmp short $P_Pack_End ;AN000; finish copy by placing NUL at end
+
+$P_PAck_End_backup_si: ;AN000; (tm08)
+ test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AN000;AC034; (tm08)
+ je $P_Pack_End ;AN000; (tm08)
+
+ dec si ;AN000; (tm08)
+ jmp short $P_Pack_End ;AN025; (tm08)
+
+$P_PL01: ;AN000;
+ mov psdata_seg:[bx],al ;AN000; move byte to STRING_BUF
+ cmp al,$P_Keyword ;AN000; if it is equal character,
+ jne $P_PL00 ;AN000; then
+
+ or psdata_seg:$P_Flags2,$P_equ ;AC034; remember it in flag
+$P_PL00: ;AN000;
+ inc bx ;AN000; ready to see next byte
+ call $P_Chk_DBCS ;AN000; was it 1st byte of DBCS ?
+ jnc $P_Pack_Loop ;AN000; if no, process to next byte
+
+ lodsb ;AN000; if yes, store
+ mov psdata_seg:[bx],al ;AN000; 2nd byte of DBCS
+ inc bx ;AN000; update pointer
+ jmp short $P_Pack_Loop ;AN000; process to next byte
+
+$P_Pack_End_BY_EOL: ;AN000;
+ dec si ;AN000; backup si pointer
+$P_Pack_End: ;AN000;
+ mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
+ mov byte ptr psdata_seg:[bx],$P_NULL ;AN000; put NULL at the end
+ mov psdata_seg:$P_Save_EOB,bx ;AC034; 3/17/87 keep the address for later use of complex
+ mov bx,es:[di].$P_PARMSX_Address ;AN000; get PARMSX address
+ lea si,psdata_seg:$P_STRING_BUF ;AC034;
+ cmp byte ptr psdata_seg:[si],$P_Switch ;AN000; the operand begins w/ switch char ?
+ je $P_SW_Manager ;AN000; if yes, process as switch
+
+ cmp byte ptr psdata_seg:[si],$P_DQuote ;M005;is it a string?
+ je $P_Positional_Manager ;M005;if so, process as one!
+
+ test psdata_seg:$P_Flags2,$P_equ ;AC034; the operand includes equal char ?
+ jne $P_Key_manager ;AN000; if yes, process as keyword
+
+$P_Positional_Manager: ;AN000; else process as positional
+ mov al,es:[bx].$P_MaxP ;AN000; get maxp
+ xor ah,ah ;AN000; ax = maxp
+ cmp psdata_seg:$P_ORDINAL,ax ;AC034; too many positional ?
+ jae $P_Too_Many_Error ;AN000; if yes, set exit code to too many
+
+ mov ax,psdata_seg:$P_ORDINAL ;AC034; see what the current ordinal
+ shl ax,1 ;AN000; ax = ax*2
+ inc bx ;AC035; add '2' to
+ inc bx ;AC035; BX reg
+ ;AN000; now bx points to 1st CONTROL
+;(changed ;AC035;) add bx,2 ;AN000; now bx points to 1st CONTROL
+ add bx,ax ;AN000; now bx points to specified CONTROL address
+ mov bx,es:[bx] ;AN000; now bx points to specified CONTROL itself
+ call $P_Chk_Pos_Control ;AN000; Do process for positional
+ jmp short $P_Return_to_Caller ;AN000; and return to the caller
+
+$P_Too_Many_Error: ;AN000;
+ mov psdata_seg:$P_RC,$P_Too_Many ;AC034; set exit code
+ jmp short $P_Return_to_Caller ;AN000; and return to the caller
+;
+$P_SW_Manager: ;AN000;
+ mov al,es:[bx].$P_MaxP ;AN000; get maxp
+ xor ah,ah ;AN000; ax = maxp
+ inc ax ;AN000;
+ shl ax,1 ;AN000; ax = (ax+1)*2
+ add bx,ax ;AN000; now bx points to maxs
+ mov cl,es:[bx] ;AN000;
+ xor ch,ch ;AN000; cx = maxs
+ or cx,cx ;AN000; at least one switch ?
+ je $P_SW_Not_Found ;AN000;
+
+ inc bx ;AN000; now bx points to 1st CONTROL address
+
+$P_SW_Mgr_Loop: ;AN000;
+ push bx ;AN000;
+ mov bx,es:[bx] ;AN000; bx points to Switch CONTROL itself
+ call $P_Chk_SW_Control ;AN000; do process for switch
+ pop bx ;AN000;
+ jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the switch, exit
+
+ inc bx ;AC035; add '2' to
+ inc bx ;AC035; BX reg
+ ;AN000; else bx points to the next CONTROL
+;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL
+ loop $P_SW_Mgr_Loop ;AN000; and loop
+
+$P_SW_Not_Found: ;AN000;
+ mov psdata_seg:$P_RC,$P_Not_In_SW ;AC034; here no CONTROL for the switch has
+ jmp short $P_Return_to_Caller0 ;AN000; not been found, means error.
+;
+$P_Key_Manager: ;AN000;
+ mov al,es:[bx].$P_MaxP ;AN000; get maxp
+ xor ah,ah ;AN000; ax = maxp
+ inc ax ;AN000;
+ shl ax,1 ;AN000; ax = (ax+1)*2
+ add bx,ax ;AN000; now bx points to maxs
+ mov al,es:[bx] ;AN000;
+ xor ah,ah ;AN000; ax = maxs
+ shl ax,1 ;AN000;
+ inc ax ;AN000; ax = ax*2+1
+ add bx,ax ;AN000; now bx points to maxk
+ mov cl,es:[bx] ;AN000;
+ xor ch,ch ;AN000; cx = maxk
+ or cx,cx ;AN000; at least one keyword ?
+ je $P_Key_Not_Found ;AN000;
+
+ inc bx ;AN000; now bx points to 1st CONTROL
+
+$P_Key_Mgr_Loop: ;AN000;
+ push bx ;AN000;
+ mov bx,es:[bx] ;AN000; bx points to keyword CONTROL itself
+ call $P_Chk_Key_Control ;AN000; do process for keyword
+ pop bx ;AN000;
+ jnc $P_Return_to_Caller ;AN000; if the CONTROL is for the keyword, exit
+
+ inc bx ;AC035; add '2' to
+ inc bx ;AC035; BX reg
+ ;AN000; else bx points to the next CONTROL
+;(changed ;AC035;) add bx,2 ;AN000; else bx points to the next CONTROL
+ loop $P_Key_Mgr_Loop ;AN000; and loop
+
+$P_Key_Not_Found: ;AN000;
+ mov psdata_seg:$P_RC,$P_Not_In_Key ;AC034; here no CONTROL for the keyword has
+$P_Return_to_Caller0: ;AN000; not been found, means error.
+
+;(deleted ;AN024;) mov bx,es:[bx-2] ;AN000; (tm13) backup bx
+
+;(deleted ;AN024;) mov al,$P_String ;AN000; Set
+;(deleted ;AN024;) mov ah,$P_No_Tag ;AN000; result
+;(deleted ;AN024;) call $P_Fill_Result ;AN000; buffer
+
+$P_Return_to_Caller: ;AN000;
+ pop bp ;AN000;
+ pop di ;AN000;
+ pop bx ;AN000;
+ mov cx,psdata_seg:$P_Ordinal ;AC034; return next ordinal
+ mov ax,psdata_seg:$P_RC ;AC034; return exit code
+ mov si,psdata_seg:$P_SI_Save ;AC034; return next operand pointer
+ mov dx,psdata_seg:$P_DX ;AC034; return result buffer address
+ mov bl,psdata_seg:$P_Terminator ;AC034; return delimiter code found
+$P_Single_Exit: ;AN000;
+ clc ;AN000;
+ ret ;AN000;
+SysParse endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_Pos_Control
+;
+; Function: Parse CONTROL block for a positional
+;
+; Input: ES:BX -> CONTROL block
+; psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Check_Match_Flags
+;
+; Vars: $P_Ordinal(W), $P_RC(W)
+;***********************************************************************
+$P_Chk_Pos_Control proc ;AN000;
+ push ax ;AN000;
+ mov ax,es:[bx].$P_Match_Flag ;AN000;
+ test ax,$P_Repeat ;AN000; repeat allowed ?
+ jne $P_CPC00 ;AN000; then do not increment ORDINAL
+
+ inc psdata_seg:$P_ORDINAL ;AC034; update the ordinal
+$P_CPC00: ;AN000;
+ cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; no data ?
+ jne $P_CPC01 ;AN000;
+
+ test ax,$P_Optional ;AN000; yes, then is it optional ?
+ jne $P_CPC02 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; no, then error 3/17/87
+ jmp short $P_CPC_Exit ;AN000;
+
+$P_CPC02: ;AN000;
+ push ax ;AN000;
+ mov al,$P_String ;AN000; if it is optional return NULL
+ mov ah,$P_No_Tag ;AN000; no item tag indication
+ call $P_Fill_Result ;AN000;
+ pop ax ;AN000;
+ jmp short $P_CPC_Exit ;AN000;
+
+$P_CPC01: ;AN000;
+ call $P_Check_Match_Flags ;AN000;
+$P_CPC_Exit: ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Chk_Pos_Control endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_Key_Control
+;
+; Function: Parse CONTROL block for a keyword
+;
+; Input: ES:BX -> CONTROL block
+; psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: CY = 1 : not match
+;
+; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags
+;
+; Vars: $P_RC(W), $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W)
+;***********************************************************************
+$P_Chk_Key_Control proc ;AN000;
+IF KeySW ;AN000;(Check if keyword is supported)
+ or psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; Indicate keyword for later string comparison
+ call $P_Search_KEYorSW ;AN000; Search the keyword in the CONTROL block
+ jc $P_Chk_Key_Err0 ;AN000; not found, then try next CONTROL
+
+ and psdata_seg:$P_Flags2,0ffh-$P_Key_Cmp ;AC034; reset the indicator previously set
+;
+ push ax ;AN000; keyword=
+ mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^
+ sub ax,si ;AN000; SI KEYorSW
+ add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex, quoted or file spec.
+ pop ax ;AN000;
+;
+ mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si just after equal char
+ cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after equal ?
+ je $P_Chk_Key_Err1 ;AN000; if no, syntax error
+
+ call $P_Check_Match_Flags ;AN000; else, process match flags
+ clc ;AN000;
+ jmp short $P_Chk_Key_Exit ;AN000;
+
+$P_Chk_Key_Err0: ;AN000;
+ stc ;AN000; not found in keyword synonym list
+ jmp short $P_Chk_Key_Exit ;AN000;
+
+$P_Chk_Key_Err1: ;AN000;
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; no parameter is not specified after "="
+$P_Chk_Key_ErrExit: ;AN000;
+ push ax ;AN000;
+ mov al,$P_String ;AN000; set
+ mov ah,$P_No_Tag ;AN000; result
+ call $P_Fill_Result ;AN000; buffer
+ pop ax ;AN000;
+ clc ;AN000;
+$P_Chk_Key_Exit: ;AN000;
+ ret ;AN000;
+ELSE ;AN000;(of IF KeySW)
+ stc ;AN000;this logic works when the KeySW
+ ret ;AN000;is reset.
+ENDIF ;AN000;(of KeySW)
+$P_Chk_Key_Control endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported)
+; $P_Search_KEYorSW:
+;
+; Function: Seach specified keyword or switch from CONTROL
+;
+; Input: ES:BX -> CONTROL block
+; psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: CY = 1 : not match
+;
+; Use: $P_String_Comp, $P_MoveBP_NUL, $P_Found_SYNONYM
+;***********************************************************************
+$P_Search_KEYorSW proc ;AN000;
+ push bp ;AN000;
+ push cx ;AN000;
+ mov cl,es:[bx].$P_nid ;AN000; Get synonym count
+ xor ch,ch ;AN000; and set it to cx
+ or cx,cx ;AN000; No synonyms specified ?
+ je $P_KEYorSW_Not_Found ;AN000; then indicate not found by CY
+
+ lea bp,es:[bx].$P_KEYorSW ;AN000; BP points to the 1st synonym
+$P_KEYorSW_Loop: ;AN000;
+ call $P_String_Comp ;AN000; compare string in buffer w/ the synonym
+ jnc $P_KEYorSW_Found ;AN000; If match, set it to synonym pointer
+
+ call $P_MoveBP_NUL ;AN000; else, bp points to the next string
+ loop $P_KEYorSW_Loop ;AN000; loop nid times
+$P_KEYorSW_Not_Found: ;AN000;
+ stc ;AN000; indicate not found in synonym list
+ jmp short $P_KEYorSW_Exit ;AN000; and exit
+
+$P_KEYorSW_Found: ;AN000;
+ mov psdata_seg:$P_Found_SYNONYM,bp ;AC034; set synonym pointer
+ clc ;AN000; indicate found
+$P_KEYorSW_Exit: ;AN000;
+ pop cx ;AN000;
+ pop bp ;AN000;
+ ret ;AN000;
+$P_Search_KEYorSW endp ;AN000;
+;***********************************************************************
+; $P_MoveBP_NUL
+;***********************************************************************
+$P_MoveBP_NUL proc ;AN000;
+$P_MBP_Loop: ;AN000;
+ cmp byte ptr es:[bp],$P_NULL ;AN000; Increment BP that points
+ je $P_MBP_Exit ;AN000; to the synomym list
+
+ inc bp ;AN000; until
+ jmp short $P_MBP_Loop ;AN000; NULL encountered.
+
+$P_MBP_Exit: ;AN000;
+ inc bp ;AN000; bp points to next to NULL
+ ret ;AN000;
+$P_MoveBP_NUL endp ;AN000;
+ENDIF ;AN000;(of KeySW+SwSW)
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_SW_Control
+;
+; Function: Parse CONTROL block for a switch
+;
+; Input: ES:BX -> CONTROL block
+; psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: CY = 1 : not match
+;
+; Use: $P_Fill_Result, $P_Search_KEYorSW, $P_Check_Match_Flags
+;
+; Vars: $P_SaveSI_Cmpx(W), $P_KEYorSW_Ptr(R), $P_Flags(W)
+;***********************************************************************
+$P_Chk_SW_Control proc ;AN000;
+
+
+IF SwSW ;AN000;(Check if switch is supported)
+ or psdata_seg:$P_Flags2,$P_Sw_Cmp ;AC034; Indicate switch for later string comparison
+ call $P_Search_KEYorSW ;AN000; Search the switch in the CONTROL block
+ jc $P_Chk_SW_Err0 ;AN000; not found, then try next CONTROL
+
+ and psdata_seg:$P_Flags2,0ffh-$P_Sw_Cmp ;AC034; reset the indicator previously set
+;
+ push ax ;AN000; /switch:
+ mov ax,psdata_seg:$P_KEYorSW_Ptr ;AC034; ^ ^
+ sub ax,si ;AN000; SI KEYorSW
+ add psdata_seg:$P_SaveSI_Cmpx,ax ;AC034; update for complex list
+ pop ax ;AN000;
+;
+ mov si,psdata_seg:$P_KEYorSW_Ptr ;AC034; set si at the end or colon
+ cmp byte ptr psdata_seg:[si],$P_NULL ;AN000; any data after colon
+ jne $P_CSW00 ;AN000; if yes, process match flags
+
+ cmp byte ptr psdata_seg:[si-1],$P_Colon ;AN000; if no, the switch terminated by colon ?
+ jne $P_Chk_if_data_required ;AN000; if yes,
+
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error
+ jmp short $P_Chk_SW_Exit ;AN000;
+
+$P_Chk_if_data_required: ;AN018; no data, no colon
+ cmp es:[bx].$P_Match_Flag,0 ;AN018; should have data? zero match flag means switch followed by nothing is OK
+ je $P_Chk_SW_Exit ;AN018; match flags not zero so should have something if optional bit is not on
+
+ test es:[bx].$P_Match_Flag,$P_Optional ;AN019; see if no value is valid
+ jnz $P_Chk_SW_Exit ;AN019; if so, then leave, else yell
+
+ mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; return required operand missing
+ jmp short $P_Chk_SW_Exit ;AN018;
+
+$P_CSW00: ;AN000;
+ call $P_Check_Match_Flags ;AN000; process match flag
+ clc ;AN000; indicate match
+ jmp short $P_Chk_SW_Single_Exit ;AN000;
+
+$P_Chk_SW_Err0: ;AN000;
+ stc ;AN000; not found in switch synonym list
+ jmp short $P_Chk_SW_Single_Exit ;AN000;
+
+$P_Chk_SW_Exit: ;AN000;
+ push ax ;AN000;
+ mov al,$P_String ;AN000; set
+ mov ah,$P_No_Tag ;AN000; result
+ call $P_Fill_Result ;AN000; buffer
+ pop ax ;AN000;
+ clc ;AN000;
+$P_Chk_SW_Single_Exit: ;AN000;
+ ret ;AN000;
+ELSE ;AN000;(of IF SwSW)
+ stc ;AN000; this logic works when the SwSW
+ ret ;AN000; is reset.
+ENDIF ;AN000;(of SwSW)
+$P_Chk_SW_Control endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Fill_Result
+;
+; Function: Fill the result buffer
+;
+; Input: AH = Item tag
+; AL = type
+; AL = 1: CX,DX has 32bit number (CX = high)
+; AL = 2: DX has index(offset) into value list
+; AL = 6: DL has driver # (1-A, 2-B, ... , 26 - Z)
+; AL = 7: DX has year, CL has month and CH has date
+; AL = 8: DL has hours, DH has minutes, CL has secondsn,
+; amd CH has hundredths
+; AL = else: psdata_seg:SI points to returned string buffer
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Do_CAPS_String, $P_Remove_Colon, $P_Found_SYNONYM
+;
+; Vars: $P_DX(W)
+;***********************************************************************
+$P_Fill_Result proc ;AN000;
+ push di ;AN000;
+ mov di,es:[bx].$P_Result_Buf ;AN000; di points to result buffer
+ mov psdata_seg:$P_DX,di ;AC034; set returned result address
+ mov es:[di].$P_Type,al ;AN000; store type
+ mov es:[di].$P_Item_Tag,ah ;AN000; store item tag
+ push ax ;AN000;
+ mov ax,psdata_seg:$P_Found_SYNONYM ;AC034; if yes,
+ mov es:[di].$P_SYNONYM_Ptr,ax ;AN000; then set it to the result
+ pop ax ;AN000;
+$P_RLT04: ;AN000;
+ cmp al,$P_Number ;AN000; if number
+ jne $P_RLT00 ;AN000;
+
+$P_RLT02: ;AN000;
+ mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store 32bit
+ mov word ptr es:[di+2].$P_Picked_Val,cx ;AN000; number
+ jmp short $P_RLT_Exit ;AN000;
+
+$P_RLT00: ;AN000;
+ cmp al,$P_List_Idx ;AN000; if list index
+ jne $P_RLT01 ;AN000;
+
+ mov word ptr es:[di].$P_Picked_Val,dx ;AN000; then store list index
+ jmp short $P_RLT_Exit ;AN000;
+
+$P_RLT01: ;AN000;
+ cmp al,$P_Date_F ;AN000; Date format ?
+ je $P_RLT02 ;AN000;
+
+ cmp al,$P_Time_F ;AN000; Time format ?
+ je $P_RLT02 ;AN000;
+;
+ cmp al,$P_Drive ;AN000; drive format ?
+ jne $P_RLT03 ;AN000;
+
+ mov byte ptr es:[di].$P_Picked_Val,dl ;AN000; store drive number
+ jmp short $P_RLT_Exit ;AN000;
+
+$P_RLT03: ;AN000;
+ cmp al,$P_Complex ;AN000; complex format ?
+ jne $P_RLT05 ;AN000;
+
+ mov ax,psdata_seg:$P_SaveSI_Cmpx ;AC034; then get pointer in command buffer
+ inc ax ;AN000; skip left Parentheses
+ mov word ptr es:[di].$P_Picked_Val,ax ;AN000; store offset
+ mov word ptr es:[di+2].$P_Picked_Val,ds ;AN000; store segment
+ jmp short $P_RLT_Exit ;AN000;
+
+$P_RLT05: ;AN000;
+;------------------------ AL = 3, 5, or 9
+ mov word ptr es:[di].$P_Picked_Val,si ;AN000; store offset of STRING_BUF
+;(replaced ;AN031;) mov word ptr es:[di+word].$P_Picked_Val,cs ;AN000; store segment of STRING_BUF
+ mov word ptr es:[di+2].$P_Picked_Val,Psdata_Seg ;AN031; store segment of STRING_BUF
+;
+ push ax ;AN000;
+ test byte ptr es:[bx].$P_Function_Flag,$P_CAP_File ;AN000; need CAPS by file table?
+ je $P_RLT_CAP00 ;AN000;
+
+ mov al,$P_DOSTBL_File ;AN000; use file upper case table
+ jmp short $P_RLT_CAP02 ;AN000;
+
+$P_RLT_CAP00: ;AN000;
+ test byte ptr es:[bx].$P_Function_Flag,$P_CAP_Char ;AN000; need CAPS by char table ?
+ je $P_RLT_CAP01 ;AN000;
+
+ mov al,$P_DOSTBL_Char ;AN000; use character upper case table
+$P_RLT_CAP02: ;AN000;
+ call $P_Do_CAPS_String ;AN000; process CAPS along the table
+$P_RLT_CAP01: ;AN000;
+ pop ax ;AN000;
+ test byte ptr es:[bx].$P_Function_Flag,$P_Rm_Colon ;AN000; removing colon at end ?
+ je $P_RLT_Exit ;AN000;
+
+ call $P_Remove_Colon ;AN000; then process it.
+$P_RLT_Exit: ;AN000;
+ pop di ;AN000;
+ ret ;AN000;
+$P_Fill_Result endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Check_Match_Flags
+;
+; Function: Check the mutch_flags and make the exit code and set the
+; result buffer
+;
+; Check for types in this order:
+; Complex
+; Date
+; Time
+; Drive
+; Filespec
+; Quoted String
+; Simple String
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Value, P$_SValue, $P_Simple_String, $P_Date_Format
+; $P_Time_Format, $P_Complex_Format, $P_File_Foemat
+; $P_Drive_Format
+;***********************************************************************
+$P_Check_Match_Flags proc ;AN000;
+ mov psdata_seg:$P_err_flag,$P_NULL ;AN033;AC034;; clear filespec error flag.
+ push ax ;AN000;
+ mov ax,es:[bx].$P_Match_Flag ;AN000; load match flag(16bit) to ax
+
+ or ax,ax ;AC035; test ax for zero
+;(changed ;AC035;) cmp ax,0 ;AN000; (tm12)
+ jne $P_Mat ;AN000; (tm12)
+
+ push ax ;AN000; (tm12)
+ push bx ;AN000; (tm12)
+ push dx ;AN000; (tm12)
+ push di ;AN000; (tm12)
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; (tm12)
+ mov ah,$P_No_Tag ;AN000; (tm12)
+ mov al,$P_String ;AN000; (tm12)
+ call $P_Fill_Result ;AN000; (tm12)
+ pop di ;AN000; (tm12)
+ pop dx ;AN000; (tm12)
+ pop bx ;AN000; (tm12)
+ pop ax ;AN000; (tm12)
+ jmp short $P_Bridge ;AC035; (tm12)
+
+$P_Mat: ;AN000; (tm12)
+
+IF CmpxSW ;AN000;(Check if complex item is supported)
+ test ax,$P_Cmpx_S ;AN000; Complex string
+ je $P_Match01 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Complex_Format ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Bridge ;AN000;
+
+$P_Match01: ;AN000;
+ENDIF ;AN000;(of CmpxSW)
+IF DateSW ;AN000;(Check if date format is supported)
+ test ax,$P_Date_S ;AN000; Date string
+ je $P_Match02 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Date_Format ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Bridge ;AN000;
+
+$P_Match02: ;AN000;
+ENDIF ;AN000;(of DateSW)
+IF TimeSW ;AN000;(Check if time format is supported)
+ test ax,$P_Time_S ;AN000; Time string
+ je $P_Match03 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Time_Format ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+; je $P_Match03 ;AN000:
+
+ jne $P_Bridge ;AN000; (tm09)
+
+ENDIF ;AN000;(of TimeSW) (tm04)
+ jmp short $P_Match03 ;AN025; (tm09)
+
+$P_Bridge: ;AN000;
+; jmp short $P_Match_Exit (tm02)
+
+ jmp $P_Match_Exit ;AN000; (tm02)
+
+$P_Match03: ;AN000;
+; ENDIF ;AN000;(of TimeSW) (tm04)
+IF NumSW ;AN000;(Check if numeric value is supported)
+ test ax,$P_Num_Val ;AN000; Numeric value
+ je $P_Match04 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Value ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Match_Exit ;AN000;
+
+$P_Match04: ;AN000;
+ test ax,$P_SNUM_Val ;AN000; Signed numeric value
+ je $P_Match05 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_SValue ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Match_Exit ;AN000;
+
+$P_Match05: ;AN000;
+ENDIF ;AN000;(of NumSW)
+IF DrvSW ;AN000;(Check if drive only is supported)
+ test ax,$P_Drv_Only ;AN000; Drive only
+ je $P_Match06 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_File_Format ;AN000; 1st, call file format
+ call $P_Drive_Format ;AN000; check drive format, next
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examinee the next type
+ jne $P_Match_Exit ;AN000;
+
+$P_Match06: ;AN000;
+ENDIF ;AN000;(of DrvSW)
+IF FileSW ;AN000;(Check if file spec is supported)
+ test ax,$P_File_Spc ;AN000; File spec
+ je $P_Match07 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_File_Format ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Match_Exit ;AN000;
+
+$P_Match07: ;AN000;
+ENDIF ;AN000;(of FileSW)
+IF QusSW ;AN000;(Check if quoted string is supported)
+ test ax,$P_Qu_String ;AN000; Quoted string
+ je $P_Match08 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Quoted_Format ;AN000; do process
+ cmp psdata_seg:$P_RC,$P_Syntax ;AC034; if error, examine the next type
+ jne $P_Match_Exit ;AN000;
+
+$P_Match08: ;AN000;
+ENDIF ;AN000;(of QusSW)
+ test ax,$P_Simple_S ;AN000; Simple string
+ je $P_Match09 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_No_Error ;AC034; assume no error
+ call $P_Simple_String ;AN000; do process
+;;;; cmp psdata_seg:$P_RC,$P_Syntax ;AC034; These two lines will be alive
+;;;; jne $P_Match_Exit ;when extending the match_flags.
+$P_Match09: ;AN000;
+$P_Match_Exit: ;AN000;
+ cmp psdata_seg:$P_err_flag,$P_error_filespec ;AC034; bad filespec ?
+ jne $P_Match2_Exit ;AN033; no, continue
+ cmp psdata_seg:$P_RC,$P_No_Error ;AN033;AC034;; check for other errors ?
+ jne $P_Match2_Exit ;AN033; no, continue
+ mov psdata_seg:$P_RC,$P_Syntax ;AN033;AC034;; set error flag
+$P_Match2_Exit: ;AN033;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Check_Match_Flags endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Remove_Colon;
+;
+; Function: Remove colon at end
+;
+; Input: psdata_seg:SI points to string buffer to be examineed
+;
+; Output: None
+;
+; Use: $P_Chk_DBCS
+;***********************************************************************
+$P_Remove_Colon proc ;AN000;
+ push ax ;AN000;
+ push si ;AN000;
+$P_RCOL_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; get character
+ or al,al ;AN000; end of string ?
+ je $P_RCOL_Exit ;AN000; if yes, just exit
+
+ cmp al,$P_Colon ;AN000; is it colon ?
+ jne $P_RCOL00 ;AN000;
+
+ cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; if so, next is NULL ?
+ jne $P_RCOL00 ;AN000; no, then next char
+
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN000; yes, remove colon
+ jmp short $P_RCOL_Exit ;AN000; and exit.
+
+$P_RCOL00: ;AN000;
+ call $P_Chk_DBCS ;AN000; if not colon, then check if
+ jnc $P_RCOL01 ;AN000; DBCS leading byte.
+
+ inc si ;AN000; if yes, skip trailing byte
+$P_RCOL01: ;AN000;
+ inc si ;AN000; si points to next byte
+ jmp short $P_RCOL_Loop ;AN000; loop until NULL encountered
+
+$P_RCOL_Exit: ;AN000;
+ pop si ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Remove_Colon endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Do_CAPS_String;
+;
+; Function: Perform capitalization along with the file case map table
+; or character case map table.
+;
+; Input: AL = 2 : Use character table
+; AL = 4 : Use file table
+; psdata_seg:SI points to string buffer to be capitalized
+;
+; Output: None
+;
+; Use: $P_Do_CAPS_Char, $P_Chk_DBCS
+;***********************************************************************
+$P_Do_CAPS_String proc ;AN000;
+ push si ;AN000;
+ push dx ;AN000;
+ mov dl,al ;AN000; save info id
+
+$P_DCS_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; load charater and
+ call $P_Chk_DBCS ;AN000; check if DBCS leading byte
+ jc $P_DCS00 ;AN000; if yes, do not need CAPS
+
+ or al,al ;AN000; end of string ?
+ je $P_DCS_Exit ;AN000; then exit.
+
+ call $P_Do_CAPS_Char ;AN000; Here a SBCS char need to be CAPS
+ mov psdata_seg:[si],al ;AN000; stored upper case char to buffer
+ jmp short $P_DCS01 ;AN000; process nexit
+$P_DCS00: ;AN000;
+ inc si ;AN000; skip DBCS leading and trailing byte
+$P_DCS01: ;AN000;
+ inc si ;AN000; si point to next byte
+ jmp short $P_DCS_Loop ;AN000; loop until NULL encountered
+$P_DCS_Exit: ;AN000;
+ pop dx ;AN000;
+ pop si ;AN000;
+ ret ;AN000;
+$P_Do_CAPS_String endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Do_CAPS_Char;
+;
+; Function: Perform capitalization along with the file case map table
+; or character case map table.
+;
+; Input: DL = 2 : Use character table
+; DL = 4 : Use file table
+; AL = character to be capitalized
+;
+; Output: None
+;
+; Use: INT 21h /w AH=65h
+;***********************************************************************
+$P_Do_CAPS_Char proc ;AN000;
+ cmp al,$P_ASCII80 ;AN000; need upper case table ?
+ jae $P_DCC_Go ;AN000;
+
+ cmp al,"a" ;AN000; if no,
+ jb $P_CAPS_Ret ;AN000; check if "a" <= AL <= "z"
+
+ cmp al,"z" ;AN000;
+ ja $P_CAPS_Ret ;AN000; if yes, make CAPS
+
+ and al,$P_Make_Upper ;AN000; else do nothing.
+ jmp short $P_CAPS_Ret ;AN000;
+
+$P_DCC_Go: ;AN000;
+ push bx ;AN000;
+ push es ;AN000;
+ push di ;AN000;
+IF CAPSW ;AN000;(Check if uppercase conversion is supported)
+ lea di,psdata_seg:$P_File_CAP_Ptr ;AC034;
+ cmp dl,$P_DOSTBL_File ;AN000; Use file CAPS table ?
+ je $P_DCC00 ;AN000;
+
+ENDIF ;AN000;(of CAPSW)
+ lea di,psdata_seg:$P_Char_CAP_Ptr ;AC034; or use char CAPS table ?
+$P_DCC00: ;AN000;
+ cmp psdata_seg:[di],dl ;AN000; already got table address ?
+ je $P_DCC01 ;AN000; if no,
+
+;In this next section, ES will be used to pass a 5 byte workarea to INT 21h,
+; the GET COUNTYRY INFO call. This usage of ES is required by the function
+; call, regardless of what base register is currently be defined as PSDATA_SEG.
+;BASESW EQU 0 means that ES is the psdata_seg reg.
+
+IFDEF BASESW ;AN037; If BASESW has been defined, and
+ IFE BASESW ;AN037; If ES is psdata base
+ push PSDATA_SEG ;AN037; save current base reg
+ ENDIF ;AN037;
+ENDIF ;AN037;
+
+ push ax ;AN000; get CAPS table thru DOS call
+ push cx ;AN000;
+ push dx ;AN000;
+
+
+ push PSDATA_SEG ;AC036; pass current base seg into
+ ;(Note: this used to push CS. BUG...
+ pop es ;AN000; ES reg, required for
+ ;get extended country information
+ mov ah,$P_DOS_Get_TBL ;AN000; get extended CDI
+ mov al,dl ;AN000; upper case table
+ mov bx,$P_DOSTBL_Def ;AN000; get active CON
+ mov cx,$P_DOSTBL_BL ;AN000; buffer length
+ mov dx,$P_DOSTBL_Def ;AN000; get for default code page
+ ;DI already set to point to buffer
+ int 21h ;AN000; es:di point to buffer that
+ ;now has been filled in with info
+ pop dx ;AN000;
+ pop cx ;AN000;
+ pop ax ;AN000;
+IFDEF BASESW ;AN037; If BASESW has been defined, and
+ IFE BASESW ;AN037; If ES is psdata base
+ pop PSDATA_SEG ;AN037; restore current base reg
+ ENDIF ;AN037;
+ENDIF ;AN037;
+$P_DCC01: ;AN000;
+
+;In this next section, ES will be used as the base of the XLAT table, provided
+; by the previous GET COUNTRY INFO DOS call. This usage of ES is made
+; regardless of which base reg is currently the PSDATA_SEG reg.
+
+IFDEF BASESW ;AN037; If BASESW has been defined, and
+ IFE BASESW ;AN037; If ES is psdata base
+ push PSDATA_SEG ;AN037; save current base reg
+ ENDIF ;AN037;
+ENDIF ;AN037;
+ mov bx,psdata_seg:[di+$P_DOS_TBL_Off] ;AN000; get offset of table
+ mov es,psdata_seg:[di+$P_DOS_TBL_Seg] ;AN000; get segment of table
+ inc bx ;AC035; add '2' to
+ inc bx ;AC035; BX reg
+ ;AN000; skip length field
+;(changed ;AN035;) add bx,word ;AN000; skip length field
+ sub al,$P_ASCII80 ;AN000; make char to index
+ xlat es:[bx] ;AN000; perform case map
+
+IFDEF BASESW ;AN037; If BASESW has been defined, and
+ IFE BASESW ;AN037; If ES is psdata base
+ pop PSDATA_SEG ;AN037; restore current base reg
+ ENDIF ;AN037;
+ENDIF ;AN037;
+ pop di ;AN000;
+ pop es ;AN000;
+ pop bx ;AN000;
+$P_CAPS_Ret: ;AN000;
+ ret ;AN000;
+$P_Do_CAPS_Char endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+IF NumSW ;AN000;(Check if numeric value is supported)
+; $P_Value / $P_SValue
+;
+; Function: Make 32bit value from psdata_seg:SI and see value list
+; and make result buffer.
+; $P_SValue is an entry point for the signed value
+; and this will simply call $P_Value after the handling
+; of the sign character, "+" or "-"
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Check_OVF
+;
+; Vars: $P_RC(W), $P_Flags(RW)
+;***********************************************************************
+$P_SValue proc ;AN000; when signed value here
+ push ax ;AN000;
+ or psdata_seg:$P_Flags2,$P_Signed ;AC034; indicate a signed numeric
+ and psdata_seg:$P_Flags2,0ffh-$P_Neg ;AC034; assume positive value
+ mov al,psdata_seg:[si] ;AN000; get sign
+ cmp al,$P_Plus ;AN000; "+" ?
+ je $P_SVal00 ;AN000;
+
+ cmp al,$P_Minus ;AN000; "-" ?
+ jne $P_Sval01 ;AN000; else
+
+ or psdata_seg:$P_Flags2,$P_Neg ;AC034; set this is negative value
+$P_SVal00: ;AN000;
+ inc si ;AN000; skip sign char
+$P_Sval01: ;AN000;
+ call $P_Value ;AN000; and process value
+ pop ax ;AN000;
+ ret ;AN000;
+$P_SValue endp ;AN000;
+;***********************************************************************
+$P_Value proc ;AN000;
+ push ax ;AN000;
+ push cx ;AN000;
+ push dx ;AN000;
+ push si ;AN000;
+ xor cx,cx ;AN000; cx = higher 16 bits
+ xor dx,dx ;AN000; dx = lower 16 bits
+ push bx ;AN000; save control pointer
+$P_Value_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; get character
+ or al,al ;AN000; end of line ?
+ je $P_Value00 ;AN000;
+
+ call $P_0099 ;AN000; make asc(0..9) to bin(0..9)
+ jc $P_Value_Err0 ;AN000;
+
+ xor ah,ah ;AN000;
+ mov bp,ax ;AN000; save binary number
+ shl dx,1 ;AN000; to have 2*x
+ rcl cx,1 ;AN000; shift left w/ carry
+ call $P_Check_OVF ;AN000; Overflow occurred ?
+ jc $P_Value_Err0 ;AN000; then error, exit
+
+ mov bx,dx ;AN000; save low(2*x)
+ mov ax,cx ;AN000; save high(2*x)
+ shl dx,1 ;AN000; to have 4*x
+ rcl cx,1 ;AN000; shift left w/ carry
+ call $P_Check_OVF ;AN000; Overflow occurred ?
+ jc $P_Value_Err0 ;AN000; then error, exit
+
+ shl dx,1 ;AN000; to have 8*x
+ rcl cx,1 ;AN000; shift left w/ carry
+ call $P_Check_OVF ;AN000; Overflow occurred ?
+ jc $P_Value_Err0 ;AN000; then error, exit
+
+ add dx,bx ;AN000; now have 10*x
+ adc cx,ax ;AN000; 32bit ADD
+ call $P_Check_OVF ;AN000; Overflow occurred ?
+ jc $P_Value_Err0 ;AN000; then error, exit
+
+ add dx,bp ;AN000; Add the current one degree decimal
+ adc cx,0 ;AN000; if carry, add 1 to high 16bit
+ call $P_Check_OVF ;AN000; Overflow occurred ?
+ jc $P_Value_Err0 ;AN000; then error, exit
+
+ inc si ;AN000; update pointer
+ jmp short $P_Value_Loop ;AN000; loop until NULL encountered
+;
+$P_Value_Err0: ;AN000;
+ pop bx ;AN000;
+ jmp $P_Value_Err ;AN000; Bridge
+;
+$P_Value00: ;AN000;
+ pop bx ;AN000; restore control pointer
+ test psdata_seg:$P_Flags2,$P_Neg ;AC034; here cx,dx = 32bit value
+ je $P_Value01 ;AN000; was it negative ?
+
+ not cx ;AN000; +
+ not dx ;AN000; |- Make 2's complement
+ add dx,1 ;AN000; |
+ adc cx,0 ;AN000; +
+$P_Value01: ;AN000; / nval =0
+ mov si,es:[bx].$P_Value_List ;AN000; si points to value list
+ mov al,es:[si] ;AN000; get nval
+ cmp al,$P_nval_None ;AN000; no value list ?
+ jne $P_Value02 ;AN000;
+
+ mov al,$P_Number ;AN000; Set type
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+ jmp $P_Value_Exit ;AN000;
+
+$P_Value02: ;AN000; / nval = 1
+IF Val1SW ;AN000;(Check if value list id #1 is supported)
+;(tm07) cmp al,$P_nval_Range ;AN000; have range list ?
+;(tm07) jne $P_Value03 ;AN000;
+
+ inc si ;AN000;
+ mov al,es:[si] ;AN000; al = number of range
+ cmp al,$P_No_nrng ;AN000; (tm07)
+ je $P_Value03 ;AN000; (tm07)
+
+ inc si ;AN000; si points to 1st item_tag
+$P_Val02_Loop: ;AN000;
+ test psdata_seg:$P_Flags2,$P_Signed ;AC034;
+ jne $P_Val02_Sign ;AN000;
+
+ cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
+ jb $P_Val02_Next ;AN000;
+
+ ja $P_Val_In ;AN000;
+
+ cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
+ jb $P_Val02_Next ;AN000;
+
+$P_Val_In: ;AN000;
+;;;;;; cmp cx,es:$P_Val_YH] ; comp cx with YH (tm01)
+ cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH (tm01)
+ ja $P_Val02_Next ;AN000;
+
+ jb $P_Val_Found ;AN000;
+
+ cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL
+ ja $P_Val02_Next ;AN000;
+
+ jmp short $P_Val_Found ;AN000;
+
+$P_Val02_Sign: ;AN000;
+ cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
+ jl $P_Val02_Next ;AN000;
+
+ jg $P_SVal_In ;AN000;
+
+ cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
+ jl $P_Val02_Next ;AN000;
+
+$P_SVal_In: ;AN000;
+ cmp cx,es:[si+$P_Val_YH] ;AN000; comp cx with YH
+ jg $P_Val02_Next ;AN000;
+
+ jl $P_Val_Found ;AN000;
+
+ cmp dx,es:[si+$P_Val_YL] ;AN000; comp dx with YL
+ jg $P_Val02_Next ;AN000;
+
+ jmp short $P_Val_Found ;AN000;
+
+$P_Val02_Next: ;AN000;
+ add si,$P_Len_Range ;AN000;
+ dec al ;AN000; loop nrng times in AL
+ jne $P_Val02_Loop ;AN000;
+ ; / Not found
+ mov psdata_seg:$P_RC,$P_Out_of_Range ;AC034;
+ mov al,$P_Number ;AN000;
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+ jmp short $P_Value_Exit ;AN000;
+
+ENDIF ;AN000;(of Val1SW)
+IF Val1SW+Val2SW ;AN000;(Check if value list id #1 or #2 is supported)
+$P_Val_Found: ;AN000;
+ mov al,$P_Number ;AN000;
+ mov ah,es:[si] ;AN000; found ITEM_TAG set
+ jmp short $P_Value_Exit ;AN000;
+
+ENDIF ;AN000;(of Val1SW+Val2SW)
+$P_Value03: ;AN000; / nval = 2
+IF Val2SW ;AN000;(Check if value list id #2 is supported)
+;;;; cmp al,$P_nval_Value ; have match list ? ASSUME nval=2,
+;;;; jne $P_Value04 ; even if it is 3 or more.
+;(tm07) inc si ;AN000;
+;(tm07) mov al,es:[si] ;AN000; al = nrng
+ mov ah,$P_Len_Range ;AN000;
+ mul ah ;AN000; Skip nrng field
+ inc ax ;AN000;
+ add si,ax ;AN000; si points to nnval
+ mov al,es:[si] ;AN000; get nnval
+ inc si ;AN000; si points to 1st item_tag
+$P_Val03_Loop: ;AN000;
+ cmp cx,es:[si+$P_Val_XH] ;AN000; comp cx with XH
+ jne $P_Val03_Next ;AN000;
+
+ cmp dx,es:[si+$P_Val_XL] ;AN000; comp dx with XL
+ je $P_Val_Found ;AN000;
+
+$P_Val03_Next: ;AN000;
+ add si,$P_Len_Value ;AN000; points to next value choice
+ dec al ;AN000; loop nval times in AL
+ jne $P_Val03_Loop ;AN000;
+ ;AN000; / Not found
+ mov psdata_seg:$P_RC,$P_Not_in_Val ;AC034;
+ mov al,$P_Number ;AN000;
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+ jmp short $P_Value_Exit ;AN000;
+
+ENDIF ;AN000;(of Val2SW)
+$P_Value04: ;AN000; / nval = 3 or else
+$P_Value_Err: ;AN000;
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034;
+ mov al,$P_String ;AN000; Set type
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+$P_Value_Exit: ;AN000;
+ call $P_Fill_Result ;AN000;
+ pop si ;AN000;
+ pop dx ;AN000;
+ pop cx ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Value endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Check_OVF
+;
+; Function: Check if overflow is occurred with consideration of
+; signed or un-signed numeric value
+;
+; Input: Flag register
+;
+; Output: CY = 1 : Overflow
+;
+; Vars: $P_Flags(R)
+;***********************************************************************
+$P_Check_OVF proc ;AN000;
+ pushf ;AN000;
+ test psdata_seg:$P_Flags2,$P_Neg ;AC034; is it negative value ?
+ jne $P_COVF ;AN000; if no, check overflow
+
+ popf ;AN000; by the CY bit
+ ret ;AN000;
+
+$P_COVF: ;AN000;
+ popf ;AN000; else,
+ jo $P_COVF00 ;AN000; check overflow by the OF
+
+ clc ;AN000; indicate it with CY bit
+ ret ;AN000; CY=0 means no overflow
+
+$P_COVF00: ;AN000;
+ stc ;AN000; and CY=1 means overflow
+ ret ;AN000;
+$P_Check_OVF endp ;AN000;
+ENDIF ;AN000;(of FarSW)
+;***********************************************************************
+; $P_0099;
+;
+; Function: Make ASCII 0-9 to Binary 0-9
+;
+; Input: AL = character code
+;
+; Output: CY = 1 : AL is not number
+; CY = 0 : AL contains binary value
+;***********************************************************************
+$P_0099 proc ;AN000;
+ cmp al,"0" ;AN000;
+ jb $P_0099Err ;AN000; must be 0 =< al =< 9
+
+ cmp al,"9" ;AN000;
+ ja $P_0099Err ;AN000; must be 0 =< al =< 9
+
+ sub al,"0" ;AN000; make char -> bin
+ clc ;AN000; indicate no error
+ ret ;AN000;
+
+$P_0099Err: ;AN000;
+ stc ;AN000; indicate error
+ ret ;AN000;
+$P_0099 endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Simple_String
+;
+; Function: See value list for the simple string
+; and make result buffer.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_String_Comp
+;
+; Vars: $P_RC(W)
+;***********************************************************************
+$P_Simple_String proc ;AN000;
+ push ax ;AN000;
+ push bx ;AN000;
+ push dx ;AN000;
+ push di ;AN000;
+ mov di,es:[bx].$P_Value_List ;AN000; di points to value list
+ mov al,es:[di] ;AN000; get nval
+ or al,al ;AN000; no value list ?
+ jne $P_Sim00 ;AN000; then
+
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+ jmp short $P_Sim_Exit ;AN000; and set result buffer
+
+$P_Sim00: ;AN000;
+IF Val3SW+KeySW ;AN000;(Check if keyword or value list id #3 is supported)
+ cmp al,$P_nval_String ;AN000; String choice list provided ?
+ jne $P_Sim01 ;AN000; if no, syntax error
+
+ inc di ;AN000;
+ mov al,es:[di] ;AN000; al = nrng
+ mov ah,$P_Len_Range ;AN000;
+ mul ah ;AN000; Skip nrng field
+ inc ax ;AN000; ax = (nrng*9)+1
+ add di,ax ;AN000; di points to nnval
+ mov al,es:[di] ;AN000; get nnval
+ mov ah,$P_Len_Value ;AN000;
+ mul ah ;AN000; Skip nnval field
+ inc ax ;AN000; ax = (nnval*5)+1
+ add di,ax ;AN000; di points to nstrval
+ mov al,es:[di] ;AN000; get nstrval
+ inc di ;AC035; add '2' to
+ inc di ;AC035; DI reg
+ ;AN000; di points to 1st string in list
+;(replaced ;AC035;) add di,2 ;AN000; di points to 1st string in list
+$P_Sim_Loop: ;AN000;
+ mov bp,es:[di] ;AN000; get string pointer
+ call $P_String_Comp ;AN000; compare it with operand
+ jnc $P_Sim_Found ;AN000; found on list ?
+
+ add di,$P_Len_String ;AN000; if no, point to next choice
+ dec al ;AN000; loop nstval times in AL
+ jne $P_Sim_Loop ;AN000;
+ ;AN000; / Not found
+ mov psdata_seg:$P_RC,$P_Not_In_Str ;AC034;
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+ jmp short $P_Sim_Exit ;AN000;
+
+$P_Sim_Found: ;AN000;
+ mov ah,es:[di-1] ;AN000; set item_tag
+ mov al,$P_List_Idx ;AN000;
+ mov dx,es:[di] ;AN000; get address of STRING
+ jmp short $P_Sim_Exit0 ;AN000;
+ENDIF ;AN000;(of Val3SW+KeySW)
+$P_Sim01: ;AN000;
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034;
+ mov ah,$P_No_Tag ;AN000; No ITEM_TAG set
+$P_Sim_Exit: ;AN000;
+ mov al,$P_String ;AN000; Set type
+$P_Sim_Exit0: ;AN000;
+ call $P_Fill_Result ;AN000;
+ pop di ;AN000;
+ pop dx ;AN000;
+ pop bx ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Simple_String endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_String_Comp:
+;
+; Function: Compare two string
+;
+; Input: psdata_seg:SI -> 1st string
+; ES:BP -> 2nd string (Must be upper case)
+; ES:BX -> CONTROL block
+;
+; Output: CY = 1 if not match
+;
+; Use: $P_Chk_DBCS, $P_Do_CAPS_Char
+;
+; Vars: $P_KEYor_SW_Ptr(W), $P_Flags(R). $P_KEYorSW_Ptr
+;***********************************************************************
+$P_String_Comp proc ;AN000;
+ push ax ;AN000;
+ push bp ;AN000;
+ push dx ;AN000;
+ push si ;AN000;
+ mov dl,$P_DOSTBL_Char ;AN000; use character case map table
+$P_SCOM_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; get command character
+ call $P_Chk_DBCS ;AN000; DBCS ?
+ jc $P_SCOM00 ;AN000; yes,DBCS
+
+ call $P_Do_CAPS_Char ;AN000; else, upper case map before comparison
+IF KeySW+SwSW ;AN000;(Check if keyword or switch is supported)
+ test psdata_seg:$P_Flags2,$P_Key_Cmp ;AC034; keyword search ?
+ je $P_SCOM04 ;AN000;
+
+ cmp al,$P_Keyword ;AN000; "=" is delimiter
+ jne $P_SCOM03 ;AN000;IF "=" on command line AND (bp+1=> char after the "=" in synonym list)
+
+ cmp byte ptr es:[bp+1],$P_NULL ;AN021; at end of keyword string in the control block THEN
+ jne $P_SCOM_DIFFER ;AN021;
+
+ jmp short $P_SCOM05 ;AN000; keyword found in synonym list
+
+$P_SCOM04: ;AN000;
+ test psdata_seg:$P_Flags2,$P_SW_Cmp ;AC034; switch search ?
+ je $P_SCOM03 ;AN000;
+
+ cmp al,$P_Colon ;AN000; ":" is delimiter, at end of switch on command line
+ jne $P_SCOM03 ;AN000; continue compares
+
+ cmp byte ptr es:[bp],$P_NULL ;AN021; IF at end of switch on command AND
+ jne $P_SCOM_DIFFER ;AN021; at end of switch string in the control block THEN
+
+$P_SCOM05: ;AN000; found a match
+ inc si ;AN000; si points to just after "=" or ":"
+ jmp short $P_SCOM_Same ;AN000; exit
+
+$P_SCOM03: ;AN000;
+ENDIF ;AN000;(of KeySW+SwSW)
+ cmp al,es:[bp] ;AN000; compare operand w/ a synonym
+ jne $P_SCOM_Differ0 ;AN000; if different, check ignore colon option
+
+ or al,al ;AN000; end of line
+ je $P_SCOM_Same ;AN000; if so, exit
+
+ inc si ;AN000; update operand pointer
+ inc bp ;AN000; and synonym pointer
+ jmp short $P_SCOM01 ;AN000; loop until NULL or "=" or ":" found in case
+
+$P_SCOM00: ;AN000; Here al is DBCS leading byte
+ cmp al,es:[bp] ;AN000; compare leading byte
+ jne $P_SCOM_Differ ;AN000; if not match, say different
+
+ inc si ;AN000; else, load next byte
+ mov al,psdata_seg:[si] ;AN000; and
+ inc bp ;AN000;
+ cmp al,es:[bp] ;AN000; compare 2nd byte
+ jne $P_SCOM_Differ ;AN000; if not match, say different, too
+
+ inc si ;AN000; else update operand pointer
+ inc bp ;AN000; and synonym pointer
+$P_SCOM01: ;AN000;
+ jmp short $P_SCOM_Loop ;AN000; loop until NULL or "=" or "/" found in case
+
+$P_SCOM_Differ0: ;AN000;
+
+IF SwSW ;AN000;(tm10)
+ test psdata_seg:$P_Flags2,$P_SW ;AC034;(tm10)
+ je $P_not_applicable ;AN000;(tm10)
+
+ test es:[bx].$P_Function_Flag,$P_colon_is_not_necessary ;AN000;(tm10)
+ je $P_not_applicable ;AN000;(tm10)
+
+ cmp byte ptr es:[bp],$P_NULL ;AN000;(tm10)
+;(deleted ;AN025;) jne $P_not_applicable ;AN000;(tm10)
+ je $P_SCOM_Same ;AN025;(tm10)
+
+$P_not_applicable: ;AN000;(tm10)
+ENDIF ;AN000;(tm10)
+
+ test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; ignore colon option specified ?
+ je $P_SCOM_Differ ;AN000; if no, say different.
+
+ cmp al,$P_Colon ;AN000; End up with ":" and
+ jne $P_SCOM02 ;AN000; subseqently
+
+ cmp byte ptr es:[bp],$P_NULL ;AN000; NULL ?
+ jne $P_SCOM_Differ ;AN000; if no, say different
+
+ jmp short $p_SCOM_Same ;AN000; else, say same
+
+$P_SCOM02: ;AN000;
+ cmp al,$P_NULL ;AN000; end up NULL and :
+ jne $P_SCOM_Differ ;AN000;
+
+ cmp byte ptr es:[bp],$P_Colon ;AN000; if no, say different
+ je $p_SCOM_Same ;AN000; else, say same
+
+$P_SCOM_Differ: ;AN000;
+ stc ;AN000; indicate not found
+ jmp short $P_SCOM_Exit ;AN000;
+
+$P_SCOM_Same: ;AN000;
+ mov psdata_seg:$P_KEYorSW_Ptr,si ;AC034; for later use by keyword or switch
+ clc ;AN000; indicate found
+$P_SCOM_Exit: ;AN000;
+ pop si ;AN000;
+ pop dx ;AN000;
+ pop bp ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_String_Comp endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+IF DateSW ;AN000;(Check if date format is supported)
+; $P_Date_Format
+;
+; Function: Convert a date string to DOS date format for int 21h
+; with format validation.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum
+;
+; Vars: $P_RC(W), $P_1st_Val(RW), $P_2nd_Val(RW), $P_3rd_Val(RW)
+;***********************************************************************
+$P_Date_Format proc ;AN000;
+ push ax ;AN000;
+ push cx ;AN000;
+ push dx ;AN000;
+ push si ;AN000;
+ push bx ;AN000;
+ push si ;AN000;
+ call $P_Set_CDI ;AN000; set country dependent information before process
+; mov bl,psdata_seg:[si].$P_CDI_DateS ;load date separator ;AN020; (deleted)
+; note: the country info is still needed
+; to determine the order of the fields,
+; but the separator char is no longer used.
+ pop si ;AN000;
+ mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value
+ call $P_Get_DecNum ;AN000; get 1st number
+ jc $P_DateF_Err0 ;AN000;-----------------------+
+
+ mov psdata_seg:$P_1st_Val,ax ;AC034; |
+ or bl,bl ;AN000; end of line ? |
+ je $P_DateF_YMD ;AN000; |
+
+ call $P_Get_DecNum ;AN000; get 2nd number |
+ jc $P_DateF_Error ;AN000; |
+
+ mov psdata_seg:$P_2nd_Val,ax ;AC034; |
+ or bl,bl ;AN000; end of line ? |
+ je $P_DateF_YMD ;AN000; |
+
+ call $P_Get_DecNum ;AN000; get 3rd number |
+$P_DateF_Err0: ;AN000; Bridge <-----------+
+ jc $P_DateF_Error ;AN000;
+
+ mov psdata_seg:$P_3rd_Val,ax ;AC034;
+ or bl,bl ;AN000; end of line ?
+ jne $P_DateF_Error ;AN000;
+
+$P_DateF_YMD: ;AN000;
+ mov bx,psdata_seg:$P_Country_Info.$P_CDI_DateF ;AC034; get date format
+ cmp bx,$P_Date_YMD ;AN000;
+ je $P_DateF00 ;AN000;
+
+ mov ax,psdata_seg:$P_1st_Val ;AC034;
+ or ah,ah ;AN000;
+ jne $P_DateF_Error ;AN000;
+
+ mov cl,al ;AN000; set month
+ mov ax,psdata_seg:$P_2nd_Val ;AC034;
+ or ah,ah ;AN000; if overflow, error.
+ jne $P_DateF_Error ;AN000;
+
+ mov ch,al ;AN000; set date
+ mov dx,psdata_seg:$P_3rd_Val ;AC034; set year
+ cmp bx,$P_Date_DMY ;AN000; from here format = MDY
+ jne $P_DateF01 ;AN000; if it is DMY
+
+ xchg ch,cl ;AN000; then swap M <-> D
+$P_DateF01: ;AN000;
+ jmp short $P_DateF02 ;AN000;
+
+$P_DateF00: ;AN000; / here format = YMD
+ mov dx,psdata_seg:$P_1st_Val ;AC034; set year
+ mov ax,psdata_seg:$P_2nd_Val ;AC034;
+ or ah,ah ;AN000; if overflow, error
+ jne $P_DateF_Error ;AN000;
+
+ mov cl,al ;AN000; set month
+ mov ax,psdata_seg:$P_3rd_Val ;AC034;
+ or ah,ah ;AN000; if overflow, error
+ jne $P_DateF_Error ;AN000;
+
+ mov ch,al ;AN000; set date
+$P_DateF02: ;AN000;
+ cmp dx,100 ;AN000; year is less that 100 ?
+ jae $P_DateF03 ;AN000;
+
+ add dx,1900 ;AN000; set year 19xx
+$P_DateF03: ;AN000;
+ pop bx ;AN000; recover CONTROL block
+ pop si ;AN000; recover string pointer
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_Date_F ;AN000; result
+ call $P_Fill_Result ;AN000; buffer
+ jmp short $P_Date_Format_Exit ;AN000; to Date
+
+$P_DateF_Error: ;AN000;
+ pop bx ;AN000; recover CONTROL block
+ pop si ;AN000; recover string pointer
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_String ;AN000; result
+ call $P_Fill_Result ;AN000; buffer to string
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error
+$P_Date_Format_Exit: ;AN000;
+ pop dx ;AN000;
+ pop cx ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Date_Format endp ;AN000;
+ENDIF ;AN000;(of DateSW)
+PAGE ;AN000;
+;***********************************************************************
+IF TimeSW+DateSW ;AN000;(Check if time or date format is supported)
+; $P_Set_CDI:
+;
+; Function: Read CDI from DOS if it has not been read yet
+;
+; Input: None
+;
+; Output: psdata_seg:SI -> CDI
+;
+; Use: INT 21h w/ AH = 38h
+;***********************************************************************
+$P_Set_CDI proc ;AN000;
+ lea si,psdata_seg:$P_Country_Info ;AC034;
+ cmp psdata_seg:[si].$P_CDI_DateF,$P_NeedToBeRead ;AN000; already read ?
+ je $P_Read_CDI ;AN000;
+
+ jmp short $P_Set_CDI_Exit ;AN000; then do nothing
+
+$P_Read_CDI: ;AN000; else read CDI thru DOS
+ push ds ;AN000;
+ push dx ;AN000;
+ push ax ;AN000;
+ push PSDATA_SEG ;AC023;
+ pop ds ;AN000; set segment register
+ mov ax,$P_DOS_Get_CDI ;AN000; get country information
+ mov dx,si ;AN000; set offset of CDI in local data area
+ int 21h ;AN000;
+ pop ax ;AN000;
+ pop dx ;AN000;
+ pop ds ;AN000;
+$P_Set_CDI_Exit: ;AN000;
+ ret ;AN000;
+$P_Set_CDI endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Get_DecNum:
+;
+; Function: Read a chcrater code from psdata_seg:SI until specified delimiter
+; or NULL encountered. And make a decimal number.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: BL = delimiter code or NULL
+; AX = Decimal number
+; SI advanced to the next number
+; CY = 1 : Syntax error, AL = Latest examineed number
+;
+; Use: $P_0099
+;***********************************************************************
+$P_Get_DecNum proc ;AN000;
+ push cx ;AN000;
+ push dx ;AN000;
+ xor cx,cx ;AN000; cx will have final value
+$P_GetNum_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; load character
+ or al,al ;AN000; end of line ?
+ je $P_GetNum00 ;AN000; if yes, exit
+
+ cmp psdata_seg:$P_Got_Time,0 ;AC034; ;is this numeric in a time field? ;AC023
+ je $P_Do_Date_Delims ;AN000;no, go check out Date delimiters ;AC023
+
+; Determine which delimiter(s) to check for. Colon & period or period only
+ cmp bl,$P_colon_period ;AN032; ;Time
+ jne $P_Do_Time_Delim1 ;AN032; ;only check for period
+
+ cmp al,$P_Colon ;AN032; ;Is this a valid delimiter ?
+ je $P_GetNum01 ;AN032; ;yes, exit
+
+$P_Do_Time_Delim1: ;AN000;
+ cmp al,$P_Period ;;AC032;;AC023;Is this a valid delimiter ?
+ je $P_GetNum01 ;AC023; yes, exit
+
+ jmp short $P_Neither_Delims ;AN023;
+
+$P_Do_Date_Delims: ;AN000;
+;Regardless of the date delimiter character specified in the country
+;dependent information, check for the presence of any one of these
+;three field delimiters: "-", "/", or ".".
+ cmp al,$P_Minus ;AN020;is this a date delimiter character?
+ je $P_GetNum01 ;AN020;if yes, exit
+
+ cmp al,$P_Slash ;AN020;is this a date delimiter character?
+ je $P_GetNum01 ;AN020;if yes, exit
+
+ cmp al,$P_Period ;AN020;is this a date delimiter character?
+ je $P_GetNum01 ;AN000; if yes, exit
+
+$P_Neither_Delims: ;AN023;
+
+ call $P_0099 ;AN000; convert it to binary
+ jc $P_GetNum_Exit ;AN000; if error exit
+
+ mov ah,0 ;AN000;
+ xchg ax,cx ;AN000;
+ mov dx,10 ;AN000;
+ mul dx ;AN000; ax = ax * 10
+ or dx,dx ;AN000; overflow
+ jne $P_GetNum02 ;AN000; then exit
+
+ add ax,cx ;AN000;
+ jc $P_GetNum_Exit ;AN000;
+
+ xchg ax,cx ;AN000;
+ inc si ;AN000;
+ jmp short $P_GetNum_Loop ;AN000;
+
+$P_GetNum00: ;AN000;
+ mov bl,al ;AN000; set bl to NULL
+ clc ;AN000; indicate no error
+ jmp short $P_GetNum_Exit ;AN000;
+
+$P_GetNum01: ;AN000;
+ inc si ;AN000; si points to next number
+ clc ;AN000; indicate no error
+ jmp short $P_GetNum_Exit ;AN000;
+
+$P_GetNum02: ;AN000;
+ stc ;AN000; indicate error
+$P_GetNum_Exit: ;AN000;
+ mov ax,cx ;AN000;return value
+ pop dx ;AN000;
+ pop cx ;AN000;
+ ret ;AN000;
+$P_Get_DecNum endp ;AN000;
+ENDIF ;AN000;(of TimeSW+DateSW)
+PAGE ;AN000;
+;***********************************************************************
+IF TimeSW ;AN000;(Check if time format is supported)
+; $P_Time_Format
+;
+; Function: Convert a time string to DOS time format for int 21h
+; with format validation.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Set_CDI, $P_Get_DecNum, $P_Time_2412
+;
+; Vars: $P_RC(W), $P_Flags(R), $P_1st_Val(RW), $P_2nd_Val(RW)
+; $P_3rd_Val(RW), $P_4th_Val(RW)
+;***********************************************************************
+$P_Time_Format proc ;AN000;
+ push ax ;AN000;
+ push cx ;AN000;
+ push dx ;AN000;
+ push si ;AN000;
+ push bx ;AN000;
+ push si ;AN000;
+ call $P_Set_CDI ;AN000; Set country independent
+ ; information before process
+;(AN032; deleted) mov bl,psdata_seg:[si].$P_CDI_TimeS ;load time separator
+;(AN032; deleted) mov bh,psdata_seg:[si].$P_CDI_Dec ;load decimal separator
+ test byte ptr psdata_seg:[si].$P_CDI_TimeF,1 ;AN000; 24 hour system
+ pop si ;AN000;
+ jne $P_TimeF00 ;AN000; if no, means 12 hour system
+
+ call $P_Time_2412 ;AN000; this routine handle "am" "pm"
+$P_TimeF00: ;AN000;
+ mov psdata_seg:$P_1st_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_2nd_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_3rd_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_4th_Val,0 ;AC034; set initial value
+ mov psdata_seg:$P_Got_Time,1 ;AN023;AC034;; use time delimiter
+ mov bl,$P_colon_period ;AN032; flag, indicates use of
+ ; delimiters between hours,
+ ; minutes,seconds
+ call $P_Get_DecNum ;AN000; get 1st number
+ jc $P_TimeF_Err0 ;AN000;
+
+ mov psdata_seg:$P_1st_Val,ax ;AC034;
+ or bl,bl ;AN000; end of line ?
+ je $P_TimeF_Rlt ;AN000;
+
+ call $P_Get_DecNum ;AN000; get 2nd number
+ jc $P_TimeF_Err0 ;AC038; if OK
+
+ mov psdata_seg:$P_2nd_Val,ax ;AC034;
+ or bl,bl ;AN000; end of line ?
+ je $P_TimeF_Rlt ;AN000;
+
+;(;AN032; deleted) mov bl,bh ;set decimal separator
+ mov bl,$P_period_only ;AN032; flag, which to decimal separator
+ call $P_Get_DecNum ;AN000; get 3rd number
+ jc $P_TimeF_Err0 ;AC039; if problem, bridge to error
+
+ mov psdata_seg:$P_3rd_Val,ax ;AC034;
+ or bl,bl ;AN000; end of line ?
+;(DELETED ;AN039;) je $P_TimeF_Rlt ;AN000;
+ jne $P_Time_4 ;AN039; NOT END OF LINE,
+ ;AN039; GO TO 4TH NUMBER
+ test psdata_seg:$P_Flags1,$P_Time_Again ;AN039; HAS TIME PARSE
+ ;AN039; BEEN REPEATED?
+ jnz $P_TimeF_Rlt ;AN039; yes, this is really
+ ;AN039; the end of line
+ ;AN039; no, time has not been repeated
+ mov si,psdata_seg:$P_SI_Save ;AN039; get where parser quit
+ ;AN039; in command line
+ cmp byte ptr [si-1],$P_Comma ;AN039; look at delimiter
+ ;AN039; from command line
+ jne $P_TimeF_Rlt ;AN039; was not a comma, this is
+ ;AN039; really end of line
+ ;AN039; is comma before hundredths,
+ ;AN039; redo TIME
+ mov byte ptr [si-1],$P_Period ;AN039; change that ambiguous
+ ;AN039; comma to a decimal point
+ ;AN039; parse can understand
+ mov psdata_seg:$P_Flags,0 ;AN039; Clear all internal flags
+ or psdata_seg:$P_Flags1,$P_Time_Again ;AN039; indicate TIME
+ ;AN039; is being repeated
+ mov cx,psdata_seg:$P_ORIG_ORD ;AN039; ORIGINAL ORDINAL FROM CX
+ mov sp,psdata_seg:$P_ORIG_STACK ;AN039; ORIGINAL VALUE
+ ;AN039; OF STACK FROM SP
+ mov si,psdata_seg:$P_ORIG_SI ;AN039; ORIGINAL START
+ ;AN039; PARSE POINTER FROM SI
+ jmp $P_Redo_Time ;AN039; go try TIME again
+; ===============================================================
+$P_Time_4: ;AN039; READY FOR 4TH (HUNDREDTHS) NUMBER
+ call $P_Get_DecNum ;AN000; get 4th number
+$P_TimeF_Err0: ;AN000; Bridge
+ jc $P_TimeF_Error ;AN000;
+
+ mov psdata_seg:$P_4th_Val,ax ;AC034;
+ or bl,bl ;AN000; After hundredth, no data allowed
+ jne $P_TimeF_Error ;AN000; if some, then error
+
+$P_TimeF_RLT: ;AN000;
+ mov ax,psdata_seg:$P_1st_Val ;AC034;
+ or ah,ah ;AN000; if overflow then error
+ jne $P_TimeF_Err ;AN000;
+
+ test psdata_seg:$P_Flags1,$P_Time12am ;AN038;if "am" specified
+ jz $P_Time_notAM ;AN038;skip if no "AM" specified
+ ;since "AM" was specified,
+ cmp al,12 ;AN038: if hour specified as later than noon
+ ja $P_TimeF_Err ;AN038; error if "AM" on more than noon
+ jne $P_Time_notAM ;AN038; for noon exactly,
+
+ xor al,al ;AN038; set hour = zero
+$P_Time_notAM: ;AN038;
+ test psdata_seg:$P_Flags2,$P_Time12 ;AC034; if 12 hour system and pm is specified
+ je $P_TimeSkip00 ;AN000; then
+
+ cmp al,12 ;AN038; if 12:00 o'clock already
+ je $P_TimeSkip00 ;AN038; it is PM already
+
+ add al,12 ;AN000; add 12 hours to make it afternoon
+ jc $P_TimeF_Err ;AN000; if overflow then error
+
+ cmp al,24 ;AN038; after adding 12, now cannot be >24
+ ja $P_TimeF_Err ;AN038; if too big, error
+
+$P_TimeSkip00: ;AN000;
+ mov dl,al ;AN000; set hour
+ mov ax,psdata_seg:$P_2nd_Val ;AC034;
+ or ah,ah ;AN000; if overflow then error
+ jne $P_TimeF_Err ;AN000;
+
+ mov dh,al ;AN000; set minute
+ mov ax,psdata_seg:$P_3rd_Val ;AC034;
+ or ah,ah ;AN000; if overflow then error
+ jne $P_TimeF_Err ;AN000;
+
+ mov cl,al ;AN000; set second
+ mov ax,psdata_seg:$P_4th_Val ;AC034;
+ or ah,ah ;AN000; if overflow then error
+ jne $P_TimeF_Err ;AN000;
+
+ mov ch,al ;AN000; set hundredth
+ pop bx ;AN000; recover CONTROL block
+ pop si ;AN000; recover string pointer
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_Time_F ;AN000; result
+ call $P_Fill_Result ;AN000; buffer
+ jmp short $P_Time_Format_Exit ;AN000; to time
+
+$P_TimeF_Error: ;AN000;
+$P_TimeF_Err: ;AN000;
+ pop bx ;AN000; recover CONTROL block
+ pop si ;AN000; recover string pointer
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_String ;AN000; result
+ call $P_Fill_Result ;AN000; buffer to string
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; return syntax error
+$P_Time_Format_Exit: ;AN000;
+ mov psdata_seg:$P_Got_Time,0 ;AN023;AC034;; finished with this time field
+ pop dx ;AN000;
+ pop cx ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Time_Format endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Time_2412:
+;
+; Function: Remove "a", "p", "am", or "pm" from the end of stinrg
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+;
+; Output: Set $P_Time12 flag when the string is terminated by "p"
+; or "pm"
+;
+; Vars: $P_Flags(W)
+;***********************************************************************
+$P_Time_2412 proc ;AN000;
+ push ax ;AN000;
+ push si ;AN000;
+$P_T12_Loop: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; Move
+ inc si ;AN000; si
+ or al,al ;AN000; to
+ jne $P_T12_Loop ;AN000; end of string
+
+ mov al,psdata_seg:[si-word] ;AN000; get char just before NULL
+ or al,$P_Make_Lower ;AN000; lower case map
+ cmp al,"p" ;AN000; only "p" of "pm" ?
+ je $P_T1200 ;AN000;
+
+ cmp al,"a" ;AN000; only "a" of "am" ?
+ je $P_T1201 ;AN000;
+
+ cmp al,"m" ;AN000; "m" of "am" or "pm"
+ jne $P_T12_Exit ;AN000;
+
+ dec si ;AN000;
+ mov al,psdata_seg:[si-word] ;AN000;
+ or al,$P_Make_lower ;AN000; lower case map
+ cmp al,"p" ;AN000; "p" of "pm" ?
+ je $P_T1200 ;AN000;
+
+ cmp al,"a" ;AN000; "a" of "am" ?
+ je $P_T1201 ;AN000; go process "a"
+
+ jmp short $P_T12_Exit ;AN000; no special chars found
+
+$P_T1200: ;AN000; "P" found
+ or psdata_seg:$P_Flags2,$P_Time12 ;AC034; flag "PM" found
+ jmp short $P_Tclr_chr ;AN038; go clear the special char
+
+$P_T1201: ;AN000; "A" found
+ or psdata_seg:$P_Flags1,$P_Time12AM ;AN038; flag "AM" found
+$P_Tclr_chr: ;AN038;
+ mov byte ptr psdata_seg:[si-2],$P_NULL ;AN000; null out special char
+$P_T12_Exit: ;AN000;
+ pop si ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Time_2412 endp ;AN000;
+ENDIF ;AN000;(of TimeSW)
+PAGE ;AN000;
+;***********************************************************************
+IF CmpxSW ;AN000;(Check if complex item is supported)
+; $P_Complex_Format:
+;
+; Function: Check if the input string is valid complex format.
+; And set the result buffer.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim
+; $P_Quoted_str, $P_Chk_DSQuote
+;
+; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R), $P_Save_EOB(R)
+;***********************************************************************
+$P_Complex_Format proc ;AN000;
+ push ax ;AN000;
+ push bx ;AN000;
+ push si ;AN000;
+ mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer
+ cmp byte ptr [bx],$P_Lparen ;AN000; 1st char = left parentheses
+ jne $P_Cmpx_Err ;AN000;
+
+ xor ah,ah ;AN000; ah = parentheses counter
+$P_Cmpx_Loop: ;AN000;
+ mov al,[bx] ;AN000; load character from command buffer
+ call $P_Chk_EOL ;AN000; if it is one of EOL
+ je $P_CmpxErr0 ;AN000; then error exit.
+
+ cmp al,$P_Lparen ;AN000; left parentheses ?
+ jne $P_Cmpx00 ;AN000; then
+
+ inc ah ;AC035; add '1' to AH reg
+ ;AN000; increment parentheses counter
+;(replaced ;AC035;) add ah,1 ;AN000; increment parentheses counter
+ jc $P_CmpxErr0 ;AN000; if overflow, error
+$P_Cmpx00: ;AN000;
+ cmp al,$P_Rparen ;AN000; right parentheses ?
+ jne $P_Cmpx01 ;AN000; then
+
+ dec ah ;AC035; subtract '1' from AH reg
+ ;AN000; decrement parentheses counter
+;(changed ;AC035;) sub ah,1 ;AN000; decrement parentheses counter
+ jc $P_CmpxErr0 ;AN000; if overflow error
+
+ je $P_Cmpx03 ;AN000; ok, valid complex
+
+$P_Cmpx01: ;AN000;
+;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; double or single quotation mark ? 3/17/KK
+ cmp al,$P_DQuote ;AN025; double quotation mark?
+ jne $P_Cmpx04 ;AN000; 3/17/KK
+
+ mov psdata_seg:[si],al ;AN000; here quoted string is found in the complex list.
+ inc si ;AN000;
+ inc bx ;AN000; bx points to 2nd character
+ call $P_Quoted_Str ;AN000; skip pointers until closing of quoted string
+ jc $P_CmpxErr0 ;AN000; if error in quoted string syntax then exit
+
+ jmp short $P_Cmpx05 ;AN000;
+
+$P_Cmpx04: ;AN000;
+ call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ?
+ jnc $P_Cmpx02 ;AN000;
+
+ mov psdata_seg:[si],al ;AN000; then store 1st byte
+ inc si ;AN000;
+ inc bx ;AN000;
+ mov al,[bx] ;AN000; load 2nd byte
+$P_Cmpx02: ;AN000;
+ mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS
+$P_Cmpx05: ;AN000;
+ inc si ;AN000;
+ inc bx ;AN000;
+ jmp short $P_Cmpx_Loop ;AN000; loop
+;---- ;AN000;
+$P_Cmpx03: ;AN000;
+ mov byte ptr psdata_seg:[si],al ;AN000;
+ mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000;
+ mov byte ptr [bx],$P_NULL ;AN000; replace right parentheses with NULL
+ mov si,bx ;AN000; skip whitespaces
+ inc si ;AN000; after
+ call $P_Skip_Delim ;AN000; right parentheses
+ mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
+ jmp short $P_Cmpx_Exit ;AN000;
+
+$P_CmpxErr0: ;AN000;
+ mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark
+$P_Cmpx_Err: ;AN000;
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034;
+$P_Cmpx_Exit: ;AN000;
+ mov ah,$P_No_Tag ;AN000;
+ mov al,$P_Complex ;AN000;
+ pop si ;AN000;
+ pop bx ;AN000;
+ call $P_Fill_Result ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Complex_Format endp ;AN000;
+ENDIF ;AN000;(of CpmxSW)
+PAGE ;AN000;
+;***********************************************************************
+IF QusSW ;AN000;(Check if quoted string is supported)
+; $P_Quoted_Format:
+;
+; Function: Check if the input string is valid quoted string format.
+; And set the result buffer.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Chk_DBCS, $P_Chk_EOL, $P_Skip_Delim
+; $P_Chk_DSQuote, $P_Quoted_Str
+;
+; Vars: $P_RC(W), $P_SI_Save(W), $P_SaveSI_Cmpx(R),$P_Save_EOB(R)
+;***********************************************************************
+$P_Quoted_Format proc ;AN000;
+ push ax ;AN000;
+ push bx ;AN000;
+ push si ;AN000;
+ mov bx,psdata_seg:$P_SaveSI_Cmpx ;AC034; bx points to user buffer
+ mov al,byte ptr [bx] ;AN000; get 1st character
+;(deleted ;AN025;) call $P_Chk_DSQuote ;AN000; is it single or double quote ?
+ cmp al,$P_DQuote ;AN025; double quotation mark?
+ jne $P_Qus_Err ;AN000; if no, error
+
+; mov psdata_seg:[si],al ;AN000; move it to internal buffer
+; inc si ;AN000;
+ inc bx ;AN000; bx points to 2nd character
+ call $P_Quoted_Str ;AN000; skip pointers to the closing of quoted string
+ jc $P_Qus_Err0 ;AN000; if invali quoted string syntax, exit
+
+ mov byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; end up with NULL
+ mov si,bx ;AN000;
+ inc si ;AN000;
+ call $P_Skip_Delim ;AN000; skip whitespaces after closing quote
+ mov psdata_seg:$P_SI_Save,si ;AC034; save next pointer, SI
+ jmp short $P_Qus_Exit ;AN000;
+
+$P_Qus_Err0: ;AN000;
+ mov si,psdata_seg:$P_Save_EOB ;AC034; if EOF encountered, restore
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN000; EOB mark
+$P_Qus_Err: ;AN000;AN000
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034; indicate syntax error
+$P_Qus_Exit: ;AN000;
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_Quoted_String ;AN000; result
+ pop si ;AN000; buffer
+ pop bx ;AN000; to
+ call $P_Fill_Result ;AN000; quoted string
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Quoted_Format endp ;AN000;
+ENDIF ;AN000;(of QusSW)
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_DSQuote;
+;
+; Function: Check if AL is double quotation or single quotation
+;
+; Input: AL = byte to be examineed
+;
+; Output: ZF on if AL is single or double quotetaion
+;
+; Vars: $P_SorD_Quote(W)
+;***********************************************************************
+IF QusSW+CmpxSW ;AN000;(Check if quoted string or complex item is supported)
+;(deleted ;AN025;) $P_Chk_DSQuote proc ;
+;(deleted ;AN025;) mov $P_SorD_Quote,$P_SQuote ; 3/17/87 assume single quote
+;(deleted ;AN025;) cmp al,$P_DQuote ; 1st char = double quotation ?
+;(deleted ;AN025;) jne $P_CDSQ00 ; 3/17/87
+;(deleted ;AN025;) mov $P_SorD_Quote,al ; 3/17/87 set bigning w/ double quote
+;(deleted ;AN025;) ret ; 3/17/87
+;(deleted ;AN025;) $P_CDSQ00: ; 3/17/87
+;(deleted ;AN025;) cmp al,$P_SQuote ; 1st char = single quotation ?
+;(deleted ;AN025;) ret ;
+;(deleted ;AN025;) $P_Chk_DSQuote endp ;
+ PAGE ;AN000;
+;***********************************************************************
+; $P_Quoted_Str:
+;
+; Function: Copy chracacter from ES:BX to psdata_seg:SI until closing single
+; (double) quotation found.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> Operand in command buffer
+;
+; Output: CY on indicates EOF encounterd before closing quotation
+; BX and SI
+;
+;
+; Vars: $P_SorD_Quote(R)
+;***********************************************************************
+$P_Quoted_Str proc ;AN000;
+ push ax ;AN000;
+$P_Qus_Loop: ;AN000;
+ mov ax,[bx] ;AN000; 3/17/87
+ call $P_Chk_EOL ;AN000;
+ je $P_Qustr_Err0 ;AN000;
+
+;(deleted ;AN025;) cmp al,$P_SorD_Quote ;AN000; quotation ? 3/17/87
+ cmp al,$P_DQuote ;AN025; double quote?
+ jne $P_Qus00 ;AN000;
+
+;(deleted ;AN025;) cmp ah,$P_SorD_Quote ;AN000; contiguous quotation 3/17/87
+ cmp ah,$P_DQuote ;AN025; double quote?
+ jne $P_Qus02 ;AN000;
+
+;(deleted ;AN025:) mov word ptr psdata_seg:[si],ax ;AN000; 3/17/87
+ mov byte ptr psdata_seg:[si],al ;AN025; save one of the quotes
+;(deleted ;AN025:) add si,2 ;AN000;
+
+ inc si ;AC035; add '1' to SI reg
+ ;AN025; adjust target index
+;(changed ;AC035;) add si,1 ;AN025; adjust target index
+ inc bx ;AC035; add '2' to
+ inc bx ;AC035; BX reg
+ ;AN000; adjust source index by 2 to skip extra quote
+;(changed ;AC035;) add bx,2 ;AN000; adjust source index by 2 to skip extra quote
+ jmp short $P_Qus_Loop ;AN000;
+
+$P_Qus00: ;AN000;
+ call $P_Chk_DBCS ;AN000; was it a lead byte of DBCS ?
+ jnc $P_Qus01 ;AN000;
+
+ mov psdata_seg:[si],al ;AN000; store 1st byte
+ inc si ;AN000;
+ inc bx ;AN000;
+ mov al,[bx] ;AN000; load 2nd byte
+$P_Qus01: ;AN000;
+ mov psdata_seg:[si],al ;AN000; store SBCS or 2nd byte of DBCS
+ inc si ;AN000;
+ inc bx ;AN000;
+ jmp short $P_Qus_Loop ;AN000;
+
+$P_Qustr_Err0: ;AN000;
+ stc ;AN000; indicate error
+ jmp short $P_Quoted_Str_Exit ;AN000;
+
+$P_Qus02: ;AN000;
+ mov byte ptr psdata_seg:[si],0 ;AN000;
+ clc ;AN000; indicate no error
+$P_Quoted_Str_Exit: ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Quoted_Str endp ;AN000;
+ENDIF ;AN000;(of QusSW+CmpxSW)
+PAGE ;AN000;
+;***********************************************************************
+IF FileSW+DrvSW ;AN000;(Check if file spec or drive only is supported)
+; $P_File_Format;
+;
+; Function: Check if the input string is valid file spec format.
+; And set the result buffer.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Chk_DBCS, $P_FileSp_Chk
+;
+; Vars: $P_RC(W), $P_SI_Save(W), $P_Terminator(W), $P_SaveSI_Cmpx(R)
+; $P_SaveSI_Cmpx(R)
+;***********************************************************************
+$P_File_Format proc ;AN000;
+ push ax ;AN000;
+ push di ;AN000;
+ push si ;AN000;
+ mov di,psdata_seg:$P_SaveSI_cmpx ;AC034; get user buffer address
+$P_FileF_Loop0: ;AN000; / skip special characters
+ mov al,psdata_seg:[si] ;AN000; load character
+ or al,al ;AN000; end of line ?
+ je $P_FileF_Err ;AN000; if yes, error exit
+
+ call $P_FileSp_Chk ;AN000; else, check if file special character
+ jne $P_FileF03 ;AN000; if yes,
+
+;AN033; deleted inc di ;skip
+;AN033; deleted inc si ; the
+;AN033; deleted jmp short $P_FileF_Loop0 ; character
+ mov psdata_seg:$P_err_flag,$P_error_filespec ;AN033;AC034;; set error flag- bad char.
+ pop si ;AN033;
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN033;
+ pop di ;AN033;
+ jmp short $P_FileF02 ;AN033;
+
+
+$P_FileF_Err: ;AN000;
+ pop si ;AN000;
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN000;
+;(deleted ;AN030;) mov di,$P_SaveSI_cmpx ;AN000; get user buffer address
+;(deleted ;AN030;) mov $P_SI_Save,di ;AN000; update pointer to user buffer
+ pop di ;AN000;
+ test es:[bx].$P_Match_Flag,$P_Optional ;AN000; is it optional ?
+ jne $P_FileF02 ;AN000;
+
+ mov psdata_seg:$P_RC,$P_Op_Missing ;AC034; 3/17/87
+ jmp short $P_FileF02 ;AN000;
+
+$P_FileF03: ;AN000;
+ pop ax ;AN000; discard save si
+ push si ;AN000; save new si
+$P_FileF_Loop1: ;AN000;
+ mov al,psdata_seg:[si] ;AN000; load character (not special char)
+ or al,al ;AN000; end of line ?
+ je $P_FileF_RLT ;AN000;
+
+ call $P_FileSp_Chk ;AN000; File special character ?
+ je $P_FileF00 ;AN000;
+
+ call $P_Chk_DBCS ;AN000; no, then DBCS ?
+ jnc $P_FileF01 ;AN000;
+ inc di ;AN000; if yes, skip next byte
+ inc si ;AN000;
+$P_FileF01: ;AN000;
+ inc di ;AN000;
+ inc si ;AN000;
+ jmp short $P_FileF_Loop1 ;AN000;
+;
+$P_FileF00: ;AN000;
+ mov psdata_seg:$P_Terminator,al ;AC034;
+ mov byte ptr psdata_seg:[si],$P_NULL ;AN000; update end of string
+ inc di ;AN000;
+ mov psdata_seg:$P_SI_Save,di ;AC034; update next pointer in command line
+$P_FileF_RLT: ;AN000;
+ pop si ;AN000;
+ pop di ;AN000;
+$P_FileF02: ;AN000;
+
+ pop ax ;AN000; (tm14)
+ test ax,$P_File_Spc ;AN000; (tm14)
+ je $P_Drv_Only_Exit ;AN000; (tm14)
+
+ push ax ;AN000; (tm14)
+
+ mov ah,$P_No_Tag ;AN000; set
+ mov al,$P_File_Spec ;AN000; result
+ call $P_Fill_Result ;AN000; buffer to file spec
+ pop ax ;AN000;
+
+$P_Drv_Only_Exit: ;AN000; (tm14)
+
+ ret ;AN000;
+$P_File_Format endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_FileSp_Chk
+;
+; Function: Check if the input byte is one of file special characters
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; AL = character code to be examineed
+;
+; Output: ZF = 1 , AL is one of special characters
+;***********************************************************************
+$P_FileSp_Chk proc ;AN000;
+ push bx ;AN000;
+ push cx ;AN000;
+ lea bx,psdata_seg:$P_FileSp_Char ;AC034; special character table
+ mov cx,$P_FileSp_Len ;AN000; load length of it
+$P_FileSp_Loop: ;AN000;
+ cmp al,psdata_seg:[bx] ;AN000; is it one of special character ?
+ je $P_FileSp_Exit ;AN000;
+
+ inc bx ;AN000;
+ loop $P_FileSp_Loop ;AN000;
+
+ inc cx ;AN000; reset ZF
+$P_FileSp_Exit: ;AN000;
+ pop cx ;AN000;
+ pop bx ;AN000;
+ ret ;AN000;
+$P_FileSp_Chk endp ;AN000;
+ENDIF ;AN000;(of FileSW+DrvSW)
+PAGE ;AN000;
+;***********************************************************************
+IF DrvSW ;AN000;(Check if drive only is supported)
+; $P_Drive_Format;
+;
+; Function: Check if the input string is valid drive only format.
+; And set the result buffer.
+;
+; Input: psdata_seg:SI -> $P_STRING_BUF
+; ES:BX -> CONTROL block
+;
+; Output: None
+;
+; Use: $P_Fill_Result, $P_Chk_DBCS
+;
+; Vars: $P_RC(W)
+;***********************************************************************
+$P_Drive_Format proc ;AN000;
+ push ax ;AN000;
+ push dx ;AN000;
+ mov al,psdata_seg:[si] ;AN000;
+ or al,al ;AN000; if null string
+ je $P_Drv_Exit ;AN000; do nothing
+
+ call $P_Chk_DBCS ;AN000; is it leading byte ?
+ jc $P_Drv_Err ;AN000;
+
+ cmp word ptr psdata_seg:[si+byte],$P_Colon ;AN000; "d", ":", 0 ?
+ je $P_DrvF00 ;AN000;
+
+ test es:[bx].$P_Match_Flag,$P_Ig_Colon ;AN000; colon can be ignored?
+ je $P_Drv_Err ;AN000;
+
+ cmp byte ptr psdata_seg:[si+byte],$P_NULL ;AN000; "d", 0 ?
+ jne $P_Drv_Err ;AN000;
+
+$P_DrvF00: ;AN000;
+ or al,$P_Make_Lower ;AN000; lower case
+ cmp al,"a" ;AN000; drive letter must
+ jb $P_Drv_Err ;AN000; in range of
+
+ cmp al,"z" ;AN000; "a" - "z"
+ ja $P_Drv_Err ;AN000; if no, error
+
+ sub al,"a"-1 ;AN000; make text drive to binary drive
+ mov dl,al ;AN000; set
+ mov ah,$P_No_Tag ;AN000; result
+ mov al,$P_Drive ;AN000; buffer
+ call $P_Fill_Result ;AN000; to drive
+ jmp short $P_Drv_Exit ;AN000;
+
+$P_Drv_Err: ;AN000;
+ mov psdata_seg:$P_RC,$P_Syntax ;AC034;
+$P_Drv_Exit: ;AN000;
+ pop dx ;AN000;
+ pop ax ;AN000;
+ ret ;AN000;
+$P_Drive_Format endp ;AN000;
+ENDIF ;AN000;(of DrvSW)
+PAGE ;AN000;
+;***********************************************************************
+; $P_Skip_Delim;
+;
+; Function: Skip delimiters specified in the PARMS list, white space
+; and comma.
+;
+; Input: DS:SI -> Command String
+; ES:DI -> Parameter List
+;
+; Output: CY = 1 if the end of line encounterd
+; CY = 0 then SI move to 1st non-delimiter character
+; AL = Last examineed character
+;
+; Use: $P_Chk_EOL, $P_Chk_Delim,
+;
+; Vars: $P_Flags(R)
+;***********************************************************************
+$P_Skip_Delim proc ;AN000;
+$P_Skip_Delim_Loop: ;AN000;
+ LODSB ;AN000;
+ call $P_Chk_EOL ;AN000; is it EOL character ?
+ je $P_Skip_Delim_CY ;AN000; if yes, exit w/ CY on
+
+ call $P_Chk_Delim ;AN000; is it one of delimiters ?
+ jne $P_Skip_Delim_NCY ;AN000; if no, exit w/ CY off
+
+ test psdata_seg:$P_Flags2,$P_Extra ;AC034; extra delim or comma found ?
+ je $P_Skip_Delim_Loop ;AN000; if no, loop
+
+ test psdata_seg:$P_Flags2,$P_SW+$P_equ ;AC034; /x , or xxx=zzz , (tm08)
+ je short $P_Exit_At_Extra ;AN000; no switch, no keyword (tm08)
+
+ dec si ;AN000; backup si for next call (tm08)
+ jmp short $P_Exit_At_Extra ;AN000; else exit w/ CY off
+
+$P_Skip_Delim_CY: ;AN000;
+ stc ;AN000; indicate EOL
+ jmp short $P_Skip_Delim_Exit ;AN000;
+
+$P_Skip_Delim_NCY: ;AN000;
+ clc ;AN000; indicate non delim
+$P_Skip_Delim_Exit: ;AN000; in this case, need
+ dec si ;AN000; backup index pointer
+ ret ;AN000;
+
+$P_Exit_At_Extra: ;AN000;
+ clc ;AN000; indicate extra delim
+ ret ;AN000;
+$P_Skip_Delim endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_EOL;
+;
+; Function: Check if AL is one of End of Line characters.
+;
+; Input: AL = character code
+; ES:DI -> Parameter List
+;
+; Output: ZF = 1 if one of End of Line characters
+;**********************************************************************
+$P_Chk_EOL proc ;AN000;
+ push bx ;AN000;
+ push cx ;AN000;
+ cmp al,$P_CR ;AN000; Carriage return ?
+ je $P_Chk_EOL_Exit ;AN000;
+
+ cmp al,$P_NULL ;AN000; zero ?
+ je $P_Chk_EOL_Exit ;AN000;
+
+IF LFEOLSW ;AN028; IF LF TO BE ACCEPTED AS EOL
+ cmp al,$P_LF ;AN000; Line feed ?
+ je $P_Chk_EOL_Exit ;AN000;
+ENDIF ;AN028;
+
+ cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_EOL ;AN000; EOL character specified ?
+ jb $P_Chk_EOL_Exit ;AN000;
+
+ xor bx,bx ;AN000;
+ mov bl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list
+ add bx,$P_Len_PARMS ;AN000; skip it
+ cmp byte ptr es:[bx+di],$P_I_Use_Default ;AN000; No extra EOL character ?
+ je $P_Chk_EOL_NZ ;AN000;
+
+ xor cx,cx ;AN000; Get number of extra chcracter
+ mov cl,es:[bx+di] ;AN000;
+$P_Chk_EOL_Loop: ;AN000;
+ inc bx ;AN000;
+ cmp al,es:[bx+di] ;AN000; Check extra EOL character
+ je $P_Chk_EOL_Exit ;AN000;
+
+ loop $P_Chk_EOL_Loop ;AN000;
+
+$P_Chk_EOL_NZ: ;AN000;
+ cmp al,$P_CR ;AN000; reset ZF
+$P_Chk_EOL_Exit: ;AN000;
+ pop cx ;AN000;
+ pop bx ;AN000;
+ ret ;AN000;
+$P_Chk_EOL endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_Delim;
+;
+; Function: Check if AL is one of delimiter characters.
+; if AL+[si] is DBCS blank, it is replaced with two SBCS
+; blanks.
+;
+; Input: AL = character code
+; DS:SI -> Next Character
+; ES:DI -> Parameter List
+;
+; Output: ZF = 1 if one of delimiter characters
+; SI points to the next character
+; Vars: $P_Terminator(W), $P_Flags(W)
+;***********************************************************************
+$P_Chk_Delim proc ;AN000;
+ push bx ;AN000;
+ push cx ;AN000;
+ mov psdata_seg:$P_Terminator,$P_Space ;AC034; Assume terminated by space
+ and psdata_seg:$P_Flags2,0ffh-$P_Extra ;AC034;
+ cmp al,$P_Space ;AN000; Space ?
+ je $P_Chk_Delim_Exit ;AN000;
+
+ cmp al,$P_TAB ;AN000; TAB ?
+ je $P_Chk_Delim_Exit ;AN000;
+
+ cmp al,$P_Comma ;AN000; Comma ?
+ je $P_Chk_Delim_Exit0 ;AN000;
+
+$P_Chk_Delim00: ;AN000;
+ cmp al,$P_DBSP1 ;AN000; 1st byte of DBCS Space ?
+ jne $P_Chk_Delim01 ;AN000;
+
+ cmp byte ptr [si],$P_DBSP2 ;AN000; 2nd byte of DBCS Space ?
+ jne $P_Chk_Delim01 ;AN000;
+
+ mov al,$P_Space ;AN000;
+ inc si ;AN000; make si point to next character
+ cmp al,al ;AN000; Set ZF
+ jmp short $P_Chk_Delim_Exit ;AN000;
+
+$P_Chk_Delim01: ;AN000;
+ cmp byte ptr es:[di].$P_Num_Extra,$P_I_Have_Delim ;AN000; delimiter character specified ?
+ jb $P_Chk_Delim_Exit ;AN000;
+
+ xor cx,cx ;AN000;
+ mov cl,es:[di].$P_Len_Extra_Delim ;AN000; get length of delimiter list
+ or cx,cx ;AN000; No extra Delim character ?
+ je $P_Chk_Delim_NZ ;AN000;
+
+ mov bx,$P_Len_PARMS-1 ;AN000; set bx to 1st extra delimiter
+$P_Chk_Delim_Loop: ;AN000;
+ inc bx ;AN000;
+ cmp al,es:[bx+di] ;AN000; Check extra Delim character
+ je $P_Chk_Delim_Exit0 ;AN000;
+
+ loop $P_Chk_Delim_Loop ;AN000; examine all extra delimiter
+
+$P_Chk_Delim_NZ: ;AN000;
+ cmp al,$P_Space ;AN000; reset ZF
+$P_Chk_Delim_Exit: ;AN000;
+;;;; jne $P_ChkDfin
+;;;; mov psdata_seg:$P_Terminator,al ;AN034;
+$P_ChkDfin: ;AN000;
+ pop cx ;AN000;
+ pop bx ;AN000;
+ ret ;AN000;
+
+$P_Chk_Delim_Exit0: ;AN000;
+ mov psdata_seg:$P_Terminator,al ;AC034; keep terminated delimiter
+ test psdata_seg:$P_Flags2,$P_Equ ;AN027;AC034;; if terminating a key=
+ jnz $P_No_Set_Extra ;AN027; then do not set the EXTRA bit
+
+ or psdata_seg:$P_Flags2,$P_Extra ;AC034; flag terminated extra delimiter or comma
+$P_No_Set_Extra: ;AN027;
+ cmp al,al ;AN000; set ZF
+ jmp short $P_Chk_Delim_Exit ;AN000;
+
+$P_Chk_Delim endp ;AN000;
+PAGE ;AN000;
+;***********************************************************************
+; $P_Chk_Switch;
+;
+; Function: Check if AL is the switch character not in first position of
+; $P_STRING_BUF
+;
+; Input: AL = character code
+; BX = current pointer within $P_String_Buf
+; SI =>next char on command line (following the one in AL)
+;
+; Output: CF = 1 (set)if AL is switch character, and not in first
+; position, and has no chance of being part of a date string,
+; i.e. should be treated as a delimiter.
+
+; CF = 0 (reset, cleared) if AL is not a switch char, is in the first
+; position, or is a slash but may be part of a date string, i.e.
+; should not be treated as a delimiter.
+;
+; Vars: $P_Terminator(W)
+
+; Use: $P_0099
+;***********************************************************************
+$P_Chk_Switch proc ;AN000;
+
+;AN020;; Function: Check if AL is the switch character from 2nd position of $P_STRING_BUF
+;AN020;; Output: ZF = 1 if switch character
+;AN020;; lea bp,$P_STRING_BUF ;AN000;
+;AN020;; cmp bx,bp ;AN000; 1st position ?
+;AN020;; je $P_Chk_S_Exit_1 ;AN000;
+;AN020;; cmp al,$P_Switch ;AN000;
+;AN020;; jmp short $P_Chk_S_Exit_0 ;AN000;
+;AN020;;$P_Chk_S_Exit_1: ;AN000;
+;AN020;; cmp al,$P_Switch ;AN000; (tm08)
+;AN020;; jne $P_Nop ;AN000; (tm08)
+;AN020;; or $P_Flags2,$P_SW ;AN000; (tm08) It could be valid switch
+;AN020;;$P_Nop: ;AN000; (tm08)
+;AN020;; inc bp ;AN000;
+;AN020;; cmp bx,bp ;AN000; reset ZF
+;AN020;;$P_Chk_S_Exit_0: ;AN000;
+;AN020;; jne $P_Chk_S_Exit ;AN000;
+;AN020;; mov $P_Terminator,al ;AN000; store switch character
+;AN020;;$P_Chk_S_Exit: ;AN000;
+
+ LEA BP,psdata_seg:$P_String_Buf ;AN020;AC034; BP=OFFSET of $P_String_Buf even in group addressing
+; .IF <BX NE BP> THEN ;AN020;IF not first char THEN
+ cmp BX,BP ;AN000;
+ je $P_STRUC_L2 ;AN000;
+
+; .IF <AL EQ $P_Switch> THEN ;AN020;otherwise see if a slash
+ cmp AL,$P_Switch ;AN000;
+ jne $P_STRUC_L5 ;AN000;
+
+ STC ;AN020;not in first position and is slash, now see if might be in date string
+IF DateSw ;AN020;caller looking for date, see if this may be part of one
+ PUSH AX ;AN020;save input char
+ MOV AL,PSDATA_SEG:[BX-1] ;AN026;AL=char before the current char
+ CALL $P_0099 ;AN020;return carry set if not numeric
+; .IF NC ;AND ;AN020;IF previous char numeric AND
+ jc $P_STRUC_L7 ;AN000;
+
+ MOV AL,[SI] ;AN020;AL=char after the current char
+ CALL $P_0099 ;AN020;return carry set if not numeric
+;(deleted) .IF NC THEN ;AN020;IF next char numeric THEN could be a date
+;(deleted) CLC ;AN020;reset CF so "/" not treated as a delimiter
+;(deleted) .ENDIF ;AN026;
+; .ENDIF ;AN020;ENDIF looks like date (number/number)
+$P_STRUC_L7: ;AN000;
+ POP AX ;AN020;restore AL to input char
+ENDIF ;AN020;DateSw
+; .ELSE ;AN020;
+ jmp short $P_STRUC_L1 ;AN000;
+
+$P_STRUC_L5: ;AN000;
+ CLC ;AN020;not a slash
+; .ENDIF ;AN020;
+; .ELSE ;AN020;is first char in the buffer, ZF=0
+ jmp short $P_STRUC_L1 ;AN000;
+
+$P_STRUC_L2: ;AN000;
+; .IF <AL EQ $P_Switch> THEN ;AN020;
+ cmp AL,$P_Switch ;AN000;
+ jne $P_STRUC_L12 ;AN000;
+
+ OR psdata_seg:$P_Flags2,$P_SW ;AN020;AC034;;could be valid switch, first char and is slash
+; .ENDIF ;AN020;
+$P_STRUC_L12: ;AN000;
+ CLC ;AN020;CF=0 indicating first char
+; .ENDIF ;AN020;
+$P_STRUC_L1: ;AN000;
+
+ ret ;AN000;
+$P_Chk_Switch endp ;AN000;
+ PAGE ;AN000;
+;**************************************************************************
+; $P_Chk_DBCS:
+;
+; Function: Check if a specified byte is in ranges of the DBCS lead bytes
+;
+; Input:
+; AL = Code to be examineed
+;
+; Output:
+; If CF is on then a lead byte of DBCS
+;
+; Use: INT 21h w/AH=63
+;
+; Vars: $P_DBCSEV_Seg(RW), $P_DBCSEV_Off(RW)
+;***************************************************************************
+$P_Chk_DBCS PROC ;AN000;
+;
+ PUSH DS ;AN000;
+ PUSH SI ;AN000;
+ PUSH bx ;AN000; (tm11)
+ CMP psdata_seg:$P_DBCSEV_SEG,0 ;AC034; ALREADY SET ?
+ JNE $P_DBCS00 ;AN000;
+
+ PUSH AX ;AN000;
+; PUSH BX ;AN000; (tm11)
+ PUSH ds ;AN000; (tm11)
+ PUSH CX ;AN000;
+ PUSH DX ;AN000;
+ PUSH DI ;AN000;
+ PUSH BP ;AN000;
+ PUSH ES ;AN000;
+ XOR SI,SI ;AN000;
+ MOV DS,SI ;AN000;
+ MOV AX,$P_DOS_GetEV ;AN000; GET DBCS EV CALL
+ INT 21H ;AN000;
+
+; MOV AX,DS ;AN000; (tm11)
+; OR AX,AX ;AN000; (tm11)
+ MOV bx,DS ;AN000; (tm11)
+ OR bx,bx ;AN000; (tm11)
+ POP ES ;AN000;
+ POP BP ;AN000;
+ POP DI ;AN000;
+ POP DX ;AN000;
+ POP CX ;AN000;
+; POP BX ;AN000; (tm11)
+ POP ds ;AN000; (tm11)
+ POP AX ;AN000;
+ JE $P_NON_DBCS ;AN000;
+
+$P_DBCS02: ;AN000;
+ MOV psdata_seg:$P_DBCSEV_OFF,SI ;AC034; save EV offset
+; MOV psdata_seg:$P_DBCSEV_SEG,DS ;AC034; save EV segment
+ MOV psdata_seg:$P_DBCSEV_SEG,bx ;AC034; save EV segment (tm11)
+$P_DBCS00: ;AN000;
+ MOV SI,psdata_seg:$P_DBCSEV_OFF ;AC034; load EV offset
+ MOV DS,psdata_seg:$P_DBCSEV_SEG ;AC034; and segment
+
+$P_DBCS_LOOP: ;AN000;
+ CMP WORD PTR [SI],0 ;AN000; zero vector ?
+ JE $P_NON_DBCS ;AN000; then exit
+
+ CMP AL,[SI] ;AN000;
+ JB $P_DBCS01 ;AN000; Check if AL is in
+
+ CMP AL,[SI+BYTE] ;AN000; range of
+ JA $P_DBCS01 ;AN000; the vector
+
+ STC ;AN000; if yes, indicate DBCS and exit
+ JMP short $P_DBCS_EXIT ;AN000;
+
+$P_DBCS01: ;AN000;
+ INC SI ;AC035; add '2' to
+ INC SI ;AC035; SI reg
+ ;AN000; get next vector
+;(changed ;AC035;) ADD SI,2 ;AN000; get next vector
+ JMP short $P_DBCS_LOOP ;AN000; loop until zero vector found
+
+$P_NON_DBCS: ;AN000;
+ CLC ;AN000; indicate SBCS
+$P_DBCS_EXIT: ;AN000;
+ POP bx ;AN000; (tm11)
+ POP SI ;AN000;
+ POP DS ;AN000;
+ RET ;AN000;
+$P_Chk_DBCS ENDP ;AN000;
diff --git a/private/mvdm/dos/v86/inc/pathmac.inc b/private/mvdm/dos/v86/inc/pathmac.inc
new file mode 100644
index 000000000..bc13cde47
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/pathmac.inc
@@ -0,0 +1,44 @@
+;;***********************************************************************
+;; NAME: pathlabl
+;; DESC: creates a public label at the spot it is placed, using the name
+;; given.
+;; INPUT: either module name or procedure name
+;; OUTPUT: public label
+;; LOGIC: LBL-parameter-name will have four values -
+;; - one for each pass (2)
+;; - one for start and one for stop
+;; if LBL is not defined, it is first pass, at beginning label
+;; - set it to 1 and create the start label
+;; if LBL = 1, it is first pass, at end label
+;; - set it to 2 and create stop label
+;; if LBL = 2, it is second pass, at beginning label
+;; - set it to 3 and create the start label
+;; if LBL = 3, it is second pass, at end label
+;; - set it to 4 and create stop label
+;; if LBL = 4, it is second pass,
+;; - this macro has been invoked more than twice with same parm
+;; - issue error message
+;;***********************************************************************
+IF1
+; %OUT COMPONENT=COMMON, MODULE=PATHMAC.INC ...
+ENDIF
+
+pathlabl MACRO pnam
+IFNDEF LBL_&pnam ;;IF THIS IS THE FIRST TIME,
+ LBL_&pnam = 0 ;;DEFINE IT, INITIALLY ZERO
+ELSE ;;SINCE IT IS DEFINED
+ IF (LBL_&pnam GT 3) ;;IF USED TOO MANY TIMES,
+ .ERR NON-UNIQUE OPERAND ON PATHLABL
+ EXITM ;;ABORT THIS GENERATION
+ ENDIF
+ENDIF
+
+IF (LBL_&pnam EQ 0) OR (LBL_&pnam EQ 2) ;;ready for START?
+ $$A_START_&pnam: ;;create START label
+ PUBLIC $$A_START_&pnam ;;make it public
+ELSE ;;SINCE SWITCH MAY BE 1 OR 3,
+ $$A_STOP_&pnam: ;;create STOP label
+ PUBLIC $$A_STOP_&pnam ;;make it public
+ENDIF
+LBL_&pnam = LBL_&pnam + 1 ;;INCREMENT SWITCH
+ENDM
diff --git a/private/mvdm/dos/v86/inc/pcgequ.inc b/private/mvdm/dos/v86/inc/pcgequ.inc
new file mode 100644
index 000000000..c49b8eb60
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/pcgequ.inc
@@ -0,0 +1,184 @@
+
+;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
+; CONDITIONAL ASSEMBLY CONTROLS
+;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
+WINTHORN EQU 1 ;OS/2 compatible
+
+;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
+; VIDEO REGISTER PORT ADDRESS EQUATES =B
+; =B
+;""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" =B
+seq_addr EQU 0C4H ;Sequencer Address =B
+seq_data EQU 0C5H ;Sequencer Data =B
+crtc_addr EQU 0D4H ;CRT Controller Address (Color) =B
+crtc_addr_b EQU 0B4H ;CRT Controller Address (Mono) =B
+crtc_data EQU 0D5H ;CRT Controller Data =B
+graph_1_pos EQU 0CCH ;Graphics 1 Position =B
+graph_2_pos EQU 0CAH ;Graphics 2 Position =B
+graph_addr EQU 0CEH ;Graphics 1 & 2 Address =B
+graph_data EQU 0CFH ;Graphics 1 & 2 Data =B
+misc_output EQU 0C2H ;Miscellaneous Output =B
+misc_read EQU 0CCH ;Miscellaneous Output Read Port Address =B
+in_stat_0 EQU 0C2H ;Input Status Register 0 =B
+input_status_b EQU 0BAH ;Feature Control (Mono) =B
+input_status EQU 0DAH ;Feature Control (Color) =B
+attr_read EQU 0C1H ;Attribute Controller Read Address =B
+attr_write EQU 0C0H ;Attribute Controller Write Address =B
+fctrl_read EQU 0CAH ;Feature Control Regiester Read Address =B
+
+;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+; SEQUENCER ADDRESS REGISTER EQUATES
+;
+;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+s_reset EQU 00H ;Reset =B
+s_clock EQU 01H ;Clocking Mode =B
+s_map EQU 02H ;Map Mask =B
+s_cgen EQU 03H ;Character Map Select =B
+s_mem EQU 04H ;Memory Mode =B
+
+
+;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+; GRAPHICS ADDRESS REGISTER EQUATES
+;
+;"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
+g_set_reset EQU 00H ;set/reset =B
+g_enbl_set EQU 01H ;enable set/reset =B
+g_clr_comp EQU 02H ;color compare =B
+g_data_rot EQU 03H ;data rotate =B
+g_read_map EQU 04H ;read map select =B
+g_mode EQU 05H ;mode =B
+g_misc EQU 06H ;miscellaneous =B
+g_color EQU 07H ;color don't care =B
+g_bit_mask EQU 08H ;bit mask =B
+
+;---------------------------------------------------------------------+
+; |
+; Miscellaneous Equates |
+; |
+;---------------------------------------------------------------------+
+
+LINELEN EQU 80 ; Length of a Graphics Buffer Line
+COLPELS EQU 8 ; Number of pels per text column
+;DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset
+;DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset
+;DEFCOFFR EQU 11 ; Default Pointer Icon Column Center Offst
+;DEFCOFFL EQU 4 ; Default Pointer Icon Column Center Offst
+;ICONROWS EQU 16 ; Number of Rows in Pointer Icon
+;M_WHITE EQU 15 ;default foreground color (icon)
+;M_DAXIS EQU 11 ;default axis mouse pointer
+
+DEFROFFU EQU 1 ; Default Pointer Icon Row Center Offset
+DEFROFFD EQU 14 ; Default Pointer Icon Row Center Offset
+DEFCOFFR EQU 14 ; Default Pointer Icon Column Center Offst
+DEFCOFFL EQU 2 ; Default Pointer Icon Column Center Offst
+ICONROWS EQU 20 ; Number of Rows in Pointer Icon
+M_DAXIS EQU 800 ;default axis mouse pointer
+
+ICONCOLS EQU 16 ; Number of Columns in Pointer Icon
+SHFTMSK EQU 07H ; Column Shift Count Bit Mask (Hi-Res)
+M_BLACK EQU 0 ;default background color (icon)
+M_WHITE EQU 15 ;default foreground color (icon)
+VSICONR EQU 28 ;# pel rows
+VSICONC EQU 2*8 ;# pel columns
+MVSICONR EQU 16 ;minimun pel rows in sb icon
+MHSICONC EQU 3*8 ;minimum pel cols in sb icon
+
+;;
+;; Long Conditional Jump Macros
+;;
+lja macro Farlabel
+ local Nearlabel
+ jna Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljae macro Farlabel
+ local Nearlabel
+ jnae Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljb macro Farlabel
+ local Nearlabel
+ jnb Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljc macro Farlabel
+ local Nearlabel
+ jnc Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljbe macro Farlabel
+ local Nearlabel
+ jnbe Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+lje macro Farlabel
+ local Nearlabel
+ jne Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljz macro Farlabel
+ local Nearlabel
+ jnz Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljg macro Farlabel
+ local Nearlabel
+ jng Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljge macro Farlabel
+ local Nearlabel
+ jnge Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljl macro Farlabel
+ local Nearlabel
+ jnl Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljle macro Farlabel
+ local Nearlabel
+ jnle Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljnc macro Farlabel
+ local Nearlabel
+ jc Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljne macro Farlabel
+ local Nearlabel
+ je Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljnz macro Farlabel
+ local Nearlabel
+ jz Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljno macro Farlabel
+ local Nearlabel
+ jo Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
+ljo macro Farlabel
+ local Nearlabel
+ jno Nearlabel
+ jmp Farlabel
+Nearlabel:
+ endm
diff --git a/private/mvdm/dos/v86/inc/pcinput.inc b/private/mvdm/dos/v86/inc/pcinput.inc
new file mode 100644
index 000000000..dc9452017
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/pcinput.inc
@@ -0,0 +1,3794 @@
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; Source...: PCINPUT.INC :
+; Created..: 01-01-82 :
+; Standards: 01-07-86 :
+; Revised..: 11-17-87 :
+; Version..: PC DOS :
+; Called as: FAR, NEAR or INT :
+; Public as: INPUT :
+; :
+;-----------------------------------------------------------------------------+
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; DEFAULT :
+; :
+; Performs the following functions: :
+; :
+; - Initializes pointers and counters :
+; - Initializes input buffer with default value (from screen or strg) :
+; - Set options and display input buffer as default on screen :
+; - Display field delimiters :
+; - Display minus or plus sign :
+; :
+; :
+; Entry: ES:SI = Points to current ICB :
+; DS:DI = Points to PB :
+; :
+; WR_CURSIZE = Current cursor size :
+; :
+; Exit: Default displayed :
+; :
+;-----------------------------------------------------------------------------+
+;
+DEFAULT PROC NEAR
+;
+; Initialize input buffer with default buffer
+;
+ PUSH BP
+ PUSH ES ;save registers
+ PUSH DS
+ PUSH DI
+ PUSH SI
+;
+ MOV DX,ES:[SI]+ICB_FIELDLEN ;save for later ;=W
+ MOV BX,ES:[SI]+ICB_DEFLEN ;save for later ;=W
+;
+ MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W
+ MOV DS,AX ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W
+ MOV DI,AX ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W
+ MOV CX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W
+ MOV SI,CX ;=W
+ MOV ES,AX ;=W
+;
+ PUSH DI
+ MOV CX,DX ;clear input buffer ;=W
+ MOV AL,WR_SPACE ;=W
+ CLD ;=W
+ REP STOSB ;=W
+ POP DI
+; ;=W
+ MOV BP,0
+ MOV CX,BX ;initialize number of bytes in ;=W
+ ; default string
+ CMP CX,DX ;check if default string is
+ JBE DEF10 ; longer than input buffer
+;
+ MOV CX,DX ;error set to input buffer leng
+ MOV BP,ICB_STRU ;set error indicating default was
+ ; truncated
+DEF10:
+ CLD
+ REP MOVSB ;move default into input buffer
+;
+ POP SI ;restore registers
+ POP DI
+ POP DS
+ POP ES
+;
+ OR ES:[SI]+ICB_STATUS,BP ;save error status
+ POP BP
+;
+; Calculate row and column of input field and set the desired display attribute
+;
+ MOV AX,ES:[SI]+ICB_ROW ;get input field row
+ MOV [DI]+CR_ROW,AX
+;
+ MOV AX,ES:[SI]+ICB_COL ;get input field column
+ MOV [DI]+CR_COL,AX
+;
+ CALL PCROWCL_CALL ;calculate row and column info
+ ; return CR_RCOFF and CR_BEGROWOFF
+ MOV AL,[DI]+WR_EATTR ;set the entry attribute to the
+ MOV [DI]+WR_CATTR,AL ; current attribute
+;
+; Initialize variables for left justified field
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if right justified
+ JNE DEF20
+;
+ MOV [DI]+WR_LEFTCHAR,1 ;set left character marker to
+ ;beginning of input field
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;get max field length ;=W
+;
+ TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scrolling ;=W
+ JE DEF15 ;no ;=W
+ MOV AX,ES:[SI]+ICB_WIDTH ;get field width for horizontal scrolling ;=W
+ ;because we only show a windowful of field ;=W
+DEF15: ;=W
+ MOV [DI]+WR_RIGHTCHAR,AX ;set ptr to rightmost character ;=W
+ CALL CAL_COORS ;get end of field char, byte ;=W
+ JMP DEF30 ;and next byte positions
+;
+; Initialize variables for right justified field
+;
+DEF20: ;
+ ; code here
+ ;
+;
+; Display default even if password option is active
+;
+DEF30: PUSH ES:[SI]+ICB_OPT1 ;save option word
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
+ JE DEF40
+;
+ AND ES:[SI]+ICB_OPT1,NOT ICB_PSW
+ ;set option word to force disp
+ ; of default value
+DEF40:
+ MOV AX,2 ;set option to actually display
+ CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper
+ ; justification
+ POP ES:[SI]+ICB_OPT1 ;restore original password
+;
+; Display initial cursor in proper size and location
+;
+ MOV AX,[DI]+IN_CURNOR ;set cursor size for replace
+ MOV [DI]+WR_CURSIZE,AX
+;
+ TEST ES:[SI]+ICB_STATUS,ICB_SINS
+ JE DEF45 ;check if insert is active
+;
+ MOV AX,[DI]+IN_CURINS ;set cursor size for insert
+ MOV [DI]+WR_CURSIZE,AX
+;
+DEF45:
+ CALL CAL_COORS ;calculate coordinates ;=W
+ CALL CURSOR ;initialize cursor size and locat
+;
+; Determine if characters in input buffer are allowonce chars and set flags
+;
+
+ jmp Def65 ;temp until bug in allowonce scan fixed
+
+ PUSH ES ;save registers
+ PUSH SI
+;
+ MOV BX,ES ;set segment of ICB
+ MOV DX,SI ;set offset of ICB
+;
+ MOV CX,ES:[SI]+ICB_FIELDLEN ;get field length
+;
+ PUSH ES:[SI]+ICB_FIELDOFF ;get field offset
+ PUSH ES:[SI]+ICB_FIELDSEG ;get field segment
+ POP ES
+ POP SI
+;
+DEF50: MOV AL,ES:[SI] ;get character from input buffer
+ MOV [DI]+DBC_KS,AL ; and set to PCINDBC PB
+;
+ INC SI ;point to next byte
+;
+ CALL PCINDBC_CALL ;call PCINDBC
+
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if keystroke double byte
+ JE DEF60
+;
+ CMP CX,0 ;if last loop is double character
+ JBE DEF60 ; and is missing trailing byte
+ ; then, consider a single byte
+;
+ MOV AH,ES:[SI] ;get character from input buffer
+ MOV [DI]+DBC_KS,AH ; and set to PCINDBC PB
+ INC SI ;point to next byte
+ DEC CX ;adjust loop pointer for additial
+ ; character read (double byte)
+;
+DEF60: PUSH ES ;save registers
+ PUSH SI
+;
+ MOV ES,BX ;load ICB
+ MOV SI,DX
+;
+ CALL ON_ALLOWONCE ;Scan the allowonce string for
+ ; the character in AX and set flag
+ ; if found
+ POP SI ;restore registers
+ POP ES
+;
+ LOOP DEF50 ;get next keystroke
+;
+ POP SI ;restore registers
+ POP ES
+;
+; Display field delimiters
+;
+DEF65: ;=W
+ MOV AX,01 ;assume "[ ]" as delimiters ;=W
+; ;=W
+ TEST ES:[SI]+ICB_OPT1,ICB_BEN ;display entry delimiters ;=W
+ JE DEF100 ;no, leave ;=W
+; ;=W
+ TEST ES:[SI]+ICB_OPT3,ICB_WIN ;does field use windowing ;=W
+ JE DEF70 ;no, check others ;=W
+; ;=W
+ TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if delimiter = box ;=W
+ JE DEF90 ;no, display normal delimiters ;=W
+; ;=W
+ MOV AX,06 ;display box ;=W
+ JMP DEF90 ;done with delimiters ;=W
+DEF70: ;=W
+ TEST ES:[SI]+ICB_OPT3,ICB_HOR ;does field use horiz. window ;=W
+ JE DEF80 ;=W
+; ;=W
+ MOV AX,03 ;display "[ >" ;=W
+ CMP ES:[SI]+ICB_HRSTART,01H ;are we at beginning of window ? ;=W
+ JLE DEF80 ;yes ;=W
+;
+ MOV AX,04 ;no, display "< >" ;=W
+DEF80: ;=W
+ CALL DELIMITER ;do it ;=W
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if also need box ;=W
+ JE DEF100 ;=W
+; ;=W
+ MOV AX,06 ;display box ;=W
+DEF90: ;=W
+ CALL DELIMITER ;do it ;=W
+;
+; Display minus or plus sign if active
+;
+DEF100:
+ TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign
+ JE DEFEXIT ; display option is active
+;
+ MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign key
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_SMU ;Check if default is negative
+ JE DEF110
+;
+ OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key
+;
+DEF110: CALL PLUS_MINUS ;display plus or minus sign and
+ ; set status
+;
+DEFEXIT: ;continue
+;
+ RET
+DEFAULT ENDP
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; PRE_EXIT :
+; :
+; Performs the following functions: :
+; :
+; - Removes field delimiters :
+; - Inserts commas as specified :
+; - Inserts decimal point as specified :
+; - Adjusts field to specified significant digits :
+; - Displays buffer contents in exit color :
+; - Checks if original default has changed :
+; - Check if entry is in specified numeric range :
+; - Sets minus or plus sign indicator in exit color :
+; - Remove thousand separators from input string buffer :
+; - Restore original cursor position and size, only in text mode :
+; :
+; Entry: ES:SI = Points to current ICB :
+; DS:DI = Points to PB :
+; :
+; Exit: None :
+; :
+;-----------------------------------------------------------------------------+
+;
+PRE_EXIT PROC NEAR
+
+;
+; Inserts commas as specified
+;
+ ;
+ ; Code here
+ ;
+;
+; Inserts decimal point as specified
+;
+ ;
+ ; Code here
+ ;
+;
+; Adjusts field to specified significant digits
+;
+ ;
+ ; Code here
+ ;
+;
+; Calculate color attribute of exit colors
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_XCL ;check if option to use exit
+ JE PRE10 ; colors is active
+;
+ MOV AL,[DI]+WR_XATTR ;set the exit attribute to the
+ MOV [DI]+WR_CATTR,AL ; current attribute
+;
+; Display default value of input buffer in proper justification
+;
+PRE10: MOV [DI]+WR_LEFTCHAR,1 ;set left character
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker
+;
+ TEST ES:[SI]+ICB_OPT3,ICB_HOR ;horizontal scrolling mode ? ;=W
+ JE PRE15 ;no, display all buffer ;=W
+ MOV AX,ES:[SI]+ICB_WIDTH ;use width instead of all buffer ;=W
+PRE15:
+ MOV [DI]+WR_RIGHTCHAR,AX
+;
+ MOV AX,2 ;set option to actually display
+ CALL WORD PTR [DI]+WR_DISPLAY ; default value in proper
+; ; justification
+; Process minus/plus key options
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_MUS ;Check if minus/plus sign
+ JE PRE40 ; display option is active
+;
+ MOV [DI]+WR_KEYCONF,0 ;initialize to plus sign
+;
+ TEST ES:[SI]+ICB_STATUS,ICB_SMUS
+ JE PRE20 ;Check if sign is negative
+;
+ OR [DI]+WR_KEYCONF,WR_MUS ;initialize to minus sign key
+;
+PRE20: TEST ES:[SI]+ICB_STATUS,ICB_SPUS
+ JE PRE30 ;Check if sign is positive
+;
+ OR [DI]+WR_KEYCONF,WR_PUS ;initialize to plus sign key
+;
+PRE30: CALL PLUS_MINUS ;display plus or minus sign
+ ; according to WR_KEYCONF setting
+;
+; Replace field entry delimiters with exit delimiters
+;
+PRE40: TEST ES:[SI]+ICB_OPT1,ICB_BEX ;check if field delimiters
+ JE PRE60 ; should be displayed on exit
+;
+ MOV AX,2 ;option to remove delimiters
+ CALL DELIMITER ;display delimiters
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_BOX ;check if box around field
+ JE PRE60 ; should be displayed
+;
+ MOV AX,7 ;set option to remove box
+ CALL DELIMITER ;display delimiters
+;
+; Check if default value has changed and set return flag
+;
+PRE60: PUSH DS ;save registers
+ PUSH SI
+ PUSH ES
+ PUSH DI
+;
+ MOV CX,ES:[SI]+ICB_DEFLEN ;initialize to default length
+ CMP CX,ES:[SI]+ICB_FIELDLEN ;check if default length is less
+ JBE PRE70 ; than field length
+;
+ MOV CX,ES:[SI]+ICB_FIELDLEN ;initialize to field length
+;
+PRE70: MOV AX,ES:[SI]+ICB_DEFSEG ;compare default string to ;=W
+ MOV DS,AX ;=W
+ MOV AX,ES:[SI]+ICB_FIELDOFF ;=W
+ MOV DI,AX ;=W
+;
+ MOV AX,ES:[SI]+ICB_DEFOFF ; current input string ;=W
+ MOV BX,ES:[SI]+ICB_FIELDSEG ;=W
+ MOV ES,BX ;=W
+ MOV SI,AX ;=W
+;
+ REPE CMPSB ;compare default and input strings
+;
+ POP DI ;restore registers
+ POP ES
+ POP SI
+ POP DS
+;
+ CMP CX,0 ;are we done ? ;=W
+ JE PRE80 ;check if strings compared
+;
+ OR ES:[SI]+ICB_STATUS,ICB_SDEF
+ ;set flag that default changed
+;
+; Check if entry is within specified numeric range, if not set flag
+;
+PRE80: ;
+ ; code here
+ ;
+;
+; Remove thousand separators if specified from input string buffer
+;
+PRE90: ;
+ ; code here
+ ;
+;
+; Restore original cursor position and size
+;
+PRE95:
+ TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
+ JE PRE100 ;no, quit
+ CALL CURSOR ;erase the graphics cursor
+PRE100:
+ OR ES:[SI]+ICB_STATUS,ICB_DONE ;exit condition found, exit ;=W
+; ;=W
+; Check if ICB_SAV option selected. If selected, then save contents of the ;=W
+; input buffer to the default buffer. ;=W
+; ;=W
+ TEST ES:[SI]+ICB_OPT4,ICB_SAV ;check ? ;=W
+ JE PRE200 ;no, exit now ;=W
+; ;=W
+ PUSH ES ;save registers ;=W
+ PUSH DS ;=W
+ PUSH DI ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV CX,ES:[SI]+ICB_ENDBYTE ;# of bytes to copy from input ;=W
+ ; buffer to default buffer ;=W
+ MOV ES:[SI]+ICB_DEFLEN,CX ;reset default length
+;
+ MOV AX,ES:[SI]+ICB_FIELDSEG ;get destination segment ;=W
+ MOV DS,AX ;=W
+; ;=W
+ MOV AX,ES:[SI]+ICB_DEFOFF ;get source string offset ;=W
+ MOV DI,AX ;=W
+; ;=W
+ MOV AX,ES:[SI]+ICB_DEFSEG ;get source string segment ;=W
+ MOV BX,ES:[SI]+ICB_FIELDOFF ;get destination offset ;=W
+ MOV SI,BX ;=W
+ MOV ES,AX ;=W
+; ;=W
+ CLD ;=W
+ REP MOVSB ;move default into input buffer ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP DI ;=W
+ POP DS ;=W
+ POP ES ;=W
+PRE200: ;=W
+ RET
+PRE_EXIT ENDP
+; ;=W
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; RIGHT_H_JUST : ;=W
+; : ;=W
+; Process keystroke and update display with input buffer changes : ;=W
+; for the following functions: : ;=W
+; : ;=W
+; Home key Up arrow Allowonce replace mode : ;=W
+; End key Down arrow Allowonce insert mode : ;=W
+; Left arrow Control end Allow replace mode : ;=W
+; Right arrow Delete key Allow insert mode : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+RIGHT_H_JUST PROC NEAR ;=W
+; ;=W
+ ; ;=W
+ ; code here ;=W
+ ; ;=W
+; ;=W
+ RET ;=W
+RIGHT_H_JUST ENDP ;=W
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; RIGHT_JUST :
+; :
+; Process keystroke and update display with input buffer changes :
+; for the following functions: :
+; :
+; Home key Up arrow Allowonce replace mode :
+; End key Down arrow Allowonce insert mode :
+; Left arrow Control end Allow replace mode :
+; Right arrow Delete key Allow insert mode :
+; :
+;-----------------------------------------------------------------------------+
+;
+RIGHT_JUST PROC NEAR
+;
+ ;
+ ; code here
+ ;
+;
+ RET
+RIGHT_JUST ENDP
+; ;=W
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; LEFT_H_JUST : ;=W
+; : ;=W
+; Process keystroke and update display with input buffer changes : ;=W
+; for the following functions: : ;=W
+; : ;=W
+; Home key Up arrow Allowonce replace mode : ;=W
+; End key Down arrow Allowonce insert mode : ;=W
+; Left arrow Control end Allow replace mode : ;=W
+; Right arrow Delete key Allow insert mode : ;=W
+; : ;=W
+; : ;=W
+; Following information is used: : ;=W
+; : ;=W
+; : ;=W
+; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
+; ³ buffer in memory. : ;=W
+; ³ : ;=W
+; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer : ;=W
+; ³ ³ of where characters will be added : ;=W
+; ³ ³ to input buffer. : ;=W
+; ³ ³ : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
+; ³ : ;=W
+; (ICB_FIELDLEN) Length of input field in bytes. : ;=W
+; : ;=W
+; : ;=W
+; The following demonstrates the before and after input buffer : ;=W
+; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing : ;=W
+; byte) : ;=W
+; : ;=W
+; Deleting a double byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Deleting a single byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Backspace removal of a double byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Backspace removal of a single byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Replacing a double byte with a double byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
+; : ;=W
+; Replacing a double byte with a single byte: (Option 1) : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Replacing a double byte with a single byte: (Option 2) : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Replacing a single byte with a single byte: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Replacing a single byte with a double byte. : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
+; : ;=W
+; Replacing a single byte with a double byte without enough buffer: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Inserting a single byte. : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Inserting a single byte without enough buffer generate an error: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ : ;=W
+; : ;=W
+; Inserting a double byte character: : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ : ;=W
+; : ;=W
+; : ;=W
+; Entry: ES:SI = Points to current ICB : ;=W
+; DS:DI = Points to PB : ;=W
+; : ;=W
+; INC_KS = Keystroke from returned from PCINCHA : ;=W
+; : ;=W
+; WR_KEYCONF = Bit flag inidicating the options set for INC_KS : ;=W
+; WR_KEYCONF2 keystroke. : ;=W
+; : ;=W
+; Exit: None. : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+LEFT_H_JUST PROC NEAR ;=W
+; ;=W
+; Initialize right and left boundary markers ;=W
+; ;=W
+ TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W
+ JNE LHJ5 ;yes, must check for editing keys ;=W
+ JMP LHJ190 ;no, skip checks for editing keys ;=W
+ ;=W
+; ;=W
+; Process home key ;=W
+; ;=W
+LHJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed ;=W
+ JE LHJ10 ;=W
+; ;=W
+ ; ;=W
+ ; add ICB_WHM option to process window home key movement ;=W
+ ; ;=W
+; ;=W
+ MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte ;=W
+ ; position, assuming no windowing ;=W
+ ; wrap is occurring ;=W
+ MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJEXIT ; returns WR_CURROW, WR_CURROW ;=W
+ ; and WR_CUBYTE ;=W
+; ;=W
+; Process end key ;=W
+; ;=W
+LHJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed ;=W
+ JNE LHJ12 ;=W
+ JMP LHJ20
+LHJ12: ;=W
+ ; ;=W
+ ; add ICB_WEN to move cursor to end of current window row ;=W
+ ; ;=W
+; ;=W
+ CALL CAL_COORS ;get current end of field info ;=W
+ MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac ;=W
+ INC AX ;=W
+ MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ17 ;no ;=W
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ15
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ JMP LHJ19 ;exit
+LHJ15:
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LHJ16 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+LHJ16: ;=W
+ MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
+ SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
+ INC BX ; DBCS support) ;=W
+ MOV [DI]+WR_HRCHAR,BX ;=W
+ JMP LHJ19 ;=W
+LHJ17: ;=W
+ MOV CX,[DI]+WR_CUBYTE ;check if need to adjust horz. ;=W
+ CMP CX,ES:[SI]+ICB_WIDTH ; window ;=W
+ JA LHJ18 ;=W
+ MOV [DI]+WR_HRCHAR,1 ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ JMP LHJ19 ;=W
+LHJ18: ;=W
+ MOV BX,[DI]+WR_ENBYTE ;yes, adjust it ;=W
+ SUB BX,ES:[SI]+ICB_WIDTH ;=W
+ ADD BX,2 ;=W
+ MOV [DI]+WR_HRCHAR,BX ;=W
+LHJ19: ;=W
+ CALL CAL_COORS ;re-calculate display ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Process left arrow ;=W
+; ;=W
+LHJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed ;=W
+ JE LHJ40 ;=W
+; ;=W
+ ; ;=W
+ ; add ICB_CSW option to wrap cursor from top/bottom end to end ;=W
+ ; ;=W
+; ;=W
+ ; ;=W
+ ; add ICB_WAR option to wrap cursor on same row end to end ;=W
+ ; ;=W
+; ;=W
+ MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W
+ CMP BX,1 ;is cursor in first position ? ;=W
+ JA LHJ30 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ23
+ MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
+ MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position
+ SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
+ INC BX ; DBCS support) ;=W
+ MOV [DI]+WR_HRCHAR,BX ;=W
+;
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ32 ;exit
+LHJ23:
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LHJ25 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+ JMP LHJ400 ;=W
+LHJ25: ;=W
+ CALL PCMBEEP_CALL ;error beep ;=W
+ JMP LHJEXIT ;exit ;=W
+LHJ30: ;=W
+ DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W
+;
+ CMP BX,[DI]+WR_HRCHAR ;is cursor to the left of horz.wind. ? ;=W
+ JG LHJ32 ;no ;=W
+ DEC [DI]+WR_HRCHAR ;yes, adjust horiz. window ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+LHJ32: ; towards the left ;=W
+ CALL CAL_COORS ;calculate cursor position
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Process right arrow ;=W
+; ;=W
+LHJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed ;=W
+ JE LHJ60 ;=W
+; ;=W
+ ; ;=W
+ ; add ICB_WAR option to wrap cursor on same row end to end ;=W
+ ; ;=W
+; ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+; ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ50 ;=W
+; ;=W
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ CALL PCMBEEP_CALL ;error beep ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+LHJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position ;=W
+ ; towards the right ;=W
+ MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
+ ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
+ CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
+ JG LHJ52 ;no ;=W
+ INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+LHJ52: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ55 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ53
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ55 ;exit
+LHJ53:
+ DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LHJ55 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+LHJ55: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Process up arrow ;=W
+; ;=W
+LHJ60: ; ;=W
+ ; adjust cursor position ;=W
+ ; ;=W
+ ;=W
+ ; ;=W
+ ; check for field wrap, exit, error beep ;=W
+ ; ;=W
+; ;=W
+; Process down arrow ;=W
+; ;=W
+LHJ70: ; ;=W
+ ; adjust cursor position ;=W
+ ; ;=W
+ ;=W
+ ; ;=W
+ ; check for field wrap, exit, error beep ;=W
+ ; ;=W
+; ;=W
+; Process cntrl+end key ;=W
+; ;=W
+LHJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed ;=W
+ JE LHJ100 ;=W
+; ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ90 ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep ;=W
+ JMP LHJEXIT ;exit ;=W
+LHJ90:
+ MOV BX,[DI]+WR_CUBYTE ;delete from current byte position ;=W
+ CALL CLEAR_BUFFER ;=W
+; ;=W
+ CALL CAL_COORS ;calculate cursor position
+ JMP LHJEXIT ;display field, set cursor, exit ;=W
+; ;=W
+; Process delete key ;=W
+; ;=W
+LHJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed ;=W
+ JE LHJ130 ;=W
+; ;=W
+ ; ;=W
+ ; Add ICB_WDL option in off state to delete on current line only ;=W
+ ; ;=W
+; ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+; ;=W
+ CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field ;=W
+ JE LHJ110 ;=W
+; ;=W
+ CALL REMOVE_CHAR ;remove character at current offst ;=W
+ ; and shift remaining in place ;=W
+ CALL CAL_COORS ;calculate cursor position
+ JMP LHJEXIT ;display field, set cursor, exit ;=W
+; ;=W
+LHJ110: CALL PCMBEEP_CALL ;error beep ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Process backspace key ;=W
+; ;=W
+LHJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed ;=W
+ JE LHJ160 ;=W
+; ;=W
+ MOV BX,ES:[SI]+ICB_CURCHAR ;get cursor position ;=W
+ CMP BX,1 ;check if cursor is at first ;=W
+ JA LHJ140 ; field position ;=W
+;
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ133
+ MOV BX,ES:[SI]+ICB_FIELDLEN ;adjust horizontal window ;=W
+ MOV ES:[SI]+ICB_CURCHAR,BX ;wrap to first character position
+ SUB BX,ES:[SI]+ICB_WIDTH ;(below this line may not work for ;=W
+ INC BX ; DBCS support) ;=W
+ MOV [DI]+WR_HRCHAR,BX ;=W
+;
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ145 ;exit
+LHJ133:
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LHJ135 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ400 ;=W
+LHJ135: ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ CALL PCMBEEP_CALL ;error beep ;=W
+ JMP LHJEXIT ;exit ;=W
+LHJ140: ;=W
+ DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
+ ; towards the left ;=W
+ CMP BX,[DI]+WR_HRCHAR ;is cursor in front of the wind. ? ;=W
+ JG LHJ142 ;no ;=W
+ DEC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+LHJ142: ;=W
+; ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+ CALL REMOVE_CHAR ;remove character at current offst ;=W
+ ; and shift remaining in place ;=W
+LHJ145: ;=W
+ CALL CAL_COORS ;calculate cursor position
+ JMP LHJEXIT ;display field, set cursor, exit ;=W
+; ;=W
+; Process insert key toggle ;=W
+; ;=W
+LHJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed ;=W
+ JE LHJ180 ; if not, continue ;=W
+; ;=W
+ TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ? ;=W
+ JE LHJ165 ;no, put in insert mode ;=W
+; ;=W
+ MOV BX,[DI]+IN_CURNOR ;set cursor size for normal ;=W
+ MOV [DI]+WR_CURSIZE,BX ; cursor ;=W
+; ;=W
+ AND ES:[SI]+ICB_STATUS,NOT ICB_SINS ;=W
+ JMP LHJ170 ;turn insert mode off ;=W
+; ;=W
+LHJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert ;=W
+ MOV [DI]+WR_CURSIZE,BX ; cursor ;=W
+; ;=W
+ OR ES:[SI]+ICB_STATUS,ICB_SINS ;=W
+ ;turn insert mode on ;=W
+; ;=W
+LHJ170: ;=W
+; ;=W
+ PUSH DS ;save registers ;=W
+ PUSH DI ;=W
+; ;=W
+ MOV DI,40H ;point DS:DI to KB_FLAG in BIOS ;=W
+ MOV DS,DI ;=W
+ MOV DI,17H ;=W
+ MOV AX,[DI] ;get current BIOS KB_FLAG ;=W
+; ;=W
+ AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off ;=W
+; ;=W
+ TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W
+ JE LHJ175 ;check if insert should be set on ;=W
+; ;=W
+ OR AX,WR_INSSTATE ;set BIOS insert active flag on ;=W
+; ;=W
+LHJ175: POP DI ;restore registers ;=W
+ POP DS ;=W
+; ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Process allowonce key option ;=W
+; ;=W
+LHJ180: ; ;=W
+ ; insert or replace ;=W
+ ; ;=W
+; ;=W
+ ; ;=W
+ ; adjust input buffer ;=W
+ ; ;=W
+; ;=W
+ ; ;=W
+ ; check for field wrap, exit, error beep ;=W
+ ; ;=W
+; ;=W
+ ; ;=W
+ ; adjust cursor position ;=W
+ ; ;=W
+; ;=W
+; Process allowed keystroke in replace mode ;=W
+; ;=W
+LHJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed ;=W
+ JNE LHJ195 ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep key not defined ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+LHJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS ;=W
+ JE LHJ198 ;check if insert is active ;=W
+; ;=W
+ JMP LHJ270 ;do insert display ;=W
+; ;=W
+LHJ198: ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ200 ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep key not defined ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Check if character to be replaced in field buffer is double byte character ;=W
+; ;=W
+LHJ200: PUSH ES ;save registers ;=W
+ PUSH SI ;=W
+; ;=W
+ PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
+ PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
+ POP SI ;=W
+ POP ES ;=W
+; ;=W
+ ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W
+ DEC SI ;make zero based ;=W
+; ;=W
+ MOV CX,ES ;save offset of character to ;=W
+ MOV DX,SI ; replace ;=W
+; ;=W
+ MOV AL,ES:[SI] ;get byte that cursor is pointing ;=W
+ MOV [DI]+DBC_KS,AL ; to check if DBCS ;=W
+ CALL PCINDBC_CALL ;call routine to check if char ;=W
+ ; is lead double byte char ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS ;=W
+ JE LHJ220 ; if no, jump to single byte code ;=W
+; ;=W
+; Replace double byte character with double byte character ;=W
+; ;=W
+ TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC ;=W
+ JE LHJ210 ;continue with single byte ;=W
+; ;=W
+ MOV AX,[DI]+INC_KS ;set double byte character to ;=W
+ ; input buffer replacing ;=W
+ ; double byte character ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace ;=W
+ MOV ES:[SI],AX ;replace double byte ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+ JMP LHJ260 ;exit ;=W
+; ;=W
+; Replace double byte character with single byte character ;=W
+; ;=W
+LHJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double ;=W
+ ; byte with single byte ;=W
+; ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace single byte ;=W
+ MOV ES:[SI],AL ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W
+ MOV [DI]+WR_RIGHTBYTE,AX ;=W
+; ;=W
+ MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
+ INC AX ;adjust past replaced leading byte ;=W
+ MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W
+; ;=W
+ MOV BX,1 ;set number of positions to shift ;=W
+ MOV AX,2 ;set option to shift left ;=W
+ CALL SHIFT ;call shift 1 position toward left ;=W
+ JMP LHJ260 ;exit ;=W
+; ;=W
+; Replace single byte character with single byte character ;=W
+; ;=W
+LHJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character ;=W
+ JNE LHJ230 ; continue with single byte ;=W
+; ;=W
+ MOV AX,[DI]+INC_KS ;get keystroke ;=W
+; ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace single byte ;=W
+ MOV ES:[SI],AL ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+ JMP LHJ260 ;exit ;=W
+; ;=W
+; Replace single byte character with double byte character ;=W
+; ;=W
+LHJ230: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W
+ MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W
+ CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W
+ JA LHJ240 ;=W
+; ;=W
+ MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W
+LHJ240: ;=W
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W
+ SUB AX,BX ;subtract to get the remaining space ;=W
+ CMP AX,1 ;will byte fit ? ;=W
+ JGE LHJ250 ;yes ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep because replace char ;=W
+ JMP LHJEXIT ; will not fit and exit ;=W
+; ;=W
+LHJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte ;=W
+ MOV [DI]+WR_RIGHTBYTE,BX ;=W
+; ;=W
+ MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
+ INC BX ;adjust past replaced leading byte ;=W
+ MOV [DI]+WR_LEFTBYTE,BX ; trailing byte ;=W
+; ;=W
+ MOV BX,1 ;set number of positions to shift ;=W
+ MOV AX,1 ;set option to shift right ;=W
+ CALL SHIFT ;call shift 1 position toward ;=W
+ ; left ;=W
+ MOV AX,[DI]+INC_KS ;get keystroke ;=W
+; ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace double byte ;=W
+ MOV ES:[SI],AX ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+; Calculate new ending and cursor coordinates ;=W
+; ;=W
+LHJ260: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W
+ MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
+ ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
+ CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
+ JG LHJ265 ;no ;=W
+ INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+LHJ265: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ267 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ266
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ267 ;exit
+LHJ266:
+
+ DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
+ JE LHJ267 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+LHJ267: ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ JMP LHJEXIT ;display field, set cursor, exit ;=W
+; ;=W
+; Process allowed keystroke in insert mode ;=W
+; ;=W
+LHJ270: ;=W
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ280 ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep key not defined ;=W
+ JMP LHJEXIT ;exit ;=W
+; ;=W
+; Check if enough room available to insert single or double byte character ;=W
+; ;=W
+LHJ280: ;=W
+ MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
+ MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
+; ;=W
+ ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer ;=W
+ DEC DX ;make zero based ;=W
+; ;=W
+ MOV BX,1 ;initialize to single byte ;=W
+; ;=W
+ TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character ;=W
+ JE LHJ290 ;=W
+; ;=W
+ MOV BX,2 ;reset to double byte character ;=W
+LHJ290: ;=W
+ PUSH BX ;=W
+ CALL CAL_COORS ;calculate cursor position ;=W
+ MOV BX,[DI]+WR_ENBYTE ;get end byte of input field ;=W
+ MOV AX,[DI]+WR_ENCHAR ;get end character of field ;=W
+ CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character ;=W
+ JA LHJ300 ;=W
+; ;=W
+ MOV BX,[DI]+WR_CUBYTE ;set cursor character position ;=W
+LHJ300: ;=W
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;get end of field position ;=W
+ SUB AX,BX ;subtract to get the remaining space ;=W
+ POP BX ;=W
+ CMP AX,BX ;will byte fit ? ;=W
+ JGE LHJ310 ;yes ;=W
+; ;=W
+ CALL PCMBEEP_CALL ;error beep replace character ;=W
+ JMP LHJEXIT ; will not fit and exit ;=W
+; ;=W
+; Shift to insert single or double byte character, BX= # bytes to shift ;=W
+; ;=W
+LHJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in ;=W
+ MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters ;=W
+; ;=W
+ MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove ;=W
+ MOV [DI]+WR_LEFTBYTE,AX ; trailing byte ;=W
+; ;=W
+ MOV AX,1 ;set option to shift right, BX= ;=W
+ ; number of bytes to insert ;=W
+ CALL SHIFT ;call shift 1 position toward ;=W
+ ; left ;=W
+ MOV AX,[DI]+INC_KS ;get keystroke ;=W
+; ;=W
+; Insert single byte character ;=W
+; ;=W
+ CMP BX,2 ;check how many bytes should be ;=W
+ JE LHJ320 ; inserted ;=W
+; ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace single byte ;=W
+ MOV ES:[SI],AL ;insert single byte character ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+ JMP LHJ330 ;=W
+; ;=W
+; Insert double byte character ;=W
+; ;=W
+LHJ320: PUSH ES ;=W
+ PUSH SI ;=W
+; ;=W
+ MOV ES,CX ;save offset of character to ;=W
+ MOV SI,DX ; replace ;=W
+ MOV ES:[SI],AX ;insert double byte character ;=W
+; ;=W
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+; Calculate new ending and cursor coordinates ;=W
+; ;=W
+LHJ330: ;=W
+ CALL CAL_COORS ;get new end coordinates ;=W
+; ;=W
+ INC ES:[SI]+ICB_CURCHAR ;point to next char ;=W
+ MOV BX,[DI]+WR_HRCHAR ;get begin. of horiz. wondow ;=W
+ ADD BX,ES:[SI]+ICB_WIDTH ;add width to get end of window ;=W
+ CMP BX,ES:[SI]+ICB_CURCHAR ;is cursor past end of window ? ;=W
+ JG LHJ332 ;no ;=W
+ INC [DI]+WR_HRCHAR ;yes, adjust the horiz. window ;=W
+ MOV AX,4 ;display delimiters "< >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+LHJ332: ;=W
+ CALL CAL_COORS ;calculate cursor position
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LHJ335 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LHJ333
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ MOV [DI]+WR_HRCHAR,1 ;reset the horiz. window ;=W
+ MOV AX,3 ;display delimiters "[ >" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ JMP LHJ335 ;exit
+LHJ333:
+ DEC [DI]+WR_HRCHAR ;yes, adjust wind back one position ;=W
+ MOV AX,5 ;display delimiters "< ]" ;=W
+ CALL DELIMITER ;display delimiter ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
+ JE LHJ335 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+LHJ335:
+ CALL CAL_COORS ;calculate cursor position ;=W
+ JMP LHJEXIT ;display cursor
+; ;=W
+; Display field & Exit ;=W
+; ;=W
+LHJ400:
+ CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W
+ ; in left justified field ;=W
+ JMP LHJCUR
+LHJEXIT: ;=W
+ CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer ;=W
+ ; in left justified field ;=W
+ TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
+ JNE LHJCUR ;cursor is already on, don't turn it on ;=W
+ CALL CURSOR ;display cursor ;=W
+LHJCUR:
+; ;=W
+ RET ;=W
+LEFT_H_JUST ENDP ;=W
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; LEFT_JUST :
+; :
+; Process keystroke and update display with input buffer changes :
+; for the following functions: :
+; :
+; Home key Up arrow Allowonce replace mode :
+; End key Down arrow Allowonce insert mode :
+; Left arrow Control end Allow replace mode :
+; Right arrow Delete key Allow insert mode :
+; :
+; :
+; Following information is used: :
+; :
+; :
+; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input :
+; ³ buffer in memory. :
+; ³ :
+; ³ ÚÄ (WR_CUBYTE) Byte offset into the input buffer :
+; ³ ³ of where characters will be added :
+; ³ ³ to input buffer. :
+; ³ ³ :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ S ³ ³ ³ ³ ³ ³ ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
+; ³ :
+; (ICB_FIELDLEN) Length of input field in bytes. :
+; :
+; :
+; The following demonstrates the before and after input buffer :
+; images. (S = Single byte, L = DBCS lead byte, T = DBCS trailing :
+; byte) :
+; :
+; Deleting a double byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
+; :
+; Deleting a single byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ L ³ T ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
+; :
+; Backspace removal of a double byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
+; :
+; Backspace removal of a single byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ S ³ S ³ S ³ L ³ T ³ ³ S ³ S ³ S ³ L ³ T ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
+; :
+; Replacing a double byte with a double byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
+; :
+; Replacing a double byte with a single byte: (Option 1) :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ S ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
+; :
+; Replacing a double byte with a single byte: (Option 2) :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ S ³ ³ S ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
+; :
+; Replacing a single byte with a single byte: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
+; :
+; Replacing a single byte with a double byte. :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
+; :
+; Replacing a single byte with a double byte without enough buffer: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ L ³ T ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
+; :
+; Inserting a single byte. :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ ³ ³ S ³ L ³ T ³ S ³ L ³ T ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÙ :
+; :
+; Inserting a single byte without enough buffer generate an error: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ S ³ ³ ³ S ³ L ³ T ³ S ³ S ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ :
+; :
+; Inserting a double byte character: :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ S ³ ³ ³ ³ S ³ L ³ T ³ L ³ T ³ S ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÙ ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÙ :
+; :
+; :
+; Entry: ES:SI = Points to current ICB :
+; DS:DI = Points to PB :
+; :
+; INC_KS = Keystroke from returned from PCINCHA :
+; :
+; WR_KEYCONF = Bit flag inidicating the options set for INC_KS :
+; WR_KEYCONF2 keystroke. :
+; :
+; Exit: None. :
+; :
+;-----------------------------------------------------------------------------+
+;
+LEFT_JUST PROC NEAR
+;
+; Initialize right and left boundary markers
+;
+ MOV [DI]+WR_LEFTCHAR,1 ;set left character to beginning
+ ; of field
+;
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;set right marker past end of
+ INC AX ; field
+ MOV [DI]+WR_RIGHTCHAR,AX
+;
+ TEST [DI]+WR_KEYCONF,WR_MASK ;check to see if editing key entered ;=W
+ JNE LJ5 ;yes, must check for editing keys ;=W
+ JMP LJ190 ;no, skip checks for editing keys ;=W
+
+;
+; Process home key
+;
+LJ5: TEST [DI]+WR_KEYCONF,WR_HOM ;check if home key pressed
+ JE LJ10
+;
+ ;
+ ; add ICB_WHM option to process window home key movement
+ ;
+;
+ MOV ES:[SI]+ICB_CURCHAR,1 ;initialize cursor to 1st byte
+ ; position, assuming no windowing
+ ; wrap is occurring
+ CALL CAL_COORS ;get cursor position ;=W
+ JMP LJEXIT ; returns WR_CURROW, WR_CURROW
+ ; and WR_CUBYTE
+;
+; Process end key
+;
+LJ10: TEST [DI]+WR_KEYCONF,WR_END ;check if home key pressed
+ JE LJ20
+;
+ ;
+ ; add ICB_WEN to move cursor to end of current window row
+ ;
+;
+ CALL CAL_COORS ;get current end of field info ;=W
+;
+ MOV AX,[DI]+WR_ENCHAR ;adjust one past end buffer charac
+ INC AX
+ MOV ES:[SI]+ICB_CURCHAR,AX ;set current cursor position to
+ ; end of field
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LJ17 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ16
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ CALL CAL_COORS ;get cursor position
+ JMP LJEXIT ;exit
+LJ16:
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LJ17 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+LJ17: ;=W
+ JMP LJEXIT ;exit
+;
+; Process left arrow
+;
+LJ20: TEST [DI]+WR_KEYCONF,WR_LFT ;check if left arrow key pressed
+ JE LJ40
+;
+ ;
+ ; add ICB_WAR option to wrap cursor on same row end to end
+ ;
+;
+ CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first
+ JA LJ30 ; field position
+;
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LJ25 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+ JMP LJCUR ;=W
+LJ25: ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ27
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position
+ MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position
+ CALL CAL_COORS
+ JMP LJEXIT
+LJ27:
+ CALL PCMBEEP_CALL ;error beep
+ JMP LJEXIT ;exit
+;
+LJ30: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
+ ; towards the left
+ CALL CAL_COORS ;get cursor position ;=W
+ JMP LJEXIT ;exit
+;
+; Process right arrow
+;
+LJ40: TEST [DI]+WR_KEYCONF,WR_RGT ;check if left arrow key pressed
+ JE LJ60
+;
+ ;
+ ; add ICB_CSW option to wrap cursor from top/bottom end to end
+ ;
+;
+ ;
+ ; add ICB_AXC option to auto enter if cursor reaches end
+ ;
+;
+ ;
+ ; add ICB_WAR option to wrap cursor on same row end to end
+ ;
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
+ JE LJ50
+;
+ CALL PCMBEEP_CALL ;error beep
+ JMP LJEXIT ;exit
+;
+LJ50: INC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
+ ; towards the left
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LJ55 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ52
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ CALL CAL_COORS ;get cursor position
+ JMP LJEXIT ;exit
+LJ52:
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LJ55 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+LJ55: ;=W
+ JMP LJEXIT ;exit
+;
+; Process up arrow
+;
+LJ60: ;
+ ; adjust cursor position
+ ;
+
+ ;
+ ; check for field wrap, exit, error beep
+ ;
+;
+; Process down arrow
+;
+LJ70: ;
+ ; adjust cursor position
+ ;
+
+ ;
+ ; check for field wrap, exit, error beep
+ ;
+;
+; Process cntrl+end key
+;
+LJ80: TEST [DI]+WR_KEYCONF,WR_CED ;check if control+end key pressed
+ JE LJ100
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
+ JE LJ90
+;
+ CALL PCMBEEP_CALL ;error beep
+ JMP LJEXIT ;exit
+;
+LJ90: CALL CAL_COORS ;get current end of field info ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;set rightmost area to refresh on
+ MOV [DI]+WR_RIGHTDISP,AX ; display to entire field
+;
+ MOV BX,[DI]+WR_CUBYTE ;delete from current byte position
+ CALL CLEAR_BUFFER
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ JMP LJ340 ;display field, set cursor, exit
+;
+; Process delete key
+;
+LJ100: TEST [DI]+WR_KEYCONF,WR_DEL ;check if delete key pressed
+ JE LJ130
+;
+ ;
+ ; Add ICB_WDL option in off state to delete on current line only
+ ;
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,1 ;check if cursor past end of field
+ JE LJ110
+;
+ CALL REMOVE_CHAR ;remove character at current offst
+ ; and shift remaining in place
+ JMP LJ340 ;display field, set cursor, exit
+;
+LJ110: CALL PCMBEEP_CALL ;error beep
+ JMP LJEXIT ;exit
+;
+; Process backspace key
+;
+LJ130: TEST [DI]+WR_KEYCONF,WR_BCK ;check if backspace key pressed
+ JE LJ160
+;
+ CMP ES:[SI]+ICB_CURCHAR,1 ;check if cursor is at first
+ JA LJ140 ; field position
+;
+ TEST ES:[SI]+ICB_OPT2,ICB_AXC ;is autoexit option set ? ;=W
+ JE LJ135 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;yes, set autoexit flag ;=W
+ JMP LJCUR ;=W
+LJ135: ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ137
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;get last position
+ MOV ES:[SI]+ICB_CURCHAR,AX ;put as current position
+ CALL CAL_COORS
+ JMP LJEXIT
+LJ137:
+ CALL PCMBEEP_CALL ;error beep
+ JMP LJEXIT ;exit
+;
+LJ140: DEC ES:[SI]+ICB_CURCHAR ;adjust cursor to one position
+ ; towards the left
+ CALL CAL_COORS ;get cursor position ;=W
+ CALL REMOVE_CHAR ;remove character at current offst
+ ; and shift remaining in place
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ JMP LJ340 ;display field, set cursor, exit
+;
+; Process insert key toggle
+;
+LJ160: TEST [DI]+WR_KEYCONF,WR_INS ;check if insert key pressed
+ JE LJ180 ; if not, continue
+;
+ TEST ES:[SI]+ICB_STATUS,ICB_SINS ;check if in insert mode ?
+ JE LJ165 ;no, put in insert mode
+;
+ MOV BX,[DI]+IN_CURNOR ;set cursor size for normal
+ MOV [DI]+WR_CURSIZE,BX ; cursor
+;
+ AND ES:[SI]+ICB_STATUS,NOT ICB_SINS
+ JMP LJ170 ;turn insert mode off
+;
+LJ165: MOV BX,[DI]+IN_CURINS ;set cursor size for insert
+ MOV [DI]+WR_CURSIZE,BX ; cursor
+;
+ OR ES:[SI]+ICB_STATUS,ICB_SINS
+ ;turn insert mode on
+;
+LJ170:
+;
+ PUSH DS ;save registers
+ PUSH DI
+;
+ MOV DI,40H ;point DS:DI to KB_FLAG in BIOS
+ MOV DS,DI
+ MOV DI,17H
+ MOV AX,[DI] ;get current BIOS KB_FLAG
+;
+ AND AX,NOT WR_INSSTATE ;set BIOS insert active flag off
+;
+ TEST ES:[SI]+ICB_STATUS,ICB_SINS
+ JE LJ175 ;check if insert should be set on
+;
+ OR AX,WR_INSSTATE ;set BIOS insert active flag on
+;
+LJ175: POP DI ;restore registers
+ POP DS
+;
+ JMP LJEXIT ;exit
+;
+; Process allowonce key option
+;
+LJ180: ;
+ ; insert or replace
+ ;
+;
+ ;
+ ; adjust input buffer
+ ;
+;
+ ;
+ ; check for field wrap, exit, error beep
+ ;
+;
+ ;
+ ; adjust cursor position
+ ;
+;
+; Process allowed keystroke in replace mode
+;
+LJ190: TEST [DI]+WR_KEYCONF,WR_ALL ;check if allow key pressed
+ JNE LJ195
+;
+ CALL PCMBEEP_CALL ;error beep key not defined
+ JMP LJEXIT ;exit
+;
+LJ195: TEST ES:[SI]+ICB_STATUS,ICB_SINS
+ JE LJ198 ;check if insert is active
+;
+ JMP LJ270 ;do insert display
+;
+LJ198:
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
+ JE LJ200
+;
+ CALL PCMBEEP_CALL ;error beep key not defined
+ JMP LJEXIT ;exit
+;
+; Check if character to be replaced in field buffer is double byte character
+;
+LJ200: PUSH ES ;save registers
+ PUSH SI
+;
+ PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
+ PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
+ POP SI
+ POP ES
+;
+ ADD SI,[DI]+WR_CUBYTE ;add cursor offset into buffer
+ DEC SI ;make zero based
+;
+ MOV CX,ES ;save offset of character to
+ MOV DX,SI ; replace
+;
+ MOV AL,ES:[SI] ;get byte that cursor is pointing
+ MOV [DI]+DBC_KS,AL ; to check if DBCS
+ CALL PCINDBC_CALL ;call routine to check if char
+ ; is lead double byte char
+;
+ POP SI ;restore registers
+ POP ES
+;
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS
+ JE LJ220 ; if no, jump to single byte code
+;
+; Replace double byte character with double byte character
+;
+ TEST [DI]+WR_KEYCONF2,WR_DBC ;check if keystroke is DBC
+ JE LJ210 ;continue with single byte
+;
+ MOV AX,[DI]+INC_KS ;set double byte character to
+ ; input buffer replacing
+ ; double byte character
+ PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace
+ MOV ES:[SI],AX ;replace double byte
+;
+ POP SI ;restore registers
+ POP ES
+;
+ JMP LJ260 ;exit
+;
+; Replace double byte character with single byte character
+;
+LJ210: MOV AX,[DI]+INC_KS ;get keystroke and replace double
+ ; byte with single byte
+;
+ PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace single byte
+ MOV ES:[SI],AL
+;
+ POP SI ;restore registers
+ POP ES
+;
+ MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte
+ MOV [DI]+WR_RIGHTBYTE,AX
+;
+ MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove
+ INC AX ;adjust past replaced leading byte ;=W
+ MOV [DI]+WR_LEFTBYTE,AX ; trailing byte
+;
+ MOV BX,1 ;set number of positions to shift
+ MOV AX,2 ;set option to shift left
+ CALL SHIFT ;call shift 1 position toward left
+ JMP LJ260 ;exit
+;
+; Replace single byte character with single byte character
+;
+LJ220: TEST [DI]+WR_KEYCONF2,WR_DBC ;check if double byte character
+ JNE LJ230 ; continue with single byte
+;
+ MOV AX,[DI]+INC_KS ;get keystroke
+;
+ PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace single byte
+ MOV ES:[SI],AL
+;
+ POP SI ;restore registers
+ POP ES
+;
+ JMP LJ260 ;exit
+;
+; Replace single byte character with double byte character
+;
+LJ230: MOV BX,ES:[SI]+ICB_CURCHAR ;set cursor character position
+ MOV [DI]+WR_LEFTCHAR,BX ; to left marker
+;
+ CALL CAL_COORS ;get the current end of field ;=W
+ ; coordinates
+ MOV AX,[DI]+WR_ENCHAR ;get end character of field
+ CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character
+ JA LJ240
+;
+ MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char
+;
+LJ240: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker
+;
+ MOV BX,1 ;One byte is already available
+ ; check if room for trailing byte
+ MOV AX,1 ;set up call to LEFT_DISP to
+ CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte
+ ; will fit in input buffer
+ CMP AX,0 ;check if double byte character
+ JE LJ250 ; will fit
+;
+ CALL PCMBEEP_CALL ;error beep because replace char
+ JMP LJEXIT ; will not fit and exit
+;
+LJ250: MOV BX,ES:[SI]+ICB_FIELDLEN ;set ending byte
+ MOV [DI]+WR_RIGHTBYTE,BX
+;
+ MOV BX,[DI]+WR_CUBYTE ;set markers for shift to remove
+ INC BX ;adjust past replaced leading byte
+ MOV [DI]+WR_LEFTBYTE,BX ; trailing byte
+;
+ MOV BX,1 ;set number of positions to shift
+ MOV AX,1 ;set option to shift right
+ CALL SHIFT ;call shift 1 position toward
+ ; left
+ MOV AX,[DI]+INC_KS ;get keystroke
+;
+ PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace double byte
+ MOV ES:[SI],AX
+;
+ POP SI ;restore registers
+ POP ES
+;
+; Calculate new ending and cursor coordinates
+;
+LJ260:
+ MOV BX,[DI]+WR_ENCHAR ;set rightmost area to refresh on ;=W
+ CALL CAL_COORS ;get new end coordinates ;=W
+ CMP BX,[DI]+WR_ENCHAR ;is old END_CHAR > new END_CHAR ? ;=W
+ JG LJ261 ;yes, use old END_CHAR (so display ;=W
+ MOV BX,[DI]+WR_ENCHAR ; is updated correctly)
+
+LJ261: ;set rightmost area to refresh on ;=W
+ MOV [DI]+WR_RIGHTDISP,BX ; display to new ending character
+
+ INC ES:[SI]+ICB_CURCHAR ;point to next char
+
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LJ265 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ262
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ JMP LJ340 ;display field, set cursor, exit
+LJ262:
+ TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
+ JE LJ265 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+LJ265: ;=W
+ JMP LJ340 ;display field, set cursor, exit
+;
+; Process allowed keystroke in insert mode
+;
+LJ270:
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field
+ JE LJ280
+;
+ CALL PCMBEEP_CALL ;error beep key not defined
+ JMP LJEXIT ;exit
+;
+; Check if enough room available to insert single or double byte character
+;
+LJ280:
+ MOV CX,ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
+ MOV DX,ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
+;
+ ADD DX,[DI]+WR_CUBYTE ;add cursor offset into buffer
+ DEC DX ;make zero based
+;
+ MOV BX,1 ;initialize to single byte
+;
+ TEST [DI]+WR_KEYCONF2,WR_DBC ;check for double byte character
+ JE LJ290
+;
+ MOV BX,2 ;reset to double byte character
+;
+LJ290: MOV AX,ES:[SI]+ICB_CURCHAR ;set cursor character position
+ MOV [DI]+WR_LEFTCHAR,AX ; to left marker
+;
+ CALL CAL_COORS ;get the current end of field ;=W
+ ; coordinates
+ MOV AX,[DI]+WR_ENCHAR ;get end character of field
+;
+ CMP AX,ES:[SI]+ICB_CURCHAR ;is cursor past end character
+ JA LJ300
+;
+ MOV AX,ES:[SI]+ICB_CURCHAR ;cursor is past last char
+ DEC AX
+;
+LJ300: MOV [DI]+WR_RIGHTCHAR,AX ;set right marker
+;
+ MOV AX,1 ;set up call to LEFT_DISP to
+ CALL WORD PTR [DI]+WR_DISPLAY ; determine if additional byte
+ ; will fit in input buffer
+ ; BX= number of bytes to insert
+ CMP AX,0 ;check if double byte character
+ JE LJ310 ; will fit
+;
+ CALL PCMBEEP_CALL ;error beep replace character
+ JMP LJEXIT ; will not fit and exit
+;
+; Shift to insert single or double byte character, BX= # bytes to shift
+;
+LJ310: MOV AX,ES:[SI]+ICB_FIELDLEN ;set ending byte to make room in
+ MOV [DI]+WR_RIGHTBYTE,AX ; buffer by shifting characters
+;
+ MOV AX,[DI]+WR_CUBYTE ;set markers for shift to remove
+ MOV [DI]+WR_LEFTBYTE,AX ; trailing byte
+;
+ MOV AX,1 ;set option to shift right, BX=
+ ; number of bytes to insert
+ CALL SHIFT ;call shift 1 position toward
+ ; left
+ MOV AX,[DI]+INC_KS ;get keystroke
+;
+; Insert single byte character
+;
+ CMP BX,2 ;check how many bytes should be
+ JE LJ320 ; inserted
+;
+ PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace single byte
+ MOV ES:[SI],AL ;insert single byte character
+;
+ POP SI ;restore registers
+ POP ES
+;
+ JMP LJ330
+;
+; Insert double byte character
+;
+LJ320: PUSH ES
+ PUSH SI
+;
+ MOV ES,CX ;save offset of character to
+ MOV SI,DX ; replace
+ MOV ES:[SI],AX ;insert double byte character
+;
+ POP SI ;restore registers
+ POP ES
+;
+; Calculate new ending and cursor coordinates
+;
+LJ330:
+ CALL CAL_COORS ;get new end coordinates ;=W
+;
+ MOV AX,[DI]+WR_ENCHAR ;set rightmost area to refresh on
+ MOV [DI]+WR_RIGHTDISP,AX ; display to old ending character
+;
+ INC ES:[SI]+ICB_CURCHAR ;point to next char
+;
+ CALL CAL_COORS ;get cursor position ;=W
+ CMP [DI]+WR_FIELDEND,0 ;check if cursor past end of field ;=W
+ JE LJ340 ;no ;=W
+ TEST ES:[SI]+ICB_OPT2,ICB_CSW ;is cursor wrap option on ? ;=W
+ JE LJ335
+ MOV ES:[SI]+ICB_CURCHAR,1 ;wrap to first character position
+ JMP LJ340 ;display field, set cursor, exit
+LJ335:
+ TEST ES:[SI]+ICB_OPT2,ICB_AXD ;is autoexit option set ? ;=W
+ JE LJ340 ;no ;=W
+ OR [DI]+WR_KEYCONF2,WR_RET ;set autoexit flag ;=W
+;
+; Display field
+;
+LJ340:
+ MOV AX,ES:[SI]+ICB_CURCHAR ;set left character to cursor
+ DEC AX ; last cursor position
+ MOV [DI]+WR_LEFTCHAR,AX
+;
+ MOV AX,[DI]+WR_RIGHTDISP ;set right character marker to ;=W
+ MOV [DI]+WR_RIGHTCHAR,AX ; max possible field length
+;
+ CALL CAL_COORS ;get end of field char, byte ;=W
+ ; and next byte positions
+
+ MOV AX,2 ;set display option
+ CALL WORD PTR [DI]+WR_DISPLAY ;display current input buffer
+ ; in left justified field
+;
+; Exit
+;
+LJEXIT: ;continue
+ TEST ES:[SI]+ICB_STATUS,ICB_CUR_ON ;is cursor on ?
+ JNE LJCUR ;cursor is already on, don't turn it on ;=W
+ CALL CURSOR ;display cursor ;=W
+LJCUR:
+;
+ RET
+LEFT_JUST ENDP
+;-----------------------------------------------------------------------------+
+; :
+; CAL_COORS :
+; :
+; Calculates character coordinates based on the display format :
+; currently active (windowing and horizontal display). :
+; :
+; The following examples demonstrate the values that are set on :
+; exit from this routine: :
+; :
+; :
+; Example: Horizontal field coordinates calculated. :
+; :
+; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
+; ³123456789012345678901234567890 :
+; ³2 :
+; ³3 [sLtLtssss....] :
+; ^ :
+; ³ ³ ³ :
+; ³ ³ ÀÄ WR_ENCHAR = 7 :
+; ³ ³ WR_ENBYTE = 9 :
+; ³ ³ WR_RGCHAR = 7 :
+; ³ ³ :
+; ³ ÀÄÄÄÄÄÄ WR_CUCHAR = 3 :
+; ³ WR_CUBYTE = 4 :
+; ³ WR_UPCHAR = 3 :
+; ³ WR_DNCHAR = 3 :
+; ³ WR_CURROW = 3 :
+; ³ WR_CURCOL = 13 :
+; ³ :
+; ÀÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 :
+; WR_HRCHAR = 1 :
+; :
+; :
+; Example: Horizontal field scroll coordinates calculated: :
+; :
+; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
+; ³123456789012345678901234567890 :
+; ³2 ÚÄÄÄÄÄ¿ :
+; ³3 s³LtLt ³Ltsss..... :
+; ³ÀÄÄÄÄÄÙ ³ :
+; ³ ³ ^ ³ :
+; ³ ³ ³ ³ :
+; ³ ³ ³ À WR_ENCHAR = 7 :
+; ³ ³ ³ WR_ENBYTE = 10 :
+; ³ ³ ³ WR_RGCHAR = 7 :
+; ³ ³ ³ :
+; ³ ³ ÀÄÄÄÄÄÄÄÄ WR_CUCHAR = 3 :
+; ³ ³ WR_CUBYTE = 4 :
+; ³ ³ WR_UPCHAR = 3 :
+; ³ ³ WR_DNCHAR = 3 :
+; ³ ³ WR_CURROW = 3 :
+; ³ ³ WR_CURCOL = 14 :
+; ³ ³ :
+; ³ ÀÄÄÄÄÄÄÄÄÄÄ WR_HRCHAR = 2 :
+; ³ :
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR = 1 :
+; :
+; :
+; :
+; Example: Windowed field coordinates calculated. :
+; :
+; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ :
+; ³123456789012345678901234567890 :
+; ³2 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ WR_LFCHAR= 6 :
+; ³3 ³ ÚÄÄÄÄÄÄÄÄ WR_UPCHAR= 3 :
+; ³4 ³ ÚÄijÄÄ¿ :
+; ³5 ³ ³ABCDE³ :
+; ³6 ÀÄÄFGHI.³ :
+; ³7 ³ Ú³³ÀÄÄÄÄÄÄ WR_RGCHAR= 10 :
+; ³8 Àij³ÀÄÄÄÄÄÄÄ WR_ENCHAR= 9 :
+; ³9 ³³ :
+; ³ÀÄÄÄÄÄÄÂÄ WR_CUCHAR= 8 :
+; ³ ÃÄ WR_CURCOL= 24 :
+; ³ ÀÄ WR_CURROW= 6 :
+; ³ :
+; ÀÄÄÄÄÄÄÄÄÄ WR_DNCHAR= 13 :
+; :
+; :
+; Entry: ICB_CURCHAR = The character position into the input field from :
+; which the exit coordinates will be calculated. :
+; :
+; WR_HRCHAR = The character position into the input field that :
+; is currently the first displayed character of the :
+; horizontal window. :
+; :
+; ICB_WIDTH = The width of windowed or horizontal scroll field. :
+; :
+; ICB_FIELDLEN = Input field buffer length. :
+; :
+; ICB_FIELDOFF = Input field buffer offset. :
+; :
+; ICB_FIELDSEG = Input field buffer segment. :
+; :
+; :
+; Exit: WR_RGCHAR = Character offset into input buffer of the character :
+; appearing at the beginning of the current line that :
+; WR_CUCHAR is located on. :
+; :
+; WR_LFCHAR = Character offset into input buffer of the character :
+; appearing at the end of the current line that :
+; WR_CUCHAR is located on. :
+; :
+; WR_UPCHAR = Character offset into input buffer of the character :
+; displayed directly above the position that :
+; WR_CUCHAR is located on. :
+; :
+; WR_DNCHAR = Character offset into input buffer of the character :
+; displayed directly below the position that :
+; WR_CUCHAR is located on. :
+; :
+; WR_ENCHAR = Number of characters currently entered in the :
+; field. This value may be less than the number :
+; of bytes used to represent the characters if :
+; double byte characters are present. :
+; :
+; WR_CURROW = Actual row offset into the video buffer of the :
+; character specified by WR_CURCHAR. :
+; :
+; WR_CURCOL = Actual column offset into the video buffer of the :
+; character specified by WR_CUCHAR. :
+; :
+; WR_ENBYTE = Number of bytes currently used to represent :
+; entered characters in the buffer. This counter :
+; can be used to calculate the current end :
+; position of the entered data in the field. :
+; :
+; WR_CUBYTE = Number of bytes into input field where WR_CUCHAR :
+; appears. :
+; : ;=W
+; WR_CUCHAR = Offset of current cursor position in input field. : ;=W
+; : ;=W
+; WR_HRBYTE = Number of bytes into input field where WR_HRCHAR :
+; appears. :
+; :
+; WR_FIELDEND = Boolean flag, 0 = cursor not past end of field : ;=W
+; 1 = cursor is past end of field : ;=W
+; :
+;-----------------------------------------------------------------------------+
+;
+CAL_COORS PROC NEAR
+;
+ PUSH AX ;save registers
+ PUSH BX
+ PUSH CX
+ PUSH DX
+ PUSH ES
+ PUSH SI
+ PUSH BP ;=W
+; ;=W
+; initialize general variables for all display modes ;=W
+;
+ MOV [DI]+WR_FIELDEND,0 ;initialize boolean flag that ;=W
+ ;cursor is not past end of field ;=W
+ MOV AX,ES:[SI]+ICB_CURCHAR ;get current char. offset ;=W
+ MOV [DI]+WR_CUCHAR,AX ;save it ;=W
+;
+ MOV AX,ES:[SI]+ICB_ROW ;initialize row offset of field ;=W
+ DEC AX ;=W
+ MOV [DI]+WR_CURROW,AX ;char row offset inot video buf ;=W
+ MOV AX,ES:[SI]+ICB_COL ;initialize col offset of field ;=W
+ DEC AX ;=W
+ MOV [DI]+WR_CURCOL,AX ;char col offset into video buf ;=W
+;
+ MOV [DI]+WR_LFCHAR,1 ;leftmost character possible char ;=W
+ MOV [DI]+WR_RGCHAR,1 ;rightmost character possible char ;=W
+ MOV [DI]+WR_ENBYTE,0 ;end byte of data in input buffer ;=W
+ MOV [DI]+WR_ENCHAR,0 ;end character in input buffer ;=W
+ MOV [DI]+WR_HRBYTE,1 ;byte of first char in horz. window ;=W
+;
+ MOV AX,[DI]+WR_CUCHAR ;get current position ;=W
+ MOV [DI]+WR_UPCHAR,1 ;topmost char in current column ;=W
+ MOV [DI]+WR_DNCHAR,1 ;bottommost char in current column ;=W
+;
+ MOV BP,0 ;have not found current char yet ;=W
+ MOV CX,1 ;counter tracking number of bytes ;=W
+ MOV DX,1 ;counter tracking number of chars ;=W
+;
+; Determine display format of field
+;
+ TEST ES:[SI]+ICB_OPT3,ICB_WIN ;check if windowing option on
+ JE CC10
+;
+ JMP CC200 ;process window option
+;
+CC10: TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if horizontal scroll option
+ JE CC20 ; on
+;
+ JMP CC100 ;process horizontal scroll
+;
+; Process fully displayed horizontal field
+;
+CC20: ;=W
+ MOV [DI]+WR_HRCHAR,1 ;leftmost character possible char
+;
+; Examine the next byte in the input buffer
+;
+CC30: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been
+ JBE CC35 ; scanned and exit
+;
+ CMP BP,0 ;found current char yet ? ;=W
+ JE CC40 ;no, find it ;=W
+ JMP CCEXIT
+;
+CC35: PUSH ES ;save registers
+ PUSH SI
+;
+ PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
+ PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
+ POP SI
+ POP ES
+;
+ DEC CX ;make byte count zero based
+ ADD SI,CX ;add byte count to input fld offst
+ INC CX ;make byte count one based
+ MOV AL,ES:[SI] ;get byte in input buffer to
+ MOV [DI]+DBC_KS,AL ; check if DBCS
+ CALL PCINDBC_CALL ;call routine to check if char
+ ; is lead double byte char
+;
+ POP SI ;restore registers
+ POP ES
+;
+; Check if end data byte and character should be updated
+;
+ CMP AL,WR_BLANK ;check if blanking character found
+ JE CC40 ;now adjust pointers
+;
+ MOV [DI]+WR_ENBYTE,CX ;set current byte count
+ MOV [DI]+WR_ENCHAR,DX ;set current character count
+ MOV [DI]+WR_RGCHAR,DX ;set right most character
+;
+; Check if current character pointer
+;
+CC40: CMP [DI]+WR_CUCHAR,DX ;check if current character found
+ JNE CC50
+;
+ MOV BP,1 ;current char found ;=W
+ MOV [DI]+WR_UPCHAR,DX ;set up and down character
+ MOV [DI]+WR_DNCHAR,DX ; to current character
+;
+ MOV [DI]+WR_CUBYTE,CX ;set current character byte count
+ ADD [DI]+WR_CURCOL,CX ;set actual column of cursor based
+ DEC [DI]+WR_CURCOL ; on current character byte count ;=W
+;
+; Increment pointers and counters to next character and byte position check
+;
+CC50: INC CX ;adjust byte counter
+ INC DX ;adjust character counter
+;
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte
+ JE CC30
+;
+ INC CX ;adjust byte count for trail byte
+ JMP CC30
+
+
+
+
+
+;
+; Calculate horizontal scroll coordinates
+;
+CC100:
+ MOV AX,[DI]+WR_CUCHAR ;initialize current character
+ CMP AX,[DI]+WR_HRCHAR ;horizontal display position must
+ JAE CC120 ; not be less than current char
+ ; position
+ MOV [DI]+WR_HRCHAR,AX ;set current char position as
+ ; new horizontal position
+;
+; Examine the next byte in the input buffer
+;
+CC120: CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been
+ JBE CC122 ; scanned and exit ;=W
+;
+ CMP BP,0 ;found current char yet ? ;=W
+ JE CC130 ;no, find it ;=W
+;
+ JMP CCEXIT ;=W
+CC122: ;=W
+ PUSH ES ;save registers
+ PUSH SI
+;
+ PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer
+ PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer
+ POP SI
+ POP ES
+;
+ DEC CX ;make byte count zero based
+ ADD SI,CX ;add byte count to input fld offst
+ INC CX ;make byte count one based
+ MOV AL,ES:[SI] ;get byte in input buffer to
+ MOV [DI]+DBC_KS,AL ; check if DBCS
+ CALL PCINDBC_CALL ;call routine to check if char
+ ; is lead double byte char
+;
+ POP SI ;restore registers
+ POP ES
+; ;=W
+; Set WR_HRBYTE to correct byte count ;=W
+; ;=W
+ CMP [DI]+WR_HRCHAR,DX ;is this position the first char ;=W
+ ;in the horizl. window ? ;=W
+ JNE CC125 ;no ;=W
+;
+ MOV [DI]+WR_HRBYTE,CX ;save # byte for first char in h. wind. ;=W
+;
+; Check if end data byte and character should be updated
+;
+CC125: CMP AL,WR_BLANK ;check if blanking character found
+ JE CC130 ;now adjust pointers
+;
+ MOV [DI]+WR_ENBYTE,CX ;set current byte count
+ MOV [DI]+WR_ENCHAR,DX ;set current character count
+ MOV [DI]+WR_RGCHAR,DX ;set right most character
+;
+; Check if current character pointer
+;
+CC130: CMP [DI]+WR_CUCHAR,DX ;check if current character found
+ JNE CC140
+;
+ MOV BP,1 ;current char found
+ MOV [DI]+WR_UPCHAR,DX ;set up and down character
+ MOV [DI]+WR_DNCHAR,DX ; to current character
+;
+ MOV [DI]+WR_CUBYTE,CX ;set current character byte count
+ MOV BX,CX ;set actual column of cursor based ;=W
+ ; on current character byte count ;=W
+ SUB BX,[DI]+WR_HRBYTE ;subtract beginning of horiz. wind. ;=W
+ ADD [DI]+WR_CURCOL,BX ;add to window offset = new column ;=W
+;
+; Increment pointers and counters to next character and byte position check
+;
+CC140: INC CX ;adjust byte counter
+ INC DX ;adjust character counter
+;
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte
+ JE CC120
+;
+ INC CX ;adjust byte count for trail byte
+ JMP CC120
+
+
+
+
+
+;
+; Calculate windowing coordinates ;=W
+;
+CC200: ;=W
+;
+; Examine the next byte in the input buffer ;=W
+;
+ CMP CX,ES:[SI]+ICB_FIELDLEN ;check if entire field has been ;=W
+ JBE CC235 ; scanned and exit ;=W
+;
+ CMP BP,0 ;found current char yet ? ;=W
+ JE CC240 ;no, find it ;=W
+;
+ JMP CCBYE ;boolean flag should have been set ;=W
+ ; already, if needed ;=W
+CC235: PUSH ES ;save registers ;=W
+ PUSH SI ;=W
+;
+ PUSH ES:[SI]+ICB_FIELDSEG ;get segment of input buffer ;=W
+ PUSH ES:[SI]+ICB_FIELDOFF ;get offset of input buffer ;=W
+ POP SI ;=W
+ POP ES ;=W
+;
+ DEC CX ;make byte count zero based ;=W
+ ADD SI,CX ;add byte count to input fld offst ;=W
+ INC CX ;make byte count one based ;=W
+ MOV AL,ES:[SI] ;get byte in input buffer to ;=W
+ MOV [DI]+DBC_KS,AL ; check if DBCS ;=W
+ CALL PCINDBC_CALL ;call routine to check if char ;=W
+ ; is lead double byte char ;=W
+;
+ POP SI ;restore registers ;=W
+ POP ES ;=W
+; ;=W
+; Check if end data byte and character should be updated ;=W
+; ;=W
+ CMP AL,WR_BLANK ;check if blanking character found ;=W
+ JE CC240 ;now adjust pointers ;=W
+;
+ MOV [DI]+WR_ENBYTE,CX ;set current byte count ;=W
+ MOV [DI]+WR_ENCHAR,DX ;set current character count ;=W
+ MOV [DI]+WR_RGCHAR,DX ;set right most character ;=W
+; ;=W
+; Check if current character pointer ;=W
+; ;=W
+CC240:
+ CMP [DI]+WR_CUCHAR,DX ;check if current character found ;=W
+ JNE CC250 ;no ;=W
+;
+ MOV BP,1 ;found current char
+ MOV [DI]+WR_CUBYTE,CX ;set current character byte count ;=W
+;
+ PUSH DX ;needed for division ;=W
+ MOV AX,CX ;get current cursor pos. in field ;=W
+ DEC AX ;make it zero based for divide ;=W
+;
+ CMP CX,ES:[SI]+ICB_FIELDLEN ;are we past end of field ? ;=W
+ JLE CC241 ;no ;=W
+ MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W
+ DEC AX ;make cursor pos. be inside field ;=W
+ ; for division ;=W
+ CWD ;calculate current row,column ;=W
+ IDIV ES:[SI]+ICB_WIDTH ; row = cur_byte / width-1 ;=W
+ ; col = cur_byte mod width-1 ;=W
+ INC DX ;reposition cursor in correct pos. ;=W
+ JMP CC244 ;=W
+CC241: ;=W
+ CWD ;calculate current row,column for ;=W
+ IDIV ES:[SI]+ICB_WIDTH ; cursor positions inside the field ;=W
+ ; row = cur_byte / width of field ;=W
+ ; col = cur_byte mod width of field ;=W
+CC244: ;=W
+ ADD [DI]+WR_CURROW,AX ;set actual row of cursor ;=W
+ ADD [DI]+WR_CURCOL,DX ;set actual column of cursor ;=W
+;
+ MOV BX,CX ;calculate WR_LFCHAR ;=W
+CC245: DEC BX ;get the correct cur_byte ;=W
+ MOV AX,BX ;cur_byte/width ;=W
+ CWD ;=W
+ IDIV ES:[SI]+ICB_WIDTH ;=W
+ CMP DX,0 ;is the remainder zero ? ;=W
+ JNE CC245 ;no, not at beginning of row, do again ;=W
+;
+ MOV [DI]+WR_LFCHAR,BX ;yes, this is beginning of row ;=W
+;
+ POP DX ;=W
+;
+; Increment pointers and counters to next character and byte position check ;=W
+; ;=W
+CC250: INC CX ;adjust byte counter ;=W
+ INC DX ;adjust character counter ;=W
+;
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if byte is leading DBC byte ;=W
+ JE CC260 ;=W
+;
+ INC CX ;adjust byte count for trail byte ;=W
+CC260:
+ JMP CC200 ;=W
+;
+; Exit
+;
+CCEXIT: ;=W
+ MOV AX,[DI]+WR_CUBYTE ;is cursor past end of field ;=W
+ CMP AX,ES:[SI]+ICB_FIELDLEN ;?? ;=W
+ JLE CCBYE ;no ;=W
+;
+ MOV [DI]+WR_FIELDEND,1 ;yes, set boolean flag ;=W
+CCBYE:
+ MOV AX,[DI]+WR_ENBYTE ;set ICB_ENDBYTE ;=W
+ MOV ES:[SI]+ICB_ENDBYTE,AX ;=W
+;
+ MOV AX,[DI]+WR_HRBYTE ;set ICB_HRSTART ;=W
+ MOV ES:[SI]+ICB_HRSTART,AX ;=W
+;
+ POP BP
+ POP SI ;restore registers
+ POP ES
+ POP DX ;restore registers
+ POP CX
+ POP BX
+ POP AX
+;
+ RET
+CAL_COORS ENDP
+;
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; SET_DISP_ADDR : ;=W
+; : ;=W
+; Determine which display routine to use. The choice is between : ;=W
+; left justified, right justified, double byte support, no double : ;=W
+; byte support, windowing, horizontal scrolling. : ;=W
+; Also pick the justify routine to use. : ;=W
+; : ;=W
+; ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ : ;=W
+; ³ DISPLAY ³ : ;=W
+; ÀÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÙ : ;=W
+; ÚÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄ¿ : ;=W
+; ÚÄÄÄÄÁÄÄÄÄ¿ ³ ³ ÚÄÄÄÄÁÄÄÄÄÄ¿ ³ ³ : ;=W
+; ³LEFT_DISP³ ³ ³ ³RIGHT_DISP³ ³ ³ : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÙ ³ ³ ÀÄÄÄÄÄÄÄÄÄÄÙ ³ ³ : ;=W
+; ÚÄÄÄÄÄÁÄÄÄÄÄ¿ ³ ÚÄÄÄÄÄÄÁÄÄÄÄÄ¿ ³ : ;=W
+; ³LEFT_H_DISP³ ³ ³RIGHT_H_DISP³ ³ : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÄÄÙ ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ ³ : ;=W
+; ÚÄÄÄÄÄÁÄÄÄÄ¿ ÚÄÄÄÄÄÄÁÄÄÄÄ¿ : ;=W
+; ³LEFTS_DISP³ ³RIGHTS_DISP³ : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÄÙ ÀÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
+; : ;=W
+; : ;=W
+; : ;=W
+; : ;=W
+; : ;=W
+; DISPLAY ROUTINES : ;=W
+; LEFT_DISP - left justified, double byte support, windowing : ;=W
+; LEFTS_DISP - left justified, no double byte support, windowing : ;=W
+; LEFT_H_DISP - left justified, double byte support, horizontal scrolling : ;=W
+; RIGHT_DISP - right justified, double byte support, windowing : ;=W
+; RIGHTS_DISP - right justified, no double byte support, windowing : ;=W
+; RIGHT_H_DISP - right justified, double byte support, horizontal scrolling : ;=W
+; : ;=W
+; JUSTIFY ROUTINES : ;=W
+; LEFT_H_JUST - left justified, horizontal scrolling : ;=W
+; LEFT_JUST - left justified, windowing : ;=W
+; RIGHT_H_JUST - right justified, horizontal scrolling : ;=W
+; RIGHT_JUST - right justified, windowing : ;=W
+; : ;=W
+; Entry: ES:SI - ICB control block : ;=W
+; DS:DI - IN control block : ;=W
+; Exit: none : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+SET_DISP_ADDR PROC NEAR ;=W
+;
+ PUSH AX ;=W
+ PUSH BX ;=W
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_RJU ;check if field right just ;=W
+ JNE SD20 ;if yes, jump ;=W
+;
+; Display value of input buffer left justified ;=W
+;
+ TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W
+ JE SD10 ;no, windowing mode ;=W
+;
+ MOV AX,OFFSET LEFT_H_DISP ;=W
+ MOV BX,OFFSET LEFT_H_JUST ;=W
+;
+ JMP SDEXIT ;=W
+SD10: ;=W
+ MOV AX,OFFSET LEFT_DISP ;=W
+ MOV BX,OFFSET LEFT_JUST ;=W
+;
+ TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W
+ JNE SDEXIT ;yes ;=W
+ MOV AX,OFFSET LEFTS_DISP ;no, single byte only ;=W
+ JMP SDEXIT ;=W
+;
+; Display default value of input buffer right justified ;=W
+;
+SD20: ;=W
+ TEST ES:[SI]+ICB_OPT3,ICB_HOR ;check if field is in horizontial ;=W
+ JE SD30 ;no, windowing mode ;=W
+;
+ MOV AX,OFFSET RIGHT_H_DISP ;=W
+ MOV BX,OFFSET RIGHT_H_JUST ;=W
+;
+ JMP SDEXIT ;=W
+SD30: ;=W
+ MOV AX,OFFSET RIGHT_DISP ;=W
+ MOV BX,OFFSET RIGHT_DISP ;=W
+;
+ TEST DS:[DI]+IN_OPT,IN_ADBCS ;check if double byte is active ;=W
+ JNE SDEXIT ;yes ;=W
+ MOV AX,OFFSET RIGHTS_DISP ;no, single byte only ;=W
+;
+SDEXIT: ;=W
+ MOV DS:[DI]+WR_DISPLAY,AX ;save addr of routine to call ;=W
+ MOV DS:[DI]+WR_JUSTIFY,BX ;save addr of routine to call ;=W
+;
+ POP BX ;=W
+ POP AX ;=W
+;
+ RET ;=W
+SET_DISP_ADDR ENDP ;=W
+;
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; RIGHTS_DISP : ;=W
+; : ;=W
+; Entry: : ;=W
+; : ;=W
+; Exit: : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+RIGHTS_DISP PROC NEAR ;=W
+; ;=W
+ ; ;=W
+ ; code here ;=W
+ ; ;=W
+; ;=W
+ RET ;=W
+RIGHTS_DISP ENDP ;=W
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; RIGHT_H_DISP :
+; :
+; Entry: :
+; :
+; Exit: :
+; :
+;-----------------------------------------------------------------------------+
+;
+RIGHT_H_DISP PROC NEAR
+;
+ ;
+ ; code here
+ ;
+;
+ RET
+RIGHT_H_DISP ENDP
+;
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; RIGHT_DISP : ;=W
+; : ;=W
+; Entry: : ;=W
+; : ;=W
+; Exit: : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+RIGHT_DISP PROC NEAR ;=W
+; ;=W
+ ; ;=W
+ ; code here ;=W
+ ; ;=W
+; ;=W
+ RET ;=W
+RIGHT_DISP ENDP ;=W
+; ;=W
+PAGE ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; LEFT_H_DISP : ;=W
+; : ;=W
+; Calculates if the specified character will fit in the input : ;=W
+; buffer at the specified character position without display. : ;=W
+; The byte offset where this character should be inserted is : ;=W
+; returned or a flag indicating that the character will not fit. : ;=W
+; : ;=W
+; Displays the specified portion of the input field buffer from : ;=W
+; the left character marker to the end of the field. The following : ;=W
+; display options are handled by this routine: : ;=W
+; : ;=W
+; - Display of the input field in a wrapped window : ;=W
+; - Adjustment of double byte characters to prevent malformed : ;=W
+; characters : ;=W
+; : ;=W
+; : ;=W
+; The following pointers are used: : ;=W
+; : ;=W
+; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
+; ³ buffer in memory. : ;=W
+; ³ : ;=W
+; ³ ÚÄ (WR_HRCHAR) Left marker delimiting the left : ;=W
+; ³ ³ most character position in the : ;=W
+; ³ ³ input buffer. : ;=W
+; ³ ³ : ;=W
+; ³ ³ : ;=W
+; ³ ³ : ;=W
+; ³ ³ : ;=W
+; ³ ³ : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
+; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W
+; ³ ³ Area to display (ICB_WIDTH) : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
+; ³ : ;=W
+; ICB_FIELDLEN Length of input field in bytes. : ;=W
+; : ;=W
+; : ;=W
+; Entry: ES:SI = Points to current ICB : ;=W
+; DS:DI = Points to PB : ;=W
+; : ;=W
+; WR_CATTR = Logical color attribute to use when updating screen : ;=W
+; if the use of the color attribute string is not : ;=W
+; specified. : ;=W
+; : ;=W
+; CR_RCOFF = Beginning offset of the upper left input field : ;=W
+; display corner from the beginning of the video : ;=W
+; buffer. : ;=W
+; : ;=W
+; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W
+; attributes. : ;=W
+; : ;=W
+; WR_HRCHAR = The offset into the input buffer, in characters, : ;=W
+; of where to begin display. : ;=W
+; : ;=W
+; Exit: (none) : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+LEFT_H_DISP PROC NEAR ;=W
+;
+ PUSH ES ;save PB pointers ;=W
+ PUSH DI ;=W
+ PUSH BX ;=W
+ PUSH [DI]+CR_RCOFF ;save input field display offset ;=W
+; ;=W
+; Initialize MOVEG parm block ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDOFF ;get offset of the input buffer ;=W
+ MOV [DI]+WR_FIELDOFF,AX ;=W
+ ;=W
+ MOV AX,ES:[SI]+ICB_FIELDSEG ;get segment of the input buffer ;=W
+ MOV [DI]+MG_TEXTSEG,AX ;=W
+ ;=W
+ MOV AX,ES:[SI]+ICB_ATTROFF ;get offset of color attribute buffer ;=W
+ MOV [DI]+MG_ATTOFF,AX ;=W
+ ;=W
+ MOV AX,ES:[SI]+ICB_ATTRSEG ;get segment of color attribute ;=W
+ MOV [DI]+MG_ATTSEG,AX ;buffer ;=W
+ ;=W
+ MOV AX,[DI]+IN_LVBSEG ;get segment of the LVB ;=W
+ MOV [DI]+MG_MIXSEG,AX ;=W
+ ;=W
+ MOV AL,[DI]+WR_CATTR ;get logical color attribute ;=W
+ MOV [DI]+MG_SOURCE_A,AL ;=W
+; ;=W
+; Display all characters in input buffer starting with WR_HRCHAR ;=W
+; and continuing until ICB_WIDTH-1 number of characters has been displayed. ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDOFF ;calcuate beginning character ;=W
+ ADD AX,[DI]+WR_HRBYTE ;to display ;=W
+ DEC AX ;=W
+ MOV [DI]+WR_FIELDOFF,AX ;save it ;=W
+ MOV [DI]+MG_TEXTOFF,AX ; to display ;=W
+;
+ MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
+ ;set write attribute option ;=W
+ ;set use logical attribute option ;=W
+ TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
+ JNE LHD10 ;=W
+;
+ OR [DI]+MG_OPT,MG_WC ;set write character option ;=W
+LHD10: ;=W
+ MOV AX,ES:[SI]+ICB_WIDTH ;get field width ;=W
+ MOV [DI]+MG_NUM,AX ;number of words to move into the ;=W
+ ; LVB ;=W
+;
+ MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
+ ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
+ MOV [DI]+MG_MIXOFF,AX ;=W
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
+; ;=W
+; Check if last character is DBCS ;=W
+; ;=W
+ PUSH ES ;=W
+ PUSH SI ;=W
+;
+ MOV AX,ES:[SI]+ICB_FIELDSEG ;get input buffer segment ;=W
+ MOV BX,ES:[SI]+ICB_FIELDOFF ;get input buffer offset ;=W
+ ADD BX,[DI]+WR_HRBYTE ;add offset of beginning of window ;=W
+ ADD BX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W
+ SUB BX,2 ;subtract to get correct byte ;=W
+ MOV ES,AX ;=W
+ MOV SI,BX ;=W
+ MOV AL,ES:[SI] ;get the character ;=W
+;
+ POP SI ;=W
+ POP ES ;=W
+;
+ PUSH AX ;=W
+ MOV [DI]+DBC_KS,AL ;=W
+ CALL PCINDBC_CALL ;check if char is lead DBCS ;=W
+ POP AX ;=W
+ TEST [DI]+DBC_STAT,DBC_DBCS ;is it ? ;=W
+ JE LHD30 ;no, display the character ;=W
+;
+ MOV AL,1DH ;display '', can't split DBCS char ;=W
+; ;=W
+; Display the last character ;=W
+; ;=W
+LHD30: ;=W
+ MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
+ ;set write attribute option ;=W
+ ;set use logical attribute option ;=W
+ TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
+ JNE LHD40 ;=W
+;
+ OR [DI]+MG_OPT,MG_WC+MG_UC ;set write character option ;=W
+LHD40: ;=W
+ MOV [DI]+MG_SOURCE_C,AL ;character to display ;=W
+ MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W
+ ; LVB ;=W
+;
+ MOV AX,ES:[SI]+ICB_WIDTH ;add width to get last character ;=W
+ MOV BX,2 ;=W
+ MUL BX ;x2 to account for attr. bytes ;=W
+ ADD AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
+ ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
+ SUB AX,2 ;subtract to get correct byte ;=W
+ MOV [DI]+MG_MIXOFF,AX ;=W
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
+LHDEXIT: ;=W
+ POP [DI]+CR_RCOFF ;save input field display offset ;=W
+ POP BX ;restore registers ;=W
+ POP DI ;=W
+ POP ES ;=W
+;
+ RET ;=W
+LEFT_H_DISP ENDP ;=W
+;
+PAGE
+;-----------------------------------------------------------------------------+
+; :
+; LEFT_DISP :
+; :
+; Calculates if the specified character will fit in the input :
+; buffer at the specified character position without display. :
+; The byte offset where this character should be inserted is :
+; returned or a flag indicating that the character will not fit. :
+; :
+; Displays the specified portion of the input field buffer from :
+; the left character marker to the end of the field. The following :
+; display options are handled by this routine: :
+; :
+; - Display of the input field in a wrapped window :
+; - Adjustment of double byte characters to prevent malformed :
+; characters :
+; :
+; :
+; The following pointers are used: :
+; :
+; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input :
+; ³ buffer in memory. :
+; ³ :
+; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left :
+; ³ ³ most character position in the :
+; ³ ³ input buffer. :
+; ³ ³ :
+; ³ ³ Right marker delimiting the right :
+; ³ ³ most character position in the :
+; ³ ³ input buffer. (WR_RIGHTCHAR) :
+; ³ ³ ³ :
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ :
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ :
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ :
+; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ :
+; ³ ³ Area to display :
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ :
+; ³ :
+; ICB_FIELDLEN Length of input field in bytes. :
+; :
+; :
+; Entry: ES:SI = Points to current ICB :
+; DS:DI = Points to PB :
+; :
+; AX 1 = This option will calculate if the specified number :
+; of bytes in BX can fit into input buffer at the :
+; specified character position considering the display :
+; coordinates and options. No update of the display :
+; screen will occur. A flag indicating if the bytes :
+; can be inserted or not is returned. If the bytes :
+; will fit the offset from the beginning of the input :
+; field in bytes is returned indicating where the :
+; characters should be inserted. :
+; :
+; 2 = This option will update the display screen in the :
+; proper format with the input buffer characters :
+; starting at the specified left offset character :
+; to the right character marker. :
+; :
+; BX = Number of bytes to insert starting at the specified :
+; character position. :
+; :
+; WR_CATTR = Logical color attribute to use when updating screen :
+; if the use of the color attribute string is not :
+; specified. :
+; :
+; CR_RCOFF = Beginning offset of the upper left input field :
+; display corner from the beginning of the video :
+; buffer. :
+; :
+; CR_SCRWIDTH = Width of the video buffer in characters and :
+; attributes. :
+; :
+; WR_LEFTCHAR = The offset into the input buffer, in characters, :
+; of where the specified bytes should fit. :
+; :
+; WR_RIGHTCHAR = The offset into the input buffer, in characters, :
+; of where the right most character position. :
+; :
+; :
+; Exit: If AX on entry is set to 1 then on exit: :
+; :
+; AX 0 = The specified number of characters will fit. :
+; 1 = The specified number of characters will not fit. :
+; :
+; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the :
+; left most character position. :
+; :
+; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the :
+; right most character position. :
+; :
+; :
+; If AX on entry is set to 2 then the input field buffer is :
+; displayed on the screen. :
+; :
+;-----------------------------------------------------------------------------+
+;
+LEFT_DISP PROC NEAR
+;
+ PUSH ES ;save PB pointers
+ PUSH DI
+ PUSH BX
+ PUSH [DI]+CR_RCOFF ;save input field display offset
+;
+ CALL LEFT_DISP_INIT ;initialize internal counter & vars ;=W
+;
+ JMP LF20 ;begin of first row
+;
+; Start a new row in LVB
+;
+LF10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row.
+ ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in
+ SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text
+ SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract
+ MOV [DI]+CR_RCOFF,AX ; the length of the input field
+ ; twice since length is just in
+ ; text chars
+;
+; Do not start new row
+;
+LF20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes
+ MOV [DI]+WR_CNTR2,AX ; available in current row of
+ ; input field
+;
+; Prepare to place next byte into LVB, verify chars remaining in input buffer
+;
+LF30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been
+ CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost)
+ JGE LF40 ;if not last char jump ?
+;
+ JMP LF160 ;yes, last character written
+ ; prepare to exit
+;
+; Check if end of field on display has been reached
+;
+LF40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is
+ CMP [DI]+WR_CNTR1,AX ; less than input buffer length
+ JLE LF50 ;
+;
+ JMP LF160
+;
+; Not complete
+;
+LF50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes
+ JE LF10 ; remaining in the row is greater
+ ; than zero, jump if bytes avail
+;
+ CMP [DI]+WR_MOVE,1 ;check if entry option is to
+ JNE LF60 ; determine if bytes may be
+ ; inserted in displayed field
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations
+ CMP [DI]+WR_CNTR3,AX ; should begin by comparing
+ JNE LF60 ; current counter with beginning
+ ; left character marker
+;
+ MOV AL,1 ;check if insertion calculations
+ CMP [DI]+WR_INSDONE,AL ; are complete
+ JE LF60 ;if yes, jump
+;
+; Adjust counters after pretending to insert a character into string and LVB
+;
+ MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row
+ ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB
+ SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row
+ MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc
+ JMP LF30 ; complete
+;
+; Determine if current byte is a DBCS lead byte
+;
+LF60: MOV BX,[DI]+WR_FIELDOFF ;get the current byte in the
+;
+ PUSH ES ;save registers
+ PUSH SI
+;
+ PUSH ES:[SI]+ICB_FIELDSEG ; input field buffer
+ PUSH [DI]+WR_FIELDOFF ;get the current byte in the
+ POP SI
+ POP ES
+;
+ MOV AL,ES:[SI] ;get character in input buffer
+;
+ POP SI ;restore registers
+ POP ES
+;
+ MOV [DI]+DBC_KS,AL
+;
+ CALL PCINDBC_CALL ;call routine to check if char
+ ; is lead double byte char
+;
+ TEST [DI]+DBC_STAT,DBC_DBCS ;check if char is lead DBCS
+ JNE LF70 ;if yes, jump to double byte code
+;
+ JMP LF130 ;if no, jump to single byte code
+;
+; Current byte is leading byte of a double byte character
+;
+LF70: CMP [DI]+WR_CNTR2,1 ;check if there is room in current
+ JNE LF80 ; row for double byte character
+;
+ JMP LF110 ;no room, adjust to next row
+;
+; Double byte character fits on current row
+;
+LF80: CMP [DI]+WR_MOVE,2 ;check if option to actually
+ JNE LF100 ; update display is active
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if character should be
+ CMP [DI]+WR_CNTR3,AX ; displayed by verifying that
+ JL LF100 ; current character falls
+ ; between the left and right
+ MOV AX,[DI]+WR_RIGHTCHAR ; character markers
+ CMP [DI]+WR_CNTR3,AX
+ JG LF100
+;
+ MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s)
+ MOV [DI]+MG_TEXTOFF,AX ; to display
+;
+ MOV [DI]+MG_OPT,MG_WA+MG_SC ;set write attribute option
+;
+ TEST ES:[SI]+ICB_OPT1,ICB_USC ;use attribute string
+ JNE LF84
+;
+ OR [DI]+MG_OPT,MG_UA ;set use logical attribute option
+;
+LF84: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;is option for password write
+ JNE LF85 ; active
+;
+ OR [DI]+MG_OPT,MG_WC ;set write character option
+;
+LF85: MOV [DI]+MG_NUM,2 ;number of words to move into LVB
+ MOV AX,[DI]+IN_LVBOFF ;set actual offset into LVB
+ ADD AX,[DI]+CR_RCOFF ; where character(s) will be
+ MOV [DI]+MG_MIXOFF,AX ; written
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write characters
+;
+; Adjust pointers and counters after moving double byte character
+;
+LF100: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
+ CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and
+ JNE LF104 ; left chars. See if the current
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so
+ MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4,
+ JMP LF106 ; into WR_LEFTBYTE
+;
+; Update right byte marker
+;
+LF104: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
+ CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and
+ JNE LF106 ; left chars. See if the current
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so
+ MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4,
+ ; into WR_RIGHTBYTE
+;
+LF106: ADD [DI]+WR_FIELDOFF,2 ;inc number bytes moved from input
+ ; buffer
+ ADD [DI]+CR_RCOFF,4 ;inc pointer into LVB
+ ADD [DI]+WR_CNTR1,2 ;inc number of bytes moved into
+ ; LVB
+ SUB [DI]+WR_CNTR2,2 ;dec number of bytes remain
+ INC [DI]+WR_CNTR3 ;inc number of characters moved
+ ; into LVB from input string
+ ADD [DI]+WR_CNTR4,2 ;inc number of bytes moved from
+ JMP LF30 ; input string
+;
+; Blank fill remaining screen character positions on current row to prevent
+; double byte character from being split
+;
+LF110: CMP [DI]+WR_MOVE,2 ;check if option to update display
+ JNE LF120 ; is active
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if current character
+ CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying
+ JL LF120 ; that the character falls
+ ; within the left and right
+ MOV AX,[DI]+WR_RIGHTCHAR ; character markers
+ CMP [DI]+WR_CNTR3,AX
+ JG LF120
+;
+ MOV AL,WR_BLANK ;get blanking character
+ MOV [DI]+MG_SOURCE_C,AL
+;
+ MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UC
+ ;set write attr, char and syn chk
+ TEST ES:[SI]+ICB_OPT1,ICB_USC
+ JNE LF114 ;use attribute string
+;
+ OR [DI]+MG_OPT,MG_UA ;set use logical attribute option
+;
+LF114: TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
+ JNE LF115
+;
+ OR [DI]+MG_OPT,MG_WC ;set write character option
+;
+LF115: MOV [DI]+MG_NUM,1 ;number of words to move into the
+ ; LVB
+ MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of
+ ADD AX,[DI]+CR_RCOFF ; the character to write
+ MOV [DI]+MG_MIXOFF,AX
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s)
+;
+; Adjust pointers and counters after writing blanking character to LVB
+;
+LF120: ADD [DI]+CR_RCOFF,2 ;inc pointer into the LVB
+ INC [DI]+WR_CNTR1 ;inc number of bytes moved into
+ ; the LVB
+ DEC [DI]+WR_CNTR2 ;dec number of bytes remaining in
+ JMP LF10 ; the current row
+;
+; Byte is a single byte character
+;
+LF130: CMP [DI]+WR_MOVE,2 ;check if option to update display
+ JNE LF150 ; is active
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if current character
+ CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying
+ JL LF150 ; that the character falls
+;
+ MOV AX,[DI]+WR_RIGHTCHAR ; character markers
+ CMP [DI]+WR_CNTR3,AX
+ JG LF150
+;
+ MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s)
+ MOV [DI]+MG_TEXTOFF,AX ; to display
+;
+ MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA
+ ;set write attribute option
+ ;set use logical attribute option
+ TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active
+ JNE LF135
+;
+ OR [DI]+MG_OPT,MG_WC ;set write character option
+;
+LF135: MOV [DI]+MG_NUM,1 ;number of words to move into the
+ ; LVB
+;
+ MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of
+ ADD AX,[DI]+CR_RCOFF ; the character to write
+ MOV [DI]+MG_MIXOFF,AX
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s)
+;
+; Adjust pointers and counters after moving single byte character
+;
+LF150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
+ CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and
+ JNE LF154 ; left chars. See if the current
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so
+ MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4,
+ JMP LF156 ; into WR_LEFTBYTE
+;
+; Update right byte marker
+;
+LF154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left
+ CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and
+ JNE LF156 ; left chars. See if the current
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so
+ MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4,
+ ; into WR_RIGHTBYTE
+;
+LF156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer
+ ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB
+ INC [DI]+WR_CNTR1 ;inc counter with number bytes
+ ; moved into LVB
+ DEC [DI]+WR_CNTR2 ;dec counter with number of bytes
+ ; remaining in current row
+ ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars
+ ; moved into the LVB from input
+ ; buffer
+ ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes
+ JMP LF30 ; moved into the LVB from input
+ ; buffer
+;
+; Completed updating LVB, adjust pointers
+;
+LF160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate
+ JNE LFEXIT ; if chars fit in buffer
+;
+; Set up proper return values for insert calculation
+;
+ MOV AX,1 ;set flag indicating insert did
+ ; not fit
+ MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB
+ DEC BX ; by comparing the right char
+ CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars
+ JNE LFEXIT ; moved into the LVB. If they
+ ; are equal the string fit into
+ ; the LVB.
+ CMP [DI]+WR_INSDONE,1 ;see if insert has been done
+ JE LF170 ;if yes set up return values
+;
+ MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of
+ SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char
+ INC BX ;see if there is enough room left
+ CMP BX,[DI]+WR_BYTESINST ; to display char being inserted
+ JL LFEXIT
+;
+LF170: MOV AX,0 ;set flag indicating insert fits
+;
+; Restores the registers to entry values and exits
+;
+LFEXIT: POP [DI]+CR_RCOFF ;save input field display offset
+;
+ POP BX ;restore registers
+ POP DI
+ POP ES
+;
+ RET
+LEFT_DISP ENDP
+;
+PAGE
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; LEFTS_DISP (no double byte support) : ;=W
+; : ;=W
+; Calculates if the specified character will fit in the input : ;=W
+; buffer at the specified character position without display. : ;=W
+; The byte offset where this character should be inserted is : ;=W
+; returned or a flag indicating that the character will not fit. : ;=W
+; : ;=W
+; Displays the specified portion of the input field buffer from : ;=W
+; the left character marker to the end of the field. The following : ;=W
+; display options are handled by this routine: : ;=W
+; : ;=W
+; - Display of the input field in a wrapped window : ;=W
+; - Adjustment of double byte characters to prevent malformed : ;=W
+; characters : ;=W
+; : ;=W
+; : ;=W
+; The following pointers are used: : ;=W
+; : ;=W
+; ÚÄ (ICB_FIELDSEG:ICB_FIELDOFF) Beginning address of input : ;=W
+; ³ buffer in memory. : ;=W
+; ³ : ;=W
+; ³ ÚÄ (WR_LEFTCHAR) Left marker delimiting the left : ;=W
+; ³ ³ most character position in the : ;=W
+; ³ ³ input buffer. : ;=W
+; ³ ³ : ;=W
+; ³ ³ Right marker delimiting the right : ;=W
+; ³ ³ most character position in the : ;=W
+; ³ ³ input buffer. (WR_RIGHTCHAR) : ;=W
+; ³ ³ ³ : ;=W
+; ÚÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄÂÄÄÄ¿ : ;=W
+; ³ S ³ L ³ T ³ L ³ T ³ S ³ L ³ T ³ S ³ S ³ S ³ S ³ ³ ³ : ;=W
+; ÀÄÄÄÁÄÄÄÁÄÄÄÁÄÍÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÁÄÄÄÙ : ;=W
+; ³ ÃÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ´ : ;=W
+; ³ ³ Area to display : ;=W
+; ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ : ;=W
+; ³ : ;=W
+; ICB_FIELDLEN Length of input field in bytes. : ;=W
+; : ;=W
+; : ;=W
+; Entry: ES:SI = Points to current ICB : ;=W
+; DS:DI = Points to PB : ;=W
+; : ;=W
+; AX 1 = This option will calculate if the specified number : ;=W
+; of bytes in BX can fit into input buffer at the : ;=W
+; specified character position considering the display : ;=W
+; coordinates and options. No update of the display : ;=W
+; screen will occur. A flag indicating if the bytes : ;=W
+; can be inserted or not is returned. If the bytes : ;=W
+; will fit the offset from the beginning of the input : ;=W
+; field in bytes is returned indicating where the : ;=W
+; characters should be inserted. : ;=W
+; : ;=W
+; 2 = This option will update the display screen in the : ;=W
+; proper format with the input buffer characters : ;=W
+; starting at the specified left offset character : ;=W
+; to the right character marker. : ;=W
+; : ;=W
+; BX = Number of bytes to insert starting at the specified : ;=W
+; character position. : ;=W
+; : ;=W
+; WR_CATTR = Logical color attribute to use when updating screen : ;=W
+; if the use of the color attribute string is not : ;=W
+; specified. : ;=W
+; : ;=W
+; CR_RCOFF = Beginning offset of the upper left input field : ;=W
+; display corner from the beginning of the video : ;=W
+; buffer. : ;=W
+; : ;=W
+; CR_SCRWIDTH = Width of the video buffer in characters and : ;=W
+; attributes. : ;=W
+; : ;=W
+; WR_LEFTCHAR = The offset into the input buffer, in characters, : ;=W
+; of where the specified bytes should fit. : ;=W
+; : ;=W
+; WR_RIGHTCHAR = The offset into the input buffer, in characters, : ;=W
+; of where the right most character position. : ;=W
+; : ;=W
+; : ;=W
+; Exit: If AX on entry is set to 1 then on exit: : ;=W
+; : ;=W
+; AX 0 = The specified number of characters will fit. : ;=W
+; 1 = The specified number of characters will not fit. : ;=W
+; : ;=W
+; WR_LEFTBYTE = The offset into the input buffer, in bytes, of the : ;=W
+; left most character position. : ;=W
+; : ;=W
+; WR_RIGHTBYTE = The offset into the input buffer, in bytes, of the : ;=W
+; right most character position. : ;=W
+; : ;=W
+; : ;=W
+; If AX on entry is set to 2 then the input field buffer is : ;=W
+; displayed on the screen. : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+; ;=W
+LEFTS_DISP PROC NEAR ;=W
+;
+ PUSH ES ;save PB pointers ;=W
+ PUSH DI ;=W
+ PUSH BX ;=W
+ PUSH [DI]+CR_RCOFF ;save input field display offset ;=W
+;
+ CALL LEFT_DISP_INIT ;initialize internal counters & vars ;=W
+;
+ JMP LS20 ;begin of first row ;=W
+; ;=W
+; Start a new row in LVB ;=W
+; ;=W
+LS10: MOV AX,[DI]+CR_RCOFF ;set ptr into LVB to next row. ;=W
+ ADD AX,[DI]+CR_SCRWIDTH ; Start with current position in ;=W
+ SUB AX,ES:[SI]+ICB_WIDTH ; LVB, add screen width in text ;=W
+ SUB AX,ES:[SI]+ICB_WIDTH ; and attributes, then subtract ;=W
+ MOV [DI]+CR_RCOFF,AX ; the length of the input field ;=W
+ ; twice since length is just in ;=W
+ ; text chars ;=W
+; ;=W
+; Do not start new row ;=W
+; ;=W
+LS20: MOV AX,ES:[SI]+ICB_WIDTH ;counter contains number of bytes ;=W
+ MOV [DI]+WR_CNTR2,AX ; available in current row of ;=W
+ ; input field ;=W
+; ;=W
+; Prepare to place next byte into LVB, verify chars remaining in input buffer ;=W
+; ;=W
+LS30: MOV AX,[DI]+WR_CNTR3 ;check if last character has been ;=W
+ CMP [DI]+WR_RIGHTCHAR,AX ; written in LVB (rightmost) ;=W
+ JGE LS40 ;if not last char jump ? ;=W
+;
+ JMP LS160 ;yes, last character written ;=W
+ ; prepare to exit ;=W
+; ;=W
+; Check if end of field on display has been reached ;=W
+; ;=W
+LS40: MOV AX,ES:[SI]+ICB_FIELDLEN ;loop if number chars moved is ;=W
+ CMP [DI]+WR_CNTR1,AX ; less than input buffer length ;=W
+ JLE LS50 ; ;=W
+;
+ JMP LS160 ;=W
+; ;=W
+; Not complete ;=W
+; ;=W
+LS50: CMP [DI]+WR_CNTR2,0 ;loop while number of bytes ;=W
+ JE LS10 ; remaining in the row is greater ;=W
+ ; than zero, jump if bytes avail ;=W
+;
+ CMP [DI]+WR_MOVE,1 ;check if entry option is to ;=W
+ JNE LS130 ; determine if bytes may be ;=W
+ ; inserted in displayed field ;=W
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if insertion calculations ;=W
+ CMP [DI]+WR_CNTR3,AX ; should begin by comparing ;=W
+ JNE LS130 ; current counter with beginning ;=W
+ ; left character marker ;=W
+;
+ MOV AL,1 ;check if insertion calculations ;=W
+ CMP [DI]+WR_INSDONE,AL ; are complete ;=W
+ JE LS130 ;if yes, jump ;=W
+; ;=W
+; Adjust counters after pretending to insert a character into string and LVB ;=W
+; ;=W
+ MOV AX,[DI]+WR_BYTESINST ;dec number bytes avail in row ;=W
+ ADD [DI]+WR_CNTR1,AX ;inc number bytes moved into LVB ;=W
+ SUB [DI]+WR_CNTR2,AX ;dec number bytes remaining in row ;=W
+ MOV [DI]+WR_INSDONE,1 ;set flag indicating insert calc ;=W
+ JMP LS30 ; complete ;=W
+; ;=W
+; Byte is a single byte character ;=W
+; ;=W
+LS130: CMP [DI]+WR_MOVE,2 ;check if option to update display ;=W
+ JNE LS150 ; is active ;=W
+;
+ MOV AX,[DI]+WR_LEFTCHAR ;check if current character ;=W
+ CMP [DI]+WR_CNTR3,AX ; should be displayed by verifying ;=W
+ JL LS150 ; that the character falls ;=W
+ ; within the left and right ;=W
+ MOV AX,[DI]+WR_RIGHTCHAR ; character markers ;=W
+ CMP [DI]+WR_CNTR3,AX ;=W
+ JG LS150 ;=W
+;
+ MOV AX,[DI]+WR_FIELDOFF ;get offset of character(s) ;=W
+ MOV [DI]+MG_TEXTOFF,AX ; to display ;=W
+;
+ MOV [DI]+MG_OPT,MG_WA+MG_SC+MG_UA ;=W
+ ;set write attribute option ;=W
+ ;set use logical attribute option ;=W
+ TEST ES:[SI]+ICB_OPT1,ICB_PSW ;check if password option active ;=W
+ JNE LS135 ;=W
+;
+ OR [DI]+MG_OPT,MG_WC ;set write character option ;=W
+;
+LS135: MOV [DI]+MG_NUM,1 ;number of words to move into the ;=W
+ ; LVB ;=W
+;
+ MOV AX,[DI]+IN_LVBOFF ;set the actual LVB offset of ;=W
+ ADD AX,[DI]+CR_RCOFF ; the character to write ;=W
+ MOV [DI]+MG_MIXOFF,AX ;=W
+;
+ CALL PCMOVEG_CALL ;call PCMOVEG to write the char(s) ;=W
+; ;=W
+; Adjust pointers and counters after moving single byte character ;=W
+; ;=W
+LS150: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W
+ CMP AX,[DI]+WR_LEFTCHAR ; byte positions of the right and ;=W
+ JNE LS154 ; left chars. See if the current ;=W
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the left char, if so ;=W
+ MOV [DI]+WR_LEFTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W
+ JMP LS156 ; into WR_LEFTBYTE ;=W
+; ;=W
+; Update right byte marker ;=W
+; ;=W
+LS154: MOV AX,[DI]+WR_CNTR3 ;LEFT returns the right and left ;=W
+ CMP AX,[DI]+WR_RIGHTCHAR ; byte positions of the right and ;=W
+ JNE LS156 ; left chars. See if the current ;=W
+;
+ MOV AX,[DI]+WR_CNTR4 ; char is the right char, if so ;=W
+ MOV [DI]+WR_RIGHTBYTE,AX ; store the byte offset, WR_CNTR4, ;=W
+ ; into WR_RIGHTBYTE ;=W
+LS156: INC [DI]+WR_FIELDOFF ;inc pointer input buffer ;=W
+ ADD [DI]+CR_RCOFF,2 ;inc pointer into LVB ;=W
+ INC [DI]+WR_CNTR1 ;inc counter with number bytes ;=W
+ ; moved into LVB ;=W
+ DEC [DI]+WR_CNTR2 ;dec counter with number of bytes ;=W
+ ; remaining in current row ;=W
+ ADD [DI]+WR_CNTR3,1 ;inc counter with number of chars ;=W
+ ; moved into the LVB from input ;=W
+ ; buffer ;=W
+ ADD [DI]+WR_CNTR4,1 ;inc counter with number of bytes ;=W
+ JMP LS30 ; moved into the LVB from input ;=W
+ ; buffer ;=W
+; ;=W
+; Completed updating LVB, adjust pointers ;=W
+; ;=W
+LS160: CMP [DI]+WR_MOVE,1 ;Check if option to calculate ;=W
+ JNE LSEXIT ; if chars fit in buffer ;=W
+; ;=W
+; Set up proper return values for insert calculation ;=W
+; ;=W
+ MOV AX,1 ;set flag indicating insert did ;=W
+ ; not fit ;=W
+ MOV BX,[DI]+WR_CNTR3 ;see if input field fit into LVB ;=W
+ DEC BX ; by comparing the right char ;=W
+ CMP [DI]+WR_RIGHTCHAR,BX ; number with the number of chars ;=W
+ JNE LSEXIT ; moved into the LVB. If they ;=W
+ ; are equal the string fit into ;=W
+ ; the LVB. ;=W
+ CMP [DI]+WR_INSDONE,1 ;see if insert has been done ;=W
+ JE LS170 ;if yes set up return values ;=W
+;
+ MOV BX,ES:[SI]+ICB_FIELDLEN ;if no, then insert is at end of ;=W
+ SUB BX,[DI]+WR_CNTR1 ; line i.e. past right char ;=W
+ INC BX ;see if there is enough room left ;=W
+ CMP BX,[DI]+WR_BYTESINST ; to display char being inserted ;=W
+ JL LSEXIT ;=W
+;
+LS170: MOV AX,0 ;set flag indicating insert fits ;=W
+; ;=W
+; Restores the registers to entry values and exits ;=W
+; ;=W
+LSEXIT: POP [DI]+CR_RCOFF ;save input field display offset ;=W
+;
+ POP BX ;restore registers ;=W
+ POP DI ;=W
+ POP ES ;=W
+;
+ RET ;=W
+LEFTS_DISP ENDP ;=W
+;
+PAGE
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; DRAW_DEM : ;=W
+; Draw a input field delimiter : ;=W
+; : ;=W
+; Entry: : ;=W
+; ES:SI address of icon : ;=W
+; GC_ROW - character row to display delimiter : ;=W
+; GC_COL - character column to display delimiter : ;=W
+; : ;=W
+; Exit: None : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+DRAW_DEM PROC NEAR ;=W
+;
+ PUSH AX ;=W
+ PUSH BX ;=W
+ PUSH CX ;=W
+ PUSH DX ;=W
+ PUSH DI ;=W
+ PUSH SI ;=W
+ PUSH DS ;=W
+ PUSH ES ;=W
+ PUSH BP ;=W
+;
+ MOV BP,AX
+;
+ MOV DX,300H + graph_addr ;=W
+ MOV AH,2 ; Write Mode 2 ;=W
+ MOV AL,5 ; Write Mode Register ;=W
+ OUT DX,AX ;=W
+;
+ MOV DL,seq_addr ;=W
+ MOV AH,0FFH ;enable all maps ;=W
+ MOV AL,s_map ;map mask ;=W
+ OUT DX,AX ;set the registers ;=W
+;
+ MOV AX,[DI]+WR_ROWBYTES ;=W
+ MOV BX,50H ;=W
+ MUL BX ;=W
+ ;=W
+ MOV BX,[DI]+GC_ROW ;=W
+ MUL BX ;=W
+ ADD AX,[DI]+GC_COL ;=W
+;
+ MOV BH,[DI]+WR_CATTR ;get current color attribute ;=W
+;
+ CMP [DI]+WR_VIDMODE,11H ;check for graphics mode 11H
+ JNE DD05 ;nop, continue
+ MOV BH,0FH ;yes, mode 11 is only black &
+;
+DD05: MOV CL,4 ;count for shift ;=W
+ SHR BX,CL ;separate background/foreground ;=W
+ MOV CL,4 ;count for shift ;=W
+ SHR BL,CL ;put in low order nibble ;=W
+ XCHG BL,BH ;foreground/background are reversed ;=W
+ ; for delimiter
+; BL = background color, BH = foreground color
+ CMP BP,02 ;check if we want to remove delimiters ;=W
+ JNE DD10 ;no, ok ;=W
+ MOV BH,BL ;make both background color ;=W
+ ;=W
+DD10: ;=W
+ MOV CL,[DI]+WR_VIDMODE ;=W
+ MOV DX,[DI]+IN_OPT
+;
+ PUSH ES ;make DS:SI point to bit maps ;=W
+ POP DS ;=W
+;
+ MOV DI,AX ;=W
+ MOV AX,0A000H ;=W
+ MOV ES,AX ;=W
+;
+ TEST DX,IN_MCGA ;mode 11H, non-VGA hardware?
+ JNE DD100 ;if so, go do it
+;--------------------------------------------- ;=W
+; Mode 10,11,12 with VGA : ;=W
+;--------------------------------------------- ;=W
+ MOV DX,300H + graph_addr ;graphics chip ;=W
+ XOR CH,CH ;=W
+;
+ MOV AL,CL ;save vid mode
+ MOV CL,0EH ;# pixel rows in delimiter ;=W
+ CMP AL,10H ;are we in graphics mode 10H
+ JE DD40 ;yes, # rows ok
+ ADD CL,2 ;no, mode 11,12 have 16 pixel rows
+DD40: ; instead of 14 pixel rows.
+ MOV BP,02H ;# pixel columns/8 in delimiter ;=W
+;
+ MOV AH,0FFH ;=W
+ MOV AL,g_bit_mask ;bit mask index ;=W
+ OUT DX,AX ;set bit mask ;=W
+DD50: ;=W
+ PUSH CX ;=W
+ PUSH DI ;=W
+ MOV CX,BP ;=W
+DD60: ;=W
+ MOV AH,0FFH ;background ;=W
+ MOV AL,g_bit_mask ;bit mask index ;=W
+ OUT DX,AX ;set bit mask ;=W
+;
+ MOV AL,ES:[DI] ;latch data ;=W
+ MOV ES:[DI],BH ;set the dot ;=W
+;
+ LODSB ;foreground ;=W
+ XCHG AL,AH ;=W
+;
+ MOV AL,g_bit_mask ;bit mask index ;=W
+ OUT DX,AX ;set bit mask ;=W
+;
+ MOV AL,ES:[DI] ;latch data ;=W
+ MOV ES:[DI],BL ;set the dot ;=W
+;
+ INC DI ;=W
+ LOOP DD60 ;=W
+;
+ POP DI ;=W
+ ADD DI,LINELEN ;=W
+ POP CX ;=W
+ LOOP DD50 ;=W
+ JMP DDEXIT ;=W
+;--------------------------------------------- ;=W
+; Mode 11H with no VGA : ;=W
+;--------------------------------------------- ;=W
+DD100: XOR CH,CH
+ MOV CL,10H ;# pixel rows in delimiter
+ MOV BP,02H ;# of pixel columns in delimiter
+
+DD110: PUSH CX
+ PUSH DI
+;
+ MOV CX,BP
+;
+DD120: LODSB ;get icon row
+;
+DD130: XOR AL,0FFH
+ MOV ES:[DI],AL ;set the dot
+ INC DI
+ LOOP DD120
+;
+ POP DI
+;
+ ADD DI,50H ;line length, 80
+;
+ POP CX
+;
+ LOOP DD110
+;
+DDEXIT: POP BP
+ POP ES
+ POP DS
+ POP SI
+ POP DI
+ POP DX
+ POP CX
+ POP BX
+ POP AX
+;
+ RET
+DRAW_DEM ENDP
+;
+PAGE
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; GET_MONO_DOS : ;=W
+; Get segment and offset of the DOS monocasing table and return it : ;=W
+; : ;=W
+; Entry: None : ;=W
+; : ;=W
+; Exit: None : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+GET_MONO_DOS PROC NEAR ;=W
+;
+ PUSH SI ;save registers ;=W
+ PUSH ES ;=W
+ PUSH DI ;=W
+;
+ MOV AH,65H ;extended country info ;=W
+ MOV AL,02H ;get uppercase table ptrs ;=W
+ MOV BX,-1 ;default code page ;=W
+ MOV DX,-1 ;default country id ;=W
+ MOV CX,05H ;# bytes returned ;=W
+ PUSH DS ;=W
+ POP ES ;ES:DI ptrs to return buffer ;=W
+ MOV DI,OFFSET WR_CUCHAR ;use as temp buffer ;=W
+;
+ INT 21H ;=W
+;
+ INC DI ;skip info id ;=W
+ MOV SI,DI ;we need DI so use SI ;=W
+ POP DI ;=W
+;
+ MOV AX,WORD PTR [SI] ;get DOS monocasing table offset ;=W
+ MOV [DI]+IN_MONOOFF,AX ;save it ;=W
+ ADD SI,2 ;=W
+ MOV AX,WORD PTR [SI] ;get DOS monocasing table segment ;=W
+ MOV [DI]+IN_MONOSEG,AX ;save it ;=W
+;
+ POP ES ;restore registers ;=W
+ POP SI ;=W
+;
+ RET ;=W
+GET_MONO_DOS ENDP
+;
+PAGE
+;-----------------------------------------------------------------------------+ ;=W
+; : ;=W
+; GET_DBCS : ;=W
+; Get segment and offset of the DOS double byte support table. : ;=W
+; : ;=W
+; Entry: DS:DI : ;=W
+; : ;=W
+; Exit: None : ;=W
+; : ;=W
+;-----------------------------------------------------------------------------+ ;=W
+GET_DBCS PROC NEAR ;=W
+;
+ PUSH SI
+ PUSH ES ;=W
+ PUSH DI ;=W
+ PUSH DI ;=W
+;
+ MOV AH,65H ;get extended country info
+ MOV AL,07H ;get DBCS environment table
+ INT 21H ;DOS function call,vector returned
+ ; in ES:DI
+ POP SI ;ptr, SI -> IN_PB
+ INC DI ;skip over id byte returned
+ MOV AX,WORD PTR ES:[DI] ;get offset of DBCS table
+ MOV [DI]+IN_DBCSOFF,AX ;save it
+;
+ ADD DI,2 ;skip over offset to get segment
+ MOV BX,WORD PTR ES:[DI] ;get segment of DBCS table
+ MOV [DI]+IN_DBCSSEG,BX ;save it
+;
+ POP DI
+;
+ MOV SI,AX ;Point to DBCS table to get length
+ MOV ES,BX
+ MOV AX,WORD PTR ES:[SI]
+ MOV [DI]+IN_DBCSLEN,AX
+ ADD [DI]+IN_DBCSOFF,2 ;change offset to point to table
+;
+ POP ES
+ POP SI
+;
+ RET
+GET_DBCS ENDP
diff --git a/private/mvdm/dos/v86/inc/pdb.inc b/private/mvdm/dos/v86/inc/pdb.inc
new file mode 100644
index 000000000..d5b816b1e
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/pdb.inc
@@ -0,0 +1,57 @@
+; SCCSID = @(#)pdb.asm 1.1 85/04/10
+BREAK <Process data block>
+
+;** Process data block (otherwise known as program header)
+;
+
+; These offset are documented in the MSDOS Encyclopedia, so nothing
+; can be rearranged here, ever. Reserved areas are probably safe
+; for use.
+
+
+FilPerProc EQU 20
+
+Process_data_block STRUC
+PDB_Exit_Call DW ? ; INT int_abort system terminate
+PDB_block_len DW ? ; size of execution block
+ DB ?
+PDB_CPM_Call DB 5 DUP (?) ; ancient call to system
+PDB_Exit DD ? ; pointer to exit routine
+PDB_Ctrl_C DD ? ; pointer to ^C routine
+PDB_Fatal_abort DD ? ; pointer to fatal error
+PDB_Parent_PID DW ? ; PID of parent (terminate PID)
+PDB_JFN_Table DB FilPerProc DUP (?)
+PDB_environ DW ? ; seg addr of environment
+PDB_User_stack DD ? ; stack of self during system calls
+PDB_JFN_Length DW ? ; number of handles allowed
+PDB_JFN_Pointer DD ? ; pointer to JFN table
+PDB_Next_PDB DD ? ; pointer to nested PDB's
+
+PDB_InterCon DB ? ; *** jh-3/28/90 ***
+PDB_Append DB ? ; *** Not sure if still used ***
+
+PDB_Novell_Used DB 2 DUP (?) ; Novell shell (redir) uses these
+
+PDB_Version DW ? ; DOS version reported to this app
+
+PDB_PAD1 DB 0Eh DUP (?)
+PDB_Call_system DB 5 DUP (?) ; portable method of system call
+PDB_PAD2 DB 7h DUP (?) ; reserved so FCB 1 can be used as
+ ; an extended FCB
+PDB_FCB1 DB 10h dup (?) ; default FCB 1
+PDB_FCB2 DB 10h dup (?) ; default FCB 2
+PDB_PAD3 DB 4 dup (?) ; not sure if this is used by PDB_FCB2
+PDB_TAIL DB 128 dup (?) ; command tail and default DTA
+
+
+
+Process_data_block ENDS
+
+
+;
+;PDB_Append equ BYTE PTR PDB_PAD1 + 1 ; reincluded because APPEND
+; ; wouldn't build w/o it. feb 1990, leaf
+;
+;PDB_InterCon EQU BYTE PTR PDB_PAD1 ; 2/12/KK
+;
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/postequ.inc b/private/mvdm/dos/v86/inc/postequ.inc
new file mode 100644
index 000000000..07de0f8af
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/postequ.inc
@@ -0,0 +1,267 @@
+;
+; M024 MD 01/28/91 Added new keyboard commands
+;
+;----------------------------------------------------------------------------
+; EQUATES :
+;----------------------------------------------------------------------------
+TTEST EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
+KY_LOCK EQU 0 ; CONDITIONAL ASM (TEST2.SRC)
+KEY_NUMS EQU 0 ; CONDITIONAL ASM (KYBD.SRC)
+;----------------------------------------------------------------------------
+X287 EQU 0F0H ; MATH PROCESSOR
+;----------------------------------------------------------------------------
+LOOP_POST EQU 020H ; MFG LOOP POST JUMPER
+;----------------------------------------------------------------------------
+REFRESH_BIT EQU 010H ; REFRESH TEST BIT
+;----------------------------------------------------------------------------
+POST_SS EQU 0H ; POST STACK SEGMENT
+POST_SP EQU 8000H ; POST STACK POINTER
+TEMP_STACK_LO EQU 0FFFFH ;
+TEMP_STACK_HI EQU 0 ; SET PROTECTED MODE TEMP_SS
+ ; 0:FFFFH
+;----------------------------------------------------------------------------
+PORT_A EQU 60H ; 8042 KEYBOARD SCAN/DIAG OUTPUTS
+PORT_B EQU 61H ; 8042 READ WRITE REGISTER
+PARITY_ERR EQU 0C0H ; RAM/IO CHANNEL PARITY ERROR
+RAM_PAR_ON EQU 11110011B ; AND THIS VALUE
+RAM_PAR_OFF EQU 00001100B ; OR THIS VALUE
+IO_CHK EQU 01000000B ; IO CHECK?
+PRTY_CHK EQU 10000000B ; PARITY CHECK?
+
+STATUS_PORT EQU 64H ;8042 STATUS PORT
+OUT_BUF_FULL EQU 01H ; 0 = +OUTPUT BUFFER FULL
+INPT_BUF_FULL EQU 02H ; 1 = +INPUT BUFFER FULL
+SYS_FLAG EQU 04H ; 2 = -SYSTEM FLAG -POR/-SELF TEST
+CMD_DATA EQU 08H ; 3 = -COMMAND/+DATA
+KYBD_INH EQU 10H ; 4 = +KEYBOARD INHIBITED
+TRANS_TMOUT EQU 20H ; 5 = +TRANSMIT TIMEOUT
+RCV_TMOUT EQU 40H ; 6 = +RECEIVE TIME OUT
+PARITY_EVEN EQU 80H ; 7 = +PARITY IS EVEN
+SHUT_CMD EQU 0FEH ; CAUSE A SHUTDOWN COMMAND
+INTR_FACE_CK EQU 0ABH ; CHECK 8042 INTERFACE CMD
+KYBD_CLK_DATA EQU 0E0H ; GET KYBD CLOCK AND DATA CMD
+KYBD_CLK EQU 001H ; KEYBOARD CLOCK BIT 0
+;----------MANUFACTURING PORT------------------------------------------------
+MFG_PORT EQU 80H ; MANUFACTURING CHECKPOINT PORT
+;----------MANUFACTURING BIT DEFINITION FOR MFG_ERR_FLAG+1-------------------
+MEM_FAIL EQU 00000001B ; STORAGE TEST FAILED (ERROR 20X)
+PRO_FAIL EQU 00000010B ; VIRTUAL MODE TEST FAILED (ERROR 104)
+LMCS_FAIL EQU 00000100B ; LOW MEG CHIP SELECT FAILED (ERROR 109)
+KYCLK_FAIL EQU 00001000B ; KEYBOARD CLOCK TEST FAILED (ERROR 304)
+KY_SYS_FAIL EQU 00010000B ; KEYBOARD OR SYSTEM FAILED (ERROR 303)
+KYBD_FAIL EQU 00100000B ; KEYBOARD FAILED (ERROR 301)
+DSK_FAIL EQU 01000000B ; DISKETTE TEST FAILED (ERROR 601)
+KEY_FAIL EQU 10000000B ; KEYBOARD LOCKED (ERROR 302)
+;----------8042 INPUT PORT BIT DEFINITION------------------------------------
+BASE_RAM EQU 10H ;BASE R/W MEMORY
+MFG_JMP EQU 20H ;LOOP POST JUMPER
+DSP_JMP EQU 40H ;DISPLAY TYPE JUMPER
+KEY_BD_INHIB EQU 80H ;KEYBOARD INHIBIT SWITCH
+;----------8042 RAM DEFINITION-----------------------------------------------
+INH_KEYBOARD EQU 10H ;BYTE 0 BIT 4 OF 8042 RAM
+;-------------- COMMANDS ----------------------------------------------------
+READ_8042_RAM EQU 20H ; BITS 0-4 = ADDRESS (20-3F)
+WRITE_8042_RAM EQU 60H ;
+SELF_8042_TEST EQU 0AAH ; 8042 SELF TEST
+READ_8042_INPUT EQU 0C0H ; READ 8042 INPUT PORT
+ENA_KBD EQU 0AEH ; ENABLE KEYBOARD COMMAND
+DIS_KBD EQU 0ADH ; DISABLE KEYBOARD COMMAND
+ENABLE_BIT20 EQU 0DFH ; ENABLE ADDR LINE BIT 20
+DISABLE_BIT20 EQU 0DDH ; DISABLE ADDR LINE BIT 20
+ENABLE_AUX EQU 0A8H ; ENABLE AUX DEVICE COMMAND ;M024
+DISABLE_AUX EQU 0A7H ; DISABLE AUX DEVICE COMMAND ;M024
+;-------------- KEYBOARD/LED COMMANDS --------------------------------------
+KB_MENU EQU 0F1H ; SELECT MENU COMMAND
+KB_TYPA_RD EQU 0F3H ; SET TYPAMATIC RATE/DELAY RWV 10-07-85
+KB_ENABLE EQU 0F4H ; KEYBOARD ENABLE
+KB_MAKE_BREAK EQU 0F7H ; TYPAMATIC
+KB_ECHO EQU 0FEH ; ECHO COMMAND
+KB_RESET EQU 0FFH ; SELF DIAGNOSTIC COMMAND
+LED_CMD EQU 0EDH ; LED WRITE COMMAND
+;--------------- KEYBOARD RESPONSE -----------------------------------------
+KB_OK EQU 0AAH ; RESPONSE FROM SELF DIAG
+KB_ACK EQU 0FAH ; ACKNOWLEDGE FROM TRANSMISSION
+KB_OVER_RUN EQU 0FFH ; OVER RUN
+KB_RESEND EQU 0FEH ; RESEND REQUEST
+KB_BREAK EQU 0F0H ; KEYBOARD BREAK CODE
+;-------------- CMOS EQUATES -------------------------------------------------
+CMOS_PORT EQU 070H ; IO ADDRESS OF CMOS PORT
+CLK_UP EQU 08AH ; CLOCK UPDATE STATUS
+CMOS_ALARM EQU 08BH ;
+CMOS_BEGIN EQU 090H ;
+CMOS_END EQU 0ADH ;
+SHUT_DOWN EQU 08FH ; SHUTDOWN OFFSET
+BATTERY_COND_STATUS EQU 08DH ; BATTERY STATUS
+M_SIZE_HI EQU 0B1H ; IO MEMORY SIZE HIGH BYTE (POST)
+M_SIZE_LO EQU 0B0H ; IO MEMORY SIZE LO BYTE (POST)
+M1_SIZE_HI EQU 096H ; 0->640K CONFIG MEMORY SIZE (SETUP)
+M1_SIZE_LO EQU 095H ; LOW BYTE (SETUP)
+M2_SIZE_HI EQU 098H ; 640K->UP CONFIG MEMORY SIZE (SETUP)
+M2_SIZE_LO EQU 097H ; LOW BYTE (SETUP)
+C_EQUIP EQU 094H ; CMOS EQUIPMENT FLAG
+HD_FILE_TYPE EQU 092H ; HARD FILE TYPE BYTE
+PAGE
+;--------------- CMOS DIAG_STATUS ERROR FLAGS--------------------------------
+DIAG_STATUS EQU 08EH ; CMOS ADDRESS OF DIAG_STATUS
+BAD_BAT EQU 080H ; DEAD BATTERY
+BAD_CKSUM EQU 040H ; CHECKSUM ERROR
+BAD_CONFIG EQU 020H ; MINIMUM CONFIG USED INSTEAD OF CMOS
+W_MEM_SIZE EQU 010H ; MEMORY SIZE NOT EQUAL TO CONFIG
+HF_FAIL EQU 008H ; HARD FILE FAILURE ON INIT
+CMOS_CLK_FAIL EQU 004H ; CMOS CLK NOT UPDATING OR NOT VALID
+;--------------- CMOS INFORMATION FLAGS--------------------------------------
+INFO_STATUS EQU 0B3H ; CMOS ADDRESS OF INFO BYTE
+M640K EQU 080H ; 512K -> 640K CARD INSTALLED
+NEW_INST EQU 040H ; FLAG USED BY CMOS SETUP UTILITY
+HF_BOOT EQU 020H ; BOOT HARD FILE FLAG
+;--------------- INTERRUPT EQUATES ------------------------------------------
+INTA00 EQU 20H ; 8259 PORT
+INTA01 EQU 21H ; 8259 PORT
+EOI EQU 20H
+INTB00 EQU 0A0H ; 2ND 8259
+INTB01 EQU 0A1H ;
+INT_TYPE EQU 070H ; START OF 8259 INTERRUPT TABLE LOCATION
+INT_VIDEO EQU 010H ; VIDEO VECTOR
+;---------------------------------------------------------------------------
+TIMER EQU 40H
+TIM_CTL EQU 43H ; 8253 TIMER CONTROL PORT ADDR
+TIMER0 EQU 40H ; 8253 TIMER/CNTER 0 PORT ADDR
+TMINT EQU 01 ; TIMER 0 INTR RECVD MASK
+;--------------------------------------------------------------------------
+DMA08 EQU 08 ; DMA STATUS REG PORT ADDR
+DMA EQU 00 ; DMA CH.0 ADDR. REG PORT ADDR
+;--------------------------------------------------------------------------
+DMA18 EQU 0D0H ; 2ND DMA STATUS PORT ADDR
+DMA1 EQU 0C0H ; 2ND DMA CH.0 ADDR. REG PORT ADDR
+;--------------------------------------------------------------------------
+DMA_PAGE EQU 81H ; START OF DMA PAGE REGISTERS
+LAST_DMA_PAGE EQU 8FH ; LAST DMA PAGE REGISTER
+;--------------------------------------------------------------------------
+MAX_PERIOD EQU 540H
+MIN_PERIOD EQU 410H
+KBD_IN EQU 60H ; KEYBOARD DATA IN ADDR PORT
+KBDINT EQU 02 ; KEYBOARD INTR MASK
+KB_DATA EQU 60H ; KEYBOARD SCAN CODE PORT
+KB_CTL EQU 61H ; CONTROL BITS FOR KEYBOARD SENSE DATA
+KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
+;----- SHIFT FLAG EQUATES WITHIN KB_FLAG
+INS_STATE EQU 80H ; INSERT STATE IS ACTIVE
+CAPS_STATE EQU 40H ; CAPS LOCK STATE HAS BEEN TOGGLED
+NUM_STATE EQU 20H ; NUM LOCK STATE HAS BEEN TOGGLED
+SCROLL_STATE EQU 10H ; SCROLL LOCK STATE HAS BEEN TOGGLED
+ALT_SHIFT EQU 08H ; ALTERNATE SHIFT KEY DEPRESSED
+CTL_SHIFT EQU 04H ; CONTROL SHIFT KEY DEPRESSED
+LEFT_SHIFT EQU 02H ; LEFT SHIFT KEY DEPRESSED
+RIGHT_SHIFT EQU 01H ; RIGHT SHIFT KEY DEPRESSED
+;----- SHIFT FLAG EQUATES WITHIN KB_FLAG_1
+INS_SHIFT EQU 80H ; INSERT KEY IS DEPRESSED
+CAPS_SHIFT EQU 40H ; CAPS LOCK KEY IS DEPRESSED
+NUM_SHIFT EQU 20H ; NUM LOCK KEY IS DEPRESSED
+SCROLL_SHIFT EQU 10H ; SCROLL LOCK KEY IS DEPRESSED
+HOLD_STATE EQU 08H ; SUSPEND KEY HAS BEEN TOGGLED
+SYS_SHIFT EQU 04H ; SYSTEM KEY DEPRESSED AND HELD
+L_ALT_SHIFT EQU 02H ; LEFT ALT KEY DOWN RWV 8-28-85
+L_CTL_SHIFT EQU 01H ; LEFT CTL KEY DOWN RWV 8-28-85
+;---------------FLAGS WITHIN KB_FLAG_2
+KB_ERR EQU 80H ; KEYBOARD TRANSMIT ERROR FLAG
+KB_PR_LED EQU 40H ; MODE INDICATOR UPDATE
+KB_FE EQU 20H ; RESEND RECEIVED FLAG
+KB_FA EQU 10H ; ACK RECEIVED
+CIRCUS_SYSTEM EQU 08H ; CIRCUS SYSTEM INDICATOR
+KB_LEDS EQU 07H ; KEYBOARD LED STATE BITS
+; 04H ; CAPS LOCK INDICATOR
+; 02H ; NUM LOCK INDICATOR
+; 01H ; SCROLL LOCK INDICATOR
+;---------------FLAGS WITHIN KB_FLAG_3
+RD_ID EQU 80H ; DOING A READ ID (MUST BE BIT0) AEV
+LC_AB EQU 40H ; LAST CHAR WAS FIRST ID CHAR AEV
+SET_NUM_LK EQU 20H ; FORCE NUM LOCK IF RD ID & KBX AEV
+KBX EQU 10H ; ENHANCED KEYBOARD INSTALLED RWV 7-18-85
+R_ALT_SHIFT EQU 08H ; RIGHT ALT KEY DOWN RWV 7-18-85
+GRAPH_ON EQU 08H ; ALT GRAPHICS KEY DOWN (WT ONLY) AEV
+R_CTL_SHIFT EQU 04H ; RIGHT CTL KEY DOWN RWV 7-18-85
+LC_E0 EQU 02H ; LAST CODE WAS THE E0 HIDDEN CODE RWV 7-18-85
+LC_E1 EQU 01H ; LAST CODE WAS THE E1 HIDDEN CODE RWV 7-18-85
+;----- SCAN CODE EQUATES FOR THE KEYBOARD
+NUM_KEY EQU 69 ; SCAN CODE FOR NUMBER LOCK
+SCROLL_KEY EQU 70 ; SCAN CODE FOR SCROLL LOCK
+ALT_KEY EQU 56 ; SCAN CODE FOR ALTERNATE KEY
+CTL_KEY EQU 29 ; SCAN CODE FOR CONTROL KEY
+CAPS_KEY EQU 58 ; SCAN CODE FOR SHIFT LOCK
+LEFT_KEY EQU 42 ; SCAN CODE FOR LEFT SHIFT
+RIGHT_KEY EQU 54 ; SCAN CODE FOR RIGHT SHIFT
+INS_KEY EQU 82 ; SCAN CODE FOR INSERT KEY
+DEL_KEY EQU 83 ; SCAN CODE FOR DELETE KEY
+SYS_KEY EQU 84 ; SCAN CODE FOR SYSTEM KEY
+;-------------- ENHANCED KEYBOARD EQUATES
+ID_1 EQU 0ABH ; 1ST ID CHAR FOR KBX
+ID_2 EQU 041H ; 2ND ID CHAR FOR KBX AEV
+ID_2A EQU 054H ; ALTERNATE 2ND ID CHAR FOR KBX RWV 8-16-85
+F11_M EQU 87 ; F11 KEY MAKE
+F12_M EQU 88 ; F12 KEY MAKE
+MC_E0 EQU 224 ; GENERAL MARKER CODE
+MC_E1 EQU 225 ; PAUSE KEY MARKER CODE
+
+;-------------- DISKETTE EQUATES
+INT_FLAG EQU 080H ; INTERRUPT OCCURRENCE FLAG
+MOTOR_WAIT EQU 37 ; 2 SECS OF COUNTS FOR MOTOR TURN OFF
+TIME_OUT EQU 80H ; ATTACHMENT FAILED TO RESPOND
+BAD_SEEK EQU 40H ; SEEK OPERATION FAILED
+BAD_NEC EQU 20H ; NEC CONTROLLER HAS FAILED
+BAD_CRC EQU 10H ; BAD CRC ON DISKETTE READ
+DMA_BOUNDARY EQU 09H ; ATTEMPT TO DMA ACROSS 64K BOUNDARY
+BAD_DMA EQU 08H ; DMA OVERRUN ON OPERATION
+MEDIA_CHANGE EQU 06H ; MEDIA REMOVED ON DUAL ATTACH CARD
+RECORD_NOT_FND EQU 04H ; REQUESTED SECTOR NOT FOUND
+WRITE_PROTECT EQU 03H ; WRITE ATTEMPTED ON WRITE PROT DISK
+BAD_ADDR_MARK EQU 02H ; ADDRESS MARK NOT FOUND
+BAD_CMD EQU 01H ; BAD COMMAND PASSED TO DISKETTE I/O
+
+XRATE EQU 02H ; 250KBS DATA TRANSFER RATE
+DUAL EQU 01H ; DUAL ATTACH CARD PRESENT FLAG
+
+DSK_CHG EQU 080H ; DISKETTE CHANGE FLAG MASK BIT
+STATE_MSK EQU 007H ; USED TO STRIP OFF STATE OF MEDIA
+REV_STATE EQU 0F8H ; USED AS MASK FOR STATE BITS
+DETERMINED EQU 010H ; SET STATE DETERMINED IN STATE BITS
+TRAN_MSK EQU 03H ; ISOLATE SHIFTED TRANSFER RATE BITS
+DOUBLE_STEP EQU 020H ; MASK TO TURN ON DOUBLE STEPPING
+MOTOR_MSK EQU 0F0H ; MASK TO CLEAR MOTOR ON BITS
+MAX_DRV EQU 002H ; MAX NUMBER OF DRIVES
+;HOME EQU 010H ; TRACK 0 MASK
+SENSE_DRV_ST EQU 004H ; SENSE DRIVE STATUS COMMAND
+ONE EQU 001H ; SEEK ONE TRACK
+TRK_SLAP EQU 030H ; CRASH STOP (48 TPI DRIVES)
+QUIET_SEEK EQU 00AH ; SEEK TO TRACK 10
+HD12_SETTLE EQU 015D ; 1.2 M HEAD SETTLE TIME
+HD320_SETTLE EQU 020D ; 320 K HEAD SETTLE TIME
+WRITE_OP EQU 080H ; WRITE OPERATION FLAG
+DD_MASK EQU 010H ; MASK TO INDICATE DRIVE IS 80 TRACKS
+PAGE
+;------ DISK CHANGE LINE EQUATES
+NOCHGLN EQU 001H ; NO DISK CHANGE LINE AVAILABLE
+CHGLN EQU 002H ; DISK CHANGE LINE AVAILABLE
+;------ MEDIA/DRIVE STATE INDICATORS
+M326D326 EQU 093H ; STATE MACHINE - 320/360 MEDIA/DRIVE
+M326D12 EQU 074H ; STATE MACHINE - 320/360 MEDIA,1.2DRIVE
+M12D12 EQU 015H ; STATE MACHINE - 1.2 MEDIA/DRIVE
+POA_DUAL EQU 061H ; 300K DATA TRANSFER RATE & STATE 1
+POA_START EQU 080H ; 250K DATA TRANSFER RATE & STATE 0
+TRK_80 EQU 008H ; DISKETTE DRIVE HAS 80 TRACKS
+;------ CMOS NON-VOLATILE RAM EQUATES
+CMOSDSB_ADDR EQU 00EH ; DISKETTE STATUS BYTE ADDRESS
+CADR_PRT EQU 070H ; CMOS ADDRESS PORT ADDRESS
+CDATA_PRT EQU 071H ; CMOS DATA PORT ADDRESS
+CMOS_GOOD EQU 0C0H ; BATTERY AND CHECKSUM INDICATOR
+CMOSDSK_BYTE EQU 010H ; DISKETTE BYTE ADDRESS
+LOWNIB EQU 00FH ; ISOLATE LOW NIBBLE IN REGISTER MASK
+INVALID_DRV EQU 002H ; FIRST INVALID DISKETTE TYPE
+;----------------------------------------
+; TIMER DATA AREA :
+;----------------------------------------
+; COUNTS_SEC EQU 18
+; COUNTS_MIN EQU 1092
+; COUNTS_HOUR EQU 65543
+; COUNTS_DAY EQU 1573040 = 1800B0H
+PAGE
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/psdata.inc b/private/mvdm/dos/v86/inc/psdata.inc
new file mode 100644
index 000000000..227e981d7
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/psdata.inc
@@ -0,0 +1,516 @@
+;*******************************************************************
+; Parser include file
+;*******************************************************************
+IF1 ;AN000;
+; %OUT INCLUDING COMP=COMMON DSN=PSDATA.INC...;AN000;
+ENDIF ;AN000;
+
+ INCLUDE version.inc
+
+;
+;**** Default assemble switches definition *************************
+
+IFNDEF FarSW ;AN000;
+FarSW equ 0 ;AN000; Near call expected
+ENDIF ;AN000;
+
+IFNDEF DateSW ;AN000;
+DateSW equ 1 ;AN000; Check date format
+ENDIF ;AN000;
+
+IFNDEF TimeSW ;AN000;
+TimeSW equ 1 ;AN000; Check time format
+ENDIF ;AN000;
+
+IFNDEF FileSW ;AN000;
+FileSW equ 1 ;AN000; Check file specification
+ENDIF ;AN000;
+
+IFNDEF CAPSW ;AN000;
+CAPSW equ 1 ;AN000; Perform CAPS if specified
+ENDIF ;AN000;
+
+IFNDEF CmpxSW ;AN000;
+CmpxSW equ 1 ;AN000; Check complex list
+ENDIF ;AN000;
+
+IFNDEF NumSW ;AN000;
+NumSW equ 1 ;AN000; Check numeric value
+ENDIF ;AN000;
+
+IFNDEF KeySW ;AN000;
+KeySW equ 1 ;AN000; Support keywords
+ENDIF ;AN000;
+
+IFNDEF SwSW ;AN000;
+SwSW equ 1 ;AN000; Support switches
+ENDIF ;AN000;
+
+IFNDEF Val1SW ;AN000;
+Val1SW equ 1 ;AN000; Support value definition 1
+ENDIF ;AN000;
+
+IFNDEF Val2SW ;AN000;
+Val2SW equ 1 ;AN000; Support value definition 2
+ENDIF ;AN000;
+
+IFNDEF Val3SW ;AN000;
+Val3SW equ 1 ;AN000; Support value definition 3
+ENDIF ;AN000;
+
+IFNDEF DrvSW ;AN000;
+DrvSW equ 1 ;AN000; Support drive only format
+ENDIF ;AN000;
+
+IFNDEF QusSW ;AN000;
+QusSW equ 1 ;AN000; Support quoted string format
+ENDIF ;AN000;
+
+IFNDEF LFEOLSW ;AN028;
+LFEOLSW EQU 1 ;AN028; Accept Line feed (0AH) as end of line
+ENDIF ;AN028;
+
+;**** Equation field
+;-------- Character code definition
+
+$P_DBSP1 equ DB_SP_HI ;AN000; 1st byte of DBCS blank
+$P_DBSP2 equ DB_SP_LO ;AN000; 2nd byte of DBCS blank
+$P_Period equ "." ;AN020;
+$P_Slash equ "/" ;AN020;
+$P_Space equ " " ;AN000; SBCS blank
+$P_Comma equ "," ;AN000;
+$P_Switch equ "/" ;AN000;
+$P_Keyword equ "=" ;AN000;
+$P_Colon equ ":" ;AN000;
+$P_Plus equ "+" ;AN000;
+$P_Minus equ "-" ;AN000;
+$P_Rparen equ ")" ;AN000;
+$P_Lparen equ "(" ;AN000;
+;(deleted ;AN025;) $P_SQuote equ "'"
+$P_DQuote equ '"' ;AN000;
+$P_NULL equ 0 ;AN000;
+$P_TAB equ 9 ;AN000;
+$P_CR equ 0Dh ;AN000;
+$P_LF equ 0Ah ;AN000;
+$P_ASCII80 equ 80h ;AN000; ASCII 80h character code
+
+;-------- Masks
+$P_Make_Lower equ 20h ;AN000; make lower case character
+$P_Make_Upper equ 0ffh-$P_Make_Lower ;AN000; make upper case character
+
+ PAGE ;AN000;
+;-------- DOS function call related equs
+
+$P_DOS_Get_CDI equ 3800h ;AN000; get country dependent information
+ ; by this call, following information
+$P_CDI struc ;AN000; is returned.
+$P_CDI_DateF dw 0 ;AN000;
+$P_CDI_Money db 0,0,0,0,0 ;AN000;
+$P_CDI_1000 db 0,0 ;AN000;
+$P_CDI_Dec db 0,0 ;AN000;
+$P_CDI_DateS db 0,0 ;AN000;
+$P_CDI_TimeS db 0,0 ;AN000;
+ db 0 ;AN000;
+ db 0 ;AN000;
+$P_CDI_TimeF db 0 ;AN000;
+ dw 0,0 ;AN000;
+ db 0,0 ;AN000;
+ dw 5 dup(0) ;AN000;
+$P_CDI ends ;AN000;
+
+$P_Date_MDY equ 0 ;AN000;
+$P_Date_DMY equ 1 ;AN000;
+$P_Date_YMD equ 2 ;AN000;
+;-------------
+$P_DOS_GetEV equ 6300h ;AN000; get DBCS EV call
+ ;AN000; DS:SI will points to DBCS EV
+;-------------
+$P_DOS_Get_TBL equ 65h ;AN000; get uppercase table call
+ ;AN000; following parameters are set
+ ;AN000; to get casemap table.
+$P_DOSTBL_Def equ -1 ;AN000; get default
+$P_DOSTBL_BL equ 5 ;AN000; buffer length for Tbl pointer
+$P_DOSTBL_File equ 4 ;AN000; get file uppercase table
+$P_DOSTBL_Char equ 2 ;AN000; get character uppercase table
+ ; By this call following information
+ ; is returned.
+$P_DOS_TBL struc ;AN000;
+$P_DOS_InfoID db 0 ;AN000; information id for the table
+$P_DOS_TBL_Off dw 0 ;AN000; offset address of the table
+$P_DOS_TBL_Seg dw 0 ;AN000; segment address of the table
+$P_DOS_TBL ends ;AN000;
+ PAGE ;AN000;
+;---------------------------------------------------------------------------------------------------------
+; PARMS LABEL BYTE
+; DW PARMSX
+; DB 2 ; NUMBER OF STRINGS (0, 1, 2)
+; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE
+; DB " .. " ; EXTRA DELIMITER LIST,
+; ; TYPICAL ARE ";", "="
+; ; "," & WHITESPACE ALWAYS
+; DB length ; LENGTH OF THE NEXT LIST, 0 IF NONE
+; DB " .. " ; EXTRA END OF LINE LIST, CR, LF OR 0 ALWAYS
+;---------------------------------------------------------------------------------------------------------
+
+;-------------------------------- PARMS block structure
+$P_PARMS_Blk struc ;AN000;
+$P_PARMSX_Address dw 0 ;AN000; Address of PARMSX
+$P_Num_Extra db 0 ;AN000; Number of extra stuff
+$P_Len_Extra_Delim db 0 ;AN000; Length of extra delimiter
+$P_PARMS_Blk ends ;AN000;
+
+$P_Len_PARMS equ 4 ;AN000;
+$P_I_Use_Default equ 0 ;AN000; no extra stuff specified
+$P_I_Have_Delim equ 1 ;AN000; extra delimiter specified
+$P_I_Have_EOL equ 2 ;AN000; extra EOL specified
+
+;---------------------------------------------------------------------------------------------------------
+; PARMSX LABEL BYTE
+; DB minp,maxp ; MIN, MAX POSITIONAL OPERANDS ALLOWED
+; DW CONTROL ; DESCRIPTION OF POSITIONAL 1
+; : ; REPEATS maxp-1 TIMES
+; DB maxs ; # OF SWITCHES
+; DW CONTROL ; DESCRIPTION OF SWITCH 1
+; : ; REPEATS maxs-1 TIMES
+; DB maxk ; # OF KEYWORD
+; DW CONTROL ; DESCRIPTION OF KEYWORD 1
+; : ; REPEATS maxk-1 TIMES
+;---------------------------------------------------------------------------------------------------------
+
+;-------------------------------- PARMSX block structure
+$P_PARMSX_Blk struc ;AN000;
+$P_MinP db 0 ;AN000; Minimum positional number
+$P_Maxp db 0 ;AN000; Maximum positional number
+$P_1st_Control dw 0 ;AN000; Address of the 1st CONTROL block
+$P_PARMSX_Blk ends ;AN000;
+ PAGE ;AN000;
+;---------------------------------------------------------------------------------------------------------
+; << Control field definition >>
+;
+;
+;CONTROL LABEL BYTE
+; DW MATCH_FLAGS ; CONTROLS TYPE MATCHED
+; ; 8000H=NUMERIC VALUE, (VALUE LIST WILL BE CHECKED)
+; ; 4000H=SIGNED NUMERIC VALUE (VALUE LIST WILL BE CHECKED)
+; ; 2000H=SIMPLE STRING(VALUE LIST WILL BE CHECKED)
+; ; 1000H=DATE STRING (VALUE LIST WON'T BE CHECKED)
+; ; 0800H=TIME STRING (VALUE LIST WON'T BE CHECKED)
+; ; 0400H=COMPLEX LIST (VALUE LIST WON'T BE CHECKED)
+; ; 0200H=FILE SPEC (VALUE LIST WON'T BE CHECKED)
+; ; 0100H=DRIVE ONLY (VALUE LIST WON'T BE CHECKED)
+; ; 0080H=QUOTED STRING (VALUE LIST WON'T BE CHECKED)
+; ; 0010H=IGNORE ":" AT END IN MATCH
+; ; 0002H=REPEATS ALLOWED
+; ; 0001H=OPTIONAL
+; DW FUNCTION_FLAGS
+; ; 0001H=CAP RESULT BY FILE TABLE
+; ; 0002H=CAP RESULT BY CHAR TABLE
+; ; 0010H=REMOVE ":" AT END
+; (tm10) ; 0020H=colon is not necessary for switch
+; DW RESULT ; RESULT BUFFER
+; DW VALUES ; VALUE LISTS
+; DB nid ; NUMBER OF KEYWORD/SWITCH SYNONYMS IN FOLLOWING LIST
+; DB "...",0 ; IF n >0, KEYWORD 1
+; :
+;
+;Note:
+; - The MATCH_FLAG is bit significant. You can set, for example, TIME bit and
+; DATE bit simalteniously.
+;
+; The parser examins each bit along with the following priority.
+;
+; COMPLEX -> DATE -> TIME -> NUMERIC VAL -> SIGNED NUMERIC VAL -> DRIVE ->
+; FILE SPEC -> SIMPLE STRING.
+;
+;
+; - When the FUNCTION_FLAG is 0001 or 0002, the STRING pointed to by a pointer
+; in the result buffer is capitalized.
+;
+; - Match_Flags 0001H and 0002H have meaning only for the positional.
+;
+;
+; - The "...",0 (bottom most line) does require '=' or '/'. When you need a
+; switch, for example, '/A', then STRING points to;
+;
+; DB 1 ; number of following synonyms
+; DB '/A',0
+;
+; When you need a keyword, for example, 'CODEPAGE=', then "...",0 will be;
+;
+; DB 1 ; number of following synonyms
+; DB 'CODEPAGE=',0
+;
+;
+; - "..." must consist of upper case characters only because the parser
+; performs pattern matching after converting input to upper case (by
+; using the current country upper case table)
+;
+;
+; - One "..." can contain only one switch or keyword. If you need, for
+; example /A and /B, the format will be;
+;
+; DB 2 ; number of following synonyms
+; DB '/A',0
+; DB '/B',0
+;---------------------------------------------------------------------------------------------------------
+
+;**** Match_Flags
+
+$P_Num_Val equ 8000h ;AN000; Numeric Value
+$P_SNum_Val equ 4000h ;AN000; Signed numeric value
+$P_Simple_S equ 2000h ;AN000; Simple string
+$P_Date_S equ 1000h ;AN000; Date string
+$P_Time_S equ 0800h ;AN000; Time string
+$P_Cmpx_S equ 0400h ;AN000; Complex string
+$P_File_Spc equ 0200h ;AN000; File Spec
+$P_Drv_Only equ 0100h ;AN000; Drive Only
+$P_Qu_String equ 0080h ;AN000; Quoted string
+$P_Ig_Colon equ 0010h ;AN000; Ignore colon at end in match
+$P_Repeat equ 0002h ;AN000; Repeat allowed
+$P_Optional equ 0001h ;AN000; Optional
+
+;**** Function flags
+
+$P_CAP_File equ 0001h ;AN000; CAP result by file table
+$P_CAP_Char equ 0002h ;AN000; CAP result by character table
+$P_Rm_Colon equ 0010h ;AN000; Remove ":" at the end
+$P_colon_is_not_necessary equ 0020h ;AN000;(tm10) /+10 and /+:10
+
+;-------------------------------- Control block structure
+$P_Control_Blk struc ;AN000;
+$P_Match_Flag dw 0 ;AN000; Controls type matched
+$P_Function_Flag dw 0 ;AN000; Function should be taken
+$P_Result_Buf dw 0 ;AN000; Result buffer address
+$P_Value_List dw 0 ;AN000; Value list address
+$P_nid db 0 ;AN000; # of keyword/SW synonyms
+$P_KeyorSW db 0 ;AN000; keyword or sw
+$P_Control_Blk ends ;AN000;
+ PAGE ;AN000;
+;---------------------------------------------------------------------------------------------------------
+; << Value List Definition >>
+;
+;VALUES LABEL BYTE
+; DB nval ; NUMBER OF VALUE DEFINITIONS (0 - 3)
+; +-
+; | DB nrng ; NUMBER OF RANGES
+; | +DB ITEM_TAG ; RETURN VALUE IF RANGE MATCHED
+; | +DD X,Y ; RANGE OF VALUES
+; | :
+; | DB nnval ; NUMBER OF CHOICES
+; | +DB ITEM_TAG ; RETURN VALUE IF NUMBER CHOICE MATCHED
+; | +DD VALUE ; SPECIFIC CHOICE IF NUMBER
+; | :
+; | DB nstrval ; NUMBER OF CHOICES
+; | +DB ITEM_TAG ; RETURN VALUE IF STRING CHOICE MATCHED
+; | +DW STRING ; SPECIFIC CHOICE IF STING
+; +- :
+;
+;STRING DB "...",0 ; ASCIIZ STRING IMAGE
+;
+;Note:
+; - ITEM_TAG must not be 0FFH, which will be used in the result buffer
+; when no choice lists are provided.
+;
+; - STRING must consist of upper case characters only because the parser
+; performs pattern matching after converting input to upper case (by
+; using the current country upper case table)
+;---------------------------------------------------------------------------------------------------------
+
+$P_nval_None equ 0 ;AN000; no value list ID
+$P_nval_Range equ 1 ;AN000; range list ID
+$P_nval_Value equ 2 ;AN000; value list ID
+$P_nval_String equ 3 ;AN000; string list ID
+$P_Len_Range equ 9 ;AN000; Length of a range choice(two DD plus one DB)
+$P_Len_Value equ 5 ;AN000; Length of a value choice(one DD plus one DB)
+$P_Len_String equ 3 ;AN000; Length of a string choice(one DW plus one DB)
+$P_No_nrng equ 0 ;AN000; (tm07) no nrng. nnval must not be 0.
+
+$P_Val_List struc ;AN000;
+$P_NumofList db 0 ;AN000; number of following choice
+$P_Val_XL dw 0 ;AN000; lower word of value
+$P_Val_XH dw 0 ;AN000; higher word of value
+$P_Val_YL dw 0 ;AN000; lower word of another value
+$P_Val_YH dw 0 ;AN000; higher word of another value
+$P_Val_List ends ;AN000;
+ PAGE ;AN000;
+;---------------------------------------------------------------------------------------------------------
+; << Result Buffer Definition >>
+;
+;RESULT LABEL BYTE ; BELOW FILLED IN FOR DEFAULTS
+; DB type ; TYPE RETURNED: 0=RESERVED,
+; ; 1=NUMBER, 2=LIST INDEX,
+; ; 3=STRING, 4=COMPLEX,
+; ; 5=FILESPEC, 6=DRIVE
+; ; 7=DATE, 8=TIME
+; ; 9=QUOTED STRING
+; DB ITEM_TAG ; MATCHED ITEM TAG
+;
+; dw synonym@ ; es:@ points to found SYNONYM if provided.
+;
+; +-
+; | DD n ; VALUE IF NUMBER
+; | or
+; | DW i ; INDEX (OFFSET) INTO VALUE LIST
+; | ; (ES presents Segment address)
+; | or
+; | DD STRING ; OFFSET OF STRING VALUE
+; | or
+; | DB drv ; DRIVE NUMBER (1-A, 2-B,..., 26-Z)
+; | or
+; | DW YEAR ;(1980-2099) IN CASE OF DATE
+; | DB MONTH ;(1-12) Note: Range check is not performed.
+; | DB DATE ;(1-31) 0 is filled when the corresponding field was not specified.
+; | or
+; | DB HOUR ;(0-23) IN CASE OF TIME
+; | DB MINUTES ;(0-59) Note: Range check is not performed .
+; | DB SECONDS ;(0-59) 0 is filled when the corresponding field was not specified .
+; | DB HUNDREDTHS ;(0-99)
+; +-
+;
+;
+;Note: ITEM_TAG is 0FFH when the caller does not specify the choice
+; list.
+;
+; YEAR: If the input value for the year is less than 100, parser
+; adds 1900 to it. For example, when 87 is input to parser for
+; the year value, he returns 1987.
+;---------------------------------------------------------------------------------------------------------
+
+;-------------------------------- Result block structure
+$P_Result_Blk struc ;AN000;
+$P_Type db 0 ;AN000; Type returned
+$P_Item_Tag db 0 ;AN000; Matched item tag
+$P_SYNONYM_Ptr dw 0 ;AN000; pointer to Synonym list returned
+$P_Picked_Val db 0,0,0,0 ;AN000; value
+$P_Result_Blk ends ;AN000;
+;--------------------------------
+;**** values for the type field in the result block
+
+$P_EOL equ 0 ;AN000; End of line
+$P_Number equ 1 ;AN000; Number
+$P_List_Idx equ 2 ;AN000; List Index
+$P_String equ 3 ;AN000; String
+$P_Complex equ 4 ;AN000; Complex
+$P_File_Spec equ 5 ;AN000; File Spec
+$P_Drive equ 6 ;AN000; Drive
+$P_Date_F equ 7 ;AN000; Date
+$P_Time_F equ 8 ;AN000; Time
+$P_Quoted_String equ 9 ;AN000; Quoted String
+
+$P_No_Tag equ 0FFH ;AN000; No ITEM_TAG found
+;**** Return code
+;
+; following return code will be returned in the AX register.
+
+$P_No_Error equ 0 ;AN000; No error
+$P_Too_Many equ 1 ;AN000; Too many operands
+$P_Op_Missing equ 2 ;AN000; Required operand missing
+$P_Not_In_SW equ 3 ;AN000; Not in switch list provided
+$P_Not_In_Key equ 4 ;AN000; Not in keyword list provided
+$P_Out_Of_Range equ 6 ;AN000; Out of range specified
+$P_Not_In_Val equ 7 ;AN000; Not in value list provided
+$P_Not_In_Str equ 8 ;AN000; Not in string list provided
+$P_Syntax equ 9 ;AN000; Syntax error
+$P_RC_EOL equ -1 ;AN000; End of command line
+
+ PAGE ;AN000;
+;********************** Local Data *************************************
+$P_ORDINAL dw 0 ;AN000; Operand ordinal save area
+$P_RC dw 0 ;AN000; Return code from parser
+$P_SI_Save dw 0 ;AN000; Pointer of command buffer
+$P_DX dw 0 ;AN000; Return result buffer address
+$P_Terminator db 0 ;AN000; Terminator code (ASCII)
+$P_DBCSEV_OFF dw 0 ;AN000; Offset of DBCS EV
+$P_DBCSEV_SEG dw 0 ;AN000; Segment of DBCS EV
+$P_Flags dw 0 ;AN000; Parser internal flags
+$P_Flags1 equ byte ptr $P_Flags ;AN038; to reference first byte flags
+$P_Flags2 equ byte ptr $P_Flags+1 ;AN038; to reference second byte flags only
+
+;in second byte of $P_Flags, referenced as $P_Flags2:
+$P_equ equ 01h ;AN000; "=" packed in string buffet
+$P_Neg equ 02h ;AN000; Negative value
+$P_Time12 equ 04h ;AN000; set when PM is specified
+$P_Key_Cmp equ 08h ;AN000; set when keyword compare
+$P_SW_Cmp equ 10h ;AN000; set when switch compare
+$P_Extra equ 20h ;AN000; set when extra delimiter found
+$P_SW equ 40h ;AN000; set when switch found (tm08)
+$P_Signed equ 80h ;AN000; signed numeric specified
+
+;in first byte of $P_Flags, referenced as $P_Flags1:
+$P_time12am equ 01h ;AN038; set when AM is specified on time
+$P_TIME_AGAIN EQU 02H ;AN039; SET WHEN READY TO RE-PARSE TIME
+
+$P_SaveSI_Cmpx dw 0 ;AN000; save si for later use by complex
+$P_KEYorSW_Ptr dw 0 ;AN000; points next to "=" or ":" code
+$P_Save_EOB dw 0 ;AN000; save pointer to EOB
+$P_Found_SYNONYM dw 0 ;AN000; es:@ points to found synonym
+
+$P_STRING_BUF db 128 dup(0) ;AN000; Pick a operand from command line
+$P_STRING_BUF_END equ $ ;AN000;
+IF TimeSw ;AN039; For TIME only
+$P_ORIG_ORD DW 0 ;AN039; ORIGINAL ORDINAL FROM CX
+$P_ORIG_STACK DW 0 ;AN039; ORIGINAL VALUE OF STACK FROM SP
+$P_ORIG_SI DW 0 ;AN039; ORIGINAL START PARSE POINTER FROM SI
+ENDIF ;AN039;
+IF DateSw+TimeSw ;AN000;(Check if date or time format is supported)
+;------------------------------
+;
+$P_Got_Time db 0 ;AN023; if 1, use Time delimiters
+$P_NeedToBeRead equ 0ffffh ;AN000;
+
+$P_COUNTRY_INFO $P_CDI <$P_NeedToBeRead> ;AN000;
+;
+$P_1st_Val dw 0 ;AN000; used when process date or time
+$P_2nd_Val dw 0 ;AN000; used when process date or time
+$P_3rd_Val dw 0 ;AN000; used when process date or time
+$P_4th_Val dw 0 ;AN000; used when process date or time
+;------------------------------
+ENDIF ;AN000;(of DateSW+TimeSW)
+$P_Char_CAP_Ptr db 0ffh ;AN000; info id
+ dw 0 ;AN000; offset of char case map table
+ dw 0 ;AN000; segment of char case map table
+IF CAPSW ;AN000;(Check if uppercase conversion is supported)
+$P_File_CAP_Ptr db 0ffh ;AN000; info id
+ dw 0 ;AN000; offset of file case map table
+ dw 0 ;AN000; segment of file case map table
+ENDIF ;AN000;(of CAPSW)
+; (tm06) IF FileSW ;AN000;(Check if file spec is supported)
+;
+
+;M029
+;!!!WARNING!!!
+; In routine SYSPARSE (parse.asm), $P_FileSp_Char is reinitialized using
+;hardcoded strings. If the chars in the string are changed here, corresponding
+;changes need to be made in SYSPARSE
+;
+IF FileSW+DrvSW ;AN000;(Check if file spec is supported)
+$P_FileSp_Char db '[]|<>+=;"' ;AN000; delimitter of file spec
+$P_FileSp_Len equ $-$P_FileSp_Char ;AN000;
+ENDIF ;AN000;(of FileSW)
+; (tm05) IF QusSW ;AN000;(Check if quoted string is supported)
+;(deleted ;AN025;) IF QusSW+CmpxSW ; (tm05) ;AN000;(Check if quoted string is supported)
+;(deleted ;AN025;) $P_SorD_Quote db 0 ;AN000; keep double or single quote
+;(deleted ;AN025;) ENDIF ;AN000;(of QueSW)
+IF KeySW ;AN029; if keywords supported
+$P_count_to_eol dw 0 ;AN029; count of chars not including EOL
+; REGISTER EQUATES - SPECIAL USAGE FOR REGISTERS
+$P_REG_BH_CG_SW EQU BH ;AN029;0="NO CHANGES MADE", FF=CHANGES MADE
+$P_REG_BL_DQ_SW EQU BL ;AN029;0=NOT IN QUOTES,FF=IN QUOTES
+
+$P_DOUBLE_QUOTE EQU """" ;AN029;
+$P_BL_EQ EQU " =" ;AN029;
+$P_EQ_BL EQU "= " ;AN029;
+$P_TB_EQ EQU 093DH ;AN029; ;"<TAB>="
+$P_EQ_TB EQU 3D09H ;AN029; ;"=<TAB>"
+ENDIF ;AN029; IF KeySW Supported
+
+; delimiter parsing
+$P_colon_period equ 01 ;AN032; check for colon & period
+$P_period_only equ 02 ;AN032; check only for period
+
+;filespec error flag
+$P_err_flag db 00 ;AN033; flag set if filespec parsing error
+ ;AN033; was detected.
+$P_error_filespec equ 01 ;AN033; mask to set flag
+;***********************************************************************
+
diff --git a/private/mvdm/dos/v86/inc/redirsym.inc b/private/mvdm/dos/v86/inc/redirsym.inc
new file mode 100644
index 000000000..56e60f568
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/redirsym.inc
@@ -0,0 +1,173 @@
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+; Redirector MACROS
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+EDW MACRO name
+ extrn name:near
+ DW OFFSET RG:name
+ENDM
+
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+CHECK_DIALECT MACRO name
+
+ IF2 ;AN000; If not defined yet,
+ IFNDEF CHECKDIALECT ;AN000; THEN Extrn
+ Extrn CHECKDIALECT&name:NEAR ;AN000;
+ ENDIF ;AN000;
+ ENDIF ;AN000;
+ CALL CHECKDIALECT&name ;AN000; Call the appropriate routine
+
+ENDM
+
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+CallREDIRSub MACRO name,fn,save,restore ;AN000;
+ IF2 ;AN000; If not defined yet,
+ IFNDEF REDIRSub&fn ;AN000; THEN Extrn
+ Extrn REDIRSub&fn:NEAR ;AN000;
+ ENDIF ;AN000;
+ ENDIF ;AN000;
+ IFNB <save> ;AN000; If not blank
+ SAVE <save> ;AN000; Save the regs
+ ENDIF ;AN000;
+ CALL REDIRSub&fn ;AN000; Call the appropriate routine
+ IFNB <restore> ;AN000; If not blank
+ RESTORE <restore> ;AN000; Save the regs
+ ENDIF ;AN000;
+ENDM ;AN000;
+
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+; Redirector structures
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+ INCLUDE IFSSYM.INC ;AN000;
+ INCLUDE ERROR.INC ;AN000;
+ INCLUDE FILEMODE.INC ;AN000;
+
+;; CD_FSDA STRUCTURE
+
+ CD_FSDA_OFF EQU WORD PTR CD_FSDA ;AN000;
+ CD_FSDA_SEG EQU WORD PTR CD_FSDA+2 ;AN000;
+ CD_FSDA_FLAGS EQU WORD PTR CD_FSDA+4 ;AN000;
+
+;; DFL_FSDA STRUCTURE
+
+ DF_FSDA_OFF EQU WORD PTR DFL_FSDA ;AN000;
+ DF_FSDA_SEG EQU WORD PTR DFL_FSDA+2 ;AN000;
+ DF_FSDA_FLAGS EQU WORD PTR DFL_FSDA+4 ;AN000;
+
+;; SFF_FSDA STRUCTURE
+
+ SFF_FSDA_OFF EQU WORD PTR SFF_FSDA ;AN000;
+ SFF_FSDA_SEG EQU WORD PTR SFF_FSDA+2 ;AN000;
+ SFF_FSDA_FLAGS EQU WORD PTR SFF_FSDA+4 ;AN000;
+
+;; IFS Structure fixes
+
+ ifsr_fcn_def EXECAPI ;AN000;
+ ifsr_api_def OPENFILE ;AN000;
+IFSR_OPENNAME@ = IFSR_NAME@ ;AN000;
+ ifsr_api_def SEARCHFILE ;AN000;
+IFSR_SRCHNAME@ = IFSR_NAME@ ;AN000;
+ ifsr_api_def MKDIR ;AN000;
+IFSR_DIRNAME@ = IFSR_NAME@ ;AN000;
+ ifsr_api_def DELFILE ;AN000;
+IFSR_DELNAME@ = IFSR_NAME@ ;AN000;
+ ifsr_api_def FILEATTR ;AN000;
+IFSR_ATTRNAME@ = IFSR_NAME@ ;AN000;
+
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+; Redirector Equates
+; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+Get_Interrupt_Vector EQU 35H ;AN000;
+Set_Interrupt_Vector EQU 25H ;AN000;
+Deallocate_memory EQU 49H ;AN000;
+
+GET_SYS_CONFIG EQU 0C000H ;AN000; INT 15H to get configuration
+CONFIG_STRUC STRUC ;AN001;
+ LENGTH DW ? ;AN001;
+ MODEL_BYTE DB ? ;AN001;
+CONFIG_STRUC ENDS ;AN001;
+
+LOWEST_386_MODEL EQU 0F8H ;AN001;
+
+INCOR_DOS EQU 1 ;AN000;
+ALREADY_INST EQU 2 ;AN000;
+NOT_INST EQU 3 ;AN000;
+NET_NOT_STARTED EQU 4 ;AN000;
+INSUFF_MEM EQU 5 ;AN000;
+BAD_PARM EQU 10 ;AN000;
+INSUFFICENT_MEM EQU 76 ;AN001; Extended Error
+
+ONE_REPLACE EQU 1 ;AN000;
+SINGLE_COUNT EQU 1 ;AN000;
+TESTDIALECT = 0 ;AN001;
+
+REDIR_INSTALLED EQU -1 ;AN000;
+REDIR_SYS_INSTALL EQU 0BF80H ;AN000; REDIR.SYS 2FH Function number
+REDIR_EXE_INSTALL EQU 0BF00H ;AN000; REDIR.EXE 2FH Function number
+
+FASSIGN_ON EQU -1 ;AN000;
+FASSIGN_OFF EQU 0 ;AN000;
+FPRINT_ON EQU -1 ;AN000;
+FPRINT_OFF EQU 0 ;AN000;
+
+EXT_ERR_72 EQU 72 ;AN000;
+PSP_ENVIRO_SEG EQU 002CH ;AN000; Offset into the PSP of the Enviroment Segment
+
+PrnIO EQU 17H ; Int vector for Printer IO
+PrntScr EQU 05H ; Int vector for Print Screen
+PrnRdrMark EQU 2 ; Mark for port addr
+
+VER12 EQU 00000010b ;AN001;
+VER13 EQU 00000100b ;AN001;
+
+FIRST_TIME EQU 1 ;AN001;
+SECOND_TIME EQU 2 ;AN001;
+
+SHIFT_BY_7 EQU 7 ;AN001;
+
+HI_BIT_SHARING_MASK EQU 1111111101111111b ;AN001; Turns off Hi bit in nibble
+
+
+;; ###############################################################
+;; MISC.INC
+;; ###############################################################
+
+; NETFILE
+
+attr_read_only = 00000001b
+
+; NETINIT
+
+IFSR_INVALID_CMD = -1 ;AN000;
+
+; NETUTIL
+
+MACRO_4 = 4
+DATE_TIME = 0
+
+
+; NETHAND
+
+LOCK_ALL_OPERS = 0
+POS_LEN_PTR_SIZE = 8 ;AN001; 8 bytes for position/length
+
+FIND_BUF STRUC
+
+find_buf_drive DB ? ; drive of search
+find_buf_name DB 11 DUP (?) ; formatted name
+find_buf_sattr DB ? ; attribute of search
+find_buf_LastEnt DW ? ; LastEnt
+find_buf_DirStart DW ? ; DirStart
+find_buf_NetID DB 4 DUP (?) ; Reserved for NET
+find_buf_attr DB ? ; attribute found
+find_buf_time DW ? ; time
+find_buf_date DW ? ; date
+find_buf_size_l DW ? ; low(size)
+find_buf_size_h DW ? ; high(size)
+find_buf_pname DB 13 DUP (?) ; packed name
+
+FIND_BUF ENDS
diff --git a/private/mvdm/dos/v86/inc/rombios.inc b/private/mvdm/dos/v86/inc/rombios.inc
new file mode 100644
index 000000000..79ba6d885
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/rombios.inc
@@ -0,0 +1,20 @@
+; Definitions of interesting variables in ROM BIOS data segment at 40:0
+;
+; Revision History
+; ================
+; 7/13/90 md Created
+
+
+ ROMBIOS_DATA segment AT 040h
+
+ org 049h
+
+CRT_Mode db ? ; current screen mode
+CRT_Cols dw ? ; current number of columns
+
+ org 084h
+
+CRT_Rows db ? ; current number of screen rows
+DEFAULT_ROWS equ 24 ; standard default for screen height
+
+ ROMBIOS_DATA ends
diff --git a/private/mvdm/dos/v86/inc/sf.inc b/private/mvdm/dos/v86/inc/sf.inc
new file mode 100644
index 000000000..a13f8ec43
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/sf.inc
@@ -0,0 +1,145 @@
+ BREAK <Internal system file table format>
+
+
+;** SF.INC - System File Table
+;
+; AN000 version 4.00 Jan. 1988
+; AN003 PTM 3680 -- make NAME offset the same as before (<=3.30)
+; AN009 PTM 3839 reorder SFT for MS WINDOWS
+
+
+;** System File Table SuperStructure
+;
+; The system file table entries are allocated in contiguous groups.
+; There may be more than one such groups; the SF "superstructure"
+; tracks the groups.
+
+SF STRUC
+SFLink DD ?
+SFCount DW ? ; number of entries
+SFTable DW ? ; beginning of array of the following
+SF ENDS
+
+
+;** System file table entry
+;
+; These are the structures which are at SFTABLE in the SF structure.
+
+sf_entry STRUC
+sf_ref_count DW ? ; number of processes sharing entry
+ ; if FCB then ref count
+sf_mode DW ? ; mode of access or high bit on if FCB
+sf_attr DB ? ; attribute of file
+sf_flags DW ? ;Bits 8-15
+ ; Bit 15 = 1 if remote file
+ ; = 0 if local file or device
+ ; Bit 14 = 1 if date/time is not to be
+ ; set from clock at CLOSE. Set by
+ ; FILETIMES and FCB_CLOSE. Reset by
+ ; other reseters of the dirty bit
+ ; (WRITE)
+ ; Bit 13 = Pipe bit (reserved)
+ ;
+ ; Bits 0-7 (old FCB_devid bits)
+ ; If remote file or local file, bit
+ ; 6=0 if dirty Device ID number, bits
+ ; 0-5 if local file.
+ ; bit 7=0 for local file, bit 7
+ ; =1 for local I/O device
+ ; If local I/O device, bit 6=0 if EOF (input)
+ ; Bit 5=1 if Raw mode
+ ; Bit 0=1 if console input device
+ ; Bit 1=1 if console output device
+ ; Bit 2=1 if null device
+ ; Bit 3=1 if clock device
+sf_devptr DD ? ; Points to device header
+sf_time DW ? ; Time associated with file
+sf_date DW ? ; Date associated with file
+sf_size DD ? ; Size associated with file
+sf_position DD ? ; LRU count for FCBs
+
+; SHARING INFO
+sf_chain DD ? ; link to next SF
+sf_PID DW ?
+sf_NTHandle DD ? ; NT File Handle
+sf_entry ENDS
+
+sf_OpenAge EQU WORD PTR sf_position+2
+sf_LRU EQU WORD PTR sf_position
+
+sf_default_number EQU 5h
+
+;
+; Note that we need to mark an SFT as being busy for OPEN/CREATE. This is
+; because an INT 24 may prevent us from 'freeing' it. We mark this as such
+; by placing a -1 in the ref_count field.
+;
+
+sf_busy EQU -1
+
+
+; Flag word masks
+sf_isfcb EQU 1000000000000000B
+sf_isnet EQU 1000000000000000B
+sf_close_nodate EQU 0100000000000000B
+sf_pipe EQU 0010000000000000B
+sf_no_inherit EQU 0001000000000000B
+sf_net_spool EQU 0000100000000000B
+sf_scs_console EQU 0000010000000000B ; special for NT DOSEM
+sf_nt_seek EQU 0000001000000000B ; special for NT DOSEM
+sf_nt_pipe_in EQU 0000000100000000B ; for stdin redirection
+ ; true if seek is needed
+ ; with next read/write operation
+
+devid_file_clean EQU 40h ; true if file and not written
+devid_file_mask_drive EQU 3Fh ; mask for drive number
+
+devid_device EQU 80h ; true if a device
+devid_device_EOF EQU 40h ; true if end of file reached
+devid_device_raw EQU 20h ; true if in raw mode
+devid_device_special EQU 10h ; true if special device
+devid_device_clock EQU 08h ; true if clock device
+devid_device_null EQU 04h ; true if null device
+devid_device_con_out EQU 02h ; true if console output
+devid_device_con_in EQU 01h ; true if consle input
+
+;
+; structure of devid field as returned by IOCTL is:
+;
+; BIT 7 6 5 4 3 2 1 0
+; |---|---|---|---|---|---|---|---|
+; | I | E | R | S | I | I | I | I |
+; | S | O | A | P | S | S | S | S |
+; | D | F | W | E | C | N | C | C |
+; | E | | | C | L | U | O | I |
+; | V | | | L | K | L | T | N |
+; |---|---|---|---|---|---|---|---|
+; ISDEV = 1 if this channel is a device
+; = 0 if this channel is a disk file
+;
+; If ISDEV = 1
+;
+; EOF = 0 if End Of File on input
+; RAW = 1 if this device is in Raw mode
+; = 0 if this device is cooked
+; ISCLK = 1 if this device is the clock device
+; ISNUL = 1 if this device is the null device
+; ISCOT = 1 if this device is the console output
+; ISCIN = 1 if this device is the console input
+;
+; If ISDEV = 0
+; EOF = 0 if channel has been written
+; Bits 0-5 are the block device number for
+; the channel (0 = A, 1 = B, ...)
+;
+devid_ISDEV EQU 80h
+devid_EOF EQU 40h
+devid_RAW EQU 20h
+devid_SPECIAL EQU 10H
+devid_ISCLK EQU 08h
+devid_ISNUL EQU 04h
+devid_ISCOT EQU 02h
+devid_ISCIN EQU 01h
+
+devid_block_dev EQU 1Fh ; mask for block device number
+
diff --git a/private/mvdm/dos/v86/inc/smdossym.inc b/private/mvdm/dos/v86/inc/smdossym.inc
new file mode 100644
index 000000000..4baff310e
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/smdossym.inc
@@ -0,0 +1,161 @@
+; SCCSID = @(#)dossym.asm 1.1 85/04/10
+; SCCSID = @(#)dossym.asm 1.1 85/04/10
+
+ ERROR - who uses this? Not DOS and kernel. Whoever uses this
+ should use DOSSYM instead. See JGL if there's a problem
+
+; PAGE 80,132
+TRUE EQU 0FFFFh
+FALSE EQU 0
+
+Installed = TRUE
+IFNDEF DEBUG
+ DEBUG = FALSE
+ENDIF
+
+include dosmac.INC
+INCLUDE VERSIONA.INC ;DEFINE THE MAJOR AND MINOR VERSION NUMBERS
+
+IF2
+; %OUT DOSSYM in Pass 2
+ENDIF
+
+BREAK <Control character definitions>
+
+c_DEL EQU 7Fh ; ASCII rubout or delete previous char
+c_BS EQU 08h ; ^H ASCII backspace
+c_CR EQU 0Dh ; ^M ASCII carriage return
+c_LF EQU 0Ah ; ^J ASCII linefeed
+c_ETB EQU 17h ; ^W ASCII end of transmission
+c_NAK EQU 15h ; ^U ASCII negative acknowledge
+c_ETX EQU 03h ; ^C ASCII end of text
+c_HT EQU 09h ; ^I ASCII tab
+
+BREAK <Read This and Weep>
+
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; ;
+; C A V E A T P R O G R A M M E R ;
+; ;
+; Certain structures, constants and system calls below are private to ;
+; the DOS and are extremely version-dependent. They may change at any ;
+; time at the implementors' whim. As a result, they must not be ;
+; documented to the general public. If an extreme case arises, they ;
+; must be documented with this warning. ;
+; ;
+; Those structures and constants that are subject to the above will be ;
+; marked and bracketed with the flag: ;
+; ;
+; C A V E A T P R O G R A M M E R ;
+; ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+
+include bpb.INC
+
+include buffer.INC
+
+BREAK <User stack inside of system call and SysVars>
+; Location of user registers relative user stack pointer
+
+user_environ STRUC
+user_AX DW ?
+user_BX DW ?
+user_CX DW ?
+user_DX DW ?
+user_SI DW ?
+user_DI DW ?
+user_BP DW ?
+user_DS DW ?
+user_ES DW ?
+user_IP DW ?
+user_CS DW ?
+user_F DW ?
+user_environ ENDS
+
+include sysvar.INC
+
+include vector.INC
+
+;include mult.INC
+
+BREAK <Disk map>
+; MSDOS partitions the disk into 4 sections:
+;
+; phys sector 0: +-------------------+
+; | | boot/reserved |
+; | +-------------------+
+; | | File allocation |
+; v | table(s) |
+; | (multiple copies |
+; | are kept) |
+; +-------------------+
+; | Directory |
+; +-------------------+
+; | File space |
+; +-------------------+
+; | Unaddressable |
+; | (to end of disk) |
+; +-------------------+
+;
+; All partition boundaries are sector boundaries. The size of the FAT is
+; adjusted to maximize the file space addressable.
+
+include dirent.INC
+
+BREAK <File allocation Table information>
+;
+; The File Allocation Table uses a 12-bit entry for each allocation unit on
+; the disk. These entries are packed, two for every three bytes. The contents
+; of entry number N is found by 1) multiplying N by 1.5; 2) adding the result
+; to the base address of the Allocation Table; 3) fetching the 16-bit word
+; at this address; 4) If N was odd (so that N*1.5 was not an integer), shift
+; the word right four bits; 5) mask to 12 bits (AND with 0FFF hex). Entry
+; number zero is used as an end-of-file trap in the OS and is passed to the
+; BIOS to help determine disk format. Entry 1 is reserved for future use.
+; The first available allocation unit is assigned entry number two, and even
+; though it is the first, is called cluster 2. Entries greater than 0FF8H
+; (12-bit fats) or 0FFF8H (16-bit fats) are end of file marks; entries of zero
+; are unallocated. Otherwise, the contents of a FAT entry is the number of
+; the next cluster in the file.
+;
+; Clusters with bad sectors are tagged with FF7H. Any non-zero number would
+; do because these clusters show as allocated, but are not part of any
+; allocation chain and thus will never be allocated to a file. A particular
+; number is selected so that disk checking programs know what to do (ie. a
+; cluster with entry FF7H which is not in a chain is not an error).
+
+include dpb.INC
+
+include curdir.INC
+
+;include cpmfcb.INC
+
+;include find.INC
+
+include pdb.INC
+
+include exe.INC
+
+include sf.INC
+
+include arena.INC
+
+include intnat.INC
+
+include mi.INC
+
+fChk equ 1
+fDelim equ 2
+fSpChk equ 4
+fFCB equ 8
+
+;include filemode.INC
+
+;include error.INC
+
+include syscall.INC
+
+include doscntry.inc ;J.K. 5/26/86
+
+SUBTTL
+
diff --git a/private/mvdm/dos/v86/inc/smifssym.inc b/private/mvdm/dos/v86/inc/smifssym.inc
new file mode 100644
index 000000000..3dc53ea49
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/smifssym.inc
@@ -0,0 +1,62 @@
+
+; PAGE 60,132
+; SCCSID = @(#)smifssym.inc 1.0 87/05/11
+;
+; Modification history:
+; Created: May 11 1987
+;
+; SMifssym is only for IBMBIO. It will only has definitions
+; for IFSHEADER, IFSRH of INIT function.
+; When ifssym.inc is Revised, make sure that SMifssym.inc
+; is also correct. - JK.
+;
+
+;==================
+;IFS drive header
+;=================
+
+ IFSDEVICE EQU 8000H ; Supports single device/file functions
+ IFSDISK EQU 4000H ; Supports multi-file functions
+ IFSUNC EQU 2000H ; Support UNC (nameless) connection
+ IFSREMOTE EQU 0800H ; File system is remote
+ IFSFILTER EQU 0400H ; FS will filter (if off, use DOS
+ ; standard, cap & 8.3)
+ IFSIOCTL EQU 0002H ; Supports IOCTL functions
+ IFSUSESHARE EQU 0001H ; Uses DOS share support (vs own share)
+
+IFSHEADER STRUC
+IFS_NEXT DD -1 ; Next header in list (-1=end)
+IFS_NAME DB " " ; IFS name
+IFS_ATTRIBUTE DW ? ; Attributes
+IFS_VERSION DW 0 ; Request level supported
+IFS_DOSCALL@ DD ? ; DOS interface routine
+ ; (set by TUPPER before the init call)
+IFS_CALL@ DW ? ; Function entry point
+IFSHEADER ENDS
+
+;=====================
+; IFS Request Header
+;=====================
+
+IFSRH STRUC
+IFSR_LENGTH DW ? ; Total length of request
+IFSR_FUNCTION DB ? ; Requested function
+IFSR_RETCODE DB ? ; Explicit error
+IFSR_RETCLASS DB ? ; Error class
+IFSR_RESV1 DB 17 DUP(0) ; DOS reserved
+IFSR_FCN_PARMS DB 38 DUP(0) ; Additional parameters
+IFSRH ENDS
+
+; IFSR_FUNCTION codes
+; Control requests:
+IFSINIT EQU 1
+IFSATTSTART EQU 2
+IFSATTEND EQU 3
+IFSEXECAPI EQU 4
+IFSCRITMSG EQU 5
+IFSCBUPDATE EQU 6
+; INIT function.
+IFSR_PARMS@ = DWORD PTR IFSR_FCN_PARMS ; command parameters
+IFSR_RESSIZE = WORD PTR IFSR_FCN_PARMS+4 ; driver total size
+LENGTH_INIT EQU IFSR_RESSIZE-IFSRH+2
+
diff --git a/private/mvdm/dos/v86/inc/struc.inc b/private/mvdm/dos/v86/inc/struc.inc
new file mode 100644
index 000000000..f024a9a74
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/struc.inc
@@ -0,0 +1,702 @@
+;;STRUC--Stucture Macro Library
+;;Optimizing Version 2.30 03/31/87
+
+if1
+$NoConj equ 0
+$And equ 1
+$Or equ 2
+$Short equ 3
+$Near equ 4
+$NearToShort equ 5
+$ncxz equ 6
+$AndOr = 0
+$Temp = 0
+$Temp2 = 0
+$Dist = 0
+
+$NoType equ 10
+$ConjIfType equ 11
+$IfType equ 12
+$ElseType equ 13
+$WhileType equ 14
+$ConjWhileType equ 15
+$RepeatType equ 16
+$ConjUntilType equ 17
+$ForType equ 18
+$ConjLeaveType equ 19
+$SelectType equ 20
+$WhenType equ 21
+$ConjWhenType equ 22
+$OtherwiseType equ $ElseType
+
+$StrucError macro text
+ Structure error -- text
+endm
+
+J macro
+endm
+JN macro
+endm
+
+$BuildJump macro j1,j2
+ j1 macro t
+ .xcref j1
+ j2 t
+ endm
+endm
+
+irp x,<<jeq,je>,<jlt,jl>,<jgt,jg>,<jneq,jne>,<jnlt,jnl>,<jngt,jng>,<jnpe,jpo>,<jnpo,jpe>>
+ $BuildJump x
+endm
+irp x,<<jzero,jz>,<jnzero,jnz>,<jnonzero,jnz>,<jnnonzero,jz>,<jand,jnz>,<jnand,jz>,<jnnand,jnz>>
+ $BuildJump x
+endm
+irp x,<a,ae,b,be,c,e,g,ge,l,le,o,p,s,z,cxz>
+ $BuildJump jnn&x,j&x
+endm
+
+jncxz macro t
+ if $Dist eq $NearToShort
+ jcxz $+5
+ jmp t
+ else
+ jcxz $+4
+ jmp short t
+ endif
+endm
+
+purge $BuildJump
+
+$GetConj macro p1,p2
+ $AndOr = $NoConj
+ irp parm,<p1,p2>
+ ifnb <&parm>
+ irp x,<and,AND,or,OR>
+ ifidn <parm>,<x>
+ $AndOr = $&&&x
+ exitm
+ endif
+ endm
+ endif
+ endm
+endm
+
+$GetDist macro p1,p2
+ irp parm,<p1,p2>
+ ifnb <parm>
+ irp x,<short,SHORT,near,NEAR>
+ ifidn <parm>,<x>
+ $Dist = $&&&x
+ exitm
+ endif
+ endm
+ endif
+ endm
+endm
+
+
+$Poke macro n,m
+ $st&n = m
+.xcref $st&n
+endm
+
+$Peek macro x,n
+ x = $st&n
+endm
+
+$Push macro n
+ $st = $st+1
+ $Poke %$st,n
+endm
+
+$Pop macro x
+ if $st gt 0
+ $Peek x,%$st
+ $st = $st-1
+ else
+ $StrucError <open structure>
+ endif
+endm
+
+$EquateLabel macro last,this
+ if $LastLabelOrg eq $
+ $ll&last = this
+ .xcref $ll&last
+ endif
+endm
+
+$TraceLabel macro n,a,b
+ if $ll&a eq $ll&b
+ $ll&n = b
+ .xcref $ll&n
+ else
+ $TraceLabel n,%$ll&a,%$ll&b
+ endif
+endm
+
+$Label macro n
+ if1
+ $EquateLabel %$LastLabel,n
+ $ll&n = n
+ .xcref $ll&n
+ $LastLabel = n
+ $LastLabelOrg = $
+$l&n:
+ else
+ if $ll&n eq n
+$l&n:
+ else
+ .xcref $l&n
+ .xcref $ll&n
+ endif
+ endif
+endm
+
+$CondJump macro l,tf,c
+ if1
+ ifb <c>
+ $EquateLabel %$LastLabel,l
+ endif
+ ifndef <$ll&l>
+ $ll&l = l
+ .xcref $ll&l
+ endif
+ else
+ $TraceLabel l,l,%$ll&l
+ endif
+ $CondJump2 %$ll&l,tf,c
+endm
+
+$CondJump2 macro l,tf,c
+ if $Dist eq $Short
+ ifb <c>
+ jmp short $l&l
+ else
+ ifidn <tf>,<f>
+ jn&c $l&l
+ else
+ j&c $l&l
+ endif
+ endif
+ else
+ ifnb <c>
+ ifdef $l&l
+ if (($ - $l&l) le 126) and (($l&l - $) le 129)
+ $Dist = $NearToShort
+ $nops = 3
+ ifidn <tf>,<f>
+ jn&c $l&l
+ ifdef $n&c
+ if $n&c eq $ncxz
+ $nops = 0
+ endif
+ endif
+ ifdef $&c
+ if $&c eq $ncxz
+ $nops = 5
+ endif
+ endif
+ else
+ j&c $l&l
+ ifdef $n&c
+ if $n&c eq $ncxz
+ $nops = 5
+ endif
+ endif
+ ifdef $&c
+ if $&c eq $ncxz
+ $nops = 0
+ endif
+ endif
+ endif
+ rept $nops
+ nop
+ endm
+ else
+ ifidn <tf>,<f>
+ j&c $+5
+ else
+ jn&c $+5
+ endif
+ jmp $l&l
+ endif
+ else
+ ifidn <tf>,<f>
+ j&c $+5
+ else
+ jn&c $+5
+ endif
+ jmp $l&l
+ endif
+ else
+ ifdef $l&l
+ ifidn <tf>,<NoFold>
+ jmp $l&l
+ else
+ if (($ - $l&l) le 126) and (($l&l - $) le 129)
+ jmp short $l&l
+ nop
+ else
+ jmp $l&l
+ endif
+ endif
+ else
+ jmp $l&l
+ endif
+ endif
+ endif
+endm
+
+
+$CondLoop macro l,c
+ loop&c $l&l
+endm
+
+$Test macro tgt,a1,a2,a3,a4,x
+ ifb <a1>
+ $StrucError <invalid condition>
+ else
+ ifb <a2>
+ $CondJump %&tgt,a1
+ else
+ ifb <a3>
+ ifdif <a1>,<zero>
+ ifdif <a1>,<nonzero>
+ ifdif <a1>,<ZERO>
+ ifdif <a1>,<NONZERO>
+ $StrucError <invalid condition>
+ exitm
+ endif
+ endif
+ endif
+ endif
+ or a2,a2
+ $CondJump %&tgt,a1
+ else
+ ifb <a4>
+ cmp a1,a3
+ $CondJump %&tgt,a2
+ else
+ ifb <x>
+ ifdif <a1>,<bit>
+ ifdif <a1>,<BIT>
+ $StrucError <invalid condition>
+ exitm
+ endif
+ endif
+ test a2,a4
+ $CondJump %&tgt,a3
+ else
+ $StrucError <invalid condition>
+ endif
+ endif
+ endif
+ endif
+ endif
+endm
+
+$TopTest macro args,n,c,p4,p5
+ $GetConj p4,p5
+ $Dist = $DefDist
+ $GetDist p4,p5
+ if $AndOr eq $NoConj
+ $Test <$sn-1,f>,args
+ $Pop $Temp
+ if $OrFound
+ $Label %$Temp
+ endif
+ $Push n
+ else
+ if $AndOr eq $And
+ $Test <$sn-1,f>,args
+ else
+ $OrFound = 1
+ $Test <$sn,t>,args
+ endif
+ $Push c
+ endif
+endm
+;;*****************************************************************************
+.if macro t,p2,p3
+ $Peek $Temp,%$st
+ if $Temp eq $ConjIfType
+ $Pop $Temp
+ else
+ $OrFound = 0
+ $sn = $sn+1
+ $Push $sn
+ $sn = $sn+1
+ $Push $sn
+ $sn = $sn+1
+ $Push $sn
+ endif
+ $TopTest <t>,$IfType,$ConjIfType,p2,p3
+endm
+;;*****************************************************************************
+.then macro
+ $Peek $Temp,%$st
+ if $Temp ne $IfType
+ if $Temp ne $WhenType
+ $StrucError <then without if or when>
+ endif
+ endif
+endm
+;;*****************************************************************************
+.elseif macro t,p2,p3
+ $Pop $Temp
+ if $Temp ne $IfType
+ $StrucError <elseif without if>
+ exitm
+ endif
+ $OrFound = 0
+ $Pop $Temp
+ $Peek $Temp2,%$st
+ $Dist = $Near
+ $CondJump %$Temp2
+ $Label %$Temp
+ $sn = $sn+1
+ $Push $sn
+ $sn = $sn+1
+ $Push $sn
+ $TopTest <t>,$IfType,$ConjIfType,p2,p3
+endm
+;;*****************************************************************************
+.else macro dist
+ $Pop $Temp
+ if $Temp ne $IfType
+ if $Temp ne $WhenType
+ if $Temp ne $SelectType
+ $StrucError <else without if, when or select>
+ exitm
+ endif
+ endif
+ endif
+ $sn = $sn+1
+ if $Temp eq $SelectType
+ $Push $sn
+ else
+ $Dist = $DefDist
+ $GetDist dist
+ $CondJump %$sn
+ $Pop $Temp
+ $Label %$Temp
+ $Push $sn
+ endif
+ $push $ElseType
+endm
+;;*****************************************************************************
+.endif macro
+ $Pop $Temp
+ if $Temp ne $IfType
+ if $Temp ne $ElseType
+ $StrucError <endif without if>
+ exitm
+ endif
+ endif
+ $Pop $Temp
+ $Label %$Temp
+ $Pop $Temp
+ $Label %$Temp
+endm
+;;*****************************************************************************
+.select macro x
+ $OrFound = 0
+ $sn = $sn+1
+ $Push $sn
+ $Push $SelectType
+endm
+;;*****************************************************************************
+.when macro tst,p2,p3
+ $Pop $Temp
+ if $Temp ne $SelectType
+ if $Temp ne $WhenType
+ if $Temp ne $ConjWhenType
+ $StrucError <when without select>
+ exitm
+ endif
+ endif
+ endif
+ if $Temp ne $ConjWhenType
+ $Dist = $Near
+ $OrFound = 0
+ if $Temp eq $WhenType
+ $Pop $Temp2
+ $Peek $Temp,%$st
+ $CondJump %$Temp
+ $Label %$Temp2
+ endif
+ $sn = $sn+1
+ $Push $sn
+ $sn = $sn+1
+ $Push $sn
+ endif
+ $TopTest <tst>,$WhenType,$ConjWhenType,p2,p3
+endm
+;;*****************************************************************************
+.otherwise macro dist
+ $Pop $Temp
+ if $Temp ne $WhenType
+ if $Temp ne $SelectType
+ if $Temp ne $IfType
+ $StrucError <otherwise without if, when or select>
+ exitm
+ endif
+ endif
+ endif
+ $sn = $sn+1
+ if $Temp eq $SelectType
+ $Push $sn
+ else
+ $Dist = $DefDist
+ $GetDist dist
+ $CondJump %$sn
+ $Pop $Temp
+ $Label %$Temp
+ $Push $sn
+ endif
+ $push $OtherwiseType
+endm
+;;*****************************************************************************
+.endselect macro
+ $Pop $Temp
+ if $Temp ne $WhenType
+ if $Temp ne $OtherwiseType
+ if $Temp ne $SelectType
+ $StrucError <endselect without select>
+ exitm
+ endif
+ endif
+ endif
+ $pop $Temp2
+ if $Temp ne $SelectType
+ $Label %$Temp2
+ $Pop $Temp2
+ $Label %$Temp2
+ endif
+endm
+;;*****************************************************************************
+.while macro t,p2,p3
+ $Peek $Temp,%$st
+ if $Temp eq $ConjWhileType
+ $Pop $Temp
+ else
+ $Push $LoopEnd
+ $OrFound = 0
+ $sn = $sn + 1
+ $Push $sn
+ $Label %$sn
+ $sn = $sn + 2
+ $Push $sn
+ $LoopEnd = $sn - 1
+ endif
+ $TopTest <t>,$WhileType,$ConjWhileType,p2,p3
+endm
+;;*****************************************************************************
+.endwhile macro p1
+ $Pop $Temp
+ if $Temp ne $WhileType
+ $StrucError <endwhile without while>
+ exitm
+ endif
+ $Dist = $Near
+ $Pop $Temp
+ $CondJump %$Temp,NoFold
+ $Label %$Temp+1
+ $Pop $LoopEnd
+endm
+;;*****************************************************************************
+.repeat macro
+ $Push $LoopEnd
+ $Push $LeaveFound
+ $sn = $sn+1
+ $Label %$sn
+ $Push $sn
+ $Push $RepeatType
+ $sn = $sn+1
+ $LoopEnd = $sn
+ $LeaveFound = 0
+endm
+;;*****************************************************************************
+.until macro t,p2,p3
+ $until2 p2,p3,t
+endm
+$until2 macro p2,p3,a1,a2,a3,a4,x
+ $Pop $Temp
+ if $Temp ne $RepeatType
+ if $Temp ne $ConjUntilType
+ $StrucError <until without repeat>
+ exitm
+ endif
+ else
+ $OrFound = 0
+ endif
+ $Dist = $DefDist
+ $GetDist p2,p3
+ $GetConj p2,p3
+
+ if $AndOr eq $NoConj
+ $Pop $Temp
+ ifb <a1>
+ $Dist = $Near
+ $CondJump %$Temp,NoFold
+ else
+ $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
+ endif
+ if $OrFound or $LeaveFound
+ $Label %$Temp+1
+ endif
+ $Pop $LeaveFound
+ $Pop $LoopEnd
+ else
+ $Peek $Temp,%$st
+ if $AndOr eq $And
+ $Test <$Temp,f>,<a1>,<a2>,<a3>,<a4>,<x>
+ else
+ $OrFound = 1
+ $Test <$Temp+1,t>,<a1>,<a2>,<a3>,<a4>,<x>
+ endif
+ $Push $ConjUntilType
+ endif
+endm
+;;*****************************************************************************
+.loop macro cond
+ $Pop $Temp
+ if $Temp ne $RepeatType
+ $StrucError <loop without repeat>
+ exitm
+ endif
+ $Pop $Temp
+ $CondLoop %$Temp,cond
+ if $LeaveFound
+ $Label %$Temp+1
+ endif
+ $Pop $LeaveFound
+ $Pop $LoopEnd
+endm
+;;*****************************************************************************
+.for macro index,equals,start,to,stop,by,step,dist
+ mov index,start
+ $Push $LoopEnd
+ $sn = $sn+1
+ $Push $sn
+ $Label %$sn
+ $sn = $sn+1
+ $LoopEnd = $sn
+ cmp index,stop
+ $Dist = $DefDist
+ ifb <step>
+ $Push 1
+ $GetDist by
+ $CondJump %$sn,t,gt
+ else
+ $GetDist dist
+ $Push %(step)
+ if step lt 0
+ $CondJump %$sn,t,lt
+ else
+ $CondJump %$sn,t,gt
+ endif
+ endif
+ $Push $ForType
+endm
+;;*****************************************************************************
+.next macro index,dist
+ $Pop $Temp
+ if $Temp ne $ForType
+ $StrucError <next without for>
+ exitm
+ endif
+ $Pop $Temp
+ if $Temp eq 1
+ inc index
+ else
+ if $Temp eq -1
+ dec index
+ else
+ add index,$Temp
+ endif
+ endif
+ $Pop $Temp
+ $Dist = $Near
+ $CondJump %$Temp,NoFold
+ $Label %$Temp+1
+ $Pop $LoopEnd
+endm
+;;*****************************************************************************
+.leave macro t,p2,p3
+ $leave2 p2,p3,t
+endm
+$leave2 macro p2,p3,a1,a2,a3,a4,x
+ ife $LoopEnd
+ $StrucError <leave outside a loop>
+ exitm
+ endif
+ $LeaveFound = 1
+ $Peek $Temp,%$st
+ if $Temp eq $ConjLeaveType
+ $Pop $Temp
+ else
+ $OrFound = 0
+ $sn = $sn + 1
+ endif
+ $Dist = 0
+ $GetDist <a1>
+ if $Dist
+ $CondJump %$LoopEnd
+ if $OrFound
+ $Label %$sn
+ endif
+ else
+ $Dist = $DefDist
+ $GetDist p2,p3
+ $GetConj p2,p3
+ if $AndOr eq $NoConj
+ ifb <a1>
+ $CondJump %$LoopEnd,t
+ else
+ $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
+ endif
+ if $OrFound
+ $Label %$sn
+ endif
+ else
+ if $AndOr eq $And
+ $OrFound = 1
+ $Test <$sn,f>,<a1>,<a2>,<a3>,<a4>,<x>
+ else
+ $Test <$LoopEnd,t>,<a1>,<a2>,<a3>,<a4>,<x>
+ endif
+ $Push $ConjLeaveType
+ endif
+ endif
+endm
+;;*****************************************************************************
+else ;else for if1
+$Pop $Temp
+;;if $Temp ne $NoType
+if $st ne 0
+ $StrucError <open structure(s)>
+endif
+.xcref $NoConj,$And,$Or,$Short,$Near,$NearToShort,$AndOr,$Temp,$Temp2,$Dist
+.xcref $NoType,$ConjIfType,$IfType,$ElseType,$WhileType,$ConjWhileType
+.xcref $RepeatType,$ConjUntilType,$ForType,$ConjLeaveType,jncxz
+.xcref $SelectType,$WhenType,$OtherwiseType,$ConjWhenType
+.xcref jeq,jgt,jlt,jneq,jngt,jnlt,jnna,jnnae,jnnb,jnnbe,jnnc,jnncxz
+.xcref jnne,jnng,jnnge,jnnl,jnnle,jnno,jnnp,jnns,jnnz,jnpe,jnpo,$BuildJump
+.xcref $GetConj,$GetDist,$Poke,$Peek,$Push,$Pop,$Label,$CondJump,$CondLoop,$Test
+.xcref $TopTest,$leave2,$until2,$StrucError,j,jn,jand,jnand,jnnand
+.xcref jnnonzero,jnonzero,jnzero,jzero
+.xcref $st,$sn,$OrFound,$LoopEnd,$LeaveFound,$DefDist
+.xcref $LastLabel,$LastLabelOrg,$EquateLabel,$TraceLabel,$CondJump2,$ncxz
+endif
+
+
+$st = 0
+$sn = 0
+$OrFound = 0
+$LoopEnd = 0
+$LeaveFound = 0
+$LastLabel = -1
+$LastLabelOrg = $
+$DefDist= $Short
+$Push %$NoType
diff --git a/private/mvdm/dos/v86/inc/syscall.inc b/private/mvdm/dos/v86/inc/syscall.inc
new file mode 100644
index 000000000..f5b10e971
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/syscall.inc
@@ -0,0 +1,166 @@
+; SCCSID = @(#)syscall.asm 1.1 85/04/10
+;BREAK <system call definitions>
+SUBTTL system call definitions
+PAGE
+
+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
+WaitProcess 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
+ECS_CALL EQU 99 ; 99 63 ;; DBCS support
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+Set_Printer_Flag EQU 100 ; 100 64
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+GetExtCntry EQU 101 ; 101 65
+GetSetCdPg EQU 102 ; 102 66
+ExtHandle EQU 103 ; 103 67
+Commit EQU 104 ; 104 68
+GetSetMediaID EQU 105 ; 105 69
+IFS_IOCTL EQU 107 ; 107 6B
+ExtOpen EQU 108 ; 108 6C
+;
+;
+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/private/mvdm/dos/v86/inc/sysmsg.inc b/private/mvdm/dos/v86/inc/sysmsg.inc
new file mode 100644
index 000000000..5c2687cad
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/sysmsg.inc
@@ -0,0 +1,550 @@
+; PAGE ,132
+ SUBTTL DOS - Message Retriever - SYSTEM CONTROL file
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; DOS -- Message Retriever
+;; (c) Copyright 1988 Microsoft
+;;
+;; File Name: SYSMSG.INC
+;; ----------
+;;
+;; Description: Message retriever functions are included into source code
+;; ------------ by referencing a MSG_SERVICES macro. That macro is defined
+;; here as well as the logic to include necessary .ASM and .INC
+;; files.
+;;
+;;
+;; Documentation Reference:
+;; ------------------------
+;; DOS -Message Retriever I0 Document - Feb. ?? 1987
+;; DOS -Message Retriever I1 Document - Mar. ?? 1987
+;; DOS -Message Retriever I2 Document - Mar. ?? 1987
+;; DOS -Final Functional Specification Document - Mar ?? 1987
+;;
+;; Procedures Contained in This File:
+;; ---------------------------------
+;; None
+;;
+;; Include Files Required:
+;; -----------------------
+;; MSGSERV.INC := All message services
+;; ???? := ????
+;;
+;; External Procedure References:
+;; ------------------------------
+;; None
+;;
+;; Linkage Instructions:
+;; --------------------
+;; None
+;;
+;; Change History:
+;; ---------------
+;; CREATED March, 1987 RPS
+;;
+;; Psuedocode:
+;; -----------
+;; None
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;;
+INCLUDE VERSIONA.INC ;;AN003;;
+
+FALSE = 0 ;;
+TRUE = NOT FALSE ;; List message services and flags
+ ;;
+
+; Control Characters For Message Skeleton file
+
+NULL EQU 00H ;; Null
+BELL EQU 07H ;; Bell
+TAB EQU 09H ;; Tab
+LF EQU 0AH ;; Line Feed
+HOME EQU 0BH ;; Home
+FORMFD EQU 0CH ;; Form Feed
+CR EQU 0DH ;; Carriage Return
+COLON EQU 3AH ;; Colon
+
+; SYSDISPMSG and SYSGETMSG Equates
+
+MSG_SER_CLASS EQU 00H ;; Message Service Class (reserved)
+EXT_ERR_CLASS EQU 01H ;; DOS Extended error class
+PARSE_ERR_CLASS EQU 02H ;; Parse error class
+UTILITY_MSG_CLASS EQU 0FFH ;; Utility message class
+
+NO_HANDLE EQU 0FFFFH ;; No handle specified (Use DOS functions 01H-09H only)
+
+NO_REPLACE EQU 0000H ;; No replacable parameters
+
+; SUBLIST Equates
+
+ Sublist_Length EQU 11 ;; Length of sublist structure
+ Reserved EQU 0 ;; Reserved byte field
+
+ Left_Align EQU 0 ;;00xxxxxx
+ Right_Align EQU 80h ;;10xxxxxx
+
+ Char_type EQU 0 ;;axxx0000 - Character type
+ Char_Field_Char EQU 0 ;;a0000000
+ Char_Field_ASCIIZ EQU 10h ;;a0010000
+
+ Unsgn_Bin_Type EQU 01h ;;axxx0001 - Unsigned Binary to Decimal character
+ Unsgn_Bin_Byte EQU 11h ;;a0010001
+ Unsgn_Bin_Word EQU 21h ;;a0100001
+ Unsgn_Bin_DWord EQU 31h ;;a0110001
+
+ Sgn_Bin_Type EQU 02h ;;axxx0010 - Signed Binary to Decimal character
+ Sgn_Bin_Byte EQU 12h ;;a0010010
+ Sgn_Bin_Word EQU 22h ;;a0100010
+ Sgn_Bin_DWord EQU 32h ;;a0110010
+
+ Bin_Hex_Type EQU 03h ;;axxx0011 - Unsigned Binary to Hexidecimal character
+ Bin_Hex_Byte EQU 13h ;;a0010011
+ Bin_Hex_Word EQU 23h ;;a0100011
+ Bin_Hex_DWord EQU 33h ;;a0110011
+
+ Date_Type EQU 04h ;;axxx0100 - Date to character using current country format
+ Date_MD EQU 14h ;;a0010100
+ Date_MDY_2 EQU 24h ;;a0100100
+ Date_MDY_4 EQU 34h ;;a0110100
+
+ Time_Cty_Type EQU 05h ;;axxx0101 - Time to character using current country format
+ Time_HHMM_Cty EQU 05h ;;a0000101
+ Time_HHMMSS_Cty EQU 15h ;;a0010101
+ Time_HHMMSSHH_Cty EQU 25h ;;a0100101
+
+ Time_24_Type EQU 06h ;;axxx0110 - Time to character using 24 hour format
+ Time_HHMM_24 EQU 06h ;;a0000110
+ Time_HHMMSS_24 EQU 16h ;;a0010110
+ Time_HHMMSSHH_24 EQU 26h ;;a0100110
+
+ $M_EXTPAR_Type EQU 08h ;;axxx1000 - Special case for extended parse replace format
+
+NO_INPUT EQU 00H ;; No input characters
+DOS_KEYB_INP EQU 01H ;; DOS INT 21H - AH=01H := Keyboard Input
+DOS_DIR_CON_INP EQU 07H ;; DOS INT 21H - AH=07H := Direct Console Input Without Echo
+DOS_CON_INP EQU 08H ;; DOS INT 21H - AH=08H := Console Input Without Echo (Check CTL-BK)
+DOS_BUF_KEYB_INP EQU 0AH ;; DOS INT 21H - AH=0AH := Buffered Keyboard Input
+DOS_CLR_KEYB_BUF EQU 0CH ;; DOS INT 21H - AH=0CH := Clear keyboard buffer
+DOS_WRITE_HANDLE EQU 40H ;; DOS INT 21H - AH=40H := Write to a DOS handle
+DOS_DISP_STRING EQU 09H ;; DOS INT 21H - AH=09H := Display $ terminated string
+DOS_DISP_CHAR EQU 02H ;; DOS INT 21H - AH=02H := Display Character
+LOWEST_4CH_VERSION EQU 0002H ;; First DOS version to allow AH = 4CH Exit (VERSION 2.00)
+
+DOS_GET_DBCS_INFO EQU 6300H ;; DOS INT 21H - AX=6507H := Get DBCS Vector Table
+DOS_GET_EXT_ERROR EQU 59H ;; DOS INT 21H - AH=59H := Get Extended Error
+DOS_GET_EXT_ERROR_BX EQU 00H ;; DOS INT 21H - BX=0000H := Version 0
+
+DOS_EXTENDED_OPEN EQU 6C00H ;AN003; DOS INT 21H - AX=6C00H := Extended Open
+NO_CRIT_OPEN EQU 2000H ;AN003; Extended Open Mode bit
+NOT_EX_FAIL_EX_OPEN EQU 0101H ;AN003; Extended Open Flag
+DOS_LSEEK_FILE EQU 4200H ;AN003; DOS INT 21H - AX=4200H := LSEEK file
+DOS_READ_BYTE EQU 3FH ;AN003; DOS INT 21H - AH=3FH := Read byte block
+DOS_CLOSE_FILE EQU 3EH ;AN003; DOS INT 21H - AH=3EH := Close file handle
+
+IFSFUNC_INSTALL_CHECK EQU 0500H ;AN006; IFSFUNC Installation Check
+IFS_GET_ERR_TEXT EQU 0502H ;AN006; IFSFUNC Get Extended Error Text
+IFSFUNC_INSTALLED EQU 0FFH ;AN006; Return code if IFSFUNC is installed
+
+EXT_ERR_39 EQU 39 ;; Insufficent Disk Space EXTENDED ERROR (changed from hex to decimal - eg d201)
+ERROR_CLASS_39 EQU 01H ;; Error Class = 1
+ACTION_39 EQU 04H ;; Suggested Action = 4
+LOCUS_39 EQU 01H ;; Locus = 1
+
+DOS_GET_COUNTRY EQU 38H ;; DOS INT 21H - AH=38H := Get Country Dependant Information
+DOS_GET_VERSION EQU 30H ;; DOS INT 21H - AH=30H := Get DOS Version number
+DOS_IOCTL_GET_INFO EQU 4400H ;; DOS INT 21H - AH=4400H := I/O control for devices
+DOS_IOCTL_SET_INFO EQU 4401H ;; DOS INT 21H - AH=4401H := I/O control for devices
+DOS_GET_EXT_PARSE_ADD EQU 122EH ;; DOS INT 2FH - AX=122EH := Get Extended/Parse error address
+DOS_GET_EXTENDED EQU 00 ;; DOS INT 2FH - AX=122EH - DL=00 := Get Extended address
+DOS_GET_PARSE EQU 02 ;; DOS INT 2FH - AX=122EH - DL=02 := Get Parse address
+DOS_GET_CRITICAL EQU 04 ;; DOS INT 2FH - AX=122EH - DL=04 := Get Critical address
+DOS_GET_FILE EQU 06 ;; DOS INT 2FH - AX=122EH - DL=06 := Get File system dependant
+DOS_GET_ADDR EQU 08 ;; DOS INT 2FH - AX=122EH - DL=08 := Get Address of READ_DISK_PROC
+DOS_SET_ADDR EQU 09 ;; DOS INT 2FH - AX=122EH - DL=09 := Set Address of READ_DISK_PROC
+LOW_NIB_MASK EQU 0FH ;; Mask out the high byte
+DOS_CLR_KEYB_BUF_MASK EQU 0C0H ;; Check if high nibble is C Hex
+$M_CON_INP EQU -1 ;; If DOS INT 21H Function 06H - DL := 0FFH for input
+$M_CRIT_LO EQU 19 ;; First Extended Error considered CRITICAL
+$M_CRIT_HI EQU 39 ;; Last Extended Error considered CRITICAL (EG - D191)
+$M_AM EQU "a" ;; Time format AM indicator
+$M_PM EQU "p" ;; Time format PM indicator
+$M_NEG_SIGN EQU "-" ;; Signed decimal number format negative indicator
+$M_DEF_TIME_FORM EQU 1 ;; Default Time format - 24 hour
+$M_DEF_DATE_FORM EQU 0 ;; Default Time format - 0 := USA format
+$M_DEF_TIME_SEP EQU ":" ;; Default Time separator - ":"
+$M_DEF_DATE_SEP EQU "-" ;; Default Time separator - "-"
+$M_DEF_DECI_SEP EQU "." ;; Default Time hundreds separator - "."
+$M_TIMEDATE_PAD EQU "0" ;; Time/Date PAD character - "0" (ie 12:03p)
+$M_MAX_2_YEAR EQU 99 ;; Maximum 2 digit year
+$M_SINGLE_CHAR EQU 1 ;; A single character is this long ^
+$M_SPECIAL_CASE EQU 30H ;; Special case for replacable parameters %0
+$M_UNLIM_W EQU 0 ;; Unlimited width character
+$M_COMMA EQU "," ;; Default Thousand separate
+$M_CR_LF EQU 0A0DH ;; Default CR/LF
+$M_SPACE_HYP EQU "- " ;; Default Space/Hyphan
+$M_SPACE EQU " " ;; Default Space
+$M_NULL EQU 0 ;; Null
+$M_FIRST_THOU EQU 3 ;; Location of first thousand separator
+$M_SECOND_THOU EQU 6 ;; Location of second thousand separator
+$M_THIRD_THOU EQU 9 ;; Location of third thousand separator
+$M_BASE10 EQU 10 ;; Base 10 for arthmetic
+$M_BASE16 EQU 16 ;; Base 16 for arthmetic
+$M_CLASS_NOT_EXIST EQU 0 ;; Does class exist?
+$M_TERMINATING_FLAG EQU -1 ;; Is there any more classes?
+$M_ADDR_SZ_NEAR EQU 2 ;; Size to increment if NEAR
+$M_ADDR_SZ_FAR EQU 4 ;; Size to increment if FAR
+$M_SL EQU DS:[SI] ;; Refer to SUBLIST as $M_SL
+$M_NO_HANDLE EQU -1 ;; No handle flag
+$M_TEMP_BUF_SZ EQU 64 ;; Size of temporary buffer ;AN003;
+$M_NEXT_DBCS_VECTOR EQU 2 ;; Amount to increment to get next vector
+$M_DBCS_TERM EQU 0000 ;; DBCS vector table terminating flag
+$M_SPECIAL_MSG_NUM EQU 0FFFFH ;; Special generic message number
+$M_CRLF_SIZE EQU 2 ;; Size of the CR LF message
+$M_NO_CRLF_MASK EQU 10000000B ;; Mask to supress CR LF
+$M_ONE_REPLACE EQU 1 ;; Indicate one replacement
+$M_CRIT_ERR_MASK EQU 00000001B ;; Mask to allow EOF/EOI Crit error
+ ;;
+$M_ALIGN_MASK EQU 10000000b ;; Mask for align
+$M_TYPE_MASK EQU 00001111b ;; Mask for types
+$M_SIZE_MASK EQU 00110000b ;; Mask for types
+$M_TIME_MASK EQU 00000001b ;; Mask for TIME
+$M_DATE_MASK EQU 00010000b ;; Mask for TIME
+$M_BYTE EQU 00010000b ;; BYTE indicator
+$M_WORD EQU 00100000b ;; WORD indicator
+$M_DWORD EQU 00110000b ;; DWORD indicator
+
+; Standard reserved DOS handles
+
+STDIN EQU 0000H ;; Standard Input device handle
+STDOUT EQU 0001H ;; Standard Output device handle
+STDERR EQU 0002H ;; Standard Error Output device handle
+STDAUX EQU 0003H ;; Standard Auxiliary device handle
+STDPRN EQU 0004H ;; Standard Printer device handle
+
+; Reserved Message Service equates
+
+NEARmsg = TRUE ;; \
+NOVERCHECKmsg = FALSE ;; |
+MSGDATA = FALSE ;; |
+FARmsg = FALSE ;; |
+GETmsg = FALSE ;; |
+LOADmsg = FALSE ;; |
+DISPLAYmsg = FALSE ;; } Set default cases
+SETSTDIO = FALSE ;; |
+NOCHECKSTDIN = FALSE ;; |
+NOCHECKSTDOUT = FALSE ;; |
+DISK_PROC = FALSE ;; | ;AN003;
+INPUTmsg = FALSE ;; |
+CHARmsg = FALSE ;; |
+NUMmsg = FALSE ;; |
+TIMEmsg = FALSE ;; |
+DATEmsg = FALSE ;; /
+
+IF1 ;;
+COMR = FALSE ;; COMMAND.COM Cases (resident)
+COMT = FALSE ;; (transient)
+ENDIF ;;
+
+$M_STRUC = TRUE ;; Internal message service defaults
+$M_LOAD = TRUE ;;
+$M_SUBS = TRUE ;;
+$M_REPLACE = TRUE ;;
+$M_REPL_DONE = FALSE ;;
+$M_CHAR_ONLY = TRUE ;;
+$M_PARSE_FLAG = TRUE ;;
+$M_EXT_ERR_FLAG = TRUE ;;
+$M_MSGDATA_ONLY = TRUE ;;
+$M_END = FALSE ;;
+$M_EXT_CLS = TRUE ;;
+$M_PAR_CLS = TRUE ;;
+ ;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_POPF Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
+$M_POPF MACRO
+ LOCAL $M_MYRET
+ JMP $+3
+$M_MYRET LABEL NEAR
+ IRET
+ PUSH CS
+ CALL $M_MYRET
+ENDM
+
+; This Macro was removed from sysmsg.inc. We had to remove this
+; macro and put it into it's own include file in order to clear up
+; some assembly errors. MS MASM will not allow a public declaration
+; during the second pass of the assembler. IBM MASM will allow this.
+;
+;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_DECLARE Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;
+;$M_DECLARE macro numcls ;
+; $M_DCOUNT = 0 ;
+; REPT numcls ;
+; $M_DCOUNT = $M_DCOUNT + 1 ;
+; $M_DECLARE2 %$M_DCOUNT ;
+; ENDM ;
+;
+; IF COMR
+; IFNDEF $M_RT2 ; If Resident table is not in this assembly,
+; EXTRN $M_RT2:BYTE ; Must be external
+; ELSE
+; PUBLIC $M_RT2
+; ENDIF ;
+; ELSE
+; IFNDEF $M_RT ; If Resident table is not in this assembly,
+; EXTRN $M_RT:BYTE ; Must be external
+; ELSE
+; PUBLIC $M_RT
+; ENDIF ;
+; ENDIF
+;
+; $M_CHECK $M_GET_MSG_ADDRESS ; If this subroutine is not in this assembly,
+; $M_CHECK $M_MSGSERV_1 ; If this subroutine is not in this assembly,
+; $M_CHECK $M_MSGSERV_2 ; If this subroutine is not in this assembly,
+;
+;ENDM ;
+; ;
+;$M_DECLARE2 macro innum ;
+; IF NOT COMR ; IF Not resident COMMAND.COM
+; IF NOT COMT ; IF Not transient COMMAND.COM
+; IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+; IF FARmsg ;
+; EXTRN $M_CLS_&innum:FAR ; Must be external
+; ELSE ;
+; EXTRN $M_CLS_&innum:NEAR ; Must be external
+; ENDIF ;
+; ELSE ; ELSE
+; PUBLIC $M_CLS_&innum ; Label PUBLIC
+; ENDIF ;
+; ELSE ; ELSE
+; IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
+; IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
+; IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+; IF FARmsg ;
+; EXTRN $M_CLS_&innum:FAR ; Must be external
+; ELSE ;
+; EXTRN $M_CLS_&innum:NEAR ; Must be external
+; ENDIF ;
+; ELSE ; ELSE
+; PUBLIC $M_CLS_&innum ; Label PUBLIC
+; ENDIF ;
+; ENDIF ;
+; ENDIF ;
+; ENDIF ;
+; ELSE ; ELSE
+; IFDIF <$M_CLS_&innum>,<$M_CLS_1> ; IF NOT $M_CLS_1 or
+; IFDIF <$M_CLS_&innum>,<$M_CLS_2> ; IF NOT $M_CLS_2 then
+; IFNDEF $M_CLS_&innum ; IF class is not in this assembly,
+; IF FARmsg ;
+; EXTRN $M_CLS_&innum:FAR ; Must be external
+; ELSE ;
+; EXTRN $M_CLS_&innum:NEAR ; Must be external
+; ENDIF ;
+; ELSE ; ELSE
+; PUBLIC $M_CLS_&innum ; Label PUBLIC
+; ENDIF ;
+; ENDIF ;
+; ENDIF ;
+; ENDIF ;
+;ENDM ;
+; ;
+;$M_CHECK macro parm ;
+; IFNDEF parm ; IF class is not in this assembly,
+; IF FARmsg ;
+; EXTRN parm:FAR ; Must be external
+; ELSE ;
+; EXTRN parm:NEAR ; Must be external
+; ENDIF ;
+; ELSE
+; IF COMR
+; ELSE
+; PUBLIC parm
+; ENDIF
+; ENDIF ;
+;ENDM ;
+; ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+; ;
+;IF2 ;
+; $M_DECLARE %$M_NUM_CLS ; Declare any class not in this assembly
+;ENDIF ;
+; ;
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;;
+;; Message Retreiver requests
+;;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+MSG_UTILNAME Macro utilname ;
+ ;
+ INCLUDE &utilname.CTL ; Include the control file for the utility
+ $M_STRUC = TRUE ;
+ INCLUDE MSGSERV.ASM ; Get structure definitions
+ ;
+ENDM ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MSG_SERVICES Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+MSG_SERVICES Macro varlist ; MACRO used in source routine
+ ;
+ $M_SERVICE = FALSE ; Reset service flag
+ IRP var,<varlist> ; FOR each variable in the list
+ $M_INCLUDE = TRUE ; Reset include flag
+ ; For each service predefined
+
+IRP serv,<MSGDATA,LOADmsg,NOVERCHECKmsg,DISPLAYmsg,GETmsg,INPUTmsg,CHARmsg,NUMmsg,TIMEmsg,DATEmsg,NEARmsg,FARmsg,COMR,COMT>
+
+ IFDIF <var>,<serv> ; IF it IS a service (defined above)
+ ELSE ;
+ IFDIF <var>,<MSGDATA> ; IF it is NOT the message data space request
+ $M_MSGDATA_ONLY = FALSE ; Instruct the assembler to include all services
+ ENDIF ; ENDIF
+ IRP repl,<CHARmsg,NUMmsg,TIMEmsg,DATEmsg> ; IF it is a replace service
+ IFIDN <var>,<repl> ;
+ $M_REPLACE = TRUE ; Set replace flag
+ ENDIF ;
+ ENDM ;
+ serv = TRUE ; Let the assembler know about the service
+ $M_SERVICE = TRUE ; Let the macro know it was a service
+ $M_INCLUDE = FALSE ; Let the macro know it wasn't a class
+ ENDIF ; ENDIF
+ ENDM ; NEXT service
+
+MSG_SERVICES2 <varlist>
+ ; Continue further checks (If we add any more predefined
+ ; function to the above IRP command, it generates a
+ ; syntax error. We must continue the processing in another
+ ; MACRO called MSG_SERVICES2)
+
+ IF $M_INCLUDE ; IF message class was requested
+ $M_INC var ; Include it as a message class
+ ENDIF ; ENDIF
+ ENDM ; NEXT variable
+ ;
+ IF $M_SERVICE ; IF it any services were requested THEN
+ INCLUDE MSGSERV.ASM ; THEN include module to get service
+ ENDIF ; ENDIF
+
+ENDM
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; MSG_SERVICES2 Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+MSG_SERVICES2 Macro varlist2 ; MACRO used in source routine
+ ;
+ ; FOR each variable in the list
+ IRP var2,<varlist2>
+ ; For each service predefined
+ IRP serv2,<SETSTDIO,NOCHECKSTDIN,NOCHECKSTDOUT,DISK_PROC>
+ ;AN003; IF it IS a service (defined above)
+ IFDIF <var2>,<serv2>
+ ELSE ;
+ serv2 = TRUE ; Let the assembler know about the service
+ $M_SERVICE = TRUE ; Let the macro know it was a service
+ $M_INCLUDE = FALSE ; Let the macro know it wasn't a class
+ ENDIF ; ENDIF
+ ENDM ; NEXT service
+ ENDM ; NEXT variable
+ENDM ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_INC Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_INC Macro ext ;
+ ;
+INCLUDE &ext ;
+ ;
+ENDM ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_BUILD_PTRS Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_BUILD_PTRS Macro nummsg ;
+ ;
+ $M_INDEX = 0 ;
+IF COMR ; IF this is resident COMMAND.COM
+ $M_MAKE_COMR ;
+ELSE ; ELSE
+ IF COMT ; IF this is transient COMMAND.COM
+ $M_MAKE_COMT ;
+ ELSE ; ELSE
+ ;
+ $M_INDEX = 0 ;
+ $M_COUNT = 0 ; Build normal utilities
+ ;
+ REPT nummsg ;
+ $M_COUNT = $M_COUNT + 1 ;
+ $M_MAKE %$M_COUNT ;
+ ENDM ;
+ ENDIF ;
+ENDIF ;
+ENDM ;
+ ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_MAKE Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_MAKE Macro $m_append ;
+IF FARmsg ;
+ CALL FAR PTR $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI)
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX+2,ES ; Move into first avaliable table location
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+ELSE ;
+ CALL $M_CLS_&$m_append ; Get addressibilty to class &$M_APPEND (ES:DI)
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+ENDIF ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ENDM ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_MAKE_COMR Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_MAKE_COMR macro ;
+ ;
+ CALL $M_CLS_3 ; Get addressibilty to class A
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ CALL $M_CLS_4 ; Get addressibilty to class B
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ CALL $M_CLS_5 ; Get addressibilty to class C
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ CALL $M_CLS_6 ; Get addressibilty to class D
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ CALL $M_CLS_7 ; Get addressibilty to class E
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ENDM ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+;; $M_MAKE_COMT Macro
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+ ;
+$M_MAKE_COMT macro ;
+ ;
+;; CALL $M_CLS_8 ; Get addressibilty to class A
+ CALL $M_CLS_3 ; Get addressibilty to class F
+ MOV WORD PTR $M_RT.$M_CLASS_ADDRS+$M_INDEX,DI ;
+$M_INDEX = $M_INDEX + 4 ; Set next available table location
+ ;
+ENDM ;
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+
diff --git a/private/mvdm/dos/v86/inc/sysvar.inc b/private/mvdm/dos/v86/inc/sysvar.inc
new file mode 100644
index 000000000..e57ec2475
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/sysvar.inc
@@ -0,0 +1,72 @@
+; SCCSID = @(#)sysvar.asm 1.1 85/04/10
+
+SysInitVars STRUC
+SYSI_DPB DD ? ; DPB chain
+SYSI_SFT DD ? ; SFT chain
+SYSI_CLOCK DD ? ; CLOCK device
+SYSI_CON DD ? ; CON device
+SYSI_MAXSEC DW ? ; maximum sector size
+SYSI_BUF DD ? ; points to Hashinitvar
+SYSI_CDS DD ? ; CDS list
+SYSI_FCB DD ? ; FCB chain
+SYSI_Keep DW ? ; keep count
+SYSI_NUMIO DB ? ; Number of block devices
+SYSI_NCDS DB ? ; number of CDS's
+SYSI_DEV DD ? ; device list
+SYSI_ATTR DW ? ; null device attribute word
+SYSI_STRAT DW ? ; null device strategy entry point
+SYSI_INTER DW ? ; null device interrupt entry point
+SYSI_NAME DB 8 DUP(?) ; null device name
+SYSI_SPLICE DB 0 ; TRUE -> splicees being done
+SYSI_IBMDOS_SIZE DW ? ; DOS size in paragraphs
+SYSI_IFS_DOSCALL@ DD ? ; IFS DOS service rountine entry
+SYSI_IFS DD ? ; IFS header chain
+SYSI_BUFFERS DW ?,0 ; BUFFERS= values (m,n)
+SYSI_BOOT_DRIVE DB ? ; boot drive A=1 B=2,..
+SYSI_DWMOVE DB 0 ; 1 if 386 machine
+SYSI_EXT_MEM DW 0 ; Extended memory size in KB.
+SysInitVars ENDS
+
+;This is added for more information exchage between DOS, BIOS.
+;DOS will give the pointer to SysInitTable in ES:DI. - J.K. 5/29/86
+SysInitVars_Ext struc
+SYSI_InitVars DD 0 ; Points to the above structure.
+SYSI_Country_Tab DD 0 ; DOS_Country_cdpg_info
+SysInitVars_Ext ends
+
+;The SYSI_BUF of SysInitVars points to the follwong structure
+EMS_MAP_BUFF_SIZE EQU 12 ; EMS map buffer size
+
+Buffinfo STRUC
+Buff_Queue DD ? ; Head of list of buffers
+Dirty_Buff_Count DW ? ; number of dirty buffers in list
+Cache_ptr DD ? ; pointer to secondary cache
+Cache_count DW 0 ; number of secondary cache entries
+
+Buff_In_HMA db 0 ; flag to indicate that buffers
+ ; are in HMA
+Lo_Mem_Buff dd 0 ; Ptr to scratch buff in Low Mem
+ ; used to read/write on disks
+
+;smr; removal of BUFFERFLAG; IF BUFFERFLAG
+
+UU_EMS_FIRST_PAGE DW 0, 0
+UU_EMS_NPA640 DW 0
+
+;smr; removal of BUFFERFLAG; ENDIF
+
+UU_EMS_mode DB -1 ; no EMS = -1
+UU_EMS_handle DW ? ; EMS handle for buffers
+UU_EMS_PageFrame_Number DW -1 ; EMS page frame number
+UU_EMS_Seg_Cnt DW 1 ; EMS segment count
+UU_EMS_Page_Frame DW -1 ; EMS page frame segment address
+UU_EMS_reserved DW 0 ; EMS segment count
+
+;smr; removal of BUFFERFLAG; IF BUFFERFLAG
+UU_EMS_Map_Buff DB 0 ; map buffer
+;smr; removal of BUFFERFLAG; ELSE
+;smr; removal of BUFFERFLAG; EMS_Map_Buff DB 12 dup(0)
+;smr; removal of BUFFERFLAG; ENDIF
+
+Buffinfo ENDS
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/umb.inc b/private/mvdm/dos/v86/inc/umb.inc
new file mode 100644
index 000000000..9070ea782
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/umb.inc
@@ -0,0 +1,64 @@
+;******************************************************************************
+;
+; (C) Copyright MICROSOFT Corp. 1989
+;
+; Module: UMB.INC - Definitions for link umb utility
+;
+; Version: 0.01
+;
+; Date: Jun. 26, 1990
+;
+;
+;******************************************************************************
+;
+; Change log:
+;
+; DATE REVISION DESCRIPTION
+; -------- -------- -------------------------------------------------------
+; 06/26/90 Original
+;
+;******************************************************************************
+
+XMM_MULTIPLEX equ 43h ; XMM multiplex number of INT 2Fh
+XMM_INSTALL_CHECK equ 00h ; install check call
+XMM_FUNCTION_ADDR equ 10h ; get control function address call
+;
+; XMM functions
+;
+XMM_GET_VERSION equ 00h
+XMM_REQUEST_UMB equ 10h
+XMM_RELEASE_UMB equ 11h
+;
+; All error codes has this bit on.
+; Used for test sucess of XMM_QUERY_FREE_EXTMEM
+;
+XMM_ERROR_BIT equ 80h
+
+;
+; Previous HIMEM.SYS versions are not reliable
+;
+GOOD_HIMEM_VERSION equ 208h
+
+
+;** Arena Header
+;
+
+arena STRUC
+arena_signature DB ? ; 4D for valid item, 5A for last item
+arena_owner DW ? ; owner of arena item
+arena_size DW ? ; size in paragraphs of item
+arena_reserved DB 3 DUP(?) ; reserved
+arena_name DB 8 DUP(?) ; owner file name
+arena ENDS
+
+arena_owner_system EQU 0 ; free block indication
+
+arena_signature_normal EQU 4Dh ; valid signature, not end of arena
+arena_signature_end EQU 5Ah ; valid signature, last block in arena
+
+DOS_ARENA EQU 24H ; offset of arena_head var in DOS
+ ; data segment
+UMB_ARENA EQU 8CH ; offset of umb_head in DOS data
+
+.list ; end of UMB.INC
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/vector.inc b/private/mvdm/dos/v86/inc/vector.inc
new file mode 100644
index 000000000..f6537849a
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/vector.inc
@@ -0,0 +1,72 @@
+; SCCSID = @(#)vector.asm 1.1 85/04/10
+BREAK <interrupt definitions>
+
+Asmvar AltVect
+
+INTTAB EQU 20H
+INTBASE EQU 4 * inttab
+ENTRYPOINT EQU INTBASE+40H
+
+ IF ALTVECT
+ALTTAB EQU 0F0H
+ALTBASE EQU 4 * ALTTAB
+ ENDIF
+
+;
+; interrupt assignments
+;
+ IF NOT ALTVECT
+int_abort EQU INTTAB ; abort process
+int_command EQU int_abort+1 ; call MSDOS
+int_terminate EQU int_abort+2 ; int to terminate address
+int_ctrl_c EQU int_abort+3 ; ^c trapper
+int_fatal_abort EQU int_abort+4 ; hard disk error
+int_disk_read EQU int_abort+5 ; logical sector disk read
+int_disk_write EQU int_abort+6 ; logical sector disk write
+int_keep_process EQU int_abort+7 ; terminate program and stay
+ ; resident
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+int_spooler EQU int_abort+8 ; spooler call
+int_fastcon EQU int_abort+9 ; fast CON interrupt
+int_IBM EQU int_abort+10; critical section maintenance
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ ELSE
+int_abort EQU INTTAB ; abort process
+int_command EQU int_abort+1 ; call MSDOS
+int_terminate EQU ALTTAB ; int to terminate address
+int_ctrl_c EQU int_terminate+1 ; ^c trapper
+int_fatal_abort EQU int_terminate+2 ; hard disk error
+int_disk_read EQU int_abort+5 ; logical sector disk read
+int_disk_write EQU int_abort+6 ; logical sector disk write
+int_keep_process EQU int_abort+7 ; terminate program and stay resident
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+int_spooler EQU int_terminate+3 ; spooler call
+int_fastcon EQU int_abort+9 ; fast CON interrupt
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+ ENDIF
+
+addr_int_abort EQU 4 * int_abort
+addr_int_command EQU 4 * int_command
+addr_int_terminate EQU 4 * int_terminate
+addr_int_ctrl_c EQU 4 * int_ctrl_c
+addr_int_fatal_abort EQU 4 * int_fatal_abort
+addr_int_disk_read EQU 4 * int_disk_read
+addr_int_disk_write EQU 4 * int_disk_write
+addr_int_keep_process EQU 4 * int_keep_process
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
+; C A V E A T P R O G R A M M E R ;
+; ;
+addr_int_spooler EQU 4 * int_spooler
+addr_int_fastcon EQU 4 * int_fastcon
+addr_int_IBM EQU 4 * int_IBM
+; ;
+; C A V E A T P R O G R A M M E R ;
+;----+----+----+----+----+----+----+----+----+----+----+----+----+----+----;
diff --git a/private/mvdm/dos/v86/inc/version.inc b/private/mvdm/dos/v86/inc/version.inc
new file mode 100644
index 000000000..5c0ca6935
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/version.inc
@@ -0,0 +1,181 @@
+; Some modules really want TRUE to be 0FFH. Best to let them have their way.
+ifndef TRUE
+ TRUE EQU 0FFFFh
+endif
+ifndef TRUEBYTE
+ TRUEBYTE EQU 0FFh
+endif
+ifndef FALSE
+ FALSE EQU 0
+endif
+
+
+; This flag should be defined to create the ROM executable version of DOS.
+; To build the regular version, it should be UNDEFINED.
+;
+; ROMDOS equ TRUE
+
+; This flag should be defined to enable a special version of the EXEC
+; function that will find and execute ROM executable programs.
+;
+; ROMEXEC equ TRUE
+
+if1
+ ifdef romdos
+ %out ***** BUILDING ROM EXECUTABLE DOS *****
+ endif
+endif
+
+;
+; Use the following switches to control cmacros.inc
+;
+?PLM = 0
+?WIN = 0
+
+memS EQU 1 ; Small model
+;
+; Use the switches below to produce the standard Microsoft version or the IBM
+; version of the operating system
+;
+; The below chart will indicate how to set the switches to build the various
+; versions
+;
+; IBMVER IBMCOPYRIGHT
+; --------------------------------------------------------
+; IBM Version | TRUE TRUE
+; --------------------------------------------------------
+; ISA Version | TRUE FALSE
+; --------------------------------------------------------
+; non ISA Version | FALSE FALSE
+;
+IBMVER EQU TRUE
+IBMCOPYRIGHT EQU FALSE
+
+;smr; removal of bufferflag; BUFFERFLAG EQU NOT IBMCOPYRIGHT
+
+;mw 8/23/90 ; removal of ROMVER, superceded by ROMDOS and ROMEXEC, above...
+; ROMVER EQU FALSE
+
+CPU8086 EQU FALSE
+
+ifndef MSVER
+MSVER EQU NOT IBMVER
+endif
+IBM EQU IBMVER
+;
+;
+ IF1
+ IF IBMVER
+ IF IBMCOPYRIGHT
+ %OUT ... IBM version build switch on ...
+ ELSE
+ ; %OUT ... ISA version build switch on ...
+ ENDIF
+ ELSE
+ IF NOT IBMCOPYRIGHT
+ %OUT ... non ISA version build switch on ...
+ ELSE
+ %OUT !!!!!!!!! VERSION SWITCHES SET INCORECTLY !!!!!!!!!
+ %OUT !!!!!!!!! CHECK SETTINGS IN INC\VERSION.INC !!!!!!!!!
+ ENDIF
+ ENDIF
+ IF CPU8086
+ %OUT !!!!!!! 8080 / 8086 Version !!!!!!!
+ ENDIF
+ ENDIF
+
+;****************************************************************************
+;
+; <<< Followings are the DBCS relating Definition >>>
+;
+;
+; To build DBCS version, Define DBCS by using MASM option via
+; Dos environment.
+;
+; ex. set MASM=-DDBCS
+;
+;
+;
+; To build Country depend version, Define JAPAN, KOREA or TAIWAN
+; by using MASM option via Dos environment.
+;
+; ex. set MASM=-DJAPAN
+; set MASM=-DKOREA
+; set MASM=-DTAIWAN
+;
+;****************************************************************************
+
+
+BUGFIX EQU TRUE
+
+
+IBMJAPVER EQU FALSE ; if TRUE define DBCS also
+IBMJAPAN EQU FALSE ; if TRUE define DBCS also
+
+
+ ifdef TAIWAN
+CSIBIOS EQU FALSE ; BIOS CSI
+CSIDRV EQU TRUE ; Device Drive CSI
+CSITSR EQU FALSE ; TSR CSI
+ else
+CSIBIOS EQU FALSE
+CSIDRV EQU FALSE
+CSITSR EQU FALSE
+ endif
+
+;
+; Set DBCS Blank constant
+;
+ ifndef DBCS
+DB_SPACE EQU 2020h
+DB_SP_HI EQU 20h
+DB_SP_LO EQU 20h
+ else
+
+ ifdef JAPAN
+DB_SPACE EQU 8140h
+DB_SP_HI EQU 81h
+DB_SP_LO EQU 40h
+ endif
+
+ ifdef TAIWAN
+DB_SPACE EQU 8130h
+DB_SP_HI EQU 81h
+DB_SP_LO EQU 30h
+ endif
+
+ ifdef KOREA
+DB_SPACE EQU 0A1A1h
+DB_SP_HI EQU 0A1h
+DB_SP_LO EQU 0A1h
+ endif
+
+ endif
+
+ifndef altvect ; avoid jerking off vector.inc
+ALTVECT EQU FALSE ;Switch to build ALTVECT version
+endif
+
+;
+ IF1
+
+ ifdef DBCS
+%OUT DBCS Version Build Switch ON
+
+ ifdef JAPAN
+%OUT JAPAN Version Build Switch ON
+ endif
+
+ ifdef TAIWAN
+%OUT TAIWAN Version Build Switch ON
+ endif
+
+ ifdef KOREA
+%OUT KOREA Version Build Switch ON
+ endif
+
+ endif
+
+ ENDIF
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/versiona.inc b/private/mvdm/dos/v86/inc/versiona.inc
new file mode 100644
index 000000000..df55ec322
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/versiona.inc
@@ -0,0 +1,26 @@
+
+major_version equ 5 ;Major DOS version
+minor_version equ 00 ;Minor DOS Version for int 21h/30h
+minor_version_NT equ 50 ;Minor DOS VersionN for int 21h/3306
+
+expected_version equ (MINOR_VERSION SHL 8)+MAJOR_VERSION
+
+DOSREVNM equ 00000000B ; bits 0-2 = revision number of DOS
+ ; currently 0.
+DOSINROM equ 00001000B ; bit 3 of ver flags returned in BH
+DOSINHMA equ 00010000B ; bit 4 of ver flags
+
+
+; if1
+; %OUT ... for DOS Version 5.00 ...
+; endif
+
+ ;******************************
+ ;Each assembler program should:
+ ; mov ah,030h ;DOS Get Version function
+ ; int 021h ;Version ret. in AX,minor version first
+ ; cmp ax,expected_version ;ALL utilities should check for an
+ ; jne error_handler ; EXACT version match.
+ ;******************************
+
+
diff --git a/private/mvdm/dos/v86/inc/win386.inc b/private/mvdm/dos/v86/inc/win386.inc
new file mode 100644
index 000000000..e04e6d9d8
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/win386.inc
@@ -0,0 +1,59 @@
+;
+; WIN386.INC
+;
+; Symbols and structures relating to WIN386 support.
+;
+; Used by files in both the DOS and the BIOS.
+;
+; Created: 7-13-89 by MRW
+;
+
+;
+; WIN386 broadcast int 2fh multiplex number and subfunction numbers
+;
+
+MultWin386 equ 16H ; Int 2f multiplex number
+
+Win386_Init equ 05H ; Win386 initialization
+Win386_Exit equ 06H ; Win386 exit
+Win386_Devcall equ 07H ; Win386 device call out
+Win386_InitDone equ 08H ; Win386 initialization is complete
+
+;
+; When Win386_Devcall is broadcast, BX is the Device ID. DOS must
+; answer call outs from the DOSMGR
+;
+
+Win386_DOSMGR equ 15H
+
+;
+; The following structures are used to communicate instance data to
+; Win386 from the DOS and the BIOS. See Win386 API documentation
+; (chapter 3, "Call Out Interfaces") for further description.
+;
+
+Win386_SIS struc ; Startup Info Structure
+SIS_Version db 3, 0
+SIS_Next_Dev_Ptr dd 0 ; pointer to next SIS in list
+SIS_Virt_Dev_File_Ptr dd 0
+SIS_Reference_Data dd 0
+SIS_Instance_Data_Ptr dd 0 ; pointer to instance data array
+Win386_SIS ends
+
+Win386_IIS struc ; Instance Item Structure
+IIS_Ptr dd ? ; pointer to an instance item
+IIS_Size dw ? ; size of an instance item
+Win386_IIS ends
+
+;
+;Win386 DOSMGR function return values to indicate operation done
+;
+
+WIN_OP_DONE equ 0b97cH ;
+DOSMGR_OP_DONE equ 0a2abH ;
+
+;M021
+; WInoldap callout multiplex number
+;
+WINOLDAP equ 46h ;
+
diff --git a/private/mvdm/dos/v86/inc/wpatch.inc b/private/mvdm/dos/v86/inc/wpatch.inc
new file mode 100644
index 000000000..8a0bed4b3
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/wpatch.inc
@@ -0,0 +1,221 @@
+
+
+DOSDATA Segment
+
+;
+; first and second DOS patches
+; Non-console device read/write (system calls 3Fh and 40h)
+;
+; Code in disk.asm, 2 locations, one for read, one for write
+; DVRDLP:
+; DVWRTLP:
+;
+;
+; 036h lds si,SS:[????] ; ThisSFT
+; lds si,si+7 ; sf_devptr
+; 0E8h call ???? <- "simulate" int28 event ; DSKSTATCHK
+;
+;
+DOSP1_ID db 036h,0C5h,036h
+DOSP1_THISSFT db 036h,005h,0C5h,074h,007h,0E8h
+DOSP1_ID_LEN equ $-DOSP1_ID
+
+ db 90h, 90h
+
+DOSP12_ID db 036h,0C5h,036h
+DOSP12_THISSFT db 036h,005h,0C5h,074h,007h,0E8h
+DOSP12_ID_LEN equ $-DOSP1_ID
+
+
+;
+; Third/Fourth DOS patch - System call 3Fh (Read) from console
+;
+; Code in disk.asm, 1 location
+; GETBUF:
+;
+; 051h push cx <- begin special int28 mode
+; push es
+; push di
+; mov dx,???? ; offset dosgroup:CONBUF
+; call ???? ; $STD_CON_STRING_INPUT
+; pop di
+; pop es
+; 059h pop cx <- end special int28 mode
+;
+DOSP3_ID db 051h,006h,057h,0BAh
+DOSP3_CONBUF db 029h,002h,0E8h
+DOSP3_ID_LEN equ $-DOSP3_ID
+ db 09Ah,0E3h,05Fh,007h ; ???? , pop di, pop es
+DOSP4_ID db 059h ; pop cx
+DOSP4_ID_OFF equ (DOSP4_ID - DOSP3_ID)
+
+;
+; Fifth DOS patch - System call 40h (Write) to console
+;
+;
+; Code in disk.asm, 1 location
+;
+; push cx
+; WRCONLP: lodsb
+; cmp al,1Ah
+; jz ????
+; call ???? <- "simulate" int28 event
+; loop WRCONLP
+; CONEOF: pop ax
+;
+DOSP5_ID db 051h ; push cx
+ db 0ACh,03Ch,01Ah,074h,005h
+ db 0E8h ; call
+DOSP5_ID_LEN equ $-DOSP5_ID
+
+;
+; Seventh DOS patch - System call entry, patch USER_ID with VMid for share
+;
+; Code in disp.asm, 1 location
+;
+;
+; mov [SaveDS],ds
+; mov [SaveBX],bx
+; mov bx,cs
+; mov ds,bx
+; inc [indos]
+; xor ax,ax
+; mov [USER_ID],AX <- Patch to set USER_ID to VMID
+;
+;
+DOSP7_ID db 02Eh,08Ch,01Eh
+DOSP7_SAVEDS db 07Eh,05h ; mov [SaveDS],ds
+ db 02Eh,089h,01Eh
+DOSP7_SAVEBX db 07Ch,05h ; mov [SaveBX],bx
+ db 08Ch,0CBh ; mov bx,cs
+ db 08Eh,0DBh ; mov ds,bx
+ db 0FEh,006h
+DOSP7_INDOS db 0CFh,002h ; inc [indos]
+ db 033h,0C0h ; xor ax,ax
+DOSP7_ID_LEN equ $-DOSP7_ID
+
+;
+; Eighth DOS patch - OWNER check in handle calls. For share, need to NOP test
+;
+; Code in handle.asm, 1 location in routine CheckOwner
+;
+;
+;
+; push ax
+; mov ax,ss:[USER_ID] <- patch to XOR AX,AX to set zero
+; cmp ax,es:[di.sf_UID] <- NOP
+; pop ax
+; jz ????
+;
+;
+;
+DOSP8_ID db 050h ; push ax
+ db 036h,0A1h
+DOSP8_USER_ID db 0EAh,002h ; mov ax,ss:[USER_ID]
+ db 026h,03Bh,045h ; cmp ax,es:[di+2F]
+DOSP8_ID_LEN equ $-DOSP8_ID
+ db 02Fh,058h ; pop ax
+
+
+;
+; 10th, 11th, 12th DOS patch - System call 3Fh (Read) in raw mode
+;
+; Take RAW read to STDIN SFT and turn it into a polling loop doing
+; a yeild when a character is not ready to be read.
+;
+; Code in disk.asm, 3 locations
+;
+; DVRDRAW:
+; PUSH ES
+; POP DS
+; ReadRawRetry: <- Patch 10
+; MOV BX,DI
+; XOR AX,AX <- Reenter #2
+; MOV DX,AX
+; call SETREAD
+; PUSH DS <- Reenter #1
+; LDS SI,[THISSFT]
+; call DEVIOCALL
+; MOV DX,DI
+; MOV AH,86H
+; MOV DI,[DEVCALL.REQSTAT]
+; TEST DI,STERR
+; JZ CRDROK
+; call CHARHARD
+; MOV DI,DX
+; OR AL,AL
+; JZ CRDROK
+; CMP AL,3
+; JZ CRDFERR
+; POP DS
+; JMP ReadRawRetry
+;
+; CRDFERR:
+; POP DI <- Patch 11
+; DEVIOFERR:
+; LES DI,[THISSFT]
+; jmp SET_ACC_ERR_DS
+;
+; CRDROK:
+; POP DI <- Patch 12
+; MOV DI,DX
+; ADD DI,[CALLSCNT]
+; JMP SHORT ENDRDDEVJ3
+;
+;
+DOSP10_ID db 006H,01FH
+DOSP10_LOC_OFFSET equ $-DOSP10_ID
+DOSP10_LOC db 08BH,0DFH
+DOSP10_REENT2_OFFSET equ $-DOSP10_LOC
+ db 033H,0C0H,08BH,0D0H,0E8H
+DOSP10_ID_LEN equ $-DOSP10_ID
+ db 0DFH,00EH
+DOSP10_REENT1_OFFSET equ $-DOSP10_LOC
+ db 01EH,036H,0C5H,036H,036H,005H,0E8H,0AFH,00EH
+ db 08BH,0D7H,0B4H,086H,036H,08BH,03EH
+DOSP10_PACKVAL_OFFSET equ $-DOSP10_ID
+ db 009H,003H
+ db 0F7H,0C7H,000H,080H,074H,019H,0E8H,047H,017H
+ db 08BH,0FAH,00AH,0C0H,074H,010H,03CH,003H,074H,003H
+ db 01FH,0EBH,0CFH
+DOSP11_LOC_OFFSET equ $-DOSP10_ID
+ db 05FH
+DOSP11_REENT_OFFSET equ $-DOSP10_LOC
+ db 036H,0C4H,03EH,036H,005H,0E9H,0A1H,004H
+
+DOSP12_LOC_OFFSET equ $-DOSP10_ID
+ db 05FH,08BH,0FAH
+
+
+;
+; 13th DOS patch - Actually a SYSINIT patch. Patches the stack fault code
+; which prints the fatal stack fault error on DOS >= 3.20.
+;
+; Sets focus to current VM so user can see fatal message.
+;
+;
+; l0: lodsb <- Setfocus here
+; cmp al, '$'
+; je l1
+; mov bl, 7
+; mov ah, 0Eh
+; int 10h
+; jmp l0
+; l1: jmp $
+;
+;
+;
+DOSP13_ID db 0ACh ; l0: lodsb
+ db 03Ch,024h ; cmp al, '$'
+ db 074h,008h ; je l1
+ db 0B3h,007h ; mov bl, 7
+ db 0B4h,00Eh ; mov ah, 0Eh
+ db 0CDh,010h ; int 10h
+ db 0EBh,0F3h ; jmp l0
+ db 0EBh,0FEh ; l1: jmp $
+DOSP13_ID_LEN equ $-DOSP13_ID
+
+
+DOSDATA ends
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/xmm.inc b/private/mvdm/dos/v86/inc/xmm.inc
new file mode 100644
index 000000000..5d2d8d62e
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/xmm.inc
@@ -0,0 +1,71 @@
+;******************************************************************************
+;
+; (C) Copyright MICROSOFT Corp. 1989
+;
+; Title: EMM386 - MICROSOFT Expanded Memory Manager 386
+;
+; Module: XMM.INC - Definitions for extended memory manger (XMM)
+;
+; Version: 0.01
+;
+; Date: Feb. 15, 1989
+;
+;
+;******************************************************************************
+;
+; Change log:
+;
+; DATE REVISION DESCRIPTION
+; -------- -------- -------------------------------------------------------
+; 02/15/89 Original
+; 02/19/89 pc add other struct and equ
+;
+;******************************************************************************
+
+XMM_MULTIPLEX equ 43h ; XMM multiplex number of INT 2Fh
+XMM_INSTALL_CHECK equ 00h ; install check call
+XMM_FUNCTION_ADDR equ 10h ; get control function address call
+;
+; XMM functions
+;
+XMM_GET_VERSION equ 00h
+XMM_REQUEST_HMA equ 01h
+XMM_RELEASE_HMA equ 02h
+XMM_GLOBAL_ENABLE_A20 equ 03h
+XMM_GLOBAL_DISABLE_A20 equ 04h
+XMM_LOCAL_ENABLE_A20 equ 05h
+XMM_LOCAL_DISABLE_A20 equ 06h
+XMM_QUERY_A20 equ 07h
+XMM_QUERY_FREE_EXTMEM equ 08h
+XMM_ALLOC_EMB equ 09h
+XMM_FREE_EMB equ 0Ah
+XMM_MOVE_EMB equ 0Bh
+XMM_LOCK_EMB equ 0Ch
+XMM_UNLOCK_EMB equ 0Dh
+XMM_GET_EMB_INFO equ 0Eh
+XMM_REALLOC_EMB equ 0Fh
+XMM_REQUEST_UMB equ 10h
+XMM_RELEASE_UMB equ 11h
+;
+; All error codes has this bit on.
+; Used for test sucess of XMM_QUERY_FREE_EXTMEM
+;
+XMM_ERROR_BIT equ 80h
+
+;
+; Previous HIMEM.SYS versions are not reliable
+;
+GOOD_HIMEM_VERSION equ 208h
+
+;
+; struct pass to XMM_MOVE_EMB in DS:SI
+;
+ExtMemMoveStruct struc
+ mov_length dd ? ; 32 bit number of bytes to transfer
+ src_handle dw ? ; handle of source block
+ src_offset dd ? ; 32 bit offset into source
+ dst_handle dw ? ; handle of destination block
+ dst_offset dd ? ; 32 bit offset into destination
+ExtMemMoveStruct ends
+
+.list ; end of XMM.INC \ No newline at end of file
diff --git a/private/mvdm/dos/v86/inc/yesno.asm b/private/mvdm/dos/v86/inc/yesno.asm
new file mode 100644
index 000000000..58fdf8d29
--- /dev/null
+++ b/private/mvdm/dos/v86/inc/yesno.asm
@@ -0,0 +1,4 @@
+; This is for contry Yes and No
+ PUBLIC NLS_YES,NLS_yes2,NLS_NO,NLS_no2
+include msdos.cl3
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/lib/xmm/makefile b/private/mvdm/dos/v86/lib/xmm/makefile
new file mode 100644
index 000000000..13e678f54
--- /dev/null
+++ b/private/mvdm/dos/v86/lib/xmm/makefile
@@ -0,0 +1,38 @@
+# Makefile for xmm.lib
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 13-Apr-1992 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+include ..\..\make.inc
+doslib =..
+
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(doslib)\xmm.lib
+
+clean: cleanup all
+
+cleanup:
+ if exist *.obj del *.obj
+ if exist *.exe del *.exe
+ if exist *.map del *.map
+ if exist *.sym del *.sym
+ if exist *.lib del *.lib
+
+xmm.obj: xmm.asm \
+ makefile \
+ $(inc)\cmacros.inc
+
+xmm.lib: xmm.obj
+ if exist xmm.lib del xmm.lib
+ lib16 xmm+xmm;
+
+$(doslib)\xmm.lib: xmm.lib
+ copy xmm.lib $(doslib)
diff --git a/private/mvdm/dos/v86/lib/xmm/xmm.asm b/private/mvdm/dos/v86/lib/xmm/xmm.asm
new file mode 100644
index 000000000..99675c327
--- /dev/null
+++ b/private/mvdm/dos/v86/lib/xmm/xmm.asm
@@ -0,0 +1,298 @@
+ TITLE XMM_INTERFACE.ASM
+ NAME XMM_INTERFACE
+
+;*******************************************************************************
+; ;
+; XMM C Interface Routines ;
+; ;
+; Microsoft Confidential
+; Copyright (C) Microsoft Corporation 1988,1991
+; All Rights Reserved.
+; ;
+;*******************************************************************************
+
+?PLM=0
+?WIN=0
+
+include cmacros.inc
+
+sBegin Data
+XMM_Initialised dw 0
+XMM_Control label dword
+ dw CodeOFFSET XMM_NotInitialised
+ dw seg _TEXT
+sEnd Data
+
+sBegin CODE
+assumes cs, CODE
+assumes ds, DGROUP
+
+;
+; Macro to convert from XMS success/fail to
+; a form more acceptable for C. IE.
+;
+; AX == 1 becomes DX:AX = 0
+; AX != 1 becomes DX:AX = BL << 24 | (AX - 1)
+;
+; Since Error Codes returned in BL have the top bit
+; set, C will interpret the return as negative.
+;
+SuccessFail macro
+ local Success
+ xor dx, dx
+ dec ax
+ jz Success
+ mov dh, bl
+Success:
+ endm
+
+;
+; Macro to convert from XMS return value in AX
+; a form more acceptable for C. IE.
+;
+; AX != 0 becomes DX:AX = AX
+; AX == 0 becomes DX:AX = BL << 24 | AX
+;
+; Since Error Codes returned in BL have the top bit
+; set, C will interpret the return as negative.
+; XMS returns of this type return BL == 0 on success.
+;
+SuccessFailAX macro
+ local Success
+ xor dx, dx
+ or ax, ax
+ jnz Success
+ mov dh, bl
+Success:
+ endm
+
+;
+; Macro to convert from XMS return value in DX
+; a form more acceptable for C. IE.
+;
+; AX != 0 becomes DX:AX = DX
+; AX == 0 becomes DX:AX = BL << 24 | DX
+;
+; Since Error Codes returned in BL have the top bit
+; set, C will interpret the return as negative.
+; XMS returns of this type return BL == 0 on success.
+;
+SuccessFailDX macro
+ local Success
+ or ax, ax
+ mov ax, dx
+ mov dx, 0 ; Preserves Flags
+ jnz Success
+ mov dh, bl
+Success:
+ endm
+
+
+cProc XMM_NotInitialised, <FAR>
+cBegin
+ xor ax, ax ; Immediate failure
+ mov bl, 80h ; Not Implemented
+cEnd
+
+cProc XMM_Installed, <NEAR, PUBLIC>, <si, di>
+cBegin
+ cmp [XMM_Initialised], 0
+ jne Already_Initialised
+ mov ax, 4300h ; Test for XMM
+ int 2fh
+ cmp al, 80h
+ jne NoDriver
+
+ mov ax, 4310h ; Get Control Function
+ int 2fh
+ mov word ptr [XMM_Control], bx
+ mov word ptr [XMM_Control+2], es
+ inc [XMM_Initialised]
+NoDriver:
+Already_Initialised:
+ mov ax, [XMM_Initialised]
+cEnd
+
+
+cProc XMM_Version, <NEAR, PUBLIC>, <si, di>
+cBegin
+ xor ah, ah ; Function 0
+ call [XMM_Control]
+ mov dx, bx ; Return a long
+cEnd
+
+
+;
+; long XMM_RequestHMA(Space_Needed: unsigned short);
+;
+cProc XMM_RequestHMA, <NEAR, PUBLIC>, <si, di>
+parmW Space_Needed
+cBegin
+ mov ah, 1
+ mov dx, Space_Needed
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_ReleaseHMA, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 2
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_GlobalEnableA20, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 3
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_GlobalDisableA20, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 4
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_EnableA20, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 5
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_DisableA20, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 6
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_QueryA20, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 7
+ call [XMM_Control]
+ SuccessFailAX
+cEnd
+
+cProc XMM_QueryLargestFree, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 8
+ call [XMM_Control]
+ SuccessFailAX
+cEnd
+
+cProc XMM_QueryTotalFree, <NEAR, PUBLIC>, <si, di>
+cBegin
+ mov ah, 8
+ call [XMM_Control]
+ SuccessFailDX
+cEnd
+
+cProc XMM_AllocateExtended, <NEAR, PUBLIC>, <si, di>
+parmW SizeK
+cBegin
+ mov ah, 9
+ mov dx, SizeK
+ call [XMM_Control]
+ SuccessFailDX
+cEnd
+
+cProc XMM_FreeExtended, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+cBegin
+ mov ah, 0Ah
+ mov dx, Handle
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_MoveExtended, <NEAR, PUBLIC>, <si, di>
+parmW pInfo
+cBegin
+ mov ah, 0Bh
+ mov si, pInfo ; DS:SI => Description
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_LockExtended, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+cBegin
+ mov ah, 0Ch
+ mov dx, Handle
+ call [XMM_Control]
+ xchg ax, bx
+ dec bx
+ jz XMML_Success
+ mov dh, al
+XMML_Success:
+cEnd
+
+cProc XMM_UnLockExtended, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+cBegin
+ mov ah, 0Dh
+ mov dx, Handle
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_GetHandleLength, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+cBegin
+ mov ah, 0Eh
+ mov dx, Handle
+ call [XMM_Control]
+ SuccessFailDX
+cEnd
+
+cProc XMM_GetHandleInfo, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+cBegin
+ mov ah, 0Eh
+ mov dx, Handle
+ call [XMM_Control]
+ mov dx, bx
+ SuccessFailDX
+cEnd
+
+cProc XMM_ReallocateExtended, <NEAR, PUBLIC>, <si, di>
+parmW Handle
+parmW NewSize
+cBegin
+ mov ah, 0Fh
+ mov dx, Handle
+ mov bx, NewSize
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+cProc XMM_RequestUMB, <NEAR, PUBLIC>, <si, di>
+parmW UMBSize
+cBegin
+ mov ah, 10h
+ mov dx, UMBSize
+ call [XMM_Control]
+ xchg bx, ax ; Segment in AX, Size in DX
+ dec bx
+ jz RUMB_Success
+ xchg ax, dx ; Largest available size in AX
+ mov dh, dl ; Error code now in DH
+RUMB_Success:
+cEnd
+
+cProc XMM_ReleaseUMB, <NEAR, PUBLIC>, <si, di>
+parmW UMBSegment
+cBegin
+ mov ah, 11h
+ mov dx, UMBSegment
+ call [XMM_Control]
+ SuccessFail
+cEnd
+
+sEnd CODE
+
+END
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/make.inc b/private/mvdm/dos/v86/make.inc
new file mode 100644
index 000000000..0f132db7b
--- /dev/null
+++ b/private/mvdm/dos/v86/make.inc
@@ -0,0 +1,128 @@
+# Common makefile defines for DOSKRNL (NTIO.SYS and NTDOS.SYS) and utilities
+#
+# Created Sudeepb 20-Mar-1991
+
+
+
+MAKE =nmake
+!IFNDEF COUNTRY
+COUNTRY =usa-ms
+msg =..\..\messages
+!ELSE
+msg = ..\..\messages\$(COUNTRY)
+!ENDIF
+inc =..\..\inc
+cinc =..\..\..\..\inc
+
+
+
+#############################################################################
+# #
+# These are the built in rules and path definitions used by the new MS Make #
+# Utility (NMAKE). The following variables are set externaly (ie set in the #
+# individual makefiles. #
+# #
+# extasw = The 'extra assembly switch' variable is optionaly used in the #
+# makefile to specify special MASM command line switches. #
+# #
+# extcsw = The 'extra C switch' variable is optionaly used in the makefile #
+# to specify special C compiler command line switches. #
+# #
+# inc = The include file search path from the utility being built to the #
+# INC directory. Used if needed. #
+# #
+# hinc = The include file search path from the utility being built to the #
+# H directory. Used if needed for C source compilation. #
+# #
+#############################################################################
+
+########## Definitions for the Assembler #####
+########## awarn can be overridden by placing #####
+########## the new warning level in extasw #####
+########## in the makefile #####
+
+asm =masm
+awarn =-W1
+aflags =-Mx -t $(awarn) $(extasw)
+ainc =-I. -I..\..\inc -I..\..\..\..\inc -I$(msg)
+
+########## Definitions for C compiler #####
+########## cwarn can be overridden by placing #####
+########## the new warning level in extcsw #####
+########## in the makefile #####
+
+cc =cl16
+cwarn =-W3
+cflags =-Os -Zp $(cwarn) $(extcsw)
+incc =-I. -I..\..\h
+
+########## Definitions for linker ##########
+
+link_opts = /MAP
+LINK =link
+exelink =/E
+
+########## Definitions for compress ##########
+
+compress =compress
+
+########## Path definition so we find 16 bit tools ##########
+# Also works around stupid bug in RC 3.1 that doesn't allow rcpp.err to be
+# in a directory that is greater than 128 chars down the path, even if
+# rc 3.1 is running as an OS/2 app.
+
+PATH = $(_NTBINDIR)\private\mvdm\tools16;$(PATH)
+
+########## Built-in rules ##########
+
+.SUFFIXES:
+.SUFFIXES: .c .obj .lst .exe .exc .exs .com .sal .cod .sil .inc .skl .cla .cl1 .ctl .asm .idx .msg
+
+.sal.asm:
+ salut $*.sal,nul,$*.asm
+
+.asm.obj:
+ $(asm) $(ainc) $(aflags) $*.asm;
+
+.asm.lst:
+ $(asm) -l $(ainc) $(aflags) $*.asm;
+
+.c.obj:
+ $(cc) -c $(incc) $(cflags) $*.c
+
+.c.lst:
+ $(cc) -c $(incc) $(cflags) -fc$*.cod -fo$*.obj $*.c
+
+.exs.sys:
+ copy $*.exs $*.exe
+ reloc $* $*.sys
+ del $*.exe
+
+.exc.com:
+ copy $*.exc $*.exe
+ reloc $* $*.com
+ del $*.exe
+
+.exe.com:
+ convert $*.exe
+
+.skl.cl1:
+ nosrvbld $*.skl $(msg)\$(COUNTRY).msg
+
+.skl.ctl:
+ buildmsg $(msg)\$(COUNTRY) $*.skl
+
+.skl.cla:
+ buildmsg $(msg)\$(COUNTRY) $*.skl
+
+.sil.inc:
+ salut $*.sil,nul,$*.inc
+
+.sal.obj:
+ salut $*.sal,nul,$*.asm
+ $(asm) $(aflags) $(ainc) $*.asm,$*.obj;
+
+.msg.idx:
+ chmode -r $*.msg
+ buildidx $*.msg
+ chmode +r $*.msg
diff --git a/private/mvdm/dos/v86/makefile b/private/mvdm/dos/v86/makefile
new file mode 100644
index 000000000..dbe8581e9
--- /dev/null
+++ b/private/mvdm/dos/v86/makefile
@@ -0,0 +1,34 @@
+# V86 root-level makefile
+#
+# Copyright (c) 1991, Microsoft Corporation
+#
+# History:
+# 22-Apr-1991 Sudeep Bharati (sudeepb)
+# Created.
+#
+
+all:
+ cd doskrnl
+ $(MAKE)
+ cd ..\dev
+ $(MAKE)
+ cd ..\lib\xmm
+ $(MAKE)
+ cd ..\..\cmd
+ $(MAKE)
+ cd ..\redir
+ $(MAKE)
+ cd ..
+
+clean:
+ cd doskrnl
+ $(MAKE) clean
+ cd ..\dev
+ $(MAKE) clean
+ cd ..\lib\xmm
+ $(MAKE) clean
+ cd ..\..\cmd
+ $(MAKE) clean
+ cd ..\redir
+ $(MAKE) clean
+ cd ..
diff --git a/private/mvdm/dos/v86/messages/comimsg.inc b/private/mvdm/dos/v86/messages/comimsg.inc
new file mode 100644
index 000000000..8173fc04b
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/comimsg.inc
@@ -0,0 +1,29 @@
+; Command.com initialization messages.
+;
+; See resmsg.equ for macro definition.
+
+ msg BadVerMsg, <"Incorrect DOS version",CR,LF>
+ msg OutEnvMsg, <"Out of environment space",CR,LF>
+ msg CopyrightMsg,<"Microsoft(R) Windows NT DOS",CR,LF,"(C)Copyright Microsoft Corp 1990-1996.",CR,LF>
+ msg BadComLkMsg, <"Specified COMMAND search directory bad",CR,LF>
+ msg BadComAccMsg,<"Specified COMMAND search directory bad access denied",CR,LF>
+
+ msg Help1Msg <"Starts a new instance of the MS-DOS command interpreter.",CR,LF,CR,LF>
+ msg Help2Msg <"COMMAND [[drive:]path] [device] [/E:nnnnn] [/P] [/C string] [/MSG]",CR,LF,CR,LF>
+ msg Help3Msg <" [drive:]path Specifies the directory containing COMMAND.COM file.",CR,LF>
+ msg Help4Msg <" device Specifies the device to use for command input and output.",CR,LF>
+ msg Help5Msg <" /E:nnnnn Sets the initial environment size to nnnnn bytes.",CR,LF>
+ msg Help6Msg <" /P Makes the new command interpreter permanent (can't exit).",CR,LF>
+ msg Help7Msg <" /C string Carries out the command specified by string, and then stops.",CR,LF>
+ msg Help8Msg <" /MSG Specifies that all error messages be stored in memory. You",CR,LF>
+ msg Help9Msg <" need to specify /P with this switch.",CR,LF>
+
+HelpMsgs dw RESGROUP:Help1Msg,RESGROUP:Help2Msg
+ dw RESGROUP:Help3Msg,RESGROUP:Help4Msg
+ dw RESGROUP:Help5Msg,RESGROUP:Help6Msg
+ dw RESGROUP:Help7Msg,RESGROUP:Help8Msg
+ dw RESGROUP:Help9Msg,0
+
+ public HelpMsgs
+
+
diff --git a/private/mvdm/dos/v86/messages/comrmsg.inc b/private/mvdm/dos/v86/messages/comrmsg.inc
new file mode 100644
index 000000000..2408533fc
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/comrmsg.inc
@@ -0,0 +1,191 @@
+;*** Translateable text for command.com resident data.
+
+
+;* Input characters for critical error "Abort, Retry, Fail, Ignore?"
+; and Yes/No.
+
+Abort_Char db "A"
+Retry_Char db "R"
+Ignore_Char db "I"
+Fail_Char db "F"
+Yes_Char db "Y"
+No_Char db "N"
+
+
+;* MESSAGES
+;
+; See resmsg.equ for macro definition.
+
+
+;* Local messages.
+
+ msg Req_Abort, <"Abort">
+ msg Req_Retry, <", Retry">
+ msg Req_Ignore,<", Ignore">
+ msg Req_Fail, <", Fail">
+ msg Req_End, <"?">
+ msg MRead, <"reading",0>
+ msg MWrite, <"writing",0>
+ msg BlkDevErr, <" %1 drive %2",CR,LF>
+ msg CharDevErr,<" %1 device %2",CR,LF>
+ msg NeedVolMsg,<"Please insert volume %1 serial %2-%3",CR,LF>
+ msg BadFatMsg, <"File allocation table bad, drive %1",CR,LF>
+ msg ComBad, <"Invalid COMMAND.COM",CR,LF>
+ msg PutBackMsg,<"Insert disk with %1 in drive %2",CR,LF>
+ msg Prompt, <"Press any key to continue . . .",CR,LF>
+ msg EndBatMes, <CR,LF,"Terminate batch job (Y/N)?">
+ msg ExecEMes, <"Cannot execute %1",CR,LF>
+ msg ExeBad, <"Error in EXE file",CR,LF>
+ msg TooBig, <"Program too big to fit in memory",CR,LF>
+ msg NoHandMes, <CR,LF,"No free file handles">
+ msg RBadNam, <"Bad Command or file name",CR,LF>
+ msg AccDen, <"Access denied ">
+ msg BMemMes, <CR,LF,"Memory allocation error">
+ msg HaltMes, <CR,LF,"Cannot load COMMAND, system halted",CR,LF>
+ msg FRetMes, <CR,LF,"Cannot start COMMAND, exiting",CR,LF>
+ msg Patricide, <CR,LF,"Top level process aborted, cannot continue",CR,LF>
+ msg Newlin, <CR,LF>
+
+;* Ptrs to message lists.
+; Segment portion is 1, signalling message services to call retriever.
+
+MsgPtrLists label dword
+ dw DATARES:ExtMsgPtrs,1 ; extended error messages
+ dw DATARES:ParsMsgPtrs,1 ; parse error messages
+ dw DATARES:ExtMsgPtrs,1 ; critical error messages -
+ ; use extended error list
+ dw 0,0 ; file system error messages - none
+ dw DATARES:MsgRetrv_Trap ; address of message retriever
+MySeg3 dw ? ; (segment filled in during init)
+
+
+
+;* Critical error messages.
+
+ msg ExtErr19,<"Write protect error">
+ msg ExtErr20,<"Invalid unit">
+ msg ExtErr21,<"Not ready">
+ msg ExtErr22,<"Invalid device request">
+ msg ExtErr23,<"Data error">
+ msg ExtErr24,<"Invalid device request parameters">
+ msg ExtErr25,<"Seek error">
+ msg ExtErr26,<"Invalid media type">
+ msg ExtErr27,<"Sector not found">
+ msg ExtErr28,<"Printer out of paper error">
+ msg ExtErr29,<"Write fault error">
+ msg ExtErr30,<"Read fault error">
+ msg ExtErr31,<"General failure">
+ msg ExtErr32,<"Sharing violation">
+ msg ExtErr33,<"Lock violation">
+ msg ExtErr34,<"Invalid disk change">
+ msg ExtErr35,<"FCB unavailable">
+ msg ExtErr36,<"System resource exhausted">
+ msg ExtErr37,<"Code page mismatch">
+ msg ExtErr38,<"Out of input">
+ msg ExtErr39,<"Insufficient disk space">
+
+; List of ptrs to critical error messages.
+; Code assumes extended error number order, beginning
+; with extended error number 19.
+
+CritMsgPtrs label word
+ dw DATARES:ExtErr19,DATARES:ExtErr20,DATARES:ExtErr21,DATARES:ExtErr22,DATARES:ExtErr23,DATARES:ExtErr24
+ dw DATARES:ExtErr25,DATARES:ExtErr26,DATARES:ExtErr27,DATARES:ExtErr28,DATARES:ExtErr29,DATARES:ExtErr30
+ dw DATARES:ExtErr31,DATARES:ExtErr32,DATARES:ExtErr33,DATARES:ExtErr34,DATARES:ExtErr35,DATARES:ExtErr36
+ dw DATARES:ExtErr37,DATARES:ExtErr38,DATARES:ExtErr39
+
+DataResEnd label byte ; end of resident portion if /msg not used
+
+
+
+;* Parse error messages.
+
+ msg ParsErr01,<"Too many parameters">
+ msg ParsErr02,<"Required parameter missing">
+ msg ParsErr03,<"Invalid switch">
+ msg ParsErr04,<"Invalid keyword">
+ msg ParsErr05,<" ">
+ msg ParsErr06,<"Parameter value not in allowed range">
+ msg ParsErr07,<"Parameter value not allowed">
+ msg ParsErr08,<"Parameter value not allowed">
+ msg ParsErr09,<"Parameter format not correct">
+ msg ParsErr10,<"Invalid parameter">
+ msg ParsErr11,<"Invalid parameter combination">
+
+; List of ptrs to parse error messages.
+; In order, beginning with parse error number 1.
+
+ParsMsgPtrs label word
+ dw DATARES:ParsErr01,DATARES:ParsErr02,DATARES:ParsErr03
+ dw DATARES:ParsErr04,DATARES:ParsErr05,DATARES:ParsErr06
+ dw DATARES:ParsErr07,DATARES:ParsErr08,DATARES:ParsErr09
+ dw DATARES:ParsErr10,DATARES:ParsErr11
+
+NUMPARSMSGS equ ($ - ParsMsgPtrs) / 2 ;M033
+
+
+;* Extended error messages.
+
+ msg ExtErr01,<"Invalid function">
+ msg ExtErr02,<"File not found">
+ msg ExtErr03,<"Path not found">
+ msg ExtErr04,<"Too many open files">
+ msg ExtErr05,<"Access denied ">
+ msg ExtErr06,<"Invalid handle">
+ msg ExtErr07,<"Memory control blocks destroyed">
+ msg ExtErr08,<"Insufficient memory">
+ msg ExtErr09,<"Invalid memory block address">
+ msg ExtErr10,<"Invalid Environment">
+ msg ExtErr11,<"Invalid format">
+ msg ExtErr12,<"Invalid function parameter">
+ msg ExtErr13,<"Invalid data">
+
+ msg ExtErr15,<"Invalid drive specification">
+ msg ExtErr16,<"Attempt to remove current directory">
+ msg ExtErr17,<"Not same device">
+ msg ExtErr18,<"No more files">
+
+ msg ExtErr80,<"File exists">
+
+ msg ExtErr82,<"Cannot make directory entry">
+ msg ExtErr83,<"Fail on INT 24">
+ msg ExtErr84,<"Too many redirections">
+ msg ExtErr85,<"Duplicate redirection">
+ msg ExtErr86,<"Invalid password">
+ msg ExtErr87,<"Invalid parameter">
+ msg ExtErr88,<"Network data fault">
+ msg ExtErr89,<"Function not supported by network">
+ msg ExtErr90,<"Required system component not installed">
+
+; List of ptrs to extended error messages.
+; In order, beginning with extended error number 1.
+; Critical error messages are included here, as well as in the
+; critical error message list.
+; Error numbers without messages are included as null ptrs.
+
+ExtMsgPtrs label word
+ dw DATARES:ExtErr01,DATARES:ExtErr02,DATARES:ExtErr03
+ dw DATARES:ExtErr04,DATARES:ExtErr05,DATARES:ExtErr06
+ dw DATARES:ExtErr07,DATARES:ExtErr08,DATARES:ExtErr09
+ dw DATARES:ExtErr10,DATARES:ExtErr11,DATARES:ExtErr12
+ dw DATARES:ExtErr13,0, DATARES:ExtErr15
+ dw DATARES:ExtErr16,DATARES:ExtErr17,DATARES:ExtErr18
+ dw DATARES:ExtErr19,DATARES:ExtErr20,DATARES:ExtErr21
+ dw DATARES:ExtErr22,DATARES:ExtErr23,DATARES:ExtErr24
+ dw DATARES:ExtErr25,DATARES:ExtErr26,DATARES:ExtErr27
+ dw DATARES:ExtErr28,DATARES:ExtErr29,DATARES:ExtErr30
+ dw DATARES:ExtErr31,DATARES:ExtErr32,DATARES:ExtErr33
+ dw DATARES:ExtErr34,DATARES:ExtErr35,DATARES:ExtErr36
+ dw DATARES:ExtErr37,DATARES:ExtErr38,DATARES:ExtErr39
+ dw 80-40 dup (0) ; null ptrs for errors 40-79
+ dw DATARES:ExtErr80,0, DATARES:ExtErr82
+ dw DATARES:ExtErr83,DATARES:ExtErr84,DATARES:ExtErr85
+ dw DATARES:ExtErr86,DATARES:ExtErr87,DATARES:ExtErr88
+ dw DATARES:ExtErr89,DATARES:ExtErr90
+ExtMsgPtrsEnd label word
+
+NUMEXTMSGS equ ($ - ExtMsgPtrs) / 2 ;M033
+
+ExtMsgEnd label byte ; end of extended error messages
+ ; = end of resident if /msg is used
+
diff --git a/private/mvdm/dos/v86/messages/denmark.msg b/private/mvdm/dos/v86/messages/denmark.msg
new file mode 100644
index 000000000..8cabcc6fa
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/denmark.msg
@@ -0,0 +1,1132 @@
+0007
+COMMON 0006 0038
+0001 T 0000 "Forkert DOS-version",CR,LF
+0002 T 0000 "%1 er allerede installeret",CR,LF
+0003 T 0000 "%1 bytes til r†dighed p† disken",CR,LF
+0004 T 0000 "%1 bytes ubenyttet",CR,LF
+0005 T 0000 "%1 bytes i uanvendelige sektorer",CR,LF
+0006 T 0000 "%1 bytes totalt p† disken",CR,LF
+0007 T 0000 "%1 bytes totalt internt lager",CR,LF
+0008 T 0000 "%1 bytes anvendes af DOS-systemet",CR,LF
+0009 T 0000 "%1 er installeret",CR,LF
+0010 T 0000 "%1 er ikke installeret",CR,LF
+0011 T 0000 "%1 er ikke installeret",CR,LF
+0012 T 0000 "%1 kan ikke anvendes p† et netv‘rksdrev",CR,LF
+0013 T 0000 "",
+0014 T 0000 "%1 kan ikke anvendes. ASSIGN eller SUBST er anvendt p† dette drev",CR,LF
+0015 T 0000 "%1 kan ikke udf›res",CR,LF
+0016 T 0000 "Udvidet internt lager kan ikke anvendes",CR,LF
+0017 T 0000 "Filallokeringstabel er beskadiget p† drev %1",CR,LF
+0018 T 0000 "Filen kan ikke kopieres til sig selv",CR,LF
+0019 T 0000 "S‘t disketten, der skal kopieres til, i drev %1",CR,LF
+0020 T 0000 "For lidt plads p† disken",CR,LF
+0021 T 0000 "Disknavnet indeholder forkerte tegn",CR,LF
+0022 T 0000 "Der er angivet en forkert tegntabel",CR,LF
+0023 T 0000 "Forkert dato",CR,LF
+0024 T 0000 "Forkert klokkesl‘t",CR,LF
+0025 T 0000 "Forkert sti",CR,LF
+0026 T 0000 "Disken, der skal kopieres fra, er ikke angivet",CR,LF
+0027 T 0000 "Disken, der skal kopieres til, er ikke angivet",CR,LF
+0028 T 0000 "Tryk p† Enter for at forts‘tte",CR,LF
+0029 T 0000 "Filerne, der skal kopieres, skal angives",CR,LF
+0030 T 0000 "DOS er installeret",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Det er ikke muligt at oprette bibliotek",CR,LF
+0033 T 0000 "Disken i drev %1 har intet navn",CR,LF
+0034 T 0000 "Disken i drev %1 er %2",CR,LF
+0035 T 0001 "Angiv et disknavn p† op til 11 tegn "
+0036 T 0000 "Diskens serienummer er %1-%2",CR,LF
+0037 T 0000 "Filen har en forkert type",CR,LF
+0038 T 0001 CR,LF
+EXTEND 076e 0089
+0001 T 0000 "Forkert funktion",CR,LF
+0002 T 0000 "Filen er ikke fundet",CR,LF
+0003 T 0000 "Stien er ikke fundet",CR,LF
+0004 T 0000 "For mange filer er †bne",CR,LF
+0005 T 0000 "Adgang n‘gtet",CR,LF
+0006 T 0000 "Forkert filhenvisning",CR,LF
+0007 T 0000 "Styreblokke i det interne lager er ›delagt",CR,LF
+0008 T 0000 "For lidt internt lager",CR,LF
+0009 T 0000 "Forkert blokadresse i internt lager",CR,LF
+0010 T 0000 "Forkert milj›",CR,LF
+0011 T 0000 "Forkert format",CR,LF
+0012 T 0000 "Forkert funktionsparameter",CR,LF
+0013 T 0000 "Forkerte data",CR,LF
+0014 T 0000 "",
+0015 T 0000 "Forkert angivelse af drev",CR,LF
+0016 T 0000 "Det aktive bibliotek kan ikke fjernes",CR,LF
+0017 T 0000 "Ikke samme udstyr",CR,LF
+0018 T 0000 "Ikke flere filer",CR,LF
+0019 T 0000 "Skrivebeskyttelsesfejl",CR,LF
+0020 T 0000 "Forkert udstyr",CR,LF
+0021 T 0000 "Ikke klar",CR,LF
+0022 T 0000 "Forkert udstyrskommando",CR,LF
+0023 T 0000 "Datafejl",CR,LF
+0024 T 0000 "Forkerte parametre i udstyrskommando",CR,LF
+0025 T 0000 "S›gefejl",CR,LF
+0026 T 0000 "Forkert disktype",CR,LF
+0027 T 0000 "Sektor er ikke fundet",CR,LF
+0028 T 0000 "Fejl - der er ikke mere papir i printeren",CR,LF
+0029 T 0000 "Skrivefejl",CR,LF
+0030 T 0000 "L‘sefejl",CR,LF
+0031 T 0000 "Generel fejl.$",CR,LF
+0032 T 0000 "Filen er i brug.$",CR,LF
+0033 T 0000 "Filen er l†st.$",CR,LF
+0034 T 0000 "Forkert diskette er indsat.$",CR,LF
+0035 T 0000 "FCB er ikke tilg‘ngelig.$",CR,LF
+0036 T 0000 "Systemets ressourcer er opbrugt",CR,LF
+0037 T 0000 "Tegntabellerne kan ikke angives sammen",CR,LF
+0038 T 0000 "Der mangler input",CR,LF
+0039 T 0000 "For lidt plads p† disken",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 T 0000 "Filsystemet accepterer ikke kommandoen",CR,LF
+0051 T 0000 "Der kan ikke oprettes forbindelse til filsystemet",CR,LF
+0052 T 0000 "Filsystemnavnet findes allerede",CR,LF
+0053 T 0000 "Filsystemnavnet er ikke fundet",CR,LF
+0054 T 0000 "Filsystemet er optaget",CR,LF
+0055 T 0000 "Filsystemudstyret findes ikke l‘ngere",CR,LF
+0056 T 0000 "Filsystemets ressourcer er opbrugt",CR,LF
+0057 T 0000 "Der er opst†et en udstyrsfejl i filsystemet",CR,LF
+0058 T 0000 "Filsystemet gav et forkert svar",CR,LF
+0059 T 0000 "Der er opst†et en fejl i filsystemet",CR,LF
+0060 T 0000 "Filsystemet er ikke kompatibelt",CR,LF
+0061 U 0000 "Device output file limit exceeded",CR,LF
+0062 U 0000 "Device output file space limit exceeded",CR,LF
+0063 U 0000 "Device output file no longer exists",CR,LF
+0064 T 0000 "Filsystemnavnet findes ikke l‘ngere",CR,LF
+0065 T 0000 "Adgang n‘gtet af filsystemet",CR,LF
+0066 T 0000 "Udstyrstypen i FILESYS-kommandoen er forkert",CR,LF
+0067 T 0000 "Filsystemet er ikke fundet",CR,LF
+0068 T 0000 "Filsystemets ressourcer er opbrugt",CR,LF
+0069 T 0000 "Filsystemets ressourcer er opbrugt",CR,LF
+0070 T 0000 "Filsystemets udstyr kan ikke anvendes i ›jeblikket",CR,LF
+0071 T 0000 "Foresp›rgsel fra filsystemet er ikke accepteret",CR,LF
+0072 T 0000 "Filsystemets udstyr er inaktivt",CR,LF
+0073 T 0001 "Komponent i filsystemet er ikke til r†dighed",CR,LF
+0074 T 0001 "Der opstod en fejl i filsystemet",CR,LF
+0075 T 0001 "Der opstod en fejl i filsystemet",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0000 "Filen findes i forvejen",CR,LF
+0081 T 0000 "",
+0082 T 0000 "Biblioteksregistrering kan ikke oprettes",CR,LF
+0083 U 0000 "Fail requested to Critical Error",CR,LF
+0084 T 0000 "For mange forbindelser",CR,LF
+0085 T 0000 "Udstyr eller fil er allerede forbundet",CR,LF
+0086 T 0000 "Forkert kodeord",CR,LF
+0087 T 0000 "Forkert parameter",CR,LF
+0088 T 0000 "Datafejl i filsystem",CR,LF
+0089 T 0000 "Funktionen kan ikke anvendes af filsystemet",CR,LF
+PARSE 168e 0011
+0001 T 0000 "For mange parametre",CR,LF
+0002 T 0000 "N›dvendig parameter mangler",CR,LF
+0003 T 0000 "Forkert parameterv‘rdi",CR,LF
+0004 T 0000 "Forkert n›gleord",CR,LF
+0005 T 0000 "",
+0006 T 0000 "Parameterv‘rdien er uden for det tilladte interval",CR,LF
+0007 T 0000 "Parameterv‘rdien accepteres ikke",CR,LF
+0008 T 0000 "Parameterv‘rdien accepteres ikke",CR,LF
+0009 T 0000 "Parameterformatet er forkert",CR,LF
+0010 T 0000 "Forkert parameter",CR,LF
+0011 T 0000 "Forkert kombination af parametre",CR,LF
+IBMBIO 18a2 0018
+0003 T 0000 13,10,"Ukendt kommando i CONFIG.SYS"
+0004 T 0000 13,10,"$"
+0005 T 0000 13,10,"Sektorst›rrelsen er for stor i filen $"
+0006 T 0000 13,10,"Forkert eller manglende $"
+0007 T 0000 "kommandofortolker",0
+0008 T 0000 13,10,"Forkert landekode eller tegntabel",13,10,"$"
+0009 T 0000 13,10,"Fejl i COUNTRY-kommando",13,10,"$"
+0010 T 0000 13,10, "Ikke tilstr‘kkeligt internt lager til filen COUNTRY.SYS",13,10,"$"
+0011 T 0000 13,10,"Ikke tilstr‘kkeligt internt lager til konfigurationen",13,10,"$"
+0012 T 0000 13,10,"For mange blokenheder",13,10,"$"
+0013 T 0000 13,10,"Forkerte STACK-parametre",13,10,"$"
+0014 T 0000 13,10,"Forkert r‘kkef›lge i linie "," i CONFIG.SYS$"
+0015 T 0000 "Fejl i linie "," i CONFIG.SYS$"
+0016 T 0000 13,10,"Fejl ved tildeling af internt lager$"
+0017 T 0001 0DH,0AH,7,0DH,0AH, "Overl›b i den interne stak.",0DH,0AH
+ "DOS-systemet er stoppet",0DH,0AH,"$"
+0020 T 0000 13,10,"S‘t disketten i drev "
+0021 T 0000 "A:",13,10,"Tryk p† Enter for at forts‘tte",13,10,10,0
+0022 T 0000 13,10,"Forkert kommando eller parameter - $"
+BOOT 1ce0 0001
+0001 T 0000 13,10,"Diskfejl eller manglende DOS",13,10
+ "Anvend DOS-disk, og tryk p† Enter",13,10,0
+DBCSDOS 1d5a 0000
+IBMDOS 1d6e 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1dad 0091
+0201 T 0000 "A" ;AC000;
+0202 T 0000 "G" ;AC000;
+0203 T 0000 "I" ;AC000;
+0204 T 0000 "F" ;AC000;
+0205 T 0000 "J" ;AC000;
+0206 T 0000 "N" ;AC000;
+0210 T 0000 "Afbryd" ;AC000;
+0211 T 0000 ", Gentag" ;AC000;
+0212 T 0000 ", Ignorer" ;AC000;
+0213 T 0000 ", Fejlmeld$" ;AC000;
+0214 T 0000 "?" ;AC000;
+0215 T 0000 "ved l‘sning fra",0 ;AC000;
+0216 T 0000 "ved skrivning p†",0 ;AC000;
+0217 T 0000 "%1 drev %2",CR,LF ;AC000;
+0218 T 0000 "%1 udstyr %2",CR,LF ;AC000;
+0219 T 0000 "S‘t disk %1, serienr. %2-%3",CR,LF ;AC009;
+0221 T 0000 "Forkert COMMAND.COM",CR,LF ;AC000;
+0222 T 0000 "S‘t diskette med %1 i drev %2",CR,LF ;AC000;
+0224 T 0000 CR,LF,"Afbryd kommandofil (J/N)?" ;AC000;
+0225 T 0000 "Kan ikke udf›re %1",CR,LF ;AC000;
+0226 T 0000 "Fejl i EXE-filen",CR,LF ;AC000;
+0227 T 0000 "For lidt internt lager",CR,LF ;AC000;
+0228 T 0000 CR,LF,"Det maksimale antal filer er i brug" ;AC000;
+0229 T 0000 "Forkert kommando eller filnavn",CR,LF ;AC000;
+0231 T 0000 CR,LF,"Fejl ved tildeling af internt lager$" ;AC000;
+0232 T 0000 CR,LF,"Kan ikke indl‘se COMMAND.COM. DOS er standset$",CR,LF;AC000;
+0233 T 0000 CR,LF,"Kan ikke starte COMMAND.COM. DOS er afsluttet",CR,LF ;AC000;
+0234 T 0000 CR,LF,"DOS afsluttes, kan ikke forts‘tte$",CR,LF;AC000;
+0235 T 0000 CR,LF ;AC000;
+0463 T 0000 "Der er ikke mere plads i parameterblokken",CR,LF ;AC000;
+0464 T 0000 CR,LF,"IBM Personal Computer DOS version 3.40",CR,LF
+ "(c) Copyright International Business Machines Corp. 1981,1988",CR,LF
+ "(c) Copyright Microsoft Corp. 1981, 1986",CR,LF ;AC000;
+0465 T 0000 "Angivet s›gesti for COMMAND.COM er forkert",CR,LF
+0466 T 0000 "Angivet s›gesti for COMMAND.COM er forkert. Adgang n‘gtet",CR,LF
+1002 T 0000 "Ens filnavne eller filen er ikke fundet",CR,LF ;AC000;
+1003 T 0000 "Forkert sti eller filen er ikke fundet",CR,LF ;AC000;
+1007 T 0000 "Der er ikke mere plads i parameterblokken",CR,LF ;AC000;
+1008 T 0000 "Fejl ved oprettelse af fil",CR,LF ;AC000;
+1009 T 0000 "Kommandofilen mangler",CR,LF ;AC000;
+1010 T 0000 CR,LF,"Inds‘t en diskette med kommandofilen",CR,LF ;AC000;
+1011 T 0000 "Forkert kommando eller filnavn",CR,LF ;AC000;
+1016 T 0000 "Det nuv‘rende indhold af filen, der kopieres til, mistes",CR,LF ;AC000;
+1017 T 0000 "Forkert filnavn eller filen er ikke fundet",CR,LF ;AC000;
+1018 T 0000 "Antal filer kopieret: %1",CR,LF ;AC000;
+1019 T 0000 "%1 fil(er) " ;AC000;
+1022 T 0000 "Tegntabellen %1 er ikke klargjort til brug",CR,LF ;AC000;
+1023 T 0000 "Tegntabellen %1 er ikke klargjort til brug for alt udstyr",CR,LF ;AC000;
+1024 T 0000 "Aktiv tegntabel: %1",CR,LF ;AC000;
+1025 T 0000 "NLSFUNC er ikke installeret",CR,LF ;AC000;
+1027 T 0000 "Det aktive drev er ikke l‘ngere gyldigt" ;AC000;
+1029 T 0000 "Programm‘rke er ikke fundet",CR,LF ;AC000;
+1030 T 0000 "Syntaksfejl",CR,LF ;AC000;
+1032 T 0000 "Datoen er angivet til %1 %2",CR,LF ;AC000;
+1033 T 0000 "S›nManTirOnsTorFreL›r" ;AC000;
+1034 T 0000 "Angiv ny dato (%1): "
+1036 T 0000 "Klokken er angivet til %1",CR,LF ;AC000;
+1037 T 0000 "Angiv nyt klokkesl‘t: "
+1038 T 0000 ", Slet (J/N)?" ;AC000;
+1039 T 0000 "Alle filerne i biblioteket vil blive slettet!",CR,LF
+ "Er det i orden (J/N)?" ;AC000;
+1040 T 0000 "IBM Personal Computer DOS version %1.%2",CR,LF ;AC000;
+1044 T 0000 "Forkert bibliotek",CR,LF ;AC000;
+1046 T 0000 "Forkert sti, ikke et bibliotek eller biblioteket er ikke tomt",CR,LF ;AC000;
+1047 T 0000 "ON eller OFF skal angives",CR,LF ;AC000;
+1048 T 0000 "Indhold af %1",CR,LF ;AC000;
+1049 T 0000 "Ingen sti er defineret",CR,LF ;AC000;
+1050 T 0000 "Forkert drev i s›gestien",CR,LF ;AC000;
+1051 T 0000 "Forkert udstyr",CR,LF ;AC000;
+1052 T 0000 "FOR kan ikke anvendes i en FOR-struktur",CR,LF ;AC000;
+1053 T 0000 "Fejl i midlertidig fil ved I/O-overf›rsel",CR,LF ;AC000;
+1054 T 0000 "Kan ikke l‘se bin‘rt fra udstyret",CR,LF ;AC000;
+1055 T 0000 "BREAK er %1 ",CR,LF ;AC000;
+1056 T 0000 "VERIFY er %1 ",CR,LF ;AC000;
+1057 T 0000 "ECHO er %1 ",CR,LF ;AC000;
+1059 T 0000 "OFF",0 ;AC000;
+1060 T 0000 "ON",0 ;AC000;
+1061 T 0000 "Fejl ved skrivning til udstyr",CR,LF ;AC000;
+1063 T 0000 "%1" ;AC000;
+1064 T 0000 "%1" ;AC000;
+1065 T 0000 "%1" ;AC000;
+1066 T 0000 "%1" ;AC000;
+1067 T 0000 9 ;AC000;
+1068 T 0000 " <DIR> " ;AC000;
+1069 T 0000 8," ",8 ;AC000;
+1070 T 0000 CR,LF ;AC000;
+1071 T 0000 "%1" ;AC000;
+1072 T 0000 "mm-dd-††" ;AC000;
+1073 T 0000 "dd-mm-††" ;AC000;
+1074 T 0000 "††-mm-dd" ;AC000;
+1075 T 0000 "%1 %2" ;AC000;
+1076 T 0000 "%1" ;AC000;
+1077 T 0001 " %1 %2" ;AC000;
+1078 T 0000 "Biblioteket findes allerede",CR,LF ;AC000;
+ATTRIB 3502 0016
+0004 T 0000 "Forkert antal parametre",CR,LF
+0005 T 0000 "Forkert sti eller filen er ikke fundet",CR,LF
+0006 T 0000 "Syntaksfejl",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 T 0000 "%1, tegntabeller stemmer ikke overens",CR,LF,"Er det sikkert (J/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 T 0000 "Filens type er angivet forkert",CR,LF
+0199 T 0000 "Fejl ved udvidet attribut",CR,LF
+0201 T 0000 "Udvidet attributnavn er ikke fundet",CR,LF
+0204 T 0000 "Udvidet attributnavn kan ikke defineres",CR,LF
+0205 T 0000 "Udvidet attributnavn kendes af filsystemet men accepteres ikke",CR,LF
+0206 T 0000 "Udvidet attributtype stemmer ikke overens",CR,LF
+0208 T 0000 "Udvidet attributv‘rdi accepteres ikke",CR,LF
+ASSIGN 381a 0001
+0002 T 0000 "Det oprindelige drev %1: er defineret til %2:",cr,lf
+CHKDSK 3871 0063
+0003 T 0000 "Konvert‚r de tabte k‘der til filer (J/N)?" ;freemes
+0004 T 0000 "Fejl i biblioteket" ;ptrandir
+0005 T 0000 "Konvert‚r biblioteket til en fil (J/N)?" ;ptrandir2
+0007 T 0000 "%1 bytes totalt p† disken" ;dskspc
+0008 T 0000 "%1 bytes i uanvendelige sektorer" ;badspc
+0009 T 0000 "%1 bytes i %2 skjulte filer" ;hidmes
+0010 T 0000 "%1 bytes i %2 biblioteker" ;dirmes
+0011 T 0000 "%1 bytes i %2 filer" ;filemes
+0012 T 0000 "%1 bytes i %2 genopbyggede filer" ;orphmes2
+0013 T 0000 "%1 bytes ville findes i %2 genopbyggede filer" ;orphmes3
+0014 T 0000 "%1 bytes til r†dighed p† disken" ;frespc
+0015 T 0000 "%1 bytes totalt internt lager" ;totmem
+0016 T 0000 "%1 bytes internt lager til r†dighed" ;fremem
+0017 T 0000 "CHKDSK kan ikke anvendes p† et netv‘rksdrev" ;no_net_arg
+0018 T 0000 "CHKDSK kan ikke anvendes. ASSIGN eller SUBST er anvendt p† dette drev" ;SubStErr
+0019 T 0000 "Formodentlig ikke en DOS-disk",CR,LF,"Skal der forts‘ttes (J/N)?"
+0020 T 0000 "Diskfejl ved l‘sning af filallokeringstabel %1",CR,LF ;badr
+0021 T 0000 "Bibliotek %1" ;direc_arg
+0022 T 0000 "%1 indeholder %2 ikke-sammenh‘ngende blokke" ;extent_arg
+0023 T 0000 "Alle angivne filer er sammenh‘ngende" ;noext_arg
+0024 T 0000 "Fejl blev fundet, men da parameteren /F ikke blev angivet,",CR,LF, "vil ‘ndringer ikke blive skrevet p† disken" ;fixmes_arg
+0025 T 0000 " Programmet kan ikke forts‘tte. %1%2" ;fatal_arg
+0026 T 0000 " Filallokeringstabel er beskadiget p† drev %1" ;badrdmes
+0029 T 0000 " Kan ikke skifte bibliotek. Alternativ metode pr›ves" ;cdddmes
+0030 T 0000 " Filen er afkortet. Indeholder forkerte klynger" ;badchain
+0031 T 0000 " Lokalbiblioteket indeholder forkerte data" ;badsubdir
+0032 T 0000 " Eksisterer ikke" ;ndotmes
+0033 T 0000 " Klynge nummer 1 er forkert. Filen er afkortet" ;nulnz
+0034 T 0000 " Allokeringsfejl. Filens st›rrelse er justeret" ;badclus
+0035 T 0000 " Kan ikke genopbygge filen '.'. Programmet forts‘tter" ;norecdot
+0036 T 0000 " Biblioteket indeholder hverken '.' eller '..'. " ;nuldmes
+0037 T 0000 " JOIN er anvendt p† dette bibliotek" ;joinmes
+0038 T 0000 " Kan ikke genopbygge filen '..'." ;norecddot
+0039 T 0000 " Filen indeholder en forkert henvisning" ;norecddot1
+0040 T 0000 " Filen har en forkert attribut" ;norecddot2
+0041 T 0000 " Filen har en forkert st›rrelse" ;norecddot3
+0042 T 0000 " Henviser til klynge %d, der anvendes af en anden fil %1" ;cross_arg
+0043 T 0000 " Kan ikke skifte til biblioteket %1",CR,LF," Tr‘strukturen efter dette punkt behandles ikke" ;badtarg_ptr
+0044 T 0000 " Tr‘strukturen efter dette punkt behandles ikke" ;badtarg2
+0045 T 0000 "%1 bytes frigjort p† disken" ;freebymes1
+0046 T 0000 "%1 bytes ville v‘re blevet frigjort p† disken " ;freebymes2
+0047 T 0000 "Disken %1 er oprettet: %2 %3",CR,LF ;idmes_arg
+0048 T 0000 "%1 allokeringsenheder p† disken i alt"
+0049 T 0000 "%1 bytes i hver allokeringsenhed" ;idmes2
+0050 T 0000 "CHKDSK kan ikke anvendes p† drev %1" ;msgExecFailure
+0051 T 0000 " Udvidede attributter indeholder forkerte klynger. Attributterne er afkortet" ;Inv_XA_Msg
+0052 T 0000 " Fejl ved allokering af udvidede attributter. Attributterne er afkortet" ;Alloc_XA_Msg
+0053 T 0000 "Forkert parameter" ;badsw_arg
+0055 T 0000 "Stien er ikke fundet" ;invpath_arg
+0056 T 0000 "Filen er ikke fundet" ;opnerr_arg
+0058 T 0000 " %1 tabte klynger fundet i %2 k‘der." ;orph_arg
+0059 T 0000 CR,LF ;crlf_arg
+0060 T 0000 " Kan ikke skifte til hovedbiblioteket",CR,LF ;badcd_arg
+0061 T 0000 " Diskfejl ved skrivning af filallokeringstabel %1" ;badw_arg
+0062 T 0000 " %1" ;noisy_arg
+0063 T 0000 "Aktivt bibliotek er forkert" ;baddpbdir
+0064 T 0000 "%1",CR,LF ;file_arg
+0065 T 0000 " Der kan ikke oprettes flere filer i hovedbiblioteket.",CR,LF," Slet filer i hovedbiblioteket, og anvend CHKDSK igen" ;creatmes
+0066 T 0000 "%1 %2 %3" ;eup_arg
+0067 T 0000 "%1 %2, %3" ;usp_arg
+0068 T 0000 "%1%2%3%4%5" ;oth_arg
+0069 T 0000 "%1%2%3%4" ;time_arg
+0070 T 0000 "%1 allokeringsenheder til r†dighed p† disken" ;idmes2 ;an017;bgb
+DEBUG 4cab 0062
+0004 T 0000 "Allokering kunne ikke udf›res, eller den angivne buffer er for lille",CR,LF
+0005 T 0000 "Forkert eller manglende meddelelsesfil",CR,LF
+0006 T 0000 "Udstyrsnavnet er forkert" ;baddev_ptr
+0007 T 0000 "Kan ikke †bne udskrivningsenheden PRN",CR,LF
+ "Angiv navn p† udskrivningsenheden $" ;badlstmes_ptr
+0008 T 0000 CR,LF ;crlf_ptr
+0009 T 0000 CR,LF,"Programmet er afsluttet normalt",CR,LF
+0010 T 0000 "Forkert angivelse af drev " ;nambad_ptr
+0012 T 0000 "Fejl ved oprettelse af fil" ;noroom_ptr
+0013 T 0000 "For lidt plads p† disken" ;nospace_ptr
+0014 T 0000 "Diskfejl ved l‘sning fra drev %1" ;dr1_ptr
+0015 T 0000 "Diskfejl ved skrivning p† drev %1" ;dr2_ptr
+0016 T 0000 "Skrivebeskyttelsesfejl ved l‘sning fra drev %1" ;dr3_ptr
+0017 T 0000 "Skrivebeskyttelsesfejl ved skrivning p† drev %1" ;dr4_ptr
+0019 T 0000 "%1^ fejl" ;synerr
+0020 T 0000 "Fejl i EXE- eller HEX-fil" ;exebad_ptr/hexerr_ptr
+0021 T 0000 "Der kan ikke skrives i EXE- og HEX-filer" ;exewrt_ptr/hexwrt_ptr
+0022 T 0000 "EXEC-fejl" ;execemes_ptr
+0023 T 0000 "Skrivefejl. Filnavn skal angives" ;nonamespec_ptr
+0024 T 0000 "Adgang n‘gtet" ;accmes_ptr
+0025 T 0000 "Paritetsfejl eller adressering i ikke-eksisterende internt lager" ;paritymes_ptr
+0026 T 0000 "-" ;prompt_ptr
+0027 T 0000 "%1 -" ;change_flag_ptr
+0032 T 0000 "%1%2" ;unassem_ln_ptr
+0033 T 0000 "%1:%2 %3" ;hex_ptr
+0034 T 0000 "%1 %2" ;add_ptr
+0035 T 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0000 "%1=%2 " ;register_ptr
+0037 T 0000 "%1 Fejl" ;errmes_ptr
+0038 T 0000 "ved skrivning p†" ;wrtmes_ptr
+0039 T 0000 "%1:%2=" ;loc_ptr
+0040 T 0000 "%1" ;little_ptr
+0041 T 0000 "%1" ;big_ptr
+0042 T 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "%1 fejl %2 drev %3" ;dskerr_ptr
+0044 T 0000 32,8 ;bacmes_ptr
+0045 T 0000 "H†ndtering af meddelelser er ikke mulig",CR,LF ;fatal_error
+0046 T 0000 "%1" ;arg_buf_ptr
+0047 T 0000 "%1" ;one_char_buf_ptr
+0050 T 0000 "%1 af %2 EMS-enheder i alt er allokeret",cr,lf
+0051 T 0000 "%1 af %2 EMS-henvisninger i alt er allokeret",cr,lf
+0054 T 0000 "FRAME for EMS-enheder = "
+0055 T 0000 "Henvisning oprettet = %1 ",cr,lf
+0056 T 0000 "Logisk enhed %1 registreret som fysisk enhed %2 ",cr,lf
+0057 T 0000 "Udstyrs- eller programfejl ved EMS",cr,lf
+0058 T 0000 "Henvisning er ikke fundet",cr,lf
+0059 T 0000 "Forkert funktionskode",cr,lf
+0060 T 0000 "Der kan ikke oprettes flere henvisninger",cr,lf
+0061 T 0000 "Fejl ved gem/genopret",cr,lf
+0062 T 0000 "Det totale antal enheder er n†et",cr,lf
+0063 T 0000 "Det totale antal ubenyttede enheder er n†et",cr,lf
+0064 T 0000 "Parameterfejl",cr,lf
+0065 T 0000 "Logisk enhed uden for interval",cr,lf
+0066 T 0000 "Fysisk enhed uden for interval",cr,lf
+0067 T 0000 "Omr†de til gem anvendes allerede",cr,lf
+0068 T 0000 "Omr†de til gem er ikke i brug",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0000 "Forkert eller manglende EMS-parameter",cr,lf
+0072 T 0000 "%2 enheder er allokeret til henvisning %1",cr,lf
+0074 T 0000 "Genopretning af EMS er udf›rt",cr,lf
+0075 T 0000 "Fysisk enhed %1 = FRAME-segment %2",cr,lf
+0076 T 0000 "Allokering af henvisning %1 er oph‘vet",cr,lf
+0078 T 0000 "EMS er ikke installeret",cr,lf
+DRIVER 5bd8 0002
+0002 T 0000 "Drev skal angives",CR,LF
+0003 T 0000 "Styreprogram til eksternt drev %1 er indl‘st",CR,LF
+EDLIN 5c55 0028
+0006 T 0000 "*" ;prompt_ptr
+0007 T 0000 "Forkert drev eller filnavn",CR,LF ;baddrv_ptr
+0008 T 0000 "Der skal angives et filnavn",CR,LF ;ndname_ptr
+0009 T 0000 "Forkert parameter",CR,LF ;opt_err_ptr
+0010 T 0000 "Filen kan kun l‘ses",CR,LF ;ro_err_ptr
+0011 T 0000 "Fejl ved oprettelse af fil",CR,LF ;bcreat_ptr
+0012 T 0000 "For mange filer er †bne",CR,LF ;too_many_ptr
+0013 T 0000 "Fejl ved l‘sning af %S",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0000 "En .BAK-fil kan ikke redigeres. Giv filen et andet navn",CR,LF ;nobak_ptr
+0015 T 0000 "Der er ikke plads til filen i dette bibliotek",CR,LF ;nodir_ptr
+0016 T 0000 "Disken er fuld. ’ndringer er tabt",CR,LF ;dskful_ptr
+0017 T 0000 "Filen er ikke fundet",CR,LF ;filenm_ptr
+0018 T 0000 "Forkert svar",CR,LF ;badcom_ptr
+0019 T 0000 "Ny fil",CR,LF ;newfil_ptr
+0020 T 0000 "Ikke fundet",CR,LF ;nosuch_ptr
+0021 T 0000 "I orden?" ;ask_ptr
+0022 T 0000 "Linien er for lang",CR,LF ;toolng_ptr
+0023 T 0000 "Filen er indl‘st",CR,LF ;eof_ptr
+0024 T 0000 "Afbryd redigering (J/N)? " ;qmes_ptr
+0025 T 0000 "Placering af blokken skal angives med et linienummer",CR,LF ;dest_ptr
+0026 T 0000 "For lidt plads til at hente hele filen",CR,LF ;mrgerr_ptr
+0027 T 0000 CR,LF ;crlf_ptr
+0028 T 0000 LF ;lf_ptr
+0029 T 0000 "Forts‘t (J/N)? " ;cont_ptr
+0030 T 0000 "Meddelelse kan ikke udskrives",CR,LF ;fatal_error
+0031 T 0000 "%1" ;arg_buf_ptr
+0032 T 0000 "%1:%2" ;line_num_buf_ptr
+0033 T 0000 "Kan ikke hente fil - tegntabellerne er forskellige",CR,LF ;cp_err_ptr
+EXE2BIN 63db 0010
+0002 T 0000 "For lidt internt lager",CR,LF
+0003 T 0000 "Meddelelser er ikke fundet",CR,LF
+0004 T 0000 "Adgang n‘gtet",CR,LF
+0005 T 0000 "Filen kan ikke konverteres",CR,LF
+0006 T 0000 "Filen er ikke fundet",CR,LF
+0007 T 0000 "Fejl ved oprettelse af fil",CR,LF
+0008 T 0000 "Programmet skal rettes - nederste segment (hex):"
+0009 T 0000 "Forkert parameter",CR,LF
+0011 T 0000 "ADVARSEL: Fejl ved l‘sning af EXE-fil.",CR,LF
+ "Der er l‘st mindre end den st›rrelse, der er angivet i filens start.",CR,LF
+0012 T 0000 "Der skal angives et filnavn",CR,LF
+FIND 661b 0001
+0004 T 0000 "FIND: "
+FORMAT 6645 0044
+0002 T 0000 CR,"%1 procent af disken er formateret"
+0004 T 0000 CR,"Formateringen er afsluttet ",CR,LF
+0007 T 0000 "S‘t en ny diskette i drev %1:",CR,LF
+0009 T 0000 "Inds‘t disketten igen i drev %1:",CR,LF
+0010 T 0000 "Angiv et disknavn p† op til 11 tegn."
+0011 T 0000 CR,"FORMAT kan ikke anvendes p† drev %1:", CR,LF
+0012 T 0000 CR,"Forkerte parametre fra styreprogrammet",CR,LF
+0013 T 0000 CR,"Kommunikationsfejl (IOCTL-kaldet)",CR,LF
+0014 T 0000 CR,"Ikke en blokenhed",CR,LF
+0015 T 0000 CR,"Fejl ved skrivning af filallokeringstabel",CR,LF
+0016 T 0000 CR,"Fejl ved skrivning af bibliotek",CR,LF
+0017 T 0000 CR,"FORMAT kan ikke anvendes. ASSIGN eller SUBST er anvendt p† dette drev",CR,LF
+0018 T 0000 CR,"Kan ikke finde DOS-systemfilene",CR,LF
+0019 T 0000 CR,"Kan ikke formatere et netv‘rksdrev",CR,LF
+0020 T 0000 CR,"Forkerte tegn i disknavn ",CR,LF
+0021 T 0000 CR,"Forkerte parametre",CR,LF
+0022 T 0000 CR,"Formateringen er afbrudt ",CR,LF
+0023 T 0000 CR,"Disken kan ikke benyttes som DOS-systemdisk ",CR,LF
+0024 T 0000 CR,"Forkert diskette eller spor 0 beskadiget. Disken kan ikke anvendes",CR,LF
+0025 T 0000 CR,"Det er ikke muligt at skrive en BOOT-sektor ",CR,LF
+0026 T 0000 CR,"Fejl ved l‘sning af bibliotek",CR,LF
+0028 T 0000 CR,"og tryk p† Enter for at forts‘tte"
+0029 T 0000 CR,"Forkert disknavn ",CR,LF
+0031 T 0000 CR,"Angiv nuv‘rende navn p† disken i drev %1: "
+0032 T 0000 CR,"De angivne parametre kan ikke anvendes til en fast disk",CR,LF
+0035 T 0000 CR,"Fejl ved l‘sning af oplysninger om inddeling",CR,LF
+0037 T 0000 CR,"FORMAT er ›delagt",CR,LF
+0038 T 0000 CR,"FORMAT kan ikke anvendes p† drev %1",CR,LF
+0039 T 0000 CR,"Diskfejl eller manglende DOS",CR,LF
+0040 T 0000 CR,"Oplysninger om inddeling af disken er beskadigede",CR,LF
+0041 T 0000 CR,"Forkerte parametre",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"S‘t DOS-disketten i drev %1:",CR,LF
+0045 T 0000 CR,LF,"ADVARSEL! ALLE DATA P DEN FASTE DISK",CR,LF,"I DREV %c: VIL BLIVE SLETTET!",CR,LF
+ "Forts‘t formateringen (J/N)?"
+0046 T 0000 CR,"Format‚r en anden disk (J/N)?"
+0047 T 0000 CR,"Fejl ved l‘sning af oplysninger om inddeling",CR,LF
+0048 T 0000 CR,"Fejl ved skrivning af oplysninger om inddeling",CR,LF
+0049 T 0000 CR,"De angivne parametre kan ikke anvendes samtidigt", CR,LF
+0050 T 0000 "%1 allokeringsenheder er til r†dighed p† disken",CR,LF
+0051 T 0000 "%1 bytes i hver allokeringsenhed",CR,LF
+0052 T 0000 CR,"Fejl ved skrivning af oplysninger om inddeling",CR,LF
+0053 T 0000 CR,"Den samme parameter er angivet to gange",CR,LF
+0054 T 0000 CR,"B†de parameteren /T og /N skal angives",CR,LF ;AN009;
+JOIN 714c 0001
+0002 T 0000 CR,LF,"Biblioteket er ikke tomt",CR,LF
+MORE 7194 0001
+0002 T 0000 "-- Mere --"
+PRINT 71c2 0022
+0002 T 0000 CR,LF
+0006 T 0000 " Fejl ved l‘sning af fil.",CR,LF,"$"
+0007 T 0000 "Filen er ikke fundet",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Fil $"
+0009 T 0000 " er afbrudt$"
+0010 T 0000 CR,LF,LF,"Udskrivning af alle filer er annulleret$"
+0011 T 0000 "Filallokeringstabel er beskadiget p† drev "
+0012 T 0000 "A.",CR,LF,"$"
+0013 T 0000 "Der kan ikke udskrives p† dette udstyr",CR,LF
+0014 T 0000 "PRINT er nu indl‘st permanent",CR,LF
+0015 T 0000 "Kan ikke anvende PRINT, anvend i stedet NET PRINT",CR,LF
+0017 T 0000 "Udskrivningsk›en er fuld",CR,LF
+0018 T 0000 "Udskrivningsk›en er tom",CR,LF
+0019 T 0000 "Adgang n‘gtet",CR,LF
+0020 T 0000 "Forkert angivelse af drev",CR,LF
+0021 T 0000 "Printeren er ikke klar",CR,LF
+ "Kontroll‚r, om den er ONLINE.",CR,LF
+0022 T 0000 CR,LF,LF," %1 udskrives nu",CR,LF
+0023 T 0000 " %1 er sat i k›",CR,LF
+0024 T 0000 "Filen %1 er ikke fundet",CR,LF
+0025 T 0001 "Stien er for lang",CR,LF
+0026 T 0001 "Er ikke i udskrivningsk›en",CR,LF
+0027 T 0000 "DOS-navn for printeren [PRN]: "
+RECOVER 75da 0012
+0002 T 0000 CR,LF,"Filen er ikke fundet",CR,LF ;File not found
+0003 T 0000 CR,LF,"Kan ikke genindl‘se et drev, der er angivet i en ASSIGN- eller SUBST-kommando",CR,LF
+0004 T 0000 CR,LF,"Forkert drev eller filnavn",CR,LF
+0005 T 0000 CR,LF,"Advarsel - biblioteket er fyldt",CR,LF
+0006 T 0000 CR,LF,"REVOVER kan ikke anvendes p† et netv‘rksdrev", CR,LF ;Cannot %1 a Network drive
+0007 T 0000 CR,LF,"RECOVER kan ikke anvendes p† drev %1",CR,LF
+0008 T 0000 CR,LF,"Antal filer genopbygget: %1",CR,LF
+0009 T 0000 CR,LF,"%1 af %2 bytes er genopbygget",CR,LF
+0010 T 0000 CR,LF,"Tryk p† Enter for at genopbygge filer p† drev %1",CR,LF;AN000;bgb
+0011 T 0000 CR,LF,"Filallokeringstabellen kan ikke l‘ses",CR,LF
+0012 T 0000 CR,LF,"Filallokeringstabellen kan ikke skrives",CR,LF
+0013 T 0000 CR,LF
+SORT 7917 0001
+0005 T 0000 "SORT: "
+SUBST 7941 0001
+0002 T 0000 CR,LF,"Forkert antal parametre",CR,LF
+SYS 7988 0008
+0004 T 0000 "Forkert angivelse af drev",CR,LF ; Old
+0007 T 0000 "For lidt plads til DOS p† disken",CR,LF ; Old
+0008 T 0000 "Det nye DOS-system fylder mere end det gamle. DOS er ikke installeret",CR,LF ; Old -
+0010 T 0000 "Der intet DOS-system p† det aktive drev",CR,LF ; Old
+0011 T 0000 "Det aktive drev kan ikke angives",CR,LF ; New
+0012 T 0000 "Skrivefejl. Disketten er ubrugelig",CR,LF ; New
+0014 T 0000 "S‘t DOS-disketten i drev %1.",CR,LF ; Old
+0016 T 0000 "Filsystemet %1 accepteres ikke",CR,LF ; New
+SHARE 7c0a 0000
+NLSFUNC 7c1e 0000
+ANSI 7c32 0001
+0010 T 0000 "Forkert parameter '%1'",CR,LF ; 'Invalid parameter'
+IFSFUNC 7c8a 0001
+0004 T 0000 "Ingen IFS-styreprogrammer er fundet",CR,LF
+PSPRINT 7cd7 0007
+0002 T 0000 " Fejl ved l‘sning af fil.",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"Filen er annulleret$",CR,FORMFD,BELL
+0004 T 0000 "Filallokeringstabel er beskadiget p† drev "
+0005 T 0000 "A.",CR,LF,"$"
+0006 T 0000 "Der kan ikke udskrives p† dette udstyr",CR,LF
+0007 T 0000 "PSPRINT er allerede indl‘st",CR,LF
+0008 T 0000 "Konflikt mellem PSPRINT og PRINT",CR,LF
+BACKUP 7e5f 0022
+0002 T 0000 CR,LF,"For lidt internt lager",CR,LF
+0006 T 0000 CR,LF,"Forkert angivelse af drev",CR,LF
+0014 T 0000 CR,LF,"Der skal angives to forskellige drev",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Fejl ved †bning af logfil",CR,LF
+0018 T 0000 CR,LF,"Loggen skrives i filen %1",CR,LF
+0019 T 0000 CR,LF,"Den sidste sikkerhedskopidiskette er ikke indsat",CR,LF
+0020 T 0000 CR,LF,"Advarsel! Filer i biblioteket",CR,LF
+ "%1:\ vil blive slettet.",CR,LF
+0021 T 0000 CR,LF,"Advarsel! Filer i biblioteket",CR,LF
+ "%1:\BACKUP vil blive slettet",CR,LF
+0022 T 0000 CR,LF,"*** Sikkerhedskopiering foretages til drev %1: ***",CR,LF
+0023 T 0000 "Diskette nummer: %1",CR,LF
+0024 T 0000 CR,LF,"ADVARSEL! Der blev ikke fundet nogen filer at sikkerhedskopiere",CR,LF
+0025 T 0000 CR,LF,"S‘t disketten, der skal sikkerhedskopieres, i drev %1:",CR,LF
+0026 T 0000 CR,LF,"S‘t sikkerhedskopidiskette %1 i drev %2:",CR,LF
+0027 T 0000 CR,LF,"*** Filen kan ikke sikkerhedskopieres ***",CR,LF
+0028 T 0000 CR,LF,"S‘t den sidste sikkerhedskopidiskette i drev %1:",CR,LF
+0029 T 0000 CR,LF,"Der kan ikke sikkerhedskopieres til den angivne disk",CR,LF
+0030 T 0000 CR,LF,"*** Sidste fil er ikke sikkerhedskopieret ***",CR,LF
+0031 T 0000 CR,LF,"Den faste disk %1: er fuld",CR,LF
+0032 T 0000 CR,LF,"Fejl ved skrivning til logfilen. Disken er fuld.",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 8424 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 845e 0013
+0004 T 0000 "10 afvigelser fundet, sammenligningen er afbrudt",CR,LF
+0006 T 0000 "Afvigelse ved adresse %1",CR,LF
+0007 T 0000 "Fil 1 = %1",CR,LF
+0008 T 0000 "Fil 2 = %1",CR,LF
+0009 T 0000 "Filsluttegn ikke fundet",CR,LF
+0010 T 0000 "Filerne er ens",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Angiv navnet p† den f›rste fil",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Angiv navnet p† den anden fil eller en drevbetegnelse",CR,LF
+0017 T 0000 "Filernes st›rrelse er forskellig",CR,LF
+0018 T 0000 "Sammenlign flere filer (J/N)?"
+0019 T 0000 "%1 og %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Filerne er ens",CR,LF
+DISKCOMP 86c6 0016
+0004 T 0000 "Filnavne skal ikke angives.",CR,LF
+ "Kommandoformat: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0000 CR,LF,"Forkert angivelse af drev.",CR,LF
+ "Et angivet drev er en fast disk eller findes ikke",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP kan ikke anvendes p† et netv‘rksdrev",CR,LF
+0007 T 0000 CR,LF,"S‘t den FRSTE diskette i drev %1:",CR,LF
+0008 T 0000 CR,LF,"S‘t den ANDEN diskette i drev %1:",CR,LF
+0009 T 0000 CR,LF,"FRSTE diskette er defekt eller ikke kompatibel",CR,LF
+0010 T 0000 CR,LF,"ANDEN diskette er defekt eller ikke kompatibel",CR,LF
+0014 T 0000 CR,LF,"Sammenlign flere disketter (J/N)?"
+0015 T 0000 CR,LF,"Sammenligner %1 spor",CR,LF
+ "Sektorer/spor: %2, sider: %3",CR,LF
+0016 T 0000 CR,LF,"Drev- eller diskettetyper er ikke kompatible",CR,LF
+0017 T 0000 CR,LF,"L‘sefejl p† drev %1",CR,LF
+ "side %2, spor %3",CR,LF
+0018 T 0000 CR,LF,"Afvigelse p†",CR,LF,"side %3, spor %4",CR,LF
+0019 T 0000 "Kontroll‚r, at disketten er sat korrekt i diskettedrevet",CR,LF ;AN004;
+0020 T 0000 CR,LF,"Sammenligningen er afsluttet",CR,LF
+0021 T 0000 CR,LF,"Filerne er ens",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 8b34 0018
+0002 T 0000 CR,LF
+0004 T 0000 "Filnavne skal ikke angives.",CR,LF
+ "Kommandoformat: DISKCOPY d: d: [/1]",CR,LF
+0005 T 0000 CR,LF,"Forkert angivelse af drev.",CR,LF
+ "Et angivet drev er en fast disk eller findes ikke",CR,LF
+0006 T 0000 CR,LF,"DISKCOPY kan ikke anvendes p† et netv‘rksdrev",CR,LF
+0007 T 0000 CR,LF,"Formaterer under kopieringen",CR,LF
+0008 T 0000 CR,LF,"S‘t den diskette, der skal kopieres FRA, i drev %1",CR,LF
+0009 T 0000 CR,LF,"S‘t den diskette, der skal kopieres TIL, i drev %1",CR,LF
+0010 T 0000 "Kontroll‚r, at disketten er sat korrekt i diskettedrevet",CR,LF ;AN004;
+0011 T 0000 CR,LF,"Disketten, der er kopieret til, kan v‘re ubrugelig",CR,LF
+0012 T 0000 CR,LF,"Disketten, der er kopieret til, er ubrugelig",CR,LF
+0016 T 0000 CR,LF,"Kopi‚r flere disketter (J/N)?"
+0017 T 0000 CR,LF,"Kopierer %1 spor",CR,LF
+ "Sektorer/spor: %2, sider: %3",CR,LF
+0018 T 0000 CR,LF,"Drev- eller diskettetyper er ikke kompatible",CR,LF
+0019 T 0000 CR,LF,"L‘sefejl p† drev %1",CR,LF
+ "side %2, spor %3",CR,LF
+0020 T 0000 CR,LF,"Skrivefejl p† drev %1",CR,LF
+ "side %2, spor %3",CR,LF
+0021 T 0000 CR,LF,"Kopieringen er afsluttet",CR,LF
+0022 T 0000 CR,LF,"Disketten, der kopieres fra, er defekt eller ikke kompatibel"
+0023 T 0000 CR,LF,"Disketten, der kopieres til, er defekt eller ikke kompatibel"
+LABL 9073 0000
+MODE 9087 0055
+0003 T 0000 CR,LF,"COM1, COM2, COM3 eller COM4 skal angives",CR,LF
+0004 T 0000 CR,LF,"MODE er nu indl‘st",CR,LF
+0005 T 0000 CR,LF,"Forkert udstyrsnavn",CR,LF
+0006 T 0000 CR,LF,"Printerfejl",CR,LF
+0007 T 0000 CR,LF,"LPT%1: angivet til 80 tegn",CR,LF
+0008 T 0000 CR,LF,"LPT%1: angivet til 132 tegn",CR,LF
+0009 T 0000 CR,LF,"Linier pr. tomme angivet for printer",CR,LF
+0010 T 0000 CR,LF,"Forkert baudhastighed angivet",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 T 0001 CR,LF,"Er tallet yderst til %s (J/N)?",CR,LF,"??yderst til h›jre/venstre?? "
+0014 T 0000 CR,LF,"Forkerte parametre",CR,LF
+0015 T 0000 "LPT%1: omdirigeret til COM%c:",CR,LF
+0016 T 0000 "LPT%1: ikke omdirigeret",CR,LF
+0017 T 0000 CR,LF,"%1 fors›g ved time-out p† parallel printer",CR,LF
+0018 T 0000 CR,LF," Det er ikke muligt at flytte sk‘rmbilledet til %s",CR,LF
+0020 T 0000 CR,LF,"Forkert antal parametre",CR,LF
+0021 T 0000 CR,LF,"NET 042: Det er ikke muligt at udf›re kommandoen",CR,LF
+0022 T 0000 CR,LF,"Gentagne fors›g er ikke muligt p† en netv‘rksprinter",cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",CR,LF
+0024 T 0000 CR,LF,"Kan ikke f† adgang til %S",CR,LF
+0025 T 0000 CR,LF,"Udstyr eller tegntabel mangler i skrifttypefilen",CR,LF
+0026 T 0000 CR,LF,"Indholdet af skrifttypefilen er forkert",CR,LF
+0027 T 0000 CR,LF,"Den tidligere aktive tegntabel er erstattet",CR,LF
+0028 T 0000 CR,LF,"Aktiv tegntabel for udstyret %S er %D",CR,LF
+0029 T 0000 CR,LF,"%1 er ikke klargjort",CR,LF
+0030 T 0000 "%1 tegntabeller:",CR,LF
+0031 T 0000 " Tegntabel %1",CR,LF ;FILLED IN BY QUERY ROUTINE WITH CODEPAGE ID
+0032 T 0000 CR,LF,"Funktionen MODE %1 tegntabel er afsluttet",CR,LF
+0033 T 0000 CR,LF,"Fejl ved %1 af den globale tegntabel",CR,LF ;FILLED IN with setting or getting
+0034 T 0000 CR,LF,"Aktiv tegntabel:",CR,LF ;table header
+0035 T 0000 " %1 - %2 tegntabel",CR,LF
+0036 T 0000 " Tegntabel ikke indl‘st",CR,LF
+0037 T 0000 "Denne enhed har fast tegntabel",CR,LF
+0038 T 0000 "Der er ikke valgt tegntabel",CR,LF
+0039 T 0000 "Fejl opst†et under %S",CR,LF
+0040 T 0000 "Tegntabellen er ikke indl‘st",CR,LF
+0041 T 0000 CR,LF,"Tastaturet kan ikke anvende denne tegntabel",CR,LF
+0042 T 0000 CR,LF,"Fejl ved l‘sning af skrifttypefil",CR,LF
+0043 T 0000 CR,LF,"Det er ikke muligt at udf›re REFRESH",CR,LF
+0044 T 0000 CR,LF ;used for formatting
+0045 T 0000 CR,LF,"Status for udstyr %1:",CR,LF ;header for status reports
+0046 T 0000 "------------------" ;first part of underline under Status for device %1:
+0047 T 0000 "----",CR,LF ;four_char_underline
+0048 T 0000 "-----",CR,LF ;five_char_underline
+0049 T 0000 "LINES=%1 (linier)",CR,LF
+0050 T 0000 "COLS=%1 (tegn pr. linie)",CR,LF
+0051 T 0000 CR,LF,"RATE og DELAY skal angives sammen",CR,LF
+0052 T 0000 "RATE=%1 (hastighed)",CR,LF
+0053 T 0000 "DELAY=%1 (forsinkelse)",CR,LF
+0054 T 0000 CR,LF,"Funktionen kan ikke anvendes p† dette system - %1",CR,LF
+0055 T 0000 CR,LF,"Den n›dvendige skrifttype er ikke indl‘st",CR,LF
+0056 T 0000 CR,LF,"ANSI.SYS skal v‘re installeret for at udf›re den ›nskede funktion",CR,LF
+0057 T 0000 CR,LF,"Baudhastighed skal angives",CR,LF
+0058 T 0000 "RETRY=%1 (gentagne fors›g)",CR,LF
+RESTORE 9da1 0022
+0002 T 0000 CR,LF,"Der skal angives to forskellige drev",CR,LF
+0003 T 0000 CR,LF,"Forkert antal parametre",CR,LF
+0006 T 0000 CR,LF,"Forkert angivelse af drev",CR,LF
+0007 T 0000 CR,LF,"Advarsel! Der blev ikke fundet nogen filer at genindl‘se",CR,LF
+0008 T 0000 CR,LF,"S‘t sikkerhedskopidiskette %1 i drev %2:",CR,LF
+0009 T 0000 CR,LF,"S‘t disketten, der skal kopieres til, i drev %1:",CR,LF
+0011 T 0000 CR,LF,"Advarsel! Ikke den rigtige diskette i r‘kken.",CR,LF
+ "Udskift eventuelt disketten.",CR,LF
+0012 T 0000 CR,LF,"Sidste fil er ikke genindl‘st",CR,LF
+0013 T 0000 CR,LF,"*** Filer blev sikkerhedskopieret %1 *** ",CR,LF
+0014 T 0000 CR,LF,"Disketten indeholder ikke sikkerhedskopifiler",CR,LF
+0015 T 0000 CR,LF,"For lidt internt lager",CR,LF
+0016 T 0000 CR,LF,"Advarsel! Filen %1 kan kun l‘ses.",CR,LF
+ "Erstat filen (J/N)? ",CR,LF
+0017 T 0000 CR,LF,"Sekvensfejl ved genindl‘sning af fil",CR,LF
+0018 T 0000 CR,LF,"Fejl ved oprettelse af fil",CR,LF
+0019 T 0000 CR,LF,"For lidt plads p† disken",CR,LF
+0020 T 0000 CR,LF,"*** Ikke muligt at genindl‘se fil ***",CR,LF
+0021 T 0000 CR,LF,"*** Genindl‘ser filer fra drev %s: ***",CR,LF
+0022 T 0000 CR,LF,"Advarsel! Filen %1 ",CR,LF
+ "er ‘ndret efter sikkerhedskopiering.",CR,LF
+ "Erstat filen (J/N)? ",CR,LF
+0023 T 0000 "Diskette: %1",CR,LF
+0024 U 0000 CR,LF,"Bizzare error, call Russ Whitehead @ 8-3863",CR,LF ??!!
+0025 T 0000 07 ;For BEEP !
+0026 T 0000 CR,LF,"Fejl ved genindl‘sning af udvidede attributter",CR,LF
+SELECT a38d 0016
+0004 T 0000 "Forkert BOOT-disk ved SELECT",CR,LF,CR,LF
+ "S‘t Installationsdisketten i drev A, og gentag funktionen"
+0005 T 0000 "Forkert disktype",CR,LF,CR,LF
+ "S‘t Installationsdisketten i drev A, og gentag funktionen"
+0006 T 0000 "Der er angivet forkerte parametre i SELECT-kommandoen.",CR,LF,CR,LF
+ "Kontroll‚r, at Installationsdisketten er i drev A,",CR,LF
+ "og start systemet igen ved at trykke p† Ctrl-Alt-Del."
+0007 T 0000 BELL,"DOS kan ikke installeres. Programmet er afbrudt",CR,LF
+0008 T 0000 "Indl‘ser SELECT..."
+0009 T 0000 "Systemet skal startes igen for at forts‘tte installationen.",CR,LF,CR,LF
+ "Tryk p† Ctrl-Alt-Del."
+0010 T 0000 "S‘t SELECT-disketten i drev A.",CR,LF,CR,LF
+ "Tryk p† Enter for at forts‘tte installationen,",CR,LF
+ "eller tryk p† Esc for at afbryde.",CR,LF
+0011 T 0000 BELL
+0012 T 0001 "S‘t SELECT-disketten i drev A.",CR,LF,CR,LF
+ "Tryk p† Enter for at forts‘tte.",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE aad3 0004
+0002 T 0000 "DISKENS TR’STRUKTUR %1",CR,LF ;define message ;AN000;
+0003 T 0000 "DISKENS TR’STRUKTUR ",CR,LF ; ;AN000;
+0004 T 0000 "Der findes ingen lokalbiblioteker",CR,LF,LF ; ;AN000;
+0007 T 0000 "ÀÄó" ;elbo,dash,tee,bar
+REPLACE ac2c 0009
+0003 T 0000 CR,LF,"Ingen filer erstattet",CR,LF
+0004 T 0000 CR,LF,"Ingen filer tilf›jet",CR,LF
+0013 T 0000 CR,LF,"Erstatter %1",CR,LF
+0014 T 0000 CR,LF,"Tilf›jer %1",CR,LF
+0015 T 0000 CR,LF,"Antal filer erstattet: %1",CR,LF
+0016 T 0000 CR,LF,"Antal filer tilf›jet: %1",CR,LF
+0017 T 0000 CR,LF,"Ingen filer fundet %1",CR,LF
+0022 T 0000 CR,LF,"Erstat %1 (J/N)? "
+0023 T 0000 CR,LF,"Tilf›j %1 (J/N)? "
+XCOPY add8 0019
+0004 T 0000 "Er %s et filnavn eller et bibliotek p† disken,",CR,LF ;AN000;
+ "der kopieres til (F = fil, B = bibliotek)?",CR,LF
+0005 T 0000 "Tryk p† Enter for at forts‘tte" ;AN000;
+0006 T 0000 "Den angivne sti er for lang",CR,LF ;AN000;
+0008 T 0000 "Cyklisk kopiering kan ikke foretages",CR,LF ;AN000;
+0012 T 0000 "XCOPY kan ikke kopiere fra det angivne udstyr",CR,LF ;AN000;
+0021 T 0000 "Forkert antal parametre",CR,LF ;AN000;
+0022 T 0000 "XCOPY kan ikke kopiere til det angivne udstyr",CR,LF ;AN000;
+0024 T 0000 "Fejl ved oprettelse af fil",CR,LF ;AN000;
+0025 T 0000 "L‘ser filer...",CR,LF ;AN000;
+0026 T 0000 CR,LF ;AN000;
+0027 T 0000 "Antal filer kopieret: %1",CR,LF ;AN000;
+0028 T 0000 "Filen %1 er ikke fundet",CR,LF ;AN000;
+0029 T 0000 "F B " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0000 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 T 0000 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0000 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 T 0000 "%1%2 (J/N)?" ;AN000;P_S_PATH_FILE0
+0034 T 0000 "%1\%2 (J/N)?" ;AN000;P_S_PATH_FILE1
+0035 T 0000 "%1 er en forkert parameterv‘rdi",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK b2aa 0013
+0002 T 0000 "For lidt internt lager",CR,LF ;AN000; Insufficient memory
+0003 T 0000 "VDISK version 3.40 virtuel disk %1",CR,LF ;AN000;
+0004 T 0000 " Den virtuelle disks st›rrelse er justeret",CR,LF ;AN000;
+0005 T 0000 " Sektorst›rrelse er justeret",CR,LF ;AN000;
+0006 T 0000 " Antallet af mulige filer i biblioteket er justeret",CR,LF ;AN000;
+0007 T 0000 " Forkert parameter",CR,LF ;AN000;
+0008 T 0000 " Blokst›rrelse er justeret",CR,LF ;AN000;
+0009 T 0000 " VDISK-st›rrelse: %1 Kb",CR,LF ;AN000;
+0010 T 0000 " Sektorst›rrelse: %1",CR,LF ;AN000;
+0011 T 0000 " Maks. antal filer i biblioteket: %1",CR,LF ;AN000;
+0012 T 0000 " Blokst›rrelse: %1",CR,LF ;AN000;
+0013 T 0000 "VDISK er ikke installeret" ;AN000;
+0014 T 0000 " Kontaktstillingen p† adapteren passer ikke",CR,LF ;AN000;
+ " til st›rrelsen p† DOS-systemets interne lager",CR,LF,CR,LF ;AN000;
+GRAFTABL b6f7 0005
+0002 T 0000 "Aktiv tegntabel: %1",CR,LF
+0003 T 0000 "Tidligere tegntabel: %1",CR,LF
+0004 T 0000 "Ingen",NULL
+0005 T 0000 "Ikke standard",NULL
+0006 T 0000 CR,LF,"F›lgende parametre kan anvendes i kommandoen",COLON,CR,LF,LF
+ " /STA - Viser navn og nummer p† den grafiske tegntabel,",CR,LF
+ " der i ›jeblikket er indl‘st",CR,LF
+ " ? - Viser denne oversigt over parametre",CR,LF,
+ " 437 - USA IBM PC-tegntabel",CR,LF
+ " 850 - Vesteurop‘isk grafisk tegntabel",CR,LF
+ " 860 - Portugisisk grafisk tegntabel",CR,LF
+ " 863 - Fransk-canadisk grafisk tegntabel",CR,LF
+ " 865 - Norsk grafisk tegntabel",CR,LF
+FASTOPEN b994 0016
+0004 T 0000 CR,LF,"FASTOPEN er indl‘st",CR,LF ;AN000;
+0005 T 0000 CR,LF,"FASTOPEN er allerede indl‘st",CR,LF ;AN000;
+0006 T 0000 CR,LF,"Forkert parameter",CR,LF ;AN000;
+0007 T 0000 CR,LF,"For mange drev er angivet",CR,LF ;AN000;
+0008 T 0000 CR,LF,"Samme drev er angivet mere end ‚n gang",CR,LF ;AN000;
+0009 T 0000 CR,LF,"Forkert parameter",CR,LF ;AN000;
+0010 T 0000 CR,LF,"Forkert parametertype",CR,LF ;AN000;
+0011 T 0000 CR,LF,"Parameterv‘rdien for lagerplads skal v‘re mellem 1 og 999",CR,LF ;AN000;
+0012 T 0000 CR,LF,"Antallet af fil-/biblioteksregistreringer skal v‘re mellem 10 og 999",CR,LF
+0013 T 0000 CR,LF,"Udvidet internt lager kan ikke klarg›res",CR,LF ;AN000;
+0014 T 0000 CR,LF,"Udvidet internt lager er ikke til r†dighed",CR,LF ;AN000;
+0015 T 0000 CR,LF,"Forkert angivelse af drev %1",CR,LF
+0016 T 0000 CR,LF,"For lidt plads i udvidet internt lager.",CR,LF ;AN000;
+ "Almindeligt internt lager vil blive anvendt.",CR,LF
+0017 T 0000 CR,LF,"FASTOPEN kan ikke anvendes p† drev %1",CR,LF
+0018 T 0000 CR,LF,"Parameterv‘rdien for lagerplads er for stor",CR,LF
+0019 T 0000 CR,LF,"Parameterv‘rdien for fil-/biblioteksregistreringer er for stor",CR,LF
+APPEND be5f 0009
+0001 T 0000 "Forkert APPEND-version",CR,LF
+0002 T 0000 "Forkert sti",CR,LF
+0003 T 0000 "Forkert parameter",CR,LF
+0004 T 0000 "Forkert kombination af parametre",CR,LF
+0005 T 0000 "Ingen APPEND er defineret",CR,LF
+0006 T 0000 "Konflikt mellem APPEND og ASSIGN",CR,LF
+0007 T 0000 "Konflikt mellem APPEND og TopView",CR,LF
+0008 T 0000 "Forkert DOS-version",CR,LF
+0009 T 0000 "APPEND er allerede indl‘st",CR,LF
+GRAPHICS c012 0012
+0005 T 0000 "Forkert parameter",CR,LF
+0007 T 0000 "Parametre m† kun angives ‚n gang",CR,LF
+0009 T 0000 "GRAPHICS-profilen er ikke fundet",CR,LF
+0010 T 0000 "N›dvendig profilkommando mangler f›r linie %1",CR,LF
+0011 T 0000 "Forkert profilkommando i linie %1",CR,LF
+0012 T 0000 "Forkert kommandor‘kkef›lge i linie %1 i profilen",CR,LF
+0013 T 0000 "Fejl ved l‘sning af GRAPHICS-profilen",CR,LF
+0014 T 0000 "Syntaksfejl i GRAPHICS-profilen",CR,LF
+0015 T 0000 "PRINTBOX:ID findes ikke i GRAPHICS-profilen",CR,LF
+0016 T 0000 "Printertypen findes ikke i GRAPHICS-profilen",CR,LF
+0017 T 0000 "/B kan kun anvendes til farveprintere",CR,LF
+0018 T 0000 "Kan ikke genindl‘ses med den anvendte profil",CR,LF
+DISPLAY c2e9 0003
+0002 T 0000 "%1-tegntabel kan ikke klarg›res",CR,LF
+0008 T 0000 "For lidt internt lager",CR,LF
+0012 T 0000 "Forkert syntaks til styreprogrammet DISPLAY.SYS",CR,LF
+PRINTER c3a3 0002
+0002 T 0000 "%1-tegntabel kan ikke klarg›res",CR,LF
+0012 T 0000 "Forkert syntaks til styreprogrammet PRINTER.SYS",CR,LF
+KEYB c431 0016
+0002 T 0000 "Nuv‘rende tastaturkode: %1"
+0003 T 0000 "Nuv‘rende tastaturnummer: %1"
+0004 T 0000 " tegntabel: %1",CR,LF
+0005 T 0000 "Nuv‘rende CON-tegntabel: ",CR,LF
+0006 T 0000 "Forkert tastaturkode angivet",CR,LF
+0007 T 0000 "Forkert tastaturnummer angivet",CR,LF
+0008 T 0000 "Forkert tegntabel angivet",CR,LF
+0009 T 0000 "Forkert eller manglende styreprogram til tastatur",CR,LF
+0010 T 0000 "KEYB er ikke indl‘st",CR,LF
+0011 T 0000 "Aktiv tegntabel ikke tilg‘ngelig fra CON",CR,LF
+0012 T 0000 "Den angivne tegntabel er ikke indl‘st",CR,LF
+0013 T 0000 "En eller flere CON-tegntabeller er ugyldige for denne tastaturkode",CR,LF
+0014 T 0000 "Den valgte tegntabel (%1) kan ikke anvendes med denne tastaturkode",CR,LF
+0015 T 0000 "Den angivne tegntabel stemmer ikke overens med den valgte tegntabel",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "Kan ikke oprette en tastaturtabel (KEYB) i det interne lager",CR,LF
+REDIRSYS c826 0000
+MEM c83a 0036
+0010 T 0000 CR,LF
+0011 T 0000 " Adresse Navn Str. Type ",CR,LF
+0012 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0000 " Henvisning EMS-navn Str. ",CR,LF
+0014 T 0000 " ÄÄÄÄÄÄÄ-Ä- ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0000 " %1 %2 %3 %4",CR,LF
+0016 T 0000 " %1 %2 %3 ",CR,LF
+0017 T 0000 " %1 %2 ",CR,LF
+0018 T 0000 "%1 bytes totalt internt lager",CR,LF
+0019 T 0000 "%1 bytes internt lager til r†dighed",CR,LF
+0020 T 0000 "%1 bytes er maksimal programst›rrelse",CR,LF
+0021 T 0000 "%1 bytes totalt udvidet internt lager",CR,LF
+0022 T 0000 "%1 bytes udvidet internt lager til r†dighed",CR,LF
+0023 T 0000 "%1 bytes totalt ekstra internt lager",CR,LF
+0024 T 0000 "Funktionskald til DOS",0
+0025 T 0000 "ROM-kommunikationsomr†de",0
+0026 T 0000 "DOS-kommunikationsomr†de",0
+0027 T 0000 "IBMBIO",0
+0028 T 0000 "IBMDOS",0
+0029 T 0000 "Systemdata",0
+0030 T 0000 "Systemprogram",0
+0031 T 0000 "Systemstyreprogram",0
+0032 T 0000 "Indl‘st styreprogram",0
+0033 T 0000 "%1:",0
+0034 T 0000 "%1: - %2:",0
+0035 T 0000 "BUFFERS=",0
+0036 T 0000 "FILES=",0
+0037 T 0000 "FCBS=",0
+0038 T 0000 "STACKS=",0
+0039 T 0000 "DEVICE=",0
+0040 T 0000 "IFS=",0
+0041 T 0000 "LASTDRIVE=",0
+0042 T 0000 "----------",0
+0043 T 0000 " ",0
+0044 T 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR ce01 0040
+0004 T 0000 "Netv‘rket er ikke startet",CR,LF
+0050 T 0000 "NET809: Netv‘rkskommando kan ikke anvendes",CR,LF,0
+0051 T 0000 "NET801: Intet svar fra det eksterne system",CR,LF,0
+0052 T 0000 "NET802: Navnet findes i forvejen i netv‘rket",CR,LF,0
+0053 T 0000 "NET803: Stien i netv‘rket er ikke fundet",CR,LF,0
+0054 T 0000 "NET804: Netv‘rket er optaget",CR,LF,0
+0055 T 0000 "NET805: Udstyret er ikke l‘ngere installeret i netv‘rket",CR,LF,0
+0056 T 0000 "NET806: Det tilladte antal BIOS-kommandoer i netv‘rket er n†et",CR,LF,0
+0057 T 0000 "NET807: Systemfejl (NETBIOS)",CR,LF,0
+0058 T 0000 "NET808: Svaret fra netv‘rket er forkert",CR,LF,0
+0059 T 0000 "NET810: Der er opst†et en fejl i netv‘rket",CR,LF,0
+0060 T 0000 "NET811: Den eksterne adapter er ikke kompatibel",CR,LF,0
+0061 T 0000 "NET812: Der er ikke mere plads i udskrivningsk›en",CR,LF,0
+0062 T 0000 "NET813: Der er ikke tilstr‘kkelig plads til udskrivningsfilen",CR,LF,0
+0063 T 0000 "NET814: Udskrivningsfilen blev slettet",CR,LF,0
+0064 T 0000 "NET815: Navnet i netv‘rket blev slettet",CR,LF,0
+0065 T 0000 "Adgang n‘gtet",CR,LF,0
+0066 T 0000 "NET817: Enheden i netv‘rket er af forkert type",CR,LF,0
+0067 T 0000 "NET818: Navnet i netv‘rket er ikke fundet",CR,LF,0
+0068 T 0000 "NET819: Det maksimale antal navne i netv‘rket er n†et",CR,LF,0
+0069 T 0000 "NET820: Det maksimale antal BIOS-sessioner i netv‘rket er n†et",CR,LF,0
+0070 T 0000 "NET821: Netv‘rket er midlertidigt inaktivt",CR,LF,0
+0071 T 0000 "NET823: Netv‘rkskommandoen blev ikke accepteret",CR,LF,0
+0072 T 0000 "NET822: Omdirigering til disk eller udskrivning er midlertidigt inaktiv",CR,LF,0
+0073 U 0000 "NET476: Netbeui not loaded",CR,LF,0
+0074 U 0000 "NET477: Unexpected adapter close",CR,LF,0
+0075 U 0000 "NET826: Target Server /RQB size too small",CR,LF,0
+0076 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0077 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0078 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0079 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0080 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0081 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0082 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0083 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0084 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0085 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0086 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0087 T 0000 "NET???: Netv‘rksfejl",CR,LF,0
+0088 T 0000 "NET825: Datafejl i netv‘rket",CR,LF,0
+FILESYS d763 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+XMA2EMS d8a5 0017
+0001 T 0000 "XMA2EMS: Styreprogram til udvidet internt lager version 1.xx",CR,LF
+ "74X9906 (c) Copyright IBM Corporation 1986 ",CR,LF,"$"
+0002 T 0000 CR,LF,"XMA001 Udf›rer fejlfinding af VMO/XMA: ","$"
+0003 T 0000 "XMA002 Fejlfinding afsluttet ",CR,LF,LF,"$"
+0004 T 0000 "XMA003 Enheder starter p†.......................... "
+0005 T 0000 "XXXX",":0",CR,LF,"$"
+0006 T 0000 "XMA004 Enheder overf›rt til alm. internt lager..... "
+0007 T 0000 "0 ",CR,LF,"$"
+0008 T 0000 "XMA005 Enheder reserveret til styreprogram......... "
+0009 T 0000 "0 ",CR,LF,"$"
+0010 T 0000 "XMA006 Enheder tilbage til udvidet internt lager... "
+0011 T 0000 "0 ",CR,LF,"$"
+0012 T 0000 CR,LF,"XMA100 Adapterfejl:",CR,LF," Styreprogram til udvidet internt lager er IKKE indl‘st",CR,LF,"$"
+0013 T 0000 CR,LF,"XMA200 Adapteren er ikke fundet:",CR,LF," Styreprogram til udvidet internt lager er IKKE indl‘st",CR,LF,"$"
+0014 T 0000 CR,LF,"XMA300 Fejl i parametersyntaks eller -v‘rdi:",CR,LF
+ " Styreprogram til udvidet internt lager er IKKE indl‘st",CR,LF,"$"
+0015 T 0000 SIZE1_END - 2 -$
+0016 T 0000 4 DUP (?)," Kb i orden",CR,LF,"$"
+0017 T 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK dd6d 0120
+0004 T 0000 "FDISK kan ikke anvendes p† et netv‘rksdrev",CR,LF
+0005 T 0000 "Systemet har ingen fast disk",CR,LF
+0006 T 0000 "Fejl ved l‘sning fra den faste disk",CR,LF
+0007 T 0000 "Fejl ved skrivning p† den faste disk",CR,LF
+1001 T 0000 "IBM Personal Computer"
+1002 T 0000 "Klarg›ring af den faste disk"
+1003 T 0000 "(c) Copyright IBM Corp. 1983, 1988"
+1004 T 0000 "FDISK Hovedmenu"
+1005 T 0000 "1. <R>Opret et afsnit eller logisk drev til DOS"
+1006 T 0000 "2. <R>V‘lg aktivt afsnit"
+1007 T 0000 "3. <R>Slet et afsnit eller logisk drev til DOS"
+1008 T 0000 "4. <R>Vis oplysninger om inddeling"
+1009 T 0000 "Tryk p† <H>Esc<R> for at afslutte FDISK"
+1010 T 0000 "V‘lg et af punkterne:"
+1011 T 0000 "5. <R>V‘lg den n‘ste faste disk"
+1012 T 0000 "Det aktive faste diskdrev er: <H><I>"
+1013 T 0000 "Advarsel! <R>Ingen afsnit er aktiveret - der kan ikke startes fra disk 1,"
+1014 T 0000 "medmindre et afsnit g›res aktivt"
+1015 T 0000 "Angiv valg: [<S> ]"
+1016 T 0000 "Opret et afsnit eller logisk drev til DOS"
+1017 T 0000 "1. <R>Opret prim‘rt DOS-afsnit"
+1018 T 0000 "2. <R>Opret udvidet DOS-afsnit"
+1019 T 0000 "3. <R>Opret logisk DOS-drev i det udvidede afsnit"
+1020 T 0000 "Tryk p† <H>Esc<R> for at returnere til Hovedmenuen"
+1021 T 0000 "Opret prim‘rt DOS-afsnit"
+1022 T 0000 "Skal der oprettes et prim‘rt aktivt afsnit til DOS"
+1023 T 0000 "med maksimal st›rrelse(<J>/<N>)? <H>[<S> ]"
+1024 T 0000 "(<J>/<N>)? <H>[<S> ]"
+1025 T 0000 "Afsnit Status Type St›rrelse i Mb % af disken udnyttet"
+1026 T 0000 "Den totale diskplads er <HIIIIR> Mb (1 Mb = 1.048.576 bytes)"
+1027 T 0000 "Afsnittet kan maksimalt defineres til <HIIIIR> Mb (<HIIIIR>)"
+1028 T 0000 "Skriv st›rrelsen p† det prim‘re DOS-afsnit"
+1029 T 0000 "i Mb eller % af diskpladsen: <H>[<IIISI>]"
+1030 T 0000 "Opret udvidet DOS-afsnit"
+1031 T 0000 "Opret udvidet DOS-afsnit: <H>[<IIISI>]"
+1032 T 0000 "Tryk p† <H>Esc<R> for at forts‘tte"
+1033 T 0000 "Opret logisk DOS-drev i udvidet DOS-afsnit"
+1034 T 0000 "Drv Disknavn Mb Systembrug"
+1035 T 0000 "Den totale st›rrelse p† udvidet DOS-afsnit er <HIIIIR> Mb (1 Mb = 1.048.576 bytes)"
+1036 T 0000 "Logisk drev kan maksimalt defineres til <HIIIIR> Mb <H>(<IIII>)"
+1037 T 0000 "Skriv st›rrelsen p† det logiske drev i Mb eller % af diskpladsen: <H>[<IIISI>]"
+1038 T 0000 "V‘lg aktivt afsnit"
+1039 T 0000 "Angiv det afsnit, der skal g›res aktivt: <H>[<S> ]"
+1040 T 0000 "Slet DOS-afsnit eller logisk DOS-drev"
+1041 T 0000 "1. <R>Slet prim‘rt DOS-afsnit"
+1042 T 0000 "2. <R>Slet udvidet DOS-afsnit"
+1043 T 0000 "3. <R>Slet logisk DOS-drev i det udvidede DOS-afsnit"
+1044 T 0000 "Slet prim‘rt DOS-afsnit"
+1045 T 0000 "Advarsel! <OR>Data i det prim‘re DOS-afsnit vil blive slettet."
+1046 T 0000 "Skal der forts‘ttes (<J>/<N>)? <H>[<S> ]"
+1047 T 0000 "Slet udvidet DOS-afsnit"
+1048 T 0000 "Advarsel! <OR>Data i det udvidede DOS-afsnit vil blive slettet."
+1049 T 0000 "Skal der forts‘ttes (<J>/<N>)? <H>[<S> ]"
+1050 T 0000 "Slet logisk DOS-drev i det udvidede DOS-afsnit"
+1051 T 0000 "Advarsel! <OR>Data i det logiske DOS-drev vil blive slettet."
+1052 T 0000 "Hvilket drev skal slettes? <H>[<S> ]"
+1053 T 0000 "Er det sikkert (<J>/<N>)? <H>[<S> ]"
+1054 T 0000 "Skriv disknavnet <H>[<S> ]"
+1055 T 0000 "Oplysninger om inddeling af fast disk"
+1056 T 0000 "Det udvidede DOS-afsnit indeholder logiske DOS-drev."
+1057 T 0000 "Skal der vises oplysninger om logiske drev (<J>/<N>)?<H>[<S> ]"
+1058 T 0000 "Oplysninger om logiske DOS-drev"
+1059 T 0000 "DOS-systemet vil nu blive startet igen"
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0000 "og tryk p† Enter"
+1062 T 0000 "Prim‘rt DOS-afsnit er slettet"
+1063 T 0000 "Udvidet DOS-afsnit er slettet"
+1064 T 0000 "Drevbetegnelse er slettet"
+1065 T 0000 "Afsnittet <I> er nu aktivt"
+1066 T 0000 "Prim‘rt DOS-afsnit er oprettet"
+1067 T 0000 "Udvidet DOS-afsnit er oprettet"
+1068 T 0000 "Logisk DOS-drev er oprettet, drevbetegnelse ‘ndret eller tilf›jet<W>"
+1069 T 0000 "Der er ikke defineret noget afsnit"
+1070 T 0000 "Der er ikke defineret nogen logiske drev"
+1071 T 0000 "Drevbetegnelser er blevet ‘ndret eller slettet<W>"
+1072 T 0000 "Drevet er omdirigeret"
+1073 T 0000 "Prim‘rt DOS-afsnit er oprettet, drevbetegnelse ‘ndret eller tilf›jet"
+1074 T 0000 "Systemet har ingen fast disk"
+1075 T 0000 "Fejl ved l‘sning fra den faste disk"
+1076 T 0000 "Fejl ved skrivning p† den faste disk"
+1077 T 0000 "Forkert DOS-version"
+1078 T 0000 "FDISK kan ikke anvendes p† et netv‘rksdrev"
+1079 T 0000 "Der er intet prim‘rt DOS-afsnit, der kan slettes"
+1080 T 0000 "Der er intet udvidet DOS-afsnit, der kan slettes"
+1081 T 0000 "Prim‘rt DOS-afsnit findes allerede"
+1082 T 0000 "Udvidet DOS-afsnit findes allerede"
+1083 T 0000 "For lidt diskplads til at oprette et DOS-afsnit"
+1084 T 0000 "Den angivne logiske drevst›rrelse er st›rre end den tilg‘ngelige diskplads<W>"
+1085 T 0000 "Den angivne afsnitsst›rrelse er st›rre end den tilg‘ngelige diskplads<W>"
+1086 T 0000 "Der er ikke defineret noget afsnit"
+1087 T 0000 "Det eneste afsnit p† drev 1, der kan startes, er allerede aktivt<W>"
+1088 T 0000 "Der er ingen afsnit, der kan g›res aktive"
+1089 T 0000 "Det valgte afsnit (<I>) kan ikke startes. Det aktive afsnit er ikke ‘ndret.<W>"
+1090 T 0000 "Et udvidet DOS-afsnit kan f›rst oprettes,"
+1091 T 0000 "n†r et prim‘rt afsnit er oprettet p† disk 1<W>"
+1092 T 0000 "Tilg‘ngelig diskplads i det udvidede DOS-afsnit"
+1093 T 0000 "er tildelt de logiske drev<W>"
+1094 T 0000 "Udvidet DOS-afsnit kan ikke slettes, n†r der findes logiske drev<W>"
+1095 T 0000 "Alle logiske drev er slettet i det udvidede DOS-afsnit<W>"
+1096 T 0000 " er ikke et korrekt valg. Angiv <III>"
+1097 T 0000 "Advarsel! Det aktiverede afsnit kan ikke startes.<W>"
+1098 T 0000 " Der findes kun afsnit, der ikke kan startes."
+1099 T 0000 "Kun afsnit p† disk 1 kan g›res aktive<W>"
+1100 T 0000 "Det maksimale antal logiske DOS-drev er oprettet<W>"
+1101 T 0000 "Der kan ikke oprettes et afsnit med en st›rrelse p† 0"
+1102 T 0000 "Drev <II> er allerede slettet"
+1103 T 0000 "Ingen adgang til drev <I><OW>"
+1104 T 0000 "Forkert valg. Angiv <III><W>"
+1105 T 0000 "Prim‘rt DOS-afsnit p† disk 1 kan ikke slettes,"
+1106 T 0000 " n†r der findes et udvidet afsnit<W>"
+1107 T 0000 "Forkert valg. Tryk p† Enter.<W>"
+1108 T 0000 "Disknavnet er forkert<W>"
+1109 T 0000 "Der kan ikke oprettes logisk DOS-drev uden et"
+1110 T 0000 "udvidet DOS-afsnit p† det aktive drev<W>"
+1111 T 0000 "Der er intet logisk DOS-drev, der kan slettes"
+1112 T 0000 "Fejl <I> i meddelelse. Se fejldefinitionen i starten af FDISKC.MSG"
+1113 T 0000 "Intern fejl"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/finland.msg b/private/mvdm/dos/v86/messages/finland.msg
new file mode 100644
index 000000000..e34e0cb89
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/finland.msg
@@ -0,0 +1,1142 @@
+0022
+COMMON 0006 0038
+0001 T 0000 "V„„r„ DOSin versio.",CR,LF
+0002 T 0000 "%1 on jo asennettu.",CR,LF
+0003 T 0000 "Levyss„ k„ytett„viss„ %1 tavua.",CR,LF
+0004 T 0000 "Vapaana %1 tavua.",CR,LF
+0005 T 0000 "Viallisia sektoreita %1 tavua.",CR,LF
+0006 T 0000 "Kokonaislevytila %1 tavua.",CR,LF
+0007 T 0000 "Kokonaismuistitila %1 tavua.",CR,LF
+0008 T 0000 "J„rjestelm„n k„yt”ss„ %1 tavua.",CR,LF
+0009 T 0000 "%1 on asennettu.",CR,LF
+0010 T 0000 "%1 ei ole asennettu.",CR,LF
+0011 T 0000 "%1 ei ole asennettu.",CR,LF
+0012 T 0000 "%1 ei ole k„ytett„viss„ verkkoasemassa.",CR,LF
+0013 T 0000 "",
+0014 T 0000 "%1 ei ole k„ytett„viss„ (asemaan on kohdistettu SUBST tai ASSIGN).",CR,LF
+0015 T 0000 "Tiedostoa %1 ei voi ajaa.",CR,LF
+0016 T 0000 "Muistin yl„alue ei ole k„ytett„viss„.",CR,LF
+0017 T 0000 "Virheellinen tiedostojen tilanvaraustaulukko asemassa %1.",CR,LF
+0018 T 0000 "Tiedostoa ei voi kopioida itsens„ p„„lle.",CR,LF
+0019 T 0000 "Aseta kohdelevyke asemaan %1.",CR,LF
+0020 T 0000 "Levytila ei riit„.",CR,LF
+0021 T 0000 "Taltion nimess„ on kelvottomia merkkej„.",CR,LF
+0022 T 0000 "V„„r„ koodisivu.",CR,LF
+0023 T 0000 "Virheellinen p„iv„m„„r„.",CR,LF
+0024 T 0000 "Virheellinen kellonaika.",CR,LF
+0025 T 0000 "Virheellinen polku.",CR,LF
+0026 T 0000 "L„hdeasemaa ei ole m„„ritetty.",CR,LF
+0027 T 0000 "Kohdeasemaa ei ole m„„ritetty.",CR,LF
+0028 T 0000 "Jatka painamalla jotain n„pp„int„.",CR,LF
+0029 T 0000 "L„hdepolku on m„„ritett„v„.",CR,LF
+0030 T 0000 "J„rjestelm„tiedostot on siirretty.",CR,LF
+0031 T 0000 "",
+0032 T 0000 "J„rjestelm„ ei voi luoda hakemistoa.",CR,LF
+0033 T 0000 "Levy asemassa %1 on nimet”n.",CR,LF
+0034 T 0000 "Levy asemassa %1 on %2.",CR,LF
+0035 T 0001 "Sy”t„ taltion nimi (enint„„n 11 merkki„). "
+0036 T 0000 "Levyn sarjanumero on %1-%2.",CR,LF
+0037 T 0000 "V„„r„ tiedoston tyyppi.",CR,LF
+0038 T 0001 CR,LF
+EXTEND 074d 0089
+0001 T 0000 "Virheellinen toiminto.",CR,LF
+0002 T 0000 "Tiedostoa ei l”ydy.",CR,LF
+0003 T 0000 "Polkua ei l”ydy.",CR,LF
+0004 T 0000 "Liian monta tiedostoa avoinna.",CR,LF
+0005 T 0000 "K„ytt”„ ei sallita.",CR,LF
+0006 T 0000 "Virheellinen tiedostoripa.",CR,LF
+0007 T 0000 "Muistinohjauslohkot ovat tuhoutuneet.",CR,LF
+0008 T 0000 "Muistitila ei riit„.",CR,LF
+0009 T 0000 "Virheellinen muistilohkon osoite.",CR,LF
+0010 T 0000 "Virheellinen k„ytt”ymp„rist”.",CR,LF
+0011 T 0000 "Muotovirhe.",CR,LF
+0012 T 0000 "Virheellinen toiminnon parametri.",CR,LF
+0013 T 0000 "Tietovirhe.",CR,LF
+0014 T 0000 "",
+0015 T 0000 "V„„r„ aseman tunnus.",CR,LF
+0016 T 0000 "K„yt”ss„ oleva hakemisto on yritetty poistaa.",CR,LF
+0017 T 0000 "Laite ei ole sama.",CR,LF
+0018 T 0000 "Tiedostoja ei ole enemp„„.",CR,LF
+0019 T 0000 "Kirjoitussuoja on k„yt”ss„.",CR,LF
+0020 T 0000 "V„„r„ yksikk”.",CR,LF
+0021 T 0000 "Ei toimintavalmis.",CR,LF
+0022 T 0000 "V„„r„ laitekutsu.",CR,LF
+0023 T 0000 "Tietovirhe.",CR,LF
+0024 T 0000 "V„„r„t laitekutsun parametrit.",CR,LF
+0025 T 0000 "Hakuvirhe.",CR,LF
+0026 T 0000 "V„„r„ tietov„line.",CR,LF
+0027 T 0000 "J„rjestelm„ ei l”yd„ sektoria.",CR,LF
+0028 T 0000 "Kirjoittimesta on loppunut paperi.",CR,LF
+0029 T 0000 "Kirjoitus ei onnistu.",CR,LF
+0030 T 0000 "Luku ei onnistu.",CR,LF
+0031 T 0000 "M„„ritt„m„t”n virhe.",CR,LF
+0032 T 0000 "Yhteisk„ytt”virhe.",CR,LF
+0033 T 0000 "Tiedosto lukittu.",CR,LF
+0034 T 0000 "Levykett„ ei saa vaihtaa.",CR,LF
+0035 T 0000 "FCB ei k„ytett„viss„.",CR,LF
+0036 T 0000 "J„rjestelm„n kapasiteetti ei riit„.",CR,LF
+0037 T 0000 "Koodisivut eiv„t vastaa toisiaan.",CR,LF
+0038 T 0000 "Sy”tt”tiedot ovat lopussa.",CR,LF
+0039 T 0000 "Levytila ei riit„.",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 T 0000 "Tiedostoj„rjestelm„ ei tue pyynt”„.",CR,LF
+0051 T 0000 "Liitt„minen tiedostoj„rjestelm„„n ei onnistu.",CR,LF
+0052 T 0000 "Tiedostoj„rjestelm„n nimi on jo olemassa.",CR,LF
+0053 T 0000 "Tiedostoj„rjestelm„n nime„ ei l”ydy.",CR,LF
+0054 T 0000 "Tiedostoj„rjestelm„ on varattuna.",CR,LF
+0055 T 0000 "Tiedostoj„rjestelm„laitetta ei en„„ ole.",CR,LF
+0056 T 0000 "Tiedostoj„rjestelm„n kapasiteetti ei riit„.",CR,LF
+0057 T 0000 "Tiedostoj„rjestelm„ss„ on laiteh„iri”.",CR,LF
+0058 T 0000 "Tiedostoj„rjestelm„ tuotti virheellisen vastauksen.",CR,LF
+0059 T 0000 "Tiedostoj„rjestelm„ss„ on odottamaton h„iri”.",CR,LF
+0060 T 0000 "Tiedostoj„rjestelm„ ei ole yhteensopiva.",CR,LF
+0061 T 0000 "Laitteen tulostustiedoston raja on ylittynyt.",CR,LF
+0062 T 0000 "Laitteen tulostustiedoston koko on ylittynyt.",CR,LF
+0063 T 0000 "Laitteen tulostustiedostoa ei en„„ ole.",CR,LF
+0064 T 0000 "Tiedostoj„rjestelm„n nime„ ei en„„ ole.",CR,LF
+0065 T 0000 "Tiedostoj„rjestelm„ ei salli k„ytt”„.",CR,LF
+0066 T 0000 "Tiedostoj„rjestelm„laitteen tyyppi on v„„r„.",CR,LF
+0067 T 0000 "Tiedostoj„rjestelm„„ ei l”ydy.",CR,LF
+0068 T 0000 "Tiedostoj„rjestelm„n kapasitetti ei riit„.",CR,LF
+0069 T 0000 "Tiedostoj„rjestelm„n kapasitetti ei riit„.",CR,LF
+0070 T 0000 "Tiedostoj„rjestelm„laitetta ei voi tilap„isesti k„ytt„„.",CR,LF
+0071 T 0000 "J„rjestelm„ ei salli tiedostoj„rjestelm„pyynt”„.",CR,LF
+0072 T 0000 "Tiedostoj„rjestelm„laite on pys„ytetty.",CR,LF
+0073 T 0001 "Tiedostoj„rjestelm„n osa ei ole k„ytett„viss„.",CR,LF
+0074 T 0001 "Tiedostoj„rjestelm„ss„ on odottamaton h„iri”.",CR,LF
+0075 T 0001 "Tiedostoj„rjestelm„ss„ on odottamaton h„iri”.",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0000 "Tiedosto on olemassa.",CR,LF
+0081 T 0000 "",
+0082 T 0000 "Hakemistomerkinn„n teko ei onnistu.",CR,LF
+0083 T 0000 "Kriittinen virhe on yritetty palauttaa ohjelmaan.",CR,LF
+0084 T 0000 "Liian monta liit„nt„„.",CR,LF
+0085 T 0000 "Laite tai tiedosto on jo liitetty.",CR,LF
+0086 T 0000 "V„„r„ tunnussana.",CR,LF
+0087 T 0000 "Virheellinen parametri.",CR,LF
+0088 T 0000 "Tiedostoj„rjestelm„n tietovirhe.",CR,LF
+0089 T 0000 "Tiedostoj„rjestelm„ ei tue toimintoa.",CR,LF
+PARSE 1770 0011
+0001 T 0000 "Liian monta parametria.",CR,LF
+0002 T 0000 "Tarvittava parametri puuttuu.",CR,LF
+0003 T 0000 "Virheellinen valitsin.",CR,LF
+0004 T 0000 "Virheellinen avainsana.",CR,LF
+0005 T 0000 "",
+0006 T 0000 "Parametrin arvo ei ole sallitulla alueella.",CR,LF
+0007 T 0000 "Parametrin arvo ei kelpaa.",CR,LF
+0008 T 0000 "Parametrin arvo ei kelpaa.",CR,LF
+0009 T 0000 "Parametrin muoto on virheellinen.",CR,LF
+0010 T 0000 "Virheellinen parametri.",CR,LF
+0011 T 0000 "Virheellinen parametriyhdistelm„.",CR,LF
+COMMAND 198a 0091
+0201 T 0000 "L"
+0202 T 0000 "U"
+0203 T 0000 "O"
+0204 T 0000 "P"
+0205 T 0000 "K"
+0206 T 0000 "E"
+0210 T 0000 "Lopetus"
+0211 T 0000 ", uusinta"
+0212 T 0000 ", ohitus"
+0213 T 0000 ", palautus"
+0214 T 0000 "?"
+0215 T 0000 "luettaessa:",0
+0216 T 0000 "kirjoitettaessa:",0
+0217 T 0000 "%1 asema %2",CR,LF
+0218 T 0000 "%1 laite %2",CR,LF
+0219 T 0000 "Aseta asemaan levyke %1, sarjanumero %2-%3",CR,LF
+0221 T 0000 "V„„r„ COMMAND.COM-tiedosto.",CR,LF
+0222 T 0000 "Aseta %1-tiedoston sis„lt„v„ levyke asemaan %2.",CR,LF
+0224 T 0001 CR,LF,"Er„k„sittelyn lopetus? (K/E) "
+0225 T 0000 "%1:ta ei voi ajaa.",CR,LF
+0226 T 0000 "Virhe EXE-tiedostossa.",CR,LF
+0227 T 0000 "Ohjelma ei mahdu muistiin.",CR,LF
+0228 T 0000 CR,LF,"Tiedostoripoja ei vapaina."
+0229 T 0000 "V„„r„ komento tai tiedoston nimi.",CR,LF
+0231 T 0000 CR,LF,"Muistin varausvirhe."
+0232 T 0000 CR,LF,"COMMAND-tiedostoa ei voi lukea muistiin. Istunto p„„ttyy.",CR,LF
+0233 T 0000 CR,LF,"COMMAND-tiedostoa ei voi k„ynnist„„. Lopetus.",CR,LF
+0234 T 0000 CR,LF,"Ylimm„n tason toimintovirhe. K„sittely„ ei voi jatkaa.",CR,LF
+0235 T 0000 CR,LF
+0463 T 0000 "K„ytt”ymp„rist”n tila ei riit„.",CR,LF
+0464 T 0000 CR,LF,"IBM Personal Computer DOS",CR,LF
+ "versio 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF
+0465 T 0000 "M„„ritetty COMMAND-tiedoston saantipolku on v„„r„."
+0466 T 0000 "M„„ritetty COMMAND-tiedoston saantipolku on v„„r„. K„ytt” kielletty."
+1002 T 0000 "Sama nimi tai tiedostoa ei l”ydy.",CR,LF
+1003 T 0000 "V„„r„ polku tai tiedoston nimi.",CR,LF
+1007 T 0000 "K„ytt”ymp„rist”n tila ei riit„.",CR,LF
+1008 T 0000 "Tiedoston luontivirhe.",CR,LF
+1009 T 0000 "Er„k„sittelytiedosto puuttuu.",CR,LF
+1010 T 0000 CR,LF,"Pane er„k„sittelytiedoston sis„lt„v„ levyke asemaan.",CR,LF
+1011 T 0000 "V„„r„ komento tai tiedoston nimi.",CR,LF
+1016 T 0000 "Vastaanottavan tiedoston sis„lt” h„vinnyt ennen kopiointia.",CR,LF
+1017 T 0000 "V„„r„ tiedoston nimi tai tiedostoa ei l”ydy.",CR,LF
+1018 T 0000 "%1 tiedosto(a) kopioitu.",CR,LF
+1019 T 0000 "%1 tiedosto(a)."
+1022 T 0000 "Koodisivua %1 ei ole valmisteltu j„rjestelm„lle.",CR,LF
+1023 T 0000 "Koodisivua %1 ei ole valmisteltu kaikille laitteille.",CR,LF
+1024 T 0000 "K„yt”ss„ oleva koodisivu: %1",CR,LF
+1025 T 0000 "NLSFUNC-tiedostoa ei ole asennettu.",CR,LF
+1027 T 0000 "T„t„ asemaa ei en„„ voi k„ytt„„."
+1029 T 0000 "Nime„ ei l”ydy.",CR,LF
+1030 T 0000 "Komennon muoto on v„„r„.",CR,LF
+1032 T 0000 "P„iv„m„„r„ on %1 %2",CR,LF
+1033 T 0000 "SunMaaTiiKesTorPerLau"
+1034 T 0000 "Anna uusi p„iv„m„„r„ (%1):"
+1036 T 0000 "Kellonaika on %1",CR,LF
+1037 T 0000 "Anna uusi kellonaika:"
+1038 T 0000 ", Poista? (K/E)"
+1039 T 0000 "Kaikki hakemiston tiedostot poistuvat!",CR,LF
+ "Oletko varma? (K/E)"
+1040 T 0000 "IBM Personal Computer DOS, versio %1.%2",CR,LF
+1044 T 0000 "Ep„kelpo hakemisto.",CR,LF
+1046 T 0000 "Polku on v„„r„, kyseess„ ei ole hakemisto,",CR,LF,"tai hakemisto ei ole tyhj„.",CR,LF
+1047 T 0000 "M„„rit„ ON (k„yt”ss„) tai OFF (ei k„yt”ss„).",CR,LF
+1048 T 0000 "Hakemisto %1",CR,LF
+1049 T 0000 "Polku puuttuu.",CR,LF
+1050 T 0000 "Saantipolussa on v„„r„ asema.",CR,LF
+1051 T 0000 "Virheellinen laitenimi.",CR,LF
+1052 T 0000 "FOR-komento ei voi olla sis„kk„inen.",CR,LF
+1053 T 0000 "V„litiedostovirhe per„kk„isteht„v„n aikana.",CR,LF
+1054 T 0000 "Laitteesta ei voi lukea bin„„ritietoja.",CR,LF
+1055 T 0000 "BREAK on %1 ",CR,LF
+1056 T 0000 "VERIFY on %1 ",CR,LF
+1057 T 0000 "ECHO on %1 ",CR,LF
+1059 T 0000 "OFF",0
+1060 T 0000 "ON",0
+1061 T 0000 "H„iri” kirjoitettaessa.",CR,LF
+1063 T 0000 "%1"
+1064 T 0000 "%1"
+1065 T 0000 "%1"
+1066 T 0000 "%1"
+1067 T 0000 9
+1068 T 0000 " <HAKEM> "
+1069 T 0000 8," ",8
+1070 T 0000 CR,LF
+1071 T 0000 "%1"
+1072 T 0000 "kk.pp.vv"
+1073 T 0000 "pp.kk.vv"
+1074 T 0000 "vv.kk.pp"
+1075 T 0000 "%1 %2"
+1076 T 0000 "%1"
+1077 T 0001 " %1 %2"
+1078 T 0000 "Hakemisto on jo olemassa.",CR,LF
+ATTRIB 292e 0016
+0004 T 0000 "Parametrien m„„r„ on v„„r„.",CR,LF
+0005 T 0000 "V„„r„ polku tai tiedostoa ei l”ydy.",CR,LF
+0006 T 0000 "Komennon muoto on v„„r„.",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 T 0000 "%1, Koodisivut eiv„t vastaa toisiaan.",CR,LF,"Oletko varma? (K/E)"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 T 0000 "V„„r„ tiedoston tyypin arvo.",CR,LF
+0199 T 0000 "Virheellinen jatkettu attribuutti.",CR,LF
+0201 T 0000 "J„rjestelm„ ei l”yd„ jatketun attribuutin nime„.",CR,LF
+0204 T 0000 "J„rjestelm„ ei voi m„„ritt„„ jatketun attribuutin nime„.",CR,LF
+0205 T 0000 "Tiedostoj„rjestelm„ tuntee jatketun attribuutin nimen mutta ei tue sit„.",CR,LF
+0206 T 0000 "Jatkettujen attribuuttien tyypit eiv„t vastaa toisiaan.",CR,LF
+0208 T 0000 "Jatketun attribuutin t„t„ arvoa ei voi k„ytt„„.",CR,LF
+ASSIGN 2c99 0001
+0002 T 0000 "Alkuper„inen: %1: Uusi m„„ritys: %2:",cr,lf
+CHKDSK 2ce7 0063
+0003 T 0000 "Muunnetaanko kadonneet ketjut tiedostoiksi? (K/E)"
+0004 T 0000 "Hakemistossa on virhe, jonka elvytys ei onnistu."
+0005 T 0000 "Haluatko muuntaa hakemiston tiedostoksi? (K/E)"
+0007 T 0000 "%1 tavua tilaa levyss„."
+0008 T 0000 "%1 tavua viallisissa sektoreissa."
+0009 T 0000 "%1 tavua %2 piilotiedostossa."
+0010 T 0000 "%1 tavua %2 hakemistossa."
+0011 T 0000 "%1 tavua %2 k„ytt„j„tiedostossa."
+0012 T 0000 "%1 tavua %2 elvytetyss„ tiedostossa."
+0013 T 0000 "%1 tavua olisi %2 elvytetyss„ tiedostossa."
+0014 T 0000 "%1 tavua k„ytett„v„n„ levyss„."
+0015 T 0000 "Kokonaismuistitila %1 tavua."
+0016 T 0000 "%1 tavua vapaana."
+0017 T 0000 "CHKDSK ei ole k„ytett„viss„ verkkoasemassa."
+0018 T 0000 "CHKDSK ei ole k„ytett„viss„ (asemaan on kohdistettu SUBST tai ASSIGN)."
+0019 T 0000 "Levy ei ehk„ ole DOS-levy?",CR,LF,"Jatketaanko? (K/E)"
+0020 T 0000 "Levyvirhe tiedostojen tilanvaraustaulukon %1 luvun aikana.",CR,LF
+0021 T 0000 "Hakemisto %1"
+0022 T 0000 "Tiedostossa %1 on %2 erillislohkoa."
+0023 T 0000 "Kaikki m„„ritetyt tiedostot koostuvat per„tt„isist„ lohkoista."
+0024 T 0000 "J„rjestelm„ havaitsi virheit„. Parametria F ei ole m„„ritetty.",CR,LF,"Korjaukset eiv„t tallennu levyyn."
+0025 T 0000 " K„sittely„ ei voi jatkaa. %1%2"
+0026 T 0000 " Aseman %1 tiedostojen varaustaulukko on virheellinen."
+0029 T 0000 " CHDIR on ep„onnistunut. J„rjestelm„ yritt„„ vaihtoehtoista menetelm„„."
+0030 T 0000 " Virheellinen sektoriryhm„, tiedosto katkaistu."
+0031 T 0000 " Virheellinen alihakemistomerkint„."
+0032 T 0000 " ei ole olemassa."
+0033 T 0000 " Tiedoston %1 ensimm„inen sektoriryhm„numero on v„„r„. Sy”te lyhennetty."
+0034 T 0000 " Tiedoston %1 tilanvarausvirhe: kokoa muutettu."
+0035 T 0000 " J„rjestelm„ ei pysty elvytt„m„„n ..-hakemistomerkint„„. Ajo jatkuu."
+0036 T 0000 " Hakemisto on tyhj„ (ei .- tai ..-osaa)."
+0037 T 0000 " Hakemisto on yhdistetty."
+0038 T 0000 " J„rjestelm„ ei pysty elvytt„m„„n ..-hakemistomerkint„„."
+0039 T 0000 " Merkinn„ss„ on kelvoton linkitys."
+0040 T 0000 " Merkinn„ss„ on kelvoton attribuutti."
+0041 T 0000 " Merkinn„n koko on kelvoton."
+0042 T 0000 " on linkitetty ristiin sektoriryhm„„n %1."
+0043 T 0000 " Vaihto hakemistoon %1 ei onnistu.",CR,LF,"J„rjestelm„ ei k„sittele t„m„n kohdan j„lkeist„ hakemistoa."
+0044 T 0000 " J„rjestelm„ ei k„sittele t„m„n kohdan j„lkeist„ hakemistoa."
+0045 T 0000 " %1 tavua levytilaa on vapautunut."
+0046 T 0000 " %1 tavua levytilaa voidaan vapauttaa."
+0047 T 0000 "Taltio %1, luotu %2 %3.",CR,LF
+0048 T 0000 "Levyss„ on k„ytett„v„n„ %1 varausyksikk”„."
+0049 T 0000 "Kussakin varausyksik”ss„ on %1 tavua."
+0050 T 0000 "CHKDSK-komentoa ei voi k„ytt„„ asemaan %1."
+0051 T 0000 " Jatketuilla attribuuteilla kelvottomia sektoriryhmi„. Attribuutit lyhennetty."
+0052 T 0000 " Laajennusattribuuttien varausvirhe. Attribuutit lyhennetty."
+0053 T 0000 "Virheellinen parametri."
+0055 T 0000 "Polkua ei l”ydy."
+0056 T 0000 "Tiedostoa ei l”ydy."
+0058 T 0000 " %1 kadonnutta sektoriryhm„„ l”ytynyt %2 ketjusta."
+0059 T 0000 CR,LF
+0060 T 0000 " Vaihto levyn p„„hakemistoon ei onnistu.",CR,LF
+0061 T 0000 " Levyvirhe tiedostojen tilanvaraustaulukon %1 kirjoituksen aikana." ;badw_arg
+0062 T 0000 " %1"
+0063 T 0000 "K„yt”ss„ oleva hakemisto on virheellinen."
+0064 T 0000 "%1",CR,LF
+0065 T 0000 " Levyn p„„hakemiston tila ei riit„.",CR,LF," Siirr„ tiedostoja pois p„„hakemistosta. Anna CHKDSK uudelleen."
+0066 T 0000 "%1 %2 %3"
+0067 T 0000 "%1 %2, %3"
+0068 T 0000 "%1%2%3%4%5"
+0069 T 0000 "%1%2%3%4"
+0070 T 0000 "Levyss„ on k„ytett„v„n„ %1 varausyksikk”„."
+DEBUG 3b37 0062
+0004 T 0000 "Varaus on ep„onnistunut tai m„„ritetty puskuri on liian pieni.",CR,LF
+0005 T 0000 "Sanomatiedot puuttuvat tai ne ovat virheellisi„.",CR,LF
+0006 T 0000 "Virheellinen laitenimi."
+0007 T 0000 "Tulostuslaitteen PRN avaus ei ole onnistunut.",CR,LF
+ "Sy”t„ tulostuslaitteen nimi."
+0008 T 0000 CR,LF
+0009 T 0000 CR,LF,"Ohjelma on p„„tetty normaalisti."
+0010 T 0000 "V„„r„ aseman tunnus."
+0012 T 0000 "Tiedoston luontivirhe."
+0013 T 0000 "Levytila ei riit„."
+0014 T 0000 "Levyvirhe. H„iri” luettaessa: asema %1."
+0015 T 0000 "Levyvirhe. H„iri” kirjoitettaessa: asema %1."
+0016 T 0000 "Kirjoitussuoja k„yt”ss„. H„iri” luettaessa: asema %1."
+0017 T 0000 "Kirjoitussuoja k„yt”ss„. H„iri” kirjoitettaessa: asema %1."
+0019 T 0000 "%1^ virhe."
+0020 T 0000 "Virhe EXE- tai HEX-tiedostossa."
+0021 T 0000 "EXE- ja HEX-tiedostoja ei voi kirjoittaa."
+0022 T 0000 "EXEC-virhe."
+0023 T 0000 "Virhe kirjoitettaessa, kohde m„„ritt„m„tt„."
+0024 T 0000 "Ei k„ytt”oikeutta."
+0025 T 0000 "Pariteettivirhe tai yritys k„ytt„„ olematonta muistia."
+0026 T 0000 "-"
+0027 T 0000 "%1 -"
+0032 T 0000 "%1%2"
+0033 T 0000 "%1:%2 %3"
+0034 T 0000 "%1 %2"
+0035 T 0000 "%1 %2",CR,LF,":"
+0036 T 0000 "%1=%2 "
+0037 T 0000 "%1 virhe."
+0038 T 0000 "Kirjoitetaan %1 tavua."
+0039 T 0000 "%1:%2="
+0040 T 0000 "%1"
+0041 T 0000 "%1"
+0042 T 0000 "%1:%2 %3 %4 %5:%6"
+0043 T 0000 "%1 virhe %2 asema %3."
+0044 T 0000 32,8
+0045 T 0000 "Sanomank„sittelij„n varaus ei onnistu.",CR,LF
+0046 T 0000 "%1"
+0047 T 0000 "%1"
+0050 T 0000 "%2 EMS-sivusta on varattu %1.",cr,lf
+0051 T 0000 "%2 EMS-rivoista on varattu %1.",cr,lf
+0054 T 0000 "Sivukehys = "
+0055 T 0000 "Luotuja ripoja = %1 ",cr,lf
+0056 T 0000 "Looginen sivu %1 on asetettu vastaamaan fyysist„ sivua %2.",cr,lf
+0057 T 0000 "EMS-laitevirhe tai -ohjelmistovirhe.",cr,lf
+0058 T 0000 "Ripaa ei l”ydy.",cr,lf
+0059 T 0000 "Virheellinen toimintokoodi.",cr,lf
+0060 T 0000 "Tiedostoripoja ei vapaina.",cr,lf
+0061 T 0000 "Tallennus- tai palautusvirhe.",cr,lf
+0062 T 0000 "Kokonaissivum„„r„ on ylitetty.",cr,lf
+0063 T 0000 "Vapaiden sivujen m„„r„ on ylitetty.",cr,lf
+0064 T 0000 "Parametrivirhe.",cr,lf
+0065 T 0000 "Looginen sivu ei ole sallitulla alueella.",cr, lf
+0066 T 0000 "Fyysinen sivu ei ole sallitulla alueella.",cr, lf
+0067 T 0000 "Tallennusalue on jo k„yt”ss„.",cr,lf
+0068 T 0000 "Tallennusalue ei ole k„yt”ss„.",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0000 "EMS-parametri puuttuu tai on kelvoton.",cr,lf
+0072 T 0000 "Ripa %1 on varannut %2 sivua.",cr,lf
+0074 T 0000 "EMS:n palautus on onnistunut.",cr,lf
+0075 T 0000 "Fyysinen sivu %1 = kehyslohko %2.",cr,lf
+0076 T 0000 "Ripa %1 vapautettu.",cr,lf
+0078 T 0000 "EMS:„„ ei ole asennettu.",cr,lf
+DRIVER 45fb 0002
+0002 T 0001 "Asemaa ei ole m„„ritetty.",CR,LF
+0003 T 0001 "Asemalle %1 on ladattu ulkoinen levyajuri.",CR,LF
+EDLIN 467e 0028
+0006 T 0000 "*"
+0007 T 0000 "V„„r„ polku tai tiedoston nimi.",CR,LF
+0008 T 0000 "Tiedoston nime„ ei ole m„„ritetty.",CR,LF
+0009 T 0000 "Virheellinen parametri.",CR,LF
+0010 T 0000 "Tiedosto on lukutiedosto.",CR,LF
+0011 T 0000 "Tiedoston luontivirhe.",CR,LF
+0012 T 0000 "Liian monta tiedostoa avoinna.",CR,LF
+0013 T 0000 "Lukuvirhe tiedostossa:",CR,LF,"%1",CR,LF
+0014 T 0000 "Ei voi muokata .BAK-tiedostoa. Muuta tiedoston nimi.",CR,LF
+0015 T 0000 "Hakemistossa ei ole tilaa tiedostolle.",CR,LF
+0016 T 0000 "Levy on t„ynn„. Muutokset on menetetty.",CR,LF
+0017 T 0000 "Tiedostoa ei l”ydy.",CR,LF
+0018 T 0000 "Virheellinen sy”te." CR,LF
+0019 T 0000 "Uusi tiedosto.",CR,LF
+0020 T 0000 "Ei l”ydy.",CR,LF
+0021 T 0000 "Hyv„ksy? "
+0022 T 0000 "Rivi on liian pitk„.",CR,LF
+0023 T 0000 "Sy”tt”tiedoston loppu.",CR,LF
+0024 T 0000 "Haluatko lopettaa muokkauksen? (K/E)"
+0025 T 0000 "Kohderivin numero on m„„ritett„v„.",CR,LF
+0026 T 0000 "Muisti ei riit„ koko tiedoston yhdist„miseen.",CR,LF
+0027 T 0000 CR,LF
+0028 T 0000 LF
+0029 T 0000 "Jatketaanko? (K/E)"
+0030 T 0000 "Sanoman tulostus ei onnistu.",CR,LF
+0031 T 0000 "%1"
+0032 T 0000 "%1:%2"
+0033 T 0000 "Yhdist„minen ei onnistu - koodisivut eiv„t vastaa toisiaan.",CR,LF
+EXE2BIN 4b68 0010
+0002 T 0000 "Muistitila ei riit„.",CR,LF
+0003 T 0000 "Sanomia ei l”ydy.",CR,LF
+0004 T 0000 "Ei k„ytt”oikeutta.",CR,LF
+0005 T 0000 "Tiedostoa ei voi muuntaa.",CR,LF
+0006 T 0000 "Tiedostoa ei l”ydy.",CR,LF
+0007 T 0000 "Tiedoston luontivirhe.",CR,LF
+0008 T 0000 "Korjauksia tarvitaan - peruslohko (heksa):"
+0009 T 0000 "Virheellinen parametri.",CR,LF
+0011 T 0000 "HUOMAUTUS - Lukuvirhe EXE-tiedossa.",CR,LF
+ "Luettu m„„r„ on pienempi kuin otsikon ilmoittama m„„r„.",CR,LF
+0012 T 0000 "Tiedoston nime„ ei ole m„„ritetty.",CR,LF
+FIND 4d93 0001
+0004 T 0000 "FIND: "
+FORMAT 4dbd 0044
+0002 T 0000 CR,"FORMAT on alustanut levyst„ %1 prosenttia."
+0004 T 0000 CR,"Alustus on p„„ttynyt. ",CR,LF
+0007 T 0000 "Aseta uusi levyke asemaan %1:",CR,LF
+0009 T 0000 "Aseta levyke uudestaan asemaan %1:",CR,LF
+0010 T 0000 "Sy”t„ taltion nimi (enint„„n 11 merkki„)."
+0011 T 0000 CR,"Alustus ei ole k„ytett„viss„ asemassa %1:.", CR,LF
+0012 T 0000 CR,"Laiteajurin laiteparametrit ovat virheellisi„.",CR,LF
+0013 T 0000 CR,"Virhe IOCTL-kutsussa. ",CR,LF
+0014 T 0000 CR,"Ei lohkolaite. ",CR,LF
+0015 T 0000 CR,"Virhe tiedostojen tilanvaraustaulukon kirjoituksessa.",CR,LF
+0016 T 0000 CR,"Virhe hakemiston kirjoituksessa.",CR,LF
+0017 T 0000 CR,"FORMAT ei ole k„ytett„viss„ (asemaan on kohdistettu SUBST tai ASSIGN).",CR,LF
+0018 T 0000 CR,"J„rjestelm„n tiedostot puuttuvat.",CR,LF
+0019 T 0000 CR,"Verkkoasemaa ei voi alustaa.",CR,LF
+0020 T 0000 CR,"Taltion nimess„ on kelvottomia merkkej„.",CR,LF
+0021 T 0000 CR,"J„rjestelm„ ei hyv„ksy parametreja.",CR,LF
+0022 T 0000 CR,"Alustus on keskeytynyt. ",CR,LF
+0023 T 0000 CR,"Levy ei kelpaa j„rjestelm„levyksi.",CR,LF
+0024 T 0000 CR,"Kelvoton tietov„line tai 0-ura on viallinen. Levy on k„ytt”kelvoton.",CR,LF
+0025 T 0000 CR,"Aloitustietueen kirjoitus ei onnistu.",CR,LF
+0026 T 0000 CR,"Hakemiston lukuvirhe.",CR,LF
+0028 T 0000 CR,"ja paina Enter-n„pp„int„."
+0029 T 0000 CR,"Kelvoton taltion nimi.",CR,LF
+0031 T 0000 CR,"Sy”t„ taltion nimi: asema %1:."
+0032 T 0000 CR,"Umpilevyn alustuskomennossa on",CR,LF,"virheellinen parametri.",CR,LF
+0035 T 0000 CR,"Osiotaulukon lukuvirhe.",CR,LF
+0037 T 0000 CR,"Alustus on turmeltunut.",CR,LF
+0038 T 0000 CR,"Alustus ei ole k„ytett„viss„ asemassa %1:.",CR,LF
+0039 T 0000 CR,"Levyvirhe tai kysess„ ei ole j„rjestelm„levy.",CR,LF
+0040 T 0000 CR,"Virheellinen osiotaulukko. ",CR,LF
+0041 T 0000 CR,"Asema ei hyv„ksy parametreja.",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"Aseta DOS-levyke asemaan %1:.",CR,LF
+0045 T 0000 CR,LF,"HUOMAUTUS! KAIKKI ASEMAN %1: KIINTEŽN",CR,LF
+ "UMPILEVYN TIEDOT TUHOUTUVAT!",CR,LF
+ "Haluatko jatkaa FORMAT-ohjelmalla? (K/E)"
+0046 T 0000 CR,"Haluatko alustaa toisen levykkeen? (K/E)"
+0047 T 0000 CR,"Osiotaulukon lukuvirhe.",CR,LF
+0048 T 0000 CR,"Osiotaulukon kirjoituksen virhe.",CR,LF
+0049 T 0000 CR,"Virheellinen parametriyhdistelm„.", CR,LF
+0050 T 0000 "Levyss„ on k„ytett„viss„ %1 varausyksikk”„.",CR,LF
+0051 T 0000 "Kussakin varausyksik”ss„ on %1 tavua.",CR,LF
+0052 T 0000 CR, "Osiotaulukon kirjoituksen virhe.",CR,LF
+0053 T 0000 CR,"Sama parametri on sy”tetty kahdesti.",CR,LF
+0054 T 0000 CR,"Sek„ /T- ett„ /N-parametri on sy”tett„v„.",CR,LF
+JOIN 588b 0001
+0002 T 0000 CR,LF,"Hakemisto ei ole tyhj„.",CR,LF
+MORE 58d2 0001
+0002 T 0000 "-- Lis„„ --"
+PRINT 5901 0022
+0002 T 0000 CR,LF
+0006 T 0000 " - h„iri” luettaessa.",CR,LF,"$"
+0007 T 0000 "Tiedostoa ei l”ydy.",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Tiedosto $"
+0009 T 0000 " - k„ytt„j„$ on peruuttanut tulostuksen."
+0010 T 0000 CR,LF,LF,"K„ytt„j„$ on peruuttanut kaikkien tiedostojen tulostuksen."
+0011 T 0000 "Tiedostojen tilanvaraustaulukko on virheellinen asemassa "
+0012 T 0000 "A.",CR,LF,"$"
+0013 T 0000 "Laitetta ei ole m„„ritetty tulostuslaiteeksi.",CR,LF
+0014 T 0000 "PRINT-komennon muistissa pysyv„ osa on asennettu.",CR,LF
+0015 T 0000 "PRINT-komentoa ei voi k„ytt„„. K„yt„ verkon tulostuskomentoa.",CR,LF
+0017 T 0000 "Tulostusjono on t„ynn„.",CR,LF
+0018 T 0000 "Tulostusjono on tyhj„.",CR,LF
+0019 T 0000 "Ei k„ytt”oikeutta.",CR,LF
+0020 T 0000 "V„„r„ aseman m„„ritys.",CR,LF
+0021 T 0000 "Tulostuslaitteen virheet osoittavat, ettei se ehk„ ole",CR,LF
+ "yhteydess„ p„„koneeseen. Tarkista yhteys.",CR,LF
+0022 T 0000 CR,LF,LF,"Tiedosto %1 tulostuu parhaillaan.",CR,LF
+0023 T 0000 "Tiedosto %1 on tulostusjonossa.",CR,LF
+0024 T 0000 "Tiedostoa %1 ei l”ydy.",CR,LF
+0025 T 0001 "Tiedoston saantipolku on liian pitk„.",CR,LF
+0026 T 0001 "Tiedosto ei ole tulostusjonossa.",CR,LF
+0027 T 0000 "Sy”t„ tulostuslaitteen nimi [PRN]:"
+RECOVER 5de5 0012
+0002 T 0000 CR,LF,"Tiedostoa ei l”ydy.",CR,LF
+0003 T 0000 CR,LF,"RECOVER ei ole k„ytett„viss„ (asemaan on kohdistettu SUBST tai ASSIGN).",CR,LF
+0004 T 0000 CR,LF,"V„„r„ asema tai tiedoston nimi.",CR,LF
+0005 T 0000 CR,LF,"Huomautus! Hakemisto on t„ynn„.",CR,LF
+0006 T 0000 CR,LF,"RECOVER ei ole k„ytett„viss„ verkkoasemassa.", CR,LF
+0007 T 0000 CR,LF,"Elvytys ei ole k„ytett„viss„ asemassa %1:.",CR,LF
+0008 T 0000 CR,LF,"%1 tiedosto(a) on elvytetty.",CR,LF
+0009 T 0000 CR,LF,"%1 tavua yhteism„„r„st„ %2 on elvytetty.",CR,LF
+0010 T 0000 CR,LF,"Aloita asemassa %1 olevien tiedostojen elvytys",CR,LF,"painamalla jotakin n„pp„int„.",CR,LF,CR,LF
+0011 T 0000 CR,LF,"Tiedostojen tilanvaraustaulukon luku ei onnistu.",CR,LF
+0012 T 0000 CR,LF,"Tiedostojen tilanvaraustaulukon kirjoitus ei onnistu.",CR,LF
+0013 T 0000 CR,LF
+SORT 6132 0001
+0005 T 0000 "SORT: "
+SUBST 615c 0001
+0002 T 0000 CR,LF,"Parametrien m„„r„ on v„„r„.",CR,LF
+SYS 61a7 0008
+0004 T 0000 "V„„r„ aseman tunnus.",CR,LF
+0007 T 0000 "Kohdelevyss„ ei ole tilaa j„rjestelm„lle.",CR,LF
+0008 T 0000 "J„rjestelm„n koko ei ole yhteensopiva.",CR,LF
+0010 T 0000 "Oletusasemassa ei ole j„rjestelm„tiedostoja.",CR,LF
+0011 T 0000 "Oletusaseman m„„ritys ei onnistu.",CR,LF
+0012 T 0000 "Virhe kirjoitettaessa. Levyke on k„ytt”kelvoton.",CR,LF
+0014 T 0000 "Aseta j„rjestelm„levyke asemaan %1:.",CR,LF
+0016 T 0000 "J„rjestelm„n siirto ei onnistu tiedostoj„rjestelm„„n %1.",CR,LF
+SHARE 63a7 0000
+NLSFUNC 63bb 0000
+ANSI 63cf 0001
+0010 T 0000 "Virheellinen parametri: %1.",CR,LF
+IFSFUNC 6414 0001
+0004 T 0000 "IFS-ajureita ei l”ydy.",CR,LF
+IBMBIO 6454 0018
+0003 T 0000 13,10,"CONFIG.SYS-tiedostossa on tunnistamaton komento"
+0004 T 0000 13,10,"$"
+0005 T 0000 13,10,"Tiedoston $ sektorikoko on liian suuri."
+0006 T 0000 13,10,"$ on virheellinen tai se puuttuu."
+0007 T 0000 "Komentotulkki",0
+0008 T 0000 13,10,"Virheellinen maatunnus tai koodisivu",13,10,"$"
+0009 T 0000 13,10,"Virhe COUNTRY-komennossa",13,10,"$"
+0010 T 0000 13,10, "Muistitila ei riit„ COUNTRY.SYS-tiedostolle.",13,10,"$"
+0011 T 0000 13,10,"Muistitila ei riit„ kokoonpanom„„ritystiedoille.",13,10,"$"
+0012 T 0000 13,10,"Liian monta lohkolaitetta.",13,10,"$"
+0013 T 0000 13,10,"Virheelliset pinoparametrit.",13,10,"$"
+0014 T 0000 13,10,"Virheellinen j„rjestys CONFIG.SYS-tiedoston rivill„ ","$"
+0015 T 0000 "Virhe CONFIG.SYS-tiedoston rivill„ ","$"
+0016 T 0000 13,10,"Muistin varausvirhe.","$"
+0017 T 0000 0DH,0AH,7,0DH,0AH, "Sis„inen pinon ylivuoto.",0DH,0AH
+ "K„sittely„ ei voi jatkaa.",0DH,0AH,"$"
+0020 T 0000 13,10,"Aseta levyke asemaan "
+0021 T 0000 "A: ja jatka",13,10,"painamalla jotain n„pp„int„.",13,10,10,0
+0022 T 0000 13,10,"Virheellinen komento tai virheelliset parametrit - $"
+BOOT 68c6 0001
+0001 T 0000 13,10,"Levyvirhe tai kyseess„ ei ole j„rjestelm„levyke.",13,10
+ "Vaihda levyke ja jatka painamalla jotain n„pp„int„.",13,10,0
+DBCSDOS 6966 0000
+IBMDOS 697a 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+PSPRINT 69b9 0007
+0002 T 0000 " - h„iri” luettaessa tiedostoa.",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"K„ytt„j„ on peruuttanut tiedoston tulostuksen.",CR,FORMFD,BELL
+0004 T 0000 "Tiedostojen tilanvaraustaulukko on virheellinen asemassa "
+0005 T 0000 "A.",CR,LF,"$"
+0006 T 0000 "Laitetta ei ole m„„ritetty tulostuslaitteeksi.",CR,LF
+0007 T 0000 "PSPRINT on jo asennettu.",CR,LF
+0008 T 0000 "PSPRINTin ja PRINTin ristiriita.",CR,LF
+BACKUP 6b75 0022
+0002 T 0000 CR,LF,"Muistitila ei riit„.",CR,LF
+0006 T 0000 CR,LF,"V„„r„ aseman tunnus.",CR,LF
+0014 T 0000 CR,LF,"L„hde- ja kohdeasema ovat samannimisi„.",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"J„rjestelm„ ei voi avata lokitiedostoa.",CR,LF
+0018 T 0000 CR,LF,"BACKUP kirjaa tiedostoon %1.",CR,LF
+0019 T 0000 CR,LF,"Viimeist„ varmistuslevykett„ ei ole asetettu asemaan.",CR,LF
+0020 T 0000 CR,LF,"Huomautus! Kohdeaseman %1: p„„hakemistossa",CR,LF
+ "olevat tiedostot poistuvat.",CR,LF
+0021 T 0000 CR,LF,"Huomautus! Kohdeaseman %1:\BACKUP-hakemistossa",CR,LF
+ "olevat tiedostot poistuvat.",CR,LF
+0022 T 0000 CR,LF,"*** J„rjestelm„ tekee tiedostoista varmistuskopiot asemaan %1:. ***",CR,LF
+0023 T 0000 "Levykkeen numero: %1.",CR,LF
+0024 T 0000 CR,LF,"Huomautus! J„rjestelm„ ei l”yd„ yht„„n varmistuskopioitavaa tiedostoa.",CR,LF
+0025 T 0000 CR,LF,"Aseta l„hdelevyke varmistuskopion tekoa varten asemaan %1:.",CR,LF
+0026 T 0000 CR,LF,"Aseta varmistuslevyke %1 asemaan %2:.",CR,LF
+0027 T 0000 CR,LF,"*** J„rjestelm„ ei voi tehd„ varmistuskopiota. ***",CR,LF
+0028 T 0000 CR,LF,"Aseta asemaan %1: viimeinen varmistuslevyke.",CR,LF
+0029 T 0000 CR,LF,"Kohdelevykett„ ei voi k„ytt„„ varmistuskopion tekoon.",CR,LF
+0030 T 0000 CR,LF,"*** Viimeisest„ tiedostosta ei ole tehty varmistuskopiota. ***",CR,LF
+0031 T 0000 CR,LF,"Kohdeumpilevy %1: on t„ynn„.",CR,LF
+0032 T 0000 CR,LF,"BACKUP-ohjelman lokitiedosto on t„ynn„.",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 7199 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 71d3 0013
+0004 T 0000 "Tiedostojen vertailussa l”ytyi v„hint„„n 10 eroavuutta. Vertailu p„„ttyy.",CR,LF
+0006 T 0000 "Eroavuus kohdassa %1.",CR,LF
+0007 T 0000 "Eroava tavu tiedostossa 1 = %1",CR,LF
+0008 T 0000 "Eroava tavu tiedostossa 2 = %1",CR,LF
+0009 T 0000 "Tiedoston loppumerkki„ ei l”ydy.",CR,LF
+0010 T 0000 "Tiedostot ovat samanlaiset.",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Sy”t„ ensimm„isen tiedoston nimi.",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Sy”t„ toisen tiedoston nimi tai aseman tunnus.",CR,LF
+0017 T 0000 "Tiedostot ovat erikokoiset.",CR,LF
+0018 T 0000 "Haluatko vertailla muita tiedostoja? (K/E)"
+0019 T 0000 "Vertaa tiedostoja %1 ja %2.",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Tiedostot ovat samanlaiset.",CR,LF
+DISKCOMP 74b3 0016
+0004 T 0000 "Žl„ m„„rit„ tiedostojen nimi„.",CR,LF
+ "Komennon muoto on: DISKCOMP d: d: [/1][/8]",LF,CR
+0005 T 0000 CR,LF,"V„„r„ aseman tunnus.",CR,LF
+ "M„„ritetty„ asemaa ei ole",CR,LF
+ "tai tunnus kuuluu umpilevyyn.",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP ei ole k„ytett„viss„",CR,LF
+ "verkkoaseman kanssa.",CR,LF
+0007 T 0000 CR,LF,"Aseta l„hdelevyke asemaan %1:.",CR,LF
+0008 T 0000 CR,LF,"Aseta kohdelevyke asemaan %1:.",CR,LF
+0009 T 0000 CR,LF,"L„hdelevyke on viallinen tai se ei ole yhteensopiva.",CR,LF
+0010 T 0000 CR,LF,"Kohdelevyke on viallinen tai se ei ole yhteensopiva.",CR,LF
+0014 T 0000 CR,LF,"Haluatko verrata toista levykett„? (K/E)"
+0015 T 0000 CR,LF,"Vertailu on meneill„„n: %1 uraa,",CR,LF
+ "%2 sektoria uraa kohti, %3-puolinen.",CR,LF
+0016 T 0000 CR,LF,"Asemat tai levykkeet eiv„t ole",CR,LF
+ "yhteensopivat.",CR,LF
+0017 T 0000 CR,LF,"Ohittamaton lukuvirhe aseman %2:",CR,LF
+ "%3-puolen urassa %4.",CR,LF
+0018 T 0000 CR,LF,"Vertailuvirhe",CR,LF,"%3-puolen urassa %4.",CR,LF
+0019 T 0000 "Varmista, ett„ levyke on asemassa ja",CR,LF
+ "aseman salpa on suljettu.",CR,LF
+0020 T 0000 CR,LF,"Levykkeiden vertailu on p„„ttynyt.",CR,LF
+0021 T 0000 CR,LF,"Levykkeet ovat identtiset.",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 799a 0018
+0002 T 0000 CR,LF
+0004 T 0000 "Žl„ m„„rit„ tiedostojen nimi„.",CR,LF
+ "Komennon muoto on: DISKCOPY d: d: [/1]",CR,LF
+0005 T 0000 CR,LF,"V„„r„ aseman tunnus.",CR,LF
+ "M„„ritetty„ asemaa ei ole",CR,LF
+ "tai tunnus kuuluu umpilevyyn.",CR,LF
+0006 T 0000 CR,LF,"DISKCOPY ei ole k„ytett„viss„",CR,LF
+ "verkkoasemassa.",CR,LF
+0007 T 0000 CR,LF,"J„rjestelm„ alustaa levykkeen kopioinnin yhteydess„.",CR,LF
+0008 T 0000 CR,LF,"Aseta l„hdelevyke asemaan %1:.",CR,LF
+0009 T 0000 CR,LF,"Aseta kohdelevyke asemaan %1:.",CR,LF
+0010 T 0000 "Varmista, ett„ levyke on asemassa ja",CR,LF
+ "aseman salpa on suljettu.",CR,LF
+0011 T 0000 CR,LF,"Kohdelevyke saattaa olla k„ytt”kelvoton.",CR,LF
+0012 T 0000 CR,LF,"Kohdelevyke on k„ytt”kelvoton.",CR,LF
+0016 T 0000 CR,LF,"Haluatko kopioida toisen levykkeen? (K/E)"
+0017 T 0000 CR,LF,"Kopiointi meneill„„n: %1 uraa,",CR,LF
+ "%2 sektoria uraa kohti, %3-puolinen.",CR,LF
+0018 T 0000 CR,LF,"Asemat tai levykkeet eiv„t ole",CR,LF
+ "yhteensopivat.",CR,LF
+0019 T 0000 CR,LF,"Ohittamaton lukuvirhe aseman %1:",CR,LF
+ "%2-puolen urassa %3.",CR,LF
+0020 T 0000 CR,LF,"Ohittamaton kirjoituksen virhe aseman %1",CR,LF
+ "%2-puolen urassa %3.",CR,LF
+0021 T 0000 CR,LF,"Kopiointi on p„„ttynyt.",CR,LF
+0022 T 0000 CR,LF,"L„hdelevyke on viallinen tai se ei ole yhteensopiva.",CR,LF
+0023 T 0000 CR,LF,"Kohdelevyke on viallinen tai se ei ole yhteensopiva.",CR,LF
+LABL 7f21 0000
+MODE 7f35 0055
+0003 T 0000 CR,LF,"M„„rit„ COM1, COM2, COM3 tai COM4.",CR,LF
+0004 T 0000 CR,LF,"MODE-komennon muistissa pysyv„ osa on asennettu.",CR,LF
+0005 T 0000 CR,LF,"Virheellinen laitenimi.",BELL,CR,LF
+0006 T 0000 CR,LF,"Kirjoittimen h„iri”.",BELL,CR,LF
+0007 T 0000 CR,LF,"LPT%1:n merkkim„„r„ksi on m„„ritetty 80.",CR,LF
+0008 T 0000 CR,LF,"LPT%1:n merkkim„„r„ksi on m„„ritetty 132.",CR,LF
+0009 T 0000 CR,LF,"Rivien m„„r„ tuumalle on m„„ritetty.",CR,LF
+0010 T 0000 CR,LF,"M„„ritetty modulointinopeus on virheellinen.",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 T 0001 CR,LF,"N„kyyk” %1? (K/E) "
+0014 T 0000 CR,LF,"Virheelliset parametrit.",CR,LF
+0015 T 0001 "LPT%1: on ohjattu edelleen COM%2:een.",CR,LF
+0016 T 0001 "LPT%1:t„ ei ole ohjattu edelleen.",CR,LF
+0017 T 0000 CR,LF,"Rinnakkaiskirjoittimen aikakatkaisulla %1 uusintayrityst„.",CR,LF
+0018 T 0000 CR,LF," N„yt”n %1 siirto ei onnistu.",CR,LF
+0020 T 0000 CR,LF,"Parametrien m„„r„ on v„„r„.",CR,LF
+0021 T 0000 CR,LF,"NET 042: Komennon toteutus ei onnistu.",CR,LF
+0022 T 0000 CR,LF,"Jatkuva uusintayritys ei ole k„ytett„viss„ verkkokirjoittimelle.",CR,LF
+0023 T 0000 CR,LF,"Koodisivun kirjasinlajitiedoston k„ytt” ei onnistu.",CR,LF
+0024 T 0000 CR,LF,"Laitteen %1 k„ytt” ei onnistu.",CR,LF
+0025 T 0000 CR,LF,"Kirjasinlajitiedostosta puuttuu laite tai koodisivu.",BELL,CR,LF
+0026 T 0000 CR,LF,"Kirjasinlajitiedoston sis„lt” on k„ytt”kelvoton.",BELL,CR,LF
+0027 T 0000 CR,LF,"Aiemmin valmisteltu koodisivu on korvattu.",BELL,CR,LF
+0028 T 0000 CR,LF,"Laitteen %1 k„yt”ss„ oleva koodisivu on %2.",CR,LF
+0029 T 0000 CR,LF,"Laitetta %1 ei ole valmisteltu.",CR,LF
+0030 T 0000 "%1 koodisivua:",CR,LF
+0031 T 0000 " Koodisivu %1.",CR,LF
+0032 T 0000 CR,LF,"MODE %1 -komennon koodisivutoiminto on p„„ttynyt.",CR,LF
+0033 T 0000 CR,LF,"Yleiskoodisivun %1 virhe.",CR,LF
+0034 T 0000 CR,LF,"K„yt”ss„ olevat koodisivun m„„ritykset:",CR,LF
+0035 T 0000 " Koodisivu %1 - %2",CR,LF
+0036 T 0000 " Koodisivua ei ole valmisteltu.",CR,LF
+0037 T 0000 "Koodisivutoiminto ei ole k„ytett„viss„ t„ss„ laitteessa.",CR,LF
+0038 T 0000 "Koodisivua ei ole valittu.",CR,LF
+0039 T 0000 "Laitevirhe %1:n aikana.",CR,LF
+0040 T 0000 "Koodisivua ei ole valmisteltu.",CR,LF
+0041 T 0000 CR,LF,"Valittu koodisivu ei ole k„ytett„viss„ t„m„n n„pp„imist”n kanssa.",CR,LF
+0042 T 0000 CR,LF,"Virhe kirjasinlajitiedoston luvun aikana.",CR,LF
+0043 T 0000 CR,LF,"Uudistustoiminto ei onnistu.",CR,LF
+0044 T 0000 CR,LF
+0045 T 0000 CR,LF,"Laitteen %1 tila:",CR,LF
+0046 T 0000 "--------------"
+0047 T 0000 "----",CR,LF
+0048 T 0000 "-----",CR,LF
+0049 T 0000 "LINES=%1",CR,LF
+0050 T 0000 "COLS=%1",CR,LF
+0051 T 0000 CR,LF,"RATE ja DELAY on m„„ritett„v„ yhdess„.",CR,LF
+0052 T 0000 "RATE=%1",CR,LF
+0053 T 0000 "DELAY=%1",CR,LF
+0054 T 0000 CR,LF,"Toiminto ei ole k„ytett„viss„ t„ss„ tietokoneessa.",CR,LF
+0055 T 0000 CR,LF,"Valittu kirjasinlaji ei ole latautunut.",CR,LF
+0056 T 0000 CR,LF,"Valittua toimintoa varten on asennettava ANSI.SYS.",CR,LF
+0057 T 0000 CR,LF,"Modulointinopeus on m„„ritett„v„.",CR,LF
+0058 T 0000 "RETRY=%1",CR,LF
+RESTORE 8b7b 0022
+0002 T 0000 CR,LF,"L„hde- ja kohdeasemat ovat samannimiset.",CR,LF
+0003 T 0000 CR,LF,"Parametrien m„„r„ on v„„r„.",CR,LF
+0006 T 0000 CR,LF,"V„„r„ aseman tunnus.",CR,LF
+0007 T 0000 CR,LF,"Huomautus! Palautettavia tiedostoja ei l”ytynyt.",CR,LF
+0008 T 0000 CR,LF,"Aseta varmistuslevyke %1 asemaan %2:.",CR,LF
+0009 T 0000 CR,LF,"Aseta palautuksen kohdelevyke asemaan %1:.",CR,LF
+0011 T 0000 CR,LF,"Huomautus! Levykkeet on asetettu asemaan v„„r„ss„ j„rjestyksess„.",CR,LF
+ "Aseta oikea levyke asemaan tai jatka palautusta.",CR,LF
+0012 T 0000 CR,LF,"Luettelon viimeist„ tiedostoa ei ole palautettu.",CR,LF
+0013 T 0000 CR,LF,"*** Varmistuskopiot on tehty %1 ***",CR,LF
+0014 T 0000 CR,LF,"L„hdelevykkeess„ ei ole varmistustiedostoja.",CR,LF
+0015 T 0000 CR,LF,"Muistitila ei riit„.",CR,LF
+0016 T 0000 CR,LF,"Huomautus! Tiedosto %1",CR,LF
+ "on lukutiedosto.",CR,LF
+ "Korvaa tiedosto? (K/E)",CR,LF
+0017 T 0000 CR,LF,"Tiedostot ovat v„„r„ss„ j„rjestyksess„.",CR,LF
+0018 T 0000 CR,LF,"Tiedoston luontivirhe.",CR,LF
+0019 T 0000 CR,LF,"Levytila ei riit„.",CR,LF
+0020 T 0000 CR,LF,"*** Tiedoston palautus ei onnistu ***",CR,LF
+0021 T 0000 CR,LF,"*** Aseman %1 tiedostot palautuvat: ***",CR,LF
+0022 T 0000 CR,LF,"Huomautus! Tiedostoa %1",CR,LF
+ "on muutettu varmistuskopion teon j„lkeen.",CR,LF
+ "Korvaa tiedosto? (K/E)",CR,LF
+0023 T 0000 "Levyke %1",CR,LF
+0024 T 0000 CR,LF,"Mi„let”n virhe. Soita Russ Whiteheadille numeroon 423313",CR,LF
+0025 T 0000 07
+0026 T 0000 CR,LF,"Virhe jatkettujen attribuuttien palautuksessa.",CR,LF
+SELECT 9193 0016
+0004 T 0000 "Virheellinen SELECTin aloituslevyke.",CR,LF,CR,LF
+ "Aseta asennuslevyke asemaan A: ja yrit„ uudelleen."
+0005 T 0000 "Virheellinen tietov„line.",CR,LF,CR,LF
+ "Aseta asennuslevyke asemaan A: ja yrit„ uudelleen."
+0006 T 0000 "SELECTin komentorivill„ on virheellisi„ parametrej„.",CR,LF,CR,LF
+ "Varmista, ett„ asennuslevyke on asemassa A:",CR,LF
+ "ja tee alkulataus painamalla Ctrl-, Alt- ja Del-n„pp„int„."
+0007 T 0000 BELL,"DOSin asennus ei onnistu. Ohjelma on keskeytynyt.",CR,LF
+0008 T 0000 "SELECTin lataus. Odota hetki."
+0009 T 0000 "J„rjestelm„n alkulataus on teht„v„ uudelleen.",CR,LF,CR,LF
+ "Jatka DOSin asennusta painamalla Ctrl-, Alt- ja Del-n„pp„int„."
+0010 T 0000 "Aseta SELECT-ohjelman sis„lt„v„ levyke asemaan A:.",CR,LF,CR,LF
+ "Jatka DOSin asennusta painamalla ENTER-n„pp„int„",CR,LF
+ "tai lopeta painamalla ESC-n„pp„int„.",CR,LF
+0011 T 0000 BELL
+0012 T 0000 "Aseta SELECT-ohjelman sis„lt„v„ levyke asemaan A:",CR,LF,CR,LF
+ "Jatka painamalla ENTER-n„pp„int„.",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE 992f 0004
+0002 T 0000 "Levyn %1 hakemistojen saantipolut:",CR,LF
+0003 T 0000 "Hakemistojen saantipolut:",CR,LF
+0004 T 0000 "Ei alihakemistoja.",CR,LF,LF
+0007 T 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE 9a0f 0009
+0003 T 0000 CR,LF,"Tiedostoja ei ole korvattu.",CR,LF
+0004 T 0000 CR,LF,"Tiedostoja ei ole lis„tty.",CR,LF
+0013 T 0000 CR,LF,"Tiedoston %1 korvaus meneill„„n.",CR,LF
+0014 T 0000 CR,LF,"Tiedoston %1 lis„ys meneill„„n.",CR,LF
+0015 T 0000 CR,LF,"%1 tiedosto(a) on korvattu.",CR,LF
+0016 T 0000 CR,LF,"%1 tiedosto(a) on lis„tty.",CR,LF
+0017 T 0000 CR,LF,"%1 tiedostoa ei l”ytynyt.",CR,LF
+0022 T 0000 CR,LF,"Korvaa tiedosto %1? (K/E)"
+0023 T 0000 CR,LF,"Lis„„ tiedosto %1? (K/E)"
+XCOPY 9c06 0019
+0004 T 0000 "Onko %1 kohdeasemassa oleva",CR,LF
+ "tiedosto vai hakemisto?",CR,LF
+ "(T = tiedosto, H = hakemisto)"
+0005 T 0000 "Aloita tiedostojen kopiointi painamalla jotain n„pp„int„."
+0006 T 0000 "Saantipolku on liian pitk„.",CR,LF
+0008 T 0000 "Keh„kopiointi ei ole sallittu.",CR,LF
+0012 T 0000 "XCOPY-komennon l„hde ei voi olla varattu laitenimi.",CR,LF
+0021 T 0000 "Parametrien m„„r„ on v„„r„.",CR,LF
+0022 T 0000 "XCOPY-komennon kohde ei voi olla varattu laitenimi.",CR,LF
+0024 T 0000 "Tiedoston luontivirhe.",CR,LF
+0025 T 0000 "L„hdetiedostojen luku on meneill„„n.",CR,LF
+0026 T 0000 CR,LF
+0027 T 0000 "%1 tiedosto(a) kopioitu.",CR,LF
+0028 T 0000 "%1 tiedosto(a) ei l”ytynyt.",CR,LF
+0029 T 0000 "T H "
+0030 T 0000 "%1%2",CR,LF
+0031 T 0000 "%1\%2",CR,LF
+0032 T 0000 "%1",CR,LF
+0033 T 0000 "%1%2 (K/E)?"
+0034 T 0000 "%1\%2 (K/E)?"
+0035 T 0000 "Virheellinen valitsin: %1",CR,LF
+VDISK 9f9f 0013
+0002 T 0000 "Muistitila ei riit„.",CR,LF
+0003 T 0000 "VDISK versio 3.40 -n„enn„islevy %1",CR,LF
+0004 T 0000 " Puskurin kokoa on muutettu.",CR,LF
+0005 T 0000 " Sektorin kokoa on muutettu.",CR,LF
+0006 T 0000 " Hakemistomerkint”j„ on muutettu.",CR,LF
+0007 T 0000 " Virhellinen valitsinmerkki.",CR,LF
+0008 T 0000 " Siirtokokoa on muutettu.",CR,LF
+0009 T 0000 " Puskurin koko: %1 kilotavua",CR,LF
+0010 T 0000 " Sektorin koko: %1",CR,LF
+0011 T 0000 " Hakemistomerkint”j„: %1",CR,LF
+0012 T 0000 " Siirtokoko: %1",CR,LF
+0013 T 0000 "VDISK-n„enn„islevy„ ei ole asennettu - "
+0014 T 0000 " laajennuskortin kytkimet",CR,LF
+ "eiv„t vastaa j„rjestelm„n muistin kokoa.",CR,LF,CR,LF
+GRAFTABL a279 0005
+0002 T 0000 "K„yt”ss„ oleva koodisivu: %1",CR,LF
+0003 T 0000 "Edellinen koodisivu: %1",CR,LF
+0004 T 0000 "ei mit„„n",NULL
+0005 T 0000 "ep„standardi",NULL
+0006 T 0000 CR,LF,"Kelvolliset parametrit DOSin komentorivill„ ovat: ",COLON,CR,LF,LF
+ " /STA - K„yt”ss„ olevan grafiikkakoodisivun numeron n„ytt”.",CR,LF
+ " ? - T„m„n parametriohjeen n„ytt”.",CR,LF,CR,LF
+ " K„ytett„viss„ olevat koodisivut:",COLON,CR,LF
+ " 437 - amerikkalainen grafiikkamerkist”",CR,LF
+ " 850 - monikielinen grafiikkamerkist”",CR,LF
+ " 860 - portugalilainen grafiikkamerkist”",CR,LF
+ " 863 - kanadanranskalainen grafiikkamerkist”",CR,LF
+ " 865 - pohjoismainen grafiikkamerkist”.",CR,LF
+FASTOPEN a54b 0016
+0004 T 0000 CR,LF,"FASTOPEN on asennettu.",CR,LF
+0005 T 0000 CR,LF,"FASTOPEN on jo asennettu.",CR,LF
+0006 T 0000 CR,LF,"Virheellinen parametri.",CR,LF
+0007 T 0000 CR,LF,"Liian monta aseman m„„rityst„.",CR,LF
+0008 T 0000 CR,LF,"Sama asema on m„„ritetty useammin kuin kerran.",CR,LF
+0009 T 0000 CR,LF,"V„„r„ parametri.",CR,LF
+0010 T 0000 CR,LF,"Virheellinen valitsimen tyyppi.",CR,LF
+0011 T 0000 CR,LF,"Virheellinen laajennoksen m„„ritys.",CR,LF
+0012 T 0000 CR,LF,"Virheellinen m„„r„ tiedosto- ja hakemistomerkint”j„",CR,LF
+0013 T 0000 CR,LF,"EMS-muistin kokoonpanonm„„ritys ei onnistu.",CR,LF
+0014 T 0000 CR,LF,"EMS-muisti ei ole k„ytett„viss„.",CR,LF
+0015 T 0000 CR,LF,"V„„r„ aseman tunnus.",CR,LF
+0016 T 0000 CR,LF,"Muistin yl„alue ei riit„. J„rjestelm„ k„ytt„„ perusmuistia.",CR,LF
+0017 T 0000 CR,LF,"FASTOPEN ei ole k„ytett„viss„ asemassa %1.",CR,LF
+0018 T 0000 CR,LF,"Liian monta laajennusmerkint„„.",CR,LF
+0019 T 0000 CR,LF,"Liian monta tiedosto- ja hakemistomerkint„„",CR,LF
+APPEND a944 0009
+0001 T 0000 "V„„r„ APPENDin versio.",CR,LF
+0002 T 0000 "Virheellinen polku.",CR,LF
+0003 T 0000 "Virheellinen parametri.",CR,LF
+0004 T 0000 "Virheellinen parametriyhdistelm„.",CR,LF
+0005 T 0000 "APPEND ei onnistu.",CR,LF
+0006 T 0000 "Ristiriita APPEND- ja ASSIGN-komennon v„lill„.",CR,LF
+0007 T 0000 "Ristiriita APPEND-komennon ja TopView'n v„lill„.",CR,LF
+0008 T 0000 "V„„r„ DOSin versio.",CR,LF
+0009 T 0000 "APPEND on jo asennettu.",CR,LF
+GRAPHICS ab19 0012
+0005 T 0000 "Virheellinen parametri: %1.",CR,LF
+0007 T 0000 "Parametria ei saa antaa kahteen kertaan.",CR,LF
+0009 T 0000 "GRAPHICS-profiilia ei l”ydy.",CR,LF
+0010 T 0000 "Tarvittava profiilim„„ritys puuttuu ennen rivi„ %1.",CR,LF
+0011 T 0000 "Virheellinen profiilim„„ritys rivill„ %1.",CR,LF
+0012 T 0000 "Profiilim„„ritys v„„r„ss„ j„rjestyksess„ rivill„ %1.",CR,LF
+0013 T 0000 "GRAPHICS-profiilin lukuvirhe.",CR,LF
+0014 T 0000 "GRAPHICS-profiilissa on muotovirheit„.",CR,LF
+0015 T 0000 "Viivapiirroksen tunnus puuttuu GRAPHICS-profiilista.",CR,LF
+0016 T 0000 "Kirjoittimen tyyppi ei ole GRAPHICS-profiilissa.",CR,LF
+0017 T 0000 "/B-parametria ei voi k„ytt„„ mustavalkokirjoittimelle.",CR,LF
+0018 T 0000 "Lataus ei onnistus toimitettua profiilia k„ytt„en.",CR,LF
+DISPLAY ae34 0003
+0002 T 0000 "%1-koodisivuajuria ei voi ottaa k„ytt””n.",CR,LF,BELL
+0008 T 0000 "Muistitila ei riit„.",CR,LF,BELL
+0012 T 0000 "DISPLAY.SYS-koodisivuajurin muotovirhe.",CR,LF,BELL
+PRINTER aefd 0002
+0002 T 0000 "%1-koodisivuajuria ei voi ottaa k„ytt””n.",CR,LF,BELL
+0012 T 0000 "PRINTER.SYS-koodisivuajurin muotovirhe.",CR,LF,BELL
+KEYB af97 0016
+0002 T 0000 "K„yt”ss„ oleva n„pp„imist”koodi: %1"
+0003 T 0000 "K„yt”ss„ oleva n„pp„imist”tunnus: %1"
+0004 T 0000 " koodisivu: %1",CR,LF
+0005 T 0000 "K„yt”ss„ oleva CON-koodisivu: %1",CR,LF
+0006 T 0000 "M„„ritetty n„pp„imist”koodi on virheellinen.",CR,LF
+0007 T 0000 "M„„ritetty n„pp„imist”tunnus on virheellinen.",CR,LF
+0008 T 0000 "M„„ritetty koodisivi on virheellinen.",CR,LF
+0009 T 0000 "N„pp„imist”m„„ritystiedosto on virheellinen tai se puuttuu.",CR,LF
+0010 T 0000 "KEYB-tiedostoa ei ole asennettu.",CR,LF
+0011 T 0000 "K„yt”ss„ oleva koodisivu ei ole k„ytett„viss„ CON-laitteesta.",CR,LF
+0012 T 0000 "M„„ritetty„ koodisivua ei ole valmisteltu j„rjestelm„„n.",CR,LF
+0013 T 0000 "Valitun n„pp„imist”koodin CON-koodisivuista yksi tai useampia on virheellisi„.",CR,LF
+0014 T 0000 "Koodisivu (%1) ei ole k„ytett„viss„ valitun n„pp„imist”koodin kanssa.",CR,LF
+0015 T 0000 "M„„ritetty koodisivu ei vastaa valittua koodisivua.",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "N„pp„imist”taulukon luonti pysyv„ismuistiin ei onnistu.",CR,LF
+REDIRSYS b407 0000
+MEM b41b 0036
+0010 T 0000 CR,LF
+0011 T 0000 " Osoite Nimi Koko Tyyppi",CR,LF
+0012 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0000 " Ripa EMS-nimi Koko ",CR,LF
+0014 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0000 " %1 %2 %3 %4",CR,LF
+0016 T 0000 " %1 %2 %3 ",CR,LF
+0017 T 0000 " %1 %2 ",CR,LF
+0018 T 0000 "Kokonaismuistitila %1 tavua",CR,LF
+0019 T 0000 "K„ytett„viss„ %1 tavua",CR,LF
+0020 T 0000 "Ajettava ohjelma enint„„n %1 tavua",CR,LF
+0021 T 0000 "EMS-muistin kokonaistila %1 tavua",CR,LF
+0022 T 0000 "EMS-muistissa k„ytett„viss„ %1 tavua",CR,LF
+0023 T 0000 "EMS-muistin kokonaistila %1 tavua",CR,LF
+0024 T 0000 "Keskeytysvektori",0
+0025 T 0000 "ROM-viestialue",0
+0026 T 0000 "DOS-viestialue",0
+0027 T 0000 "IBMBIO",0
+0028 T 0000 "IBMDOS",0
+0029 T 0000 "J„rjestelm„n tietoa",0
+0030 T 0000 "J„rjestelm„ohjelma",0
+0031 T 0000 "J„rjestelm„n laiteajuri",0
+0032 T 0000 "Asennettu laiteajuri",0
+0033 T 0000 "%1:",0
+0034 T 0000 "%1: - %2:",0
+0035 T 0000 "BUFFERS=",0
+0036 T 0000 "FILES=",0
+0037 T 0000 "FCBS=",0
+0038 T 0000 "STACKS=",0
+0039 T 0000 "DEVICE=",0
+0040 T 0000 "IFS=",0
+0041 T 0000 "LASTDRIVE=",0
+0042 T 0000 "----------",0
+0043 T 0000 " ",0
+0044 T 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR b9b6 0040
+0004 T 0000 "Verkkoa ei ole otettu k„ytt””n.",CR,LF
+0050 T 0000 "NET809: J„rjestelm„ ei tue verkkopyynt”„.",CR,LF,0
+0051 T 0000 "NET801: Et„tietokone ei kuuntele.",CR,LF,0
+0052 T 0000 "NET802: Verkossa on kaksi samaa tiedoston nime„.",CR,LF,0
+0053 T 0000 "NET803: Verkkopolkua ei l”ytynyt.",CR,LF,0
+0054 T 0000 "NET804: Verkko on varattu.",CR,LF,0
+0055 T 0000 "NET805: Laite on poistettu verkosta.",CR,LF,0
+0056 T 0000 "NET806: Verkossa on enimm„ism„„r„ BIOS-komentoja.",CR,LF,0
+0057 T 0000 "NET807: J„rjestelm„virhe: verkon BIOS-virhe.",CR,LF,0
+0058 T 0000 "NET808: Verkosta tullut vastaus on virheellinen.",CR,LF,0
+0059 T 0000 "NET810: Odottamaton verkkovirhe.",CR,LF,0
+0060 T 0000 "NET811: Et„sovitin ei ole yhteensopiva.",CR,LF,0
+0061 T 0000 "NET812: Tulostusjono on t„ynn„.",CR,LF,0
+0062 T 0000 "NET813: Tulostustiedostolle ei ole tilaa.",CR,LF,0
+0063 T 0000 "NET814: Tulostustiedosto on poistettu.",CR,LF,0
+0064 T 0000 "NET815: Verkkotunnus on poistettu.",CR,LF,0
+0065 T 0000 "Ei k„ytt”oikeutta.",CR,LF,0
+0066 T 0000 "NET817: Verkkolaitteen tyyppi on virheellinen.",CR,LF,0
+0067 T 0000 "NET818: Verkkonime„ ei l”ydy.",CR,LF,0
+0068 T 0000 "NET819: Tunnusten enimm„ism„„r„ verkossa on ylittynyt.",CR,LF,0
+0069 T 0000 "NET820: BIOS-istuntojen enimm„ism„„r„ verkossa on ylittynyt.",CR,LF,0
+0070 T 0000 "NET821: Yhteisk„ytt” on keskeytynyt tilap„isesti.",CR,LF,0
+0071 T 0000 "NET823: J„rjestelm„ ei hyv„ksy verkkopyynt”„.",CR,LF,0
+0072 T 0000 "NET822: Tulostuksen tai levyn reititys on keskeytynyt.",CR,LF,0
+0073 T 0000 "NET476: Netbeui-laitetta ei ole ladattu.",CR,LF,0
+0074 T 0000 "NET477: Odottamaton sovittimen sulku.",CR,LF,0
+0075 T 0000 "NET826: Kohdepalvelija /RQB:n koko on liian pieni.",CR,LF,0
+0076 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0077 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0078 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0079 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0080 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0081 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0082 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0083 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0084 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0085 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0086 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0087 T 0000 "NET???: Odottamaton verkkovirhe.",CR,LF,0
+0088 T 0000 "NET825: Tietovirhe verkossa.",CR,LF,0
+XMA2EMS c362 0017
+0001 T 0000 "XMA2EMS: Expanded Memory Manager versio 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 All rights reserved",CR,LF,"$"
+0002 T 0000 CR,LF,"XMA001 VMO/XMA-vianm„„ritys k„ynniss„: ","$"
+0003 T 0000 "XMA002 Vianm„„ritys on p„„ttynyt ",CR,LF,LF,"$"
+0004 T 0000 "XMA003 Sivunkehys alkaa kohdasta................... "
+0005 T 0000 "XXXX",":0",CR,LF,"$"
+0006 T 0000 "XMA004 Tavalliselle muistille varattuja sivuja..... "
+0007 T 0000 "0 ",CR,LF,"$"
+0008 T 0000 "XMA005 Ohjausohjelmalle varattuja sivuja........... "
+0009 T 0000 "0 ",CR,LF,"$"
+0010 T 0000 "XMA006 EMS-muistille k„ytett„viss„ sivuja.......... "
+0011 T 0000 "0 ",CR,LF,"$"
+0012 T 0000 CR,LF,"XMA100 Sovittimen virhe:",CR,LF," Expanded Memory Manageria EI ole asennettu",CR,LF,"$"
+0013 T 0000 CR,LF,"XMA200 J„rjestelm„ ei l”yd„ sovitinta:",CR,LF," Expanded Memory Manageria EI ole asennettu",CR,LF,"$"
+0014 T 0000 CR,LF,"XMA300 Parametrin muoto- tai arvovirhe:",CR,LF
+ " Expanded Memory Manageria EI ole asennettu",CR,LF,"$"
+0015 T 0000 SIZE1_END - 2 -$
+0016 T 0000 4 DUP (?)," kilotavua tarkastettu",CR,LF,"$"
+0017 T 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FILESYS c846 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+FDISK c988 0120
+0004 T 0000 "FDISK-ohjelmaa ei voi k„ytt„„ verkon ollessa ladattuna.",CR,LF
+0005 T 0000 "J„rjestelm„ss„ ei ole umpilevy„.",CR,LF
+0006 T 0000 "H„iri” luettaessa tietoja umpilevyst„.",CR,LF
+0007 T 0000 "H„iri” kirjoitettaessa tietoja umpilevyyn.",CR,LF
+1001 T 0000 "IBM Personal Computer"
+1002 T 0000 "Fixed Disk Setup Program versio 3.40"
+1003 T 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "FDISK-ohjelman vaihtoehdot"
+1005 T 0000 "1. <R>DOS-osion tai loogisen aseman luonti"
+1006 T 0000 "2. <R>K„yt”ss„ olevan osion vaihto"
+1007 T 0000 "3. <R>DOS-osion tai loogisen aseman poisto"
+1008 T 0000 "4. <R>Osiotietojen n„ytt”"
+1009 T 0000 "Palaa DOSiin painamalla <H>Esc-n„pp„int„<R>"
+1010 T 0000 "Valitse jokin seuraavista:"
+1011 T 0000 "5. <R>Toisen umpilevyn valinta"
+1012 T 0000 "K„yt”ss„ oleva umpilevyasema: <H><I>"
+1013 T 0000 "Huomautus! <R>Osioita ei ole aktivoitu - j„rjestelm„„ ei voi ladata"
+1014 T 0000 "umpilevyst„ 1 ellei osiota aktivoida."
+1015 T 0000 "Kirjoita valinta: [<S> ]"
+1016 T 0000 "Luo DOS-osio tai looginen asema"
+1017 T 0000 "1. <R>Luo DOSin ensi”osio"
+1018 T 0000 "2. <R>Luo DOSin jatkettu osio"
+1019 T 0000 "3. <R>Luo looginen asema DOSin jatkettuun osioon"
+1020 T 0000 "Palaa FDISK-ohjelman valikkoon painamalla <H>Esc-n„pp„int„<R>"
+1021 T 0000 "Luo DOSin ensi”osio"
+1022 T 0000 "Haluatko luoda aktiivisen DOS-osion, johon kuuluu"
+1023 T 0000 "kaikki k„ytett„viss„ oleva tila? (K/E) <H>[<S> ]"
+1024 T 0000 "(K/E)................................. <H>[<S> ]"
+1025 T 0000 "Osio Tila Tyyppi Koko megatavuina Osuus levyn koosta"
+1026 T 0000 "Levyn kokonaistila on <HIIIIR> megatavua (1 megatavu = 1048576 tavua)."
+1027 T 0000 "Osioon on k„ytett„viss„ enint„„n <HIIIIR> megatavua (<HIIIIR>)"
+1028 T 0000 "Luo DOSin ensi”osio antamalla osion koko joko"
+1029 T 0000 "megatavuina tai osuutena (%) levyn kokonaistilasta:............. <H>[<IIISI>]"
+1030 T 0000 "Luo DOSin jatkettu osio"
+1031 T 0000 "luo DOSin jatkettu osio:....................................... <H>[<IIISI>]"
+1032 T 0000 "Jatka painamalla <H>Esc-n„pp„int„<R>"
+1033 T 0000 "Luo looginen asema DOSin jatkettuun osioon"
+1034 T 0000 "As. Taltion nimi Mtavua J„rjestelm„ K„ytt”"
+1035 T 0000 "DOSin jatketun osion kokonaistila on <HIIIIR> megatavua (1 MB = 1048576 tavua)."
+1036 T 0000 "Loogiseen asemaan on k„ytett„viss„ enint„„n <HIIIIR> megatavua <H>(<IIII>)."
+1037 T 0000 "Loogisen aseman koko (megatavuina tai osuutena (%) levytilasta)...<H>[<IIISI>]"
+1038 T 0000 "K„yt”ss„ olevan osion vaihto"
+1039 T 0000 "Anna aktivoitavan osion numero:...................................... <H>[<S> ]"
+1040 T 0000 "DOS-osion tai loogisen aseman poisto"
+1041 T 0000 "1. <R>Poista DOSin ensi”osio "
+1042 T 0000 "2. <R>Poista DOSin jatkettu osio"
+1043 T 0000 "3. <R>Poista looginen asema DOSin jatketusta osiosta"
+1044 T 0000 "DOSin ensi”osion poisto"
+1045 T 0000 "Huomautus! <OR>DOSin ensi”osion tiedot poistuvat."
+1046 T 0000 "Haluatko varmasti jatkaa? (K/E).................... <H>[<S> ]"
+1047 T 0000 "DOSin jatketun osion poisto"
+1048 T 0000 "Huomautus! <OR>DOSin jatketun osion tiedot poistuvat."
+1049 T 0000 "Haluatko varmasti jatkaa? (K/E).................... <H>[<S> ]"
+1050 T 0000 "Loogisen aseman poisto DOSin jatketusta osiosta"
+1051 T 0000 "Huomautus! <OR>Loogisen aseman tiedot poistuvat."
+1052 T 0000 "Mink„ aseman haluat poistaa?.................................... <H>[<S> ]"
+1053 T 0000 "Haluatko varmasti jatkaa? (K/E)...................... <H>[<S> ]"
+1054 T 0000 "Kirjoita taltion nimi?........................... <H>[<S> ]"
+1055 T 0000 "Osiotietojen n„ytt”"
+1056 T 0000 "DOSin jatketussa osiossa on loogisia asemia."
+1057 T 0000 "Haluatko n„hd„ tiedot loogisista asemista? (K/E).....................<H>[<S> ]"
+1058 T 0000 "Loogisten asemien tietojen n„ytt”"
+1059 T 0000 "J„rjestelm„ latautuu uudelleen."
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0000 "Jatka painamalla jotain n„pp„int„ . . .<S>"
+1062 T 0000 "DOSin ensi”osio on poistettu."
+1063 T 0000 "DOSin jatkettu osio on poistettu."
+1064 T 0000 "Asema on poistettu."
+1065 T 0000 "Osio <I> on aktivoitu."
+1066 T 0000 "DOSin ensi”osio on luotu."
+1067 T 0000 "DOSin jatkettu osio on luotu."
+1068 T 0000 "Looginen asema on luotu, asemien tunnuksia on lis„tty tai muutettu.<W>"
+1069 T 0000 "Osioita ei ole m„„ritetty."
+1070 T 0000 "Loogisia asemia ei ole m„„ritetty."
+1071 T 0000 "Asemien tunnuksia on poistettu tai muutettu.<W>"
+1072 T 0000 "Asema on m„„ritetty uudelleen."
+1073 T 0000 "DOSin ensi”osio on luotu, asemien tunnuksia on lis„tty tai muutettu."
+1074 T 0000 "J„rjestelm„ss„ ei ole umpilevyj„."
+1075 T 0000 "H„iri” luettaessa tietoja umpilevyst„."
+1076 T 0000 "H„iri” kirjoitettaessa tietoja umpilevyyn."
+1077 T 0000 "V„„r„ DOSin versio."
+1078 T 0000 "FDISK-ohjelmaa ei voi k„ytt„„ verkon ollessa ladattuna."
+1079 T 0000 "Levyss„ ei ole DOSin ensi”osiota."
+1080 T 0000 "Levyss„ ei ole DOSin jatkettua osiota."
+1081 T 0000 "Levyss„ on jo DOSin ensi”osio."
+1082 T 0000 "Levyss„ on jo DOSin jatkettu osio."
+1083 T 0000 "Levytila ei riit„ DOS-osion luomiseen."
+1084 T 0000 "Loogisen aseman haluttu koko on suurempi kuin k„ytett„viss„ oleva tila.<W>"
+1085 T 0000 "Osion haluttu koko on suurempi kuin k„ytett„viss„ oleva tila.<W>"
+1086 T 0000 "Levyss„ ei ole osioita."
+1087 T 0000 "Aseman 1 ainoa aloitusosio on jo asetettu aktiiviseksi.<W>"
+1088 T 0000 "Levyss„ ei ole aktivoitavia osioita."
+1089 T 0000 "Valittu osio (<I>) ei ole aloitusosio. Aktiivinen osio ei ole muuttunut.<W>"
+1090 T 0000 "DOSin jatkettua osiota ei voi luoda,"
+1091 T 0000 "ellei levyss„ 1 ole DOSin ensi”osiota.<W>"
+1092 T 0000 "Kaikki DOSin jatketun osion k„ytett„viss„ oleva tila"
+1093 T 0000 "on m„„ritetty loogisiin asemiin.<W>"
+1094 T 0000 "Loogisia asemia sis„lt„v„„ DOSin jatkettua osiota ei voi poistaa.<W>"
+1095 T 0000 "Kaikki jatketun DOS-osion loogiset asemat on poistettu.<W>"
+1096 T 0000 " ei ole oikea vaihtoehto. Kirjoita <III>.<W>"
+1097 T 0000 "Huomautus! Aktivoitua osiota ei voi k„ytt„„ j„rjestelm„n lataukseen.<W>"
+1098 T 0000 " Levyss„ ei ole aloitusosioita."
+1099 T 0000 "Vain aseman 1 levyn osioita voi aktivoida.<W>"
+1100 T 0000 "Enimm„ism„„r„ loogisia DOS-asemia on asennettu.<W>"
+1101 T 0000 "Luotavan osion koko ei voi olla nolla."
+1102 T 0000 "Asema <II> on jo poistettu."
+1103 T 0000 "Ei aseman <I> k„ytt”oikeutta.<OW>"
+1104 T 0000 "Virheellinen vastaus, kirjoita <III>.<W>"
+1105 T 0000 "Asemassa 1 olevaa DOSin ensi”osiota ei voi poistaa, "
+1106 T 0000 "jos DOSin jatkettu osio on olemassa.<W>"
+1107 T 0000 "Virheellinen vastaus, paina Enter-n„pp„int„.<W>"
+1108 T 0000 "Taltion nimi ei t„sm„„.<W>"
+1109 T 0000 "Loogista DOS-asemaa ei voi luoda, ellei"
+1110 T 0000 "k„yt”ss„ olevassa asemassa ole jatkettua DOS-osiota.<W>"
+1111 T 0000 "Levyss„ ei ole loogisia DOS-asemia."
+1112 T 0000 "Virhe sanomatekstiss„ <I>. Katso virhem„„ritys FDISKC.MSG-tiedostosta."
+1113 T 0000 "Sis„inen virhe."
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/france.msg b/private/mvdm/dos/v86/messages/france.msg
new file mode 100644
index 000000000..2ead6533a
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/france.msg
@@ -0,0 +1,1150 @@
+0009
+COMMON 0006 0038
+0001 T 0000 "Mauvaise version de DOS.",CR,LF
+0002 T 0000 "%1 est d‚j… install‚(e).",CR,LF
+0003 T 0000 "%1 octet(s) disponible(s) sur disque.",CR,LF
+0004 T 0000 "%1 octet(s) disponible(s).",CR,LF
+0005 T 0000 "%1 octet(s) dans secteurs d‚fectueux.",CR,LF
+0006 T 0000 "%1 octet(s) espace total sur disque.",CR,LF
+0007 T 0000 "%1 octet(s) m‚moire totale.",CR,LF
+0008 T 0000 "%1 octet(s) utilis‚(s) par le systŠme.",CR,LF
+0009 T 0000 "%1 install‚(e).",CR,LF
+0010 T 0000 "%1 pas install‚.",CR,LF
+0011 T 0000 "%1 pas install‚.",CR,LF
+0012 T 0000 "%1 impossible avec unit‚ de r‚seau.",CR,LF
+0013 T 0000 "",
+0014 T 0000 "Ex‚cution de %1 impossible sur une unit‚ ASSIGN‚e ou SUBSTitu‚e.",CR,LF
+0015 T 0000 "Ex‚cution de %1 impossible.",CR,LF
+0016 T 0000 "Extension m‚moire non disponible.",CR,LF
+0017 T 0000 "Table des fichiers non valide dans unit‚ %1.",CR,LF
+0018 T 0000 "Fichier ne peut ˆtre copi‚ sur lui-mˆme.",CR,LF
+0019 T 0000 "Ins‚rez disque cible dans unit‚ %1.",CR,LF
+0020 T 0000 "Espace insuffisant sur disque.",CR,LF
+0021 T 0000 "CaractŠres non valides dans",CR,LF,"le label de volume.",CR,LF
+0022 T 0000 "Page de codes non valide.",CR,LF
+0023 T 0000 "Date non valide.",CR,LF
+0024 T 0000 "Heure non valide.",CR,LF
+0025 T 0000 "Chemin non valide.",CR,LF
+0026 T 0000 "Unit‚ source non sp‚cifi‚e.",CR,LF
+0027 T 0000 "Unit‚ cible non sp‚cifi‚e.",CR,LF
+0028 T 0000 "Appuyez sur une touche. . .",CR,LF
+0029 T 0000 "Chemin source demand‚.",CR,LF
+0030 T 0000 "Fichiers systŠme transf‚r‚s.",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Cr‚ation de r‚pertoire impossible.",CR,LF
+0033 T 0000 "Volume dans unit‚ %1 n'a pas de label.",CR,LF
+0034 T 0000 "Volume dans unit‚ %1 est %2.",CR,LF
+0035 T 0000 "Donnez label de volume (11 car.) : "
+0036 T 0000 "Num‚ro de s‚rie du volume : %1-%2.",CR,LF
+0037 T 0000 "Type de fichier incorrect.",CR,LF
+0038 U 0001 CR,LF
+EXTEND 076f 0089
+0001 T 0000 "Fonction non valide.",CR,LF
+0002 T 0000 "Fichier introuvable.",CR,LF
+0003 T 0000 "Chemin introuvable.",CR,LF
+0004 T 0000 "Trop de fichiers ouverts.",CR,LF
+0005 T 0000 "AccŠs refus‚.",CR,LF
+0006 T 0000 "Indicateur de fichier non valide.",CR,LF
+0007 T 0000 "Blocs de contr“le m‚moire d‚truits.",CR,LF
+0008 T 0000 "M‚moire insuffisante.",CR,LF
+0009 T 0000 "Adresse non valide des blocs de m‚moire.",CR,LF
+0010 T 0000 "La taille environnement sp‚cifi‚e n'est pas valide.",CR,LF
+0011 T 0000 "Format non valide.",CR,LF
+0012 T 0000 "ParamŠtre de fonction non valide.",CR,LF
+0013 T 0000 "Donn‚es non valides.",CR,LF
+0014 T 0000 "",
+0015 T 0000 "D‚signation d'unit‚ non valide.",CR,LF
+0016 T 0000 "Tentative de suppression du r‚pertoire en cours.",CR,LF
+0017 T 0000 "P‚riph‚rique diff‚rent.",CR,LF
+0018 T 0000 "Dernier fichier.",CR,LF
+0019 T 0000 "Erreur de protection contre l'‚criture.",CR,LF
+0020 T 0000 "Unit‚ non valide.",CR,LF
+0021 T 0000 "Pas prˆt(e).",CR,LF
+0022 T 0000 "Demande non valide de p‚riph‚rique.",CR,LF
+0023 T 0000 "Erreur de donn‚es.",CR,LF
+0024 T 0000 "ParamŠtres non valides dans demande de p‚riph‚rique.",CR,LF
+0025 T 0000 "Erreur de recherche.",CR,LF
+0026 T 0000 "Type de support non valide.",CR,LF
+0027 T 0000 "Secteur introuvable.",CR,LF
+0028 T 0000 "Erreur fin de papier sur imprimante.",CR,LF
+0029 T 0000 "Erreur d'‚criture.",CR,LF
+0030 T 0000 "Erreur de lecture.",CR,LF
+0031 T 0000 "Situation critique.",CR,LF
+0032 T 0000 "Valeur de partage non respect‚e.",CR,LF
+0033 T 0000 "Valeur de verrouillage non respect‚e.",CR,LF
+0034 T 0000 "Changement de disque non valide.",CR,LF
+0035 T 0000 "FCB non disponible.",CR,LF
+0036 T 0000 "Epuisement des ressources du systŠme.",CR,LF
+0037 T 0000 "Non-correspondance des pages de codes.",CR,LF
+0038 T 0000 "Fin des entr‚es.",CR,LF
+0039 T 0000 "Espace insuffisant sur disque.",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 T 0000 "Demande non prise en charge par le systŠme de fichiers.",CR,LF
+0051 T 0000 "Connexion impossible au systŠme de fichiers.",CR,LF
+0052 T 0000 "Le nom du systŠme de fichiers existe d‚j….",CR,LF
+0053 T 0000 "Nom du systŠme de fichiers introuvable.",CR,LF
+0054 T 0000 "SystŠme de fichiers non disponible.",CR,LF
+0055 T 0000 "Le systŠme de fichiers n'a plus de p‚riph‚rique.",CR,LF
+0056 T 0000 "Epuisement des ressources du systŠme de fichiers.",CR,LF
+0057 T 0000 "Le systŠme de fichiers a rencontr‚ une erreur de p‚riph‚rique.",CR,LF
+0058 T 0000 "R‚ponse erron‚e du systŠme de fichiers.",CR,LF
+0059 T 0000 "Le systŠme de fichiers a rencontr‚ une erreur inattendue.",CR,LF
+0060 T 0000 "SystŠme de fichiers non compatible.",CR,LF
+0061 T 0000 "D‚passement des limites du fichier de sortie du p‚riph‚rique.",CR,LF
+0062 T 0000 "Plus d'espace disponible dans le fichier de sortie des p‚riph‚riques.",CR,LF
+0063 T 0000 "Le fichier de sortie des p‚riph‚riques n'existe plus.",CR,LF
+0064 T 0000 "Le nom du systŠme de fichiers n'existe plus.",CR,LF
+0065 T 0000 "AccŠs non autoris‚ par le systŠme de fichiers.",CR,LF
+0066 T 0000 "Type incorrect du p‚riph‚rique du systŠme de fichiers.",CR,LF
+0067 T 0000 "SystŠme de fichiers introuvable.",CR,LF
+0068 T 0000 "Epuisement des ressources du systŠme de fichiers.",CR,LF
+0069 T 0000 "Epuisement des ressources du systŠme de fichiers.",CR,LF
+0070 T 0000 "P‚riph‚rique du systŠme de fichiers indisponible actuellement.",CR,LF
+0071 T 0000 "La demande du systŠme de fichiers est refus‚e.",CR,LF
+0072 T 0000 "Le p‚riph‚rique du systŠme de fichiers est sur PAUSE.",CR,LF
+0073 T 0001 "Composant du systŠme de fichiers non disponible.",CR,LF
+0074 T 0001 "Le systŠme de fichiers a rencontr‚ une erreur inattendue.",CR,LF
+0075 T 0001 "Le systŠme de fichiers a rencontr‚ une erreur inattendue.",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0000 "Le fichier existe d‚j….",CR,LF
+0081 T 0000 "",
+0082 T 0000 "Ajout impossible d'une entr‚e au r‚pertoire.",CR,LF
+0083 T 0000 "Echec impos‚ en cas d'erreur critique.",CR,LF
+0084 T 0000 "Trop de connexions.",CR,LF
+0085 T 0000 "P‚riph‚rique ou fichier d‚j… connect‚.",CR,LF
+0086 T 0000 "Mot de passe non valide.",CR,LF
+0087 T 0000 "ParamŠtre non valide.",CR,LF
+0088 T 0000 "Donn‚es erron‚es dans le systŠme de fichiers.",CR,LF
+0089 T 0000 "Fonction non prise en charge par le systŠme de fichiers.",CR,LF
+PARSE 1920 0011
+0001 T 0000 "Trop de paramŠtres.",CR,LF
+0002 T 0000 "Le paramŠtre requis est manquant.",CR,LF
+0003 T 0000 "Commutation non valide.",CR,LF
+0004 T 0000 "Mot-cl‚ non valide.",CR,LF
+0005 T 0000 "",
+0006 T 0000 "Le paramŠtre d‚passe les limites autoris‚es.",CR,LF
+0007 T 0000 "ParamŠtre non autoris‚.",CR,LF
+0008 T 0000 "ParamŠtre non autoris‚.",CR,LF
+0009 T 0000 "Le format du paramŠtre est incorrect.",CR,LF
+0010 T 0000 "ParamŠtre non valide.",CR,LF
+0011 T 0000 "Combinaison non valide de paramŠtres.",CR,LF
+IBMBIO 1b38 0018
+0003 U 0000 13,10,"Commande non reconnue dans CONFIG.SYS."
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Le fichier $ a de trop grands secteurs."
+0006 U 0000 13,10,"Fichier $ d‚fectueux ou manquant."
+0007 U 0000 "Interpr‚teur de commandes ",0
+0008 U 0000 13,10,"Code pays ou page de codes non valide.",13,10,"$"
+0009 U 0000 13,10,"Commande COUNTRY erron‚e.",13,10,"$"
+0010 U 0000 13,10, "M‚moire insuffisante pour le fichier COUNTRY.SYS.",13,10,"$"
+0011 U 0000 13,10,"Configuration trop importante pour la m‚moire.",13,10,"$"
+0012 U 0000 13,10,"Trop de p‚riph‚riques par blocs.",13,10,"$"
+0013 U 0000 13,10,"ParamŠtres STACK non valides.",13,10,"$"
+0014 U 0000 13,10,"Ordre des lignes incorrect dans fichier CONFIG.SYS.","$"
+0015 U 0000 "Ligne erron‚e dans CONFIG.SYS.","$"
+0016 T 0000 13,10,"Erreur d'attribution de m‚moire $."
+0017 T 0000 0DH,0AH,7,0DH,0AH, "D‚passement de capacit‚ dans la pile.",0DH,0AH
+ "SystŠme arrˆt‚.",0DH,0AH,"$"
+0020 T 0000 13,10,"Placez la disquette dans l'unit‚ "
+0021 T 0000 "A,",13,10,"appuyez ensuite sur une touche.",13,10,10,0
+0022 U 0000 13,10,"Commande ou paramŠtres erron‚s - $"
+BOOT 1fb6 0001
+0001 T 0000 13,10,"Disque sans systŠme ou erreur disque.",13,10
+ "Remplacez et appuyez sur une touche.",13,10,0
+DBCSDOS 203c 0000
+IBMDOS 2050 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 208f 0091
+0201 T 0000 "A"
+0202 T 0000 "R"
+0203 T 0000 "I"
+0204 T 0000 "C"
+0205 T 0000 "O"
+0206 T 0000 "N"
+0210 T 0000 "Abandon"
+0211 T 0000 ", Reprise"
+0212 T 0000 ", Ignore" ;AC000;
+0213 T 0000 ", Continue"
+0214 T 0000 "?" ;AC000;
+0215 T 0000 "lors de la lecture de ",CR,LF
+0216 T 0000 "lors de l'‚criture de ",CR,LF
+0217 T 0000 "%1 sur %2.",CR,LF
+0218 T 0000 "%1 sur %2.",CR,LF
+0219 T 0000 "Ins‚rez volume %1 num‚ro de s‚rie %2-%3.",CR,LF ;AC009;
+0221 T 0000 "COMMAND.COM non valide.",CR,LF
+0222 T 0000 "Placez disque avec %1 dans %2.",CR,LF
+0224 T 0000 CR,LF,"Arrˆt traitement des commandes (O/N) ?",CR,LF
+0225 T 0000 "%1 impossible.",CR,LF
+0226 T 0000 "Erreur dans fichier EXE.",CR,LF
+0227 T 0000 "M‚moire insuf. pour charger programme.",CR,LF
+0228 T 0000 CR,LF,"Pas d'indicateur de fichier disponible."
+0229 T 0000 "Nom de commande ou de fichier non valide.",CR,LF
+0231 T 0000 CR,LF,"Erreur d'attribution de m‚moire."
+0232 T 0000 CR,LF,"Ne peut charger COMMAND, systŠme arrˆt‚.",CR,LF
+0233 T 0000 CR,LF,"Ne peut lancer COMMAND, sortie.",CR,LF
+0234 T 0000 CR,LF,"Proc‚dure de niveau sup‚rieur abandonn‚e.",CR,LF
+0235 T 0000 CR,LF
+0463 T 0000 "Espace environnement insuffisant.",CR,LF
+0464 T 0000 CR,LF,"DOS de l'Ordinateur Personnel IBM.",CR,LF
+ "Version 3.40 (C)Copyright International Business Machines Corp 1981,1988.",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986.",CR,LF ;AC000;
+0465 T 0000 "R‚pertoire non valide pour recherche du programme COMMAND.",CR,LF
+0466 T 0000 "R‚pertoire non valide pour recherche du programme COMMAND - AccŠs refus‚.",CR,LF
+1002 T 0000 "Nom de fichier existant d‚j… ou fichier introuvable.",CR,LF
+1003 T 0000 "Nom de fichier ou de chemin non valide.",CR,LF
+1007 T 0000 "Espace environnement insuffisant.",CR,LF
+1008 T 0000 "Erreur de cr‚ation de fichier.",CR,LF
+1009 T 0000 "Fichier de commandes absent.",CR,LF
+1010 T 0000 CR,LF,"Placez disque avec fichier de commandes.",CR,LF
+1011 T 0000 "Nom de commande ou de fichier non valide.",CR,LF
+1016 T 0000 "Fichier destinataire perdu avant copie.",CR,LF
+1017 T 0000 "Nom de fichier non valide ou",CR,LF,"fichier introuvable.",CR,LF
+1018 T 0000 "%1 fichier(s) copi‚(s).",CR,LF
+1019 T 0000 "%1 fichier(s)." ;AC000;
+1022 T 0000 "Page de codes %1 non pr‚par‚e pour le systŠme.",CR,LF
+1023 T 0000 "Page de codes %1 non pr‚par‚e pour chaque p‚riph‚rique.",CR,LF
+1024 T 0000 "Page de codes active : %1.",CR,LF
+1025 T 0000 "NLSFUNC non install‚.",CR,LF
+1027 T 0000 "L'unit‚ en cours n'est plus valide.",CR,LF
+1029 T 0000 "Label introuvable.",CR,LF
+1030 T 0000 "Erreur de syntaxe.",CR,LF
+1032 T 0000 "Date du jour : %1 %2.",CR,LF
+1033 T 0000 "DimLunMarMerJeuVenSam"
+1034 T 0000 "Entrez la nouvelle date (%1) :"
+1036 T 0000 "Date du jour : %1.",CR,LF
+1037 T 0000 "Entrez la nouvelle heure :"
+1038 T 0000 ", A effacer (O/N)?" ;AC000;
+1039 T 0000 "Tous les fichiers du r‚pertoire seront effac‚s !",CR,LF
+ "Etes-vous s–r (O/N)?" ;AC000;
+1040 T 0000 "Ordinateur personnel IBM DOS ver. %1.%2.",CR,LF
+1044 T 0000 "R‚pertoire non valide.",CR,LF
+1046 T 0000 "Chemin non valide, r‚pert. inexistant",CR,LF,"ou contenant encore des fichiers.",CR,LF
+1047 T 0000 "Pr‚cisez ON ou OFF.",CR,LF
+1048 T 0000 "R‚pertoire %1",CR,LF
+1049 T 0000 "Pas de chemin.",CR,LF
+1050 T 0000 "Unit‚ non valide dans chemin de recherche.",CR,LF
+1051 T 0000 "P‚riph‚rique non valide.",CR,LF
+1052 T 0000 "FOR ne peut pas ˆtre imbriqu‚.",CR,LF
+1053 T 0000 "Erreur fichier interm. pendant chaŒnage.",CR,LF
+1054 T 0000 "Lecture binaire impossible",CR,LF,"… partir d'un p‚riph‚rique.",CR,LF
+1055 T 0000 "BREAK est %1.",CR,LF ;AC000;
+1056 T 0000 "VERIFY est %1.",CR,LF ;AC000;
+1057 T 0000 "ECHO est %1.",CR,LF ;AC000;
+1059 T 0000 "off",0 ;AC000;
+1060 T 0000 "on",0 ;AC000;
+1061 T 0000 "Erreur d'‚criture sur p‚riph‚rique.",CR,LF
+1063 T 0000 "%1" ;AC000;
+1064 T 0000 "%1" ;AC000;
+1065 T 0000 "%1" ;AC000;
+1066 T 0000 "%1" ;AC000;
+1067 T 0000 9 ;AC000;
+1068 T 0000 " <DIR> " ;AC000;
+1069 T 0000 8," ",8 ;AC000;
+1070 T 0000 CR,LF ;AC000;
+1071 T 0000 "%1" ;AC000;
+1072 T 0000 "mm-jj-aa"
+1073 T 0000 "jj-mm-aa"
+1074 T 0000 "aa-mm-jj"
+1075 T 0000 "%1 %2" ;AC000;
+1076 T 0000 "%1" ;AC000;
+1077 T 0000 " %1 %2"
+1078 T 0000 "R‚pertoire existant d‚j….",CR,LF ;AC000;
+ATTRIB 3373 0016
+0004 T 0000 "Nombre de paramŠtres incorrect.",CR,LF
+0005 T 0000 "Chemin non valide ou fichier introuvable.",CR,LF
+0006 T 0000 "Erreur de syntaxe.",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 T 0000 "%1 : Non-correspondance de la page de codes.",CR,LF,"Etes-vous s–r (O/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 T 0000 "Type de fichier non valide.",CR,LF
+0199 T 0000 "Erreur d'attribut ‚tendu.",CR,LF
+0201 T 0000 "Nom d'attribut ‚tendu introuvable.",CR,LF
+0204 T 0000 "Impossible de donner un nom d'attribut ‚tendu.",CR,LF
+0205 T 0000 "Nom d'attribut ‚tendu connu par systŠme de fichiers",CR,LF,"mais non pris en charge.",CR,LF
+0206 T 0000 "Non-correspondance du type d'attribut ‚tendu.",CR,LF
+0208 T 0000 "Attribut ‚tendu non pris en charge.",CR,LF
+ASSIGN 36be 0001
+0002 T 0000 "%1: d'origine d‚sign‚e en tant que %2:",cr,lf
+CHKDSK 370e 0063
+0003 T 0000 "Conversion chaŒne(s) perdue(s)",CR,LF,"en fichier(s) (O/N) ?",CR,LF
+0004 T 0000 "Erreur irr‚m‚diable dans r‚pertoire.",CR,LF
+0005 T 0000 "Conversion du r‚pertoire en fichiers."
+0007 T 0000 "%1 octets espace total.",CR,LF
+0008 T 0000 "%1 octets dans secteurs d‚fectueux.",CR,LF
+0009 T 0000 "%1 octets dans %2 fichier(s) cach‚(s).",CR,LF
+0010 T 0000 "%1 octets dans %2 r‚pertoire(s).",CR,LF
+0011 T 0000 "%1 octets dans %2 fichier(s) utilisateur.",CR,LF
+0012 T 0000 "%1 octets dans %2 fichier(s) r‚cup‚r‚(s).",CR,LF
+0013 T 0000 "%1 octets seraient dans %2 fichiers r‚cup‚r‚s." ;orphmes3
+0014 T 0000 "%1 octet(s) disponible(s) sur disque.",CR,LF
+0015 T 0000 "%1 octets de m‚moire totale." ;totmem
+0016 T 0000 "%1 octet(s) disponible(s).",CR,LF
+0017 T 0000 "CHKDSK impossible avec unit‚ de r‚seau."
+0018 T 0000 "Ex‚cution de CHKDSK impossible sur",CR,LF
+ "une unit‚ ASSIGN‚e ou SUBSTitu‚e."
+0019 T 0000 "Disque probablement non-DOS.",CR,LF
+ "Voulez-vous continuer (O/N) ?"
+0020 T 0000 "Erreur de lecture sur disque de la table des fichiers %1.",CR,LF ;badr
+0021 T 0000 "R‚pertoire %1."
+0022 T 0000 "%1 contient %2 bloc(s) non-adjacent(s)."
+0023 T 0000 "Tous ces fichiers sont adjacents."
+0024 T 0000 "Erreurs trouv‚es,",CR,LF,"paramŠtre F non sp‚cifi‚.",CR,LF
+ "Corrections non ‚crites sur disque.",CR,LF
+0025 T 0000 " Le traitement ne peut se poursuivre %1%2."
+0026 T 0000 " Table des fichiers non valide dans unit‚ %1."
+0029 T 0000 " CHDIR a ‚chou‚ avec autre m‚thode."
+0030 T 0000 " Groupe non valide, fichier tronqu‚."
+0031 T 0000 " El‚ment de sous-r‚pertoire non valide."
+0032 T 0000 " N'existe pas."
+0033 T 0000 " Premier nombre de groupe non valide, entr‚e tronqu‚e."
+0034 T 0000 " Erreur d'attribution, longueur ajust‚e."
+0035 T 0000 " R‚cup‚ration de .. impossible,",CR,LF," le traitement continue."
+0036 T 0000 " R‚pertoire vide, pas de . ni de .."
+0037 T 0000 " R‚pertoire joint."
+0038 T 0000 " R‚cup‚ration de .. impossible."
+0039 T 0000 " Liaison non valide." ;norecddot1
+0040 T 0000 " Attribut non valide." ;norecddot2
+0041 T 0000 " Longueur non valide." ;norecddot3
+0042 T 0000 " est crois‚ sur le groupe %1."
+0043 T 0000 " CHDIR impossible sur %1,",CR,LF," structure non trait‚e au-del…",CR,LF," de ce point."
+0044 T 0000 " structure non trait‚e au-del…",CR,LF," de ce point."
+0045 T 0000 "%1 octets rendus disponibles sur disque.",0
+0046 T 0000 "%1 octets seraient rendus disponibles sur disque." ;freebymes2
+0047 T 0000 "Volume %s",CR,LF,"cr‚‚ le",CR,LF
+0048 T 0000 "%1 total des unit‚s d'attribution sur disque."
+0049 T 0000 "%1 octet(s) dans chaque unit‚ d'attribution." ;idmes2
+0050 T 0000 "CHKDSK non disponible sur unit‚ %1." ;msgExecFailure
+0051 T 0000 " Groupes non valides dans attributs ‚tendus, attributs tronqu‚s." ;nv_XA_Msg
+0052 T 0000 " Erreur d'attribution des attributs ‚tendus, attributs tronqu‚s." ;Alloc_XA_Msg
+0053 T 0000 "ParamŠtre non valide."
+0055 T 0000 "Chemin introuvable."
+0056 T 0000 "Fichier introuvable."
+0058 T 0000 " %1 groupe(s) perdu(s) dans",CR,LF," %2 chaŒne(s).",CR,LF
+0059 T 0000 CR,LF ;crlf_arg
+0060 T 0000 " CHDIR impossible sur ",CR,LF
+ " r‚pertoire principal",CR,LF
+0061 T 0000 " Erreur disque lors de l'‚criture de la table des fichiers %1." ;badw_arg
+0062 T 0000 " %1" ;noisy_arg
+0063 T 0000 "R‚pertoire en cours non valide."
+0064 T 0000 "%1",CR,LF ;file_arg
+0065 T 0000 "Espace insuffisant dans le r‚pertoire principal.",CR,LF
+ "Effacez des fichiers du r‚pertoire principal et refaites CHKDISK.",CR,LF
+0066 T 0000 "%1 %2 %3" ;eup_arg
+0067 T 0000 "%1 %2, %3" ;usp_arg
+0068 T 0000 "%1%2%3%4%5" ;oth_arg
+0069 T 0000 "%1%2%3%4" ;time_arg
+0070 T 0000 "%1 unit‚s d'attribution disponibles sur disque.",cr,lf ;idmes2 ;an017;bgb
+DEBUG 47a1 0062
+0004 T 0000 "Attribution imposs. ou m‚moire tampon insuffisante.",CR,LF
+0005 T 0000 "Info. Msg erron‚e ou absente.",CR,LF
+0006 T 0000 "Nom de p‚riph‚rique non valide."
+0007 T 0000 "Impossible d'ouvrir p‚riph. de liste PRN.",CR,LF
+ "Nom du p‚riph‚rique ? "
+0008 T 0000 CR,LF ;crlf_ptr
+0009 T 0000 CR,LF,"Fin normale du programme.",CR,LF
+0010 T 0000 "D‚signation d'unit‚ non valide.",CR,LF
+0012 T 0000 "Erreur de cr‚ation de fichier.",CR,LF
+0013 T 0000 "Espace insuffisant sur disque.",CR,LF
+0014 T 0000 "Erreur de lecture sur le disque de l'unit‚ %1.",CR,LF
+0015 T 0000 "Erreur d'‚criture sur le disque de l'unit‚ %1.",CR,LF
+0016 T 0000 "Erreur de lecture sur l'unit‚ %1 ; protection contre l'‚criture.",CR,LF
+0017 T 0000 "Erreur d'‚criture sur l'unit‚ %1 ; protection contre l'‚criture.",CR,LF
+0019 T 0000 "%1^ Erreur."
+0020 T 0000 "Erreur dans fichier EXE ou HEX.",CR,LF
+0021 T 0000 "Ecriture impossible dans fichiers EXE et HEX.",CR,LF
+0022 T 0000 "Erreur d'EXEC."
+0023 T 0000 "Erreur d'‚criture ; destination non d‚finie.",CR,LF
+0024 T 0000 "AccŠs refus‚.",CR,LF
+0025 T 0000 "M‚moire inexistante ou erreur de parit‚."
+0026 T 0000 "-" ;prompt_ptr
+0027 T 0000 "%1 -" ;change_flag_ptr
+0032 T 0000 "%1%2" ;unassem_ln_ptr
+0033 T 0000 "%1:%2 %3" ;hex_ptr
+0034 T 0000 "%1 %2" ;add_ptr
+0035 T 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0000 "%1=%2 " ;register_ptr
+0037 T 0000 "Erreur %1"
+0038 T 0000 "Ecriture %1 octets"
+0039 T 0000 "%1:%2=" ;loc_ptr
+0040 T 0000 "%1" ;little_ptr
+0041 T 0000 "%1" ;big_ptr
+0042 T 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "%1 erreur %2 unit‚ %3"
+0044 T 0000 32,8 ;bacmes_ptr
+0045 T 0000 "Attribution impossible de gestionnaire de messages",CR,LF ;
+0046 T 0000 "%1" ;arg_buf_ptr
+0047 T 0000 "%1" ;one_char_buf_ptr
+0050 T 0000 "%1 sur un total de %2 pages EMS a ‚t‚ attribu‚.",cr,lf
+0051 T 0000 "%1 sur un total de %2 indicateurs EMS a ‚t‚ attribu‚.",cr,lf
+0054 T 0000 "Cadre de page = "
+0055 T 0000 "Indicateur cr‚‚ = %1.",cr,lf
+0056 T 0000 "Page logique %1 mapp‚e sur la page physique %2.",cr,lf
+0057 T 0000 "Erreur logiciel/mat‚riel EMS.",cr,lf
+0058 T 0000 "Indicateur introuvable.",cr,lf
+0059 T 0000 "Code fonction non valide.",cr,lf
+0060 T 0000 "Aucun indicateur disponible.",cr,lf
+0061 T 0000 "Erreur Sauvegarde/Restauration.",cr,lf
+0062 T 0000 "D‚passement du total des pages.",cr,lf
+0063 T 0000 "D‚passement du nombre de pages disponibles.",cr,lf
+0064 T 0000 "Erreur de paramŠtres.",cr,lf
+0065 T 0000 "Page logique hors limite.",cr,lf
+0066 T 0000 "Page physique hors limite.",cr,lf
+0067 T 0000 "Zone de sauvegarde d‚j… utilis‚e.",cr,lf
+0068 T 0000 "Zone de sauvegarde disponible.",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0000 "ParamŠtre EMS absent ou non valide.",cr,lf
+0072 T 0000 "%2 pages attribu‚es … l'indicateur %1.",cr,lf
+0074 T 0000 "Restauration EMS r‚ussie.",cr,lf
+0075 T 0000 "Page physique %1 = Segment de cadre %2.",cr,lf
+0076 T 0000 "Indicateur %1 supprim‚.",cr,lf
+0078 T 0000 "EMS non install‚.",CR,LF
+DRIVER 5536 0002
+0002 T 0000 "Unit‚ non sp‚cifi‚e.",CR,LF
+0003 T 0000 "Prog. de disquette externe charg‚ pour unit‚ %1.",CR,LF
+EDLIN 55ba 0028
+0006 T 0000 "*" ;prompt_ptr
+0007 T 0000 "Nom d'unit‚ ou de fichier non valide.",CR,LF
+0008 T 0000 "Le nom de fichier DOIT ˆtre sp‚cifi‚.",CR,LF
+0009 T 0000 "ParamŠtre non valide.",CR,LF
+0010 T 0000 "Fichier en LECTURE SEULEMENT.",CR,LF
+0011 T 0000 "Erreur de cr‚ation de fichier.",CR,LF
+0012 T 0000 "Trop de fichiers ouverts.",CR,LF
+0013 T 0000 "Erreur de lecture dans :",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0000 "Edition de fichier .BAK impossible.",CR,LF
+ "Renommez le fichier.",CR,LF
+0015 T 0000 "Pas de place pour fichier",CR,LF,"dans ce r‚pertoire.",CR,LF
+0016 T 0000 "Disque satur‚. Fichiers perdus.",CR,LF
+0017 T 0000 "Fichier introuvable.",CR,LF
+0018 T 0000 "Erreur d'entr‚e.",CR,LF
+0019 T 0000 "Nouveau fichier.",CR,LF
+0020 T 0000 "Introuvable.",CR,LF
+0021 T 0000 "D'accord ?",CR,LF
+0022 T 0000 "Ligne trop longue.",CR,LF
+0023 T 0000 "Fin du fichier d'entr‚e.",CR,LF
+0024 T 0000 "Abandon du programme ? (O/N) "
+0025 T 0000 "PRECISEZ nø de ligne de destination.",CR,LF
+0026 T 0000 "Espace insuffisant pour fusion complŠte.",CR,LF
+0027 T 0000 CR,LF ;crlf_ptr
+0028 T 0000 LF ;lf_ptr
+0029 T 0000 "Voulez-vous continuer (O/N)?" ;cont_ptr
+0030 T 0000 "Impression de message impossible.",CR,LF ;fatal_error
+0031 T 0000 "%1" ;arg_buf_ptr
+0032 T 0000 "%1:%2" ;line_num_buf_ptr
+0033 T 0000 "Fusion impossible - Non-correspondance de page de codes.",CR,LF ;cp_err_ptr
+EXE2BIN 5bd6 0010
+0002 T 0000 "M‚moire insuffisante.",CR,LF
+0003 T 0000 "Messages introuvables.",CR,LF
+0004 T 0000 "AccŠs refus‚.",CR,LF
+0005 T 0000 "Conversion de fichier impossible.",CR,LF
+0006 T 0000 "Fichier introuvable.",CR,LF
+0007 T 0000 "Erreur de cr‚ation de fichier.",CR,LF
+0008 T 0000 "Corrections n‚cessaires - segment de base (hex):"
+0009 T 0000 "ParamŠtre non valide.",CR,LF
+0011 T 0000 "ATTENTION - Erreur de lecture dans fichier EXE.",CR,LF
+ "Quantit‚ lue inf‚rieure … la taille sp‚cifi‚e dans l'en-tˆte.",CR,LF
+0012 T 0000 "Le nom de fichier DOIT ˆtre sp‚cifi‚.",CR,LF
+FIND 5e2c 0001
+0004 T 0000 "FIND: "
+FORMAT 5e56 0044
+0002 T 0000 CR,"%1 pour cent du disque format‚s."
+0004 T 0000 CR,"Formatage termin‚ ",CR,LF
+0007 T 0000 "Placez une nouvelle disquette",CR,LF,"dans l'unit‚ %1:",CR,LF
+0009 T 0000 "Placez de nouveau la disquette",CR,LF,"dans l'unit‚ %1:",CR,LF
+0010 T 0000 "Donnez label de volume (11 car.) :"
+0011 T 0000 CR,"Formatage impossible sur l'unit‚ %1:", CR,LF
+0012 T 0000 CR,"ParamŠtres non valides dans pilote de p‚riph‚riques.",CR,LF
+0013 T 0000 CR,"Erreur dans l'appel IOCTL.",CR,LF
+0014 T 0000 CR,"Ce n'est pas un p‚riph. d'E-S par blocs. ",CR,LF
+0015 T 0000 CR,"Erreur d'‚criture dans table des fichiers. ",CR,LF
+0016 T 0000 CR,"Erreur d'‚criture dans r‚pertoire.",CR,LF
+0017 T 0000 CR,"Formatage impossible d'une",CR,LF,"unit‚ ASSIGN‚e ou SUBSTitu‚e.",CR,LF
+0018 T 0000 CR,"Fichiers systŠme introuvables.",CR,LF
+0019 T 0000 CR,"Formatage d'une unit‚ r‚seau impossible.",CR,LF
+0020 T 0000 CR,"CaractŠres non valides dans",CR,LF,"le label de volume.",CR,LF
+0021 T 0000 CR,"ParamŠtres non conformes.",CR,LF
+0022 T 0000 CR,"Formatage interrompu. ",CR,LF
+0023 T 0000 CR,"Disque inutilisable pour",CR,LF,"fichiers systŠme.",CR,LF
+0024 T 0000 CR,"Support ou piste 0 non valide.",CR,LF,"Disque inutilisable.",CR,LF
+0025 T 0000 CR,"Ecriture du programme BOOT impossible.",CR,LF
+0026 T 0000 CR,"Erreur de lecture dans r‚pertoire.",CR,LF
+0028 T 0000 CR,"et appuyez sur ENTREE quand vous ˆtes prˆt..."
+0029 T 0000 CR,"ID de volume non valide.",CR,LF
+0031 T 0000 CR,"Entrez label du volume en cours sur %1:"
+0032 T 0000 CR,"ParamŠtres incompatibles",CR,LF,"avec disque dur.",CR,LF
+0035 T 0000 CR,"Erreur de lecture dans table des partitions.",CR,LF
+0037 T 0000 CR,"Formatage interrompu.",CR,LF
+0038 T 0000 CR,"Formatage impossible sur %1:",CR,LF
+0039 T 0000 CR,"Disque sans systŠme ou erreur disque.",CR,LF
+0040 T 0000 CR,"Table des partitions incorrecte. ",CR,LF
+0041 T 0000 CR,"ParamŠtres incompatibles avec unit‚ ",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"Placez la disquette DOS dans l'unit‚ %1:",CR,LF
+0045 T 0000 CR,LF,"ATTENTION: LES DONNEES DU DISQUE DUR %1:",CR,LF
+ "VONT ETRE DETRUITES.",CR,LF
+ "Maintenez-vous votre demande (O/N) ?"
+0046 T 0000 CR,"Autre formatage (O/N) ?",CR,LF
+0047 T 0000 CR,"Erreur de lecture dans table des partitions.",CR,LF
+0048 T 0000 CR,"Erreur d'‚criture dans table des partitions.",CR,LF
+0049 T 0000 CR,"ParamŠtres incompatibles.",CR,LF
+0050 T 0000 "%1 unit‚s d'attribution disponibles sur disque.",CR,LF
+0051 T 0000 "%1 octets dans chaque unit‚ d'attribution.",CR,LF
+0052 T 0000 CR,"Erreur d'‚criture dans table des partitions.",CR,LF
+0053 T 0000 CR,"Le mˆme paramŠtre a ‚t‚ entr‚ deux fois.",CR,LF
+0054 T 0000 CR,"Entrez les DEUX paramŠtres /T et /N.",CR,LF ;AN009;
+JOIN 6956 0001
+0002 T 0000 CR,LF,"Le r‚pertoire contient encore des fichiers.",CR,LF
+MORE 69b1 0001
+0002 T 0000 "- Suite - "
+PRINT 69df 0022
+0002 T 0000 CR,LF
+0006 T 0000 "Erreur de lecture du fichier.",CR,LF,"$"
+0007 T 0000 "Fichier introuvable.",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Fichier $ "
+0009 T 0000 "annul‚",CR,LF,"par l'op‚rateur$.",CR,LF
+0010 T 0000 CR,LF,LF,"Demandes d'impression",CR,LF,"annul‚es par l'op‚rateur$."
+0011 T 0000 "Table des fichiers non valide dans l'unit‚ "
+0012 T 0000 "A.",CR,LF,"$"
+0013 T 0000 "Sortie liste non affect‚e …",CR,LF,"un p‚riph‚rique.",CR,LF
+0014 T 0000 "Partie r‚sidente de PRINT install‚e.",CR,LF
+0015 T 0000 "Utilisation de PRINT impossible",CR,LF,"- Utilisez NET PRINT.",CR,LF
+0017 T 0000 "File d'attente d'impression satur‚e.",CR,LF
+0018 T 0000 "File d'attente d'impression vide.",CR,LF
+0019 T 0000 "AccŠs refus‚.",CR,LF
+0020 T 0000 "D‚signation d'unit‚ non valide.",CR,LF
+0021 T 0000 "Erreurs d'imprimante :",CR,LF
+ "v‚rifiez qu'elle est en ligne.",CR,LF
+0022 T 0000 CR,LF,LF," %1 est en cours d'impression.",CR,LF
+0023 T 0000 " %1 est dans la file d'attente.",CR,LF
+0024 T 0000 "%1 Fichier introuvable.",CR,LF
+0025 T 0000 "Le nom de chemin est trop long.",CR,LF
+0026 T 0000 "Le fichier n'est pas dans la file d'attente.",CR,LF
+0027 T 0000 "Nom d'imprimante [PRN]: ",CR,LF
+RECOVER 6ea7 0012
+0002 T 0000 CR,LF,"Fichier introuvable.",CR,LF
+0003 T 0000 CR,LF,"R‚cup‚ration impossible d'une unit‚ ASSIGN‚e ou SUBSTitu‚e.",CR,LF
+0004 T 0000 CR,LF,"Nom d'unit‚ ou de fichier non valide.",CR,LF
+0005 T 0000 CR,LF,"Attention : r‚pertoire satur‚.",CR,LF
+0006 T 0000 CR,LF,"R‚cup‚ration impossible d'une unit‚ de r‚seau.",CR,LF
+0007 T 0000 CR,LF,"R‚cup‚ration impossible sur %1.",CR,LF
+0008 T 0000 CR,LF,"%1 fichier(s) r‚cup‚r‚(s).",CR,LF
+0009 T 0000 CR,LF,"%1 octet(s) r‚cup‚r‚(s) sur %2.",CR,LF
+0010 T 0000 CR,LF,"Appuyez sur une touche pour r‚cup‚rer ",CR,LF,"le(s) fichier(s) sur l'unit‚ %1.",CR,LF,CR,LF
+0011 T 0000 CR,LF,"Lecture impossible de la table des fichiers.",CR,LF
+0012 T 0000 CR,LF,"Ecriture impossible dans la table des fichiers.",CR,LF
+0013 T 0000 CR,LF
+SORT 71ca 0001
+0005 T 0000 "SORT: "
+SUBST 71f4 0001
+0002 T 0000 CR,LF,"Nombre de paramŠtres incorrect",CR,LF
+SYS 7242 0008
+0004 T 0000 "D‚signation d'unit‚ non valide.",CR,LF
+0007 T 0000 "Espace insuffisant pour sys. sur disque cible.",CR,LF
+0008 T 0000 "Espace allou‚ au systŠme insuffisant.",CR,LF
+0010 T 0000 "Pas de systŠme sur unit‚ par d‚faut.",CR,LF
+0011 T 0000 "Impossible de sp‚cifier unit‚ par d‚faut.",CR,LF ; New
+0012 T 0000 "Ecriture impossible, disque inutilisable.",CR,LF ; New
+0014 T 0000 "Placez disquette systŠme dans unit‚ %1.",CR,LF ; Old
+0016 T 0000 "SYS impossible sur systŠme de fichiers %1.",CR,LF ; New
+SHARE 7470 0000
+NLSFUNC 7484 0000
+ANSI 7498 0001
+0010 T 0000 "ParamŠtre non valide - %1",CR,LF
+IFSFUNC 74db 0001
+0004 T 0000 "Programmes IFS introuvables.",CR,LF
+PSPRINT 7521 0007
+0002 T 0000 "Erreur de lecture du fichier.",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"Fichier annul‚ par l'op‚rateur.",CR,FORMFD,BELL
+0004 T 0000 "Table des fichiers non valide dans l'unit‚ "
+0005 T 0000 "A.",CR,LF,"$"
+0006 T 0000 "Sortie liste non affect‚e …",CR,LF,"un p‚riph‚rique",CR,LF
+0007 T 0000 "PSPRINT est d‚j… install‚e.",CR,LF
+0008 T 0000 "Conflit entre PSPRINT et PRINT.",CR,LF
+BACKUP 76c5 0022
+0002 T 0000 CR,LF,"M‚moire insuffisante.",CR,LF
+0006 T 0000 CR,LF,"D‚signation d'unit‚ non valide.",CR,LF
+0014 T 0000 CR,LF,"Unit‚s source et cible identiques.",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Erreur d'ouverture du journal.",CR,LF
+0018 T 0000 CR,LF,"Enregistrement dans fichier %1.",CR,LF
+0019 T 0000 CR,LF,"La derniŠre disquette de sauvegarde",CR,LF,"n'a pas ‚t‚ introduite.",CR,LF
+0020 T 0000 CR,LF,"Attention ! Les fichiers du r‚pertoire",CR,LF
+ "principal de %1:\ vont ˆtre effac‚s.",CR,LF
+0021 T 0000 CR,LF,"Attention ! Les fichiers du r‚pertoire",CR,LF
+ "BACKUP de %1: vont ˆtre effac‚s.",CR,LF
+0022 T 0000 CR,LF,"*** Sauvegarde des fichiers sur unit‚ %1: ***",CR,LF
+0023 T 0000 "Num‚ro de la disquette : %1",CR,LF
+0024 T 0000 CR,LF,"Fichiers … sauvegarder introuvables.",CR,LF
+0025 T 0000 CR,LF,"Placez disquette source de sauvegarde dans %1:",CR,LF
+0026 T 0000 CR,LF,"Placez la disquette de sauvegarde %1",CR,LF"dans l'unit‚ %2:",CR,LF
+0027 T 0000 CR,LF,"*** Sauvegarde des fichiers impossible ***",CR,LF
+0028 T 0000 CR,LF,"Placez la derniŠre disquette de",CR,LF,"sauvegarde dans l'unit‚ %1:",CR,LF
+0029 T 0000 CR,LF,"Disque cible inutilisable",CR,LF"pour sauvegarde.",CR,LF
+0030 T 0000 CR,LF,"*** Dernier fichier non sauvegard‚ ***",CR,LF
+0031 T 0000 CR,LF,"Le disque dur de sauvegarde %1: est satur‚.",CR,LF
+0032 T 0000 CR,LF,"Disque satur‚. Erreur d'‚criture sur journal.",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 7cda 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 7d14 0013
+0004 T 0000 "10 ‚checs - Arrˆt de la comparaison.",CR,LF
+0006 T 0000 "Erreur de comparaison … DEPLACEMENT %1.",CR,LF
+0007 T 0000 "Fichier 1 = %1.",CR,LF
+0008 T 0000 "Fichier 2 = = %1.",CR,LF
+0009 T 0000 "Marque de fin de fichier introuvable.",CR,LF
+0010 T 0000 "Fichiers identiques.",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Entrez le nom du premier fichier.",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Entrez le nom du 2e fichier ou l'ID d'unit‚.",CR,LF
+0017 T 0000 "Fichiers de longueurs diff‚rentes.",CR,LF
+0018 T 0000 "Autre comparaison (O/N) ? ",CR,LF
+0019 T 0000 "%1 et %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Fichiers identiques.",CR,LF
+DISKCOMP 7fa6 0016
+0004 T 0000 "N'indiquez pas de nom de fichier.",CR,LF
+ "Syntaxe : DISKCOMP u: u:[/1][/8].",CR,LF
+0005 T 0000 CR,LF,"D‚signation d'unit‚ non valide.",CR,LF
+ "L'unit‚ sp‚cifi‚e n'existe pas "
+ "ou est inamovible."
+0006 T 0000 CR,LF,"DISKCOMP impossible vers ou … partir "
+ "d'une unit‚ de r‚seau.",CR,LF
+0007 T 0000 CR,LF,"Ins‚rez le PREMIER disque dans %1:",CR,LF
+0008 T 0000 CR,LF,"Ins‚rez le SECOND disque dans %1:",CR,LF
+0009 T 0000 CR,LF,"PREMIER disque d‚fectueux ou incompatible.",CR,LF
+0010 T 0000 CR,LF,"SECOND disque d‚fectueux ou incompatible.",CR,LF
+0014 T 0000 CR,LF,"Autre comparaison (O/N) ? ",CR,LF
+0015 T 0000 CR,LF,"Comparaison de %1 pistes",CR,LF
+ "%2 secteurs/piste, %3 face(s).",CR,LF
+0016 T 0000 CR,LF,"Types d'unit‚ ou types de disquette",CR,LF
+ "incompatibles.",CR,LF
+0017 T 0000 CR,LF,"Erreur de lecture irr‚cup‚rable sur l'unit‚ %2",CR,LF
+ "face %3, piste %4.",CR,LF
+0018 T 0000 CR,LF,"Erreur de comparaison sur",CR,LF,"face %3, piste %4.",CR,LF
+0019 T 0000 "Assurez-vous qu'une disquette",CR,LF
+ "est plac‚e dans l'unit‚ et que",CR,LF
+ "le clapet est ferm‚.",CR,LF
+0020 T 0000 CR,LF,"Comparaison termin‚e.",CR,LF
+0021 T 0000 CR,LF,"Comparaison OK.",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 8482 0018
+0002 T 0000 CR,LF
+0004 T 0000 "N'indiquez pas de nom de fichier.",CR,LF
+ "Syntaxe : DISKCOPY u: u:[/1][/8].",CR,LF
+0005 T 0000 CR,LF,"D‚signation d'unit‚ non valide.",CR,LF
+ "L'unit‚ sp‚cifi‚e n'existe pas "
+ "ou est inamovible."
+0006 T 0000 CR,LF,"DISKCOMP impossible vers ou … partir "
+ "d'une unit‚ de r‚seau.",CR,LF
+0007 T 0000 CR,LF,"Formatage pendant la copie.",CR,LF
+0008 T 0000 CR,LF,"Placez la disquette SOURCE dans l'unit‚ %1:",CR,LF
+0009 T 0000 CR,LF,"Placez la disquette CIBLE dans l'unit‚ %1:",CR,LF
+0010 T 0000 "Assurez-vous qu'une disquette est ins‚r‚e",CR,LF ;AN004;
+ "dans l'unit‚ et que le clapet est ferm‚.",CR,LF ;AN004;
+0011 T 0000 CR.LF,"La disquette cible peut ˆtre",CR,LF,"inutilisable.",CR,LF
+0012 T 0000 CR,LF,"Disquette cible inutilisable.",CR,LF
+0016 T 0000 CR,LF,"Copie d'une autre (O/N)? ",CR,LF
+0017 T 0000 CR,LF,"Copie de %1 pistes",CR,LF
+ "%2 secteurs/piste, %3 face(s).",CR,LF
+0018 T 0000 CR,LF,"Types d'unit‚ ou types de disquette",CR,LF
+ "incompatibles.",CR,LF
+0019 T 0000 CR,LF,"Erreur de lecture irr‚cup‚rable sur l'unit‚ %1",CR,LF
+ "%2 secteurs/piste, %3 face(s).",CR,LF
+0020 T 0000 CR,LF,"Erreur d'‚criture irr‚cup‚rable sur l'unit‚ %1",CR,LF
+ "%2 secteurs/piste, %3 face(s).",CR,LF
+0021 T 0000 CR,LF,"Copie termin‚e.",CR,LF
+0022 T 0000 CR,LF,"Disquette SOURCE d‚fectueuse ou incompatible."
+0023 T 0000 CR,LF,"Disquette CIBLE d‚fectueuse ou incompatible.",CR,LF
+LABL 8a55 0000
+MODE 8a69 0055
+0003 T 0000 CR,LF,"Vous devez sp‚cifier COM1 ou COM2.",CR,LF
+0004 T 0000 CR,LF,"Partie r‚sidente de MODE charg‚e.",CR,LF
+0005 T 0000 CR,LF,"Nom de p‚riph‚rique non autoris‚.",CR,LF
+0006 T 0000 CR,LF,"Erreur d'imprimante.",CR,LF
+0007 T 0000 CR,LF,"LPT%1: r‚gl‚e … 80.",CR,LF
+0008 T 0000 CR,LF,"LPT%1: r‚gl‚e … 132.",CR,LF
+0009 T 0000 CR,LF,"Nombre de lignes au pouce d‚fini.",CR,LF
+0010 T 0000 CR,LF,"D‚bit sp‚cifi‚ non valide.",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6.",CR,LF
+0012 T 0000 "0123456789"
+0013 T 0000 CR,LF,"Voyez-vous le %1 ? (o/n) "
+0014 T 0000 CR,LF,"ParamŠtres non valides.",CR,LF
+0015 T 0000 "LPT%1: r‚achemin‚e sur COM%2:",CR,LF
+0016 T 0000 "LPT%1: non r‚achemin‚e.",CR,LF
+0017 T 0000 CR,LF,"D‚lai de relance %1 sur imprimante parallŠle.",CR,LF
+0018 T 0000 CR,LF,"D‚calage affich. vers la %1 imposs.",CR,LF
+0020 T 0000 CR,LF,"Nombre de paramŠtres incorrect.",CR,LF
+0021 T 0000 CR,LF,"NET 042: Ex‚cution commande impossible.",CR,LF
+0022 T 0000 CR,LF,"Relance infinie impossible sur une imprimante r‚seau.",CR,LF
+0023 T 0000 CR,LF,"AccŠs impossible au fichier police des pages de codes.",CR,LF
+0024 T 0000 CR,LF,"AccŠs impossible … l'unit‚ %1.",CR,LF
+0025 T 0000 CR,LF,"Unit‚ ou page de codes manquante sur fichier police.",CR,LF
+0026 T 0000 CR,LF,"Contenu du fichier police incorrect.",CR,LF
+0027 T 0000 CR,LF,"Page de codes pr‚c‚dente remplac‚e.",CR,LF
+0028 T 0000 CR,LF,"La page de codes active pour l'unit‚ %1 est %2.",CR,LF
+0029 T 0000 CR,LF,"Unit‚ %1 non pr‚par‚e.",CR,LF
+0030 T 0000 "Pages de codes %1 :",CR,LF
+0031 T 0000 " Page de codes %1 :",CR,LF
+0032 T 0000 CR,LF,"MODE: Fonction %1 page de codes termin‚e.",CR,LF
+0033 T 0000 CR,LF,"Erreur de page de codes %1 globale.",CR,LF ;FILLED IN with "setting" or "getting"
+0034 C 0000 CR,LF,"Page de codes en cours :",CR,LF ;table header
+0035 T 0000 " %1 - %2 Page de codes.",CR,LF
+0036 T 0000 " Page de codes non pr‚par‚e.",CR,LF
+0037 T 0000 CR,LF,"Page de codes non prise en charge sur cette unit‚.",CR,LF
+0038 T 0000 "Aucune page de codes n'a ‚t‚ SELECTEE.",CR,LF
+0039 T 0000 "Erreur unit‚ %1.",CR,LF
+0040 T 0000 " Page de codes non pr‚par‚e.",CR,LF
+0041 T 0000 CR,LF,"Le clavier en cours ne prend pas ",cr,lf,"en charge cette page de codes.",CR,LF
+0042 T 0000 CR,LF,"Erreur lors de la lecture du fichier police.",CR,LF
+0043 T 0000 CR,LF,"R‚g‚n‚ration impossible.",CR,LF
+0044 T 0000 CR,LF ;used for formatting
+0045 T 0000 CR,LF,"Etat de l'unit‚ %1:",CR,LF ;header for status reports
+0046 T 0000 "------------------" ;first part of underline under "Etat de l'unit‚ %1:"
+0047 T 0000 "----",CR,LF ;four_char_underline
+0048 T 0000 "-----",CR,LF ;five_char_underline
+0049 T 0000 "LINES=%1",CR,LF
+0050 T 0000 "COLUMNS=%1",CR,LF
+0051 T 0000 CR,LF,"RATE et DELAY doivent ˆtre sp‚cifi‚s ensemble.",CR,LF
+0052 T 0000 "RATE=%1",CR,LF
+0053 T 0000 "DELAY=%1",CR,LF
+0054 T 0000 CR,LF,"Fonction impossible sur cet ordinateur - %1.",CR,LF
+0055 T 0000 CR,LF,"Police requise non charg‚e.",CR,LF
+0056 T 0000 CR,LF,"ANSI.SYS doit ˆtre install‚ pour ex‚cuter la fonction.",CR,LF
+0057 T 0000 CR,LF,"D‚bit (en bauds) requis.",CR,LF
+0058 T 0000 "RETRY=%1",CR,LF
+RESTORE 9742 0022
+0002 T 0000 CR,LF,"Unit‚s source et cible identiques.",CR,LF
+0003 T 0000 CR,LF,"Nombre de paramŠtres incorrect.",CR,LF
+0006 T 0000 CR,LF,"D‚signation d'unit‚ non valide.",CR,LF
+0007 T 0000 CR,LF,"Attention ! Fichiers … restaurer introuvables.",CR,LF
+0008 T 0000 CR,LF,"Placez la disquette de sauvegarde %1 dans l'unit‚ %2:",CR,LF
+0009 T 0000 CR,LF,"Placez la disquette cible dans l'unit‚ %1:",CR,LF
+0011 T 0000 CR,LF,"Attention ! Disquette d‚class‚e.",CR,LF
+ "Changez de disquette ou continuez.",CR,LF
+0012 T 0000 CR,LF,"Dernier fichier non restaur‚.",CR,LF
+0013 T 0000 CR,LF,"*** Fichiers sauvegard‚s %1 *** ",CR,LF
+0014 T 0000 CR,LF,"Pas de fichier sauvegard‚ sur disque source.",CR,LF
+0015 T 0000 CR,LF,"M‚moire insuffisante.",CR,LF
+0016 T 0000 CR,LF,"Attention ! Le fichier %1",CR,LF
+ "est un fichier en lecture seulement.",CR,LF
+ "Remplacement du fichier ? (O/N)",CR,LF
+0017 T 0000 CR,LF,"Ordre de restauration des fichiers incorrect.",CR,LF
+0018 T 0000 CR,LF,"Erreur de cr‚ation de fichier.",CR,LF
+0019 T 0000 CR,LF,"Espace insuffisant sur disque.",CR,LF
+0020 T 0000 CR,LF,"*** Restauration fichier impossible ***",CR,LF
+0021 T 0000 CR,LF,"*** Restauration fichiers de l'unit‚ %1: en cours ***",CR,LF
+0022 T 0000 CR,LF,"Attention ! Le fichier %1",CR,LF
+ "a ‚t‚ modifi‚ depuis sa sauvegarde.",CR,LF
+ "Remplacement du fichier ? (O/N)",CR,LF
+0023 T 0000 "Disquette : %1",CR,LF
+0024 T 0000 CR,LF,"Erreur bizarre, appeler Russ Whitehead @ 8-3863.",CR,LF
+0025 T 0000 07 ;For BEEP !
+0026 T 0000 CR,LF,"Erreur lors de la restauration d'attributs ‚tendus.",CR,LF
+SELECT 9d92 0016
+0004 T 0000 "Support de lancement de SELECT incorrect.",CR,LF,CR,LF
+ "Placez la disquette d'installation dans l'unit‚ A: et recommencez."
+0005 T 0000 "Support disque/disquette non valide.",CR,LF,CR,LF
+ "Placez la disquette d'installation dans l'unit‚ A: et recommencez."
+0006 T 0000 "ParamŠtres non valides dans la ligne de commande SELECT.",CR,LF,CR,LF
+ "V‚rifiez que la disquette d'installation est dans l'unit‚ A:,",CR,LF
+ "puis faites Ctrl+Alt+Suppr pour red‚marrer."
+0007 T 0000 BELL,"Installation de DOS impossible. Programme termin‚.",CR,LF
+0008 T 0000 "Chargement de SELECT en cours... Veuillez patienter."
+0009 T 0000 "R‚initialisez le systŠme pour continuer.",CR,LF,CR,LF
+ "Faites Ctrl+Alt+Suppr pour continuer l'installation de DOS."
+0010 T 0000 "Placez la disquette SELECT dans l'unit‚ A:",CR,LF,CR,LF
+ "Appuyez sur ENTREE pour continuer l'installation de DOS,",CR,LF
+ "ou sur Echap pour abandonner.",CR,LF
+0011 T 0000 BELL
+0012 T 0000 "Placez la disquette SELECT dans l'unit‚ A:",CR,LF,CR,LF
+ "Appuyez sur ENTREE pour continuer.",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press ENTER to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE a567 0004
+0002 T 0000 "AFFICHAGE CHEMIN ET REPERTOIRE POUR VOLUME %1.",CR,LF ;define message ;AN000;
+0003 T 0000 "AFFICHAGE CHEMIN ET REPERTOIRE.",CR,LF
+0004 T 0000 "Pas de sous-r‚pertoire.",CR,LF,LF
+0007 T 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE a682 0009
+0003 T 0000 CR,LF,"Aucun fichier remplac‚.",CR,LF
+0004 T 0000 CR,LF,"Aucun fichier ajout‚.",CR,LF
+0013 T 0000 CR,LF,"Remplacement de %1 en cours...",CR,LF
+0014 T 0000 CR,LF,"Ajout de %1 en cours...",CR,LF
+0015 T 0000 CR,LF,"%1 fichier(s) remplac‚(s).",CR,LF
+0016 T 0000 CR,LF,"%d fichier(s) ajout‚(s).",CR,LF
+0017 T 0000 CR,LF,"Fichiers introuvables %1.",CR,LF
+0022 T 0000 CR,LF,"Remplacement %1 (O/N) ? ",CR,LF
+0023 T 0000 CR,LF,"Ajout de %s (O/N) ? ",CR,LF
+XCOPY a86a 0019
+0004 U 0000 "Le %1 donn‚ par l'utilisateur sp‚cifie-t-il",CR,LF
+ "un nom de fichier ou de r‚pertoire existant", CR,LF
+ "sur l'unit‚ cible (F = Fichier, R = R‚pertoire) ?"
+0005 T 0000 "Appuyez sur une touche pour lancer la copie.",CR,LF
+0006 T 0000 "Chemin trop long.",CR,LF
+0008 T 0000 "Ex‚cution de copie cyclique impossible.",CR,LF
+0012 T 0000 "XCOPY imposs. … partir p‚riph. r‚serv‚.",CR,LF
+0021 T 0000 "Nombre de paramŠtres incorrect.",CR,LF
+0022 T 0000 "XCOPY impossible sur p‚riph. r‚serv‚.",CR,LF
+0024 T 0000 "Erreur de cr‚ation de fichier.",CR,LF
+0025 T 0000 "Lecture fichier(s) source en cours...",CR,LF
+0026 T 0000 CR,LF
+0027 T 0000 "%1 fichier(s) copi‚(s).",CR,LF
+0028 T 0000 "%1 fichier introuvable.",CR,LF
+0029 T 0000 "F D " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0000 "%1%2",CR,LF
+0031 T 0000 "%1\%2",CR,LF
+0032 T 0000 "%1",CR,LF
+0033 T 0000 "%1%2 (O/N)?"
+0034 T 0000 "%1\%2 (O/N)?"
+0035 T 0000 "Commutation %1 non valide.",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK ac7a 0013
+0002 T 0000 "M‚moire insuffisante.",CR,LF
+0003 T 0000 "VDISK Version 3.40 disque virtuel %1.",CR,LF
+0004 T 0000 " Taille m‚moire tampon ajust‚e.",CR,LF
+0005 T 0000 " Taille secteur ajust‚e.",CR,LF
+0006 T 0000 " Entr‚es de r‚pertoires ajust‚es.",CR,LF
+0007 T 0000 " CaractŠre de commutation non valide.",CR,LF
+0008 T 0000 " Taille de transfert ajust‚e.",CR,LF
+0009 T 0000 " Taille m‚moire tampon : %1 KB.",CR,LF
+0010 T 0000 " Taille secteur : %1.",CR,LF
+0011 T 0000 " Entr‚es de r‚pertoire : %1.",CR,LF
+0012 T 0000 " Taille de transfert : %1.",CR,LF
+0013 T 0000 " VDISK pas install‚ - m‚moire insuffisante."
+0014 T 0000 " Le positionnement des",CR,LF
+ " commutateurs sur la carte d'extension ne",CR,LF
+ " correspond pas … la taille m‚moire.",CR,LF,CR,LF
+GRAFTABL afbe 0005
+0002 T 0000 "Page de codes active : %1.",CR,LF
+0003 T 0000 "Page de codes pr‚c‚dente : %1.",CR,LF
+0004 T 0000 "Aucun",NULL
+0005 T 0000 "Non-standard",NULL
+0006 T 0000 CR,LF,"Les paramŠtres reconnus par GRAFTABL sont ",COLON,CR,LF,LF
+ " /STA - Affichage du nom et du num‚ro de la",CR,LF," table graphique en cours.",CR,LF
+ " ? - Affichage des paramŠtres de GRAFTABL",CR,LF,CR,LF
+ " Pages de codes disponibles.",COLON,CR,LF
+ " 437 - Chargement de la table graphique US.",CR,LF
+ " 850 - Chargement de la table graphique multilingue.",CR,LF
+ " 860 - Chargement de la table graphique PORTUGAL.",CR,LF
+ " 863 - Chargement de la table graphique CANADA FR.",CR,LF
+ " 865 - Chargement de la table graphique PAYS NORDIQUES.",CR,LF
+FASTOPEN b2d7 0016
+0004 T 0000 CR,LF,"FASTOPEN install‚e.",CR,LF
+0005 T 0000 CR,LF,"La commande FASTOPEN est d‚j… d‚finie.",CR,LF
+0006 T 0000 CR,LF,"ParamŠtre incorrect.",CR,LF
+0007 T 0000 CR,LF,"Identifications d'unit‚ trop nombreuses.",CR,LF
+0008 T 0000 CR,LF,"Unit‚ d‚sign‚e plus d'une fois.",CR,LF
+0009 T 0000 CR,LF,"ParamŠtre non valide.",CR,LF
+0010 T 0000 CR,LF,"Type de commutateur incorrect.",CR,LF ;AN000;
+0011 T 0000 CR,LF,"Identification d'extension non valide.",CR,LF ;AN000;
+0012 T 0000 CR,LF,"Nombre incorrect d'identifications de fichier et r‚pertoire.",CR,LF
+0013 T 0000 CR,LF,"Configuration impossible de la m‚moire ‚tendue.",CR,LF ;AN000;
+0014 T 0000 CR,LF,"M‚moire ‚tendue non disponible.",CR,LF ;AN000;
+0015 T 0000 CR,LF,"D‚signation d'unit‚ non valide %1.",CR,LF
+0016 T 0000 CR,LF,"Espace insuffisant dans EMS. M‚moire basse utilis‚e.",CR,LF ;AN000;
+0017 T 0000 CR,LF,"Utilisation de FASTOPEN impossible sur unit‚ %1.",CR,LF
+0018 T 0000 CR,LF,"Trop de valeurs d'extension.",CR,LF
+0019 T 0000 CR,LF,"Trop d'identifications de fichier et de r‚pertoire.",CR,LF
+APPEND b740 0009
+0001 T 0000 "Mauvaise version d'APPEND.",CR,LF
+0002 T 0000 "Chemin non valide.",CR,LF
+0003 T 0000 "ParamŠtre non valide.",CR,LF
+0004 T 0000 "Combinaison de paramŠtres non valide.",CR,LF
+0005 T 0000 "Pas de commande APPEND en cours.",CR,LF
+0006 T 0000 "Conflit entre APPEND et ASSIGN.",CR,LF
+0007 T 0000 "Conflit entre APPEND et TopView.",CR,LF
+0008 T 0000 "Mauvaise version de DOS.",CR,LF
+0009 T 0000 "APPEND est d‚j… install‚e.",CR,LF
+GRAPHICS b911 0012
+0005 T 0000 "ParamŠtre non valide.",CR,LF
+0007 T 0000 "ParamŠtres en double non accept‚s.",CR,LF
+0009 T 0000 "Profil GRAPHICS introuvable.",CR,LF
+0010 T 0000 "Instruction de profil manquante avant ligne %1.",CR,LF
+0011 T 0000 "Instruction de profil non valide … la ligne %1.",CR,LF
+0012 T 0000 "Instruction de profil d‚class‚e … la ligne %1.",CR,LF
+0013 T 0000 "Erreur de lecture du profil GRAPHICS.",CR,LF
+0014 T 0000 "Erreurs de syntaxe dans le profil GRAPHICS.",CR,LF
+0015 T 0000 "L'ID de la boŒte d'impression ne figure pas dans le profil GRAPHICS.",CR,LF
+0016 T 0000 "Le type d'imprimante ne figure pas dans le profil GRAPHICS.",CR,LF
+0017 T 0000 "ParamŠtre /B non valide avec une imprimante noir et blanc.",CR,LF
+0018 T 0000 "Rechargement impossible avec le profil fourni.",CR,LF
+DISPLAY bc43 0003
+0002 T 0000 "%1 Le gestionnaire des pages de codes ne peut pas ˆtre initialis‚.",CR,LF
+0008 T 0000 "M‚moire insuffisante.",CR,LF
+0012 T 0000 "Syntaxe non valide dans la commande DISPLAY.SYS.",CR,LF
+PRINTER bd20 0002
+0002 T 0000 "%1 Le gestionnaire des pages de codes ne peut pas ˆtre initialis‚.",CR,LF
+0012 T 0000 "Syntaxe non valide dans commande PRINTER.SYS.",CR,LF
+KEYB bdcf 0016
+0002 T 0000 "Code clavier en cours : %1."
+0003 T 0000 "ID clavier en cours : %1."
+0004 T 0000 "Page de codes: %1.",CR,LF
+0005 T 0000 "Page de codes console en cours : %1.",CR,LF
+0006 T 0000 "Code clavier sp‚cifi‚ non valide.",CR,LF
+0007 T 0000 "ID clavier sp‚cifi‚ non valide.",CR,LF
+0008 T 0000 "Page de codes sp‚cifi‚e non valide.",CR,LF
+0009 T 0000 "Fichier de d‚finition clavier incorrect ou manquant.",CR,LF
+0010 T 0000 "La commande KEYB n'est pas d‚finie.",CR,LF
+0011 T 0000 "Page de codes active non disponible sur console.",CR,LF
+0012 T 0000 "La page de codes sp‚cifi‚e n'a pas ‚t‚ pr‚par‚e.",CR,LF
+0013 T 0000 "Au moins une page de codes console incompatible avec code clavier.",CR,LF
+0014 T 0000 "Page de codes demand‚e (%1) incompatible avec code clavier.",CR,LF
+0015 T 0000 "Page de codes sp‚cifi‚e incompatible avec page d‚j… s‚lect‚e.",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "KEYB ne peut pas cr‚er la table dans la m‚moire r‚sidente",CR,LF
+REDIRSYS c1f5 0000
+MEM c209 0036
+0010 T 0000 CR,LF
+0011 T 0000 " Adresse Nom Taille Type ",CR,LF
+0012 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0000 " ID Nom EMS Taille ",CR,LF
+0014 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0000 " %1 %2 %3 %4",CR,LF
+0016 T 0000 " %1 %2 %3 ",CR,LF
+0017 T 0000 " %1 %2 ",CR,LF
+0018 T 0000 "%1 octet(s) de m‚moire totale.",CR,LF
+0019 T 0000 "%1 octet(s) disponible(s).",CR,LF
+0020 T 0000 "%1 taille maximale pour programme ex‚cutable.",CR,LF
+0021 T 0000 "%1 octet(s) de m‚moire EMS totale.",CR,LF
+0022 T 0000 "%1 octet(s) disponible(s) de m‚moire EMS.",CR,LF
+0023 T 0000 "%1 octet(s) de m‚moire ‚tendue totale.",CR,LF
+0024 T 0000 "Vecteur d'interruption",0
+0025 T 0000 "Zone de communication ROM",0
+0026 T 0000 "Zone de communication DOS",0
+0027 T 0000 "IBMBIO",0
+0028 T 0000 "IBMDOS",0
+0029 T 0000 "Donn‚es SystŠme",0
+0030 T 0000 "Programme SystŠme",0
+0031 T 0000 "Pilote de p‚riph‚riques systŠme",0
+0032 T 0000 "Pilote de p‚riph‚riques install‚",0
+0033 T 0000 "%1:",0
+0034 T 0000 "%1: - %2:",0
+0035 T 0000 "BUFFERS=",0
+0036 T 0000 "FILES=",0
+0037 T 0000 "FCBS=",0
+0038 T 0000 "STACKS=",0
+0039 T 0000 "DEVICE=",0
+0040 T 0000 "IFS=",0
+0041 T 0000 "LASTDRIVE=",0
+0042 T 0000 "----------",0
+0043 T 0000 " ",0
+0044 T 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR c7ee 0040
+0004 T 0000 "R‚seau non amorc‚.",CR,LF
+0050 T 0000 "NET809: Demande de r‚seau non prise en charge.",CR,LF,0
+0051 T 0000 "NET801: PC … distance non disponible.",CR,LF,0
+0052 T 0000 "NET802: Nom dupliqu‚ sur le r‚seau.",CR,LF,0
+0053 T 0000 "NET803: Chemin de r‚seau introuvable.",CR,LF,0
+0054 T 0000 "NET804: R‚seau occup‚.",CR,LF,0
+0055 T 0000 "NET805: P‚riph‚rique de r‚seau n'existe plus.",CR,LF,0
+0056 T 0000 "NET806: Limite de commande NET BIOS d‚pass‚e.",CR,LF,0
+0057 T 0000 "NET807: Erreur systŠme ; erreur NETBIOS.",CR,LF,0
+0058 T 0000 "NET808: R‚ponse incorrecte venant du r‚seau.",CR,LF,0
+0059 T 0000 "NET810: Erreur r‚seau inattendue.",CR,LF,0
+0060 T 0000 "NET811: Carte … distance incompatible.",CR,LF,0
+0061 T 0000 "NET812: File d'attente d'impression satur‚e.",CR,LF,0
+0062 T 0000 "NET813: Espace insuffisant pour fichier d'impression.",CR,LF,0
+0063 T 0000 "NET814: Fichier d'impression annul‚.",CR,LF,0
+0064 T 0000 "NET815: Nom de r‚seau supprim‚.",CR,LF,0
+0065 T 0000 "AccŠs refus‚.",CR,LF,0
+0066 T 0000 "NET817: Type de p‚riph‚riques r‚seau incorrect.",CR,LF,0
+0067 T 0000 "NET818: Nom de r‚seau introuvable.",CR,LF,0
+0068 T 0000 "NET819: Limite du nom de r‚seau d‚pass‚e.",CR,LF,0
+0069 T 0000 "NET820: Limite de session NET BIOS d‚pass‚e.",CR,LF,0
+0070 T 0000 "NET821: Partage interrompu momentan‚ment.",CR,LF,0
+0071 T 0000 "NET823: Demande r‚seau refus‚e.",CR,LF,0
+0072 T 0000 "NET822: Redirection du disque ou impression interrompue.",CR,LF,0
+0073 T 0000 "NET476: Programme NETBEUI pas charg‚.",CR,LF,0
+0074 T 0000 "NET477: Erreur : d‚connexion logique de l'adaptateur.",CR,LF,0
+0075 T 0000 "NET826: Taille insuffisante du serveur cible /RQB.",CR,LF,0
+0076 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0077 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0078 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0079 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0080 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0081 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0082 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0083 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0084 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0085 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0086 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0087 T 0000 "NET???: Erreur r‚seau inattendue.",CR,LF,0
+0088 T 0000 "NET825: Erreur de donn‚es r‚seau.",CR,LF,0
+XMA2EMS d188 0017
+0001 T 0000 "XMA2EMS: Gestionaire de m‚moire ‚tendue Version 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 Tous droits r‚serv‚s.",CR,LF,"$"
+0002 T 0000 CR,LF,"XMA001 ex‚cutant les diagnostics VMO/XMA : ","$"
+0003 T 0000 "XMA002 Diagnostics termin‚s.",CR,LF,LF,"$"
+0004 T 0000 "XMA003 Cadre de page d‚bute …..................... "
+0005 T 0000 "XXXX",":0",CR,LF,"$"
+0006 T 0000 "XMA004 Pages mapp‚es … la m‚moire conventionnelle..... "
+0007 T 0000 "0 ",CR,LF,"$"
+0008 T 0000 "XMA005 Pages r‚serv‚es au programme de contr“le....... "
+0009 T 0000 "0 ",CR,LF,"$"
+0010 T 0000 "XMA006 Pages disponibles pour m‚moire ‚tendue......... "
+0011 T 0000 "0 ",CR,LF,"$"
+0012 T 0000 CR,LF,"XMA100 Erreur carte :",CR,LF," Le gestionnaire de m‚moire ‚tendue N'est PAS install‚.",CR,LF,"$"
+0013 T 0000 CR,LF,"XMA200 Carte introuvable:",CR,LF," Le gestionnaire de m‚moire ‚tendue N'est PAS install‚.",CR,LF,"$"
+0014 T 0000 CR,LF,"XMA300 Erreur de paramŠtre ou de syntaxe de paramŠtre :",CR,LF
+ " Le gestionnaire de m‚moire ‚tendue N'est PAS install‚.",CR,LF,"$"
+0015 T 0000 SIZE1_END - 2 -$
+0016 T 0000 4 DUP (?)," KB OK",CR,LF,"$"
+0017 T 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FILESYS d68a 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+FDISK d7cc 0120
+0004 T 0000 "FDISK impossible avec r‚seau install‚.",CR,LF
+0005 T 0000 "Pas de disque dur.",CR,LF
+0006 T 0000 "Erreur de lecture sur le disque dur.",CR,LF
+0007 T 0000 "Erreur d'‚criture sur le disque dur.",CR,LF
+1001 T 0000 "Ordinateur Personnel IBM"
+1002 T 0000 "Programme d'installation du disque dur Version 3.40"
+1003 T 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "Options FDISK"
+1005 T 0000 "1. <R>Cr‚ation d'une partition DOS ou d'une unit‚ logique"
+1006 T 0000 "2. <R>Changement de partition active"
+1007 T 0000 "3. <R>Suppression d'une partition DOS ou d'une unit‚ logique"
+1008 T 0000 "4. <R>Affichage des donn‚es partitions"
+1009 T 0000 "Appuyez sur <H>Echap<R> pour revenir … DOS."
+1010 T 0000 "Entrez votre choix :"
+1011 T 0000 "5. <R>S‚lection d'une autre unit‚ de disque dur"
+1012 T 0000 "Unit‚ de disque dur en cours : <H><I>"
+1013 T 0000 "Attention ! <R>Aucune partition active - disque 1 non-amor‡able "
+1014 T 0000 "tant qu'aucune partition n'est rendue active."
+1015 T 0000 "Entrez votre choix : [<S> ]"
+1016 T 0000 "Cr‚ation d'une partition DOS ou d'une unit‚ logique"
+1017 T 0000 "1. <R>Cr‚ation d'une partition DOS principale"
+1018 T 0000 "2. <R>Cr‚ation d'une partition DOS ‚tendue"
+1019 T 0000 "3. <R>Cr‚ation d'unit‚(s) logique(s) dans la partition DOS ‚tendue"
+1020 T 0000 "Faites <H>Echap<R> pour revenir aux options FDISK."
+1021 T 0000 "Cr‚ation d'une partition DOS principale"
+1022 T 0000 "Voulez-vous utiliser l'espace maximal que peut avoir une partition DOS"
+1023 T 0000 " (<O>/<N>)...........? <H>[<S> ]"
+1024 T 0000 "(<O>/<N>)...................................................? <H>[<S> ]"
+1025 T 0000 "Etat partition Type Taille en Mo % espace disque utilis‚"
+1026 T 0000 "Espace disque total : <HIIIIR> Mo (1 Mo = 1 048 576 octets)."
+1027 T 0000 "Espace maximal pour partition : <HIIIIR> Mo (<HIIIIR>)."
+1028 T 0000 "Entrez la taille de la partition en Mo ou en % espace disque "
+1029 T 0000 "pour cr‚er une partition DOS principale........................: <H>[<IIISI>]"
+1030 T 0000 "Cr‚ation d'une partition DOS ‚tendue."
+1031 T 0000 "Cr‚ation d'une partition DOS ‚tendue.........................: <H>[<IIISI>]"
+1032 T 0000 "Appuyez sur <H>Echap<R> pour continuer."
+1033 T 0000 "Cr‚ation d'unit‚(s) logique(s) DOS dans la partition DOS ‚tendue."
+1034 T 0000 "Unit‚ Label de vol. M‚ga-octets SystŠme Utilisation"
+1035 T 0000 "Taille de la partition DOS ‚tendue : <HIIIIR> Mo (1 Mo = 1048576 octets)."
+1036 T 0000 "Espace maximal pour une unit‚ logique : <HIIIIR> Mo <H>(<IIII>)."
+1037 T 0000 "Entrez la taille de l'unit‚ logique en Mo ou en % espace disque (%)...<H>[<IIISI>]"
+1038 T 0000 "Partition … rendre active"
+1039 T 0000 "Entrez le num‚ro de la partition que vous voulez rendre active....: <H>[<S> ]"
+1040 T 0000 "Suppression de la partition DOS ou de l'unit‚ logique"
+1041 T 0000 "1. <R>Suppression de la partition DOS principale"
+1042 T 0000 "2. <R>Suppression de la partition DOS ‚tendue"
+1043 T 0000 "3. <R>Suppression unit‚(s) logique(s) de la partition DOS ‚tendue"
+1044 T 0000 "Suppression de la partition DOS principale"
+1045 T 0000 "Attention ! <OR>Les donn‚es de la partition principale seront perdues."
+1046 T 0000 " Voulez-vous continuer ? (<O>/<N>)................. <H>[<S> ]"
+1047 T 0000 "Suppression de la partition DOS ‚tendue"
+1048 T 0000 "Attention ! <OR>Les donn‚es de la partition DOS ‚tendue seront perdues."
+1049 T 0000 " Voulez-vous continuer ? (<O>/<N>)................. <H>[<S> ]"
+1050 T 0000 "Suppression unit‚(s) logique(s) de la partition DOS ‚tendue"
+1051 T 0000 "Attention ! <OR>Les donn‚es de l'unit‚ logique DOS supprim‚e seront perdues."
+1052 T 0000 "Quelle unit‚ supprimer ..................................? <H>[<S> ]"
+1053 T 0000 "Etes-vous s–r ? (<O>/<N>).............................. <H>[<S> ]"
+1054 T 0000 "Entrez le label du volume .....................? <H>[<S> ]"
+1055 T 0000 "Affichage des donn‚es partitions"
+1056 T 0000 "La partition DOS ‚tendue contient des unit‚s logiques."
+1057 T 0000 "Affichage des donn‚es des unit‚s logiques ? (<O>/<N>)........<H>[<S> ]"
+1058 T 0000 "Affichage des donn‚es unit‚(s) logique(s)"
+1059 T 0000 "Le systŠme va red‚marrer."
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0000 "Appuyez ensuite sur une touche . . .<S>."
+1062 T 0000 "Partition DOS principale supprim‚e."
+1063 T 0000 "Partition DOS ‚tendue supprim‚e."
+1064 T 0000 "Unit‚ supprim‚e."
+1065 T 0000 "Partition <I> rendue active."
+1066 T 0000 "Partition DOS principale cr‚‚e."
+1067 T 0000 "Partition DOS ‚tendue cr‚‚e."
+1068 T 0000 "Unit‚ logique DOS cr‚‚e, identifications d'unit‚ modifi‚es ou ajout‚es.<W>"
+1069 T 0000 "Aucune partition d‚finie."
+1070 T 0000 "Aucune unit‚ logique d‚finie."
+1071 T 0000 "Identifications d'unit‚ modifi‚es ou supprim‚es.<W>"
+1072 T 0000 "Unit‚ redirig‚e."
+1073 T 0000 "Partition DOS principale cr‚‚e, identifications d'unit‚s modifi‚es ou ajout‚es."
+1074 T 0000 "Pas de disque dur."
+1075 T 0000 "Erreur de lecture sur le disque dur."
+1076 T 0000 "Erreur d'‚criture sur le disque dur."
+1077 T 0000 "Mauvaise version de DOS."
+1078 T 0000 "FDISK impossible avec r‚seau install‚."
+1079 T 0000 "Pas de partition DOS principale … supprimer."
+1080 T 0000 "Pas de partition DOS ‚tendue … supprimer."
+1081 T 0000 "La partition DOS principale existe d‚j…."
+1082 T 0000 "La partition DOS ‚tendue existe d‚j…."
+1083 T 0000 "Espace insuffisant pour cr‚er une partition DOS."
+1084 T 0000 "Espace insuffisant pour une unit‚ logique<W>"
+1085 T 0000 "Espace insuffisant pour une partition<W>"
+1086 T 0000 "Pas de partition DOS … supprimer."
+1087 T 0000 "La seule partition amor‡able de l'unit‚ 1 est d‚j… active<W>"
+1088 T 0000 "Pas de partition … rendre active."
+1089 T 0000 "Partition choisie (<I>) non amor‡able, partition active inchang‚e<W>"
+1090 T 0000 "Cr‚ation de la partition DOS ‚tendue impossible sans partition DOS "
+1091 T 0000 "principale sur le disque 1<W>"
+1092 T 0000 "Tout l'espace de la partition DOS"
+1093 T 0000 " ‚tendue est allou‚ … des unit‚s logiques<W>"
+1094 T 0000 "Aucune partition DOS ‚tendue ne peut ˆtre supprim‚e tant qu'il existe des unit‚s logiques.<W>"
+1095 T 0000 "Toutes les unit‚s logiques sont supprim‚es de la partition DOS ‚tendue.<W>."
+1096 T 0000 " n'est pas valide. Veuillez entrer <III>.<W>"
+1097 T 0000 "Attention ! La partition active n'est pas amor‡able<W>"
+1098 T 0000 "Il n'existe que des partitions actives."
+1099 T 0000 "Seules les partitions de l'unit‚ 1 peuvent ˆtre rendues actives<W>"
+1100 T 0000 "Nombre maximal d'unit‚s logiques DOS install‚.<W>"
+1101 T 0000 "Cr‚ation d'une partition de taille z‚ro impossible."
+1102 T 0000 "Unit‚ <II> d‚j… supprim‚e."
+1103 T 0000 "AccŠs impossible … l'unit‚ <I>.<OW>"
+1104 T 0000 "Entr‚e incorrecte. Veuillez frapper <III.><W>"
+1105 T 0000 "DOS ne peut pas supprimer la partition principale de l'unit‚ 1 tant qu'il"
+1106 T 0000 " existe une partition ‚tendue.<W>"
+1107 T 0000 "Entr‚e incorrecte. Appuyez sur Entr‚e.<W>"
+1108 T 0000 "Erreur de label de volume.<W>"
+1109 T 0000 "Cr‚ation d'une unit‚ logique DOS impossible sans "
+1110 T 0000 "partition DOS ‚tendue sur l'unit‚ en cours.<W>"
+1111 T 0000 "Aucune unit‚ logique DOS … supprimer."
+1112 T 0000 "Erreur dans chaŒne de messages <I>. Reportez-vous … l'en-tˆte du fichier FDISKC.MSG."
+1113 T 0000 "Erreur interne."
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/germany.msg b/private/mvdm/dos/v86/messages/germany.msg
new file mode 100644
index 000000000..63012d41b
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/germany.msg
@@ -0,0 +1,1171 @@
+0008
+COMMON 0006 0038
+0001 T 0000 "Falsche DOS-Version",CR,LF
+0002 T 0000 "%1 bereits installiert",CR,LF
+0003 T 0000 "%1 Byte auf Diskette/Platte",CR,LF
+0004 T 0000 "%1 Byte frei",CR,LF
+0005 T 0000 "%1 Byte in fehlerhaften Sektoren",CR,LF
+0006 T 0000 "%1 Byte Gesamtspeicherbereich",CR,LF
+0007 T 0001 "%1 Byte Gesamtspeicher",CR,LF
+0008 T 0000 "%1 Byte vom System verwendet",CR,LF
+0009 T 0000 "%1 installiert",CR,LF
+0010 T 0000 "%1 nicht installiert",CR,LF
+0011 T 0000 "%1 nicht installiert",CR,LF
+0012 T 0001 "%1 fr Netzwerklaufwerk nicht m”glich",CR,LF
+0013 T 0000 "",
+0014 T 0001 "%1 fr ein mit SUBST/ASSIGN zugeordnetes Laufwerk nicht m”glich",CR,LF
+0015 T 0000 "kann nicht ausgefhrt %1",CR,LF
+0016 T 0001 "Hauptspeichererweiterung nicht verfgbar",CR,LF
+0017 T 0000 "Dateizuordnungstabelle fehlerhaft %1",CR,LF
+0018 T 0000 "Datei kann nicht in sich selbst kopiert",CR,LF
+0019 T 0001 "Zieldiskette in Laufwerk %1 einlegen",CR,LF
+0020 T 0000 "Nicht genug Platz auf Diskette/Platte",CR,LF
+0021 T 0000 "Name enth„lt ungltige Zeichen",CR,LF
+0022 T 0000 "Ungltige Zeichensatztabelle angegeben",CR,LF
+0023 T 0000 "Ungltige Datumsangabe",CR,LF
+0024 T 0000 "Ungltige Zeitangabe",CR,LF
+0025 T 0000 "Ungltiger Pfad",CR,LF
+0026 T 0000 "Kein Quellenlaufwerk angegeben",CR,LF
+0027 T 0000 "Kein Ziellaufwerk angegeben",CR,LF
+0028 T 0001 "Weiter mit beliebiger Taste . . .",CR,LF
+0029 T 0000 "Quellenpfad erforderlich",CR,LF
+0030 T 0000 "Systemdateien bertragen",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Ungltiger Pfad, kein Verzeichnis",CR,LF
+0033 T 0000 "Diskette/Platte, Laufwerk %1 Ungltiges Verzeichnis",CR,LF
+0034 T 0001 "Datentr„ger in Laufwerk %1 ist %2",CR,LF
+0035 T 0000 "Name (max. 11 Zeichen) oder Eingabetaste "
+0036 T 0001 "Datentr„gernummer: %1-%2",CR,LF
+0037 T 0001 "Falscher Dateityp",CR,LF
+0038 T 0001 CR,LF
+EXTEND 0746 0089
+0001 T 0001 "Ungltige Funktion",CR,LF
+0002 T 0000 "Datei nicht gefunden",CR,LF
+0003 T 0000 "Pfad nicht gefunden",CR,LF
+0004 T 0000 "Zu viele Dateien er”ffnet",CR,LF
+0005 T 0000 "Zugriff verweigert ",CR,LF
+0006 T 0001 "Ungltige Dateikennzeichnung",CR,LF
+0007 T 0001 "Speichersteuerbl”cke zerst”rt",CR,LF
+0008 T 0000 "Nicht gengend Speicherplatz",CR,LF
+0009 T 0001 "Ungltige Speicherblockadresse",CR,LF
+0010 T 0001 "Ungltige Umgebung",CR,LF
+0011 T 0001 "Ungltiges Format",CR,LF
+0012 T 0001 "Ungltiger Funktionsparameter",CR,LF
+0013 T 0001 "Ungltige Daten",CR,LF
+0014 T 0000 "",
+0015 T 0000 "Ungltige Laufwerksangabe",CR,LF
+0016 T 0001 "Versuch, aktuelles Verzeichnis zu entfernen",CR,LF
+0017 T 0001 "Nicht dieselbe Einheit",CR,LF
+0018 T 0001 "Keine weiteren Dateien",CR,LF
+0019 T 0001 "Schreibschutzfehler",CR,LF
+0020 T 0001 "Ungltige Einheit",CR,LF
+0021 T 0000 "Nicht bereit.",CR,LF
+0022 T 0001 "Ungltige Einheitenanforderung",CR,LF
+0023 T 0001 "Datenfehler",CR,LF
+0024 T 0001 "Ungltige Einheitenanforderungsparameter",CR,LF
+0025 T 0001 "Fehler beim Positionieren",CR,LF
+0026 T 0001 "Ungltiger Datentr„gertyp",CR,LF
+0027 T 0000 "Sektor nicht gefunden. ",CR,LF
+0028 T 0001 "Drucker ohne Papier",CR,LF
+0029 T 0001 "Fehler beim Schreiben",CR,LF
+0030 T 0001 "Fehler beim Lesen",CR,LF
+0031 T 0000 "Allgemeine Fehlerbedingung",CR,LF
+0032 T 0000 "Ungltige SHARE-Operation",CR,LF
+0033 T 0000 "Ungltige LOCK-Operation",CR,LF
+0034 T 0000 "Ungltiger Diskettenwechsel",CR,LF
+0035 T 0000 "Dateisteuerblock (FCB) nicht verfgbar",CR,LF
+0036 T 0001 "Systembetriebsmittel ersch”pft",CR,LF
+0037 T 0001 "Keine šbereinstimmung bei Zeichensatztabelle",CR,LF
+0038 T 0001 "Keine Eingabedaten",CR,LF
+0039 T 0000 "Nicht genug Platz auf Diskette/Platte",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 T 0001 "Anforderung von Dateisystem nicht untersttzt",CR,LF
+0051 T 0001 "Zuordnung zu Dateisystem nicht m”glich",CR,LF
+0052 T 0001 "Dateisystemname bereits vorhanden",CR,LF
+0053 T 0001 "Dateisystemname nicht gefunden",CR,LF
+0054 T 0001 "Dateisystem aktiv",CR,LF
+0055 T 0001 "Dateisystemeinheit nicht mehr vorhanden",CR,LF
+0056 T 0001 "Dateisystembetriebsmittel ersch”pft",CR,LF
+0057 T 0001 "Einheitenfehler im Dateisystem aufgetreten",CR,LF
+0058 T 0001 "Dateisystem gab falsche Antwort aus",CR,LF
+0059 T 0001 "Unerwarteter Fehler im Dateisystem aufgetreten",CR,LF
+0060 T 0001 "Dateisystem nicht kompatibel",CR,LF
+0061 T 0001 "Begrenzung fr Einheitenausgabedateien berschritten",CR,LF
+0062 T 0001 "Speicherbereich fr Einheitenausgabedateien berschritten",CR,LF
+0063 T 0001 "Einheitenausgabedatei nicht mehr vorhanden",CR,LF
+0064 T 0001 "Dateisystemname nicht mehr vorhanden",CR,LF
+0065 T 0001 "Zugriff vom Dateisystem abgelehnt",CR,LF
+0066 T 0001 "Falscher Einheitentyp des Dateisystems",CR,LF
+0067 T 0001 "Dateisystem nicht gefunden",CR,LF
+0068 T 0001 "Dateisystembetriebsmittel ersch”pft",CR,LF
+0069 T 0001 "Dateisystembetriebsmittel ersch”pft",CR,LF
+0070 T 0001 "Dateisystemeinheit vorbergehend nicht verfgbar",CR,LF
+0071 T 0001 "Anforderung des Dateisystems nicht akzeptiert",CR,LF
+0072 T 0001 "Dateisystemeinheit vorbergehend nicht aktiv",CR,LF
+0073 T 0001 "Dateisystemkomponente nicht verfgbar",CR,LF
+0074 T 0001 "Unerwarteter Fehler im Dateisystem aufgetreten",CR,LF
+0075 T 0001 "Unerwarteter Fehler im Dateisystem aufgetreten",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0001 "Datei bereits vorhanden",CR,LF
+0081 T 0000 "",
+0082 T 0001 "Verzeichniseintrag kann nicht erstellt werden",CR,LF
+0083 T 0001 "Bei schwerem Fehler U(ebergehen) angefordert",CR,LF
+0084 T 0001 "Zu viele Zuordnungen",CR,LF
+0085 T 0001 "Einheit oder Datei bereits zugeordnet",CR,LF
+0086 T 0001 "Ungltiges Kennwort",CR,LF
+0087 T 0000 "Ungltiger Parameter",CR,LF
+0088 T 0001 "Datenfehler im Dateisystem",CR,LF
+0089 T 0001 "Funktion von Dateisystem nicht untersttzt",CR,LF
+PARSE 175c 0011
+0001 T 0001 "Zu viele Parameter",CR,LF
+0002 T 0001 "Erforderlicher Parameter fehlt",CR,LF
+0003 T 0001 "Ungltiger Parameter",CR,LF
+0004 T 0001 "Ungltiges Schlsselwort",CR,LF
+0005 T 0000 "",
+0006 T 0001 "Parameterwert auáerhalb des erlaubten Bereichs",CR,LF
+0007 T 0001 "Parameterwert nicht zul„ssig",CR,LF
+0008 T 0001 "Parameterwert nicht zul„ssig",CR,LF
+0009 T 0001 "Falsches Parameterformat",CR,LF
+0010 T 0000 "Ungltiger Parameter",CR,LF
+0011 T 0001 "Ungltige Parameterkombination",CR,LF
+IBMBIO 1969 0018
+0003 T 0001 13,10,"CONFIG.SYS enth„lt unbekannten Befehl"
+0004 T 0001 13,10,"$"
+0005 T 0001 13,10,"Sektor zu groá in Datei $"
+0006 T 0001 13,10,"Falsch oder fehlend $"
+0007 T 0001 "Befehlsprozessor",0
+0008 T 0001 13,10,"Landescode oder Zeichensatztabelle ungltig",13,10,"$"
+0009 T 0001 13,10,"Fehler im Befehl COUNTRY",13,10,"$"
+0010 T 0001 13,10, "Zu wenig Speicherplatz fr Datei COUNTRY.SYS",13,10,"$"
+0011 T 0001 13,10,"Zu wenig Speicherplatz fr Konfiguration",13,10,"$"
+0012 T 0001 13,10,"Zu viele Blockeinheiten",13,10,"$"
+0013 T 0001 13,10,"Ungltige(r) STACK-Parameter",13,10,"$"
+0014 T 0001 13,10,"Falsche Befehlsreihenfolge in Datei CONFIG.SYS in Zeile ","$"
+0015 T 0001 "Fehler in Datei CONFIG.SYS in Zeile ","$"
+0016 T 0000 13,10,"Speicherzuordnungsfehler$"
+0017 T 0001 0DH,0AH,7,0DH,0AH, "šberlauf des internen Stapelspeichers",0DH,0AH
+ "System gestoppt",0DH,0AH,"$"
+0020 T 0000 13,10,"Diskette in Laufwerk "
+0021 T 0000 "A: einlegen,",13,10,"anschlieáend eine Taste bet„tigen",13,10,10,0
+0022 T 0001 13,10,"Falscher Befehl oder Parameter - $"
+BOOT 1db3 0001
+0001 T 0000 13,10,"Diskette: Kein System oder fehlerhaft",13,10
+ "Austauschen und eine Taste bet„tigen",13,10
+DBCSDOS 1e37 0000
+IBMDOS 1e4b 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1e8a 0091
+0201 T 0000 "A"
+0202 T 0000 "W"
+0203 T 0000 "I"
+0204 T 0000 "U"
+0205 T 0000 "J"
+0206 T 0000 "N"
+0210 T 0000 "A(bbruch)"
+0211 T 0000 ", W(iederholen)"
+0212 T 0000 ", I(gnorieren)"
+0213 T 0000 ", U(ebergehen)"
+0214 T 0000 "?"
+0215 T 0000 "Lesefehler",0
+0216 T 0000 "Schreibfehler",0
+0217 T 0000 "%1 Laufwerk %2",CR,LF
+0218 T 0000 "%1 Einheit %2",CR,LF
+0219 T 0001 "Datentr„ger %1 mit der Nummer %2-%3 einlegen",CR,LF
+0221 T 0000 "Falsche COMMAND.COM-Version",CR,LF
+0222 T 0000 "Diskette mit %1 in Laufwerk %2",CR,LF
+0224 T 0000 CR,LF,"Stapeljob beenden (J/N)?"
+0225 T 0000 "kann nicht ausgefhrt %1",CR,LF
+0226 T 0000 "Fehler in .EXE-Datei",CR,LF
+0227 T 0000 "Programm paát nicht in den Speicher",CR,LF
+0228 T 0000 CR,LF,"Keine freien Dateinummern vorhanden"
+0229 T 0000 "Falscher Befehl oder Dateiname",CR,LF
+0231 T 0000 CR,LF,"Speicherzuordnungsfehler"
+0232 T 0000 CR,LF,"COMMAND.COM kann nicht geladen",CR,LF
+0233 T 0000 CR,LF,"COMMAND.COM kann nicht gestartet",CR,LF
+0234 T 0000 CR,LF,"Verarbeitung der obersten Programmebene",CR,LF
+0235 T 0000 CR,LF
+0463 T 0000 "Kein Platz mehr im Umgebungsbereich",CR,LF
+0464 T 0000 CR,LF,CR,LF,"The IBM Personal Computer DOS",CR,LF
+ "Version 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF
+0465 T 0000 "Angeg. COMMAND-Verzeichnis fehlerhaft",CR,LF
+0466 T 0000 "Angeg. COMMAND-Verzeichnis fehlerhaft,",CR,LF
+1002 T 0000 "Doppelter Dateiname oder",CR,LF,"Datei nicht gefunden",CR,LF
+1003 T 0000 "Ungltige Anzahl Parameter",CR,LF
+1007 T 0000 "Kein Platz mehr im Umgebungsbereich",CR,LF
+1008 T 0000 "Fehler beim Erstellen der Datei",CR,LF
+1009 T 0000 "Stapeldatei fehlt",CR,LF
+1010 T 0000 CR,LF,"Diskette mit der Stapeldatei einlegen",CR,LF
+1011 T 0000 "Falscher Befehl oder Dateiname",CR,LF
+1016 T 0000 "Inhalt der Zieldatei vor dem Kopieren",CR,LF,"verloren gegangen",CR,LF
+1017 T 0000 "Ungltiger Dateiname oder Datei nicht",CR,LF,"gefunden",CR,LF
+1018 T 0000 "%9d Datei(en) kopiert",CR,LF
+1019 T 0000 "%9d Datei(en) "
+1022 T 0000 "Zeichensatztabelle %5d fr System nicht vorbereitet",CR,LF
+1023 T 0000 "Zeichensatztabelle %5d nicht fr alle Einheiten vorbereitet",CR,LF
+1024 T 0000 "Aktive Zeichensatztabelle: %5d",CR,LF
+1025 T 0001 "NLSFUNC nicht installiert",CR,LF
+1027 T 0000 "Aktuelles Laufwerk nicht mehr gltig"
+1029 T 0000 "Name nicht gefunden",CR,LF
+1030 T 0000 "Syntaxfehler",CR,LF
+1032 T 0000 "Systemdatum: %1 %2",CR,LF
+1033 T 0000 "So.Mo.Di.Mi.Do.Fr.Sa."
+1034 T 0000 "Neues Datum (%1): "
+1036 T 0000 "Systemzeit: %1",CR,LF
+1037 T 0000 "Neue Zeit (hh.mm.ss) eingeben: "
+1038 T 0001 ", L”schen (J/N)?"
+1039 T 0001 "Alle Dateien im Verzeichnis werden gel”scht!",CR,LF
+ "Sind Sie sicher (J/N)?"
+1040 T 0000 "IBM Personal Computer DOS-Version %1d.%02d",CR,LF
+1044 T 0000 "Ungltiges Verzeichnis",CR,LF
+1046 T 0000 "Ungltiger Pfad, kein Verzeichnis,",CR,LF,"oder Verzeichnis nicht leer",CR,LF
+1047 T 0000 "ON oder OFF angeben",CR,LF
+1048 T 0000 "Verzeichnis von %S",CR,LF
+1049 T 0000 "Kein Pfad",CR,LF
+1050 T 0000 "Ungltige Laufwerksangabe im Suchpfad",CR,LF
+1051 T 0000 "Ungltige Einheit",CR,LF
+1052 T 0000 "FOR kann nicht verschachtelt werden",CR,LF
+1053 T 0000 "Dateifehler w„hrend Dateibergabe (PIPE)",CR,LF
+1054 T 0000 "Bin„res Lesen von Einheit nicht m”glich ",CR,LF
+1055 T 0000 "BREAK ist %1 ",CR,LF
+1056 T 0000 "VERIFY ist %1",CR,LF
+1057 T 0000 "ECHO ist %1 ",CR,LF
+1059 T 0001 "ausgeschaltet (off)",0
+1060 T 0001 "eingeschaltet (on)",0
+1061 T 0000 "Fehler beim Schreiben auf Einheit",CR,LF
+1063 T 0000 "%1"
+1064 T 0000 "%1"
+1065 T 0000 "%1"
+1066 T 0000 "%1"
+1067 T 0000 9
+1068 T 0000 " <DIR> "
+1069 T 0000 8," ",8
+1070 T 0000 CR,LF
+1071 T 0000 "%1"
+1072 T 0000 "(mm-tt-jj): "
+1073 T 0000 "(tt.mm.jj) eingeben: "
+1074 T 0000 "(jj-mm-tt): "
+1075 T 0000 "%1 %2"
+1076 T 0000 "%1"
+1077 T 0000 " %1 %2"
+1078 T 0001 "Verzeichnis ist bereits vorhanden",CR,LF
+ATTRIB 2e41 0016
+0004 T 0000 "Ungltige Anzahl Parameter",CR,LF
+0005 T 0000 "Ungltiger Pfad oder Datei nicht gefunden",CR,LF
+0006 T 0000 "Syntaxfehler",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 T 0001 "%1, Keine šbereinstimmung bei Zeichensatztabelle",CR,LF,"Sind Sie sicher (J/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 T 0001 "Ungltiger Dateityp",CR,LF
+0199 T 0001 "Fehler bei erweitertem Attribut",CR,LF
+0201 T 0001 "Name des erweiterten Attributs nicht gefunden",CR,LF
+0204 T 0001 "Name des erweiterten Attributs kann nicht definiert werden",CR,LF
+0205 T 0001 "Name des erweiterten Attributs bekannt, aber nicht untersttzt",CR,LF
+0206 T 0001 "Keine šbereinstimmung bei Typ des erweiterten Attributs",CR,LF
+0208 T 0001 "Wert des erweiterten Attributs nicht untersttzt",CR,LF
+ASSIGN 319d 0001
+0002 T 0001 "Von ursprnglich %1: auf %2: gesetzt",cr,lf
+CHKDSK 31eb 0063
+0003 T 0000 "Verlorene Ketten in Dateien (J/N)?"
+0004 T 0000 " Nicht behebbarer Fehler im Verzeichnis"
+0005 T 0000 "Verzeichnis in Datei umwandeln (J/N)?"
+0007 T 0000 "%l10d Byte Gesamtspeicherbereich "
+0008 T 0000 "%l10d Byte in fehlerhaften Sektoren"
+0009 T 0001 "%1 Byte in %2 geschtzten Dateien"
+0010 T 0001 "%1 Byte in %2 Verzeichnissen"
+0011 T 0001 "%1 Byte in %2 Benutzerdateien"
+0012 T 0001 "%1 Byte in %2 wiederhergestellten Dateien"
+0013 T 0001 "%1 Byte w„ren in %2 wiederhergestellten Dateien"
+0014 T 0000 "%l10d Byte auf Diskette/Platte "
+0015 T 0001 "%1 Byte Gesamtspeicher"
+0016 T 0000 "%9ld Byte frei"
+0017 T 0000 "CHKDSK fr Netzwerklaufwerk nicht "
+0018 T 0000 "CHKDSK auf diesem Laufwerk nicht "
+0019 T 0001 "Vermutlich keine DOS-Diskette/Festplatte",CR,LF,"Weiter (J/N)?"
+0020 T 0001 "Fehler bei Lesen von Dateizuordnungstabelle %1",CR,LF
+0021 T 0000 "Verzeichnis %s"
+0022 T 0000 " Enth„lt %d nicht zusammenh„ngende Bl”cke"
+0023 T 0000 "Alle angegebenen Dateien"
+0024 T 0000 "Fehler gefunden. Da Parameter F nicht ",CR,LF,"angegeben wurde, werden die Korrekturen"
+0025 T 0000 "Verarbeitung kann nicht fortgesetzt %s%s"
+0026 T 0000 "Dateizuordnungstabelle fehlerhaft, %1"
+0029 T 0000 " CHDIR .. fehlerhaft, alternative"
+0030 T 0000 " Falscher Bereich,"
+0031 T 0000 " Ungltiger Unterverzeichniseintrag"
+0032 T 0000 " Existiert nicht"
+0033 T 0001 " Erste Cluster-Nummer ungltig, Eintrag gekrzt"
+0034 T 0000 " Zuordnungsfehler, GrӇe berichtigt"
+0035 T 0000 " Eintrag `.' nicht wiederherstellbar,"
+0036 T 0000 " Directory is totally empty, no . or ..,"
+0037 T 0000 " Verzeichnis angeh„ngt,"
+0038 T 0000 " Eintrag `..' nicht wiederherstellbar,"
+0039 T 0000 " Eintrag hat ungltige Verknpfung"
+0040 T 0000 " Eintrag hat ungltige s Attribut"
+0041 T 0000 " Eintrag hat ungltige GrӇe"
+0042 T 0000 " Verknpft mit Bereichsangabe %d"
+0043 T 0000 " Verzeichniswechsel nicht m”glich zu %s",CR,LF,"Verzeichnispfad(e) ab diesem Punkt "
+0044 T 0000 " Verzeichnispfad(e) ab diesem Punkt "
+0045 T 0000 "%1 Byte Speicher freigegeben."
+0046 T 0000 "%1 Byte Speicher wrden freigegeben."
+0047 T 0000 "Diskette/Platte %s ",CR,LF
+0048 T 0001 "%1 Zuordnungseinheiten auf Diskette/Festplatte"
+0049 T 0001 "%1 Byte in jeder Zuordnungseinheit"
+0050 T 0001 "CHKDSK auf Laufwerk %1 nicht vorhanden"
+0051 T 0001 " Ungltige Cluster bei erweiterten Attributen, Attribute gekrzt"
+0052 T 0001 " Zuordnungsfehler bei erweiterten Attributen, Attribute gekrzt"
+0053 T 0001 "Ungltiger Parameter"
+0055 T 0001 "Pfad nicht gefunden"
+0056 T 0001 "Datei nicht gefunden"
+0058 T 0001 " %1 verlorene Cluster in %2 Ketten gefunden."
+0059 T 0000 CR,LF
+0060 T 0001 " Mit CHDIR kann nicht ins Stammverzeichnis gewechselt werden",CR,LF
+0061 T 0001 " Fehler bei Schreiben von Dateizuordnungstabelle %1"
+0062 T 0000 " %1"
+0063 T 0001 "Aktuelles Verzeichnis ungltig"
+0064 T 0000 "%1",CR,LF
+0065 T 0001 " Nicht genug Platz im Stammverzeichnis",CR,LF," Dateien aus Stammverzeichnis entfernen und CHKDSK wiederholen"
+0066 T 0000 "%1 %2 %3"
+0067 T 0000 "%1 %2, %3"
+0068 T 0000 "%1%2%3%4%5"
+0069 T 0000 "%1%2%3%4"
+0070 T 0001 "%1 Zuordungseinheiten auf Diskette/Festplatte"
+DEBUG 3ec7 0062
+0004 T 0001 "Zuordnung nicht erfolgreich oder angegebener Puffer zu klein",CR,LF
+0005 T 0001 "Nachrichtentext falsch oder fehlend",CR,LF
+0006 T 0001 "Falscher Einheitenname"
+0007 T 0000 "Einheit PRN kann nicht er”ffnet werden",CR,LF
+ "Listeinheit angeben? ",CR,LF
+0008 T 0000 CR,LF
+0009 T 0000 CR,LF,"Programm normal beendee",CR,LF
+0010 T 0000 "Ungltige Laufwerksangabe",CR,LF
+0012 T 0000 "Fehler beim Erstellen der Datei",CR,LF
+0013 T 0000 "Nicht gengend Platz auf Diskette/Platte",CR,LF
+0014 T 0001 "Disketten-/Plattenfehler bei Lesezugriff auf Laufwerk %1",CR,LF
+0015 T 0001 "Disketten-/Plattenfehler bei Schreibzugriff auf Laufwerk %1",CR,LF
+0016 T 0001 "Schreibschutzfehler bei Lesezugriff auf Laufwerk %1",CR,LF
+0017 T 0001 "Schreibschutzfehler bei Schreibzugriff auf Laufwerk %1",CR,LF
+0019 T 0000 "%1 "
+0020 T 0000 "Fehler in .EXE- oder .HEX-Datei",CR,LF
+0021 T 0000 "Žnderungen bei .EXE- und .HEX-Dateien ",CR,LF
+0022 T 0000 "EXEC-Fehler"
+0023 T 0001 "Fehler bei Schreibzugriff, kein Ziellaufwerk angegeben",CR,LF
+0024 T 0000 "Zugriff verweigert",CR,LF
+0025 T 0000 "Parit„ts- oder Speicherfehler"
+0026 T 0000 "-"
+0027 T 0000 "%1 -"
+0032 T 0000 "%1%2"
+0033 T 0000 "%1:%2 %3"
+0034 T 0000 "%1 %2"
+0035 T 0000 "%1 %2",CR,LF,":"
+0036 T 0000 "%1=%2 "
+0037 T 0000 "%1 "
+0038 T 0000 "Schreiben von %01 Byte"
+0039 T 0000 "%1:%2="
+0040 T 0000 "%1"
+0041 T 0000 "%1"
+0042 T 0000 "%1:%2 %3 %4 %5:%6"
+0043 T 0000 "%1 ",CR,LF,"%2 Laufwerk %3:"
+0044 T 0000 32,8
+0045 T 0001 "Nachrichtenbehandlungsroutine kann nicht zugeordnet werden",CR,LF
+0046 T 0000 "%1"
+0047 T 0000 "%1"
+0050 T 0001 "%1 von insgesamt %2 EMS-Seiten wurden zugeordnet",cr,lf
+0051 T 0001 "%1 von insgesamt %2 EMS-Dateikennzeichnungen wurden zugeordnet",cr,lf
+0054 T 0001 "Seitenrahmen = "
+0055 T 0001 "Erstellte Dateikennzeichnung = %1 ",cr,lf
+0056 T 0001 "Logische Seite %1 auf physischer Seite %2 abgebildet ",cr,lf
+0057 T 0001 "EMS-Hardware-/Softwarefehler",cr,lf
+0058 T 0001 "Dateikennzeichnung nicht gefunden",cr,lf
+0059 T 0001 "Ungltiger Funktionscode",cr,lf
+0060 T 0001 "Keine freien Dateikennzeichnungen",cr,lf
+0061 T 0001 "Fehler beim Sichern/Zurckspeichern von Daten",cr,lf
+0062 T 0001 "Gesamtseitenzahl berschritten",cr,lf
+0063 T 0001 "Anzahl freier Seiten berschritten",cr,lf
+0064 T 0001 "Parameterfehler",cr,lf
+0065 T 0001 "Logische Seite auáerhalb des Bereichs",cr,lf
+0066 T 0001 "Physische Seite auáerhalb des Bereichs",cr,lf
+0067 T 0001 "Sicherungsbereich wird bereits benutzt",cr,lf
+0068 T 0001 "Sicherungsbereich wird nicht benutzt",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0001 "Fehlender oder ungltiger EMS-Parameter",cr,lf
+0072 T 0001 "Der Dateikennzeichnung %1 wurden %2 Seiten zugeordnet",cr,lf
+0074 T 0001 "EMS-Wiederherstellung erfolgreich ausgefhrt",cr,lf
+0075 T 0001 "Physische Seite %1 = Rahmensegment %2",cr,lf
+0076 T 0001 "Zuordnung fr Dateikennzeichnung %1 aufgehoben",cr,lf
+0078 T 0001 "EMS nicht installiert",cr,lf
+DRIVER 4a91 0002
+0002 T 0000 "Fehler - Kein Laufwerk angegeben",CR,LF
+0003 T 0000 "Externer Einheitentreiber fr Laufwerk %1",CR,LF
+EDLIN 4b1a 0028
+0006 T 0000 "*"
+0007 T 0000 "Laufwerk/Dateiname ungltig",CR,LF
+0008 T 0000 "Dateiname muá angegeben werden",CR,LF
+0009 T 0000 "Ungltiger Parameter",CR,LF
+0010 T 0000 "Datei hat Status Nur-Lesen ",CR,LF
+0011 T 0000 "Fehler beim Erstellen der Datei ",CR,LF
+0012 T 0000 "Zu viele Dateien er”ffnet",CR,LF
+0013 T 0000 "Lesefehler in:",CR,LF,"%1",CR,LF
+0014 T 0000 "Editieren einer .BAK-Datei nicht m”glich ",CR,LF
+0015 T 0000 "Kein Platz im Verzeichnis fr die Datei",CR,LF
+0016 T 0000 "Diskette/Platte voll ",CR,LF
+0017 T 0000 "Datei nicht gefunden",CR,LF
+0018 T 0000 "Eingabefehler",CR,LF
+0019 T 0000 "Neue Datei",CR,LF
+0020 T 0000 "Nicht gefunden",CR,LF
+0021 T 0000 "O.K.? "
+0022 T 0000 "Zeile zu lang",CR,LF
+0023 T 0000 "Ende der Eingabedatei",CR,LF
+0024 T 0000 "Editieren abbrechen (J/N)? "
+0025 T 0000 "Nummer der Zielzeile angeben",CR,LF
+0026 T 0000 "Nicht genug Platz zum Einlesen der",CR,LF
+ "gesamten Datei",CR,LF
+0027 T 0000 CR,LF
+0028 T 0000 LF
+0029 T 0000 "Fortfahren (J/N)?"
+0030 T 0001 "Nachricht kann nicht gedruckt werden",CR,LF
+0031 T 0000 "%1"
+0032 T 0000 "%1:%2"
+0033 T 0001 "Mischen nicht m”glich - fehlende šbereinstimmung bei Zeichensatztabelle",CR,LF
+EXE2BIN 4fdf 0010
+0002 T 0000 "Nicht gengend Speicherplatz",CR,LF
+0003 T 0001 "Nachrichten wurden nicht gefunden",CR,LF
+0004 T 0000 "Zugriff verweigert",CR,LF
+0005 T 0001 "Datei kann nicht konvertiert werden",CR,LF
+0006 T 0000 "Datei nicht gefunden",CR,LF
+0007 T 0000 "Fehler beim Erstellen der Datei",CR,LF
+0008 T 0001 "Korrektur erforderlich - Basissegment (hex):"
+0009 T 0000 "Ungltiger Parameter",CR,LF
+0011 T 0001 "WARNUNG - Fehler bei Lesezugriff auf EXE-Datei.",CR,LF
+ "Gelesene Byteanzahl kleiner als GrӇenangabe im Kennsatz.",CR,LF
+0012 T 0000 "Dateiname muá angegeben werden",CR,LF
+FIND 523f 0001
+0004 T 0000 "FIND: "
+FORMAT 5269 0044
+0002 T 0001 CR,"%1 Prozent der Platte formatiert"
+0004 T 0000 CR,"Formatieren beendet ",CR,LF
+0007 T 0001 "Neue Diskette in Laufwerk %1: einlegen",CR,LF
+0009 T 0001 "Diskette erneut in Laufwerk %1: einlegen",CR,LF
+0010 T 0001 "Name (11 Zeichen)? "
+0011 T 0000 CR,"Format auf Laufwerk %c: nicht m”glich ",CR,LF
+0012 T 0000 CR,"Ungltige Parameter vom ",CR,LF
+ "Einheitentreiber",CR,LF
+0013 T 0000 CR,"Fehler im IOCTL-Aufruf ",CR,LF
+0014 T 0000 CR,"Keine Blockeinheit ",CR,LF
+0015 T 0000 CR,"Schreibfehler Dateizuordnungstabelle ",CR,LF
+0016 T 0000 CR,"Schreibfehler Verzeichnis ",CR,LF
+0017 T 0000 CR,"FORMAT auf diesem Laufwerk nicht ",CR,LF
+ "m”glich, da ASSIGN bzw. SUBST verwendet ",CR,LF
+ "wurde.",CR,LF
+0018 T 0000 CR,"Systemdateien nicht gefunden",CR,LF
+0019 T 0000 CR,"FORMAT fr Netzwerklaufwerk nicht ",CR,LF
+ "m”glich",CR,LF
+0020 T 0000 CR,"Name enth„lt ungltige Zeichen ",CR,LF
+0021 T 0000 CR,"Parameter nicht untersttzt",CR,LF
+0022 T 0001 CR,"Formatieren beendet ",CR,LF
+0023 T 0000 CR,"Diskette nicht als Systemdiskette ",CR,LF
+ "verwendbar",CR,LF
+0024 T 0000 CR,"Ungltiges Medium oder Spur 0 fehlerhaft",CR,LF
+ "--> Diskette unbrauchbar ",CR,LF
+0025 T 0000 CR,"BOOT kann nicht geschrieben werden ",CR,LF
+0026 T 0000 CR,"Lesefehler Verzeichnis ",CR,LF
+0028 T 0001 CR,"und anschlieáend Eingabetaste bet„tigen..."
+0029 T 0000 CR,"Ungltiger Name ",CR,LF
+0031 T 0000 CR,"Momentanen Namen der Diskette/Platte, ",CR,LF
+ "Laufwerk %1:, eingeben "
+0032 T 0000 CR,"Parameter mit Festplatte nicht ",CR,LF
+ "kompatibel",CR,LF
+0035 T 0000 CR,"Lesefehler Partitionstabelle ",CR,LF
+0037 T 0001 CR,"Format aufgeteilt",CR,LF
+0038 T 0001 CR,"Format nicht auf Laufwerk %1 verfgbar",CR,LF
+0039 T 0001 CR,"Keine Systemdiskette/-platte oder Disketten-/Plattenfehler",CR,LF
+0040 T 0000 CR,"Ungltige Partitionstabelle ",CR,LF
+0041 T 0001 CR,"Angegebene(r) Parameter nicht vom Laufwerk untersttzt",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0001 CR,"DOS-Diskette in Laufwerk %1: einlegen",CR,LF
+0045 T 0000 CR,LF,"ACHTUNG !"
+ " Alle Daten auf der ",CR,LF
+ "Festplatte %1: werden gel”scht!",CR,LF
+ "Formatieren durchfhren (J/N)?"
+0046 T 0000 CR,"Weitere Dskt./Platte formatieren (J/N)?"
+0047 T 0000 CR,"Lesefehler Partitionstabelle ",CR,LF
+0048 T 0000 CR,"Schreibfehler Partitionstabelle ",CR,LF
+0049 T 0000 CR,"Parameter nicht kompatibel ",CR,LF
+0050 T 0001 "%1 Zuordnungseinheiten auf Platte verfgbar",CR,LF
+0051 T 0001 "%1 Byte in jeder Zuordnungseinheit",CR,LF
+0052 T 0000 CR, "Schreibfehler Partitionstabelle ",CR,LF
+0053 T 0001 CR,"Parameter doppelt eingegeben",CR,LF
+0054 T 0001 CR,"Angabe der Parameter /T und /N erforderlich",CR,LF
+JOIN 5d49 0001
+0002 T 0000 CR,LF,"Verzeichnis nicht leer",CR,LF
+MORE 5d8f 0001
+0002 T 0000 "--- Fortsetzung ---"
+PRINT 5dc6 0022
+0002 T 0000 CR,LF
+0006 T 0000 "Fehler beim Lesen der Datei",CR,LF,"$"
+0007 T 0000 "Datei nicht gefunden",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Datei "
+0009 T 0000 " aus Drucker-",CR,LF
+ "warteschlange gel”scht",CR,LF
+0010 T 0000 CR,LF,LF,"Alle Dateien aus Druckerwarteschlange",CR,LF
+ "gel”scht"
+0011 T 0000 "Dateizuordnungstabelle fehlerhaft,",CR,LF,"Laufwerk"
+0012 T 0000 " A",CR,LF,"$"
+0013 T 0000 "Druckausgabe ist keiner Einheit ",CR,LF
+ "zugeordnet",CR,LF
+0014 T 0000 "Residenter Teil von PRINT geladen ",CR,LF
+0015 T 0000 "PRINT nicht m”glich - NET PRINT anwenden ",CR,LF
+0017 T 0000 "Die Druckerwarteschlange ist voll",CR,LF
+0018 T 0000 "Die Druckerwarteschlange ist leer",CR,LF
+0019 T 0000 "Zugriff verweigert ",CR,LF
+0020 T 0000 "Ungltige Laufwerksangabe",CR,LF
+0021 T 0000 "Ausgabeeinheit ist evtl. ausgeschaltet",CR,LF
+ "oder OFFLINE. Bitte berprfen. ",CR,LF
+0022 T 0000 CR,LF,LF," %1 wird gerade gedruckt",CR,LF
+0023 T 0000 " %1 ist in der Warteschlange",CR,LF
+0024 T 0000 "Datei nicht gefunden",CR,LF
+0025 T 0000 "Pfadname zu lang",CR,LF
+0026 T 0000 "%1 Datei nicht in Druckerwarteschlange",CR,LF
+0027 T 0000 "Name der Ausgabeeinheit [PRN]: "
+RECOVER 627d 0012
+0002 T 0000 CR,LF,"Datei nicht gefunden",CR,LF
+0003 T 0001 CR,LF,"RECOVER fr ein mit ASSIGN/SUBST zugeordnetes Laufwerk nicht m”glich",CR,LF
+0004 T 0000 CR,LF,"Laufwerk/Dateiname ungltig",CR,LF
+0005 T 0000 CR,LF,"Achtung - Verzeichnis voll",CR,LF
+0006 T 0000 CR,LF,"RECOVER fr Netzwerklaufwerk nicht ",CR,LF
+ "m”glich",CR,LF
+0007 T 0001 CR,LF,"RECOVER nicht auf Laufwerk %1",CR,LF
+0008 T 0000 CR,LF,"%1 Datei(en) wiederhergestellt",CR,LF
+0009 T 0000 CR,LF,"%1 von %2 Byte ",CR,LF
+ "wiederhergestellt",CR,LF
+0010 T 0000 CR,LF,"Zur Wiederherstellung der Datei(en) auf",CR,LF
+ "Laufwerk %1 eine Taste bet„tigen",CR,LF,CR,LF
+0011 T 0001 CR,LF,"Dateizuordnungstabelle kann nicht gelesen werden",CR,LF
+0012 T 0001 CR,LF,"Dateizuordnungstabelle kann nicht geschrieben werden",CR,LF
+0013 T 0000 CR,LF
+SORT 65bd 0001
+0005 T 0000 "SORT: "
+SUBST 65e7 0001
+0002 T 0000 CR,LF,"Ungltige Anzahl Parameter",CR,LF
+SYS 6631 0008
+0004 T 0000 "Ungltige Laufwerksangabe",CR,LF
+0007 T 0000 "Kein Platz fr Betriebssystem auf ",CR,LF
+ "Zieldiskette",CR,LF
+0008 T 0000 "SystemgrӇe nicht kompatibel",CR,LF
+0010 T 0000 "Kein Betriebssystem auf Standardlaufwerk",CR,LF
+0011 T 0001 "Standardlaufwerk kann nicht angegeben werden",CR,LF
+0012 T 0001 "Schreibfehler, Diskette nicht verwendbar",CR,LF
+0014 T 0000 "Systemdiskette in Laufwerk %1",CR,LF
+0016 T 0001 "SYS auf %1-Dateisystem nicht m”glich",CR,LF
+SHARE 6820 0000
+NLSFUNC 6834 0000
+ANSI 6848 0001
+0010 T 0001 "Ungltiger Parameter - %1",CR,LF
+IFSFUNC 688b 0001
+0004 T 0001 "Keine IFS-Treiber gefunden",CR,LF
+PSPRINT 68cf 0007
+0002 T 0000 "Fehler beim Lesen der Datei",CR,LF,FORMFD,BELL,"$"
+0003 T 0001 CR,LF,LF,"Dateiverarbeitung durch Bediener abgebrochen",CR,FORMFD,BELL
+0004 T 0000 "Dateizuordnungstabelle fehlerhaft,",CR,LF,"Laufwerk"
+0005 T 0000 "A ",CR,LF
+0006 T 0000 "Druckausgabe ist keiner Einheit ",CR,LF
+ "zugeordnet",CR,LF
+0007 T 0000 "PSPRINT bereits installiert",CR,LF
+0008 T 0000 "PSPRINT und PRINT nicht kompatibel",CR,LF
+BACKUP 6a87 0022
+0002 T 0000 CR,LF,"Nicht gengend Speicherplatz",CR,LF
+0006 T 0000 CR,LF,"Ungltige Laufwerksangabe",CR,LF
+0014 T 0001 CR,LF,"Quellen- und Ziellaufwerk sind identisch",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Fehler beim Er”ffnen der Protokolldatei",CR,LF
+0018 T 0000 CR,LF,"Protokoll wird in Datei %1",CR,LF
+ "geschrieben",CR,LF
+0019 T 0000 CR,LF,"Letzte Sicherungsdiskette",CR,LF
+ "nicht eingelegt",CR,LF
+0020 T 0000 CR,LF,"Achtung! Dateien im Stammverzeichnis",CR,LF
+ "%1:\ des Ziellaufwerks werden gel”scht.",CR,LF
+0021 T 0000 CR,LF,"Achtung! Dateien im Verzeichnis",CR,LF
+ "%1:\BACKUP des Ziellaufwerks werden gel”scht.",CR,LF
+0022 T 0000 CR,LF,"*** Dateisicherung nach Laufwerk %1: ***",CR,LF
+0023 T 0000 "Diskette Nummer: %1",CR,LF
+0024 T 0000 CR,LF,"Achtung! Keine Dateien zum Sichern",CR,LF
+ "gefunden",CR,LF
+0025 T 0000 CR,LF,"Sicherungsquellendiskette in Laufwerk",CR,LF
+ "%1: einlegen und anschlieáend eine",CR,LF
+0026 T 0000 CR,LF,"Sicherungsdiskette %s in Laufwerk %c:",CR,LF
+ "einlegen",CR,LF
+0027 T 0000 CR,LF,"*** Datei kann nicht gesichert",CR,LF,"werden ***",CR,LF
+0028 T 0000 CR,LF,"Letzte Sicherungsdiskette in Laufwerk",CR,LF
+ "%1: einlegen und eine Taste bet„tigen",CR,LF
+0029 T 0000 CR,LF,"Zieleinheit kann nicht zum Sichern",CR,LF
+ "verwendet werden",CR,LF
+0030 T 0000 CR,LF,"*** Letzte Datei nicht gesichert ***",CR,LF
+0031 T 0000 CR,LF,"Die zugeordnete Einheit %c: fr die",CR,LF
+ "Sicherung ist voll",CR,LF
+0032 T 0000 CR,LF,"Diskette/Platte voll, Schreibfehler bei BACKUP-Protokolldatei",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 7120 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 715a 0013
+0004 T 0000 "10 Vergleichsfehler - Vergleich beendet",CR,LF
+0006 T 0000 "Vergleichsfehler bei OFFSET",CR,LF
+0007 T 0000 "Datei 1 = %1",CR,LF
+0008 T 0000 "Datei 2 = %1",CR,LF
+0009 T 0000 "EOF-Markierung nicht gefunden",CR,LF
+0010 T 0000 "Dateien sind identisch",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Ersten Dateinamen eingeben",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Zweiten Dateinamen oder Laufwerk eingeben",CR,LF
+0017 T 0000 "Dateien haben unterschiedliche GrӇe",CR,LF
+0018 T 0000 "Weitere Dateien vergleichen (J/N) ?"
+0019 T 0000 "%1 and %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Dateien sind identisch",CR,LF
+DISKCOMP 73d1 0016
+0004 T 0000 "Keine Dateinamen angeben",CR,LF
+ "Befehlsformat: DISKCOMP d: d:[/1][/8",CR,LF
+0005 T 0000 CR,LF,"Ungltige Laufwerksangabe",CR,LF
+ "Angegebenes Laufwerk existiert nicht",CR,LF
+ "oder ist kein Diskettenlaufwerk",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP fr Netzwerklaufwerk",CR,LF
+ "nicht m”glich",CR,LF
+0007 T 0001 CR,LF,"ERSTE Diskette in Laufwerk %1: einlegen",CR,LF
+0008 T 0001 CR,LF,"ZWEITE Diskette in Laufwerk %1: einlegen",CR,LF
+0009 T 0001 CR,LF,"ERSTE Diskette fehlerhaft oder nicht kompatibel",CR,LF
+0010 T 0001 CR,LF,"ZWEITE Diskette fehlerhaft oder nicht kompatibel",CR,LF
+0014 T 0000 CR,LF,"Weitere Disketten vergleichen (J/N)?"
+0015 T 0001 CR,LF,"Verglichen werden %1 Spuren",CR,LF
+ "mit %2 Sektoren pro Spur auf %3 Seite(n)",CR,LF
+0016 T 0000 CR,LF,"Disketten-/Laufwerksart nicht",CR,LF
+ "kompatibel",CR,LF
+0017 T 0001 CR,LF,"Nicht behebbarer Lesefehler auf Laufwerk %2",CR,LF
+ "Seite %3, Spur %4",CR,LF
+0018 T 0001 CR,LF,"Vergleichsfehler auf",CR,LF,"Seite %3, Spur %4",CR,LF
+0019 T 0000 "Diskette muá eingelegt und Verriegelung",CR,LF
+ "geschlossen sein",CR,LF
+0020 T 0000 CR,LF,"Vergleich beendet",CR,LF
+0021 T 0000 CR,LF,"Vergleich OK",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 789e 0018
+0002 T 0000 CR,LF
+0004 T 0000 "Keine Dateinamen angeben",CR,LF
+ "Befehlsformat: DISKCOMP d: d:[/1][/8",CR,LF
+0005 T 0000 CR,LF,"Ungltige Laufwerksangabe",CR,LF
+ "Angegebenes Laufwerk existiert nicht",CR,LF
+ "oder ist kein Diskettenlaufwerk",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP fr Netzwerklaufwerk",CR,LF
+ "nicht m”glich",CR,LF
+0007 T 0000 CR,LF,"Diskette wird beim Kopieren formatiert",CR,LF
+0008 T 0001 CR,LF,"Quellendiskette in Laufwerk %1: einlegen",CR,LF
+0009 T 0001 CR,LF,"Zieldiskette in Laufwerk %1: einlegen",CR,LF
+0010 T 0000 "Diskette muá eingelegt und Verriegelung",CR,LF
+ "geschlossen sein",CR,LF
+0011 T 0000 CR,LF,"Zieldiskette ist evtl. nicht verwendbar",CR,LF
+0012 T 0000 CR,LF,"Zieldiskette ist nicht verwendbar",CR,LF
+0016 T 0000 CR,LF,"Eine weitere Kopie erstellen (J/N)?"
+0017 T 0001 CR,LF,"Kopiert werden %1 Spuren",CR,LF
+ "mit %2 Sektoren/Spur auf %3 Seite(n)",CR,LF
+0018 T 0000 CR,LF,"Disketten-/Laufwerksart",CR,LF
+ "nicht kompatibel",CR,LF
+0019 T 0001 CR,LF,"Nicht behebbarer Lesefehler auf Laufwerk %1",CR,LF
+ "Seite %2, Spur %3",CR,LF
+0020 T 0001 CR,LF,"Nicht behebbarer Schreibfehler auf Laufwerk %1",CR,LF
+ "Seite %2, Spur %3",CR,LF
+0021 T 0000 CR,LF,"Kopiervorgang beendet",CR,LF
+0022 T 0001 CR,LF,"Quellendiskette fehlerhaft oder nicht kompatibel"
+0023 T 0001 CR,LF,"Zieldiskette fehlerhaft oder nicht kompatibel"
+LABL 7e10 0000
+MODE 7e24 0055
+0003 T 0001 CR,LF,"Angabe von COM1, COM2, COM3 oder COM4 erforderlich",CR,LF
+0004 T 0000 CR,LF,"Residenter Teil von MODE geladen",CR,LF
+0005 T 0000 CR,LF,"Ungltiger Einheitenname",BELL,CR,LF
+0006 T 0000 CR,LF,"Druckerfehler",BELL,CR,LF
+0007 T 0000 CR,LF,"LPT%1: ist auf 80 Zeichen/Zeile gesetzt",CR,LF
+0008 T 0000 CR,LF,"LPT%1: ist auf 132 Zeichen/Zeile gesetzt",CR,LF
+0009 T 0000 CR,LF,"Druckzeilen pro Zoll gesetzt",CR,LF
+0010 T 0000 CR,LF,"Ungltige šbertragungsrate angegeben",BELL,CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 T 0000 CR,LF,"Ist %1 zu sehen (J/N)? ",CR,LF
+0014 T 0000 CR,LF,"Ungltiger Parameter",CR,LF
+0015 T 0000 "LPT%1: umgeleitet zu COM%2:",CR,LF
+0016 T 0000 "LPT%1: nicht umgeleitet",CR,LF
+0017 T 0000 CR,LF,"%1 Wiederholungsversuche ",CR,LF
+ "bei Zeitlimitberschreitung ",CR,LF
+ "des Paralleldruckers",CR,LF
+0018 T 0000 CR,LF,"Verschieben der Anzeige %1 unm”glich",CR,LF
+0020 T 0000 CR,LF,"Ungltige Anzahl Parameter",CR,LF
+0021 T 0000 CR,LF,"NET 042: Befehl nicht ausfhrbar",CR,LF
+0022 T 0000 CR,LF,"Anhaltende Wiederholungsversuche bei",CR,LF
+ "Netzwerkdrucker nicht untersttzt",CR,LF
+0023 T 0000 CR,LF,"Zugriffsfehler auf Zeichensatztabelle der Fontdatei",CR,LF
+0024 T 0000 CR,LF,"Zugriffsfehler, Einheit: %1",CR,LF
+0025 T 0000 CR,LF,"Fehlende Einheit oder Zeichensatztabelle in Fontdatei",CR,LF
+0026 T 0000 CR,LF,"Inhalt der Fontdatei ungltig",CR,LF
+0027 T 0000 CR,LF,"Zuvor definierte Zeichensatztabelle wurde ersetzt",CR,LF
+0028 T 0000 CR,LF,"Aktive Zeichensatztabelle fr Einheit %1 ist %2",CR,LF
+0029 T 0000 CR,LF,"Einheit %1 nicht vorbereitet",CR,LF
+0030 T 0000 "%1 Zeichensatztabellen:",CR,LF
+0031 T 0001 " Zeichensatztabelle %1",CR,LF
+0032 T 0000 CR,LF,"Zeichensatztabellen-Funktion von MODE %1 beendet",CR,LF
+0033 T 0001 CR,LF,"Fehler %1 Globale Zeichensatztabelle",CR,LF
+0034 T 0000 CR,LF,"Z. Zt. definierte Zeichensatz-",CR,LF,"tabellen:",CR,LF
+0035 T 0000 " %1 - %2 Zeichensatztabelle",CR,LF
+0036 T 0000 " Zeichensatztabelle nicht vorbereitet",CR,LF
+0037 T 0000 "Zeichensatztabellen-Operation auf",CR,LF,"dieser Einheit nicht untersttzt",CR,LF
+0038 T 0000 "Keine Zeichensatztabelle ausgew„hlt",CR,LF
+0039 T 0000 "Einheitenfehler w„hrend %1",CR,LF
+0040 T 0000 "Zeichensatztabelle nicht vorbereitet",CR,LF
+0041 T 0000 CR,LF,"Definierte Tastatur untersttzt diese",CR,LF,"Zeichensatztabelle nicht",CR,LF
+0042 T 0000 CR,LF,"Fehler beim Lesen der Fontdatei",CR,LF
+0043 T 0000 CR,LF,"REFRESH kann nicht durchgefhrt werden",CR,LF
+0044 T 0000 CR,LF
+0045 T 0001 CR,LF,"Status fr Einheit %1:",CR,LF
+0046 T 0000 "------------------"
+0047 T 0000 "----",CR,LF
+0048 T 0000 "-----",CR,LF
+0049 T 0001 "LINES=%1",CR,LF
+0050 T 0001 "COLUMNS=%1",CR,LF
+0051 T 0001 CR,LF,"RATE und DELAY mssen zusammen angegeben werden",CR,LF
+0052 T 0001 "RATE=%1",CR,LF
+0053 T 0001 "DELAY=%1",CR,LF
+0054 T 0001 CR,LF,"Funktion wird von dieser Systemkonfiguration nicht untersttzt",CR,LF
+0055 T 0001 CR,LF,"Erforderlicher Zeichensatz nicht geladen",CR,LF
+0056 T 0001 CR,LF,"Angeforderte Funktion setzt installierte Datei ANSI.SYS voraus",CR,LF
+0057 T 0001 CR,LF,"Angabe der Datenbertragungsgeschwindigkeit erforderlich",CR,LF
+0058 T 0001 "RETRY=%1",CR,LF
+RESTORE 8aff 0022
+0002 T 0000 CR,LF,"Quellen- und Ziellaufwerk sind identisch",CR,LF
+0003 T 0000 CR,LF,"Ungltige Anzahl Parameter",CR,LF
+0006 T 0000 CR,LF,"Ungltige Laufwerksangabe",CR,LF
+0007 T 0000 CR,LF,"Achtung! Keine Dateien zum ",CR,LF,"Zurckspeichern gefunden",CR,LF
+0008 T 0000 CR,LF,"Sicherungsdiskette %1 in Laufwerk %2",CR,LF
+0009 T 0000 CR,LF,"Sicherungszieldiskette in Laufwerk %1: einlegen und",CR,LF
+0011 T 0000 CR,LF,"Achtung! Diskette in falscher Reihenfolge",CR,LF
+ "Diskette austauschen oder fortfahren",CR,LF
+0012 T 0000 CR,LF,"Letzte Datei konnte nicht zurckgespeichert werden",CR,LF
+0013 T 0000 CR,LF,"*** Dateien gesichert am %1 ***",CR,LF
+0014 T 0000 CR,LF,"Quelle enth„lt keine Sicherungsdateien",CR,LF
+0015 T 0000 CR,LF,"Nicht gengend Speicherplatz",CR,LF
+0016 T 0000 CR,LF,"Achtung! Fr Datei %1",CR,LF
+ "besteht Nur-Lese-Zugriff",CR,LF
+ "Datei ersetzen (J/N)? ",CR,LF
+0017 T 0000 CR,LF,"Falsche Reihenfolge beim Zurckspeichern",CR,LF
+0018 T 0000 CR,LF,"Fehler beim Erstellen der Datei",CR,LF
+0019 T 0000 CR,LF,"Nicht genug Platz auf Diskette/Platte",CR,LF
+0020 T 0000 CR,LF,"*** Datei kann nicht zurckgespeichert werden ***",CR,LF
+0021 T 0000 CR,LF,"*** Dateien werden von Laufwerk %1:",CR,LF," zurckgespeichert ***",CR,LF
+0022 T 0000 CR,LF,"Achtung! Datei %1",CR,LF
+ "wurde nach der Sicherung ge„ndert",CR,LF
+ "Datei ersetzen (J/N)?",CR,LF
+0023 T 0000 "Diskette: %1",CR,LF
+0024 T 0001 CR,LF,"Schwerer Fehler, bitte IBM verst„ndigen",CR,LF
+0025 T 0000 07
+0026 T 0001 CR,LF,"Fehler bei der Wiederherstellung erweiterter Attribute",CR,LF
+SELECT 9140 0016
+0004 T 0001 "Falscher/fehlerhafter Plattenname fr SELECT-Systemstart",CR,LF,CR,LF
+ "Installationsdiskette in Laufwerk A: einlegen und Versuch wiederholen"
+0005 T 0001 "Falsche/fehlerhafte Diskette",CR,LF,CR,LF
+ "Installationsdiskette in Laufwerk A: einlegen und Versuch wiederholen"
+0006 T 0001 "Ungltige Parameter in der SELECT-Befehlszeile",CR,LF,CR,LF
+ "šberprfen, ob sich die Installationsdiskette in Laufwerk A: befindet,",CR,LF
+ "anschlieáend System mit Strg+Alt+Entf erneut starten."
+0007 T 0001 BELL,"DOS kann nicht installiert werden. Programm abgebrochen",CR,LF
+0008 T 0001 "SELECT wird geladen. Bitte warten..."
+0009 T 0001 "Erneuter Start des Systems erforderlich.",CR,LF,CR,LF
+ "Zur Fortsetzung der DOS-Installation Strg-Alt-L”sch drcken."
+0010 T 0001 "SELECT-Diskette in Laufwerk A: einlegen",CR,LF,CR,LF
+ "DOS-Installation mit der Eingabetaste fortsetzen oder mit",CR,LF
+ "ESC abbrechen.",CR,LF
+0011 T 0001 BELL
+0012 T 0001 "SELECT-Diskette in Laufwerk A: einlegen,",CR,LF,CR,LF
+ "anschlieáend Eingabetaste bet„tigen",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press ENTER to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE 9910 0004
+0002 T 0001 "Auflistung der Verzeichnispfade fr Laufwerk %1",CR,LF
+0003 T 0001 "Auflistung der Verzeichnispfade",CR,LF
+0004 T 0000 "Keine Unterverzeichnisse vorhanden",CR,LF,LF
+0007 T 0000 "ÀÄó"
+REPLACE 99ed 0009
+0003 T 0000 CR,LF,"Keine Dateien ersetzt",CR,LF
+0004 T 0000 CR,LF,"Keine Dateien hinzugefgt",CR,LF
+0013 T 0000 CR,LF,"%1 wird ersetzt",CR,LF
+0014 T 0000 CR,LF,"%1 wird hinzugefgt",CR,LF
+0015 T 0000 CR,LF,"%1 Datei(en) ersetzt",CR,LF
+0016 T 0000 CR,LF,"%1 Datei(en) hinzugefgt",CR,LF
+0017 T 0000 CR,LF,"Keine Dateien gefunden %s",CR,LF
+0022 T 0000 CR,LF,"%1 ersetzen (J/N)?"
+0023 T 0000 CR,LF,"%1 hinzufgen (J/N)?"
+XCOPY 9bac 0019
+0004 T 0000 "Wird durch %1 ein Dateiname oder ein Verzeichnis",CR,LF
+ "auf der Zieleinheit angegeben",CR,LF
+ "(D=Datei, V=Verzeichnis)?",CR,LF
+0005 T 0000 "Zum Kopieren von Datei(en)"
+0006 T 0000 "Pfad zu lang",CR,LF
+0008 T 0000 "Rekursive Kopie nicht m”glich",CR,LF
+0012 T 0000 "XCOPY von reservierter Einheit nicht m”glich",CR,LF
+0021 T 0000 "Ungltige Anzahl Parameter",CR,LF
+0022 T 0000 "XCOPY zu reservierter Einheit nicht m”glich",CR,LF
+0024 T 0000 "Fehler beim Erstellen der Datei",CR,LF
+0025 T 0000 "Quellendatei(en) wird/werden eingelesen",CR,LF
+0026 T 0000 CR,LF
+0027 T 0000 "%1 Datei(en) kopiert",CR,LF
+0028 T 0001 "%1 Datei nicht gefunden",CR,LF
+0029 T 0001 "D L "
+0030 T 0000 "%1%2",CR,LF
+0031 T 0000 "%1\%2",CR,LF
+0032 T 0000 "%1",CR,LF
+0033 T 0000 "%1%2 (J/N)?"
+0034 T 0000 "%1\%2 (J/N)?"
+0035 T 0001 "Ungltiger Parameter %1",CR,LF
+VDISK 9f25 0013
+0002 T 0000 "Nicht gengend Speicherplatz",CR,LF
+0003 T 0000 "VDISK Version 3.40 Virtuelle Platte %1",CR,LF
+0004 T 0000 "Puffergr”áe angepaát",CR,LF
+0005 T 0000 "Sektorgr”áe angepaát",CR,LF
+0006 T 0000 "Verzeichniseintr„ge angepaát",CR,LF
+0007 T 0000 "Ungltiger Parameter",CR,LF
+0008 T 0000 "Gr”áe des Transferpuffers angepaát",CR,LF
+0009 T 0001 " PuffergrӇe: %1 KByte",CR,LF
+0010 T 0000 " SektorgrӇe: %1",CR,LF
+0011 T 0000 "Verzeichniseintr„ge: %1",CR,LF
+0012 T 0000 "TransferpuffergrӇe: %1",CR,LF
+0013 T 0000 "VDISK nicht installiert - Schalter ",CR,LF
+0014 T 0000 "auf Erweiterungskarte entsprechen",CR,LF
+ "nicht SpeichergrӇe des Systems",CR,LF,CR,LF
+GRAFTABL a1ed 0005
+0002 T 0000 "Aktive Zeichensatztabelle: %1",CR,LF
+0003 T 0000 "Vorherige Zeichensatztabelle: %1",CR,LF
+0004 T 0000 "Keine(s)"
+0005 T 0001 "Kein Standard",NULL
+0006 T 0001 CR,LF,"Untersttzte Parameter in der DOS-Befehlszeile",COLON,CR,LF,LF
+ " /STA - Nur Statusabfrage",CR,LF
+ " ? - Diese Parameterbersicht anzeigen",CR,LF,CR,LF
+ " verfgbare Zeichensatztabellen",COLON,CR,LF
+ " 437 - USA - Grafikzeichensatz",CR,LF
+ " 850 - Mehrsprachiger Grafikzeichensatz",CR,LF
+ " 860 - Portugal - Grafikzeichensatz",CR,LF
+ " 863 - Kanada (franz.) - Grafikzeichensatz",CR,LF
+ " 865 - Nordische Sprachen - Grafikzeichensatz",CR,LF
+FASTOPEN a498 0016
+0004 T 0000 CR,LF,"FASTOPEN installiert",CR,LF
+0005 T 0001 CR,LF,"FASTOPEN bereits installiert",CR,LF
+0006 T 0000 CR,LF,"Falsche Parameter",CR,LF
+0007 T 0000 CR,LF,"Zu viele Laufwerkseintr„ge",CR,LF
+0008 T 0000 CR,LF,"Gleiches Laufwerk mehrmals angegeben",CR,LF
+0009 T 0000 CR,LF,"Ungltiger Parameter",CR,LF
+0010 T 0001 CR,LF,"Ungltiger Parametertyp",CR,LF
+0011 T 0001 CR,LF,"Ungltiger Bereichseintrag",CR,LF
+0012 T 0001 CR,LF,"Ungltige Anzahl Datei-/Verzeichniseintr„ge",CR,LF
+0013 T 0001 CR,LF,"Hauptspeichererweiterung kann nicht aktiviert werden",CR,LF
+0014 T 0001 CR,LF,"Hauptspeichererweiterung nicht verfgbar",CR,LF
+0015 T 0000 CR,LF,"Ungltige Laufwerksangabe %1",CR,LF
+0016 T 0001 CR,LF,"EMS-Speicherplatz reicht nicht aus. Basisspeicherbereich wird benutzt",CR,LF
+0017 T 0000 CR,LF,"FASTOPEN fr Laufwerk %1",CR,LF
+0018 T 0001 CR,LF,"Zu viele Bereichseintr„ge",CR,LF
+0019 T 0001 CR,LF,"Zu viele Datei-/Verzeichniseintr„ge",CR,LF
+APPEND a86c 0009
+0001 T 0000 "Falsche APPEND-Version",CR,LF
+0002 T 0000 "Ungltiger Pfad",CR,LF
+0003 T 0000 "Ungltiger Parameter",CR,LF
+0004 T 0001 "Ungltige Parameterkombination",CR,LF
+0005 T 0000 "Kein APPEND",CR,LF
+0006 T 0000 "APPEND und ASSIGN nicht kompatibel",CR,LF
+0007 T 0000 "APPEND und TopView nicht kompatibel",CR,LF
+0008 T 0000 "Falsche DOS-Version",CR,LF
+0009 T 0000 "APPEND bereits installiert",CR,LF
+GRAPHICS aa1a 0012
+0005 T 0000 "Ungltiger Parameter %1",CR,LF
+0007 T 0001 "Doppelte Parameter sind nicht zul„ssig",CR,LF
+0009 T 0001 "GRAPHICS-Profil nicht gefunden",CR,LF
+0010 T 0001 "Erforderliche Profilanweisung fehlt vor Zeile %1",CR,LF
+0011 T 0001 "Ungltige Profilanweisung in Zeile %1",CR,LF
+0012 T 0001 "Profilanweisung an falscher Position in Zeile %1",CR,LF
+0013 T 0001 "Fehler beim Lesen des GRAPHICS-Profils",CR,LF
+0014 T 0001 "Syntaxfehler im GRAPHICS-Profil",CR,LF
+0015 T 0001 "Druckbox-Kennzeichen nicht im GRAPHICS-Profil",CR,LF
+0016 T 0001 "Druckertyp nicht im GRAPHICS-Profil",CR,LF
+0017 T 0001 "/B bei Schwarz/Weiá-Drucker ungltig",CR,LF
+0018 T 0001 "Erneutes Laden mit angegebenem Profil nicht m”glich",CR,LF
+DISPLAY ad03 0003
+0002 T 0000 "Einheitentreiber fr Zeichensatztabelle kann nicht initialisiert werden",CR,LF,BELL
+0008 T 0000 "Nicht gengend Speicherplatz",CR,LF,BELL
+0012 T 0000 "Ungltige Syntax beim Einheitentreiber fr die DISPLAY.SYS-Zeichensatztabelle",CR,LF,BELL
+PRINTER ae18 0002
+0002 T 0000 "Einheitentreiber fr Zeichensatztabelle kann nicht initialisiert werden",CR,LF,BELL
+0012 T 0000 "Ungltige Syntax beim Einheitentreiber fr die DISPLAY.SYS-Zeichensatztabelle",CR,LF,BELL
+KEYB aef6 0016
+0002 T 0000 "Aktueller Tastaturcode: %1"
+0003 T 0001 "Aktuelles Tastaturkennzeichen: %1"
+0004 T 0000 "Zeichensatztabelle: %1",CR,LF
+0005 T 0000 "Aktuelle CON-Zeichensatztabelle: %1",CR,LF
+0006 T 0000 "Ungltiger Tastaturcode angegeben",CR,LF
+0007 T 0001 "Ungltiges Tastaturkennzeichen angegeben",CR,LF
+0008 T 0000 "Ungltige Zeichensatztabelle angegeben",CR,LF
+0009 T 0000 "Ungltige oder fehlende Datei zur Tastaturdefinition",CR,LF
+0010 T 0000 "KEYB wurde nicht installiert",CR,LF
+0011 T 0000 "Aktive Zeichensatztabelle fr Einheit CON nicht verfgbar",CR,LF
+0012 T 0000 "Definierte Zeichensatztabelle wurde nicht vorbereitet",CR,LF
+0013 T 0000 "CON-Zeichensatztabelle(n) ungltig fr diesen Tastaturcode",CR,LF
+0014 T 0000 "Gewnschte Zeichensatztabelle %1 ist ungltig fr diesen Tastaturcode",CR,LF
+0015 T 0000 "Angegebene und ausgew„hlte Zeichensatztabellen passen nicht zusammen",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "KEYB-Tabelle kann nicht im residenten Speicher erstellt werden",CR,LF
+REDIRSYS b347 0000
+MEM b35b 0036
+0010 T 0001 CR,LF
+0011 T 0001 " Adresse Name GrӇe Typ ",CR,LF
+0012 T 0001 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0001 " Kennz. EMS-Name GrӇe ",CR,LF
+0014 T 0001 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0001 " %1 %2 %3 %4",CR,LF
+0016 T 0001 " %1 %2 %3 ",CR,LF
+0017 T 0001 " %1 %2 ",CR,LF
+0018 T 0001 "%1 Byte Gesamtspeicher",CR,LF
+0019 T 0001 "%1 Byte verfgbar",CR,LF
+0020 T 0001 "%1 Byte maximal fr ein ausfhrbares Programm verfgbar",CR,LF
+0021 T 0001 "%1 Byte Gesamt-EMS-Speicher",CR,LF
+0022 T 0001 "%1 Byte freier EMS-Speicher",CR,LF
+0023 T 0001 "%1 Byte Gesamt-Erweiterungsspeicher",CR,LF
+0024 T 0001 "Unterbrechungsvektor",0
+0025 T 0001 "ROM-šbertragungsbereich",0
+0026 T 0001 "DOS-šbertragungsbereich",0
+0027 T 0001 "IBMBIO",0
+0028 T 0001 "IBMDOS",0
+0029 T 0001 "Systemdaten",0
+0030 T 0001 "Systemprogramm",0
+0031 T 0001 "Systemeinheitentreiber",0
+0032 T 0001 "Installierter Einheitentreiber",0
+0033 T 0001 "%1:",0
+0034 T 0001 "%1: - %2:",0
+0035 T 0001 "BUFFERS=",0
+0036 T 0001 "FILES=",0
+0037 T 0001 "FCBS=",0
+0038 T 0001 "STACKS=",0
+0039 T 0001 "DEVICE=",0
+0040 T 0001 "IFS=",0
+0041 T 0001 "LASTDRIVE=",0
+0042 T 0001 "----------",0
+0043 T 0001 " ",0
+0044 T 0001 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR b907 0040
+0004 T 0001 "Netzwerk wurde nicht gestartet",CR,LF
+0050 T 0001 "NET809: Netzwerkanforderung wird nicht untersttzt",CR,LF,0
+0051 T 0001 "NET801: Entfernter Computer nicht empfangsbereit",CR,LF,0
+0052 T 0001 "NET802: Name im Netzwerk bereits vorhanden",CR,LF,0
+0053 T 0001 "NET803: Netzwerkpfad nicht gefunden",CR,LF,0
+0054 T 0001 "NET804: Netzwerk aktiv",CR,LF,0
+0055 T 0001 "NET805: Netzwerkeinheit nicht mehr verfgbar",CR,LF,0
+0056 T 0001 "NET806: Begrenzung fr NETBIOS-Befehl berschritten",CR,LF,0
+0057 T 0001 "NET807: Systemfehler; NETBIOS-Fehler",CR,LF,0
+0058 T 0001 "NET808: Ungltige Antwort vom Netzwerk",CR,LF,0
+0059 T 0001 "NET810: Unerwarteter Netzwerkfehler",CR,LF,0
+0060 T 0001 "NET811: Entfernter Adapter nicht kompatibel",CR,LF,0
+0061 T 0001 "NET812: Druckwarteschlange voll",CR,LF,0
+0062 T 0001 "NET813: Speicherplatz reicht fr Druckdatei nicht aus",CR,LF,0
+0063 T 0001 "NET814: Druckdatei wurde abgebrochen",CR,LF,0
+0064 T 0001 "NET815: Netzwerkname wurde gel”scht",CR,LF,0
+0065 T 0001 "Zugriff abgelehnt",CR,LF,0
+0066 T 0001 "NET817: Ungltiger Typ fr Netzwerkeinheit",CR,LF,0
+0067 T 0001 "NET818: Netzwerkname nicht gefunden",CR,LF,0
+0068 T 0001 "NET819: Begrenzung fr Netzwerknamen berschritten",CR,LF,0
+0069 T 0001 "NET820: Begrenzung fr NETBIOS-Sitzung berschritten",CR,LF,0
+0070 T 0001 "NET821: Gemeinsamer Zugriff vorbergehend unterbrochen",CR,LF,0
+0071 T 0001 "NET823: Netzwerkanforderung abgelehnt",CR,LF,0
+0072 T 0001 "NET822: Druck- oder Disketten/-Plattenumleitung vorbergehend unterbrochen",CR,LF,0
+0073 T 0001 "NET476: Netbeui nicht geladen",CR,LF,0
+0074 T 0001 "NET477: Unerwarteter Adapterabschluá",CR,LF,0
+0075 T 0001 "NET826: /RQB-GrӇe des Ziel-Server zu klein",CR,LF,0
+0076 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0077 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0078 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0079 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0080 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0081 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0082 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0083 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0084 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0085 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0086 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0087 T 0001 "NET???: Unerwarteter Netzwerkfehler",CR,LF,0
+0088 T 0001 "NET825: Netzwerkdatenfehler",CR,LF,0
+XMA2EMS c2e2 0017
+0001 U 0001 "XMA2EMS: Hauptspeichererweiterungsmanager Version 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM 1986 Alle Rechte vorbehalten",CR,LF,"$"
+0002 U 0001 CR,LF,"XMA001 VMO/XMA-Diagnose wird ausgefhrt: ","$"
+0003 U 0001 "XMA002 Diagnose beendet",CR,LF,LF,"$"
+0004 U 0001 "XMA003 Seitenrahmen beginnt bei.................... "
+0005 U 0000 "XXXX",":0",CR,LF,"$"
+0006 U 0001 "XMA004 Seiten im normalen Speicher abgebildet...... "
+0007 U 0000 "0 ",CR,LF,"$"
+0008 U 0001 "XMA005 Seiten reserviert fr Steuerprogramm........ "
+0009 U 0000 "0 ",CR,LF,"$"
+0010 U 0001 "XMA006 Seiten fr Hauptspeichererweit. verfgbar... "
+0011 U 0000 "0 ",CR,LF,"$"
+0012 U 0001 CR,LF,"XMA100 Adapterfehler:",CR,LF," Hauptspeichererweiterungsmanager NICHT installiert",CR,LF,"$"
+0013 U 0001 CR,LF,"XMA200 Adapter nicht gefunden:",CR,LF," Hauptspeichererweiterungsmanager NICHT installiert",CR,LF,"$"
+0014 U 0001 CR,LF,"XMA300 Fehler bei Parametersyntax oder -wert:",CR,LF
+ " Hauptspeichererweiterungsmanager NICHT installiert",CR,LF,"$"
+0015 U 0000 SIZE1_END - 2 -$
+0016 U 0001 4 DUP (?)," KByte OK",CR,LF,"$"
+0017 U 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FILESYS c7bd 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0001 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+FDISK c8ff 0120
+0004 T 0000 "FDISK bei geladenem Netzwerkprogramm nicht m”glich.",CR,LF
+0005 T 0000 "Keine Festplatte vorhanden",CR,LF
+0006 T 0000 "Lesefehler auf der Festplatte",CR,LF
+0007 T 0000 "Schreibfehler auf der Festplatte",CR,LF
+1001 T 0001 "IBM Personal Computer"
+1002 T 0000 "Festplatten-Einrichtungsprogramm 3.30"
+1003 T 0001 "(C)Copyright IBM 1983, 1988"
+1004 T 0000 "FDISK-Men"
+1005 T 0000 "1. <R>Erstellen einer DOS-Partition"
+1006 T 0000 "2. <R>Žndern der aktiven Partition"
+1007 T 0000 "3. <R>L”schen der DOS-Partition"
+1008 T 0000 "4. <R>Anzeigen der Partitionsdaten"
+1009 T 0000 "<H>ESC<R> --> Zurck zu DOS"
+1010 T 0000 "Eine Auswahl angeben:"
+1011 T 0000 "5. <R>N„chste Festplatte ausw„hlen"
+1012 T 0000 "Aktuelles Festplattenlaufwerk: <H><I>"
+1013 T 0001 "ACHTUNG! <R>Keine Partitionen als aktiv markiert - Platte 1 kann nur gestartet"
+1014 T 0001 "werden, wenn eine Partition aktiviert wird"
+1015 T 0000 "Auswahl: [<S> ]"
+1016 T 0001 "Erstellen einer DOS-Partition oder eines logischen DOS-Laufwerks"
+1017 T 0000 "1. <R>Erstellen einer Prim„ren DOS-Partition"
+1018 T 0000 "2. <R>Erstellen einer Erweiterten DOS-Partition"
+1019 T 0000 "3. <R>Erstellen logische(s) DOS-Laufwerk(e) in der Erweiterten DOS-Partition"
+1020 T 0000 "<H>ESC<R> --> Zum FDISK-Men"
+1021 T 0000 "Erstellen einer Prim„ren DOS-Partition"
+1022 T 0001 "Soll der maximal verfgbare Speicherbereich fr die prim„re DOS-Partition"
+1023 T 0001 "verwendet und diese Partition aktiviert werden (<J>/<N>)....? <H>[<S> ]"
+1024 T 0001 "(<J>/<N>)....................? <H>[<S> ]"
+1025 T 0001 "Partitionsstatus Typ GrӇe in MByte Benutzter Speicherbereich in %"
+1026 T 0001 "Gesamtspeicherbereich: <HIIIIR> MByte (1 MByte = 1048576 Byte)"
+1027 T 0000 "Maximal verfgbarer Platz fr Partition: <HIIIIR> MByte (<HIIIIR>)"
+1028 T 0001 "Angabe der PartitionsgrӇe (MByte oder Prozentsatz des Gesamtspeichers) zum"
+1029 T 0001 "Erstellen der prim„ren DOS-Partition.................................: <H>[<IIISI>]"
+1030 T 0000 "Erstellen einer Erweitert. DOS-Partition"
+1031 T 0000 "Erstellen einer Erweitert. DOS-Partition..............................: <H>[<IIISI>]"
+1032 T 0001 "Weiter mit <H>Esc<R>"
+1033 T 0000 "<R>Erstellen logische(s) DOS-Laufwerk(e) in der Erweiterten DOS-Partition"
+1034 T 0001 "Lwk Plattenname MByte System Verwendung"
+1035 T 0001 "GesamtgrӇe der Erweitert. DOS-Partition: <HIIIIR> MByte (1 MByte = 1048576 Byte)"
+1036 T 0000 "Fr logische Laufwerke stehen maximal <HIIIIR> MByte zur Verfgung"
+1037 T 0001 "GrӇe des logischen Laufwerks (MByte oder Prozentsatz Gesamtspeicher) angeben..<H>[<IIISI>]"
+1038 T 0001 "Aktive Partition angeben"
+1039 T 0000 "Geben Sie die zu aktivierende Partition ein .....................: <H>[<S> ]"
+1040 T 0001 "DOS-Partition oder logisches DOS-Laufwerk l”schen"
+1041 T 0000 "1. <R>L”schen einer Prim„ren DOS-Partition"
+1042 T 0000 "2. <R>L”schen einer Erweiterten DOS-Partition"
+1043 T 0000 "3. <R>L”schen logische(s) DOS-Laufwerk(e) in der Erweiterten DOS-Partition"
+1044 T 0000 "L”schen einer Prim„ren DOS-Partition"
+1045 T 0000 "Achtung! <OR>Alle Daten in der Prim„ren DOS-Partition werden gel”scht."
+1046 T 0000 "Fortfahren (<Y>/<N>).................? <H>[<S> ]"
+1047 T 0000 "L”schen einer Erweiterten DOS-Partition"
+1048 T 0000 "Achtung! <OR>Alle Daten in der Erweiterten DOS-Partition werden gel”scht."
+1049 T 0000 "Fortfahren (<Y>/<N>).................? <H>[<S> ]"
+1050 T 0001 "Logische(s) DOS-Laufwerk(e) in der Erweitert. DOS-Partition l”schen"
+1051 T 0001 "Warnung! <OR>Die Daten eines gel”schten logischen DOS-Laufwerks gehen verloren"
+1052 T 0001 "Welches Laufwerk soll gel”scht werden..........................? <H>[<S> ]"
+1053 T 0001 "Sind Sie sicher (<J>/<N>)...........................? <H>[<S> ]"
+1054 T 0001 "Plattenamen eingeben............................? <H>[<S> ]"
+1055 T 0000 "Anzeigen der Partitionsdaten"
+1056 T 0000 "Die Erweiterte DOS-Partition enth„lt logische DOS-Laufwerke"
+1057 T 0001 "Sollen die Angaben ber das logische Laufwerk angezeigt werden (<J>/<N>)......?<H>[<S> ]"
+1058 T 0001 "Anzeigen der Angaben ber das logische DOS-Laufwerk"
+1059 T 0001 "System wird jetzt erneut gestartet"
+1060 T 0000 "System fhrt nun einen Warmstart durch DOS-Diskette in Laufwerk A: einlegen"
+1061 T 0000 "anschlieáend eine Taste bet„tigen <S>"
+1062 T 0000 "Prim„re DOS-Partition gel”scht"
+1063 T 0000 "Erweiterte DOS-Partition gel”scht"
+1064 T 0000 "Laufw. gel”scht"
+1065 T 0000 "Partition <I> aktiviert"
+1066 T 0000 "Prim„re DOS-Partition erstellt"
+1067 T 0000 "Erweiterte DOS-Partition erstellt"
+1068 T 0000 "Logisches DOS-Laufwerk erstellt, Laufwerksnamen ge„ndert bzw. hinzugefgt<W>"
+1069 T 0000 "Keine Partitionen definiert"
+1070 T 0000 "Keine logischen Laufwerke definiert"
+1071 T 0000 "Laufwerksnamen wurden ge„ndert oder gel”scht<W>"
+1072 T 0001 "Laufwerk umgeleitet"
+1073 T 0001 "Prim„re DOS-Partition erstellt, Laufwerksbuchstaben wurden ge„ndert/hinzugefgt."
+1074 T 0000 "Keine Festplatte vorhanden"
+1075 T 0000 "Lesefehler auf der Festplatte",CR,LF
+1076 T 0000 "Schreibfehler auf der Festplatte",CR,LF
+1077 T 0001 "Falsche DOS-Version"
+1078 T 0001 "FDISK bei geladenem Netzwerkprogramm nicht m”glich."
+1079 T 0000 "Keine Prim„re DOS-Partition zum L”schen vorhanden."
+1080 T 0000 "Keine Erweiterte DOS-Partition zum L”schen vorhanden."
+1081 T 0000 "Prim„re DOS-Partition bereits vorhanden."
+1082 T 0000 "Erweiterte DOS-Partition bereits vorhanden."
+1083 T 0000 "Kein Platz zum Erstellen einer DOS-Partition"
+1084 T 0000 "Gewnschte GrӇe fr logisches Laufwerk berschreitet den verfgbaren Speicher.<W>"
+1085 T 0000 "Gewnschte PartitionsgrӇe berschreitet den verfgbaren Speicherbereich auf Festplatte.<W>"
+1086 T 0000 "Keine Partition zum L”schen vorhanden."
+1087 T 0001 "Die fr Systemstarts verfgbare Partition auf Laufwerk 1 ist bereits aktiv.<W>"
+1088 T 0000 "Keine Partitionen zum Aktivieren vorhanden"
+1089 T 0001 "Partition (<I>) ist keine Start-Partition, aktive Partition nicht ge„ndert.<W>"
+1090 T 0000 "Auf Laufwerk 1 ohne Prim„re DOS-"
+1091 T 0000 "Partition keine Erweiterte DOS-Partition m”glich.<W>"
+1092 T 0000 "Der gesamte verfgbare Speicher ist "
+1093 T 0000 "logischen Laufwerken zugeordnet <W>"
+1094 T 0000 "Erweiterte DOS-Partition kann nicht gel”scht werden, w„hrend logische Laufwerke vorhanden sind.<W>"
+1095 T 0000 "Alle logischen Laufwerke in der Erweiterten DOS-Partition gel”scht<W>"
+1096 T 0000 " ist falsch. M”gliche Angaben: <III>."
+1097 T 0001 "Warnung! Von der aktivierten Partition ist kein Systemstart m”glich.<W>"
+1098 T 0001 " Das System kann von den vorhandenen Partitionen nicht gestartet werden."
+1099 T 0000 "Nur Partitionen auf Laufwerk 1 k”nnen aktiviert werden.<W>"
+1100 T 0000 "Maximale Anzahl logischer DOS-Laufwerke installiert.<W>"
+1101 T 0001 "Eine Partition mit der GrӇe 0 kann nicht erstellt werden."
+1102 T 0000 "Logisches Laufwerk <II> bereits gel”scht.\"
+1103 T 0000 "Zugriff auf Laufwerk <I> nicht m”glich<OW>"
+1104 T 0000 "Ungltiger Eintrag, bitte <III> eingeben <W>"
+1105 T 0001 "Prim„re DOS-Partition auf Laufwerk 1 kann nicht gel”scht werden, "
+1106 T 0001 "wenn eine Erweitert. DOS-Partition vorhanden ist.<W>"
+1107 T 0001 "Ungltige Eingabe, Eingabetaste bet„tigen.<W>"
+1108 T 0001 "Fehlende šbereinstimmung bei Angabe des Plattennamens.<W>"
+1109 T 0001 "Ohne Erweitert. DOS-Partition auf dem aktuellen Laufwerk "
+1110 T 0001 "kann kein logisches DOS-Laufwerk erstellt werden.<W>"
+1111 T 0001 "Es sind keine zu l”schenden logischen DOS-Laufwerke vorhanden."
+1112 T 0000 "Nachrichtenfehler <I>, siehe Kopfsatz von FDISKC.MSG zur Fehlerdefinition"
+1113 T 0000 "Interner Fehler"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/holland.msg b/private/mvdm/dos/v86/messages/holland.msg
new file mode 100644
index 000000000..c8ab7c694
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/holland.msg
@@ -0,0 +1,1142 @@
+0007
+COMMON 0006 0038
+0001 T 0001 "Onjuiste DOS versie",CR,LF
+0002 T 0002 "%1 reeds ge‹nstalleerd",CR,LF
+0003 T 0003 "%1 bytes beschikbaar op schijf",CR,LF
+0004 T 0004 "%1 bytes beschikbaar",CR,LF
+0005 T 0005 "%1 bytes in onbruikbare sectoren",CR,LF
+0006 T 0006 "%1 bytes schijfcapaciteit",CR,LF
+0007 T 0007 "%1 bytes totaal geheugen",CR,LF
+0008 T 0008 "%1 bytes in systeembestanden",CR,LF
+0009 T 0009 "%1 ge‹nstalleerd",CR,LF
+0010 T 0010 "%1 niet ge‹nstalleerd",CR,LF
+0011 T 0011 "%1 niet ge‹nstalleerd",CR,LF
+0012 T 0012 "%1 kan niet worden gebruikt voor een netwerkstation",CR,LF
+0013 T 0013 "",
+0014 T 0014 "%1 kan niet worden gebruikt omdat SUBST of ASSIGN actief is",CR,LF
+0015 T 0015 "%1 kan niet worden uitgevoerd",CR,LF
+0016 T 0016 "Vergroot geheugen niet beschikbaar",CR,LF
+0017 T 0017 "FAT beschadigd op schijf in station %1",CR,LF
+0018 T 0018 "Bestand kan niet naar zichzelf worden gekopieerd",CR,LF
+0019 T 0019 "Plaats doeldiskette in station %1",CR,LF
+0020 T 0020 "Onvoldoende schijfruimte",CR,LF
+0021 T 0021 "Ongeldige tekens in volume-label",CR,LF
+0022 T 0022 "Ongeldige codetabel",CR,LF
+0023 T 0023 "Datum of notatie ongeldig",CR,LF
+0024 T 0024 "Tijd of notatie ongeldig",CR,LF
+0025 T 0025 "Ongeldig pad",CR,LF
+0026 T 0026 "Geen bronstation opgegeven",CR,LF
+0027 T 0027 "Geen doelstation opgegeven",CR,LF
+0028 T 0028 "Druk op een toets om verder te gaan . . .",CR,LF
+0029 T 0029 "Bronpad moet worden opgegeven",CR,LF
+0030 T 0030 "Systeem overgezet",CR,LF
+0031 T 0031 "",
+0032 T 0032 "Index kan niet worden gemaakt",CR,LF
+0033 T 0033 "Volume in station %1 heeft geen label",CR,LF
+0034 T 0034 "Volume in station %1 heet %2",CR,LF
+0035 T 0001 "Volume-label (max. 11 tekens): "
+0036 T 0036 "Volume-volgnummer is %1-%2",CR,LF
+0037 T 0037 "Onjuist bestandstype",CR,LF
+0038 U 0001 CR,LF
+EXTEND 072f 0089
+0001 T 0001 "Ongeldige functie",CR,LF
+0002 T 0002 "Bestand niet gevonden",CR,LF
+0003 T 0003 "Pad niet gevonden",CR,LF
+0004 T 0004 "Te veel open bestanden",CR,LF
+0005 T 0005 "Geen toegang ",CR,LF
+0006 T 0006 "Ongeldige ingang",CR,LF
+0007 T 0007 "Geheugenstuurblokken vernietigd",CR,LF
+0008 T 0008 "Onvoldoende geheugen",CR,LF
+0009 T 0009 "Ongeldig geheugenblokadres",CR,LF
+0010 T 0010 "Ongeldige verwerkingsomgeving",CR,LF
+0011 T 0011 "Ongeldige indeling",CR,LF
+0012 T 0012 "Ongeldige parameter",CR,LF
+0013 T 0013 "Ongeldige gegevens",CR,LF
+0014 T 0014 "",
+0015 T 0015 "Ongeldig station opgegeven",CR,LF
+0016 T 0016 "Actieve index kan niet worden verwijderd",CR,LF
+0017 T 0017 "Niet dezelfde eenheid",CR,LF
+0018 T 0018 "Geen bestanden meer",CR,LF
+0019 T 0019 "Schijf heeft schrijfbescherming",CR,LF
+0020 T 0020 "Ongeldige eenheid",CR,LF
+0021 T 0021 "Eenheid of schijf niet gereed ",CR,LF
+0022 T 0022 "Ongeldige eenheid opgegeven",CR,LF
+0023 T 0023 "Gegevensfout",CR,LF
+0024 T 0024 "Parameters ongeldig voor opgegeven eenheid",CR,LF
+0025 T 0025 "Zoekfout",CR,LF
+0026 T 0026 "Ongeldig medium",CR,LF
+0027 T 0027 "Sector niet gevonden ",CR,LF
+0028 T 0028 "Geen papier in printer ",CR,LF
+0029 T 0029 "DOS kan gegevens niet wegschrijven ",CR,LF
+0030 T 0030 "DOS kan gegevens niet inlezen",CR,LF
+0031 T 0031 "Algemene storing",CR,LF
+0032 T 0032 "Inbreuk op gemeenschappelijk gebruik ",CR,LF
+0033 T 0033 "Inbreuk op geblokkeerd bestand ",CR,LF
+0034 T 0034 "Verwisselen van schijf ongeldig",CR,LF
+0035 T 0035 "FCB niet beschikbaar",CR,LF
+0036 T 0036 "Systeemfaciliteiten uitgeput",CR,LF
+0037 T 0037 "Onjuiste combinatie van codetabellen",CR,LF
+0038 T 0038 "Geen invoer meer mogelijk",CR,LF
+0039 T 0039 "Onvoldoende schijfruimte",CR,LF
+0040 T 0040 "",
+0041 T 0041 "",
+0042 T 0042 "",
+0043 T 0043 "",
+0044 T 0044 "",
+0045 T 0045 "",
+0046 T 0046 "",
+0047 T 0047 "",
+0048 T 0048 "",
+0049 T 0049 "",
+0050 T 0050 "Aanvraag niet ondersteund door bestandssysteem",CR,LF
+0051 T 0051 "Aansluiting op bestandssysteem niet mogelijk",CR,LF
+0052 T 0052 "Naam bestandssysteem bestaat reeds",CR,LF
+0053 T 0053 "Naam bestandssysteem niet gevonden",CR,LF
+0054 T 0054 "Bestandssysteem bezet",CR,LF
+0055 T 0055 "Opgegeven eenheid voor bestandssysteem bestaat niet meer",CR,LF
+0056 T 0056 "Faciliteiten bestandssysteem uitgeput",CR,LF
+0057 T 0057 "Apparatuurfout gevonden door bestandssysteem",CR,LF
+0058 T 0058 "Onjuiste respons van bestandssysteem",CR,LF
+0059 T 0059 "Onverwachte fout gevonden door bestandssysteem",CR,LF
+0060 T 0060 "Bestandssysteem niet uitwisselbaar",CR,LF
+0061 T 0061 "Maximale aantal uitvoerbestanden overschreden",CR,LF
+0062 T 0062 "Beschikbare ruimte voor uitvoerbestanden overschreden",CR,LF
+0063 T 0063 "Uitvoerbestand bestaat niet meer",CR,LF
+0064 T 0064 "Naam bestandssysteem bestaat niet meer",CR,LF
+0065 T 0065 "Geen toegang",CR,LF
+0066 T 0066 "Ongeldig type eenheid voor bestandssysteem",CR,LF
+0067 T 0067 "Bestandssysteem niet gevonden",CR,LF
+0068 T 0068 "Faciliteiten bestandssysteem uitgeput",CR,LF
+0069 T 0069 "Faciliteiten bestandssysteem uitgeput",CR,LF
+0070 T 0070 "Eenheid bestandssysteem nu niet beschikbaar",CR,LF
+0071 T 0071 "Aanvraag voor bestandssysteem afgewezen",CR,LF
+0072 T 0072 "Eenheid bestandssysteem onderbroken",CR,LF
+0073 T 0073 "Component van bestandssysteem niet beschikbaar",CR,LF
+0074 T 0074 "Onverwachte fout gevonden door bestandssysteem",CR,LF
+0075 T 0075 "Onverwachte fout gevonden door bestandssysteem",CR,LF
+0076 T 0076 "",
+0077 T 0077 "",
+0078 T 0078 "",
+0079 T 0079 "",
+0080 T 0080 "Bestand bestaat reeds",CR,LF
+0081 T 0081 "",
+0082 T 0082 "Index kan niet worden gemaakt",CR,LF
+0083 T 0083 "Fail requested to Critical Error",CR,LF
+0084 T 0084 "Te veel aansluitingen",CR,LF
+0085 T 0085 "Eenheid of bestand reeds aangesloten",CR,LF
+0086 T 0086 "Ongeldig wachtwoord",CR,LF
+0087 T 0087 "Ongeldige parameter",CR,LF
+0088 T 0088 "Gegevensfout in bestandssysteem",CR,LF
+0089 T 0089 "Functie niet ondersteund door bestandssysteem",CR,LF
+PARSE 1719 0011
+0001 T 0001 "Te veel parameters opgegeven",CR,LF
+0002 T 0002 "Vereiste parameter ontbreekt",CR,LF
+0003 T 0003 "Ongeldig wisselteken",CR,LF
+0004 T 0004 "Ongeldig trefwoord",CR,LF
+0005 T 0005 "",
+0006 T 0006 "Waarde parameter buiten voorgeschreven bereik",CR,LF
+0007 T 0007 "Waarde parameter ongeldig",CR,LF
+0008 T 0008 "Waarde parameter ongeldig",CR,LF
+0009 T 0009 "Indeling parameters onjuist",CR,LF
+0010 T 0010 "Ongeldige parameter",CR,LF
+0011 T 0011 "Onjuiste combinatie van parameters",CR,LF
+IBMBIO 1927 0018
+0003 T 0003 13,10,"Onbekende opdracht in CONFIG.SYS"
+0004 T 0004 13,10,"$"
+0005 T 0005 13,10,"Sector te groot in bestand $"
+0006 T 0006 13,10,"$ ontbreekt of kon niet worden geladen"
+0007 T 0007 "COMMAND.COM",0
+0008 T 0008 13,10,"Ongeldige landaanduiding of codetabel",13,10,"$"
+0009 T 0009 13,10,"Fout in COUNTRY-opdracht",13,10,"$"
+0010 T 0000 13,10, "Onvoldoende geheugen voor COUNTRY.SYS",13,10,"$"
+0011 T 0011 13,10,"Configuratie te groot voor het geheugen",13,10,"$"
+0012 T 0012 13,10,"Te veel stations",13,10,"$"
+0013 T 0013 13,10,"Ongeldige STACK-parameters",13,10,"$"
+0014 T 0014 13,10,"Onjuiste volgorde in CONFIG.SYS, regel:","$"
+0015 T 0015 "Foutieve opdracht in CONFIG.SYS, regel:","$"
+0016 T 0016 13,10,"Fout bij toewijzen geheugen $"
+0017 T 0017 0DH,0AH,7,0DH,0AH, "Interne stack-ruimte overschreden",0DH,0AH
+ "Systeemfuncties gestopt",0DH,0AH,"$"
+0020 T 0020 13,10,"Plaats diskette in station "
+0021 T 0021 "A: ",13,10,"en druk op een toets om verder te gaan",13,10,10,0
+0022 T 0022 13,10,"Opdracht of parameters onjuist - $"
+BOOT 1d60 0001
+0001 T 0001 13,10,"Geen systeemschijf of schijffout",13,10
+ "Vervang schijf en druk op een toets",13,10,0
+DBCSDOS 1de0 0000
+IBMDOS 1df4 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1e33 0091
+0201 T 0201 "A" ;AC000;
+0202 T 0202 "H" ;AC000;
+0203 T 0203 "N" ;AC000;
+0204 T 0204 "O" ;AC000;
+0205 T 0205 "J" ;AC000;
+0206 T 0206 "N" ;AC000;
+0210 T 0210 "Afbreken" ;AC000;
+0211 T 0211 ", Herhalen" ;AC000;
+0212 T 0212 ", Negeren" ;AC000;
+0213 T 0213 ", Overslaan" ;AC000;
+0214 T 0214 "?" ;AC000;
+0215 T 0215 "bij lezen van",0 ;AC000;
+0216 T 0216 "bij schrijven naar",0 ;AC000;
+0217 T 0217 "%1 station %2",CR,LF ;AC000;
+0218 T 0218 "%1 eenheid %2",CR,LF ;AC000;
+0219 T 0219 "Plaats volume %1 volgnummer %2-%3",CR,LF ;AC009;
+0221 T 0221 "Ongeldige COMMAND",CR,LF ;AC000;
+0222 T 0222 "Plaats diskette met %1 in station %2",CR,LF ;AC000;
+0224 T 0001 CR,LF,"Batch-programma be‰indigen (J/N) ? " ;AC000;
+0225 T 0225 "%1 kan niet worden uitgevoerd",CR,LF ;AC000;
+0226 T 0226 "Fout in .EXE-bestand",CR,LF ;AC000;
+0227 T 0227 "Programma te groot voor het geheugen",CR,LF ;AC000;
+0228 T 0228 CR,LF,"Geen bestandsingang beschikbaar" ;AC000;
+0229 T 0229 "Opdracht of bestandsnaam onjuist",CR,LF ;AC000;
+0231 T 0231 CR,LF,"Fout bij toewijzen geheugen" ;AC000;
+0232 T 0232 CR,LF,"COMMAND kan niet worden geladen, systeemfuncties gestopt",CR,LF;AC000;
+0233 T 0233 CR,LF,"COMMAND kan niet worden gestart",CR,LF ;AC000;
+0234 T 0234 CR,LF,"Proces afgebroken, opstarten kan niet worden voortgezet",CR,LF;AC000;
+0235 T 0235 CR,LF ;AC000;
+0463 T 0463 "Onvoldoende ruimte in verwerkingsomgeving",CR,LF ;AC000;
+0464 T 0464 CR,LF,"IBM Personal Computer DOS",CR,LF
+ "Versie 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF ;AC000;
+0465 T 0465 "Ongeldige zoekindex voor COMMAND",CR,LF
+0466 T 0466 "Ongeldige zoekindex voor COMMAND - geen toegang",CR,LF
+1002 T 1002 "Bestandsnaam bestaat reeds of bestand niet gevonden",CR,LF ;AC000;
+1003 T 1003 "Pad of bestandsnaam ongeldig",CR,LF ;AC000;
+1007 T 1007 "Onvoldoende ruimte in verwerkingsomgeving",CR,LF ;AC000;
+1008 T 1008 "Fout bij maken bestand",CR,LF ;AC000;
+1009 T 1009 "Batch-bestand ontbreekt",CR,LF ;AC000;
+1010 T 1010 CR,LF,"Plaats schijf met batch-bestand",CR,LF ;AC000;
+1011 T 1011 "Opdracht of bestandsnaam onjuist",CR,LF ;AC000;
+1016 T 1016 "Inhoud doelbestand v¢¢r het kopi‰ren verloren gegaan",CR,LF ;AC000;
+1017 T 1017 "Bestandsnaam ongeldig of bestand niet gevonden",CR,LF ;AC000;
+1018 T 1018 "%1 bestand(en) gekopieerd",CR,LF ;AC000;
+1019 T 1019 "%1 bestand(en) " ;AC000;
+1022 T 1022 "Codetabel %1 niet gedefinieerd voor dit systeem",CR,LF ;AC000;
+1023 T 1023 "Codetabel %1 niet gedefinieerd voor alle eenheden",CR,LF ;AC000;
+1024 T 1024 "Actieve codetabel: %1",CR,LF ;AC000;
+1025 T 1025 "NLSFUNC niet ge‹nstalleerd",CR,LF ;AC000;
+1027 T 1027 "Actief station is niet meer geldig" ;AC000;
+1029 T 1029 "Label niet gevonden",CR,LF ;AC000;
+1030 T 1030 "Syntaxisfout",CR,LF ;AC000;
+1032 T 1032 "Datum is nu ingesteld op %1 %2",CR,LF ;AC000;
+1033 T 1033 "zo ma di wo do vr za " ;AC000;
+1034 T 1034 "Voer nieuwe datum in (%1): "
+1036 T 1036 "Tijd is nu ingesteld op %1",CR,LF ;AC000;
+1037 T 1037 "Voer nieuwe tijd in: "
+1038 T 1038 ", Wissen (J/N)?" ;AC000;
+1039 T 1039 "Alle bestanden in de index zullen worden gewist!",CR,LF
+ "Weet u het zeker (J/N)?" ;AC000;
+1040 T 1040 "IBM Personal Computer DOS Versie %1.%2",CR,LF ;AC000;
+1044 T 1044 "Ongeldige index",CR,LF ;AC000;
+1046 T 1046 "Ongeldig pad, geen index",CR,LF,"of index niet leeg",CR,LF ;AC000;
+1047 T 1047 "ON/OFF moet worden opgegeven",CR,LF ;AC000;
+1048 T 1048 "Index van %1",CR,LF ;AC000;
+1049 T 1049 "Geen pad",CR,LF ;AC000;
+1050 T 1050 "Ongeldig station in zoekopdracht",CR,LF ;AC000;
+1051 T 1051 "Ongeldige eenheid",CR,LF ;AC000;
+1052 T 1052 "FOR kan niet worden genest",CR,LF ;AC000;
+1053 T 1053 "Fout in tussenbestand tijdens sluizen",CR,LF ;AC000;
+1054 T 1054 "Binair lezen vanaf eenheid niet mogelijk",CR,LF ;AC000;
+1055 T 1055 "BREAK is %1 ",CR,LF ;AC000;
+1056 T 1056 "VERIFY is %1 ",CR,LF ;AC000;
+1057 T 1057 "ECHO is %1 ",CR,LF ;AC000;
+1059 T 1059 "off",0 ;AC000;
+1060 T 1060 "on",0 ;AC000;
+1061 T 1061 "Fout bij schrijven naar eenheid",CR,LF ;AC000;
+1063 T 1063 "%1" ;AC000;
+1064 T 1064 "%1" ;AC000;
+1065 T 1065 "%1" ;AC000;
+1066 T 1066 "%1" ;AC000;
+1067 T 1067 9 ;AC000;
+1068 T 1068 " <DIR> " ;AC000;
+1069 T 1069 8," ",8 ;AC000;
+1070 T 1070 CR,LF ;AC000;
+1071 T 1071 "%1" ;AC000;
+1072 T 1072 "mm-dd-jj" ;AC000;
+1073 T 1073 "dd-mm-jj" ;AC000;
+1074 T 1047 "jj-mm-dd" ;AC000;
+1075 T 1075 "%1 %2" ;AC000;
+1076 T 1076 "%1" ;AC000;
+1077 T 0001 " %1 %2" ;AC000;
+1078 T 1078 "Index bestaat reeds",CR,LF ;AC000;
+ATTRIB 35a3 0016
+0004 T 0004 "Onjuist aantal parameters",CR,LF
+0005 T 0005 "Ongeldig pad of bestand niet gevonden",CR,LF
+0006 T 0006 "Syntaxisfout",CR,LF
+0008 T 0008 " %1"
+0009 T 0009 "%1 %2",CR,LF
+0010 T 0010 "%1",CR,LF,"%2",CR,LF
+0011 T 0011 "%1, onjuiste combinatie van codetabellen",CR,LF,"Weet u het zeker (J/N)?"
+0012 T 0012 "%1",CR,LF
+0014 T 0014 CR,LF
+0015 T 0015 "Ongeldige waarde voor bestandstype",CR,LF
+0199 T 0199 "Fout in uitgebreid bestandskenmerk",CR,LF
+0201 T 0201 "Naam uitgebreid bestandskenmerk niet gevonden",CR,LF
+0204 T 0204 "Naam uitgebreid bestandskenmerk kan niet worden ingesteld",CR,LF
+0205 T 0205 "Naam uitgebreid bestandskenmerk bekend, maar niet ondersteund door dit systeem",CR,LF
+0206 T 0206 "Onjuiste combinatie van uitgebreide bestandskenmerken",CR,LF
+0208 T 0208 "Waarde uitgebreid bestandskenmerk niet ondersteund",CR,LF
+ASSIGN 3914 0001
+0002 T 0002 "Oorspronkelijk station %1: heet nu %2:",cr,lf
+CHKDSK 3964 0063
+0003 T 0003 "Verspreide ketens converteren naar bestanden (J/N) ?" ;freemes
+0004 T 0004 "Onherstelbare fout in index" ;ptrandir
+0005 T 0005 "Index naar bestand converteren (J/N) ?" ;ptrandir2
+0007 T 0007 "%1 bytes totale schijfruimte" ;dskspc
+0008 T 0008 "%1 bytes in onbruikbare sectoren" ;badspc
+0009 T 0009 "%1 bytes in %2 verborgen bestanden" ;hidmes
+0010 T 0010 "%1 bytes in %2 indexen" ;dirmes
+0011 T 0011 "%1 bytes in %2 gebruikersbestanden" ;filemes
+0012 T 0012 "%1 bytes in %2 teruggevonden bestanden" ;orphmes2
+0013 T 0013 "%1 bytes zouden beschikbaar komen in %2 teruggevonden bestanden" ;orphmes3
+0014 T 0014 "%1 bytes beschikbaar op schijf" ;frespc
+0015 T 0015 "%1 totaal bytes geheugen" ;totmem
+0016 T 0016 "%1 bytes beschikbaar" ;fremem
+0017 T 0017 "CHKDSK kan niet worden gebruikt voor een netwerkstation" ;no_net_arg
+0018 T 0018 "CHKDSK kan niet worden gebruikt omdat SUBST of ASSIGN actief is" ;SubStErr
+0019 T 0019 "Waarschijnlijk geen DOS-schijf",CR,LF,"Doorgaan (J/N) ?" ;badidbyt
+0020 T 0020 "Schijffout bij lezen van FAT %1",CR,LF ;badr
+0021 T 0021 "Index %1" ;direc_arg
+0022 T 0022 "%1 bevat %2 niet-aaneengesloten blokken" ;extent_arg
+0023 T 0023 "Alle opgegeven bestanden zijn aaneengesloten" ;noext_arg
+0024 T 0024 "Fouten gevonden. Parameter /F niet opgegeven:",CR,LF,"correcties worden niet naar schijf geschreven" ;fixmes_arg
+0025 T 0025 " Verwerking kan niet worden voortgezet %1%2" ;fatal_arg
+0026 T 0026 " FAT beschadigd op schijf in station %1" ;badrdmes
+0029 T 0029 " CHDIR .. mislukt, andere methode wordt geprobeerd" ;cdddmes
+0030 T 0030 " Heeft een ongeldige cluster, bestand afgekapt" ;badchain
+0031 T 0031 " Ongeldige informatie in subindex" ;badsubdir
+0032 T 0032 " Bestaat niet" ;ndotmes
+0033 T 0033 " Nummer eerste cluster is ongeldig, bestand afgekapt" ;nulnz
+0034 T 0034 " Fout in toewijzing, grootte aangepast" ;badclus
+0035 T 0035 " Ingang . kan niet worden teruggevonden, verwerking voortgezet" ;norecdot
+0036 T 0036 " Index is geheel leeg, ook geen . of .." ;nuldmes
+0037 T 0037 " Index samengevoegd" ;joinmes
+0038 T 0038 " Ingang .. kan niet worden teruggevonden" ;norecddot
+0039 T 0039 " Ingang heeft een foutieve verbinding" ;norecddot1
+0040 T 0040 " Ingang heeft een foutief bestandskenmerk" ;norecddot2
+0041 T 0041 " Ingang heeft een foutieve grootte" ;norecddot3
+0042 T 0042 " Is kruiselings gekoppeld met cluster %1" ;cross_arg
+0043 T 0043 " CHDIR naar %1 niet mogelijk,",CR,LF,"voorbij dit punt niet uitgevoerd" ;badtarg_ptr
+0044 T 0044 " voorbij dit punt niet uitgevoerd" ;badtarg2
+0045 T 0045 "%1 bytes schijfruimte vrijgemaakt" ;freebymes1
+0046 T 0046 "%1 bytes schijfruimte zou worden vrijgemaakt" ;freebymes2
+0047 T 0047 "Schijf %1 is gemaakt op %2 %3",CR,LF ;idmes_arg
+0048 T 0048 "%1 totaal aantal ketens op schijf"
+0049 T 0049 "%1 bytes in elke keten" ;idmes2
+0050 T 0050 "CHKDSK niet beschikbaar op station %1" ;msgExecFailure
+0051 T 0051 " Ongeldige clusters in uitgebreide bestandskenmerken, bestandskenmerken afgekapt" ;Inv_XA_Msg
+0052 T 0052 " Fout in toewijzing uitgebreide bestandskenmerken, bestandskenmerken afgekapt" ;Alloc_XA_Msg
+0053 T 0053 "Ongeldige parameter" ;badsw_arg
+0055 T 0055 "Pad niet gevonden" ;invpath_arg
+0056 T 0056 "Bestand niet gevonden" ;opnerr_arg
+0058 T 0058 " %1 verspreide clusters gevonden in %2 ketens" ;orph_arg
+0059 T 0059 CR,LF ;crlf_arg
+0060 T 0060 " CHDIR naar hoofdindex niet mogelijk",CR,LF ;badcd_arg
+0061 T 0061 " Schijffout bij schrijven naar FAT %1" ;badw_arg
+0062 T 0062 " %1" ;noisy_arg
+0063 T 0063 "Actieve index is niet bruikbaar" ;baddpbdir
+0064 T 0064 "%1",CR,LF ;file_arg
+0065 T 0065 " Onvoldoende ruimte in hoofdindex.",CR,LF," Wis bestanden uit hoofdindex en herhaal CHKDSK" ;creatmes
+0066 T 0066 "%1 %2 %3" ;eup_arg
+0067 T 0067 "%1 %2, %3" ;usp_arg
+0068 T 0068 "%1%2%3%4%5" ;oth_arg
+0069 T 0069 "%1%2%3%4" ;time_arg
+0070 T 0070 "%1 ketens beschikbaar op schijf" ;idmes2 ;an017;bgb
+DEBUG 4d53 0062
+0004 T 0004 "Toewijzing mislukt of opgegeven waarde buffer te klein",CR,LF
+0005 T 0005 "Msg info ontbreekt of is onjuist",CR,LF
+0006 T 0006 "Foutieve naam eenheid" ;baddev_ptr
+0007 T 0007 "Kan uitvoereenheid PRN niet openen",CR,LF
+ "Voer naam van uitvoereenheid in " ;badlstmes_ptr
+0008 T 0008 CR,LF ;crlf_ptr
+0009 T 0009 CR,LF,"Programma normaal be‰indigd",CR,LF
+0010 T 0010 "Ongeldig station opgegeven" ;nambad_ptr
+0012 T 0012 "Fout bij maken bestand" ;noroom_ptr
+0013 T 0013 "Onvoldoende schijfruimte" ;nospace_ptr
+0014 T 0014 "Schijffout bij lezen van station %1" ;dr1_ptr
+0015 T 0015 "Schijffout bij schrijven naar station %1" ;dr2_ptr
+0016 T 0016 "Fout bij het lezen van station %1 - schijf heeft schrijfbescherming" ;dr3_ptr
+0017 T 0017 "Fout bij het schrijven naar station %1 - schijf heeft schrijfbescherming" ;dr4_ptr
+0019 T 0019 "%1^Fout" ;synerr
+0020 T 0020 "Fout in .EXE- of .HEX-bestand" ;exebad_ptr/hexerr_ptr
+0021 T 0021 "Bestandstypen .EXE en .HEX kunnen niet worden weggeschreven" ;exewrt_ptr/hexwrt_ptr
+0022 T 0022 "EXEC niet uitgevoerd" ;execemes_ptr
+0023 T 0023 "Schrijffout, geen bestemming opgegeven" ;nonamespec_ptr
+0024 T 0024 "Geen toegang" ;accmes_ptr
+0025 T 0025 "Pariteitsfout of geheugen niet aanwezig" ;paritymes_ptr
+0026 T 0026 "-" ;prompt_ptr
+0027 T 0027 "%1 -" ;change_flag_ptr
+0032 T 0032 "%1%2" ;unassem_ln_ptr
+0033 T 0033 "%1:%2 %3" ;hex_ptr
+0034 T 0034 "%1 %2" ;add_ptr
+0035 T 0035 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0036 "%1=%2 " ;register_ptr
+0037 T 0037 "%1fout" ;errmes_ptr
+0038 T 0038 "%1 bytes worden weggeschreven" ;wrtmes_ptr
+0039 T 0039 "%1:%2=" ;loc_ptr
+0040 T 0040 "%1" ;little_ptr
+0041 T 0041 "%1" ;big_ptr
+0042 T 0042 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0043 "%1fout %2 station %3" ;dskerr_ptr
+0044 T 0044 32,8 ;bacmes_ptr
+0045 T 0045 "Toewijzing voor berichtenprogramma niet mogelijk",CR,LF ;fatal_error
+0046 T 0046 "%1" ;arg_buf_ptr
+0047 T 0047 "%1" ;one_char_buf_ptr
+0050 T 0050 "%1 van totaal %2 EMS-pagina's toegewezen",cr,lf
+0051 T 0051 "%1 van totaal %2 EMS-ingangen toegewezen",cr,lf
+0054 T 0054 "Paginakader = "
+0055 T 0055 "Gemaakte ingang = %1 ",cr,lf
+0056 T 0056 "Logische pagina %1 overgezet naar fysieke pagina %2 ",cr,lf
+0057 T 0057 "Storing in EMS hardware/software",cr,lf
+0058 T 0058 "Ingang niet gevonden",cr,lf
+0059 T 0059 "Ongeldige functiecode",cr,lf
+0060 T 0060 "Geen ingangen beschikbaar",cr,lf
+0061 T 0061 "Fout bij opslaan/terugzetten",cr,lf
+0062 T 0062 "Maximum aantal pagina's overschreden",cr,lf
+0063 T 0063 "Maximum aantal beschikbare pagina's overschreden",cr,lf
+0064 T 0064 "Ongeldige parameter",cr,lf
+0065 T 0065 "Logische pagina ligt buiten beschikbaar bereik",cr,lf
+0066 T 0066 "Fysieke pagina ligt buiten beschikbaar bereik",cr,lf
+0067 T 0067 "Opslaggebied is reeds in gebruik",cr,lf
+0068 T 0068 "Opslaggebied is niet in gebruik",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0071 "EMS-parameter is ongeldig of ontbreekt",cr,lf
+0072 T 0072 "%2 pagina's toegewezen aan ingang %1",cr,lf
+0074 T 0074 "Terugzetten EMS voltooid",cr,lf
+0075 T 0075 "Fysieke pagina %1 = Kaderonderdeel %2",cr,lf
+0076 T 0076 "Ingang %1 vrijgegeven",cr,lf
+0078 T 0078 "EMS niet ge‹nstalleerd",cr,lf
+DRIVER 5cb4 0002
+0002 T 0001 "Geen station opgegeven",CR,LF
+0003 T 0001 "Stuurprogramma geladen voor extern station %1",CR,LF
+EDLIN 5d37 0028
+0006 T 0006 "*" ;prompt_ptr
+0007 T 0007 "Station of bestandsnaam ongeldig",CR,LF ;baddrv_ptr
+0008 T 0008 "Bestandsnaam moet worden opgegeven",CR,LF ;ndname_ptr
+0009 T 0009 "Ongeldige parameter",CR,LF ;opt_err_ptr
+0010 T 0010 "Bestand kan alleen worden gelezen",CR,LF ;ro_err_ptr
+0011 T 0011 "Fout bij maken bestand",CR,LF ;bcreat_ptr
+0012 T 0012 "Te veel open bestanden",CR,LF ;too_many_ptr
+0013 T 0013 "Leesfout in:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0014 "Een .BAK-bestand kan niet worden gewijzigd",CR,LF,"Wijzig bestandsnaam",CR,LF ;nobak_ptr
+0015 T 0015 "Geen ruimte in index voor bestand",CR,LF ;nodir_ptr
+0016 T 0016 "Schijf vol. Wijzigingen zijn verloren",CR,LF ;dskful_ptr
+0017 T 0017 "Bestand niet gevonden",CR,LF ;filenm_ptr
+0018 T 0018 "Invoerfout",CR,LF ;badcom_ptr
+0019 T 0019 "Nieuw bestand",CR,LF ;newfil_ptr
+0020 T 0020 "Niet gevonden",CR,LF ;nosuch_ptr
+0021 T 0021 "O.K.? " ;ask_ptr
+0022 T 0022 "Regel te lang",CR,LF ;toolng_ptr
+0023 T 0023 "Einde invoerbestand",CR,LF ;eof_ptr
+0024 T 0024 "Afbreken zonder opslaan (J/N) ?" ;qmes_ptr
+0025 T 0025 "Nummer van bestemmingsregel moet worden opgegeven",CR,LF ;dest_ptr
+0026 T 0026 "Niet genoeg ruimte om bestand volledig samen te voegen",CR,LF ;mrgerr_ptr
+0027 T 0027 CR,LF ;crlf_ptr
+0028 T 0028 LF ;lf_ptr
+0029 T 0029 "Doorgaan (J/N) ?" ;cont_ptr
+0030 T 0030 "Bericht kan niet worden afgedrukt",CR,LF ;fatal_error
+0031 T 0031 "%1" ;arg_buf_ptr
+0032 T 0032 "%1:%2" ;line_num_buf_ptr
+0033 T 0033 "Kan niet worden samengevoegd - onjuiste combinatie van codetabellen",CR,LF ;cp_err_ptr
+EXE2BIN 64ff 0010
+0002 T 0002 "Onvoldoende geheugen",CR,LF
+0003 T 0003 "Berichten niet gevonden",CR,LF
+0004 T 0004 "Geen toegang",CR,LF
+0005 T 0005 "Bestand kan niet worden geconverteerd",CR,LF
+0006 T 0006 "Bestand niet gevonden",CR,LF
+0007 T 0007 "Fout bij maken bestand",CR,LF
+0008 T 0008 "Fix-ups needed - base segment (hex):"
+0009 T 0009 "Ongeldige parameter",CR,LF
+0011 T 0011 "WARNING - Leesfout van EXE bestand.",CR,LF
+ "Amount read is less than size in header.",CR,LF
+0012 T 0012 "Bestandsnaam moet worden opgegeven",CR,LF
+FIND 671f 0001
+0004 T 0004 "FIND: "
+FORMAT 6749 0044
+0002 T 0002 CR,"%1 procent van de schijf ingedeeld"
+0004 T 0004 CR,"Indelen voltooid ",CR,LF
+0007 T 0007 "Plaats nieuwe diskette in station %1:",CR,LF
+0009 T 0009 "Plaats de diskette terug in station %1:",CR,LF
+0010 T 0010 "Volume-label (max. 11 tekens) ? "
+0011 T 0011 CR,"Indelen niet mogelijk in station %1:", CR,LF
+0012 T 0012 CR,"Stuurprogramma voor eenheid bevat ongeldige parameters",CR,LF
+0013 T 0013 CR,"Fout in IOCTL-opdracht ",CR,LF
+0014 T 0014 CR,"Geen schijfstation ",CR,LF
+0015 T 0015 CR,"Fout bij vastleggen van de FAT ",CR,LF
+0016 T 0016 CR,"Fout bij vastleggen van de index",CR,LF
+0017 T 0017 CR,"Station kan niet worden ingedeeld omdat ASSIGN of SUBST actief is",CR,LF
+0018 T 0018 CR,"DOS kan systeembestanden niet vinden",CR,LF
+0019 T 0019 CR,"Een netwerkstation kan niet worden ingedeeld",CR,LF
+0020 T 0020 CR,"Ongeldige tekens in volume-label ",CR,LF
+0021 T 0021 CR,"Parameters niet mogelijk",CR,LF
+0022 T 0022 CR,"Indelen afgebroken ",CR,LF
+0023 T 0023 CR,"Schijf kan niet worden gebruikt als systeemschijf",CR,LF
+0024 T 0024 CR,"Ongeldig medium of spoor 0 beschadigd - schijf onbruikbaar",CR,LF
+0025 T 0025 CR,"BOOT-record kan niet worden vastgelegd ",CR,LF
+0026 T 0026 CR,"Fout bij lezen van de index",CR,LF
+0028 T 0028 CR,"en druk op ENTER om verder te gaan..."
+0029 T 0029 CR,"Ongeldige volume-ID ",CR,LF
+0031 T 0031 CR,"Voer het huidige volume-label in van station %1: "
+0032 T 0032 CR,"Parameters niet geldig",CR,LF,"voor vaste schijf",CR,LF
+0035 T 0035 CR,"Fout bij lezen van de partitietabel",CR,LF
+0037 T 0037 CR,"Indeling verstoord",CR,LF
+0038 T 0038 CR,"FORMAT niet beschikbaar op station %1",CR,LF
+0039 T 0039 CR,"Geen systeemschijf of schijffout",CR,LF
+0040 T 0040 CR,"Ongeldige partitietabel ",CR,LF
+0041 T 0041 CR,"Parameters niet mogelijk voor station",CR,LF
+0042 T 0042 CR,LF
+0043 T 0043 CR,LF,LF
+0044 T 0044 CR,"Plaats DOS-schijf in station %1:",CR,LF
+0045 T 0045 CR,LF,"WAARSCHUWING, ALLE INFORMATIE OP VASTE SCHIJF",CR,LF
+ "IN STATION %1: ZAL VERLOREN GAAN!",CR,LF
+ "Starten met indelen (J/N) ?"
+0046 T 0046 CR,"Nog een schijf indelen (J/N) ?"
+0047 T 0047 CR,"Fout bij lezen van de partitietabel",CR,LF
+0048 T 0048 CR,"Fout bij vastleggen van de partitietabel",CR,LF
+0049 T 0049 CR,"Parameters kunnen niet worden gecombineerd", CR,LF
+0050 T 0050 "%1 ketens beschikbaar op schijf",CR,LF
+0051 T 0051 "%1 bytes in elke keten",CR,LF
+0052 T 0052 CR, "Fout bij vastleggen van de partitietabel",CR,LF
+0053 T 0053 CR,"Zelfde parameter twee keer opgegeven",CR,LF
+0054 T 0054 CR,"Parameters /T en /N moeten allebei worden opgegeven",CR,LF ;AN009;
+JOIN 7240 0001
+0002 T 0002 CR,LF,"Index niet leeg",CR,LF
+MORE 727f 0001
+0002 T 0002 "-- Vervolg --"
+PRINT 72b0 0022
+0002 T 0002 CR,LF
+0006 T 0006 " fout bij inlezen van bestand",CR,LF,"$"
+0007 T 0007 "Bestand niet gevonden",CR,LF,"$"
+0008 T 0008 CR,LF,LF,"Bestand $"
+0009 T 0009 " geannuleerd door operator$"
+0010 T 0010 CR,LF,LF,"Alle bestanden geannuleerd door operator$"
+0011 T 0011 "FAT beschadigd op schijf in station "
+0012 T 0012 "A:",CR,LF,"$"
+0013 T 0013 "Ongeldige uitvoereenheid voor PRINT",CR,LF
+0014 T 0014 "Resident gedeelte van PRINT ge‹nstalleerd",CR,LF
+0015 T 0015 "PRINT kan niet worden gebruikt - gebruik NET PRINT",CR,LF
+0017 T 0017 "PRINT-wachtrij is vol",CR,LF
+0018 T 0018 "PRINT-wachtrij is leeg",CR,LF
+0019 T 0019 "Geen toegang",CR,LF
+0020 T 0020 "Ongeldig station opgegeven",CR,LF
+0021 T 0021 "Foutmelding in uitvoereenheid geeft aan dat de eenheid",CR,LF
+ "mogelijk niet online is. Controleer de eenheid",CR,LF
+0022 T 0022 CR,LF,LF," %1 wordt nu afgedrukt",CR,LF
+0023 T 0023 " %1 staat in de wachtrij",CR,LF
+0024 T 0024 "%1 niet gevonden",CR,LF
+0025 T 0001 "Padnaam te lang",CR,LF
+0026 T 0001 "Bestand staat niet in de PRINT-wachtrij",CR,LF
+0027 T 0027 "Naam van uitvoereenheid [PRN]: "
+RECOVER 7726 0012
+0002 T 0002 CR,LF,"Bestand niet gevonden",CR,LF ;File not found
+0003 T 0003 CR,LF,"RECOVER kan niet worden gebruikt omdat ASSIGN of SUBST actief is",CR,LF
+0004 T 0004 CR,LF,"Station of bestandsnaam ongeldig",CR,LF
+0005 T 0005 CR,LF,"Waarschuwing - index is vol",CR,LF
+0006 T 0006 CR,LF,"RECOVER kan niet worden gebruikt voor een netwerkstation", CR,LF ;Cannot %1 a Network drive
+0007 T 0007 CR,LF,"RECOVER niet beschikbaar op station %1",CR,LF
+0008 T 0008 CR,LF,"%1 bestand(en) teruggevonden",CR,LF
+0009 T 0009 CR,LF,"%1 van %2 bytes hersteld",CR,LF
+0010 T 0010 CR,LF,"Druk op een toets om bestand(en)",CR,LF,"terug te vinden in station %1",CR,LF,CR,LF ;AN000;bgb
+0011 T 0011 CR,LF,"FAT kan niet worden gelezen",CR,LF
+0012 T 0012 CR,LF,"FAT kan niet worden vastgelegd",CR,LF
+0013 T 0013 CR,LF
+SORT 7a6d 0001
+0005 T 0005 "SORT: "
+SUBST 7a97 0001
+0002 T 0002 CR,LF,"Onjuist aantal parameters",CR,LF
+SYS 7ae0 0008
+0004 T 0004 "Ongeldig station opgegeven",CR,LF ; Old
+0007 T 0007 "Geen ruimte voor systeem op doelschijf",CR,LF ; Old
+0008 T 0008 "Niet uitwisselbare versies van DOS",CR,LF ; Old
+0010 T 0010 "Geen systeem in standaardstation",CR,LF ; Old
+0011 T 0011 "Standaardstation kan niet worden opgegeven",CR,LF ; New
+0012 T 0012 "Schrijven naar schijf mislukt - schijf onbruikbaar",CR,LF ; New
+0014 T 0014 "Plaats systeemschijf in station %1:",CR,LF ; Old
+0016 T 0016 "Systeembestanden kunnen niet worden overgezet naar %1",CR,LF ; New
+SHARE 7d8b 0000
+NLSFUNC 7d9f 0000
+ANSI 7db3 0001
+0010 T 0010 "Ongeldige parameter - %1",CR,LF ; 'Invalid parameter'
+IFSFUNC 7e0d 0001
+0004 T 0004 "Geen IFS-stuurprogramma's gevonden",CR,LF
+PSPRINT 7e59 0007
+0002 T 0002 " fout bij lezen van bestand",CR,LF,FORMFD,BELL,"$"
+0003 T 0003 CR,LF,LF,"Bestand geannuleerd door operator",CR,FORMFD,BELL
+0004 T 0004 "FAT beschadigd op schijf in station "
+0005 T 0005 "A:",CR,LF,"$"
+0006 T 0006 "Ongeldige uitvoereenheid voor PRINT",CR,LF
+0007 T 0007 "PSPRINT reeds ge‹nstalleerd",CR,LF
+0008 T 0008 "PSPRINT/PRINT-conflict",CR,LF
+BACKUP 7fdd 0022
+0002 T 0002 CR,LF,"Onvoldoende geheugen",CR,LF
+0006 T 0006 CR,LF,"Ongeldig station opgegeven",CR,LF
+0014 T 0014 CR,LF,"Bron- en doelstations zijn gelijk",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0017 CR,LF,"Fout bij openen logboekbestand",CR,LF
+0018 T 0018 CR,LF,"Registratie in bestand %1",CR,LF
+0019 T 0019 CR,LF,"Laatste reservediskette niet geplaatst",CR,LF
+0020 T 0020 CR,LF,"Waarschuwing! Bestanden in de ",CR,LF
+ "hoofdindex %1:\ zullen worden gewist",CR,LF
+0021 T 0021 CR,LF,"Waarschuwing! Bestanden in de ",CR,LF
+ "index %1:\BACKUP zullen worden gewist",CR,LF
+0022 T 0022 CR,LF,"*** Reservekopie van de bestanden wordt naar station %1: geschreven ***",CR,LF
+0023 T 0023 "Diskette nummer: %1",CR,LF
+0024 T 0024 CR,LF,"Let op! Geen bestanden gevonden om reservekopie te maken",CR,LF
+0025 T 0025 CR,LF,"Plaats brondiskette in station %1:",CR,LF
+0026 T 0026 CR,LF,"Plaats reservediskette %1 in station %2:",CR,LF
+0027 T 0027 CR,LF,"*** Reservebestand kan niet worden gemaakt ***",CR,LF
+0028 T 0028 CR,LF,"Plaats laatste reservediskette in station %1:",CR,LF
+0029 T 0029 CR,LF,"Doelschijf kan niet worden gebruikt voor reservekopie",CR,LF
+0030 T 0030 CR,LF,"*** Laatste reservebestand is niet gemaakt ***",CR,LF
+0031 T 0031 CR,LF,"Vaste schijf %1: is vol",CR,LF
+0032 T 0032 CR,LF,"Schijf vol tijdens schrijven naar BACKUP-logboekbestand",CR,LF
+0034 T 0034 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 85b3 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 85ed 0013
+0004 T 0004 "10 Verschillen - vergelijking be‰indigd",CR,LF
+0006 T 0006 "Verschil bij OFFSET %1",CR,LF
+0007 T 0007 "Bestand 1 = %1",CR,LF
+0008 T 0008 "Bestand 2 = %1",CR,LF
+0009 T 0009 "EOF-markering niet gevonden",CR,LF
+0010 T 0010 "Bestanden zijn identiek",CR,LF
+0015 T 0015 CR,LF,CR,LF,"Geef eerste bestandsnaam op",CR,LF
+0016 T 0016 CR,LF,CR,LF,"Geef tweede bestandsnaam of station op",CR,LF
+0017 T 0017 "Bestanden zijn niet even groot",CR,LF
+0018 T 0018 "Nog meer bestanden vergelijken (J/N) ?"
+0019 T 0019 "%1 en %2",CR,LF
+0020 T 0020 CR,LF
+0023 T 0023 "Bestanden zijn identiek",CR,LF
+DISKCOMP 885f 0016
+0004 T 0004 "Geen bestandsnamen opgeven",CR,LF
+ "Voer opdracht in als: DISKCOMP s: s:[/1][/8]",LF,CR
+0005 T 0005 CR,LF,"Ongeldig station opgegeven",CR,LF
+ "Opgegeven station bestaat niet",CR,LF
+ "of is niet-verwisselbaar",CR,LF
+0006 T 0006 CR,LF,"DISKCOMP van of naar ",CR,LF
+ "een netwerkstation is niet mogelijk",CR,LF
+0007 T 0007 CR,LF,"Plaats EERSTE diskette in station %1:",CR,LF
+0008 T 0008 CR,LF,"Plaats TWEEDE diskette in station %1:",CR,LF
+0009 T 0009 CR,LF,"EERSTE diskette beschadigd of niet uitwisselbaar met DOS",CR,LF
+0010 T 0010 CR,LF,"TWEEDE diskette beschadigd of niet uitwisselbaar met DOS",CR,LF
+0014 T 0014 CR,LF,"Nog meer diskettes vergelijken (J/N) ?"
+0015 T 0015 CR,LF,"Vergelijking van %1 sporen",CR,LF
+ "%2 sectoren per spoor, %3 - zijdig",CR,LF
+0016 T 0016 CR,LF,"Stations of diskettes zijn",CR,LF
+ "niet uitwisselbaar",CR,LF
+0017 T 0017 CR,LF,"Onherstelbare leesfout in station %2",CR,LF
+ "zijde %3, spoor %4",CR,LF
+0018 T 0018 CR,LF,"Verschil gevonden op",CR,LF,"zijde %3, spoor %4",CR,LF
+0019 T 0019 "Controleer of een diskette in het station",CR,LF ;AN004;
+ "geplaatst is en of het station gesloten is",CR,LF ;AN004;
+0020 T 0020 CR,LF,"Vergelijking van diskettes voltooid",CR,LF
+0021 T 0021 CR,LF,"Vergelijking: OK",CR,LF
+0022 T 0022 CR,LF
+DISKCOPY 8dab 0018
+0002 T 0002 CR,LF
+0004 T 0004 "Geen bestandsnamen opgeven",CR,LF
+ "Voer opdracht in als: DISKCOPY s: s: [/1]",CR,LF
+0005 T 0005 CR,LF,"Ongeldig station opgegeven",CR,LF
+ "Opgegeven station bestaat niet",CR,LF
+ "of is niet-verwisselbaar",CR,LF
+0006 T 0006 CR,LF,"DISKCOPY van of naar",CR,LF
+ "een netwerkstation is niet mogelijk",CR,LF
+0007 T 0007 CR,LF,"Indelen tijdens kopi‰ren",CR,LF
+0008 T 0008 CR,LF,"Plaats BRON diskette in station %1:",CR,LF
+0009 T 0009 CR,LF,"Plaats DOEL diskette in station %1:",CR,LF
+0010 T 0010 "Controleer of een diskette in het station ",CR,LF ;AN004;
+ "geplaatst is en of het station gesloten is",CR,LF ;AN004;
+0011 T 0011 CR,LF,"DOEL diskette kan onbruikbaar zijn",CR,LF
+0012 T 0012 CR,LF,"DOEL diskette is onbruikbaar",CR,LF
+0016 T 0016 CR,LF,"Nog een diskette kopi‰ren (J/N) ?"
+0017 T 0017 CR,LF,"Bezig met kopi‰ren van %1 sporen",CR,LF
+ "%2 sectoren per spoor, %3- zijdig",CR,LF
+0018 T 0018 CR,LF,"Stations of diskettes zijn",CR,LF
+ "niet uitwisselbaar",CR,LF
+0019 T 0019 CR,LF,"Onherstelbare leesfout in station %1",CR,LF
+ "zijde %2, spoor %3",CR,LF
+0020 T 0020 CR,LF,"Onherstelbare schrijffout in station %1",CR,LF
+ "zijde %2, spoor %3",CR,LF
+0021 T 0021 CR,LF,"Kopi‰ren van diskettes voltooid",CR,LF
+0022 T 0022 CR,LF,"BRON diskette beschadigd of niet uitwisselbaar met DOS"
+0023 T 0023 CR,LF,"DOEL diskette beschadigd of niet uitwisselbaar met DOS"
+LABL 936e 0000
+MODE 9382 0055
+0003 T 0003 CR,LF,"COM1, COM2, COM3 of COM4 moet worden opgegeven",CR,LF
+0004 T 0004 CR,LF,"Resident gedeelte van MODE geladen",CR,LF
+0005 T 0005 CR,LF,"Ongeldige naam voor eenheid",CR,LF
+0006 T 0006 CR,LF,"Printerfout",CR,LF
+0007 T 0007 CR,LF,"LPT%1: ingesteld op 80 kolommen",CR,LF
+0008 T 0008 CR,LF,"LPT%1: ingesteld op 132 kolommen",CR,LF
+0009 T 0009 CR,LF,"Afdrukregels per inch ingesteld",CR,LF
+0010 T 0010 CR,LF,"Ongeldig baud-getal opgegeven",CR,LF
+0011 T 0011 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0012 "0123456789"
+0013 T 0001 CR,LF,"Kunt u de %1 zien? (J/N) "
+0014 T 0014 CR,LF,"Ongeldige parameters",CR,LF
+0015 T 0001 "LPT%1: uitvoer gaat naar COM%2:",CR,LF
+0016 T 0001 "LPT%1: uitvoer gaat (weer) naar parallelle poort",CR,LF
+0017 T 0017 CR,LF,"%1 herhaling bij time-out van parallelle printer",CR,LF
+0018 T 0018 CR,LF," Scherm kan niet verder naar %1 worden verschoven",CR,LF
+0020 T 0020 CR,LF,"Onjuist aantal parameters",CR,LF
+0021 T 0021 CR,LF,"NET 042: Opdracht kan niet worden uitgevoerd",CR,LF
+0022 T 0022 CR,LF,"Onbeperkte herhaling niet mogelijk voor netwerk-printer",cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",CR,LF
+0024 T 0024 CR,LF,"Eenheid %1 kon niet worden geactiveerd",CR,LF
+0025 T 0025 CR,LF,"Eenheid of codetabel niet aanwezig in schriftsoortbestand",CR,LF
+0026 T 0026 CR,LF,"Inhoud schriftsoortbestand ongeldig",CR,LF
+0027 T 0027 CR,LF,"Eerder gedefinieerde codetabel is vervangen",CR,LF
+0028 T 0028 CR,LF,"Actieve codetabel voor eenheid %1 is %2",CR,LF
+0029 T 0029 CR,LF,"Eenheid %1 niet gedefinieerd",CR,LF
+0030 T 0030 "%1 codetabellen:",CR,LF
+0031 T 0031 " Codetabel %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0032 CR,LF,"MODE-functie %1 CODEPAGE voltooid",CR,LF
+0033 T 0033 CR,LF,"Fout bij %1 GLOBAL CODEPAGE",CR,LF ;FILLED IN with "instellen" or "ophalen"
+0034 T 0034 CR,LF,"Actieve CODEPAGE-instellingen:",CR,LF ;table header
+0035 T 0035 " %1 - %2 codetabel",CR,LF
+0036 T 0036 " Codetabel niet gedefinieerd",CR,LF
+0037 T 0037 "CODEPAGE-bewerking niet mogelijk voor deze eenheid",CR,LF
+0038 T 0038 "Er is geen codetabel",CR,LF
+0039 T 0039 "Fout in eenheid bij %1",CR,LF
+0040 T 0040 "Codetabel niet gedefinieerd",CR,LF
+0041 T 0041 CR,LF,"Actief toetsenbord ondersteunt deze codetabel niet",CR,LF
+0042 T 0042 CR,LF,"Fout bij inlezen van het schriftsoortbestand",CR,LF
+0043 T 0043 CR,LF,"REFRESH-bewerking kan niet worden uitgevoerd",CR,LF
+0044 T 0044 CR,LF ;used for formatting
+0045 T 0045 CR,LF,"Status eenheid %1:",CR,LF ;header for status reports
+0046 T 0046 "------------------" ;first part of underline under "Status eenheid %1:"
+0047 T 0047 "----",CR,LF ;four_char_underline
+0048 T 0048 "-----",CR,LF ;five_char_underline
+0049 T 0049 "LINES=%1",CR,LF
+0050 T 0050 "COLUMNS=%1",CR,LF
+0051 T 0051 CR,LF,"RATE en DELAY moeten samen worden opgegeven",CR,LF
+0052 T 0052 "RATE=%1",CR,LF
+0053 T 0053 "DELAY=%1",CR,LF
+0054 T 0054 CR,LF,"Opdracht niet ondersteund op deze computer - %1",CR,LF
+0055 T 0055 CR,LF,"Vereiste schriftsoort niet geladen",CR,LF
+0056 T 0056 CR,LF,"ANSI.SYS niet ge‹nstalleerd - opdracht kan niet worden uitgevoerd",CR,LF
+0057 T 0057 CR,LF,"Baud-getal moet worden opgegeven",CR,LF
+0058 T 0058 "RETRY=%1",CR,LF
+RESTORE a0c4 0022
+0002 T 0002 CR,LF,"Bron- en doelstations zijn gelijk",CR,LF
+0003 T 0003 CR,LF,"Onjuist aantal parameters",CR,LF
+0006 T 0006 CR,LF,"Ongeldig station opgegeven",CR,LF
+0007 T 0007 CR,LF,"Let op! Geen bestanden gevonden om terug te zetten",CR,LF
+0008 T 0008 CR,LF,"Plaats reservediskette %1 in station %2:",CR,LF
+0009 T 0009 CR,LF,"Plaats doeldiskette in station %1:",CR,LF
+0011 T 0011 CR,LF,"Let op! Volgorde diskettes onjuist",CR,LF
+ "Plaats een andere diskette of ga door indien toch juist",CR,LF
+0012 T 0012 CR,LF,"Laatste bestand niet teruggezet",CR,LF
+0013 T 0013 CR,LF,"*** Reservekopie is gemaakt op %1 *** ",CR,LF
+0014 T 0014 CR,LF,"Bronschijf bevat geen reservebestanden",CR,LF
+0015 T 0015 CR,LF,"Onvoldoende geheugen",CR,LF
+0016 T 0016 CR,LF,"Let op! Bestand %1",CR,LF
+ "kan alleen worden gelezen",CR,LF
+ "Bestand vervangen (J/N) ? ",CR,LF
+0017 T 0017 CR,LF,"Fout: diskettes niet in juiste volgorde",CR,LF
+0018 T 0018 CR,LF,"Fout bij maken bestand",CR,LF
+0019 T 0019 CR,LF,"Onvoldoende schijfruimte",CR,LF
+0020 T 0020 CR,LF,"*** Bestand kan niet worden teruggezet ***",CR,LF
+0021 T 0021 CR,LF,"*** Bestanden worden teruggezet vanuit station %1: ***",CR,LF
+0022 T 0022 CR,LF,"Let op! Bestand %1",CR,LF
+ "is gewijzigd na maken reservekopie",CR,LF
+ "Bestand vervangen (J/N) ? ",CR,LF
+0023 T 0023 "Diskette: %1",CR,LF
+0024 T 0024 CR,LF,"Bizzare error, call Russ Whitehead @ 8-3863",CR,LF
+0025 T 0025 07 ;For BEEP !
+0026 T 0026 CR,LF,"Fout bij terugzetten van uitgebreide bestandskenmerken",CR,LF
+SELECT a6d7 0016
+0004 T 0004 "Verkeerde systeemschijf: SELECT kan niet worden uitgevoerd",CR,LF,CR,LF
+ "Plaats de INSTALLATIEDISKETTE in station A: en voer de opdracht opnieuw uit"
+0005 T 0005 "Geen systeemschijf",CR,LF,CR,LF
+ "Plaats de INSTALLATIEDISKETTE in station A: en voer de opdracht opnieuw uit"
+0006 T 0006 "SELECT-opdrachtregel bevat ongeldige parameters",CR,LF,CR,LF
+ "Controleer of de INSTALLATIEDISKETTE in station A: is geplaatst",CR,LF
+ "Druk daarna gelijktijdig op Ctrl+Alt+Del om het systeem opnieuw te starten"
+0007 T 0007 BELL,"DOS kan niet worden ge‹nstalleerd. Installatieprogramma afgebroken",CR,LF
+0008 T 0008 "SELECT wordt geladen. Even geduld a.u.b."
+0009 T 0009 "Start de computer opnieuw op om verder te gaan met de DOS-installatie",CR,LF,CR,LF
+ "door gelijktijdig op Ctrl+Alt+Del te drukken"
+0010 T 0010 "Plaats de SELECT-schijf in station A:",CR,LF,CR,LF
+ "Druk op Enter om verder te gaan met de DOS-installatie,",CR,LF
+ "of druk op Esc om de installatie te annuleren",CR,LF
+0011 T 0011 BELL
+0012 T 0012 "Plaats de SELECT-schijf in station A:",CR,LF,CR,LF
+ "Druk op Enter om verder te gaan met de DOS-installatie",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE af00 0004
+0002 T 0002 "Indexen Van Volume %1",CR,LF ;define message ;AN000;
+0003 T 0003 "Indexen",CR,LF ; ;AN000;
+0004 T 0004 "Schijf bevat geen subindexen",CR,LF,LF ; ;AN000;
+0007 T 0007 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE b04e 0009
+0003 T 0003 CR,LF,"Geen bestanden vervangen",CR,LF
+0004 T 0004 CR,LF,"Geen bestanden toegevoegd",CR,LF
+0013 T 0013 CR,LF,"%1 wordt vervangen",CR,LF
+0014 T 0014 CR,LF,"%1 wordt toegevoegd",CR,LF
+0015 T 0015 CR,LF,"%1 bestand(en) vervangen",CR,LF
+0016 T 0016 CR,LF,"%1 bestand(en) toegevoegd",CR,LF
+0017 T 0017 CR,LF,"%1-bestanden niet gevonden",CR,LF
+0022 T 0022 CR,LF,"%1 vervangen? (J/N)"
+0023 T 0023 CR,LF,"%1 toevoegen? (J/N)"
+XCOPY b219 0019
+0004 T 0004 "Is %1 de naam van een",CR,LF ;AN000;
+ "bestand of index op de doelschijf",CR,LF
+ "(B = Bestand, I = Index) ? "
+0005 T 0005 "Druk op een toets om bestand(en) te kopi‰ren" ;AN000;
+0006 T 0006 "Pad te lang",CR,LF ;AN000;
+0008 T 0008 "Cyclisch kopi‰ren niet mogelijk",CR,LF ;AN000;
+0012 T 0012 "XCOPY vanaf een gereserveerde eenheid niet mogelijk",CR,LF ;AN000;
+0021 T 0021 "Onjuist aantal parameters",CR,LF ;AN000;
+0022 T 0022 "XCOPY naar een gereserveerde eenheid niet mogelijk",CR,LF ;AN000;
+0024 T 0024 "Fout bij maken bestand",CR,LF ;AN000;
+0025 T 0025 "Bronbestand(en) worden ingelezen...",CR,LF ;AN000;
+0026 T 0026 CR,LF ;AN000;
+0027 T 0027 "%1 bestand(en) gekopieerd",CR,LF ;AN000;
+0028 T 0028 "%1 Bestand niet gevonden",CR,LF ;AN000;
+0029 T 0029 "B I " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0030 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 T 0031 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0032 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 T 0033 "%1%2 (J/N)?" ;AN000;P_S_PATH_FILE0
+0034 T 0034 "%1\%2 (J/N)?" ;AN000;P_S_PATH_FILE1
+0035 T 0035 "Ongeldig wisselteken %1",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK b6fa 0013
+0002 T 0002 "onvoldoende geheugen",CR,LF ;AN000; "Insufficient memory"
+0003 T 0003 "VDISK versie 3.40 virtuele schijf %1",CR,LF ;AN000;
+0004 T 0004 " Buffer-grootte aangepast",CR,LF ;AN000;
+0005 T 0005 " Sector-grootte aangepast",CR,LF ;AN000;
+0006 T 0006 " Indexgegevens aangepast",CR,LF ;AN000;
+0007 T 0007 " Ongeldig wisselteken",CR,LF ;AN000;
+0008 T 0008 " Transfer-grootte aangepast",CR,LF ;AN000;
+0009 T 0009 " Buffer-grootte: %1 KB",CR,LF ;AN000;
+0010 T 0010 " Sector-grootte: %1",CR,LF ;AN000;
+0011 T 0011 " Indexgegevens: %1",CR,LF ;AN000;
+0012 T 0012 " Transfer-omvang: %1",CR,LF ;AN000;
+0013 T 0013 "VDISK niet ge‹nstalleerd - " ;AN000;
+0014 T 0014 " schakelaarstand Extender Card",CR,LF ;AN000;
+ "niet in overeenstemming met geheugengrootte",CR,LF,CR,LF ;AN000;
+GRAFTABL baf4 0005
+0002 T 0002 "Actieve codetabel: %1",CR,LF
+0003 T 0003 "Vorige codetabel: %1",CR,LF
+0004 T 0004 "Geen",NULL
+0005 T 0005 "Niet-standaard",NULL
+0006 T 0006 CR,LF,"Overzicht van ondersteunde parameters in de DOS-opdrachtregel",COLON,CR,LF,LF
+ " /STA - Alleen status opvragen",CR,LF
+ " ? - Dit overzicht van parameters weergeven",CR,LF,CR,LF
+ " Beschikbare codetabellen",COLON,CR,LF
+ " 437 - USA grafische tekenset",CR,LF
+ " 850 - Meertalige grafische tekenset",CR,LF
+ " 860 - Portugese grafische tekenset",CR,LF
+ " 863 - Canadees-Franse grafische tekenset",CR,LF
+ " 865 - Deense/Noorse grafische tekenset",CR,LF
+FASTOPEN bd95 0016
+0004 T 0004 CR,LF,"FASTOPEN ge‹nstalleerd",CR,LF ;AN000;
+0005 T 0005 CR,LF,"FASTOPEN reeds ge‹nstalleerd",CR,LF ;AN000;
+0006 T 0006 CR,LF,"Ongeldige parameter",CR,LF ;AN000;
+0007 T 0007 CR,LF,"Te veel stations opgegeven",CR,LF ;AN000;
+0008 T 0008 CR,LF,"Hetzelfde station meer dan ‚‚n keer opgegeven",CR,LF ;AN000;
+0009 T 0009 CR,LF,"Ongeldige parameter",CR,LF ;AN000;
+0010 T 0010 CR,LF,"Ongeldig wisselteken",CR,LF ;AN000;
+0011 T 0011 CR,LF,"Ongeldig aantal bestandsdelen opgegeven",CR,LF ;AN000;
+0012 T 0012 CR,LF,"Ongeldig aantal bestands- of indexgegevens",CR,LF
+0013 T 0013 CR,LF,"Vergroot geheugen kan niet worden ge‹nstalleerd",CR,LF ;AN000;
+0014 T 0014 CR,LF,"Vergroot geheugen niet beschikbaar",CR,LF ;AN000;
+0015 T 0015 CR,LF,"Ongeldig station opgegeven %1",CR,LF
+0016 T 0016 CR,LF,"Niet genoeg ruimte in EMS. Conventioneel geheugen wordt gebruikt",CR,LF ;AN000;
+0017 T 0017 CR,LF,"FASTOPEN kan niet worden gebruikt voor station ",CR,LF
+0018 T 0018 CR,LF,"Te veel bestandsdelen opgegeven",CR,LF
+0019 T 0019 CR,LF,"Te veel bestands- of indexgegevens",CR,LF
+APPEND c206 0009
+0001 T 0001 "Onjuiste APPEND-versie",CR,LF
+0002 T 0002 "Ongeldig pad",CR,LF
+0003 T 0003 "Ongeldige parameter",CR,LF
+0004 T 0004 "Onjuiste combinatie van parameters",CR,LF
+0005 T 0005 "Geen APPEND",CR,LF
+0006 T 0006 "APPEND/ASSIGN-conflict",CR,LF
+0007 T 0007 "APPEND/TopView-conflict",CR,LF
+0008 T 0008 "Onjuiste DOS versie",CR,LF
+0009 T 0009 "APPEND reeds ge‹nstalleerd",CR,LF
+GRAPHICS c39c 0012
+0005 T 0005 "Ongeldige parameter: %1",CR,LF ;AN000
+0007 T 0007 "Dezelfde parameter mag niet twee keer worden opgegeven",CR,LF ;AN000
+0009 T 0009 "GRAPHICS-profiel niet gevonden",CR,LF ;AN000
+0010 T 0010 "Vereiste profielinstructie ontbreekt v¢¢r regel %1",CR,LF ;AN000
+0011 T 0011 "Ongeldige profielinstructie in regel %1",CR,LF ;AN000
+0012 T 0012 "Ongeldige volgorde van profielinstructie in regel %1",CR,LF ;AN000
+0013 T 0013 "Fout bij inlezen van GRAPHICS-profiel",CR,LF ;AN000
+0014 T 0014 "Syntaxisfouten in GRAPHICS-profiel",CR,LF ;AN000
+0015 T 0015 "Geen PRINTBOX-ID opgegeven in GRAPHICS-profiel",CR,LF
+0016 T 0016 "Geen printertype opgegeven in GRAPHICS-profiel",CR,LF ;AN000
+0017 T 0017 "Parameter /B kan niet worden gebruikt voor zwart-wit printers",CR,LF ;AN000
+0018 T 0018 "Opnieuw laden niet mogelijk met huidig profiel",CR,LF ;AN000
+DISPLAY c830 0003
+0002 T 0002 "%1-stuurprogramma voor codetabel kan niet worden ge‹nitialiseerd",CR,LF
+0008 T 0008 "Onvoldoende geheugen",CR,LF
+0012 T 0012 "Ongeldige syntaxis voor DISPLAY.SYS",CR,LF
+PRINTER c8fd 0002
+0002 T 0002 "%1-stuurprogramma voor codetabel kan niet worden ge‹nitialiseerd",CR,LF
+0012 T 0012 "Ongeldige syntaxis voor PRINTER.SYS",CR,LF
+KEYB c9a0 0016
+0002 T 0002 "Actieve toetsenbord-code: %1"
+0003 T 0003 "Huidig toetsenbord-ID: %1"
+0004 T 0004 " huidige codetabel: %1",CR,LF
+0005 T 0005 "Actieve CON-codetabel: %1",CR,LF
+0006 T 0006 "Ongeldige toetsenbord-code opgegeven",CR,LF
+0007 T 0007 "Ongeldige toetsenbord-ID opgegeven",CR,LF
+0008 T 0008 "Ongeldige codetabel opgegeven",CR,LF
+0009 T 0009 "KEYBOARD.SYS is ongeldig of ontbreekt",CR,LF
+0010 T 0010 "KEYB niet ge‹nstalleerd",CR,LF
+0011 T 0011 "Actieve codetabel niet beschikbaar voor CON-eenheid",CR,LF
+0012 T 0012 "Opgegeven codetabel niet gedefinieerd",CR,LF
+0013 T 0013 "Een of meer CON-codetabellen ongeldig voor toetsenbord-code",CR,LF
+0014 T 0014 "Gevraagde codetabel (%1) ongeldig voor toetsenbord-code",CR,LF
+0015 T 0015 "Opgegeven codetabel strijdig met ingestelde codetabel",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0017 "KEYB-tabel kan niet worden gemaakt in resident geheugen",CR,LF
+REDIRSYS cd89 0000
+MEM cd9d 0036
+0010 T 0010 CR,LF
+0011 T 0011 " Adres Naam Grootte Type ",CR,LF
+0012 T 0012 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0013 " Ingang EMS-naam Grootte ",CR,LF
+0014 T 0014 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ",CR,LF
+0015 T 0015 " %1 %2 %3 %4",CR,LF
+0016 T 0016 " %1 %2 %3 ",CR,LF
+0017 T 0017 " %1 %2 ",CR,LF
+0018 T 0018 "%1 bytes totaal geheugen",CR,LF
+0019 T 0019 "%1 bytes beschikbaar",CR,LF
+0020 T 0020 "%1 maximale grootte uitvoerbare programma's",CR,LF
+0021 T 0021 "%1 bytes totaal EMS-geheugen",CR,LF
+0022 T 0022 "%1 bytes EMS-geheugen beschikbaar",CR,LF
+0023 T 0023 "%1 bytes totaal vergroot geheugen",CR,LF
+0024 T 0024 "Interrupt Vector",0
+0025 T 0025 "ROM Communicatiegebied",0
+0026 T 0026 "DOS Communicatiegebied",0
+0027 T 0027 "IBMBIO",0
+0028 T 0028 "IBMDOS",0
+0029 T 0029 "Systeemgegevens",0
+0030 T 0030 "Systeemprogramma",0
+0031 T 0031 "Systeemstuurprogramma",0
+0032 T 0032 "Ge‹nstalleerd stuurprogramma",0
+0033 T 0033 "%1:",0
+0034 T 0034 "%1: - %2:",0
+0035 T 0035 "BUFFERS=",0
+0036 T 0036 "FILES=",0
+0037 T 0037 "FCBS=",0
+0038 T 0038 "STACKS=",0
+0039 T 0039 "DEVICE=",0
+0040 T 0040 "IFS=",0
+0041 T 0041 "LASTDRIVE=",0
+0042 T 0042 "----------",0
+0043 T 0043 " ",0
+0044 T 0044 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR d348 0040
+0004 T 0004 "Netwerk is niet opgestart",CR,LF
+0050 T 0050 "NET809: Netwerkaanvraag niet ondersteund",CR,LF,0
+0051 T 0051 "NET801: Computer op afstand geeft geen respons",CR,LF,0
+0052 T 0052 "NET802: Naam komt twee keer voor in netwerk",CR,LF,0
+0053 T 0053 "NET803: Netwerkpad niet gevonden",CR,LF,0
+0054 T 0054 "NET804: Netwerk bezet",CR,LF,0
+0055 T 0055 "NET805: Eenheid in netwerk bestaat niet meer",CR,LF,0
+0056 T 0056 "NET806: Net BIOS-opdrachtlimiet overschreden",CR,LF,0
+0057 T 0057 "NET807: Systeemfout; NETBIOS-fout",CR,LF,0
+0058 T 0058 "NET808: Onjuiste respons van netwerk",CR,LF,0
+0059 T 0059 "NET810: Onverwachte fout in netwerk",CR,LF,0
+0060 T 0060 "NET811: Adapter op afstand niet uitwisselbaar",CR,LF,0
+0061 T 0061 "NET812: PRINT-wachtrij is vol",CR,LF,0
+0062 T 0062 "NET813: Onvoldoende ruimte voor afdrukbestand",CR,LF,0
+0063 T 0063 "NET814: Afdrukbestand geannuleerd",CR,LF,0
+0064 T 0064 "NET815: Netwerknaam gewist",CR,LF,0
+0065 T 0065 "Geen toegang",CR,LF,0
+0066 T 0066 "NET817: Onjuist type netwerkeenheid",CR,LF,0
+0067 T 0067 "NET818: Netwerknaam niet gevonden",CR,LF,0
+0068 T 0068 "NET819: Netwerknaam te lang",CR,LF,0
+0069 T 0069 "NET820: Net BIOS-sessielimiet overschreden",CR,LF,0
+0070 T 0070 "NET821: Gemeenschappelijk gebruik tijdelijk onderbroken",CR,LF,0
+0071 T 0071 "NET823: Netwerkaanvraag niet ondersteund",CR,LF,0
+0072 T 0072 "NET822: Print- of schijf-redirection tijdelijk onderbroken",CR,LF,0
+0073 T 0073 "NET476: Netbeui niet ge‹nstalleerd",CR,LF,0
+0074 T 0074 "NET477: Adapter onverwachts afgesloten",CR,LF,0
+0075 T 0075 "NET826: Target Server /RQB te klein",CR,LF,0
+0076 T 0076 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0077 T 0077 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0078 T 0078 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0079 T 0079 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0080 T 0080 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0081 T 0081 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0082 T 0082 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0083 T 0083 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0084 T 0084 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0085 T 0085 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0086 T 0086 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0087 T 0087 "NET???: Onverwachte fout in netwerk",CR,LF,0
+0088 T 0088 "NET825: Gegevensfout in netwerk",CR,LF,0
+FILESYS dcb7 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0011 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+XMA2EMS ddf9 0017
+0001 T 0001 "XMA2EMS: Expanded Memory Manager Versie 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986. Alle rechten voorbehouden",CR,LF,"$"
+0002 T 0002 CR,LF,"XMA001 VMO/XMA diagnostics worden uitgevoerd: ","$"
+0003 T 0003 "XMA002 Diagnostics voltooid ",CR,LF,LF,"$"
+0004 T 0004 "XMA003 Paginakader begint op........................ "
+0005 T 0005 "XXXX",":0",CR,LF,"$"
+0006 T 0006 "XMA004 Pagina's overgezet naar conventioneel geheugen......... "
+0007 T 0007 "0 ",CR,LF,"$"
+0008 T 0008 "XMA005 Pagina's gereserveerd voor Control Program.......... "
+0009 T 0009 "0 ",CR,LF,"$"
+0010 T 0010 "XMA006 Pagina's gereserveerd voor vergroot geheugen......... "
+0011 T 0011 "0 ",CR,LF,"$"
+0012 T 0012 CR,LF,"XMA100 Adapterfout:",CR,LF," Expanded Memory Manager NIET ge‹nstalleerd",CR,LF,"$"
+0013 T 0013 CR,LF,"XMA200 Adapter niet gevonden:",CR,LF," Expanded Memory Manager NIET ge‹nstalleerd",CR,LF,"$"
+0014 T 0014 CR,LF,"XMA300 Onjuiste waarde parameter of syntaxisfout:",CR,LF
+ " Expanded Memory Manager NIET ge‹nstalleerd",CR,LF,"$"
+0015 T 0015 SIZE1_END - 2 -$
+0016 T 0016 4 DUP (?)," KB OK",CR,LF,"$"
+0017 T 0017 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK e2eb 0120
+0004 T 0004 "FDISK niet mogelijk in actief netwerk",CR,LF
+0005 T 0005 "Geen vaste schijven beschikbaar.",CR,LF
+0006 T 0006 "Fout bij lezen van vaste schijf.",CR,LF
+0007 T 0007 "Fout bij schrijven naar vaste schijf.",CR,LF
+1001 T 1001 "IBM Personal Computer"
+1002 T 1002 "Installatieprogramma Vaste Schijf V3.40"
+1003 T 1003 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 1004 "FDISK - opties"
+1005 T 1005 "1. <R>DOS-partitie of logisch DOS-station maken"
+1006 T 1006 "2. <R>Partitie actief maken"
+1007 T 1007 "3. <R>DOS-partitie of logisch DOS-station wissen"
+1008 T 1008 "4. <R>Partitiegegevens afbeelden"
+1009 T 1009 "Druk op <H>Esc<R> om FDISK te verlaten"
+1010 T 1010 "Kies een van de volgende opties:"
+1011 T 1011 "5. <R>Volgende vaste schijf kiezen"
+1012 T 1012 "Actief station met vaste schijf: <H><I>"
+1013 T 1013 "Waarschuwing! <R>Geen partities actief - schijf 1 kan alleen maar worden gestart als"
+1014 T 1014 "een actieve partitie aanwezig is"
+1015 T 1015 "Voer uw keuze in: [<S> ]"
+1016 T 1016 "DOS-partitie of logisch DOS-station maken"
+1017 T 1017 "1. <R>Primaire DOS-partitie maken"
+1018 T 1018 "2. <R>Uitgebreide DOS-partitie maken"
+1019 T 1019 "3. <R>Logische DOS-station(s) maken in de uitgebreide DOS-partitie"
+1020 T 1020 "ESC<R> om terug te keren naar FDISK-opties"
+1021 T 1021 "Primaire DOS-partitie maken"
+1022 T 1022 "Wilt u de maximum grootte voor een DOS-partitie gebruiken en deze"
+1023 T 1023 "actief maken (J/N) .............? <H>[<S> ]"
+1024 T 1024 "(<J>/<N>)...................................................? <H>[<S> ]"
+1025 T 1025 "Partitie Status Type Grootte in Mbytes Gebruikt percentage schijf"
+1026 T 1026 "Totaal schijfruimte is <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 T 1027 "Beschikbare ruimte voor partitie is maximaal <HIIIIR> Mbytes (<HIIIIR>)"
+1028 T 1028 "Geef grootte partitie op in Mbytes of in percentage schijfruimte (%) om"
+1029 T 1029 "een primaire DOS-partitie te maken.................................: <H>[<IIISI>]"
+1030 T 1030 "Uitgebreide DOS-partitie maken"
+1031 T 1031 "een uitgebreide DOS-partitie te maken..............................: <H>[<IIISI>]"
+1032 T 1032 "Druk op <H>Esc<R> om verder te gaan"
+1033 T 1033 "Logische DOS-station(s) maken in de uitgebreide DOS-Partitie"
+1034 T 1034 "Stat. Volume Label Mbytes Systeem In gebruik"
+1035 T 1035 "Totale grootte uitgebreide DOS-partitie is <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 T 1036 "Beschikbare ruimte voor logisch station is maximaal <HIIIIR> Mbytes <H>(<IIII>)"
+1037 T 1037 "Geef grootte logisch station op in Mbytes of in percentage schijfruimte (%)...<H>[<IIISI>]"
+1038 T 1038 "Partitie actief maken"
+1039 T 1039 "Voer nummer in van de partitie die u actief wilt maken.................: <H>[<S> ]"
+1040 T 1040 "DOS-partitie of logisch DOS-station wissen"
+1041 T 1041 "1. <R>Primaire DOS-partitie wissen"
+1042 T 1042 "2. <R>Uitgebreide DOS-partitie wissen"
+1043 T 1043 "3. <R>Logische DOS-stations wissen in de uitgebreide DOS-partitie"
+1044 T 1044 "Primaire DOS-partitie wissen"
+1045 T 1045 "Waarschuwing! <OR>Gegevens in de primaire partitie zullen verloren gaan"
+1046 T 1046 "Doorgaan (<J>/<N>).................? <H>[<S> ]"
+1047 T 1047 "Uitgebreide DOS-partitie wissen"
+1048 T 1048 "Waarschuwing! <OR>Gegevens in de uitgebreide DOS-partitie zullen verloren gaan"
+1049 T 1049 "Doorgaan (<J>/<N>).................? <H>[<S> ]"
+1050 T 1050 "Logische DOS-station(s) in de uitgebreide DOS-Partitie wissen"
+1051 T 1051 "Waarschuwing! <OR>Gegevens in het logische DOS-station zullen verloren gaan"
+1052 T 1052 "Welk station moet worden gewist...............................? <H>[<S> ]"
+1053 T 1053 "Doorgaan (<J>/<N>)..............................? <H>[<S> ]"
+1054 T 1054 "Volume-label invoeren..............................? <H>[<S> ]"
+1055 T 1055 "Partitiegegevens afbeelden"
+1056 T 1056 "Uitgebreide DOS-partitie bevat logische DOS-stations"
+1057 T 1057 "Gegevens over logisch station afbeelden (<J>/<N>)......?<H>[<S> ]"
+1058 T 1058 "Gegevens over logisch DOS-station afbeelden"
+1059 T 1059 "Systeem wordt opnieuw gestart"
+1060 T 1060 "Plaats DOS Opstartdiskette in station A:"
+1061 T 1061 "Druk op een toets om verder te gaan ...<S>"
+1062 T 1062 "Primaire DOS-partitie gewist"
+1063 T 1063 "Uitgebreide DOS-partitie gewist"
+1064 T 1064 "Station verwijderd"
+1065 T 1065 "Partitie <I> actief gemaakt"
+1066 T 1066 "Primaire DOS-partitie gemaakt"
+1067 T 1067 "Uitgebreide DOS-partitie gemaakt"
+1068 T 1068 "Logisch DOS-station gemaakt, letteraanduiding gewijzigd of toegevoegd<W>"
+1069 T 1069 "Geen partities gedefinieerd"
+1070 T 1070 "Geen logische stations gedefinieerd"
+1071 T 1071 "Letteraanduiding van stations gewijzigd of gewist<W>"
+1072 T 1072 "Station doorgestuurd"
+1073 T 1073 "Primaire DOS-partitie gemaakt, letteraanduiding gewijzigd of toegevoegd"
+1074 T 1074 "Geen vaste schijven beschikbaar."
+1075 T 1075 "Fout bij lezen van vaste schijf."
+1076 T 1076 "Fout bij schrijven naar vaste schijf."
+1077 T 1077 "Onjuiste DOS versie"
+1078 T 1078 "FDISK niet mogelijk in actief netwerk"
+1079 T 1079 "Geen primaire DOS-partitie aanwezig die gewist kan worden."
+1080 T 1080 "Geen uitgebreide DOS-partitie aanwezig die gewist kan worden."
+1081 T 1081 "Primaire DOS-partitie bestaat reeds."
+1082 T 1082 "Uitgebreide DOS-partitie bestaat reeds"
+1083 T 1083 "Geen ruimte voor DOS-partitie."
+1084 T 1084 "Opgegeven logisch station overschrijdt beschikbare grootte.<W>"
+1085 T 1085 "Opgegeven partitie overschrijdt beschikbare grootte.<W>"
+1086 T 1086 "Geen partities aanwezig"
+1087 T 1087 "De opstartpartitie in station 1 is reeds actief.<W>"
+1088 T 1088 "Geen partities om actief te maken."
+1089 T 1089 "Opstarten in partitie (<I>) niet mogelijk; actieve partitie ongewijzigd<W>"
+1090 T 1090 "Uitgebreide DOS-partitie kan niet worden"
+1091 T 1091 "gemaakt zonder primaire DOS-partitie op schijf 1.<W>"
+1092 T 1092 "Alle beschikbare ruimte in uitgebreide"
+1093 T 1093 "DOS-partitie is toegewezen aan logische stations.<W>"
+1094 T 1094 "Uitgebreide DOS-partitie met logische stations kan niet worden gewist.<W>"
+1095 T 1095 "Alle logische eenheden in de uitgebreide DOS-partitie gewist.<W>"
+1096 T 1096 " geen keuzemogelijkheid. Voer <III> in."
+1097 T 1097 "Waarschuwing! De actieve partitie kan niet worden opgestart<W>"
+1098 T 1098 "Aanwezige partities kunnen niet worden opgestart"
+1099 T 1099 "Alleen partities in station 1 kunnen actief worden gemaakt.<W>"
+1100 T 1100 "Maximum aantal logische DOS-stations ge‹nstalleerd.<W>"
+1101 T 1101 "Geen grootte opgegeven - partitie kan niet worden gemaakt."
+1102 T 1102 "Station <II> reeds gewist."
+1103 T 1103 "Geen toegang tot station <I>.<OW>"
+1104 T 1104 "Invoer ongeldig. Voer <III> in.<W>"
+1105 T 1105 "Primaire DOS-partitie in station 1 kan "
+1106 T 1106 "niet worden gewist als uitgebreide partitie aanwezig is.<W>"
+1107 T 1107 "Ongeldig invoergegeven, druk op ENTER<W>"
+1108 T 1108 "Onjuist volume-label<W>"
+1109 T 1109 "Logisch DOS-station kan niet worden gemaakt zonder"
+1110 T 1110 "uitgebreide DOS-partitie in het actieve station<W>"
+1111 T 1111 "Geen logische DOS-stations aanwezig die kunnen worden gewist"
+1112 T 1112 "Fout in boodschap <I>. Raadpleeg de titel van FDISKC.MSG voor foutdefinitie"
+1113 T 1113 "Interne fout"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/italy.msg b/private/mvdm/dos/v86/messages/italy.msg
new file mode 100644
index 000000000..dc9000067
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/italy.msg
@@ -0,0 +1,1143 @@
+0009
+COMMON 0006 0038
+0001 T 0000 "Versione DOS non corretta",CR,LF
+0002 T 0000 "%1 Š gi… installato",CR,LF
+0003 T 0000 "%1 byte disponibili su disco",CR,LF
+0004 T 0000 "%1 byte disponibili",CR,LF
+0005 T 0000 "%1 byte in settori difettosi",CR,LF
+0006 T 0000 "%1 byte totali su disco",CR,LF
+0007 T 0000 "%1 byte di memoria totale",CR,LF
+0008 T 0000 "%1 byte usati dal sistema",CR,LF
+0009 T 0000 "%1 installato",CR,LF
+0010 T 0000 "%1 non installato",CR,LF
+0011 T 0000 "%1 non installato",CR,LF
+0012 T 0000 "%1 Impossibile su una unit… di rete",CR,LF
+0013 T 0000 "",
+0014 T 0000 "%1 impossibile su unit… modificata",CR,LF
+0015 T 0000 "E' impossibile eseguire %1",CR,LF
+0016 T 0000 "Memoria espansa non disponibile",CR,LF
+0017 T 0000 "Tabella assegnazione file errata su unit… %1",CR,LF
+0018 T 0000 "Il file non pu• essere copiato su se stesso",CR,LF
+0019 T 0000 "Inserire il disco di destinazione nell'unit… %1",CR,LF
+0020 T 0000 "Spazio su disco insufficiente",CR,LF
+0021 T 0000 "Caratteri non validi nell'etichetta di volume",CR,LF
+0022 T 0000 "Code page non valida",CR,LF
+0023 T 0000 "Data non valida",CR,LF
+0024 T 0000 "Ora non valida",CR,LF
+0025 T 0000 "Percorso non valido",CR,LF
+0026 T 0000 "Manca l'identificativo dell'unit… di origine",CR,LF
+0027 T 0000 "Manca l'identificativo dell'unit… di destinazione",CR,LF
+0028 T 0000 "Per continuare premere un tasto qualsiasi . . .",CR,LF
+0029 T 0000 "Richiesto percorso origine",CR,LF
+0030 T 0000 "Sistema trasferito",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Impossibile creare l'indirizzario",CR,LF
+0033 T 0000 "Il Volume nell'unit… %1 non ha etichetta",CR,LF
+0034 T 0000 "Il Volume nell'unit… %1 Š %2",CR,LF
+0035 T 0001 "Etichetta di Volume (11 caratteri)? "
+0036 T 0000 "Il numero di serie del Volume Š %1-%2",CR,LF
+0037 T 0000 "Tipo di file errato",CR,LF
+0038 T 0001 CR,LF
+EXTEND 0745 0089
+0001 T 0000 "Funzione non valida",CR,LF
+0002 T 0000 "File non trovato",CR,LF
+0003 T 0000 "Percorso non trovato",CR,LF
+0004 T 0000 "Troppi file aperti",CR,LF
+0005 T 0000 "Accesso respinto",CR,LF
+0006 T 0000 "Riferimento non valido",CR,LF
+0007 T 0000 "Blocchi di controllo memoria distrutti",CR,LF
+0008 T 0000 "Memoria insufficiente",CR,LF
+0009 T 0000 "Indirizzo del blocco di memoria non valido",CR,LF
+0010 T 0000 "Ambiente operativo non valido",CR,LF
+0011 T 0000 "Formato non valido",CR,LF
+0012 T 0000 "Parametro della funzione non valido",CR,LF
+0013 T 0000 "Dati non validi",CR,LF
+0014 T 0000 "",
+0015 T 0000 "Identificativo dell'unit… non valido",CR,LF
+0016 T 0000 "Tentativo di rimozione dell'indirizzario corrente",CR,LF
+0017 T 0000 "Non stessa unit…",CR,LF
+0018 T 0000 "Non altri file",CR,LF
+0019 T 0000 "Errore di protezione da scrittura",CR,LF
+0020 T 0000 "Unit… non valida",CR,LF
+0021 T 0000 "di non pronto",CR,LF
+0022 T 0000 "Richiesta unit… non valida",CR,LF
+0023 T 0000 "Errore dati",CR,LF
+0024 T 0000 "Parametri di richiesta unit… non validi",CR,LF
+0025 T 0000 "Errore di ricerca",CR,LF
+0026 T 0000 "Tipo di supporto non valido",CR,LF
+0027 T 0000 "di settore non trovato",CR,LF
+0028 T 0000 "Errore: stampante senza carta",CR,LF
+0029 T 0000 "Errore di mancata scrittura",CR,LF
+0030 T 0000 "Errore di mancata lettura",CR,LF
+0031 T 0000 "Errore non identificato",CR,LF
+0032 T 0000 "Errore di violazione della condivisione",CR,LF
+0033 T 0000 "Errore di violazione della protezione",CR,LF
+0034 T 0000 "Sostituzione del minidisco non possibile",CR,LF
+0035 T 0000 "FCB non disponibile",CR,LF
+0036 T 0000 "Risorsa di sistema esaurita",CR,LF
+0037 T 0000 "Code page non corrispondente",CR,LF
+0038 T 0000 "Fuori dall'immissione",CR,LF
+0039 T 0000 "Spazio su disco insufficiente",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 T 0000 "Richiesta non prevista dal file per il sistema",CR,LF
+0051 T 0000 "Impossibile collegarsi al file per il sistema",CR,LF
+0052 T 0000 "Nome del file per il sistema gi… esistente",CR,LF
+0053 T 0000 "Nome del file per il sistema non trovato",CR,LF
+0054 T 0000 "File per il sistema occupato",CR,LF
+0055 T 0000 "L'unit… del file per il sistema non esiste pi—",CR,LF
+0056 T 0000 "Risorsa del file per il sistema esaurita",CR,LF
+0057 T 0000 "Il file per il sistema ha rilevato un errore sull'unit…",CR,LF
+0058 T 0000 "Il file per il sistema ha fornito una risposta errata",CR,LF
+0059 T 0000 "Il file per il sistema ha rilevato un errore non previsto",CR,LF
+0060 T 0000 "File per il sistema non compatibile",CR,LF
+0061 T 0000 "Superato il limite del file di emissione dell'unit…",CR,LF
+0062 T 0000 "Superato limite spazio del file di emissione dell'unit…",CR,LF
+0063 T 0000 "Il file di emissione dell'unit… non esiste pi—",CR,LF
+0064 T 0000 "Il nome del file per il sistema non esiste pi—",CR,LF
+0065 T 0000 "Accesso respinto dal file per il sistema",CR,LF
+0066 T 0000 "Tipo di unit… del file per il sistema errato",CR,LF
+0067 T 0000 "File per il sistema non trovato",CR,LF
+0068 T 0000 "Risorsa del file per il sistema esaurita",CR,LF
+0069 T 0000 "Risorsa del file per il sistema esaurita",CR,LF
+0070 T 0000 "Unit… del file per il sistema temporaneamente non disponibile",CR,LF
+0071 T 0000 "Richiesta del file per il sistema non accettata",CR,LF
+0072 T 0000 "Unit… del file per il sistema in pausa",CR,LF
+0073 T 0001 "Componente del file per il sistema non disponibile",CR,LF
+0074 T 0001 "Il file per il sistema ha rilevato un errore non previsto",CR,LF
+0075 T 0001 "Il file per il sistema ha rilevato un errore non previsto",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0000 "File gi… esistente",CR,LF
+0081 T 0000 "",
+0082 T 0000 "Impossibile creare voce indirizzario",CR,LF
+0083 T 0000 "Arresto richiesto ad errore critico",CR,LF
+0084 T 0000 "Troppi collegamenti",CR,LF
+0085 T 0000 "Unit… o file gi… collegato",CR,LF
+0086 T 0000 "Parola d'ordine non valida",CR,LF
+0087 T 0000 "Parametro non valido",CR,LF
+0088 T 0000 "Errore relativo ai dati del file per il sistema",CR,LF
+0089 T 0000 "Funzione non prevista dal file per il sistema",CR,LF
+PARSE 1831 0011
+0001 T 0000 "Troppi parametri",CR,LF
+0002 T 0000 "Parametro richiesto mancante",CR,LF
+0003 T 0000 "Scambio non valido",CR,LF
+0004 T 0000 "Parola chiave non valida",CR,LF
+0005 T 0000 "",
+0006 T 0000 "Valore parametro non compreso nell'intervallo consentito",CR,LF
+0007 T 0000 "Valore parametro non consentito",CR,LF
+0008 T 0000 "Valore parametro non consentito",CR,LF
+0009 T 0000 "Formato del parametro errato",CR,LF
+0010 T 0000 "Parametro non valido",CR,LF
+0011 T 0000 "Combinazione di parametri non valida",CR,LF
+IBMBIO 1a52 0018
+0003 T 0000 13,10,"Comando sconosciuto in CONFIG.SYS"
+0004 T 0000 13,10,"$"
+0005 T 0000 13,10,"Dimensione del settore troppo grande nel file $"
+0006 T 0000 13,10,"$ errato o mancante"
+0007 T 0000 "Interprete dei comandi",0
+0008 T 0000 13,10,"Codice del paese o code page non validi",13,10,"$"
+0009 T 0000 13,10,"Errore nel comando COUNTRY",13,10,"$"
+0010 T 0000 13,10,"Memoria non sufficiente per il file COUNTRY.SYS",13,10,"$"
+0011 T 0000 13,10,"Configurazione troppo grande per la memoria",13,10,"$"
+0012 T 0000 13,10,"Troppi dispositivi a blocchi",13,10,"$"
+0013 T 0000 13,10,"Parametri STACK non validi",13,10,"$"
+0014 T 0000 13,10,"Ordine errato nella riga del file CONFIG.SYS ","$"
+0015 T 0000 "Errore nella riga di CONFIG.SYS ","$"
+0016 T 0000 13,10,"Errore di assegnazione memoria $"
+0017 T 0000 0DH,0AH,7,0DH,0AH, "Overflow nello stack interno",0DH,0AH
+ "Sistema bloccato",0DH,0AH,"$"
+0020 T 0000 13,10,"Inserire il minidisco nell'unit… "
+0021 T 0001 "A: e premere un tasto quando pronto",13,10,10,0
+0022 T 0000 13,10,"Comando o parametri errati - $"
+BOOT 1e9d 0001
+0001 T 0000 13,10,"Sistema non su disco o errore del disco. ",13,10
+ "Sostituire e premere un tasto.",13,10,0
+DBCSDOS 1f21 0000
+IBMDOS 1f35 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1f74 0091
+0201 T 0000 "A" ;AC000;
+0202 T 0000 "R" ;AC000;
+0203 T 0000 "I" ;AC000;
+0204 T 0000 "T" ;AC000;
+0205 T 0000 "S" ;AC000;
+0206 T 0000 "N" ;AC000;
+0210 T 0000 "Annulla",CR,LF
+0211 T 0000 ", Riprova",CR,LF
+0212 T 0000 ", Ignora",CR,LF
+0213 T 0000 ", Tralascia",CR,LF
+0214 T 0000 "?" ;AC000;
+0215 T 0000 "leggendo",CR,LF
+0216 T 0000 "scrivendo",CR,LF
+0217 T 0000 "%1 unit… %2",CR,LF ;AC000;
+0218 T 0000 "%1 unit… %2",CR,LF ;AC000;
+0219 T 0000 "Inserire il volume %1 serie %2-%3",CR,LF ;AC009;
+0221 T 0000 "COMMAND.COM non valido",CR,LF
+0222 T 0000 "Inserire il minidisco con %1 nell'unit… %2",CR,LF
+0224 T 0000 CR,LF,"Si vuol terminare il lavoro batch (S/N)?",CR,LF
+0225 T 0000 "Impossibile eseguire %1",CR,LF
+0226 T 0000 "Errore nel file EXE",CR,LF
+0227 T 0000 "Memoria insufficiente",CR,LF,"per contenere il programma",CR,LF
+0228 T 0000 "Non ci sono riferimenti di file liberi",CR,LF
+0229 T 0000 "Comando o nome di file non valido",CR,LF
+0231 T 0000 "Errore di assegnazione memoria",CR,LF
+0232 T 0000 " Impossibile caricare COMMAND",CR,LF,"sistema bloccato",CR,LF
+0233 T 0000 "Impossibile avviare COMMAND ",CR,LF
+0234 T 0000 "Elaborazione di livello superiore ",CR,LF,"annullata, impossibile continuare.",CR,LF
+0235 T 0000 CR,LF ;AC000;
+0463 T 0000 "Fuori dello spazio del segmento di ambiente ",CR,LF
+0464 T 0000 CR,LF,"DOS Personal Computer IBM ",CR,LF
+ "Versione 3.40 (C)Copyright International Business Machines Corp 1981, 1986",CR,LF,
+ " (C)Copyright Microsoft Corp 1981, 1987",CR,LF,
+ "Materiale riservato - Programma di propriet… IBM",CR,LF
+0465 T 0000 "Errato indirizzario di ricerca COMMAND",CR,LF
+0466 T 0000 "Accesso respinto per",CR,LF,"errato indirizzario di ricerca COMMAND",CR,LF
+1002 T 0000 "Nome file duplicato o file non trovato",CR,LF
+1003 T 0000 "Percorso o nome di file non valido",CR,LF
+1007 T 0000 "Fuori dello spazio del segmento di ambiente ",CR,LF
+1008 T 0000 "Errore di creazione del file",CR,LF
+1009 T 0000 "File Batch mancante",CR,LF
+1010 T 0000 CR,LF,"Inserire il minidisco con il file batch",CR,LF,"e premere un tasto quando pronto",CR,LF
+1011 T 0000 "Comando o nome di file errato ",CR,LF
+1016 T 0000 "Contenuto dell'area di destinazione",CR,LF,"perso prima della copia",CR,LF
+1017 T 0000 "Nome file non valido o file non trovato",CR,LF
+1018 T 0000 "%1 file copiato(i)",CR,LF
+1019 T 0000 "%1 file " ;AC000;
+1022 T 0000 "La code page %1 non Š stata preparata per il sistema",CR,LF
+1023 T 0000 "La code page %1 non Š stata preparata per tutte le unit…",CR,LF
+1024 T 0000 "Code page attiva: %1",CR,LF
+1025 T 0000 "NLSFUNC non installato",CR,LF ;AC000;
+1027 T 0000 "Unit… corrente non pi— valida",CR,LF
+1029 T 0000 "Etichetta non trovata",CR,LF
+1030 T 0000 "Errore di sintassi",CR,LF
+1032 T 0000 "La data attuale Š %1 %2",CR,LF
+1033 T 0000 "DomLunMarMerGioVenSab",CR,LF
+1034 T 0000 "Immettere la data (%1): ",CR,LF
+1036 T 0000 "L'ora attuale Š %1",CR,LF
+1037 T 0000 "Immettere l'ora: ",CR,LF
+1038 T 0000 ", Si desidera cancellare? (S/N)" ;AC000;
+1039 T 0000 "Tutti i file dell'indirizzario saranno cancellati!",CR,LF
+ "E' sicuro (S/N)?"
+1040 T 0000 "DOS Personal Computer IBM %1 %2",CR,LF
+1044 T 0000 "Indirizzario non valido",CR,LF
+1046 T 0000 "Percorso non valido, non Š un indirizzario",CR,LF,"o l'indirizzario non Š vuoto",CR,LF
+1047 T 0000 "Bisogna specificare ON o OFF",CR,LF
+1048 T 0000 " Indirizzario di %1",CR,LF
+1049 T 0000 "Nessun percorso",CR,LF
+1050 T 0000 "Unit… non valida in percorso di ricerca ",CR,LF
+1051 T 0000 "Unit… non valida",CR,LF
+1052 T 0000 "FOR non pu• essere nidificato",CR,LF
+1053 T 0000 "Errore nella creazione del file intermedio",CR,LF
+1054 T 0000 "Impossibile leggere in binario da una unit…",CR,LF
+1055 T 0000 "BREAK Š %1 ",CR,LF
+1056 T 0000 "VERIFY Š %1 ",CR,LF
+1057 T 0000 "ECHO Š %1 ",CR,LF
+1059 T 0000 "disattivato",0
+1060 T 0000 "attivato",0
+1061 T 0000 "Errore nella scrittura sull'unit…",CR,LF
+1063 T 0000 "%1" ;AC000;
+1064 T 0000 "%1" ;AC000;
+1065 T 0000 "%1" ;AC000;
+1066 T 0000 "%1" ;AC000;
+1067 T 0000 9 ;AC000;
+1068 T 0000 " <DIR> " ;AC000;
+1069 T 0000 8," ",8 ;AC000;
+1070 T 0000 CR,LF ;AC000;
+1071 T 0000 "%1" ;AC000;
+1072 T 0000 "mm-gg-aa" ;AC000;
+1073 T 0000 "gg-mm-aa" ;AC000;
+1074 T 0000 "aa-mm-gg" ;AC000;
+1075 T 0000 "%1 %2" ;AC000;
+1076 T 0000 "%1" ;AC000;
+1077 T 0000 " %1 %2" ;AC000;
+1078 T 0000 "Indirizzario gi… esistente ",CR,LF ;AC000;
+ATTRIB 3349 0016
+0004 T 0000 "Numero di parametri non valido",CR,LF
+0005 T 0000 "Percorso non valido o file non trovato",CR,LF
+0006 T 0000 "Errore di sintassi",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 T 0000 "%1, Code page non corrispondente",CR,LF,"E' sicuro (S/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 T 0000 "Valore del tipo di file non valido",CR,LF
+0199 T 0000 "Errore relativo all'attributo esteso",CR,LF
+0201 T 0000 "Nome di attributo esteso non trovato",CR,LF
+0204 T 0000 "Il nome dell'attributo esteso non pu• essere impostato",CR,LF
+0205 T 0000 "Nome attributo esteso noto dai file per sistema ma non previsto",CR,LF
+0206 T 0000 "Tipo di attributo esteso non corrispondente",CR,LF
+0208 T 0000 "Il valore dell'attributo esteso non Š previsto",CR,LF
+ASSIGN 3690 0001
+0002 T 0000 "%1: origine impostata a %2:",cr,lf
+CHKDSK 36d5 0063
+0003 T 0000 "Conversione concatenamenti persi in file (S/N)?",CR,LF
+0004 T 0000 " Errore irrecuperabile in indirizzario",CR,LF
+0005 T 0000 " Conversione dell'indirizzario in un file ",CR,LF
+0007 T 0000 "%1 totali su disco",CR,LF
+0008 T 0000 "%1 settori difettosi ",CR,LF
+0009 T 0000 "%1 file nascosti ",CR,LF
+0010 T 0000 "%1 byte in %2 indirizzari" ;dirmes
+0011 T 0000 "%1 byte in %2 file utente" ;filemes
+0012 T 0000 "%1 byte in %2 file ricuperati" ;orphmes2
+0013 T 0000 "%1 byte potrebbero stare in %2 file ricuperati" ;orphmes3
+0014 T 0000 "%1 byte disponibili su disco" ;frespc
+0015 T 0000 "%1 byte di memoria totale" ;totmem
+0016 T 0000 "%1 byte liberi" ;fremem
+0017 T 0000 "CHKDSK non eseguibile su unit… di rete",CR,LF
+0018 T 0000 "CHKDSK impossibile su unit… modificata",CR,LF,"con SUBST o ASSIGN",CR,LF
+0019 T 0000 "Probabile disco non-DOS.",CR,LF,"Si vuole continuare ",CR,LF
+0020 T 0000 "Errore disco leggendo FAT %1",CR,LF ;badr
+0021 T 0000 "Indirizzario %1",CR,LF
+0022 T 0000 "%1 Contiene %2 blocchi non contigui.",CR,LF
+0023 T 0000 "Tutti i file specificati sono contigui.",CR,LF
+0024 T 0000 "Trovati errori, parametro F non specificato",CR,LF,"Correzioni non saranno scritte su disco.",CR,LF
+0025 T 0000 "L'elaborazione non pu• continuare.",CR,LF,"%1%2",CR,LF
+0026 T 0000 "Tabella assegnazione file errata su unit… %1",CR,LF
+0029 T 0000 "CHDIR .. non andato a buon fine,",CR,LF," provare metodo alternativo.",CR,LF
+0030 T 0000 "Ha 'cluster' non valido, file troncato",CR,LF
+0031 T 0000 "Entrata di sottoindirizzario errata.",CR,LF
+0032 T 0000 "Non esiste.",CR,LF
+0033 T 0000 "Il numero del primo 'cluster'",CR,LF," non Š valido, entrata troncata.",CR,LF
+0034 T 0000 "Errore assegnazione, dimensione aggiustata",CR,LF
+0035 T 0000 "Impossibile recupero entrata ",CR,LF," l'elaborazione continua.",CR,LF
+0036 T 0000 "Indirizzario completamente vuoto,",CR,LF," manca '.' o '..',",CR,LF
+0037 T 0000 "Indirizzario collegato",CR,LF
+0038 T 0000 " Impossibile recupero entrata '..'",CR,LF
+0039 T 0000 "L'entrata ha un collegamento non valido",CR,LF
+0040 T 0000 " L'entrata ha un attributo non valido",CR,LF
+0041 T 0000 " L'entrata ha un dimensionamento non valido",CR,LF
+0042 T 0000 "%s",13,10,"Š ,'agganciato al 'cluster' %d",CR,LF
+0043 T 0000 "Non si pu• eseguire CHDIR a",13,10,"%s",CR,LF
+0044 T 0000 " percorso non elaborato",CR,LF," dopo questo punto.",CR,LF
+0045 T 0000 "%1 byte su disco liberati",CR,LF
+0046 T 0000 "%1 byte su disco verrebbero liberati",CR,LF
+0047 T 0000 "Volume %s creato %2 %3 ",CR,LF
+0048 T 0000 "%1 unit… di assegnazione totali su disco"
+0049 T 0000 "%1 byte in ogni unit… di assegnazione" ;idmes2
+0050 T 0000 "CHKDSK non disponibile sull'unit… %1" ;msgExecFailure
+0051 T 0000 " Attributi estesi con 'cluster' non validi, attributi troncati" ;Inv_XA_Msg
+0052 T 0000 " Errore di assegnazione Attributi estesi, attributi troncati" ;Alloc_XA_Msg
+0053 T 0000 "Parametro non valido",CR,LF
+0055 T 0000 "Percorso non trovato",CR,LF
+0056 T 0000 "File non trovato",CR,LF
+0058 T 0000 "Rilevati %1 'cluster' persi in ",CR,LF,"%2 concatenamenti",CR,LF
+0059 T 0000 CR,LF ;crlf_arg
+0060 T 0000 "CHDIR non eseguibile su radice",CR,LF
+0061 T 0000 "Errore disco scrivendo FAT %2 ",CR,LF
+0062 T 0000 " %1" ;noisy_arg
+0063 T 0000 "Indirizzario in uso non valido",CR,LF
+0064 T 0000 "%1",CR,LF ;file_arg
+0065 T 0000 "Spazio insufficiente in indirizzario radice",CR,LF
+0066 T 0000 "%1 %2 %3" ;eup_arg
+0067 T 0000 "%1 %2, %3" ;usp_arg
+0068 T 0000 "%1%2%3%4%5" ;oth_arg
+0069 T 0000 "%1%2%3%4" ;time_arg
+0070 T 0000 "%1 unit… di assegnazione disponibili su disco" ;idmes2 ;an017;bgb
+DEBUG 46ef 0062
+0004 T 0000 "Assegnazione non riuscita o buffer specificato troppo piccolo",CR,LF
+0005 U 0001 "Bad or missing Msg information",CR,LF
+0006 T 0000 "Nome di unit… errato",CR,LF
+0007 T 0000 "Impossibile attivare unit… di stampa PRN",CR,LF
+ "Immettere il nome dell'unit… di stampa " ;badlstmes_ptr
+0008 T 0000 CR,LF ;crlf_ptr
+0009 T 0000 "Programma terminato regolarmente",CR,LF
+0010 T 0000 "Errore di scrittura, destinazione non definita"
+0012 T 0000 "Errore di creazione del file"
+0013 T 0000 "Errore di creazione del file"
+0014 T 0000 "Errore di disco leggendo sull'unit… %1"
+0015 T 0000 "Errore di disco scrivendo sull'unit… %1"
+0016 T 0000 "Errore di protezione da scrittura leggendo sull'unit… %1"
+0017 T 0000 "Errore di protezione da scrittura scrivendo sull'unit… %1"
+0019 T 0000 "%s^ ERRORE"
+0020 T 0000 "Errore su file EXE o HEX"
+0021 T 0000 "File EXE e HEX non si possono scrivere"
+0022 T 0000 "EXEC non andato a buon fine"
+0023 T 0000 "Errore di scrittura, destinazione",CR,LF,"non definita"
+0024 T 0000 "Accesso respinto"
+0025 T 0000 "Segnalati errori di parit… od errori di memoria inesistente"
+0026 T 0000 "-" ;prompt_ptr
+0027 T 0000 "%1 -" ;change_flag_ptr
+0032 T 0000 "%1%2" ;unassem_ln_ptr
+0033 T 0000 "%1:%2 %3" ;hex_ptr
+0034 T 0000 "%1 %2" ;add_ptr
+0035 T 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0000 "%1=%2 " ;register_ptr
+0037 T 0000 "Errore %1" ;errmes_ptr
+0038 T 0000 "%1 byte in scrittura"
+0039 T 0000 "%1:%2=" ;loc_ptr
+0040 T 0000 "%1" ;little_ptr
+0041 T 0000 "%1" ;big_ptr
+0042 T 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "Errore %1 %2 sull'unit… %3",CR,LF
+0044 T 0000 32,8 ;bacmes_ptr
+0045 T 0000 "Impossibile assegnare il gestore dei messaggi",CR,LF ;fatal_error
+0046 T 0000 "%1" ;arg_buf_ptr
+0047 T 0000 "%1" ;one_char_buf_ptr
+0050 T 0000 "Sono state assegnate %1 su %2 pagine EMS totali",cr,lf
+0051 T 0000 "Sono stati assegnati %1 su %2 riferimenti EMS totali",cr,lf
+0054 T 0000 "Segmento di pagina = "
+0055 T 0000 "Riferimento creato = %1 ",cr,lf
+0056 T 0000 "Pagina logica %1 resa corrispondente a pagina fisica %2 ",cr,lf
+0057 T 0000 "Malfunzionamento EMS hardware/software ",cr,lf
+0058 T 0000 "Riferimento non trovato",cr,lf
+0059 T 0000 "Codice di funzione non valido",cr,lf
+0060 T 0000 "Nessun riferimento libero",cr,lf
+0061 T 0000 "Errore di Salvataggio/Ripristino",cr,lf
+0062 T 0000 "Pagine totali superate",cr,lf
+0063 T 0000 "Pagine libere superate",cr,lf
+0064 T 0000 "Errore di parametro",cr,lf
+0065 T 0000 "Pagina logica fuori dei limiti",cr,lf
+0066 T 0000 "Pagina fisica fuori dei limiti",cr,lf
+0067 T 0000 "Area di salvataggio gi… in uso",cr,lf
+0068 T 0000 "Area di salvataggio non in uso",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0000 "Parametro EMS mancante o non valido",cr,lf
+0072 T 0000 "Il riferimento %1 ha %2 pagine assegnate",cr,lf
+0074 T 0000 "Ripristino EMS riuscito regolarmente",cr,lf
+0075 T 0000 "Pagina fisica %1 = porzione del segmento %2",cr,lf
+0076 T 0000 "Riferimento %1 rilasciato",cr,lf
+0078 T 0000 "EMS non installato",cr,lf
+DRIVER 54d5 0002
+0002 T 0000 "Unit… non specificata",CR,LF
+0003 T 0000 "Caricato programma di controllo per",CR,LF,"l'unit… esterna ",CR,LF
+EDLIN 5566 0028
+0006 T 0000 "*" ;prompt_ptr
+0007 T 0000 "Unit… o nome di file non valido",CR,LF
+0008 T 0000 "Deve essere specificato il nome del file",CR,LF
+0009 T 0000 "Parametro non valido",CR,LF
+0010 T 0000 "File di SOLA-LETTURA",CR,LF
+0011 T 0000 "Errore nella creazione del file",CR,LF
+0012 T 0000 "Troppi file aperti",CR,LF
+0013 T 0000 "Errore di lettura in:",13,10,"%S",CR,LF
+0014 T 0000 "Impossibile editare file.BAK ",CR,LF
+0015 T 0000 "Indirizzario privo di spazio per il file",CR,LF
+0016 T 0000 "Disco pieno. Modifiche perdute.",CR,LF
+0017 T 0000 "File non trovato",CR,LF
+0018 T 0000 "Errore di immissione",CR,LF
+0019 T 0000 "Nuovo file",CR,LF ;newfil_ptr
+0020 T 0000 "File nuovo",CR,LF
+0021 T 0000 "O.K.? " ;ask_ptr
+0022 T 0000 "Riga troppo lunga",CR,LF
+0023 T 0000 "Fine del file in immissione",CR,LF
+0024 T 0000 "Si vuole interrompere editazione (S/N)? ",CR,LF
+0025 T 0000 "Si deve specificare il numero della riga di destinazione",CR,LF
+0026 T 0000 "Memoria insufficiente per la fusione dell'intero file",CR,LF
+0027 T 0000 CR,LF ;crlf_ptr
+0028 T 0000 LF ;lf_ptr
+0029 T 0000 "Continuare (S/N)?",CR,LF
+0030 T 0000 "Impossibile stampare messaggio",CR,LF ;fatal_error
+0031 T 0000 "%1" ;arg_buf_ptr
+0032 T 0000 "%1:%2" ;line_num_buf_ptr
+0033 T 0000 "Integrazione impossibile - Code page non corrispondente",CR,LF ;cp_err_ptr
+EXE2BIN 5b62 0009
+0002 T 0000 "Memoria non sufficiente",CR,LF
+0003 T 0000 "Impossibile trovare messaggi",CR,LF
+0004 T 0000 "Accesso respinto",CR,LF
+0005 T 0000 "Il file non pu• essere convertito",CR,LF
+0006 T 0000 "File non trovato",CR,LF
+0007 T 0000 "Errore di creazione del file",CR,LF
+0008 T 0000 "Correzioni necessarie - segmento base (hex):"
+0011 T 0000 "ATTENZIONE - Errore di lettura sul file EXE.",CR,LF
+ "La quantit… letta Š minore della dimensione nella testata.",CR,LF
+0012 T 0000 "Deve essere specificato il nome del file",CR,LF
+FIND 5d8b 0001
+0004 T 0000 "FIND: "
+FORMAT 5db5 0044
+0002 T 0000 CR,"%1 percento del disco formattato"
+0004 T 0000 "Formattazione completata ",CR,LF
+0007 T 0000 "Inserire un nuovo minidisco nell'unit… %1:",CR,LF
+0009 T 0000 "Reinserire il minidisco nell'unit… %1:",CR,LF
+0010 T 0001 "Etichetta di Volume (11 caratteri max. ) "
+0011 T 0000 "Format non possibile sull'unit… %1:",CR,LF
+0012 T 0000 "Parametri unit… non validi",CR,LF
+0013 T 0000 "Errore nella chiamata IOCTL",CR,LF
+0014 T 0000 "Non Š un dispositivo a blocchi",CR,LF
+0015 T 0000 "Errore scrivendo FAT",CR,LF
+0016 T 0000 "Errore di scrittura nell'indirizzario ",CR,LF
+0017 T 0000 CR,"Formattazione impossibile su unit…",CR,LF,"modificata con SUBST o ASSIGN ",CR,LF
+0018 T 0000 CR,"Impossibile trovare file di sistema",CR,LF
+0019 T 0000 CR,"FORMAT impossibile su una unit… di rete",CR,LF
+0020 T 0000 "Caratteri non validi nell'etichetta di volume ",CR,LF
+0021 T 0000 "Formattazione non andata a buon fine",CR,LF
+0022 T 0000 CR,"Formattazione terminata ",CR,LF
+0023 T 0000 CR,"Disco inadatto per disco di sistema",CR,LF
+0024 T 0000 CR,"Disco inadatto o Pista 0 difettosa ",CR,LF,"- disco inutilizzabile",CR,LF
+0025 T 0000 CR,"Impossibile scrivere registrazione BOOT ",CR,LF
+0026 T 0000 CR,"Errore leggendo l'indirizzario",CR,LF
+0028 T 0000 CR,"e premere INVIO quando pronti ",CR,LF
+0029 T 0000 CR,"Identificativo del volume non valido ",CR,LF
+0031 T 0000 CR,"Immettere etichetta di volume in uso ",CR,LF,"per l'unit… %1: "
+0032 T 0000 CR,"Parametro incompatibile con disco fisso",CR,LF
+0035 T 0000 CR,"Errore leggendo la tabella partizioni ",CR,LF
+0037 T 0000 CR,"Formattazione interrotta",CR,LF
+0038 T 0000 CR,"Format non disponibile sull'unit… %1",CR,LF
+0039 T 0000 CR,"Sistema non su disco o errore di disco",CR,LF
+0040 T 0000 CR,"Tabella partizioni danneggiata ",CR,LF
+0041 T 0000 CR,"Parametri non previsti per l'unit…",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"Inserire il minidisco DOS nell'unit… %c:",CR,LF
+0045 T 0000 CR,LF,"ATTENZIONE! TUTTI I DATI SUL DISCO FISSO",CR,LF
+ "UNITA' %c: ANDRANNO PERSI!",CR,LF
+ "Si vuole formattare comunque (S/N)?"
+0046 T 0000 CR,"Altro disco da formattare (S/N)?",CR,LF
+0047 T 0000 CR,"Errore leggendo la tabella partizioni ",CR,LF
+0048 T 0000 CR,"Errore scrivendo la tabella partizioni",CR,LF
+0049 T 0000 CR,"Parametri non compatibili",CR,LF
+0050 T 0000 "%1 unit… di assegnazione disponibile(i) su disco",CR,LF
+0051 T 0000 "%1 byte in ogni unit… di assegnazione",CR,LF
+0052 T 0000 CR,"Errore scrivendo la tabella partizioni",CR,LF
+0053 T 0000 CR,"Stesso parametro immesso due volte",CR,LF
+0054 T 0000 CR,"Devono essere immessi entrambi i parametri /T e /N",CR,LF
+JOIN 689b 0001
+0002 T 0000 CR,LF,"L'indirizzario non Š vuoto",CR,LF
+MORE 68e5 0001
+0002 T 0000 "-- Ancora --"
+PRINT 6915 0022
+0002 T 0000 CR,LF
+0006 T 0000 "leggendo il file",CR,LF,"$"
+0007 T 0000 "File non trovato",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"File $"
+0009 T 0000 "cancellato dall'operatore$"
+0010 T 0000 CR,LF,LF "Tutti i file cancellati dall'operatore$"
+0011 T 0000 "Tabella assegnazione file errata su unit…"
+0012 T 0000 "A.",CR,LF,"$"
+0013 T 0000 "Emissione non assegnata ad una unit…",CR,LF
+0014 T 0000 "Parte residente di PRINT installata",CR,LF
+0015 T 0000 "Impossibile usare PRINT - usare NET PRINT",CR,LF
+0017 T 0000 "La coda di STAMPA Š piena",CR,LF
+0018 T 0000 "La coda di STAMPA Š vuota",CR,LF
+0019 T 0000 "Accesso respinto",CR,LF
+0020 T 0000 "Identificativo dell'unit… non valido",CR,LF
+0021 T 0000 "Errori su unit… di stampa indicano che ",CR,LF
+ "pu• essere fuori linea. Controllare.",CR,LF
+0022 T 0000 CR,LF,LF," %1 Š in stampa ",CR,LF
+0023 T 0000 "Š in coda",CR,LF
+0024 T 0000 "File %s",CR,LF,"non trovato",CR,LF
+0025 T 0000 "nome di percorso troppo lungo",CR,LF
+0026 T 0000 "File non in coda di STAMPA",CR,LF
+0027 T 0000 "Nome dell'unit… di stampa [PRN]: "
+RECOVER 6d5f 0012
+0002 T 0000 CR,LF,"File non trovato",CR,LF
+0003 T 0000 CR,LF,"RECOVER impossibile su unit… modificata",CR,LF,"con SUBST o ASSIGN",CR,LF
+0004 T 0000 CR,LF,"Unit… o nome di file non valido",CR,LF
+0005 T 0000 CR,LF,"Attenzione - indirizzario pieno",CR,LF
+0006 T 0000 CR,LF,"Impossibile eseguire RECOVER su",CR,LF,"una unit… di rete",CR,LF
+0007 T 0000 CR,LF,"Recupero non disponibile sull'unit… %1",CR,LF
+0008 T 0000 CR,LF,"%1 file ricuperato(i)",CR,LF
+0009 T 0000 CR,LF,"%1 su %2 byte ricuperato(i)",CR,LF
+0010 T 0000 CR,LF,"Premere un tasto per iniziare ricupero",CR,LF
+0011 T 0000 CR,LF,"Impossibile leggere la tabella di assegnazione file",CR,LF
+0012 T 0000 CR,LF,"Impossibile scrivere la tabella di assegnazione file",CR,LF
+0013 T 0000 CR,LF
+SORT 7066 0001
+0005 T 0000 "SORT: "
+SUBST 7090 0001
+0002 T 0000 CR,LF,"Numero di parametri non valido",CR,LF
+SYS 70de 0008
+0004 T 0000 "Identificativo dell'unit… non valido",CR,LF
+0007 T 0000 "Manca spazio per il DOS sul disco",CR,LF,"destinazione",CR,LF
+0008 T 0000 "Ampiezza di sistema incompatibile",CR,LF
+0010 T 0000 "Manca il sistema sull'unit… assunta",CR,LF
+0011 T 0000 "Impossibile specificare l'unit… assunta",CR,LF ; New
+0012 T 0000 "Errore di scrittura, minidisco non utilizzabile",CR,LF ; New
+0014 T 0000 "Inserire il disco di sistema nell'unit… %1",CR,LF
+0016 T 0000 "Impossibile eseguire SYS su file per il sistema %1",CR,LF ; New
+SHARE 7326 0000
+NLSFUNC 733a 0000
+ANSI 734e 0001
+0010 T 0000 "Parametro non valido - %1",CR,LF ; 'Parametro non valido'
+IFSFUNC 73ac 0001
+0004 T 0000 "Nessun programma di controllo IFS trovato",CR,LF
+PSPRINT 73ff 0007
+0002 T 0000 "leggendo il file",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"File cancellato dall'operatore",CR,FORMFD,BELL
+0004 T 0000 "Tabella assegnazione file errata su unit…"
+0005 T 0000 "A.",CR,LF,"$"
+0006 T 0000 "Emissione non assegnata ad una unit…",CR,LF
+0007 T 0000 "PSPRINT Š gi… installato",CR,LF
+0008 T 0000 "Conflitto PSPRINT/PRINT",CR,LF
+BACKUP 7579 0022
+0002 T 0000 CR,LF,"Memoria non sufficiente",CR,LF
+0006 T 0000 CR,LF,"Identificativo dell'unit… non valido",CR,LF
+0014 T 0000 CR,LF,"Stesse unit… di origine e di destinazione",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Errore nell'apertura del file di registrazione",CR,LF
+0018 T 0000 CR,LF,"Registrazione informazioni di backup sul file %1",CR,LF
+0019 T 0000 CR,LF,"Ultimo minidisco di salvataggio non inserito",CR,LF
+0020 T 0000 CR,LF,"Attenzione! I file nell'indirizzario",CR,LF
+ "radice del disco destinazione %1:\ saranno cancellati",CR,LF
+0021 T 0000 CR,LF,"Attenzione! I file nell'indirizzario",CR,LF
+ "%1:\BACKUP del disco destinazione saranno cancellati",CR,LF
+0022 T 0000 CR,LF,"*** Salvataggio file nell'unit… %1: ***",CR,LF
+0023 T 0000 CR,LF,"Minidisco numero: %1",CR,LF
+0024 T 0000 CR,LF,"Attenzione! Non trovati file da salvare",CR,LF
+0025 T 0000 CR,LF,"Inserire il minidisco da salvare nell'unit… %1:",CR,LF
+0026 T 0000 CR,LF,"Inserire il minidisco di destinazione",CR,LF,"salvataggio %1 nell'unit… %2:",CR,LF
+0027 T 0000 CR,LF,"*** Impossibile salvare il file ***",CR,LF
+0028 T 0000 CR,LF,"Inserire l'ultimo minidisco",CR,LF,"di salvataggio nell'unit… %1:",CR,LF
+0029 T 0000 CR,LF,"Impossibile usare il disco di destinazione",CR,LF,"per salvataggio",CR,LF
+0030 T 0000 CR,LF,"*** L'ultimo file non Š stato salvato ***",CR,LF
+0031 T 0000 CR,LF,"Il disco fisso di salvataggio %c: Š pieno",CR,LF
+0032 T 0000 CR,LF,"Impossibile usare il disco di destinazione",CR,LF,"per salvataggio",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 7bf1 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 7c2b 0013
+0004 T 0000 "10 errori di comparazione",CR,LF,"- comparazione terminata",CR,LF,BELL
+0006 T 0000 " Errore di comparazione alla posizione: ",CR,LF
+0007 T 0000 "File 1 = %1",CR,LF
+0008 T 0000 "File 2 = %1",CR,LF
+0009 T 0000 "Non trovato carattere di fine file",CR,LF
+0010 T 0000 "Comparazione file OK",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Immettere nome del file primario",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Immettere nome del secondo file o",CR,LF,"identificativo unit…",CR,LF
+0017 T 0000 "I file hanno dimensioni differenti",CR,LF
+0018 T 0000 "Altri file da confrontare? (S/N)"
+0019 T 0000 "%1 e %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Comparazione file OK",CR,LF
+DISKCOMP 7eda 0016
+0004 T 0000 "Non specificare nome(i) di file.",CR,LF
+ "Formato comando: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0000 CR,LF,"Identificativo unit… non valido.",CR,LF
+ "L'unit… indicata non esiste,",CR,LF
+ "o Š un disco fisso.",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP impossibile da o su",CR,LF
+ "un'unit… di Rete ",CR,LF
+0007 T 0000 CR,LF,"Inserire il PRIMO minidisco nell'unit… %1:",CR,LF
+0008 T 0000 CR,LF,"Inserire il SECONDO minidisco nell'unit… %1:",CR,LF
+0009 T 0000 CR,LF,"PRIMO minidisco difettoso o incompatibile",CR,LF
+0010 T 0000 CR,LF,"SECONDO minidisco difettoso",CR,LF,"o incompatibile",CR,LF
+0014 T 0000 CR,LF,"Altro minidisco da comparare (S/N) ?"
+0015 T 0000 CR,LF,"%1 piste in comparazione",CR,LF
+ "%2 settori/pista, %3 faccia(e)",CR,LF
+0016 T 0000 CR,LF,"Tipo minidisco o tipo unit…",CR,LF
+ "non compatibili",CR,LF
+0017 T 0000 CR,LF,"Errore di lettura non ricuperabile",CR,LF,"sull'unit… %2",CR,LF
+ "faccia %3, pista %4",CR,LF
+0018 T 0000 CR,LF,"Errore di comparazione sulla",CR,LF,"faccia %3, pista %4",CR,LF
+0019 T 0000 "Assicurarsi che il minidisco sia inserito",CR,LF ;AN004;
+ "nell'unit… e che la levetta sia chiusa.",CR,LF ;AN004;
+0020 T 0000 CR,LF,"Comparazione terminata",CR,LF
+0021 T 0000 CR,LF,"Comparazione OK",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 8414 0018
+0002 T 0000 CR,LF
+0004 T 0000 "Non specificare nome(i) di file.",CR,LF
+ "Formato comando: DISKCOPY d: d: [/1]",CR,LF
+0005 T 0000 CR,LF,"Identificativo unit… non valido.",CR,LF
+ "L'unit… indicata non esiste,",CR,LF
+ "o Š un disco fisso.",CR,LF
+0006 T 0000 CR,LF,"DISKCOPY impossibile da o su",CR,LF
+ "un'unit… di Rete",CR,LF
+0007 T 0000 CR,LF,"Formattazione durante la copia",CR,LF
+0008 T 0000 CR,LF,"Inserire minidisco ORIGINE nell'unit… %1:",CR,LF
+0009 T 0000 CR,LF,"Inserire minidisco DESTINAZIONE nell'unit… %1:",CR,LF
+0010 T 0000 "Assicurarsi che il minidisco sia inserito",CR,LF ;AN004;
+ "nell'unit… e che la levetta sia chiusa.",CR,LF ;AN004;
+0011 T 0000 CR,LF,"Minidisco destinazione",CR,LF,"pu• essere inutilizzabile",CR,LF
+0012 T 0000 CR,LF,"Minidisco destinazione inutilizzabile",CR,LF
+0016 T 0000 CR,LF,"Altro minidisco da copiare (S/N)? "
+0017 T 0000 CR,LF,"%1 piste in copia",CR,LF
+ "%2 settori/pista, %3 faccia(e)",CR,LF
+0018 T 0000 CR,LF,"Tipo minidisco o tipo unit…",CR,LF
+ "non compatibili.",CR,LF
+0019 T 0000 CR,LF,"Errore di lettura non recuperabile sull'unit… %1",CR,LF
+ "Faccia %2, pista %3",CR,LF
+0020 T 0000 CR,LF,"Errore di scrittura non recuperabile sull'unit… %1",CR,LF
+ "Faccia %2, pista %3",CR,LF
+0021 T 0000 CR,LF,"Copia terminata",CR,LF
+0022 T 0000 CR,LF,"Minidisco ORIGINE difettoso",CR,LF,"o incompatibile"
+0023 T 0000 CR,LF,"Minidisco DESTINAZIONE difettoso",CR,LF,"o incompatibile"
+LABL 89f4 0000
+MODE 8a08 0055
+0003 T 0000 CR,LF,"COM1,COM2,COM3 o COM4 devono essere specificati",CR,LF
+0004 T 0000 CR,LF,"Caricata parte residente",CR,LF,"del comando MODE",CR,LF
+0005 T 0000 CR,LF,"Nome di unit… non valido",CR,LF
+0006 T 0000 CR,LF,"Errore della stampatrice",CR,LF
+0007 T 0000 CR,LF,"LPT%1: predisposta per 80 caratteri",CR,LF
+0008 T 0000 CR,LF,"LPT%1: predisposta per 132 caratteri",CR,LF
+0009 T 0000 CR,LF,"Predisposte righe di stampa per pollice",CR,LF
+0010 T 0000 CR,LF,"Velocit… trasmissione specificata non valida",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 T 0000 CR,LF,"Si vede %1? (S/N) "
+0014 T 0000 CR,LF,"Parametro non valido",CR,LF
+0015 T 0001 "LPT%1: reindirizzato a COM%2:",CR,LF
+0016 T 0001 "LPT%1: non reindirizzato",CR,LF
+0017 T 0000 CR,LF,"%1 dopo time-out",CR,LF,"stampatrice parallela",CR,LF
+0018 T 0000 CR,LF,"Impossibile far scorrere lo schermo %1",CR,LF
+0020 T 0000 CR,LF,"Numero di parametri non valido",CR,LF
+0021 T 0000 CR,LF,"NET 042: Il comando richiesto non pu• essere eseguito",CR,LF
+0022 T 0000 CR,LF,"Tentativi ripetitivi non previsti sulla stampatrice di Rete di PC",cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 T 0000 CR,LF,"Accesso non riuscito al file di definizione",CR,LF,"dei caratteri della code page",CR,LF
+0025 T 0000 CR,LF,"Unit… o code page mancante nel file",CR,LF,"di definizione dei caratteri",cr,lf
+0026 T 0000 CR,LF,"Contenuto del file di definizione",13,10,"dei caratteri non valido",CR,LF
+0027 T 0000 CR,LF,"E' stata sostituita la code page precedente",CR,LF
+0028 T 0000 CR,LF,"La code page attiva per l'unit… %1 Š %2",CR,LF
+0029 T 0000 CR,LF,"Non Š stata preparata l'unit… %1",CR,LF
+0030 T 0000 "code page %1:",CR,LF
+0031 T 0000 " Code page %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0000 CR,LF,"E' stata completata la funzione MODE %1 della code page",CR,LF
+0033 T 0000 CR,LF,"Errore di %1 della Global Code Page",CR,LF ;FILLED IN with "setting" or "getting"
+0034 T 0000 CR,LF,"Impostazione della code page corrente:",CR,LF ;table header
+0035 T 0000 " %1 - Code page %2",CR,LF
+0036 T 0000 " La code page non Š stata preparata",CR,LF
+0037 T 0000 "L'operazione di code page",CR,LF,"non Š prevista per questa unit…",CR,LF
+0038 T 0000 "Nessuna code page Š stata selezionata",CR,LF
+0039 T 0000 "Errore sull'unit… durante l'operazione di %1",CR,LF
+0040 T 0000 "La code page non Š stata preparata correttamente",CR,LF
+0041 T 0000 CR,LF,"Questa code page non Š prevista dal programma",CR,LF,"di tastiera in uso",CR,LF
+0042 T 0000 CR,LF,"Errore durante la letture del file",CR,LF,"di definizione dei caratteri",CR,LF
+0043 T 0000 CR,LF,"Impossibile eseguire l'operazione di REFRESH",CR,LF
+0044 T 0000 CR,LF ;used for formatting
+0045 T 0000 CR,LF,"Status per l'unit… %1:",CR,LF ;header for status reports
+0046 T 0000 "------------------" ;first part of underline under "Status for device %1:"
+0047 T 0000 "----",CR,LF ;four_char_underline
+0048 T 0000 "-----",CR,LF ;five_char_underline
+0049 T 0000 "LINES=%1",CR,LF
+0050 T 0000 "COLUMNS=%1",CR,LF
+0051 T 0000 CR,LF,"RATE e DELAY devono essere specificati insieme",CR,LF
+0052 T 0000 "RATE=%1",CR,LF
+0053 T 0000 "DELAY=%1",CR,LF
+0054 T 0000 CR,LF,"Funzione non prevista su questo sitema - %1",CR,LF
+0055 T 0000 CR,LF,"Font richiesta non caricata",CR,LF
+0056 T 0000 CR,LF,"Installare ANSI.SYS per eseguire la funzione richiesta",CR,LF
+0057 T 0000 CR,LF,"Velocit… richiesta in Baud",CR,LF
+0058 T 0000 "RETRY=%1",CR,LF
+RESTORE 9857 0022
+0002 T 0000 CR,LF,"Stesse unit… di origine e di destinazione",CR,LF
+0003 T 0000 CR,LF,"Numero di parametri non valido",CR,LF
+0006 T 0000 CR,LF,"Identificativo dell'unit… non valido",CR,LF
+0007 T 0000 CR,LF,"Attenzione! Non trovati file da ripristinare",CR,LF
+0008 T 0000 CR,LF,"Inserire minidisco salvataggio %1 %2:",CR,LF
+0009 T 0000 CR,LF,"Inserire minidisco di destinazione %1:",CR,LF
+0011 T 0000 CR,LF,"Attenzione! Il minidisco Š fuori sequenza.",CR,LF
+ "Sostituirlo o continuare se previsto.",CR,LF
+0012 T 0000 CR,LF,"L'ultimo file non Š stato ripristinato",CR,LF
+0013 T 0000 CR,LF,"*** File salvati il %1 ***",CR,LF
+0014 T 0000 CR,LF,"Il disco origine non contiene file di salvataggio",CR,LF
+0015 T 0000 CR,LF,"Memoria non sufficiente",CR,LF
+0016 T 0000 CR,LF,"Attenzione! Il file %1",CR,LF
+ "Š di sola lettura",CR,LF
+ "Si vuole sostituire il file (S/N)?",CR,LF
+0017 T 0000 CR,LF,"Errore di sequenza su file di ripristino",CR,LF
+0018 T 0000 CR,LF,"Errore di creazione del file",CR,LF
+0019 T 0000 CR,LF,"Spazio su disco insufficiente ",CR,LF
+0020 T 0000 CR,LF,"*** Impossibile ripristinare il file ***",CR,LF
+0021 T 0000 CR,LF,"*** File in ripristino dall'unit… %1: ***",CR,LF
+0022 T 0000 CR,LF,"Attenzione! Il file %1",CR,LF
+ "risultare non autocaricante",CR,LF
+ "Si vuole sostituire il file (S/N)?",CR,LF
+0023 T 0000 "Minidisco: %1",CR,LF
+0024 T 0000 CR,LF,"Errore insolito",CR,LF
+0025 T 0000 07 ;For BEEP !
+0026 T 0000 CR,LF,"Errore ripristinando attributi estesi",CR,LF
+SELECT 9e56 0016
+0004 T 0000 "Supporto di caricamento SELECT non valido",CR,LF,CR,LF
+ "Inserire il minidisco INSTALL nell'unit… A: e riprovare"
+0005 T 0000 "Disco/Minidisco non valido",CR,LF,CR,LF
+ "Inserire il minidisco INSTALL nell'unit… A: e riprovare"
+0006 T 0000 "Parametri non validi sulla riga comandi di SELECT",CR,LF,CR,LF
+ "Assicurarsi che il minidisco INSTALL sia nell'unit… A:,",CR,LF
+ "quindi premere Ctrl+Alt+Canc per riavviare."
+0007 T 0000 BELL,"Impossibile installare il DOS. Programma terminato",CR,LF
+0008 T 0000 "Caricamento SELECT in corso. Attendere..."
+0009 T 0000 "Per continuare Š necessario riavviare il sistema.",CR,LF,CR,LF
+ "Per continuare l'installazione del DOS premere Ctrl+Alt+Canc."
+0010 T 0000 "Inserire il minidisco SELECT nell'unit… A:",CR,LF,CR,LF
+ "Per continuare l'installazione del DOS premere INVIO,",CR,LF
+ "o premere Esc per uscire.",CR,LF
+0011 T 0000 BELL
+0012 T 0000 "Inserire il minidisco SELECT nell'unit… A:",CR,LF,CR,LF
+ "Premere INVIO per continuare",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE a5f2 0004
+0002 T 0000 " LISTA PERCORSI INDIRIZZARIO DEL VOLUME %1",CR,LF ;define message ;AN000;
+0003 T 0000 " Lista PERCORSI Indirizzario",CR,LF ; ;AN000;
+0004 T 0000 "Non esistono sottoindirizzari",CR,LF,LF ; ;AN000;
+0007 T 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE a76b 0009
+0003 T 0000 CR,LF,"Nessun file sostituito",CR,LF
+0004 T 0000 CR,LF,"Nessun file aggiunto",CR,LF
+0013 T 0000 CR,LF," Si sta sostituendo %1",CR,LF
+0014 T 0000 CR,LF," Si sta aggiungendo %1",CR,LF
+0015 T 0000 CR,LF,"%1 file sostituito(i)",CR,LF
+0016 T 0000 CR,LF,"%1 file aggiunto(i)",CR,LF
+0017 T 0000 CR,LF,"File non trovati '%1'",CR,LF
+0022 T 0000 CR,LF," Si deve sostituire il %1? (S/N)"
+0023 T 0000 CR,LF," Si deve aggiungere il %1? (S/N)"
+XCOPY a943 0019
+0004 T 0000 "Il %1 specifica come",CR,LF ;AN000;
+ "destinazione un nome di file o di indirizzario?",CR,LF
+ "(F = file, I = indirizzario)"
+0005 T 0000 "Premere un tasto per inizio copia file" ;AN000;
+0006 T 0000 "Percorso troppo lungo",CR,LF ;AN000;
+0008 T 0000 "Impossibile eseguire una copia ciclica",CR,LF ;AN000;
+0012 T 0000 "XCOPY impossibile da un'unit… riservata ",CR,LF ;AN000;
+0021 T 0000 "Numero di parametri non valido ",CR,LF
+0022 T 0000 "XCOPY impossibile su un'unit… riservata",CR,LF ;AN000;
+0024 T 0000 "Errore di creazione del file",CR,LF ;AN000;
+0025 T 0000 "File origine in lettura... ",CR,LF
+0026 T 0000 CR,LF ;AN000;
+0027 T 0000 "%1 File copiato(i)",CR,LF
+0028 T 0000 "%1 File non trovato",CR,LF ;AN000;
+0029 T 0000 "F D " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0000 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 T 0000 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0000 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 T 0000 "%1%2 (S/N)?" ;AN000;P_S_PATH_FILE0
+0034 T 0000 "%1\%2 (S/N)?" ;AN000;P_S_PATH_FILE1
+0035 T 0000 "Scambio %1 non valido",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK ae04 0013
+0002 T 0000 "Memoria non sufficiente",CR,LF
+0003 T 0000 "Disco virtuale VDISK %1 Versione 3.40",CR,LF ;AN000;
+0004 T 0000 "Dimensione ottimizzata della memoria di transito",CR,LF ;AN000;
+0005 T 0000 " Dimensione ottimizzata del settore",CR,LF ;AN000;
+0006 T 0000 " Numero entrate indirizzario ottimizzato "CR,LF
+0007 T 0000 " Carattere di commutazione non valido",CR,LF
+0008 T 0000 " Dimensione ottimizzata del trasferimento",CR,LF
+0009 T 0000 " Dimensione memoria di transito: ",CR,LF
+0010 T 0000 " Entrate dell'indirizzario: ",CR,LF
+0011 T 0000 " Dimensione del trasferimento: %1",CR,LF
+0012 T 0000 " Dimensione del trasferimento: %1",CR,LF ;AN000;
+0013 T 0000 "VDISK non installato -",CR,LF
+0014 T 0000 " Posizionamento interruttori nella",CR,LF
+ "scheda di espansione non coincide con la",CR,LF," dimensione della memoria",CR,LF ;AN000;
+GRAFTABL b1bc 0005
+0002 T 0000 "Code page attiva: %1",CR,LF
+0003 T 0000 "Code page precedente: %1",CR,LF
+0004 T 0000 "Nessuna",NULL
+0005 T 0000 "Non standard",NULL
+0006 T 0000 CR,LF,"Parametri della linea dei comandi DOS disponibili",COLON,CR,LF,LF
+ " /STA - Richiesta stato (solo per informazioni sullo stato)",CR,LF
+ " ? - Visualizzare questa lista di parametri",CR,LF,CR,LF
+ " Code Page disponibile",COLON,CR,LF
+ " 437 - Serie di caratteri grafici statunitense",CR,LF
+ " 850 - Serie di caratteri grafici multilingue",CR,LF
+ " 860 - Serie di caratteri grafici pertoghese",CR,LF
+ " 863 - Serie di caratteri grafici per Canada francese",CR,LF
+ " 865 - Serie di caratteri grafici nordica",CR,LF
+FASTOPEN b4a0 0016
+0004 T 0000 CR,LF,"FASTOPEN installato",CR,LF
+0005 T 0000 CR,LF,"FASTOPEN Š gi… installato",CR,LF ;AN000;
+0006 T 0000 CR,LF,"Parametro errato",CR,LF ;AN000;
+0007 T 0000 CR,LF,"Sono state immesse troppe unit…",CR,LF
+0008 T 0000 CR,LF,"Stessa unit… specificata pi— di una volta",CR,LF
+0009 T 0000 CR,LF,"Parametro non valido",CR,LF ;AN000;
+0010 T 0000 CR,LF,"Tipo di scambio non valido",CR,LF ;AN000;
+0011 T 0000 CR,LF,"Puntatore non valido",CR,LF ;AN000;
+0012 T 0000 CR,LF,"Numero di voci del file/indirizzario non valido",CR,LF
+0013 T 0000 CR,LF,"Impossibile attivare memoria espansa",CR,LF ;AN000;
+0014 T 0000 CR,LF,"Memoria espansa non disponibile",CR,LF ;AN000;
+0015 T 0000 CR,LF,"Identificativo dell'unit… non valido %1",CR,LF
+0016 T 0000 CR,LF,"Spazio insufficiente in EMS. Memoria usata non sufficiente",CR,LF ;AN000;
+0017 T 0000 CR,LF,"Impossibile usare FASTOPEN per l'unit… %1",CR,LF
+0018 T 0000 CR,LF,"Troppi puntatori",CR,LF
+0019 T 0000 CR,LF,"Troppe voci del file/indirizzario",CR,LF
+APPEND b8c8 0009
+0001 T 0000 "Versione del comando APPEND non corretta",CR,LF
+0002 T 0000 "Percorso non valido",CR,LF
+0003 T 0000 "Parametro non valido",CR,LF
+0004 T 0000 "Combinazione di parametri non valida",CR,LF
+0005 T 0000 "Nessun Append",CR,LF
+0006 T 0000 "Conflitto APPEND/ASSIGN",CR,LF
+0007 T 0000 "Conflitto APPEND/TopView",CR,LF
+0008 T 0000 "Versione DOS non corretta",CR,LF
+0009 T 0000 "APPEND Š gi… installato",CR,LF
+GRAPHICS ba81 0012
+0005 T 0000 "Parametro non valido: %1",CR,LF ;AN000
+0007 T 0000 "Parametri doppi non consentiti",CR,LF ;AN000
+0009 T 0000 "Impossibile trovare il profilo di GRAPHICS",CR,LF ;AN000
+0010 T 0000 "Prima della riga %1 manca l"istruzione profilo richiesta",CR,LF ;AN000
+0011 T 0000 "Istruzione profilo non valida a riga %1",CR,LF ;AN000
+0012 T 0000 "Istruzione profilo fuori sequenza a riga %1",CR,LF ;AN000
+0013 T 0000 "Errore leggendo il profilo di GRAPHICS",CR,LF ;AN000
+0014 T 0000 "Errori di sintassi nel profilo di GRAPHICS",CR,LF ;AN000
+0015 T 0000 "ID della stampante non presente nel profilo di GRAPHICS",CR,LF
+0016 T 0000 "Tipo di stampante non presente nel profilo di GRAPHICS",CR,LF ;AN000
+0017 T 0000 "/B non valido con una stampante in bianco e nero",CR,LF ;AN000
+0018 T 0000 "Impossibile ricaricare con il profilo fornito",CR,LF ;AN000
+DISPLAY bf13 0003
+0002 T 0000 "%1 non pu• essere inizializzato",CR,LF
+0008 T 0000 "Memoria non sufficiente",CR,LF
+0012 T 0000 "Sintassi non valida nel programma di controllo",CR,LF
+PRINTER bfcd 0002
+0002 T 0000 "%1 non pu• essere inizializzato",CR,LF
+0012 T 0000 "Sintassi non valida nel programma di controllo",CR,LF
+KEYB c05a 0016
+0002 T 0000 "Codice corrente della tastiera: %1"
+0003 T 0000 "Identificativo corrente della tastiera: %1"
+0004 T 0000 " code page: %1",CR,LF
+0005 T 0000 "Code page corrente per l'unit… CON : %1",CR,LF
+0006 T 0000 "E' stato specificato un codice della tastiera non valido",CR,LF
+0007 T 0000 "L'identificativo della tastiera specificato non Š valido",CR,LF
+0008 T 0000 "E' stata specificata una code page non valida",CR,LF
+0009 T 0000 "Il file di definizione della tastiera Š mancante o alterato",CR,LF
+0010 T 0000 "KEYB non Š stato installato",CR,LF
+0011 T 0000 "La code page attiva non Š disponibile dall'unit… CON",CR,LF
+0012 T 0000 "La code page specificata non Š stata preparata",CR,LF
+0013 T 0000 "Una o pi— code page dell'unit… CON non valide",CR,LF
+0014 T 0000 "La code page richiesta (%1) non Š valida per il codice della tastiera immesso",CR,LF
+0015 T 0000 "La code page specificata Š in contrasto con la code page selezionata",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "Non Š possibile creare la tabella KEYB in memoria residente",CR,LF
+REDIRSYS c4d9 0000
+MEM c4ed 0036
+0010 T 0000 CR,LF
+0011 T 0000 " Indiriz Nome Dimens Tipo ",CR,LF
+0012 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0000 " Riferim Nome EMS Dimens ",CR,LF
+0014 T 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0000 " %06lX %-8.8s %06lX %s",CR,LF
+0016 T 0000 " %-8.8s %06lX %s ",CR,LF
+0017 T 0000 " %-8.8s %s "CR,LF
+0018 T 0000 "%10ld byte di memoria totale",CR,LF
+0019 T 0000 "%10ld byte disponibili",CR,LF
+0020 T 0000 "%10ld massima dimensione del programma eseguibile",CR,LF
+0021 T 0000 "%10ld byte di memoria EMS totale",CR,LF
+0022 T 0000 "%10ld byte liberi di memoria EMS",CR,LF
+0023 T 0000 "%10ld byte di memoria estesa totale",CR,LF
+0024 T 0000 "Vettore d'interruzione" ;
+0025 T 0000 "Area per le comunicazioni ROM" ;
+0026 T 0000 "Area per le comunicazioni DOS" ;
+0027 T 0000 "IBMBIO" ;
+0028 T 0000 "IBMDOS" ;
+0029 T 0000 "Dati di sistema" ;
+0030 T 0000 "Programma di sistema" ;
+0031 T 0000 "Programma di controllo unit… del sistema" ;
+0032 T 0000 "Programma di controllo unit… installato" ;
+0033 T 0000 "%c:" ;
+0034 T 0000 "%c: - %c:" ;
+0035 T 0000 "BUFFERS=" ;
+0036 T 0000 "FILES=" ;
+0037 T 0000 "FCBS=" ;
+0038 T 0000 "STACKS=" ;
+0039 T 0000 "DRIVER=" ;
+0040 T 0000 "IFS=" ;
+0041 T 0000 "LASTDRIVE=" ;
+0042 T 0000 "ÄÄÄÄÄÄÄÄÄÄ" ;
+0043 T 0000 " ";
+0044 T 0000 "%1%2%3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR cade 0040
+0004 T 0000 "La rete non Š stata avviata",CR,LF
+0050 T 0000 "NET809: Richiesta di rete non prevista",CR,LF,0
+0051 T 0000 "NET801: Sistema remoto non in ricezione",CR,LF,0
+0052 T 0000 "NET802: Nome duplicato sulla rete",CR,LF,0
+0053 T 0000 "NET803: Percorso della rete non trovato",CR,LF,0
+0054 T 0000 "NET804: Rete occupata",CR,LF,0
+0055 T 0000 "NET805: L'unit… della rete non esiste pi—",CR,LF,0
+0056 T 0000 "NET806: Superato il limite del comando NETBIOS",CR,LF,0
+0057 T 0000 "NET807: Errore di sistema; errore di NETBIOS",CR,LF,0
+0058 T 0000 "NET808: Risposta errata dalla rete",CR,LF,0
+0059 T 0000 "NET810: Errore di rete non previsto",CR,LF,0
+0060 T 0000 "NET811: Adattatore remoto non compatibile",CR,LF,0
+0061 T 0000 "NET812: Coda di stampa piena",CR,LF,0
+0062 T 0000 "NET813: Spazio non sufficiente per il file di stampa",CR,LF,0
+0063 T 0000 "NET814: Il file di stampa Š stato cancellato",CR,LF,0
+0064 T 0000 "NET815: Il nome della rete Š stato cancellato",CR,LF,0
+0065 T 0000 "Accesso respinto",CR,LF,0
+0066 T 0000 "NET817: Tipo di unit… della rete errato",CR,LF,0
+0067 T 0000 "NET818: Nome della rete non trovato",CR,LF,0
+0068 T 0000 "NET819: Superato il limite del nome della rete",CR,LF,0
+0069 T 0000 "NET820: Superato il limite della sessione BIOS della rete",CR,LF,0
+0070 T 0000 "NET821: Condivisione temporaneamente sospesa",CR,LF,0
+0071 T 0000 "NET823: Richiesta di rete non accettata",CR,LF,0
+0072 T 0000 "NET822: Reindirizzamento della stampa o del disco sospeso",CR,LF,0
+0073 T 0000 "NET476: NETBIOS non caricato",CR,LF,0
+0074 T 0000 "NET477: Chiusura dell'adattatore non prevista",CR,LF,0
+0075 T 0000 "NET826: Dimensione servente destinaz. /RQB troppo piccola",CR,LF,0
+0076 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0077 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0078 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0079 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0080 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0081 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0082 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0083 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0084 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0085 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0086 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0087 T 0000 "NET???: Errore di rete non previsto",CR,LF,0
+0088 T 0000 "NET825: Errore nei dati della rete",CR,LF,0
+FILESYS d4a4 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+XMA2EMS d5e6 0017
+0001 T 0000 "XMA2EMS: Gestore memoria espansa Versione 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 Tutti i diritti riservati",CR,LF,"$"
+0002 T 0000 CR,LF,"XMA001 Esecuzione diagnostici VMO/XMA: ","$"
+0003 T 0000 "XMA002 Diagnostici completati ",CR,LF,LF,"$"
+0004 T 0000 "XMA003 Il segmento di pagina inizia a ..............."
+0005 T 0000 "XXXX",":0",CR,LF,"$"
+0006 T 0000 "XMA004 Pagine corrispondenti a memoria convenzionale."
+0007 T 0000 "0 ",CR,LF,"$"
+0008 T 0000 "XMA005 Pagine riservate per programma di controllo..."
+0009 T 0000 "0 ",CR,LF,"$"
+0010 T 0000 "XMA006 Pagine disponibili per memoria espansa........"
+0011 T 0000 "0 ",CR,LF,"$"
+0012 T 0000 CR,LF,"XMA100 Errore di adattatore:",CR,LF," Il gestore memoria espansa NON Š stato installato",CR,LF,"$"
+0013 T 0000 CR,LF,"XMA200 Impossibile trovare adattatore:",CR,LF," Il gestore memoria espansa NON Š stato installato",CR,LF,"$"
+0014 T 0000 CR,LF,"XMA300 Errore di valore o di sintassi del parametro:",CR,LF
+ " Il gestore memoria espansa NON Š stato installato",CR,LF,"$"
+0015 T 0000 SIZE1_END - 2 -$
+0016 T 0000 4 DUP (?)," KB OK",CR,LF,"$"
+0017 T 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK dae2 0120
+0004 T 0000 "FDISK impossibile con programma di rete caricato",CR,LF
+0005 T 0000 "Non ci sono dischi fissi.",CR,LF
+0006 T 0000 "Errore di lettura su disco fisso.",CR,LF
+0007 T 0000 "Errore di scrittura su disco fisso.",CR,LF
+1001 T 0000 "IBM Personal Computer"
+1002 T 0000 "Programma attivazione disco fisso Versione 3.40"
+1003 T 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "Opzioni FDISK"
+1005 T 0000 "1. <R>Creare partizione DOS o unit… logica DOS"
+1006 T 0000 "2. <R>Impostare la partizione attiva"
+1007 T 0000 "3. <R>Cancellare la partizione DOS o l'unit… logica DOS"
+1008 T 0000 "4. <R>Visualizzare i dati della"
+1009 T 0000 "Premere <H>Esc<R> per uscire da FDISK"
+1010 T 0000 "Scegliere una delle seguenti:"
+1011 T 0000 "5. <R>Selezionare successiva unit… con",CR,LF,"disco fisso"
+1012 T 0000 "Unit… con disco fisso in uso: <H><I>"
+1013 T 0000 "Attenzione! <R>Nessuna partizione Š attiva - disco 1 non attivabile a meno che"
+1014 T 0000 "non venga resa attiva una partizione"
+1015 T 0000 "Immettere la scelta: [<S> ]"
+1016 T 0000 "Creare partizione DOS o unit… logica DOS"
+1017 T 0000 "1. <R>Creare la partizione DOS Primaria"
+1018 T 0000 "2. <R>Creare la partizione DOS Estesa"
+1019 T 0000 "3. <R>Creare una o pi— unit… logiche",CR,LF,"DOS nella partizione DOS Estesa"
+1020 T 0000 "Premere <H>ESC<R> per tornare a opzioni FDISK"
+1021 T 0000 "Creare la partizione DOS Primaria"
+1022 T 0000 "Si desidera usare la dimensione massima",CR,LF,"per una partizione DOS e rendere ",CR,LF
+1023 T 0000 "la partizione attiva (<S>/<N>).....? <H>[<S> ]"
+1024 T 0000 "(<S>/<N>)...................................................? <H>[<S> ]"
+1025 T 0000 "Partizione Stato Tipo Dimens. in MB Percentuale disco usata"
+1026 T 0000 "Lo spazio totale su disco Š <HIIIIR> MB (1 MB = 1048576 byte)"
+1027 T 0000 "Lo spazio massimo disponibile per la partizione Š <HIIIIR> MB (<HIIIIR>)"
+1028 T 0000 "Immettere ampiezza partizione in MB o percentuale spazio su disco per"
+1029 T 0000 "creare una partizione DOS Primaria.............................: <H>[<IIISI>]"
+1030 T 0000 "Creare la partizione DOS Estesa"
+1031 T 0000 "creare la partizione DOS Estesa..............................: <H>[<IIISI>]"
+1032 T 0000 "Premere <H>Esc<R> per continuare"
+1033 T 0000 "Creare una o pi— unit… logiche DOS nella partizione DOS Estesa"
+1034 T 0000 "Ut… Volume Etich. MB Sistema Uso "
+1035 T 0000 "La dimensione totale della partizione DOS Estesa Š <HIIIIR> MB (1 MB = 1048576 byte)"
+1036 T 0000 "Lo spazio massimo disponibile per l'unit… logica Š <HIIIIR> MB <H>(<IIII>)"
+1037 T 0000 "Immettere dimensione unit… logica in MB o percentuale spazio su disco....<H>[<IIISI>]"
+1038 T 0000 "Impostare la partizione attiva"
+1039 T 0000 "Immettere il numero della partizione",CR,LF,"che si vuole attivare.......: <H>[<S> ]"
+1040 T 0000 "Cancellare la partizione DOS o l'unit… logica DOS"
+1041 T 0000 "1. <R>Cancellare la partizione DOS Primaria"
+1042 T 0000 "2. <R>Cancellare la partizione DOS Estesa"
+1043 T 0000 "3. <R>Cancellare le unit… logiche DOS",CR,LF,"nella partizione DOS Estesa"
+1044 T 0000 "Cancellare la partizione DOS Primaria"
+1045 T 0000 "Attenzione! <OR>I dati nella partizione DOS Primaria cancellata andranno persi."
+1046 T 0000 "Si vuole continuare (<S>/<N>).................? <H>[<S> ]"
+1047 T 0000 "Cancellare la partizione DOS Estesa"
+1048 T 0000 "Attenzione! <OR>I dati nella partizione DOS Estesa cancellata andranno persi."
+1049 T 0000 "Si vuole continuare (<S>/<N>).................? <H>[<S> ]"
+1050 T 0000 "Cancellare una o pi— unit… logiche DOS nella partizione DOS Estesa"
+1051 T 0000 "Attenzione! <OR>I dati in una unit… logica DOS cancellata andranno persi."
+1052 T 0000 "Quale unit… si vuole cancellare................................? <H>[<S> ]"
+1053 T 0000 "Si Š sicuri (<S>/<N>)...............................? <H>[<S> ]"
+1054 T 0000 "Immettere l'etichetta di Volume.................? <H>[<S> ]"
+1055 T 0000 "Visualizzare le informazioni della partizione"
+1056 T 0000 "La partizione DOS Estesa contiene unit… logiche DOS."
+1057 T 0000 "Si vuole visualizzare le informazioni dell'unit… logica (<S>/<N>).?<H>[<S> ]"
+1058 T 0000 "Visualizzare le informazioni dell'unit… logica DOS"
+1059 T 0000 "Il sistema ora si riavvier…"
+1060 T 0000 "Inserire il minidisco di avviamento del DOS nell'unit… A:"
+1061 T 0000 "Premere un tasto quando Š pronto <S>"
+1062 T 0000 "Partizione DOS Primaria cancellata"
+1063 T 0000 "Partizione DOS Estesa cancellata"
+1064 T 0000 "unit… cancellata"
+1065 T 0000 "Partizione <I> resa attiva"
+1066 T 0000 "Partizione DOS Primaria creata"
+1067 T 0000 "Partizione DOS Estesa creata"
+1068 T 0000 "Unit… log. DOS creata, lettere identif. di unit… sono state cambiate o aggiunte<W>"
+1069 T 0000 "Nessuna partizione da attivare"
+1070 T 0000 "Nessuna unit… logica definita"
+1071 T 0000 "Le lettere identificative delle unit… sono state cambiate o cancellate<W>"
+1072 T 0000 "Unit… reindirizzata"
+1073 T 0000 "Creata partizione DOS Primaria, lettere identificative cambiate o aggiunte"
+1074 T 0000 "Non ci sono dischi fissi."
+1075 T 0000 "Errore di lettura su disco fisso."
+1076 T 0000 "Errore di scrittura su disco fisso."
+1077 T 0000 "Versione DOS non corretta."
+1078 T 0000 "FDISK impossibile con programma rete caricato"
+1079 T 0000 "Nessuna partizione DOS Primaria da cancellare.<W>"
+1080 T 0000 "Nessuna partizione DOS Estesa da cancellare<W>"
+1081 T 0000 "Partizione DOS Primaria gi… esistente"
+1082 T 0000 "Partizione DOS Estesa gi… esistente"
+1083 T 0000 "Non c'Š spazio per creare una partizione DOS.<W> "
+1084 T 0000 "La dimensione richiesta per unit… logica eccede lo spazio massimo disponibile.<W>"
+1085 T 0000 "La dimensione richiesta per la partiz. eccede lo spazio massimo disponibile<W>"
+1086 T 0000 "Nessuna partizione da cancellare"
+1087 T 0000 "L'unica partizione avviabile sull'unit… 1 Š gi… resa attiva.<W>"
+1088 T 0000 "Nessuna partizione da rendere attiva."
+1089 T 0000 "Partizione selezionata (<I>) non avviabile, partizione attiva non cambiata.<W>"
+1090 T 0000 "Impossibile creare partizione DOS Estesa"
+1091 T 0000 "senza partizione DOS Primaria sul disco 1.<W>"
+1092 T 0000 "Tutto lo spazio disp. nella partizione"
+1093 T 0000 "DOS Estesa ‚ assegnato ad unit… logiche.<W>"
+1094 T 0000 "Impossibile cancellare la partizione DOS"CR,LF,"Estesa mentre vi esistono unit… logiche.<W>"
+1095 T 0000 "Tutte le unit… logiche sono state ",CR,LF,"cancellate nella partizione DOS Estesa<W>"
+1096 T 0000 " non Š una scelta. Immettere <III>."
+1097 T 0000 "Attenzione! La partizione resa attiva non Š avviabile.<W>"
+1098 T 0000 " Esistono soltanto partizioni non avviabili."
+1099 T 0000 "Possono essere attivate soltanto le partizioni sull'Unit… disco 1.<W>"
+1100 T 0000 "Raggiunto il numero massimo di unit… logiche DOS.<W>"
+1101 T 0000 "Impossibile creare una partizione con dimensione zero."
+1102 T 0000 "Unit… <II> gi… cancellata."
+1103 T 0000 "E' impossibile accedere all'unit… <I>.<OW>"
+1104 T 0000 "Entrata non valida, immettere <III>.<W>"
+1105 T 0000 "Impossibile cancellare partizione DOS Primaria "
+1106 T 0000 "su unit… 1 se esiste la partizione Estesa<W>"
+1107 T 0000 "Voce non valida, premere Invio.<W>"
+1108 T 0000 "L'etichetta di Volume non corrisponde.<W>"
+1109 T 0000 "Impossibile creare una unit… logica DOS senza"
+1110 T 0000 "una partizione DOS Estesa sull'unit… corrente.<W>"
+1111 T 0000 "Nessuna unit… logica DOS da cancellare"
+1112 T 0000 "Errore sulla linea del messaggio <I>, vedere la testata",CR,LF
+ "del file FDISKC.MSG per la definizione dell'errore"
+1113 T 0000 "Errore interno"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/japan.msg b/private/mvdm/dos/v86/messages/japan.msg
new file mode 100644
index 000000000..bd75135e7
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/japan.msg
@@ -0,0 +1,1621 @@
+0408
+COMMON 00000006 0038
+0001 U 0000 "Incorrect DOS version",CR,LF
+0002 U 0000 "%1 already installed",CR,LF
+0003 U 0000 "%1 bytes available on disk",CR,LF
+0004 U 0000 "%1 bytes free",CR,LF
+0005 U 0000 "%1 bytes in bad sectors",CR,LF
+0006 U 0000 "%1 bytes total disk space",CR,LF
+0007 U 0000 "%1 bytes total memory",CR,LF
+0008 U 0000 "%1 bytes used by system",CR,LF
+0009 U 0000 "%1 installed",CR,LF
+0010 U 0000 "%1 not installed",CR,LF
+0011 U 0000 "%1 not installed",CR,LF
+0012 U 0000 "Cannot %1 a network drive",CR,LF
+0013 U 0000 "",
+0014 U 0000 "Cannot %1 a SUBSTed or ASSIGNed drive",CR,LF
+0015 U 0000 "Cannot execute %1",CR,LF
+0016 U 0000 "Expanded Memory not available",CR,LF
+0017 U 0000 "File allocation table bad, drive %1",CR,LF
+0018 U 0000 "File cannot be copied onto itself",CR,LF
+0019 U 0000 "Insert target disk in drive %1",CR,LF
+0020 U 0000 "Insufficient disk space",CR,LF
+0021 U 0000 "Invalid characters in volume label",CR,LF
+0022 U 0000 "Invalid code page",CR,LF
+0023 U 0000 "Invalid date",CR,LF
+0024 U 0000 "Invalid time",CR,LF
+0025 U 0000 "Invalid path",CR,LF
+0026 U 0000 "No source drive specified",CR,LF
+0027 U 0000 "No target drive specified",CR,LF
+0028 U 0000 "Press any key to continue . . .",CR,LF
+0029 U 0000 "Source path required",CR,LF
+0030 U 0000 "System transferred",CR,LF
+0031 U 0000 "",
+0032 U 0000 "Unable to create directory",CR,LF
+0033 U 0000 "Volume in drive %1 has no label",CR,LF
+0034 U 0000 "Volume in drive %1 is %2",CR,LF
+0035 U 0001 "Volume label (11 characters, ENTER for none)? "
+0036 U 0000 "Volume Serial Number is %1-%2",CR,LF
+0037 U 0000 "Incorrect file type",CR,LF
+0038 U 0001 CR,LF
+EXTEND 00000689 0090
+0001 U 0003 "Invalid function"
+0002 U 0000 "File not found"
+0003 U 0000 "Path not found"
+0004 U 0000 "Too many open files"
+0005 U 0000 "Access denied "
+0006 U 0000 "Invalid handle"
+0007 U 0000 "Memory control blocks destroyed"
+0008 U 0000 "Insufficient memory"
+0009 U 0000 "Invalid memory block address"
+0010 U 0000 "Invalid Environment"
+0011 U 0000 "Invalid format"
+0012 U 0000 "Invalid function parameter"
+0013 U 0000 "Invalid data"
+0014 U 0000 "",
+0015 U 0000 "Invalid drive specification"
+0016 U 0000 "Attempt to remove current directory"
+0017 U 0000 "Not same device"
+0018 U 0000 "No more files"
+0019 U 0000 "Write protect error"
+0020 U 0000 "Invalid unit"
+0021 U 0000 "Not ready"
+0022 U 0000 "Invalid device request"
+0023 U 0000 "Data error"
+0024 U 0000 "Invalid device request parameters"
+0025 U 0000 "Seek error"
+0026 U 0000 "Invalid media type"
+0027 U 0000 "Sector not found"
+0028 U 0000 "Printer out of paper error"
+0029 U 0000 "Write fault error"
+0030 U 0000 "Read fault error"
+0031 U 0000 "General failure"
+0032 U 0000 "Sharing violation"
+0033 U 0000 "Lock violation"
+0034 U 0000 "Invalid disk change"
+0035 U 0000 "FCB unavailable"
+0036 U 0000 "System resource exhausted"
+0037 U 0000 "Code page mismatch"
+0038 U 0000 "Out of input"
+0039 U 0000 "Insufficient disk space"
+0040 U 0000 "",
+0041 U 0000 "",
+0042 U 0000 "",
+0043 U 0000 "",
+0044 U 0000 "",
+0045 U 0000 "",
+0046 U 0000 "",
+0047 U 0000 "",
+0048 U 0000 "",
+0049 U 0000 "",
+0050 U 0000 "NET809: Network request not supported"
+0051 U 0000 "NET801: Remote computer not listening"
+0052 U 0000 "NET802: Duplicate name on network"
+0053 U 0000 "NET803: Network path not found"
+0054 U 0000 "NET804: Network busy"
+0055 U 0000 "NET805: Network device no longer exists"
+0056 U 0000 "NET806: NETBIOS command limit exceeded"
+0057 U 0000 "NET807: System error; NETBIOS error"
+0058 U 0000 "NET808: Incorrect response from network"
+0059 U 0000 "NET810: Unexpected network error"
+0060 U 0000 "NET811: Incompatible remote adapter"
+0061 U 0000 "NET812: Print queue full"
+0062 U 0000 "NET813: Not enough space for print file"
+0063 U 0000 "NET814: Print file was cancelled"
+0064 U 0000 "NET815: Network name was deleted"
+0065 U 0000 "Access denied"
+0066 U 0000 "NET817: Network device type incorrect"
+0067 U 0000 "NET818: Network name not found"
+0068 U 0000 "NET819: Network name limit exceeded"
+0069 U 0000 "NET820: NETBIOS session limit exceeded"
+0070 U 0000 "NET821: Sharing temporarily paused"
+0071 U 0000 "NET823: Network request not accepted"
+0072 U 0000 "NET822: Print or disk redirection is paused"
+0073 U 0000 "NET476: Netbeui not loaded"
+0074 U 0000 "NET477: Unexpected adapter close"
+0075 U 0000 "",
+0076 U 0000 "",
+0077 U 0004 "",
+0078 U 0004 "",
+0079 U 0004 "",
+0080 U 0004 "File exists"
+0081 U 0004 "",
+0082 U 0004 "Cannot make directory entry"
+0083 U 0004 "Fail on INT 24"
+0084 U 0004 "Too many redirections"
+0085 U 0004 "Duplicate redirection"
+0086 U 0004 "Invalid password"
+0087 U 0004 "Invalid parameter"
+0088 U 0004 "Network data fault"
+0089 U 0004 "Function not supported by network"
+0090 U 0002 "Required system component not installed"
+PARSE 0000131d 0011
+0001 U 0000 "Too many parameters"
+0002 U 0000 "Required parameter missing"
+0003 U 0000 "Invalid switch"
+0004 U 0000 "Invalid keyword"
+0005 U 0000 "",
+0006 U 0000 "Parameter value not in allowed range"
+0007 U 0000 "Parameter value not allowed"
+0008 U 0000 "Parameter value not allowed"
+0009 U 0000 "Parameter format not correct"
+0010 U 0000 "Invalid parameter"
+0011 U 0000 "Invalid parameter combination"
+COMMAND 000014d4 0147
+1002 U 0000 "Duplicate file name or file not found",CR,LF
+1003 U 0000 "Invalid path or file name",CR,LF
+1007 U 0000 "Out of environment space",CR,LF
+1008 U 0000 "File creation error",CR,LF
+1009 U 0000 "Batch file missing",CR,LF
+1010 U 0000 CR,LF,"Insert disk with batch file",CR,LF
+1011 U 0000 "Bad command or file name",CR,LF
+1016 U 0000 "Content of destination lost before copy",CR,LF
+1017 U 0000 "Invalid filename or file not found",CR,LF
+1018 U 0000 "%1 file(s) copied",CR,LF
+1019 U 0000 "%1 file(s) "
+1022 U 0000 "Code page %1 not prepared for system",CR,LF
+1023 U 0000 "Code page %1 not prepared for all devices",CR,LF
+1024 U 0000 "Active code page: %1",CR,LF
+1025 U 0000 "NLSFUNC not installed",CR,LF
+1027 U 0000 "Current drive is no longer valid"
+1029 U 0000 "Label not found",CR,LF
+1030 U 0000 "Syntax error",CR,LF
+1032 U 0000 "Current date is %1 %2",CR,LF
+1033 U 0000 "Sun Mon Tue Wed Thu Fri Sat "
+1034 U 0000 "Enter new date (%1): "
+1036 U 0000 "Current time is %1",CR,LF
+1037 U 0000 "Enter new time: "
+1038 U 0000 ", Delete (Y/N)?"
+1039 U 0000 "All files in directory will be deleted!",CR,LF,"Are you sure (Y/N)?"
+1040 U 0000 "MS-DOS Version %1.%2J"
+1044 U 0000 "Invalid directory",CR,LF
+1046 U 0000 "Invalid path, not directory,",CR,LF,"or directory not empty",CR,LF
+1047 U 0000 "Must specify ON or OFF",CR,LF
+1048 U 0000 "Directory of %1",CR,LF
+1049 U 0000 "No Path",CR,LF
+1050 U 0000 "Invalid drive in search path",CR,LF
+1051 U 0000 "Invalid device",CR,LF
+1052 U 0000 "FOR cannot be nested",CR,LF
+1053 U 0000 "Intermediate file error during pipe",CR,LF
+1054 U 0000 "Cannot do binary reads from a device",CR,LF
+1055 U 0000 "BREAK is %1",CR,LF
+1056 U 0000 "VERIFY is %1",CR,LF
+1057 U 0000 "ECHO is %1",CR,LF
+1059 U 0000 "off",0
+1060 U 0000 "on",0
+1061 U 0000 "Error writing to device",CR,LF
+1063 U 0000 "%1"
+1064 U 0000 "%1"
+1065 U 0000 "%1"
+1066 U 0000 "%1"
+1067 U 0000 9
+1068 U 0000 " <DIR> "
+1069 U 0000 8," ",8
+1070 U 0000 CR,LF
+1071 U 0000 "%1"
+1072 U 0000 "mm-dd-yy"
+1073 U 0000 "dd-mm-yy"
+1074 U 0000 "yy-mm-dd"
+1075 U 0000 "%1 %2"
+1076 U 0000 "%1"
+1077 U 0000 " %1 %2"
+1078 U 0000 "Directory already exists",CR,LF
+1079 U 0000 "%1 bytes",CR,LF
+1080 U 0000 "Total files listed:",CR,LF
+1081 U 0000 "(Error occurred in environment variable)",CR,LF
+1084 U 0000 "(continuing %1)"
+1090 U 0000 "Revision %1 (KANJI Version)",CR,LF
+1091 U 0000 "DOS is in ROM"
+1092 U 0000 "DOS is in HMA"
+1093 U 0000 "DOS is in low memory"
+1094 U 0000 "Cannot Loadhigh batch file",CR,LF
+1095 U 0000 "LoadHigh: Invalid filename",CR,LF
+1096 U 0000 "Cannot open specified country information file",CR,LF
+1300 U 0000 "Sets or clears extended CTRL+C checking.",CR,LF,CR,LF
+ "BREAK [ON | OFF]",CR,LF,CR,LF
+ "Type BREAK without a parameter to display the current BREAK setting.",CR,LF
+1320 U 0000 "Displays or sets the active code page number.",CR,LF,CR,LF
+ "CHCP [nnn]",CR,LF,CR,LF
+1321 U 0000 " nnn Specifies a code page number.",CR,LF,CR,LF
+ "Type CHCP without a parameter to display the active code page number.",CR,LF
+1340 U 0000 "Displays the name of or changes the current directory.",CR,LF,CR,LF
+ "CHDIR [drive:][path]",CR,LF
+ "CHDIR[..]",CR,LF
+1341 U 0000 "CD [drive:][path]",CR,LF
+ "CD[..]",CR,LF,CR,LF
+ " .. Specifies that you want to change to the parent directory.",CR,LF,CR,LF
+1342 U 0000 "Type CD drive: to display the current directory in the specified drive.",CR,LF
+ "Type CD without parameters to display the current drive and directory.",CR,LF
+1360 U 0000 "Clears the screen.",CR,LF,CR,LF
+ "CLS",CR,LF
+1400 U 0000 "Copies one or more files to another location.",CR,LF,CR,LF
+ "COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination",CR,LF
+ " [/A | /B]] [/V]",CR,LF,CR,LF
+1401 U 0000 " source Specifies the file or files to be copied.",CR,LF
+ " /A Indicates an ASCII text file.",CR,LF
+1402 U 0000 " /B Indicates a binary file.",CR,LF
+ " destination Specifies the directory and/or filename for the new file(s).",CR,LF
+1403 U 0000 " /V Verifies that new files are written correctly.",CR,LF,CR,LF
+1404 U 0000 "To append files, specify a single file for destination, but multiple files",CR,LF
+ "for source (using wildcards or file1+file2+file3 format).",CR,LF
+1420 U 0000 "Changes the terminal device used to control your system.",CR,LF,CR,LF
+ "CTTY device",CR,LF,CR,LF
+ " device The terminal device you want to use, such as COM1.",CR,LF
+1440 U 0000 "Displays or sets the date.",CR,LF,CR,LF
+ "DATE [date]",CR,LF,CR,LF
+1441 U 0000 "Type DATE without parameters to display the current date setting and",CR,LF
+ "a prompt for a new one. Press ENTER to keep the same date.",CR,LF
+1460 U 0000 "Deletes one or more files.",CR,LF,CR,LF
+ "DEL [drive:][path]filename [/P]",CR,LF
+ "ERASE [drive:][path]filename [/P]",CR,LF,CR,LF
+1461 U 0000 " [drive:][path]filename Specifies the file(s) to delete. Specify multiple",CR,LF
+ " files by using wildcards.",CR,LF
+1462 U 0000 " /P Prompts for confirmation before deleting each file.",CR,LF
+1480 U 0000 "Displays a list of files and subdirectories in a directory.",CR,LF,CR,LF
+ "DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]",CR,LF
+ " [/O[[:]sortorder]] [/S] [/B] [/L]",CR,LF,CR,LF
+1481 U 0000 " [drive:][path][filename]",CR,LF
+ " Specifies drive, directory, and/or files to list.",CR,LF
+1482 U 0000 " /P Pauses after each screenful of information.",CR,LF
+ " /W Uses wide list format.",CR,LF
+1483 U 0000 " /A Displays files with specified attributes.",CR,LF
+ " attributes D Directories R Read-only files",CR,LF
+1484 U 0000 " H Hidden files A Files ready for archiving",CR,LF
+ " S System files - Prefix meaning ""not""",CR,LF
+ " /O List by files in sorted order.",CR,LF
+1485 U 0000 " sortorder N By name (alphabetic) S By size (smallest first)",CR,LF
+ " E By extension (alphabetic) D By date & time (earliest first)",CR,LF
+1486 U 0000 " G Group directories first - Prefix to reverse order",CR,LF
+ " /S Displays files in specified directory and all subdirectories.",CR,LF
+1487 U 0000 " /B Uses bare format (no heading information or summary).",CR,LF
+ " /L Uses lowercase.",CR,LF,CR,LF
+1488 U 0000 "Switches may be preset in the DIRCMD environment variable. Override",CR,LF
+ "preset switches by prefixing any switch with - (hyphen)--for example, /-W.",CR,LF
+1500 U 0000 "Quits the COMMAND.COM program (command interpreter).",CR,LF,CR,LF
+ "EXIT",CR,LF
+1520 U 0000 "Creates a directory.",CR,LF,CR,LF
+ "MKDIR [drive:]path",CR,LF
+ "MD [drive:]path",CR,LF
+1540 U 0000 "Displays or sets a search path for executable files.",CR,LF,CR,LF
+ "PATH [[drive:]path[;...]]",CR,LF
+ "PATH ;",CR,LF,CR,LF
+1541 U 0000 "Type PATH ; to clear all search-path settings and direct MS-DOS to search",CR,LF
+ "only in the current directory.",CR,LF
+1542 U 0000 "Type PATH without parameters to display the current path.",CR,LF
+1560 U 0000 "Changes the MS-DOS command prompt.",CR,LF,CR,LF
+ "PROMPT [text]",CR,LF,CR,LF
+1561 U 0000 " text Specifies a new command prompt.",CR,LF,CR,LF
+ "Prompt can be made up of normal characters and the following special codes:",CR,LF,CR,LF
+1562 U 0000 " $Q = (equal sign)",CR,LF
+ " $$ $ (dollar sign)",CR,LF
+1563 U 0000 " $T Current time",CR,LF
+ " $D Current date",CR,LF
+1564 U 0000 " $P Current drive and path",CR,LF
+ " $V MS-DOS version number",CR,LF
+1565 U 0000 " $N Current drive",CR,LF
+ " $G > (greater-than sign)",CR,LF
+1566 U 0000 " $L < (less-than sign)",CR,LF
+ " $B | (pipe)",CR,LF
+1567 U 0000 " $H Backspace (erases previous character)",CR,LF
+ " $E Escape code (ASCII code 27)",CR,LF
+ " $_ Carriage return and linefeed",CR,LF,CR,LF
+1568 U 0000 "Type PROMPT without parameters to reset the prompt to the default setting.",CR,LF
+1580 U 0000 "Removes (deletes) a directory.",CR,LF,CR,LF
+ "RMDIR [drive:]path",CR,LF
+ "RD [drive:]path",CR,LF
+1600 U 0000 "Renames a file or files.",CR,LF,CR,LF
+1601 U 0000 "RENAME [drive:][path]filename1 filename2",CR,LF
+ "REN [drive:][path]filename1 filename2",CR,LF,CR,LF
+1602 U 0000 "Note that you cannot specify a new drive or path for your destination file.",CR,LF
+1620 U 0000 "Displays, sets, or removes MS-DOS environment variables.",CR,LF,CR,LF
+ "SET [variable=[string]]",CR,LF,CR,LF
+1621 U 0000 " variable Specifies the environment-variable name.",CR,LF
+ " string Specifies a series of characters to assign to the variable.",CR,LF,CR,LF
+1622 U 0000 "Type SET without parameters to display the current environment variables.",CR,LF
+1640 U 0000 "Displays or sets the system time.",CR,LF,CR,LF
+ "TIME [time]",CR,LF,CR,LF
+1641 U 0000 "Type TIME with no parameters to display the current time setting and a prompt",CR,LF
+ "for a new one. Press ENTER to keep the same time.",CR,LF
+1660 U 0000 "Displays the contents of a text file.",CR,LF,CR,LF
+ "TYPE [drive:][path]filename",CR,LF
+1680 U 0000 "Displays the MS-DOS version.",CR,LF,CR,LF
+ "VER",CR,LF
+1700 U 0000 "Tells MS-DOS whether to verify that your files are written correctly to a",CR,LF
+ "disk.",CR,LF,CR,LF
+ "VERIFY [ON | OFF]",CR,LF,CR,LF
+ "Type VERIFY without a parameter to display the current VERIFY setting.",CR,LF
+1720 U 0000 "Displays the disk volume label and serial number, if they exist.",CR,LF,CR,LF
+ "VOL [drive:]",CR,LF
+1740 U 0000 "Calls one batch program from another.",CR,LF,CR,LF
+ "CALL [drive:][path]filename [batch-parameters]",CR,LF,CR,LF
+1741 U 0000 " batch-parameters Specifies any command-line information required by the",CR,LF
+ " batch program.",CR,LF
+1760 U 0000 "Records comments (remarks) in a batch file or CONFIG.SYS.",CR,LF,CR,LF
+ "REM [comment]",CR,LF
+1780 U 0000 "Suspends processing of a batch program and displays the message ""Press any",CR,LF
+ "key to continue....""",CR,LF,CR,LF
+ "PAUSE",CR,LF
+1800 U 0000 "Displays messages, or turns command-echoing on or off.",CR,LF,CR,LF
+ " ECHO [ON | OFF]",CR,LF
+1801 U 0000 " ECHO [message]",CR,LF,CR,LF
+ "Type ECHO without parameters to display the current echo setting.",CR,LF
+1820 U 0000 "Directs MS-DOS to a labelled line in a batch program.",CR,LF,CR,LF
+ "GOTO label",CR,LF,CR,LF
+1821 U 0000 " label Specifies a text string used in the batch program as a label.",CR,LF,CR,LF
+ "You type a label on a line by itself, beginning with a colon.",CR,LF
+1840 U 0000 "Changes the position of replaceable parameters in a batch file.",CR,LF,CR,LF
+ "SHIFT",CR,LF
+1860 U 0000 "Performs conditional processing in batch programs.",CR,LF,CR,LF
+ "IF [NOT] ERRORLEVEL number command",CR,LF
+1861 U 0000 "IF [NOT] string1==string2 command",CR,LF
+ "IF [NOT] EXIST filename command",CR,LF,CR,LF
+1862 U 0000 " NOT Specifies that MS-DOS should carry out the command only",CR,LF
+ " if the condition is false.",CR,LF
+1863 U 0000 " ERRORLEVEL number Specifies a true condition if the last program run returned",CR,LF
+ " an exit code equal to or greater than the number specified.",CR,LF
+1864 U 0000 " command Specifies the command to carry out if the condition is",CR,LF
+ " met.",CR,LF
+1865 U 0000 " string1==string2 Specifies a true condition if the specified text strings",CR,LF
+ " match.",CR,LF
+1866 U 0000 " EXIST filename Specifies a true condition if the specified filename",CR,LF
+ " exists.",CR,LF
+1880 U 0000 "Runs a specified command for each file in a set of files.",CR,LF,CR,LF
+ "FOR %variable IN (set) DO command [command-parameters]",CR,LF,CR,LF
+1881 U 0000 " %variable Specifies a replaceable parameter.",CR,LF
+ " (set) Specifies a set of one or more files. Wildcards may be used.",CR,LF
+1882 U 0000 " command Specifies the command to carry out for each file.",CR,LF
+ " command-parameters",CR,LF
+1883 U 0000 " Specifies parameters or switches for the specified command.",CR,LF,CR,LF
+ "To use the FOR command in a batch program, specify %%variable instead of",CR,LF
+ "%variable.",CR,LF
+1900 U 0000 "Reserved command name",CR,LF
+1920 U 0000 "Loads a program into the upper memory area.",CR,LF,CR,LF
+1921 U 0000 "LOADHIGH [drive:][path]filename [parameters]",CR,LF
+ "LH [drive:][path]filename [parameters]",CR,LF,CR,LF
+1922 U 0000 " parameters Specifies any command-line information required by the",CR,LF
+ " program you want to load.",CR,LF
+ANSI 000046c0 0001
+0010 U 0000 "Invalid parameter - %1",CR,LF
+APPEND 00004704 0026
+0001 U 0000 "Incorrect APPEND version",CR,LF
+0002 U 0000 "Invalid path",CR,LF
+0003 U 0000 "Invalid parameter",CR,LF
+0004 U 0000 "Invalid combination of parameters",CR,LF
+0005 U 0000 "No Append",CR,LF
+0006 U 0000 "APPEND / ASSIGN Conflict",CR,LF
+0007 U 0000 "APPEND / TopView Conflict",CR,LF
+0008 U 0000 "Incorrect DOS version",CR,LF
+0009 U 0000 "APPEND already installed",CR,LF
+0300 U 0000 "Allows programs to open data files in specified directories as if they were in",CR,LF
+0301 U 0000 "the current directory.",CR,LF,CR,LF
+0302 U 0000 "APPEND [[drive:]path[;...]] [/X[:ON | :OFF]] [/PATH:ON | /PATH:OFF] [/E]",CR,LF
+0303 U 0000 "APPEND ;",CR,LF,CR,LF
+0304 U 0000 " [drive:]path Specifies a drive and directory to append.",CR,LF
+0305 U 0000 " /X:ON Applies appended directories to file searches and",CR,LF
+0306 U 0000 " application execution.",CR,LF
+0307 U 0000 " /X:OFF Applies appended directories only to requests to open files.",CR,LF
+0308 U 0000 " /X:OFF is the default setting.",CR,LF
+0309 U 0000 " /PATH:ON Applies appended directories to file requests that already",CR,LF
+0310 U 0000 " specify a path. /PATH:ON is the default setting.",CR,LF
+0311 U 0000 " /PATH:OFF Turns off the effect of /PATH:ON.",CR,LF
+0312 U 0000 " /E Stores a copy of the appended directory list in an environment",CR,LF
+0313 U 0000 " variable named APPEND. /E may be used only the first time",CR,LF
+0314 U 0000 " you use APPEND after starting your system.",CR,LF,CR,LF
+0315 U 0000 "Type APPEND ; to clear the appended directory list.",CR,LF
+0316 U 0000 "Type APPEND without parameters to display the appended directory list.",CR,LF
+ASSIGN 00004df2 0007
+0002 U 0000 "Original %1: set to %2:",cr,lf
+0300 U 0000 "Redirects requests for disk operations on one drive to a different drive.",CR,LF,CR,LF
+0301 U 0000 "ASSIGN [x[:]=y[:][...]]",CR,LF
+ "ASSIGN /STATUS",CR,LF,CR,LF
+0302 U 0000 " x Specifies the drive letter to reassign.",CR,LF
+0303 U 0000 " y Specifies the drive that x: will be assigned to.",CR,LF
+0304 U 0000 " /STATUS Displays current drive assignments.",CR,LF,CR,LF
+0305 U 0000 "Type ASSIGN without parameters to reset all drive letters to original",CR,LF
+ "assignments.",CR,LF
+ATTRIB 0000503d 0027
+0004 U 0000 "Invalid number of parameters",CR,LF
+0005 U 0000 "Invalid path or file not found",CR,LF
+0006 U 0000 "Syntax error",CR,LF
+0008 U 0000 " %1"
+0009 U 0000 "%1 %2",CR,LF
+0010 U 0000 "%1",CR,LF,"%2",CR,LF
+0011 U 0000 "%1, Code page mismatch",CR,LF,"Are you sure (Y/N)?"
+0012 U 0000 "%1",CR,LF
+0014 U 0000 CR,LF
+0015 U 0000 "Invalid file type value",CR,LF
+0199 U 0000 "Extended attribute error",CR,LF
+0201 U 0000 "Extended attribute name not found",CR,LF
+0204 U 0000 "Extended attribute name cannot be set",CR,LF
+0205 U 0000 "Extended attribute name known to this file system but not supported",CR,LF
+0206 U 0000 "Extended attribute type mismatch",CR,LF
+0208 U 0000 "Extended attribute value not supported",CR,LF
+0216 U 0000 "Not resetting system file %1",CR,LF
+0217 U 0000 "Not resetting hidden file %1",CR,LF
+0300 U 0000 "Displays or changes file attributes.",CR,LF,CR,LF
+0301 U 0000 "ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]",CR,LF,CR,LF
+0302 U 0000 " + Sets an attribute.",CR,LF
+0303 U 0000 " - Clears an attribute.",CR,LF
+0304 U 0000 " R Read-only file attribute.",CR,LF
+0305 U 0000 " A Archive file attribute.",CR,LF
+0306 U 0000 " S System file attribute.",CR,LF
+0307 U 0000 " H Hidden file attribute.",CR,LF
+0308 U 0000 " /S Processes files in all directories in the specified path.",CR,LF
+BACKUP 000055c2 0040
+0002 U 0000 CR,LF,"Insufficient memory",CR,LF
+0006 U 0000 CR,LF,"Invalid drive specification",CR,LF
+0014 U 0000 CR,LF,"Source and target drives are the same",CR,LF
+0015 U 0001 CR,LF,"Error executing FORMAT",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 U 0000 CR,LF,"Error opening logfile",CR,LF
+0018 U 0000 CR,LF,"Logging to file %1",CR,LF
+0019 U 0000 CR,LF,"Last backup diskette not inserted",CR,LF
+0020 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\ root directory will be erased",CR,LF
+0021 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\BACKUP directory will be erased",CR,LF
+0022 U 0000 CR,LF,"*** Backing up files to drive %1: ***",CR,LF
+0023 U 0000 "Diskette Number: %1",CR,LF
+0024 U 0000 CR,LF,"WARNING! No files were found to back up",CR,LF
+0025 U 0000 CR,LF,"Insert backup source diskette in drive %1:",CR,LF
+0026 U 0000 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF
+0027 U 0000 CR,LF,"*** Not able to backup file ***",CR,LF
+0028 U 0000 CR,LF,"Insert last backup diskette in drive %1:",CR,LF
+0029 U 0000 CR,LF,"Target cannot be used for backup",CR,LF
+0030 U 0000 CR,LF,"*** Last file not backed up ***",CR,LF
+0031 U 0000 CR,LF,"Fixed backup device %1: is full",CR,LF
+0032 U 0000 CR,LF,"Disk full error writing to BACKUP Log File",CR,LF
+0034 U 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+0040 U 0000 CR, LF, "Because your source drive is either ASSIGNed, JOINed, or SUBSTed", CR, LF, "it is actually the same as the target drive", CR, LF
+0041 U 0000 CR, LF, "Because your target drive is either ASSIGNed, JOINed, or SUBSTed", CR, LF, "it is actually the same as the source drive", CR, LF
+0042 U 0000 "Your target diskette is unformatted and "
+0043 U 0000 "No FORMAT program was found.",CR,LF
+ "Do you have another diskette with FORMAT on it (Y/N)? "
+0044 U 0000 CR,LF,"Insert the diskette with FORMAT in drive A:",CR,LF
+0045 U 0000 CR,LF,"Do you want to continue by inserting a new disk (Y/N)? "
+0300 U 0000 "Backs up one or more files from one disk to another.",CR,LF,CR,LF
+0301 U 0000 "BACKUP source destination-drive: [/S] [/M] [/A] [/F[:size]]",CR,LF
+ " [/D:date[/T:time]] [/L[:[drive:][path]logfile]]",CR,LF,CR,LF
+0302 U 0000 " source Specifies the file(s), drive, or directory to back up.",CR,LF
+0303 U 0000 " destination-drive: Specifies the drive to save backup copies onto.",CR,LF
+0304 U 0000 " /S Backs up contents of subdirectories.",CR,LF
+0305 U 0000 " /M Backs up only files that have changed since the last",CR,LF
+ " backup.",CR,LF
+0306 U 0000 " /A Adds backup files to an existing backup disk.",CR,LF
+0307 U 0000 " /F:[size] Specifies the size of the disk to be formatted.",CR,LF
+0308 U 0000 " /D:date Backs up only files changed on or after the specified",CR,LF
+ " date.",CR,LF
+0309 U 0000 " /T:time Backs up only files changed at or after the specified",CR,LF
+ " time.",CR,LF
+0310 U 0000 " /L[:[drive:][path]logfile]",CR,LF
+ " Creates a log file and entry to record the backup",CR,LF
+ " operation.",CR,LF
+BASIC 0000629a 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+BOOT 000062d8 0001
+0001 U 0000 13,10,"Non-System disk or disk error",13,10
+ "Replace and press any key when ready",13,10,0
+CHKDSK 0000635a 0071
+0003 U 0000 "Convert lost chains to files (Y/N)?"
+0004 U 0000 "Unrecoverable error in directory"
+0005 U 0000 "Convert directory to file (Y/N)?"
+0007 U 0000 "%1 bytes total disk space"
+0008 U 0000 "%1 bytes in bad sectors"
+0009 U 0000 "%1 bytes in %2 hidden files"
+0010 U 0000 "%1 bytes in %2 directories"
+0011 U 0000 "%1 bytes in %2 user files"
+0012 U 0000 "%1 bytes in %2 recovered files"
+0013 U 0000 "%1 bytes would be in %2 recovered files"
+0014 U 0000 "%1 bytes available on disk"
+0015 U 0000 "%1 total bytes memory"
+0016 U 0000 "%1 bytes free"
+0017 U 0000 "Cannot CHKDSK a network drive"
+0018 U 0000 "Cannot CHKDSK a SUBSTed or ASSIGNed drive"
+0019 U 0000 "Probable non-DOS disk",CR,LF,"Continue (Y/N)?"
+0020 U 0000 "Disk error reading FAT %1",CR,LF
+0021 U 0000 "Directory %1"
+0022 U 0000 "%1 Contains %2 non-contiguous blocks"
+0023 U 0000 "All specified file(s) are contiguous"
+0024 U 0000 "Errors found, F parameter not specified",CR,LF,"Corrections will not be written to disk"
+0025 U 0000 " Processing cannot continue %1%2"
+0026 U 0000 " File allocation table bad, drive %1"
+0029 U 0000 " CHDIR .. failed, trying alternate method"
+0030 U 0001 " Has invalid allocation unit, file truncated"
+0031 U 0000 " Invalid sub-directory entry"
+0032 U 0000 " Does not exist"
+0033 U 0001 " First allocation unit is invalid, entry truncated"
+0034 U 0000 " Allocation error, size adjusted"
+0035 U 0000 " Cannot recover .. entry, processing continued"
+0036 U 0000 " Directory is totally empty, no . or .."
+0037 U 0000 " Directory is joined"
+0038 U 0000 " Cannot recover .. entry"
+0039 U 0000 " Entry has a bad link"
+0040 U 0000 " Entry has a bad attribute"
+0041 U 0000 " Entry has a bad size"
+0042 U 0001 " Is cross linked on allocation unit %1"
+0043 U 0000 " Cannot CHDIR to %1,",CR,LF,"tree past this point not processed"
+0044 U 0000 " tree past this point not processed"
+0045 U 0000 "%1 bytes disk space freed"
+0046 U 0000 "%1 bytes disk space would be freed"
+0047 U 0000 "Volume %1 created %2 %3",CR,LF
+0048 U 0000 "%1 total allocation units on disk"
+0049 U 0000 "%1 bytes in each allocation unit"
+0050 U 0000 "CHKDSK not available on drive %1"
+0053 U 0000 "Invalid parameter"
+0055 U 0000 "Path not found"
+0056 U 0000 "File not found"
+0058 U 0001 " %1 lost allocation units found in %2 chains."
+0059 U 0000 CR,LF
+0060 U 0000 " Cannot CHDIR to root",CR,LF
+0061 U 0000 " Disk error writing FAT %1"
+0062 U 0000 "%1" ;C05
+0063 U 0000 "Invalid current directory",0
+0064 U 0000 "%1",CR,LF
+0065 U 0000 " Insufficient room in root directory",CR,LF," Move files from root directory and repeat CHKDSK"
+0066 U 0000 "%1 %2 %3"
+0067 U 0000 "%1 %2, %3"
+0068 U 0000 "%1%2%3%4%5"
+0069 U 0000 "%1%2%3%4"
+0070 U 0000 "%1 available allocation units on disk"
+0075 U 0000 "CHKDSK /F cannot be done in a Windows/DosShell Command Prompt",CR,LF
+0076 U 0000 " - Insufficient Memory",0
+0077 U 0000 " - File allocation table bad",0
+0300 U 0000 "Checks a disk and displays a status report.",CR,LF,CR,LF
+0301 U 0000 "CHKDSK [drive:][[path]filename] [/F] [/V]",CR,LF,CR,LF
+0302 U 0000 " [drive:][path] Specifies the drive and directory to check.",CR,LF
+0303 U 0000 " filename Specifies the file(s) to check for fragmentation.",CR,LF
+0304 U 0000 " /F Fixes errors on the disk.",CR,LF
+0305 U 0000 " /V Displays the full path and name of every file on the disk.",CR,LF,CR,LF
+0306 U 0000 "Type CHKDSK without parameters to check the current disk.",CR,LF
+DEBUG 000071a0 0068
+0004 U 0000 "Allocation failed or specified buffer too small",CR,LF
+0006 U 0000 "Bad device name"
+0007 U 0000 "Cannot open list device PRN",CR,LF
+ "Enter name of list device? "
+0008 U 0000 CR,LF
+0009 U 0000 CR,LF,"Program terminated normally",CR,LF
+0010 U 0001 "Invalid drive specification",CR,LF
+0012 U 0001 "File creation error",CR,LF
+0013 U 0001 "Insufficient space on disk",CR,LF
+0014 U 0001 "Disk error reading drive %1",CR,LF
+0015 U 0001 "Disk error writing drive %1",CR,LF
+0016 U 0001 "Write protect error reading drive %1",CR,LF
+0017 U 0001 "Write protect error writing drive %1",CR,LF
+0019 U 0000 "%1^ Error"
+0020 U 0001 "Error in EXE or HEX file",CR,LF
+0021 U 0001 "EXE and HEX files cannot be written",CR,LF
+0022 U 0000 "EXEC failure"
+0023 U 0001 "(W)rite error, no destination defined",CR,LF
+0024 U 0001 "Access denied",CR,LF
+0025 U 0000 "Parity error or nonexistent memory error detected"
+0026 U 0000 "-"
+0027 U 0000 "%1 -"
+0032 U 0000 "%1%2"
+0033 U 0000 "%1:%2 %3"
+0034 U 0000 "%1 %2"
+0035 U 0000 "%1 %2",CR,LF,":"
+0036 U 0000 "%1=%2 "
+0037 U 0000 "%1 Error"
+0038 U 0000 "Writing %2%1 bytes" ;C02
+0039 U 0000 "%1:%2="
+0040 U 0000 "%1"
+0041 U 0000 "%1"
+0042 U 0000 "%1:%2 %3 %4 %5:%6"
+0044 U 0000 32,8
+0046 U 0000 "%1"
+0047 U 0000 "%1"
+0050 U 0000 "%1 of a total %2 EMS pages have been allocated",cr,lf
+0051 U 0000 "%1 of a total %2 EMS handles have been allocated",cr,lf
+0055 U 0000 "Handle created = %1 ",cr,lf
+0056 U 0000 "Logical page %1 mapped to physical page %2 ",cr,lf
+0057 U 0001 "EMS hardware/software failure",cr,lf
+0058 U 0000 "Handle not found",cr,lf
+0059 U 0000 "Invalid function code",cr,lf
+0060 U 0000 "No free handles",cr,lf
+0061 U 0000 "Save/Restore error",cr,lf
+0062 U 0000 "Total pages exceeded",cr,lf
+0063 U 0000 "Free pages exceeded",cr,lf
+0064 U 0000 "Parameter error",cr,lf
+0065 U 0000 "Logical Page out of range",cr,lf
+0066 U 0000 "Physical Page out of range",cr,lf
+0067 U 0000 "Save area already in use",cr,lf
+0068 U 0000 "Save area not in use",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 U 0000 "Missing or invalid EMS parameter",cr,lf
+0072 U 0000 "Handle %1 has %2 pages allocated",cr,lf
+0075 U 0000 "Physical page %1 = Frame segment %2",cr,lf
+0076 U 0003 "Handle %1 deallocated",cr,lf
+0078 U 0000 "EMS not installed",cr,lf
+0090 U 0000 "Runs Debug, a program testing and editing tool.",cr,lf,cr,lf
+0091 U 0000 "DEBUG [[drive:][path]filename [testfile-parameters]]",cr,lf,cr,lf
+0092 U 0000 " [drive:][path]filename Specifies the file you want to test.", cr,lf
+0093 U 0000 " testfile-parameters Specifies command-line information required by",cr,lf
+ " the file you want to test.",cr,lf,cr,lf
+0094 U 0000 "After Debug starts, type ? to display a list of debugging commands.",cr,lf
+0100 U 0000 "assemble A [address]",CR,LF
+ "compare C range address",CR,LF
+ "dump D [range]",CR,LF
+ "enter E address [list]",CR,LF
+0101 U 0000 "fill F range list",CR,LF
+ "go G [=address] [addresses]",CR,LF
+ "hex H value1 value2",CR,LF
+ "input I port",CR,LF
+0102 U 0000 "load L [address] [drive] [firstsector] [number]",CR,LF
+ "move M range address",CR,LF
+ "name N [pathname] [arglist]",CR,LF
+ "output O port byte",CR,LF
+0103 U 0000 "proceed P [=address] [number]",CR,LF
+ "quit Q",CR,LF
+ "register R [register]",CR,LF
+ "search S range list",CR,LF
+0104 U 0000 "trace T [=address] [value]",CR,LF
+ "unassemble U [range]",CR,LF
+ "write W [address] [drive] [firstsector] [number]",CR,LF
+0105 U 0000 "allocate expanded memory XA [#pages]",CR,LF
+ "deallocate expanded memory XD [handle]",CR,LF
+ "map expanded memory pages XM [Lpage] [Ppage] [handle]",CR,LF
+ "display expanded memory status XS",CR,LF
+DISKCOMP 0000810a 0020
+0004 U 0000 "Do not specify filename(s)",CR,LF
+ "Command format: DISKCOMP [drive1: [drive2:]] [/1] [/8]",LF,CR
+0005 U 0000 CR,LF,"Invalid drive specification",CR,LF
+ "Specified drive does not exist",CR,LF
+ "or is non-removable",CR,LF
+0006 U 0000 CR,LF,"Cannot DISKCOMP to or from",CR,LF
+ "a network drive",CR,LF
+0007 U 0000 CR,LF,"Insert FIRST diskette in drive %1:",CR,LF
+0008 U 0000 CR,LF,"Insert SECOND diskette in drive %1:",CR,LF
+0009 U 0000 CR,LF,"FIRST diskette bad or incompatible",CR,LF
+0010 U 0000 CR,LF,"SECOND diskette bad or incompatible",CR,LF
+0014 U 0000 CR,LF,"Compare another diskette (Y/N) ?"
+0015 U 0000 CR,LF,"Comparing %1 tracks",CR,LF
+ "%2 sectors per track, %3 side(s)",CR,LF
+0016 U 0000 CR,LF,"Drive types or diskette types",CR,LF
+ "not compatible",CR,LF
+0017 U 0000 CR,LF,"Unrecoverable read error on drive %2",CR,LF
+ "side %3, track %4",CR,LF
+0018 U 0000 CR,LF,"Compare error on",CR,LF,"side %3, track %4",CR,LF
+0019 U 0000 "Make sure a diskette is inserted into",CR,LF
+ "the drive and the door is closed",CR,LF
+0020 U 0000 CR,LF,"Compare process ended",CR,LF
+0021 U 0000 CR,LF,"Compare OK",CR,LF
+0022 U 0000 CR,LF
+0300 U 0000 "Compares the contents of two floppy disks.",CR,LF,CR,LF
+0301 U 0000 "DISKCOMP [drive1: [drive2:]] [/1] [/8]",CR,LF,CR,LF
+0302 U 0000 " /1 Compares the first side of the disks.",CR,LF
+0303 U 0000 " /8 Compares only the first eight sectors of each track.",CR,LF
+DISKCOPY 000086ca 0025
+0002 U 0000 CR,LF
+0004 U 0000 "Do not specify filename(s)",CR,LF
+ "Command Format: DISKCOPY [drive1: [drive2:]] [/1] [/V]",CR,LF
+0005 U 0000 CR,LF,"Invalid drive specification",CR,LF
+ "Specified drive does not exist",CR,LF
+ "or is non-removable",CR,LF
+0006 U 0000 CR,LF,"Cannot DISKCOPY to or from",CR,LF
+ "a network drive",CR,LF
+0007 U 0000 CR,LF,"Formatting while copying",CR,LF
+0008 U 0000 CR,LF,"Insert SOURCE diskette in drive %1:",CR,LF
+0009 U 0000 CR,LF,"Insert TARGET diskette in drive %1:",CR,LF
+0010 U 0000 "Make sure a diskette is inserted into",CR,LF
+ "the drive and the door is closed",CR,LF
+0011 U 0000 CR,LF,"Target diskette may be unusable",CR,LF
+0012 U 0000 CR,LF,"Target diskette unusable",CR,LF
+0016 U 0000 CR,LF,"Copy another diskette (Y/N)? "
+0017 U 0000 CR,LF,"Copying %1 tracks",CR,LF
+ "%2 sectors per track, %3 side(s)",CR,LF
+0018 U 0000 CR,LF,"Drive types or diskette types",CR,LF
+ "not compatible",CR,LF
+0019 U 0000 CR,LF,"Unrecoverable read error on drive %1",CR,LF
+ "Side %2, track %3",CR,LF
+0020 U 0000 CR,LF,"Unrecoverable write error on drive %1",CR,LF
+ "Side %2, track %3",CR,LF
+0021 U 0000 CR,LF,"Copy process ended",CR,LF
+0022 U 0000 CR,LF,"SOURCE diskette bad or incompatible"
+0023 U 0000 CR,LF,"TARGET diskette bad or incompatible"
+0030 U 0000 CR,LF,"TARGET media has lower capacity than SOURCE",CR,LF
+ "Continue anyway (Y/N)?"
+0031 U 0000 CR,LF,"Press CTRL+C to abort,",CR,LF
+ "or correct this problem and press any other key to continue . . .",CR,LF
+0300 U 0000 "Copies the contents of one floppy disk to another.",CR,LF,CR,LF
+0301 U 0000 "DISKCOPY [drive1: [drive2:]] [/1] [/V]",CR,LF,CR,LF
+0302 U 0000 " /1 Copies only the first side of the disk.",CR,LF
+0303 U 0000 " /V Verifies that the information is copied correctly.",CR,LF,CR,LF
+0304 U 0000 "The two floppy disks must be the same type.",CR,LF
+ "You may specify the same drive for drive1 and drive2.",CR,LF
+DISPLAY 00008e7b 0003
+0002 U 0000 "%1 code page driver cannot be initialized",CR,LF,BELL
+0008 U 0000 "Too many code pages specified",CR,LF,BELL
+0012 U 0000 "Invalid syntax on DISPLAY.SYS code page driver",CR,LF,BELL
+DOSKEY 00008f58 0010
+0001 U 0000 7,"An incompatible DOSKey is already installed.$"
+0002 U 0000 7,"Cannot change BUFSIZE.$"
+0003 U 0000 "DOSKey installed.$"
+0004 U 0000 "Invalid macro definition.$"
+0005 U 0000 "Edits command lines, recalls MS-DOS commands, and creates macros.",CR,LF,CR,LF
+ "DOSKEY [/REINSTALL] [/BUFSIZE=size] [/MACROS] [/HISTORY]",CR,LF
+ " [/INSERT | /OVERSTRIKE] [macroname=[text]]",CR,LF,CR,LF
+ " /REINSTALL Installs a new copy of Doskey.",CR,LF
+ " /BUFSIZE=size Sets size of command history buffer.",CR,LF
+ " /MACROS Displays all Doskey macros.",CR,LF
+ " /HISTORY Displays all commands stored in memory.",CR,LF
+ " /INSERT Specifies that new text you type is inserted in old text.",CR,LF
+ " /OVERSTRIKE Specifies that new text overwrites old text.",CR,LF
+ " macroname Specifies a name for a macro you create.",CR,LF
+ " text Specifies commands you want to record.",CR,LF,CR,LF
+ "UP and DOWN ARROWS recall commands; ESC clears command line; F7 displays",CR,LF
+ "command history; ALT+F7 clears command history; F8 searches command",CR,LF
+ "history; F9 selects a command by number; ALT+F10 clears macro definitions.",CR,LF,CR,LF
+ "The following are some special codes in Doskey macro definitions:",CR,LF
+ "$T Command separator. Allows multiple commands in a macro.",CR,LF
+ "$1-$9 Batch parameters. Equivalent to %1-%9 in batch programs.",CR,LF
+ "$* Symbol replaced by everything following macro name on command line.",CR,LF,0
+0006 U 0000 7,"Insufficent memory to store macro. Use the DOSKEY command with the /BUFSIZE",CR,LF
+ "switch to increase available memory.$",0
+0007 U 0000 7,"Incorrect DOS version$"
+0008 U 0000 CR,LF,'$'
+0020 U 0000 CR,LF,"-- More --",0
+0021 U 0000 "Line number: ",0
+DRIVER 00009659 0002
+0002 U 0000 "No drive specified",CR,LF
+0003 U 0000 "Loaded External Disk Driver for Drive %1",CR,LF
+EDLIN 000096d7 0035
+0006 U 0000 "*"
+0007 U 0000 "Invalid drive or file name",CR,LF
+0008 U 0000 "File name must be specified",CR,LF
+0010 U 0000 "File is READ-ONLY",CR,LF
+0011 U 0000 "File Creation Error",CR,LF
+0012 U 0000 "Too many files open",CR,LF
+0013 U 0000 "Read error in:",CR,LF,"%1",CR,LF
+0014 U 0000 "Cannot edit .BAK file--rename file",CR,LF
+0015 U 0000 "No room in directory for file",CR,LF
+0016 U 0000 "Disk full. Edits lost.",CR,LF
+0017 U 0000 "File not found",CR,LF
+0018 U 0000 "Entry error",CR,LF
+0019 U 0000 "New file",CR,LF
+0020 U 0000 "Not found",CR,LF
+0021 U 0000 "O.K.? "
+0022 U 0000 "Line too long",CR,LF
+0023 U 0000 "End of input file",CR,LF
+0024 U 0000 "Abort edit (Y/N)? "
+0025 U 0000 "Must specify destination line number",CR,LF
+0026 U 0000 "Not enough room to merge the entire file",CR,LF
+0027 U 0000 CR,LF
+0028 U 0000 LF
+0029 U 0000 "Continue (Y/N)?"
+0030 U 0000 "Unable to print message",CR,LF
+0031 U 0000 "%1"
+0032 U 0000 "%1:%2"
+0033 U 0000 "Cannot merge - code page mismatch",CR,LF
+0300 U 0000 "Starts Edlin, a line-oriented text editor.",CR,LF,CR,LF
+ "EDLIN [drive:][path]filename [/B]",CR,LF,CR,LF
+ " /B Ignores end-of-file (CTRL+Z) characters.",CR,LF
+0301 U 0000 "Edit line line#",CR,LF
+ "Append [#lines]A",CR,LF
+0302 U 0000 "Copy [startline],[endline],toline[,times]C",CR,LF
+ "Delete [startline][,endline]D",CR,LF
+0303 U 0000 "End (save file) E",CR,LF
+ "Insert [line]I",CR,LF
+0304 U 0000 "List [startline][,endline]L",CR,LF
+ "Move [startline],[endline],tolineM",CR,LF
+0305 U 0000 "Page [startline][,endline]P",CR,LF
+ "Quit (throw away changes) Q",CR,LF
+0306 U 0000 "Replace [startline][,endline][?]R[oldtext][CTRL+Znewtext]",CR,LF
+ "Search [startline][,endline][?]Stext",CR,LF
+0307 U 0000 "Transfer [toline]T[drive:][path]filename",CR,LF
+ "Write [#lines]W",CR,LF
+EXE2BIN 00009f1b 0012
+0002 U 0000 "Insufficient memory",CR,LF
+0003 U 0000 "Cannot find messages",CR,LF
+0004 U 0000 "Access denied",CR,LF
+0005 U 0000 "File cannot be converted",CR,LF
+0006 U 0000 "File not found",CR,LF
+0007 U 0000 "File creation error",CR,LF
+0008 U 0000 "Fix-ups needed - base segment (hex):"
+0012 U 0000 "File name must be specified",CR,LF
+0300 U 0000 "Converts .EXE (executable) files to binary format.",CR,LF,CR,LF
+0301 U 0000 "EXE2BIN [drive1:][path1]input-file [[drive2:][path2]output-file]",CR,LF,CR,LF
+0302 U 0000 " input-file Specifies the .EXE file to be converted.",CR,LF
+0303 U 0000 " output-file Specifies the binary file to be created.",CR,LF
+FASTOPEN 0000a1cd 0021
+0004 U 0000 CR,LF,"FASTOPEN installed",CR,LF
+0005 U 0000 CR,LF,"FASTOPEN already installed",CR,LF
+0006 U 0000 CR,LF,"Incorrect parameter",CR,LF
+0007 U 0000 CR,LF,"Too many drive entries",CR,LF
+0008 U 0000 CR,LF,"Same drive specified more than once",CR,LF
+0009 U 0000 CR,LF,"Invalid parameter",CR,LF
+0010 U 0000 CR,LF,"Invalid switch type",CR,LF
+0012 U 0001 CR,LF,"Invalid number of file/directory entries",CR,LF
+0013 U 0000 CR,LF,"Cannot setup expanded memory",CR,LF
+0014 U 0000 CR,LF,"Expanded memory not available",CR,LF
+0015 U 0000 CR,LF,"Invalid drive specification %1",CR,LF
+0016 U 0002 CR,LF,"FASTOPEN EMS entry count exceeded. Use fewer entries",CR,LF
+0017 U 0000 CR,LF,"Cannot use FASTOPEN for drive %1",CR,LF
+0019 U 0000 CR,LF,"Too many file/directory entries",CR,LF
+0020 U 0000 CR,LF,"FASTOPEN cannot be installed under DosShell",CR,LF
+0300 U 0000 "Decreases the amount of time needed to open frequently used files",CR,LF
+0301 U 0000 "and directories.",CR,LF,CR,LF
+0302 U 0000 "FASTOPEN drive:[[=]n] [drive:[[=]n][ ...]] [/X]",CR,LF,CR,LF
+0303 U 0000 " drive: Specifies the hard disk drive you want Fastopen to work with.",CR,LF
+0304 U 0000 " n Specifies the maximum number of file locations Fastopen retains",CR,LF
+ " in its filename cache.",CR,LF
+0305 U 0000 " /X Creates the filename cache in expanded memory.",CR,LF
+FDISK 0000a746 0140
+0004 U 0000 "Cannot FDISK with network loaded",CR,LF
+0005 U 0000 "No fixed disks present",CR,LF
+0006 U 0000 "Error reading fixed disk",CR,LF
+0007 U 0000 "Error writing fixed disk",CR,LF
+0009 U 0003 "Y",0
+0010 U 0003 "N",0
+0011 U 0000 "The master boot code has NOT been updated.",CR,LF
+0300 U 0000 "Configures a hard disk for use with MS-DOS.",CR,LF,CR,LF
+0301 U 0000 "FDISK",CR,LF
+1001 U 0000 " MS-DOS Version 5.00"
+1002 U 0000 " Fixed Disk Setup Program"
+1003 U 0000 " (C)Copyright Microsoft Corp. 1983 - 1991"
+1004 U 0000 " FDISK Options"
+1005 U 0000 "1. <R>Create DOS partition or Logical DOS Drive"
+1006 U 0000 "2. <R>Set active partition"
+1007 U 0000 "3. <R>Delete partition or Logical DOS Drive"
+1008 U 0000 "4. <R>Display partition information"
+1009 U 0000 "Press <H>Esc<R> to exit FDISK"
+1010 U 0000 "Choose one of the following:"
+1011 U 0000 "5. <R>Change current fixed disk drive"
+1012 U 0000 "Current fixed disk drive: <H><I>"
+1013 U 0000 "WARNING! <R>No partitions are set active - disk 1 is not startable unless"
+1014 U 0000 "a partition is set active"
+1015 U 0000 "Enter choice: <H>[<S> ]"
+1016 U 0000 " Create DOS Partition or Logical DOS Drive"
+1017 U 0000 "1. <R>Create Primary DOS Partition"
+1018 U 0000 "2. <R>Create Extended DOS Partition"
+1019 U 0000 "3. <R>Create Logical DOS Drive(s) in the Extended DOS Partition"
+1020 U 0000 "Press <H>Esc<R> to return to FDISK Options"
+1021 U 0000 " Create Primary DOS Partition"
+1022 U 0000 "Do you wish to use the maximum available size for a Primary DOS Partition"
+1023 U 0000 "and make the partition active (<Y>/<N>).....................? <H>[<S> ]"
+1024 U 0000 "(<Y>/<N>)...................................................? <H>[<S> ]"
+1025 U 0000 "Partition Status Type Volume Label Mbytes System Usage" ;C25
+1026 U 0000 "Total disk space is <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 U 0000 "Maximum space available for partition is <HIIIIR> Mbytes (<HIIIIR>)"
+1028 U 0000 "Enter partition size in Mbytes or percent of disk space (%) to"
+1029 U 0000 "create a Primary DOS Partition.................................: <H>[<IIISI>]"
+1030 U 0000 " Create Extended DOS Partition"
+1031 U 0000 "create an Extended DOS Partition..............................: <H>[<IIISI>]"
+1032 U 0000 "Press <H>Esc<R> to continue<S>"
+1033 U 0000 " Create Logical DOS Drive(s) in the Extended DOS Partition"
+1034 U 0000 "Drv Volume Label Mbytes System Usage"
+1035 U 0000 "Total Extended DOS Partition size is <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 U 0000 "Maximum space available for logical drive is <HIIIIR> Mbytes <H>(<IIII>)"
+1037 U 0000 "Enter logical drive size in Mbytes or percent of disk space (%)...<H>[<IIISI>]"
+1038 U 0000 " Set Active Partition"
+1039 U 0000 "Enter the number of the partition you want to make active...........: <H>[<S> ]"
+1040 U 0000 " Delete DOS Partition or Logical DOS Drive"
+1041 U 0000 "1. <R>Delete Primary DOS Partition"
+1042 U 0000 "2. <R>Delete Extended DOS Partition"
+1043 U 0000 "3. <R>Delete Logical DOS Drive(s) in the Extended DOS Partition"
+1044 U 0000 " Delete Primary DOS Partition"
+1045 U 0000 "WARNING! <OR>Data in the deleted Primary DOS Partition will be lost."
+1046 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1047 U 0000 " Delete Extended DOS Partition"
+1048 U 0000 "WARNING! <OR>Data in the deleted Extended DOS Partition will be lost."
+1049 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1050 U 0000 " Delete Logical DOS Drive(s) in the Extended DOS Partition"
+1051 U 0000 "WARNING! <OR>Data in a deleted Logical DOS Drive will be lost."
+1052 U 0000 "What drive do you want to delete...............................? <H>[<S> ]"
+1053 U 0000 "Are you sure (<Y>/<N>)..............................? <H>[<S> ]"
+1054 U 0000 "Enter Volume Label..............................? <H>[<S> ]"
+1055 U 0000 " Display Partition Information"
+1056 U 0000 "The Extended DOS Partition contains Logical DOS Drives."
+1057 U 0000 "Do you want to display the logical drive information (<Y>/<N>)......?<H>[<S> ]"
+1058 U 0000 " Display Logical DOS Drive Information"
+1059 U 0000 "System will now restart"
+1060 U 0001 "Insert DOS system diskette in drive A:"
+1061 U 0000 "Press any key when ready . . .<S>"
+1062 U 0000 "Primary DOS Partition deleted"
+1063 U 0000 "Extended DOS Partition deleted"
+1064 U 0000 "Drive deleted"
+1065 U 0000 "Partition <I> made active"
+1066 U 0000 "Primary DOS Partition created"
+1067 U 0000 "Extended DOS Partition created"
+1068 U 0000 "Logical DOS Drive created, drive letters changed or added<W>"
+1069 U 0000 "No partitions defined"
+1070 U 0000 "No logical drives defined"
+1071 U 0000 "Drive letters have been changed or deleted<W>"
+1072 U 0000 "Drive redirected"
+1073 U 0000 "Primary DOS Partition created, drive letters changed or added"
+1074 U 0000 "No fixed disks present."
+1075 U 0000 "Error reading fixed disk."
+1076 U 0000 "Error writing fixed disk."
+1077 U 0000 "Incorrect DOS version."
+1078 U 0000 "Cannot FDISK with network loaded."
+1079 U 0000 "No Primary DOS Partition to delete."
+1080 U 0000 "No Extended DOS Partition to delete."
+1081 U 0000 "Primary DOS Partition already exists."
+1082 U 0000 "Extended DOS Partition already exists."
+1083 U 0000 "No space to create a DOS partition."
+1084 U 0000 "Requested logical drive size exceeds the maximum available space.<W>"
+1085 U 0000 "Requested partition size exceeds the maximum available space.<W>"
+1086 U 0000 "No partitions to delete."
+1087 U 0000 "The only startable partition on Drive 1 is already set active.<W>"
+1088 U 0000 "No partitions to make active."
+1089 U 0000 "Partition selected (<I>) is not startable, active partition not changed.<W>"
+1090 U 0000 "Cannot create Extended DOS Partition without"
+1091 U 0000 "Primary DOS Partition on disk 1.<W>"
+1092 U 0000 "All available space in the Extended DOS Partition"
+1093 U 0000 "is assigned to logical drives.<W>"
+1094 U 0000 "Cannot delete Extended DOS Partition while logical drives exist.<W>"
+1095 U 0000 "All logical drives deleted in the Extended DOS Partition.<W>"
+1096 U 0000 " is not a choice. Please enter <III>.<W>"
+1097 U 0000 "WARNING! The partition set active is not startable.<W>"
+1098 U 0000 " Only non-startable partitions exist."
+1099 U 0000 "Only partitions on Drive 1 can be made active.<W>"
+1100 U 0000 "Maximum number of Logical DOS Drives installed.<W>"
+1101 U 0000 "Cannot create a zero size partition."
+1102 U 0000 "Drive <II> already deleted."
+1103 U 0000 "Unable to access Drive <I>.<OW>"
+1104 U 0000 "Invalid entry, please enter <III>.<W>"
+1105 U 0000 "Cannot delete Primary DOS Partition on drive 1 "
+1106 U 0000 "when an Extended DOS Partition exists.<W>"
+1107 U 0000 "Invalid entry.<W>"
+1108 U 0000 "Volume label does not match.<W>"
+1109 U 0000 "Cannot create Logical DOS Drive without"
+1110 U 0000 "an Extended DOS Partition on the current drive.<W>"
+1111 U 0000 "No Logical DOS Drive(s) to delete."
+1112 U 0000 "Message string error <I>. See header of FDISKC.MSG for error definition"
+1113 U 0000 "Internal error"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
+1117 U 0000 " Change Current Fixed Disk Drive"
+1118 U 0000 " Disk Drv Mbytes Free Usage"
+1119 U 0000 "(1 MByte = 1048576 bytes)"
+1120 U 0000 "Enter Fixed Disk Drive Number (1-<I>).......................<H>[<SI>]"
+1121 U 0000 "* Remote * ",0
+1122 U 0000 " Fixed Disk Drive Status"
+1123 U 0000 "What primary partition do you want to delete..? <H>[<S> ]<R>" ;C01
+1124 U 0000 "Partition selected is not a Primary DOS Partition" ;C01
+1125 U 0000 "4. <R>Delete Non-DOS Partition" ;C14
+1126 U 0000 " Delete Non-DOS Partition" ;C14
+1127 U 0000 "WARNING! <OR>Data in the deleted Non-DOS Partition will be lost." ;C14
+1128 U 0000 "What Non-DOS partition do you want to delete..? <H>[<S> ]<R>" ;C14
+1129 U 0000 "Non-DOS Partition deleted" ;C14
+1130 U 0000 "No Non-DOS Partition to delete." ;C14
+1131 U 0000 "Partition selected is not a Non-DOS Partition" ;C14
+FIND 0000c938 0012
+0004 U 0000 "FIND: "
+0300 U 0000 "Searches for a text string in a file or files.",CR,LF,CR,LF
+0301 U 0000 "FIND [/V] [/C] [/N] [/I] ""string"" [[drive:][path]filename[ ...]]",CR,LF,CR,LF
+0302 U 0000 " /V Displays all lines NOT containing the specified string.",CR,LF
+0303 U 0000 " /C Displays only the count of lines containing the string.",CR,LF
+0304 U 0000 " /N Displays line numbers with the displayed lines.",CR,LF
+0305 U 0000 " /I Ignores the case of characters when searching for the string.",CR,LF
+0306 U 0000 " ""string"" Specifies the text string to find.",CR,LF
+0307 U 0000 " [drive:][path]filename",CR,LF
+0308 U 0000 " Specifies a file or files to search.",CR,LF,CR,LF
+0309 U 0000 "If a pathname is not specified, FIND searches the text typed at the prompt",CR,LF
+0310 U 0000 "or piped from another command.",CR,LF
+FORMAT 0000ccc4 0082
+0002 U 0000 CR,"%1 percent completed. ",CR ; max 39 chars (not counting CR,LF)
+0004 U 0003 CR,"Format complete. ",CR,LF ; padded with blanks to 1 more than length of 0002 (%1 takes 3 characters)
+0007 U 0000 "Insert new diskette for drive %1:",CR,LF
+0009 U 0000 "Reinsert diskette for drive %1:",CR,LF
+0011 U 0000 CR,"Format not supported on drive %1:", CR,LF
+0012 U 0000 CR,"Invalid device parameters from device driver.",CR,LF
+0013 U 0000 CR,"Error in IOCTL call. ",CR,LF
+0014 U 0000 CR,"Not a block device. ",CR,LF
+0015 U 0000 CR,"Error writing FAT. ",CR,LF
+0016 U 0000 CR,"Error writing directory.",CR,LF
+0017 U 0000 CR,"Cannot format an ASSIGNed or SUBSTed drive. ",CR,LF
+0018 U 0000 CR,"Cannot find System Files.",CR,LF
+0019 U 0000 CR,"Cannot format a network drive.",CR,LF
+0021 U 0000 CR,"Parameters not supported.",CR,LF
+0022 U 0003 CR,"Format terminated. ",CR,LF
+0023 U 0000 CR,"Disk unsuitable for system disk.",CR,LF
+0024 U 0000 CR,"Invalid media or Track 0 bad - disk unusable.",CR,LF
+0025 U 0000 CR,"Unable to write BOOT. ",CR,LF
+0026 U 0000 CR,"Error reading directory.",CR,LF
+0028 U 0000 CR,"and press ENTER when ready..."
+0029 U 0000 CR,"Invalid Volume ID. ",CR,LF
+0031 U 0000 CR,"Enter current volume label for drive %1: "
+0032 U 0000 CR,"Parameters not compatible",CR,LF,"with fixed disk.",CR,LF
+0035 U 0000 CR,"Error reading partition table.",CR,LF
+0037 U 0000 CR,"Format broken.",CR,LF
+0038 U 0000 CR,"Format not available on drive %1:",CR,LF
+0039 U 0000 CR,"Non-System disk or disk error.",CR,LF
+0040 U 0000 CR,"Bad Partition Table. ",CR,LF
+0041 U 0000 CR,"Parameters not supported by drive.",CR,LF
+0042 U 0000 CR,LF
+0043 U 0000 CR,LF,LF
+0044 U 0000 CR,"Insert DOS disk in drive %1:",CR,LF
+0045 U 0000 CR,LF,"WARNING, ALL DATA ON NON-REMOVABLE DISK",CR,LF
+ "DRIVE %1: WILL BE LOST!",CR,LF
+ "Proceed with Format (Y/N)?"
+0046 U 0000 CR,"Format another (Y/N)?"
+0047 U 0000 CR,"Error reading partition table.",CR,LF
+0048 U 0000 CR,"Error writing partition table.",CR,LF
+0049 U 0000 CR,"Parameters not compatible.", CR,LF
+0050 U 0000 "%1 allocation units available on disk.",CR,LF
+0051 U 0000 "%1 bytes in each allocation unit.",CR,LF
+0052 U 0000 CR, "Error writing partition table.",CR,LF
+0053 U 0000 CR,"Same parameter entered twice.",CR,LF
+0054 U 0000 CR,"Must enter both /T and /N parameters.",CR,LF
+0055 U 0000 CR,"Trying to recover allocation unit %1. ",CR
+0056 U 0000 CR,"There is not enough room to create a restore file.",CR,LF
+ "You will not be able to use the unformat utility.",CR,LF
+ "Proceed with Format (Y/N)?"
+0057 U 0000 CR,"There is not enough disk space for system files. ",CR,LF
+0058 U 0000 CR,"Disk was formatted under a different version of DOS.",CR,LF
+ "This disk cannot be unformatted.",CR,LF
+ "Proceed with Format (Y/N)?"
+0059 U 0000 CR,"There was an error creating the format recovery file.",CR,LF
+ "This disk cannot be unformatted.",CR,LF
+ "Proceed with Format (Y/N)?"
+0060 U 0000 CR,"Volume label is not supported with /8 parameter.",CR,LF
+0070 U 0000 CR,"Insufficient memory to load system files.",CR,LF
+0071 U 0000 CR,"Insufficient memory.",CR,LF
+0075 U 0000 CR,"QuickFormat another (Y/N)?"
+0076 U 0000 CR,"Existing format differs from that specified.",CR,LF
+ "This disk cannot be unformatted.",CR,LF
+ "Proceed with Format (Y/N)?"
+0077 U 0000 CR,"Invalid existing format.",CR,LF
+ "This disk cannot be QuickFormatted.",CR,LF
+ "Proceed with Unconditional Format (Y/N)?"
+0078 U 0000 CR,"Formatting %1K",CR,LF
+0079 U 0000 CR,"Formatting %1M",CR,LF
+0080 U 0000 CR,"Formatting %1.%2M",CR,LF
+0081 U 0000 CR,"WARNING: This disk cannot be unformatted if system files are transferred.",CR,LF
+ "Proceed with system transfer anyway (Y/N)?"
+0082 U 0000 CR,"Verifying %1K",CR,LF
+0083 U 0000 CR,"Verifying %1M",CR,LF
+0084 U 0000 CR,"Verifying %1.%2M",CR,LF
+0085 U 0000 CR,"Saving UNFORMAT information.",CR,LF
+0086 U 0000 CR,"Checking existing disk format.",CR,LF
+0087 U 0000 CR,"QuickFormatting %1K",CR,LF
+0088 U 0000 CR,"QuickFormatting %1M",CR,LF
+0089 U 0000 CR,"QuickFormatting %1.%2M",CR,LF
+0300 U 0000 "Formats a disk for use with MS-DOS.",CR,LF,CR,LF
+0301 U 0000 "FORMAT drive: [/V[:label]] [/Q] [/U] [/F:size] [/B | /S]",CR,LF
+0302 U 0000 "FORMAT drive: [/V[:label]] [/Q] [/U] [/T:tracks /N:sectors] [/B | /S]",CR,LF
+0303 U 0000 "FORMAT drive: [/V[:label]] [/Q] [/U] [/1] [/4] [/B | /S]",CR,LF
+0304 U 0000 "FORMAT drive: [/Q] [/U] [/1] [/4] [/8] [/B | /S]",CR,LF,CR,LF
+0305 U 0000 " /V[:label] Specifies the volume label.",CR,LF
+0306 U 0000 " /Q Performs a quick format.",CR,LF
+0307 U 0000 " /U Performs an unconditional format.",CR,LF
+0308 U 0000 " /F:size Specifies the size of the floppy disk to format (such ",CR,LF
+0309 U 0000 " as 160, 180, 320, 360, 720, 1.2, 1.44, 2.88).",CR,LF
+0310 U 0000 " /B Allocates space on the formatted disk for system files.",CR,LF
+0311 U 0000 " /S Copies system files to the formatted disk.",CR,LF
+0312 U 0000 " /T:tracks Specifies the number of tracks per disk side.",CR,LF
+0313 U 0000 " /N:sectors Specifies the number of sectors per track.",CR,LF
+0314 U 0000 " /1 Formats a single side of a floppy disk.",CR,LF
+0315 U 0000 " /4 Formats a 5.25-inch 360K floppy disk in a high-density drive.",CR,LF
+0316 U 0000 " /8 Formats eight sectors per track.",CR,LF
+GRAFTABL 0000e2d0 0008
+0002 U 0000 "Active Code Page: %1",CR,LF
+0003 U 0000 "Previous Code Page: %1",CR,LF
+0004 U 0000 "None",NULL
+0005 U 0000 "Non-standard",NULL
+0300 U 0000 "Enables MS-DOS to display an extended character set in graphics mode.",CR,LF,CR,LF
+0301 U 0000 "GRAFTABL [xxx]",CR,LF
+ "GRAFTABL /STATUS",CR,LF,CR,LF
+0302 U 0000 " xxx Specifies a code page number.",CR,LF
+0303 U 0000 " /STATUS Displays the current code page selected for use with GRAFTABL.",CR,LF
+GRAPHICS 0000e4bb 0020
+0005 U 0000 "Invalid parameter: %1",CR,LF
+0007 U 0000 "Duplicate parameters not allowed",CR,LF
+0009 U 0000 "Cannot find GRAPHICS profile",CR,LF
+0010 U 0000 "Required profile statement missing before line %1",CR,LF
+0011 U 0000 "Invalid profile statement on line %1",CR,LF
+0012 U 0000 "Profile statement out of sequence on line %1",CR,LF
+0013 U 0000 "Error reading GRAPHICS profile",CR,LF
+0014 U 0000 "Syntax errors in GRAPHICS profile",CR,LF
+0015 U 0000 "Printbox ID not in GRAPHICS profile",CR,LF
+0016 U 0000 "Printer type not in GRAPHICS profile",CR,LF
+0017 U 0000 "/B invalid with a black and white printer",CR,LF
+0018 U 0000 "Unable to reload with profile supplied",CR,LF
+0300 U 0000 "Loads a program that can print graphics.",CR,LF,CR,LF
+0301 U 0000 "GRAPHICS [type] [[drive:][path]filename] [/R] [/B] [/LCD]",CR,LF
+ " [/PRINTBOX:STD | /PRINTBOX:LCD]",CR,LF,CR,LF
+0302 U 0000 " type Specifies a printer type (see User's Guide and Reference).",CR,LF
+0303 U 0000 " [drive:][path]filename",CR,LF
+ " Specifies the file containing information on supported printers.",CR,LF
+0304 U 0000 " /R Prints white on black as seen on the screen.",CR,LF
+0305 U 0000 " /B Prints the background in color for COLOR4 and COLOR8 printers.",CR,LF
+0306 U 0000 " /LCD Prints using LCD aspect ratio.",CR,LF
+0307 U 0000 " /PRINTBOX:STD | /PRINTBOX:LCD",CR,LF
+ " Specifies the print-box size, either STD or LCD.",CR,LF
+JOIN 0000eaa5 0009
+0002 U 0001 "Directory not empty",CR,LF
+0300 U 0000 "Joins a disk drive to a directory on another drive.",CR,LF,CR,LF
+0301 U 0000 "JOIN [drive1: [drive2:]path]",CR,LF
+0302 U 0000 "JOIN drive1: /D",CR,LF,CR,LF
+0303 U 0000 " drive1: Specifies a disk drive that will appear as a directory on",CR,LF
+ " drive2.",CR,LF
+0304 U 0000 " drive2: Specifies a drive to which you want to join drive1.",CR,LF
+0305 U 0000 " path Specifies the directory to which you want to join drive1. It",CR,LF
+ " must be empty and cannot be the root directory.",CR,LF
+0306 U 0000 " /D Cancels any previous JOIN commands for the specified drive.",CR,LF,CR,LF
+0307 U 0000 "Type JOIN without parameters to list currently joined drives.",CR,LF
+KEYB 0000edd8 0023
+0002 U 0000 "Current keyboard code: %1"
+0003 U 0000 "Current keyboard ID: %1"
+0004 U 0000 " code page: %1",CR,LF
+0005 U 0000 "Current CON code page: %1",CR,LF
+0006 U 0000 "Invalid keyboard code specified",CR,LF
+0007 U 0000 "Invalid keyboard ID specified",CR,LF
+0008 U 0000 "Invalid code page specified",CR,LF
+0009 U 0000 "Bad or missing Keyboard Definition File",CR,LF
+0010 U 0000 "KEYB has not been installed",CR,LF
+0011 U 0000 "Active code page not available from CON device",CR,LF
+0012 U 0000 "Code page specified has not been prepared",CR,LF
+0013 U 0000 "One or more CON code pages invalid for given keyboard code",CR,LF
+0014 U 0000 "Code page requested (%1) is not valid for given keyboard code",CR,LF
+0015 U 0000 "Code page specified is inconsistent with the selected code page",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 U 0000 "Unable to create KEYB table in resident memory",CR,LF
+0300 U 0000 "Configures a keyboard for a specific language.",CR,LF,CR,LF
+0301 U 0000 "KEYB [xx[,[yyy][,[drive:][path]filename]]] [/E] [/ID:nnn]",CR,LF,CR,LF
+0302 U 0000 " xx Specifies a two-letter keyboard code.",CR,LF
+0303 U 0000 " yyy ÿ Specifies the code page for the character set.",CR,LF
+0304 U 0000 " [drive:][path]filename Specifies the keyboard definition file.",CR,LF
+0305 U 0000 " /E Specifies that an enhanced keyboard is installed.",CR,LF
+0306 U 0000 " /ID:nnn Specifies the keyboard in use.",CR,LF
+MEM 0000f40f 0066
+0010 U 0000 CR,LF
+0011 U 0000 " Address Name Size Type ",CR,LF
+0012 U 0000 " ------- -------- ------ ------",CR,LF
+0013 U 0000 " Handle EMS Name Size ",CR,LF
+0014 U 0000 " ------- -------- ------ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "%1 bytes total conventional memory",CR,LF
+0019 U 0000 "%1 bytes available to MS-DOS",CR,LF
+0020 U 0000 "%1 largest executable program size",CR,LF
+0021 U 0000 "%1 bytes total EMS memory",CR,LF
+0022 U 0000 "%1 bytes free EMS memory",CR,LF
+0023 U 0000 "%1 bytes total contiguous extended memory",CR,LF
+0024 U 0000 "Interrupt Vector",0
+0025 U 0000 "ROM Communication Area",0
+0026 U 0000 "DOS Communication Area",0
+0027 U 0000 "IO",0
+0028 U 0000 "MSDOS",0
+0029 U 0000 "System Data",0
+0030 U 0000 "System Program",0
+0031 U 0000 "System Device Driver",0
+0032 U 0000 "Installed Device Driver",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "BUFFERS=",0
+0036 U 0000 "FILES=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "STACKS=",0
+0039 U 0000 "DEVICE=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "LASTDRIVE=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+0046 U 0001 "%1 bytes available contiguous extended memory",CR,LF
+0047 U 0000 "System Stacks",0
+0048 U 0000 "-- Free --",0
+0049 U 0000 "Program",0
+0050 U 0000 "Environment",0
+0051 U 0000 "Data",0
+0052 N 0000 "%1 bytes available XMS memory",CR,LF
+0053 N 0000 " 64Kb High Memory Area available",CR,LF
+0054 N 0000 " High Memory Area in use",CR,LF
+0055 N 0000 " MS-DOS resident in High Memory Area",CR,LF
+0056 U 0000 "IBMBIO",0 ;*EGH
+0057 U 0000 "IBMDOS",0 ;*EGH
+0058 N 0000 " MS-DOS resident in ROM using High Memory Area",CR,LF
+0059 U 0000 "Conventional Memory :",CR,LF
+0060 U 0000 "Upper Memory :",CR,LF
+0061 U 0000 "Total FREE : %1 %2 ",CR,LF
+0062 U 0000 "FREE",0
+0063 U 0000 " Name Size in Decimal Size in Hex",CR,LF
+0064 U 0000 "------------- --------------------- -------------",CR,LF
+0065 U 0000 "Total bytes available to programs (Conventional+Upper) : %1 %2",CR,LF
+0066 U 0000 "Largest executable program size : %1 %2",CR,LF
+0067 U 0000 "Largest available upper memory block : %1 %2",CR,LF
+0068 U 0000 "Too much of memory fragmentation; MEM /C cannot be done",CR,LF
+0069 U 0000 "SYSTEM",0
+0070 U 0000 "Total bytes available to programs : %1 %2",CR,LF
+0300 U 0000 "Displays the amount of used and free memory in your system.",CR,LF,CR,LF
+0301 U 0000 "MEM [/PROGRAM | /DEBUG | /CLASSIFY]",CR,LF,CR,LF
+0302 U 0000 " /PROGRAM or /P Displays status of programs currently loaded in memory.",CR,LF
+0303 U 0000 " /DEBUG or /D Displays status of programs, internal drivers, and other",CR,LF
+ " information.",CR,LF
+0304 U 0000 " /CLASSIFY or /C Classifies programs by memory usage. Lists the size of",CR,LF
+ " programs, provides a summary of memory in use, and lists",CR,LF
+ " largest memory block available.",CR,LF
+0400 U 0000 "ADDDRV",0
+MODE 000101cb 0079
+0003 U 0000 CR,LF,"Must specify COM1, COM2, COM3 or COM4",CR,LF
+0004 U 0000 CR,LF,"Resident portion of MODE loaded",CR,LF
+0005 U 0000 CR,LF,"Illegal device name",CR,LF
+0006 U 0000 CR,LF,"Printer error",CR,LF
+0007 U 0000 CR,LF,"LPT%1: set for 80",CR,LF
+0008 U 0000 CR,LF,"LPT%1: set for 132",CR,LF
+0009 U 0000 CR,LF,"Printer lines per inch set",CR,LF
+0010 U 0000 CR,LF,"Invalid baud rate specified",CR,LF
+0011 U 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 U 0000 "0123456789"
+0013 U 0001 CR,LF,"Do you see the %1? (Y/N) "
+0015 U 0000 "LPT%1: rerouted to COM%2:",CR,LF
+0016 U 0000 "LPT%1: not rerouted",CR,LF
+0017 U 0000 CR,LF,"%1 retry on parallel printer time-out",CR,LF
+0018 U 0000 CR,LF," Unable to shift screen %1",CR,LF
+0020 U 0000 CR,LF,"Invalid number of parameters",CR,LF
+0021 U 0000 CR,LF,"NET 042: Unable to do requested command",CR,LF
+0022 U 0001 CR,LF,"Infinite retry not supported on network printer",CR,LF
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 U 0000 CR,LF,"Failure to access device: %1",CR,LF
+0025 U 0001 CR,LF,"Device or code page missing from font file",CR,LF
+0026 U 0000 CR,LF,"Font file contents invalid",CR,LF
+0027 U 0001 CR,LF,"Previously prepared code page replaced",CR,LF
+0028 U 0001 CR,LF,"Active code page for device %1 is %2",CR,LF
+0029 U 0000 CR,LF,"Device %1 not prepared",CR,LF
+0030 U 0001 "%1 code pages:",CR,LF
+0031 U 0001 " code page %1",CR,LF
+0032 U 0001 CR,LF,"MODE %1 code page function completed",CR,LF
+0033 U 0002 CR,LF,"Current code page settings:",CR,LF
+0034 U 0002 " %1 - %2 code page",CR,LF
+0035 U 0002 " code page not prepared",CR,LF
+0036 U 0002 CR,LF,"Code page operation not supported on this device",CR,LF
+0037 U 0002 CR,LF,"No code page has been selected",CR,LF
+0038 U 0002 "Device error during %1",CR,LF
+0039 U 0002 "Code page not prepared",CR,LF
+0040 U 0002 CR,LF,"Current keyboard does not support this code page",CR,LF
+0041 U 0002 CR,LF,"Error during read of font file",CR,LF
+0042 U 0002 CR,LF,"Unable to perform refresh operation",CR,LF
+0043 U 0002 CR,LF
+0044 U 0002 CR,LF,"Status for device %1:",CR,LF
+0045 U 0002 "------------------"
+0046 U 0002 "----",CR,LF
+0047 U 0002 "-----",CR,LF
+0048 U 0002 "Lines=%1",CR,LF
+0049 U 0002 "Columns=%1",CR,LF
+0050 U 0002 CR,LF,"Rate and delay must be specified together",CR,LF
+0051 U 0002 "Rate=%1",CR,LF
+0052 U 0002 "Delay=%1",CR,LF
+0053 U 0002 CR,LF,"Function not supported on this computer - %1",CR,LF
+0054 U 0002 CR,LF,"Required font not loaded",CR,LF
+0055 U 0002 CR,LF,"ANSI.SYS must be installed to perform requested function",CR,LF
+0056 U 0002 CR,LF,"Baud rate required",CR,LF
+0057 U 0002 "Retry=%1",CR,LF
+0059 U 0002 "rightmost 9",0
+0060 U 0002 "leftmost 0",0
+0061 U 0002 "No",0
+0062 U 0002 "Infinite",0
+0063 U 0002 "left",0
+0064 U 0002 "right",0
+0065 U 0002 "Hardware",0
+0066 U 0002 "Prepared",0
+0067 U 0002 "status",0
+0068 U 0002 "prepare",0
+0069 U 0002 "select",0
+0070 U 0002 "refresh",0
+0071 U 0002 "write of font file to device",0
+0072 U 0002 "selected",0
+0073 U 0002 "system",0
+0300 U 0000 "Configures system devices.",CR,LF,CR,LF
+0301 U 0000 "Printer port: MODE LPTn[:] [COLS=c] [LINES=l] [RETRY=r]",CR,LF
+0302 U 0000 "Serial port: MODE COMm[:] [BAUD=b] [PARITY=p] [DATA=d] [STOP=s] [RETRY=r]",CR,LF
+0303 U 0000 "Device Status: MODE [device] [/STATUS]",CR,LF
+0304 U 0000 "Redirect printing: MODE LPTn[:]=COMm[:]",CR,LF
+0305 U 0000 "Prepare code page: MODE device CP PREPARE=((yyy[...]) [drive:][path]filename)",CR,LF
+0306 U 0000 "Select code page: MODE device CP SELECT=yyy",CR,LF
+0307 U 0000 "Refresh code page: MODE device CP REFRESH",CR,LF
+0308 U 0000 "Code page status: MODE device CP [/STATUS]",CR,LF
+0309 U 0000 "Display mode: MODE [display-adapter][,n]",CR,LF
+ " MODE CON[:] [COLS=c] [LINES=n]",CR,LF
+0310 U 0000 "Typematic rate: MODE CON[:] [RATE=r DELAY=d]",CR,LF
+MORE 00011148 0007
+0002 U 0000 "-- More --"
+0003 U 0000 "Too many arguments in command line",CR,LF
+0300 U 0000 "Displays output one screen at a time.",CR,LF,CR,LF
+0301 U 0000 "MORE < [drive:][path]filename",CR,LF
+0302 U 0000 "command-name | MORE",CR,LF,CR,LF
+0303 U 0000 " [drive:][path]filename Specifies a file to display one screen at a time.",CR,LF
+0304 U 0000 " command-name Specifies a command whose output will be displayed.",CR,LF
+MSBIO 00011319 0023
+0003 U 0000 13,10,"Unrecognized command in CONFIG.SYS"
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Sector size too large in file $"
+0006 U 0000 13,10,"Bad or missing $"
+0007 U 0000 "Command Interpreter",0
+0008 U 0000 13,10,"Invalid country code or code page",13,10,"$"
+0009 U 0000 13,10,"Error in COUNTRY command",13,10,"$"
+0010 U 0000 13,10, "Insufficient memory for COUNTRY.SYS file",13,10,"$"
+0011 U 0000 13,10,"Configuration too large for memory",13,10,"$"
+0012 U 0000 13,10,"Too many block devices",13,10,"$"
+0013 U 0000 13,10,"Invalid STACK parameters",13,10,"$"
+0014 U 0000 13,10,"Incorrect order in CONFIG.SYS line ","$"
+0015 U 0000 "Error in CONFIG.SYS line ","$"
+0016 U 0000 13,10,"Memory allocation error ","$"
+0017 U 0001 0DH,0AH,7,0DH,0AH, "Internal stack overflow",0DH,0AH
+ "System halted",0DH,0AH,"$"
+0018 U 0000 "HMA not available : Loading DOS low",13,10,"$"
+0019 U 0000 13,10,"failed to boot - missing local driver $"
+0020 U 0000 13,10,"Insert diskette for drive "
+0021 U 0000 "A: and press any key when ready",13,10,10,0
+0022 U 0000 13,10,"Bad command or parameters - $"
+0023 U 0000 "Fatal Error:Cannot allocate Memory for DOS", 13, 10, "$"
+0024 U 0000 "WARNING! Logical drives past Z: exist and will be ignored",13,10,"$"
+0025 U 0000 "This version of DOS will boot only on IBM machines",13,10,0
+MSDOS 00011869 0007
+0001 U 0001 13,10,"Divide overflow",13,10
+0002 U 0002 "y"
+0003 U 0002 "n"
+0004 U 0003 13,10,"A20 Hardware Error",13,10,"$"
+0005 U 0000 "Y"
+0006 U 0000 "N"
+0007 U 0000 "You must have the file WINA20.386 in the root of your boot drive",13,10
+ "to run Windows in Enhanced Mode",13,10
+NLSFUNC 000119a2 0003
+0300 U 0000 "Loads country-specific information.",CR,LF,CR,LF
+0301 U 0000 "NLSFUNC [[drive:][path]filename]",CR,LF,CR,LF
+0302 U 0000 " [drive:][path]filename Specifies the file containing country-specific",CR,LF
+ " information.",CR,LF
+PRINT 00011ac6 0034
+0002 U 0000 CR,LF
+0006 U 0000 " error reading file",CR,LF,"$"
+0007 U 0000 "File not found",CR,LF,"$"
+0008 U 0000 CR,LF,LF,"File $"
+0009 U 0000 " canceled by operator$"
+0010 U 0000 CR,LF,LF,"All files canceled by operator$"
+0011 U 0000 "File allocation table bad drive "
+0012 U 0000 "A.",CR,LF,"$"
+0013 U 0000 "List output is not assigned to a device",CR,LF
+0014 U 0000 "Resident part of PRINT installed",CR,LF
+0015 U 0000 "Cannot use PRINT - Use NET PRINT",CR,LF
+0017 U 0000 "PRINT queue is full",CR,LF
+0018 U 0000 "PRINT queue is empty",CR,LF
+0019 U 0000 "Access denied",CR,LF
+0020 U 0000 "Invalid drive specification",CR,LF
+0021 U 0000 "Errors on list device indicate that it",CR,LF
+ "may be off-line. Please check it.",CR,LF
+0022 U 0000 CR,LF,LF," %1 is currently being printed",CR,LF
+0023 U 0000 " %1 is in queue",CR,LF
+0025 U 0001 "Pathname too long",CR,LF
+0026 U 0001 "File not in PRINT queue",CR,LF
+0027 U 0000 "Name of list device [PRN]: "
+0300 U 0000 "Prints a text file while you are using other MS-DOS commands.",CR,LF,CR,LF
+0301 U 0000 "PRINT [/D:device] [/B:size] [/U:ticks1] [/M:ticks2] [/S:ticks3]",CR,LF
+0302 U 0000 " [/Q:qsize] [/T] [[drive:][path]filename[ ...]] [/C] [/P]",CR,LF,CR,LF
+0303 U 0000 " /D:device Specifies a print device.",CR,LF
+0304 U 0000 " /B:size Sets the internal buffer size, in bytes.",CR,LF
+0305 U 0000 " /U:ticks1 Waits the specified maximum number of clock ticks for the printer",CR,LF
+ " to be available.",CR,LF
+0306 U 0000 " /M:ticks2 Specifies the maximum number of clock ticks it takes to print a",CR,LF
+ " character.",CR,LF
+0307 U 0000 " /S:ticks3 Allocates the scheduler the specified number of clock ticks for",CR,LF
+ " background printing.",CR,LF
+0308 U 0000 " /Q:qsize Specifies the maximum number of files allowed in the print queue.",CR,LF
+0309 U 0000 " /T Removes all files from the print queue.",CR,LF
+0310 U 0000 " /C Cancels printing of the preceding filename and subsequent",CR,LF
+ " filenames.",CR,LF
+0311 U 0000 " /P Adds the preceding filename and subsequent filenames to the print",CR,LF
+ " queue.",CR,LF,CR,LF
+0312 U 0000 "Type PRINT without parameters to display the contents of the print queue.",CR,LF
+PRINTER 000123f8 0002
+0002 U 0000 "%1 code page driver cannot be initialized",CR,LF,BELL
+0012 U 0000 "Invalid syntax on PRINTER.SYS code page driver",CR,LF,BELL
+RECOVER 0001249d 0017
+0002 U 0000 CR,LF,"File not found",CR,LF
+0003 U 0000 CR,LF,"Cannot RECOVER an ASSIGNed or SUBSTed drive",CR,LF
+0004 U 0000 CR,LF,"Invalid drive or file name",CR,LF
+0005 U 0000 CR,LF,"WARNING - directory full",CR,LF
+0006 U 0000 CR,LF,"Cannot RECOVER a network drive", CR,LF
+0008 U 0000 CR,LF,"%1 file(s) recovered",CR,LF
+0009 U 0000 CR,LF,"%1 of %2 bytes recovered",CR,LF
+0010 U 0000 CR,LF,"Press any key to begin recovery of the",CR,LF,"file(s) on drive %1",CR,LF,CR,LF
+0011 U 0000 CR,LF,"Cannot read file allocation table",CR,LF
+0012 U 0000 CR,LF,"Cannot write file allocation table",CR,LF
+0013 U 0000 CR,LF
+0300 U 0000 "Recovers readable information from a bad or defective disk.",CR,LF,CR,LF
+0301 U 0000 "RECOVER [drive:][path]filename",CR,LF
+0302 U 0000 "RECOVER drive:",CR,LF,CR,LF
+0303 U 0000 "Consult your User's Guide and Reference before using the RECOVER command.",CR,LF
+0400 U 0000 "The current directory structure will be destroyed.",CR,LF
+ "All files will be placed in the root directory.",CR,LF
+ "Are you sure (Y/N)? "
+0401 U 0000 "The entire drive will be reconstructed,",CR,LF
+ "directory structures will be destroyed.", CR, LF
+ "Are you sure (Y/N)? "
+REPLACE 0001295a 0019
+0003 U 0000 CR,LF,"No files replaced",CR,LF
+0004 U 0000 CR,LF,"No files added",CR,LF
+0013 U 0000 CR,LF,"Replacing %1",CR,LF
+0014 U 0000 CR,LF,"Adding %1",CR,LF
+0015 U 0000 CR,LF,"%1 file(s) replaced",CR,LF
+0016 U 0000 CR,LF,"%1 file(s) added",CR,LF
+0017 U 0000 CR,LF,"No files found - %1",CR,LF
+0022 U 0000 CR,LF,"Replace %1? (Y/N)"
+0023 U 0000 CR,LF,"Add %1? (Y/N)"
+0300 U 0000 "Replaces files.",CR,LF,CR,LF
+0301 U 0000 "REPLACE [drive1:][path1]filename [drive2:][path2] [/A] [/P] [/R] [/W]",CR,LF
+ "REPLACE [drive1:][path1]filename [drive2:][path2] [/P] [/R] [/S] [/W] [/U]",CR,LF,CR,LF
+0302 U 0000 " [drive1:][path1]filename Specifies the source file or files.",CR,LF
+0303 U 0000 " [drive2:][path2] Specifies the directory where files are to be",CR,LF
+ " replaced.",CR,LF
+0304 U 0000 " /A Adds new files to destination directory. Cannot",CR,LF
+ " use with /S or /U switches.",CR,LF
+0305 U 0000 " /P Prompts for confirmation before replacing a file or",CR,LF
+ " adding a source file.",CR,LF
+0306 U 0000 " /R Replaces read-only files as well as unprotected",CR,LF
+ " files.",CR,LF
+0307 U 0000 " /S Replaces files in all subdirectories of the",CR,LF
+ " destination directory. Cannot use with the /A",CR,LF
+ " switch.",CR,LF
+0308 U 0000 " /W Waits for you to insert a disk before beginning.",CR,LF
+0309 U 0000 " /U Replaces (updates) only files that are older than",CR,LF
+ " source files. Cannot use with the /A switch.",CR,LF
+RESTORE 00013069 0035
+0002 U 0000 CR,LF,"Source and target drives are the same",CR,LF
+0003 U 0000 CR,LF,"Invalid number of parameters",CR,LF
+0006 U 0000 CR,LF,"Invalid drive specification",CR,LF
+0007 U 0000 CR,LF,"WARNING! No files were found to restore",CR,LF
+0008 U 0000 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF
+0009 U 0000 CR,LF,"Insert restore target in drive %1:",CR,LF
+0011 U 0000 CR,LF,"WARNING! Diskette is out of sequence",CR,LF
+ "Replace diskette or continue if OK",CR,LF
+0012 U 0000 CR,LF,"The last file was not restored",CR,LF
+0013 U 0000 CR,LF,"*** Files were backed up %1 ***",CR,LF
+0014 U 0000 CR,LF,"Source does not contain backup files",CR,LF
+0015 U 0000 CR,LF,"Insufficient memory",CR,LF
+0016 U 0000 CR,LF,"WARNING! File %1",CR,LF
+ "is a read-only file",CR,LF
+ "Replace the file (Y/N)?"
+0017 U 0000 CR,LF,"Restore file sequence error",CR,LF
+0018 U 0000 CR,LF,"File creation error",CR,LF
+0019 U 0000 CR,LF,"Insufficient disk space",CR,LF
+0020 U 0000 CR,LF,"*** Not able to restore file ***",CR,LF
+0021 U 0000 CR,LF,"*** Restoring files from drive %1: ***",CR,LF
+0022 U 0000 CR,LF,"WARNING! File %1",CR,LF
+ "was changed after it was backed up",CR,LF
+ "Replace the file (Y/N)?",CR,LF
+0023 U 0000 "Diskette: %1",CR,LF
+0032 U 0000 CR,LF,"*** Listing files on drive %1: ***",CR,LF
+0300 U 0000 "Restores files that were backed up by using the BACKUP command.",CR,LF,CR,LF
+0301 U 0000 "RESTORE drive1: drive2:[path[filename]] [/S] [/P] [/B:date] [/A:date] [/E:time]",CR,LF
+0302 U 0000 " [/L:time] [/M] [/N] [/D]",CR,LF,CR,LF
+0303 U 0000 " drive1: Specifies the drive on which the backup files are stored.",CR,LF
+0304 U 0000 " drive2:[path[filename]]",CR,LF
+ " Specifies the file(s) to restore.",CR,LF
+0305 U 0000 " /S Restores files in all subdirectories in the path.",CR,LF
+0306 U 0000 " /P Prompts before restoring read-only files or files changed since",CR,LF
+0307 U 0000 " the last backup (if appropriate attributes are set).",CR,LF
+0308 U 0000 " /B Restores only files last changed on or before the specified date.",CR,LF
+0309 U 0000 " /A Restores only files changed on or after the specified date.",CR,LF
+ " /E Restores only files last changed at or earlier than the specified",CR,LF
+0310 U 0000 " time.",CR,LF
+0311 U 0000 " /L Restores only files changed at or later than the specified time.",CR,LF
+0312 U 0000 " /M Restores only files changed since the last backup.",CR,LF
+0313 U 0000 " /N Restores only files that no longer exist on the destination disk.",CR,LF
+0314 U 0000 " /D Displays files on the backup disk that match specifications.",CR,LF
+SHARE 00013b08 0005
+0003 U 0000 "SHARE cannot be installed under DOSSHELL.",CR,LF
+0300 U 0000 "Installs file-sharing and locking capabilities on your hard disk.",CR,LF,CR,LF
+0301 U 0000 "SHARE [/F:space] [/L:locks]",CR,LF,CR,LF
+0302 U 0000 " /F:space Allocates file space (in bytes) for file-sharing information.",CR,LF
+0303 U 0000 " /L:locks Sets the number of files that can be locked at one time.",CR,LF
+SORT 00013cae 0009
+0005 U 0000 "SORT: "
+0300 U 0000 "Sorts input and writes results to the screen, a file, or another device.",CR,LF,CR,LF
+0301 U 0000 "SORT [/R] [/+n] < [drive1:][path1]filename1 [> [drive2:][path2]filename2]",CR,LF
+0302 U 0000 "[command |] SORT [/R] [/+n] [> [drive2:][path2]filename2]",CR,LF,CR,LF
+0303 U 0000 " /R Reverses the sort order; that is, sorts Z to A,",CR,LF
+ " then 9 to 0.",CR,LF
+0304 U 0000 " /+n Sorts the file according to characters in",CR,LF
+ " column n.",CR,LF
+0305 U 0000 " [drive1:][path1]filename1 Specifies a file to be sorted.",CR,LF
+0306 U 0000 " [drive2:][path2]filename2 Specifies a file where the sorted input is to be ",CR,LF
+ " stored.",CR,LF
+0307 U 0000 " command Specifies a command whose output is to be sorted.",CR,LF
+SUBST 0001405f 0009
+0002 U 0001 "Incorrect number of parameters",CR,LF
+0005 U 0000 "Drive already SUBSTed",CR,LF
+0300 U 0000 "Associates a path with a drive letter.",CR,LF,CR,LF
+0301 U 0000 "SUBST [drive1: [drive2:]path]",CR,LF
+0302 U 0000 "SUBST drive1: /D",CR,LF,CR,LF
+0303 U 0000 " drive1: Specifies a virtual drive to which you want to assign a path.",CR,LF
+0304 U 0000 " [drive:2]path Specifies a physical drive and path you want to assign to",CR,LF
+ " a virtual drive.",CR,LF
+0305 U 0000 " /D Deletes a substituted (virtual) drive.",CR,LF,CR,LF
+0306 U 0000 "Type SUBST with no parameters to display a list of current virtual drives.",CR,LF
+SYS 0001431a 0015
+0004 U 0000 "Invalid drive specification",CR,LF
+0007 U 0000 "No room for system on destination disk",CR,LF
+0008 U 0001 "Invalid path or System files not found",CR,LF
+0010 U 0000 "No system on default drive",CR,LF
+0011 U 0000 "Cannot specify default drive",CR,LF
+0012 U 0000 "Write failure, diskette unusable",CR,LF
+0014 U 0000 "Insert system disk in drive %1",CR,LF
+0016 U 0000 "Not able to SYS to %1 file system",CR,LF
+0019 U 0000 "Source path and target drive cannot be the same",CR,LF ;C04
+0025 U 0000 CR,LF,"Could not copy COMMAND.COM onto target disk",CR,LF
+0026 U 0000 "Insufficient memory",CR,LF
+0300 U 0000 "Copies MS-DOS system files and command interpreter to a disk you specify.",CR,LF,CR,LF
+0301 U 0000 "SYS [drive1:][path] drive2:",CR,LF,CR,LF
+0302 U 0000 " [drive1:][path] Specifies the location of the system files.",CR,LF
+0303 U 0000 " drive2: Specifies the drive the files are to be copied to.",CR,LF
+TREE 000146e8 0008
+0002 U 0000 "Directory PATH listing for Volume %1",CR,LF
+0003 U 0000 "Directory PATH listing",CR,LF
+0004 U 0000 "No sub-directories exist",CR,LF,LF
+0007 U 0000 "ÀÄó"
+0300 U 0000 "Graphically displays the directory structure of a drive or path.",CR,LF,CR,LF
+0301 U 0000 "TREE [drive:][path] [/F] [/A]",CR,LF,CR,LF
+0302 U 0000 " /F Displays the names of the files in each directory.",CR,LF
+0303 U 0000 " /A Uses ASCII instead of extended characters.",CR,LF
+XCOPY 000148d6 0033
+0004 U 0000 "Does %1 specify a file name",CR,LF
+ "or directory name on the target",CR,LF
+ "(F = file, D = directory)?"
+0005 U 0000 "Press any key to begin copying file(s)"
+0006 U 0000 "Path too long",CR,LF
+0008 U 0000 "Cannot perform a cyclic copy",CR,LF
+0012 U 0000 "Cannot XCOPY from a reserved device",CR,LF
+0021 U 0000 "Invalid number of parameters",CR,LF
+0022 U 0000 "Cannot XCOPY to a reserved device",CR,LF
+0024 U 0000 "File creation error",CR,LF
+0025 U 0000 "Reading source file(s)...",CR,LF
+0026 U 0000 CR,LF
+0027 U 0000 "%1 File(s) copied",CR,LF
+0028 U 0000 "%1 File not found",CR,LF
+0029 U 0000 "F D "
+0030 U 0000 "%1%2",CR,LF
+0031 U 0000 "%1\%2",CR,LF
+0032 U 0000 "%1",CR,LF
+0033 U 0000 "%1%2 (Y/N)?"
+0034 U 0000 "%1\%2 (Y/N)?"
+0036 U 0000 "Invalid Path, not all directories/files copied",CR,LF ;C02
+0300 U 0000 "Copies files (except hidden and system files) and directory trees.",CR,LF,CR,LF
+0301 U 0000 "XCOPY source [destination] [/A | /M] [/D:date] [/P] [/S [/E]] [/V] [/W]",CR,LF,CR,LF
+0302 U 0000 " source Specifies the file(s) to copy.",CR,LF
+0303 U 0000 " destination Specifies the location and/or name of new files.",CR,LF
+0304 U 0000 " /A Copies files with the archive attriband interpreter to a disk you specify.",CR,LF,CR,LF
+0301 U 0000 "SYS [drive1:][path] drive2:",CR,LF,CR,LF
+0302 U 0000 " [drive1:][path] Specifies the location of the system files.",CR,LF
+0303 U 0000 " drive2: Specifies the drive the files are to be copied to.",CR,LF
+TREE 000146e8 0008
+0002 U 0000 "Directory PATH listing for Volume %1",CR,LF
+0003 U 0000 "Directory PATH listing",CR,LF
+0004 U 0000 "No sub-directories exist",CR,LF,LF
+0007 U 0000 "ÀÄó"
+0300 U 0000 "Graphically displays the directory structure of a drive or path.",CR,LF,CR,LF
+0301 U 0000 "TREE [drive:][path] [/F] [/A]",CR,LF,CR,LF
+0302 U 0000 " /F Displays the names of the files in each directory.",CR,LF
+0303 U 0000 " /A Uses ASCII instead of extended characters.",CR,LF
+XCOPY 000148d6 0033
+0004 U 0000 "Does %1 specify a file name",CR,LF
+ "or directory name on the target",CR,LF
+ "(F = file, D = directory)?"
+0005 U 0000 "Press any key to begin copying file(s)"
+0006 U 0000 "Path too long",CR,LF
+0008 U 0000 "Cannot perform a cyclic copy",CR,LF
+0012 U 0000 "Cannot XCOPY from a reserved device",CR,LF
+0021 U 0000 "Invalid number of parameters",CR,LF
+0022 U 0000 "Cannot XCOPY to a reserved device",CR,LF
+0024 U 0000 "File creation error",CR,LF
+0025 U 0000 "Reading source file(s)...",CR,LF
+0026 U 0000 CR,LF
+0027 U 0000 "%1 File(s) copied",CR,LF
+0028 U 0000 "%1 File not found",CR,LF
+0029 U 0000 "F D "
+0030 U 0000 "%1%2",CR,LF
+0031 U 0000 "%1\%2",CR,LF
+0032 U 0000 "%1",CR,LF
+0033 U 0000 "%1%2 (Y/N)?"
+0034 U 0000 "%1\%2 (Y/N)?"
+0036 U 0000 "Invalid Path, not all directories/files copied",CR,LF ;C02
+0300 U 0000 "Copies files (except hidden and system files) and directory trees.",CR,LF,CR,LF
+0301 U 0000 "XCOPY source [destination] [/A | /M] [/D:date] [/P] [/S [/E]] [/V] [/W]",CR,LF,CR,LF
+0302 U 0000 " source Specifies the file(s) to copy.",CR,LF
+0303 U 0000 " destination Specifies the location and/or name of new files.",CR,LF
+0304 U 0000 " /A Copies files with the archive attribute set,",CR,LF
+0305 U 0000 " doesn't change the attribute.",CR,LF
+0306 U 0000 " /M Copies files with the archive attribute \ No newline at end of file
diff --git a/private/mvdm/dos/v86/messages/loadmsg.msg b/private/mvdm/dos/v86/messages/loadmsg.msg
new file mode 100644
index 000000000..8adf099f5
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/loadmsg.msg
@@ -0,0 +1,12 @@
+HelpMsg db 'Loads a program above the first 64K of memory, and runs the program.',0dh,0ah,0dh,0ah
+ db 'LOADFIX [drive:][path]filename',0dh,0ah,0dh,0ah
+ db 'Use LOADFIX to load a program if you have received the message',0dh,0ah
+ db '"Packed file corrupt" when trying to load it in low memory.',0dh,0ah
+ db '$'
+
+ErrMsg db 'Error executing the given program','$'
+NoParms db 'Error: No program name given','$'
+NoComspec db 'Error: missing COMSPEC','$'
+
+
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/messages/makefile b/private/mvdm/dos/v86/messages/makefile
new file mode 100644
index 000000000..b633bce04
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/makefile
@@ -0,0 +1,14 @@
+#************************* makefile for messages **************************
+!IFNDEF COUNTRY
+COUNTRY =usa-ms
+!ENDIF
+
+
+#
+####################### dependencies begin here. #########################
+#
+
+all: $(COUNTRY).idx
+
+$(COUNTRY).idx: $(COUNTRY).msg
+ -$(_NTBINDIR)\private\mvdm\tools16\buildidx $(COUNTRY).msg
diff --git a/private/mvdm/dos/v86/messages/nether.msg b/private/mvdm/dos/v86/messages/nether.msg
new file mode 100644
index 000000000..729c398df
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/nether.msg
@@ -0,0 +1,1107 @@
+0003
+COMMON 0006 0037
+0001 T 0000 "Onjuiste DOS versie",CR,LF
+0002 T 0000 "%1 reeds ge‹nstalleerd",CR,LF
+0003 T 0000 "%1 bytes beschikbaar op schijf",CR,LF
+0004 T 0000 "%1 bytes beschikbaar",CR,LF
+0005 T 0000 "%1 bytes in onbruikbare sectoren",CR,LF
+0006 T 0000 "%1 bytes schijfcapaciteit",CR,LF
+0007 U 0000 "%1 bytes total memory",CR,LF
+0008 T 0000 "%1 bytes in systeembestanden",CR,LF
+0009 T 0000 "%1 ge‹nstalleerd",CR,LF
+0010 T 0000 "%1 niet ge‹nstalleerd",CR,LF
+0011 T 0000 "%1 niet ge‹nstalleerd",CR,LF
+0012 T 0000 "%1 kan niet worden gebruikt voor een netwerkstation",CR,LF
+0013 T 0000 "",
+0014 T 0000 "%1 kan niet worden gebruikt omdat SUBST of ASSIGN actief is",CR,LF
+0015 T 0000 "%1 kan niet worden uitgevoerd",CR,LF
+0016 U 0000 "Expanded Memory not available",CR,LF
+0017 T 0000 "FAT beschadigd op schijf in station %1",CR,LF
+0018 T 0000 "Bestand kan niet naar zichzelf worden gekopieerd",CR,LF
+0019 U 0000 "Insert target disk in drive %1",CR,LF
+0020 T 0000 "Onvoldoende schijfruimte",CR,LF
+0021 T 0000 "Ongeldige tekens in volume-label",CR,LF
+0022 U 0000 "Invalid code page",CR,LF
+0023 T 0000 "Datum of notatie ongeldig",CR,LF
+0024 T 0000 "Tijd of notatie ongeldig",CR,LF
+0025 T 0000 "Ongeldig pad",CR,LF
+0026 T 0000 "Geen bronstation opgegeven",CR,LF
+0027 T 0000 "Geen doelstation opgegeven",CR,LF
+0028 U 0000 "Press any key to continue . . .",CR,LF
+0029 T 0000 "Bronpad moet worden opgegeven",CR,LF
+0030 T 0000 "Systeem overgezet",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Index kan niet worden gemaakt",CR,LF
+0033 T 0000 "Volume in station %1 heeft geen label",CR,LF
+0034 T 0000 "Volume in station %1 heet %2",CR,LF
+0035 T 0000 "Volume-label (max. 11 tekens):",CR,LF
+0036 U 0000 "Volume Serial Number is %1-%2",CR,LF
+0037 U 0000 "Incorrect file type",CR,LF
+EXTEND 070c 0089
+0001 U 0000 "Invalid Function",CR,LF
+0002 T 0000 "Bestand niet gevonden",CR,LF
+0003 T 0000 "Pad niet gevonden",CR,LF
+0004 T 0000 "Te veel open bestanden",CR,LF
+0005 T 0000 "Geen toegang ",CR,LF
+0006 U 0000 "Invalid handle",CR,LF
+0007 U 0000 "Memory control blocks destroyed",CR,LF
+0008 T 0000 "Onvoldoende geheugen",CR,LF
+0009 U 0000 "Invalid memory block address",CR,LF
+0010 U 0000 "Invalid Environment",CR,LF
+0011 U 0000 "Invalid format",CR,LF
+0012 U 0000 "Invalid function parameter",CR,LF
+0013 U 0000 "Invalid data",CR,LF
+0014 T 0000 "",
+0015 T 0000 "Ongeldig station opgegeven",CR,LF
+0016 U 0000 "Attempt to remove current directory",CR,LF
+0017 U 0000 "Not same device",CR,LF
+0018 U 0000 "No more files",CR,LF
+0019 U 0000 "Write protect error",CR,LF
+0020 U 0000 "Invalid unit",CR,LF
+0021 T 0000 "Eenheid of schijf niet gereed (fout ",CR,LF
+0022 U 0000 "Invalid device request",CR,LF
+0023 U 0000 "Data error",CR,LF
+0024 U 0000 "Invalid device request parameters",CR,LF
+0025 U 0000 "Seek error",CR,LF
+0026 U 0000 "Invalid media type",CR,LF
+0027 T 0000 "Sector niet gevonden (fout ",CR,LF
+0028 T 0000 "Geen papier in printer (fout ",CR,LF
+0029 T 0000 "DOS kan gegevens niet wegschrijven (fout ",CR,LF
+0030 U 0000 "Read fault error",CR,LF
+0031 T 0000 "Algemene storing",CR,LF
+0032 T 0000 "Inbreuk op gemeenschappelijk gebruik - fout",CR,LF
+0033 T 0000 "Inbreuk op geblokkeerd bestand - fout",CR,LF
+0034 T 0000 "Verwisselen van schijf ongeldig",CR,LF
+0035 T 0000 "FCB niet beschikbaar",CR,LF
+0036 U 0000 "System resource exhausted",CR,LF
+0037 U 0000 "Code page mismatch",CR,LF
+0038 U 0000 "Out of input",CR,LF
+0039 T 0000 "Onvoldoende schijfruimte",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 U 0000 "Request not supported by file system",CR,LF
+0051 U 0000 "Can not attach to File system",CR,LF
+0052 U 0000 "File system name already exists",CR,LF
+0053 U 0000 "File system name not found",CR,LF
+0054 U 0000 "File system busy",CR,LF
+0055 U 0000 "File system device no longer exists",CR,LF
+0056 U 0000 "File system resource exhausted",CR,LF
+0057 U 0000 "File system experienced a device error",CR,LF
+0058 U 0000 "File system provided incorrect response",CR,LF
+0059 U 0000 "File system experienced an unexpected error",CR,LF
+0060 U 0000 "File system not compatible",CR,LF
+0061 U 0000 "Device output file limit exceeded",CR,LF
+0062 U 0000 "Device output file space limit exceeded",CR,LF
+0063 U 0000 "Device output file no longer exists",CR,LF
+0064 U 0000 "File system name no longer exists",CR,LF
+0065 U 0000 "Access denied by file system",CR,LF
+0066 U 0000 "File system device type incorrect",CR,LF
+0067 U 0000 "File system not found",CR,LF
+0068 U 0000 "File system resource exhausted",CR,LF
+0069 U 0000 "File system resource exhausted",CR,LF
+0070 U 0000 "File system device is temporarily unavailable",CR,LF
+0071 U 0000 "File system request not accepted",CR,LF
+0072 U 0000 "File system device is paused",CR,LF
+0073 U 0001 "File system component not available",CR,LF
+0074 U 0001 "File system experienced an unexpected error",CR,LF
+0075 U 0001 "File system experienced an unexpected error",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 U 0000 "File already exists",CR,LF
+0081 T 0000 "",
+0082 U 0000 "Can not make directory entry",CR,LF
+0083 U 0000 "Fail requested to Critical Error",CR,LF
+0084 U 0000 "Too many attaches",CR,LF
+0085 U 0000 "Device or file already attached",CR,LF
+0086 U 0000 "Invalid password",CR,LF
+0087 T 0000 "Ongeldige parameter",CR,LF
+0088 U 0000 "File system data fault",CR,LF
+0089 U 0000 "Function not supported by file system",CR,LF
+PARSE 15f5 0011
+0001 U 0000 "Too many parameters",CR,LF
+0002 U 0000 "Required parameter missing",CR,LF
+0003 U 0000 "Invalid switch",CR,LF
+0004 U 0000 "Invalid keyword",CR,LF
+0005 T 0000 "",
+0006 U 0000 "Parameter value not in allowed range",CR,LF
+0007 U 0000 "Parameter value not allowed",CR,LF
+0008 U 0000 "Parameter value not allowed",CR,LF
+0009 U 0000 "Parameter format not correct",CR,LF
+0010 T 0000 "Ongeldige parameter",CR,LF
+0011 U 0000 "Invalid parameter combination",CR,LF
+IBMBIO 17e6 0017
+0003 U 0000 CR,LF,"Unrecognized command in CONFIG.SYS"
+0004 T 0000 CR,LF,"$"
+0005 U 0000 CR,LF,"Sector size too large in file $"
+0006 U 0000 CR,LF,"Bad or missing $"
+0007 U 0000 "Command Interpreter",0
+0008 U 0000 CR,LF,"Invalid country code or code page",CR,LF,"$"
+0009 U 0000 CR,LF,"Error in COUNTRY command",CR,LF,"$" 0010 U 0000 CR,LF, "Insufficient memory for COUNTRY.SYS file",CR,LF,"$"
+0011 U 0000 CR,LF,"Configuration too large for memory",CR,LF,"$"
+0012 U 0000 CR,LF,"Too many Block Devices",CR,LF,"$"
+0013 U 0000 CR,LF,"Invalid STACK parameters",CR,LF,"$"
+0014 U 0000 CR,LF,"Incorrect order in CONFIG.SYS file line ","$"
+0015 U 0000 "Error in CONFIG.SYS line ","$"
+0016 T 0000 CR,LF,"Fout bij toewijzen geheugen $"
+0017 T 0000 "Interne stack-ruimte overschreden",CR,LF
+ "Systeemfuncties gestopt",CR,LF
+0020 T 0000 CR,LF,"Plaats diskette in station "
+0021 T 0000 "A: ",CR,LF,"en druk op een toets om verder te gaan",CR,LF,LF,0
+0022 U 0000 CR,LF,"Bad command or parameters - $"
+BOOT 1be6 0001
+0001 T 0000 CR,LF,"Geen systeemschijf of schijffout",CR,LF
+ "Vervang schijf en druk op een toets",CR,LF,0
+COMMAND 1c66 0091
+0201 T 0000 "A" ;AC000;
+0202 T 0000 "H" ;AC000;
+0203 T 0000 "N" ;AC000;
+0204 U 0000 "F" ;AC000;
+0205 T 0000 "J" ;AC000;
+0206 T 0000 "N" ;AC000;
+0210 T 0000 "Afbreken" ;AC000;
+0211 T 0000 ", Herhalen" ;AC000;
+0212 T 0000 ", Negeren" ;AC000;
+0213 U 0000 ", Fail" ;AC000;
+0214 U 0000 "?" ;AC000;
+0215 T 0000 "bij lezen van",0 ;AC000;
+0216 T 0000 "bij schrijven naar",0 ;AC000;
+0217 T 0000 "%1 station %2",CR,LF ;AC000;
+0218 U 0000 "%1 device %2",CR,LF ;AC000;
+0219 U 0000 "Please insert volume %1 serial %2-%3",CR,LF ;AC009;
+0221 T 0000 "Ongeldige COMMAND",CR,LF ;AC000;
+0222 T 0000 "Plaats diskette met %1 in station %2",CR,LF ;AC000;
+0224 T 0000 CR,LF,"Batch-programma be‰indigen (J/N) ?" ;AC000;
+0225 T 0000 "%1 kan niet worden uitgevoerd",CR,LF ;AC000;
+0226 T 0000 "Fout in .EXE-bestand",CR,LF ;AC000;
+0227 T 0000 "Programma te groot voor het geheugen",CR,LF ;AC000;
+0228 T 0000 CR,LF,"Geen bestandsingang beschikbaar" ;AC000;
+0229 T 0000 "Opdracht of bestandsnaam onjuist",CR,LF ;AC000;
+0231 T 0000 CR,LF,"Fout bij toewijzen geheugen" ;AC000;
+0232 T 0000 CR,LF,"COMMAND kan niet worden geladen, systeemfuncties gestopt",CR,LF;AC000;
+0233 T 0000 CR,LF,"COMMAND kan niet worden gestart",CR,LF ;AC000;
+0234 T 0000 CR,LF,"Proces afgebroken, opstarten kan niet worden voortgezet",CR,LF;AC000;
+0235 T 0000 CR,LF ;AC000;
+0463 T 0000 "Onvoldoende ruimte in verwerkingsomgeving",CR,LF ;AC000;
+0464 U 0000 CR,LF,"The IBM Personal Computer DOS",CR,LF
+ "Version 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF ;AC000;
+0465 T 0000 "Ongeldige zoekindex voor COMMAND",CR,LF
+0466 T 0000 "Ongeldige zoekindex voor COMMAND - geen toegang",CR,LF
+1002 T 0000 "Bestandsnaam bestaat reeds of bestand niet gevonden",CR,LF ;AC000;
+1003 T 0000 "Pad of bestandsnaam ongeldig",CR,LF ;AC000;
+1007 T 0000 "Onvoldoende ruimte in verwerkingsomgeving",CR,LF ;AC000;
+1008 T 0000 "Fout bij maken bestand",CR,LF ;AC000;
+1009 T 0000 "Batch-bestand ontbreekt",CR,LF ;AC000;
+1010 T 0000 CR,LF,"Plaats schijf met batch-bestand",CR,LF ;AC000;
+1011 T 0000 "Opdracht of bestandsnaam onjuist",CR,LF ;AC000;
+1016 T 0000 "Inhoud doelbestand v¢¢r het kopi‰ren verloren gegaan",CR,LF ;AC000;
+1017 T 0000 "Bestandsnaam ongeldig of bestand niet gevonden",CR,LF ;AC000;
+1018 T 0000 "%1 bestand(en) gekopieerd",CR,LF ;AC000;
+1019 T 0000 "%1 bestand(en) " ;AC000;
+1022 T 0000 "Codetabel %1 niet gedefinieerd voor dit systeem",CR,LF ;AC000;
+1023 T 0000 "Codetabel %1 niet gedefinieerd voor alle eenheden",CR,LF ;AC000;
+1024 T 0000 "Actieve codetabel: %1",CR,LF ;AC000;
+1025 U 0000 "NLSFUNC not installed",CR,LF ;AC000;
+1027 T 0000 "Actief station is niet meer geldig" ;AC000;
+1029 T 0000 "Label niet gevonden",CR,LF ;AC000;
+1030 T 0000 "Syntaxisfout",CR,LF ;AC000;
+1032 T 0000 "Datum is nu ingesteld op %1 %2",CR,LF ;AC000;
+1033 T 0000 "zo ma di wo do vr za " ;AC000;
+1034 T 0000 "Voer nieuwe datum in (%1): "
+1036 T 0000 "Tijd is nu ingesteld op %1",CR,LF ;AC000;
+1037 T 0000 "Voer nieuwe tijd in: "
+1038 U 0000 ", Delete (Y/N)?" ;AC000;
+1039 U 0000 "All files in directory will be deleted!",CR,LF
+ "Are you sure (Y/N)?" ;AC000;
+1040 T 0000 "IBM Personal Computer DOS Versie %1.%2",CR,LF ;AC000;
+1044 T 0000 "Ongeldige index",CR,LF ;AC000;
+1046 T 0000 "Ongeldig pad, geen index",CR,LF,"of index niet leeg",CR,LF ;AC000;
+1047 T 0000 "ON/OFF moet worden opgegeven",CR,LF ;AC000;
+1048 T 0000 "Index van %1",CR,LF ;AC000;
+1049 T 0000 "Geen pad",CR,LF ;AC000;
+1050 T 0000 "Ongeldig station in zoekopdracht",CR,LF ;AC000;
+1051 T 0000 "Ongeldige eenheid",CR,LF ;AC000;
+1052 T 0000 "FOR kan niet worden genest",CR,LF ;AC000;
+1053 T 0000 "Fout in tussenbestand tijdens sluizen",CR,LF ;AC000;
+1054 T 0000 "Binair lezen vanaf eenheid niet mogelijk",CR,LF ;AC000;
+1055 T 0000 "BREAK is %1 ",CR,LF ;AC000;
+1056 T 0000 "VERIFY is %1 ",CR,LF ;AC000;
+1057 T 0000 "ECHO is %1 ",CR,LF ;AC000;
+1059 T 0000 "off",0 ;AC000;
+1060 T 0000 "on",0 ;AC000;
+1061 T 0000 "Fout bij schrijven naar eenheid",CR,LF ;AC000;
+1063 T 0000 "%1" ;AC000;
+1064 T 0000 "%1" ;AC000;
+1065 T 0000 "%1" ;AC000;
+1066 T 0000 "%1" ;AC000;
+1067 T 0000 9 ;AC000;
+1068 T 0000 " <DIR> " ;AC000;
+1069 T 0000 8," ",8 ;AC000;
+1070 T 0000 CR,LF ;AC000;
+1071 T 0000 "%1" ;AC000;
+1072 T 0000 "mm-dd-jj" ;AC000;
+1073 T 0000 "dd-mm-jj" ;AC000;
+1074 T 0000 "jj-mm-dd" ;AC000;
+1075 T 0000 "%1 %2" ;AC000;
+1076 T 0000 "%1" ;AC000;
+1077 T 0000 " %1 %2" ;AC000;
+1078 U 0000 "Directory already exists",CR,LF ;AC000;
+ATTRIB 33cc 0016
+0004 T 0000 "Onjuist aantal parameters",CR,LF
+0005 T 0000 "Ongeldig pad of bestand niet gevonden",CR,LF
+0006 T 0000 "Syntaxisfout",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 U 0000 "%1, Code page mismatch",CR,LF,"Are you sure (Y/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 U 0000 "Invalid file type value",CR,LF
+0199 U 0000 "Extended attribute error",CR,LF
+0201 U 0000 "Extended attribute name not found",CR,LF
+0204 U 0000 "Extended attribute name can't be set",CR,LF
+0205 U 0000 "Extended attribute name known to this filesystem but not supported",CR,LF
+0206 U 0000 "Extended attribute type mismatch",CR,LF
+0208 U 0000 "Extended attribute value not supported",CR,LF
+ASSIGN 36c4 0001
+0002 U 0000 "Original %1: set to %2:",cr,lf
+CHKDSK 3705 0063
+0003 T 0000 "Verspreide ketens converteren naar bestanden (J/N) ?" ;freemes
+0004 T 0000 "Onherstelbare fout in index" ;ptrandir
+0005 T 0000 "Index naar bestand converteren (J/N) ?" ;ptrandir2
+0007 T 0000 "%1 bytes totale schijfruimte" ;dskspc
+0008 T 0000 "%1 bytes in onbruikbare sectoren" ;badspc
+0009 T 0000 "%1 bytes in %2 verborgen bestanden" ;hidmes
+0010 T 0000 "%1 bytes in %2 indexen" ;dirmes
+0011 T 0000 "%1 bytes in %2 gebruikersbestanden" ;filemes
+0012 T 0000 "%1 bytes in %2 teruggevonden bestanden" ;orphmes2
+0013 T 0000 "%1 bytes zouden beschikbaar komenin %2 teruggevonden bestanden" ;orphmes3
+0014 T 0000 "%1 bytes beschikbaar op schijf" ;frespc
+0015 T 0000 "%1 totaal bytes geheugen" ;totmem
+0016 T 0000 "%1 bytes beschikbaar" ;fremem
+0017 T 0000 "CHKDSK kan niet worden gebruikt voor een netwerkstation" ;no_net_arg
+0018 T 0000 "CHKDSK kan niet worden gebruikt omdat SUBST of ASSIGN actief is" ;SubStErr
+0019 T 0000 "Waarschijnlijk geen DOS-schijf",CR,LF,"Doorgaan (J/N) ?" ;badidbyt
+0020 U 0000 "Disk error reading FAT %1",CR,LF ;badr
+0021 T 0000 "Index %1" ;direc_arg
+0022 T 0000 "%1 Bevat %2 niet-aaneengesloten blokken" ;extent_arg
+0023 T 0000 "Alle opgegeven bestanden zijn aaneengesloten" ;noext_arg
+0024 T 0000 "Fouten gevonden. Parameter /F niet opgegeven:",CR,LF,"correcties worden niet naar schijf geschreven" ;fixmes_arg
+0025 T 0000 " Verwerking kan niet worden voortgezet %1%2" ;fatal_arg
+0026 T 0000 " FAT beschadigd op schijf in station %1" ;badrdmes
+0029 T 0000 " CHDIR .. mislukt, andere methode wordt geprobeerd" ;cdddmes
+0030 T 0000 " Heeft een ongeldige cluster, bestand afgekapt" ;badchain
+0031 T 0000 " Ongeldige informatie in subindex" ;badsubdir
+0032 T 0000 " Bestaat niet" ;ndotmes
+0033 T 0000 " Nummer eerste cluster is ongeldig, bestand afgekapt" ;nulnz
+0034 T 0000 " Fout in toewijzing, omvang aangepast" ;badclus
+0035 T 0000 " Ingang . kan niet worden teruggevonden, verwerking voortgezet" ;norecdot
+0036 T 0000 " Index is geheel leeg, ook geen . of .." ;nuldmes
+0037 T 0000 " Index samengevoegd" ;joinmes
+0038 T 0000 " Ingang .. kan niet worden teruggevonden" ;norecddot
+0039 T 0000 " Ingang heeft een foutieve verbinding" ;norecddot1
+0040 T 0000 " Ingang heeft een foutief bestandskenmerk" ;norecddot2
+0041 T 0000 " Ingang heeft een foutieve omvang" ;norecddot3
+0042 T 0000 " Is kruiselings gekoppeld met cluster %1" ;cross_arg
+0043 T 0000 " CHDIR naar %1,",CR,LF,"voorbij dit punt niet uitgevoerd" ;badtarg_ptr
+0044 T 0000 " voorbij dit punt niet uitgevoerd" ;badtarg2
+0045 T 0000 "%1 bytes schijfruimte svrijgemaakt" ;freebymes1
+0046 T 0000 "%1 bytes schijfruimte zou worden vrijgemaakt" ;freebymes2
+0047 T 0000 "Schijf %1 is gemaakt op %2 %3",CR,LF ;idmes_arg
+0048 U 0000 "%1 total allocation units on disk"
+0049 U 0000 "%1 bytes in each allocation unit" ;idmes2
+0050 U 0000 "CHKDSK not available on drive %1" ;msgExecFailure
+0051 U 0000 " Extended Attributes has invalid clusters, attributes truncated" ;Inv_XA_Msg
+0052 U 0000 " Extended Attributes allocation error , attributes truncated" ;Alloc_XA_Msg
+0053 T 0000 "Ongeldige parameter" ;badsw_arg
+0055 T 0000 "Pad niet gevonden" ;invpath_arg
+0056 T 0000 "Bestand niet gevonden" ;opnerr_arg
+0058 T 0000 " %1 verspreide clusters gevonden in %2 ketens" ;orph_arg
+0059 T 0000 CR,LF ;crlf_arg
+0060 T 0000 " CHDIR naar hoofdindex niet mogelijk",CR,LF ;badcd_arg
+0061 T 0000 " Schijffout bij schrijven naar FAT %1" ;badw_arg
+0062 T 0000 " %1" ;noisy_arg
+0063 T 0000 "Actieve index is niet bruikbaar" ;baddpbdir
+0064 T 0000 "%1",CR,LF ;file_arg
+0065 U 0000 " Insufficient room in root directory",CR,LF," Move files from root directory and repeat CHKDSK" ;creatmes
+0066 T 0000 "%1 %2 %3" ;eup_arg
+0067 T 0000 "%1 %2, %3" ;usp_arg
+0068 T 0000 "%1%2%3%4%5" ;oth_arg
+0069 T 0000 "%1%2%3%4" ;time_arg
+0070 U 0000 "%1 available allocation units on disk" ;idmes2 ;an017;bgb
+DEBUG 4ac5 0062
+0004 U 0000 "Allocation failed or specified buffer too small",CR,LF
+0005 U 0000 "Bad or missing Msg info",CR,LF
+0006 T 0000 "Foutieve naam eenheid" ;baddev_ptr
+0007 T 0000 "Kan uitvoereenheid PRN niet openen",CR,LF
+ "Voer naam van uitvoereenheid " ;badlstmes_ptr
+0008 T 0000 CR,LF ;crlf_ptr
+0009 T 0000 CR,LF,"Programma normaal be‰indigd",CR,LF
+0010 T 0000 "Ongeldig station opgegeven" ;nambad_ptr
+0012 T 0000 "Fout bij maken bestand" ;noroom_ptr
+0013 T 0000 "Onvoldoende schijfruimte" ;nospace_ptr
+0014 U 0000 "Disk error reading drive %1" ;dr1_ptr
+0015 U 0000 "Disk error writing drive %1" ;dr2_ptr
+0016 U 0000 "Write protect error reading drive %1" ;dr3_ptr
+0017 U 0000 "Write protect error writing drive %1" ;dr4_ptr
+0019 T 0000 "%1^Fout" ;synerr
+0020 T 0000 "Fout in .EXE- of .HEX-bestand" ;exebad_ptr/hexerr_ptr
+0021 T 0000 "Bestandstypen .EXE en .HEX kunnen niet worden weggeschreven" ;exewrt_ptr/hexwrt_ptr
+0022 T 0000 "EXEC niet uitgevoerd" ;execemes_ptr
+0023 T 0000 "Schrijffout, geen bestemming opgegeven" ;nonamespec_ptr
+0024 T 0000 "Geen toegang" ;accmes_ptr
+0025 T 0000 "Pariteitsfout of geheugen niet aanwezig" ;paritymes_ptr
+0026 T 0000 "-" ;prompt_ptr
+0027 T 0000 "%1 -" ;change_flag_ptr
+0032 T 0000 "%1%2" ;unassem_ln_ptr
+0033 T 0000 "%1:%2 %3" ;hex_ptr
+0034 T 0000 "%1 %2" ;add_ptr
+0035 T 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0000 "%1=%2 " ;register_ptr
+0037 T 0000 "%1fout" ;errmes_ptr
+0038 T 0000 "%1 bytes worden weggeschreven" ;wrtmes_ptr
+0039 T 0000 "%1:%2=" ;loc_ptr
+0040 T 0000 "%1" ;little_ptr
+0041 T 0000 "%1" ;big_ptr
+0042 T 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "%1fout %2 station %3" ;dskerr_ptr
+0044 T 0000 32,8 ;bacmes_ptr
+0045 U 0000 "Unable to allocate message handler",CR,LF ;fatal_error
+0046 T 0000 "%1" ;arg_buf_ptr
+0047 T 0000 "%1" ;one_char_buf_ptr
+0050 U 0000 "%1 of a total %2 EMS pages have been allocated",cr,lf
+0051 U 0000 "%1 of a total %2 EMS handles have been allocated",cr,lf
+0054 U 0000 "Page Frame = "
+0055 U 0000 "Handle created = %1 ",cr,lf
+0056 U 0000 "Logical page %1 mapped to physical page %2 ",cr,lf
+0057 U 0000 "EMS hardward/software failure",cr,lf
+0058 U 0000 "Handle not found",cr,lf
+0059 U 0000 "Invalid function code",cr,lf
+0060 U 0000 "No free handles",cr,lf
+0061 U 0000 "Save/Restore error",cr,lf
+0062 U 0000 "Total pages exceeded",cr,lf
+0063 U 0000 "Free pages exceeded",cr,lf
+0064 U 0000 "Parameter error",cr,lf
+0065 U 0000 "Logical Page out of range",cr,lf
+0066 U 0000 "Physical Page out of range",cr,lf
+0067 U 0000 "Save area already in use",cr,lf
+0068 U 0000 "Save area not in use",cr,lf
+0070 U 0000 "General error (TBD)",cr,lf
+0071 U 0000 "Missing or invalid EMS parameter",cr,lf
+0072 U 0000 "Handle %1 has %2 pages allocated",cr,lf
+0074 U 0000 "EMS restore successful",cr,lf
+0075 U 0000 "Physical page %1 = Frame segment %2",cr,lf
+0076 U 0000 "Handle %1 deallocated",cr,lf
+0078 U 0000 "EMS not installed",cr,lf
+DRIVER 5919 0002
+0002 T 0000 "Geen station opgegeven",CR,LF,"$"
+0003 T 0000 "Stuurprogramma geladen voor extern station %1",CR,LF,"$"
+EDLIN 59a4 0028
+0006 T 0000 "*" ;prompt_ptr
+0007 T 0000 "Station of bestandsnaam ongeldig",CR,LF ;baddrv_ptr
+0008 T 0000 "Bestandsnaam moet worden opgegeven",CR,LF ;ndname_ptr
+0009 T 0000 "Ongeldige parameter",CR,LF ;opt_err_ptr
+0010 T 0000 "Bestand kan alleen worden gelezen",CR,LF ;ro_err_ptr
+0011 T 0000 "Fout bij maken bestand",CR,LF ;bcreat_ptr
+0012 T 0000 "Te veel open bestanden",CR,LF ;too_many_ptr
+0013 T 0000 "Leesfout in:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0000 "Een .BAK-bestand kan niet worden gewijzigd",CR,LF,"Wijzig bestandsnaam",CR,LF ;nobak_ptr
+0015 T 0000 "Geen ruimte in index voor bestand",CR,LF ;nodir_ptr
+0016 T 0000 "Schijf vol. Wijzigingen zijn verloren",CR,LF ;dskful_ptr
+0017 T 0000 "Bestand niet gevonden",CR,LF ;filenm_ptr
+0018 T 0000 "Invoerfout",CR,LF ;badcom_ptr
+0019 T 0000 "Nieuw bestand",CR,LF ;newfil_ptr
+0020 T 0000 "Niet gevonden",CR,LF ;nosuch_ptr
+0021 T 0000 "O.K.? " ;ask_ptr
+0022 T 0000 "Regel te lang",CR,LF ;toolng_ptr
+0023 T 0000 "Einde invoerbestand",CR,LF ;eof_ptr
+0024 T 0000 "Afbreken zonder opslaan (J/N) ?" ;qmes_ptr
+0025 T 0000 "Nummer van bestemmingsregel moet worden opgegeven",CR,LF ;dest_ptr
+0026 T 0000 "Niet genoeg ruimte om bestand volledig samen te voegen",CR,LF ;mrgerr_ptr
+0027 T 0000 CR,LF ;crlf_ptr
+0028 T 0000 LF ;lf_ptr
+0029 T 0000 "Doorgan (J/N) ?" ;cont_ptr
+0030 U 0000 "Unable to print message",CR,LF ;fatal_error
+0031 T 0000 "%1" ;arg_buf_ptr
+0032 T 0000 "%1:%2" ;line_num_buf_ptr
+0033 U 0000 "Cannot merge - Code page mismatch",CR,LF ;cp_err_ptr
+EXE2BIN 613f 0010
+0002 T 0000 "Onvoldoende geheugen",CR,LF
+0003 U 0000 "Can't find messages",CR,LF
+0004 T 0000 "Geen toegang",CR,LF
+0005 U 0000 "File cannot be converted",CR,LF
+0006 T 0000 "Bestand niet gevonden",CR,LF
+0007 T 0000 "Fout bij maken bestand",CR,LF
+0008 U 0000 "Fix-ups needed - base segment (hex):"
+0009 T 0000 "Ongeldige parameter",CR,LF
+0011 U 0000 "WARNING - Read error on EXE file.",CR,LF
+ "Amount read is less than size in header.",CR,LF
+0012 T 0000 "Bestandsnaam moet worden opgegeven",CR,LF
+FIND 634c 0001
+0004 U 0000 "FIND: "
+FORMAT 6376 0044
+0002 U 0000 CR,"%1 percent of disk formatted"
+0004 T 0000 CR,"Indelen voltooid ",CR,LF
+0007 T 0000 "Plaats nieuwe diskette in station %1:",CR,LF
+0009 T 0000 "Plaats de diskette terug in station %1:",CR,LF
+0010 T 0000 "Volume-label (max. 11 tekens) ? "
+0011 T 0000 CR,"Indelen niet mogelijk in station %1:", CR,LF
+0012 T 0000 CR,"Stuurprogramma voor eenheid bevat ongeldige parameters",CR,LF
+0013 T 0000 CR,"Fout in IOCTL-opdracht ",CR,LF
+0014 T 0000 CR,"Geen schijfstation ",CR,LF
+0015 T 0000 CR,"Fout bij vastleggen van de FAT ",CR,LF
+0016 T 0000 CR,"Fout bij vastleggen van de index",CR,LF
+0017 T 0000 CR,"Station kan niet worden ingedeeld omdat ASSIGN of SUBST actief is",CR,LF
+0018 T 0000 CR,"DOS kan systeembestanden niet vinden",CR,LF
+0019 T 0000 CR,"Een netwerkstation kan niet worden ingedeeld",CR,LF
+0020 T 0000 CR,"Ongeldige tekens in volume-label ",CR,LF
+0021 T 0000 CR,"Parameters niet mogelijk",CR,LF
+0022 U 0000 CR,"Format terminated ",CR,LF
+0023 T 0000 CR,"Schijf kan niet worden gebruikt als systeemschijf",CR,LF
+0024 T 0000 CR,"Ongeldig medium of spoor 0 beschadigd - schijf onbruikbaar",CR,LF
+0025 T 0000 CR,"BOOT-record kan niet worden vastgelegd ",CR,LF
+0026 T 0000 CR,"Fout bij lezen van de index",CR,LF
+0028 U 0000 CR,"and press ENTER when ready..."
+0029 T 0000 CR,"Ongeldige volume-ID ",CR,LF
+0031 T 0000 CR,"Voer het huidige volume-label in van station %1: "
+0032 T 0000 CR,"Parameters niet geldig",CR,LF,"voor vaste schijf",CR,LF
+0035 T 0000 CR,"Fout bij lezen van de partitietabel",CR,LF
+0037 T 0000 CR,"Indeling verstoord",CR,LF
+0038 U 0000 CR,"Format not available on drive %1",CR,LF
+0039 T 0000 CR,"Geen systeemschijf of schijffout",CR,LF
+0040 T 0000 CR,"Ongeldige partitietabel ",CR,LF
+0041 T 0000 CR,"Parameters niet mogelijk voor station",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"Insert DOS disk in drive %1:",CR,LF
+0045 T 0000 CR,LF,"WAARSCHUWING, ALLE INFORMATIE OP VASTE SCHIJF",CR,LF
+ "IN STATION %1: ZAL VERLOREN GAAN!",CR,LF
+ "Starten met indelen (J/N) ?"
+0046 T 0000 CR,"Nog een schijf indelen (J/N) ?"
+0047 T 0000 CR,"Fout bij lezen van de partitietabel",CR,LF
+0048 T 0000 CR,"Fout bij vastleggen van de partitietabel",CR,LF
+0049 T 0000 CR,"Parameters kunnen niet worden gecombineerd", CR,LF
+0050 U 0000 "%1 allocation units available on disk",CR,LF
+0051 U 0000 "%1 bytes in each allocation unit",CR,LF
+0052 T 0000 CR, "Fout bij vastleggen van de partitietabel",CR,LF
+0053 U 0000 CR,"Same parameter entered twice",CR,LF
+0054 U 0000 CR,"Must enter both /T and /N parameters",CR,LF ;AN009;
+JOIN 6e4f 0001
+0002 T 0000 CR,LF,"Index niet leeg",CR,LF
+MORE 6e8e 0001
+0002 T 0000 "-- Vervolg --"
+PRINT 6ebf 0022
+0002 T 0000 CR,LF
+0006 U 0000 " error reading file",CR,LF,"$"
+0007 T 0000 "Bestand niet gevonden",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Bestand $"
+0009 T 0000 " geannuleerd door operator$"
+0010 T 0000 CR,LF,LF,"Alle bestanden geannuleerd door operator$"
+0011 T 0000 "FAT beschadigd op schijf in station "
+0012 T 0000 "A:",CR,LF,"$"
+0013 T 0000 "Ongeldige uitvoereenheid voor PRINT",CR,LF
+0014 T 0000 "Resident gedeelte van PRINT ge‹nstalleerd",CR,LF
+0015 T 0000 "PRINT kan niet worden gebruikt - gebruik NET PRINT",CR,LF
+0017 T 0000 "PRINT-wachtrij is vol",CR,LF
+0018 T 0000 "PRINT-wachtrij is leeg",CR,LF
+0019 T 0000 "Geen toegang",CR,LF
+0020 T 0000 "Ongeldig station opgegeven",CR,LF
+0021 T 0000 "Foutmelding in uitvoereenheid geeft aan dat de eenheid",CR,LF
+ "mogelijk niet online is. Controleer de eenheid",CR,LF
+0022 T 0000 CR,LF,LF," %1 wordt nu afgedrukt",CR,LF
+0023 T 0000 " %1 staat in de wachtrij",CR,LF
+0024 T 0000 "%1 niet gevonden",CR,LF
+0025 T 0000 "Padnaam %1 te lang",CR,LF
+0026 T 0000 "Bestand %1 staat niet in de PRINT-wachtrij",CR,LF
+0027 T 0000 "Naam van uitvoereenheid [PRN]: "
+RECOVER 7331 0012
+0002 T 0000 CR,LF,"Bestand niet gevonden",CR,LF ;File not found
+0003 U 0000 CR,LF,"Cannot RECOVER an ASSIGNED or SUBST'd drive",CR,LF
+0004 T 0000 CR,LF,"Station of bestandsnaam ongeldig",CR,LF
+0005 T 0000 CR,LF,"Waarschuwing - index is vol",CR,LF
+0006 T 0000 CR,LF,"RECOVER kan niet worden gebruikt voor een netwerkstation", CR,LF ;Cannot %1 a Network drive
+0007 U 0000 CR,LF,"Recover not available on drive %1",CR,LF
+0008 T 0000 CR,LF,"%1 bestand(en) teruggevonden",CR,LF
+0009 T 0000 CR,LF,"%1 van %2 bytes hersteld",CR,LF
+0010 T 0000 CR,LF,"Druk op een toets om bestand(en)",CR,LF,"terug te vinden in station %1",CR,LF,CR,LF ;AN000;bgb
+0011 U 0000 CR,LF,"Can not read file allocation table",CR,LF
+0012 U 0000 CR,LF,"Can not write file allocation table",CR,LF
+0013 T 0000 CR,LF
+SORT 766a 0001
+0005 T 0000 "SORT: "
+SUBST 7694 0001
+0002 T 0000 CR,LF,"Onjuist aantal parameters",CR,LF
+SYS 76dd 0008
+0004 T 0000 "Ongeldig station opgegeven",CR,LF ; Old
+0007 T 0000 "Geen ruimte voor systeem op doelschijf",CR,LF ; Old
+0008 T 0000 "Niet uitwisselbare versies van DOS",CR,LF ; Old
+0010 T 0000 "Geen systeem in standaardstation",CR,LF ; Old
+0011 U 0000 "Can not specify default drive",CR,LF ; New
+0012 U 0000 "Write failure, diskette unusable",CR,LF ; New
+0014 T 0000 "Plaats systeemschijf in station %1:",CR,LF ; Old
+0016 U 0000 "Not able to SYS to %1 file system",CR,LF ; New
+SHARE 7955 0000
+NLSFUNC 7969 0000
+ANSI 797d 0001
+0010 T 0000 "Ongeldige parameter - %1",CR,LF ; 'Invalid parameter'
+IFSFUNC 79d7 0001
+0004 U 0000 "No IFS drivers found",CR,LF
+PSPRINT 7a15 0007
+0002 U 0000 " error reading file",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"Bestand geannuleerd door operator",CR,FORMFD,BELL
+0004 T 0000 "FAT beschadigd op schijf in station "
+0005 T 0000 "A:",CR,LF,"$"
+0006 T 0000 "Ongeldige uitvoereenheid voor PRINT",CR,LF
+0007 T 0000 "PSPRINT reeds ge‹nstalleerd",CR,LF
+0008 T 0000 "PSPRINT/PRINT-conflict",CR,LF
+BACKUP 7b91 0020
+0002 T 0000 CR,LF,"Onvoldoende geheugen",CR,LF
+0006 T 0000 CR,LF,"Ongeldig station opgegeven",CR,LF
+0014 T 0000 CR,LF,"Bron- en doelstations zijn gelijk",CR,LF
+0017 T 0000 CR,LF,"Fout bij openen logboekbestand",CR,LF
+0018 T 0000 CR,LF,"Registratie in bestand %1",CR,LF
+0019 T 0000 CR,LF,"Laatste reservediskette niet geplaatst",CR,LF
+0020 T 0000 CR,LF,"Waarschuwing! Bestanden in de ",CR,LF
+ "hoofdindex %1:\ zullen worden gewist",CR,LF
+0021 T 0000 CR,LF,"Waarschuwing! Bestanden in de ",CR,LF
+ "index %1:\BACKUP zullen worden gewist",CR,LF
+0022 T 0000 CR,LF,"*** Reservekopie van de bestanden wordt naar station %1: geschreven ***",CR,LF
+0023 T 0000 "Diskette nummer: %1",CR,LF
+0024 T 0000 CR,LF,"Let op! Geen bestanden gevonden om reservekopie te maken",CR,LF
+0025 T 0000 CR,LF,"Plaats brondiskette in station %1:",CR,LF
+0026 T 0000 CR,LF,"Plaats reservediskette %1 in station %2:",CR,LF
+0027 T 0000 CR,LF,"*** Reservebestand kan niet worden gemaakt ***",CR,LF
+0028 T 0000 CR,LF,"Plaats laatste reservediskette in station %1:",CR,LF
+0029 T 0000 CR,LF,"Doelschijf kan niet worden gebruikt voor reservekopie",CR,LF
+0030 T 0000 CR,LF,"*** Laatste reservebestand is niet gemaakt ***",CR,LF
+0031 T 0000 CR,LF,"Vaste schijf %1: is vol",CR,LF
+0032 T 0000 CR,LF,"Schijf vol tijdens schrijven naar BACKUP-logboekbestand",CR,LF
+0034 T 0000 CR,LF
+COMP 80f5 0013
+0004 T 0000 "10 Verschillen - vergelijking be‰indigd",CR,LF
+0006 T 0000 "Verschil bij OFFSET %1",CR,LF
+0007 T 0000 "Bestand 1 = %1",CR,LF
+0008 T 0000 "Bestand 2 = %1",CR,LF
+0009 T 0000 "EOF-markering niet gevonden",CR,LF
+0010 T 0000 "Bestanden zijn identiek",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Geef eerste bestandsnaam op",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Geef tweede bestandsnaam of station op",CR,LF
+0017 T 0000 "Bestanden zijn niet even groot",CR,LF
+0018 T 0000 "Nog meer bestanden vergelijken (J/N) ?"
+0019 T 0000 "%1 en %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Bestanden zijn identiek",CR,LF
+DISKCOMP 8367 0016
+0004 T 0000 "Geen bestandsnamen opgeven",CR,LF
+ "Voer opdracht in als: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0000 CR,LF,"Ongeldig station opgegeven",CR,LF
+ "Opgegeven station bestaat niet",CR,LF
+ "of is niet verwisselbaar",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP van of naar ",CR,LF
+ "een netwerkstation is niet mogelijk",CR,LF
+0007 T 0000 CR,LF,"Plaats EERSTE diskette in station %1:",CR,LF
+0008 T 0000 CR,LF,"Plaats TWEEDE diskette in station %1:",CR,LF
+0009 T 0000 CR,LF,"EERSTE diskette beschadigd of niet uitwisselbaar met DOS",CR,LF
+0010 T 0000 CR,LF,"TWEEDE diskette beschadigd of niet uitwisselbaar met DOS",CR,LF
+0014 T 0000 CR,LF,"Nog meer diskettes vergelijken (J/N) ?"
+0015 T 0000 CR,LF,"Vergelijking van %1 sporen",CR,LF
+ "%2 sectoren per spoor, %3 - zijdig",CR,LF
+0016 T 0000 CR,LF,"Stations of diskettes zijn",CR,LF
+ "niet uitwisselbaar",CR,LF
+0017 T 0000 CR,LF,"Onherstelbare leesfout in station %2",CR,LF
+ "zijde %3, spoor %4",CR,LF
+0018 T 0000 CR,LF,"Verschil gevonden op",CR,LF,"zijde %3, spoor %4",CR,LF
+0019 T 0000 "Controleer of een diskette in het station",CR,LF ;AN004;
+ "geplaatst is en of het station gesloten is",CR,LF ;AN004;
+0020 T 0000 CR,LF,"Vergelijking van diskettes voltooid",CR,LF
+0021 T 0000 CR,LF,"Vergelijking: OK",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 88b3 0018
+0002 T 0000 CR,LF
+0004 T 0000 "Geen bestandsnamen opgeven",CR,LF
+ "Voer opdracht in als: DISKCOPY s: s: [/1]",CR,LF
+0005 T 0000 CR,LF,"Ongeldig station opgegeven",CR,LF
+ "Opgegeven station bestaat niet",CR,LF
+ "of is niet-verwisselbaar",CR,LF
+0006 T 0000 CR,LF,"DISKCOPY van of naar",CR,LF
+ "een netwerkstation is niet mogelijk",CR,LF
+0007 T 0000 CR,LF,"Formatteren tijdens kopi‰ren",CR,LF
+0008 T 0000 CR,LF,"Plaats BRON diskette in station %1:",CR,LF
+0009 T 0000 CR,LF,"Plaats DOEL diskette in station %1:",CR,LF
+0010 T 0000 "Controleer of een diskette in het station ",CR,LF ;AN004;
+ "geplaatst is en of het station gesloten is",CR,LF ;AN004;
+0011 T 0000 CR,LF,"DOEL diskette kan onbruikbaar zijn",CR,LF
+0012 T 0000 CR,LF,"DOEL diskette is onbruikbaar",CR,LF
+0016 T 0000 CR,LF,"Nog een diskette kopi‰ren (J/N) ?"
+0017 T 0000 CR,LF,"Bezig met kopi‰ren van %1 sporen",CR,LF
+ "%2 sectoren per spoor, %3- zijdig",CR,LF
+0018 T 0000 CR,LF,"Stations of diskettes zijn",CR,LF
+ "niet uitwisselbaar",CR,LF
+0019 T 0000 CR,LF,"Onherstelbare lees fout in station %1",CR,LF
+ "zijde %2, spoor %3",CR,LF
+0020 T 0000 CR,LF,"Onherstelbare schrijf fout in station %1",CR,LF
+ "zijde %2, spoor %3",CR,LF
+0021 T 0000 CR,LF,"Kopi‰ren van diskettes voltooid",CR,LF
+0022 T 0000 CR,LF,"BRON diskette beschadigd of niet uitwisselbaar met DOS"
+0023 T 0000 CR,LF,"DOEL diskette beschadigd of niet uitwisselbaar met DOS"
+MODE 8e7c 0055
+0003 T 0000 CR,LF,"COM1, COM2, COM3 of COM4 moet worden opgegeven",CR,LF
+0004 T 0000 CR,LF,"Resident gedeelte van MODE geladen",CR,LF
+0005 T 0000 CR,LF,"Ongeldige naam voor eenheid",CR,LF
+0006 T 0000 CR,LF,"Printerfout",CR,LF
+0007 T 0000 CR,LF,"LPT%1: ingesteld op 80 kolommen",CR,LF
+0008 T 0000 CR,LF,"LPT%1: ingesteld op 132 kolommen",CR,LF
+0009 T 0000 CR,LF,"Afdrukregels per inch ingesteld",CR,LF
+0010 T 0000 CR,LF,"Ongeldig baud-getal opgegeven",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 U 0000 CR,LF,"Do you see the %1? (YES/NO)",CR,LF
+0014 T 0000 CR,LF,"Ongeldige parameters",CR,LF
+0015 T 0000 CR,LF,"LPT%1: uitvoer gaat naar COM%2:",CR,LF
+0016 T 0000 CR,LF,"LPT%1: uitvoer gaat (weer) naar parallelle poort",CR,LF
+0017 T 0000 CR,LF,"%1 herhaling bij time-out van parallelle printer",CR,LF
+0018 T 0000 CR,LF," Scherm kan niet verder naar %1 worden verschoven",CR,LF
+0020 T 0000 CR,LF,'Onjuist aantal parameters',CR,LF
+0021 T 0000 CR,LF,'NET 042: Opdracht kan niet worden uitgevoerd',CR,LF
+0022 T 0000 CR,LF,'Onbeperkte herhaling kan niet worden opgegeven voor netwerk-printer',cr,lf
+0023 T 0000 CR,LF,"Schriftsoortbestand kon niet worden geopend",CR,LF
+0024 T 0000 CR,LF,"Eenheid %1 kon niet worden geactiveerd",CR,LF
+0025 T 0000 CR,LF,"Eenheid of codetabel niet aanwezig in schriftsoortbestand",CR,LF
+0026 T 0000 CR,LF,"Inhoud schriftsoortbestand ongeldig",CR,LF
+0027 T 0000 CR,LF,"Eerder gedefinieerde codetabel is vervangen",CR,LF
+0028 T 0000 CR,LF,"Actieve codetabel voor eenheid %1 is %2",CR,LF
+0029 T 0000 CR,LF,"Eenheid %1 niet gedefinieerd",CR,LF
+0030 T 0000 "%1codetabellen:",CR,LF
+0031 T 0000 " Codetabel %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0000 CR,LF,"MODE-functie %1 CODEPAGE voltooid",CR,LF
+0033 T 0000 CR,LF,"Fout bij %1 GLOBAL CODEPAGE",CR,LF ;FILLED IN with "setting" or "getting"
+0034 T 0000 CR,LF,"Actieve CODEPAGE-instellingen:",CR,LF ;table header
+0035 T 0000 " %1 - %2codetabel",CR,LF
+0036 T 0000 " Codetabel niet gedefinieerd",CR,LF
+0037 T 0000 "CODEPAGE-bewerking niet mogelijk voor deze eenheid",CR,LF
+0038 T 0000 "Er is geen codetabel",CR,LF
+0039 U 0000 "Device error during %1",CR,LF
+0040 T 0000 "Codetabel niet gedefinieerd",CR,LF
+0041 T 0000 CR,LF,"Actief toetsenbord ondersteunt deze codetabel niet",CR,LF
+0042 T 0000 CR,LF,"Fout bij inlezen van het schriftsoortbestand",CR,LF
+0043 T 0000 CR,LF,"REFRESH-bewerking kan niet worden uitgevoerd",CR,LF
+0044 T 0000 CR,LF ;used for formatting
+0045 U 0000 CR,LF,"Status for device %1:",CR,LF ;header for status reports
+0046 U 0000 "------------------" ;first part of underline under "Status for device %1:"
+0047 U 0000 "----",CR,LF ;four_char_underline
+0048 U 0000 "-----",CR,LF ;five_char_underline
+0049 U 0000 "LINES=%1",CR,LF
+0050 U 0000 "COLUMNS=%1",CR,LF
+0051 U 0000 CR,LF,"RATE and DELAY must be specified together",CR,LF
+0052 U 0000 "RATE=%1",CR,LF
+0053 U 0000 "DELAY=%1",CR,LF
+0054 U 0000 CR,LF,"Function not supported on this computer - %1",CR,LF
+0055 U 0000 CR,LF,"Required font not loaded",CR,LF
+0056 U 0000 CR,LF,"ANSI.SYS must be installed to perform requested function",CR,LF
+0057 U 0000 CR,LF,"Baud rate required",CR,LF
+0058 U 0000 "RETRY=%1",CR,LF
+RESTORE 9bc0 0022
+0002 T 0000 CR,LF,"Bron- en doelstations zijn gelijk",CR,LF
+0003 T 0000 CR,LF,"Onjuist aantal parameters",CR,LF
+0006 T 0000 CR,LF,"Ongeldig station opgegeven",CR,LF
+0007 T 0000 CR,LF,"Let op! Geen bestanden gevonden om terug te zetten",CR,LF
+0008 T 0000 CR,LF,"Plaats reservediskette %1 in station %2:",CR,LF
+0009 T 0000 CR,LF,"Plaats doeldiskette in station %1:",CR,LF
+0011 T 0000 CR,LF,"Let op! Volgorde diskettes onjuist",CR,LF
+ "Plaats een andere diskette of ga door indien toch juist",CR,LF
+0012 T 0000 CR,LF,"Laatste bestand niet teruggezet",CR,LF
+0013 T 0000 CR,LF,"*** Reservekopie is gemaakt op %1 *** ",CR,LF
+0014 T 0000 CR,LF,"Bronschijf bevat geen reservebestanden",CR,LF
+0015 T 0000 CR,LF,"Onvoldoende geheugen",CR,LF
+0016 T 0000 CR,LF,"Let op! Bestand %1",CR,LF
+ "kan alleen worden gelezen",CR,LF
+ "Bestand vervangen (J/N) ? ",CR,LF
+0017 T 0000 CR,LF,"Fout: diskettes niet in juiste volgorde",CR,LF
+0018 T 0000 CR,LF,"Fout bij maken bestand",CR,LF
+0019 T 0000 CR,LF,"Onvoldoende schijfruimte",CR,LF
+0020 T 0000 CR,LF,"*** Bestand kan niet worden teruggezet ***",CR,LF
+0021 T 0000 CR,LF,"*** Bestanden worden teruggezet vanuit station %1: ***",CR,LF
+0022 T 0000 CR,LF,"Let op! Bestand %1",CR,LF
+ "is gewijzigd na maken reservekopie",CR,LF
+ "Bestand vervangen (J/N) ? ",CR,LF
+0023 T 0000 "Diskette: %1",CR,LF
+0024 U 0000 CR,LF,"Bizzare error, call Russ Whitehead @ 8-3863",CR,LF
+0025 T 0000 07 ;For BEEP !
+0026 U 0000 CR,LF,"Error restoring extended attributes",CR,LF
+SELECT a1c0 0009
+0004 U 0000 "Invalid SELECT Boot Media",CR,LF,CR,LF
+ "Insert INSTALL diskette in drive A:, then retry"
+0005 U 0000 "Invalid Disk/Diskette Media",CR,LF,CR,LF
+ "Insert INSTALL diskette in drive A:, then retry"
+0006 U 0000 "Invalid Parameters on SELECT Command Line",CR,LF,CR,LF
+ "Make sure the INSTALL diskette is in drive A:,",CR,LF
+ "then press Ctrl+Alt+Del to restart."
+0007 U 0000 BELL,"Unable to install DOS. Program terminated",CR,LF
+0008 U 0000 "Loading SELECT. Please wait..."
+0009 U 0000 "You must restart your computer to continue.",CR,LF,CR,LF
+ "Press Ctrl+Alt+Del to continue with DOS installation."
+0010 U 0000 "Insert SELECT diskette in drive A:",CR,LF,CR,LF
+ "Press ENTER to continue installing DOS,",CR,LF
+ "or press ESC to exit.",CR,LF
+0011 U 0000 BELL
+0012 U 0000 "Insert SELECT diskette in drive A:",CR,LF,CR,LF
+ "Press ENTER to continue",CR,LF
+TREE a545 0004
+0002 T 0000 "Indexen Van Volume %1",CR,LF ;define message ;AN000;
+0003 T 0000 "Indexen",CR,LF ; ;AN000;
+0004 T 0000 "Schijf bevat geen subindexen",CR,LF,LF ; ;AN000;
+0007 U 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE a693 0009
+0003 T 0000 CR,LF,"Geen bestanden vervangen",CR,LF
+0004 T 0000 CR,LF,"Geen bestanden toegevoegd",CR,LF
+0013 T 0000 CR,LF,"%1 wordt vervangen",CR,LF
+0014 T 0000 CR,LF,"%1 wordt toegevoegd",CR,LF
+0015 T 0000 CR,LF,"%1 bestand(en) vervangen",CR,LF
+0016 T 0000 CR,LF,"%1 bestand(en) toegevoegd",CR,LF
+0017 T 0000 CR,LF,"%1-bestanden niet gevonden",CR,LF
+0022 T 0000 CR,LF,"%1 vervangen? (J/N)"
+0023 T 0000 CR,LF,"%1 toevoegen? (J/N)"
+XCOPY a85e 0019
+0004 T 0000 "Is %1 de naam van een",CR,LF ;AN000;
+ "bestand of index op de doelschijf",CR,LF
+ "(B = Bestand, I = Index) ? "
+0005 T 0000 "Druk op een toets om bestand(en) te kopi‰ren" ;AN000;
+0006 T 0000 "Pad te lang",CR,LF ;AN000;
+0008 T 0000 "Cyclisch kopi‰ren niet mogelijk",CR,LF ;AN000;
+0012 T 0000 "XCOPY vanaf een gereserveerde eenheid niet mogelijk",CR,LF ;AN000;
+0021 T 0000 "Onjuist aantal parameters",CR,LF ;AN000;
+0022 U 0000 "Cannot XCOPY to a reserved device",CR,LF ;AN000;
+0024 T 0000 "Fout bij maken bestand",CR,LF ;AN000;
+0025 U 0000 "Reading source file(s)...",CR,LF ;AN000;
+0026 T 0000 CR,LF ;AN000;
+0027 T 0000 "%1 bestand(en) gekopieerd",CR,LF ;AN000;
+0028 T 0000 "%1 Bestand niet gevonden",CR,LF ;AN000;
+0029 U 0000 "F D " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0000 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 U 0000 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0000 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 U 0000 "%1%2 (Y/N)?" ;AN000;P_S_PATH_FILE0
+0034 U 0000 "%1\%2 (Y/N)?" ;AN000;P_S_PATH_FILE1
+0035 U 0000 "Invalid switch %1",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK ad1e 0013
+0002 T 0000 "onvoldoende geheugen",CR,LF ;AN000; "Insufficient memory"
+0003 T 0000 "VDISK versie 3.40 virtuele schijf %1",CR,LF ;AN000;
+0004 T 0000 " Buffer-omvang aangepast",CR,LF ;AN000;
+0005 T 0000 " Sector-omvang aangepast",CR,LF ;AN000;
+0006 T 0000 " Indexgegevens aangepast",CR,LF ;AN000;
+0007 T 0000 " Ongeldig wisselteken",CR,LF ;AN000;
+0008 T 0000 " Transfer-omvang aangepast",CR,LF ;AN000;
+0009 T 0000 " Buffer-omvang: %1 KB",CR,LF ;AN000;
+0010 T 0000 " Sector-omvang: %1",CR,LF ;AN000;
+0011 T 0000 " Indexgegevens: %1",CR,LF ;AN000;
+0012 T 0000 " Transfer-omvang: %1",CR,LF ;AN000;
+0013 T 0000 "VDISK niet ge‹nstalleerd - " ;AN000;
+0014 T 0000 " schakelaarstand Extender Card",CR,LF ;AN000;
+ "niet in overeenstemming met geheugenomvang",CR,LF,CR,LF ;AN000;
+GRAFTABL b110 0005
+0002 T 0000 "Actieve codetabel: %1",CR,LF
+0003 U 0000 "Previous Code Page: %1",CR,LF
+0004 T 0000 "geen",NULL
+0005 U 0000 "Non-standard",NULL
+0006 U 0000 CR,LF,"DOS command line parameters supported",COLON,CR,LF,LF
+ " /STA - Request Status only",CR,LF
+ " ? - Display this summary of parameters",CR,LF,CR,LF
+ " Code Pages available",COLON,CR,LF
+ " 437 - USA Graphic Character Set",CR,LF
+ " 850 - Multi-lingual Graphic Character Set",CR,LF
+ " 860 - Portuguese Graphic Character Set",CR,LF
+ " 863 - Canadian French Graphic Character Set",CR,LF
+ " 865 - Nordic Graphic Character Set",CR,LF
+FASTOPEN b39a 0016
+0004 T 0000 CR,LF,"FASTOPEN ge‹nstalleerd",CR,LF ;AN000;
+0005 U 0000 CR,LF,"FASTOPEN already installed",CR,LF ;AN000;
+0006 T 0000 CR,LF,"Ongeldige parameter",CR,LF ;AN000;
+0007 T 0000 CR,LF,"Te veel stations opgegeven",CR,LF ;AN000;
+0008 T 0000 CR,LF,"Hetzelfde station meer dan ‚‚n maal opgegeven",CR,LF ;AN000;
+0009 T 0000 CR,LF,"Ongeldige parameter",CR,LF ;AN000;
+0010 U 0000 CR,LF,"Invalid switch type",CR,LF ;AN000;
+0011 U 0000 CR,LF,"Invalid extent entry",CR,LF ;AN000;
+0012 U 0000 CR,LF,"Invalid number of file/directory entries",CR,LF
+0013 U 0000 CR,LF,"Cannot setup expanded memory",CR,LF ;AN000;
+0014 U 0000 CR,LF,"Expanded memory not available",CR,LF ;AN000;
+0015 T 0000 CR,LF,"Ongeldig station opgegeven %1",CR,LF
+0016 U 0000 CR,LF,"Not enough space in EMS. Low memory is used",CR,LF ;AN000;
+0017 T 0000 CR,LF,"FASTOPEN kan niet worden gebruikt voor station ",CR,LF
+0018 U 0000 CR,LF,"Too many extent entries",CR,LF
+0019 U 0000 CR,LF,"Too many file/directory entries",CR,LF
+APPEND b7bb 0009
+0001 T 0000 "Onjuiste APPEND-versie",CR,LF
+0002 T 0000 "Ongeldig pad",CR,LF
+0003 T 0000 "Ongeldige parameter",CR,LF
+0004 U 0000 "Invalid combination of parameters",CR,LF
+0005 T 0000 "Geen APPEND",CR,LF
+0006 T 0000 "APPEND/ASSIGN-conflict",CR,LF
+0007 T 0000 "APPEND/TopView-conflict",CR,LF
+0008 T 0000 "Onjuiste DOS versie",CR,LF
+0009 T 0000 "APPEND reeds ge‹nstalleerd",CR,LF
+GRAPHICS b950 0012
+0005 T 0000 'Ongeldige parameter: %1',CR,LF ;AN000
+0007 U 0000 'Duplicate parameters not allowed',CR,LF ;AN000
+0009 U 0000 'Cannot find GRAPHICS profile',CR,LF ;AN000
+0010 U 0000 'Required profile statement missing before line %1',CR,LF ;AN000
+0011 U 0000 'Invalid profile statement on line %1',CR,LF ;AN000
+0012 U 0000 'Profile statement out of sequence on line %1',CR,LF ;AN000
+0013 U 0000 'Error reading GRAPHICS profile',CR,LF ;AN000
+0014 U 0000 'Syntax errors in GRAPHICS profile',CR,LF ;AN000
+0015 U 0000 "Printbox ID not in GRAPHICS profile",CR,LF
+0016 U 0000 'Printer type not in GRAPHICS profile',CR,LF ;AN000
+0017 U 0000 '/B invalid with a black and white printer',CR,LF ;AN000
+0018 U 0000 'Unable to reload with profile supplied',CR,LF ;AN000
+DISPLAY bd87 0003
+0002 T 0000 "%1-stuurprogramma voor codetabel kan niet worden ge‹nitialiseerd",CR,LF
+0008 T 0000 "Onvoldoende geheugen",CR,LF
+0012 T 0000 "Ongeldige syntaxis voor DISPLAY.SYS",CR,LF
+PRINTER be54 0002
+0002 T 0000 "%1-stuurprogramma voor codetabel kan niet worden ge‹nitialiseerd",CR,LF
+0012 T 0000 "Ongeldige syntaxis voor PRINTER.SYS",CR,LF
+KEYB bef7 0016
+0002 T 0000 "Actieve toetsenbord-code: %1"
+0003 U 0000 "Current keyboard ID: %1"
+0004 T 0000 " huidige codetabel: %1",CR,LF
+0005 T 0000 "Actieve CON-codetabel: %1",CR,LF
+0006 T 0000 "Ongeldige toetsenbord-code opgegeven",CR,LF
+0007 U 0000 "Invalid keyboard ID specified",CR,LF
+0008 T 0000 "Ongeldige codetabel opgegeven",CR,LF
+0009 T 0000 "KEYBOARD.SYS is ongeldig of ontbreekt",CR,LF
+0010 T 0000 "KEYB niet ge‹nstalleerd",CR,LF
+0011 T 0000 "Actieve codetabel niet beschikbaar voor CON-eenheid",CR,LF
+0012 T 0000 "Opgegeven codetabel niet gedefinieerd",CR,LF
+0013 T 0000 "Een of meer CON-codetabellen ongeldig voor toetsenbord-code",CR,LF
+0014 T 0000 "Gevraagde codetabel (%1) ongeldig voor toetsenbord-code",CR,LF
+0015 T 0000 "Opgegeven codetabel strijdig met ingestelde codetabel",CR,LF
+0016 U 0000 "ID code specified is inconsistent with the selected keyboard code",CR,LF
+0017 T 0000 "KEYB-tabel kan niet worden gemaakt in resident geheugen",CR,LF
+REDIRSYS c2d3 0000
+MEM c2e7 0035
+0010 U 0000 CR,LF
+0011 U 0000 " Address Name Size Type ",CR,LF
+0012 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 U 0000 " Handle EMS Name Size ",CR,LF
+0014 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "%1 bytes total memory",CR,LF
+0019 U 0000 "%1 bytes available",CR,LF
+0020 U 0000 "%1 largest executable program size",CR,LF
+0021 U 0000 "%1 bytes total EMS memory",CR,LF
+0022 U 0000 "%1 bytes free EMS memory",CR,LF
+0023 U 0000 "%1 bytes total extended memory",CR,LF
+0024 U 0000 "Interrupt Vector",0
+0025 U 0000 "ROM Communication Area",0
+0026 U 0000 "DOS Communication Area",0
+0027 U 0000 "IBMBIO",0
+0028 U 0000 "IBMDOS",0
+0029 U 0000 "System Data",0
+0030 U 0000 "System Program",0
+0031 U 0000 "System Device Driver",0
+0032 U 0000 "Installed Device Driver",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "BUFFERS=",0
+0036 U 0000 "FILES=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "STACKS=",0
+0039 U 0000 "DEVICE=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "LASTDRIVE=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+REDIR c84a 0040
+0004 U 0000 "Network has not been started",CR,LF
+0050 U 0000 "NET809: Network request not supported",CR,LF,0
+0051 U 0000 "NET801: Remote computer not listening",CR,LF,0
+0052 U 0000 "NET802: Duplicate name on network",CR,LF,0
+0053 U 0000 "NET803: Network path not found",CR,LF,0
+0054 U 0000 "NET804: Network busy",CR,LF,0
+0055 U 0000 "NET805: Network device no longer exists",CR,LF,0
+0056 U 0000 "NET806: Net BIOS command limit exceeded",CR,LF,0
+0057 U 0000 "NET807: System error; NETBIOS error",CR,LF,0
+0058 U 0000 "NET808: Incorrect response from network",CR,LF,0
+0059 U 0000 "NET810: Unexpected network error",CR,LF,0
+0060 U 0000 "NET811: Incompatible remote adapter",CR,LF,0
+0061 U 0000 "NET812: Print queue full",CR,LF,0
+0062 U 0000 "NET813: Not enough space for print file",CR,LF,0
+0063 U 0000 "NET814: Print file was cancelled",CR,LF,0
+0064 U 0000 "NET815: Network name was deleted",CR,LF,0
+0065 U 0000 "Access denied",CR,LF,0
+0066 U 0000 "NET817: Network device type incorrect",CR,LF,0
+0067 U 0000 "NET818: Network name not found",CR,LF,0
+0068 U 0000 "NET819: Network name limit exceeded",CR,LF,0
+0069 U 0000 "NET820: Net BIOS session limit exceeded",CR,LF,0
+0070 U 0000 "NET821: Sharing temporarily paused",CR,LF,0
+0071 U 0000 "NET823: Network request not accepted",CR,LF,0
+0072 U 0000 "NET822: Print or disk redirection is paused",CR,LF,0
+0073 U 0000 "NET476: Netbeui not loaded",CR,LF,0
+0074 U 0000 "NET477: Unexpected adapter close",CR,LF,0
+0075 U 0000 "NET826: Target Server /RQB size too small",CR,LF,0
+0076 U 0000 "NET???: Unexpected network error",CR,LF,0
+0077 U 0000 "NET???: Unexpected network error",CR,LF,0
+0078 U 0000 "NET???: Unexpected network error",CR,LF,0
+0079 U 0000 "NET???: Unexpected network error",CR,LF,0
+0080 U 0000 "NET???: Unexpected network error",CR,LF,0
+0081 U 0000 "NET???: Unexpected network error",CR,LF,0
+0082 U 0000 "NET???: Unexpected network error",CR,LF,0
+0083 U 0000 "NET???: Unexpected network error",CR,LF,0
+0084 U 0000 "NET???: Unexpected network error",CR,LF,0
+0085 U 0000 "NET???: Unexpected network error",CR,LF,0
+0086 U 0000 "NET???: Unexpected network error",CR,LF,0
+0087 U 0000 "NET???: Unexpected network error",CR,LF,0
+0088 U 0000 "NET825: Network data fault",CR,LF,0
+FILESYS d137 0002
+0010 U 0000 "%1 REDIR %2 Paused",CR,LF
+0011 U 0000 "%1 REDIR %2",CR,LF
+XMA2EMS d194 0017
+0001 U 0000 "XMA2EMS: Expanded Memory Manager Version 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 All rights reserved",CR,LF,"$"
+0002 U 0000 CR,LF,"XMA001 Performing VMO/XMA diagnostics: ","$"
+0003 U 0000 "XMA002 Diagnostics completed ",CR,LF,LF,"$"
+0004 U 0000 "XMA003 Page Frame starts at........................ "
+0005 U 0000 "XXXX",":0",CR,LF,"$"
+0006 U 0000 "XMA004 Pages mapped to conventional memory......... "
+0007 U 0000 "0 ",CR,LF,"$"
+0008 U 0000 "XMA005 Pages reserved for Control Program.......... "
+0009 U 0000 "0 ",CR,LF,"$"
+0010 U 0000 "XMA006 Pages available for expanded memory......... "
+0011 U 0000 "0 ",CR,LF,"$"
+0012 U 0000 CR,LF,"XMA100 Adapter error:",CR,LF," Expanded Memory Manager has NOT been installed",CR,LF,"$"
+0013 U 0000 CR,LF,"XMA200 Cannot find adapter:",CR,LF," Expanded Memory Manager has NOT been installed",CR,LF,"$"
+0014 U 0000 CR,LF,"XMA300 Parameter syntax or value error:",CR,LF
+ " Expanded Memory Manager has NOT been installed",CR,LF,"$"
+0015 U 0000 SIZE1_END - 2 -$
+0016 U 0000 4 DUP (?)," KB OK",CR,LF,"$"
+0017 U 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK d663 0117
+0004 T 0000 "FDISK niet mogelijk in actief netwerk",CR,LF
+0005 T 0000 "Geen vaste schijven beschikbaar.",CR,LF
+0006 T 0000 "Fout bij lezen van vaste schijf.",CR,LF
+0007 T 0000 "Fout bij schrijven naar vaste schijf.",CR,LF
+1001 U 0000 "IBM Personal Computer"
+1002 T 0000 "Installatieprogramma Vaste Schijf V3.40"
+1003 U 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "FDISK - opties"
+1005 U 0000 "1. <R>Create DOS Partition or Logical DOS Drive"
+1006 U 0000 "2. <R>Set active partition"
+1007 T 0000 "3. <R>Delete DOS Partition or Logical DOS Drive"
+1008 U 0000 "4. <R>Partitiegegevens afbeelden"
+1009 U 0000 "Press <H>Esc<R> to exit FDISK"
+1010 U 0000 "Choose one of the following:"
+1011 T 0000 "5. <R>Volgende vaste schijf kiezen"
+1012 T 0000 "Actief station met vaste schijf: <H><I>"
+1013 U 0000 "Warning! <R>No partitions are set active - disk 1 is not startable unless"
+1014 U 0000 "a partition is set active"
+1015 U 0000 "Enter choice: [<S> ]"
+1016 U 0000 "Create DOS Partition or Logical DOS Drive"
+1017 T 0000 "1. <R>Primaire DOS-partitie maken"
+1018 T 0000 "2. <R>Uitgebreide DOS-partitie maken"
+1019 T 0000 "3. <R>Logische DOS-station(s) maken in de uitgebreide DOS-partitie"
+1020 T 0000 "ESC<R> om terug te keren naar FDISK-opties"
+1021 T 0000 "Primaire DOS-partitie maken"
+1022 T 0000 "Wilt u de maximum omvang voor een DOS-partitie gebruiken en dezea"
+1023 T 0000 "actief maken (J/N) .............? <H>[<S> ]
+1024 T 0000 "(<J>/<N>)...................................................? <H>[<S> ]"
+1025 U 0000 "Partition Status Type Size in Mbytes Percentage of Disk Used"
+1026 U 0000 "Total disk space is <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 U 0000 "Maximum space available for partition is <HIIIIR> Mbytes (<HIIIIR>)"
+1028 U 0000 "Enter partition size in Mbytes or percent of disk space (%) to"
+1029 U 0000 "create a Primary DOS Partition.................................: <H>[<IIISI>]"
+1030 T 0000 "Uitgebreide DOS-partitie maken"
+1031 U 0000 "create an Extended DOS Partition..............................: <H>[<IIISI>]"
+1032 U 0000 "Press <H>Esc<R> to continue"
+1033 U 0000 "Create Logical DOS Drive(s) in the Extended DOS Partition"
+1034 U 0000 "Drv Volume Label Mbytes System Usage"
+1035 U 0000 "Total Extended DOS Partition size is <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 U 0000 "Maximum space available for logical drive is <HIIIIR> Mbytes <H>(<IIII>)"
+1037 U 0000 "Enter logical drive size in Mbytes or percent of disk space (%)...<H>[<IIISI>]"
+1038 U 0000 "Set Active Partition"
+1039 T 0000 "Voer nummer in van de partitie die u actief wilt maken.................: <H>[<S> ]"
+1040 U 0000 "Delete DOS Partition or Logical DOS Drive"
+1041 T 0000 "1. <R>Primaire DOS-partitie wissen"
+1042 T 0000 "2. <R>Uitgebreide DOS-partitie wissen"
+1043 T 0000 "3. <R>Logische DOS-stations wissen in de uitgebreide DOS-partitie"
+1044 T 0000 "Primaire DOS-partitie wissen"
+1045 U 0000 "Warning! <OR>Data in the deleted Primary DOS Partition will be lost."
+1046 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1047 U 0000 "Delete Extended DOS Partition"
+1048 U 0000 "Warning! <OR>Data in the deleted Extended DOS Partition will be lost."
+1049 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1050 U 0000 "Delete Logical DOS Drive(s) in the Extended DOS Partition"
+1051 U 0000 "Warning! <OR>Data in a deleted Logical DOS Drive will be lost."
+1052 U 0000 "What drive do you want to delete...............................? <H>[<S> ]"
+1053 U 0000 "Are you sure (<Y>/<N>)..............................? <H>[<S> ]"
+1054 U 0000 "Enter Volume Label..............................? <H>[<S> ]"
+1055 U 0000 "Display Partition Information"
+1056 U 0000 "The Extended DOS Partition contains Logical DOS Drives."
+1057 U 0000 "Do you want to display the logical drive information (<Y>/<N>)......?<H>[<S> ]"
+1058 U 0000 "Display Logical DOS Drive Information"
+1059 U 0000 "System will now restart"
+1060 U 0000 "Insert DOS Startup diskette in drive A:"
+1061 T 0000 "Druk op een toets om verder te gaan ...<S>"
+1062 T 0000 "Primaire DOS-partitie gewist"
+1063 T 0000 "Uitgebreide DOS-partitie gewist"
+1064 U 0000 "Drive deleted"
+1065 T 0000 "Partitie <I> actief gemaakt"
+1066 T 0000 "Primaire DOS-partitie gemaakt"
+1067 T 0000 "Uitgebreide DOS-partitie gemaakt"
+1068 T 0000 "Logisch DOS-station gemaakt, letteraanduiding gewijzigd of toegevoegd<W>"
+1069 T 0000 "Geen partities gedefinieerd"
+1070 T 0000 "Geen logische stations gedefinieerd"
+1071 T 0000 "Letteraanduiding van stations gewijzigd of gewist<W>"
+1072 U 0000 "Drive redirected"
+1073 U 0000 "Primary DOS Partition created, drive letters changed or added"
+1074 T 0000 "Geen vaste schijven beschikbaar."
+1075 T 0000 "Fout bij lezen van vaste schijf."
+1076 T 0000 "Fout bij schrijven naar vaste schijf."
+1077 T 0000 "Onjuiste DOS versie"
+1078 T 0000 "FDISK niet mogelijk in actief netwerk"
+1079 T 0000 "Geen primaire DOS-partitie aanwezig die gewist kan worden."
+1080 T 0000 "Geen uitgebreide DOS-partitie aanwezig die gewist kan worden."
+1081 T 0000 "Primaire DOS-partitie bestaat reeds."
+1082 T 0000 "Uitgebreide DOS-partitie bestaat reeds"
+1083 T 0000 "Geen ruimte voor DOS-partitie."
+1084 T 0000 "Opgegeven omvang logisch station groter dan beschikbaar.<W>"
+1085 T 0000 "Opgegeven omvang partitie groter dan beschikbaar.<W>"
+1086 T 0000 "Geen partities aanwezig"
+1087 U 0000 "The only startable partition on Drive 1 is already set active.<W>"
+1088 T 0000 "Geen partities om actief te maken."
+1089 U 0000 "Partition selected (<I>) is not startable, active partition not changed.<W>"
+1090 T 0000 "Uitgebreide DOS-partitie kan niet worden"
+1091 T 0000 "gemaakt zonder primaire DOS-partitie op schijf 1.<W>"
+1092 T 0000 "Alle beschikbare ruimte in uitgebreide"
+1093 T 0000 "DOS-partitie is toegewezen aan logische stations.<W>"
+1094 T 0000 "Uitgebreide DOS-partitie met logische stations kan niet worden gewist.<W>"
+1095 T 0000 "Alle logische eenheden in de uitgebreide DOS-partitie gewist.<W>"
+1096 T 0000 " geen keuzemogelijkheid. Voer <III> in."
+1097 U 0000 "Warning! The partition set active is not startable.<W>"
+1098 U 0000 " Only non-startable partitions exist."
+1099 T 0000 "Alleen partities in station 1 kunnen actief worden gemaakt.<W>"
+1100 T 0000 "Maximum aantal logische DOS-stations ge‹nstalleerd.<W>"
+1101 U 0000 "Cannot create a zero size partition."
+1102 T 0000 "Station <II> reeds gewist."
+1103 T 0000 "Geen toegang tot station <I>.<OW>"
+1104 T 0000 "Invoer ongeldig. Voer <III> in.<W>"
+1105 T 0000 "Primaire DOS-partitie in station 1 kan "
+1106 T 0000 "niet worden gewist als uitgebreide partitie aanwezig is.<W>"
+1107 U 0000 "Invalid entry, please press Enter.<W>"
+1108 U 0000 "Volume label does not match.<W>"
+1109 U 0000 "Cannot create Logical DOS Drive without"
+1110 U 0000 "an Extended DOS Partition on the current drive.<W>"
+1111 U 0000 "No Logical DOS Drive(s) to delete."
+1112 U 0000 "Message string error <I>. See header of FDISKC.MSG for error definition"
+1113 U 0000 "Internal error"
diff --git a/private/mvdm/dos/v86/messages/norway.msg b/private/mvdm/dos/v86/messages/norway.msg
new file mode 100644
index 000000000..35018b365
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/norway.msg
@@ -0,0 +1,1142 @@
+0006
+COMMON 0006 0038
+0001 T 0002 "Uriktig DOS-versjon",CR,LF
+0002 T 0002 "%1 er allerede installert",CR,LF
+0003 T 0002 "%1 byte ledig lagerplass",CR,LF
+0004 T 0002 "%1 byte er ledig",CR,LF
+0005 T 0002 "%1 byte i defekte sektorer",CR,LF
+0006 T 0002 "%1 byte total lagerplass",CR,LF
+0007 T 0002 "%1 byte minne totalt",CR,LF
+0008 T 0002 "%1 byte brukes av systemet",CR,LF
+0009 T 0002 "%1 er installert",CR,LF
+0010 T 0002 "%1 er ikke installert",CR,LF
+0011 T 0002 "%1 er ikke installert",CR,LF
+0012 T 0002 "Kan ikke utf›re %1 p† en nettverksstasjon",CR,LF
+0013 T 0002 "",
+0014 T 0002 "Kan ikke utf›re %1 p† en stasjon etter SUBST eller ASSIGN",CR,LF
+0015 T 0002 "Kan ikke utf›re %1",CR,LF
+0016 T 0002 "Utvidet minne er ikke tilgjengelig",CR,LF
+0017 T 0002 "Feil i filtildelingstabellen p† stasjon %1",CR,LF
+0018 T 0002 "Filen kan ikke kopieres p† seg selv",CR,LF
+0019 T 0002 "Sett tildisketten i stasjon %1",CR,LF
+0020 T 0002 "Ikke nok lagerplass",CR,LF
+0021 T 0002 "Ugyldige tegn i lagernavnet",CR,LF
+0022 T 0002 "Ugyldig kodesett",CR,LF
+0023 T 0002 "Ugyldig dato",CR,LF
+0024 T 0002 "Ugyldig klokkeslett",CR,LF
+0025 T 0002 "Ugyldig tilgangsbane",CR,LF
+0026 T 0002 "Du har ikke angitt frastasjon",CR,LF
+0027 T 0002 "Du har ikke angitt tilstasjon",CR,LF
+0028 T 0002 "Trykk p† en tast for † fortsette...",CR,LF
+0029 T 0002 "Du m† angi frabane",CR,LF
+0030 T 0002 "Systemet er overf›rt",CR,LF
+0031 T 0002 "",
+0032 T 0002 "Kan ikke opprette katalogen",CR,LF
+0033 T 0002 "Lageret i stasjon %1 har ikke noe lagernavn",CR,LF
+0034 T 0002 "Navnet p† lageret i stasjon %1 er %2",CR,LF
+0035 T 0001 "Lagernavn (inntil 11 tegn)? "
+0036 T 0002 "Lagerets serienummer er %1-%2",CR,LF
+0037 T 0002 "Uriktig filtype",CR,LF
+0038 U 0001 CR,LF
+EXTEND 06e0 0089
+0001 T 0002 "Ugyldig funksjon",CR,LF
+0002 T 0002 "Finner ikke filen",CR,LF
+0003 T 0002 "Finner ikke tilgangsbanen",CR,LF
+0004 T 0002 "For mange †pne filer",CR,LF
+0005 T 0002 "Ingen tilgang",CR,LF
+0006 T 0002 "Ugyldig referanse",CR,LF
+0007 T 0002 "Minnekontrollblokkene er ›delagt",CR,LF
+0008 T 0002 "Ikke nok minne",CR,LF
+0009 T 0002 "Ugyldig minneblokkadresse",CR,LF
+0010 T 0002 "Ugyldig systeminformasjon",CR,LF
+0011 T 0002 "Ugyldig format",CR,LF
+0012 T 0002 "Ugyldig funksjonsparameter",CR,LF
+0013 T 0002 "Ugyldige data",CR,LF
+0014 T 0002 "",
+0015 T 0002 "Ugyldig stasjonsbetegnelse",CR,LF
+0016 T 0002 "Du fors›kte † fjerne/slette den aktive katalogen",CR,LF
+0017 T 0002 "Ikke samme enhet",CR,LF
+0018 T 0002 "Ikke flere filer",CR,LF
+0019 T 0002 "Skrivebeskyttelsesfeil",CR,LF
+0020 T 0002 "Ugyldig enhet",CR,LF
+0021 T 0002 "Ikke klar",CR,LF
+0022 T 0002 "Ugyldig anmodning om enhet",CR,LF
+0023 T 0002 "Datafeil",CR,LF
+0024 T 0002 "Ugyldige parametere i anmodning om enhet",CR,LF
+0025 T 0002 "Ugyldig tilgangsbane",CR,LF
+0026 T 0002 "Ugyldig type medium",CR,LF
+0027 T 0002 "Finner ikke sektor",CR,LF
+0028 T 0002 "Det er ikke mer papir i skriveren",CR,LF
+0029 T 0002 "Skrivefeil",CR,LF
+0030 T 0002 "Lesefeil",CR,LF
+0031 T 0002 "Generell feil",CR,LF
+0032 T 0002 "Fildelingsfeil",CR,LF
+0033 T 0002 "Filen er l†st",CR,LF
+0034 T 0002 "Ulovlig diskettbytte",CR,LF
+0035 T 0002 "Filkontrollblokken er ikke tilgjengelig",CR,LF
+0036 T 0002 "Systemressursene er oppbrukt",CR,LF
+0037 T 0002 "Sammenlikningsfeil i kodesett",CR,LF
+0038 T 0002 "Slutt p† inndata",CR,LF
+0039 T 0002 "Ikke nok lagerplass",CR,LF
+0040 T 0002 "",
+0041 T 0002 "",
+0042 T 0002 "",
+0043 T 0002 "",
+0044 T 0002 "",
+0045 T 0002 "",
+0046 T 0002 "",
+0047 T 0002 "",
+0048 T 0002 "",
+0049 T 0002 "",
+0050 T 0002 "Anmodningen st›ttes ikke av filsystemet",CR,LF
+0051 T 0002 "Kan ikke tilknytte filsystemet",CR,LF
+0052 T 0002 "Filsystemnavnet finnes allerede",CR,LF
+0053 T 0002 "Finner ikke filsystemnavnet",CR,LF
+0054 T 0002 "Filsystemet er i bruk",CR,LF
+0055 T 0002 "Filsystemenheten finnes ikke lenger",CR,LF
+0056 T 0002 "Filsystemressursene er oppbrukt",CR,LF
+0057 T 0002 "Filsystemet fikk feil p† en enhet",CR,LF
+0058 T 0002 "Filsystemet har gitt et uriktig svar",CR,LF
+0059 T 0002 "Filsystemet st›tte p† en uventet feil",CR,LF
+0060 T 0002 "Filsystemet er ikke kompatibelt",CR,LF
+0061 T 0002 "Filst›rrelsen for utdatafiler til enheten er overskredet",CR,LF
+0062 T 0002 "Plassen til utdatafiler p† enheten er overskredet",CR,LF
+0063 T 0002 "Utdatafilen til enheten finnes ikke lenger",CR,LF
+0064 T 0002 "Filsystemnavnet finnes ikke lenger",CR,LF
+0065 T 0002 "Filsystemet gir deg ikke tilgang",CR,LF
+0066 T 0002 "Uriktig type enhet for filsystemet",CR,LF
+0067 T 0002 "Finner ikke filsystemet",CR,LF
+0068 T 0002 "Filsystemressursene er oppbrukt",CR,LF
+0069 T 0002 "Filsystemressursene er oppbrukt",CR,LF
+0070 T 0002 "Filsystemenheten er midlertidig utilgjengelig",CR,LF
+0071 T 0002 "Ugyldig filsystemanmodning",CR,LF
+0072 T 0002 "Filsystemenheten har tatt en pause",CR,LF
+0073 T 0002 "Filsystemkomponenten er ikke tilgjengelig",CR,LF
+0074 T 0002 "Filsystemet st›tte p† en uventet feil",CR,LF
+0075 T 0002 "Filsystemet st›tte p† en uventet feil",CR,LF
+0076 T 0002 "",
+0077 T 0002 "",
+0078 T 0002 "",
+0079 T 0002 "",
+0080 T 0002 "Filen finnes allerede",CR,LF
+0081 T 0002 "",
+0082 T 0002 "Kan ikke opprette katalogpost",CR,LF
+0083 T 0002 "Du valgte † fortsette etter en alvorlig feil",CR,LF
+0084 T 0002 "For mange tilknytninger",CR,LF
+0085 T 0002 "Enheten eller filen er allerede tilknyttet",CR,LF
+0086 T 0002 "Ugyldig passord",CR,LF
+0087 T 0002 "Ugyldig parameter",CR,LF
+0088 T 0002 "Datafeil i filsystemet",CR,LF
+0089 T 0002 "Funksjonen st›ttes ikke av filsystemet",CR,LF
+PARSE 15d8 0011
+0001 T 0002 "Du har angitt for mange parametere",CR,LF
+0002 T 0002 "N›dvendig parameter mangler",CR,LF
+0003 T 0002 "Ugyldig parameter",CR,LF
+0004 T 0002 "Ugyldig n›kkelord",CR,LF
+0005 T 0002 "",
+0006 T 0002 "Parameterverdien ligger utenfor tillatt verdiomr†de",CR,LF
+0007 T 0002 "Parameterverdien er ikke gyldig",CR,LF
+0008 T 0002 "Parameterverdien er ikke gyldig",CR,LF
+0009 T 0002 "Parameterformatet er ikke riktig",CR,LF
+0010 T 0002 "Ugyldig parameter",CR,LF
+0011 T 0002 "Ugyldig parameterkombinasjon",CR,LF
+IBMBIO 17f6 0018
+0003 T 0002 13,10,"Ukjent kommando i CONFIG.SYS"
+0004 T 0002 13,10,"$"
+0005 T 0002 13,10,"Sektorst›rrelsen er for stor i filen $"
+0006 T 0002 13,10,"Defekt eller manglende $"
+0007 T 0002 "Kommandotolk",0
+0008 T 0002 13,10,"Ugyldig landkode eller kodesett",13,10,"$"
+0009 T 0002 13,10,"Feil i COUNTRY-kommandoen",13,10,"$"
+0010 T 0002 13,10, "Ikke nok minne til COUNTRY.SYS-filen",13,10,"$"
+0011 T 0002 13,10,"Konfigurasjonen er for stor for minnet",13,10,"$"
+0012 T 0002 13,10,"For mange blokkenheter",13,10,"$"
+0013 T 0002 13,10,"Ugyldige STACK-parametere",13,10,"$"
+0014 T 0002 13,10,"Feil rekkef›lge i CONFIG.SYS-filen p† linje ","$"
+0015 T 0002 "CONFIG.SYS-filen har en feil i linje ","$"
+0016 T 0002 13,10,"Minnetildelingsfeil ","$"
+0017 T 0002 0DH,0AH,7,0DH,0AH, "Intern overflyt i stakken",0DH,0AH
+ "Systemet har stoppet opp",0DH,0AH,"$"
+0020 T 0002 13,10,"Sett inn disketten for stasjon A:"
+0021 T 0002 13,10,"og trykk p† en tast n†r du er klar",13,10,10,0
+0022 T 0002 13,10,"Uriktig kommando eller parametere - $"
+BOOT 1c1c 0001
+0001 T 0002 13,10,"Ikke systemdiskett, eller feil p† lageret",13,10
+ "Velg et annet og trykk p† en tast n†r du er klar",13,10,0
+DBCSDOS 1cb2 0000
+IBMDOS 1cc6 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1d05 0091
+0201 T 0002 "A"
+0202 T 0002 "P"
+0203 T 0002 "O"
+0204 T 0002 "F"
+0205 T 0002 "J"
+0206 T 0002 "N"
+0210 T 0002 "Avbryte"
+0211 T 0002 ", Pr›ve igjen"
+0212 T 0002 ", Overse"
+0213 T 0002 ", Fortsette"
+0214 T 0002 "?"
+0215 T 0002 "under lesing fra",0
+0216 T 0002 "under skriving til",0
+0217 T 0002 "%1 stasjon %2",CR,LF
+0218 T 0002 "%1 enhet %2",CR,LF
+0219 T 0002 "Sett inn %1 med serienummer %2-%3",CR,LF
+0221 T 0002 "Ugyldig COMMAND.COM",CR,LF
+0222 T 0002 "Sett disketten med %1 i stasjon %2",CR,LF
+0224 T 0002 CR,LF,"Vil du avbryte satsjobben (.BAT)? (J/N) "
+0225 T 0002 "Kan ikke utf›re %1",CR,LF
+0226 T 0002 "Feil i EXE-fil",CR,LF
+0227 T 0002 "Programmet er for stort for minnet",CR,LF
+0228 T 0002 CR,LF,"Ingen ledige filreferanser"
+0229 T 0002 "Uriktig kommando eller filnavn",CR,LF
+0231 T 0002 CR,LF,"Minnetildelingsfeil"
+0232 T 0002 CR,LF,"Kan ikke laste COMMAND, systemet har stoppet",CR,LF
+0233 T 0002 CR,LF,"Kan ikke starte COMMAND, avslutter",CR,LF
+0234 T 0002 CR,LF,"Hovedprosessen er avbrutt, kan ikke fortsette",CR,LF
+0235 T 0002 CR,LF
+0463 T 0002 "Ikke mer plass til systeminformasjon",CR,LF
+0464 T 0002 CR,LF,"IBM Personal Computer DOS",CR,LF
+ "Versjon 3.40 (C)Copyright International Business Machines Corp 1981, 1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF
+0465 T 0002 "Ugyldig s›kebane for COMMAND",CR,LF
+0466 T 0002 "Ugyldig s›kebane for COMMAND, ingen tilgang",CR,LF
+1002 T 0002 "Like filnavn, eller finner ikke filen",CR,LF
+1003 T 0002 "Ugyldig tilgangsbane eller filnavn",CR,LF
+1007 T 0002 "Ikke mer plass til systeminformasjon",CR,LF
+1008 T 0002 "Filopprettingsfeil",CR,LF
+1009 T 0002 "Satsfilen (.BAT) mangler",CR,LF
+1010 T 0002 CR,LF,"Sett inn disketten med satsfilen",CR,LF
+1011 T 0002 "Uriktig kommando eller filnavn",CR,LF
+1016 T 0002 "Innholdet i tilfilen gikk tapt f›r kopiering",CR,LF
+1017 T 0002 "Ugyldig filnavn, eller finner ikke filen",CR,LF
+1018 T 0002 "%1 fil(er) er kopiert",CR,LF
+1019 T 0002 "%1 fil(er) "
+1022 T 0002 "Kodesett %1 er ikke klargjort for systemet",CR,LF
+1023 T 0002 "Kodesett %1 er ikke klargjort for alle enhetene",CR,LF
+1024 T 0002 "Gjeldende kodesett: %1",CR,LF
+1025 T 0002 "NLSFUNC er ikke installert",CR,LF
+1027 T 0002 "Den aktive stasjonen er ikke lenger gyldig"
+1029 T 0002 "Finner ikke merket",CR,LF
+1030 T 0002 "Syntaksfeil",CR,LF
+1032 T 0002 "Datoen er: %1 %2",CR,LF
+1033 T 0002 "s›nmantironstorfrel›r"
+1034 T 0002 "Skriv inn ny dato (%1): "
+1036 T 0002 "Klokken er: %1",CR,LF
+1037 T 0002 "Skriv inn nytt klokkeslett: "
+1038 T 0002 ", Slette? (J/N)"
+1039 T 0002 "Alle filene i katalogen vil bli slettet!",CR,LF
+ "Er du sikker? (J/N) "
+1040 T 0002 "IBM Personal Computer DOS, versjon %1.%2",CR,LF
+1044 T 0002 "Ugyldig katalog",CR,LF
+1046 T 0002 "Ugyldig tilgangsbane, ikke katalog",CR,LF,"eller katalogen er ikke tom",CR,LF
+1047 T 0002 "Du m† angi ON eller OFF",CR,LF
+1048 T 0002 "Innholdet i %1",CR,LF
+1049 T 0002 "Ingen tilgangsbane",CR,LF
+1050 T 0002 "Ugyldig stasjon i s›kebanen",CR,LF
+1051 T 0002 "Ugyldig enhet",CR,LF
+1052 T 0002 "FOR kan ikke nestes",CR,LF
+1053 T 0002 "Feil i midlertidig fil under r›rprosessen",CR,LF
+1054 T 0002 "Kan ikke utf›re bin‘r lesing fra en enhet",CR,LF
+1055 T 0002 "BREAK er %1 ",CR,LF
+1056 T 0002 "VERIFY er %1 ",CR,LF
+1057 T 0002 "ECHO er %1 ",CR,LF
+1059 T 0002 "av",0
+1060 T 0002 "p†",0
+1061 T 0002 "Feil under skriving til enhet",CR,LF
+1063 T 0002 "%1"
+1064 T 0002 "%1"
+1065 T 0002 "%1"
+1066 T 0002 "%1"
+1067 T 0002 9
+1068 T 0002 " <DIR> "
+1069 T 0002 8," ",8
+1070 T 0002 CR,LF
+1071 T 0002 "%1"
+1072 T 0002 "mm-dd-††"
+1073 T 0002 "dd.mm.††"
+1074 T 0002 "††-mm-dd"
+1075 T 0002 "%1 %2"
+1076 T 0002 "%1"
+1077 T 0001 " %1 %2"
+1078 T 0002 "Katalogen finnes allerede",CR,LF
+ATTRIB 2beb 0016
+0004 T 0002 "Ugyldig antall parametere",CR,LF
+0005 T 0002 "Ugyldig tilgangsbane, eller finner ikke filen",CR,LF
+0006 T 0002 "Syntaksfeil",CR,LF
+0008 T 0002 " %1"
+0009 T 0002 "%1 %2",CR,LF
+0010 T 0002 "%1",CR,LF,"%2",CR,LF
+0011 T 0002 "Et annet kodesett er brukt p† %1",CR,LF,"Vil du skifte? (J/N) "
+0012 T 0002 "%1",CR,LF
+0014 T 0002 CR,LF
+0015 T 0002 "Ugyldig filtypeverdi",CR,LF
+0199 T 0002 "Tilleggsattributtfeil",CR,LF
+0201 T 0002 "Finner ikke tilleggsattributtnavnet",CR,LF
+0204 T 0002 "Kan ikke angi navn p† tilleggsattributt",CR,LF
+0205 T 0002 "Tilleggsattributtnavnet er kjent, men st›ttes ikke av filsystemet",CR,LF
+0206 T 0002 "Uoverensstemmelse mellom tilleggsattributter",CR,LF
+0208 T 0002 "Ugyldig tilleggsattributtverdi",CR,LF
+ASSIGN 2ef8 0001
+0002 T 0002 "Opprinnelig: %1: Satt til: %2:",cr,lf
+CHKDSK 2f41 0063
+0003 T 0002 "Vil du gj›re om de tapte kjedene til filer? (J/N) " ;freemes
+0004 T 0002 "Uopprettelig feil i katalogen" ;ptrandir
+0005 T 0002 "Vil du gj›re om katalog til fil? (J/N) " ;ptrandir2
+0007 T 0002 "%1 byte total lagerplass" ;dskspc
+0008 T 0002 "%1 byte i defekte sektorer" ;badspc
+0009 T 0002 "%1 byte i %2 skjulte filer" ;hidmes
+0010 T 0002 "%1 byte i %2 kataloger" ;dirmes
+0011 T 0002 "%1 byte i %2 brukerfiler" ;filemes
+0012 T 0002 "%1 byte i %2 gjenopprettede filer" ;orphmes2
+0013 T 0002 "%1 byte kan gjenopprettes i %2 filer" ;orphmes3
+0014 T 0002 "%1 byte ledig lagerplass" ;frespc
+0015 T 0002 "%1 byte minne totalt" ;totmem
+0016 T 0002 "%1 byte er ledig" ;fremem
+0017 T 0002 "Kan ikke kj›re CHKDSK p† en nettverksstasjon" ;no_net_arg
+0018 T 0002 "Kan ikke kj›re CHKDSK p† en stasjon etter SUBST eller ASSIGN" ;SubStErr
+0019 T 0002 "Sannsynligvis ikke DOS-lager",CR,LF,"Vil du fortsette? (J/N) " ;badidbyt
+0020 T 0002 "Feil under lesing av filtildelingstabell %1",CR,LF ;badr
+0021 T 0002 "Katalog %1" ;direc_arg
+0022 T 0002 "%1 inneholder %2 ikke-tilgrensende blokker" ;extent_arg
+0023 T 0002 "Hver av de angitte filene best†r av tilgrensende blokker" ;noext_arg
+0024 T 0002 "Feil er funnet. Parameteren /F er ikke angitt.",CR,LF,"Rettelsene blir ikke skrevet p† lageret." ;fixmes_arg
+0025 T 0002 " Behandlingen kan ikke fortsette %1%2" ;fatal_arg
+0026 T 0002 " Feil i filtildelingstabellen p† stasjon %1" ;badrdmes
+0029 T 0002 " CHDIR .. mislyktes, og klarte ikke † l›se problemet" ;cdddmes
+0030 T 0002 " Har ugyldig blokkreferanse, filen er avkuttet" ;badchain
+0031 T 0002 " Ugyldig post i delkatalogen" ;badsubdir
+0032 T 0002 " Finnes ikke" ;ndotmes
+0033 T 0002 " F›rste referansenummer er ugyldig, posten er avkuttet" ;nulnz
+0034 T 0002 " Tildelingsfeil, st›rrelsen er endret" ;badclus
+0035 T 0002 " Kan ikke gjenopprette .., behandlingen fortsetter" ;norecdot
+0036 T 0002 " Katalogen er helt tom, uten . eller .." ;nuldmes
+0037 T 0002 " Katalogen er tilknyttet" ;joinmes
+0038 T 0002 " Kan ikke gjenopprette .." ;norecddot
+0039 T 0002 " Posten har en defekt lenke" ;norecddot1
+0040 T 0002 " Posten har et uriktig attributt" ;norecddot2
+0041 T 0002 " Posten har en uriktig st›rrelse" ;norecddot3
+0042 T 0002 " er krysskoplet i referanse %1" ;cross_arg
+0043 T 0002 " Kan ikke skifte katalog til %1,",CR,LF,"treet er ikke behandlet etter dette punktet" ;badtarg_ptr
+0044 T 0002 " treet er ikke behandlet etter dette punktet" ;badtarg2
+0045 T 0002 "%1 byte er frigjort" ;freebymes1
+0046 T 0002 "%1 byte kan frigj›res" ;freebymes2
+0047 T 0002 ;idmes_arg
+0048 T 0002 "%1 blokker p† lageret"
+0049 T 0002 "%1 byte i hver blokk" ;idmes2
+0050 T 0002 "CHKDSK er ikke tilgjengelig p† stasjon %1" ;msgExecFailure
+0051 T 0002 " Tilleggsattributtene har ugyldige referanser, attributtene er avkuttet" ;Inv_XA_Msg
+0052 T 0002 " Feil tildeling av tilleggsattributter, attributtene er avkuttet" ;Alloc_XA_Msg
+0053 T 0002 "Ugyldig parameter" ;badsw_arg
+0055 T 0002 "Finner ikke tilgangsbanen" ;invpath_arg
+0056 T 0002 "Finner ikke filen" ;opnerr_arg
+0058 T 0002 " %1 uriktige blokkreferanser er funnet i %2 kjeder." ;orph_arg
+0059 T 0002 CR,LF ;crlf_arg
+0060 T 0002 " Kan ikke skifte til rotkatalogen",CR,LF ;badcd_arg
+0061 T 0002 " Feil p† lageret under skriving av filtildelingstabell %1" ;badw_arg
+0062 T 0002 " %1" ;noisy_arg
+0063 T 0002 "Ugyldig aktiv katalog" ;baddpbdir
+0064 T 0002 "%1",CR,LF ;file_arg
+0065 T 0002 " Ikke nok plass i rotkatalogen",CR,LF," Flytt noen filer fra rotkatalogen og pr›v CHKDSK igjen" ;creatmes
+0066 T 0002 "%1 %2 %3" ;eup_arg
+0067 T 0002 "%1 %2, %3" ;usp_arg
+0068 T 0002 "%1%2%3%4%5" ;oth_arg
+0069 T 0002 "%1%2%3%4" ;time_arg
+0070 T 0002 "%1 ledige blokker p† lageret" ;idmes2 ;an017;bgb
+DEBUG 4241 0062
+0004 T 0002 "Tildelingen mislyktes, eller bufferen er for liten",CR,LF
+0005 T 0002 "Uriktig eller manglende meldingstekst",CR,LF
+0006 T 0002 "Uriktig navn p† enhet" ;baddev_ptr
+0007 T 0002 "Fikk ikke tilgang til utskriftsenheten PRN",CR,LF
+ "Oppgi navnet p† utskriftsenheten? " ;badlstmes_ptr
+0008 T 0002 CR,LF ;crlf_ptr
+0009 T 0002 CR,LF,"Programmet ble avsluttet p† vanlig m†te",CR,LF
+0010 T 0002 "Ugyldig stasjonsbetegnelse" ;nambad_ptr
+0012 T 0002 "Filopprettingsfeil" ;noroom_ptr
+0013 T 0002 "Ikke nok plass p† lageret" ;nospace_ptr
+0014 T 0002 "Feil under lesing p† lageret i stasjon %1" ;dr1_ptr
+0015 T 0002 "Feil under skriving p† lageret i stasjon %1" ;dr2_ptr
+0016 T 0002 "Skrivebeskyttelsesfeil under lesing p† stasjon %1" ;dr3_ptr
+0017 T 0002 "Skrivebeskyttelsesfeil under skriving p† stasjon %1" ;dr4_ptr
+0019 T 0002 "%1^ Feil" ;synerr
+0020 T 0002 "Feil i EXE- eller HEX-fil" ;exebad_ptr/hexerr_ptr
+0021 T 0002 "EXE- og HEX-filer kan ikke skrives ut" ;exewrt_ptr/hexwrt_ptr
+0022 T 0002 "EXEC-feil" ;execemes_ptr
+0023 T 0002 "Skrivefeil, du har ikke angitt tilfil" ;nonamespec_ptr
+0024 T 0002 "Ingen tilgang" ;accmes_ptr
+0025 T 0002 "Paritetsfeil eller ikke-eksisterende minne oppdaget" ;paritymes_ptr
+0026 T 0002 "-" ;prompt_ptr
+0027 T 0002 "%1 -" ;change_flag_ptr
+0032 T 0002 "%1%2" ;unassem_ln_ptr
+0033 T 0002 "%1:%2 %3" ;hex_ptr
+0034 T 0002 "%1 %2" ;add_ptr
+0035 T 0002 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0002 "%1=%2 " ;register_ptr
+0037 T 0002 "%1 Feil" ;errmes_ptr
+0038 T 0002 "Skriver %1 byte" ;wrtmes_ptr
+0039 T 0002 "%1:%2=" ;loc_ptr
+0040 T 0002 "%1" ;little_ptr
+0041 T 0002 "%1" ;big_ptr
+0042 T 0002 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0002 "%1 feil %2 stasjon %3" ;dskerr_ptr
+0044 T 0002 32,8 ;bacmes_ptr
+0045 T 0002 "Kan ikke † tildele en meldingsbehandler",CR,LF ;fatal_error
+0046 T 0002 "%1" ;arg_buf_ptr
+0047 T 0002 "%1" ;one_char_buf_ptr
+0050 T 0002 "%1 av %2 EMS-sider er tildelt",cr,lf
+0051 T 0002 "%1 av %2 EMS-referanser er tildelt",cr,lf
+0054 T 0002 "Sideramme = "
+0055 T 0002 "Referanse opprettet = %1 ",cr,lf
+0056 T 0002 "Logisk side %1 overf›rt til fysisk side %2 ",cr,lf
+0057 T 0002 "EMS-feil i maskin- eller programvare",cr,lf
+0058 T 0002 "Finner ikke referanse",cr,lf
+0059 T 0002 "Ugyldig funksjonskode",cr,lf
+0060 T 0002 "Ingen ledige referanser",cr,lf
+0061 T 0002 "Lagrings- eller tilbakekopieringsfeil",cr,lf
+0062 T 0002 "Totalt antall sider er overskredet",cr,lf
+0063 T 0002 "Antall ledige sider er overskredet",cr,lf
+0064 T 0002 "Parameterfeil",cr,lf
+0065 T 0002 "Logisk side ligger utenfor omr†de",cr,lf
+0066 T 0002 "Fysisk side ligger utenfor omr†de",cr,lf
+0067 T 0002 "Lagringsomr†det er allerede i bruk",cr,lf
+0068 T 0002 "Lagringsomr†det er ikke i bruk",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0002 "Manglende eller ugyldig EMS-parameter",cr,lf
+0072 T 0002 "Referanse %1 er tildelt %2 sider",cr,lf
+0074 T 0002 "Gjenoppretting av EMS er fullf›rt",cr,lf
+0075 T 0002 "Fysisk side %1 er rammesegment %2",cr,lf
+0076 T 0002 "Referanse %1 er fraordnet",cr,lf
+0078 T 0002 "EMS er ikke installert",cr,lf
+DRIVER 5132 0002
+0002 T 0001 "Ingen stasjon er angitt",CR,LF
+0003 T 0001 "Frittst†ende diskettstasjon er definert som stasjon %1",CR,LF
+EDLIN 51bf 0028
+0006 T 0002 "*" ;prompt_ptr
+0007 T 0002 "Ugyldig stasjon eller filnavn",CR,LF ;baddrv_ptr
+0008 T 0002 "Du m† oppgi filnavn",CR,LF ;ndname_ptr
+0009 T 0002 "Ugyldig parameter",CR,LF ;opt_err_ptr
+0010 T 0002 "Filen er BARE FOR LESING",CR,LF ;ro_err_ptr
+0011 T 0002 "Filopprettingsfeil",CR,LF ;bcreat_ptr
+0012 T 0002 "For mange †pne filer",CR,LF ;too_many_ptr
+0013 T 0002 "Lesefeil i:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0002 "Du kan ikke redigere en BAK-fil, gi den nytt navn",CR,LF ;nobak_ptr
+0015 T 0002 "Ikke plass til filen i katalogen",CR,LF ;nodir_ptr
+0016 T 0002 "Ikke mer plass p† lageret, du mistet en del av endringene.",CR,LF ;dskful_ptr
+0017 T 0002 "Finner ikke filen",CR,LF ;filenm_ptr
+0018 T 0002 "Du har skrevet feil",CR,LF ;badcom_ptr
+0019 T 0002 "Ny fil",CR,LF ;newfil_ptr
+0020 T 0002 "Ikke funnet",CR,LF ;nosuch_ptr
+0021 T 0002 "I orden? " ;ask_ptr
+0022 T 0002 "Linjen er for lang",CR,LF ;toolng_ptr
+0023 T 0002 "Hele filen er lastet inn",CR,LF ;eof_ptr
+0024 T 0002 "Vil du avbryte redigeringen? (J/N) " ;qmes_ptr
+0025 T 0002 "Angi linjenummeret du skal til",CR,LF ;dest_ptr
+0026 T 0002 "Ikke nok plass til † ta inn hele filen",CR,LF ;mrgerr_ptr
+0027 T 0002 CR,LF ;crlf_ptr
+0028 T 0002 LF ;lf_ptr
+0029 T 0002 "Fortsette? (J/N)" ;cont_ptr
+0030 T 0002 "Meldingen kan ikke skrives ut",CR,LF ;fatal_error
+0031 T 0002 "%1" ;arg_buf_ptr
+0032 T 0002 "%1:%2" ;line_num_buf_ptr
+0033 T 0002 "Kan ikke flettes, det er brukt forskjellige kodesett",CR,LF ;cp_err_ptr
+EXE2BIN 5939 0010
+0002 T 0002 "Ikke nok minne",CR,LF
+0003 T 0002 "Finner ikke meldingene",CR,LF
+0004 T 0002 "Ingen tilgang",CR,LF
+0005 T 0002 "Filen kan ikke konverteres",CR,LF
+0006 T 0002 "Finner ikke filen",CR,LF
+0007 T 0002 "Filopprettingsfeil",CR,LF
+0008 T 0002 "Rettelser m† til i hovedsegment (heksadesimalt):"
+0009 T 0002 "Ugyldig parameter",CR,LF
+0011 T 0002 "ADVARSEL - Lesefeil i EXE-fil.",CR,LF
+ "Det som er lest er mindre enn det som er angitt i filhodet.",CR,LF
+0012 T 0002 "Du m† oppgi filnavn",CR,LF
+FIND 5b49 0001
+0004 T 0002 "FIND: "
+FORMAT 5b73 0044
+0002 T 0002 CR,"%1 prosent av lageret er formatert"
+0004 T 0002 CR,"Formateringen er ferdig ",CR,LF
+0007 T 0002 "Sett en ny diskett i stasjon %1:",CR,LF
+0009 T 0002 "Sett inn igjen disketten for stasjon %1:",CR,LF
+0010 T 0002 "Lagernavn (inntil 11 tegn)? "
+0011 T 0002 CR,"Stasjon %1: kan ikke formateres", CR,LF
+0012 T 0002 CR,"Ugyldige enhetsparametere fra styreprogrammet",CR,LF
+0013 T 0002 CR,"Feil i IOCTL-kall ",CR,LF
+0014 T 0002 CR,"Ingen blokkenhet ",CR,LF
+0015 T 0002 CR,"Feil under skriving av filtildelingstabell",CR,LF
+0016 T 0002 CR,"Feil under skriving av katalog",CR,LF
+0017 T 0002 CR,"Kan ikke formatere lager etter SUBST eller ASSIGN. ",CR,LF
+0018 T 0002 CR,"Finner ikke systemfilene",CR,LF
+0019 T 0002 CR,"Du kan ikke formatere en nettverksstasjon",CR,LF
+0020 T 0002 CR,"Ugyldige tegn i lagernavnet ",CR,LF
+0021 T 0002 CR,"Parameterne st›ttes ikke",CR,LF
+0022 T 0002 CR,"Formateringen er avsluttet ",CR,LF
+0023 T 0002 CR,"Lageret kan ikke brukes til † starte systemet",CR,LF
+0024 T 0002 CR,"Ugyldig medium eller defekt spor 0, lageret kan ikke brukes",CR,LF
+0025 T 0002 CR,"F†r ikke skrevet oppstartingssporet ",CR,LF
+0026 T 0002 CR,"Feil under lesing av katalog",CR,LF
+0028 T 0002 CR,"og trykk p† ENTER n†r du er klar..."
+0029 T 0002 CR,"Ugyldig lagernavn ",CR,LF
+0031 T 0002 CR,"Skriv inn gjeldende lagernavn for stasjon %1: "
+0032 T 0002 CR,"Parameterne er ikke kompatible",CR,LF,"med platelageret",CR,LF
+0035 T 0002 CR,"Feil under lesing av partisjonstabellen",CR,LF
+0037 T 0002 CR,"Formateringen er avbrutt",CR,LF
+0038 T 0002 CR,"FORMAT er ikke tilgjengelig p† stasjon %1",CR,LF
+0039 T 0002 CR,"Ikke systemdiskett, eller feil p† lageret",CR,LF
+0040 T 0002 CR,"Feil i partisjonstabellen",CR,LF
+0041 T 0002 CR,"Parameterne st›ttes ikke av stasjonen",CR,LF
+0042 T 0002 CR,LF
+0043 T 0002 CR,LF,LF
+0044 T 0002 CR,"Sett DOS-disketten i stasjon %1:",CR,LF
+0045 T 0002 CR,LF,"ADVARSEL! ALLE DATA P PLATELAGERET",CR,LF
+ "I STASJON %1: VIL G TAPT!",CR,LF
+ "Vil du fortsette med formateringen? (J/N) "
+0046 T 0002 CR,"Vil du formatere en til? (J/N) "
+0047 T 0002 CR,"Feil under lesing av partisjonstabellen",CR,LF
+0048 T 0002 CR,"Feil under skriving av partisjonstabellen",CR,LF
+0049 T 0002 CR,"Parameterne er ikke kompatible", CR,LF
+0050 T 0002 "%1 blokker tilgjengelig p† lageret",CR,LF
+0051 T 0002 "%1 byte i hver blokk",CR,LF
+0052 T 0002 CR,"Feil under skriving av partisjonstabellen",CR,LF
+0053 T 0002 CR,"Du har angitt den samme parameteren to ganger",CR,LF
+0054 T 0002 CR,"Du m† bruke b†de /T- og /N-parameterne",CR,LF ;AN009;
+JOIN 65c9 0001
+0002 T 0002 CR,LF,"Katalogen er ikke tom",CR,LF
+MORE 660e 0001
+0002 T 0002 "-- Fortsetter --"
+PRINT 6642 0022
+0002 T 0002 CR,LF
+0006 T 0002 " feil under lesing av filen",CR,LF,"$"
+0007 T 0002 "Finner ikke filen",CR,LF,"$"
+0008 T 0002 CR,LF,LF,"Utskrift av filen $"
+0009 T 0002 " er annullert av brukeren$"
+0010 T 0002 CR,LF,LF,"Utskrift av alle filer er annullert av brukeren$"
+0011 T 0002 "Feil i filtildelingstabellen p† stasjon "
+0012 T 0002 "A.",CR,LF,"$"
+0013 T 0002 "Du har ikke angitt utskriftsenhet",CR,LF
+0014 T 0002 "Den minnefaste delen av PRINT er lastet inn",CR,LF
+0015 T 0002 "Du kan ikke bruke PRINT, bruk NET PRINT",CR,LF
+0017 T 0002 "Skriverk›en er full",CR,LF
+0018 T 0002 "Skriverk›en er tom",CR,LF
+0019 T 0002 "Ingen tilgang",CR,LF
+0020 T 0002 "Ugyldig stasjonsbetegnelse",CR,LF
+0021 T 0002 "Se etter om utskriftsenheten",CR,LF
+ "er ordentlig tilkoplet.",CR,LF
+0022 T 0002 CR,LF,LF," %1 skrives ut n†",CR,LF
+0023 T 0002 " %1 ligger i k›en",CR,LF
+0024 T 0002 "Finner ikke filen %1 ",CR,LF
+0025 T 0001 "Banenavnet er for langt",CR,LF
+0026 T 0001 "Filen er ikke i skriverk›en",CR,LF
+0027 T 0002 "Oppgi navnet p† utskriftsenheten [PRN]: "
+RECOVER 6a83 0012
+0002 T 0002 CR,LF,"Finner ikke filen",CR,LF ;File not found
+0003 T 0002 CR,LF,"Kan ikke kj›re RECOVER p† en stasjonen etter ASSIGN eller SUBST",CR,LF
+0004 T 0002 CR,LF,"Ugyldig stasjon eller filnavn",CR,LF
+0005 T 0002 CR,LF,"ADVARSEL - Katalogen er full",CR,LF
+0006 T 0002 CR,LF,"Du kan ikke kj›re RECOVER p† en nettverksstasjon", CR,LF ;Cannot %1 a Network drive
+0007 T 0002 CR,LF,"RECOVER er ikke tilgjengelig p† stasjon %1",CR,LF
+0008 T 0002 CR,LF,"%1 fil(er) er gjenopprettet",CR,LF
+0009 T 0002 CR,LF,"%1 av %2 byte er gjenopprettet",CR,LF
+0010 T 0002 CR,LF,"Trykk p† en tast for † gjenopprette",CR,LF,"filen(e) p† stasjon %1",CR,LF,CR,LF bgb
+0011 T 0002 CR,LF,"Kan ikke lese filtildelingstabellen",CR,LF
+0012 T 0002 CR,LF,"Kan ikke skrive filtildelingstabellen",CR,LF
+0013 T 0002 CR,LF
+SORT 6dc8 0001
+0005 T 0002 "SORT: "
+SUBST 6df2 0001
+0002 T 0002 CR,LF,"Uriktig antall parametere",CR,LF
+SYS 6e3b 0008
+0004 T 0002 "Ugyldig stasjonsbetegnelse",CR,LF ; Old
+0007 T 0002 "Ikke plass til systemet p† tillageret",CR,LF ; Old
+0008 T 0002 "Systemfilene er for store",CR,LF ; Old
+0010 T 0002 "Ingen systemfiler p† standardstasjonen",CR,LF ; Old
+0011 T 0002 "Kan ikke spesifisere standardstasjon",CR,LF ; New
+0012 T 0002 "Skrivefeil, disketten kan ikke brukes",CR,LF ; New
+0014 T 0002 "Sett systemdisketten i stasjon %c",CR,LF ; Old
+0016 T 0002 "Kan ikke overf›re systemet til filsystemet %1",CR,LF ; New
+SHARE 70a8 0000
+NLSFUNC 70bc 0000
+ANSI 70d0 0001
+0010 T 0002 "Ugyldig parameter - %1",CR,LF ; 'Invalid parameter'
+IFSFUNC 7128 0001
+0004 T 0002 "Finner ingen IFS-styreprogram",CR,LF
+PSPRINT 716f 0007
+0002 T 0002 " feil under lesing av filen",CR,LF,FORMFD,BELL,"$"
+0003 T 0002 CR,LF,LF,"Filen er annullert av brukeren",CR,FORMFD,BELL
+0004 T 0002 "Feil i filtildelingstabellen p† stasjon "
+0005 T 0002 "A.",CR,LF,"$"
+0006 T 0002 "Du har ikke angitt utskriftsenhet",CR,LF
+0007 T 0002 "PSPRINT er allerede lastet inn",CR,LF
+0008 T 0002 "Konflikt mellom PSPRINT og PRINT",CR,LF
+BACKUP 72ff 0022
+0002 T 0002 CR,LF,"Ikke nok minne",CR,LF
+0006 T 0002 CR,LF,"Ugyldig stasjonsbetegnelse",CR,LF
+0014 T 0002 CR,LF,"Fra- og tilstasjonene er identiske",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0002 CR,LF,"Feil under †pning av loggfil",CR,LF
+0018 T 0002 CR,LF,"Logger til filen %1",CR,LF
+0019 T 0002 CR,LF,"Den siste reservekopidisketten er ikke satt inn",CR,LF
+0020 T 0002 CR,LF,"Advarsel! Filene i rotkatalogen %1:\",CR,LF
+ "p† tilstasjonen vil bli slettet",CR,LF
+0021 T 0002 CR,LF,"Advarsel! Filene i katalogen %1\BACKUP",CR,LF
+ "p† tilstasjonen vil bli slettet",CR,LF
+0022 T 0002 CR,LF,"*** Reservekopierer filer til stasjon %1: ***",CR,LF
+0023 T 0002 "Diskett nummer: %1",CR,LF
+0024 T 0002 CR,LF,"Advarsel! Det er ingen filer † reservekopiere",CR,LF
+0025 T 0002 CR,LF,"Sett disketten som skal reservekopieres i stasjon %1:",CR,LF
+0026 T 0002 CR,LF,"Sett reservekopidiskett %1 i stasjon %2:",CR,LF
+0027 T 0002 CR,LF,"*** Kan ikke reservekopiere fil ***",CR,LF
+0028 T 0002 CR,LF,"Sett den siste reservekopidisketten i stasjon %1:",CR,LF
+0029 T 0002 CR,LF,"Tilstasjonen kan ikke brukes til reservekopiering",CR,LF
+0030 T 0002 CR,LF,"*** Siste fil er ikke reservekopiert ***",CR,LF
+0031 T 0002 CR,LF,"Platelageret %1:, som du reservekopierer til, er fullt",CR,LF
+0032 T 0002 CR,LF,"Lageret er fullt, feil under skriving til BACKUP-loggfil",CR,LF
+0034 T 0002 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 78d0 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 790a 0013
+0004 T 0002 "10 ulikheter, sammenlikningen er avsluttet",CR,LF
+0006 T 0002 "Sammenlikningsfeil i relativ posisjon %1",CR,LF
+0007 T 0002 "Fil 1 = %1",CR,LF
+0008 T 0002 "Fil 2 = %1",CR,LF
+0009 T 0002 "Finner ikke filsluttmerket (EOF)",CR,LF
+0010 T 0002 "Filene er like",CR,LF
+0015 T 0002 CR,LF,CR,LF,"Oppgi navnet p† prim‘rfilen",CR,LF
+0016 T 0002 CR,LF,CR,LF,"Oppgi navnet p† den andre filen eller en stasjonsbokstav",CR,LF
+0017 T 0002 "Filene er ikke like store",CR,LF
+0018 T 0002 "Vil du sammenlikne flere filer? (J/N) "
+0019 T 0002 "%1 og %2",CR,LF
+0020 T 0002 CR,LF
+0023 T 0002 "Filene er like",CR,LF
+DISKCOMP 7b87 0016
+0004 T 0002 "Ikke oppgi filnavn",CR,LF
+ "Kommandoformat: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0002 CR,LF,"Ugyldig stasjonsbetegnelse",CR,LF
+ "Den angitte stasjonen finnes ikke",CR,LF
+ "eller er ikke flyttbar",CR,LF
+0006 T 0002 CR,LF,"Du kan ikke kj›re DISKCOMP",CR,LF
+ "p† eller fra en nettverksstasjon",CR,LF
+0007 T 0002 CR,LF,"Sett den FRSTE disketten i stasjon %1:",CR,LF
+0008 T 0002 CR,LF,"Sett den ANDRE disketten i stasjon %1:",CR,LF
+0009 T 0002 CR,LF,"FRSTE diskett er defekt eller inkompatibel",CR,LF
+0010 T 0002 CR,LF,"ANDRE diskett er defekt eller inkompatibel",CR,LF
+0014 T 0002 CR,LF,"Vil du sammenlikne flere disketter? (J/N) "
+0015 T 0002 CR,LF,"Sammenlikner %1 spor,",CR,LF
+ "%2 sektorer pr. spor, %3 side(r)",CR,LF
+0016 T 0002 CR,LF,"Stasjonene eller diskettene",CR,LF
+ "er ikke kompatible",CR,LF
+0017 T 0002 CR,LF,"Uopprettelig lesefeil p† stasjon %2",CR,LF
+ "side %3, spor %4",CR,LF
+0018 T 0002 CR,LF,"Sammenlikningsfeil p†",CR,LF,"side %3, spor %4",CR,LF
+0019 T 0002 "Se etter at disketten er satt riktig",CR,LF ;AN004;
+ "p† plass i stasjonen",CR,LF ;AN004;
+0020 T 0002 CR,LF,"Sammenlikningen er ferdig",CR,LF
+0021 T 0002 CR,LF,"Diskettene er like",CR,LF
+0022 T 0002 CR,LF
+DISKCOPY 806f 0018
+0002 T 0002 CR,LF
+0004 T 0002 "Ikke oppgi filnavn",CR,LF
+ "Kommandoformat: DISKCOPY d: d: [/1]",CR,LF
+0005 T 0002 CR,LF,"Ugyldig stasjonsbetegnelse",CR,LF
+ "Den angitte stasjonen finnes ikke",CR,LF
+ "eller er ikke flyttbar",CR,LF
+0006 T 0002 CR,LF,"Du kan ikke kj›re DISKCOPY",CR,LF
+ "p† eller fra en nettverksstasjon",CR,LF
+0007 T 0002 CR,LF,"Formaterer under kopieringen",CR,LF
+0008 T 0002 CR,LF,"Sett fradisketten i stasjon %1:",CR,LF
+0009 T 0002 CR,LF,"Sett tildisketten i stasjon %1:",CR,LF
+0010 T 0002 "Se etter at disketten er satt riktig",CR,LF ;AN004;
+ "p† plass i stasjonen",CR,LF ;AN004;
+0011 T 0002 CR,LF,"Tildisketten er kanskje ubrukelig",CR,LF
+0012 T 0002 CR,LF,"Tildisketten kan ikke brukes",CR,LF
+0016 T 0002 CR,LF,"Vil du kopiere en diskett til? (J/N) "
+0017 T 0002 CR,LF,"Kopierer %1 spor,",CR,LF
+ "%2 sektorer pr. spor, %3 side(r)",CR,LF
+0018 T 0002 CR,LF,"Stasjonene eller diskettene",CR,LF
+ "er ikke kompatible",CR,LF
+0019 T 0002 CR,LF,"Uopprettelig lesefeil p† stasjon %1",CR,LF
+ "side %2, spor %3",CR,LF
+0020 T 0002 CR,LF,"Uopprettelig skrivefeil p† stasjon %1",CR,LF
+ "side %2, spor %3",CR,LF
+0021 T 0002 CR,LF,"Kopieringen er ferdig",CR,LF
+0022 T 0002 CR,LF,"Fradisketten er defekt eller inkompatibel"
+0023 T 0002 CR,LF,"Tildisketten er defekt eller inkompatibel"
+LABL 85d1 0000
+MODE 85e5 0055
+0003 T 0002 CR,LF,"Du m† angi COM1, COM2, COM3 eller COM4",CR,LF
+0004 T 0002 CR,LF,"Den minnefaste delen av MODE er lastet inn",CR,LF
+0005 T 0002 CR,LF,"Ugyldig navn p† enhet",CR,LF
+0006 T 0002 CR,LF,"Skriverfeil",CR,LF
+0007 T 0002 CR,LF,"LPT%1: innstilt p† 80",CR,LF
+0008 T 0002 CR,LF,"LPT%1: innstilt p† 132",CR,LF
+0009 T 0002 CR,LF,"Antall linjer pr. tomme er fastsatt",CR,LF
+0010 T 0002 CR,LF,"Det er angitt en ulovlig baudverdi",CR,LF
+0011 T 0002 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0002 "0123456789"
+0013 T 0001 CR,LF,"Ser du %1 p† skjermen? (J/N) "
+0014 T 0002 CR,LF,"Ugyldige parametere",CR,LF
+0015 T 0001 "LPT%1: er omdirigert til COM%2:",CR,LF
+0016 T 0001 "LPT%1: er ikke omdirigert",CR,LF
+0017 T 0002 CR,LF,"%1 gjenfors›k ved utkopling av parallellskriveren",CR,LF
+0018 T 0002 CR,LF," Kan ikke flytte bildet mot %1",CR,LF
+0020 T 0002 CR,LF,"Ugyldig antall parametere",CR,LF
+0021 T 0002 CR,LF,"NET 042: Kan ikke utf›re kommandoen",CR,LF
+0022 T 0002 CR,LF,"Nettverksskriveren st›tter ikke ubegrensede gjenfors›k",cr,lf
+0023 T 0002 CR,LF,"Fikk ikke tilgang til kodesettets skrifttypefil",CR,LF
+0024 T 0002 CR,LF,"Fikk ikke tilgang til denne enheten: %1",CR,LF
+0025 T 0002 CR,LF,"Enhet eller kodesett mangler i skrifttypefilen",CR,LF
+0026 T 0002 CR,LF,"Ugyldig innhold i skrifttypefilen",CR,LF
+0027 T 0002 CR,LF,"Det forrige kodesettet er skiftet ut",CR,LF
+0028 T 0002 CR,LF,"Det gjeldende kodesettet for %1 er %2",CR,LF
+0029 T 0002 CR,LF,"Enheten %1 er ikke klargjort",CR,LF
+0030 T 0002 "%1 kodesett:",CR,LF
+0031 T 0002 " Kodesett %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0002 CR,LF,"MODE %1-funksjonen er utf›rt",CR,LF
+0033 T 0002 CR,LF,"Feil %1 globalt kodesett",CR,LF ;FILLED IN with "ved fastsetting av" or "ved henting av"
+0034 T 0002 CR,LF,"Gjeldende kodesettvalg:",CR,LF ;table header
+0035 T 0002 " %1 - %2 kodesett",CR,LF
+0036 T 0002 " Kodesettet er ikke klargjort",CR,LF
+0037 T 0002 "Kodesettfunksjonen st›ttes ikke p† denne enheten",CR,LF
+0038 T 0002 "Det er ikke valgt noe kodesett (med SELECT-parameteren)",CR,LF
+0039 T 0002 "Feil p† enhet under %1",CR,LF
+0040 T 0002 "Kodesettet er ikke klargjort",CR,LF
+0041 T 0002 CR,LF,"Tastbordet st›tter ikke kodesettet",CR,LF
+0042 T 0002 CR,LF,"Feil under lesing av skrifttypefil",CR,LF
+0043 T 0002 CR,LF,"Kan ikke utf›re REFRESH-operasjonen",CR,LF
+0044 T 0002 CR,LF ;used for formatting
+0045 T 0002 CR,LF,"Status for %1:",CR,LF ;header for status reports
+0046 T 0002 "-----------" ;first part of underline under "Status for device %1:"
+0047 T 0002 "----",CR,LF ;four_char_underline
+0048 T 0002 "-----",CR,LF ;five_char_underline
+0049 T 0002 "LINES=%1",CR,LF
+0050 T 0002 "COLUMNS=%1",CR,LF
+0051 T 0002 CR,LF,"RATE og DELAY m† angis sammen",CR,LF
+0052 T 0002 "RATE=%1",CR,LF
+0053 T 0002 "DELAY=%1",CR,LF
+0054 T 0002 CR,LF,"Funksjonen st›ttes ikke p† denne datamaskinen - %1",CR,LF
+0055 T 0002 CR,LF,"Den n›dvendige skrifttypen er ikke lastet inn",CR,LF
+0056 T 0002 CR,LF,"ANSI.SYS m† v‘re installert for † kunne utf›re denne funksjonen",CR,LF
+0057 T 0002 CR,LF,"Du m† angi baudverdi",CR,LF
+0058 T 0002 "RETRY=%1",CR,LF
+RESTORE 92c0 0022
+0002 T 0002 CR,LF,"Fra- og tilstasjonene er identiske",CR,LF
+0003 T 0002 CR,LF,"Ugyldig antall parametere",CR,LF
+0006 T 0002 CR,LF,"Ugyldig stasjonsbetegnelse",CR,LF
+0007 T 0002 CR,LF,"Advarsel! Fant ingen filer † tilbakekopiere",CR,LF
+0008 T 0002 CR,LF,"Sett reservekopidiskett %1 i stasjon %2:",CR,LF
+0009 T 0002 CR,LF,"Sett disketten du vil tilbakekopiere p† i stasjon %1:",CR,LF
+0011 T 0002 CR,LF,"Advarsel! Feil i rekkef›lgen p† diskettene",CR,LF
+ "Bytt ut disketten eller fortsett hvis det er i orden",CR,LF
+0012 T 0002 CR,LF,"Den siste filen ble ikke tilbakekopiert",CR,LF
+0013 T 0002 CR,LF,"*** Filene ble reservekopiert %1 ***",CR,LF
+0014 T 0002 CR,LF,"Fralageret inneholder ikke reservekopifiler",CR,LF
+0015 T 0002 CR,LF,"Ikke nok minne",CR,LF
+0016 T 0002 CR,LF,"Advarsel! Filen %1",CR,LF
+ "er bare for lesing",CR,LF
+ "Vil du erstatte filen? (J/N) ",CR,LF
+0017 T 0002 CR,LF,"Feil i rekkef›lgen under tilbakekopiering av filer",CR,LF
+0018 T 0002 CR,LF,"Filopprettingsfeil",CR,LF
+0019 T 0002 CR,LF,"Ikke nok plass p† lageret",CR,LF
+0020 T 0002 CR,LF,"*** Kan ikke tilbakekopiere fil ***",CR,LF
+0021 T 0002 CR,LF,"*** Tilbakekopierer filer fra stasjon %1: ***",CR,LF
+0022 T 0002 CR,LF,"Advarsel! Filen %1",CR,LF
+ "er endret etter at den ble reservekopiert",CR,LF
+ "Vil du erstatte filen? (J/N) ",CR,LF
+0023 T 0002 "Diskett: %1",CR,LF
+0024 T 0002 CR,LF,"Merkelig feil, ring Russ Whitehead @ 8-3863",CR,LF
+0025 T 0002 07 ;For BEEP !
+0026 T 0002 CR,LF,"Feil under tilbakekopiering av tilleggsattributter",CR,LF
+SELECT 98e3 0016
+0004 T 0002 "Du kan ikke starte SELECT p† denne stasjonen",CR,LF,CR,LF
+ "Sett installeringsdisketten i stasjon A: og pr›v igjen"
+0005 T 0002 "Ugyldig lagringsmedium",CR,LF,CR,LF
+ "Sett installeringsdisketten i stasjon A: og pr›v igjen"
+0006 T 0002 "Ugyldige parametere i konfigureringskommandoen",CR,LF,CR,LF
+ "Pass p† at installeringsdisketten er i stasjon A:,",CR,LF
+ "og trykk p† Ctrl+Alt+Del for † starte p† nytt."
+0007 T 0002 BELL,"Kan ikke installere DOS. Programmet ble avbrutt.",CR,LF
+0008 T 0002 "Laster konfigureringsprogrammet. Vent litt..."
+0009 T 0002 "Du m† starte datamaskinen p† nytt for † fortsette.",CR,LF,CR,LF
+ "Trykk p† Ctrl+Alt+Del for † fortsette med installeringen av DOS."
+0010 T 0002 "Sett konfigureringsdisketten i stasjon A:",CR,LF,CR,LF
+ "Trykk p† Enter for † fortsette installeringen av DOS,",CR,LF
+ "eller trykk p† Esc for † avslutte.",CR,LF
+0011 T 0002 BELL
+0012 T 0002 "Sett konfigureringsdisketten i stasjon A:",CR,LF,CR,LF
+ "Trykk p† Enter for † fortsette",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE a085 0004
+0002 T 0002 "Katalogoversikt for %1",CR,LF ;define message
+0003 T 0002 "Katalogoversikt",CR,LF ;
+0004 T 0002 "Det finnes ingen delkataloger",CR,LF,LF ;
+0007 T 0002 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE a16f 0009
+0003 T 0002 CR,LF,"Ingen filer er skiftet ut",CR,LF
+0004 T 0002 CR,LF,"Ingen filer er tilf›yd",CR,LF
+0013 T 0002 CR,LF,"Skifter ut %1",CR,LF
+0014 T 0002 CR,LF,"Tilf›yer %1",CR,LF
+0015 T 0002 CR,LF,"%1 fil(er) er skiftet ut",CR,LF
+0016 T 0002 CR,LF,"%1 fil(er) er tilf›yd",CR,LF
+0017 T 0002 CR,LF,"Finner ingen filer %1",CR,LF
+0022 T 0002 CR,LF,"Vil du skifte ut %1? (J/N) "
+0023 T 0002 CR,LF,"Vil du tilf›ye %1? (J/N) "
+XCOPY a330 0019
+0004 T 0002 "Angir %1 et filnavn",CR,LF
+ "eller et katalognavn p† tilstasjonen",CR,LF
+ "(F = fil, K = katalog)? "
+0005 T 0002 "Trykk p† en tast for † starte kopieringen"
+0006 T 0002 "Tilgangsbanen er for lang",CR,LF
+0008 T 0002 "Kan ikke utf›re en syklisk kopiering",CR,LF
+0012 T 0002 "Kan ikke XCOPY fra en reservert enhet",CR,LF
+0021 T 0002 "Ugyldig antall parametere",CR,LF
+0022 T 0002 "Kan ikke XCOPY til en reservert enhet",CR,LF
+0024 T 0002 "Filopprettingsfeil",CR,LF
+0025 T 0002 "Leser frafil(er)...",CR,LF
+0026 T 0002 CR,LF
+0027 T 0002 "%1 fil(er) er kopiert",CR,LF
+0028 T 0002 "Finner ikke filen %1",CR,LF
+0029 T 0002 "FK"
+0030 T 0002 "%1%2",CR,LF S_PATH_FILE0
+0031 T 0002 "%1\%2",CR,LF S_PATH_FILE1
+0032 T 0002 "%1",CR,LF DISPLAY_S_PATH
+0033 T 0002 "%1%2? (J/N) " P_S_PATH_FILE0
+0034 T 0002 "%1\%2? (J/N) " P_S_PATH_FILE1
+0035 T 0002 "Ugyldig parameter - %1",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK a717 0013
+0002 T 0002 "Ikke nok minne",CR,LF
+0003 T 0002 "VDISK, versjon 3.40 Virtuelt lager %1",CR,LF
+0004 T 0002 " Bufferst›rrelsen er endret",CR,LF
+0005 T 0002 " Sektorst›rrelsen er endret",CR,LF
+0006 T 0002 " Katalogpostene er endret",CR,LF
+0007 T 0002 " Ugyldig parameterbokstav",CR,LF
+0008 T 0002 " Overf›ringsst›rrelsen er endret",CR,LF
+0009 T 0002 " Bufferst›rrelse: %1 kB",CR,LF
+0010 T 0002 " Sektorst›rrelse: %1",CR,LF
+0011 T 0002 " Katalogposter: %1",CR,LF
+0012 T 0002 " Overf›ringsst›rrelse: %1",CR,LF
+0013 T 0002 "VDISK er ikke installert - "
+0014 T 0002 " Bryterne p† utbyggings-",CR,LF
+ "kortet er stilt feil",CR,LF,CR,LF
+GRAFTABL a9cd 0005
+0002 T 0002 "Gjeldende kodesett: %1",CR,LF
+0003 T 0002 "Forrige kodesett: %1",CR,LF
+0004 T 0002 "Ingen",NULL
+0005 T 0002 "Ikke standard",NULL
+0006 T 0002 CR,LF,"Disse parameterne kan brukes:",COLON,CR,LF,LF
+ " /STA - Ber bare om status",CR,LF
+ " ? - Viser denne parameteroversikten",CR,LF,CR,LF
+ " Tilgjengelige kodesett:",COLON,CR,LF
+ " 437 - Amerikansk grafisk tegnsett",CR,LF
+ " 850 - Flerspr†klig grafisk tegnsett",CR,LF
+ " 860 - Portugisisk grafisk tegnsett",CR,LF
+ " 863 - Fransk-kanadisk grafisk tegnsett",CR,LF
+ " 865 - Nordisk grafisk tegnsett",CR,LF
+FASTOPEN ac3e 0016
+0004 T 0002 CR,LF,"FASTOPEN er installert",CR,LF
+0005 T 0002 CR,LF,"FASTOPEN er allerede installert",CR,LF
+0006 T 0002 CR,LF,"Uriktig parameter",CR,LF
+0007 T 0002 CR,LF,"Du har angitt for mange stasjoner",CR,LF
+0008 T 0002 CR,LF,"Du har angitt samme stasjon flere ganger",CR,LF
+0009 T 0002 CR,LF,"Ugyldig parameter",CR,LF
+0010 T 0002 CR,LF,"Ugyldig parametertype",CR,LF
+0011 T 0002 CR,LF,"Ugyldig omfang",CR,LF
+0012 T 0002 CR,LF,"Ugyldig antall fil- og katalogposter",CR,LF
+0013 T 0002 CR,LF,"Kan ikke installere utvidet minne",CR,LF
+0014 T 0002 CR,LF,"Utvidet minne er ikke tilgjengelig",CR,LF
+0015 T 0002 CR,LF,"Ugyldig stasjonsbetegnelse - %1",CR,LF
+0016 T 0002 CR,LF,"Ikke nok plass i EMS. Basisminne blir brukt.",CR,LF
+0017 T 0002 CR,LF,"Du kan ikke bruke FASTOPEN p† stasjon %1",CR,LF
+0018 T 0002 CR,LF,"For mange omfangsspesifikasjoner",CR,LF
+0019 T 0002 CR,LF,"Du har angitt for mange fil- eller katalogposter",CR,LF
+APPEND afff 0009
+0001 T 0002 "Uriktig APPEND-versjon",CR,LF
+0002 T 0002 "Ugyldig tilgangsbane",CR,LF
+0003 T 0002 "Ugyldig parameter",CR,LF
+0004 T 0002 "Ugyldig kombinasjon av parametere",CR,LF
+0005 T 0002 "Ingen tilknyttede kataloger",CR,LF
+0006 T 0002 "Konflikt mellom APPEND og ASSIGN",CR,LF
+0007 T 0002 "Konflikt mellom APPEND og TopView",CR,LF
+0008 T 0002 "Uriktig DOS-versjon",CR,LF
+0009 T 0002 "APPEND er allerede installert",CR,LF
+GRAPHICS b1c1 0012
+0005 T 0002 "Ugyldig parameter - %1",CR,LF ;AN000
+0007 T 0002 "Like parametere er ikke tillatt",CR,LF ;AN000
+0009 T 0002 "Finner ikke GRAPHICS-profilen",CR,LF ;AN000
+0010 T 0002 "N›dvendig profilsetning mangler f›r linje %1",CR,LF ;AN000
+0011 T 0002 "Ugyldig profilsetning p† linje %1",CR,LF ;AN000
+0012 T 0002 "Feil rekkef›lge i profilsetningen p† linje %1",CR,LF ;AN000
+0013 T 0002 "Feil under lesing av GRAPHICS-profilen",CR,LF ;AN000
+0014 T 0002 "Syntaksfeil i GRAPHICS-profilen",CR,LF ;AN000
+0015 T 0002 "PRINTBOX-navnet finnes ikke i GRAPHICS-profilen",CR,LF
+0016 T 0002 "Skriveren er ikke angitt i GRAPHICS-profilen",CR,LF ;AN000
+0017 T 0002 "/B er ugyldig sammen med en svart/hvitt-skriver",CR,LF ;AN000
+0018 T 0002 "Kan ikke laste inn p† nytt med denne profilen",CR,LF ;AN000
+DISPLAY b5fe 0003
+0002 T 0002 "Styreprogrammet for skjermen, %1, kan ikke klargj›res",CR,LF
+0008 T 0002 "Ikke nok minne",CR,LF
+0012 T 0002 "Ugyldig syntaks i styreprogrammet for skjermen - DISPLAY.SYS",CR,LF
+PRINTER b6d3 0002
+0002 T 0002 "Styreprogrammet for skriveren, %1, kan ikke klargj›res",CR,LF
+0012 T 0002 "Ugyldig syntaks i styreprogrammet for skriveren - PRINTER.SYS",CR,LF
+KEYB b786 0016
+0002 T 0002 "Gjeldende tastbordkode..: %1"
+0003 T 0002 "Gjeldende tastbordnummer: %1"
+0004 T 0002 " kodesett: %1",CR,LF
+0005 T 0002 "Gjeldende CON-kodesett..: %1",CR,LF
+0006 T 0002 "Du har angitt en ugyldig tastbordkode",CR,LF
+0007 T 0002 "Du har angitt et ugyldig tastbordnummer",CR,LF
+0008 T 0002 "Du har angitt et ugyldig kodesett",CR,LF
+0009 T 0002 "Defekt eller manglende definisjonsfil for tastbord",CR,LF
+0010 T 0002 "KEYB er ikke installert",CR,LF
+0011 T 0002 "Gjeldende kodesett er ikke tilgjengelig p† CON-enhet",CR,LF
+0012 T 0002 "Kodesettet du har angitt, er ikke klargjort",CR,LF
+0013 T 0002 "Ett eller flere CON-kodesett er ugyldige for den angitt tastbordkoden",CR,LF
+0014 T 0002 "Kodesettet du bad om (%1), er ikke gyldig for den angitt tastbordkoden",CR,LF
+0015 T 0002 "Kodesettet du bad om, er uforenelig med det valgte kodesettet",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0002 "Kan ikke opprette KEYB-tabell som ligger fast i minnet",CR,LF
+REDIRSYS bbaa 0000
+MEM bbbe 0036
+0010 T 0002 CR,LF
+0011 T 0002 " Adresse Navn St›rrelse Type ",CR,LF
+0012 T 0002 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0002 " Referanse EMS-navn St›rrelse ",CR,LF
+0014 T 0002 " ÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄ ",CR,LF
+0015 T 0002 " %06lX %-8.8s %06lX %s",CR,LF
+0016 T 0002 " %-8.8s %06lX %s ",CR,LF
+0017 T 0002 " %-8.8s %s "CR,LF
+0018 T 0002 "%1 byte minne totalt",CR,LF
+0019 T 0002 "%1 byte ledig",CR,LF
+0020 T 0002 "%1 - st›rste program som kan kj›res",CR,LF
+0021 T 0002 "%1 byte EMS-minne totalt",CR,LF
+0022 T 0002 "%1 byte ledig EMS-minne",CR,LF
+0023 T 0002 "%1 byte utvidet minne totalt",CR,LF
+0024 T 0002 "Avbruddsvektor" ;
+0025 T 0002 "ROM-kommunikasjonsomr†de" ;
+0026 T 0002 "DOS-kommunikasjonsomr†de" ;
+0027 T 0002 "IBMBIO" ;
+0028 T 0002 "IBMDOS" ;
+0029 T 0002 "Systemdata" ;
+0030 T 0002 "Systemprogram" ;
+0031 T 0002 "Systemstyreprogram" ;
+0032 T 0002 "Installert styreprogram" ;
+0033 T 0002 "%c:" ;
+0034 T 0002 "%c: - %c:" ;
+0035 T 0002 "BUFFERS=" ;
+0036 T 0002 "FILES=" ;
+0037 T 0002 "FCBS=" ;
+0038 T 0002 "STACKS=" ;
+0039 T 0002 "DEVICE=" ;
+0040 T 0002 "IFS=" ;
+0041 T 0002 "LASTDRIVE=" ;
+0042 T 0002 "ÄÄÄÄÄÄÄÄÄÄ" ;
+0043 T 0002 " ";
+0044 T 0002 "%1%2%3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR c134 0040
+0004 T 0002 "Nettverket er ikke startet opp",CR,LF
+0050 T 0002 "NET809: Det finnes ikke st›tte for nettverksanmodningen",CR,LF,0
+0051 T 0002 "NET801: Den fjerntliggende datamaskinen er ikke klar",CR,LF,0
+0052 T 0002 "NET802: Samme filnavn er allerede brukt i nettverket",CR,LF,0
+0053 T 0002 "NET803: Finner ikke nettverksnavnet",CR,LF,0
+0054 T 0002 "NET804: Nettverket er opptatt",CR,LF,0
+0055 T 0002 "NET805: Nettverksenheten finnes ikke lenger",CR,LF,0
+0056 T 0002 "NET806: Kommandolengden for NETBIOS er overskredet",CR,LF,0
+0057 T 0002 "NET807: Systemfeil: Feil i NETBIOS",CR,LF,0
+0058 T 0002 "NET808: Tilbakemeldingen fra nettverket er ikke riktig",CR,LF,0
+0059 T 0002 "NET810: Uventet nettverksfeil",CR,LF,0
+0060 T 0002 "NET811: Inkompatibelt kort i fjerntliggende datamaskin",CR,LF,0
+0061 T 0002 "NET812: Skriverk›en er full",CR,LF,0
+0062 T 0002 "NET813: Det er ikke plass til utskriftsfilen",CR,LF,0
+0063 T 0002 "NET814: Utskriftsfilen ble annullert",CR,LF,0
+0064 T 0002 "NET815: Nettverksnavnet ble slettet",CR,LF,0
+0065 T 0002 "Du f†r ikke tilgang til nettverket",CR,LF,0
+0066 T 0002 "NET817: Ugyldig nettverksenhet",CR,LF,0
+0067 T 0002 "NET818: Finner ikke nettverksnavnet",CR,LF,0
+0068 T 0002 "NET819: Nettverksnavnet er for langt",CR,LF,0
+0069 T 0002 "NET820: For mange NETBIOS-kommunikasjons›kter",CR,LF,0
+0070 T 0002 "NET821: Midlertidig pause i fildeling",CR,LF,0
+0071 T 0002 "NET823: Nettverksanmodningen ble ikke godtatt",CR,LF,0
+0072 T 0002 "NET822: Omdirigering av utskrift eller lagerenhet er midlertidig stanset",CR,LF,0
+0073 T 0002 "NET476: NETBIOS er ikke lastet inn",CR,LF,0
+0074 T 0002 "NET477: Uventet tilpasseravslutning",CR,LF,0
+0075 T 0002 "NET826: /RQB-verdien for filtjeneren er for liten",CR,LF,0
+0076 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0077 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0078 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0079 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0080 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0081 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0082 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0083 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0084 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0085 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0086 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0087 T 0002 "NET???: Uventet nettverksfeil",CR,LF,0
+0088 T 0002 "NET825: Datafeil i nettverket",CR,LF,0
+XMA2EMS cad6 0017
+0001 T 0002 "XMA2EMS: Styreprogram for utvidet minne Versjon 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 Alle rettigheter forbeholdes",CR,LF,"$"
+0002 T 0002 CR,LF,"XMA001 VMO/XMA-feils›king p†g†r: ","$"
+0003 T 0002 "XMA002 Feils›kingen er ferdig ",CR,LF,LF,"$"
+0004 T 0002 "XMA003 Siderammen starter ved...................... "
+0005 T 0002 "XXXX",":0",CR,LF,"$"
+0006 T 0002 "XMA004 Sider som er overf›rt til vanlig minne...... "
+0007 T 0002 "0 ",CR,LF,"$"
+0008 T 0002 "XMA005 Sider som er reservert for styreprogrammet.. "
+0009 T 0002 "0 ",CR,LF,"$"
+0010 T 0002 "XMA006 Sider som er tilgjengelig for utvidet minne. "
+0011 T 0002 "0 ",CR,LF,"$"
+0012 T 0002 CR,LF,"XMA100 Feil p† kortet:",CR,LF," Styreprogrammet for utvidet minne er ikke installert",CR,LF,"$"
+0013 T 0002 CR,LF,"XMA200 Finner ikke kortet:",CR,LF," Styreprogrammet for utvidet minne er ikke installert",CR,LF,"$"
+0014 T 0002 CR,LF,"XMA300 Feil parametersyntaks eller verdi:",CR,LF
+ " Styreprogrammet for utvidet minne er ikke installert",CR,LF,"$"
+0015 T 0002 SIZE1_END - 2 -$
+0016 T 0002 4 DUP (?)," kB er i orden",CR,LF,"$"
+0017 T 0002 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FILESYS cfc2 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 T 0002 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+FDISK d104 0120
+0004 T 0002 "Kan ikke kj›re FDISK n†r nettverket er lastet inn",CR,LF
+0005 T 0002 "Det finnes ikke noe platelager"
+0006 T 0002 "Feil under lesing av platelager"
+0007 T 0002 "Feil under skriving p† platelager"
+1001 T 0002 "IBM Personal Computer"
+1002 T 0002 "Konfigureringsprogram for platelager, versjon 3.40"
+1003 T 0002 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0002 "FDISK-meny"
+1005 T 0002 "1. <R>Opprette DOS-partisjon eller logisk stasjon"
+1006 T 0002 "2. <R>Angi aktiv partisjon"
+1007 T 0002 "3. <R>Slette DOS-partisjon eller logisk stasjon"
+1008 T 0002 "4. <R>Vise partisjonsdata"
+1009 T 0002 "Trykk p† <H>Esc<R> for † g† ut av FDISK"
+1010 T 0002 "Velg ett av f›lgende:"
+1011 T 0002 "5. <R>Velge neste platestasjon"
+1012 T 0002 "Aktiv platestasjon: <H><I>"
+1013 T 0002 "Advarsel! <R>Ingen partisjon er gjort aktiv. Lager 1 kan ikke"
+1014 T 0002 "startes uten en aktiv partisjon."
+1015 T 0002 "Skriv inn valg: [<S> ]"
+1016 T 0002 "Opprette DOS-partisjon eller logisk stasjon"
+1017 T 0002 "1. <R>Opprette prim‘r DOS-partisjon"
+1018 T 0002 "2. <R>Opprette sekund‘r DOS-partisjon"
+1019 T 0002 "3. <R>Opprette logiske stasjoner i den sekund‘re partisjonen"
+1020 T 0002 "Trykk p† <H>ESC<R> for † g† tilbake til menyen"
+1021 T 0002 "Opprette prim‘r DOS-partisjon"
+1022 T 0002 "Vil du bruke all tilgjengelig plass til en prim‘r DOS-partisjon"
+1023 T 0002 "og gj›re partisjonen aktiv (<J>/<N>).....................? <H>[<S> ]"
+1024 T 0002 "(<J>/<N>)................................................? <H>[<S> ]"
+1025 T 0002 "Partisjon Status Type St›rrelse i MB Opptatt plass (i prosent)"
+1026 T 0002 "Total lagerplass er <HIIIIR> MB (1 MB = 1048576 byte)"
+1027 T 0002 "Maksimal tilgjengelig plass for partisjonen er <HIIIIR> MB (<HIIIIR>)"
+1028 T 0002 "Angi partisjonsst›rrelse i MB eller i prosent av lagerplass (%) for"
+1029 T 0002 "† opprette en prim‘r DOS-partisjon................................: <H>[<IIISI>]"
+1030 T 0002 "Opprette sekund‘r DOS-partisjon"
+1031 T 0002 "† opprette en sekund‘r DOS-partisjon..............................: <H>[<IIISI>]"
+1032 T 0002 "Trykk p† <H>Esc<R> for † fortsette"
+1033 T 0002 "Opprette logisk stasjon(er) i den sekund‘re DOS-partisjonen"
+1034 T 0002 "St. Lagernavn MB System Brukt"
+1035 T 0002 "Den sekund‘re DOS-partisjon er p† <HIIIIR> MB (1 MB = 1048576 byte)"
+1036 T 0002 "Maksimal tilgjengelig plass for logisk stasjon er <HIIIIR> MB <H>(<IIII>)"
+1037 T 0002 "Angi logisk stasjonsst›rrelse i MB eller prosent av lagerplass....: <H>[<IIISI>]"
+1038 T 0002 "Angi aktiv partisjon"
+1039 T 0002 "Angi nummeret p† partisjonen du vil gj›re aktiv...................: <H>[<S> ]"
+1040 T 0002 "Slette DOS-partisjon eller logisk stasjon"
+1041 T 0002 "Slette prim‘r DOS-partisjon"
+1042 T 0002 "Slette sekund‘r DOS-partisjon"
+1043 T 0002 "Slette logiske stasjoner i sekund‘r partisjon"
+1044 T 0002 "Slette prim‘r DOS-partisjon"
+1045 T 0002 "Advarsel! <OR>Data i den prim‘re DOS-partisjonen vil g† tapt."
+1046 T 0002 "nsker du † fortsette? (J/N).......................... <H>[<S> ]"
+1047 T 0002 "Slette sekund‘r DOS-partisjon"
+1048 T 0002 "Advarsel! <OR>Data i den sekund‘re DOS-partisjonen vil g† tapt."
+1049 T 0002 "nsker du † fortsette................................? <H>[<S> ]"
+1050 T 0002 "Slette logiske stasjoner i sekund‘r partisjon"
+1051 T 0002 "Advarsel! <OR>Data i den logiske stasjonen vil g† tapt."
+1052 T 0002 "Hvilken stasjon vil du slette........................? <H>[<S> ]"
+1053 T 0002 "Er du sikker (<J>/<N>)...................................? <H>[<S> ]"
+1054 T 0002 "Skriv inn lagernavn..................................: <H>[<S> ]"
+1055 T 0002 "Vise partisjonsdata"
+1056 T 0002 "Den sekund‘re DOS-partisjonen inneholder logiske stasjoner."
+1057 T 0002 "Vil du vite mer om de logiske stasjonene (<J>/<N>).......? <H>[<S> ]"
+1058 T 0002 "Vise data om logiske stasjoner"
+1059 T 0002 "Systemet starter p† nytt"
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0002 "Trykk p† en tast n†r du er klar...<S>"
+1062 T 0002 "Den prim‘re DOS-partisjonen er slettet"
+1063 T 0002 "Den sekund‘re DOS-partisjonen er slettet"
+1064 T 0002 "Den logiske stasjonen er slettet"
+1065 T 0002 "Partisjon <I> er gjort aktiv"
+1066 T 0002 "Den prim‘re DOS-partisjonen er opprettet<W>"
+1067 T 0002 "Den sekund‘re DOS-partisjonen er opprettet<W>"
+1068 T 0002 "Logisk stasjon er opprettet, stasjonsbokstaver er endret eller tilf›yd<W>"
+1069 T 0002 "Ingen partisjon er definert"
+1070 T 0002 "Ingen logisk stasjon er definert"
+1071 T 0002 "Stasjonsbokstaver er endret eller tilf›yd<W>"
+1072 T 0002 "Stasjonen er omdirigert"
+1073 T 0002 "Prim‘r DOS-partisjon er opprettet, stasjonsbokstaver er endret eller tilf›yd"
+1074 T 0002 "Det finnes ikke noe platelager."
+1075 T 0002 "Feil under lesing av platelager."
+1076 T 0002 "Feil under skriving p† platelager."
+1077 T 0002 "Uriktig DOS-versjon."
+1078 T 0002 "Kan ikke kj›re FDISK med nettverket lastet inn"
+1079 T 0002 "Ingen prim‘r DOS-partisjon † slette."
+1080 T 0002 "Ingen sekund‘r DOS-partisjon † slette."
+1081 T 0002 "Det finnes allerede en prim‘r DOS-partisjon."
+1082 T 0002 "Det finnes allerede en sekund‘r DOS-partisjon."
+1083 T 0002 "Det er ikke plass til † opprette en DOS-partisjon."
+1084 T 0002 "Den angitte logiske stasjonen overskrider tilgjengelig plass.<W>"
+1085 T 0002 "Den angitte partisjonen overskrider tilgjengelig plass.<W>"
+1086 T 0002 "Ingen partisjon † slette."
+1087 T 0002 "Den eneste partisjonen p† stasjon 1 som du kan starte, er allerede aktiv.<W>"
+1088 T 0002 "Ingen partisjon † gj›re aktiv."
+1089 T 0002 "Den angitte partisjonen (<I>) kan ikke startes, aktiv partisjon ikke endret.<W>"
+1090 T 0002 "Du kan ikke opprette en sekund‘r DOS-partisjon"
+1091 T 0002 "uten en prim‘r DOS-partisjon p† stasjon 1.<W>"
+1092 T 0002 "All tilgjengelig plass i den sekund‘re DOS-"
+1093 T 0002 "partisjonen er avsatt til logiske stasjoner.<W>"
+1094 T 0002 "Kan ikke slette sekund‘r DOS-partisjon mens det finnes logiske stasjoner.<W>"
+1095 T 0002 "Alle logiske stasjoner i den sekund‘re DOS-partisjonen er slettet<W>"
+1096 T 0002 " er ikke et gyldig valg, skriv et tall i omr†det <III>.<W>"
+1097 T 0002 "Advarsel! Partisjonen du har merket aktiv, kan ikke startes.<W>"
+1098 T 0002 " Ingen av partisjonene kan startes."
+1099 T 0002 "Bare partisjoner p† stasjon 1 kan gj›res aktive.<W>"
+1100 T 0002 "Det maksimale antall logiske stasjoner er installert.<W>"
+1101 T 0002 "Kan ikke opprette en partisjon med en st›rrelse p† 0 byte."
+1102 T 0002 "Stasjon <II> er allerede slettet."
+1103 T 0002 "F†r ikke tilgang til stasjon <I>.<OW>"
+1104 T 0002 "Ugyldig valg, skriv et tall i omr†det <III>.<W>"
+1105 T 0002 "Du kan ikke slette den prim‘re DOS-partisjonen"
+1106 T 0002 "p† stasjon 1 n†r det finnes en sekund‘r partisjon<W>"
+1107 T 0002 "Ugyldig tegn/valg, trykk p† Enter.<W>"
+1108 T 0002 "Lagernavnet stemmer ikke.<W>"
+1109 T 0002 "Kan ikke opprette logiske stasjoner uten en"
+1110 T 0002 "sekund‘r DOS-partisjon p† den aktive stasjonen.<W>"
+1111 T 0002 "Det finnes ingen logisk(e) stasjon(er) † slette."
+1112 T 0002 "Feil i meldingsstreng <I>. Den er n‘rmere definert i filhodet til FDISKC.MSG"
+1113 T 0002 "Intern feil"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/portugal.msg b/private/mvdm/dos/v86/messages/portugal.msg
new file mode 100644
index 000000000..a4ad5c5f6
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/portugal.msg
@@ -0,0 +1,1142 @@
+0007
+COMMON 0006 0038
+0001 T 0000 "VersÆo incorrecta de DOS",CR,LF
+0002 T 0000 "%1 j  instalado",CR,LF
+0003 T 0000 "%1 bytes dispon¡veis no disco",CR,LF
+0004 T 0000 "%1 bytes livres",CR,LF
+0005 T 0000 "%1 bytes em sectores danificados",CR,LF
+0006 T 0000 "%1 bytes de espa‡o total em disco",CR,LF
+0007 T 0000 "%1 bytes de mem¢ria total",CR,LF
+0008 T 0000 "%1 bytes usados pelo sistema",CR,LF
+0009 T 0000 "%1 instalado",CR,LF
+0010 T 0000 "%1 nÆo instalado",CR,LF
+0011 T 0000 "%1 nÆo instalado",CR,LF
+0012 T 0000 "%1 nÆo execut vel numa unidade de Rede",CR,LF
+0013 T 0000 "",
+0014 T 0000 "%1 nÆo execut vel numa unidade depois do SUBST ou do ASSIGN",CR,LF
+0015 T 0000 "%1 nÆo execut vel",CR,LF
+0016 U 0000 "Mem¢ria Expandida nÆo dispon¡vel",CR,LF
+0017 T 0000 "Tabela de aloca‡Æo de ficheiro inv lida para a unidade %1",CR,LF
+0018 T 0000 "O ficheiro nÆo pode ser copiado sobre ele pr¢prio",CR,LF
+0019 U 0000 "Introduza a disquete destino na unidade %1",CR,LF
+0020 T 0000 "Espa‡o insuficiente em disco",CR,LF
+0021 T 0000 "Caracteres inv lidos na identifica‡Æo da unidade",CR,LF
+0022 U 0000 "Code page inv lido",CR,LF
+0023 T 0000 "Data inv lida",CR,LF
+0024 T 0000 "Hora inv lida",CR,LF
+0025 T 0000 "Caminho (path) inv lido",CR,LF
+0026 T 0000 "Unidade origem nÆo indicada",CR,LF
+0027 T 0000 "Unidade destino nÆo indicada",CR,LF
+0028 U 0000 "Prima qualquer tecla para continuar . . .",CR,LF
+0029 T 0000 "Mem¢ria insuficiente",CR,LF
+0030 T 0000 "Sistema transferido",CR,LF
+0031 T 0000 "",
+0032 T 0000 "Imposs¡vel criar direct¢rio",CR,LF
+0033 T 0000 "O volume na unidade %1 nÆo tem identifica‡Æo",CR,LF
+0034 T 0000 "O volume na unidade %1 ‚ %2",CR,LF
+0035 T 0001 "Identifica‡Æo do volume (11 caracteres)? "
+0036 U 0000 "O N£mero de S‚rie do Volume ‚ %1-%2",CR,LF
+0037 U 0000 "Tipo de ficheiro incorrecto",CR,LF
+0038 U 0001 CR,LF
+EXTEND 0745 0089
+0001 U 0000 "Fun‡Æo Inv lida",CR,LF
+0002 T 0000 "Ficheiro nÆo encontrado.",CR,LF
+0003 T 0000 "Caminho (path) nÆo encontrado.",CR,LF
+0004 T 0000 "Excesso de ficheiros abertos",CR,LF
+0005 T 0000 "Acesso negado",CR,LF
+0006 U 0000 "Tratamento inv lido",CR,LF
+0007 U 0000 "Blocos de controlo de mem¢ria destru¡dos",CR,LF
+0008 T 0000 "Mem¢ria insuficiente",CR,LF
+0009 U 0000 "Endere‡o de bloco de mem¢ria inv lido",CR,LF
+0010 U 0000 "Ambiente Inv lido",CR,LF
+0011 U 0000 "Formato inv lido",CR,LF
+0012 U 0000 "Parƒmetro da fun‡Æo inv lido",CR,LF
+0013 U 0000 "Dados inv lidos",CR,LF
+0014 T 0000 "",
+0015 T 0000 "Unidade indicada inv lida",CR,LF
+0016 U 0000 "Tentativa de elimina‡Æo do direct¢rio corrente",CR,LF
+0017 U 0000 "O dispositivo nÆo ‚ o mesmo",CR,LF
+0018 U 0000 "NÆo existem mais ficheiros",CR,LF
+0019 U 0000 "Erro de protec‡Æo contra grava‡Æo",CR,LF
+0020 U 0000 "Unidade inv lida",CR,LF
+0021 T 0000 "NÆo operacional.",CR,LF
+0022 U 0000 "Pedido de dispositivo inv lido",CR,LF
+0023 U 0000 "Erro de dados",CR,LF
+0024 U 0000 "Parƒmetros de pedido de dispositivo inv lidos",CR,LF
+0025 U 0000 "Erro de pesquisa",CR,LF
+0026 U 0000 "Tipo de suporte inv lido",CR,LF
+0027 T 0000 "Sector nÆo encontrado.",CR,LF
+0028 U 0000 "Erro - impressora sem papel",CR,LF
+0029 U 0000 "Erro de falha de grava‡Æo",CR,LF
+0030 U 0000 "Erro de falha de leitura",CR,LF
+0031 T 0000 "Falha Geral",CR,LF
+0032 T 0000 "Viola‡Æo de partilha",CR,LF
+0033 T 0000 "Viola‡Æo de bloqueio",CR,LF
+0034 T 0000 "Troca de Discos Inv lida.",CR,LF
+0035 T 0000 "FCB nÆo dispon¡vel.",CR,LF
+0036 U 0000 "Capacidades do sistema esgotadas",CR,LF
+0037 U 0000 "Falta de correspondˆncia entre code pages",CR,LF
+0038 U 0000 "Inexistˆncia de input",CR,LF
+0039 T 0000 "Espa‡o insuficiente em disco",CR,LF
+0040 T 0000 "",
+0041 T 0000 "",
+0042 T 0000 "",
+0043 T 0000 "",
+0044 T 0000 "",
+0045 T 0000 "",
+0046 T 0000 "",
+0047 T 0000 "",
+0048 T 0000 "",
+0049 T 0000 "",
+0050 U 0000 "Pedido nÆo suportado pelo sistema de ficheiros",CR,LF
+0051 U 0000 "Imposs¡vel ligar ao sistema de ficheiros",CR,LF
+0052 U 0000 "Nome j  existente no sistema de ficheiros",CR,LF
+0053 U 0000 "Nome nÆo encontrado no sistema de ficheiros",CR,LF
+0054 U 0000 "Sistema de ficheiros ocupado",CR,LF
+0055 U 0000 "O dispositivo do sistema de ficheiros j  nÆo existe",CR,LF
+0056 U 0000 "Capacidades do sistema de ficheiros esgotadas",CR,LF
+0057 U 0000 "Erro de dispositivo encontrado pelo sistema de ficheiros",CR,LF
+0058 U 0000 "Resposta incorrecta dada ao sistema de ficheiros",CR,LF
+0059 U 0000 "Erro inesperado para o sistema de ficheiros",CR,LF
+0060 U 0000 "Sistema de ficheiros nÆo compat¡vel",CR,LF
+0061 U 0000 "Limite do dispositivo do ficheiro de output excedido",CR,LF
+0062 U 0000 "Espa‡o do dispositivo do ficheiro de output excedido",CR,LF
+0063 U 0000 "O dispositivo do ficheiro de output j  nÆo existe",CR,LF
+0064 U 0000 "O nome do sistema de ficheiros j  nÆo existe",CR,LF
+0065 U 0000 "Acesso negado pelo sistema de ficheiros",CR,LF
+0066 U 0000 "Tipo de dispositivo do sistema de ficheiros incorrecto",CR,LF
+0067 U 0000 "Sistema de ficheiros nÆo encontrado",CR,LF
+0068 U 0000 "Capacidade do sistema de ficheiros esgotada",CR,LF
+0069 U 0000 "Capacidade do sistema de ficheiros esgotada",CR,LF
+0070 U 0000 "Dispositivo do sistema de ficheiros temporariamente nÆo dispon¡vel" ,CR,LF
+0071 U 0000 "Pedido do sistema de ficheiros nÆo aceite",CR,LF
+0072 U 0000 "Sistema de ficheiros em pausa",CR,LF
+0073 U 0001 "Componente do sistema de ficheiros nÆo dispon¡vel",CR,LF
+0074 U 0001 "O sistema de ficheiros encontrou um erro inesperado",CR,LF
+0075 U 0001 "O sistema de ficheiros encontrou um erro inesperado",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 U 0000 "Ficheiro j  existente",CR,LF
+0081 T 0000 "",
+0082 U 0000 "Imposs¡vel criar a entrada do direct¢rio",CR,LF
+0083 U 0000 "Erro Cr¡tico provocado por falha",CR,LF
+0084 U 0000 "Excesso de liga‡äes",CR,LF
+0085 U 0000 "Dispositivo ou ficheiro j  ligado",CR,LF
+0086 U 0000 "Palavra-passe inv lida",CR,LF
+0087 T 0000 "Parƒmetro inv lido",CR,LF
+0088 U 0000 "Falha de dados no sistema de ficheiros",CR,LF
+0089 U 0000 "Fun‡Æo nÆo suportada pelo sistema de ficheiros",CR,LF
+PARSE 17f9 0011
+0001 U 0000 "Excesso de parƒmetros",CR,LF
+0002 U 0000 "Parƒmetro necess rio em falta",CR,LF
+0003 U 0000 "Indicador inv lido",CR,LF
+0004 U 0000 "Palavra-chave inv lida",CR,LF
+0005 T 0000 "",
+0006 U 0000 "Valor do parƒmetro fora do limite permitido",CR,LF
+0007 U 0000 "Valor do parƒmetro nÆo permitido",CR,LF
+0008 U 0000 "Valor do parƒmetro nÆo permitido",CR,LF
+0009 U 0000 "Formato do parƒmetro nÆo correcto",CR,LF
+0010 T 0000 "Parƒmetro inv lido",CR,LF
+0011 U 0000 "Combina‡Æo de parƒmetros inv lida",CR,LF
+IBMBIO 1a13 0018
+0003 U 0000 13,10,"Comando desconhecido no CONFIG.SYS"
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Comprimento de sector longo demais no ficheiro $"
+0006 U 0000 13,10,"$ inv lido ou em falta"
+0007 U 0000 "Intrepertador de Comandos",0
+0008 U 0000 13,10,"C¢digo de pa¡s ou code page inv lido",13,10,"$"
+0009 U 0000 13,10,"Erro no comando COUNTRY",13,10,"$"
+0010 U 0000 13,10, "Mem¢ria insufuciente para o ficheiro COUNTRY.SYS",13,10,"$"
+0011 U 0000 13,10,"Configura‡Æo grande demais para a mem¢ria",13,10,"$"
+0012 U 0000 13,10,"Excesso de Dispositivos de Blocos",13,10,"$"
+0013 U 0000 13,10,"Parƒmetros do STACK inv lidos",13,10,"$"
+0014 U 0000 13,10,"Sequˆncia incorrecta no ficheiro CONFIG.SYS, linha ","$"
+0015 U 0000 "Erro no CONFIG.SYS, linha ","$"
+0016 T 0000 13,10,"Erro de aloca‡Æo de mem¢ria $"
+0017 T 0000 0DH,0AH,7,0DH,0AH, "Stack interno excedido",0DH,0AH
+ "Sistema parado",0DH,0AH,"$"
+0020 T 0000 13,10,"Introduza a disquete na unidade A:"
+0021 T 0000 "e prima depois qualquer tecla",13,10,10,0
+0022 U 0000 13,10,"Comando ou parƒmetros inv lidos - $"
+BOOT 1e5d 0001
+0001 U 0000 13,10,"Disco sem sistema ou erro de disco. "
+ "Substitua e prima depois qualquer tecla",13,10
+DBCSDOS 1edd 0000
+IBMDOS 1ef1 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1f30 0091
+0201 T 0000 "A" ;AC000;
+0202 T 0000 "R" ;AC000;
+0203 T 0000 "I" ;AC000;
+0204 T 0000 "C" ;AC000;
+0205 T 0000 "S" ;AC000;
+0206 T 0000 "N" ;AC000;
+0210 T 0000 "Acabar" ;AC000;
+0211 T 0000 ", Repetir" ;AC000;
+0212 T 0000 ", Ignorar" ;AC000;
+0213 T 0000 ", Continuar" ;AC000;
+0214 T 0000 "?" ;AC000;
+0215 T 0000 "leitura",0 ;AC000;
+0216 T 0000 "grava‡Æo",0 ;AC000;
+0217 T 0000 "%1 na unidade %2",CR,LF ;AC000;
+0218 T 0000 "%1 no dispositivo %2",CR,LF ;AC000;
+0219 U 0000 "Introduza o volume %1 s‚rie %2-%3",CR,LF ;AC009;
+0221 T 0000 "COMMAND.COM inv lido",CR,LF ;AC000;
+0222 T 0000 "Introduza o disco com %1 na unidade %2",CR,LF ;AC000;
+0224 T 0001 CR,LF,"Termino o programa batch (S/N)? " ;AC000;
+0225 T 0000 "%1 nÆo execut vel",CR,LF ;AC000;
+0226 T 0000 "Erro no ficheiro EXE",CR,LF ;AC000;
+0227 T 0000 "Programa grande demais para a mem¢ria",CR,LF ;AC000;
+0228 T 0000 CR,LF,"µrea para tratamento de ficheiros esgotada" ;AC000;
+0229 T 0000 "Comando ou nome de ficheiro inv lido",CR,LF ;AC000;
+0231 T 0000 CR,LF,"Erro de aloca‡Æo de mem¢ria " ;AC000;
+0232 T 0000 CR,LF,"Imposs¡vel carregar o COMMAND, sistema parado",CR,LF;AC000;
+0233 T 0000 CR,LF,"Imposs¡vel iniciar o COMMAND, a sair",CR,LF ;AC000;
+0234 T 0000 CR,LF,"Processo de alto n¡vel acabado, imposs¡vel continuar.",CR,LF;AC000;
+0235 T 0000 CR,LF ;AC000;
+0463 T 0000 "Fora da  rea de trabalho",CR,LF ;AC000;
+0464 T 0000 CR,LF,"The IBM Personal Computer DOS",CR,LF
+ "VersÆo 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF ;AC000;
+0465 T 0000 "COMMAND - pesquisa de direct¢rio indicada inv lida",CR,LF
+0466 T 0000 "COMMAND - pesquisa de direct¢rio indicada negada por acesso inv lido",CR,LF
+1002 T 0000 "Ficheiro duplicado ou ficheiro nÆo encontrado",CR,LF ;AC000;
+1003 T 0000 "Caminho (path) ou nome de ficheiro inv lido",CR,LF ;AC000;
+1007 T 0000 "Fora da  rea de trabalho",CR,LF ;AC000;
+1008 T 0000 "Erro na cria‡Æo do ficheiro",CR,LF ;AC000;
+1009 T 0000 "Ficheiro batch em falta",CR,LF ;AC000;
+1010 T 0000 CR,LF,"Introduza o disco com o ficheiro batch",CR,LF ;AC000;
+1011 T 0000 "Comando ou nome de ficheiro inv lido",CR,LF ;AC000;
+1016 T 0000 "Conte£do do destino perdido antes da c¢pia",CR,LF ;AC000;
+1017 T 0000 "Nome de ficheiro inv lido ou ficheiro nÆo encontrado",CR,LF ;AC000;
+1018 T 0000 "%1 Ficheiro(s) copiado(s)",CR,LF ;AC000;
+1019 T 0000 "%1 Ficheiro(s) " ;AC000;
+1022 T 0000 "Code page %1 nÆo preparado para o sistema",CR,LF ;AC000;
+1023 T 0000 "Code page %1 nÆo preparado para todos os dispositivos",CR,LF ;AC000;
+1024 T 0000 "Code page activo: %1",CR,LF ;AC000;
+1025 U 0000 "NLSFUNC nÆo instalado",CR,LF ;AC000;
+1027 T 0000 "A unidade actual j  nÆo ‚ v lida" ;AC000;
+1029 T 0000 "Legenda nÆo encontrada",CR,LF ;AC000;
+1030 T 0000 "Erro de sintaxe",CR,LF ;AC000;
+1032 T 0000 "A data actual ‚ %1 %2",CR,LF ;AC000;
+1033 T 0000 "DomSegTerQuaQuiSexS b" ;AC000;
+1034 T 0000 "Entre nova data (%1): "
+1036 T 0000 "A hora actual ‚ %1",CR,LF ;AC000;
+1037 T 0000 "Entre nova hora: "
+1038 U 0000 ", Elimino (Y/N)?" ;AC000;
+1039 U 0000 "Todos os ficheiros do direct¢rio serÆo eliminados!",CR,LF
+ "Tem a certeaa (S/N)?" ;AC000;
+1040 T 0000 "IBM Personal Computer DOS VersÆo %1.%2",CR,LF ;AC000;
+1044 T 0000 "Direct¢rio inv lido",CR,LF ;AC000;
+1046 T 0000 "Caminho (path) inv lido, nÆo ‚ direct¢rio",CR,LF,"ou direct¢rio nÆo vazio",CR,LF ;AC000;
+1047 T 0000 "Deve especificar ON ou OFF",CR,LF ;AC000;
+1048 T 0000 "Direct¢rio de %1",CR,LF ;AC000;
+1049 T 0000 "Sem caminho (path)",CR,LF ;AC000;
+1050 T 0000 "Unidade inv lida no caminho (path) de pesquisa",CR,LF ;AC000;
+1051 T 0000 "Dispositivo inv lido",CR,LF ;AC000;
+1052 T 0000 "NÆo pode haver mais do que um FOR numa linha",CR,LF ;AC000;
+1053 T 0000 "Erro no ficheiro interm‚dio",CR,LF ;AC000;
+1054 T 0000 "Leitura em bin rio imposs¡vel",CR,LF ;AC000;
+1055 T 0000 "BREAK est  %1 ",CR,LF ;AC000;
+1056 T 0000 "VERIFY est  %1 ",CR,LF ;AC000;
+1057 T 0000 "ECHO est  %1 ",CR,LF ;AC000;
+1059 T 0000 "off",0 ;AC000;
+1060 T 0000 "on",0 ;AC000;
+1061 T 0000 "Erro de grava‡Æo no dispositivo",CR,LF ;AC000;
+1063 T 0000 "%1" ;AC000;
+1064 T 0000 "%1" ;AC000;
+1065 T 0000 "%1" ;AC000;
+1066 T 0000 "%1" ;AC000;
+1067 T 0000 9 ;AC000;
+1068 T 0000 " <DIR> " ;AC000;
+1069 T 0000 8," ",8 ;AC000;
+1070 T 0000 CR,LF ;AC000;
+1071 T 0000 "%1" ;AC000;
+1072 T 0000 "mm-dd-aa" ;AC000;
+1073 T 0000 "dd-mm-aa" ;AC000;
+1074 T 0000 "aa-mm-dd" ;AC000;
+1075 T 0000 "%1 %2" ;AC000;
+1076 T 0000 "%1" ;AC000;
+1077 T 0001 " %1 %2" ;AC000;
+1078 U 0000 "Direct¢rio j  existente",CR,LF ;AC000;
+ATTRIB 36d6 0016
+0004 T 0000 "N£mero inv lido de parƒmetros",CR,LF
+0005 T 0000 "Caminho (path) inv lido ou ficheiro nÆo encontrado",CR,LF
+0006 T 0000 "Erro de sintaxe",CR,LF
+0008 T 0000 " %1"
+0009 T 0000 "%1 %2",CR,LF
+0010 T 0000 "%1",CR,LF,"%2",CR,LF
+0011 U 0000 "%1, Falta de correspondˆncia entre code pages.",CR,LF,"Tem a certeza (S/N)?"
+0012 T 0000 "%1",CR,LF
+0014 T 0000 CR,LF
+0015 U 0000 "Tipo de ficheiro inv lido",CR,LF
+0199 U 0000 "Erro de atributo expandido",CR,LF
+0201 U 0000 "Nome de atributo expandido nÆo encontrado",CR,LF
+0204 U 0000 "O nome do atributo expandido nÆo pode ser definido",CR,LF
+0205 U 0000 "Nome de atributo conhecido por este sistema de ficheiros mas nÆo suportado",CR,LF
+0206 U 0000 "Falta de correspondˆncia entre o tipo de atributo expandido",CR,LF
+0208 U 0000 "Valor do atributo expandido nÆo suportado",CR,LF
+ASSIGN 3a3b 0001
+0002 U 0000 "Original %1: definido como %2:",cr,lf
+CHKDSK 3a83 0063
+0003 T 0000 "Converto as cadeias perdidas em ficheiros (S/N)? " ;freemes
+0004 T 0000 "Erro irrecuper vel no direct¢rio." ;ptrandir
+0005 T 0000 "Converto direct¢rio em ficheiro (S/N)?" ;ptrandir2
+0007 T 0000 "%1 bytes de espa‡o total em disco" ;dskspc
+0008 T 0000 "%1 bytes em sectores danificados" ;badspc
+0009 T 0000 "%1 bytes em %2 ficheiros fantasma" ;hidmes
+0010 T 0000 "%1 bytes em %2 direct¢rios" ;dirmes
+0011 T 0000 "%1 bytes em %2 ficheiros do utilizador" ;filemes
+0012 T 0000 "%1 bytes em %2 ficheiros recuperados" ;orphmes2
+0013 T 0000 "%1 bytes devem estar em %2 ficheiros recuperados" ;orphmes3
+0014 T 0000 "%1 bytes dispon¡veis no disco" ;frespc
+0015 T 0000 "%1 bytes de mem¢ria total" ;totmem
+0016 T 0000 "%1 bytes livres" ;fremem
+0017 T 0000 "CHKDSK nÆo execut vel numa unidade de Rede" ;no_net_arg
+0018 T 0000 "CHKDSK nÆo execut vel numa unidade depois do SUBST ou do ASSIGN" ;SubStErr
+0019 T 0000 "Disco nÆo de DOS prov vel.",CR,LF,"Continuo (S/N)?" ;badidbyt
+0020 T 0000 "Erro de disco na leitura do FAT %1",CR,LF ;badr
+0021 T 0000 "Direct¢rio %1" ;direc_arg
+0022 T 0000 "%1 cont‚m %2 blocos nÆo seguidos." ;extent_arg
+0023 T 0000 "Todos os ficheiros indicados sÆo cont¡nuos." ;noext_arg
+0024 T 0000 "Erros encontrados, parƒmetro F nÆo indicado.",CR,LF,"As correc‡äes nÆo serÆo escritas no disco." ;fixmes_arg
+0025 T 0000 " O processamento nÆo pode continuar. %1%2" ;fatal_arg
+0026 T 0000 " Tabela de aloca‡Æo de ficheiro inv lida para a unidade %1" ;badrdmes
+0029 T 0000 " CHDIR .. falhado, a tentar um m‚todo alternativo." ;cdddmes
+0030 T 0000 " Cluster inv lido, ficheiro truncado." ;badchain
+0031 T 0000 " Entrada de sub-direct¢rio inv lida." ;badsubdir
+0032 T 0000 " NÆo existe." ;ndotmes
+0033 T 0000 " N£mero do primeiro cluster inv lido, entrada truncada." ;nulnz
+0034 T 0000 " Erro de aloca‡Æo, comprimento ajustado." ;badclus
+0035 T 0000 " Imposs¡vel recuperar a entrada ... o processamento continua." ;norecdot
+0036 T 0000 " Direct¢rio totalmente vazio no . ou no .." ;nuldmes
+0037 T 0000 " Direct¢rio foi junto" ;joinmes
+0038 T 0000 " Imposs¡vel de recuperar a entrada ..." ;norecddot
+0039 T 0000 " Entrada com m  liga‡Æo" ;norecddot1
+0040 T 0000 " Entrada com mau atributo" ;norecddot2
+0041 T 0000 " Entrada com comprimento inv lido" ;norecddot3
+0042 T 0000 " ligado no cluster %1" ;cross_arg
+0043 T 0000 " CHDIR nÆo execut vel para %1,",CR,LF," TREE nÆo ser  processado a partir deste ponto." ;badtarg_ptr
+0044 T 0000 " TREE nÆo ser  processado a partir deste ponto." ;badtarg2
+0045 T 0000 "%1 bytes de espa‡o libertados." ;freebymes1
+0046 T 0000 "%1 bytes de espa‡o seriam libertados." ;freebymes2
+0047 T 0000 "Volume %1 criado em %2 %3",CR,LF ;idmes_arg
+0048 U 0000 "%1 de espa‡o alocado em unidades do disco"
+0049 U 0000 "%1 bytes em cada unidade alocada" ;idmes2
+0050 U 0000 "CHKDSK nÆo dispon¡vel na unidade %1" ;msgExecFailure
+0051 U 0000 " Atributos Expandidos com clusters inv lidos, atributos truncados" ;Inv_XA_Msg
+0052 U 0000 " Erro na aloca‡Æo de atributos expandidos, atributos truncados" ;Alloc_XA_Msg
+0053 T 0000 "Parƒmetro inv lido" ;badsw_arg
+0055 T 0000 "Caminho (path) nÆo encontrado." ;invpath_arg
+0056 T 0000 "Ficheiro nÆo encontrado." ;opnerr_arg
+0058 T 0000 " %1 clusters perdidos em %2 cadeias." ;orph_arg
+0059 T 0000 CR,LF ;crlf_arg
+0060 T 0000 " CHDIR nÆo execut vel no direct¢rio raiz",CR,LF ;badcd_arg
+0061 T 0000 " Erro de disco na grava‡Æo do FAT %1" ;badw_arg
+0062 T 0000 " %1" ;noisy_arg
+0063 T 0000 "Direct¢rio corrente inv lido" ;baddpbdir
+0064 T 0000 "%1",CR,LF ;file_arg
+0065 U 0000 " Espa‡o insuficiente no direct¢rio raiz",CR,LF," Retire ficheiros e repita a execu‡Æo do CHKDSK" ;creatmes
+0066 T 0000 "%1 %2 %3" ;eup_arg
+0067 T 0000 "%1 %2, %3" ;usp_arg
+0068 T 0000 "%1%2%3%4%5" ;oth_arg
+0069 T 0000 "%1%2%3%4" ;time_arg
+0070 U 0000 "%1 unidades de aloca‡Æo dispon¡veis no disco" ;idmes2
+DEBUG 4e1f 0062
+0004 U 0000 "Aloca‡Æo falhada ou buffer indicado insuficiente",CR,LF
+0005 U 0000 "Msg em falta ou inv lida",CR,LF
+0006 T 0000 "Nome de dispositivo inv lido" ;baddev_ptr
+0007 T 0000 "O dispositivo PRN nÆo pode ser aberto.",CR,LF
+ "Entre o nome do dispositivo de listagem? " ;badlstmes_ptr
+0008 T 0000 CR,LF ;crlf_ptr
+0009 T 0000 CR,LF,"Programa terminado normalmente",CR,LF
+0010 T 0000 "Unidade indicada inv lida" ;nambad_ptr
+0012 T 0000 "Erro na cria‡Æo do ficheiro" ;noroom_ptr
+0013 T 0000 "Espa‡o insuficiente em disco" ;nospace_ptr
+0014 U 0000 "Erro de leitura na unidade %1" ;dr1_ptr
+0015 U 0000 "Erro de grava‡Æo na unidade %1" ;dr2_ptr
+0016 U 0000 "Erro de protec‡Æo contra grava‡Æo durante a leitura da unidade %1" ;dr3_ptr
+0017 U 0000 "Erro de protec‡Æo contra grava‡Æo durante a grava‡Æo na unidade %1" ;dr4_ptr
+0019 T 0000 "%1^ Erro" ;synerr
+0020 T 0000 "Erro no ficheiro EXE ou HEX" ;exebad_ptr/hexerr_ptr
+0021 T 0000 "Os ficheiros EXE e HEX nÆo podem ser gravados" ;exewrt_ptr/hexwrt_ptr
+0022 T 0000 "Falha de EXEC" ;execemes_ptr
+0023 T 0000 "Erro de grava‡Æo, destino nÆo especificado" ;nonamespec_ptr
+0024 T 0000 "Acesso negado" ;accmes_ptr
+0025 T 0000 "Erro de paridade ou erro de mem¢ria inexistente" ;paritymes_ptr
+0026 T 0000 "-" ;prompt_ptr
+0027 T 0000 "%1 -" ;change_flag_ptr
+0032 T 0000 "%1%2" ;unassem_ln_ptr
+0033 T 0000 "%1:%2 %3" ;hex_ptr
+0034 T 0000 "%1 %2" ;add_ptr
+0035 T 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0000 "%1=%2 " ;register_ptr
+0037 T 0000 "Erro %1" ;errmes_ptr
+0038 T 0000 "Gravar %1 bytes" ;wrtmes_ptr
+0039 T 0000 "%1:%2=" ;loc_ptr
+0040 T 0000 "%1" ;little_ptr
+0041 T 0000 "%1" ;big_ptr
+0042 T 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "Erro de %1 no %2 da unidade %3" ;dskerr_ptr
+0044 T 0000 32,8 ;bacmes_ptr
+0045 U 0000 "Imposs¡vel alocar o gestor de mensagens",CR,LF ;fatal_error
+0046 T 0000 "%1" ;arg_buf_ptr
+0047 T 0000 "%1" ;one_char_buf_ptr
+0050 U 0000 "Foram alocadas %1 de um total de %2 p ginas EMS",cr,lf
+0051 U 0000 "Foram alocados %1 de um total de %2 tratamentos",cr,lf
+0054 U 0000 "Estrutura de p gina = "
+0055 U 0000 "Tratamentos criados = %1 ",cr,lf
+0056 U 0000 "P gina l¢gica %1 transformada na p gina f¡sica %2 ",cr,lf
+0057 U 0000 "Falha no hardware/software EMS",cr,lf
+0058 U 0000 "Tratamento nÆo encontrado",cr,lf
+0059 U 0000 "C¢digo de fun‡Æo inv lido",cr,lf
+0060 U 0000 "NÆo existem tratamentos dispon¡veis",cr,lf
+0061 U 0000 "Erro de Save/Restore",cr,lf
+0062 U 0000 "Total de p ginas excedido",cr,lf
+0063 U 0000 "P ginas livres excedidas",cr,lf
+0064 U 0000 "Erro no parƒmetro",cr,lf
+0065 U 0000 "P gina L¢gica fora dos limites",cr,lf
+0066 U 0000 "P gina F¡sica fora dos limites",cr,lf
+0067 U 0000 "A  rea de grava‡Æo j  est  a ser utilizada",cr,lf
+0068 U 0000 "A  rea de grava‡Æo nÆo est  a ser utilizada",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 U 0000 "Parƒmetro EMS em falta ou inv lido",cr,lf
+0072 U 0000 "O tratamento %1 tem %2 p ginas alocadas",cr,lf
+0074 U 0000 "Reposi‡Æo do EMS conclu¡da com sucesso",cr,lf
+0075 U 0000 "P gina f¡sica %1 = Segmento de estrutura %2",cr,lf
+0076 U 0000 "Tratamento %1 desalocado",cr,lf
+0078 U 0000 "EMS nÆo instalado",cr,lf
+DRIVER 5d67 0002
+0002 T 0001 "Nenhuma unidade especificada",CR,LF
+0003 T 0001 "Carregar o Driver de Unidade Externa para a Unidade %1",CR,LF
+EDLIN 5df9 0028
+0006 T 0000 "*" ;prompt_ptr
+0007 T 0000 "Unidade ou nome de ficheiro inv lido",CR,LF ;baddrv_ptr
+0008 T 0000 "O nome do ficheiro tem de ser indicado",CR,LF ;ndname_ptr
+0009 T 0000 "Parƒmetro inv lido",CR,LF ;opt_err_ptr
+0010 T 0000 "Ficheiro s¢ de LEITURA",CR,LF ;ro_err_ptr
+0011 T 0000 "Erro na cria‡Æo do ficheiro",CR,LF ;bcreat_ptr
+0012 T 0000 "Excesso de ficheiros abertos",CR,LF ;too_many_ptr
+0013 T 0000 "Erro de leitura em:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0000 "Edi‡Æo de ficheiros .BAK nÆo execut vel--mude o nome",CR,LF ;nobak_ptr
+0015 T 0000 "Sem espa‡o no direct¢rio para o ficheiro",CR,LF ;nodir_ptr
+0016 T 0000 "Disco cheio. Edi‡äes perdidas.",CR,LF ;dskful_ptr
+0017 T 0000 "Ficheiro nÆo encontrado",CR,LF ;filenm_ptr
+0018 T 0000 "Entrada em erro",CR,LF ;badcom_ptr
+0019 T 0000 "Ficheiro novo",CR,LF ;newfil_ptr
+0020 T 0000 "NÆo encontrado",CR,LF ;nosuch_ptr
+0021 T 0000 "O.K.? " ;ask_ptr
+0022 T 0000 "Linha muito longa",CR,LF ;toolng_ptr
+0023 T 0000 "Fim do ficheiro de input",CR,LF ;eof_ptr
+0024 T 0000 "Aborto a edi‡Æo (S/N)? " ;qmes_ptr
+0025 T 0000 "Deve indicar o n£mero da linha destino",CR,LF ;dest_ptr
+0026 T 0000 "Espa‡o insuficiente para intercalar todo o ficheiro",CR,LF ;mrgerr_ptr
+0027 T 0000 CR,LF ;crlf_ptr
+0028 T 0000 LF ;lf_ptr
+0029 U 0000 "Continuo (S/N)?" ;cont_ptr
+0030 U 0000 "Imposs¡vel imprimir a mensagem",CR,LF ;fatal_error
+0031 T 0000 "%1" ;arg_buf_ptr
+0032 T 0000 "%1:%2" ;line_num_buf_ptr
+0033 U 0000 "Conjuga‡Æo imposs¡vel - Falta de correspondˆncia entre code pages",CR,LF ;cp_err_ptr
+EXE2BIN 65b2 0010
+0002 T 0000 "Mem¢ria insuficiente",CR,LF
+0003 U 0000 "Imposs¡vel encontrar mensagens",CR,LF
+0004 T 0000 "Acesso negado",CR,LF
+0005 U 0000 "O ficheiro nÆo pode ser convertido",CR,LF
+0006 T 0000 "Ficheiro nÆo encontrado.",CR,LF
+0007 T 0000 "Erro na cria‡Æo do ficheiro",CR,LF
+0008 U 0000 "Correc‡äes necess rias - segmento de base (hex):"
+0009 T 0000 "Parƒmetro inv lido",CR,LF
+0011 U 0000 "ATENۂO - Erro de leitura no ficheiro EXE.",CR,LF
+ "A quantidade lida ‚ menor do que o comprimento no cabe‡alho.",CR,LF
+0012 T 0000 "O nome do ficheiro tem de ser indicado",CR,LF
+FIND 6809 0001
+0004 T 0000 "FIND: "
+FORMAT 6833 0044
+0002 U 0000 CR,"%1 por cento do disco formatado"
+0004 T 0000 CR,"Formata‡Æo terminada ",CR,LF
+0007 T 0000 "Introduza a disquete nova na unidade %1:",CR,LF
+0009 T 0000 "Reintroduza a disquete na unidade %1:",CR,LF
+0010 T 0000 "Identifica‡Æo do volume (11 caracteres)? "
+0011 T 0000 CR,"Formata‡Æo nÆo suportada na unidade %1:", CR,LF
+0012 T 0000 CR,"Parƒmetros inv lidos no driver da unidade",CR,LF
+0013 T 0000 CR,"Erro na chamada do IOCTL ",CR,LF
+0014 T 0000 CR,"Unidade sem blocos ",CR,LF
+0015 T 0000 CR,"Erro a gravar o FAT ",CR,LF
+0016 T 0000 CR,"Erro a gravar o direct¢rio",CR,LF
+0017 T 0000 CR,"Imposs¡vel formatar uma unidade depois do ASSIGN ou do SUBST. ",CR,LF
+0018 T 0000 CR,"Ficheiros de Sistema nÆo encontrados",CR,LF
+0019 T 0000 CR,"FORMATA€ÇO nÆo execut vel numa unidade de Rede",CR,LF
+0020 T 0000 CR,"Caracteres inv lidos na identifica‡Æo da unidade ",CR,LF
+0021 T 0000 CR,"Parƒmetros nÆo suportados",CR,LF
+0022 U 0000 CR,"Formata‡Æo terminada ",CR,LF
+0023 T 0000 CR,"Disco inutiliz vel como disco de sistema",CR,LF
+0024 T 0000 CR,"M‚dia ou Pista 0 inv lida - disco inutiliz vel",CR,LF
+0025 T 0000 CR,"Imposs¡vel gravar o BOOT ",CR,LF
+0026 T 0000 CR,"Erro de leitura no direct¢rio",CR,LF
+0028 U 0000 CR,"e prima depois ENTER..."
+0029 T 0000 CR,"Identifica‡Æo de volume inv lida ",CR,LF
+0031 T 0000 CR,"Entre a Identifica‡Æo do Volume da unidade %1: "
+0032 T 0000 CR,"Parƒmetros nÆo compat¡veis",CR,LF,"com o disco fixo",CR,LF
+0035 T 0000 CR,"Erro de leitura da tabela da parti‡Æo",CR,LF
+0037 T 0000 CR,"Formata‡Æo Interrompida",CR,LF
+0038 U 0000 CR,"Formata‡Æo nÆo dispon¡vel na unidade %1",CR,LF
+0039 T 0000 CR,"Disco sem sistema ou erro de disco",CR,LF
+0040 T 0000 CR,"Tabela de parti‡Æo inv lida",CR,LF
+0041 T 0000 CR,"Parƒmetros nÆo suportados pela Unidade",CR,LF
+0042 T 0000 CR,LF
+0043 T 0000 CR,LF,LF
+0044 T 0000 CR,"Introduza a disquete de DOS na unidade %1:",CR,LF
+0045 T 0000 CR,LF,"ATENۂO, TODOS OS DADOS DO DISCO FIXO",CR,LF
+ "NA UNIDADE %1: SERÇO PERDIDOS!",CR,LF
+ "Continuo com a formata‡Æo (S/N)?"
+0046 T 0000 CR,"Formatar outro (S/N)?"
+0047 T 0000 CR,"Erro de leitura da tabela da parti‡Æo",CR,LF
+0048 T 0000 CR,"Erro de grava‡Æo na tabela da parti‡Æo",CR,LF
+0049 T 0000 CR,"Parƒmetros nÆo compat¡veis", CR,LF
+0050 U 0000 "%1 unidades de aloca‡Æo dispon¡veis no disco",CR,LF
+0051 U 0000 "%1 bytes em cada unidade de aloca‡Æo",CR,LF
+0052 T 0000 CR,"Erro de grava‡Æo na tabela da parti‡Æo",CR,LF
+0053 U 0000 CR,"O mesmo parƒmetro entrou duas vezes",CR,LF
+0054 U 0000 CR,"Deve entrar os parƒmetros /T e /N",CR,LF ;AN009;
+JOIN 72f4 0001
+0002 T 0000 CR,LF,"Direct¢rio nÆo vazio",CR,LF
+MORE 7338 0001
+0002 T 0000 "-- More --"
+PRINT 7366 0022
+0002 T 0000 CR,LF
+0006 T 0000 " Erro na leitura do ficheiro.",CR,LF,"$"
+0007 T 0000 "Ficheiro nÆo encontrado",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Ficheiro $"
+0009 T 0000 " cancelado pelo operador$"
+0010 T 0000 CR,LF,LF,"Todos os ficheiros cancelados pelo operador$"
+0011 T 0000 "Tabela de aloca‡Æo de ficheiro inv lida para a unidade "
+0012 T 0000 "A.",CR,LF,"$"
+0013 T 0000 "Lista de output nÆo assignada a um dispositivo",CR,LF
+0014 T 0000 "Parte residente de PRINT instalada",CR,LF
+0015 T 0000 "PRINT nÆo execut vel - Use NET PRINT",CR,LF
+0017 T 0000 "Fila de PRINT cheia",CR,LF
+0018 T 0000 "Fila de PRINT vazia",CR,LF
+0019 T 0000 "Acesso negado",CR,LF
+0020 T 0000 "Unidade indicada inv lida",CR,LF
+0021 T 0000 "Os erros no dispositivo de listagem indicam que",CR,LF
+ "possa estar desligado. Verifique, por favor.",CR,LF
+0022 T 0000 CR,LF,LF," %1 est  a ser impresso",CR,LF
+0023 T 0000 " %1 est  na fila",CR,LF
+0024 T 0000 "%1 Ficheiro nÆo encontrado",CR,LF
+0025 T 0001 "Nome de caminho (path) muito longo",CR,LF
+0026 T 0001 "O ficheiro nÆo est  na fila de PRINT",CR,LF
+0027 T 0000 "Nome do dispositivo de listagem [PRN]: "
+RECOVER 77f6 0012
+0002 T 0000 CR,LF,"Ficheiro nÆo encontrado",CR,LF ;File not found
+0003 U 0000 CR,LF,"Imposs¡vel executar o RECOVER numa unidade depois de um ASSIGN ou SUBST",CR,LF
+0004 T 0000 CR,LF,"Unidade ou nome de ficheiro inv lido",CR,LF
+0005 T 0000 CR,LF,"Aten‡Æo - direct¢rio cheio",CR,LF
+0006 T 0000 CR,LF,"Imposs¡vel executar o RECOVER numa unidade de Rede", CR,LF ;Cannot %1 a Network drive
+0007 U 0000 CR,LF,"Recupera‡Æo nÆo dispon¡vel na unidade %1",CR,LF
+0008 T 0000 CR,LF,"%1 ficheiro(s) recuperados",CR,LF
+0009 T 0000 CR,LF,"%1 bytes de %2 recuperados",CR,LF
+0010 T 0000 CR,LF,"Prima qualquer tecla para come‡ar a recuperar",CR,LF,"o(s) ficheiro(s) da unidade %1",CR,LF,CR,LF ;AN000;bgb
+0011 U 0000 CR,LF,"Imposs¡vel ler a tabela de aloca‡Æo de ficheiros",CR,LF
+0012 U 0000 CR,LF,"Imposs¡vel gravar na tabela de aloca‡Æo de ficheiros",CR,LF
+0013 T 0000 CR,LF
+SORT 7b7e 0001
+0005 T 0000 "SORT: "
+SUBST 7ba8 0001
+0002 T 0000 CR,LF,"N£mero incorrecto de parƒmetros",CR,LF
+SYS 7bf7 0008
+0004 T 0000 "Unidade indicada inv lida",CR,LF ; Old
+0007 T 0000 "NÆo h  espa‡o para o sistema no disco destino",CR,LF ; Old
+0008 T 0000 "Comprimento do sistema incompat¡vel",CR,LF ; Old
+0010 T 0000 "Unidade assumida sem sistema",CR,LF ; Old
+0011 U 0000 "Imposs¡vel indicar a unidade assumida.",CR,LF ; New
+0012 U 0000 "Falha de grava‡Æo, disquete inutilizada",CR,LF ; New
+0014 T 0000 "Introduza o disco de sistema na unidade %1",CR,LF ; Old
+0016 U 0000 "Execu‡Æo do SYS imposs¡vel no sistema de ficheiros %1",CR,LF ; New
+SHARE 7e97 0000
+NLSFUNC 7eab 0000
+ANSI 7ebf 0001
+0010 T 0000 "Parƒmetro inv lido - %1",CR,LF ; 'Invalid parameter'
+IFSFUNC 7f18 0001
+0004 U 0000 "Unidades IFS nÆo encontradas",CR,LF
+PSPRINT 7f5e 0007
+0002 T 0000 " Erro na leitura do ficheiro.",CR,LF,FORMFD,BELL,"$"
+0003 T 0000 CR,LF,LF,"Ficheiro cancelado pelo operador",CR,FORMFD,BELL
+0004 T 0000 "Tabela de aloca‡Æo de ficheiro inv lida para a unidade "
+0005 T 0000 "A.",CR,LF,"$"
+0006 T 0000 "Lista de output nÆo assignada a um dispositivo",CR,LF
+0007 T 0000 "PSPRINT j  instalado",CR,LF
+0008 T 0000 "Conflito PSPRINT/PRINT",CR,LF
+BACKUP 80fa 0022
+0002 T 0000 CR,LF,"Mem¢ria insuficiente",CR,LF
+0006 T 0000 CR,LF,"Unidade indicada inv lida",CR,LF
+0014 T 0000 CR,LF,"As unidades origem e destino sÆo a mesma",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Erro na abertura do ficheiro de registo",CR,LF
+0018 T 0000 CR,LF,"Registar para o ficheiro %1",CR,LF
+0019 T 0000 CR,LF,"O disco da £ltima c¢pia nÆo foi introduzido",CR,LF
+0020 T 0000 CR,LF,"Aten‡Æo! Os ficheiros no direct¢rio raiz",CR,LF
+ "da unidade destino %1:\ serÆo apagados.",CR,LF
+0021 T 0000 CR,LF,"Aten‡Æo! Os ficheiros no direct¢rio %1:\BACKUP",CR,LF
+ "do disco destino serÆo apagados",CR,LF
+0022 T 0000 CR,LF,"*** A copiar os ficheiros para a unidade %1: ***",CR,LF
+0023 T 0000 "Disquete N£mero: %1",CR,LF
+0024 T 0000 CR,LF,"Aten‡Æo! NÆo foram encontrados ficheiros para copiar",CR,LF
+0025 T 0000 CR,LF,"Introduza a disquete origem na unidade %1:",CR,LF
+0026 T 0000 CR,LF,"Introduza a disquete %1 na unidade %2:",CR,LF
+0027 T 0000 CR,LF,"*** Imposs¡vel copiar o ficheiro ***",CR,LF
+0028 T 0000 CR,LF,"Introduza a £ltima disquete na unidade %1:",CR,LF
+0029 T 0000 CR,LF,"O destino nÆo pode ser usado pelo Backup",CR,LF
+0030 T 0000 CR,LF,"*** éltimo ficheiro nÆo copiado ***",CR,LF
+0031 T 0000 CR,LF,"Unidade fixa de backup %1: cheia",CR,LF
+0032 T 0000 CR,LF,"Erro - disco cheio para o ficheiro de registo do BACKUP",CR,LF
+0034 T 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 86cc 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 8706 0013
+0004 T 0000 "10 correspondˆncias erradas - compara‡Æo terminada",CR,LF
+0006 T 0000 "Erro de compara‡Æo no OFFSET %1",CR,LF
+0007 T 0000 "Ficheiro 1 = %1",CR,LF
+0008 T 0000 "Ficheiro 2 = %1",CR,LF
+0009 T 0000 "Marca EOF nÆo encontrada",CR,LF
+0010 T 0000 "Compara‡Æo de ficheiros ok",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Entre o nome do primeiro ficheiro",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Entre o nome do segundo ficheiro ou a unidade",CR,LF
+0017 T 0000 "Os ficheiros tˆm comprimentos diferentes",CR,LF
+0018 T 0000 "Comparar mais ficheiros (S/N) ?"
+0019 T 0000 "%1 e %2",CR,LF
+0020 T 0000 CR,LF
+0023 T 0000 "Compara‡Æo de ficheiros ok",CR,LF
+DISKCOMP 899e 0016
+0004 T 0000 "NÆo especifique nome(s) de ficheiro(s)",CR,LF
+ "Formato do comando: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0000 CR,LF,"Unidade indicada inv lida",CR,LF
+ "Unidade indicada nÆo existente,",CR,LF
+ "ou nÆo remov¡vel",CR,LF
+0006 T 0000 CR,LF,"DISKCOMP nÆo execut vel numa",CR,LF
+ "unidade de Rede",CR,LF
+0007 T 0000 CR,LF,"Introduza a PRIMEIRA disquete na unidade %1:",CR,LF
+0008 T 0000 CR,LF,"Introduza a SEGUNDA disquete na unidade %1:",CR,LF
+0009 T 0000 CR,LF,"PRIMEIRA disquete inv lida ou incompat¡vel",CR,LF
+0010 T 0000 CR,LF,"SEGUNDA disquete inv lida ou incompat¡vel",CR,LF
+0014 T 0000 CR,LF,"Comparar outra disquete (S/N) ?"
+0015 T 0000 CR,LF,"A comparar %1 pistas,",CR,LF
+ "%2 sectores por pista, %3 lado(s)",CR,LF
+0016 T 0000 CR,LF,"Tipos de unidades ou de disquetes",CR,LF
+ "nÆo compat¡veis",CR,LF
+0017 T 0000 CR,LF,"Erro irrecuper vel de leitura na unidade %2",CR,LF
+ "lado %3, pista %4",CR,LF
+0018 T 0000 CR,LF,"Erro de compara‡ao no",CR,LF,"lado %3, pista %4",CR,LF
+0019 T 0000 "Verifique se a disquete est  introduzida na",CR,LF ;AN004;
+ "unidade e se a porta est  fechada",CR,LF ;AN004;
+0020 T 0000 CR,LF,"Compara‡Æo terminada",CR,LF
+0021 T 0000 CR,LF,"Compara‡Æo OK",CR,LF
+0022 T 0000 CR,LF
+DISKCOPY 8eb1 0018
+0002 T 0000 CR,LF
+0004 T 0000 "NÆo especifique nome(s) de ficheiro(s)",CR,LF
+ "Formato do comando: DISKCOPY d: d: [/1]",CR,LF
+0005 T 0000 CR,LF,"Unidade indicada inv lida",CR,LF
+ "Unidade indicada nÆo existente,",CR,LF
+ "ou nÆo remov¡vel",CR,LF
+0006 T 0000 CR,LF,"DISKCOPY nÆo execut vel numa",CR,LF
+ "unidade de Rede",CR,LF
+0007 T 0000 CR,LF,"A formatar durante a c¢pia",CR,LF
+0008 T 0000 CR,LF,"Introduza a disquete ORIGEM na unidade %1:",CR,LF
+0009 T 0000 CR,LF,"Introduza a disquete DESTINO na unidade %1:",CR,LF
+0010 T 0000 "Verifique se a disquete est  introduzida na",CR,LF ;AN004;
+ "unidade e se a porta est  fechada",CR,LF ;AN004;
+0011 T 0000 CR,LF,"A disquete destino pode estar inutiliz vel",CR,LF
+0012 T 0000 CR,LF,"Disquete destino inutiliz vel",CR,LF
+0016 T 0000 CR,LF,"Copiar outra disquete (S/N)?"
+0017 T 0000 CR,LF,"A copiar %1 pistas",CR,LF
+ "%2 sectores/pista, %3 lado(s)",CR,LF
+0018 T 0000 CR,LF,"Tipos de unidade ou de disquetes",CR,LF
+ "nÆo compat¡veis",CR,LF
+0019 U 0000 CR,LF,"Erro de leitura irrecuper vel na unidade %1",CR,LF
+ "Lado %2, pista %3",CR,LF
+0020 U 0000 CR,LF,"Erro de grava‡Æo irrecuper vel na unidade %1",CR,LF
+ "Lado %2, pista %3",CR,LF
+0021 T 0000 CR,LF,"C¢pia terminada",CR,LF
+0022 T 0000 CR,LF,"Disquete ORIGEM inv lida ou incompat¡vel"
+0023 T 0000 CR,LF,"Disquete DESTINO inv lida ou incompat¡vel"
+LABL 9447 0000
+MODE 945b 0055
+0003 T 0000 CR,LF,"Deve indicar COM1, COM2, COM3 ou COM4",CR,LF
+0004 T 0000 CR,LF,"Parte residente do MODE carregada",CR,LF
+0005 T 0000 CR,LF,"Nome de dispositivo ilegal",CR,LF
+0006 T 0000 CR,LF,"Erro de impressora",CR,LF
+0007 T 0000 CR,LF,"LPT%1: definida para 80",CR,LF
+0008 T 0000 CR,LF,"LPT%1: definida para 132",CR,LF
+0009 T 0000 CR,LF,"Defini‡Æo de linhas por polegada",CR,LF
+0010 T 0000 CR,LF,"Velocidade de transmissÆo indicada inv lida",CR,LF
+0011 T 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0000 "0123456789"
+0013 U 0001 CR,LF,"Vˆ o %1? (S/N) "
+0014 T 0000 CR,LF,"Parƒmetros inv lidos",CR,LF
+0015 T 0001 "LPT%1: desviado para COM%2:",CR,LF
+0016 T 0001 "LPT%1: nÆo desviado",CR,LF
+0017 T 0000 CR,LF,"Repeti‡Æo %1 na impressora paralela - tempo excedido",CR,LF
+0018 T 0000 CR,LF," Imposs¡vel partir o ‚cran para a %1",CR,LF
+0020 T 0000 CR,LF,'N£mero inv lido de parƒmetros',CR,LF
+0021 T 0000 CR,LF,'NET 042: Comando pedido nÆo execut vel',CR,LF
+0022 T 0000 CR,LF,'Repeti‡Æo infinita nÆo suportada por uma impressora de Rede',cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 T 0000 CR,LF,"Falha no acesso ao dispositivo: %1",CR,LF
+0025 T 0000 CR,LF,"Dispositivo ou code page em falta no ficheiro fonte",CR,LF
+0026 T 0000 CR,LF,"Conte£do do ficheiro fonte inv lido",CR,LF
+0027 T 0000 CR,LF,"Code page anterior substitu¡do",CR,LF
+0028 T 0000 CR,LF,"O code page activo para o dispositivo %1 ‚ %2",CR,LF
+0029 T 0000 CR,LF,"Dispositivo %1 nÆo preparado",CR,LF
+0030 T 0000 "Code page %1:",CR,LF
+0031 T 0000 " Code page %1:",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0000 CR,LF,"MODE Fun‡Æo %1 code page terminada",CR,LF
+0033 T 0000 CR,LF,"Erro %1 code page Global",CR,LF ;FILLED IN with "definir" or "obter"
+0034 T 0000 CR,LF,"Defini‡Æo corrente de code page:",CR,LF ;table header
+0035 T 0000 " %1 - code page %2",CR,LF
+0036 T 0000 " Code page nÆo preparado",CR,LF
+0037 T 0000 "Opera‡Æo de code page nÆo suportada neste dispositivo",CR,LF
+0038 T 0000 "NÆo foi SELECCIONADO nenhum code page",CR,LF
+0039 T 0000 "Erro de dispositivo durante a Fun‡Æo %1",CR,LF
+0040 T 0000 "Code page nÆo preparado",CR,LF
+0041 T 0000 CR,LF,"Este teclado nÆo suporta este code page",CR,LF
+0042 T 0000 CR,LF,"Erro durante a leitura do ficheiro fonte",CR,LF
+0043 T 0000 CR,LF,"Imposs¡vel executar a fun‡Æo ACTUALIZAR",CR,LF
+0044 T 0000 CR,LF ;used for formatting
+0045 U 0000 CR,LF,"Estado do dispositivo %1:",CR,LF ;header for status reports
+0046 T 0000 "------------------" ;first part of underline under "Estado do dispositivo %1:"
+0047 T 0000 "----",CR,LF ;four_char_underline
+0048 T 0000 "-----",CR,LF ;five_char_underline
+0049 U 0000 "LINHAS=%1",CR,LF
+0050 U 0000 "COLUNAS=%1",CR,LF
+0051 U 0000 CR,LF,"RATE e DELAY devem ser indicados em conjunto",CR,LF
+0052 U 0000 "RATE=%1",CR,LF
+0053 U 0000 "DELAY=%1",CR,LF
+0054 U 0000 CR,LF,"Fun‡Æo nÆo suportada neste neste computador - %1",CR,LF
+0055 U 0000 CR,LF,"Fonte pedida nÆo carregada",CR,LF
+0056 U 0000 CR,LF,"ANSI.SYS deve ser instalado para executar a fun‡Æo pedida",CR,LF
+0057 U 0000 CR,LF,"Velocidade de transmissÆo necess ria",CR,LF
+0058 U 0000 "RETRY=%1",CR,LF
+RESTORE a15e 0022
+0002 T 0000 CR,LF,"As unidades origem e destino sÆo a mesma",CR,LF
+0003 T 0000 CR,LF,"N£mero inv lido de parƒmetros",CR,LF
+0006 T 0000 CR,LF,"Unidade indicada inv lida",CR,LF
+0007 T 0000 CR,LF,"Aten‡Æo! NÆo foram encontrados ficheiros para repor",CR,LF
+0008 T 0000 CR,LF,"Introduza a disquete de backup %1 na unidade %2:",CR,LF
+0009 U 0000 CR,LF,"Introduza o destino para reposi‡Æo na unidade %1:",CR,LF
+0011 T 0000 CR,LF,"Aten‡Æo! Disquete fora de sequˆncia",CR,LF
+ "Substitua a disquete ou continue",CR,LF
+0012 T 0000 CR,LF,"O £ltimo ficheiro nÆo foi reposto",CR,LF
+0013 T 0000 CR,LF,"*** Ficheiros copiados em %1 *** ",CR,LF
+0014 T 0000 CR,LF,"A origem nÆo cont‚m ficheiros de backup",CR,LF
+0015 T 0000 CR,LF,"Mem¢ria insuficiente",CR,LF
+0016 T 0000 CR,LF,"Aten‡Æo! O ficheiro %1",CR,LF
+ "‚ s¢ de leitura",CR,LF
+ "Substituo o ficheiro (S/N)? ",CR,LF
+0017 T 0000 CR,LF,"Erro na sequˆncia de ficheiros",CR,LF
+0018 T 0000 CR,LF,"Erro na cria‡Æo do ficheiro",CR,LF
+0019 T 0000 CR,LF,"Espa‡o insuficiente em disco",CR,LF
+0020 T 0000 CR,LF,"*** Inposs¡vel repor o ficheiro ***",CR,LF
+0021 T 0000 CR,LF,"*** Repor ficheiros da unidade %1: ***",CR,LF
+0022 T 0000 CR,LF,"Aten‡Æo! O ficheiro %1",CR,LF
+ "foi alterado depois da £ltima c¢pia",CR,LF
+ "Substituo o ficheiro (S/N)? ",CR,LF
+0023 T 0000 "Disquete: %1",CR,LF
+0024 U 0000 CR,LF,"Bizzare error, call Russ Whitehead @ 8-3863",CR,LF
+0025 T 0000 07 ;For BEEP !
+0026 U 0000 CR,LF,"Erro durante a reposi‡Æo de atributos expandidos",CR,LF
+SELECT a761 0016
+0004 U 0000 "Suporte de carregamento do SELECT inv lido",CR,LF,CR,LF
+ "Introduza a disquete do INSTALL na unidade A: e tente de novo"
+0005 U 0000 "Suporte de Disco/Disquete inv lido",CR,LF,CR,LF
+ "Introduza a disquete do INSTALL na unidade A: e tente de novo"
+0006 U 0000 "Parƒmetros Inv lidos na Linha de Comandos do SELECT",CR,LF,CR,LF
+ "Assegure-se de que a disquete do INSTALL est  na unidade A:.",CR,LF
+ "Prima entÆo Ctrl+Alt+Del para reiniciar."
+0007 U 0000 BELL,"Imposs¡vel instalar o DOS. Programa terminado.",CR,LF
+0008 U 0000 "A carregar o SELECT. Aguarde, por favor..."
+0009 U 0000 "Deve reiniciar o seu computador para continuar.",CR,LF,CR,LF
+ "Prima Ctrl+Alt+Del para continuar com a instala‡Æo do DOS."
+0010 U 0000 "Introduza a disquete do SELECT na unidade A:",CR,LF,CR,LF
+ "Prima Enter para continuar a instalar o DOS,",CR,LF
+ "ou prima Esc para sair.",CR,LF
+0011 U 0000 BELL
+0012 U 0000 "Introduza a disquete do SELECT na unidade A:",CR,LF,CR,LF
+ "Prims Enter para continuar",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE af04 0004
+0002 T 0000 "LISTA DE DIRECTàRIOS PARA O VOLUME %1",CR,LF ;define message ;AN000;
+0003 T 0000 "LISTA DE DIRECTàRIOS ",CR,LF ; ;AN000;
+0004 T 0000 "NÆo existem sub-direct¢rios",CR,LF,LF ; ;AN000;
+0007 T 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE b06f 0009
+0003 T 0000 CR,LF,"NÆo foram substitu¡dos ficheiros",CR,LF
+0004 T 0000 CR,LF,"NÆo foram adicionados ficheiros",CR,LF
+0013 T 0000 CR,LF,"A substituir %1",CR,LF
+0014 T 0000 CR,LF,"A adicionar %1",CR,LF
+0015 T 0000 CR,LF,"%1 ficheiro(s) substituido(s)",CR,LF
+0016 T 0000 CR,LF,"%1 ficheiro(s) adicionado(s)",CR,LF
+0017 T 0000 CR,LF,"NÆo foram encontrados ficheiros %1",CR,LF
+0022 T 0000 CR,LF,"Substituo %1? (S/N) "
+0023 T 0000 CR,LF,"Adiciono %1? (S/N) "
+XCOPY b252 0019
+0004 T 0000 "%1 indica um nome de ficheiro",CR,LF ;AN000;
+ "ou direct¢rio no destino",CR,LF
+ "(F = ficheiro, D = direct¢rio)? "
+0005 T 0000 "Prima qualquer tecla para iniciar a c¢pia do(s) ficheiro(s)" ;AN000;
+0006 T 0000 "Caminho (path) muito longo",CR,LF ;AN000;
+0008 T 0000 "C¢pia c¡clica nÆo execut vel",CR,LF ;AN000;
+0012 U 0000 "XCOPY nÆo execut vel a partir de um dispositico reservado",CR,LF ;AN000;
+0021 T 0000 "N£mero inv lido de parƒmetros",CR,LF ;AN000;
+0022 T 0000 "XCOPY nÆo execut vel num dispositivo reservado",CR,LF ;AN000;
+0024 T 0000 "Erro na cria‡Æo do ficheiro",CR,LF ;AN000;
+0025 T 0000 "A ler o(s) ficheiro(s) origem...",CR,LF ;AN000;
+0026 T 0000 CR,LF ;AN000;
+0027 T 0000 "%1 Ficheiro(s) copiado(s)",CR,LF ;AN000;
+0028 T 0000 "%1 Ficheiro nÆo encontrado.",CR,LF ;AN000;
+0029 U 0000 "F D " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0000 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 T 0000 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0000 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 T 0000 "%1%2 (S/N)?" ;AN000;P_S_PATH_FILE0
+0034 T 0000 "%1\%2 (S/N)?" ;AN000;P_S_PATH_FILE1
+0035 U 0000 "Indicador inv lido %1",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK b75b 0013
+0002 T 0000 "mem¢ria insuficiente",CR,LF ;AN000; "Insufficient memory"
+0003 T 0000 "VDISK Disco Virtual VersÆo 3.40 %1",CR,LF ;AN000;
+0004 T 0000 " Comprimento do buffer ajustado",CR,LF ;AN000;
+0005 T 0000 " Comprimento do sector ajustado",CR,LF ;AN000;
+0006 T 0000 " Entradas do direct¢rio ajustadas",CR,LF ;AN000;
+0007 T 0000 " Troca de caracteres inv lida",CR,LF ;AN000;
+0008 T 0000 " Comprimento de transferˆncia ajustado",CR,LF ;AN000;
+0009 T 0000 " Comprimento do buffer : %1 KB",CR,LF ;AN000;
+0010 T 0000 " Comprimento do sector : %1",CR,LF ;AN000;
+0011 T 0000 " Entradas de direct¢rio : %1",CR,LF ;AN000;
+0012 T 0000 " Comprimento de transferˆncia: %1",CR,LF ;AN000;
+0013 T 0000 "VDISK nÆo instalado - " ;AN000;
+0014 T 0000 " os interruptores da expansÆo",CR,LF ;AN000;
+ "nÆo correspondem … mem¢ria instalada",CR,LF,CR,LF ;AN000;
+GRAFTABL bb9e 0005
+0002 T 0000 "Code page activo: %1",CR,LF
+0003 U 0000 "Code Page anterior: %1",CR,LF
+0004 T 0000 "Nenhum",NULL
+0005 U 0000 "NÆo-standard",NULL
+0006 U 0000 CR,LF,"Parƒmetros suportados na linha de comando de DOS",COLON,CR,LF,LF
+ " /STA - Pedido de visualiza‡Æo do estado",CR,LF
+ " ? - Visualiza o conjunto de parƒmetros",CR,LF,CR,LF
+ " Code Pages dispon¡veis",COLON,CR,LF
+ " 437 - Conjunto de Caracteres Gr ficos E.U.A.",CR,LF
+ " 850 - Conjunto de Caracteres Gr ficos Multi-idioma",CR,LF
+ " 860 - Conjunto de Caracteres Gr ficos Portugueses",CR,LF
+ " 863 - Conjunto de Caracteres Gr ficos Canadiano Francˆs",CR,LF
+ " 865 - Conjunto de Caracteres Gr ficos N¢rdicos",CR,LF
+FASTOPEN be7c 0016
+0004 T 0000 CR,LF,"FASTOPEN instalado",CR,LF ;AN000;
+0005 U 0000 CR,LF,"FASTOPEN j  instalado",CR,LF ;AN000;
+0006 T 0000 CR,LF,"Parƒmetro incorrecto",CR,LF ;AN000;
+0007 T 0000 CR,LF,"Excesso de entradas de unidades",CR,LF ;AN000;
+0008 T 0000 CR,LF,"Indica‡Æo da mesma unidade mais do que uma vez",CR,LF ;AN000;
+0009 T 0000 CR,LF,"Parƒmetro inv lido",CR,LF ;AN000;
+0010 U 0000 CR,LF,"Tipo de indicador inv lido",CR,LF ;AN000;
+0011 U 0000 CR,LF,"Entrada expandida inv lida",CR,LF ;AN000;
+0012 U 0000 CR,LF,"N£mero inv lido de entradas de ficheiros/direct¢rios",CR,LF
+0013 U 0000 CR,LF,"Imposs¡vel definir a mem¢ria expandida",CR,LF ;AN000;
+0014 U 0000 CR,LF,"Mem¢ria expandida nÆo dispon¡vel",CR,LF ;AN000;
+0015 T 0000 CR,LF,"Unidade indicada inv lida %1",CR,LF
+0016 U 0000 CR,LF,"Espa‡o insuficiente no EMS. Ser  utilizada a mem¢ria inferior.",CR,LF ;AN000;
+0017 T 0000 CR,LF,"FASTOPEN nÆo execut vel para a unidade %1",CR,LF
+0018 U 0000 CR,LF,"Excesso de entradas expandidas",CR,LF
+0019 U 0000 CR,LF,"Excesso de entradas de ficheiros/direct¢rios",CR,LF
+APPEND c2c5 0009
+0001 T 0000 "VersÆo incorrecta de APPEND",CR,LF
+0002 T 0000 "Caminho (path) inv lido",CR,LF
+0003 T 0000 "Parƒmetro inv lido",CR,LF
+0004 U 0000 "Combina‡Æo de parƒmetros inv lida",CR,LF
+0005 T 0000 "Append nÆo executado",CR,LF
+0006 T 0000 "Conflito entre APPEND / ASSIGN",CR,LF
+0007 T 0000 "Conflito entre APPEND / Topview",CR,LF
+0008 T 0000 "VersÆo incorrecta de DOS",CR,LF
+0009 T 0000 "APPEND j  instalado",CR,LF
+GRAPHICS c480 0012
+0005 T 0000 'Parƒmetro inv lido: %1',CR,LF ;AN000
+0007 U 0000 'Parƒmetros duplicados nÆo permitidos',CR,LF ;AN000
+0009 U 0000 'Perfil do GRAPHICS nÆo encontrado',CR,LF ;AN000
+0010 U 0000 'Instru‡Æo do perfil em falta antes da linha %1',CR,LF ;AN000
+0011 U 0000 'Instru‡Æo do perfil inv lida na linha %1',CR,LF ;AN000
+0012 U 0000 'Instru‡Æo do perfil fora de sequˆncia na linha %1',CR,LF ;AN000
+0013 U 0000 'Erro durante a leitura do perfil do GRAPHICS',CR,LF ;AN000
+0014 U 0000 'Erro de sintaxe no perfil do GRAPHICS',CR,LF ;AN000
+0015 U 0000 "O ID do Printbox nÆo existente no perfil do GRAPHCIS",CR,LF
+0016 U 0000 'Tipo de impressora nÆo encontrado no perfil do GRAPHICS',CR,LF ;AN000
+0017 U 0000 '/B inv lido para uma impressora a preto e branco',CR,LF ;AN000
+0018 U 0000 'Imposs¡vel recarregar com o perfil indicado',CR,LF ;AN000
+DISPLAY c907 0003
+0002 T 0000 "%1 - o driver do code page nÆo pode ser inicializado",CR,LF
+0008 T 0000 "Mem¢ria insuficiente",CR,LF
+0012 T 0000 "Sintaxe inv lida no driver do code page DISPLAY.SYS",CR,LF
+PRINTER c9d8 0002
+0002 T 0000 "%1 - driver do code page nÆo pode ser inicializado",CR,LF
+0012 T 0000 "Sintaxe inv lida no driver do code page PRINTER.SYS",CR,LF
+KEYB ca7d 0016
+0002 T 0000 "C¢digo de teclado corrente: %1"
+0003 U 0000 "ID de teclado corrente: %1"
+0004 T 0000 " code page: %1",CR,LF
+0005 T 0000 "Code page CON corrente: %1",CR,LF
+0006 T 0000 "C¢digo de teclado indicado inv lido",CR,LF
+0007 U 0000 "ID de teclado indicado inv lido",CR,LF
+0008 T 0000 "Code page indicado inv lido",CR,LF
+0009 T 0000 "Ficheiro de Defini‡Æo do Teclado inv lido ou em falta",CR,LF
+0010 T 0000 "KEYB nÆo foi instalado",CR,LF
+0011 T 0000 "Code page activo nÆo dispon¡vel no dispositivo CON",CR,LF
+0012 T 0000 "Code page indicado nÆo foi preparado",CR,LF
+0013 T 0000 "Um ou mais CON code pages inv lidos para o c¢digo do teclado",CR,LF
+0014 T 0000 "Code page pedido (%1) nÆo ‚ valido para este c¢digo de teclado",CR,LF
+0015 T 0000 "Code page indicado ‚ inconsistente com o code page seleccionado",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "Imposs¡vel criar a tabela KEYB na mem¢ria residente",CR,LF
+REDIRSYS ce76 0000
+MEM ce8a 0036
+0010 U 0000 CR,LF
+0011 U 0000 " Endere‡o Nome Comp Tipo ",CR,LF
+0012 U 0000 " ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 U 0000 " Tratam Nome EMS Comp ",CR,LF
+0014 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "%1 bytes de mem¢ria total",CR,LF
+0019 U 0000 "%1 bytes dispon¡veis",CR,LF
+0020 U 0000 "%1 de comprimento m ximo para execu‡Æo de um programa",CR,LF
+0021 U 0000 "%1 bytes de mem¢ria EMS total",CR,LF
+0022 U 0000 "%1 bytes livres de mem¢ria EMS",CR,LF
+0023 U 0000 "%1 bytes de mem¢ria total expandida",CR,LF
+0024 U 0000 "Vector de Interrup‡Æo",0
+0025 U 0000 "µrea de Comunica‡Æo da ROM",0
+0026 U 0000 "µrea de Comunica‡Æo do DOS",0
+0027 U 0000 "IBMBIO",0
+0028 U 0000 "IBMDOS",0
+0029 U 0000 "Dados do Sistema",0
+0030 U 0000 "Programa de Sistema",0
+0031 U 0000 "Driver do Dispositivo de Sistema",0
+0032 U 0000 "Driver do Dispositivo Instalado",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "BUFFERS=",0
+0036 U 0000 "FICHEIROS=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "STACKS=",0
+0039 U 0000 "DISPOSITIVO=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "LASTDRIVE=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR d464 0040
+0004 U 0000 "A rede foi iniciada agora",CR,LF
+0050 U 0000 "NET809: Pedido de rede nÆo suportado",CR,LF,0
+0051 U 0000 "NET801: Computador remoto nÆo est  em escuta",CR,LF,0
+0052 U 0000 "NET802: Nome duplicado na rede",CR,LF,0
+0053 U 0000 "NET803: Caminho (path) de rede nÆo encontrado",CR,LF,0
+0054 U 0000 "NET804: Rede ocupada",CR,LF,0
+0055 U 0000 "NET805: O dispositivo de rede j  nÆo existe",CR,LF,0
+0056 U 0000 "NET806: Limite do comando de Net BIOS excedido",CR,LF,0
+0057 U 0000 "NET807: Erro de Sistema; erro de NETBIOS",CR,LF,0
+0058 U 0000 "NET808: Resposta da rede incorrecta",CR,LF,0
+0059 U 0000 "NET810: Erro de rede inesperado",CR,LF,0
+0060 U 0000 "NET811: Adaptador remoto incompat¡vel",CR,LF,0
+0061 U 0000 "NET812: A fila de espera de impressÆo est  cheia",CR,LF,0
+0062 U 0000 "NET813: Espa‡o insuficiente para imprimir o ficheiro",CR,LF,0
+0063 U 0000 "NET814: ImpressÆo do ficheiro cancelada",CR,LF,0
+0064 U 0000 "NET815: Nome de rede eliminado",CR,LF,0
+0065 U 0000 "Acesso negado",CR,LF,0
+0066 U 0000 "NET817: Tipo de dispositivo de rede incorrecto",CR,LF,0
+0067 U 0000 "NET818: Nome de rede nÆo encontrado",CR,LF,0
+0068 U 0000 "NET819: Limite de nome de rede excedido",CR,LF,0
+0069 U 0000 "NET820: Limite da sessÆo de Net BIOS excedida",CR,LF,0
+0070 U 0000 "NET821: Partilha temporariamente em pausa",CR,LF,0
+0071 U 0000 "NET823: Pedido de rede nÆo aceite",CR,LF,0
+0072 U 0000 "NET822: ImpressÆo ou redireccionamento de disco em pausa",CR,LF,0
+0073 U 0000 "NET476: Netbeui nÆo carregado",CR,LF,0
+0074 U 0000 "NET477: Fecho inesperado do adaptador",CR,LF,0
+0075 U 0000 "NET826: Comprimento do Server destino /RQB demasiado pequeno",CR,LF,0
+0076 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0077 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0078 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0079 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0080 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0081 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0082 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0083 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0084 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0085 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0086 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0087 U 0000 "NET???: Erro de rede inesperado",CR,LF,0
+0088 U 0000 "NET825: Falha de dados na rede",CR,LF,0
+FILESYS ddd3 0006
+0010 U 0000 "%1 REDIR %2 em Pausa",CR,LF
+0011 U 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+XMA2EMS df12 0017
+0001 U 0000 "XMA2EMS: Expanded Memory Manager VersÆo 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 Todos os direitos reservados",CR,LF,"$"
+0002 U 0000 CR,LF,"XMA001 Em execu‡Æo dos diagn¢sticos VMO/XMA: ","$"
+0003 U 0000 "XMA002 Diagn¢sticos terminados ",CR,LF,LF,"$"
+0004 U 0000 "XMA003 Estrutura de P gina iniciada em............. "
+0005 U 0000 "XXXX",":0",CR,LF,"$"
+0006 U 0000 "XMA004 P ginas transferidas para a mem¢ria......... "
+0007 U 0000 "0 ",CR,LF,"$"
+0008 U 0000 "XMA005 P gina reservadas para o Programa de Controlo ......... "
+0009 U 0000 "0 ",CR,LF,"$"
+0010 U 0000 "XMA006 P ginas dispon¡veis para a mem¢ria expandida .......... "
+0011 U 0000 "0 ",CR,LF,"$"
+0012 U 0000 CR,LF,"XMA100 Erro de adaptador:",CR,LF," Expanded Memory Manager NÇO foi instalado",CR,LF,"$"
+0013 U 0000 CR,LF,"XMA200 Adaptador nÆo encontrado:",CR,LF," Expanded Memory Manager NÇO foi instalado",CR,LF,"$"
+0014 U 0000 CR,LF,"XMA300 Erro de valor ou sintaxe do parƒmetro:",CR,LF
+ " Expanded Memory Manager NÇO foi instalado",CR,LF,"$"
+0015 U 0000 SIZE1_END - 2 -$
+0016 U 0000 4 DUP (?)," KB OK",CR,LF,"$"
+0017 U 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK e407 0120
+0004 U 0000 "FDISK nÆo execut vel com a rede instalada",CR,LF
+0005 T 0000 "NÆo existe disco fixo."
+0006 T 0000 "Erro de leitura no disco fixo."
+0007 T 0000 "Erro de grava‡Æo no disco fixo."
+1001 U 0000 "IBM Personal Computer"
+1002 U 0000 "Fixed Disk Setup Program VersÆo 3.40"
+1003 U 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "FDISK - Op‡äes"
+1005 U 0000 "1. <R>Criar Parti‡Æo de DOS ou Unidade L¢gica de DOS"
+1006 U 0000 "2. <R>Definir a parti‡Æo activa"
+1007 U 0000 "3. <R>Eliminar Parti‡Æo de DOS ou Unidade L¢gica de DOS"
+1008 T 0000 "4. <R>Ver os dados da parti‡Æo"
+1009 T 0000 "Prima <H>ESC<R> para regressar ao DOS"
+1010 T 0000 "Escolha uma das op‡äes seguintes:"
+1011 T 0000 "5. <R>Seleccionar o disco seguinte"
+1012 T 0000 "Unidade de disco fixo corrente: <H><I>"
+1013 U 0000 "Aten‡Æo! <R>Nenhuma parti‡Æo est  activa - o disco 1 nÆo pode ser carregado"
+1014 U 0000 "a menos que a parti‡Æo seja activada"
+1015 U 0000 "Entre a escolha: [<S> ]"
+1016 U 0000 "Criar Parti‡Æo de DOS ou Unidade L¢gica de DOS"
+1017 T 0000 "1. <R>Criar uma parti‡Æo prim ria"
+1018 T 0000 "2. <R>Criar uma parti‡Æo expandida"
+1019 T 0000 "3. <R>Criar unidade(s) l¢gica(s) na parti‡Æo expandida"
+1020 T 0000 "Prima <H>ESC<R> para regressar …s Op‡äes"
+1021 U 0000 "Criar Parti‡Æo Prim ria de DOS"
+1022 T 0000 "Quer usar o comprimento m ximo para a parti‡Æo de DOS "
+1023 T 0000 "e quer activar a parti‡Æo (S/N) ...............? <H>[<S> ]"
+1024 U 0000 "(<S>/<N>)...................................................? <H>[<S> ]"
+1025 U 0000 "Estado Parti‡Æo Tipo Comp em Mbytes Percentagem de Disco Usado"
+1026 U 0000 "Espa‡o total ‚ de <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 U 0000 "Espa‡o m ximo dispon¡vel para a parti‡Æo ‚ de <HIIIIR> Mbytes (<HIIIIR>)"
+1028 U 0000 "Entre o comprimento da parti‡Æo em Mbytes ou percentacem de disco (%) para"
+1029 U 0000 "criar a Parti‡Æo Prim ria de DOS...............................: <H>[<IIISI>]"
+1030 U 0000 "Criar uma Parti‡Æo Expandida de DOS"
+1031 U 0000 "criar uma Parti‡Æo Expandida de DOS...........................: <H>[<IIISI>]"
+1032 U 0000 "Prima <H>Esc<R> para continuar"
+1033 U 0000 "Criar Unidade(s) L¢gica de DOS na Parti‡Æo Expandida de DOS"
+1034 U 0000 "Uni Identifica‡Æo Mbytes Sistema Usado"
+1035 U 0000 "Comprimento total da Parti‡Æo Expandida de DOS ‚ <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 U 0000 "Espa‡o m ximo dispon¡vel para a unidade l¢gica ‚ <HIIIIR> Mbytes <H>(<IIII>)"
+1037 U 0000 "Entre o comprimento da unidade l¢gica em Mbytes ou percentagem de disco (%)...<H>[<IIISI>]"
+1038 U 0000 "Definir a Parti‡Æo Activa"
+1039 T 0000 "Entre o n£mero da parti‡Æo que quer activar ................... [#] <H>[<S> ]"
+1040 U 0000 "Eliminar Parti‡Æo de DOS ou Unidade L¢gica de DOS"
+1041 T 0000 "1. <R>Eliminar uma parti‡Æo prim ria"
+1042 T 0000 "2. <R>Eliminar uma parti‡Æo expandida"
+1043 T 0000 "3. <R>Eliminar unidade(s) l¢gica(s) de DOS na parti‡Æo expandida"
+1044 T 0000 "Eliminar uma parti‡Æo prim ria"
+1045 T 0000 "Aten‡Æo! <OR>Os dados da parti‡Æo prim ria de DOS perder-se-Æo."
+1046 T 0000 "Quer continuar .........? <H>[<S> ]"
+1047 T 0000 "Eliminar uma parti‡Æo expandida"
+1048 T 0000 "Aten‡Æo! Os dados da parti‡Æo expandida de DOS perder-se-Æo."
+1049 T 0000 "Quer continuar ........? <H>[<S> ]"
+1050 U 0000 "Eliminar Unidade(s) L¢gica de DOS na Parti‡Æo Expandida de DOS"
+1051 T 0000 "Aten‡Æo! <OR>Os dados da unidade l¢gica de DOS perder-se-Æo."
+1052 T 0000 "Qual a unidade que quer eliminar ....................? <H>[<S> ]"
+1053 U 0000 "Tem a certeza (<S>/<N>).............................? <H>[<S> ]"
+1054 U 0000 "Entre a Identifica‡Æo do Volume.................? <H>[<S> ]"
+1055 U 0000 "Visualizar Informa‡Æo da Parti‡Æo"
+1056 T 0000 "A parti‡Æo expandida cont‚m unidades l¢gicas de DOS."
+1057 T 0000 "Quer visualizar a informa‡Æo dessas unidades? ...... <H>[<S> ]"
+1058 T 0000 "Ver a informa‡Æo das unidades l¢gicas"
+1059 T 0000 "O sistema ser  agora reinicializado"
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0000 "A: e prima depois qualquer tecla . . .<S>"
+1062 T 0000 "Parti‡Æo prim ria de DOS eliminada"
+1063 T 0000 "Parti‡Æo expandida de DOS eliminada"
+1064 U 0000 "Unidade eliminada"
+1065 T 0000 "Parti‡Æo <I> activada"
+1066 T 0000 "Parti‡Æo prim ria criada"
+1067 T 0000 "Parti‡Æo expandida criada"
+1068 T 0000 "Unidade l¢gica da DOS criada, unidades alteradas ou adicionadas<W>"
+1069 T 0000 "NÆo existem parti‡äes definidas"
+1070 T 0000 "NÆo existem unidades l¢gicas definidas"
+1071 T 0000 "As unidades foram alteradas ou eliminadas<W>"
+1072 U 0000 "Unidade re-direccionada"
+1073 U 0000 "Parti‡Æo Prim ria de DOS criada, letras das unidades alteradas ou adicionadas"
+1074 T 0000 "NÆo existe disco fixo."
+1075 T 0000 "Erro de leitura no disco fixo."
+1076 T 0000 "Erro de grava‡Æo no disco fixo."
+1077 U 0000 "VersÆo incorrecta de DOS."
+1078 T 0000 "FDISK nÆo execut vel na Rede."
+1079 T 0000 "NÆo existe parti‡Æo prim ria."
+1080 T 0000 "NÆo existe parti‡Æo expandida."
+1081 T 0000 "Parti‡Æo prim ria j  existente."
+1082 T 0000 "Parti‡Æo expandida j  existente."
+1083 T 0000 "Falta de espa‡o para a parti‡Æo de DOS."
+1084 T 0000 "O comprimento pedido para a unidade l¢gica excede o espa‡o dispon¡vel.<W>"
+1085 T 0000 "O comprimento pedido para a parti‡Æo excede o espa‡o dispon¡vel.<W>"
+1086 T 0000 "NÆo existem parti‡äes para eliminar."
+1087 U 0000 "A £nica parti‡Æo carreg vel da Unidade 1 j  est  activada.<W>"
+1088 T 0000 "NÆo existem parti‡äes para activar."
+1089 U 0000 "A parti‡Æo seleccionada (<I>) nÆo ‚ carreg vel, parti‡Æo activa nÆo alterada.<W>"
+1090 T 0000 "Cria‡Æo da parti‡Æo expandida imposs¡vel "
+1091 T 0000 "sem uma parti‡Æo primaria no disco 1.<W>"
+1092 T 0000 "O espa‡o da parti‡Æo expandida est  "
+1093 T 0000 "todo assignado a unidades l¢gicas de DOS.<W>"
+1094 T 0000 "Imposs¡vel eliminar a parti‡Æo expandida enquanto tiver unidades l¢gicas.<W>"
+1095 T 0000 "Unidades l¢gicas da parti‡Æo expandida eliminadas<W>"
+1096 T 0000 " nÆo ‚ escolha. Entre <III>, por favor"
+1097 U 0000 "Aten‡Æo! NÆo pode carregar o sistema a partir da parti‡Æo seleccionada.<W>"
+1098 U 0000 "S¢ existem parti‡äes nÆo carreg veis."
+1099 T 0000 "S¢ as parti‡äes da Unidade 1 podem ser activadas.<W>"
+1100 T 0000 "N£mero m ximo de unidades l¢gicas de DOS instaladas.<W>"
+1101 U 0000 "Imposs¡vel criar uma parti‡Æo com comprimento zero."
+1102 T 0000 "Unidade <II> j  eliminada."
+1103 T 0000 "Imposs¡vel aceder … unidade <I>.<OW>"
+1104 U 0000 "Entrada inv lida, entre <III>.<W>"
+1105 U 0000 "Imposs¡vel eliminar uma Parti‡Æo Prim ria de DOS na unidade 1"
+1106 U 0000 "quando existe uma Parti‡Æo Expandida de DOS.<W>"
+1107 T 0000 "Entrada inv lida, entre <III>, por favor.<W>"
+1108 U 0000 "A Identifica‡Æo do Volume nÆo corresponde.<W>"
+1109 U 0000 "Imposs¡vel criar uma Unidade L¢gica de DOS sem existir"
+1110 U 0000 "uma Parti‡Æo Expandida de DOS na unidade corrente.<W>"
+1111 U 0000 "NÆo existem Unidade(s) L¢gicas de DOS para eliminar."
+1112 U 0000 "Erro na mensagem <I>. Consulte o cabe‡alho do FDISKC.MSG para ver a defini‡Æo do erro"
+1113 U 0000 "Erro interno"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/spain.msg b/private/mvdm/dos/v86/messages/spain.msg
new file mode 100644
index 000000000..ddd6ed707
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/spain.msg
@@ -0,0 +1,1141 @@
+0008
+COMMON 0006 0038
+0001 T 0000 "Versi¢n incorrecta del DOS",CR,LF
+0002 T 0000 "%1 ya est  instalado",CR,LF
+0003 T 0000 "%1 bytes disponibles en disco",CR,LF
+0004 T 0000 "%1 bytes libres",CR,LF
+0005 T 0000 "%1 bytes en sectores defectuosos",CR,LF
+0006 T 0000 "%1 bytes es el espacio total en disco",CR,LF
+0007 U 0000 "%1 bytes de memoria total",CR,LF
+0008 T 0000 "%1 bytes usados por el Sistema",CR,LF
+0009 T 0000 "%1 instalado",CR,LF
+0010 T 0000 "%1 no instalado",CR,LF
+0011 T 0000 "%1 no instalado",CR,LF
+0012 T 0000 "No se puede hacer %1 a una unidad de red",CR,LF
+0013 U 0000 "",
+0014 T 0000 "No se puede hacer %1 a una unidad bajo",CR,LF
+0015 T 0000 "No se puede ejecutar %1",CR,LF
+0016 U 0000 "Memoria Expandida no disponible",CR,LF
+0017 T 0000 "Tabla de asignaci¢n de archivos err¢nea en la unidad %1",CR,LF
+0018 T 0000 "No se puede copiar un archivo sobre s¡ mismo",CR,LF
+0019 U 0000 "Inserte diskette destino en unidad %1",CR,LF
+0020 T 0000 "Espacio insuficiente en disco",CR,LF
+0021 T 0000 "Caracteres no v lidos en etiqueta de Volumen",CR,LF
+0022 T 0000 "P gina de c¢digos no v lida",CR,LF
+0023 T 0000 "Fecha no v lida",CR,LF
+0024 T 0000 "Hora no v lida",CR,LF
+0025 T 0000 "V¡a de acceso err¢nea",CR,LF
+0026 T 0000 "Unidad de origen no especificada",CR,LF
+0027 T 0000 "Unidad de destino no especificada",CR,LF
+0028 U 0000 "Pulse cualquier tecla para continuar . . .",CR,LF
+0029 T 0000 "V¡a de acceso origen requerida",CR,LF
+0030 T 0000 "Sistema transferido",CR,LF
+0031 U 0000 "",
+0032 T 0000 "Imposible crear directorio",CR,LF
+0033 T 0000 "Volumen en unidad %1 sin etiqueta",CR,LF
+0034 T 0000 "Volumen en unidad %1 etiquetado %2",CR,LF
+0035 T 0001 "Etiqueta de Volumen (m ximo 11 caracteres y/o INTRO) "
+0036 U 0000 "El N£mero de Serie del Volumen es %1-%2",CR,LF
+0037 U 0000 "El tipo de archivo es incorrecto",CR,LF
+0038 T 0001 CR,LF
+EXTEND 0762 0089
+0001 U 0000 "Funci¢n no v lida",CR,LF
+0002 T 0000 "o no se encontr¢ archivo",CR,LF
+0003 T 0000 "No se encontr¢ v¡a de acceso",CR,LF
+0004 T 0000 "Demasiados archivos abiertos",CR,LF
+0005 T 0000 "Acceso denegado ",CR,LF
+0006 U 0000 "Manejo no v lido",CR,LF
+0007 U 0000 "Destruidos bloques de control de memoria",CR,LF
+0008 T 0000 "Memoria insuficiente",CR,LF
+0009 U 0000 "Direcci¢n no v lida de bloque de memoria",CR,LF
+0010 T 0000 "Tama¤o de entorno",CR,LF
+0011 U 0000 "Formato no v lido",CR,LF
+0012 U 0000 "Par metro de funci¢n no v lido",CR,LF
+0013 U 0000 "Datos no v lidos",CR,LF
+0014 U 0000 "",
+0015 T 0000 "Especificaci¢n de unidad err¢nea",CR,LF
+0016 U 0000 "Intento de eliminar el directorio actual",CR,LF
+0017 U 0000 "No es el mismo dispositivo",CR,LF
+0018 U 0000 "No hay m s archivos",CR,LF
+0019 U 0000 "Error de protecci¢n contra grabaci¢n",CR,LF
+0020 U 0000 "Unidad no v lida",CR,LF
+0021 T 0000 "Unidad no preparada",CR,LF
+0022 U 0000 "Petici¢n de dispositivo no v lida",CR,LF
+0023 U 0000 "Error de datos",CR,LF
+0024 U 0000 "Par metros de petici¢n de dispositivo no v lidos",CR,LF
+0025 U 0000 "Error de b£squeda",CR,LF
+0026 U 0000 "Tipo de soporte no v lido",CR,LF
+0027 T 0000 "No se encontr¢ sector",CR,LF
+0028 T 0000 "ERROR: sin papel$",CR,LF
+0029 T 0000 "ERROR: de grabaci¢n$",CR,LF
+0030 T 0000 "ERROR: de lectura$",CR,LF
+0031 T 0000 "Anomal¡a general",CR,LF
+0032 T 0000 "Archivo compartido",CR,LF
+0033 T 0000 "Archivo bloqueado",CR,LF
+0034 T 0000 "Cambio de diskette no v lido$",CR,LF
+0035 T 0000 "FCB no disponible$",CR,LF
+0036 U 0000 "Agotado recurso del sistema",CR,LF
+0037 U 0000 "No coincidencia de p gina de c¢digo",CR,LF
+0038 U 0000 "Fuera de entrada",CR,LF
+0039 T 0000 "Espacio insuficiente en disco",CR,LF
+0040 U 0000 "",
+0041 U 0000 "",
+0042 U 0000 "",
+0043 U 0000 "",
+0044 U 0000 "",
+0045 U 0000 "",
+0046 U 0000 "",
+0047 U 0000 "",
+0048 U 0000 "",
+0049 U 0000 "",
+0050 U 0000 "Petici¢n no soportada por sistema de archivos",CR,LF
+0051 U 0000 "No puede adjuntarse a sistema de Archivos",CR,LF
+0052 U 0000 "Nombre de sistema de archivos ya existe",CR,LF
+0053 U 0000 "Nombre de sistema de archivos no encontrado",CR,LF
+0054 U 0000 "Sistema de archivos ocupado",CR,LF
+0055 U 0000 "El dispositivo de sistema de archivos ya no existe",CR,LF
+0056 U 0000 "Agotado recurso de sistema de archivos",CR,LF
+0057 U 0000 "El sistema de archivos sufri¢ un error de dispositivo",CR,LF
+0058 U 0000 "El sistema de archivos proporcion¢ una respuesta incorrecta",CR,LF
+0059 U 0000 "El sistema de archivos sufri¢ un error inesperado",CR,LF
+0060 U 0000 "Sistema de archivos no compatible",CR,LF
+0061 U 0000 "Excedido el l¡mite de archivos de salida del dispositivo",CR,LF
+0062 U 0000 "Excedido el l¡mite de espacio de archivos de salida del dispositivo",CR,LF
+0063 U 0000 "El archivo de salida del dispositivo ya no existe",CR,LF
+0064 U 0000 "El nombre de sistema de archivos ya no existe",CR,LF
+0065 U 0000 "Acceso denegado por sistema de archivos",CR,LF
+0066 U 0000 "El tipo de dispositivo del sistema de archivos es incorrecto",CR,LF
+0067 U 0000 "Sistema de archivos no encontrado",CR,LF
+0068 U 0000 "Agotado recurso de sistema de archivos",CR,LF
+0069 U 0000 "Agotado recurso de sistema de archivos",CR,LF
+0070 U 0000 "El dispositivo del sistema de archivos no est  disponible temporalmente",CR,LF
+0071 U 0000 "Petici¢n del sistema de archivos no aceptada",CR,LF
+0072 U 0000 "El dispositivo del sistema de archivos est  en una pausa",CR,LF
+0073 U 0001 "Componente del sistema de archivos no disponible",CR,LF
+0074 U 0001 "El sistema de archivos sufri¢ un error inesperado",CR,LF
+0075 U 0001 "El sistema de archivos sufri¢ un error inesperado",CR,LF
+0076 U 0000 "",
+0077 U 0000 "",
+0078 U 0000 "",
+0079 U 0000 "",
+0080 U 0000 "El archivo ya existe",CR,LF
+0081 U 0000 "",
+0082 U 0000 "No puede crearse la entrada en el directorio",CR,LF
+0083 U 0000 "Anomal¡a solicitada a 'Critical Error'",CR,LF
+0084 U 0000 "Demasiadas conexiones",CR,LF
+0085 U 0000 "Dispositivo o archivo ya conectado",CR,LF
+0086 U 0000 "Contrase¤a no v lida",CR,LF
+0087 T 0000 "Par metro no v lido",CR,LF
+0088 U 0000 "Error de datos del sistema de archivos",CR,LF
+0089 U 0000 "Funci¢n no suportada por sistema de archivos",CR,LF
+PARSE 1838 0011
+0001 U 0000 "Demasiados par metros",CR,LF
+0002 U 0000 "Falta par metro requerido",CR,LF
+0003 T 0000 "cambio no v lido",CR,LF
+0004 U 0000 "Palabra clave no v lida",CR,LF
+0005 U 0000 "",
+0006 U 0000 "El valor del par metro no est  dentro del rango permitido",CR,LF
+0007 U 0000 "El valor del par metro no est  permitido",CR,LF
+0008 U 0000 "El valor del par metro no est  permitido",CR,LF
+0009 U 0000 "El formato del par metro no es correcto",CR,LF
+0010 T 0000 "Par metro no v lido",CR,LF
+0011 U 0000 "Combinaci¢n de par metros no v lida",CR,LF
+IBMBIO 1a74 0018
+0003 U 0000 13,10,"Mandato no reconozido en CONFIG.SYS"
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Tama¤o de sector demasiado grande en archivo $"
+0006 U 0000 13,10,"$ no vale o falta"
+0007 U 0000 "Interprete de Mandatos",0
+0008 U 0000 13,10,"C¢digo de pa¡s o p gina de c¢digo no v lido",13,10,"$"
+0009 U 0000 13,10,"Error en mandato COUNTRY",13,10,"$"
+0010 U 0000 13,10, "Insuficiente memoria para archivo COUNTRY.SYS",13,10,"$"
+0011 U 0000 13,10,"Configuraci¢n demasiado grande para memoria",13,10,"$"
+0012 U 0000 13,10,"Demasiados Dispositivos de Bloque",13,10,"$"
+0013 U 0000 13,10,"Par metros de STACK no v lidos",13,10,"$"
+0014 U 0000 13,10,"Orden incorrecto en l¡nea del archivo CONFIG.SYS ","$"
+0015 U 0000 "Error en l¡nea de CONFIG.SYS ","$"
+0016 T 0000 13,10,"Error en asignaci¢n de memoria $"
+0017 U 0001 0DH,0AH,7,0DH,0AH, "Desbordamiento en Pila Interna",0DH,0AH
+ "Sistema parado",0DH,0AH,"$"
+0020 T 0000 13,10,"Inserte el diskette en la unidad "
+0021 T 0000 "A: y",13,10,"pulse cualquier tecla para continuar",13,10,10,0
+0022 U 0000 13,10,"Mandato o par metros no v lidos - $"
+BOOT 1edc 0001
+0001 U 0001 13,10,"Error en diskette o diskette sin DOS",13,10
+ "C mbielo y pulse cualquier tecla",13,10,0
+DBCSDOS 1f5d 0000
+IBMDOS 1f71 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1fb0 0091
+0201 U 0000 "C"
+0202 U 0000 "R"
+0203 U 0000 "I"
+0204 U 0000 "S"
+0205 U 0000 "S"
+0206 U 0000 "N"
+0210 T 0000 "¨Cancelar$"
+0211 T 0000 ", Reintentar$"
+0212 T 0000 ", Ignorar$"
+0213 T 0000 ", Seguir$"
+0214 U 0000 "?"
+0215 T 0000 "leyendo",0
+0216 T 0000 "grabando",0
+0217 T 0000 "%1 la unidad %2",CR,LF
+0218 T 0000 "%1 dispositivo %2",CR,LF
+0219 U 0000 "Inserte el volumen %1 serie %2-%3",CR,LF
+0221 T 0000 "COMMAND.COM err¢neo",CR,LF
+0222 T 0000 "Inserte diskette con $ %1 en unidad %2",CR,LF
+0224 T 0000 CR,LF,"¨Terminar el trabajo por lotes (S/N)? $"
+0225 T 0000 "No se puede ejecutar %1",CR,LF
+0226 T 0000 "Error de archivo EXE",CR,LF
+0227 T 0000 "El programa no cabe en memoria",CR,LF
+0228 T 0000 CR,LF,"No se pueden utilizar m s archivos$"
+0229 T 0000 "Mandato o nombre de archivo err¢neo",CR,LF
+0231 T 0000 CR,LF,"Error en asignaci¢n de memoria $"
+0232 T 0000 CR,LF,"No se puede cargar COMMAND, Sistema parado$",CR,LF
+0233 T 0000 CR,LF,"No se puede arrancar COMMAND, salir",CR,LF
+0234 T 0000 CR,LF,"Proceso de mayor nivel cancelado, no se puede continuar$",CR,LF
+0235 U 0000 CR,LF
+0463 T 0000 "Fuera del espacio de entorno",CR,LF
+0464 T 0000 CR,LF,"DOS del IBM Personal Computer ",CR,LF
+ "Versi¢n 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF
+0465 T 0000 "Directorio err¢neo para b£squeda de COMMAND",CR,LF
+0466 T 0000 "Acceso denegado al directorio para b£squeda de COMMAND",CR,LF
+1002 U 0000 "Nombre de archivo duplicado o archivo no encontrado",CR,LF
+1003 T 0000 "V¡a de acceso o nombre de archivo err¢neo",CR,LF
+1007 T 0000 "Fuera del espacio de entorno",CR,LF
+1008 T 0000 "Error en creaci¢n de archivo",CR,LF
+1009 T 0000 "Falta el archivo de proceso por lotes",CR,LF
+1010 T 0000 CR,LF,"Inserte diskette con archivo de proceso por lotes",CR,LF,"y pulse cualquier tecla para continuar",CR,LF
+1011 T 0000 "Mandato o nombre de archivo err¢neo",CR,LF
+1016 T 0000 "Se perdi¢ el contenido de la copia antes de copiarse",CR,LF
+1017 T 0000 "Nombre de archivo no v lido o no se encontr¢",CR,LF
+1018 T 0000 "%1 Archivo(s) copiado(s)",CR,LF
+1019 T 0000 "%1 Archivo(s) "
+1022 T 0000 "P gina de c¢digos %1 no preparada para el Sistema",CR,LF
+1023 T 0000 "P gina de c¢digos %1 no preparada para todos los dispositivos",CR,LF
+1024 T 0000 "P gina de c¢digos activa: %1",CR,LF
+1025 U 0000 "NLSFUNC no instalado",CR,LF
+1027 T 0000 "La unidad actual ya no es v lida"
+1029 T 0000 "No se encontr¢ etiqueta",CR,LF
+1030 T 0000 "Error de sintaxis",CR,LF
+1032 T 0000 "La fecha actual es %1 %2",CR,LF
+1033 T 0000 "DomLunMarMieJueVieSab"
+1034 T 0000 "Introduzca nueva fecha (%1): "
+1036 T 0000 "La hora actual es %1 ",CR,LF
+1037 T 0000 "Introduzca nueva hora: "
+1038 U 0000 ", ¨Suprimir (S/N)?"
+1039 U 0000 "­Se suprimir n todos los archivos del directorio!",CR,LF
+ "¨Est  seguro (S/N)?"
+1040 T 0000 "IBM Personal Computer - Versi¢n DOS %1.%2",CR,LF
+1044 T 0000 "Directorio err¢neo",CR,LF
+1046 U 0000 "V¡a de acceso no v lida, no directorio,",CR,LF,"o directorio no vac¡o",CR,LF
+1047 T 0000 "Debe especificar ON u OFF",CR,LF
+1048 T 0000 "Directorio de %1",CR,LF
+1049 T 0000 "No hay v¡a de acceso",CR,LF
+1050 T 0000 "Unidad err¢nea en la v¡a de acceso de b£squeda",CR,LF
+1051 T 0000 "Dispositivo err¢neo",CR,LF
+1052 T 0000 "FOR no puede ser anidado",CR,LF
+1053 T 0000 "Error de archivo intermedio durante el encadenado",CR,LF
+1054 T 0000 "No se puede hacer lectura binaria de la unidad",CR,LF
+1055 T 0000 "BREAK es %1 ",CR,LF
+1056 T 0000 "VERIFY es %1 ",CR,LF
+1057 T 0000 "ECHO es %1 ",CR,LF
+1059 T 0000 "off",0
+1060 T 0000 "on",0
+1061 T 0000 "Error durante la grabaci¢n en la unidad",CR,LF
+1063 U 0000 "%1"
+1064 U 0000 "%1"
+1065 U 0000 "%1"
+1066 U 0000 "%1"
+1067 U 0000 9
+1068 U 0000 " <DIR> "
+1069 U 0000 8," ",8
+1070 U 0000 CR,LF
+1071 U 0000 "%1"
+1072 T 0000 "mm-dd-aa"
+1073 T 0000 "dd/mm/aa"
+1074 T 0000 "aa-mm-dd"
+1075 U 0000 "%1 %2"
+1076 U 0000 "%1"
+1077 T 0001 " %1 %2"
+1078 U 0000 "El directorio ya existe",CR,LF
+ATTRIB 2fbd 0016
+0004 T 0000 "N£mero de par metros no v lido",CR,LF
+0005 T 0000 "V¡a de acceso err¢nea o no se encontr¢ archivo",CR,LF
+0006 T 0000 "Error de sintaxis",CR,LF
+0008 U 0000 " %1"
+0009 U 0000 "%1 %2",CR,LF
+0010 U 0000 "%1",CR,LF,"%2",CR,LF
+0011 U 0000 "%1, No coincidencia de p gina de c¢digos",CR,LF,"¨Est  seguro (S/N)?"
+0012 U 0000 "%1",CR,LF
+0014 U 0000 CR,LF
+0015 U 0000 "Valor no v lido de tipo de archivo",CR,LF
+0199 U 0000 "Error de atributo ampliado",CR,LF
+0201 U 0000 "Nombre de atributo ampliado no encontrado",CR,LF
+0204 U 0000 "No puede definirse el nombre del atributo ampliado",CR,LF
+0205 U 0000 "Nombre atributo ampliado conocido para este sistema archivos pero no soportado",CR,LF
+0206 U 0000 "No coincidencia de tipo de atributo ampliado",CR,LF
+0208 U 0000 "Valor de atributo ampliado no soportado",CR,LF
+ASSIGN 3316 0001
+0002 U 0000 "Original %1: definido para %2:",cr,lf
+CHKDSK 335e 0062
+0003 T 0000 "¨Convertir cadenas perdidas en archivos (S/N)?" ;freemes
+0004 T 0000 "Error irrecuperable en directorio" ;ptrandir
+0005 T 0000 "¨Convertir directorio en archivo (S/N)?" ;ptrandir2
+0007 T 0000 "%1 bytes es el espacio total en disco" ;dskspc
+0008 T 0000 "%1 bytes en sectores defectuosos" ;badspc
+0009 T 0000 "%1 bytes en %2 archivo(s) oculto(s)" ;hidmes
+0010 T 0000 "%1 bytes en %2 directorio(s)" ;dirmes
+0011 T 0000 "%1 bytes en %2 archivo(s) de usuario" ;filemes
+0012 T 0000 "%1 bytes en %2 archivo(s) recuperado(s)" ;orphmes2
+0013 U 0000 "%1 bytes estar¡an en %2 archivos recuperados" ;orphmes3
+0014 T 0000 "%1 bytes disponibles en disco" ;frespc
+0015 U 0000 "Total de %1 bytes de memoria" ;totmem
+0016 T 0000 "%1 bytes libres" ;fremem
+0017 T 0000 "No se puede hacer CHKDSK a una unidad de red" ;no_net_arg
+0018 T 0000 "No se puede hacer CHKDSK a una unidad bajo" ;SubStErr
+0019 U 0000 "Es probable que el disco no sea del DOS",CR,LF,"¨Continuar (S/N)?" ;badidbyt
+0020 U 0000 "Error de disco al leer FAT %1",CR,LF ;badr
+0021 T 0000 "Directorio %1" ;direc_arg
+0022 T 0000 "%1 Contiene %2 bloques no contiguos" ;extent_arg
+0023 T 0000 "Todos los archivos especificados son contiguos" ;noext_arg
+0024 U 0000 "Encontrados errores, par m. F no especif.",CR,LF,"Correcciones no se grabar n en disco" ;fixmes_arg
+0025 T 0000 "No se puede continuar el proceso" ;fatal_arg
+0026 T 0000 " Tabla de asignaci¢n de archivos err¢nea en la unidad " ;badrdmes
+0029 T 0000 " CHDIR .. fallido, pruebe m‚todo alternativo" ;cdddmes
+0030 T 0000 " Hay un cluster err¢neo, archivo truncado" ;badchain
+0031 T 0000 " Entrada err¢nea al sub-directorio" ;badsubdir
+0032 T 0000 " No existe" ;ndotmes
+0033 U 0000 " El primer n£mero del cluster no es v lido, entrada truncada" ;nulnz
+0034 T 0000 " Error de asignaci¢n, tama¤o actualizado" ;badclus
+0035 T 0000 " Imposible recuperar entrada . , contin£a el proceso" ;norecdot
+0036 T 0000 " El directorio est  totalmente vac¡o, no hay . o ..," ;nuldmes
+0037 T 0000 " El directorio est  unido," ;joinmes
+0038 T 0000 " No se puede recuperar entrada .. ," ;norecddot
+0039 T 0000 " La entrada tuvo un enlace err¢neo" ;norecddot1
+0040 T 0000 " La entrada tuvo un atributo err¢neo" ;norecddot2
+0041 T 0000 " La entrada tuvo un tama¤o err¢neo" ;norecddot3
+0042 T 0000 " Enlace cruzado de archivo en cluster %1" ;cross_arg
+0043 T 0000 " No se puede hacer CHDIR a %1,",CR,LF,"Pasado este punto,  rbol no procesado" ;badtarg_ptr
+0044 T 0000 " Pasado este punto,  rbol no procesado" ;badtarg2
+0045 U 0000 "%1 bytes de espacio en disco liberados",0 ;freebymes1
+0046 U 0000 "Se liberar¡an %1 bytes de espacio en disco" ;freebymes2
+0047 U 0000 "Volumen %1 creado %2 %3",CR,LF ;idmes_arg
+0048 U 0000 "Total de %1 unidades de asignaci¢n en el disco"
+0049 U 0000 "%1 bytes en cada unidad de asignaci¢n" ;idmes2
+0050 U 0000 "CHKDSK no disponible en unidad %1" ;msgExecFailure
+0051 U 0000 " Atributos Ampliados tiene clusters no v lidos, atributos truncados" ;Inv_XA_Msg
+0052 U 0000 " Error de asignaci¢n de Atributos Ampliados, atributos truncados" ;Alloc_XA_Msg
+0053 T 0000 "Par metro no v lido" ;badsw_arg
+0055 T 0000 "No se encontr¢ v¡a de acceso" ;invpath_arg
+0056 T 0000 "No se encontraron archivos" ;opnerr_arg
+0058 T 0000 " %1 clusters perdidos encontrados en %2 cadenas" ;orph_arg 0059 U 0000 CR,LF ;crlf_arg
+0060 T 0000 " No se puede hacer CHDIR al directorio ra¡z",CR,LF ;badcd_arg
+0061 U 0000 " Error de disco al grabar FAT %1" ;badw_arg
+0062 U 0000 " %1" ;noisy_arg
+0063 T 0000 "Directorio actual err¢neo" ;baddpbdir
+0064 U 0000 "%1",CR,LF ;file_arg
+0065 U 0000 " Espacio insuficiente en directorio ra¡z.",CR,LF," Mueva archivos de directorio ra¡z y repita CHKDSK" ;creatmes
+0066 U 0000 "%1 %2 %3" ;eup_arg
+0067 U 0000 "%1 %2, %3" ;usp_arg
+0068 U 0000 "%1%2%3%4%5" ;oth_arg
+0069 U 0000 "%1%2%3%4" ;time_arg
+0070 U 0000 "%1 unidades de asignaci¢n disponibles en disco" ;idmes2 ;an017;bgb
+DEBUG 4744 0062
+0004 U 0000 "Fall¢ asignaci¢n o el almacenam. intermedio especificado es demasiado peque¤o",CR,LF
+0005 U 0000 "Falta o no es v lida la informaci¢n del Mensaje",CR,LF
+0006 T 0000 "Nombre de dispositivo incorrecto" ;baddev_ptr
+0007 T 0000 "No pudo abrirse el dispositivo de salida PRN",CR,LF
+ "Introduzca el nombre del dispositivo de salida $" ;badlstmes_ptr
+0008 U 0000 CR,LF ;crlf_ptr
+0009 T 0000 CR,LF,"El programa termin¢ normalmente",CR,LF
+0010 T 0000 "Especificaci¢n err¢nea de dispositivo" ;nambad_ptr
+0012 T 0000 "Error en creaci¢n de archivo" ;noroom_ptr
+0013 T 0000 "Espacio insuficiente en disco" ;nospace_ptr
+0014 U 0000 "Error de disco al leer desde unidad %1" ;dr1_ptr
+0015 U 0000 "Error de disco al grabar en unidad %1" ;dr2_ptr
+0016 U 0000 "Error de protecci¢n contra grabaci¢n al leer desde unidad %1" ;dr3_ptr
+0017 U 0000 "Error de protecci¢n contra grabaci¢n al grabar en unidad %1" ;dr4_ptr
+0019 U 0000 "%1^ Error" ;synerr
+0020 T 0000 "Error en el archivo EXE o HEX" ;exebad_ptr/hexerr_ptr
+0021 T 0000 "No se puede grabar en los archivos EXE y HEX" ;exewrt_ptr/hexwrt_ptr
+0022 T 0000 "Error en EXEC" ;execemes_ptr
+0023 T 0000 "Error de grabaci¢n. Destino no est  definido" ;nonamespec_ptr
+0024 T 0000 "Acceso denegado" ;accmes_ptr
+0025 T 0000 "Error de paridad o error de memoria inexistente" ;paritymes_ptr
+0026 U 0000 "-" ;prompt_ptr
+0027 U 0000 "%1 -" ;change_flag_ptr
+0032 U 0000 "%1%2" ;unassem_ln_ptr
+0033 U 0000 "%1:%2 %3" ;hex_ptr
+0034 U 0000 "%1 %2" ;add_ptr
+0035 U 0000 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 U 0000 "%1=%2 " ;register_ptr
+0037 U 0000 "%1 Error" ;errmes_ptr
+0038 T 0000 "grabando %1 bytes" ;wrtmes_ptr
+0039 U 0000 "%1:%2=" ;loc_ptr
+0040 U 0000 "%1" ;little_ptr
+0041 U 0000 "%1" ;big_ptr
+0042 U 0000 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0043 T 0000 "%1 error %2 la unidad %3" ;dskerr_ptr
+0044 U 0000 32,8 ;bacmes_ptr
+0045 U 0000 "No puede asignarse manejador de mensajes",CR,LF ;fatal_error
+0046 U 0000 "%1" ;arg_buf_ptr
+0047 U 0000 "%1" ;one_char_buf_ptr
+0050 U 0000 "Se han asignado %1 de un total de %2 p ginas EMS",cr,lf
+0051 U 0000 "Se han asignado %1 de un total de %2 manejos EMS",cr,lf
+0054 U 0000 "Marco de P gina = "
+0055 U 0000 "Manejo creado = %1 ",cr,lf
+0056 U 0000 "P gina l¢gica %1 correlacionada con p gina f¡sica %2 ",cr,lf
+0057 U 0000 "Anomal¡a de 'hardware'/'software' EMS",cr,lf
+0058 U 0000 "Manejo no encontrado",cr,lf
+0059 U 0000 "C¢digo de funci¢n no v lido",cr,lf
+0060 T 0000 "No se pueden utilizar m s archivos$",cr,lf
+0061 U 0000 "Error de Save/Restore",cr,lf
+0062 U 0000 "Total de p ginas excedido",cr,lf
+0063 U 0000 "P ginas libres excedidas",cr,lf
+0064 T 0000 "Error Par metro",cr,lf
+0065 U 0000 "P gina L¢gica fuera de rango",cr,lf
+0066 U 0000 "P gina F¡sica fuera de rango",cr,lf
+0067 U 0000 "Area de salvar ya en uso",cr,lf
+0068 U 0000 "No se usa  rea de salvar",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 U 0000 "Falta o no es v lido par metro de EMS",cr,lf
+0072 U 0000 "Manejo %1 tiene %2 p ginas asignadas",cr,lf
+0074 U 0000 "Restauraci¢n de EMS satisfactoria",cr,lf
+0075 U 0000 "P gina f¡sica %1 = Segmento marco %2",cr,lf
+0076 U 0000 "Manejo %1 desasignado",cr,lf
+0078 U 0000 "EMS no instalado",cr,lf
+DRIVER 56ae 0002
+0002 T 0000 "No se especific¢ unidad",CR,LF
+0003 T 0000 "Cargada la unidad externa de disco para la unidad ",CR,LF
+EDLIN 5737 0028
+0006 U 0000 "*" ;prompt_ptr
+0007 T 0000 "Unidad o nombre de archivo no v lidos",CR,LF ;baddrv_ptr
+0008 T 0000 "Debe especificarse nombre de archivo",CR,LF ;ndname_ptr
+0009 T 0000 "Par metro no v lido",CR,LF ;opt_err_ptr
+0010 T 0000 "Archivo de s¢lo lectura",CR,LF ;ro_err_ptr
+0011 T 0000 "Error en creaci¢n de archivo",CR,LF ;bcreat_ptr
+0012 T 0000 "Demasiados archivos abiertos",CR,LF ;too_many_ptr
+0013 U 0000 "Error de lectura en:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0000 "No se puede editar archivo BAK - c mbielo de nombre",CR,LF ;nobak_ptr
+0015 T 0000 "No hay espacio para el archivo en el directorio",CR,LF ;nodir_ptr
+0016 T 0000 "Diskette lleno. Se perdi¢ la edici¢n.",CR,LF ;dskful_ptr
+0017 T 0000 "No se encontraron archivos",CR,LF ;filenm_ptr
+0018 T 0000 "Error de entrada",CR,LF ;badcom_ptr
+0019 T 0000 "Archivo nuevo",CR,LF ;newfil_ptr
+0020 T 0000 "No se encontr¢",CR,LF ;nosuch_ptr
+0021 T 0000 "¨OK? " ;ask_ptr
+0022 T 0000 "L¡nea demasiado larga",CR,LF ;toolng_ptr
+0023 T 0000 "Fin del archivo de entrada",CR,LF ;eof_ptr
+0024 T 0000 "¨Interrumpir la edici¢n (S/N)? " ;qmes_ptr
+0025 T 0000 "Debe especificar n£mero de l¡nea de destino",CR,LF ;dest_ptr
+0026 T 0000 "No hay espacio para a¤adir el archivo completo",CR,LF ;mrgerr_ptr
+0027 U 0000 CR,LF ;crlf_ptr
+0028 U 0000 LF ;lf_ptr
+0029 U 0000 "¨Continuar (S/N)?" ;cont_ptr
+0030 U 0000 "No puede imprimirse mensaje",CR,LF ;fatal_error
+0031 U 0000 "%1" ;arg_buf_ptr
+0032 U 0000 "%1:%2" ;line_num_buf_ptr
+0033 U 0000 "No se puede fusionar - No coincidencia de p gina de c¢digos",CR,LF ;cp_err_ptr
+EXE2BIN 5f0a 0010
+0002 T 0000 "Memoria insuficiente",CR,LF
+0003 U 0000 "No pueden encontrarse mensajes",CR,LF
+0004 T 0000 "Acceso denegado",CR,LF
+0005 U 0000 "No puede convertirse archivo",CR,LF
+0006 T 0000 "No se encontraron archivos",CR,LF
+0007 T 0000 "Error en creaci¢n de archivo",CR,LF
+0008 U 0000 "Se necesitan arreglos - segmento base (hex):"
+0009 T 0000 "Par metro no v lido",CR,LF
+0011 U 0000 "AVISO - Error de lectura en archivo EXE.",CR,LF
+ "La cantidad leida es menor que el tama¤o en la cabecera.",CR,LF
+0012 T 0000 "Debe especificarse nombre de archivo",CR,LF
+FIND 6155 0001
+0004 U 0000 "ENCONTRAR: "
+FORMAT 6184 0044
+0002 U 0000 CR,"%1 por ciento del disco con formato"
+0004 T 0000 CR,"Acci¢n de dar formato finalizada ",CR,LF
+0007 T 0000 "Inserte Tn nuevo diskette en la unidad %1:",CR,LF
+0009 T 0000 "Reinserte diskette en unidad %1:",CR,LF
+0010 T 0000 "Etiqueta de Volumen (m ximo 11 caracteres y/o INTRO)"
+0011 T 0000 CR,"Formato no soportado en la unidad %1: ", CR,LF
+0012 T 0000 CR,"Par metros de dispositivo no v lidos en unidad ",CR,LF
+0013 T 0000 CR,"Error en llamada IOCTL ",CR,LF
+0014 T 0000 CR,"Sin dispositivo de bloque ",CR,LF
+0015 T 0000 CR,"Error en grabaci¢n de FAT ",CR,LF
+0016 T 0000 CR,"Error en grabaci¢n de directorio ",CR,LF
+0017 T 0000 CR,"Unidad bajo mandato ASSIGN o SUBST - no se puede dar formato",CR,LF
+0018 T 0000 CR,"No se encontraron los archivos del Sistema",CR,LF
+0019 T 0000 CR,"No se puede usar FORMAT con una unidad de red",CR,LF
+0020 T 0000 CR,"Caracteres no v lidos en etiqueta de Volumen ",CR,LF
+0021 T 0000 CR,"Par metros no soportados",CR,LF
+0022 U 0000 CR,"Formato terminado ",CR,LF
+0023 T 0000 CR,"Diskette no adecuado para contener el Sistema",CR,LF
+0024 T 0000 CR,"Pista 0 defectuosa - diskette inutilizable ",CR,LF
+0025 T 0000 CR,"No es posible grabar BOOT ",CR,LF
+0026 T 0000 CR,"Error en lectura de directorio ",CR,LF
+0028 U 0000 CR,"y pulse INTRO cuando est‚ preparado..."
+0029 T 0000 CR,"ID de volumen no v lido ",CR,LF
+0031 T 0000 CR,"Introduzca la etiqueta de volumen para la unidad %1: "
+0032 T 0000 CR,"Par metro no compatible",CR,LF,"with fixed disk",CR,LF
+0035 T 0000 CR,"Error al leer la tabla de la partici¢n ",CR,LF
+0037 U 0000 CR,"Formato Interrumpido",CR,LF
+0038 U 0000 CR,"Formato no disponible en unidad %1",CR,LF
+0039 T 0000 CR,"Error en diskette o no tiene Sistema",CR,LF
+0040 T 0000 CR,"Tabla de partici¢n err¢nea ",CR,LF
+0041 T 0000 CR,"Par metros no soportados por la unidad ",CR,LF
+0042 U 0000 CR,LF
+0043 U 0000 CR,LF,LF
+0044 T 0000 CR,"Inserte el diskette del DOS en la unidad %1:",CR,LF
+0045 T 0000 CR,LF,"­ATENCION!: TODOS LOS DATOS ALMACENADOS EN ",CR,LF
+ "EL DISCO NO REMOVIBLE %1: SE PERDERAN.",CR,LF
+ "¨Quiere continuar (S/N)?"
+0046 T 0000 CR,"¨Dar formato a otro diskette (S/N)?"
+0047 T 0000 CR,"Error al leer la tabla de la partici¢n ",CR,LF
+0048 T 0000 CR,"Error al grabar la tabla de la partici¢n ",CR,LF
+0049 T 0000 CR,"Par metro no compatible", CR,LF
+0050 U 0000 "%1 unidades de asignaci¢n disponibles en disco",CR,LF
+0051 U 0000 "%1 bytes en cada unidad de asignaci¢n",CR,LF
+0052 T 0000 CR, "Error al grabar la tabla de la partici¢n ",CR,LF
+0053 U 0000 CR,"Introducido dos veces el mismo par metro",CR,LF
+0054 U 0000 CR,"Debe introducir los dos par metros /T y /N",CR,LF ;AN009;
+JOIN 6c8f 0001
+0002 T 0000 CR,LF,"El directorio no est  vac¡o",CR,LF
+MORE 6cda 0001
+0002 T 0000 "-- M s --$"
+PRINT 6d08 0022
+0002 U 0000 CR,LF
+0006 T 0000 " leyendo archivo",CR,LF,"$"
+0007 T 0000 "No se encontraron archivos",CR,LF,"$"
+0008 T 0000 CR,LF,LF,"Archivo $"
+0009 T 0000 "cancelado por el operador$"
+0010 T 0000 CR,LF,LF,"Todos los archivos cancelados por el operador$"
+0011 T 0000 "Tabla de asignaci¢n de archivos err¢nea en la unidad "
+0012 U 0000 "A.",CR,LF,"$"
+0013 T 0000 "Salida de listado no asignada a un dispositivo",CR,LF
+0014 T 0000 "Parte residente de PRINT instalada",CR,LF
+0015 T 0000 "No se puede usar PRINT - Use NET PRINT",CR,LF
+0017 T 0000 "Cola de impresi¢n llena",CR,LF
+0018 T 0000 "Cola de impresi¢n vac¡a",CR,LF
+0019 T 0000 "Acceso denegado",CR,LF
+0020 T 0000 "Especificaci¢n de unidad err¢nea",CR,LF
+0021 T 0000 "Los errores en el dispositivo de salida indican",CR,LF
+ "que ‚ste puede estar desconectado. Verif¡quelo.",CR,LF
+0022 T 0000 CR,LF,LF," %1 est  siendo impreso",CR,LF
+0023 T 0000 " %1 est  en cola",CR,LF
+0024 T 0000 "Archivo %1 no encontrado",CR,LF
+0025 T 0001 "Nombre de v¡a de acceso demasiado largo",CR,LF
+0026 T 0001 "Archivo no est  en cola de impresi¢n",CR,LF
+0027 T 0000 "Nombre del dispositivo de impresi¢n [PRN]: "
+RECOVER 71ab 0012
+0002 T 0000 CR,LF,"No se encontraron archivos",CR,LF ;File not found
+0003 U 0000 CR,LF,"No puede hacer RECOVER de una unidad ASIGNADA o SUSTITUIDA",CR,LF
+0004 T 0000 CR,LF,"Unidad o nombre de archivo no v lidos",CR,LF
+0005 T 0000 CR,LF,"­PRECAUCION! - directorio lleno",CR,LF
+0006 T 0000 CR,LF,"No se puede hacer RECOVER a una unidad de red", CR,LF ;Cannot %1 a Network drive
+0007 U 0000 CR,LF,"Recuperaci¢n no disponible en unidad %1",CR,LF
+0008 T 0000 CR,LF,"%1 archivo(s) recuperado(s)",CR,LF
+0009 T 0000 CR,LF,"%1 de %2 bytes recuperados",CR,LF
+0010 T 0000 CR,LF,"PTlse cualquier tecla para recuperar",CR,LF,"archivo(s) en unidad %1",CR,LF,CR,LF
+0011 U 0000 CR,LF,"No puede leerse tabla de asignaci¢n de archivos",CR,LF
+0012 U 0000 CR,LF,"No puede grabarse tabla de asignaci¢n de archivos",CR,LF
+0013 U 0000 CR,LF
+SORT 750b 0001
+0005 T 0000 "SORT: "
+SUBST 7535 0001
+0002 T 0000 CR,LF,"N£mero de par metros err¢neo",CR,LF
+SYS 7581 0008
+0004 T 0000 "Especificaci¢n de unidad err¢nea",CR,LF ; Old
+0007 T 0000 "No hay espacio para el Sistema en el diskette destino",CR,LF ; Old
+0008 T 0000 "Tama¤o del Sistema incompatible",CR,LF ; Old
+0010 T 0000 "No se encontr¢ el Sistema en la unidad por omisi¢n",CR,LF ; Old
+0011 U 0000 "No puede especificarse unidad por omisi¢n",CR,LF ; New
+0012 U 0000 "Error de grabaci¢n, diskette no utilizable",CR,LF ; New
+0014 T 0000 "Inserte el diskette del Sistema en la unidad %1",CR,LF ; Old
+0016 U 0000 "No se puede hacer SYS a sistema de archivos %1",CR,LF ; New
+SHARE 784c 0000
+NLSFUNC 7860 0000
+ANSI 7874 0001
+0010 T 0000 "Par metro '%1' no v lido",CR,LF ; 'Invalid parameter'
+IFSFUNC 78ce 0001
+0004 U 0000 "No encontrado ning£n controlador de IFS",CR,LF
+PSPRINT 791f 0007
+0002 T 0000 " leyendo archivo",CR,LF,FORMFD,BELL,"$"
+0003 U 0000 CR,LF,LF,"Archivo cancelado por operador",CR,FORMFD,BELL
+0004 T 0000 "Tabla de asignaci¢n de archivos err¢nea en la unidad "
+0005 U 0000 "A.",CR,LF,"$"
+0006 T 0000 "Salida de listado no asignada a un dispositivo",CR,LF
+0007 T 0000 "PSPRINT ya est  instalado",CR,LF
+0008 T 0000 "Conflicto entre PSPRINT/PRINT",CR,LF
+BACKUP 7ab6 0022
+0002 T 0000 CR,LF,"Memoria insuficiente",CR,LF
+0006 T 0000 CR,LF,"Especificaci¢n de unidad no v lida",CR,LF
+0014 T 0000 CR,LF,"Las unidades de origen y destino son las mismas",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0000 CR,LF,"Error en la apertura del archivo de anotaci¢n",CR,LF
+0018 T 0000 CR,LF,"Anotando en el archivo %1",CR,LF
+0019 T 0000 CR,LF,"Ultimo diskette de copia de seguridad no insertado",CR,LF
+0020 T 0000 CR,LF,"­Aviso! Los archivos del directorio",CR,LF
+ "%1:\ ra¡z de la unidad de destino se borrar n.",CR,LF
+0021 T 0000 CR,LF,"­Aviso! Los archivos del directorio",CR,LF
+ "%1:\BACKUP de la unidad de destino se borrar n.",CR,LF
+0022 T 0000 CR,LF,"*** Efectuando copia de seguridad de archivos a la unidad %1: ***",CR,LF
+0023 T 0000 "N£mero de Diskette: %1",CR,LF
+0024 T 0000 CR,LF,"­Aviso! No se han encontrado archivos para hacer copia de seguridad",CR,LF
+0025 T 0000 CR,LF,"Inserte el diskette origen de copia de seguridad en la unidad %1:",CR,LF
+0026 T 0000 CR,LF,"Inserte el diskette de copia de seguridad %1 en la unidad %2:",CR,LF
+0027 T 0000 CR,LF,"*** No es posible hacer copia de seguridad del archivo ***",CR,LF
+0028 T 0000 CR,LF,"Inserte el £ltimo diskette de copia de seguridad en la unidad %1:",CR,LF
+0029 T 0000 CR,LF,"El destino no se puede utilizar para hacer copia de seguridad",CR,LF
+0030 T 0000 CR,LF,"*** No se ha hecho copia de seguridad del £ltimo archivo ***",CR,LF
+0031 T 0000 CR,LF,"Dispositivo fijo de copias de seguridad %c: est  lleno",CR,LF
+0032 T 0000 CR,LF,"Error de disco lleno grabando en el Archivo de Registro de Errores de BACKUP",CR,LF
+0034 U 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 8181 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 81bb 0013
+0004 T 0000 "10 diferencias - FIN de la comparaci¢n",CR,LF
+0006 T 0000 "Error de comparaci¢n en OFFSET %1",CR,LF
+0007 T 0000 "Archivo 1 = %1",CR,LF
+0008 T 0000 "Archivo 2 = %1",CR,LF
+0009 T 0000 "No se encontr¢ marca de Fin de Archivo",CR,LF
+0010 T 0000 "Comparaci¢n de archivos ok",CR,LF
+0015 T 0000 CR,LF,CR,LF,"Teclee el nombre del primer archivo",CR,LF
+0016 T 0000 CR,LF,CR,LF,"Teclee el nombre del segundo archivo o la ID de la unidad",CR,LF
+0017 T 0000 "Los archivos son de longitud diferente",CR,LF
+0018 T 0000 "¨Comparar m s archivos (S/N)"
+0019 T 0000 "%1 and %2",CR,LF
+0020 U 0000 CR,LF
+0023 T 0000 "Comparaci¢n de archivos ok",CR,LF
+DISKCOMP 8460 0016
+0004 T 0000 "No especifique nombre(s) de archivo(s)",CR,LF
+ "Formato del Mandato: DISKCOMP d: d:[/1][/8]",LF,CR
+0005 T 0000 CR,LF,"Especificaci¢n de unidad err¢nea",CR,LF
+ "La unidad especificada no existe",CR,LF
+ "o no es removible",CR,LF
+0006 T 0000 CR,LF,"No se puede hacer DISKCOMP hacia o desde",CR,LF
+ "una unidad de red",CR,LF
+0007 T 0000 CR,LF,"Inserte el PRIMER diskette en la unidad %1",CR,LF
+0008 T 0000 CR,LF,"Inserte el SEGUNDO diskette en la unidad %1:",CR,LF
+0009 T 0000 CR,LF,"PRIMER diskette defectuoso o incompatible",CR,LF
+0010 T 0000 CR,LF,"SEGUNDO diskette defectuoso o incompatible",CR,LF
+0014 T 0000 CR,LF,"¨Comparar otro diskette (S/N)? "
+0015 T 0000 CR,LF,"Comparando %1 Pistas",CR,LF
+ "%2 Sectores/Pista, %3 Cara(s)",CR,LF
+0016 T 0000 CR,LF,"Tipo de unidad o de diskette",CR,LF
+ "no compatible",CR,LF
+0017 T 0000 CR,LF,"Error de lectura irrecuperable en la unidad %2",CR,LF
+ "Cara %3, Pistas %4",CR,LF
+0018 T 0000 CR,LF,"Error de comparaci¢n en",CR,LF,"Cara %3, Pistas %4",CR,LF
+0019 T 0000 "Aseg£rese de que el diskette fue insertado en",CR,LF ;AN004;
+ "la unidad y que ‚sta est  cerrada",CR,LF ;AN004;
+0020 T 0000 CR,LF,"Proceso de comparaci¢n terminado",CR,LF
+0021 T 0000 CR,LF,"Comparaci¢n OK",CR,LF
+0022 U 0000 CR,LF
+DISKCOPY 8994 0018
+0002 U 0000 CR,LF
+0004 T 0000 "No especifique nombre(s) de archivo(s)",CR,LF
+ "Formato del Mandato: DISKCOPY d: d:[/1]",CR,LF
+0005 T 0000 CR,LF,"Especificaci¢n de unidad err¢nea",CR,LF
+ "La unidad especificada no existe",CR,LF
+ "o no es removible",CR,LF
+0006 T 0000 CR,LF,"No se puede hacer DISKCOPY hacia o desde",CR,LF
+ "una unidad de red",CR,LF
+0007 T 0000 CR,LF,"Copiando con formato ",CR,LF
+0008 T 0000 CR,LF,"Inserte diskette ORIGEN en la unidad %1",CR,LF
+0009 T 0000 CR,LF,"Inserte diskette DESTINO la unidad %1",CR,LF
+0010 T 0000 "Aseg£rese de que el diskette fue insertado en",CR,LF ;AN004;
+ "la unidad y que ‚sta est  cerrada",CR,LF ;AN004;
+0011 T 0000 CR,LF,"El diskette DESTINO puede ser inutilizable",CR,LF
+0012 T 0000 CR,LF,"El diskette DESTINO es inutilizable",CR,LF
+0016 T 0000 CR,LF,"¨Copiar otro diskette (S/N)? "
+0017 T 0000 CR,LF,"Copiar %1 Pistas",CR,LF
+ "%2 Sectores/Pista, %3 Cara(s)",CR,LF
+0018 T 0000 CR,LF,"Tipo de unidad o de diskette",CR,LF
+ "no compatible",CR,LF
+0017 T 0000 CR,LF,"Error de lectura irrecuperable en la unidad %1",CR,LF
+ "Cara %2, Pistas %3",CR,LF
+0017 T 0000 CR,LF,"Error de grabaci¢n irrecuperable en la unidad %1",CR,LF
+ "Cara %2, Pistas %3",CR,LF
+0021 T 0000 CR,LF,"Proceso de Copia terminado",CR,LF
+0022 T 0000 CR,LF,"PRIMER diskette defectuoso o incompatible",CR,LF
+0023 T 0000 CR,LF,"SEGUNDO diskette defectuoso o incompatible",CR,LF
+LABL 8f56 0000
+MODE 8f6a 0055
+0003 T 0000 CR,LF,"Debe especificarse COM1 o COM2",CR,LF
+0004 T 0000 CR,LF,"Parte residente de MODE cargada",CR,LF
+0005 T 0000 CR,LF,"Nombre de dispositivo err¢neo",CR,LF
+0006 T 0000 CR,LF,"Error de impresora",CR,LF
+0007 T 0000 CR,LF,"LPT%1: fijado para 80",CR,LF
+0008 T 0000 CR,LF,"LPT%1: set for 132",CR,LF
+0009 T 0000 CR,LF,"Se han fijado las l¡neas por pulgada en impresora",CR,LF
+0010 T 0000 CR,LF,"Velocidad en baudios no v lida",CR,LF
+0011 U 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 U 0000 "0123456789"
+0013 U 0001 CR,LF,"¨Ve el %1? (S/N) "
+0014 T 0000 CR,LF,"Par metros no v lidos",CR,LF
+0015 T 0000 "LPT%1: redireccionado a COM%2:",CR,LF
+0016 T 0000 "LPT%1: no redireccionado",CR,LF
+0017 T 0000 CR,LF,"%1 reintentos de tiempo de espera en impresora paralelo",CR,LF
+0018 T 0000 CR,LF," Imposible desplazar la pantalla a la %1",CR,LF
+0020 T 0000 CR,LF,"N£mero de par metros no v lido",CR,LF
+0021 T 0000 CR,LF,"NET 042: Imposible ejecutar el mandato pedido",CR,LF
+0022 T 0000 CR,LF,"La impresora de la Red no soporta infinitos reintentos ",cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 T 0000 CR,LF,"Error al acceder al dispositivo: %1",CR,LF
+0025 T 0000 CR,LF,"Dispositivo o code page no est n en el archivo de tipo de letra",CR,LF
+0026 T 0000 CR,LF,"Contenido del archivo de tipo de letra no v lido",CR,LF
+0027 T 0000 CR,LF,"code page preparada previamente, sustituida",CR,LF
+0028 T 0000 CR,LF,"La code page activa para el dispositivo %1 es %2",CR,LF
+0029 T 0000 CR,LF,"Dispositivo %1 no preparado",CR,LF
+0030 T 0000 "code pages %1:",CR,LF
+0031 T 0000 " code page %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH code page ID
+0032 T 0000 CR,LF,"Finalizada la funci¢n de MODE code page %1",CR,LF
+0033 U 0000 CR,LF,"Error %1 P gina de C¢digos Global",CR,LF ;FILLED IN with "setting" or "getting"
+0034 T 0000 CR,LF,"Valores actuales de la code page:",CR,LF ;table header
+0035 U 0000 " %1 - %2 P gina de C¢digos",CR,LF
+0036 T 0000 " code page no preparada",CR,LF
+0037 T 0000 "Operaci¢n de code page no soportada en este dispositivo",CR,LF
+0038 T 0000 "No se ha SELECCIONADO code page",CR,LF
+0039 T 0000 "Error de dispositivo durante %S",CR,LF
+0040 T 0000 "code page no preparada",CR,LF
+0041 T 0000 CR,LF,"El teclado actual no soporta esta code page",CR,LF
+0042 T 0000 CR,LF,"Error durante la lectura del archivo de tipo de letra",CR,LF
+0043 T 0000 CR,LF,"No se puede efectuar la operaci¢n de REFRESCO",CR,LF
+0044 U 0000 CR,LF ;used for formatting
+0045 U 0000 CR,LF,"Estado para dispositivo %1:",CR,LF ;header for status reports
+0046 U 0000 "------------------------" ;first part of underline under "Status for device %1:"
+0047 U 0000 "----",CR,LF ;four_char_underline
+0048 U 0000 "-----",CR,LF ;five_char_underline
+0049 U 0000 "LINEAS=%1",CR,LF
+0050 U 0000 "COLUMNAS=%1",CR,LF
+0051 U 0000 CR,LF,"RATE y DELAY deben especificarse juntos",CR,LF
+0052 U 0000 "RATE=%1",CR,LF
+0053 U 0000 "DELAY=%1",CR,LF
+0054 U 0000 CR,LF,"Funci¢n no soportada en este sistema - %1",CR,LF
+0055 U 0000 CR,LF,"Tipo de letra requerida no cargada",CR,LF
+0056 U 0000 CR,LF,"ANSI.SYS debe estar instalado para ejecutar la funci¢n solicitada",CR,LF
+0057 U 0000 CR,LF,"Requerida velocidad en baudios",CR,LF
+0058 U 0000 "RETRY=%1",CR,LF
+RESTORE 9cca 0022
+0002 T 0000 CR,LF,"Las unidades de origen y destino son las mismas",CR,LF
+0003 T 0000 CR,LF,"N£mero de par metros no v lido",CR,LF
+0006 T 0000 CR,LF,"Especificaci¢n de unidad err¢nea",CR,LF
+0007 T 0000 CR,LF,"­Aviso! No se han encontrado archivos para restaurar",CR,LF
+0008 T 0000 CR,LF,"Inserte el diskette de copia de seguridad %1 en la unidad %2",CR,LF
+0009 T 0000 CR,LF,"Inserte el destino de restauraci¢nen la unidad %1:",CR,LF
+0011 T 0000 CR,LF,"­Aviso! Diskette fuera de secuencia",CR,LF
+ "Sustituya el diskette o contin£e si es correcto",CR,LF
+0012 T 0000 CR,LF,"El £ltimo archivo no se restaur¢",CR,LF
+0013 T 0000 CR,LF,"*** Se hizo copia de seguridad de los archivos %1 *** ",CR,LF
+0014 T 0000 CR,LF,"El origen no contiene archivos de copia de seguridad",CR,LF
+0015 T 0000 CR,LF,"Memoria insuficiente",CR,LF
+0016 T 0000 CR,LF,"­Aviso! El archivo %1",CR,LF
+ "es un archivo de s¢lo lectura",CR,LF
+ "¨Sustituir el archivo (S/N)? ",CR,LF
+0017 T 0000 CR,LF,"Error de secuencia en archivo restaurado",CR,LF
+0018 T 0000 CR,LF,"Error de creaci¢n de archivo",CR,LF
+0019 T 0000 CR,LF,"Espacio insuficiente en disco",CR,LF
+0020 T 0000 CR,LF,"*** No es posible restaurar el archivo ***",CR,LF
+0021 T 0000 CR,LF,"*** Restaurando archivos desde la unidad %1: ***",CR,LF
+0022 T 0000 CR,LF,"­Aviso! El archivo %1",CR,LF
+ "se cambi¢ despu‚s de efectuar copia de seguridad",CR,LF
+ "¨Sustituir el archivo (S/N)? ",CR,LF
+0023 U 0000 "Diskette: %1",CR,LF
+0024 U 0000 CR,LF,"Error extra¤o, llame a Russ Whitehead @ 8-3863",CR,LF
+0025 U 0000 07 ;For BEEP !
+0026 U 0000 CR,LF,"Error al restaurar atributos ampliados",CR,LF
+SELECT a34c 0016
+0004 U 0000 "SELECT Soporte de Arranque No V lido",CR,LF,CR,LF
+ "Inserte diskette INSTALL en unidad A:, despu‚s vuelva a intentarlo"
+0005 U 0000 "Soporte de Disco/Diskette No V lido",CR,LF,CR,LF
+ "Inserte diskette INSTALL en unidad A:, despu‚s vuelva a intentarlo"
+0006 U 0000 "Par metros No V lidos en SELECT L¡nea de Mandatos",CR,LF,CR,LF
+ "Aseg£rese de que el diskette INSTALL est‚ en la unidad A:,",CR,LF
+ "despu‚s pulse Control+Alt+Supr para volver a arrancar."
+0007 U 0000 BELL,"No puede instalarse el DOS. Programa terminado",CR,LF
+0008 U 0000 "Se est  cargando SELECT. Espere..."
+0009 U 0000 "Debe volver a arrancar el sistema para continuar.",CR,LF,CR,LF
+ "Pulse Control+Alt+Supr para continuar con la instalaci¢n del DOS."
+0010 U 0000 "Inserte el diskette SELECT en la unidad A:",CR,LF,CR,LF
+ "Pulse Intro para continuar con la instalaci¢n del DOS,",CR,LF
+ "o pulse Esc para salir.",CR,LF
+0011 U 0000 BELL
+0012 U 0000 "Inserte el diskette SELECT en la unidad A:",CR,LF,CR,LF
+ "Pulse Intro para continuar",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE ab07 0004
+0002 T 0000 "LISTADO DE VIAS DE ACCESO AL DIRECTORIO %1 DEL VOLUMEN ",CR,LF ;define message
+0003 T 0000 "LISTADO DE VIAS DE ACCESO AL DIRECTORIO ",CR,LF ;
+0004 T 0000 "No existen sub-directorios",CR,LF,LF ;
+0007 U 0000 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE ac28 0009
+0003 T 0000 CR,LF,"No se sustituy¢ ning£n archivo",CR,LF
+0004 T 0000 CR,LF,"No se a¤adieron archivos",CR,LF
+0013 T 0000 CR,LF,"Sustituyendo %1",CR,LF
+0014 T 0000 CR,LF,"A¤adiendo %1",CR,LF
+0015 T 0000 CR,LF,"%1 archivo(s) sustituido(s)",CR,LF
+0016 T 0000 CR,LF,"%1 archivo(s) a¤adido(s)",CR,LF
+0017 T 0000 CR,LF,"No se encontraron archivos '%1'",CR,LF
+0022 T 0000 CR,LF,"Sustituir %1? (S/N) "
+0023 T 0000 CR,LF,"¨A¤adir %1? (S/N) "
+XCOPY adf6 0019
+0004 T 0000 "¨Especifica el %1 un nombre de archivo ",CR,LF
+ "o de directorio de destino",CR,LF
+ " (A = Archivo, D = Directorio)?"
+0005 T 0000 "Pulse cualquier tecla para comenzar a copiar archivos"
+0006 T 0000 "V¡a de acceso demasiado larga",CR,LF
+0008 T 0000 "No se puede realizar una copia c¡clica",CR,LF
+0012 T 0000 "No se puede ejecutar XCOPY desde un dispositivo reservado",CR,LF
+0021 T 0000 "N£mero de par metros no v lido",CR,LF
+0022 T 0000 "No se puede ejecutar XCOPY a un dispositivo reservado",CR,LF
+0024 T 0000 "Error en creaci¢n de archivo",CR,LF
+0025 T 0000 "Leyendo archivo(s) fuente(s)...",CR,LF
+0026 U 0000 CR,LF
+0027 T 0000 "%1 Archivo(s) copiado(s)",CR,LF
+0028 T 0000 "%1 No se encontraron archivos",CR,LF
+0029 U 0000 "F D "
+0030 U 0000 "%1%2",CR,LF
+0031 U 0000 "%1\%2",CR,LF
+0032 U 0000 "%1",CR,LF
+0033 U 0000 "%1%2 ¨(S/N)?"
+0034 U 0000 "%1\%2 ¨(S/N)?"
+0035 U 0000 "Conmutador %1 no v lido",CR,LF
+VDISK b1b4 0013
+0002 T 0000 "Memoria insuficiente",CR,LF
+0003 T 0000 "VDISK Version 3.40 disco virtual %1",CR,LF
+0004 T 0000 " Tama¤o de almacenamiento intermedio ajustado",CR,LF
+0005 T 0000 " Tama¤o de sector ajustado",CR,LF
+0006 T 0000 " Entradas de directorio ajustadas",CR,LF
+0007 T 0000 " Car cter de cambio no v lido",CR,LF
+0008 T 0000 " Tama¤o de transferencia ajustado",CR,LF
+0009 T 0000 " Tama¤o de buffer: %1",CR,LF
+0010 T 0000 " Tama¤o de sector: %1",CR,LF
+0011 T 0000 " Entradas de directorio: %1",CR,LF
+0012 T 0000 " Tama¤o de transferencia:%1",CR,LF
+0013 T 0000 "VDISK no instalado -"
+0014 T 0000 " Los conmutadores de la",CR,LF
+GRAFTABL b468 0005
+0002 T 0000 "P gina de c¢digos activa: %1",CR,LF
+0003 U 0000 "P gina de C¢digos Previa: %1",CR,LF
+0004 T 0000 "Ninguno",NULL
+0005 U 0000 "No est ndar",NULL
+0006 U 0000 CR,LF,"Par metros soportados de l¡nea de mandatos del DOS",COLON,CR,LF,LF
+ " /STA - S¢lo Pedir Estado",CR,LF
+ " ? - Visualizar este resumen de par metros",CR,LF,CR,LF
+ " P ginas de C¢digos disponibles",COLON,CR,LF
+ " 437 - Juego de Caracteres Gr fico USA",CR,LF
+ " 850 - Juego de Caracteres Gr fico de M£ltiples Lenguas",CR,LF
+ " 860 - Juego de Caracteres Gr fico del Portugu‚s",CR,LF
+ " 863 - Juego de Caracteres Gr fico del Franc‚s del Canad ",CR,LF
+ " 865 - Juego de Caracteres Gr fico N¢rdico",CR,LF
+FASTOPEN b749 0016
+0004 T 0000 CR,LF,"FASTOPEN instalado",CR,LF
+0005 T 0000 CR,LF,"FASTOPEN ya ha sido instalado",CR,LF
+0006 T 0000 CR,LF,"Par metro no v lido",CR,LF
+0007 T 0000 CR,LF,"Demasiadas entradas de unidad",CR,LF
+0008 T 0000 CR,LF,"La misma unidad est  especificada m s de una vez",CR,LF
+0009 T 0000 CR,LF,"Par metro no v lido",CR,LF
+0010 U 0000 CR,LF,"Tipo de conmutador no v lido",CR,LF
+0011 U 0000 CR,LF,"Entrada de extensi¢n no v lida",CR,LF
+0012 U 0000 CR,LF,"N£mero no v lido de entradas de archivos/directorios",CR,LF
+0013 U 0000 CR,LF,"No puede configurarse la memoria expandida",CR,LF
+0014 U 0000 CR,LF,"Memoria expandida no disponible",CR,LF
+0015 T 0000 CR,LF,"Especificaci¢n de unidad err¢nea %1",CR,LF
+0016 U 0000 CR,LF,"No hay suficiente espacio en EMS. Se utiliza memoria baja",CR,LF
+0017 T 0000 CR,LF,"No puede utilizar FASTOPEN para la unidad %1",CR,LF
+0018 U 0000 CR,LF,"Demasiadas entradas de extensiones",CR,LF
+0019 U 0000 CR,LF,"Demasiadas entradas de archivos/directorios",CR,LF
+APPEND bb4b 0009
+0001 T 0000 "Versi¢n incorrecta del APPEND",CR,LF
+0002 T 0000 "V¡a de acceso err¢nea",CR,LF
+0003 T 0000 "Par metro no v lido",CR,LF
+0004 U 0000 "Combinaci¢n de par metros no v lida",CR,LF
+0005 T 0000 "No hay APPEND",CR,LF
+0006 T 0000 "Conflicto entre APPEND/ASSIGN",CR,LF
+0007 T 0000 "Conflicto entre APPEND/TopView",CR,LF
+0008 T 0000 "Versi¢n incorrecta del DOS",CR,LF
+0009 T 0000 "APPEND ya est  instalado",CR,LF
+GRAPHICS bd07 0012
+0005 T 0000 "Par metro no v lido$",CR,LF ;AN000
+0007 U 0000 "Par metros duplicados no permitidos",CR,LF ;AN000
+0009 U 0000 "No puede encontrarse el perfil GRAPHICS",CR,LF ;AN000
+0010 U 0000 "Falta sentencia de perfil requerida antes de la l¡nea %1",CR,LF ;AN000
+0011 U 0000 "Sentencia de perfil no v lida en la l¡nea %1",CR,LF ;AN000
+0012 U 0000 "Sentencia de perfil fuera de secuencia en la l¡nea %1",CR,LF ;AN000
+0013 U 0000 "Error al leer perfil GRAPHICS",CR,LF ;AN000
+0014 U 0000 "Errores de sintaxis en perfil GRAPHICS",CR,LF ;AN000
+0015 U 0000 "El ID de recuadro de impresi¢n no est  en perfil GRAPHICS",CR,LF
+0016 U 0000 "El tipo de impresora no est  en el perfil GRAPHICS",CR,LF ;AN000
+0017 U 0000 "/B no es v lido con una impresora en blanco y negro",CR,LF ;AN000
+0018 U 0000 "No se puede volver a cargar con el perfil suministrado",CR,LF ;AN000
+DISPLAY c1a2 0003
+0002 T 0000 "%1 no puede inicializarse",CR,LF
+0008 T 0000 "Memoria insuficiente",CR,LF
+0012 T 0000 "Sintaxis no v lida en el controlador de p gina de c¢digos DISPLAY.SYS",CR,LF
+PRINTER c26a 0002
+0002 T 0000 "%1 no puede inicializarse",CR,LF
+0012 T 0000 "Sintaxis no v lida en el controlador de p gina de c¢digos PRINTER.SYS",CR,LF
+KEYB c308 0016
+0002 T 0000 "C¢digo de teclado actual: %1"
+0003 U 0000 "ID del teclado actual: %1"
+0004 T 0000 " p gina de c¢digos: %1",CR,LF
+0005 T 0000 "P gina de c¢digos CON actual: %1",CR,LF
+0006 T 0000 "C¢digo de teclado especificado no v lido",CR,LF
+0007 U 0000 "Especificado ID de teclado no v lido",CR,LF
+0008 T 0000 "P gina de c¢digos especificada no v lida",CR,LF
+0009 T 0000 "Archivo de Definici¢n de Teclado est  mal o falta",CR,LF
+0010 T 0000 "No se ha instalado KEYB",CR,LF
+0011 T 0000 "P gina de c¢digos activa no disponible en dispositivo CON",CR,LF
+0012 T 0000 "La p gina de c¢digos especificada no se ha preparado",CR,LF
+0013 T 0000 "Una o m s p ginas de c¢digos CON no v lidas para el c¢digo de teclado dado",CR,LF
+0014 T 0000 "La p gina de c¢digos solicitada (%1) no es v lida para el teclado dado",CR,LF
+0015 T 0000 "La p gina de c¢digos especificada no corresponde con la seleccionada",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0000 "No se puede crear la tabla KEYB en la memoria residente",CR,LF
+REDIRSYS c757 0000
+MEM c76b 0036
+0010 U 0000 CR,LF
+0011 U 0000 " Direcci¢n Nombre Tama¤o Tipo ",CR,LF
+0012 U 0000 " ÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 U 0000 " Manejo Nombre EMS Tama¤o ",CR,LF
+0014 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "Total de %1 bytes de memoria",CR,LF
+0019 U 0000 "%1 bytes disponibles",CR,LF
+0020 U 0000 "%1 tama¤o m s grande de programa ejecutable",CR,LF
+0021 U 0000 "Total de %1 bytes de memoria EMS",CR,LF
+0022 U 0000 "%1 bytes de memoria EMS libre",CR,LF
+0023 U 0000 "Total de %1 bytes de memoria ampliada",CR,LF
+0024 U 0000 "Vector de Interrupci¢n",0
+0025 U 0000 "Area de Comunicaciones ROM",0
+0026 U 0000 "Area de Comunicaciones DOS",0
+0027 U 0000 "IBMBIO",0
+0028 U 0000 "IBMDOS",0
+0029 U 0000 "Datos del Sistema",0
+0030 U 0000 "Programa del Sistema",0
+0031 U 0000 "Controlador de Dispositivos del Sistema",0
+0032 U 0000 "Controlador de Dispositivos Instalados",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "ALMACENAMIENTOS INTERMEDIOS=",0
+0036 U 0000 "ARCHIVOS=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "PILAS=",0
+0039 U 0000 "DISPOSITIVO=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "ULTIMA UNIDAD=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+REDIR cd69 0040
+0004 U 0000 "No se ha arrancado la red",CR,LF
+0050 U 0000 "NET809: Petici¢n de red no soportada",CR,LF,0
+0051 U 0000 "NET801: El sistema remoto no recibe",CR,LF,0
+0052 U 0000 "NET802: Nombre duplicado en red",CR,LF,0
+0053 U 0000 "NET803: V¡a de acceso de red no encontrada",CR,LF,0
+0054 U 0000 "NET804: Red ocupada",CR,LF,0
+0055 U 0000 "NET805: El dispositivo de red ya no existe",CR,LF,0
+0056 U 0000 "NET806: Excedido el l¡mite de mandatos Net BIOS",CR,LF,0
+0057 U 0000 "NET807: Error del sistema; error de NETBIOS",CR,LF,0
+0058 U 0000 "NET808: Respuesta incorrecta de la red",CR,LF,0
+0059 U 0000 "NET810: Error de red inesperado",CR,LF,0
+0060 U 0000 "NET811: Adaptador remoto incompatible",CR,LF,0
+0061 U 0000 "NET812: Cola de impresi¢n llena",CR,LF,0
+0062 U 0000 "NET813: No hay suficiente espacio para el archivo de impresi¢n",CR,LF,0
+0063 U 0000 "NET814: Se cancel¢ el archivo de impresi¢n",CR,LF,0
+0064 U 0000 "NET815: Se suprimi¢ el nombre de red",CR,LF,0
+0065 U 0000 "Acceso denegado",CR,LF,0
+0066 U 0000 "NET817: Tipo de dispositivo de red incorrecto",CR,LF,0
+0067 U 0000 "NET818: Nombre de red no encontrado",CR,LF,0
+0068 U 0000 "NET819: Excedido el l¡mite de nombres de red",CR,LF,0
+0069 U 0000 "NET820: Excedido l¡mite de sesiones Net BIOS",CR,LF,0
+0070 U 0000 "NET821: Compartir est  temoralmente en una pausa",CR,LF,0
+0071 U 0000 "NET823: Petici¢n de red no aceptada",CR,LF,0
+0072 U 0000 "NET822: La impresi¢n o el redireccionamiento de disco est  en una pausa",CR,LF,0
+0073 U 0000 "NET476: Netbeui no cargado",CR,LF,0
+0074 U 0000 "NET477: Cierre de adaptador inesperado",CR,LF,0
+0075 U 0000 "NET826: Tama¤o del Servidor de Destino /RQB demasiado peque¤o",CR,LF,0
+0076 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0077 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0078 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0079 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0080 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0081 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0082 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0083 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0084 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0085 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0086 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0087 U 0000 "NET???: Error de red inesperado",CR,LF,0
+0088 U 0000 "NET825: Anomal¡a de datos de red",CR,LF,0
+FILESYS d6f2 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 U 0000 "%1 REDIR %2",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+XMA2EMS d834 0017
+0001 U 0000 "XMA2EMS: Gestor de Memoria Expandida Versi¢n 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 Todos los derechos reservados",CR,LF,"$"
+0002 U 0000 CR,LF,"XMA001 Ejecuci¢n de diagn¢sticos VMO/XMA: ","$"
+0003 U 0000 "XMA002 Diagn¢sticos terminados ",CR,LF,LF,"$"
+0004 U 0000 "XMA003 El Marco de P gina comienza en..................... "
+0005 U 0000 "XXXX",":0",CR,LF,"$"
+0006 U 0000 "XMA004 P ginas correlacionadas con memoria convencional... "
+0007 U 0000 "0 ",CR,LF,"$"
+0008 U 0000 "XMA005 P ginas reservadas para Programa de Control........ "
+0009 U 0000 "0 ",CR,LF,"$"
+0010 U 0000 "XMA006 P ginas disponibles para memoria expandida......... "
+0011 U 0000 "0 ",CR,LF,"$"
+0012 U 0000 CR,LF,"XMA100 Error de adaptador:",CR,LF," NO se ha instalado el Gestor de Memoria Expandida",CR,LF,"$"
+0013 U 0000 CR,LF,"XMA200 No puede encontrarse adaptador:",CR,LF," Gestor de Memoria Expandida NO instalado",CR,LF,"$"
+0014 U 0000 CR,LF,"XMA300 Error en sintaxis o valor de par metro:",CR,LF
+ " NO se ha instalado el Gestor de Memoria Expandida",CR,LF,"$"
+0015 U 0000 SIZE1_END - 2 -$
+0016 U 0000 4 DUP (?)," KB OK",CR,LF,"$"
+0017 U 0000 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FDISK dd3b 0120
+0004 T 0000 "No se puede efectuar FDISK con la red cargada.",CR,LF
+0005 T 0000 "No hay Disco Fijo",CR,LF
+0006 T 0000 "Error de lectura en Disco Fijo",CR,LF
+0007 T 0000 "Error de grabaci¢n en Disco Fijo",CR,LF
+1001 U 0000 "IBM Personal Computer"
+1002 T 0000 "Programa de Utilidad del Disco Fijo Versi¢n 3.40"
+1003 T 0000 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0000 "Opciones de FDISK"
+1005 U 0000 "1. <R>Crear Partici¢n del DOS o Unidad L¢gica del DOS"
+1006 U 0000 "2. <R>Definir partici¢n activa"
+1007 U 0000 "3. <R>Suprimir Partici¢n del DOS o Unidad L¢gica del DOS"
+1008 T 0000 "4. <R>Visualizar particiones"
+1009 U 0000 "Pulse <H>Esc<R> para salir de FDISK"
+1010 T 0000 "Elija una de las siguientes opciones:"
+1011 T 0000 "5. <R>Seleccionar otra unidad de Disco Fijo"
+1012 T 0000 "Unidad actual de Disco Fijo: <H><I>"
+1013 U 0000 "­Aviso! <R>No hay particiones definidas como activas - el disco 1 no puede"
+1014 U 0000 "arrancarse a menos que se defina una partici¢n como activa"
+1015 T 0000 "Teclee una opci¢n: [<S> ]"
+1016 U 0000 "Crear Partici¢n del DOS o Unidad L¢gica del DOS"
+1017 T 0000 "1. <R>Crear partici¢n Primaria del DOS"
+1018 T 0000 "2. <R>Crear partici¢n Ampliada del DOS"
+1019 T 0000 "3. <R>Crear unidad(es) l¢gica(as) del DOS en la partici¢n Ampliada del DOS"
+1020 T 0000 "Pulse <H>ESC<R> para volver al men£ de FDISK"
+1021 T 0000 "Crear Partici¢n Primaria del DOS"
+1022 T 0000 "¨Desea utilizar el tama¤o m ximo para una partici¢n del DOS y activar la"
+1023 U 0000 "partici¢n del DOS (<S>/<N>).........? <H>[<S> ]"
+1024 T 0000 "(<S>/<N>)...................................................? <H>[<S> ]"
+1025 U 0000 "Estado Partici¢n Tipo Tama¤o en Mbytes Porcentaje de Disco Utilizado"
+1026 U 0000 "El espacio total en disco es de <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 U 0000 "El m ximo espacio disponible para la partici¢n es de <HIIIIR> Mbytes (<HIIIIR>)"
+1028 U 0000 "Introduzca el tama¤o de la partici¢n en Mbytes o el porcentaje de"
+1029 U 0000 "espacio en disco (%) para crear una Partici¢n Primaria del DOS....: <H>[<IIISI>]"
+1030 T 0000 "Crear Partici¢n Ampliada del DOS"
+1031 T 0000 "Crear una Partici¢n Ampliada del DOS..............................: <H>[<IIISI>]"
+1032 U 0000 "Pulse <H>Esc<R> para continuar"
+1033 U 0000 "Crear Unidad(es) L¢gica(s) del DOS en la Partici¢n Ampliada del DOS"
+1034 U 0000 "Unidad Volumen Etiqueta Mbytes Sistema Uso"
+1035 U 0000 "Tama¤o total Partic. Ampliada DOS es <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 U 0000 "M ximo espacio disponible para unidad l¢gica es <HIIIIR> Mbytes <H>(<IIII>)"
+1037 U 0000 "Intro. tama¤o unidad l¢gica Mbytes o porcentaje espacio disco (%).<H>[<IIISI>]"
+1038 U 0000 "Defina Partici¢n Activa"
+1039 T 0000 "Teclee el n£mero de la partici¢n que",CR,LF,"desea activar.....................: <H>[<S> ]"
+1040 U 0000 "Suprimir la Partici¢n del DOS o la Unidad L¢gica del DOS"
+1041 T 0000 "1. <R>Suprimir la partici¢n Primaria",CR,LF,"del DOS"
+1042 T 0000 "2. <R>Suprimir la partici¢n Ampliada",CR,LF,"del DOS"
+1043 T 0000 "3. <R>Suprimir unidad(es) l¢gica(s) del",CR,LF,"DOS en la Partici¢n Ampliada del DOS"
+1044 T 0000 "Suprimir la Partici¢n Primaria del DOS"
+1045 U 0000 "­Aviso! <OR>Se perder n los datos de la Partici¢n Primaria del DOS suprimida."
+1046 U 0000 "¨Desea continuar (<S>/<N>).................? <H>[<S> ]"
+1047 U 0000 "Suprimir la Partici¢n Ampliada del DOS"
+1048 U 0000 "­Aviso! <OR>Se perder n los datos de la Partici¢n Ampliada del DOS suprimida."
+1049 U 0000 "¨Desea continuar (<S>/<N>).................? <H>[<S> ]"
+1050 U 0000 "Suprimir Unidad(es) L¢gica(s) del DOS en la Partici¢n Ampliada del DOS"
+1051 U 0000 "­Aviso! <OR>Se perder n los datos de la Unidad L¢gica del DOS suprimida."
+1052 U 0000 "¨Qu‚ unidad quiere suprimir...............................? <H>[<S> ]"
+1053 U 0000 "¨Est  seguro (<S>/<N>)..............................? <H>[<S> ]"
+1054 U 0000 "Introduzca la Etiqueta del Volumen..............? <H>[<S> ]"
+1055 U 0000 "Visualizar Informaci¢n de Particiones"
+1056 U 0000 "La Partici¢n Ampliada del DOS contiene Unidades L¢gicas del DOS."
+1057 U 0000 "¨Quiere visualizar la informaci¢n de las unidad l¢gicas (<S>/<N>)...?<H>[<S> ]"
+1058 U 0000 "Visualizar Informaci¢n de las Unidades L¢gicas del DOS"
+1059 U 0000 "El sistema volver  a arrancar ahora"
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0000 "Pulse cualquier tecla para continuar <S>"
+1062 T 0000 "Suprimida la partici¢n primaria del DOS"
+1063 T 0000 "Extended DOS Partition deleted"
+1064 T 0000 "Drive deleted"
+1065 T 0000 "Partition <I> made active"
+1066 T 0000 "Suprimida la partici¢n ampliada del DOS"
+1067 T 0000 "Creada la partici¢n ampliada del DOS"
+1068 T 0000 "Unidad l¢gica DOS creada. La letra",CR,LF,"de la unidad est  cambiada o a¤adida.<W>"
+1069 T 0000 "No hay particiones definidas"
+1070 T 0000 "No hay unidades l¢gicas definidas"
+1071 T 0000 "Las letras de la(s) unidad(es) se han ",CR,LF,"cambiado o suprimido<W>"
+1072 U 0000 "Unidad redireccionada"
+1073 U 0000 "Creada Partici¢n Primaria del DOS, letras de unidad cambiadas o a¤adidas"
+1074 T 0000 "No hay Disco Fijo"
+1075 T 0000 "Error de lectura en Disco Fijo"
+1076 T 0000 "Error de grabaci¢n en Disco Fijo"
+1077 T 0000 "Versi¢n de DOS incorrecta."
+1078 T 0000 "No se puede efectuar FDISK con la red cargada."
+1079 T 0000 "No hay partici¢n Primaria del DOS para suprimir.<W>"
+1080 T 0000 "No hay partici¢n Ampliada del DOS para suprimir.<W>"
+1081 T 0000 "La partici¢n Primaria del DOS ya existe."
+1082 T 0000 "La partici¢n Ampliada del DOS ya existe."
+1083 T 0000 "No hay espacio para crear una partici¢n del DOS.<W>"
+1084 T 0000 "El tama¤o de la unidad l¢gica requerida",CR,LF,"excede del espacio m ximo disponible.<W>"
+1085 T 0000 "El tama¤o de la partici¢n solicitada",CR,LF,"excede del espacio m ximo disponible.<W>"
+1086 T 0000 "No existe una partici¢n del DOS para suprimir.<W>"
+1087 U 0000 "La £nica partici¢n que puede arrancar en la Unidad 1 ya est  como activa.<W>"
+1088 T 0000 "No hay particiones para activar."
+1089 U 0000 "Partici¢n seleccionada (<I>) no puede arrancar, partic. activa no cambiada.<W>"
+1090 T 0000 "No se puede crear la partici¢n Ampliada ",CR,LF,"del DOS sin la partici¢n Primaria del",CR,LF
+1091 T 0000 "DOS en el disco 1.<W>"
+1092 T 0000 "Todo el espacio de la partici¢n Ampliada"
+1093 T 0000 "del DOS est  asignado a unidades l¢gicas<W>"
+1094 T 0000 "No puede suprimirse partici¢n Ampliada mientras existan las unidades l¢gicas.<W>"
+1095 T 0000 "Las unidades l¢gicas de la partici¢n ",CR,LF,"Ampliada del DOS, han sido suprimidas<W>"
+1096 U 0000 " no es una elecci¢n. Introduzca <III>.<W>"
+1097 U 0000 "­Aviso! La partici¢n definida como activa no puede arrancarse.<W>"
+1098 U 0000 " S¢lo existen particiones que no pueden arrancarse."
+1099 T 0000 "S¢lo se pueden activar las particiones",CR,LF,"de la Unidad 1.<W>"
+1100 T 0000 "N£mero m ximo de unidades l¢gicas del DOS instaladas.<W>"
+1101 U 0000 "No puede crearse una partici¢n de tama¤o cero."
+1102 T 0000 " Unidad <II> ya est  suprimida."
+1103 T 0000 "No se puede acceder a la unidad <I>.<OW>"
+1104 T 0000 "Entrada no v lida, introduzca <III>.<W>"
+1105 T 0000 "Imposible suprimir la partici¢n Primaria"
+1106 T 0000 "en unidad 1 cuando existe una Ampliada<W>"
+1107 U 0000 "Entrada no v lida, pulse Intro.<W>"
+1108 U 0000 "La etiqueta del volumen no coincide.<W>"
+1109 U 0000 "No puede crearse una Unidad L¢gica del DOS sin"
+1110 U 0000 "una Partici¢n Ampliada del DOS en la unidad actual.<W>"
+1111 U 0000 "No hay ninguna Unidad L¢gica del DOS para suprimir."
+1112 T 0000 "Error en la cadena de caracteres <I>, vea la cabecera de",CR,LF
+ "FDISKC.MSG para la definici¢n del error"
+1113 T 0000 "Error interno"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/state.rst b/private/mvdm/dos/v86/messages/state.rst
new file mode 100644
index 000000000..059195d34
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/state.rst
@@ -0,0 +1,11 @@
+[edit-]
+screen=80 53
+toggles=1 1 0 1 0 0
+srch=please insert
+src=
+rpl=
+file=f:\src\dos500\messages\usa-ibm.msg 1 135 14 160
+[brief]
+file=f:\src\dos500\messages\usa-ibm.msg 1 135 14 160 1 50 78 1 c=0
+[shared-]
+pmark=f:\src\dos500\messages\usa-ibm.msg 14 160
diff --git a/private/mvdm/dos/v86/messages/sweden.msg b/private/mvdm/dos/v86/messages/sweden.msg
new file mode 100644
index 000000000..49a0323d6
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/sweden.msg
@@ -0,0 +1,1130 @@
+0007
+COMMON 0006 0038
+0001 T 0002 "Fel DOS-version.",CR,LF
+0002 T 0002 "%1 „r redan installerad.",CR,LF
+0003 T 0002 "%1 byte finns tillg„ngliga p† disken.",CR,LF
+0004 T 0002 "%1 byte „r lediga.",CR,LF
+0005 T 0002 "%1 byte g†r inte att anv„nda (defekta sektorer).",CR,LF
+0006 T 0002 "%1 byte utg”r det totala diskutrymmet.",CR,LF
+0007 T 0002 "%1 byte utg”r det totala minnet.",CR,LF
+0008 T 0002 "%1 byte anv„nds av systemet.",CR,LF
+0009 T 0002 "%1 „r installerad.",CR,LF
+0010 T 0002 "%1 „r inte installerad.",CR,LF
+0011 T 0002 "%1 „r inte installerad.",CR,LF
+0012 T 0002 "%1 kan inte anv„ndas mot en enhet i n„tet.",CR,LF
+0013 T 0002 "",
+0014 T 0002 "%1 kan inte anv„ndas mot en disk efter SUBST eller ASSIGN av enheten.",CR,LF
+0015 T 0002 "Kan inte k”ra %1.",CR,LF
+0016 T 0002 "Ut”kat minne finns inte tillg„ngligt.",CR,LF
+0017 T 0002 "Fel i filallokeringstabell (FAT), enhet %1.",CR,LF
+0018 T 0002 "Filen kan inte kopieras till sig sj„lv.",CR,LF
+0019 T 0002 "S„tt in destinationsdisketten i enhet %1.",CR,LF
+0020 T 0002 "Diskutrymmet r„cker inte till.",CR,LF
+0021 T 0002 "Ogiltiga tecken i volymetiketten.",CR,LF
+0022 T 0002 "Ogiltig teckentabell.",CR,LF
+0023 T 0002 "Fel datumformat.",CR,LF
+0024 T 0002 "Fel tidsformat.",CR,LF
+0025 T 0002 "Ogiltig s”kv„g.",CR,LF
+0026 T 0002 "Du har inte angivit k„lla.",CR,LF
+0027 T 0002 "Du har inte angivit destination.",CR,LF
+0028 T 0002 "Tryck p† valfri tangent f”r att forts„tta.",CR,LF
+0029 T 0002 "Ange k„llans s”kv„g.",CR,LF
+0030 T 0002 "Systemet „r ”verf”rt.",CR,LF
+0031 T 0002 "",
+0032 T 0002 "Kan inte skapa katalog.",CR,LF
+0033 T 0002 "Volymen i enhet %1 har ingen etikett.",CR,LF
+0034 T 0002 "Volymen i enhet %1 „r %2.",CR,LF
+0035 T 0001 "Ange eventuell volymetikett (max 11 tecken). "
+0036 T 0002 "Volymens serienummer „r %1-%2.",CR,LF
+0037 T 0002 "Felaktig filtyp.",CR,LF
+0038 T 0001 CR,LF
+EXTEND 075b 0089
+0001 T 0002 "Ogiltig funktion.",CR,LF
+0002 T 0002 "Hittar inte filen.",CR,LF
+0003 T 0002 "Hittar inte s”kv„gen.",CR,LF
+0004 T 0002 "F”r m†nga filer „r ”ppna.",CR,LF
+0005 T 0002 "tkomst nekad.",CR,LF
+0006 T 0002 "Ogiltigt filnummer.",CR,LF
+0007 T 0002 "Tabell med styrinformation f”r minnet „r f”rst”rd.",CR,LF
+0008 T 0002 "Minnet r„cker inte till.",CR,LF
+0009 T 0002 "Ogiltig adress p† tabell med styrinformation f”r minnet.",CR,LF
+0010 T 0002 "Ogiltigt utrymme f”r systemvariabler.",CR,LF
+0011 T 0002 "Ogiltigt format.",CR,LF
+0012 T 0002 "Ogiltig parameter.",CR,LF
+0013 T 0002 "Ogiltig data.",CR,LF
+0014 T 0002 "",
+0015 T 0002 "Ogiltig enhet angiven",CR,LF
+0016 T 0002 "Du f”rs”kte ta bort denna katalog.",CR,LF
+0017 T 0002 "Inte samma enhet.",CR,LF
+0018 U 0000 "No more files",CR,LF
+0019 T 0002 "Skrivskyddsfel.",CR,LF
+0020 T 0002 "Ogiltig enhet.",CR,LF
+0021 T 0002 "Inte redo.",CR,LF
+0022 T 0002 "Ogiltig beg„ran om enhet.",CR,LF
+0023 T 0002 "Datafel.",CR,LF
+0024 T 0002 "Ogiltiga parametrar vid beg„ran om enhet.",CR,LF
+0025 T 0002 "S”kfel.",CR,LF
+0026 T 0002 "Ogiltig mediatyp.",CR,LF
+0027 T 0002 "Hittar inte sektor.",CR,LF
+0028 T 0002 "Papperet „r slut i skrivaren.",CR,LF
+0029 T 0002 "Skrivfel.",CR,LF
+0030 T 0002 "L„sfel.",CR,LF
+0031 T 0002 "Allm„nt fel.",CR,LF
+0032 T 0002 "Fildelningsfel.",CR,LF
+0033 T 0002 "L†sningsfel.",CR,LF
+0034 T 0002 "Ogiltigt diskbyte.",CR,LF
+0035 T 0002 "Inget ledigt FCB.",CR,LF
+0036 T 0002 "Systemets resurser „r f”rbrukade.",CR,LF
+0037 T 0002 "Teckentabell ”verensst„mmer inte.",CR,LF
+0038 T 0002 "Slut p† indata.",CR,LF
+0039 T 0002 "Otillr„ckligt diskutrymme.",CR,LF
+0040 T 0002 "",
+0041 T 0002 "",
+0042 T 0002 "",
+0043 T 0002 "",
+0044 T 0002 "",
+0045 T 0002 "",
+0046 T 0002 "",
+0047 T 0002 "",
+0048 T 0002 "",
+0049 T 0002 "",
+0050 T 0002 "Beg„ran finns inte i filsystemet.",CR,LF
+0051 U 0000 "Can not attach to File system",CR,LF
+0052 T 0002 "Filsystemets namn finns redan.",CR,LF
+0053 T 0002 "Kan inte hitta filsystemets namn.",CR,LF
+0054 T 0002 "Filsystemet „r upptaget.",CR,LF
+0055 T 0002 "Filsystemets enhet finns inte l„ngre.",CR,LF
+0056 T 0002 "Filsystemets resurser „r f”rbrukade.",CR,LF
+0057 T 0002 "Filsystemet har uppt„ckt ett fel p† en enhet.",CR,LF
+0058 T 0002 "Filsystemet gav ett felaktigt svar.",CR,LF
+0059 T 0002 "Filsystemet har uppt„ckt ett ov„ntat fel.",CR,LF
+0060 T 0002 "Filsystemet „r inte kompatibelt.",CR,LF
+0061 U 0000 "Device output file limit exceeded",CR,LF
+0062 U 0000 "Device output file space limit exceeded",CR,LF
+0063 U 0000 "Device output file no longer exists",CR,LF
+0064 T 0002 "Filsystemets namn finns inte l„ngre.",CR,LF
+0065 T 0002 "tkomst nekad av filsystemet.",CR,LF
+0066 T 0002 "Felaktig enhetstyp f”r filsystemet.",CR,LF
+0067 T 0002 "Hittar inte filsystemet.",CR,LF
+0068 T 0002 "Filsystemets resurser „r f”rbrukade.",CR,LF
+0069 T 0002 "Filsystemets resurser „r f”rbrukade.",CR,LF
+0070 U 0000 "File system device is temporarily unavailable",CR,LF
+0071 U 0000 "File system request not accepted",CR,LF
+0072 U 0000 "File system device is paused",CR,LF
+0073 U 0001 "File system component not available",CR,LF
+0074 T 0002 "Filsystemet har hittat ett ov„ntat fel.",CR,LF
+0075 T 0002 "Filsystemet har hittat ett ov„ntat fel.",CR,LF
+0076 T 0000 "",
+0077 T 0000 "",
+0078 T 0000 "",
+0079 T 0000 "",
+0080 T 0002 "Filen finns redan.",CR,LF
+0081 T 0000 "",
+0082 U 0000 "Can not make directory entry",CR,LF
+0083 U 0000 "Fail requested to Critical Error",CR,LF
+0084 U 0000 "Too many attaches",CR,LF
+0085 T 0002 "Enhet eller fil „r redan ansluten.",CR,LF
+0086 T 0002 "Ogiltigt l”senord.",CR,LF
+0087 T 0002 "Ogiltig parameter.",CR,LF
+0088 U 0000 "File system data fault",CR,LF
+0089 T 0002 "Funktionen finns inte i filsystemet.",CR,LF
+PARSE 163f 0011
+0001 T 0002 "Du har anv„nt f”r m†nga parametrar.",CR,LF
+0002 T 0002 "Parameter saknas.",CR,LF
+0003 T 0002 "Ogiltigt tecken.",CR,LF
+0004 U 0000 "Invalid keyword",CR,LF
+0005 T 0000 "",
+0006 T 0002 "Parameterns v„rde „r inte inom till†ten gr„ns.",CR,LF
+0007 T 0002 "Parameterns v„rde „r ogiltigt.",CR,LF
+0008 T 0002 "Parameterns v„rde „r ogiltigt.",CR,LF
+0009 T 0002 "Parametern har fel format.",CR,LF
+0010 T 0002 "Ogiltig parameter.",CR,LF
+0011 T 0002 "Ogiltig kombination av parametrar.",CR,LF
+IBMBIO 184b 0018
+0003 T 0002 13,10,"Ok„nt kommando i filen CONFIG.SYS."
+0004 T 0000 13,10,"$"
+0005 T 0002 13,10,"Sektorstorleken „r f”r stor i filen $."
+0006 T 0002 13,10,"$ „r defekt eller saknas."
+0007 T 0002 "Kommandotolk",0
+0008 T 0002 13,10,"Ogiltig landskod eller teckentabell.",13,10,"$"
+0009 T 0002 13,10,"Fel i COUNTRY-kommandot.",13,10,"$"
+0010 T 0002 13,10, "Minnet r„cker inte till f”r filen COUNTRY.SYS.",13,10,"$"
+0011 T 0002 13,10,"Konfigureringen „r f”r stor f”r minnet.",13,10,"$"
+0012 T 0002 13,10,"F”r m†nga blockenheter.",13,10,"$"
+0013 T 0002 13,10,"Ogiltiga parametrar i kommandot STACKS.",13,10,"$"
+0014 T 0002 13,10,"Felaktig ordning i raden $ i CONFIG.SYS."
+0015 T 0002 "Fel i raden $ i CONFIG.SYS."
+0016 T 0002 13,10,"Fel vid minnesallokering $."
+0017 T 0002 0DH,0AH,7,0DH,0AH, "Stackresurserna „r ”verskridna.",0DH,0AH
+ "Systemet har stoppats.",0DH,0AH,"$"
+0020 T 0002 13,10,"S„tt in disketten f”r enhet "
+0021 T 0002 "A:,",13,10,"och tryck p† valfri tangent.",13,10,10,0
+0022 T 0002 13,10,"Fel kommando eller parametrar - $."
+BOOT 1c7f 0001
+0001 T 0002 13,10,"Ingen systemdisk. Eller finns det ett diskfel."
+ "Byt och tryck sedan p† valfri tangent.",13,10,0
+DBCSDOS 1d0a 0000
+IBMDOS 1d1e 0001
+0001 U 0001 13,10,"Divide overflow",13,10
+COMMAND 1d5d 0091
+0201 T 0000 "A" ;AC000;
+0202 T 0000 "F" ;AC000;
+0203 T 0000 "I" ;AC000;
+0204 T 0000 "G" ;AC000;
+0205 T 0000 "J" ;AC000;
+0206 T 0000 "N" ;AC000;
+0210 T 0002 "Avbryt" ;AC000;
+0211 T 0002 ", F”rs”k igen" ;AC000;
+0212 T 0002 ", Ignorera" ;AC000;
+0213 T 0002 ", G† vidare" ;AC000;
+0214 T 0000 "?" ;AC000;
+0215 T 0002 "vid l„sning fr†n",0 ;AC000;
+0216 T 0002 "vid skrivning till",0 ;AC000;
+0217 T 0002 "%1 enhet %2.",CR,LF ;AC000;
+0218 T 0002 "%1 enhet %2.",CR,LF ;AC000;
+0219 T 0002 "S„tt in volym %1 med serienummer %2-%3.",CR,LF ;AC009;
+0221 T 0002 "Filen COMMAND.COM „r ogiltig.",CR,LF ;AC000;
+0222 T 0002 "S„tt in diskett med %1 i enhet %2.",CR,LF ;AC000;
+0224 T 0001 CR,LF,"Vill du avbryta k”rningen av kommandofilen? (J/N) "
+0225 T 0002 "Kan inte k”ra %1.",CR,LF ;AC000;
+0226 T 0002 "Fel i EXE-fil.",CR,LF ;AC000;
+0227 T 0002 "Programmet „r f”r stort f”r minnet.",CR,LF ;AC000;
+0228 T 0002 CR,LF,"Det finns inga lediga filnummer." ;AC000;
+0229 T 0002 "Felaktigt kommando eller filnamn.",CR,LF ;AC000;
+0231 T 0002 CR,LF,"Fel vid minnesallokering." ;AC000;
+0232 T 0002 CR,LF,"COMMAND g†r inte att l„sa in. Systemet har stoppats.",CR,LF;AC000;
+0233 T 0002 CR,LF,"COMMAND kan inte startas - avbryter.",CR,LF ;AC000;
+0234 T 0002 CR,LF,"Process p† h”gsta niv† avbruten, kan inte forts„tta.",CR,LF;AC000;
+0235 T 0002 CR,LF ;AC000;
+0463 T 0002 "Utrymmet f”r systemvariabler „r fullt.",CR,LF ;AC000;
+0464 T 0002 CR,LF,"IBM Personal Computer DOS",CR,LF
+ "Version 3.40 (C)Copyright International Business Machines Corp 1981,1988",CR,LF
+ " (C)Copyright Microsoft Corp 1981, 1986",CR,LF ;AC000;
+0465 T 0002 "Ogiltig s”kv„g angiven vid COMMAND.",CR,LF
+0466 T 0002 "Ogiltig s”kv„g angiven vid COMMAND - †tkomst nekad.",CR,LF
+1002 T 0002 "Filnamnet „r upptaget. Eller hittar inte filen.",CR,LF ;AC000;
+1003 T 0002 "S”kv„gen eller filen finns inte.",CR,LF ;AC000;
+1007 T 0002 "Utrymmet f”r systemvariabler „r fullt.",CR,LF ;AC000;
+1008 T 0002 "Fel n„r fil ska skapas.",CR,LF ;AC000;
+1009 T 0002 "Kommandofil saknas.",CR,LF ;AC000;
+1010 T 0002 CR,LF,"S„tt in disketten med kommandofilen.",CR,LF ;AC000;
+1011 T 0002 "Felaktigt kommando eller filnamn.",CR,LF ;AC000;
+1016 T 0002 "Inneh†llet i destinationsfilen raderades vid kopieringen.",CR,LF ;AC000;
+1017 T 0002 "Ogiltigt filnamn. Eller hittar inte filen.",CR,LF ;AC000;
+1018 T 0002 "%1 fil(er) har kopierats.",CR,LF ;AC000;
+1019 T 0002 "%1 fil(er) " ;AC000;
+1022 T 0002 "Teckentabell %1 „r inte f”rberedd (PREPARE) f”r systemet.",CR,LF ;AC000;
+1023 T 0002 "Teckentabell %1 „r inte f”rberedd (PREPARE) f”r alla enheter.",CR,LF ;AC000;
+1024 T 0002 "Aktiv teckentabell: %1",CR,LF ;AC000;
+1025 T 0002 "NLSFUNC „r inte installerad.",CR,LF ;AC000;
+1027 T 0002 "Aktuell enhet „r inte l„ngre giltig." ;AC000;
+1029 T 0002 "Hittar inte hoppadressen.",CR,LF ;AC000;
+1030 T 0002 "Syntaxfel.",CR,LF ;AC000;
+1032 T 0002 "Dagens datum „r %1 %2.",CR,LF ;AC000;
+1033 T 0002 "s”nm†ntisonstorfrel”r" ;AC000;
+1034 T 0002 "Ange nytt datum (%1): "
+1036 T 0002 "Klockan „r %1.",CR,LF ;AC000;
+1037 T 0002 "Ange ny tid: "
+1038 T 0002 ", Vill du radera filerna? (J/N)" ;AC000;
+1039 T 0002 "Alla filer i katalogen kommer att raderas!",CR,LF
+ "Vill du forts„tta? (J/N)" ;AC000;
+1040 T 0002 "IBM Personal Computer DOS Version %1.%2",CR,LF ;AC000;
+1044 T 0002 "Ogiltig katalog.",CR,LF ;AC000;
+1046 T 0002 "Katalogen finns inte eller „r inte tom.",CR,LF ;AC000;
+1047 T 0002 "Du m†ste ange ON eller OFF.",CR,LF ;AC000;
+1048 T 0002 "Katalog %1",CR,LF ;AC000;
+1049 T 0002 "Ingen s”kv„g.",CR,LF ;AC000;
+1050 T 0002 "Ogiltig enhet i s”kv„gen.",CR,LF ;AC000;
+1051 T 0002 "Ogiltig enhet.",CR,LF ;AC000;
+1052 T 0002 "FOR kan inte kapslas.",CR,LF ;AC000;
+1053 T 0002 "Fel vid anv„ndning av instruktionsk”.",CR,LF ;AC000;
+1054 T 0002 "Kan inte g”ra bin„rl„sning fr†n enheten.",CR,LF ;AC000;
+1055 T 0002 "BREAK „r %1.",CR,LF ;AC000;
+1056 T 0002 "VERIFY „r %1.",CR,LF ;AC000;
+1057 T 0002 "ECHO „r %1.",CR,LF ;AC000;
+1059 T 0002 "OFF",0 ;AC000;
+1060 T 0002 "ON",0 ;AC000;
+1061 T 0002 "Fel vid skrivning till enhet",CR,LF ;AC000;
+1063 T 0002 "%1" ;AC000;
+1064 T 0002 "%1" ;AC000;
+1065 T 0002 "%1" ;AC000;
+1066 T 0002 "%1" ;AC000;
+1067 T 0002 9 ;AC000;
+1068 T 0002 " <KAT> " ;AC000;
+1069 T 0002 8," ",8 ;AC000;
+1070 T 0002 CR,LF ;AC000;
+1071 T 0002 "%1" ;AC000;
+1072 T 0002 "mm-dd-††" ;AC000;
+1073 T 0002 "dd-mm-††" ;AC000;
+1074 T 0002 "††-mm-dd" ;AC000;
+1075 T 0002 "%1 %2" ;AC000;
+1076 T 0002 "%1" ;AC000;
+1077 T 0001 " %1 %2" ;AC000;
+1078 T 0002 "Katalogen finns redan.",CR,LF ;AC000;
+ATTRIB 34a5 0016
+0004 T 0002 "Fel antal parametrar.",CR,LF
+0005 T 0002 "Ogiltig s”kv„g. Eller hittar inte filen.",CR,LF
+0006 T 0002 "Syntaxfel.",CR,LF
+0008 T 0002 " %1"
+0009 T 0002 "%1 %2",CR,LF
+0010 T 0002 "%1",CR,LF,"%2",CR,LF
+0011 T 0002 "%1, Teckentabell ”verensst„mmer inte.",CR,LF,"Žr du s„ker? (J/N)"
+0012 T 0002 "%1",CR,LF
+0014 T 0002 CR,LF
+0015 T 0002 "Ogiltig filtyp.",CR,LF
+0199 U 0000 "Extended attribute error",CR,LF
+0201 U 0000 "Extended attribute name not found",CR,LF
+0204 U 0000 "Extended attribute name can't be set",CR,LF
+0205 U 0000 "Extended attribute name known to this filesystem but not supported",CR,LF
+0206 U 0000 "Extended attribute type mismatch",CR,LF
+0208 U 0000 "Extended attribute value not supported",CR,LF
+ASSIGN 37a0 0001
+0002 U 0000 "Original %1: set to %2:",cr,lf
+CHKDSK 37e1 0063
+0003 T 0002 "Ska f”rlorade kedjor konverteras till filer? (J/N)" ;freemes
+0004 T 0002 "Katalogen inneh†ller fel som inte g†r att †tg„rda." ;ptrandir
+0005 T 0002 "Ska katalogen konverteras till en fil? (J/N)" ;ptrandir2
+0007 T 0002 "%1 byte utg”r det totala diskutrymmet." ;dskspc
+0008 T 0002 "%1 byte finns i defekta sektorer." ;badspc
+0009 T 0002 "%1 byte finns i %2 g”mda filer." ;hidmes
+0010 T 0002 "%1 byte finns i %2 kataloger." ;dirmes
+0011 T 0002 "%1 byte finns i %2 anv„ndarfiler." ;filemes
+0012 T 0002 "%1 byte finns i %2 †terskapade filer." ;orphmes2
+0013 T 0002 "%1 byte skulle kunna vara i %2 †terskapade filer." ;orphmes3
+0014 T 0002 "%1 byte finns tillg„ngliga p† disken." ;frespc
+0015 T 0002 "%1 byte utg”r det totala minnet." ;totmem
+0016 T 0002 "%1 byte „r lediga." ;fremem
+0017 T 0002 "CHKDSK kan inte anv„ndas mot en diskenhet i n„tet." ;no_net_arg
+0018 T 0002 "CHKDSK kan inte anv„ndas mot en disk efter SUBST eller ASSIGN av enheten." ;SubStErr
+0019 T 0002 "Sannolikt ingen DOS-disk.",CR,LF,"Vill du forts„tta? (J/N) " ;badidbyt
+0020 T 0002 "Diskfel vid l„sning av FAT %1.",CR,LF ;badr
+0021 T 0002 "Katalog %1." ;direc_arg
+0022 T 0002 "%1 inneh†ller %2 icke angr„nsande block." ;extent_arg
+0023 T 0002 "Alla angivna filer „r angr„nsande." ;noext_arg
+0024 T 0002 "Har hittat fel. Du har inte angivit parametern F.",CR,LF,"R„ttelser kommer inte att skrivas till disken." ;fixmes_arg
+0025 T 0002 " Bearbetningen kan inte forts„tta %1%2." ;fatal_arg
+0026 T 0002 " Felaktig filallokeringstabell (FAT), enhet %1." ;badrdmes
+0029 T 0002 " CHDIR .. misslyckades, f”rs”ker en alternativ metod." ;cdddmes
+0030 T 0002 " Har felaktig grupp, filen trunkerad." ;badchain
+0031 T 0002 " Ogiltig ing†ng i underkatalog." ;badsubdir
+0032 T 0002 " Finns inte." ;ndotmes
+0033 T 0002 " F”rsta gruppnumret „r ogiltigt, filens storlek „ndrad." ;nulnz
+0034 T 0002 " Allokeringsfel, storleken „ndrad." ;badclus
+0035 T 0002 " Kan inte †terskapa ing†ng .. , bearbetningen forts„tter." ;norecdot
+0036 T 0002 " Katalogen „r helt tom, inga . eller .. -ing†ngar." ;nuldmes
+0037 T 0002 " Katalogen „r sammankopplad." ;joinmes
+0038 T 0002 " Kan inte †terskapa ing†ng .. " ;norecddot
+0039 T 0002 " Ing†ngen har en felaktig l„nkning." ;norecddot1
+0040 T 0002 " Ing†ngen har ett felaktigt attribut." ;norecddot2
+0041 T 0002 " Ing†ngen har en felaktig storlek." ;norecddot3
+0042 T 0002 " „r korsl„nkad i grupp %1." ;cross_arg
+0043 T 0002 " Kan inte g”ra CHDIR till %1.,",CR,LF,"Bearbetningen avslutas i denna position i tr„det." ;badtarg_ptr
+0044 T 0002 " Bearbetningen avslutas i denna position i tr„det." ;badtarg2
+0045 T 0002 "%1 byte diskutrymme lediggjorda." ;freebymes1
+0046 T 0002 "%1 byte diskutrymme kunde bli lediggjorda." ;freebymes2
+0047 T 0002 "Volym %1 skapad %2 %3.",CR,LF ;idmes_arg
+0048 T 0002 "Totalt %1 allokeringsenheter finns p† disken."
+0049 T 0002 "%1 byte finns i varje allokeringsenhet." ;idmes2
+0050 T 0002 "CHKDSK fungerar inte p† enhet %1." ;msgExecFailure
+0051 U 0000 " Extended Attributes has invalid clusters, attributes truncated" ;Inv_XA_Msg
+0052 U 0000 " Extended Attributes allocation error , attributes truncated" ;Alloc_XA_Msg
+0053 T 0002 "Ogiltig parameter." ;badsw_arg
+0055 T 0002 "Hittar inte s”kv„gen." ;invpath_arg
+0056 T 0002 "Hittar inte filen." ;opnerr_arg
+0058 T 0002 " %1 f”rlorade grupper funna i %2 kedjor." ;orph_arg
+0059 T 0002 CR,LF ;crlf_arg
+0060 T 0002 " Kan inte g”ra CHDIR till rot.",CR,LF ;badcd_arg
+0061 T 0002 " Diskfel vid skrivning till FAT %1." ;badw_arg
+0062 T 0002 " %1" ;noisy_arg
+0063 T 0002 "Ogiltig aktuell katalog." ;baddpbdir
+0064 T 0002 "%1",CR,LF ;file_arg
+0065 T 0002 " Utrymmet i rotkatalogen r„cker inte till.",CR,LF," Ta bort filer fr†n rotkatalogen och g”r om CHKDSK." ;creatmes
+0066 T 0002 "%1 %2 %3" ;eup_arg
+0067 T 0002 "%1 %2, %3" ;usp_arg
+0068 T 0002 "%1%2%3%4%5" ;oth_arg
+0069 T 0002 "%1%2%3%4" ;time_arg
+0070 T 0002 "%1 allokeringsenheter finns tillg„ngliga p† disken." ;idmes2 ;an017;bgb
+DEBUG 4bf3 0059
+0004 T 0002 "Allokeringen misslyckades. Eller angiven buffert „r f”r liten.",CR,LF
+0005 U 0000 "Bad or missing Msg info",CR,LF
+0006 T 0002 "Felaktigt enhetsnamn." ;baddev_ptr
+0007 T 0002 "Kan inte ”ppna listenheten PRN.",CR,LF
+ "Ange listenhetens namn." ;badlstmes_ptr
+0008 T 0002 CR,LF ;crlf_ptr
+0009 T 0002 CR,LF,"Programmet har avslutats normalt.",CR,LF
+0010 T 0002 "Ogiltig enhet angiven." ;nambad_ptr
+0012 T 0002 "Fel n„r filen ska skapas." ;noroom_ptr
+0013 T 0002 "Otillr„ckligt diskutrymme." ;nospace_ptr
+0014 T 0002 "Diskfel vid l„sning fr†n enhet %1." ;dr1_ptr
+0015 T 0002 "Diskfel vid skrivning till enhet %1." ;dr2_ptr
+0016 T 0002 "Skrivskyddsfel vid l„sning fr†n enhet %1." ;dr3_ptr
+0017 T 0002 "Skrivskyddsfel vid skrivning till enhet %1." ;dr4_ptr
+0019 T 0002 "%1^ fel." ;synerr
+0020 T 0002 "Fel i EXE- eller HEX-fil." ;exebad_ptr/hexerr_ptr
+0021 T 0002 "Kan inte skriva EXE- och HEX- filer." ;exewrt_ptr/hexwrt_ptr
+0022 T 0002 "EXEC-fel." ;execemes_ptr
+0023 T 0002 "(W)rite-fel, ingen destination definierad." ;nonamespec_ptr
+0024 T 0002 "tkomst nekad." ;accmes_ptr
+0025 T 0002 "Paritetsfel." ;paritymes_ptr
+0026 T 0002 "-" ;prompt_ptr
+0027 T 0002 "%1 -" ;change_flag_ptr
+0032 T 0002 "%1%2" ;unassem_ln_ptr
+0033 T 0002 "%1:%2 %3" ;hex_ptr
+0034 T 0002 "%1 %2" ;add_ptr
+0035 T 0002 "%1 %2",CR,LF,":" ;single_reg_ptr
+0036 T 0002 "%1=%2 " ;register_ptr
+0037 T 0002 "%1 fel." ;errmes_ptr
+0038 T 0002 "Skriver %1 byte." ;wrtmes_ptr
+0039 T 0002 "%1:%2=" ;loc_ptr
+0040 T 0002 "%1" ;little_ptr
+0041 T 0002 "%1" ;big_ptr
+0042 T 0002 "%1:%2 %3 %4 %5:%6" ;comp_ptr
+0044 T 0002 32,8 ;bacmes_ptr
+0045 T 0002 "Meddelanderutin g†r inte att allokera.",CR,LF ;fatal_error
+0046 T 0002 "%1" ;arg_buf_ptr
+0047 T 0002 "%1" ;one_char_buf_ptr
+0050 T 0002 "%1 av totalt %2 EMS-sidor har allokerats.",cr,lf
+0051 T 0002 "%1 av totalt %2 EMS handles har allokerats.",cr,lf
+0055 U 0000 "Handle created = %1 ",cr,lf
+0056 T 0002 "Logisk sida %1 motsvarar fysisk sida %2.",cr,lf
+0057 T 0002 "Fel p† EMS maskin-/programvara.",cr,lf
+0058 U 0000 "Handle not found",cr,lf
+0059 T 0002 "Ogiltig funktionskod.",cr,lf
+0060 U 0000 "No free handles",cr,lf
+0061 T 0002 "Fel vid lagring/†terst„llning.",cr,lf
+0062 T 0002 "Totala antalet sidor har ”verskridits.",cr,lf
+0063 T 0002 "Antalet lediga sidor har ”verskridits.",cr,lf
+0064 T 0002 "Parameterfel.",cr,lf
+0065 U 0000 "Logical Page out of range",cr,lf
+0066 U 0000 "Physical Page out of range",cr,lf
+0067 U 0000 "Save area already in use",cr,lf
+0068 U 0000 "Save area not in use",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 T 0002 "EMS-parameter saknas eller „r ogiltig.",cr,lf
+0072 U 0000 "Handle %1 har %2 allokerade sidor.",cr,lf
+0075 T 0002 "Fysisk sida %1 = ramsegment %2.",cr,lf
+0076 U 0000 "Handle %1 deallocated",cr,lf
+0078 T 0002 "EMS „r inte installerat.",cr,lf
+DRIVER 59cf 0002
+0002 T 0001 "Ingen enhet angiven.",CR,LF
+0003 T 0001 "Har l„st in drivrutinen f”r extern disk, enhet %1.",CR,LF
+EDLIN 5a55 0027
+0006 T 0002 "*" ;prompt_ptr
+0007 T 0002 "Ogiltigt enhets- eller filnamn.",CR,LF ;baddrv_ptr
+0008 T 0002 "Filnamnet m†ste anges.",CR,LF ;ndname_ptr
+0010 T 0002 "Filen „r en LŽSFIL.",CR,LF ;ro_err_ptr
+0011 T 0002 "Fel n„r fil ska skapas.",CR,LF ;bcreat_ptr
+0012 T 0002 "F”r m†nga ”ppna filer.",CR,LF ;too_many_ptr
+0013 T 0002 "L„sfel i:",CR,LF,"%1",CR,LF ;read_err_ptr
+0014 T 0002 "Kan inte redigera en .BAK-fil - d”p om filen.",CR,LF ;nobak_ptr
+0015 T 0002 "Filen f†r inte plats i katalogen.",CR,LF ;nodir_ptr
+0016 T 0002 "Disken „r full. Žndringar har inte sparats.",CR,LF ;dskful_ptr
+0017 T 0002 "Hittar inte filen.",CR,LF ;filenm_ptr
+0018 T 0002 "Inmatningsfel.",CR,LF ;badcom_ptr
+0019 T 0002 "Ny fil.",CR,LF ;newfil_ptr
+0020 T 0002 "Hittar inte.",CR,LF ;nosuch_ptr
+0021 T 0002 "O.K.? " ;ask_ptr
+0022 T 0002 "Raden „r f”r l†ng.",CR,LF ;toolng_ptr
+0023 T 0002 "Slut p† infilen.",CR,LF ;eof_ptr
+0024 T 0002 "Skall redigeringen avbrytas? (J/N) " ;qmes_ptr
+0025 T 0002 "Du m†ste ange radnummer.",CR,LF ;dest_ptr
+0026 T 0002 "Hela filen f†r inte plats.",CR,LF ;mrgerr_ptr
+0027 T 0002 CR,LF ;crlf_ptr
+0028 T 0002 LF ;lf_ptr
+0029 T 0002 "Vill du forts„tta? (J/N)" ;cont_ptr
+0030 T 0002 "Meddelandet g†r inte att skriva ut.",CR,LF ;fatal_error
+0031 T 0002 "%1" ;arg_buf_ptr
+0032 T 0002 "%1:%2" ;line_num_buf_ptr
+0033 T 0002 "Kan inte foga - teckentabellerna „r olika.",CR,LF ;cp_err_ptr
+EXE2BIN 6164 0008
+0002 T 0002 "Otillr„ckligt minne.",CR,LF
+0003 T 0002 "Hittar inte meddelandena.",CR,LF
+0004 T 0002 "tkomst nekad.",CR,LF
+0005 T 0002 "Filen kan inte konverteras.",CR,LF
+0006 T 0002 "Hittar inte filen.",CR,LF
+0007 T 0002 "Fel n„r fil ska skapas.",CR,LF
+0008 U 0000 "Fix-ups needed - base segment (hex):"
+0012 T 0002 "Du m†ste ange filnamnet.",CR,LF
+FIND 62dd 0001
+0004 T 0002 "FIND: "
+FORMAT 6307 0044
+0002 T 0002 CR,"%1 procent av disken „r formaterad."
+0004 T 0002 CR,"Formateringen „r klar. ",CR,LF
+0007 T 0002 "S„tt in en ny diskett i enhet %1:",CR,LF
+0009 T 0002 "S„tt in disketten igen i enhet %1:",CR,LF
+0010 T 0002 "Ange ev. volymetikett (max 11 tecken)."
+0011 T 0002 CR,"Det g†r inte att g”ra FORMAT p† disk i enhet %1:", CR,LF
+0012 T 0002 CR,"Ogiltiga enhetsparametrar fr†n drivrutinen.",CR,LF
+0013 T 0002 CR,"Fel i IOCTL-anrop. ",CR,LF
+0014 T 0002 CR,"Inte en blockenhet. ",CR,LF
+0015 T 0002 CR,"Fel vid skrivning av FAT. ",CR,LF
+0016 T 0002 CR,"Fel vid skrivning av katalogen.",CR,LF
+0017 T 0002 CR,"Det g†r inte att formatera en disk efter ASSIGN eller SUBST av enheten.",CR,LF
+0018 T 0002 CR,"Hittar inte systemfilerna.",CR,LF
+0019 T 0002 CR,"FORMAT kan inte anv„ndas mot en diskenhet i n„tet.",CR,LF
+0020 T 0002 CR,"Ogiltiga tecken i volymetiketten. ",CR,LF
+0021 T 0002 CR,"Parametrar inte giltiga.",CR,LF
+0022 T 0002 CR,"Formateringen „r avbruten. ",CR,LF
+0023 T 0002 CR,"Disken ol„mplig att vara systemdisk.",CR,LF
+0024 T 0002 CR,"Ogiltigt medium eller sp†r 0 defekt - disketten oanv„ndbar.",CR,LF
+0025 T 0002 CR,"Kan inte skriva BOOT-posten. ",CR,LF
+0026 T 0002 CR,"Fel vid l„sning av katalogen.",CR,LF
+0028 T 0002 CR,"och tryck p† Enter n„r du „r klar."
+0029 T 0002 CR,"Ogiltig volymetikett. ",CR,LF
+0031 T 0002 CR,"Ange aktuell volymetikett f”r enhet %1: "
+0032 T 0002 CR,"Parametrarna „r inte kompatibla",CR,LF,"med den fasta disken.",CR,LF
+0035 T 0002 CR,"Fel vid l„sning av partitionstabell.",CR,LF
+0037 T 0002 CR,"Formateringen avbruten.",CR,LF
+0038 T 0002 CR,"Kommandot FORMAT fungerar inte p† diskenhet %1:",CR,LF
+0039 T 0002 CR,"Ingen systemdisk eller diskfel.",CR,LF
+0040 T 0002 CR,"Felaktig partitionstabell. ",CR,LF
+0041 T 0002 CR,"Parametrarna „r inte giltiga f”r enheten.",CR,LF
+0042 T 0002 CR,LF
+0043 T 0002 CR,LF,LF
+0044 T 0002 CR,"S„tt in DOS-disketten i enhet %1:",CR,LF
+0045 T 0002 CR,LF,"VARNING! ALL INFORMATION P DEN FASTA",CR,LF
+ "DISKENHETEN %1: KOMMER ATT F™RSVINNA!",CR,LF
+ "Vill Du forts„tta med formateringen? (J/N) "
+0046 T 0002 CR,"Vill du formatera fler disketter? (J/N) "
+0047 T 0002 CR,"Fel vid l„sning av partitionstabell.",CR,LF
+0048 T 0002 CR,"Fel vid skrivning av partitionstabell.",CR,LF
+0049 T 0002 CR,"Parametrarna „r inte kompatibla.", CR,LF
+0050 T 0002 "%1 allokeringsenheter finns tillg„ngliga p† disken.",CR,LF
+0051 T 0002 "Varje allokeringsenhet best†r av %1 byte.",CR,LF
+0052 T 0002 CR, "Fel vid skrivning av partitionstabell.",CR,LF
+0053 T 0002 CR,"Du skrev samma parameter tv† g†nger.",CR,LF
+0054 T 0002 CR,"B†de parametern /T och /N m†ste anges.",CR,LF ;AN009;
+JOIN 6e26 0001
+0002 T 0002 CR,LF,"Katalogen „r inte tom.",CR,LF
+MORE 6e6c 0001
+0002 T 0002 "-- Forts„ttning --"
+PRINT 6ea2 0021
+0002 T 0002 CR,LF
+0006 T 0002 " Fel vid l„sning fr†n fil",CR,LF,"$."
+0007 T 0002 "Hittar inte filen",CR,LF,"$."
+0008 T 0002 CR,LF,LF,"Fil $"
+0009 T 0002 " annullerad av operat”ren$."
+0010 T 0002 CR,LF,LF,"Alla filer annullerade av operat”ren$."
+0011 T 0002 "Fel i filallokeringstabellen (FAT), enhet "
+0012 T 0002 "A.",CR,LF,"$"
+0013 T 0002 "Utdata f”r listning „r inte tilldelad en enhet.",CR,LF
+0014 T 0002 "Den residenta delen av PRINT „r installerad.",CR,LF
+0015 T 0002 "Kan inte anv„nda PRINT - anv„nd NET PRINT.",CR,LF
+0017 T 0002 "PRINT-k”n „r full.",CR,LF
+0018 T 0002 "PRINT-k”n „r tom.",CR,LF
+0019 T 0002 "tkomst nekad.",CR,LF
+0020 T 0002 "Ogiltig enhet angiven.",CR,LF
+0021 T 0002 "Fel p† skrivaren. Kontrollera att den „r ansluten.",CR,LF
+0022 T 0002 CR,LF,LF," %1 h†ller p† att skrivas ut.",CR,LF
+0023 T 0002 " %1 ligger i k”.",CR,LF
+0025 U 0001 "Pathname too long",CR,LF
+0026 U 0001 "File not in PRINT queue",CR,LF
+0027 T 0002 "Namn p† skrivare [PRN]: "
+RECOVER 7295 0011
+0002 T 0002 CR,LF,"Hittar inte filen.",CR,LF ;File not found
+0003 T 0002 CR,LF,"Det g†r inte att anv„nda RECOVER efter ASSIGN eller SUBST av enheten.",CR,LF
+0004 T 0002 CR,LF,"Ogiltigt enhets- eller filnamn.",CR,LF
+0005 T 0002 CR,LF,"Varning - katalogen „r full.",CR,LF
+0006 T 0002 CR,LF,"RECOVER kan inte anv„ndas mot en diskenhet i n„tet.", CR,LF ;Cannot %1 a Network drive
+0008 T 0002 CR,LF,"%1 fil(er) har †terskapats.",CR,LF
+0009 T 0002 CR,LF,"%1 av %2 byte har †terskapats.",CR,LF
+0010 T 0002 CR,LF,"Tryck p† valfri tangent f”r att starta †terskapandet av",CR,LF,"fil(erna) p† enhet %1:",CR,LF,CR,LF ;AN000;bgb
+0011 T 0002 CR,LF,"Kan inte l„sa filallokeringstabellen (FAT).",CR,LF
+0012 T 0002 CR,LF,"Kan inte skriva filallokeringstabell (FAT).",CR,LF
+0013 T 0002 CR,LF
+SORT 75c9 0001
+0005 T 0002 "SORT: "
+SUBST 75f3 0001
+0002 T 0002 CR,LF,"Fel antal parametrar.",CR,LF
+SYS 7638 0008
+0004 T 0002 "Ogiltig enhet angiven.",CR,LF ; Old
+0007 T 0002 "Systemet f†r inte plats p† destinationsdisken.",CR,LF ; Old
+0008 T 0002 "Inkompatibel systemstorlek.",CR,LF ; Old
+0010 T 0002 "Inget system p† standardenheten.",CR,LF ; Old
+0011 T 0002 "Du kan inte ange standardenheten.",CR,LF ; New
+0012 T 0002 "Skrivfel. Disketten g†r inte att anv„nda.",CR,LF ; New
+0014 T 0002 "S„tt in systemdisken i enhet %1:",CR,LF ; Old
+0016 U 0000 "Not able to SYS to %1 file system",CR,LF ; New
+SHARE 78b7 0000
+NLSFUNC 78cb 0000
+ANSI 78df 0001
+0010 T 0002 "Ogiltig parameter - %1.",CR,LF ; 'Invalid parameter'
+IFSFUNC 7938 0001
+0004 T 0002 "Hittade inga IFS drivrutiner.",CR,LF
+PSPRINT 797f 0007
+0002 T 0002 " Fel vid l„sning fr†n fil.",CR,LF,FORMFD,BELL,"$"
+0003 T 0002 CR,LF,LF,"Filen annullerades av operat”r.",CR,FORMFD,BELL
+0004 T 0002 "Fel i filallokeringstabellen (FAT), enhet "
+0005 T 0002 "A.",CR,LF,"$"
+0006 T 0002 "Data som ska skrivas ut „r inte tilldelad en enhet.",CR,LF
+0007 T 0002 "PSPRINT „r redan installerad.",CR,LF
+0008 T 0002 "PSPRINT/PRINT konflikt.",CR,LF
+BACKUP 7b19 0022
+0002 T 0002 CR,LF,"Otillr„ckligt minne.",CR,LF
+0006 T 0002 CR,LF,"Ogiltig enhet angiven.",CR,LF
+0014 T 0002 CR,LF,"Samma k„lla och destination.",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 T 0002 CR,LF,"Fel n„r loggfilen ska ”ppnas.",CR,LF
+0018 T 0002 CR,LF,"Loggar till filen %1.",CR,LF
+0019 T 0002 CR,LF,"Du har inte satt in sista BACKUP-disketten.",CR,LF
+0020 T 0002 CR,LF,"Varning! Filerna i destinationsdiskens",CR,LF
+ "rotkatalog (enhet %1) kommer att tas bort.",CR,LF
+0021 T 0002 CR,LF,"Varning! Filerna i destinationsdiskens",CR,LF
+ "BACKUP-katalog (enhet %1) kommer att tas bort.",CR,LF
+0022 T 0002 CR,LF,"*** S„kerhetskopiering av filer till enhet %1: ***",CR,LF
+0023 T 0002 "Diskett nummer: %1",CR,LF
+0024 T 0002 CR,LF,"Varning! Hittar inga filer f”r s„kerhetskopiering.",CR,LF
+0025 T 0002 CR,LF,"S„tt in k„lldisketten f”r s„kerhetskopiering i enhet %1:",CR,LF
+0026 T 0002 CR,LF,"S„tt in BACKUP-diskett %1 i enhet %2:",CR,LF
+0027 T 0002 CR,LF,"*** Kan inte s„kerhetskopiera filen ***",CR,LF
+0028 T 0002 CR,LF,"S„tt in sista BACKUP-disketten i enhet %1:",CR,LF
+0029 T 0002 CR,LF,"Destinationen kan inte anv„ndas f”r s„kerhetskopiering.",CR,LF
+0030 T 0002 CR,LF,"*** Sista filen „r inte s„kerhetskopierad. ***",CR,LF
+0031 T 0002 CR,LF,"Den fasta destinationsdisken %1: „r full.",CR,LF
+0032 T 0002 CR,LF,"Disken „r full. Fel vid skrivning till BACKUP loggfil.",CR,LF
+0034 T 0002 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 8105 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 813f 0013
+0004 T 0002 "10 avvikelser, nu avslutas j„mf”relsen.",CR,LF
+0006 T 0002 "Fel vid j„mf”relse, relativ position %1.",CR,LF
+0007 T 0002 "Fil 1 = %1",CR,LF
+0008 T 0002 "Fil 2 = %1",CR,LF
+0009 T 0002 "Inget filslutsm„rke.",CR,LF
+0010 T 0002 "Filerna „r lika.",CR,LF
+0015 T 0002 CR,LF,CR,LF,"Ange det f”rsta filnamnet.",CR,LF
+0016 T 0002 CR,LF,CR,LF,"Ange det andra filnamnet eller enhetsspecifikationen.",CR,LF
+0017 T 0002 "Filerna „r olika stora.",CR,LF
+0018 T 0002 "Vill du j„mf”ra fler filer? (J/N) "
+0019 T 0002 "%1 och %2",CR,LF
+0020 T 0002 CR,LF
+0023 T 0002 "Filerna „r lika.",CR,LF
+DISKCOMP 83a8 0016
+0004 T 0002 "Ange inte filnamn.",CR,LF
+ "Kommandots format: DISKCOMP e: e:[/1][/8]",LF,CR
+0005 T 0002 CR,LF,"Ogiltig enhet angiven.",CR,LF
+ "Angiven enhet finns inte",CR,LF
+ "eller „r fast.",CR,LF
+0006 T 0002 CR,LF,"DISKCOMP kan inte anv„ndas mot",CR,LF
+ "en diskenhet i n„tet.",CR,LF
+0007 T 0002 CR,LF,"S„tt in F™RSTA disketten i enhet %1:",CR,LF
+0008 T 0002 CR,LF,"S„tt in ANDRA disketten i enhet %1:",CR,LF
+0009 T 0002 CR,LF,"F™RSTA disketten „r felaktig eller inkompatibel.",CR,LF
+0010 T 0002 CR,LF,"ANDRA disketten „r felaktig eller inkompatibel.",CR,LF
+0014 T 0002 CR,LF,"Vill du j„mf”ra fler disketter? (J/N) "
+0015 T 0002 CR,LF,"J„mf”r %1 sp†r",CR,LF
+ "%2 sektorer per sp†r, %3 sida/sidor.",CR,LF
+0016 T 0002 CR,LF,"Enhets- eller diskettyperna",CR,LF
+ "„r inte kompatibla.",CR,LF
+0017 T 0002 CR,LF,"O†tg„rdbart l„sfel, enhet %2",CR,LF
+ "sida %3, sp†r %4.",CR,LF
+0018 T 0002 CR,LF,"J„mf”relsefel p†",CR,LF,"sida %3, sp†r %4.",CR,LF
+0019 T 0002 "Kontrollera att disketten „r r„tt",CR,LF ;AN004;
+ "insatt i enheten.",CR,LF ;AN004;
+0020 T 0002 CR,LF,"J„mf”relsen avslutad.",CR,LF
+0021 T 0002 CR,LF,"Disketterna „r lika.",CR,LF
+0022 T 0002 CR,LF
+DISKCOPY 8879 0018
+0002 T 0002 CR,LF
+0004 T 0002 "Ange inte filnamn.",CR,LF
+ "Kommandots format: DISKCOPY e: e: [/1]",CR,LF
+0005 T 0002 CR,LF,"Ogiltig enhet angiven.",CR,LF
+ "Angiven enhet finns inte",CR,LF
+ "eller „r fast.",CR,LF
+0006 T 0002 CR,LF,"DISKCOPY kan inte anv„ndas mot",CR,LF
+ "en diskenhet i n„tet.",CR,LF
+0007 T 0002 CR,LF,"Formaterar och kopierar.",CR,LF
+0008 T 0002 CR,LF,"S„tt in k„lldisketten i enhet %1:",CR,LF
+0009 T 0002 CR,LF,"S„tt in destinationsdisketten i enhet %1:",CR,LF
+0010 T 0002 "Kontrollera att disketten „r r„tt",CR,LF ;AN004;
+ "insatt i enheten.",CR,LF ;AN004;
+0011 T 0002 CR,LF,"Destinationsdisketten kan vara oanv„ndbar.",CR,LF
+0012 T 0002 CR,LF,"Destinationsdisketten „r oanv„ndbar.",CR,LF
+0016 T 0002 CR,LF,"Vill du kopiera fler disketter? (J/N) "
+0017 T 0002 CR,LF,"Kopierar %1 sp†r",CR,LF
+ "%2 sektorer/sp†r, antal sidor: %3.",CR,LF
+0018 T 0002 CR,LF,"Enhets- eller diskettyper „r inte kompatibla.",CR,LF
+0019 T 0002 CR,LF,"L„sfelet g†r inte att †tg„rda, enhet %1:",CR,LF
+ "sida %2, sp†r %3.",CR,LF
+0020 T 0002 CR,LF,"Skrivfelet g†r inte att †tg„rda, enhet %1:",CR,LF
+ "sida %2, sp†r %3.",CR,LF
+0021 T 0002 CR,LF,"Kopieringen „r avslutad.",CR,LF
+0022 T 0002 CR,LF,"K„lldisketten felaktig eller inkompatibel."
+0023 T 0002 CR,LF,"Destinationsdisketten felaktig eller inkompatibel."
+LABL 8de5 0000
+MODE 8df9 0054
+0003 T 0002 CR,LF,"COM1, COM2, COM3 eller COM4 m†ste anges.",CR,LF
+0004 T 0002 CR,LF,"Den residenta delen av MODE „r inl„st.",CR,LF
+0005 T 0002 CR,LF,"Ogiltigt enhetsnamn.",CR,LF
+0006 T 0002 CR,LF,"Skrivarfel.",CR,LF
+0007 T 0002 CR,LF,"LPT%1: radl„ngd = 80",CR,LF
+0008 T 0002 CR,LF,"LPT%1: radl„ngd = 132",CR,LF
+0009 T 0002 CR,LF,"Antal rader per tum satta.",CR,LF
+0010 T 0002 CR,LF,"Ogiltig ”verf”ringshastighet angiven.",CR,LF
+0011 T 0002 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 T 0002 "0123456789"
+0013 T 0001 CR,LF,"Kan du se den %1? (J/N) "
+0015 T 0001 "LPT%1: „r omdirigerad till COM%2:",CR,LF
+0016 T 0001 "LPT%1: „r inte omdirigerad.",CR,LF
+0017 T 0002 CR,LF,"%1 omf”rs”k p† parallellansluten skrivare.",CR,LF
+0018 T 0002 CR,LF," Kan inte flytta sk„rmen sidledes %1.",CR,LF
+0020 T 0002 CR,LF,"Fel antal parametrar.",CR,LF
+0021 T 0002 CR,LF,"NET 042: Kan inte utf”ra beg„rt kommando.",CR,LF
+0022 T 0002 CR,LF,"O„ndliga omf”rs”k st”ds inte av skrivare i n„tet.",cr,lf
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 T 0002 CR,LF,"Kan inte ”ppna enhet: %1.",CR,LF
+0025 T 0002 CR,LF,"Uppgift om enhet eller teckentabell saknas i typsnittsfilen.",CR,LF
+0026 T 0002 CR,LF,"Ogiltigt inneh†ll i typsnittsfilen.",CR,LF
+0027 T 0002 CR,LF,"Teckentabellen „r utbytt.",CR,LF
+0028 T 0002 CR,LF,"Aktiv teckentabell f”r enhet %1 „r %2.",CR,LF
+0029 T 0002 CR,LF,"Enhet %1 inte f”rberedd (PREPARE).",CR,LF
+0030 T 0002 "%1 teckentabeller:",CR,LF
+0031 T 0002 " teckentabell %1",CR,LF ;FILLED IN BY "QUERY" ROUTINE WITH CODEPAGE ID
+0032 T 0002 CR,LF,"MODE %1 teckentabell avslutad.",CR,LF
+0033 T 0002 CR,LF,"Fel %1 GLOBAL teckentabell.",CR,LF ;FILLED IN with "setting" or "getting"
+0034 T 0002 CR,LF,"Aktuell teckentabell:",CR,LF ;table header
+0035 T 0002 " %1 - %2 teckentabell",CR,LF
+0036 T 0002 " Teckentabell inte f”rberedd (PREPARE).",CR,LF
+0037 T 0002 "Denna enhet st”der inte teckentabeller.",CR,LF
+0038 T 0002 "Ingen teckentabell har valts (SELECT).",CR,LF
+0039 T 0002 "Fel p† enheten vid %1.",CR,LF
+0040 T 0002 "Teckentabellen „r inte f”rberedd (PREPARE).",CR,LF
+0041 T 0002 CR,LF,"Aktuell tangentbordskod st”der inte denna teckentabell.",CR,LF
+0042 T 0002 CR,LF,"Fel vid l„sning av typsnittsfil.",CR,LF
+0043 T 0002 CR,LF,"Kan inte g”ra REFRESH.",CR,LF
+0044 T 0002 CR,LF ;used for formatting
+0045 T 0002 CR,LF,"Status p† enhet %1:",CR,LF ;header for status reports
+0046 T 0002 "------------------" ;first part of underline under "Status for device %1:"
+0047 T 0002 "----",CR,LF ;four_char_underline
+0048 T 0002 "-----",CR,LF ;five_char_underline
+0049 T 0002 "LINES=%1",CR,LF
+0050 T 0002 "COLUMNS=%1",CR,LF
+0051 T 0002 CR,LF,"RATE och DELAY m†ste st† ihop.",CR,LF
+0052 T 0002 "RATE=%1",CR,LF
+0053 T 0002 "DELAY=%1",CR,LF
+0054 T 0002 CR,LF,"Funktionen finns inte i datorn - %1",CR,LF
+0055 T 0002 CR,LF,"Typsnittet som kr„vs „r inte inl„st.",CR,LF
+0056 T 0002 CR,LF,"ANSI.SYS m†ste vara installerad f”r denna funktion.",CR,LF
+0057 T 0002 CR,LF,"Du m†ste ange ”verf”ringshastighet (i Baud).",CR,LF
+0058 T 0002 "RETRY=%1",CR,LF
+RESTORE 9a8f 0021
+0002 T 0002 CR,LF,"Samma k„lla och destination.",CR,LF
+0003 T 0002 CR,LF,"Fel antal parametrar.",CR,LF
+0006 T 0002 CR,LF,"Ogiltig enhet angiven.",CR,LF
+0007 T 0002 CR,LF,"Varning! Hittar inga filer att †terst„lla.",CR,LF
+0008 T 0002 CR,LF,"S„tt in BACKUP-diskett %1 i enhet %2:",CR,LF
+0009 T 0002 CR,LF,"S„tt in destinationsdisketten i enhet %1:",CR,LF
+0011 T 0002 CR,LF,"Varning! BACKUP-disketten „r inte den r„tta i ordningen.",CR,LF
+ "Byt ut disketten eller forts„tt med denna.",CR,LF
+0012 T 0002 CR,LF,"Den sista filen blev inte †terst„lld.",CR,LF
+0013 T 0002 CR,LF,"*** Filerna har †terst„llts %1. ***",CR,LF
+0014 T 0002 CR,LF,"K„llan inneh†ller inte BACKUP-filer.",CR,LF
+0015 T 0002 CR,LF,"Otillr„ckligt minne.",CR,LF
+0016 T 0002 CR,LF,"Varning! Fil %1",CR,LF
+ "„r en LŽSFIL.",CR,LF
+ "Skall filen bytas ut? (J/N) ",CR,LF
+0017 T 0002 CR,LF,"RESTORE-filerna „r inte i r„tt ordning.",CR,LF
+0018 T 0002 CR,LF,"Fel n„r filen ska skapas.",CR,LF
+0019 T 0002 CR,LF,"Otillr„ckligt diskutrymme.",CR,LF
+0020 T 0002 CR,LF,"*** Det g†r inte att †terst„lla filen. ***",CR,LF
+0021 T 0002 CR,LF,"*** terst„ller filer fr†n enhet %1: ***",CR,LF
+0022 T 0002 CR,LF,"Varning! Filen %1",CR,LF
+ "har „ndrats efter sista s„kerhetskopieringen.",CR,LF
+ "Skall filen bytas ut? (J/N) ",CR,LF
+0023 T 0002 "Diskett nr: %1",CR,LF
+0025 T 0002 07 ;For BEEP !
+0026 U 0000 CR,LF,"Error restoring extended attributes",CR,LF
+SELECT a039 0016
+0004 T 0002 "Ogiltig SELECT Boot Media",CR,LF,CR,LF
+ "S„tt in INSTALL-disketten i enhet A: och f”rs”k igen."
+0005 T 0002 "Ogiltig disk- eller diskettmedia.",CR,LF,CR,LF
+ "S„tt in INSTALL-disketten i enhet A: och f”rs”k igen."
+0006 T 0002 "Ogiltiga parametrar p† kommandoraden SELECT.",CR,LF,CR,LF
+ "Kontrollera att INSTALL-disketten „r i enhet A:",CR,LF
+ "Tryck p† Ctrl+Alt+Del f”r att starta om."
+0007 T 0002 BELL,"Kan inte installera DOS. Programmet har avbrutits.",CR,LF
+0008 T 0002 "L„ser in SELECT. Var god v„nta."
+0009 T 0002 "Du m†ste starta om datorn om du vill forts„tta.",CR,LF,CR,LF
+ "Tryck p† Ctrl+Alt+Del f”r att forts„tta med DOS-installationen."
+0010 T 0002 "S„tt in SELECT-disketten i enhet A:",CR,LF,CR,LF
+ "Tryck p† Enter f”r att installera DOS",CR,LF
+ "eller avbryt med Esc.",CR,LF
+0011 T 0002 BELL
+0012 T 0002 "S„tt in SELECT-disketten i enhet A:",CR,LF,CR,LF
+ "Forts„tt med Enter.",CR,LF
+0013 U 0001 "Remove the INSTALL COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE a782 0004
+0002 T 0002 "Lista ”ver kataloger f”r volym %1.",CR,LF ;define message ;AN000;
+0003 T 0002 "Lista ”ver kataloger.",CR,LF ; ;AN000;
+0004 T 0002 "Det finns inga underkataloger.",CR,LF,LF ; ;AN000;
+0007 T 0002 "ÀÄó" ;"elbo","dash","tee","bar"
+REPLACE a8ed 0009
+0003 T 0002 CR,LF,"Inga filer har bytts ut.",CR,LF
+0004 T 0002 CR,LF,"Inga filer har lagts till.",CR,LF
+0013 T 0002 CR,LF,"Filen %1 byts ut.",CR,LF
+0014 T 0002 CR,LF,"Filen %1 l„ggs till.",CR,LF
+0015 T 0002 CR,LF,"%1 fil(er) har bytts ut.",CR,LF
+0016 T 0002 CR,LF,"%1 fil(er) har lagts till.",CR,LF
+0017 T 0002 CR,LF,"Hittar inga filer %1.",CR,LF
+0022 T 0002 CR,LF,"Skall filen %1 bytas ut? (J/N) "
+0023 T 0002 CR,LF,"Skall filen %1 l„ggas till? (J/N) "
+XCOPY aad0 0019
+0004 T 0002 "Žr %1 ett filnamn eller ett",CR,LF ;AN000;
+ "katalognamn p† destinationen?",CR,LF
+ "(F = fil, K = katalog) "
+0005 T 0002 "Tryck p† valfri tangent f”r att b”rja kopieringen av fil(er)." ;AN000;
+0006 T 0002 "S”kv„gen „r f”r l†ng.",CR,LF ;AN000;
+0008 T 0002 "Kan inte utf”ra en cyklisk kopiering.",CR,LF ;AN000;
+0012 T 0002 "XCOPY kan inte anv„ndas fr†n en reserverad enhet.",CR,LF ;AN000;
+0021 T 0002 "Fel antal parametrar.",CR,LF ;AN000;
+0022 T 0002 "XCOPY kan inte g”ras till en reserverad enhet.",CR,LF ;AN000;
+0024 T 0002 "Fel n„r filen ska skapas.",CR,LF ;AN000;
+0025 T 0002 "L„ser k„llfil(er)...",CR,LF ;AN000;
+0026 T 0002 CR,LF ;AN000;
+0027 T 0002 "%1 fil(er) har kopierats.",CR,LF ;AN000;
+0028 T 0002 "Hittar inte filen %1.",CR,LF ;AN000;
+0029 T 0002 "F D " ;AN000;'PLEASE TRANSLATE' ELIMINATE THE SPACE CHARACTERS
+0030 T 0002 "%1%2",CR,LF ;AN000;S_PATH_FILE0
+0031 T 0002 "%1\%2",CR,LF ;AN000;S_PATH_FILE1
+0032 T 0002 "%1",CR,LF ;AN000;DISPLAY_S_PATH
+0033 T 0002 "%1%2 (J/N)" ;AN000;P_S_PATH_FILE0
+0034 T 0002 "%1\%2 (J/N)" ;AN000;P_S_PATH_FILE1
+0035 U 0000 "Invalid switch %1.",CR,LF ;AN004;DUPLICATE SW ERROR MSG
+VDISK afb0 0013
+0002 T 0002 "Otillr„ckligt minne.",CR,LF ;AN000; "Otillr„ckligt minne."
+0003 T 0002 "VDISK Version 3.40 virtuell disk %1",CR,LF ;AN000;
+0004 T 0002 " Buffertstorlek „ndrad.",CR,LF ;AN000;
+0005 T 0002 " Sektorstorlek „ndrad.",CR,LF ;AN000;
+0006 T 0002 " Antal kataloging†ngar „ndrade.",CR,LF ;AN000;
+0007 U 0000 " Invalid switch character",CR,LF ;AN000;
+0008 T 0002 " ™verf”ringsstorleken justerad.",CR,LF ;AN000;
+0009 T 0002 " Buffertstorlek: %1 KB",CR,LF ;AN000;
+0010 T 0002 " Sektorstorlek: %1",CR,LF ;AN000;
+0011 T 0002 " Antal kataloging†ngar: %1",CR,LF ;AN000;
+0012 T 0002 " ™verf”ringsstorlek: %1",CR,LF ;AN000;
+0013 T 0002 "VDISK inte installerad - " ;AN000;
+0014 T 0002 " omkopplarna p† utbyggnadskortet",CR,LF ;AN000;
+ "”verensst„mmer inte med systemets minnesstorlek.",CR,LF,CR,LF ;AN000;
+GRAFTABL b3b7 0005
+0002 T 0002 "Aktiv teckentabell: %1",CR,LF
+0003 T 0002 "Tidigare teckentabell: %1",CR,LF
+0004 T 0002 "Inga",NULL
+0005 T 0002 "Inte standard",NULL
+0006 U 0000 CR,LF,"DOS command line parameters supported",COLON,CR,LF,LF
+ " /STA - Request Status only",CR,LF
+ " ? - Display this summary of parameters",CR,LF,CR,LF
+ " Code Pages available",COLON,CR,LF
+ " 437 - USA Graphic Character Set",CR,LF
+ " 850 - Multi-lingual Graphic Character Set",CR,LF
+ " 860 - Portuguese Graphic Character Set",CR,LF
+ " 863 - Canadian French Graphic Character Set",CR,LF
+ " 865 - Nordic Graphic Character Set",CR,LF
+FASTOPEN b646 0016
+0004 T 0002 CR,LF,"FASTOPEN „r installerad.",CR,LF ;AN000;
+0005 U 0000 CR,LF,"FASTOPEN already installed.",CR,LF ;AN000;
+0006 U 0000 CR,LF,"Incorrect parameter.",CR,LF ;AN000;
+0007 T 0002 CR,LF,"F”r m†nga enhetsing†ngar.",CR,LF ;AN000;
+0008 T 0002 CR,LF,"Samma enhet „r specificerad flera g†nger.",CR,LF ;AN000;
+0009 T 0002 CR,LF,"Ogiltig parameter.",CR,LF ;AN000;
+0010 U 0000 CR,LF,"Invalid switch type.",CR,LF ;AN000;
+0011 U 0000 CR,LF,"Invalid extent entry.",CR,LF ;AN000;
+0012 U 0000 CR,LF,"Invalid number of file/directory entries.",CR,LF
+0013 U 0000 CR,LF,"Cannot setup expanded memory.",CR,LF ;AN000;
+0014 T 0002 CR,LF,"Ut”kat minne „r inte tillg„ngligt.",CR,LF ;AN000;
+0015 T 0002 CR,LF,"Ogiltig enhet angiven %1.",CR,LF ;AN000;
+0016 U 0000 CR,LF,"Not enough space in EMS. Low memory is used.",CR,LF ;AN000;
+0017 T 0002 CR,LF,"FASTOPEN kan inte anv„ndas f”r enhet %1.",CR,LF
+0018 U 0000 CR,LF,"Too many extent entries.",CR,LF
+0019 U 0000 CR,LF,"Too many file/directory entries.",CR,LF
+APPEND ba6e 0009
+0001 T 0002 "Fel version av APPEND.",CR,LF
+0002 T 0002 "Ogiltig s”kv„g.",CR,LF
+0003 T 0002 "Ogiltig parameter.",CR,LF
+0004 T 0002 "Ogiltig kombination av parametrar.",CR,LF
+0005 T 0002 "Ingen APPEND g„ller.",CR,LF
+0006 T 0002 "APPEND / ASSIGN konflikt.",CR,LF
+0007 T 0002 "APPEND / TopView konflikt.",CR,LF
+0008 T 0002 "Fel DOS-version.",CR,LF
+0009 T 0002 "APPEND „r redan installerad.",CR,LF
+GRAPHICS bc14 0012
+0005 T 0002 "Ogiltig parameter: %1",CR,LF ;AN000
+0007 T 0002 "Dubblerade parametrar „r inte till†tet.",CR,LF ;AN000
+0009 U 0000 "Cannot find GRAPHICS profile.",CR,LF ;AN000
+0010 U 0000 "Required profile statement missing before line %1",CR,LF ;AN000
+0011 U 0000 "Invalid profile statement on line %1",CR,LF ;AN000
+0012 U 0000 "Profile statement out of sequence on line %1",CR,LF ;AN000
+0013 U 0000 "Error reading GRAPHICS profile",CR,LF ;AN000
+0014 U 0000 "Syntax errors in GRAPHICS profile",CR,LF ;AN000
+0015 U 0000 "Printbox ID not in GRAPHICS profile",CR,LF
+0016 U 0000 "Printer type not in GRAPHICS profile",CR,LF ;AN000
+0017 U 0000 "/B invalid with a black and white printer",CR,LF ;AN000
+0018 U 0000 "Unable to reload with profile supplied",CR,LF ;AN000
+DISPLAY c051 0003
+0002 T 0002 "%1 -drivrutinen f”r teckentabell kan inte initieras",CR,LF
+0008 T 0002 "Otillr„ckligt minne",CR,LF
+0012 T 0002 "Fel syntax i DEVICE=DISPLAY.SYS-kommandot",CR,LF
+PRINTER c116 0002
+0002 T 0002 "%1 -drivrutinen f”r teckentabell kan inte initieras",CR,LF
+0012 T 0002 "Fel syntax i DEVICE=PRINTER.SYS-kommandot",CR,LF
+KEYB c1b2 0016
+0002 T 0002 "Aktuell tangentbordskod: %1"
+0003 T 0002 "Tangentbordets nuvarande ID: %1"
+0004 T 0002 " teckentabell: %1.",CR,LF
+0005 T 0002 "Aktuell teckentabell f”r CON: %1.",CR,LF
+0006 T 0002 "Ogiltig tangentbordskod angiven.",CR,LF
+0007 T 0002 "Du har angivit fel tangentbords-ID.",CR,LF
+0008 T 0002 "Ogiltig teckentabell angiven.",CR,LF
+0009 T 0002 "Filen KEYBOARD.SYS saknas eller „r felaktig.",CR,LF
+0010 T 0002 "KEYB har inte installerats.",CR,LF
+0011 T 0002 "Ingen aktiv teckentabell f”r enheten CON.",CR,LF
+0012 T 0002 "Angiven teckentabell „r inte f”rberedd (PREPARE).",CR,LF
+0013 T 0002 "En eller flera teckentabeller f”r CON passar inte tangentbordskoden.",CR,LF
+0014 T 0002 "Beg„rd teckentabell (%1) passar inte tangentbordskoden.",CR,LF
+0015 T 0002 "Tangentbord och sk„rm anv„nder olika teckentabeller.",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 T 0002 "Kan inte skapa tangentbordstabeller i det residenta minnet.",CR,LF
+REDIRSYS c5ba 0000
+MEM c5ce 0037
+0010 T 0002 CR,LF
+0011 T 0002 " Adress Namn Storlek Typ ",CR,LF
+0012 T 0002 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 T 0002 " Filnummer EMS Namn Storlek ",CR,LF
+0014 T 0002 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 T 0002 " %1 %2 %3 %4",CR,LF
+0016 T 0002 " %1 %2 %3 ",CR,LF
+0017 T 0002 " %1 %2 ",CR,LF
+0018 T 0002 "%1 byte utg”r det totala minnet.",CR,LF
+0019 T 0002 "%1 byte finns tillg„ngliga.",CR,LF
+0020 T 0002 "%1 st”rsta m”jliga storlek p† k”rbart program.",CR,LF
+0021 T 0002 "%1 byte utg”r det totala EMS-minnet.",CR,LF
+0022 T 0002 "%1 byte „r lediga i EMS-minnet.",CR,LF
+0023 T 0002 "%1 byte utg”r det totala ut”kade minnet.",CR,LF
+0024 T 0002 "Avbrottsvektor",0
+0025 T 0002 "ROM kommunikationsarea",0
+0026 T 0002 "DOS kommunikationsarea",0
+0027 T 0002 "IBMBIO",0
+0028 T 0002 "IBMDOS",0
+0029 T 0002 "Systemdata",0
+0030 T 0002 "Systemprogram",0
+0031 T 0002 "Systemets drivrutin",0
+0032 T 0002 "Installerad drivrutin",0
+0033 T 0002 "%1:",0
+0034 T 0002 "%1: - %2:",0
+0035 T 0002 "BUFFERS=",0
+0036 T 0002 "FILES=",0
+0037 T 0002 "FCBS=",0
+0038 T 0002 "STACKS=",0
+0039 T 0002 "DEVICE=",0
+0040 T 0002 "IFS=",0
+0041 T 0002 "LASTDRIVE=",0
+0042 T 0002 "----------",0
+0043 T 0002 " ",0
+0044 T 0002 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+0046 U 0001 "%1 bytes available extended memory",CR,LF
+REDIR cbba 0040
+0004 T 0002 "N„tet „r inte startat.",CR,LF
+0050 T 0002 "NET809: N„toperationen finns inte.",CR,LF,0
+0051 T 0002 "NET801: Fj„rransluten dator svarar inte.",CR,LF,0
+0052 T 0002 "NET802: Namnet finns redan i n„tet.",CR,LF,0
+0053 T 0002 "NET803: S”kv„g i n„tet finns inte.",CR,LF,0
+0054 T 0002 "NET804: N„tet „r upptaget.",CR,LF,0
+0055 T 0002 "NET805: N„tenheten finns inte l„ngre.",CR,LF,0
+0056 U 0000 "NET806: Net BIOS command limit exceeded",CR,LF,0
+0057 T 0002 "NET807: Systemfel - NETBIOS-fel.",CR,LF,0
+0058 T 0002 "NET808: Felaktigt svar fr†n n„tet.",CR,LF,0
+0059 T 0002 "NET810: Ov„ntat fel i n„tet.",CR,LF,0
+0060 T 0002 "NET811: Fj„rransluten adapter „r inkompatibel.",CR,LF,0
+0061 T 0002 "NET812: Utskriftsk”n „r full.",CR,LF,0
+0062 U 0000 "NET813: Not enough space for print file",CR,LF,0
+0063 T 0002 "NET814: Utskriftsfilen „r annullerad.",CR,LF,0
+0064 U 0000 "NET815: Network name was deleted",CR,LF,0
+0065 T 0002 "tkomst nekad.",CR,LF,0
+0066 T 0002 "NET817: Felaktig typ av n„tenhet.",CR,LF,0
+0067 U 0000 "NET818: Network name not found",CR,LF,0
+0068 U 0000 "NET819: Network name limit exceeded",CR,LF,0
+0069 U 0000 "NET820: Net BIOS session limit exceeded",CR,LF,0
+0070 T 0002 "NET821: Delning har tillf„lligt stannat av.",CR,LF,0
+0071 T 0002 "NET823: N„toperationen accepteras inte.",CR,LF,0
+0072 U 0000 "NET822: Print or disk redirection is paused",CR,LF,0
+0073 U 0000 "NET476: Netbeui not loaded",CR,LF,0
+0074 U 0000 "NET477: Unexpected adapter close",CR,LF,0
+0075 U 0000 "NET826: Target Server /RQB size too small",CR,LF,0
+0076 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0077 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0078 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0079 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0080 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0081 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0082 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0083 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0084 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0085 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0086 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0087 T 0002 "NET???: Ov„ntat n„tfel.",CR,LF,0
+0088 T 0002 "NET825: Datafel i n„tet.",CR,LF,0
+XMA2EMS d44f 0017
+0001 T 0002 "XMA2EMS: Expanded Memory Manager Version 1.xx",CR,LF
+ "74X9906 (c)Copyright IBM Corporation 1986 All rights reserved",CR,LF,"$"
+0002 T 0002 CR,LF,"XMA001 K”r testprogram VMO/XMA: ","$"
+0003 T 0002 "XMA002 Testen „r klar. ",CR,LF,LF,"$"
+0004 T 0002 "XMA003 Sidram b”rjar vid ............................. "
+0005 T 0002 "XXXX",":0",CR,LF,"$"
+0006 T 0002 "XMA004 Sidor som fyller ut minnet till 640 KB......... "
+0007 T 0002 "0 ",CR,LF,"$"
+0008 T 0002 "XMA005 Sidor reserverade f”r styrprogram.............. "
+0009 T 0002 "0 ",CR,LF,"$"
+0010 T 0002 "XMA006 Sidor tillg„ngliga f”r ut”kat minne............ "
+0011 T 0002 "0 ",CR,LF,"$"
+0012 T 0002 CR,LF,"XMA100 Adapterfel:",CR,LF," Expanded Memory Manager har INTE installerats.",CR,LF,"$"
+0013 T 0002 CR,LF,"XMA200 Hittar inget XMA-kort:",CR,LF," Expanded Memory Manager har INTE installerats.",CR,LF,"$"
+0014 T 0002 CR,LF,"XMA300 Parametern har fel syntax eller v„rde:",CR,LF
+ " Expanded Memory Manager har INTE installerats.",CR,LF,"$"
+0015 T 0002 SIZE1_END - 2 -$
+0016 T 0002 4 DUP (?)," KB OK",CR,LF,"$"
+0017 T 0002 NXT_LN_END - 2 -$," ",CR,LF,"$"
+FILESYS d922 0006
+0010 U 0001 " Paused %1 %2 %3",CR,LF
+0011 U 0001 " %1 %2 %3",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0001 "No Entries Found",CR,LF
+FDISK da70 0120
+0004 T 0002 "FDISK kan inte anv„ndas med n„tprogrammet.",CR,LF
+0005 T 0002 "Ingen fast disk „r tillg„nglig.",CR,LF
+0006 T 0002 "Fel vid l„sning fr†n fast disk.",CR,LF
+0007 T 0002 "Fel vid skrivning till fast disk.",CR,LF
+1001 T 0002 "IBM Personal Computer"
+1002 T 0002 "Fixed Disk Setup Program Version 3.40"
+1003 T 0002 "(C)Copyright IBM Corp. 1983,1988"
+1004 T 0002 "FDISK huvudmeny"
+1005 T 0002 "1. <R>Skapa en DOS-partition eller logisk DOS-enhet."
+1006 T 0002 "2. <R>G”r en partition aktiv."
+1007 T 0002 "3. <R>Ta bort en DOS-partition eller logisk DOS-enhet."
+1008 T 0002 "4. <R>Visa partitionsdata."
+1009 T 0002 "L„mna FDISK med <H>Esc<R>."
+1010 T 0002 "V„lj ett av f”ljande alternativ:"
+1011 T 0002 "5. <R>V„lj n„sta fasta diskenhet."
+1012 T 0002 "Aktuell fast diskenhet: <H><I>"
+1013 T 0002 "Varning: <R>Ingen partition „r aktiv - disk 1 kan inte startas."
+1014 T 0002 " "
+1015 T 0002 "Ange alternativ: [<S> ]"
+1016 T 0002 "Skapa en DOS-partition eller logisk DOS-enhet"
+1017 T 0002 "1. <R>Skapa prim„r DOS-partition."
+1018 T 0002 "2. <R>Skapa sekund„r DOS-partition."
+1019 T 0002 "3. <R>Skapa logiska DOS-enheter i den sekund„ra DOS-partitionen."
+1020 T 0002 "Tryck p† <H>ESC<R> f”r att komma till FDISK huvudmeny."
+1021 T 0002 "Skapa prim„r DOS-partition"
+1022 T 0002 "Vill du anv„nda maximal storlek f”r partitionen och g”ra den aktiv?"
+1023 T 0002 "(<Y>/<N>).....................? <H>[<S> ]"
+1024 T 0002 "(<Y>/<N>)...................................................? <H>[<S> ]"
+1025 T 0002 "Partition Status Typ Start Slut Cyl"
+1026 T 0002 "Det totala diskutrymmet „r <HIIIIR> MB (1 MB = 1048576 byte)."
+1027 T 0002 "Maximalt utrymme f”r partitionen „r <HIIIIR> MB (<HIIIIR>)."
+1028 T 0002 "Ange partitionens storlek i MB eller procent av diskutrymme (%) f”r"
+1029 T 0002 "att skapa en prim„r DOS-partition..............................: <H>[<IIISI>]"
+1030 T 0002 "Skapa sekund„r DOS-partition"
+1031 T 0002 "skapa en sekund„r DOS-partition...............................: <H>[<IIISI>]"
+1032 T 0002 "Forts„tt med <H>Esc<R>."
+1033 T 0002 "Skapa logisk(a) DOS-enhet(er) i den sekund„ra DOS-partitionen"
+1034 T 0002 "Enhet Volym Etikett MB System Anv„nds"
+1035 T 0002 "Den sekund„ra DOS-partitionens totala storlek „r <HIIIIR> MB (1 MB=1048576 byte)."
+1036 T 0002 "Maximalt utrymme f”r den logiska enheten „r <HIIIIR> MB <H>(<IIII>)."
+1037 T 0002 "Ange storlek p† logisk enhet i MB eller procent av diskutrymme (%)...<H>[<IIISI>]"
+1038 T 0002 "G”r en partition aktiv"
+1039 T 0002 "Ange numret p† partitionen du vill g”ra aktiv................: <H>[<S> ]"
+1040 T 0002 "Ta bort en DOS-partition eller logisk DOS-enhet"
+1041 T 0002 "1. <R>Ta bort prim„r DOS-partition."
+1042 T 0002 "2. <R>Ta bort sekund„r DOS-partition."
+1043 T 0002 "3. <R>Ta bort logiska DOS-enheter i den sekund„ra DOS-partitionen."
+1044 T 0002 "Ta bort prim„r DOS-partition"
+1045 T 0002 "Varning: <OR>Data i den prim„ra DOS-partitionen kommer att tas bort."
+1046 T 0002 "Vill du forts„tta?....................... <H>[<S> ]"
+1047 T 0002 "Ta bort sekund„r DOS-partition"
+1048 T 0002 "Varning: <OR>Data i den sekund„ra DOS-partitionen kommer att tas bort."
+1049 T 0002 "Vill du forts„tta?....................... <H>[<S> ]"
+1050 T 0002 "Ta bort logiska DOS-enheter i den sekund„ra DOS-partitionen"
+1051 T 0002 "Varning: <OR>Data i den logiska DOS-enheten kommer att tas bort."
+1052 T 0002 "Vilken enhet vill du ta bort?...................... <H>[<S> ]"
+1053 T 0002 "Žr du s„ker?...................... <H>[<S> ]"
+1054 T 0002 "Ange volymetikett...............................? <H>[<S> ]"
+1055 T 0002 "Visa partitionsdata"
+1056 T 0002 "Den sekund„ra DOS-partitionen inneh†ller logiska DOS-enheter."
+1057 T 0002 "Vill du att data f”r logiska enheter ska visas? [<S> ]"
+1058 T 0002 "Visa data f”r logiska DOS-enheter"
+1059 T 0002 "Systemet kommer att †terstartas."
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 T 0002 " "
+1062 T 0002 "Den prim„ra DOS-partitionen „r borttagen."
+1063 T 0002 "Den sekund„ra DOS-partitionen „r borttagen."
+1064 T 0002 "Enheten „r borttagen."
+1065 T 0002 "Partition <I> „r aktiverad."
+1066 T 0002 "Prim„r DOS-partition har skapats."
+1067 T 0002 "Sekund„r DOS-partition har skapats."
+1068 T 0002 "Logisk DOS-enhet har skapats, enhetsbokst„verna har „ndrats eller lagts till. <W>"
+1069 T 0002 "Ingen partition „r definierad."
+1070 T 0002 "Ingen logisk enhet „r definierad."
+1071 T 0002 "Enhetens bokstav har „ndrats eller tagits bort <W>."
+1072 T 0002 "Enheten „r omdirigerad."
+1073 T 0002 "Prim„r DOS-partition har skapats, enhetsbokst„verna har „ndrats eller lagts till."
+1074 T 0002 "Ingen fast disk „r tillg„nglig."
+1075 T 0002 "Fel vid l„sning fr†n fast disk."
+1076 T 0002 "Fel vid skrivning till fast disk."
+1077 T 0002 "Fel DOS-version."
+1078 T 0002 "FDISK kan inte anv„ndas med n„tprogrammet."
+1079 T 0002 "Det finns ingen prim„r DOS-partition att ta bort."
+1080 T 0002 "Det finns ingen sekund„r DOS-partition att ta bort"
+1081 T 0002 "Prim„r DOS-partition finns redan."
+1082 T 0002 "Sekund„r DOS-partition finns redan."
+1083 T 0002 "Det finns inte utrymme f”r att skapa en DOS-partition. <W>"
+1084 T 0002 "Beg„rd storlek f”r logisk enhet ”verskrider maximalt tillg„ngligt utrymme. <W>"
+1085 T 0002 "Beg„rd partitionsstorlek ”verskrider maximalt tillg„ngligt utrymme. <W>"
+1086 T 0002 "Det finns ingen partition att ta bort."
+1087 T 0002 "Startpartitionen p† enhet 1 „r redan aktiv. <W>"
+1088 T 0002 "Det finns ingen partition att g”ra aktiv."
+1089 T 0002 "Partitionen du valde (<I>) „r ingen startpartition. Ingen „ndring har gjorts. <W>"
+1090 T 0002 "Kan inte skapa sekund„r DOS-partition "
+1091 T 0002 "utan prim„r DOS-partition p† disk 1. <W>"
+1092 T 0002 "Allt utrymme i sekund„r DOS-partition har"
+1093 T 0002 "anv„nts till logiska enheter. <W>"
+1094 T 0002 "Kan inte ta bort sekund„r DOS-partition n„r det finns logiska enheter.<W>"
+1095 T 0002 "Alla logiska enheter „r borttagna ur den sekund„ra DOS-partitionen.<W>"
+1096 T 0002 " „r ett ogiltigt val. Ange <III>. "
+1097 T 0002 "Varning: Den markerade partitionen „r ingen startpartition.<W>"
+1098 T 0002 " Det finns ingen partition som g†r att starta."
+1099 T 0002 "Bara partitioner i enhet 1 kan g”ras aktiva.<W>"
+1100 T 0002 "Maximalt antal logiska DOS-enheter installerade.<W>"
+1101 T 0002 "Antal cylindrar f†r inte vara noll (0)."
+1102 T 0002 "Enhet <II> „r redan borttagen."
+1103 T 0002 "tkomstfel. Enhet: <I>.<OW>"
+1104 T 0002 "Ogiltigt alternativ, ange: <III>.<W>"
+1105 T 0002 "Kan inte ta bort en prim„r DOS-partition p† enhet 1 n„r det finns sekund„ra "
+1106 T 0002 "partitioner.<W>"
+1107 T 0002 "Ogiltig indata. Tryck p† Enter.<W>"
+1108 T 0002 "Volymetikett ”verensst„mmer inte.<W>"
+1109 T 0002 "Det g†r inte att skapa en logisk DOS-enhet utan en"
+1110 T 0002 "sekund„r DOS-partition p† aktuell enhet.<W>"
+1111 T 0002 "Det finns ingen logisk DOS-enhet att ta bort."
+1112 U 0000 "Message string error <I>. See header of FDISKC.MSG for error definition"
+1113 T 0002 "Internt fel."
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
diff --git a/private/mvdm/dos/v86/messages/usa-ibm.msg b/private/mvdm/dos/v86/messages/usa-ibm.msg
new file mode 100644
index 000000000..7a7d5aa9c
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/usa-ibm.msg
@@ -0,0 +1,1222 @@
+0065
+COMMON 0006 0038
+0001 U 0000 "Incorrect DOS version",CR,LF
+0002 U 0000 "%1 already installed",CR,LF
+0003 U 0000 "%1 bytes available on disk",CR,LF
+0004 U 0000 "%1 bytes free",CR,LF
+0005 U 0000 "%1 bytes in bad sectors",CR,LF
+0006 U 0000 "%1 bytes total disk space",CR,LF
+0007 U 0000 "%1 bytes total memory",CR,LF
+0008 U 0000 "%1 bytes used by system",CR,LF
+0009 U 0000 "%1 installed",CR,LF
+0010 U 0000 "%1 not installed",CR,LF
+0011 U 0000 "%1 not installed",CR,LF
+0012 U 0000 "Cannot %1 a network drive",CR,LF
+0013 U 0000 "",
+0014 U 0000 "Cannot %1 a SUBSTed or ASSIGNed drive",CR,LF
+0015 U 0000 "Cannot execute %1",CR,LF
+0016 U 0000 "Expanded Memory not available",CR,LF
+0017 U 0000 "File allocation table bad, drive %1",CR,LF
+0018 U 0000 "File cannot be copied onto itself",CR,LF
+0019 U 0000 "Insert target disk in drive %1",CR,LF
+0020 U 0000 "Insufficient disk space",CR,LF
+0021 U 0000 "Invalid characters in volume label",CR,LF
+0022 U 0000 "Invalid code page",CR,LF
+0023 U 0000 "Invalid date",CR,LF
+0024 U 0000 "Invalid time",CR,LF
+0025 U 0000 "Invalid path",CR,LF
+0026 U 0000 "No source drive specified",CR,LF
+0027 U 0000 "No target drive specified",CR,LF
+0028 U 0000 "Press any key to continue . . .",CR,LF
+0029 U 0000 "Source path required",CR,LF
+0030 U 0000 "System transferred",CR,LF
+0031 U 0000 "",
+0032 U 0000 "Unable to create directory",CR,LF
+0033 U 0000 "Volume in drive %1 has no label",CR,LF
+0034 U 0000 "Volume in drive %1 is %2",CR,LF
+0035 U 0001 "Volume label (11 characters, ENTER for none)? "
+0036 U 0000 "Volume Serial Number is %1-%2",CR,LF
+0037 U 0000 "Incorrect file type",CR,LF
+0038 U 0001 CR,LF
+EXTEND 0685 0090
+0001 U 0003 "Invalid function"
+0002 U 0000 "File not found"
+0003 U 0000 "Path not found"
+0004 U 0000 "Too many open files"
+0005 U 0000 "Access denied "
+0006 U 0000 "Invalid handle"
+0007 U 0000 "Memory control blocks destroyed"
+0008 U 0000 "Insufficient memory"
+0009 U 0000 "Invalid memory block address"
+0010 U 0000 "Invalid Environment"
+0011 U 0000 "Invalid format"
+0012 U 0000 "Invalid function parameter"
+0013 U 0000 "Invalid data"
+0014 U 0000 "",
+0015 U 0000 "Invalid drive specification"
+0016 U 0000 "Attempt to remove current directory"
+0017 U 0000 "Not same device"
+0018 U 0000 "No more files"
+0019 U 0000 "Write protect error"
+0020 U 0000 "Invalid unit"
+0021 U 0000 "Not ready"
+0022 U 0000 "Invalid device request"
+0023 U 0000 "Data error"
+0024 U 0000 "Invalid device request parameters"
+0025 U 0000 "Seek error"
+0026 U 0000 "Invalid media type"
+0027 U 0000 "Sector not found"
+0028 U 0000 "Printer out of paper error"
+0029 U 0000 "Write fault error"
+0030 U 0000 "Read fault error"
+0031 U 0000 "General failure"
+0032 U 0000 "Sharing violation"
+0033 U 0000 "Lock violation"
+0034 U 0000 "Invalid disk change"
+0035 U 0000 "FCB unavailable"
+0036 U 0000 "System resource exhausted"
+0037 U 0000 "Code page mismatch"
+0038 U 0000 "Out of input"
+0039 U 0000 "Insufficient disk space"
+0040 U 0000 "",
+0041 U 0000 "",
+0042 U 0000 "",
+0043 U 0000 "",
+0044 U 0000 "",
+0045 U 0000 "",
+0046 U 0000 "",
+0047 U 0000 "",
+0048 U 0000 "",
+0049 U 0000 "",
+0050 U 0000 "NET809: Network request not supported"
+0051 U 0000 "NET801: Remote computer not listening"
+0052 U 0000 "NET802: Duplicate name on network"
+0053 U 0000 "NET803: Network path not found"
+0054 U 0000 "NET804: Network busy"
+0055 U 0000 "NET805: Network device no longer exists"
+0056 U 0000 "NET806: NETBIOS command limit exceeded"
+0057 U 0000 "NET807: System error; NETBIOS error"
+0058 U 0000 "NET808: Incorrect response from network"
+0059 U 0000 "NET810: Unexpected network error"
+0060 U 0000 "NET811: Incompatible remote adapter"
+0061 U 0000 "NET812: Print queue full"
+0062 U 0000 "NET813: Not enough space for print file"
+0063 U 0000 "NET814: Print file was cancelled"
+0064 U 0000 "NET815: Network name was deleted"
+0065 U 0000 "Access denied"
+0066 U 0000 "NET817: Network device type incorrect"
+0067 U 0000 "NET818: Network name not found"
+0068 U 0000 "NET819: Network name limit exceeded"
+0069 U 0000 "NET820: NETBIOS session limit exceeded"
+0070 U 0000 "NET821: Sharing temporarily paused"
+0071 U 0000 "NET823: Network request not accepted"
+0072 U 0000 "NET822: Print or disk redirection is paused"
+0073 U 0000 "NET476: Netbeui not loaded"
+0074 U 0000 "NET477: Unexpected adapter close"
+0075 U 0000 "",
+0076 U 0000 "",
+0077 U 0004 "",
+0078 U 0004 "",
+0079 U 0004 "",
+0080 U 0004 "File exists"
+0081 U 0004 "",
+0082 U 0004 "Cannot make directory entry"
+0083 U 0004 "Fail on INT 24"
+0084 U 0004 "Too many redirections"
+0085 U 0004 "Duplicate redirection"
+0086 U 0004 "Invalid password"
+0087 U 0004 "Invalid parameter"
+0088 U 0004 "Network data fault"
+0089 U 0004 "Function not supported by network"
+0090 U 0002 "Required system component not installed"
+PARSE 1315 0011
+0001 U 0000 "Too many parameters"
+0002 U 0000 "Required parameter missing"
+0003 U 0000 "Invalid switch"
+0004 U 0000 "Invalid keyword"
+0005 U 0000 "",
+0006 U 0000 "Parameter value not in allowed range"
+0007 U 0000 "Parameter value not allowed"
+0008 U 0000 "Parameter value not allowed"
+0009 U 0000 "Parameter format not correct"
+0010 U 0000 "Invalid parameter"
+0011 U 0000 "Invalid parameter combination"
+COMMAND 14c8 0091
+0201 U 0000 "A"
+0202 U 0000 "R"
+0203 U 0000 "I"
+0204 U 0000 "F"
+0205 U 0000 "Y"
+0206 U 0000 "N"
+0210 U 0000 "Abort"
+0211 U 0000 ", Retry"
+0212 U 0000 ", Ignore"
+0213 U 0000 ", Fail"
+0214 U 0000 "?"
+0215 U 0000 "reading",0
+0216 U 0000 "writing",0
+0217 U 0000 " %1 drive %2",CR,LF
+0218 U 0000 " %1 device %2",CR,LF
+0219 U 0000 "Please insert volume %1 serial %2-%3",CR,LF
+0221 U 0000 "Invalid COMMAND.COM",CR,LF
+0222 U 0000 "Insert disk with %1 in drive %2",CR,LF
+0224 U 0000 CR,LF,"Terminate batch job (Y/N)?"
+0225 U 0000 "Cannot execute %1",CR,LF
+0226 U 0000 "Error in EXE file",CR,LF
+0227 U 0000 "Program too big to fit in memory",CR,LF
+0228 U 0000 CR,LF,"No free file handles"
+0229 U 0000 "Bad Command or file name",CR,LF
+0231 U 0000 CR,LF,"Memory allocation error"
+0232 U 0000 CR,LF,"Cannot load COMMAND, system halted",CR,LF
+0233 U 0000 CR,LF,"Cannot start COMMAND, exiting",CR,LF
+0234 U 0000 CR,LF,"Top level process aborted, cannot continue",CR,LF
+0235 U 0000 CR,LF
+0463 U 0000 "Out of environment space",CR,LF
+0464 U 0001 CR,LF,CR,LF,"IBM DOS Version 4.10",CR,LF
+ " (C)Copyright International Business Machines Corp 1981, 1990",CR,LF
+ " (C)Copyright Microsoft Corp 1981-1986",CR,LF
+0465 U 0000 "Specified COMMAND search directory bad",CR,LF
+0466 U 0000 "Specified COMMAND search directory bad access denied",CR,LF
+1002 U 0000 "Duplicate file name or file not found",CR,LF
+1003 U 0000 "Invalid path or file name",CR,LF
+1007 U 0000 "Out of environment space",CR,LF
+1008 U 0000 "File creation error",CR,LF
+1009 U 0000 "Batch file missing",CR,LF
+1010 U 0000 CR,LF,"Insert disk with batch file",CR,LF
+1011 U 0000 "Bad command or file name",CR,LF
+1016 U 0000 "Content of destination lost before copy",CR,LF
+1017 U 0000 "Invalid filename or file not found",CR,LF
+1018 U 0000 "%1 File(s) copied",CR,LF
+1019 U 0000 "%1 File(s) "
+1022 U 0000 "Code page %1 not prepared for system",CR,LF
+1023 U 0000 "Code page %1 not prepared for all devices",CR,LF
+1024 U 0000 "Active code page: %1",CR,LF
+1025 U 0000 "NLSFUNC not installed",CR,LF
+1027 U 0000 "Current drive is no longer valid"
+1029 U 0000 "Label not found",CR,LF
+1030 U 0000 "Syntax error",CR,LF
+1032 U 0000 "Current date is %1 %2",CR,LF
+1033 U 0000 "SunMonTueWedThuFriSat"
+1034 U 0000 "Enter new date (%1): "
+1036 U 0000 "Current time is %1",CR,LF
+1037 U 0000 "Enter new time: "
+1038 U 0000 ", Delete (Y/N)?"
+1039 U 0000 "All files in directory will be deleted!",CR,LF
+ "Are you sure (Y/N)?"
+1040 U 0000 "IBM DOS Version %1.%2",CR,LF
+1044 U 0000 "Invalid directory",CR,LF
+1046 U 0000 "Invalid path, not directory,",CR,LF,"or directory not empty",CR,LF
+1047 U 0000 "Must specify ON or OFF",CR,LF
+1048 U 0000 "Directory of %1",CR,LF
+1049 U 0000 "No Path",CR,LF
+1050 U 0000 "Invalid drive in search path",CR,LF
+1051 U 0000 "Invalid device",CR,LF
+1052 U 0000 "FOR cannot be nested",CR,LF
+1053 U 0000 "Intermediate file error during pipe",CR,LF
+1054 U 0000 "Cannot do binary reads from a device",CR,LF
+1055 U 0000 "BREAK is %1",CR,LF
+1056 U 0000 "VERIFY is %1",CR,LF
+1057 U 0000 "ECHO is %1",CR,LF
+1059 U 0000 "off",0
+1060 U 0000 "on",0
+1061 U 0000 "Error writing to device",CR,LF
+1063 U 0000 "%1"
+1064 U 0000 "%1"
+1065 U 0000 "%1"
+1066 U 0000 "%1"
+1067 U 0000 9
+1068 U 0000 " <DIR> "
+1069 U 0000 8," ",8
+1070 U 0000 CR,LF
+1071 U 0000 "%1"
+1072 U 0000 "mm-dd-yy"
+1073 U 0000 "dd-mm-yy"
+1074 U 0000 "yy-mm-dd"
+1075 U 0000 "%1 %2"
+1076 U 0000 "%1"
+1077 U 0000 " %1 %2"
+1078 U 0000 "Directory already exists",CR,LF
+1079 U 0000 "%1 bytes",CR,LF
+1080 U 0000 "Total files listed:",CR,LF
+1081 U 0000 "(Error occurred in environment variable)",CR,LF
+1082 U 0000 CR,LF
+ " DIR [filespec] /W/P/S/B/A/O",CR,LF,CR,LF
+ " /W wide /A all files",CR,LF
+ " /P paged /A[[-]HSDAR] attributes",CR,LF
+ " /S subdirectories /O standard sort order",CR,LF
+ " /B bare /O[[-]FNEDS] sort order "
+1083 U 0000 CR,LF
+ " /H help",CR,LF,CR,LF
+ " Options may be preset in environment variable DIRCMD.",CR,LF,CR,LF
+ " Override environment options by prefixing any option with '-',",CR,LF
+ " like /-W to turn off wide format.",CR,LF
+1084 U 0000 "(continuing %1)",CR,LF
+1090 U 0000 "DOS Version: 4.00 U.S. Date: 06/17/88",CR,LF
+ "CSD Version: 0000000 U.S. Date: xx/xx/xx",CR,LF
+ATTRIB 22d6 0016
+0004 U 0000 "Invalid number of parameters",CR,LF
+0005 U 0000 "Invalid path or file not found",CR,LF
+0006 U 0000 "Syntax error",CR,LF
+0008 U 0000 " %1"
+0009 U 0000 "%1 %2",CR,LF
+0010 U 0000 "%1",CR,LF,"%2",CR,LF
+0011 U 0000 "%1, Code page mismatch",CR,LF,"Are you sure (Y/N)?"
+0012 U 0000 "%1",CR,LF
+0014 U 0000 CR,LF
+0015 U 0000 "Invalid file type value",CR,LF
+0199 U 0000 "Extended attribute error",CR,LF
+0201 U 0000 "Extended attribute name not found",CR,LF
+0204 U 0000 "Extended attribute name cannot be set",CR,LF
+0205 U 0000 "Extended attribute name known to this file system but not supported",CR,LF
+0206 U 0000 "Extended attribute type mismatch",CR,LF
+0208 U 0000 "Extended attribute value not supported",CR,LF
+ASSIGN 25cc 0001
+0002 U 0000 "Original %1: set to %2:",cr,lf
+CHKDSK 260d 0063
+0003 U 0000 "Convert lost chains to files (Y/N)?"
+0004 U 0000 "Unrecoverable error in directory"
+0005 U 0000 "Convert directory to file (Y/N)?"
+0007 U 0000 "%1 bytes total disk space"
+0008 U 0000 "%1 bytes in bad sectors"
+0009 U 0000 "%1 bytes in %2 hidden files"
+0010 U 0000 "%1 bytes in %2 directories"
+0011 U 0000 "%1 bytes in %2 user files"
+0012 U 0000 "%1 bytes in %2 recovered files"
+0013 U 0000 "%1 bytes would be in %2 recovered files"
+0014 U 0000 "%1 bytes available on disk"
+0015 U 0000 "%1 total bytes memory"
+0016 U 0000 "%1 bytes free"
+0017 U 0000 "Cannot CHKDSK a network drive"
+0018 U 0000 "Cannot CHKDSK a SUBSTed or ASSIGNed drive"
+0019 U 0000 "Probable non-DOS disk",CR,LF,"Continue (Y/N)?"
+0020 U 0000 "Disk error reading FAT %1",CR,LF
+0021 U 0000 "Directory %1"
+0022 U 0000 "%1 Contains %2 non-contiguous blocks"
+0023 U 0000 "All specified file(s) are contiguous"
+0024 U 0000 "Errors found, F parameter not specified",CR,LF,"Corrections will not be written to disk"
+0025 U 0000 " Processing cannot continue %1%2"
+0026 U 0000 " File allocation table bad, drive %1"
+0029 U 0000 " CHDIR .. failed, trying alternate method"
+0030 U 0001 " Has invalid allocation unit, file truncated"
+0031 U 0000 " Invalid sub-directory entry"
+0032 U 0000 " Does not exist"
+0033 U 0001 " First allocation unit is invalid, entry truncated"
+0034 U 0000 " Allocation error, size adjusted"
+0035 U 0000 " Cannot recover .. entry, processing continued"
+0036 U 0000 " Directory is totally empty, no . or .."
+0037 U 0000 " Directory is joined"
+0038 U 0000 " Cannot recover .. entry"
+0039 U 0000 " Entry has a bad link"
+0040 U 0000 " Entry has a bad attribute"
+0041 U 0000 " Entry has a bad size"
+0042 U 0001 " Is cross linked on allocation unit %1"
+0043 U 0000 " Cannot CHDIR to %1,",CR,LF,"tree past this point not processed"
+0044 U 0000 " tree past this point not processed"
+0045 U 0000 "%1 bytes disk space freed"
+0046 U 0000 "%1 bytes disk space would be freed"
+0047 U 0000 "Volume %1 created %2 %3",CR,LF
+0048 U 0000 "%1 total allocation units on disk"
+0049 U 0000 "%1 bytes in each allocation unit"
+0050 U 0000 "CHKDSK not available on drive %1"
+0051 U 0001 " Extended Attributes has invalid allocation units, attributes truncated"
+0052 U 0000 " Extended Attributes allocation error , attributes truncated"
+0053 U 0000 "Invalid parameter"
+0055 U 0000 "Path not found"
+0056 U 0000 "File not found"
+0058 U 0001 " %1 lost allocation units found in %2 chains."
+0059 U 0000 CR,LF
+0060 U 0000 " Cannot CHDIR to root",CR,LF
+0061 U 0000 " Disk error writing FAT %1"
+0062 U 0000 " %1"
+0063 U 0000 "Invalid current directory"
+0064 U 0000 "%1",CR,LF
+0065 U 0000 " Insufficient room in root directory",CR,LF," Move files from root directory and repeat CHKDSK"
+0066 U 0000 "%1 %2 %3"
+0067 U 0000 "%1 %2, %3"
+0068 U 0000 "%1%2%3%4%5"
+0069 U 0000 "%1%2%3%4"
+0070 U 0000 "%1 available allocation units on disk"
+DEBUG 31e4 0057
+0004 U 0000 "Allocation failed or specified buffer too small",CR,LF
+0006 U 0000 "Bad device name"
+0007 U 0000 "Cannot open list device PRN",CR,LF
+ "Enter name of list device? "
+0008 U 0000 CR,LF
+0009 U 0000 CR,LF,"Program terminated normally",CR,LF
+0010 U 0001 "Invalid drive specification",CR,LF
+0012 U 0001 "File creation error",CR,LF
+0013 U 0001 "Insufficient space on disk",CR,LF
+0014 U 0001 "Disk error reading drive %1",CR,LF
+0015 U 0001 "Disk error writing drive %1",CR,LF
+0016 U 0001 "Write protect error reading drive %1",CR,LF
+0017 U 0001 "Write protect error writing drive %1",CR,LF
+0019 U 0000 "%1^ Error"
+0020 U 0001 "Error in EXE or HEX file",CR,LF
+0021 U 0001 "EXE and HEX files cannot be written",CR,LF
+0022 U 0000 "EXEC failure"
+0023 U 0001 "(W)rite error, no destination defined",CR,LF
+0024 U 0001 "Access denied",CR,LF
+0025 U 0000 "Parity error or nonexistent memory error detected"
+0026 U 0000 "-"
+0027 U 0000 "%1 -"
+0032 U 0000 "%1%2"
+0033 U 0000 "%1:%2 %3"
+0034 U 0000 "%1 %2"
+0035 U 0000 "%1 %2",CR,LF,":"
+0036 U 0000 "%1=%2 "
+0037 U 0000 "%1 Error"
+0038 U 0000 "Writing %1 bytes"
+0039 U 0000 "%1:%2="
+0040 U 0000 "%1"
+0041 U 0000 "%1"
+0042 U 0000 "%1:%2 %3 %4 %5:%6"
+0044 U 0000 32,8
+0046 U 0000 "%1"
+0047 U 0000 "%1"
+0050 U 0000 "%1 of a total %2 EMS pages have been allocated",cr,lf
+0051 U 0000 "%1 of a total %2 EMS handles have been allocated",cr,lf
+0055 U 0000 "Handle created = %1 ",cr,lf
+0056 U 0000 "Logical page %1 mapped to physical page %2 ",cr,lf
+0057 U 0001 "EMS hardware/software failure",cr,lf
+0058 U 0000 "Handle not found",cr,lf
+0059 U 0000 "Invalid function code",cr,lf
+0060 U 0000 "No free handles",cr,lf
+0061 U 0000 "Save/Restore error",cr,lf
+0062 U 0000 "Total pages exceeded",cr,lf
+0063 U 0000 "Free pages exceeded",cr,lf
+0064 U 0000 "Parameter error",cr,lf
+0065 U 0000 "Logical Page out of range",cr,lf
+0066 U 0000 "Physical Page out of range",cr,lf
+0067 U 0000 "Save area already in use",cr,lf
+0068 U 0000 "Save area not in use",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 U 0000 "Missing or invalid EMS parameter",cr,lf
+0072 U 0000 "Handle %1 has %2 pages allocated",cr,lf
+0075 U 0000 "Physical page %1 = Frame segment %2",cr,lf
+0076 U 0003 "Handle %1 deallocated",cr,lf
+0078 U 0000 "EMS not installed",cr,lf
+DRIVER 3b0e 0002
+0002 U 0000 "No drive specified",CR,LF
+0003 U 0000 "Loaded External Disk Driver for Drive %1",CR,LF
+EDLIN 3b88 0027
+0006 U 0000 "*"
+0007 U 0000 "Invalid drive or file name",CR,LF
+0008 U 0000 "File name must be specified",CR,LF
+0010 U 0000 "File is READ-ONLY",CR,LF
+0011 U 0000 "File Creation Error",CR,LF
+0012 U 0000 "Too many files open",CR,LF
+0013 U 0000 "Read error in:",CR,LF,"%1",CR,LF
+0014 U 0000 "Cannot edit .BAK file--rename file",CR,LF
+0015 U 0000 "No room in directory for file",CR,LF
+0016 U 0000 "Disk full. Edits lost.",CR,LF
+0017 U 0000 "File not found",CR,LF
+0018 U 0000 "Entry error",CR,LF
+0019 U 0000 "New file",CR,LF
+0020 U 0000 "Not found",CR,LF
+0021 U 0000 "O.K.? "
+0022 U 0000 "Line too long",CR,LF
+0023 U 0000 "End of input file",CR,LF
+0024 U 0000 "Abort edit (Y/N)? "
+0025 U 0000 "Must specify destination line number",CR,LF
+0026 U 0000 "Not enough room to merge the entire file",CR,LF
+0027 U 0000 CR,LF
+0028 U 0000 LF
+0029 U 0000 "Continue (Y/N)?"
+0030 U 0000 "Unable to print message",CR,LF
+0031 U 0000 "%1"
+0032 U 0000 "%1:%2"
+0033 U 0000 "Cannot merge - code page mismatch",CR,LF
+EXE2BIN 3f96 0008
+0002 U 0000 "Insufficient memory",CR,LF
+0003 U 0000 "Cannot find messages",CR,LF
+0004 U 0000 "Access denied",CR,LF
+0005 U 0000 "File cannot be converted",CR,LF
+0006 U 0000 "File not found",CR,LF
+0007 U 0000 "File creation error",CR,LF
+0008 U 0000 "Fix-ups needed - base segment (hex):"
+0012 U 0000 "File name must be specified",CR,LF
+FIND 4100 0001
+0004 U 0000 "FIND: "
+FORMAT 412a 0043
+0002 U 0000 CR,"%1 percent of disk formatted ",CR
+0004 U 0003 CR,"Format complete ",CR,LF
+0007 U 0000 "Insert new diskette for drive %1:",CR,LF
+0009 U 0000 "Re-insert diskette for drive %1:",CR,LF
+0011 U 0000 CR,"Format not supported on drive %1:", CR,LF
+0012 U 0000 CR,"Invalid device parameters from device driver",CR,LF
+0013 U 0000 CR,"Error in IOCTL call ",CR,LF
+0014 U 0000 CR,"Not a block device ",CR,LF
+0015 U 0000 CR,"Error writing FAT ",CR,LF
+0016 U 0000 CR,"Error writing directory",CR,LF
+0017 U 0000 CR,"Cannot format an ASSIGNed or SUBSTed drive. ",CR,LF
+0018 U 0000 CR,"Cannot find System Files",CR,LF
+0019 U 0000 CR,"Cannot FORMAT a network drive",CR,LF
+0021 U 0000 CR,"Parameters not supported",CR,LF
+0022 U 0003 CR,"Format terminated ",CR,LF
+0023 U 0000 CR,"Disk unsuitable for system disk",CR,LF
+0024 U 0000 CR,"Invalid media or Track 0 bad - disk unusable",CR,LF
+0025 U 0000 CR,"Unable to write BOOT ",CR,LF
+0026 U 0000 CR,"Error reading directory",CR,LF
+0028 U 0000 CR,"and press ENTER when ready..."
+0029 U 0000 CR,"Invalid Volume ID ",CR,LF
+0031 U 0000 CR,"Enter current volume label for drive %1: "
+0032 U 0000 CR,"Parameters not compatible",CR,LF,"with fixed disk",CR,LF
+0035 U 0000 CR,"Error reading partition table",CR,LF
+0037 U 0000 CR,"Format broken",CR,LF
+0038 U 0000 CR,"Format not available on drive %1",CR,LF
+0039 U 0000 CR,"Non-System disk or disk error",CR,LF
+0040 U 0000 CR,"Bad Partition Table ",CR,LF
+0041 U 0000 CR,"Parameters not supported by drive",CR,LF
+0042 U 0000 CR,LF
+0043 U 0000 CR,LF,LF
+0044 U 0000 CR,"Insert DOS disk in drive %1:",CR,LF
+0045 U 0000 CR,LF,"WARNING, ALL DATA ON NON-REMOVABLE DISK",CR,LF
+ "DRIVE %1: WILL BE LOST!",CR,LF
+ "Proceed with Format (Y/N)?"
+0046 U 0000 CR,"Format another (Y/N)?"
+0047 U 0000 CR,"Error reading partition table",CR,LF
+0048 U 0000 CR,"Error writing partition table",CR,LF
+0049 U 0000 CR,"Parameters not compatible", CR,LF
+0050 U 0000 "%1 allocation units available on disk",CR,LF
+0051 U 0000 "%1 bytes in each allocation unit",CR,LF
+0052 U 0000 CR, "Error writing partition table",CR,LF
+0053 U 0000 CR,"Same parameter entered twice",CR,LF
+0054 U 0000 CR,"Must enter both /T and /N parameters",CR,LF
+0055 U 0000 CR,"Attempting to recover allocation unit %1 ",CR
+0056 U 0000 CR,"There is not enough room to create a restore file",CR,LF
+ "You will not be able to use the unformat utility",CR,LF
+ "Proceed with Format (Y/N)?"
+0057 U 0000 CR,"There is not enough disk space for system files ",CR,LF
+0058 U 0000 CR,"Disk was formatted under a different version of DOS",CR,LF
+ "This disk cannot be unformatted",CR,LF
+ "Proceed with Format (Y/N)?"
+0059 U 0000 CR,"There was an error creating the format recovery file",CR,LF
+ "This disk cannot be unformatted",CR,LF
+ "Proceed with Format (Y/N)?"
+JOIN 4b2c 0001
+0002 U 0001 "Directory not empty",CR,LF
+MORE 4b69 0001
+0002 U 0000 "-- More --"
+PRINT 4b97 0021
+0002 U 0000 CR,LF
+0006 U 0000 " error reading file",CR,LF,"$"
+0007 U 0000 "File not found",CR,LF,"$"
+0008 U 0000 CR,LF,LF,"File $"
+0009 U 0000 " canceled by operator$"
+0010 U 0000 CR,LF,LF,"All files canceled by operator$"
+0011 U 0000 "File allocation table bad drive "
+0012 U 0000 "A.",CR,LF,"$"
+0013 U 0000 "List output is not assigned to a device",CR,LF
+0014 U 0000 "Resident part of PRINT installed",CR,LF
+0015 U 0000 "Cannot use PRINT - Use NET PRINT",CR,LF
+0017 U 0000 "PRINT queue is full",CR,LF
+0018 U 0000 "PRINT queue is empty",CR,LF
+0019 U 0000 "Access denied",CR,LF
+0020 U 0000 "Invalid drive specification",CR,LF
+0021 U 0000 "Errors on list device indicate that it",CR,LF
+ "may be off-line. Please check it.",CR,LF
+0022 U 0000 CR,LF,LF," %1 is currently being printed",CR,LF
+0023 U 0000 " %1 is in queue",CR,LF
+0025 U 0001 "Pathname too long",CR,LF
+0026 U 0001 "File not in PRINT queue",CR,LF
+0027 U 0000 "Name of list device [PRN]: "
+RECOVER 4f77 0011
+0002 U 0000 CR,LF,"File not found",CR,LF
+0003 U 0000 CR,LF,"Cannot RECOVER an ASSIGNed or SUBSTed drive",CR,LF
+0004 U 0000 CR,LF,"Invalid drive or file name",CR,LF
+0005 U 0000 CR,LF,"WARNING - directory full",CR,LF
+0006 U 0000 CR,LF,"Cannot RECOVER a network drive", CR,LF
+0008 U 0000 CR,LF,"%1 file(s) recovered",CR,LF
+0009 U 0000 CR,LF,"%1 of %2 bytes recovered",CR,LF
+0010 U 0000 CR,LF,"Press any key to begin recovery of the",CR,LF,"file(s) on drive %1",CR,LF,CR,LF
+0011 U 0000 CR,LF,"Cannot read file allocation table",CR,LF
+0012 U 0000 CR,LF,"Cannot write file allocation table",CR,LF
+0013 U 0000 CR,LF
+SORT 51f7 0001
+0005 U 0000 "SORT: "
+SUBST 5221 0001
+0002 U 0001 "Incorrect number of parameters",CR,LF
+SYS 5269 0008
+0004 U 0000 "Invalid drive specification",CR,LF
+0007 U 0000 "No room for system on destination disk",CR,LF
+0008 U 0001 "Invalid path or System files not found",CR,LF
+0010 U 0000 "No system on default drive",CR,LF
+0011 U 0000 "Cannot specify default drive",CR,LF
+0012 U 0000 "Write failure, diskette unusable",CR,LF
+0014 U 0000 "Insert system disk in drive %1",CR,LF
+0016 U 0000 "Not able to SYS to %1 file system",CR,LF
+SHARE 5429 0000
+NLSFUNC 543d 0000
+ANSI 5451 0001
+0010 U 0000 "Invalid parameter - %1",CR,LF
+IFSFUNC 5491 0001
+0004 U 0001 "Invalid configuration",CR,LF
+IBMBIO 54d0 0019
+0003 U 0000 13,10,"Unrecognized command in CONFIG.SYS"
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Sector size too large in file $"
+0006 U 0000 13,10,"Bad or missing $"
+0007 U 0000 "Command Interpreter",0
+0008 U 0000 13,10,"Invalid country code or code page",13,10,"$"
+0009 U 0000 13,10,"Error in COUNTRY command",13,10,"$"
+0010 U 0000 13,10, "Insufficient memory for COUNTRY.SYS file",13,10,"$"
+0011 U 0000 13,10,"Configuration too large for memory",13,10,"$"
+0012 U 0000 13,10,"Too many block devices",13,10,"$"
+0013 U 0000 13,10,"Invalid STACK parameters",13,10,"$"
+0014 U 0000 13,10,"Incorrect order in CONFIG.SYS line ","$"
+0015 U 0000 "Error in CONFIG.SYS line ","$"
+0016 U 0000 13,10,"Memory allocation error ","$"
+0017 U 0001 0DH,0AH,7,0DH,0AH, "Internal stack overflow",0DH,0AH
+ "System halted",0DH,0AH,"$"
+0020 U 0000 13,10,"Insert diskette for drive "
+0021 U 0000 "A: and press any key when ready",13,10,10,0
+0022 U 0000 13,10,"Bad command or parameters - $"
+0023 U 0002 "WARNING! SHARE should be loaded for large media",13,10,"$"
+BOOT 5907 0001
+0001 U 0000 13,10,"Non-System disk or disk error",13,10
+ "Replace and press any key when ready",13,10,0
+DBCSDOS 5985 0000
+IBMDOS 5999 0003
+0001 U 0001 13,10,"Divide overflow",13,10
+0002 U 0002 "y"
+0003 U 0002 "n"
+PSPRINT 59fa 0007
+0002 U 0000 " error reading file",CR,LF,FORMFD,BELL,"$"
+0003 U 0000 CR,LF,LF,"File canceled by operator",CR,FORMFD,BELL
+0004 U 0000 "File allocation table bad drive "
+0005 U 0000 "A.",CR,LF,"$"
+0006 U 0000 "List output is not assigned to a device",CR,LF
+0007 U 0000 "PSPRINT is allready installed",CR,LF
+0008 U 0000 "PSPRINT/PRINT conflict",CR,LF
+BACKUP 5b70 0023
+0002 U 0000 CR,LF,"Insufficient memory",CR,LF
+0006 U 0000 CR,LF,"Invalid drive specification",CR,LF
+0014 U 0000 CR,LF,"Source and target drives are the same",CR,LF
+0015 U 0001 CR,LF,"Error executing FORMAT",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 U 0000 CR,LF,"Error opening logfile",CR,LF
+0018 U 0000 CR,LF,"Logging to file %1",CR,LF
+0019 U 0000 CR,LF,"Last backup diskette not inserted",CR,LF
+0020 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\ root directory will be erased",CR,LF
+0021 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\BACKUP directory will be erased",CR,LF
+0022 U 0000 CR,LF,"*** Backing up files to drive %1: ***",CR,LF
+0023 U 0000 "Diskette Number: %1",CR,LF
+0024 U 0000 CR,LF,"WARNING! No files were found to back up",CR,LF
+0025 U 0000 CR,LF,"Insert backup source diskette in drive %1:",CR,LF
+0026 U 0000 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF
+0027 U 0000 CR,LF,"*** Not able to backup file ***",CR,LF
+0028 U 0000 CR,LF,"Insert last backup diskette in drive %1:",CR,LF
+0029 U 0000 CR,LF,"Target cannot be used for backup",CR,LF
+0030 U 0000 CR,LF,"*** Last file not backed up ***",CR,LF
+0031 U 0000 CR,LF,"Fixed backup device %1: is full",CR,LF
+0032 U 0000 CR,LF,"Disk full error writing to BACKUP Log File",CR,LF
+0034 U 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+BASIC 6101 0001
+0001 U 0001 "Cannot exec BASICA.COM"
+COMP 613b 0013
+0004 U 0000 "10 Mismatches - ending compare",CR,LF
+0006 U 0000 "Compare error at OFFSET %1",CR,LF
+0007 U 0000 "File 1 = %1",CR,LF
+0008 U 0000 "File 2 = %1",CR,LF
+0009 U 0000 "EOF mark not found",CR,LF
+0010 U 0000 "Files compare OK",CR,LF
+0015 U 0000 CR,LF,CR,LF,"Enter primary filename",CR,LF
+0016 U 0000 CR,LF,CR,LF,"Enter 2nd filename or drive id",CR,LF
+0017 U 0000 "Files are different sizes",CR,LF
+0018 U 0000 "Compare more files (Y/N) ?"
+0019 U 0000 "%1 and %2",CR,LF
+0020 U 0000 CR,LF
+0023 U 0000 "Files compare OK",CR,LF
+DISKCOMP 636c 0016
+0004 U 0000 "Do not specify filename(s)",CR,LF
+ "Command format: DISKCOMP d: d: [/1][/8]",LF,CR
+0005 U 0000 CR,LF,"Invalid drive specification",CR,LF
+ "Specified drive does not exist",CR,LF
+ "or is non-removable",CR,LF
+0006 U 0000 CR,LF,"Cannot DISKCOMP to or from",CR,LF
+ "a network drive",CR,LF
+0007 U 0000 CR,LF,"Insert FIRST diskette in drive %1:",CR,LF
+0008 U 0000 CR,LF,"Insert SECOND diskette in drive %1:",CR,LF
+0009 U 0000 CR,LF,"FIRST diskette bad or incompatible",CR,LF
+0010 U 0000 CR,LF,"SECOND diskette bad or incompatible",CR,LF
+0014 U 0000 CR,LF,"Compare another diskette (Y/N) ?"
+0015 U 0000 CR,LF,"Comparing %1 tracks",CR,LF
+ "%2 sectors per track, %3 side(s)",CR,LF
+0016 U 0000 CR,LF,"Drive types or diskette types",CR,LF
+ "not compatible",CR,LF
+0017 U 0000 CR,LF,"Unrecoverable read error on drive %2",CR,LF
+ "side %3, track %4",CR,LF
+0018 U 0000 CR,LF,"Compare error on",CR,LF,"side %3, track %4",CR,LF
+0019 U 0000 "Make sure a diskette is inserted into",CR,LF
+ "the drive and the door is closed",CR,LF
+0020 U 0000 CR,LF,"Compare process ended",CR,LF
+0021 U 0000 CR,LF,"Compare OK",CR,LF
+0022 U 0000 CR,LF
+DISKCOPY 67fe 0018
+0002 U 0000 CR,LF
+0004 U 0000 "Do not specify filename(s)",CR,LF
+ "Command Format: DISKCOPY d: d: [/1]",CR,LF
+0005 U 0000 CR,LF,"Invalid drive specification",CR,LF
+ "Specified drive does not exist",CR,LF
+ "or is non-removable",CR,LF
+0006 U 0000 CR,LF,"Cannot DISKCOPY to or from",CR,LF
+ "a network drive",CR,LF
+0007 U 0000 CR,LF,"Formatting while copying",CR,LF
+0008 U 0000 CR,LF,"Insert SOURCE diskette in drive %1:",CR,LF
+0009 U 0000 CR,LF,"Insert TARGET diskette in drive %1:",CR,LF
+0010 U 0000 "Make sure a diskette is inserted into",CR,LF
+ "the drive and the door is closed",CR,LF
+0011 U 0000 CR,LF,"Target diskette may be unusable",CR,LF
+0012 U 0000 CR,LF,"Target diskette unusable",CR,LF
+0016 U 0000 CR,LF,"Copy another diskette (Y/N)? "
+0017 U 0000 CR,LF,"Copying %1 tracks",CR,LF
+ "%2 Sectors/Track, %3 Side(s)",CR,LF
+0018 U 0000 CR,LF,"Drive types or diskette types",CR,LF
+ "not compatible",CR,LF
+0019 U 0000 CR,LF,"Unrecoverable read error on drive %1",CR,LF
+ "Side %2, track %3",CR,LF
+0020 U 0000 CR,LF,"Unrecoverable write error on drive %1",CR,LF
+ "Side %2, track %3",CR,LF
+0021 U 0000 CR,LF,"Copy process ended",CR,LF
+0022 U 0000 CR,LF,"SOURCE diskette bad or incompatible"
+0023 U 0000 CR,LF,"TARGET diskette bad or incompatible"
+LABL 6d0a 0001
+0009 U 0003 CR,LF,"Delete current volume label (Y/N)? "
+MODE 6d57 0068
+0003 U 0000 CR,LF,"Must specify COM1, COM2, COM3 or COM4",CR,LF
+0004 U 0000 CR,LF,"Resident portion of MODE loaded",CR,LF
+0005 U 0000 CR,LF,"Illegal device name",CR,LF
+0006 U 0000 CR,LF,"Printer error",CR,LF
+0007 U 0000 CR,LF,"LPT%1: set for 80",CR,LF
+0008 U 0000 CR,LF,"LPT%1: set for 132",CR,LF
+0009 U 0000 CR,LF,"Printer lines per inch set",CR,LF
+0010 U 0000 CR,LF,"Invalid baud rate specified",CR,LF
+0011 U 0000 CR,LF,"COM%1: %2,%3,%4,%5,%6",CR,LF
+0012 U 0000 "0123456789"
+0013 U 0001 CR,LF,"Do you see the %1? (Y/N) "
+0015 U 0000 "LPT%1: rerouted to COM%2:",CR,LF
+0016 U 0000 "LPT%1: not rerouted",CR,LF
+0017 U 0000 CR,LF,"%1 retry on parallel printer time-out",CR,LF
+0018 U 0000 CR,LF," Unable to shift screen %1",CR,LF
+0020 U 0000 CR,LF,"Invalid number of parameters",CR,LF
+0021 U 0000 CR,LF,"NET 042: Unable to do requested command",CR,LF
+0022 U 0001 CR,LF,"Infinite retry not supported on network printer",CR,LF
+0023 U 0001 CR,LF,"Failure to access code page font file",cr,lf
+0024 U 0000 CR,LF,"Failure to access device: %1",CR,LF
+0025 U 0001 CR,LF,"Device or code page missing from font file",CR,LF
+0026 U 0000 CR,LF,"Font file contents invalid",CR,LF
+0027 U 0001 CR,LF,"Previously prepared code page replaced",CR,LF
+0028 U 0001 CR,LF,"Active code page for device %1 is %2",CR,LF
+0029 U 0000 CR,LF,"Device %1 not prepared",CR,LF
+0030 U 0001 "%1 code pages:",CR,LF
+0031 U 0001 " code page %1",CR,LF
+0032 U 0001 CR,LF,"MODE %1 code page function completed",CR,LF
+0033 U 0002 CR,LF,"Current code page settings:",CR,LF
+0034 U 0002 " %1 - %2 code page",CR,LF
+0035 U 0002 " code page not prepared",CR,LF
+0036 U 0002 "Code page operation not supported on this device",CR,LF
+0037 U 0002 "No code page has been selected",cr,lf
+0038 U 0002 "Device error during %1",CR,LF
+0039 U 0002 "Code page not prepared",CR,LF
+0040 U 0002 CR,LF,"Current keyboard does not support this code page",CR,LF
+0041 U 0002 CR,LF,"Error during read of font file",CR,LF
+0042 U 0002 CR,LF,"Unable to perform refresh operation",CR,LF
+0043 U 0002 CR,LF
+0044 U 0002 CR,LF,"Status for device %1:",CR,LF
+0045 U 0002 "------------------"
+0046 U 0002 "----",CR,LF
+0047 U 0002 "-----",CR,LF
+0048 U 0002 "LINES=%1",CR,LF
+0049 U 0002 "COLUMNS=%1",CR,LF
+0050 U 0002 CR,LF,"RATE and DELAY must be specified together",CR,LF
+0051 U 0002 "RATE=%1",CR,LF
+0052 U 0002 "DELAY=%1",CR,LF
+0053 U 0002 CR,LF,"Function not supported on this computer - %1",CR,LF
+0054 U 0002 CR,LF,"Required font not loaded",CR,LF
+0055 U 0002 CR,LF,"ANSI.SYS must be installed to perform requested function",CR,LF
+0056 U 0002 CR,LF,"Baud rate required",CR,LF
+0057 U 0002 "RETRY=%1",CR,LF
+0059 U 0002 "rightmost 9",0
+0060 U 0002 "leftmost 0",0
+0061 U 0002 "No",0
+0062 U 0002 "Infinite",0
+0063 U 0002 "left",0
+0064 U 0002 "right",0
+0065 U 0002 "Hardware",0
+0066 U 0002 "Prepared",0
+0067 U 0002 "status",0
+0068 U 0002 "prepare",0
+0069 U 0002 "select",0
+0070 U 0002 "refresh",0
+0071 U 0002 "write of font file to device",0
+0072 U 0002 "selected",0
+0073 U 0002 "system",0
+RESTORE 7971 0020
+0002 U 0000 CR,LF,"Source and target drives are the same",CR,LF
+0003 U 0000 CR,LF,"Invalid number of parameters",CR,LF
+0006 U 0000 CR,LF,"Invalid drive specification",CR,LF
+0007 U 0000 CR,LF,"WARNING! No files were found to restore",CR,LF
+0008 U 0000 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF
+0009 U 0000 CR,LF,"Insert restore target in drive %1:",CR,LF
+0011 U 0000 CR,LF,"WARNING! Diskette is out of sequence",CR,LF
+ "Replace diskette or continue if OK",CR,LF
+0012 U 0000 CR,LF,"The last file was not restored",CR,LF
+0013 U 0000 CR,LF,"*** Files were backed up %1 ***",CR,LF
+0014 U 0000 CR,LF,"Source does not contain backup files",CR,LF
+0015 U 0000 CR,LF,"Insufficient memory",CR,LF
+0016 U 0000 CR,LF,"WARNING! File %1",CR,LF
+ "is a read-only file",CR,LF
+ "Replace the file (Y/N)?",CR,LF
+0017 U 0000 CR,LF,"Restore file sequence error",CR,LF
+0018 U 0000 CR,LF,"File creation error",CR,LF
+0019 U 0000 CR,LF,"Insufficient disk space",CR,LF
+0020 U 0000 CR,LF,"*** Not able to restore file ***",CR,LF
+0021 U 0000 CR,LF,"*** Restoring files from drive %1: ***",CR,LF
+0022 U 0000 CR,LF,"WARNING! File %1",CR,LF
+ "was changed after it was backed up",CR,LF
+ "Replace the file (Y/N)?",CR,LF
+0023 U 0000 "Diskette: %1",CR,LF
+0025 U 0000 07
+SELECT 7e79 0016
+0004 U 0000 "Invalid SELECT boot media",CR,LF,CR,LF
+ "Insert INSTALL diskette in drive A:, then retry"
+0005 U 0000 "Invalid disk/diskette media",cr,lf,cr,lf
+ "Insert INSTALL diskette in drive A:, then retry"
+0006 U 0000 "Invalid parameters on SELECT command line",CR,LF,CR,LF
+ "Make sure the INSTALL diskette is in drive A:,",CR,LF
+ "then press Ctrl+Alt+Del to restart."
+0007 U 0000 BELL,"Unable to install DOS. Program terminated",CR,LF
+0008 U 0000 "Loading SELECT. Please wait..."
+0009 U 0000 "You must restart your computer to continue.",CR,LF,CR,LF
+ "Press Ctrl+Alt+Del to continue with DOS installation."
+0010 U 0000 "Insert SELECT diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue installing DOS,",CR,LF
+ "or press Esc to exit.",CR,LF
+0011 U 0000 BELL
+0012 U 0000 "Insert SELECT diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0013 U 0001 "Remove the SELECT COPY Diskette from drive A:",CR,LF,CR,LF
+ "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0014 U 0001 "Remove the INSTALL Diskette from drive A:",CR,LF,CR,LF
+ "Insert the SELECT COPY Diskette in drive A:",CR,LF,CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+0015 U 0001 "Copying diskette . . .",CR,LF
+0016 U 0001 "Drive not ready. Please close the",CR,LF,CR,LF
+ "diskette drive door and press Enter",CR,LF
+ "to continue, or Esc to exit SELECT.",CR,LF
+0017 U 0001 "Write protect diskette in drive.",CR,LF,CR,LF
+ "Please remove protect tab and",CR,LF
+ "press Enter to continue, or Esc to exit SELECT.",CR,LF
+0018 U 0001 "An error occurred while installing DOS.",CR,LF
+ "Press Enter to continue, or Esc to exit SELECT.",CR,LF
+0019 U 0001 "Insert the INSTALL Diskette in drive A:",CR,LF,CR,LF
+ "Press Enter to continue.",CR,LF
+TREE 8594 0004
+0002 U 0000 "Directory PATH listing for Volume %1",CR,LF
+0003 U 0000 "Directory PATH listing",CR,LF
+0004 U 0000 "No sub-directories exist",CR,LF,LF
+0007 U 0000 "ÀÄó"
+REPLACE 8653 0009
+0003 U 0000 CR,LF,"No files replaced",CR,LF
+0004 U 0000 CR,LF,"No files added",CR,LF
+0013 U 0000 CR,LF,"Replacing %1",CR,LF
+0014 U 0000 CR,LF,"Adding %1",CR,LF
+0015 U 0000 CR,LF,"%1 file(s) replaced",CR,LF
+0016 U 0000 CR,LF,"%1 file(s) added",CR,LF
+0017 U 0000 CR,LF,"No files found - %1",CR,LF
+0022 U 0000 CR,LF,"Replace %1? (Y/N)"
+0023 U 0000 CR,LF,"Add %1? (Y/N)"
+XCOPY 87df 0018
+0004 U 0000 "Does %1 specify a file name",CR,LF
+ "or directory name on the target",CR,LF
+ "(F = file, D = directory)?"
+0005 U 0000 "Press any key to begin copying file(s)"
+0006 U 0000 "Path too long",CR,LF
+0008 U 0000 "Cannot perform a cyclic copy",CR,LF
+0012 U 0000 "Cannot XCOPY from a reserved device",CR,LF
+0021 U 0000 "Invalid number of parameters",CR,LF
+0022 U 0000 "Cannot XCOPY to a reserved device",CR,LF
+0024 U 0000 "File creation error",CR,LF
+0025 U 0000 "Reading source file(s)...",CR,LF
+0026 U 0000 CR,LF
+0027 U 0000 "%1 File(s) copied",CR,LF
+0028 U 0000 "%1 File not found",CR,LF
+0029 U 0000 "F D "
+0030 U 0000 "%1%2",CR,LF
+0031 U 0000 "%1\%2",CR,LF
+0032 U 0000 "%1",CR,LF
+0033 U 0000 "%1%2 (Y/N)?"
+0034 U 0000 "%1\%2 (Y/N)?"
+VDISK 8aeb 0013
+0002 U 0000 "Insufficient memory",CR,LF
+0003 U 0000 "IBM DOS Version 4.00, VDISK virtual disk %1",CR,LF
+0004 U 0000 " Buffer size adjusted",CR,LF
+0005 U 0000 " Sector size adjusted",CR,LF
+0006 U 0000 " Directory entries adjusted",CR,LF
+0007 U 0000 " Invalid switch character",CR,LF
+0008 U 0000 " Transfer size adjusted",CR,LF
+0009 U 0000 " Buffer size: %1 KB",CR,LF
+0010 U 0000 " Sector size: %1",CR,LF
+0011 U 0000 " Directory entries: %1",CR,LF
+0012 U 0000 " Transfer size: %1",CR,LF
+0013 U 0000 "VDISK not installed - "
+0014 U 0000 " Extender Card switches",CR,LF
+ "do not match system memory size",CR,LF,CR,LF
+GRAFTABL 8d92 0009
+0002 U 0000 "Active Code Page: %1",CR,LF
+0003 U 0000 "Previous Code Page: %1",CR,LF
+0004 U 0000 "None",NULL
+0005 U 0000 "Non-standard",NULL
+0006 U 0002 CR,LF,"DOS command line parameters supported",COLON,CR,LF,LF
+0007 U 0002 " /STA - Request Status only",CR,LF
+ " ? - Display this summary of parameters",CR,LF,CR,LF
+0008 U 0002 " Code Pages available",COLON,CR,LF
+ " 437 - USA Graphic Character Set",CR,LF
+0009 U 0002 " 850 - Multi-lingual Graphic Character Set",CR,LF
+ " 860 - Portuguese Graphic Character Set",CR,LF
+0010 U 0002 " 863 - Canadian French Graphic Character Set",CR,LF
+ " 865 - Nordic Graphic Character Set",CR,LF
+FASTOPEN 9047 0016
+0004 U 0000 CR,LF,"FASTOPEN installed",CR,LF
+0005 U 0000 CR,LF,"FASTOPEN already installed",CR,LF
+0006 U 0000 CR,LF,"Incorrect parameter",CR,LF
+0007 U 0000 CR,LF,"Too many drive entries",CR,LF
+0008 U 0000 CR,LF,"Same drive specified more than once",CR,LF
+0009 U 0000 CR,LF,"Invalid parameter",CR,LF
+0010 U 0000 CR,LF,"Invalid switch type",CR,LF
+0011 U 0000 CR,LF,"Invalid extent entry",CR,LF
+0012 U 0001 CR,LF,"Invalid file/directory entry",CR,LF
+0013 U 0000 CR,LF,"Cannot setup expanded memory",CR,LF
+0014 U 0000 CR,LF,"Expanded memory not available",CR,LF
+0015 U 0000 CR,LF,"Invalid drive specification %1",CR,LF
+0016 U 0002 CR,LF,"FASTOPEN EMS entry count exceeded. Use fewer entries",CR,LF
+0017 U 0000 CR,LF,"Cannot use FASTOPEN for drive %1",CR,LF
+0018 U 0000 CR,LF,"Too many extent entries",CR,LF
+0019 U 0000 CR,LF,"Too many file/directory entries",CR,LF
+APPEND 93c9 0009
+0001 U 0000 "Incorrect APPEND version",CR,LF
+0002 U 0000 "Invalid path",CR,LF
+0003 U 0000 "Invalid parameter",CR,LF
+0004 U 0000 "Invalid combination of parameters",CR,LF
+0005 U 0000 "No Append",CR,LF
+0006 U 0000 "APPEND / ASSIGN Conflict",CR,LF
+0007 U 0000 "APPEND / TopView Conflict",CR,LF
+0008 U 0000 "Incorrect DOS version",CR,LF
+0009 U 0000 "APPEND already installed",CR,LF
+GRAPHICS 9560 0012
+0005 U 0000 "Invalid parameter: %1",CR,LF
+0007 U 0000 "Duplicate parameters not allowed",CR,LF
+0009 U 0000 "Cannot find GRAPHICS profile",CR,LF
+0010 U 0000 "Required profile statement missing before line %1",CR,LF
+0011 U 0000 "Invalid profile statement on line %1",CR,LF
+0012 U 0000 "Profile statement out of sequence on line %1",CR,LF
+0013 U 0000 "Error reading GRAPHICS profile",CR,LF
+0014 U 0000 "Syntax errors in GRAPHICS profile",CR,LF
+0015 U 0000 "Printbox ID not in GRAPHICS profile",CR,LF
+0016 U 0000 "Printer type not in GRAPHICS profile",CR,LF
+0017 U 0000 "/B invalid with a black and white printer",CR,LF
+0018 U 0000 "Unable to reload with profile supplied",CR,LF
+DISPLAY 9824 0003
+0002 U 0000 "%1 code page driver cannot be initialized",CR,LF,BELL
+0008 U 0000 "Insufficient memory",CR,LF,BELL
+0012 U 0000 "Invalid syntax on DISPLAY.SYS code page driver",CR,LF,BELL
+PRINTER 98f3 0002
+0002 U 0000 "%1 code page driver cannot be initialized",CR,LF,BELL
+0012 U 0000 "Invalid syntax on PRINTER.SYS code page driver",CR,LF,BELL
+KEYB 9994 0016
+0002 U 0000 "Current keyboard code: %1"
+0003 U 0000 "Current keyboard ID: %1"
+0004 U 0000 " code page: %1",CR,LF
+0005 U 0000 "Current CON code page: %1",CR,LF
+0006 U 0000 "Invalid keyboard code specified",CR,LF
+0007 U 0000 "Invalid keyboard ID specified",CR,LF
+0008 U 0000 "Invalid code page specified",CR,LF
+0009 U 0000 "Bad or missing Keyboard Definition File",CR,LF
+0010 U 0000 "KEYB has not been installed",CR,LF
+0011 U 0000 "Active code page not available from CON device",CR,LF
+0012 U 0000 "Code page specified has not been prepared",CR,LF
+0013 U 0000 "One or more CON code pages invalid for given keyboard code",CR,LF
+0014 U 0000 "Code page requested (%1) is not valid for given keyboard code",CR,LF
+0015 U 0000 "Code page specified is inconsistent with the selected code page",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 U 0000 "Unable to create KEYB table in resident memory",CR,LF
+REDIRSYS 9d6f 0000
+MEM 9d83 0042
+0010 U 0000 CR,LF
+0011 U 0000 " Address Name Size Type ",CR,LF
+0012 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ÄÄÄÄÄÄ",CR,LF
+0013 U 0000 " Handle EMS Name Size ",CR,LF
+0014 U 0000 " ÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "%1 bytes total memory",CR,LF
+0019 U 0000 "%1 bytes available to PC-DOS",CR,LF
+0020 U 0000 "%1 largest executable program size",CR,LF
+0021 U 0000 "%1 bytes total EMS memory",CR,LF
+0022 U 0000 "%1 bytes free EMS memory",CR,LF
+0023 U 0000 "%1 bytes total contiguous extended memory",CR,LF
+0024 U 0000 "Interrupt Vector",0
+0025 U 0000 "ROM Communication Area",0
+0026 U 0000 "DOS Communication Area",0
+0027 U 0000 "IBMBIO",0
+0028 U 0000 "IBMDOS",0
+0029 U 0000 "System Data",0
+0030 U 0000 "System Program",0
+0031 U 0000 "System Device Driver",0
+0032 U 0000 "Installed Device Driver",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "BUFFERS=",0
+0036 U 0000 "FILES=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "STACKS=",0
+0039 U 0000 "DEVICE=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "LASTDRIVE=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+0046 U 0001 "%1 bytes available contiguous extended memory",CR,LF
+0047 U 0000 "System Stacks",0
+0048 U 0000 "-- Free --",0
+0049 U 0000 "Program",0
+0050 U 0000 "Environment",0
+0051 U 0000 "Data",0
+0052 N 0000 "%1 bytes available XMS memory",CR,LF
+0053 N 0000 " 64Kb High Memory Area available",CR,LF
+0054 N 0000 " High Memory Area in use",CR,LF
+REDIR a3c6 0040
+0004 U 0000 "Network has not been started",CR,LF
+0050 U 0000 "NET809: Network request not supported",CR,LF,0
+0051 U 0000 "NET801: Remote computer not listening",CR,LF,0
+0052 U 0000 "NET802: Duplicate name on network",CR,LF,0
+0053 U 0000 "NET803: Network path not found",CR,LF,0
+0054 U 0000 "NET804: Network busy",CR,LF,0
+0055 U 0000 "NET805: Network device no longer exists",CR,LF,0
+0056 U 0000 "NET806: NETBIOS command limit exceeded",CR,LF,0
+0057 U 0000 "NET807: System error; NETBIOS error",CR,LF,0
+0058 U 0000 "NET808: Incorrect response from network",CR,LF,0
+0059 U 0000 "NET810: Unexpected network error",CR,LF,0
+0060 U 0000 "NET811: Incompatible remote adapter",CR,LF,0
+0061 U 0000 "NET812: Print queue full",CR,LF,0
+0062 U 0000 "NET813: Not enough space for print file",CR,LF,0
+0063 U 0000 "NET814: Print file was cancelled",CR,LF,0
+0064 U 0000 "NET815: Network name was deleted",CR,LF,0
+0065 U 0000 "Access denied",CR,LF,0
+0066 U 0000 "NET817: Network device type incorrect",CR,LF,0
+0067 U 0000 "NET818: Network name not found",CR,LF,0
+0068 U 0004 "NET819: Network name limit exceeded",CR,LF,0
+0069 U 0000 "NET820: NETBIOS session limit exceeded",CR,LF,0
+0070 U 0000 "NET821: Sharing temporarily paused",CR,LF,0
+0071 U 0000 "NET823: Network request not accepted",CR,LF,0
+0072 U 0000 "NET822: Print or disk redirection is paused",CR,LF,0
+0073 U 0000 "NET476: Netbeui not loaded",CR,LF,0
+0074 U 0000 "NET477: Unexpected adapter close",CR,LF,0
+0084 U 0004 "NET819: Network name limit exceeded",CR,LF,0
+0085 U 0004 "NET802: Duplicate name on network",CR,LF,0
+0088 U 0000 "NET825: Network data fault",CR,LF,0
+XMA2EMS ab5b 0030
+0001 U 0000 CR,LF,"$"
+0002 U 0000 "XMA2EMS: Expanded Memory Manager",CR,LF
+ "(c)Copyright IBM Corporation 1988 All rights reserved",CR,LF,"$"
+0003 U 0000 CR,LF,"Performing XMA diagnostics: ","$"
+0004 U 0000 CR,LF,"Diagnostics completed ",CR,LF,LF,"$"
+0005 U 0000 "Page Frame starts at........................ "
+0006 U 0000 "XXXX:0",CR,LF,"Pages mapped to conventional memory......... "
+0007 U 0000 "0 ",CR,LF,"$"
+0008 U 0000 "Pages reserved for 3270 PC Control Program.. "
+0009 U 0000 "0 ",CR,LF,"$"
+0010 U 0000 "Pages available for expanded memory......... "
+0011 U 0000 "0 ",CR,LF,"$"
+0012 U 0000 CR,LF,"Adapter error ",CR,LF,"$"
+0013 U 0000 CR,LF,"Cannot find adapter ",CR,LF,"$"
+0014 U 0000 CR,LF,"Parameter syntax or value error ",CR,LF,"$"
+0015 U 0000 CR,LF,"Cannot find XMA Emulator device driver ",CR,LF,"$"
+0016 U 0000 CR,LF,"Incorrect version of XMAEM.SYS ",CR,LF,"$"
+0017 U 0000 CR,LF,"Incorrect version of INDXMAA.SYS ",CR,LF,"$"
+0018 U 0000 CR,LF,"Too many EMS pages requested in /X parameter ",CR,LF,"$"
+0019 U 0000 "Expanded Memory Manager has NOT been installed",CR,LF,"$"
+0020 U 0000 "Specified page address conflicts with installed adapter at address "
+0021 U 0000 "0 ",CR,LF,"$"
+0022 U 0000 "Possible 16KB page available at address "
+0023 U 0000 "0 ",CR,LF,"$"
+0024 U 0000 CR,LF,"Possible 64KB frame available at address "
+0025 U 0000 "0 ",CR,LF,"$"
+0026 U 0000 "No page addresses specified",CR,LF,"$"
+0027 U 0000 " "
+0028 U 0000 " "," KB OK","$"
+0029 U 0000 " ",CR,LF,"$"
+0030 U 0000 "$"
+FILESYS b1a2 0007
+0010 U 0003 " PAUSED %1 %2 %3",CR,LF
+0011 U 0001 " %1 %2 %3",CR,LF
+0012 U 0001 " Local IFS",CR,LF
+0013 U 0001 " Status Device Name Parameters",CR,LF
+0014 U 0001 " ______ ______ _________ ___________________",CR,LF,CR,LF
+0015 U 0003 "No entries found",CR,LF
+0016 U 0003 " ERROR %1 %2 %3",CR,LF
+FDISK b31d 0122
+0004 U 0000 "Cannot FDISK with network loaded",CR,LF
+0005 U 0000 "No fixed disks present",CR,LF
+0006 U 0000 "Error reading fixed disk",CR,LF
+0007 U 0000 "Error writing fixed disk",CR,LF
+0009 U 0003 "Y",0
+0010 U 0003 "N",0
+1001 U 0000 "IBM DOS Version 4.00"
+1002 U 0000 "Fixed Disk Setup Program"
+1003 U 0000 "(C)Copyright IBM Corp. 1983, 1988"
+1004 U 0000 "FDISK Options"
+1005 U 0000 "1. <R>Create DOS Partition or Logical DOS Drive"
+1006 U 0000 "2. <R>Set active partition"
+1007 U 0000 "3. <R>Delete DOS Partition or Logical DOS Drive"
+1008 U 0000 "4. <R>Display partition information"
+1009 U 0000 "Press <H>Esc<R> to exit FDISK"
+1010 U 0000 "Choose one of the following:"
+1011 U 0000 "5. <R>Select next fixed disk drive"
+1012 U 0000 "Current fixed disk drive: <H><I>"
+1013 U 0000 "WARNING! <R>No partitions are set active - disk 1 is not startable unless"
+1014 U 0000 "a partition is set active"
+1015 U 0000 "Enter choice: [<S> ]"
+1016 U 0000 "Create DOS Partition or Logical DOS Drive"
+1017 U 0000 "1. <R>Create Primary DOS Partition"
+1018 U 0000 "2. <R>Create Extended DOS Partition"
+1019 U 0000 "3. <R>Create Logical DOS Drive(s) in the Extended DOS Partition"
+1020 U 0000 "Press <H>Esc<R> to return to FDISK Options"
+1021 U 0000 "Create Primary DOS Partition"
+1022 U 0000 "Do you wish to use the maximum available size for a Primary DOS Partition"
+1023 U 0000 "and make the partition active (<Y>/<N>).....................? <H>[<S> ]"
+1024 U 0000 "(<Y>/<N>)...................................................? <H>[<S> ]"
+1025 U 0000 "Partition Status Type Size in Mbytes Percentage of Disk Used"
+1026 U 0000 "Total disk space is <HIIIIR> Mbytes (1 Mbyte = 1048576 bytes)"
+1027 U 0000 "Maximum space available for partition is <HIIIIR> Mbytes (<HIIIIR>)"
+1028 U 0000 "Enter partition size in Mbytes or percent of disk space (%) to"
+1029 U 0000 "create a Primary DOS Partition.................................: <H>[<IIISI>]"
+1030 U 0000 "Create Extended DOS Partition"
+1031 U 0000 "create an Extended DOS Partition..............................: <H>[<IIISI>]"
+1032 U 0000 "Press <H>Esc<R> to continue"
+1033 U 0000 "Create Logical DOS Drive(s) in the Extended DOS Partition"
+1034 U 0000 "Drv Volume Label Mbytes System Usage"
+1035 U 0000 "Total Extended DOS Partition size is <HIIIIR> Mbytes (1 MByte = 1048576 bytes)"
+1036 U 0000 "Maximum space available for logical drive is <HIIIIR> Mbytes <H>(<IIII>)"
+1037 U 0000 "Enter logical drive size in Mbytes or percent of disk space (%)...<H>[<IIISI>]"
+1038 U 0000 "Set Active Partition"
+1039 U 0000 "Enter the number of the partition you want to make active...........: <H>[<S> ]"
+1040 U 0000 "Delete DOS Partition or Logical DOS Drive"
+1041 U 0000 "1. <R>Delete Primary DOS Partition"
+1042 U 0000 "2. <R>Delete Extended DOS Partition"
+1043 U 0000 "3. <R>Delete Logical DOS Drive(s) in the Extended DOS Partition"
+1044 U 0000 "Delete Primary DOS Partition"
+1045 U 0000 "WARNING! <OR>Data in the deleted Primary DOS Partition will be lost."
+1046 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1047 U 0000 "Delete Extended DOS Partition"
+1048 U 0000 "WARNING! <OR>Data in the deleted Extended DOS Partition will be lost."
+1049 U 0000 "Do you wish to continue (<Y>/<N>).................? <H>[<S> ]"
+1050 U 0000 "Delete Logical DOS Drive(s) in the Extended DOS Partition"
+1051 U 0000 "WARNING! <OR>Data in a deleted Logical DOS Drive will be lost."
+1052 U 0000 "What drive do you want to delete...............................? <H>[<S> ]"
+1053 U 0000 "Are you sure (<Y>/<N>)..............................? <H>[<S> ]"
+1054 U 0000 "Enter Volume Label..............................? <H>[<S> ]"
+1055 U 0000 "Display Partition Information"
+1056 U 0000 "The Extended DOS Partition contains Logical DOS Drives."
+1057 U 0000 "Do you want to display the logical drive information (<Y>/<N>)......?<H>[<S> ]"
+1058 U 0000 "Display Logical DOS Drive Information"
+1059 U 0000 "System will now restart"
+1060 U 0001 "Insert DOS Install diskette in drive A:"
+1061 U 0000 "Press any key when ready . . .<S>"
+1062 U 0000 "Primary DOS Partition deleted"
+1063 U 0000 "Extended DOS Partition deleted"
+1064 U 0000 "Drive deleted"
+1065 U 0000 "Partition <I> made active"
+1066 U 0000 "Primary DOS Partition created"
+1067 U 0000 "Extended DOS Partition created"
+1068 U 0000 "Logical DOS Drive created, drive letters changed or added<W>"
+1069 U 0000 "No partitions defined"
+1070 U 0000 "No logical drives defined"
+1071 U 0000 "Drive letters have been changed or deleted<W>"
+1072 U 0000 "Drive redirected"
+1073 U 0000 "Primary DOS Partition created, drive letters changed or added"
+1074 U 0000 "No fixed disks present."
+1075 U 0000 "Error reading fixed disk."
+1076 U 0000 "Error writing fixed disk."
+1077 U 0000 "Incorrect DOS version."
+1078 U 0000 "Cannot FDISK with network loaded."
+1079 U 0000 "No Primary DOS Partition to delete."
+1080 U 0000 "No Extended DOS Partition to delete."
+1081 U 0000 "Primary DOS Partition already exists."
+1082 U 0000 "Extended DOS Partition already exists."
+1083 U 0000 "No space to create a DOS partition."
+1084 U 0000 "Requested logical drive size exceeds the maximum available space.<W>"
+1085 U 0000 "Requested partition size exceeds the maximum available space.<W>"
+1086 U 0000 "No partitions to delete."
+1087 U 0000 "The only startable partition on Drive 1 is already set active.<W>"
+1088 U 0000 "No partitions to make active."
+1089 U 0000 "Partition selected (<I>) is not startable, active partition not changed.<W>"
+1090 U 0000 "Cannot create Extended DOS Partition without"
+1091 U 0000 "Primary DOS Partition on disk 1.<W>"
+1092 U 0000 "All available space in the Extended DOS Partition"
+1093 U 0000 "is assigned to logical drives.<W>"
+1094 U 0000 "Cannot delete Extended DOS Partition while logical drives exist.<W>"
+1095 U 0000 "All logical drives deleted in the Extended DOS Partition.<W>"
+1096 U 0000 " is not a choice. Please enter <III>.<W>"
+1097 U 0000 "WARNING! The partition set active is not startable.<W>"
+1098 U 0000 " Only non-startable partitions exist."
+1099 U 0000 "Only partitions on Drive 1 can be made active.<W>"
+1100 U 0000 "Maximum number of Logical DOS Drives installed.<W>"
+1101 U 0000 "Cannot create a zero size partition."
+1102 U 0000 "Drive <II> already deleted."
+1103 U 0000 "Unable to access Drive <I>.<OW>"
+1104 U 0000 "Invalid entry, please enter <III>.<W>"
+1105 U 0000 "Cannot delete Primary DOS Partition on drive 1 "
+1106 U 0000 "when an Extended DOS Partition exists.<W>"
+1107 U 0000 "Invalid entry, please press Enter.<W>"
+1108 U 0000 "Volume label does not match.<W>"
+1109 U 0000 "Cannot create Logical DOS Drive without"
+1110 U 0000 "an Extended DOS Partition on the current drive.<W>"
+1111 U 0000 "No Logical DOS Drive(s) to delete."
+1112 U 0000 "Message string error <I>. See header of FDISKC.MSG for error definition"
+1113 U 0000 "Internal error"
+1114 U 0001 "Invalid partition table",0
+1115 U 0001 "Error loading operating system",0
+1116 U 0001 "Missing operating system",0
+XMAEM cf17 0006
+0001 U 0000 "80386 XMA Emulator Version 1.10",CR,LF
+ " (C) Copyright IBM Corporation 1987, 1988 All rights reserved",CR,LF,CR,LF,"$"
+0002 U 0000 "80386 XMA Emulator installed",CR,LF,"$"
+0003 U 0004 "80386 XMA Emulator not installed. This system unit",CR,LF
+ " is not supported.",CR,LF,CR,LF,"$"
+0004 U 0000 "80386 XMA Emulator not installed.",CR,LF
+ " Protected mode already in use.",CR,LF,CR,LF,"$"
+0005 U 0003 "80386 XMA Emulator not installed",CR,LF
+ " Parameter value must specify 64 pages or greater",CR,LF,"$"
+0006 U 0000 "80386 XMA Emulator not installed",CR,LF
+ " Insufficient memory for requested parameter value",CR,LF,"$"
+UPDATE d226 0006
+0100 U 0000 "- Enter your keyboard code: "
+0110 U 0000 "US" ;DEFAULT KEYBOARD CODE
+0120 U 0000 "- Enter the drive which contains files to be",CR,LF
+ " replaced (target cannot be drive A:): "
+0125 U 0000 "B:" ;DEFAULT DRIVE LETTER W/O HARDFILE
+0130 U 0000 "C:" ;DEFAULT DRIVE LETTER W HARDFILE
+0140 U 0000 "- Do you want to replace the DOS files",CR,LF
+ " in all directories (Y/N)? "
+0150 U 0000 "Y" ;DEFAULT Y/N PROMPT
+0160 U 0000 "- Enter the target directory name (\ for root): "
+0170 U 0000 "\" ;DEFAULT PATH
+0180 U 0000 "- Do you start IBM PC DOS from drive C: (Y/N)? "
+0190 U 0000 CR,LF,"- Insert next IBM PC DOS Corrective Service Diskette into drive A:",CR,LF
+0194 U 0000 CR,LF,"- Would you like to install changes on another diskette (Y/N)? "
+0195 U 0000 CR,LF,"- Insert First IBM PC DOS Corrective Service Diskette into drive A:"
+0196 U 0000 Cr,LF," and insert next target diskette into drive "
+0200 U 0000 CR,LF,"- Insert IBM PC DOS Corrective Service Diskette into drive A:",CR,LF
+ " Press any key to restart system . . ."
+0210 U 0000 CR,LF,"- Corrective Service has been successfully installed",CR,LF
+ " Remove IBM PC DOS Corrective Service Diskette from drive A:",CR,LF
+ " Press any key to restart system . . ."
+0220 U 0000 CR,LF,"Invalid keyboard code specified",CR,LF
+
diff --git a/private/mvdm/dos/v86/messages/usa-ms.idx b/private/mvdm/dos/v86/messages/usa-ms.idx
new file mode 100644
index 000000000..8d997fda1
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/usa-ms.idx
@@ -0,0 +1,18 @@
+0419
+COMMON 00000006 0038
+EXTEND 00000689 0090
+PARSE 0000131d 0011
+COMMAND 000014d4 0147
+ANSI 000046c4 0001
+APPEND 00004708 0026
+BACKUP 00004df6 0040
+DEBUG 00005ace 0068
+EDLIN 00006a38 0035
+EXE2BIN 0000727c 0012
+GRAPHICS 0000752e 0020
+KEYB 00007b18 0023
+MEM 0000814f 0066
+MSBIO 00008f0b 0023
+MSDOS 0000945b 0007
+NLSFUNC 00009594 0003
+SHARE 000096b8 0005
diff --git a/private/mvdm/dos/v86/messages/usa-ms.msg b/private/mvdm/dos/v86/messages/usa-ms.msg
new file mode 100644
index 000000000..c3808b3e1
--- /dev/null
+++ b/private/mvdm/dos/v86/messages/usa-ms.msg
@@ -0,0 +1,764 @@
+0419
+COMMON 00000006 0038
+0001 U 0000 "Incorrect DOS version",CR,LF
+0002 U 0000 "%1 already installed",CR,LF
+0003 U 0000 "%1 bytes available on disk",CR,LF
+0004 U 0000 "%1 bytes free",CR,LF
+0005 U 0000 "%1 bytes in bad sectors",CR,LF
+0006 U 0000 "%1 bytes total disk space",CR,LF
+0007 U 0000 "%1 bytes total memory",CR,LF
+0008 U 0000 "%1 bytes used by system",CR,LF
+0009 U 0000 "%1 installed",CR,LF
+0010 U 0000 "%1 not installed",CR,LF
+0011 U 0000 "%1 not installed",CR,LF
+0012 U 0000 "Cannot %1 a network drive",CR,LF
+0013 U 0000 "",
+0014 U 0000 "Cannot %1 a SUBSTed or ASSIGNed drive",CR,LF
+0015 U 0000 "Cannot execute %1",CR,LF
+0016 U 0000 "Expanded Memory not available",CR,LF
+0017 U 0000 "File allocation table bad, drive %1",CR,LF
+0018 U 0000 "File cannot be copied onto itself",CR,LF
+0019 U 0000 "Insert target disk in drive %1",CR,LF
+0020 U 0000 "Insufficient disk space",CR,LF
+0021 U 0000 "Invalid characters in volume label",CR,LF
+0022 U 0000 "Invalid code page",CR,LF
+0023 U 0000 "Invalid date",CR,LF
+0024 U 0000 "Invalid time",CR,LF
+0025 U 0000 "Invalid path",CR,LF
+0026 U 0000 "No source drive specified",CR,LF
+0027 U 0000 "No target drive specified",CR,LF
+0028 U 0000 "Press any key to continue . . .",CR,LF
+0029 U 0000 "Source path required",CR,LF
+0030 U 0000 "System transferred",CR,LF
+0031 U 0000 "",
+0032 U 0000 "Unable to create directory",CR,LF
+0033 U 0000 "Volume in drive %1 has no label",CR,LF
+0034 U 0000 "Volume in drive %1 is %2",CR,LF
+0035 U 0001 "Volume label (11 characters, ENTER for none)? "
+0036 U 0000 "Volume Serial Number is %1-%2",CR,LF
+0037 U 0000 "Incorrect file type",CR,LF
+0038 U 0001 CR,LF
+EXTEND 00000689 0090
+0001 U 0003 "Invalid function"
+0002 U 0000 "File not found"
+0003 U 0000 "Path not found"
+0004 U 0000 "Too many open files"
+0005 U 0000 "Access denied "
+0006 U 0000 "Invalid handle"
+0007 U 0000 "Memory control blocks destroyed"
+0008 U 0000 "Insufficient memory"
+0009 U 0000 "Invalid memory block address"
+0010 U 0000 "Invalid Environment"
+0011 U 0000 "Invalid format"
+0012 U 0000 "Invalid function parameter"
+0013 U 0000 "Invalid data"
+0014 U 0000 "",
+0015 U 0000 "Invalid drive specification"
+0016 U 0000 "Attempt to remove current directory"
+0017 U 0000 "Not same device"
+0018 U 0000 "No more files"
+0019 U 0000 "Write protect error"
+0020 U 0000 "Invalid unit"
+0021 U 0000 "Not ready"
+0022 U 0000 "Invalid device request"
+0023 U 0000 "Data error"
+0024 U 0000 "Invalid device request parameters"
+0025 U 0000 "Seek error"
+0026 U 0000 "Invalid media type"
+0027 U 0000 "Sector not found"
+0028 U 0000 "Printer out of paper error"
+0029 U 0000 "Write fault error"
+0030 U 0000 "Read fault error"
+0031 U 0000 "General failure"
+0032 U 0000 "Sharing violation"
+0033 U 0000 "Lock violation"
+0034 U 0000 "Invalid disk change"
+0035 U 0000 "FCB unavailable"
+0036 U 0000 "System resource exhausted"
+0037 U 0000 "Code page mismatch"
+0038 U 0000 "Out of input"
+0039 U 0000 "Insufficient disk space"
+0040 U 0000 "",
+0041 U 0000 "",
+0042 U 0000 "",
+0043 U 0000 "",
+0044 U 0000 "",
+0045 U 0000 "",
+0046 U 0000 "",
+0047 U 0000 "",
+0048 U 0000 "",
+0049 U 0000 "",
+0050 U 0000 "NET809: Network request not supported"
+0051 U 0000 "NET801: Remote computer not listening"
+0052 U 0000 "NET802: Duplicate name on network"
+0053 U 0000 "NET803: Network path not found"
+0054 U 0000 "NET804: Network busy"
+0055 U 0000 "NET805: Network device no longer exists"
+0056 U 0000 "NET806: NETBIOS command limit exceeded"
+0057 U 0000 "NET807: System error; NETBIOS error"
+0058 U 0000 "NET808: Incorrect response from network"
+0059 U 0000 "NET810: Unexpected network error"
+0060 U 0000 "NET811: Incompatible remote adapter"
+0061 U 0000 "NET812: Print queue full"
+0062 U 0000 "NET813: Not enough space for print file"
+0063 U 0000 "NET814: Print file was cancelled"
+0064 U 0000 "NET815: Network name was deleted"
+0065 U 0000 "Access denied"
+0066 U 0000 "NET817: Network device type incorrect"
+0067 U 0000 "NET818: Network name not found"
+0068 U 0000 "NET819: Network name limit exceeded"
+0069 U 0000 "NET820: NETBIOS session limit exceeded"
+0070 U 0000 "NET821: Sharing temporarily paused"
+0071 U 0000 "NET823: Network request not accepted"
+0072 U 0000 "NET822: Print or disk redirection is paused"
+0073 U 0000 "NET476: Netbeui not loaded"
+0074 U 0000 "NET477: Unexpected adapter close"
+0075 U 0000 "",
+0076 U 0000 "",
+0077 U 0004 "",
+0078 U 0004 "",
+0079 U 0004 "",
+0080 U 0004 "File exists"
+0081 U 0004 "",
+0082 U 0004 "Cannot make directory entry"
+0083 U 0004 "Fail on INT 24"
+0084 U 0004 "Too many redirections"
+0085 U 0004 "Duplicate redirection"
+0086 U 0004 "Invalid password"
+0087 U 0004 "Invalid parameter"
+0088 U 0004 "Network data fault"
+0089 U 0004 "Function not supported by network"
+0090 U 0002 "Required system component not installed"
+PARSE 0000131d 0011
+0001 U 0000 "Too many parameters"
+0002 U 0000 "Required parameter missing"
+0003 U 0000 "Invalid switch"
+0004 U 0000 "Invalid keyword"
+0005 U 0000 "",
+0006 U 0000 "Parameter value not in allowed range"
+0007 U 0000 "Parameter value not allowed"
+0008 U 0000 "Parameter value not allowed"
+0009 U 0000 "Parameter format not correct"
+0010 U 0000 "Invalid parameter"
+0011 U 0000 "Invalid parameter combination"
+COMMAND 000014d4 0147
+1002 U 0000 "Duplicate file name or file not found",CR,LF
+1003 U 0000 "Invalid path or file name",CR,LF
+1007 U 0000 "Out of environment space",CR,LF
+1008 U 0000 "File creation error",CR,LF
+1009 U 0000 "Batch file missing",CR,LF
+1010 U 0000 CR,LF,"Insert disk with batch file",CR,LF
+1011 U 0000 "Bad command or file name",CR,LF
+1016 U 0000 "Content of destination lost before copy",CR,LF
+1017 U 0000 "Invalid filename or file not found",CR,LF
+1018 U 0000 "%1 file(s) copied",CR,LF
+1019 U 0000 "%1 file(s) "
+1022 U 0000 "Code page %1 not prepared for system",CR,LF
+1023 U 0000 "Code page %1 not prepared for all devices",CR,LF
+1024 U 0000 "Active code page: %1",CR,LF
+1025 U 0000 "NLSFUNC not installed",CR,LF
+1027 U 0000 "Current drive is no longer valid"
+1029 U 0000 "Label not found",CR,LF
+1030 U 0000 "Syntax error",CR,LF
+1032 U 0000 "Current date is %1 %2",CR,LF
+1033 U 0000 "SunMonTueWedThuFriSat"
+1034 U 0000 "Enter new date (%1): "
+1036 U 0000 "Current time is %1",CR,LF
+1037 U 0000 "Enter new time: "
+1038 U 0000 ", Delete (Y/N)?"
+1039 U 0000 "All files in directory will be deleted!",CR,LF,"Are you sure (Y/N)?"
+1040 U 0000 "MS-DOS Version %1.%2.500"
+1044 U 0000 "Invalid directory",CR,LF
+1046 U 0000 "Invalid path, not directory,",CR,LF,"or directory not empty",CR,LF
+1047 U 0000 "Must specify ON or OFF",CR,LF
+1048 U 0000 "Directory of %1",CR,LF
+1049 U 0000 "No Path",CR,LF
+1050 U 0000 "Invalid drive in search path",CR,LF
+1051 U 0000 "Invalid device",CR,LF
+1052 U 0000 "FOR cannot be nested",CR,LF
+1053 U 0000 "Intermediate file error during pipe",CR,LF
+1054 U 0000 "Cannot do binary reads from a device",CR,LF
+1055 U 0000 "BREAK is %1",CR,LF
+1056 U 0000 "VERIFY is %1",CR,LF
+1057 U 0000 "ECHO is %1",CR,LF
+1059 U 0000 "off",0
+1060 U 0000 "on",0
+1061 U 0000 "Error writing to device",CR,LF
+1063 U 0000 "%1"
+1064 U 0000 "%1"
+1065 U 0000 "%1"
+1066 U 0000 "%1"
+1067 U 0000 9
+1068 U 0000 " <DIR> "
+1069 U 0000 8," ",8
+1070 U 0000 CR,LF
+1071 U 0000 "%1"
+1072 U 0000 "mm-dd-yy"
+1073 U 0000 "dd-mm-yy"
+1074 U 0000 "yy-mm-dd"
+1075 U 0000 "%1 %2"
+1076 U 0000 "%1"
+1077 U 0000 " %1 %2"
+1078 U 0000 "Directory already exists",CR,LF
+1079 U 0000 "%1 bytes",CR,LF
+1080 U 0000 "Total files listed:",CR,LF
+1081 U 0000 "(Error occurred in environment variable)",CR,LF
+1084 U 0000 "(continuing %1)"
+1090 U 0000 "Revision %1",CR,LF
+1091 U 0000 "DOS is in ROM"
+1092 U 0000 "DOS is in HMA"
+1093 U 0000 "DOS is in low memory"
+1094 U 0000 "Cannot Loadhigh batch file",CR,LF
+1095 U 0000 "LoadHigh: Invalid filename",CR,LF
+1096 U 0000 "Cannot open specified country information file",CR,LF
+1300 U 0000 "Sets or clears extended CTRL+C checking.",CR,LF,CR,LF
+ "BREAK [ON | OFF]",CR,LF,CR,LF
+ "Type BREAK without a parameter to display the current BREAK setting.",CR,LF
+1320 U 0000 "Displays or sets the active code page number.",CR,LF,CR,LF
+ "CHCP [nnn]",CR,LF,CR,LF
+1321 U 0000 " nnn Specifies a code page number.",CR,LF,CR,LF
+ "Type CHCP without a parameter to display the active code page number.",CR,LF
+1340 U 0000 "Displays the name of or changes the current directory.",CR,LF,CR,LF
+ "CHDIR [drive:][path]",CR,LF
+ "CHDIR[..]",CR,LF
+1341 U 0000 "CD [drive:][path]",CR,LF
+ "CD[..]",CR,LF,CR,LF
+ " .. Specifies that you want to change to the parent directory.",CR,LF,CR,LF
+1342 U 0000 "Type CD drive: to display the current directory in the specified drive.",CR,LF
+ "Type CD without parameters to display the current drive and directory.",CR,LF
+1360 U 0000 "Clears the screen.",CR,LF,CR,LF
+ "CLS",CR,LF
+1400 U 0000 "Copies one or more files to another location.",CR,LF,CR,LF
+ "COPY [/A | /B] source [/A | /B] [+ source [/A | /B] [+ ...]] [destination",CR,LF
+ " [/A | /B]] [/V]",CR,LF,CR,LF
+1401 U 0000 " source Specifies the file or files to be copied.",CR,LF
+ " /A Indicates an ASCII text file.",CR,LF
+1402 U 0000 " /B Indicates a binary file.",CR,LF
+ " destination Specifies the directory and/or filename for the new file(s).",CR,LF
+1403 U 0000 " /V Verifies that new files are written correctly.",CR,LF,CR,LF
+1404 U 0000 "To append files, specify a single file for destination, but multiple files",CR,LF
+ "for source (using wildcards or file1+file2+file3 format).",CR,LF
+1420 U 0000 "Changes the terminal device used to control your system.",CR,LF,CR,LF
+ "CTTY device",CR,LF,CR,LF
+ " device The terminal device you want to use, such as COM1.",CR,LF
+1440 U 0000 "Displays or sets the date.",CR,LF,CR,LF
+ "DATE [date]",CR,LF,CR,LF
+1441 U 0000 "Type DATE without parameters to display the current date setting and",CR,LF
+ "a prompt for a new one. Press ENTER to keep the same date.",CR,LF
+1460 U 0000 "Deletes one or more files.",CR,LF,CR,LF
+ "DEL [drive:][path]filename [/P]",CR,LF
+ "ERASE [drive:][path]filename [/P]",CR,LF,CR,LF
+1461 U 0000 " [drive:][path]filename Specifies the file(s) to delete. Specify multiple",CR,LF
+ " files by using wildcards.",CR,LF
+1462 U 0000 " /P Prompts for confirmation before deleting each file.",CR,LF
+1480 U 0000 "Displays a list of files and subdirectories in a directory.",CR,LF,CR,LF
+ "DIR [drive:][path][filename] [/P] [/W] [/A[[:]attributes]]",CR,LF
+ " [/O[[:]sortorder]] [/S] [/B] [/L]",CR,LF,CR,LF
+1481 U 0000 " [drive:][path][filename]",CR,LF
+ " Specifies drive, directory, and/or files to list.",CR,LF
+1482 U 0000 " /P Pauses after each screenful of information.",CR,LF
+ " /W Uses wide list format.",CR,LF
+1483 U 0000 " /A Displays files with specified attributes.",CR,LF
+ " attributes D Directories R Read-only files",CR,LF
+1484 U 0000 " H Hidden files A Files ready for archiving",CR,LF
+ " S System files - Prefix meaning ""not""",CR,LF
+ " /O List by files in sorted order.",CR,LF
+1485 U 0000 " sortorder N By name (alphabetic) S By size (smallest first)",CR,LF
+ " E By extension (alphabetic) D By date & time (earliest first)",CR,LF
+1486 U 0000 " G Group directories first - Prefix to reverse order",CR,LF
+ " /S Displays files in specified directory and all subdirectories.",CR,LF
+1487 U 0000 " /B Uses bare format (no heading information or summary).",CR,LF
+ " /L Uses lowercase.",CR,LF,CR,LF
+1488 U 0000 "Switches may be preset in the DIRCMD environment variable. Override",CR,LF
+ "preset switches by prefixing any switch with - (hyphen)--for example, /-W.",CR,LF
+1500 U 0000 "Quits the COMMAND.COM program (command interpreter).",CR,LF,CR,LF
+ "EXIT",CR,LF
+1520 U 0000 "Creates a directory.",CR,LF,CR,LF
+ "MKDIR [drive:]path",CR,LF
+ "MD [drive:]path",CR,LF
+1540 U 0000 "Displays or sets a search path for executable files.",CR,LF,CR,LF
+ "PATH [[drive:]path[;...]]",CR,LF
+ "PATH ;",CR,LF,CR,LF
+1541 U 0000 "Type PATH ; to clear all search-path settings and direct MS-DOS to search",CR,LF
+ "only in the current directory.",CR,LF
+1542 U 0000 "Type PATH without parameters to display the current path.",CR,LF
+1560 U 0000 "Changes the MS-DOS command prompt.",CR,LF,CR,LF
+ "PROMPT [text]",CR,LF,CR,LF
+1561 U 0000 " text Specifies a new command prompt.",CR,LF,CR,LF
+ "Prompt can be made up of normal characters and the following special codes:",CR,LF,CR,LF
+1562 U 0000 " $Q = (equal sign)",CR,LF
+ " $$ $ (dollar sign)",CR,LF
+1563 U 0000 " $T Current time",CR,LF
+ " $D Current date",CR,LF
+1564 U 0000 " $P Current drive and path",CR,LF
+ " $V MS-DOS version number",CR,LF
+1565 U 0000 " $N Current drive",CR,LF
+ " $G > (greater-than sign)",CR,LF
+1566 U 0000 " $L < (less-than sign)",CR,LF
+ " $B | (pipe)",CR,LF
+1567 U 0000 " $H Backspace (erases previous character)",CR,LF
+ " $E Escape code (ASCII code 27)",CR,LF
+ " $_ Carriage return and linefeed",CR,LF,CR,LF
+1568 U 0000 "Type PROMPT without parameters to reset the prompt to the default setting.",CR,LF
+1580 U 0000 "Removes (deletes) a directory.",CR,LF,CR,LF
+ "RMDIR [drive:]path",CR,LF
+ "RD [drive:]path",CR,LF
+1600 U 0000 "Renames a file or files.",CR,LF,CR,LF
+1601 U 0000 "RENAME [drive:][path]filename1 filename2",CR,LF
+ "REN [drive:][path]filename1 filename2",CR,LF,CR,LF
+1602 U 0000 "Note that you cannot specify a new drive or path for your destination file.",CR,LF
+1620 U 0000 "Displays, sets, or removes MS-DOS environment variables.",CR,LF,CR,LF
+ "SET [variable=[string]]",CR,LF,CR,LF
+1621 U 0000 " variable Specifies the environment-variable name.",CR,LF
+ " string Specifies a series of characters to assign to the variable.",CR,LF,CR,LF
+1622 U 0000 "Type SET without parameters to display the current environment variables.",CR,LF
+1640 U 0000 "Displays or sets the system time.",CR,LF,CR,LF
+ "TIME [time]",CR,LF,CR,LF
+1641 U 0000 "Type TIME with no parameters to display the current time setting and a prompt",CR,LF
+ "for a new one. Press ENTER to keep the same time.",CR,LF
+1660 U 0000 "Displays the contents of a text file.",CR,LF,CR,LF
+ "TYPE [drive:][path]filename",CR,LF
+1680 U 0000 "Displays the MS-DOS version.",CR,LF,CR,LF
+ "VER",CR,LF
+1700 U 0000 "Tells MS-DOS whether to verify that your files are written correctly to a",CR,LF
+ "disk.",CR,LF,CR,LF
+ "VERIFY [ON | OFF]",CR,LF,CR,LF
+ "Type VERIFY without a parameter to display the current VERIFY setting.",CR,LF
+1720 U 0000 "Displays the disk volume label and serial number, if they exist.",CR,LF,CR,LF
+ "VOL [drive:]",CR,LF
+1740 U 0000 "Calls one batch program from another.",CR,LF,CR,LF
+ "CALL [drive:][path]filename [batch-parameters]",CR,LF,CR,LF
+1741 U 0000 " batch-parameters Specifies any command-line information required by the",CR,LF
+ " batch program.",CR,LF
+1760 U 0000 "Records comments (remarks) in a batch file or CONFIG.SYS.",CR,LF,CR,LF
+ "REM [comment]",CR,LF
+1780 U 0000 "Suspends processing of a batch program and displays the message ""Press any",CR,LF
+ "key to continue....""",CR,LF,CR,LF
+ "PAUSE",CR,LF
+1800 U 0000 "Displays messages, or turns command-echoing on or off.",CR,LF,CR,LF
+ " ECHO [ON | OFF]",CR,LF
+1801 U 0000 " ECHO [message]",CR,LF,CR,LF
+ "Type ECHO without parameters to display the current echo setting.",CR,LF
+1820 U 0000 "Directs MS-DOS to a labelled line in a batch program.",CR,LF,CR,LF
+ "GOTO label",CR,LF,CR,LF
+1821 U 0000 " label Specifies a text string used in the batch program as a label.",CR,LF,CR,LF
+ "You type a label on a line by itself, beginning with a colon.",CR,LF
+1840 U 0000 "Changes the position of replaceable parameters in a batch file.",CR,LF,CR,LF
+ "SHIFT",CR,LF
+1860 U 0000 "Performs conditional processing in batch programs.",CR,LF,CR,LF
+ "IF [NOT] ERRORLEVEL number command",CR,LF
+1861 U 0000 "IF [NOT] string1==string2 command",CR,LF
+ "IF [NOT] EXIST filename command",CR,LF,CR,LF
+1862 U 0000 " NOT Specifies that MS-DOS should carry out the command only",CR,LF
+ " if the condition is false.",CR,LF
+1863 U 0000 " ERRORLEVEL number Specifies a true condition if the last program run returned",CR,LF
+ " an exit code equal to or greater than the number specified.",CR,LF
+1864 U 0000 " command Specifies the command to carry out if the condition is",CR,LF
+ " met.",CR,LF
+1865 U 0000 " string1==string2 Specifies a true condition if the specified text strings",CR,LF
+ " match.",CR,LF
+1866 U 0000 " EXIST filename Specifies a true condition if the specified filename",CR,LF
+ " exists.",CR,LF
+1880 U 0000 "Runs a specified command for each file in a set of files.",CR,LF,CR,LF
+ "FOR %variable IN (set) DO command [command-parameters]",CR,LF,CR,LF
+1881 U 0000 " %variable Specifies a replaceable parameter.",CR,LF
+ " (set) Specifies a set of one or more files. Wildcards may be used.",CR,LF
+1882 U 0000 " command Specifies the command to carry out for each file.",CR,LF
+ " command-parameters",CR,LF
+1883 U 0000 " Specifies parameters or switches for the specified command.",CR,LF,CR,LF
+ "To use the FOR command in a batch program, specify %%variable instead of",CR,LF
+ "%variable.",CR,LF
+1900 U 0000 "Reserved command name",CR,LF
+1920 U 0000 "Loads a program into the upper memory area.",CR,LF,CR,LF
+1921 U 0000 "LOADHIGH [drive:][path]filename [parameters]",CR,LF
+ "LH [drive:][path]filename [parameters]",CR,LF,CR,LF
+1922 U 0000 " parameters Specifies any command-line information required by the",CR,LF
+ " program you want to load.",CR,LF
+ANSI 000046c4 0001
+0010 U 0000 "Invalid parameter - %1",CR,LF
+APPEND 00004708 0026
+0001 U 0000 "Incorrect APPEND version",CR,LF
+0002 U 0000 "Invalid path",CR,LF
+0003 U 0000 "Invalid parameter",CR,LF
+0004 U 0000 "Invalid combination of parameters",CR,LF
+0005 U 0000 "No Append",CR,LF
+0006 U 0000 "APPEND / ASSIGN Conflict",CR,LF
+0007 U 0000 "APPEND / TopView Conflict",CR,LF
+0008 U 0000 "Incorrect DOS version",CR,LF
+0009 U 0000 "APPEND already installed",CR,LF
+0300 U 0000 "Allows programs to open data files in specified directories as if they were in",CR,LF
+0301 U 0000 "the current directory.",CR,LF,CR,LF
+0302 U 0000 "APPEND [[drive:]path[;...]] [/X[:ON | :OFF]] [/PATH:ON | /PATH:OFF] [/E]",CR,LF
+0303 U 0000 "APPEND ;",CR,LF,CR,LF
+0304 U 0000 " [drive:]path Specifies a drive and directory to append.",CR,LF
+0305 U 0000 " /X:ON Applies appended directories to file searches and",CR,LF
+0306 U 0000 " application execution.",CR,LF
+0307 U 0000 " /X:OFF Applies appended directories only to requests to open files.",CR,LF
+0308 U 0000 " /X:OFF is the default setting.",CR,LF
+0309 U 0000 " /PATH:ON Applies appended directories to file requests that already",CR,LF
+0310 U 0000 " specify a path. /PATH:ON is the default setting.",CR,LF
+0311 U 0000 " /PATH:OFF Turns off the effect of /PATH:ON.",CR,LF
+0312 U 0000 " /E Stores a copy of the appended directory list in an environment",CR,LF
+0313 U 0000 " variable named APPEND. /E may be used only the first time",CR,LF
+0314 U 0000 " you use APPEND after starting your system.",CR,LF,CR,LF
+0315 U 0000 "Type APPEND ; to clear the appended directory list.",CR,LF
+0316 U 0000 "Type APPEND without parameters to display the appended directory list.",CR,LF
+BACKUP 00004df6 0040
+0002 U 0000 CR,LF,"Insufficient memory",CR,LF
+0006 U 0000 CR,LF,"Invalid drive specification",CR,LF
+0014 U 0000 CR,LF,"Source and target drives are the same",CR,LF
+0015 U 0001 CR,LF,"Error executing FORMAT",CR,LF
+0016 U 0001 CR,LF,"Cannot find FORMAT.COM",CR,LF
+0017 U 0000 CR,LF,"Error opening logfile",CR,LF
+0018 U 0000 CR,LF,"Logging to file %1",CR,LF
+0019 U 0000 CR,LF,"Last backup diskette not inserted",CR,LF
+0020 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\ root directory will be erased",CR,LF
+0021 U 0000 CR,LF,"WARNING! Files in the target drive",CR,LF
+ "%1:\BACKUP directory will be erased",CR,LF
+0022 U 0000 CR,LF,"*** Backing up files to drive %1: ***",CR,LF
+0023 U 0000 "Diskette Number: %1",CR,LF
+0024 U 0000 CR,LF,"WARNING! No files were found to back up",CR,LF
+0025 U 0000 CR,LF,"Insert backup source diskette in drive %1:",CR,LF
+0026 U 0000 CR,LF,"Insert backup diskette %1 in drive %2:",CR,LF
+0027 U 0000 CR,LF,"*** Not able to backup file ***",CR,LF
+0028 U 0000 CR,LF,"Insert last backup diskette in drive %1:",CR,LF
+0029 U 0000 CR,LF,"Target cannot be used for backup",CR,LF
+0030 U 0000 CR,LF,"*** Last file not backed up ***",CR,LF
+0031 U 0000 CR,LF,"Fixed backup device %1: is full",CR,LF
+0032 U 0000 CR,LF,"Disk full error writing to BACKUP Log File",CR,LF
+0034 U 0000 CR,LF
+0035 U 0001 CR,LF,"Cannot FORMAT nonremovable drive %1:",CR,LF
+0040 U 0000 CR, LF, "Because your source drive is either ASSIGNed, JOINed, or SUBSTed", CR, LF, "it is actually the same as the target drive", CR, LF
+0041 U 0000 CR, LF, "Because your target drive is either ASSIGNed, JOINed, or SUBSTed", CR, LF, "it is actually the same as the source drive", CR, LF
+0042 U 0000 "Your target diskette is unformatted and "
+0043 U 0000 "No FORMAT program was found.",CR,LF
+ "Do you have another diskette with FORMAT on it (Y/N)? "
+0044 U 0000 CR,LF,"Insert the diskette with FORMAT in drive A:",CR,LF
+0045 U 0000 CR,LF,"Do you want to continue by inserting a new disk (Y/N)? "
+0300 U 0000 "Backs up one or more files from one disk to another.",CR,LF,CR,LF
+0301 U 0000 "BACKUP source destination-drive: [/S] [/M] [/A] [/F[:size]]",CR,LF
+ " [/D:date[/T:time]] [/L[:[drive:][path]logfile]]",CR,LF,CR,LF
+0302 U 0000 " source Specifies the file(s), drive, or directory to back up.",CR,LF
+0303 U 0000 " destination-drive: Specifies the drive to save backup copies onto.",CR,LF
+0304 U 0000 " /S Backs up contents of subdirectories.",CR,LF
+0305 U 0000 " /M Backs up only files that have changed since the last",CR,LF
+ " backup.",CR,LF
+0306 U 0000 " /A Adds backup files to an existing backup disk.",CR,LF
+0307 U 0000 " /F:[size] Specifies the size of the disk to be formatted.",CR,LF
+0308 U 0000 " /D:date Backs up only files changed on or after the specified",CR,LF
+ " date.",CR,LF
+0309 U 0000 " /T:time Backs up only files changed at or after the specified",CR,LF
+ " time.",CR,LF
+0310 U 0000 " /L[:[drive:][path]logfile]",CR,LF
+ " Creates a log file and entry to record the backup",CR,LF
+ " operation.",CR,LF
+DEBUG 00005ace 0068
+0004 U 0000 "Allocation failed or specified buffer too small",CR,LF
+0006 U 0000 "Bad device name"
+0007 U 0000 "Cannot open list device PRN",CR,LF
+ "Enter name of list device? "
+0008 U 0000 CR,LF
+0009 U 0000 CR,LF,"Program terminated normally",CR,LF
+0010 U 0001 "Invalid drive specification",CR,LF
+0012 U 0001 "File creation error",CR,LF
+0013 U 0001 "Insufficient space on disk",CR,LF
+0014 U 0001 "Disk error reading drive %1",CR,LF
+0015 U 0001 "Disk error writing drive %1",CR,LF
+0016 U 0001 "Write protect error reading drive %1",CR,LF
+0017 U 0001 "Write protect error writing drive %1",CR,LF
+0019 U 0000 "%1^ Error"
+0020 U 0001 "Error in EXE or HEX file",CR,LF
+0021 U 0001 "EXE and HEX files cannot be written",CR,LF
+0022 U 0000 "EXEC failure"
+0023 U 0001 "(W)rite error, no destination defined",CR,LF
+0024 U 0001 "Access denied",CR,LF
+0025 U 0000 "Parity error or nonexistent memory error detected"
+0026 U 0000 "-"
+0027 U 0000 "%1 -"
+0032 U 0000 "%1%2"
+0033 U 0000 "%1:%2 %3"
+0034 U 0000 "%1 %2"
+0035 U 0000 "%1 %2",CR,LF,":"
+0036 U 0000 "%1=%2 "
+0037 U 0000 "%1 Error"
+0038 U 0000 "Writing %2%1 bytes" ;C02
+0039 U 0000 "%1:%2="
+0040 U 0000 "%1"
+0041 U 0000 "%1"
+0042 U 0000 "%1:%2 %3 %4 %5:%6"
+0044 U 0000 32,8
+0046 U 0000 "%1"
+0047 U 0000 "%1"
+0050 U 0000 "%1 of a total %2 EMS pages have been allocated",cr,lf
+0051 U 0000 "%1 of a total %2 EMS handles have been allocated",cr,lf
+0055 U 0000 "Handle created = %1 ",cr,lf
+0056 U 0000 "Logical page %1 mapped to physical page %2 ",cr,lf
+0057 U 0001 "EMS hardware/software failure",cr,lf
+0058 U 0000 "Handle not found",cr,lf
+0059 U 0000 "Invalid function code",cr,lf
+0060 U 0000 "No free handles",cr,lf
+0061 U 0000 "Save/Restore error",cr,lf
+0062 U 0000 "Total pages exceeded",cr,lf
+0063 U 0000 "Free pages exceeded",cr,lf
+0064 U 0000 "Parameter error",cr,lf
+0065 U 0000 "Logical Page out of range",cr,lf
+0066 U 0000 "Physical Page out of range",cr,lf
+0067 U 0000 "Save area already in use",cr,lf
+0068 U 0000 "Save area not in use",cr,lf
+0070 U 0001 "General EMS error",cr,lf
+0071 U 0000 "Missing or invalid EMS parameter",cr,lf
+0072 U 0000 "Handle %1 has %2 pages allocated",cr,lf
+0075 U 0000 "Physical page %1 = Frame segment %2",cr,lf
+0076 U 0003 "Handle %1 deallocated",cr,lf
+0078 U 0000 "EMS not installed",cr,lf
+0090 U 0000 "Runs Debug, a program testing and editing tool.",cr,lf,cr,lf
+0091 U 0000 "DEBUG [[drive:][path]filename [testfile-parameters]]",cr,lf,cr,lf
+0092 U 0000 " [drive:][path]filename Specifies the file you want to test.", cr,lf
+0093 U 0000 " testfile-parameters Specifies command-line information required by",cr,lf
+ " the file you want to test.",cr,lf,cr,lf
+0094 U 0000 "After Debug starts, type ? to display a list of debugging commands.",cr,lf
+0100 U 0000 "assemble A [address]",CR,LF
+ "compare C range address",CR,LF
+ "dump D [range]",CR,LF
+ "enter E address [list]",CR,LF
+0101 U 0000 "fill F range list",CR,LF
+ "go G [=address] [addresses]",CR,LF
+ "hex H value1 value2",CR,LF
+ "input I port",CR,LF
+0102 U 0000 "load L [address] [drive] [firstsector] [number]",CR,LF
+ "move M range address",CR,LF
+ "name N [pathname] [arglist]",CR,LF
+ "output O port byte",CR,LF
+0103 U 0000 "proceed P [=address] [number]",CR,LF
+ "quit Q",CR,LF
+ "register R [register]",CR,LF
+ "search S range list",CR,LF
+0104 U 0000 "trace T [=address] [value]",CR,LF
+ "unassemble U [range]",CR,LF
+ "write W [address] [drive] [firstsector] [number]",CR,LF
+0105 U 0000 "allocate expanded memory XA [#pages]",CR,LF
+ "deallocate expanded memory XD [handle]",CR,LF
+ "map expanded memory pages XM [Lpage] [Ppage] [handle]",CR,LF
+ "display expanded memory status XS",CR,LF
+EDLIN 00006a38 0035
+0006 U 0000 "*"
+0007 U 0000 "Invalid drive or file name",CR,LF
+0008 U 0000 "File name must be specified",CR,LF
+0010 U 0000 "File is READ-ONLY",CR,LF
+0011 U 0000 "File Creation Error",CR,LF
+0012 U 0000 "Too many files open",CR,LF
+0013 U 0000 "Read error in:",CR,LF,"%1",CR,LF
+0014 U 0000 "Cannot edit .BAK file--rename file",CR,LF
+0015 U 0000 "No room in directory for file",CR,LF
+0016 U 0000 "Disk full. Edits lost.",CR,LF
+0017 U 0000 "File not found",CR,LF
+0018 U 0000 "Entry error",CR,LF
+0019 U 0000 "New file",CR,LF
+0020 U 0000 "Not found",CR,LF
+0021 U 0000 "O.K.? "
+0022 U 0000 "Line too long",CR,LF
+0023 U 0000 "End of input file",CR,LF
+0024 U 0000 "Abort edit (Y/N)? "
+0025 U 0000 "Must specify destination line number",CR,LF
+0026 U 0000 "Not enough room to merge the entire file",CR,LF
+0027 U 0000 CR,LF
+0028 U 0000 LF
+0029 U 0000 "Continue (Y/N)?"
+0030 U 0000 "Unable to print message",CR,LF
+0031 U 0000 "%1"
+0032 U 0000 "%1:%2"
+0033 U 0000 "Cannot merge - code page mismatch",CR,LF
+0300 U 0000 "Starts Edlin, a line-oriented text editor.",CR,LF,CR,LF
+ "EDLIN [drive:][path]filename [/B]",CR,LF,CR,LF
+ " /B Ignores end-of-file (CTRL+Z) characters.",CR,LF
+0301 U 0000 "Edit line line#",CR,LF
+ "Append [#lines]A",CR,LF
+0302 U 0000 "Copy [startline],[endline],toline[,times]C",CR,LF
+ "Delete [startline][,endline]D",CR,LF
+0303 U 0000 "End (save file) E",CR,LF
+ "Insert [line]I",CR,LF
+0304 U 0000 "List [startline][,endline]L",CR,LF
+ "Move [startline],[endline],tolineM",CR,LF
+0305 U 0000 "Page [startline][,endline]P",CR,LF
+ "Quit (throw away changes) Q",CR,LF
+0306 U 0000 "Replace [startline][,endline][?]R[oldtext][CTRL+Znewtext]",CR,LF
+ "Search [startline][,endline][?]Stext",CR,LF
+0307 U 0000 "Transfer [toline]T[drive:][path]filename",CR,LF
+ "Write [#lines]W",CR,LF
+EXE2BIN 0000727c 0012
+0002 U 0000 "Insufficient memory",CR,LF
+0003 U 0000 "Cannot find messages",CR,LF
+0004 U 0000 "Access denied",CR,LF
+0005 U 0000 "File cannot be converted",CR,LF
+0006 U 0000 "File not found",CR,LF
+0007 U 0000 "File creation error",CR,LF
+0008 U 0000 "Fix-ups needed - base segment (hex):"
+0012 U 0000 "File name must be specified",CR,LF
+0300 U 0000 "Converts .EXE (executable) files to binary format.",CR,LF,CR,LF
+0301 U 0000 "EXE2BIN [drive1:][path1]input-file [[drive2:][path2]output-file]",CR,LF,CR,LF
+0302 U 0000 " input-file Specifies the .EXE file to be converted.",CR,LF
+0303 U 0000 " output-file Specifies the binary file to be created.",CR,LF
+GRAPHICS 0000752e 0020
+0005 U 0000 "Invalid parameter: %1",CR,LF
+0007 U 0000 "Duplicate parameters not allowed",CR,LF
+0009 U 0000 "Cannot find GRAPHICS profile",CR,LF
+0010 U 0000 "Required profile statement missing before line %1",CR,LF
+0011 U 0000 "Invalid profile statement on line %1",CR,LF
+0012 U 0000 "Profile statement out of sequence on line %1",CR,LF
+0013 U 0000 "Error reading GRAPHICS profile",CR,LF
+0014 U 0000 "Syntax errors in GRAPHICS profile",CR,LF
+0015 U 0000 "Printbox ID not in GRAPHICS profile",CR,LF
+0016 U 0000 "Printer type not in GRAPHICS profile",CR,LF
+0017 U 0000 "/B invalid with a black and white printer",CR,LF
+0018 U 0000 "Unable to reload with profile supplied",CR,LF
+0300 U 0000 "Loads a program that can print graphics.",CR,LF,CR,LF
+0301 U 0000 "GRAPHICS [type] [[drive:][path]filename] [/R] [/B] [/LCD]",CR,LF
+ " [/PRINTBOX:STD | /PRINTBOX:LCD]",CR,LF,CR,LF
+0302 U 0000 " type Specifies a printer type (see User's Guide and Reference).",CR,LF
+0303 U 0000 " [drive:][path]filename",CR,LF
+ " Specifies the file containing information on supported printers.",CR,LF
+0304 U 0000 " /R Prints white on black as seen on the screen.",CR,LF
+0305 U 0000 " /B Prints the background in color for COLOR4 and COLOR8 printers.",CR,LF
+0306 U 0000 " /LCD Prints using LCD aspect ratio.",CR,LF
+0307 U 0000 " /PRINTBOX:STD | /PRINTBOX:LCD",CR,LF
+ " Specifies the print-box size, either STD or LCD.",CR,LF
+KEYB 00007b18 0023
+0002 U 0000 "Current keyboard code: %1"
+0003 U 0000 "Current keyboard ID: %1"
+0004 U 0000 " code page: %1",CR,LF
+0005 U 0000 "Current CON code page: %1",CR,LF
+0006 U 0000 "Invalid keyboard code specified",CR,LF
+0007 U 0000 "Invalid keyboard ID specified",CR,LF
+0008 U 0000 "Invalid code page specified",CR,LF
+0009 U 0000 "Bad or missing Keyboard Definition File",CR,LF
+0010 U 0000 "KEYB has not been installed",CR,LF
+0011 U 0000 "Active code page not available from CON device",CR,LF
+0012 U 0000 "Code page specified has not been prepared",CR,LF
+0013 U 0000 "One or more CON code pages invalid for given keyboard code",CR,LF
+0014 U 0000 "Code page requested (%1) is not valid for given keyboard code",CR,LF
+0015 U 0000 "Code page specified is inconsistent with the selected code page",CR,LF
+0016 U 0001 "Keyboard ID specified is inconsistent with the selected keyboard layout",CR,LF
+0017 U 0000 "Unable to create KEYB table in resident memory",CR,LF
+0300 U 0000 "Configures a keyboard for a specific language.",CR,LF,CR,LF
+0301 U 0000 "KEYB [xx[,[yyy][,[drive:][path]filename]]] [/E] [/ID:nnn]",CR,LF,CR,LF
+0302 U 0000 " xx Specifies a two-letter keyboard code.",CR,LF
+0303 U 0000 " yyy ÿ Specifies the code page for the character set.",CR,LF
+0304 U 0000 " [drive:][path]filename Specifies the keyboard definition file.",CR,LF
+0305 U 0000 " /E Specifies that an enhanced keyboard is installed.",CR,LF
+0306 U 0000 " /ID:nnn Specifies the keyboard in use.",CR,LF
+MEM 0000814f 0066
+0010 U 0000 CR,LF
+0011 U 0000 " Address Name Size Type ",CR,LF
+0012 U 0000 " ------- -------- ------ ------",CR,LF
+0013 U 0000 " Handle EMS Name Size ",CR,LF
+0014 U 0000 " ------- -------- ------ ",CR,LF
+0015 U 0000 " %1 %2 %3 %4",CR,LF
+0016 U 0000 " %1 %2 %3 ",CR,LF
+0017 U 0000 " %1 %2 ",CR,LF
+0018 U 0000 "%1 bytes total conventional memory",CR,LF
+0019 U 0000 "%1 bytes available to MS-DOS",CR,LF
+0020 U 0000 "%1 largest executable program size",CR,LF
+0021 U 0000 "%1 bytes total EMS memory",CR,LF
+0022 U 0000 "%1 bytes free EMS memory",CR,LF
+0023 U 0000 "%1 bytes total contiguous extended memory",CR,LF
+0024 U 0000 "Interrupt Vector",0
+0025 U 0000 "ROM Communication Area",0
+0026 U 0000 "DOS Communication Area",0
+0027 U 0000 "IO",0
+0028 U 0000 "MSDOS",0
+0029 U 0000 "System Data",0
+0030 U 0000 "System Program",0
+0031 U 0000 "System Device Driver",0
+0032 U 0000 "Installed Device Driver",0
+0033 U 0000 "%1:",0
+0034 U 0000 "%1: - %2:",0
+0035 U 0000 "BUFFERS=",0
+0036 U 0000 "FILES=",0
+0037 U 0000 "FCBS=",0
+0038 U 0000 "STACKS=",0
+0039 U 0000 "DEVICE=",0
+0040 U 0000 "IFS=",0
+0041 U 0000 "LASTDRIVE=",0
+0042 U 0000 "----------",0
+0043 U 0000 " ",0
+0044 U 0000 " %1 %2 %3",CR,LF
+0045 U 0001 "INSTALL=",0
+0046 U 0001 "%1 bytes available contiguous extended memory",CR,LF
+0047 U 0000 "System Stacks",0
+0048 U 0000 "-- Free --",0
+0049 U 0000 "Program",0
+0050 U 0000 "Environment",0
+0051 U 0000 "Data",0
+0052 N 0000 "%1 bytes available XMS memory",CR,LF
+0053 N 0000 " 64Kb High Memory Area available",CR,LF
+0054 N 0000 " High Memory Area in use",CR,LF
+0055 N 0000 " MS-DOS resident in High Memory Area",CR,LF
+0056 U 0000 "IBMBIO",0 ;*EGH
+0057 U 0000 "IBMDOS",0 ;*EGH
+0058 N 0000 " MS-DOS resident in ROM using High Memory Area",CR,LF
+0059 U 0000 "Conventional Memory :",CR,LF
+0060 U 0000 "Upper Memory :",CR,LF
+0061 U 0000 "Total FREE : %1 %2 ",CR,LF
+0062 U 0000 "FREE",0
+0063 U 0000 " Name Size in Decimal Size in Hex",CR,LF
+0064 U 0000 "------------- --------------------- -------------",CR,LF
+0065 U 0000 "Total bytes available to programs (Conventional+Upper) : %1 %2",CR,LF
+0066 U 0000 "Largest executable program size : %1 %2",CR,LF
+0067 U 0000 "Largest available upper memory block : %1 %2",CR,LF
+0068 U 0000 "Too much of memory fragmentation; MEM /C cannot be done",CR,LF
+0069 U 0000 "SYSTEM",0
+0070 U 0000 "Total bytes available to programs : %1 %2",CR,LF
+0300 U 0000 "Displays the amount of used and free memory in your system.",CR,LF,CR,LF
+0301 U 0000 "MEM [/PROGRAM | /DEBUG | /CLASSIFY]",CR,LF,CR,LF
+0302 U 0000 " /PROGRAM or /P Displays status of programs currently loaded in memory.",CR,LF
+0303 U 0000 " /DEBUG or /D Displays status of programs, internal drivers, and other",CR,LF
+ " information.",CR,LF
+0304 U 0000 " /CLASSIFY or /C Classifies programs by memory usage. Lists the size of",CR,LF
+ " programs, provides a summary of memory in use, and lists",CR,LF
+ " largest memory block available.",CR,LF
+MSBIO 00008f0b 0023
+0003 U 0000 13,10,"Unrecognized command in CONFIG.SYS"
+0004 U 0000 13,10,"$"
+0005 U 0000 13,10,"Sector size too large in file $"
+0006 U 0000 13,10,"Bad or missing $"
+0007 U 0000 "Command Interpreter",0
+0008 U 0000 13,10,"Invalid country code or code page",13,10,"$"
+0009 U 0000 13,10,"Error in COUNTRY command",13,10,"$"
+0010 U 0000 13,10, "Insufficient memory for COUNTRY.SYS file",13,10,"$"
+0011 U 0000 13,10,"Configuration too large for memory",13,10,"$"
+0012 U 0000 13,10,"Too many block devices",13,10,"$"
+0013 U 0000 13,10,"Invalid STACK parameters",13,10,"$"
+0014 U 0000 13,10,"Incorrect order in CONFIG.SYS line ","$"
+0015 U 0000 "Error in CONFIG.SYS line ","$"
+0016 U 0000 13,10,"Memory allocation error ","$"
+0017 U 0001 0DH,0AH,7,0DH,0AH, "Internal stack overflow",0DH,0AH
+ "System halted",0DH,0AH,"$"
+0018 U 0000 "HMA not available : Loading DOS low",13,10,"$"
+0019 U 0000 13,10,"failed to boot - missing local driver $"
+0020 U 0000 13,10,"Insert diskette for drive "
+0021 U 0000 "A: and press any key when ready",13,10,10,0
+0022 U 0000 13,10,"Bad command or parameters - $"
+0023 U 0000 "Fatal Error:Cannot allocate Memory for DOS", 13, 10, "$"
+0024 U 0000 "WARNING! Logical drives past Z: exist and will be ignored",13,10,"$"
+0025 U 0000 "This version of DOS will boot only on IBM machines",13,10,0
+MSDOS 0000945b 0007
+0001 U 0001 13,10,"Divide overflow",13,10
+0002 U 0002 "y"
+0003 U 0002 "n"
+0004 U 0003 13,10,"A20 Hardware Error",13,10,"$"
+0005 U 0000 "Y"
+0006 U 0000 "N"
+0007 U 0000 "You must have the file WINA20.386 in the root of your boot drive",13,10
+ "to run Windows in Enhanced Mode",13,10
+NLSFUNC 00009594 0003
+0300 U 0000 "Loads country-specific information.",CR,LF,CR,LF
+0301 U 0000 "NLSFUNC [[drive:][path]filename]",CR,LF,CR,LF
+0302 U 0000 " [drive:][path]filename Specifies the file containing country-specific",CR,LF
+ " information.",CR,LF
+SHARE 000096b8 0005
+0003 U 0000 "SHARE cannot be installed under DOSSHELL.",CR,LF
+0300 U 0000 "Installs file-sharing and locking capabilities on your hard disk.",CR,LF,CR,LF
+0301 U 0000 "SHARE [/F:space] [/L:locks]",CR,LF,CR,LF
+0302 U 0000 " /F:space Allocates file space (in bytes) for file-sharing information.",CR,LF
+0303 U 0000 " /L:locks Sets the number of files that can be locked at one time.",CR,LF
diff --git a/private/mvdm/dos/v86/redir/asmmacro.inc b/private/mvdm/dos/v86/redir/asmmacro.inc
new file mode 100644
index 000000000..b85f59aba
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/asmmacro.inc
@@ -0,0 +1,242 @@
+;++
+;
+;Copyright (c) 1991 Microsoft Corporation
+;
+;Module Name:
+;
+; asmmacro.inc
+;
+;Abstract:
+;
+; Contains macros to extend masm functionality:
+;
+; jmpc
+; jmpnc
+; jmpne
+; jmps
+; _mkjmp
+;
+;
+;Author:
+;
+; Richard L Firth (rfirth) 24-Sep-1991
+;
+;Environment:
+;
+; DOS application mode only
+;
+;Revision History:
+;
+; 24-Sep-1991 rfirth
+; Created
+;
+;--
+
+
+
+DEFINED_BIT=020h
+;ISDEFINED equ %(.type <thing> and DEFINED_BIT)
+LABEL_DEFINED equ <(.type &label and DEFINED_BIT)>
+
+DEBUG_MACROS = 0
+;DEBUG_MACROS = 1
+
+
+;*** jmpa
+;*
+;* jump to label if above. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpa macro label
+ _mkjmp ja,jna,&label
+endm
+
+;*** jmpc
+;*
+;* jump to label if below. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpb macro label
+ _mkjmp jb,jnb,&label
+endm
+
+;*** jmpc
+;*
+;* jump to label if carry flag set. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpc macro label
+ _mkjmp jc,jnc,&label
+endm
+
+
+
+;*** jmpnc
+;*
+;* jump to label if carry flag NOT set. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpnc macro label
+ _mkjmp jnc,jc,&label
+endm
+
+
+
+;*** jmpne
+;*
+;* jump to label if zero flag NOT set. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpne macro label
+ _mkjmp jne,je,&label
+endm
+
+
+
+;*** jmpe
+;*
+;* jump to label if zero flag set. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmpe macro label
+ _mkjmp je,jne,&label
+endm
+
+
+
+;*** jmps
+;*
+;* jump to label. Label can be short (+129, -126 from
+;* the first byte of the current jump instruction, if it is a short - ie
+;* byte - jump) or near
+;*
+;* ENTRY label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+jmps macro label
+ local dist
+
+dist=&label-$
+
+if DEBUG
+ jmp &label
+else
+if (.type label and DEFINED_BIT)
+if ((dist gt 129) or (dist lt -126))
+ jmp &label
+else
+ jmp short &label
+endif
+else
+ jmp &label
+endif
+endif
+
+endm
+
+
+
+;*** _mkjmp
+;*
+;* Make a jmp<?> macro. Generate instruction sequence for jump with or
+;* without conditional test. Jump may be short (+127/-128 bytes) or near
+;* (+32767/-32768 bytes)
+;*
+;* ENTRY is - short jump instruction
+;* in - near jump instruction
+;* label - to jump to
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+_mkjmp macro is, in, label
+ local l
+
+if DEBUG
+ &in l
+ jmp &label
+else
+ &is &label
+endif
+
+l:
+
+endm
diff --git a/private/mvdm/dos/v86/redir/debugmac.inc b/private/mvdm/dos/v86/redir/debugmac.inc
new file mode 100644
index 000000000..45fe236e5
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/debugmac.inc
@@ -0,0 +1,356 @@
+;++
+;
+;Copyright (c) 1991 Microsoft Corporation
+;
+;Module Name:
+;
+; debugmac.inc
+;
+;Abstract:
+;
+; Contains debugging macros:
+;
+; DbgBreakPoint
+; DbgUnsupported
+; DbgDEBUG
+; DbgPrint
+; DbgPrintTty
+; DbgPrintString
+; DbgPrintHexDword
+; DbgPrintHexWord
+; DbgPrintHexByte
+; DbgPrintNearPointer
+; DbgPrintFarPointer
+;
+;Author:
+;
+; Richard L Firth (rfirth) 13-Sep-1991
+;
+;Environment:
+;
+; DOS application mode only
+;
+;[Notes:]
+;
+; optional-notes
+;
+;Revision History:
+;
+; 13-Sep-1991 rfirth
+; Created
+;
+;--
+
+
+;*** DbgBreakPoint
+;*
+;* Same as NT routine of same name. No-op in non-DEBUG version
+;*
+;* ENTRY
+;*
+;* EXIT
+;*
+;* RETURNS
+;*
+;* ASSUMES
+;*
+;***
+
+DbgBreakPoint macro
+if DEBUG
+ int 3
+endif
+endm
+
+;*** DbgUnsupported
+;*
+;* Causes the 32-bit support code to display a message about an unsupported
+;* service code, and dumps the 16-bit registers. Used to discover when an
+;* unsupported int 2f/11 call or int 21/5f call is being made
+;*
+;* ENTRY
+;*
+;* EXIT
+;*
+;* RETURNS
+;*
+;* ASSUMES
+;*
+;***
+
+DbgUnsupported macro
+if DEBUG
+ SVC -1
+endif
+endm
+
+;*** DbgDEBUG
+;*
+;* Prints the string "DEBUG: " to console using Bios Int 10h/ah=0eh
+;*
+;* ENTRY nothing
+;*
+;* EXIT nothing
+;*
+;* USES ax
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgDEBUG macro
+ mov ax,(14 shl 8) + 'D'
+ int 10h
+ mov al,'E'
+ int 10h
+ mov al,'B'
+ int 10h
+ mov al,'U'
+ int 10h
+ mov al,'G'
+ int 10h
+ mov al,':'
+ int 10h
+ mov al,' '
+ int 10h
+endm
+
+
+
+;*** DbgCrLf
+;*
+;* Prints CR,LF to console using Bios Int 10h/ah=0eh
+;*
+;* ENTRY nothing
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgCrLf macro
+ push ax
+ mov ax,(14 shl 8) + 13
+ int 10h
+ mov al,10
+ int 10h
+ pop ax
+endm
+
+
+
+;*** DbgPrint
+;*
+;* Prints an ASCIZ string to console using Bios Int 10h
+;*
+;* ENTRY string - address of ASCIZ string to print
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrint macro string
+if DEBUG ;; no macro if not debug version
+ pushf ;; save regs used by DbgPrintTty
+ push ax
+ push bx
+ push si
+ push ds
+ mov ax,seg string
+ mov ds,ax
+ mov si,offset string;; ds:si = address of string
+ DbgPrintTty ;; display it on console
+ pop ds
+ pop si
+ pop bx
+ pop ax
+ popf
+endif
+endm
+
+
+
+;*** DbgPrintTty
+;*
+;* Prints an ASCIZ string in ds:si to console using Bios Int 10h
+;*
+;* ENTRY page - if present defines which Bios video page to use
+;* Defaults to 0
+;* ds:si - address of ASCIZ string to print
+;*
+;* EXIT nothing
+;*
+;* USES al, bh, si, flags
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrintTty macro page
+ local l1,l2
+
+if DEBUG ;; no macro if not debug version
+ mov ah,14 ;; Bios Int write character as TTY function
+ifb <page>
+ sub bh,bh
+else
+ mov bh,page
+endif
+ cld ;; autoincrement lodsb
+l1: lodsb ;; al := next character; si := next character addr
+ or al,al ;; eof string?
+ jz l2 ;; yes
+ int 10h ;; display it to console
+ jmp short l1 ;; go round again
+l2:
+endif
+endm
+
+
+
+;*** DbgPrintString
+;*
+;* Prints a string to console using Bios Int 10h. Note that this macro
+;* does not do printf style substitutions. The string "DEBUG: " will be
+;* displayed if the banner parm is not blank
+;*
+;* ENTRY string - character string. Needn't be zero-terminated
+;* banner - the "DEBUG: " banner will be printed if not blank
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrintString macro string, banner
+ local s1
+ local l1
+
+if DEBUG ;; no macro if not debug version
+ jmp short l1
+s1 db &string,0
+l1: pushf ;; don't destroy direction flag
+ pusha ;; save gp regs
+ifb <banner>
+ DbgDEBUG ;; Display "DEBUG: "
+endif
+ push ds ;; save user's data seg
+ push cs
+ pop ds ;; ds == cs
+ mov si,offset cs:s1 ;; si := string offset
+ DbgPrintTty ;; display ds:si to console
+ pop ds ;; restore user's data seg
+ popa ;; restore gp regs
+ popf ;; restore direction flag+
+endif
+endm
+
+
+
+;*** DbgPrintHexDword
+;*
+;* Prints a dword to console in hex notation using Bios Int 10h
+;*
+;* ENTRY dword - dword to print
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrintHexDword macro dword
+if DEBUG ;; no macro if not debug version
+ DbgPrint <"DbgPrintHexDword not implemented yet",13,10>
+endif
+endm
+
+
+
+;*** DbgPrintHexWord
+;*
+;* Prints a word to console in hex notation using Bios Int 10h
+;*
+;* ENTRY word - to print. Can be memory or register
+;*
+;* EXIT nothing
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrintHexWord macro word
+ local l1, l2
+if DEBUG ;; no macro if not debug version
+ pushf ;; don't use any registers
+ push ax
+ push cx
+ push dx
+ifdifi <word>,<ax>
+ mov ax,word
+endif
+ mov cx,4
+l1: rol ax,4
+ mov dx,ax
+ and al,0fh
+ cmp al,9
+ jle l2
+ add al,'a'-('9'+1)
+l2: add al,'0'
+ mov ah,14
+ int 10h
+ mov ax,dx
+ loop l1
+ pop dx
+ pop cx
+ pop ax
+ popf
+endif
+endm
+
+
+
+;*** DbgPrintHexByte
+;*
+;* Prints a string to console using Bios Int 10h. Note that this macro
+;* does not do printf style substitutions
+;*
+;* ENTRY string - character string. Needn't be zero-terminated
+;*
+;* EXIT
+;*
+;* USES nothing
+;*
+;* ASSUMES 286+
+;*
+;***
+
+DbgPrintHexByte macro byte
+if DEBUG ;; no macro if not debug version
+ DbgPrint <"DbgPrintHexByte not implemented yet",13,10>
+endif
+endm
+
+
+
+DbgPrintNearPointer macro nearptr
+endm
+
+
+
+DbgPrintFarPointer macro farptr
+endm
diff --git a/private/mvdm/dos/v86/redir/enumapis.inc b/private/mvdm/dos/v86/redir/enumapis.inc
new file mode 100644
index 000000000..5aca2a3e9
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/enumapis.inc
@@ -0,0 +1,67 @@
+;****************************************************************
+;** Microsoft LAN Manager *
+;** Copyright(c) Microsoft Corp., 1990 *
+;****************************************************************
+;*** enumapis.h
+;*
+;* This file contains the subfunctions for the loadable APIs in the
+;* REDIR 1.5 project
+;
+REDIRBASEFUNCTION EQU 5f00H
+BADFUNCTION EQU 0FFFFH
+UseWkstaPass EQU 80H
+Local_API_ReturnMode EQU 00H
+Local_API_SetMode EQU 01H
+Local_API_GetAsgList EQU 02H
+Local_API_Define EQU 03H
+Local_API_BREAK_MAC EQU 04H
+Local_API_GetAsgList2 EQU 05H
+Local_API_RedirGetVersion EQU 30H
+Local_API_NetWkstaSetUID EQU 31H
+Local_API_DosQNmPipeInfo EQU 32H
+Local_API_DosQNmPHandState EQU 33H
+Local_API_DosSetNmPHandState EQU 34H
+Local_API_DosPeekNmPipe EQU 35H
+Local_API_DosTransactNmPipe EQU 36H
+Local_API_DosCallNmPipe EQU 37H
+Local_API_DosWaitNmPipe EQU 38H
+Local_API_DosRawReadNmPipe EQU 39H
+Local_API_DosRawWriteNmPipe EQU 3aH
+Local_API_NetHandleSetInfo EQU 3bH
+Local_API_NetHandleGetInfo EQU 3cH
+Local_API_NetTransact EQU 3dH
+Local_API_NetSpecialSMB EQU 3eH
+Local_API_NetIRemoteAPI EQU 3fH
+Local_API_NetMessageBufferSend EQU 40H
+Local_API_NetServiceEnum EQU 41H
+Local_API_NetServiceControl EQU 42H
+Local_API_DosPrintJobGetID EQU 43H
+Local_API_NetWkstaGetInfo EQU 44H
+Local_API_NetWkstaSetInfo EQU 45H
+Local_API_NetUseEnum EQU 46H
+Local_API_NetUseAdd EQU 47H
+Local_API_NetUseDel EQU 48H
+Local_API_NetUseGetInfo EQU 49H
+Local_API_NetRemoteCopy EQU 4aH
+Local_API_NetRemoteMove EQU 4bH
+Local_API_NetServerEnum EQU 4cH
+Local_API_DosMakeMailslot EQU 4dH
+Local_API_DosDeleteMailslot EQU 4eH
+Local_API_DosMailslotInfo EQU 4fH
+Local_API_DosReadMailslot EQU 50H
+Local_API_DosPeekMailslot EQU 51H
+Local_API_DosWriteMailslot EQU 52H
+Local_API_NetServerEnum2 EQU 53H
+Local_API_NullTransact EQU 54H
+; NOTE:: Remove_Network_Connections is a private call to allow the
+;* NetSetUserName INT 2F to remove network connections.
+;
+Local_API_Remove_Network_Connections EQU 55H
+; NOTE:: Process_Interrogate is a private call to allow the
+;* redirector to kick itself from INT 28 and INT 8 to process relogon
+;* requests.
+;
+Local_API_Periodic_View_Tasks EQU 56H
+Local_API_Set_LongName EQU 57H
+Local_API_Start_Redir_On_Net EQU 58H
+Local_API_Stop_Redir_per_Net EQU 59H
diff --git a/private/mvdm/dos/v86/redir/fudgedef.inc b/private/mvdm/dos/v86/redir/fudgedef.inc
new file mode 100644
index 000000000..e8503141d
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/fudgedef.inc
@@ -0,0 +1,11 @@
+; this file contains definitions I really need to get from elsewhere, but
+; can't be bothered looking for the nonce. Find 'em when everything;s working
+
+if1
+%out NB: Included fudgedef.inc: Replace with proper includes at my leisure
+endif
+
+cr equ 0dh
+lf equ 0ah
+major_version equ 30 ; of DOS
+LM20_CNLEN equ 15
diff --git a/private/mvdm/dos/v86/redir/int2a.asm b/private/mvdm/dos/v86/redir/int2a.asm
new file mode 100644
index 000000000..4ee536ef9
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/int2a.asm
@@ -0,0 +1,164 @@
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ int2a.asm
+
+Abstract:
+
+ This module contains the int 2a handler for the NT VDM redir TSR
+
+Author:
+
+ Richard L Firth (rfirth) 29-Oct-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+endif
+
+
+
+.xlist
+.xcref
+include rdrsvc.inc ; SVC
+include debugmac.inc ; debug display macros
+include segorder.inc ; load order of 'redir' segments
+.cref
+.list
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+ public Old2aHandler
+Old2aHandler dd ?
+
+; *** Int2aHandler
+; *
+; * Handles int 2a requests, in which we pretend to be minses and any
+; * other missing parts of the net stack
+; *
+; * ENTRY function code in ah:
+; * ah = 0, return ah = 1
+; * ah = 1, Cooked NetBIOS call
+; * ah = 4, al = 0, same as ah = 1
+; * al = 1, Raw NetBIOS call
+; * al = 2, unknown function; we don't handle it
+; * See doslan\minses\int2a.inc in LANMAN
+; * project for details
+; * ah = 5, Get Adapter Resources. Returns in CX number of
+; * available NCBs and in DX the number of available
+; * sessions. We don't (as yet) handle this
+; *
+; * es:bx = NCB
+; *
+; * EXIT See above
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+ public Int2aHandler
+Int2aHandler proc near
+ or ah,ah ; installation check
+ jz increment_ah_and_return
+
+;
+; not installation. Check for cooked/raw netbios calls
+;
+
+ cmp ah,1
+ je cooked
+ cmp ah,4
+ je cooked_or_raw
+ cmp ah,5
+ je get_adapter_resources
+
+;DbgPrintString "Int2aHandler: unrecognized request: "
+;DbgPrintHexWord ax
+;DbgCrLf
+
+;
+; the call is not for us - chain to the next Int 2A handler
+;
+
+chain_next_handler:
+ DbgUnsupported
+ jmp Old2aHandler
+
+
+cooked_or_raw:
+ or al,al ; ax = 0x0400?
+ jz cooked ; yes - cooked
+ cmp al,1 ; ax = 0x0401?
+ je raw ; yes - raw
+ cmp al,2 ; ax = 0x0402?
+ jne chain_next_handler ; yes - same as raw; no - chain next
+
+;
+; raw request: just call NetBios via INT 5C and set ah dependent upon whether
+; an error was returned from NetBios
+;
+
+raw: int 5ch
+ sub ah,ah
+ or al,al
+ jz @f
+
+increment_ah_and_return:
+ inc ah
+@@: iret
+
+get_adapter_resources:
+ mov ax,1
+ mov bx,16
+ mov cx,128
+ mov dx,64
+ iret
+
+;
+; 'cooked' call: this tries to convert synchronous NetBios calls to asynchronous
+; then spins & beeps until the command has completed. Some commands are retried
+; for a certain time or number of retries
+;
+
+;
+; there is no justification for doing the 'cooked' processing that MINSES proper
+; performs: The cooked processing is mainly to give the poor DOS user peace of
+; mind when his machine seems dead, by occasionally beeping in a meaningful
+; manner. Since we can terminate DOS sessions with impunity, there seems little
+; point in letting the user know the machine is still alive, or retrying commands
+; for that matter. However, that may change...
+;
+
+cooked:
+ DbgUnsupported
+ jmp short raw ; fudge it for now
+
+Int2aHandler endp
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/int5c.asm b/private/mvdm/dos/v86/redir/int5c.asm
new file mode 100644
index 000000000..0cc3b274d
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/int5c.asm
@@ -0,0 +1,418 @@
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ int5c.asm
+
+Abstract:
+
+ This module contains the int 5c handler for the NT VDM redir TSR
+
+Author:
+
+ Colin Watson (colinw) 5-Dec-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Dec-1991 colinw
+ Created
+
+--*/
+endif
+
+
+
+.xlist
+.xcref
+include debugmac.inc ; debug display macros
+include segorder.inc ; load order of 'redir' segments
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include int5c.inc ; Int to be used for pseudo network adapter
+include asmmacro.inc ; jumps which may be short or near
+include vrdlctab.inc ; VDM_REDIR_DOS_WINDOW
+.cref
+.list
+
+.286 ; all code in this module 286 compatible
+
+;
+; Misc. local manifests
+;
+
+NETBIOS_STACK_SIZE equ 256
+
+ResidentDataStart
+NetbiosStack db NETBIOS_STACK_SIZE dup( 0 )
+NetbiosStackTop label word
+ResidentDataEnd
+
+pic1 equ 20h
+pic2 equ 0a0h
+
+;
+; The CCB1 definition
+;
+
+CCB struc
+
+CCB_ADAPTER db ?
+CCB_COMMAND db ?
+CCB_RETCODE db ?
+CCB_WORK db ?
+CCB_POINTER dd ?
+CCB_CMD_CMPL dd ?
+CCB_PARM_TAB dd ?
+
+CCB ends
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+ public Old5cHandler
+Old5cHandler dd ?
+ public OldNetworkHandler
+OldNetworkHandler dd ?
+
+
+; *** VDM REDIR INFO WINDOW
+; *
+; * ABSTRACT:
+; * Used to share data structures between VDM device driver
+; * in 32-bit mode and DOS-VDM. This data structure must be
+; * excactly same as VDM_REDIR_DOS_WINDOW struct in vdmredir.h.
+; *
+; ***
+ public dwPostRoutineAddress
+dwPostRoutineAddress: ; async post routine address
+ VDM_REDIR_DOS_WINDOW <>
+
+; *** Int5cHandler
+; *
+; * Handles int 5c requests, in which we redirect work to netapi.dll
+; *
+; * ENTRY es:bx = Address of NCB or DLC CCB, if the
+; * first byte less than 10H.
+; *
+; * EXIT al = NCB_RETCODE for NCB's
+; *
+; * RETURNS nothing
+; *
+; * USES nothing
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+ public Int5cHandler
+Int5cHandler proc near
+
+;
+; Perform a BOP into 32 bit mode to process the request.
+; It's DLC if the first byte in ES:BX is less than 10h.
+;
+
+ sti ; enable hw interrupts
+ cmp byte ptr es:[bx], 10H
+ jb call_dlc_5c
+
+;
+; deferred loading: if this call is from (presumably) DOSX checking to see if
+; the 5C support is loaded, return the expected error without calling Netbios
+; for real: this allows us to continue installation without having to load
+; VDMREDIR.DLL until it is really required
+;
+
+ cmp byte ptr es:[bx],7fh ; NETBIOS presence check
+ je @f
+ cmp byte ptr es:[bx],0ffh ; async NETBIOS presence check
+ je @f
+ SVC SVC_NETBIOS5C
+ iret
+@@: mov al,3 ; INVALID COMMAND error
+ mov es:[bx].ncb_retcode,al ; returned in NCB_RETCODE && al
+ mov es:[bx].ncb_cmd_cplt,al ; and NCB_CMD_CPLT
+ iret
+
+;
+; call is for DLC. DLC does not return anything in registers. Command completion
+; is either via an 'appendage' (call-back to you and me) or by the app polling
+; the CCB_RETCODE field of the CCB in ES:BX for a change from 0xFF
+;
+
+call_dlc_5c:
+
+;
+; BOP into 32-bit DOS DLC emulator. This will return in AL the status of the
+; CCB request: 0xFF if the command will complete asynchronously, else a
+; synchrnous completion code
+;
+
+ SVC SVC_DLC_5C
+
+;
+; if the CCB completed (synchronously) and there is an 'appendage' (who do IBM
+; have writing this stuff?) then we must call it. We check the return code in
+; AL since the return in the CCB may be the final code (ie already changed by
+; the asynchronous completion thread in 32-bit DOS DLC emulator)
+;
+
+ cmp al,0ffh ; is the command active?
+ je @f ; yes - return to the app
+
+;
+; the 32-bit DOS DLC emulator returned a synchronous completion code. We
+; complete the CCB by calling the 'appendage'. The appendage is pointed at
+; by the CCB_CMD_CMPL field in the CCB. If this field is 0:0 then the app
+; has not provided an 'appendage' and will periodically look at the CCB_RETCODE
+; field until the 32-bit emulator's asynchronous completion thread writes
+; something there other than 0xFF
+;
+
+ pusha ; save caller's registers
+ mov cx,word ptr es:[bx].CCB_CMD_CMPL
+ or cx,word ptr es:[bx].CCB_CMD_CMPL[2]
+ jz no_go
+
+;
+; we have an appendage. The manual says: cx=adapter #, es:bx=CCB, ss:sp=stack (!)
+; cs=appendage cs (!!). Simulate an interrupt (ints off - that's what it says)
+;
+
+ mov cl,byte ptr es:[bx].CCB_ADAPTER
+ xor ch,ch
+ xor ah,ah
+ pushf ; simulate INT
+ cli ; all ints are off
+ call dword ptr es:[bx].CCB_CMD_CMPL
+
+;
+; appendage irets here, we restore the caller's registers and wend our merry
+; walker
+;
+
+no_go: popa ; restore caller's context
+@@: iret
+
+Int5cHandler endp
+
+; *** IntNetworkHandler
+; *
+; * Handles int Network requests, in which we redirect work to netapi.dll
+; *
+; * NOTE: !!! This routine is NOT re-entrant: it sets up a new stack !!!
+; *
+; * ENTRY nothing
+; *
+; * EXIT nothing
+; *
+; * RETURNS nothing
+; *
+; * USES nothing
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+ even
+
+InterruptedStack dd ?
+
+if DEBUG
+ReEntered db 0
+endif
+
+ public IntNetworkHandler
+IntNetworkHandler proc near
+
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+if DEBUG
+ cmp ReEntered,0
+ jne __re_entry
+ inc ReEntered
+ jmps @f
+
+__re_entry:
+ DbgPrintString <"ERROR: IntNetworkHandler re-entered",13,10>
+ push ds
+ push es
+ push ax
+ sub ax,ax
+ dec ax
+ mov ds,ax ; ds = es = -1 signals re-entrancy
+ mov es,ax
+ DbgUnsupported
+ DbgBreakPoint
+ pop ax
+ pop es
+ pop ds
+@@:
+endif
+
+;
+; Switch stacks and call the post routine
+;
+
+ push ax ; interrupted ax on interrupted stack
+; push dx ; dx
+ mov word ptr InterruptedStack,sp
+ mov word ptr InterruptedStack[2],ss
+ mov ax,seg NetbiosStack
+ mov ss,ax
+ mov sp,offset NetbiosStackTop
+
+;
+; perform a BOP into 32 bit mode to process the request.
+;
+; 32 bit code returns:
+;
+; ZF = 0, CF = 0 nothing to do (2 jumps)
+; ZF = 0, CF = 1 async named pipe post processing (1 jump)
+; ZF = 1, CF = 0 DLC post processing (1 jump)
+; ZF = 1, CF = 1 NCB post processing (0 jumps)
+;
+; CAVEAT: if we extend this interface to have >3 options + do nothing, then
+; we need to change to setting a value in a (unused) register (bp?)
+;
+
+ pusha ; rest of interrupted registers on our stack
+ push ds
+ push es
+ SVC SVC_NETBIOS5CINTERRUPT
+ jmpne nothing_or_nmpipe
+ jmpnc dlc_processing
+
+;
+; Call post routine, it returns with IRET => push flags to stack.
+; We must not change any registers between BOP and post routine!
+; Note: NCB post processing is currently on fastest path. May need
+; to change to DLC. Check it out in performance phase
+;
+
+ pushf ; fake interrupt call
+ call es:[bx].ncb_post
+ jmps exit_IntNetworkHandler
+
+nothing_or_nmpipe:
+ jmpnc exit_IntNetworkHandler
+
+;
+; default is async named-pipe processing. The BOP handler returns us the
+; following:
+; AL = 0 => ordinary (not AsyncNmPipe2) call
+; AL != 0 => call is DosReadAsyncNmPipe2 or DosWriteAsyncNmPipe2
+; CX:BX = address of ANR
+; DS:SI = address of data buffer
+; ES:DI = 'semaphore' handle for AsyncNmPipe2 call
+;
+; if the async name pipe function call didn't specify a semaphore, then don't
+; push anything to stack since the ANR itself knows how many parameters will
+; be on the stack. We expect it to ret n
+;
+
+ DbgPrintString <"AsyncNmPipe callback!", 13, 10>
+ or al,al
+ jz @f
+ push es ; semaphore handle for type2 calls
+ push di
+@@: push ds ; buffer address
+ push si
+
+;
+; the ANR is a pascal function which will clean the stack before returning. We
+; push the ANR address and fake a far call. The ANR will return to
+; exit_IntNetworkHandler. We futz the stack anyway, so we may as well avoid
+; an extra jump
+;
+
+ push cs ; store far return addr on the stack
+ push offset exit_IntNetworkHandler
+ push cx ; fake far call to ANR
+ push bx
+ retf
+
+;
+; DLC post processing: 32-bit code has set relevant registers and put post
+; routine address in dwPostRoutineAddress. Must make sure that post address
+; (ie 'appendage' address) is not 0:0
+;
+
+dlc_processing:
+ cmp word ptr dwPostRoutineAddress,0
+ jne @f
+ cmp word ptr dwPostRoutineAddress[2],0
+ je exit_IntNetworkHandler ; huh?
+
+;
+; there is a non-zero post routine address set in the BOP. Simulate an
+; interrupt into the post routine (appendage)
+;
+
+@@: pushf ; fake interrupt call
+; cli ; manual says ints off
+ call dword ptr dwPostRoutineAddress
+
+;
+; restore the interrupted registers and stack
+;
+
+exit_IntNetworkHandler:
+ pop es
+ pop ds
+ popa
+ mov ss,word ptr InterruptedStack[2]
+ mov sp,word ptr InterruptedStack
+; pop dx ; interrupted dx
+
+;;
+;; re-enable the 8259s
+;;
+;
+; mov al,20h
+;
+;;
+;; Edge triggered assuming interrupt on slave pic as per the AT
+;;
+;
+; out pic2,al ; EOI pic 2
+; out pic1,al ; EOI pic 1
+;
+;;
+;; Level triggered assuming interrupt on slave pic
+;;
+;; out pic1,al ; EOI pic 1
+;; out pic2,al ; EOI pic 2
+;
+;;
+;; assuming interrupt on master pic
+;; out pic1,al ; EOI pic 1
+;;
+
+ pop ax ; interrupted ax
+
+if DEBUG
+ dec ReEntered
+endif
+
+ SVC SVC_RDRINTACK2
+ iret ; back to interrupted code
+; jmp dword ptr OldNetworkHandler
+IntNetworkHandler endp
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/int5c.inc b/private/mvdm/dos/v86/redir/int5c.inc
new file mode 100644
index 000000000..f65a54f0c
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/int5c.inc
@@ -0,0 +1,62 @@
+
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ int5c.inc
+
+Abstract:
+
+ This module contains the int 5c/Netbios equates
+
+Author:
+
+ Colin Watson (colinw) 5-Dec-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Dec-1991 colinw
+ Created
+
+--*/
+endif
+
+;
+; Use Irql 14 (normally the hard disk drive) to pretend to be Irql used by the network
+; adapter. Irql 14 is not used for the disk in the emulation system. Utilizing 14 means
+; that there will be no clash of interrupts with user supplied virtual devices.
+;
+
+NETWORK_INTERRUPT equ 76h
+
+;
+; Network Control Block
+;
+
+NCBNAMSZ equ 16
+
+ncb struc
+ ncb_command db ? ; command code
+ ncb_retcode db ? ; return code
+ ncb_lsn db ? ; local session number
+ ncb_num db ? ; number of our network name
+ ncb_buffer dd ? ; address of message buffer
+ ncb_length dw ? ; size of message buffer
+ ncb_callname db NCBNAMSZ dup (?) ; blank-padded name of remote
+ ncb_name db NCBNAMSZ dup (?) ; our blank-padded netname
+ ncb_rto db ? ; rcv timeout/retry count
+ ncb_sto db ? ; send timeout/sys timeout
+ ncb_post dd ? ; Async notification handle
+ ncb_lana_num db ? ; lana (adapter) number
+ ncb_cmd_cplt db ? ; 0xff => commmand pending
+ ncb_reserve db 14 dup (?) ; reserved, used by BIOS
+ncb ends
diff --git a/private/mvdm/dos/v86/redir/localmac.inc b/private/mvdm/dos/v86/redir/localmac.inc
new file mode 100644
index 000000000..58910ced6
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/localmac.inc
@@ -0,0 +1,80 @@
+;++
+;
+;Copyright (c) 1991 Microsoft Corporation
+;
+;Module Name:
+;
+; localmac.inc
+;
+;Abstract:
+;
+; Contains various macros to get around various things:
+;
+; DosCallBack
+;
+;
+;Author:
+;
+; Richard L Firth (rfirth) 27-Sep-1991
+;
+;Environment:
+;
+; DOS application mode only
+;
+;Revision History:
+;
+; 24-Sep-1991 rfirth
+; Created
+;
+;--
+
+
+
+;*** DosCallBack
+;*
+;* Call back into DOS via the int 2f/ah=12 back door. If CALL_DOS defined,
+;* use a call, else s/w interrupt. Using a call means no other TSRs etc.
+;* which load AFTER the redir can hook it, but we DON'T HAVE TO MAKE A
+;* PRIVILEGE TRANSITION ON x86 which speeds things up. This should be safe,
+;* because no other s/w should really be hooking INT 2F/AH=12
+;*
+;* ENTRY FunctionNumber - dispatch code goes in al
+;* DosAddr - if present, variable containing address of
+;* DOS int 2f entry point
+;* OldMultHandler - this variable contains the address of DOSs
+;* int 2f back door. Specific to redir code
+;*
+;* EXIT nothing
+;*
+;* USES ax, OldMultHandler
+;*
+;* ASSUMES nothing
+;*
+;***
+
+DosCallBack macro FunctionNumber, DosAddr
+ mov ax,(MultDOS shl 8) + FunctionNumber
+ifdef CALL_DOS
+ pushf
+ifb <DosAddr>
+if (((.type OldMultHandler) and 32) eq 0) ;; OldMultHandler not defined
+ extrn OldMultHandler:dword
+endif
+ call OldMultHandler
+else
+ call DosAddr
+endif
+else
+ int 2fh
+endif
+endm
+
+
+
+;
+; defines for DosCallBack FunctionNumbers
+;
+
+SF_FROM_SFN = 22
+GET_USER_STACK = 24
+PJFN_FROM_HANDLE= 32
diff --git a/private/mvdm/dos/v86/redir/mailslot.asm b/private/mvdm/dos/v86/redir/mailslot.asm
new file mode 100644
index 000000000..990d833c8
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/mailslot.asm
@@ -0,0 +1,338 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ mailslot.asm
+
+Abstract:
+
+ This module contains the resident code part of the stub redir TSR for NT
+ VDM net support. The routines contained herein are the mailslot API stubs:
+
+ DosDeleteMailslot
+ DosMailslotInfo
+ DosMakeMailslot
+ DosPeekMailslot
+ DosReadMailslot
+ DosWriteMailslot
+
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include dossym.inc ; User_<Reg> defines
+include mult.inc ; MultNET
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include syscall.inc ; DOS system call numbers
+include rdrint2f.inc ; redirector Int 2f numbers
+include segorder.inc ; segments
+include enumapis.inc ; dispatch codes
+include debugmac.inc ; DbgPrint macro
+include localmac.inc ; DbgPrint macro
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include sf.inc ; SFT definitions/structure
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+
+; *** DosDeleteMailslot
+; *
+; * Delete a local mailslot. We must also pass in the current PDB. A
+; * Dos process can only delete mailslots which it has previously
+; * created. We pass the PDB in ax, since it only contains a dispatch
+; * vector
+; *
+; * Function = 5F4Eh
+; *
+; * ENTRY BX = Mailslot handle
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * ES:DI = Mailslot buffer address
+; * DX = Mailslot selector
+; *
+; * RETURNS
+; *
+; * USES ax, dx, di, ds, es, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosDeleteMailslot
+DosDeleteMailslot proc near
+ push bx
+ mov ah,51h
+ int 21h ; get current PDB
+ mov ax,bx ; ax := current PDB
+ pop bx ; bx := mailslot handle
+ SVC SVC_RDRDELETEMAILSLOT
+ jc @f
+
+;
+; success - copy returned info in registers to copy of caller's registers in
+; DOS segment
+;
+
+ DosCallBack GET_USER_STACK
+ mov [si].User_Dx,dx
+ mov [si].User_Es,es
+ mov [si].User_Di,di
+ clc
+@@: ret
+DosDeleteMailslot endp
+
+
+
+; *** DosMailslotInfo
+; *
+; * Retrieves local mailslot info
+; *
+; * Function = 5F4Fh
+; *
+; * ENTRY BX = Mailslot handle
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Message size
+; * BX = Mailslot size
+; * CX = Next size
+; * DX = Next priority
+; * SI = Message count
+; *
+; * USES ax, bx, cx, dx, si, ds, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosMailslotInfo
+DosMailslotInfo proc near
+ SVC SVC_RDRGETMAILSLOTINFO
+ jc @f
+ push si ; push returned values on stack
+ push dx
+ push cx
+ push bx
+ push ax
+ DosCallBack GET_USER_STACK ; get caller register frame
+ pop [si].User_Ax ; set caller's registers to returned values
+ pop [si].User_Bx
+ pop [si].User_Cx
+ pop [si].User_Dx
+ pop [si].User_Si
+ clc
+@@: ret
+DosMailslotInfo endp
+
+
+
+; *** DosMakeMailslot
+; *
+; * Creates a local mailslot. We need to pass in the current PDB as a
+; * process identifier (see DosDeleteMailslot). We use ax since this only
+; * contains a dispatch vector
+; *
+; * Function = 5F4Dh
+; *
+; * ENTRY DS:SI = ASCIZ Name of mailslot to create
+; * BX = Message size (hint)
+; * CX = Mailslot size (hint)
+; * DX = Mailslot selector (for WIN 3 protect mode)
+; * ES:DI = User's data buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Mailslot handle
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosMakeMailslot
+DosMakeMailslot proc near
+ push bx
+ mov ah,51h
+ int 21h ; get current PDB
+ mov ax,bx ; ax := current PDB
+ pop bx ; bx := mailslot size
+if 0
+if DEBUG
+ DbgPrintString "DosMakeMailslot: ax="
+ DbgPrintHexWord ax
+ DbgPrintString <13,10," Message size (bx) =">, NO_BANNER
+ DbgPrintHexWord bx
+ DbgPrintString <13,10," Mailslot size (cx) =">, NO_BANNER
+ DbgPrintHexWord cx
+ DbgPrintString <13,10," Mailslot selector (dx) =">, NO_BANNER
+ DbgPrintHexWord dx
+ DbgPrintString <13,10," User buffer (es:di) =">, NO_BANNER
+ DbgPrintHexWord es
+ DbgPrintString ":", NO_BANNER
+ DbgPrintHexWord di
+ DbgPrintString <13,10>,NO_BANNER
+endif
+endif
+ SVC SVC_RDRMAKEMAILSLOT
+ ret
+DosMakeMailslot endp
+
+
+
+; *** DosPeekMailslot
+; *
+; * Reads a message from a mailslot non-destructively
+; *
+; * Function = 5F51h
+; *
+; * ENTRY BX = Mailslot handle
+; * ES:DI = Buffer address
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Bytes read
+; * CX = Next size
+; * DX = Next priority
+; *
+; * USES ax, cx, dx, si, ds, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosPeekMailslot
+DosPeekMailslot proc near
+ SVC SVC_RDRPEEKMAILSLOT
+ jmp short common_peek_read ; jump to common read/peek processing
+DosPeekMailslot endp
+
+
+
+; *** DosReadMailslot
+; *
+; * Reads the next message from a mailslot
+; *
+; * Function = 5F50h
+; *
+; * ENTRY BX = Mailslot handle
+; * ES:DI = Buffer address
+; * DX:CX = Timeout (mSec)
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Bytes read
+; * CX = NextSize
+; * DX = NextPriorty
+; *
+; * USES ax, cx, dx, si, ds, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosReadMailslot
+DosReadMailslot proc near
+ SVC SVC_RDRREADMAILSLOT
+
+;
+; common read/peek mailslot code - if error return else copy following values
+; returned in registers to caller's registers in DOS stack segment
+;
+
+common_peek_read:
+ jc @f ; error - return
+ push dx
+ push cx
+ push ax
+ DosCallBack GET_USER_STACK
+ pop [si].User_Ax ; # bytes read
+ pop [si].User_Cx ; byte size of next message
+ pop [si].User_Dx ; priority of next message
+ clc ; indicate success
+@@: ret
+DosReadMailslot endp
+
+
+
+; *** DosWriteMailslot
+; *
+; * Writes a message to a mailslot. The mailslot is identified by a
+; * symbolic name (even if its local)
+; *
+; * Function = 5F52h
+; *
+; * ENTRY DS:SI = Destination mailslot name
+; * ES:DI = Pointer to DosWriteMailslotStruct:
+; * DWORD Timeout
+; * char far* Buffer
+; * CX = Number of bytes in buffer
+; * DX = Message priority
+; * BX = Message class
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * No error
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosWriteMailslot
+DosWriteMailslot proc near
+ SVC SVC_RDRWRITEMAILSLOT
+ ret
+DosWriteMailslot endp
+
+ResidentCodeEnd
+end
+ \ No newline at end of file
diff --git a/private/mvdm/dos/v86/redir/makefile b/private/mvdm/dos/v86/redir/makefile
new file mode 100644
index 000000000..382278c6c
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/makefile
@@ -0,0 +1,223 @@
+!IF 0
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ makefile
+
+Abstract:
+
+ makefile for Vdm Redir program
+
+Author:
+
+ Richard L Firth (rfirth) 13-Sep-1991
+
+Revision History:
+
+ 13-Sep-1991 rfirth
+ Created
+
+!ENDIF
+
+
+
+.SUFFIXES:
+.SUFFIXES: .asm .h
+
+########## Path definition so we find 16 bit tools ##########
+# Also works around stupid bug in RC 3.1 that doesn't allow rcpp.err to be
+# in a directory that is greater than 128 chars down the path, even if
+# rc 3.1 is running as an OS/2 app.
+
+PATH = $(_NTBINDIR)\private\mvdm\tools16;$(PATH)
+
+#
+# nmake doesn't work properly if we try to stick the objects in obj, so put
+# them in current dir for now. WHEN CHANGE OBJPATH TO BE OBJ, CHANGE clean TOO
+#
+
+#OBJPATH = .
+OBJPATH = obj
+
+ASM = masm
+LINK = link16
+
+#
+# convert NTDEBUG into DEBUG flag. NTDEBUG can be not present or retail, either
+# of which mean no debugging; or ntsd, cvp or sym, which means debugging support
+# required
+#
+!IFNDEF COUNTRY
+COUNTRY=usa
+!ENDIF
+!IFDEF NTDEBUG
+!IF "$(NTDEBUG)" == "retail" || "$(NTDEBUG)" == "ntsdnodbg"
+DEBUGGING=0
+!ELSE
+DEBUGGING=1
+!ENDIF
+!ELSE
+DEBUGGING=0
+!ENDIF
+
+#
+# assembler and linker debugging options
+#
+
+!IF $(DEBUGGING)
+ASMDEBUG = /DDEBUG=1 /Zi
+LINKDEBUG = /CO
+!ELSE
+ASMDEBUG = /DDEBUG=0
+LINKDEBUG =
+!ENDIF
+ASMINC = /I..\inc /I..\..\..\inc
+ASMFLAGS = /Mx
+LINKFLAGS = /MAP /CP:1
+
+#
+# any other non-debug related options (for assembler) go in USERDEFS
+#
+
+USERDEFS = /DCALL_DOS
+
+
+
+#
+# Inference rules - asm to obj, h to inc
+#
+
+.asm{$(OBJPATH)\}.obj:
+ $(ASM) $(ASMINC) $(ASMDEBUG) $(USERDEFS) $<,$@;
+
+.h.inc:
+ h2inc -c $< -o $*.inc
+
+.asm.lst:
+ $(ASM) $(ASMINC) $(ASMDEBUG) $(USERDEFS) /L $<;
+
+
+
+#
+# what it is we're building
+#
+
+TARGET = $(OBJPATH)\redir.exe
+#TARGET = $(OBJPATH)\ntdosnet.exe
+MAPFILE = $(TARGET:.exe=.map)
+DEFFILE = ;
+
+OBJS = $(OBJPATH)\redir.obj \
+ $(OBJPATH)\resident.obj \
+ $(OBJPATH)\namepipe.obj \
+ $(OBJPATH)\mailslot.obj \
+ $(OBJPATH)\netapis.obj \
+ $(OBJPATH)\int2a.obj \
+ $(OBJPATH)\int5c.obj \
+ $(OBJPATH)\neterror.obj \
+ $(OBJPATH)\msgapi.obj
+
+LIBS =
+
+
+
+#
+# how to build it
+#
+
+all: makedir $(TARGET)
+
+$(TARGET): $(OBJS)
+ $(LINK) @<<
+$(OBJS)
+$(TARGET) $(LINKFLAGS) $(LINKDEBUG)
+$(MAPFILE)
+$(LIBS)
+$(DEFFILE)
+<<
+
+#
+# where to put it
+#
+
+ binplace $(TARGET)
+
+#
+# clean build - delete all objs
+#
+
+clean: cleanup all
+
+cleanup:
+ if exist $(OBJPATH)\*.obj del $(OBJPATH)\*.obj
+
+#
+# makedir - ensure the subdirectory for the object files exists
+#
+
+makedir:
+ @-if not exist $(OBJPATH) md $(OBJPATH)
+
+#
+# file dependencies
+#
+
+$(OBJPATH)\redir.obj: \
+ redir.asm \
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ int5c.inc \
+ segorder.inc \
+ redirmsg.inc
+
+$(OBJPATH)\resident.obj:\
+ resident.asm \
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ segorder.inc
+
+$(OBJPATH)\namepipe.obj:\
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ segorder.inc
+
+$(OBJPATH)\mailslot.obj:\
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ segorder.inc
+
+$(OBJPATH)\netapis.obj: \
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ segorder.inc
+
+$(OBJPATH)\int2a.obj: \
+ debugmac.inc \
+ segorder.inc
+
+$(OBJPATH)\int5c.obj: \
+ debugmac.inc \
+ int5c.inc \
+ segorder.inc
+
+$(OBJPATH)\neterror.obj:\
+ enumapis.inc \
+ debugmac.inc \
+ localmac.inc \
+ asmmacro.inc \
+ segorder.inc
+
+redirmsg.inc : $(COUNTRY)\redirmsg.inc
+ copy $(COUNTRY)\redirmsg.inc .
diff --git a/private/mvdm/dos/v86/redir/msgapi.asm b/private/mvdm/dos/v86/redir/msgapi.asm
new file mode 100644
index 000000000..8970f35fe
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/msgapi.asm
@@ -0,0 +1,100 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ msgapi.asm
+
+Abstract:
+
+ This module contains the messenger functions that we marginally support
+ for VDM
+
+ MessengerDispatch
+
+Author:
+
+ Richard L Firth (rfirth) 21-Sep-1992
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include segorder.inc ; segments
+include debugmac.inc ; DbgPrint macro
+include localmac.inc ; DbgPrint macro
+include asmmacro.inc ; language extensions
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include rdrmisc.inc ; miscellaneous definitions
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+.286
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+MessengerDispatchTable label word
+ dw MessageInstalled
+ dw MessageDone
+ dw MessageLogging
+ dw MessageUserFunction
+ dw MessageUnusedFunction
+ dw MessagePauseContinue
+
+LAST_MESSENGER_FUNCTION = (offset $ - offset MessengerDispatchTable)/2 - 1
+
+ public MessengerDispatch
+MessengerDispatch proc near
+ cmp al,LAST_MESSENGER_FUNCTION
+ jbe @f
+ mov al,ERROR_INVALID_PARAMETER
+ stc
+ ret
+@@: cbw
+ push bx
+ mov bx,ax
+ shl bx,1
+ mov ax,MessengerDispatchTable[bx]
+ pop bx
+ jmp ax
+MessengerDispatch endp
+
+MessageInstalled:
+ dec al
+
+MessageDone:
+ ret
+
+MessageLogging:
+MessageUserFunction:
+MessageUnusedFunction:
+MessagePauseContinue:
+; mov ax,ERROR_INVALID_FUNCTION
+ mov ax,2142 ; NERR_InvalidAPI
+ stc
+ retn
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/namepipe.asm b/private/mvdm/dos/v86/redir/namepipe.asm
new file mode 100644
index 000000000..c6dc6c8cb
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/namepipe.asm
@@ -0,0 +1,578 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ namepipe.asm
+
+Abstract:
+
+ This module contains the resident code part of the stub redir TSR for NT
+ VDM net support. The routines contained herein are the named pipe API
+ stubs:
+
+ DosQNmPipeInfo
+ DosQNmpHandState
+ DosSetNmpHandState
+ DosPeekNmPipe
+ DosTransactNmPipe
+ DosCallNmPipe
+ DosWaitNmPipe
+ NetHandleGetInfo
+ NetHandleSetInfo
+ DosReadAsyncNmPipe
+ DosWriteAsyncNmPipe
+ DosReadAsyncNmPipe2
+ DosWriteAsyncNmPipe2
+ (MapNtHandle)
+
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include dossym.inc ; User_<Reg> defines
+include mult.inc ; MultNET
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include syscall.inc ; DOS system call numbers
+include rdrint2f.inc ; redirector Int 2f numbers
+include segorder.inc ; segments
+include enumapis.inc ; dispatch codes
+include debugmac.inc ; DosCallBack macro
+include localmac.inc ; DbgPrint macro
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include sf.inc ; SFT definitions/structure
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+
+; *** DosQNmPipeInfo
+; *
+; * Implements the DosQNmPipeInfo call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F32h
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Buffer size
+; * DX = Info level
+; * DS:SI = Buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * no error
+; * AX = undefined
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosQNmPipeInfo
+DosQNmPipeInfo proc near
+ call MapNtHandle
+ jc @f ; bad handle: ax = error code, cf = 1
+ SVC SVC_RDRQNMPIPEINFO ; BP:BX is 32-bit handle
+@@: ret
+DosQNmPipeInfo endp
+
+
+
+; *** DosQNmpHandState
+; *
+; * Implements the DosQNmpHandState call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F33h
+; *
+; * ENTRY BX = Pipe handle
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Pipe mode:
+; * BSxxxWxRIIIIIIII
+; *
+; * where:
+; * B = Blocking mode. If B=1 the pipe is non blocking
+; * S = Server end of pipe if 1
+; * W = Pipe is written in message mode if 1 (else byte mode)
+; * R = Pipe is read in message mode if 1 (else byte mode)
+; * I = Pipe instances. Unlimited if 0xFF
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosQNmpHandState
+DosQNmpHandState proc near
+ call MapNtHandle
+ jc @f ; bad handle: ax = error code, cf = 1
+ SVC SVC_RDRQNMPHANDSTATE
+@@: ret
+DosQNmpHandState endp
+
+
+
+; *** DosSetNmpHandState
+; *
+; * Implements the DosSetNmpHandState call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F34h
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Pipe mode to set
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Pipe mode set
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosSetNmpHandState
+DosSetNmpHandState proc near
+ call MapNtHandle
+ jc @f ; bad handle: ax = error code, cf = 1
+ SVC SVC_RDRSETNMPHANDSTATE
+@@: ret
+DosSetNmpHandState endp
+
+
+
+; *** DosPeekNmPipe
+; *
+; * Implements the DosPeekNmPipe call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F35h
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Size of buffer for peek
+; * DS:SI = Buffer address
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * AX = Pipe status
+; * BX = Number of bytes peeked into buffer
+; * CX = Number of bytes in pipe
+; * DX = Number of bytes in message
+; * DI = Pipe status
+; * DS:SI = Data peeked
+; *
+; * USES ax, bx, cx, dx, si, di, ds, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosPeekNmPipe
+DosPeekNmPipe proc near
+ call MapNtHandle
+ jc @f ; bad handle: ax = error code, cf = 1
+ SVC SVC_RDRPEEKNMPIPE ; do the 'bop' (makes the lambada look tame)
+ jc @f ; error returned from protect mode
+
+;
+; success - set the user's registers to values returned
+;
+
+ push ax ; pipe status
+ DosCallBack GET_USER_STACK ; Get_User_Stack
+ pop [si].User_Ax ; copy saved return code into user's copy
+ mov [si].User_Bx,bx
+ mov [si].User_Cx,cx
+ mov [si].User_Dx,dx
+ mov [si].User_Di,di
+ clc ; reset cf, just in case
+@@: ret
+DosPeekNmPipe endp
+
+
+
+; *** DosTransactNmPipe
+; *
+; * Implements the DosTransactNmPipe call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F36h
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Transmit buffer length
+; * DX = Receive buffer length
+; * DS:SI = Transmit buffer
+; * ES:DI = Receive buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * CX = Number of bytes in Receive buffer
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosTransactNmPipe
+DosTransactNmPipe proc near
+ call MapNtHandle
+ jc @f ; bad handle: ax = error code, cf = 1
+ SVC SVC_RDRTRANSACTNMPIPE
+ jc @f ; error from protect-mode side
+
+;
+; success - copy returned cx value to user's registers in Dos stack seg
+;
+
+ DosCallBack GET_USER_STACK
+ mov [si].User_Cx,cx
+ clc ; reset carry flag, just in case
+@@: ret
+DosTransactNmPipe endp
+
+
+
+; *** DosCallNmPipe
+; *
+; * Implements the DosCallNmPipe call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F37h
+; *
+; * ENTRY DS:SI = Pointer to CallNmPipe structure:
+; * DWORD Timeout; +0
+; * LPWORD lpBytesRead; +4
+; * WORD OutputBufferLen; +8
+; * LPBYTE OutputBuffer; +10
+; * WORD InputBufferLength; +14
+; * LPBYTE InputBuffer; +16
+; * LPSTR PipeName; +20
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * CX = Bytes received
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosCallNmPipe
+DosCallNmPipe proc near
+ SVC SVC_RDRCALLNMPIPE
+ jc @f ; oops - error
+
+;
+; success - copy returned ByteRead count in cx to user's cx in Dos stack seg
+;
+
+ DosCallBack GET_USER_STACK
+ mov [si].User_Cx,cx
+ clc ; reset carry flag, just in case
+@@: ret
+DosCallNmPipe endp
+
+
+
+; *** DosWaitNmPipe
+; *
+; * Implements the DosWaitNmPipe call by vectoring into the VdmRedir
+; * dispatcher which calls a 32-bit function to do the work
+; *
+; * Function = 5F38h
+; *
+; * ENTRY BX:CX = Timeout
+; * DS:DX = Pipe name
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * No error
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosWaitNmPipe
+DosWaitNmPipe proc near
+ SVC SVC_RDRWAITNMPIPE
+ ret
+DosWaitNmPipe endp
+
+
+
+; *** NetHandleSetInfo
+; *
+; * Function = 5F3Bh
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Buffer length
+; * SI = Level (1)
+; * DI = Parmnum
+; * DS:DX = Buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * Stuff from buffer set
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetHandleSetInfo
+NetHandleSetInfo proc
+ call MapNtHandle
+ jc @f
+ SVC SVC_RDRHANDLESETINFO
+@@: ret
+NetHandleSetInfo endp
+
+
+
+; *** NetHandleGetInfo
+; *
+; * Function = 5F3Ch
+; *
+; * ENTRY BX = Pipe handle
+; * CX = Buffer length
+; * SI = Level (1)
+; * DS:DX = Buffer
+; *
+; * EXIT CX = size of required buffer (whether we got it or not)
+; * CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * indicated stuff put in buffer
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetHandleGetInfo
+NetHandleGetInfo proc
+ call MapNtHandle
+ jc @f
+ SVC SVC_RDRHANDLEGETINFO
+ jc @f
+ DosCallBack GET_USER_STACK
+ mov [si].User_Cx,cx
+ clc
+@@: ret
+NetHandleGetInfo endp
+
+
+
+; *** DosReadAsyncNmPipe/DosReadAsyncNmPipe2
+; * DosWriteAsyncNmPipe/DosWriteAsyncNmPipe2
+; *
+; * Implements the AsyncNmPipe calls. 32-bit DLL does all the work
+; *
+; * Function = int 2fh/ax=1186h (DosReadAsyncNmPipe)
+; * Function = int 2fh/ax=1190h (DosReadAsyncNmPipe2)
+; * Function = int 2fh/ax=118fh (DosWriteAsyncNmPipe)
+; * Function = int 2fh/ax=1191h (DosWriteAsyncNmPipe2)
+; *
+; * ENTRY DS:SI = DosAsyncNmPipeStruct:
+; * DD pBytesRead +0
+; * DW buflen +4
+; * DD pBuffer +6
+; * DD pError +10
+; * DD pAnr +14
+; * DW hPipe +18
+; *
+; * + For DosReadAsyncNmPipe2/DosWriteAsyncNmPipe2
+; * DD pSemaphore +20
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * No error
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public DosReadAsyncNmPipe
+DosReadAsyncNmPipe proc near
+ Int2fNumber DosReadAsyncNmPipe
+
+async_read_write_common:
+
+;
+; since the async named pipe calls arrive via int 2f, we don't have the safety
+; blanket of DOS saving our registers
+;
+
+ push bp
+ push bx
+ mov bx,word ptr [si+18] ; pipe handle
+ call MapNtHandle
+ jc @f
+ SVC SVC_RDRREADASYNCNMPIPE ; same for Read & Write
+@@: pop bx
+ pop bp
+ ret
+
+ public DosReadAsyncNmPipe2
+DosReadAsyncNmPipe2:
+ Int2fNumber DosReadAsyncNmPipe2
+ jmp short async_read_write_common
+
+ public DosWriteAsyncNmPipe
+DosWriteAsyncNmPipe:
+ Int2fNumber DosWriteAsyncNmPipe
+ jmp short async_read_write_common
+
+ public DosWriteAsyncNmPipe2
+DosWriteAsyncNmPipe2:
+ Int2fNumber DosWriteAsyncNmPipe2
+ jmp short async_read_write_common
+DosReadAsyncNmPipe endp
+
+
+
+; *** MapNtHandle
+; *
+; * Given a handle in BX, map it to a 32-bit Nt handle from the SFT in
+; * BP:BX
+; *
+; * ENTRY bx = handle to map
+; *
+; * EXIT Success - BP:BX = 32-bit Nt handle from SFT
+; *
+; * RETURNS Success - CF = 0
+; * Failure - CF = 1, ax = ERROR_INVALID_HANDLE
+; *
+; * USES ax, bp, bx, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+MapNtHandle proc near
+ push ax ; save regs used by Dos call back
+ push cx
+ push dx
+ push ds
+ push si
+ push es
+ push di
+
+;
+; call back to Dos to get the pointer to the JFN in our caller's JFT. Remember
+; the handle (BX) is an index into the JFT. The byte at this offset in the JFT
+; contains the index of the SFT structure we want in the system file table
+;
+
+ DosCallBack PJFN_FROM_HANDLE ; pJfnFromHamdle
+ jc @f ; bad handle
+
+;
+; we retrieved a pointer to the required byte in the JFT. The byte at this
+; pointer is the SFT index which describes our 'file' (named pipe in this
+; case). We use this as an argument to the next call back function - get
+; Sft from System File Number
+;
+
+ mov bl,es:[di]
+ xor bh,bh
+ DosCallBack SF_FROM_SFN ; SfFromSfn
+ jc @f ; oops - bad handle
+
+;
+; Ok. We have a pointer to the SFT which describes this named pipe. Get the
+; 32-bit Nt handle
+;
+
+ mov bx,word ptr es:[di].sf_NtHandle
+ mov bp,word ptr es:[di].sf_NtHandle[2]
+
+;
+; restore all registers used by Dos call back. BX at this point is either
+; the low 16-bits of the 32-bit Nt handle or junk. Carry flag is set
+; appropriately
+;
+
+@@: pop di
+ pop es
+ pop si
+ pop ds
+ pop dx
+ pop cx
+ pop ax
+ jnc @f
+
+;
+; finally, if there was an error then return a bad handle indication in ax
+;
+
+ mov ax,ERROR_INVALID_HANDLE
+@@: ret
+MapNtHandle endp
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/netapis.asm b/private/mvdm/dos/v86/redir/netapis.asm
new file mode 100644
index 000000000..32ee18b99
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/netapis.asm
@@ -0,0 +1,566 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ netapis.asm
+
+Abstract:
+
+ This module contains the resident code part of the stub redir TSR for NT
+ VDM net support. The routines contained herein are the Lan Manager API
+ stubs:
+
+ NetIRemoteAPI
+ NetMessageBufferSend
+ NetNullTransactAPI
+ NetServerEnum
+ NetServiceControl
+ NetTransactAPI
+ NetUseAdd
+ NetUseDel
+ NetUseEnum
+ NetUseGetInfo
+ NetWkstaGetInfo
+ NetWkstaSetInfo
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include dossym.inc ; User_<Reg> defines
+include mult.inc ; MultNET
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include syscall.inc ; DOS system call numbers
+include rdrint2f.inc ; redirector Int 2f numbers
+include segorder.inc ; segments
+include enumapis.inc ; dispatch codes
+include debugmac.inc ; DbgPrint macro
+include localmac.inc ; DbgPrint macro
+include asmmacro.inc ; language extensions
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include sf.inc ; SFT definitions/structure
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+extrn SetNetErrorCodeAx:near
+
+;
+; if we are remoting NetUserSetInfo with an unencrypted password, we need
+; somewhere in 16-bit memory to store the encrypted password. Hence, this:
+;
+
+password_buffer db 16 dup(?)
+
+; *** NetIRemoteAPI
+; *
+; * Remotes API requests to a server. Creates a transaction smb. The
+; * return data buffer address and length are in the caller's parameters.
+; *
+; * This is an internal API so the parameters are trusted.
+; *
+; * Function = 5F3Fh
+; *
+; * ENTRY CX = API number
+; * ES:BX = pointer to caller parameters
+; * DS:SI = pointer to ASCIZ parameter descriptor string
+; * DS:DI = pointer to ASCIZ data descriptor string
+; * DS:DX = pointer to ASCIZ aux data descriptor string
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * Output depends on type of request
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetIRemoteAPI
+NetIRemoteAPI proc near
+ mov ax,offset cs:password_buffer
+ SVC SVC_RDRIREMOTEAPI
+
+;
+; all routines in this module come here for exit processing
+;
+
+common_net_api_exit:
+ jc common_api_error_exit ; quick return on success
+ ret
+
+common_api_error_exit:
+ push ax
+ DosCallBack GET_USER_STACK
+ pop [si].User_Ax ; return failure status in caller's ax
+ call SetNetErrorCodeAx ; set up to return 16-bit error to app
+ stc ; failure indication
+ ret
+NetIRemoteAPI endp
+
+
+
+; *** NetMessageBufferSend
+; *
+; * Function = 5F40h
+; *
+; * ENTRY DS:DX = NetMessageBufferSendStruct:
+; *
+; * char FAR * NMBSS_NetName; /* asciz net name. */
+; * char FAR * NMBSS_Buffer; /* pointer to buffer. */
+; * unsigned int NMBSS_BufSize; /* size of buffer. */
+; *
+; * EXIT CF = 0
+; * Success
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetMessageBufferSend
+NetMessageBufferSend proc
+ SVC SVC_RDRMESSAGEBUFFERSEND
+ jmps common_net_api_exit
+NetMessageBufferSend endp
+
+
+
+; *** NetNullTransactApi
+; *
+; * Function = 5F54h
+; *
+; * ENTRY DS:SI = transaction packet
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * Success
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetNullTransactAPI
+NetNullTransactAPI proc near
+ SVC SVC_RDRNULLTRANSACTAPI
+ jmps common_net_api_exit
+NetNullTransactAPI endp
+
+
+
+; *** NetServerEnum
+; *
+; * Function = 5F4Ch
+; *
+; * ENTRY BL = level (0 or 1)
+; * CX = size of buffer
+; * ES:DI = buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code:
+; * NERR_BufTooSmall
+; * ERROR_MORE_DATA
+; *
+; * CF = 0
+; * BX = entries read
+; * CX = total available
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetServerEnum
+NetServerEnum proc near
+ mov al,4ch
+ jmp short common_server_enum
+NetServerEnum endp
+
+
+
+; *** NetServerEnum2
+; *
+; * Function = 5F53h
+; *
+; * ENTRY DS:SI = NetServerEnum2Struct:
+; * DW Level
+; * DD Buffer
+; * DW Buflen
+; * DD Type
+; * DD Domain
+; *
+; * EXIT CF = 1
+; * AX = Error code:
+; * NERR_BufTooSmall
+; * ERROR_MORE_DATA
+; *
+; * CF = 0
+; * BX = entries read
+; * CX = total available
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetServerEnum2
+NetServerEnum2 proc near
+ mov al,53h
+common_server_enum:
+ SVC SVC_RDRSERVERENUM
+
+;
+; we are going to set the caller's BX and CX irrespective of whether we have
+; meaningful values in them. The reason: WinUnPack is brain-dead. This function
+; is used to unpack a real-mode buffer into a protect-mode buffer, and it uses
+; the returned EntriesRead in BX to do so. It's brain-dead because it doesn't
+; look at the return code until after its tried to unpack BX elements from its
+; buffer, which probably contains crap. This took me a day to find out why its
+; blowing up in 16-bit windows protect-mode netapi.dll, and probably means that
+; if the real DOS redir ever returned anything other than a list of servers,
+; then windows would fall over too. (Actually, the real redir does the right
+; thing. This is what you get for believing comments, and not reading the code
+; #^*&^@@*&%!)
+;
+
+ pushf
+ push ax
+ DosCallBack GET_USER_STACK
+ mov [si].User_Bx,bx
+ mov [si].User_Cx,cx
+ pop ax ; error status or XXXX
+ popf ; error indication
+@@: jmps common_net_api_exit
+NetServerEnum2 endp
+
+
+
+; *** NetServiceControl
+; *
+; * Returns information about the state of a service, or applies a control
+; * to a service (and its dependents). We only allow INTERROGATE under NT
+; * since we don't want DOS apps starting and stopping the NT services. In
+; * most cases they couldn't anyway, since a DOS program will most likely
+; * be running in an account with not enough privilege to control the
+; * services (ie an admin is very likely to be using only 32-bit tools
+; * to control services)
+; *
+; * Function = 5F42h
+; *
+; * ENTRY ES:BX = NetServiceControlStruct:
+; * char far* ServiceName
+; * unsigned short BufLen
+; * char far* Buffer (service_info_2)
+; * DL = opcode:
+; * 0 = interrogate
+; * 1 = pause
+; * 2 = continue
+; * 3 = uninstall
+; * 4 - 127 = reserved
+; * 128 - 255 = OEM defined
+; *
+; * EXIT CF = 0
+; * Buffer contains service_info_2 structure for requested service
+; *
+; * CF = 1
+; * AX = error code:
+; * NERR_ServiceCtlNotValid
+; * NERR_BufTooSmall
+; * NERR_ServiceNotInstalled
+; * ERROR_INVALID_PARAMETER (NEW)
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetServiceControl
+NetServiceControl proc near
+ SVC SVC_RDRSERVICECONTROL
+ jmps common_net_api_exit
+NetServiceControl endp
+
+
+
+; *** NetTransactAPI
+; *
+; * Function = 5F3Dh
+; *
+; * ENTRY DS:SI = transaction packet
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * CF = 0
+; * Success
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetTransactAPI
+NetTransactAPI proc near
+ SVC SVC_RDRTRANSACTAPI
+ jmps common_net_api_exit
+NetTransactAPI endp
+
+
+
+; *** NetUseAdd
+; *
+; * Function = 5F47h
+; *
+; * ENTRY BX = level
+; * CX = buffer length
+; * DS:SI = server name for remote call (MBZ)
+; * ES:DI = buffer containing use_info_1 structure
+; *
+; * EXIT CF = 0
+; * Success
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetUseAdd
+NetUseAdd proc
+ SVC SVC_RDRUSEADD
+ jmps common_net_api_exit
+NetUseAdd endp
+
+
+
+; *** NetUseDel
+; *
+; * Function = 5F48h
+; *
+; * ENTRY BX = force flag
+; * DS:SI = server name for remote call (MBZ)
+; * ES:DI = use name
+; *
+; * EXIT CF = 0
+; * Success
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetUseDel
+NetUseDel proc
+ SVC SVC_RDRUSEDEL
+ jmps common_net_api_exit
+NetUseDel endp
+
+
+
+; *** NetUseEnum
+; *
+; * Function = 5F46h
+; *
+; * ENTRY BX = level of info required - 0 or 1
+; * CX = buffer length
+; * ES:DI = buffer for enum info
+; *
+; * EXIT CF = 0
+; * CX = Entries Read
+; * DX = Total number of entries available
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetUseEnum
+NetUseEnum proc
+ SVC SVC_RDRUSEENUM
+ pushf ; error indication
+ push ax ; error code
+
+;
+; return EntriesRead and TotalEntries regardless of error
+;
+
+ DosCallBack GET_USER_STACK
+ mov [si].User_Cx,cx
+ mov [si].User_Dx,dx
+ pop ax
+ popf
+ jmpc common_api_error_exit ; error
+ ret
+NetUseEnum endp
+
+
+
+; *** NetUseGetInfo
+; *
+; * Function = 5F49h
+; *
+; * ENTRY DS:DX = NetUseGetInfoStruc:
+; *
+; * const char FAR* NUGI_usename; /* ASCIZ redirected device name */
+; * short NUGI_level; /* level of info */
+; * char FAR* NUGI_buffer; /* buffer for returned info */
+; * unsigned short NUGI_buflen; /* size of buffer */
+; *
+; * EXIT CF = 0
+; * DX = size of entry returned (or size of buffer required)
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetUseGetInfo
+NetUseGetInfo proc
+ SVC SVC_RDRUSEGETINFO
+ jmpc common_api_error_exit
+ DosCallBack GET_USER_STACK
+ mov [si].User_Dx,dx
+ clc
+ ret
+NetUseGetInfo endp
+
+
+
+; *** NetWkstaGetInfo
+; *
+; * Function = 5F44h
+; *
+; * ENTRY BX = level of information - 0, 1, 10
+; * CX = size of caller's buffer
+; * DS:SI = server name for remote call (Must Be Null)
+; * ES:DI = caller's buffer
+; *
+; * EXIT CF = 0
+; * DX = size of buffer required for request
+; * AX = NERR_Success (0)
+; *
+; * CF = 1
+; * AX = Error code
+; * NERR_BufTooSmall (2123)
+; * Caller's buffer not large enough to hold even fixed
+; * part of structure
+; *
+; * ERROR_MORE_DATA (234)
+; * Caller's buffer large enough to hold fixed structure
+; * part of data, but not all variable parts too
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetWkstaGetInfo
+NetWkstaGetInfo proc
+ SVC SVC_RDRWKSTAGETINFO
+ pushf ; save error indication in carry
+ push ax ; save error code
+ DosCallBack GET_USER_STACK
+ mov [si].User_Dx,dx ; user's dx = buffer required
+ pop ax ; ax = error code or ?
+ popf ; carry flag = error (1) or no error
+ jmps common_net_api_exit ; if error, store it, and return
+NetWkstaGetInfo endp
+
+
+
+; *** NetWkstaSetInfo
+; *
+; * Function = 5F45h
+; *
+; * ENTRY BX = level - MBZ
+; * CX = buffer size
+; * DX = parm num
+; * DS:SI = server name for remote call (MBZ)
+; * ES:DI = caller's buffer
+; *
+; * EXIT CF = 0
+; * Success
+; *
+; * CF = 1
+; * AX = Error code
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public NetWkstaSetInfo
+NetWkstaSetInfo proc
+ SVC SVC_RDRWKSTASETINFO
+ jmps common_net_api_exit
+NetWkstaSetInfo endp
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/neterror.asm b/private/mvdm/dos/v86/redir/neterror.asm
new file mode 100644
index 000000000..4674ffb56
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/neterror.asm
@@ -0,0 +1,152 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ neterror.asm
+
+Abstract:
+
+ This module contains error handling code, specifically in order to get
+ 16-bit errors back to apps - DOS summarily truncates error codes to 8
+ bits. The following routines are contained herein:
+
+ SetNetErrorCodeAx
+ ReturnNetErrorCodeAx
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include dossym.inc ; User_<Reg> defines
+include mult.inc ; MultNET
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include syscall.inc ; DOS system call numbers
+include rdrint2f.inc ; redirector Int 2f numbers
+include segorder.inc ; segments
+include enumapis.inc ; dispatch codes
+include debugmac.inc ; DbgPrint macro
+include localmac.inc ; DbgPrint macro
+include asmmacro.inc ; language extensions
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include sf.inc ; SFT definitions/structure
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentCodeStart
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+
+;
+; once again, store the data in the code segment
+;
+
+CallerAx dw ? ; where the error code goes
+CallerCs dw ? ; far return address to caller
+CallerIp dw ?
+
+
+
+; *** SetNetErrorCodeAx
+; *
+; * Causes a 16-bit error code to be returned in ax to a calling app. This
+; * routine is only called in the case of an error being returned
+; *
+; * DOS routinely truncates any error we hand it to 8 bits, since
+; * historically DOS error codes were all <255. We do here the same
+; * execrable fix that the real redir must do - capture the return address
+; * from DOS's stack, set the DOS return address to this routine, store
+; * away the 16-bit error code and return an 8-bit error code to DOS. When
+; * DOS does an iret, we get control, set ax to the real 16-bit error, set
+; * the carry flag and return to the caller for real
+; *
+; * ENTRY AX = error code
+; *
+; * EXIT nothing affected
+; *
+; * USES ds
+; *
+; * ASSUMES Not re-entrant
+; *
+; ***
+
+public SetNetErrorCodeAx
+SetNetErrorCodeAx proc
+ pushf ; don't lose error indication
+ push ax ; or error code
+ DosCallBack GET_USER_STACK
+ mov ax,[si].User_Cs
+ mov CallerCs,ax
+ mov ax,[si].User_Ip
+ mov CallerIp,ax
+ mov [si].User_Cs,cs
+ mov [si].User_Ip,offset ReturnNetErrorCodeAx
+ pop ax
+ popf
+ mov CallerAx,ax
+ ret
+SetNetErrorCodeAx endp
+
+; *** ReturnNetErrorCodeAx
+; *
+; * This routine is called as a result of SetNetErrorCodeAx being called.
+; * This is on the exit path from DOS to an app which called a redir
+; * entry point which returned an error.
+; * We set the real 16-bit error code that we remembered before, set the
+; * carry flag to indicate an error then iret to the real caller's return
+; * address
+; *
+; * ENTRY user's registers
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; *
+; * USES ax, carry flag
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+public ReturnNetErrorCodeAx
+ReturnNetErrorCodeAx proc
+ push CallerCs
+ push CallerIp
+ mov ax,CallerAx
+ stc ; remember - only called if error
+ retf ; far return
+ReturnNetErrorCodeAx endp
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/rdrint2f.inc b/private/mvdm/dos/v86/redir/rdrint2f.inc
new file mode 100644
index 000000000..d79adaa26
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/rdrint2f.inc
@@ -0,0 +1,94 @@
+;*****************************************************************;
+;** Microsoft LAN Manager **;
+;** Copyright(c) Microsoft Corp., 1990 **;
+;*****************************************************************;
+;* RDRINT2F.INC - Redirector INT 2F function equates.
+;
+; This file contains symbolic definitions of the redirector INT 2F
+; entry points.
+;
+_2F_NETInstall equ 0
+_2F_NET_RMDIR equ 1
+_2F_NET_SEQ_RMDIR equ 2
+_2F_NET_MKDIR equ 3
+_2F_NET_SEQ_MKDIR equ 4
+_2F_NET_CHDIR equ 5
+_2F_NET_CLOSE equ 6
+_2F_NET_COMMIT equ 7
+_2F_NET_READ equ 8
+_2F_NET_WRITE equ 9
+_2F_NET_LOCK equ 10
+_2F_NET_UNLOCK equ 11
+_2F_NET_DISK_INFO equ 12
+_2F_NET_SET_FILE_ATTRIBUTE equ 13
+_2F_NET_SEQ_SET_FILE_ATTRIBUTE equ 14
+_2F_NET_GET_FILE_INFO equ 15
+_2F_NET_SEQ_GET_FILE_INFO equ 16
+_2F_NET_RENAME equ 17
+_2F_NET_SEQ_RENAME equ 18
+_2F_NET_DELETE equ 19
+_2F_NET_SEQ_DELETE equ 20
+_2F_NET_OPEN equ 21
+_2F_NET_SEQ_OPEN equ 22
+_2F_NET_CREATE equ 23
+_2F_NET_SEQ_CREATE equ 24
+_2F_NET_SEQ_SEARCH_FIRST equ 25
+_2F_NET_SEQ_SEARCH_NEXT equ 26
+_2F_NET_SEARCH_FIRST equ 27
+_2F_NET_SEARCH_NEXT equ 28
+_2F_NET_ABORT equ 29
+_2F_NET_ASSOPER equ 30
+_2F_Printer_GETSET_STRING equ 31
+_2F_NetFlushBuf equ 32
+_2F_NET_LSEEK equ 33
+_2F_NetResetEnvironment equ 34
+_2F_NetSpoolCheck equ 35
+_2F_NetSpoolClose equ 36
+_2F_NetSpoolOper equ 37
+_2F_NetSpoolEchoCheck equ 38
+ifdef DOSVER
+if ( DOSVER EQ 400 ) OR ( DOSVER EQ 500 )
+_2F_NetDeviceIOCTL EQU 43
+_2F_NetUpdateCB EQU 44
+_2F_NetExtendedAttrib EQU 45
+_2F_NetExtendedOpen EQU 46
+_2F_NetDependantIOCTL EQU 47
+ENDIF
+ENDIF
+;* Entry points from here on down are DOS 3 Lan Manager specific.
+;
+;
+_2F_NetGetUserName equ 80h
+_2F_NetSetUserName equ 81h
+_2F_NetServiceNotify equ 82h
+_2F_NetPrintNameEnum equ 83h
+_2F_NetGetEnumInfo equ 84h
+_2F_TestKanjRD equ 85h
+_2F_TestDBCSLB equ 85h
+_2F_DosReadAsyncNmPipe equ 86h
+_2F_DosUnusedFunction1 equ 87h
+_2F_DosUnusedFunction2 equ 88h
+_2F_NetCalloutNCB equ 89h
+_2F_EncrPasswd equ 8Ah
+_2F_Set_LongName equ 8Ah
+_2F_NetGetLogonServer equ 8Bh
+_2F_NetSetLogonServer equ 8Ch
+_2F_NetGetDomain equ 8Dh
+_2F_NetSetDomain equ 8Eh
+_2F_DosWriteAsyncNmPipe EQU 8FH
+_2F_DosReadAsyncNmPipe2 EQU 90H
+_2F_DosWriteAsyncNmPipe2 EQU 91H
+
+;* Symbolic Defination for Printer API's
+;
+_2F_Open_Specific_Spool equ 0BF02H
+_2F_Close_Specific_Spool equ 0BF03H
+
+CallRedir macro function
+ mov ax,(MultNET shl 8) + _2F_&function
+ int 2fh
+endm
+
+Int2fNumber macro function
+ mov ax,(MultNET shl 8) + _2F_&function
+endm
diff --git a/private/mvdm/dos/v86/redir/rdrmisc.inc b/private/mvdm/dos/v86/redir/rdrmisc.inc
new file mode 100644
index 000000000..09820181c
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/rdrmisc.inc
@@ -0,0 +1,30 @@
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ rdrmisc.inc
+
+Abstract:
+
+ Contains miscellaneous definitions
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+--*/
+endif
+
+LM20_CNLEN equ 15 ; from LMCONS.H!
+LM20_UNLEN equ 20 ; ditto
diff --git a/private/mvdm/dos/v86/redir/redir.asm b/private/mvdm/dos/v86/redir/redir.asm
new file mode 100644
index 000000000..21c702a8f
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/redir.asm
@@ -0,0 +1,558 @@
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ redir.asm
+
+Abstract:
+
+ This module contains the stub redir TSR code for NT VDM net support
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+endif
+
+
+
+;
+; DOS include files
+;
+
+.xlist
+.xcref
+include dossym.inc ; includes MS-DOS version etc
+include pdb.inc ; PSP defines
+include syscall.inc ; AssignOper
+include enumapis.inc ; Local_API_GetRedirVersion, etc.
+include segorder.inc ; load order of 'redir' segments
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include rdrmisc.inc ; miscellaneous definitions
+include debugmac.inc ; debug display macros
+include asmmacro.inc ; jumps which may be short or near
+include int5c.inc ; Int to be used for pseudo network adapter
+.cref
+.list
+
+
+
+;
+; Misc. local manifests
+;
+
+LOAD_STACK_SIZE equ 256
+
+
+
+;
+; Define externals in resident code and data
+;
+
+ResidentCodeStart
+ extrn OldMultHandler:dword
+ extrn MultHandler:near
+ extrn Old2aHandler:dword
+ extrn Int2aHandler:near
+ extrn Old5cHandler:dword
+ extrn Int5cHandler:near
+ extrn OldNetworkHandler:dword
+ extrn IntNetworkHandler:near
+ extrn dwPostRoutineAddress:dword
+if DEBUG
+ extrn Old21Handler:dword
+ extrn CheckInt21Function5e:near
+endif
+ResidentCodeEnd
+
+
+
+ResidentDataStart
+ extrn LanRootLength:word
+ extrn LanRoot:byte
+ResidentDataEnd
+
+
+
+InitStack segment stack para 'stack'
+
+ dw LOAD_STACK_SIZE dup (?)
+
+top_of_stack equ $
+
+InitStack ends
+
+
+
+InitDataStart
+
+;
+; pull in messages. Kept in a separate file to make internationalisation easier
+;
+
+include redirmsg.inc
+
+ public ComputerName
+ComputerName db LM20_CNLEN + 1 dup (?)
+
+DefaultLanRoot db "C:\LANMAN.DOS",0
+DEFAULT_LANROOT_LENGTH equ $-DefaultLanRoot
+
+InitDataEnd
+
+
+
+InitCodeStart
+
+ assume cs:InitCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+ public start
+start proc near
+
+;
+; when we start up we could be on any old PC - even an original, so don't
+; assume anything other than a model-T processor
+;
+
+ .8086
+
+;
+; let's do the decent thing and create a stack. This way we're covered
+;
+
+ mov dx,InitStack
+ mov ss,dx ; disables ints until after next ins.
+ mov sp,offset top_of_stack
+
+ assume ss:InitStack
+
+;
+; may as well set the data segment while we're at it - all paths set it sooner
+; or later. NOTE: es will point to the PSP until we change it!
+;
+
+ mov dx,InitData
+ mov ds,dx
+
+ assume ds:InitData
+
+;
+; first off, get the DOS version. If we're not running on NT (VDM) then this
+; TSR's not going to do much, so exit. Exit using various methods, depending
+; on the DOS version (don't you hate compatibility?)
+;
+
+ mov ah,30h
+ int 21h
+ jc ancient_version ; version not even supported, forcrissake
+
+;
+; version is 2.0 or higher. Check it out. al = major#, ah = minor#
+;
+
+ cmp al,major_version
+ jne invalid_version
+
+;
+; what do you know? We're actually running on NT (unless some evil programmer
+; has pinched int 21h/30h and done something execrable with it!). We'd better
+; do something...
+; Also: at this point we know we're on at a 386, so lets enable some 286
+; instructions to be generated. Eh? you justifiably ponder - is this a typo?
+; Unfortunately, SoftPc only emulates the lowly 286 processor. We need to wait
+; until Microsoft has paid Insignia lots of money before they can afford some
+; new brains who will then dutifully provide us with full 386+ emulation (maybe)
+;
+
+ .286c
+
+ mov ax,(AssignOper SHL 8) + Local_API_RedirGetVersion
+ int 21h ; is redir already loaded?
+ jnc already_here ; yep
+
+;
+; OK, the redir is not already loaded - we're in business. Get and set the
+; various interrupt vectors, Calculate the amount of space we want to keep,
+; free up any unused space (like the environment segment), display a message
+; in the DEBUG version, then terminate and stay resident. Remember: at this
+; point we expect ES to point at the PSP
+;
+
+@@: call InstallInterruptHandlers
+
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+;;
+;; Initialize VDM DOS memory window address (in virtual DLC driver).
+;; The memory window is used for the async Netbios, DLC and
+;; named pipe post routines.
+;;
+;
+; push es ; PSP
+; mov bx,ResidentCode
+; mov es,bx
+;
+; assume es:ResidentCode
+;
+;;
+;; now that VDMREDIR support is a DLL, we can fail initialization on the 32-bit
+;; side if the DLL cannot be loaded, or the entry points not found. In this case
+;; we will fail to load redir.exe, rather than constantly returning
+;; ERROR_NOT_SUPPORTED every time we make a redir BOP
+;;
+;
+; mov bx,offset dwPostRoutineAddress
+; SVC SVC_VDM_WINDOW_INIT
+; pop es ; es back to PSP
+; jmpc initialization_error
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+
+ assume es:nothing
+
+;
+; free the environment segment
+;
+
+ mov es,es:[PDB_environ]
+ mov ah,49h
+ int 21h ; free environment segment
+
+if DEBUG
+ifdef PROLIX
+ DbgPrintString <"Redir successfully loaded",13,10>
+endif
+endif
+
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+;;
+;; now perform the BOP which will let the 32-bit redir support know that the
+;; DOS redirector TSR is successfully loaded. This must be the last action -
+;; we cannot fail installation after this point (unless we call the BOP to
+;; uninitialize 32-bit VDM redir support
+;;
+;
+; mov bx,seg ComputerName
+; mov es,bx
+;
+; assume es:seg ComputerName
+;
+; mov bx,offset ComputerName ; initialization returns the computer name
+; mov cx,size ComputerName ; which will be gettable using int 21/ah=5e
+; SVC SVC_RDRINITIALIZE
+; jmpc initialization_error ; 32-bit DLL failed (?)
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+
+; DbgBreakPoint ; check computer name returned
+
+;
+; set the computer name returned from the 32-bit side
+;
+
+if DEBUG
+ifdef PROLIX
+ DbgPrintString <"Set computer name here",13,10>
+endif
+endif
+
+if 0
+ mov ax,5e01h ; set machine name
+ xor cx,cx ; cx is 'user num'
+ int 21h
+endif
+
+;
+; do initialisation things - set the lanroot to the default if not otherwise
+; specified
+;
+
+ mov ax,InitData
+ mov ds,ax
+
+ assume ds:InitData
+
+ mov ax,ResidentData
+ mov es,ax
+
+ assume es:ResidentData
+
+ mov LanRootLength,DEFAULT_LANROOT_LENGTH
+ mov si,offset DefaultLanRoot
+ mov di,offset LanRoot
+ cld
+ mov cx,DEFAULT_LANROOT_LENGTH/2
+ rep movsw
+if (DEFAULT_LANROOT_LENGTH and 1)
+ movsb
+endif
+
+;
+; finally terminate and stay resident
+;
+
+ mov dx,ResidentEnd
+ sub dx,ResidentStart ; number of paragraphs in resident code
+ add dx,10h ; additional for PSP (PDB)
+
+; DbgBreakPoint
+
+if DEBUG
+ifdef PROLIX
+ DbgPrintString "Staying resident with "
+ DbgPrintHexWord dx
+ DbgPrintString " paragraphs. Load seg is ",NOBANNER
+ mov ah,62h
+ int 21h
+ DbgPrintHexWord bx
+ DbgPrintString " current seg is ",NOBANNER
+ DbgPrintHexWord cs
+ DbgCrLf
+endif
+endif
+
+ mov ax,3100h
+ int 21h ; terminate and stay resident
+
+;
+; here if the MS-DOS version check (Ah=30h) call is not supported
+;
+
+ancient_version:
+ mov dx,InitData
+ mov ds,dx
+
+ assume ds:InitData
+
+ mov dx,offset bad_ver_msg
+ mov ah,9 ; cp/m-style write to output
+ int 21h
+
+;
+; safe exit: what we really want to do here is INT 20H, but when you do this,
+; CS must be the segment of the PSP of this program. Knowing that CD 20 is
+; embedded at the start of the PSP, the most foolproof way of doing this is
+; to jump (using far return) to the start of the PSP
+;
+
+ push es
+ xor ax,ax
+ push ax
+ retf ; terminate
+
+;
+; we are running on a version of DOS >= 2.00, but its not NT, so we still can't
+; help. Display the familiar message and exit, but using a less programmer-
+; hostile mechanism
+;
+
+invalid_version:
+ mov dx,offset bad_ver_msg
+ mov cx,BAD_VER_MSG_LEN
+ jmp short print_error_message_and_exit
+
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+;;
+;; if we cannot initialize 32-bit support (because we can't find/load the DLL)
+;; then put back the hooked interrupt vectors as they were when this TSR started,
+;; display a message and fail to load the redir TSR
+;;
+;
+;initialization_error:
+; call RestoreInterruptHandlers
+; mov dx,offset cannot_load_msg
+; mov cx,CANNOT_LOAD_MSG_LEN
+; jmps print_error_message_and_exit
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+
+;
+; The DOS version's OK, but this TSR is already loaded
+;
+
+already_here:
+ mov dx,offset already_loaded_msg
+ mov cx,ALREADY_LOADED_MSG_LEN
+
+print_error_message_and_exit:
+ mov bx,1 ; bx = stdout handle
+ mov ah,40h ; write to handle
+ int 21h ; write (cx) bytes @ (ds:dx) to stdout
+ mov ax,4c01h ; terminate program
+ int 21h ; au revoir, cruel environment
+
+start endp
+
+;*******************************************************************************
+;*
+;* InstallInterruptHandlers
+;*
+;* Sets the interrupt handlers for all the ints we use - 2a, 2f, 5c
+;* and NETWORK_INTERRUPT (0e)
+;*
+;* ENTRY es = PSP segment
+;* ds =
+;*
+;* EXIT OldMultHandler contains the original interrupt 2f vector
+;* Old2aHandler contains the original interrupt 2a vector
+;* Old5cHandler contains the original interrupt 5c vector
+;* OldNetworkHandler contains the original interrupt 0e vector
+;*
+;* RETURNS nothing
+;*
+;* ASSUMES
+;*
+;*******************************************************************************
+
+InstallInterruptHandlers proc
+ push es ; PSP segment - destroyed by INT 21/35h
+ push ds
+
+;
+; note: if we use ResidentCode here, explicitly, instead of seg OldMultHandler,
+; then we can leave out an extraneous load of ds for the ISR address
+;
+
+ mov dx,ResidentCode
+ mov ds,dx
+
+ assume ds:ResidentCode
+
+ mov ax,352fh ; get current INT 2Fh vector
+ int 21h
+ mov word ptr OldMultHandler,bx
+ mov word ptr OldMultHandler+2,es
+ mov dx,offset ResidentCode:MultHandler
+ mov ax,252fh
+ int 21h ; set INT 2Fh vector to our handler
+
+;
+; we have to pinch int 2a too - certain parts of the net libraries perform a
+; net check using a presence check on 2ah
+;
+
+ mov ax,352ah
+ int 21h
+ mov word ptr Old2aHandler,bx
+ mov word ptr Old2aHandler+2,es
+ mov dx,offset ResidentCode:Int2aHandler
+ mov ax,252ah
+ int 21h
+
+;
+; we have to pinch int 5c for Netbios and DLC
+;
+
+ mov ax,355ch
+ int 21h
+ mov word ptr Old5cHandler,bx
+ mov word ptr Old5cHandler+2,es
+ mov dx,offset ResidentCode:Int5cHandler
+ mov ax,255ch
+ int 21h
+
+;
+; we have to pinch int NETWORK_INTERRUPT for Netbios and DLC
+;
+
+ mov ax,3500h OR NETWORK_INTERRUPT
+ int 21h
+ mov word ptr OldNetworkHandler,bx
+ mov word ptr OldNetworkHandler+2,es
+ mov dx,offset ResidentCode:IntNetworkHandler
+ mov ax,2500h OR NETWORK_INTERRUPT
+ int 21h
+
+;if DEBUG
+;;
+;; get the int 21 handler too so we can find out if anyone's calling the
+;; (unsupported) int 21/ah=5e
+;;
+;
+; mov ax,3521h
+; int 21h
+; mov word ptr Old21Handler,bx
+; mov word ptr Old21Handler+2,es
+; mov dx,offset ResidentCode:CheckInt21Function5e
+; mov ax,2521h
+; int 21h
+;endif
+
+ pop ds ; restore segment registers
+ pop es
+ ret
+InstallInterruptHandlers endp
+
+;*******************************************************************************
+;*
+;* RestoreInterruptHandlers
+;*
+;* Resets the interrupt handlers for all the ints we use - 2a, 2f, 5c
+;* and NETWORK_INTERRUPT (0e). Called in the event we cannot complete
+;* installation
+;*
+;* ENTRY OldMultHandler, Old2aHandler, Old5cHandler, OldNetworkHandler
+;* contain the interrupt vectors from before redir.exe was loaded
+;*
+;* EXIT Original interrupt vectors are restored
+;*
+;* RETURNS nothing
+;*
+;* ASSUMES
+;*
+;*******************************************************************************
+
+RestoreInterruptHandlers proc
+ push ds
+
+ assume ds:nothing
+
+ push es
+ mov dx,ResidentCode
+ mov es,dx
+
+ assume es:ResidentCode
+
+ lds dx,OldMultHandler
+ mov ax,252fh
+ int 21h ; set INT 2Fh vector to previous handler
+
+ lds dx,Old2aHandler
+ mov ax,252ah
+ int 21h
+
+ lds dx,Old5cHandler
+ mov ax,255ch
+ int 21h
+
+ lds dx,OldNetworkHandler
+ mov ax,2500h OR NETWORK_INTERRUPT
+ int 21h
+
+;if DEBUG
+; lds dx,Old21Handler
+; mov ax,2521h
+; int 21h
+;endif
+
+ pop es
+ pop ds
+ ret
+RestoreInterruptHandlers endp
+
+InitCodeEnd
+end start
diff --git a/private/mvdm/dos/v86/redir/resident.asm b/private/mvdm/dos/v86/redir/resident.asm
new file mode 100644
index 000000000..7d4b38551
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/resident.asm
@@ -0,0 +1,1154 @@
+page ,132
+if 0
+
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ resident.asm
+
+Abstract:
+
+ This module contains the resident code part of the stub redir TSR for NT
+ VDM net support. The routines contained herein are the 2f handler and the
+ API support routines:
+
+ MultHandler
+ ReturnMode
+ SetMode
+ GetAssignList
+ DefineMacro
+ BreakMacro
+ GetRedirVersion
+ NetGetUserName
+ DefaultServiceError
+ NetGetEnumInfo
+ NetSpoolStuff
+
+Author:
+
+ Richard L Firth (rfirth) 05-Sep-1991
+
+Environment:
+
+ Dos mode only
+
+Revision History:
+
+ 05-Sep-1991 rfirth
+ Created
+
+--*/
+
+endif
+
+
+
+.xlist ; don't list these include files
+.xcref ; turn off cross-reference listing
+include dosmac.inc ; Break macro etc (for following include files only)
+include dossym.inc ; User_<Reg> defines
+include mult.inc ; MultNET
+include error.inc ; DOS errors - ERROR_INVALID_FUNCTION
+include syscall.inc ; DOS system call numbers
+include rdrint2f.inc ; redirector Int 2f numbers
+include segorder.inc ; segments
+include enumapis.inc ; dispatch codes
+include debugmac.inc ; DbgPrint macro
+include localmac.inc ; DbgPrint macro
+include asmmacro.inc ; language extensions
+include rdrsvc.inc ; BOP and SVC macros/dispatch codes
+include rdrmisc.inc ; miscellaneous definitions
+include sf.inc ; SFT definitions/structure
+include vrdefld.inc ; VDM_LOAD_INFO
+.cref ; switch cross-reference back on
+.list ; switch listing back on
+subttl ; kill subtitling started in include file
+
+
+
+.286 ; all code in this module 286 compatible
+
+
+
+ResidentDataStart
+ public LanRootLength, LanRoot
+
+LanRootLength dw ? ; can't be >81 bytes anyhow
+LanRoot db (64+3+1+13) dup (?)
+
+ResidentDataEnd
+
+
+
+ResidentCodeStart
+ extrn DosQnmPipeInfo: near
+ extrn DosQNmpHandState: near
+ extrn DosSetNmpHandState: near
+ extrn DosPeekNmPipe: near
+ extrn DosTransactNmPipe: near
+ extrn DosCallNmPipe: near
+ extrn DosWaitNmPipe: near
+ extrn NetTransactAPI: near
+ extrn NetIRemoteAPI: near
+ extrn NetUseAdd: near
+ extrn NetUseDel: near
+ extrn NetUseEnum: near
+ extrn NetUseGetInfo: near
+ extrn NetServerEnum: near
+ extrn DosMakeMailslot: near
+ extrn DosDeleteMailslot: near
+ extrn DosMailslotInfo: near
+ extrn DosReadMailslot: near
+ extrn DosPeekMailslot: near
+ extrn DosWriteMailslot: near
+ extrn NetNullTransactAPI: near
+ extrn NetServerEnum2: near
+ extrn NetServiceControl: near
+ extrn NetWkstaGetInfo: near
+ extrn NetWkstaSetInfo: near
+ extrn NetMessageBufferSend: near
+ extrn NetHandleGetInfo: near
+ extrn NetHandleSetInfo: near
+ extrn DosReadAsyncNmPipe: near
+ extrn DosWriteAsyncNmPipe: near
+ extrn DosReadAsyncNmPipe2: near
+ extrn DosWriteAsyncNmPipe2: near
+ extrn MessengerDispatch: near
+
+;
+; IMPORTANT: This structure MUST be the first thing in the resident code segment
+;
+
+ extrn dwPostRoutineAddress: dword
+
+VdmWindowAddr VDM_LOAD_INFO <dwPostRoutineAddress, 0>
+
+ align 4
+
+;
+; Address of previous handler to chain if int 2f not for us
+;
+
+ public OldMultHandler
+OldMultHandler dd ?
+
+;
+; OldFunctionTable is a table of near pointers to handlers for the old 5f
+; functions 5f00 through 5f05
+;
+
+OldFunctionTable label word
+ dw ReturnMode ; 5f00
+ dw SetMode ; 5f01
+ dw GetAssignList ; 5f02
+ dw DefineMacro ; 5f03
+ dw BreakMacro ; 5f04
+ dw GetAssignList2 ; 5f05
+
+;
+; May as well keep this jump table in the code segment - no point in loading
+; ds just to get a jump offset
+;
+
+MultDispatchTable label word
+ dw GetRedirVersion ; 5f30
+ dw DefaultServiceError ; 5f31 - NetWkstaSetUID
+ dw DosQnmPipeInfo ; 5f32
+ dw DosQNmpHandState ; 5f33
+ dw DosSetNmpHandState ; 5f34
+ dw DosPeekNmPipe ; 5f35
+ dw DosTransactNmPipe ; 5f36
+ dw DosCallNmPipe ; 5f37
+ dw DosWaitNmPipe ; 5f38
+ dw DefaultServiceError ; 5f39 - DosRawReadNmPipe
+ dw DefaultServiceError ; 5f3a - DosRawWriteNmPipe
+ dw NetHandleSetInfo ; 5f3b
+ dw NetHandleGetInfo ; 5f3c
+ dw NetTransactAPI ; 5f3d
+ dw DefaultServiceError ; 5f3e - NetSpecialSMB
+ dw NetIRemoteAPI ; 5f3f
+ dw NetMessageBufferSend ; 5f40
+ dw DefaultServiceError ; 5f41 - NetServiceEnum
+ dw NetServiceControl ; 5f42
+ dw DefaultServiceError ; 5f43 - DosPrintJobGetID
+ dw NetWkstaGetInfo ; 5f44
+ dw NetWkstaSetInfo ; 5f45
+ dw NetUseEnum ; 5f46
+ dw NetUseAdd ; 5f47
+ dw NetUseDel ; 5f48
+ dw NetUseGetInfo ; 5f49
+ dw DefaultServiceError ; 5f4a - NetRemoteCopy
+ dw DefaultServiceError ; 5f4b - NetRemoteMove
+ dw NetServerEnum ; 5f4c
+ dw DosMakeMailslot ; 5f4d
+ dw DosDeleteMailslot ; 5f4e
+ dw DosMailslotInfo ; 5f4f
+ dw DosReadMailslot ; 5f50
+ dw DosPeekMailslot ; 5f51
+ dw DosWriteMailslot ; 5f52
+ dw NetServerEnum2 ; 5f53
+ dw NetNullTransactAPI ; 5f54 - NullTransaction entrypoint.
+
+MAX_TABLE_ENTRIES = (($-MultDispatchTable)/type MultDispatchTable)-1
+
+
+;
+; this next table dispatches the functions that come in through a direct call
+; to int 2f, ah=11, al=function code
+;
+
+ServiceDispatchTable label word
+ dw NetGetUserName ; 80h - NetGetUserName o
+ dw DefaultServiceError ; 81h - NetSetUserName x
+ dw DefaultServiceError ; 82h - NetServiceNotify x
+ dw DefaultServiceError ; 83h - NetPrintNameEnum x
+ dw NetGetEnumInfo ; 84h - NetGetEnumInfo o
+ dw DefaultServiceError ; 85h - TestDBCSLB x
+ dw DosReadAsyncNmPipe ; 86h - DosReadAsyncNmPipe x
+ dw DefaultServiceError ; 87h - DosUnusedFunction1 x
+ dw DefaultServiceError ; 88h - DosUnusedFunction2 x
+ dw DefaultServiceError ; 89h - NetCalloutNCB x
+ dw DefaultServiceError ; 8Ah - EncrPasswd x
+ dw DefaultServiceError ; 8Bh - NetGetLogonServer o
+ dw DefaultServiceError ; 8Ch - NetSetLogonServer o
+ dw DefaultServiceError ; 8Dh - NetGetDomain o
+ dw DefaultServiceError ; 8Eh - NetSetDomain o
+ dw DosWriteAsyncNmPipe ; 8FH - DosWriteAsyncNmPipe x
+ dw DosReadAsyncNmPipe2 ; 90H - DosReadAsyncNmPipe2 x
+ dw DosWriteAsyncNmPipe2 ; 91H - DosWriteAsyncNmPipe2 x
+
+MAX_SERVICE_ENTRIES = (($-ServiceDispatchTable)/type ServiceDispatchTable)-1
+
+page
+; *** MultHandler
+; *
+; * Whenever an INT 2F call is made, sooner or later this function will
+; * get control. If the call is actually for the redir, AH will be set
+; * to 11h (MultNET). If it is any other value then we just chain it
+; * along. Note that since there is no MINSES loaded in the NT DOS network
+; * stack, then we need also to fake calls to MINSES. These are made through
+; * INT 2F, with ah = 0xB8. We trap calls AX=B800 (network presence test)
+; * and AX=B809 (network/redir installation test)
+; *
+; * ENTRY ax = (MultNET << 8) | net operation code
+; * Net operation code can be:
+; * Install check 0
+; * Assign operation 30
+; * Anything else is DOS/NET specific. We should raise a gorbachev
+; * or rather an error if we receive something else
+; *
+; * Stack: IP \
+; * CS > From Int 2f
+; * Flags /
+; * Caller's AX From call to Int 21/ah=5f
+; *
+; * We need the caller's AX to dispatch the NetAssOper calls, nothing
+; * more
+; *
+; * All the rest of the registers are as per the caller
+; *
+; * EXIT CF = 0
+; * success
+; * CF = 1
+; * AX = error
+; *
+; * USES all regs
+; *
+; * ASSUMES Earth is flat
+; *
+; ***
+
+if DEBUG
+OriginalAx dw ?
+OriginalBx dw ?
+endif
+
+ public MultHandler
+MultHandler proc far
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+if DEBUG
+ mov OriginalAx,ax
+ mov OriginalBx,bx
+endif
+ cmp ah,MultNET ; 11h
+ je @f
+
+;
+; test for AH=B8 and return network presence indicators if it is. Here we are
+; faking calls to MINSES (minimum session layer) and intercept calls AX=B800
+; and AX=B809. Any other AH=B8 call must be for a different TSR/driver
+;
+
+ cmp ah,0b8h
+ jne check_messenger
+ or al,al
+ jnz try_9
+
+;
+; AX=B800. This is the MinSes installation check. Return the magic numbers
+; AL=1 and BX=8 (see doslan\minses\int2f.inc in LANMAN project)
+;
+
+ inc al
+ mov bx,8
+do_iret:iret
+
+try_9:
+ cmp al,9
+ jne chain_previous_handler ; AL not 0 or 9, AH=B8 for somebody else
+
+;
+; AX=B809 is a network installation test. Return the magic numbers AL=1, AH=2
+; for PC Network version 1.2 (this is what minses does, don't complain to me
+; about PC networks, etc, etc)
+;
+
+ mov ax,0201h
+ jmp short do_iret
+
+;
+; MESSENGER TSR uses AH=42h
+;
+
+check_messenger:
+ cmp ah,42h ; multMESSAGE
+ jne chain_previous_handler
+ call MessengerDispatch
+ retf 2 ; return state in flags
+
+chain_previous_handler:
+ jmp OldMultHandler ; not for us; pass it along
+
+;
+; the 2f call is for us. If it is the installation check, return al == -1 else
+; dispatch the byte code at sp+6
+;
+
+@@: sti ; re-enable interrupts
+ or al,al
+ jnz @f
+ or al,-1 ; installation check just returns 0xff
+ ret 2 ; 'or' clears carry
+
+@@: cld ; auto-increment string operations
+
+;
+; this call is something other than an installation check. I really hope that
+; its the AssignOper request, because I don't know what to do if it isn't...
+;
+
+ cmp al,_2F_NET_ASSOPER
+ jmpe is_net_request ; yes - we can do something
+
+;
+; if its the ResetEnvironment request then we have to kill any net state info
+; like mailslot info. Return via iret
+;
+
+ cmp al,_2F_NetResetEnvironment
+ jmpne check_service_call
+
+;
+; deferred loading: don't load VDMREDIR.DLL for VrTerminateDosProcess if no NET
+; calls have been made
+;
+
+ cmp VdmWindowAddr.VrInitialized,1
+ je @f
+ iret
+
+if 0
+ DbgPrintString "NetResetEnvironment received. PDB="
+ push ax ; int 21/51 uses ax,bx
+ push bx
+endif
+
+@@: mov ah,51h
+ int 21h ; get current PDB
+
+if 0
+ DbgPrintHexWord bx ; bx contains PSP of current process
+ pop bx
+ pop ax
+ DbgCrLf
+endif
+
+ mov ax,bx
+ SVC SVC_RDRTERMINATE
+ iret
+
+;
+; if this is a net service call (ah=11h, al=function code 80h through 91h) then
+; dispatch through the service table
+;
+
+check_service_call:
+ cmp al,_2F_NetSpoolOper ; 25h
+ jne @f
+ call NetSpoolStuff
+ jmp short return_to_dos
+@@: cmp al,_2F_NetGetUserName ; 80h
+ jmpb trap_it
+ cmp al,_2F_DosWriteAsyncNmPipe2 ; 91h
+ jmpa trap_it
+
+if 0
+ DbgPrintString "Received Service Request: "
+ DbgPrintHexWord ax
+ DbgCrLf
+endif
+
+ sub ax,(MultNET shl 8) + _2F_NetGetUserName
+ xchg ax,bx
+ shl bx,1
+ mov bx,ServiceDispatchTable[bx]
+ xchg ax,bx
+ call ax
+
+;
+; all calls that come through here are expected to have originated in DOS
+;
+
+return_to_dos:
+ ret 2 ; with interrupts enabled
+;
+; if we get anything else, either from DOS, or some - as yet - unknown source,
+; then just pass it along to the next handler. In the debug version, we alert
+; someone to the fact that we've got an unrecognized call
+;
+
+trap_it:
+ DbgPrintString "Received unrecognized Service Request: "
+ DbgPrintHexWord ax
+ DbgCrLf
+ DbgBreakPoint
+
+ jmp OldMultHandler ; pass it down the chain
+
+;
+; get the original dispatch code back off the stack. We no longer require the
+; current contents of ax
+;
+
+is_net_request:
+ push bp
+ mov bp,sp
+ mov ax,[bp + 8] ; ax <- original code (5fxx)
+ pop bp
+
+if DEBUG
+ mov OriginalAx,ax
+endif
+
+;
+; quick sanity check to make sure that we're processing the right call. If we
+; were called with ax != 5fxx, assume that somebody else is also using the
+; same 2F function call, and chain the next handler. Note: this wouldn't be
+; a very smart thing to do
+;
+
+ sub ah,AssignOper ; ah => 0 it is AssignOper
+ jz @f
+ DbgBreakPoint
+ mov ax,(MultNET shl 8) + _2F_NET_ASSOPER ; restore ax
+ jmps chain_previous_handler
+
+@@: cmp al,5 ; is it 5f00 - 5f05?
+ jnbe @f
+
+;
+; if the function is in the range 0 - 5 then its an old function - dispatch
+; through the old function table
+;
+
+ shl al,1
+ xchg ax,bx
+ mov bx,OldFunctionTable[bx]
+ xchg ax,bx
+ call ax
+ ret 2
+
+@@: sub al,Local_API_RedirGetVersion
+ jz @f ; function is GetRedirVersion
+ cmp al,MAX_TABLE_ENTRIES
+ jbe @f ; UNSIGNED comparison!!!
+
+;
+; get 32-bit support code to dump registers to debug terminal
+;
+
+if DEBUG
+ mov ax,OriginalAx
+ DbgUnsupported
+endif
+
+ mov ax,ERROR_NOT_SUPPORTED
+ stc ; set error indication
+ jmp short set_ax_exit
+
+;
+; the function is within range. Dispatch it. Copy the offset from the dispatch
+; table into ax then call through ax. ax was only required to get us this far
+; and contains no useful information
+;
+
+@@: xchg ax,bx ; need base register, ax not good enough in 286
+ shl bx,1 ; bx is now offset in dispatch table
+ mov bx,MultDispatchTable[bx]; bx is offset of handler routine
+ xchg ax,bx ; restore caller's bx
+ call ax ; go handle it
+ ret 2 ; return without reinstating flags
+
+;
+; Return an error in the caller's ax register. To do this we have to ask DOS to
+; please give us the address of its copy of the user's registers, which it will
+; pass back in DS:SI. We then futz with the copy of the user's reg. Dos will
+; restore this before returning control to the user code. Since we know we have
+; an error situation set the carry flag
+;
+
+set_ax_exit:
+ pushf ; error indicator
+ push ax ; return code
+ DosCallBack GET_USER_STACK ; get pointer to caller's context
+
+ assume ds:nothing ; nuked - actually in DOS somewhere (stack)
+
+ pop [si].User_Ax ; copy saved return code into user's copy
+ popf ; restore error indicator
+ ret 2 ; clear caller's flags from int 2f call
+MultHandler endp
+
+page
+; *** ReturnMode
+; *
+; * Returns the disk or print redirection flag. Flag is 0 if redirection
+; * is paused, else 1
+; *
+; * ENTRY BL = 3
+; * Return print redirection
+; *
+; * BL = 4
+; * Return drive redirection
+; *
+; * EXIT CF = 0
+; * BX = redirection flag: 0 or 1
+; *
+; * CF = 1
+; * error
+; *
+; * USES bx
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+PrintRedirection db 0
+DriveRedirection db 0
+
+ReturnMode proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ DbgPrintString <"5f00 called",13,10>
+ DbgUnsupported
+
+ cmp bl,3
+ jne @f
+ mov bh,PrintRedirection
+ jmp short set_info
+@@: cmp bl,4
+ stc
+ jnz @f
+ mov bh,DriveRedirection
+set_info:
+ and bh,1
+ DosCallBack GET_USER_STACK
+ mov [si].User_Bx,bx
+ clc
+@@: ret
+ReturnMode endp
+
+page
+; *** SetMode
+; *
+; * Pauses or continues drive or printer redirection. Note that we don't
+; * support drive/print pause/continuation from DOS
+; *
+; * ENTRY BL = printer (3) or drive (4) redirection
+; * BH = pause (0) or continue (1)
+; *
+; * EXIT CF = 0
+; * success
+; * CF = 1
+; * ax = ERROR_INVALID_PARAMETER
+; *
+; * USES ax, bx
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+SetMode proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ DbgPrintString <"5f01 called",13,10>
+ DbgUnsupported
+
+ cmp bh,1
+ jnbe bad_parm_exit
+ dec bh ; convert 0 => ff, 1 => 0
+ not bh ; convert ff => 0, 0 => ff
+ sub bl,3
+ jnz try_drive
+ mov PrintRedirection,bh
+ jmp short ok_exit
+try_drive:
+ dec bl
+ jnz bad_parm_exit
+ mov DriveRedirection,bh
+ok_exit:clc
+ ret
+bad_parm_exit:
+ mov ax,ERROR_INVALID_PARAMETER
+ stc
+ ret
+SetMode endp
+
+page
+; *** GetAssignList
+; *
+; * Returns information on enumerated redirections. Old version of
+; * NetUseGetInfo
+; *
+; * ENTRY BX = which item to return (starts @ 0)
+; * DS:SI points to local redirection name
+; * ES:DI points to remote redirection name
+; * AL != 0 means return LSN in BP (GetAssignList2)? ** UNSUPPORTED **
+; *
+; * EXIT CF = 0
+; * BL = macro type (3 = printer, 4 = drive)
+; * BH = 'interesting' bits: 00 = valid, 01 = invalid
+; * CX = user word
+; * DS:SI has device type
+; * ES:DI has net path
+; * CF = 1
+; * AX = ERROR_NO_MORE_FILES
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+GetAssignList proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ xor al,al
+ jmp short @f
+GetAssignList2:
+ or al,-1
+@@: SVC SVC_RDRGET_ASG_LIST
+ jc @f
+ push bx
+ push cx
+ DosCallBack GET_USER_STACK
+ pop [si].User_Cx
+ pop [si].User_Bx
+ clc
+@@: ret
+GetAssignList endp
+
+page
+; *** DefineMacro
+; *
+; * Old version of NetUseAdd
+; *
+; * ENTRY BL = device type
+; * 3 = printer
+; * 4 = drive
+; * bit 7 on means use the wksta password when connecting
+; * CX = user word
+; * DS:SI = local device
+; * Can be NUL device name, indicating UNC use
+; * ES:DI = remote name
+; *
+; * EXIT CF = 0
+; * success
+; *
+; * CF = 1
+; * AX = ERROR_INVALID_PARAMETER (87)
+; * ERROR_INVALID_PASSWORD (86)
+; * ERROR_INVALID_DRIVE (15)
+; * ERROR_ALREADY_ASSIGNED (85)
+; * ERROR_PATH_NOT_FOUND (3)
+; * ERROR_ACCESS_DENIED (5)
+; * ERROR_NOT_ENOUGH_MEMORY (8)
+; * ERROR_NO_MORE_FILES (18)
+; * ERROR_REDIR_PAUSED (72)
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+DefineMacro proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ SVC SVC_RDRDEFINE_MACRO
+ ret
+DefineMacro endp
+
+page
+; *** BreakMacro
+; *
+; * Old version of NetUseDel
+; *
+; * ENTRY DS:SI = buffer containing device name of redirection to break
+; *
+; * EXIT
+; *
+; * USES
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+BreakMacro proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ SVC SVC_RDRBREAK_MACRO
+ ret
+BreakMacro endp
+
+page
+; *** GetRedirVersion
+; *
+; * Returns the version number of this redir in ax
+; *
+; * ENTRY none
+; *
+; * EXIT ax = version #
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+GetRedirVersion proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ mov ax,300
+ clc
+ ret
+GetRedirVersion endp
+
+page
+; *** NetGetUserName
+; *
+; * Returns the current logged on user name (if any)
+; *
+; * ENTRY CX = buffer length
+; * ES:DI = buffer
+; *
+; * EXIT CF = 1
+; * AX = Error code
+; * NERR_BufTooSmall
+; * Buffer not large enough for user name
+; *
+; * CF = 0
+; * CX:BX = UID (ignored)
+; * ES:DI = user name
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+NetGetUserName proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+ mov bx,1 ; bx == 1: check name length against cx
+ call NetGetUserNameSvcCall
+
+ DbgBreakPoint
+
+ jc @f ; error
+
+;
+; no error: the user name was copied into ES:DI. Set the caller's cx and bx to
+; return a UID. We could leave this as a random number since it is not used,
+; but we set it to a known value
+;
+
+ DosCallBack GET_USER_STACK
+ xor ax,ax ; clears carry again
+ mov [si].User_Cx,ax
+ inc ax
+ mov [si].User_Bx,ax ; UID = 0x00000001
+@@: ret
+NetGetUserName endp
+
+page
+; *** DefaultServiceError
+; *
+; * Default error routine - returns ERROR_INVALID_FUNCTION for any API
+; * function which we don't support. Reached exclusively through dispatch
+; * table
+; *
+; * ENTRY none
+; *
+; * EXIT CF = 1
+; * AX = ERROR_INVALID_FUNCTION
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+DefaultServiceError proc near
+ assume cs:ResidentCode
+ assume ds:nothing
+
+; DbgPrintString <"DefaultServiceError Ax="
+; DbgPrintHexWord OriginalAx
+; DbgPrintString <" Bx=">,NOBANNER
+; DbgPrintHexWord OriginalBx
+; DbgCrLf
+
+;
+; cause debug output to go to debug port: making invalid BOP will dump registers
+;
+
+if DEBUG
+ mov ax,OriginalAx
+ mov bx,OriginalBx
+ DbgUnsupported
+endif
+ mov ax,ERROR_INVALID_FUNCTION
+ stc
+ ret
+DefaultServiceError endp
+
+page
+; *** NetGetEnumInfo
+; *
+; * Routine which returns various internal redir variables based on an
+; * index
+; *
+; * ENTRY BL = index
+; * 0 = CDNames
+; * 1 = Comment (not supported)
+; * 2 = LanRoot
+; * 3 = ComputerName
+; * 4 = UserName
+; * 5 = Primary Domain
+; * 6 = Logon Server
+; * 7 = Mailslots Yes/No
+; * 8 = RIPL Yes/No
+; * 9 = Get RIPL UNC
+; * 10 = Get RIPL drive
+; * 11 = Start marking CON_RIPL
+; * 12 = Stop marking CON_RIPL
+; * 13 = exchange int17 handlers
+; * 14 = primary WrkNet
+; *
+; * es:di = buffer for returned info
+; *
+; * EXIT CF = 0
+; * success
+; * CF = 1
+; * AX = ERROR_INVALID_FUNCTION
+; *
+; * USES ax, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+NetGetEnumInfo proc near
+ or bl,bl
+ jnz @f
+
+;
+; CDNames (Computer and Domain Names)
+;
+
+; DbgPrintString <"NetGetEnumInfo: return CDNames", 13, 10>
+ SVC SVC_RDRGETCDNAMES
+ ret
+
+;
+; Comment - nothing returned by this or the original redir (ax = invalid
+; function, but carry clear?)
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return Comment", 13, 10>
+ mov ax,ERROR_INVALID_FUNCTION
+ ret
+
+;
+; LanRoot
+;
+
+@@: dec bl
+ jnz check_computername
+ DbgPrintString <"NetGetEnumInfo: return LanRoot", 13, 10>
+ pusha ; save user gp regs
+ push es ; save user seg regs
+ push ds
+ mov si,ResidentData
+ mov ds,si
+ assume ds:ResidentData
+ mov si,offset LanRoot
+ mov cx,LanRootLength
+ shr cx,1 ; cx = number of words to copy, cf=lsb
+ cld
+ rep movsw ; copy words
+ jnc @f ; if not odd number of bytes skip
+ movsb ; copy single byte
+@@: pop ds ; restore user seg regs
+ pop es
+ popa ; restore user gp regs
+ ret
+
+;
+; ComputerName
+;
+
+check_computername:
+ dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return ComputerName", 13, 10>
+ SVC SVC_RDRGETCOMPUTERNAME
+ ret
+;
+; Username
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return UserName", 13, 10>
+
+;
+; This is also the entry point for NetGetUserName, which return some info in
+; cx:bx (the (ignored) UID). We could leave this random, but we set it to a
+; known value, just in case
+;
+
+NetGetUserNameSvcCall:
+ SVC SVC_RDRGETUSERNAME ; either 0 if for NetGetEnumInfo or 1 if NetGetUserName
+ ret
+
+;
+; Primary domain name
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return DomainName", 13, 10>
+ SVC SVC_RDRGETDOMAINNAME
+ ret
+
+;
+; Logon server name
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return LogonServerName", 13, 10>
+ SVC SVC_RDRGETLOGONSERVER
+ ret
+
+;
+; Mailslots YN
+;
+; Mailslots are always enabled with this redir, so return yes (TRUE, 1)
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: Mailslot check", 13, 10>
+ mov ax,1
+ ret
+
+;
+; RIPL YN
+;
+; This redir doesn't know anything about RPL, so return no (FALSE, 0)
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: RIPL check", 13, 10>
+ xor ax,ax
+ ret
+
+;
+; RIPL UNC
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return RIPL UNC", 13, 10>
+ jmps DefaultServiceError
+
+;
+; RIPL drive
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return RIPL drive", 13, 10>
+ jmps DefaultServiceError
+
+;
+; Start marking CON_RIPL
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: Start marking CON_RIPL", 13, 10>
+ jmps DefaultServiceError
+
+;
+; Stop marking CON_RIPL
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: Stop marking CON_RIPL", 13, 10>
+ jmps DefaultServiceError
+
+;
+; exchange int 17 handlers
+;
+; We don't support this so return error
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: exchange int 17 handlers", 13, 10>
+ jmps DefaultServiceError
+
+;
+; primary WrkNet
+;
+; This is transport-specific so we don't return anything except error
+;
+
+@@: dec bl
+ jnz @f
+ DbgPrintString <"NetGetEnumInfo: return primary WrkNet", 13, 10>
+ jmps DefaultServiceError
+
+;
+; anything else - return an error
+;
+
+@@: DbgPrintString "NetGetEnumInfo: unknown request: "
+ DbgPrintHexWord bx
+ DbgCrLf
+ jmps DefaultServiceError
+NetGetEnumInfo endp
+
+page
+; *** NetSpoolStuff
+; *
+; * Gets control from INT 2f/ax=1125h. This really has no use in NTVDM,
+; * but we supply it because DOS has started making 1125 calls. Spooling
+; * in NTVDM has nothing to do with the Redir TSR. Historically, printing
+; * over the net was handled by the redir & this call was used (amongst
+; * other things) to flush & close all spool files when an app terminated
+; *
+; * ENTRY AL = 7 Return truncate flag in DL (DH destroyed)
+; * AL = 8 Set truncate flag from DL (must be 0 or 1)
+; * AL = 9 Close all spool files
+; *
+; * EXIT CF = 1
+; * AX = ERROR_INVALID_FUNCTION
+; *
+; * USES ax, dx, si, ds, flags
+; *
+; * ASSUMES nothing
+; *
+; ***
+
+PrintTruncate db 0
+
+NetSpoolStuff proc near
+ sub al,9 ; most common case first
+ jnz @f
+
+net_spool_stuff_good_exit:
+ xor ax,ax ; nothing to do for CloseAllSpool!
+ ret
+
+@@: inc al
+ jnz @f ; must be get, or invalid
+ mov ax,ERROR_INVALID_PARAMETER
+ cmp dl,1 ; must be 0 or 1
+ ja net_spool_stuff_error_exit
+ mov PrintTruncate,dl
+ jmp short net_spool_stuff_good_exit
+@@: inc al
+ mov ax,ERROR_INVALID_FUNCTION
+ jnz net_spool_stuff_error_exit
+
+;
+; return PrintTruncate flag to caller (app)
+;
+
+ DosCallBack GET_USER_STACK
+ mov dl,PrintTruncate
+ xor dh,dh
+ mov [si].User_Dx,dx
+ ret
+
+net_spool_stuff_error_exit:
+ stc
+ ret
+NetSpoolStuff endp
+
+page
+if DEBUG
+ even
+
+ public Old21Handler
+Old21Handler dd ?
+
+ public CheckInt21Function5e
+CheckInt21Function5e proc far
+ assume cs:ResidentCode
+ assume ds:nothing
+ assume es:nothing
+ assume ss:nothing
+
+; cmp ah,5eh
+; jnz @f
+; DbgUnsupported
+@@: jmp Old21Handler ; let DOS handle it. DOS returns to caller
+CheckInt21Function5e endp
+endif
+
+ResidentCodeEnd
+end
diff --git a/private/mvdm/dos/v86/redir/segorder.inc b/private/mvdm/dos/v86/redir/segorder.inc
new file mode 100644
index 000000000..689c62fa2
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/segorder.inc
@@ -0,0 +1,113 @@
+;/*++
+;
+;Copyright (c) 1991 Microsoft Corporation
+;
+;Module Name:
+;
+; segorder.inc
+;
+;Abstract:
+;
+; This module contains the segment order and segment macros
+;
+;Author:
+;
+; Richard Firth (rfirth) 05-Sep-1991
+;
+;Environment:
+;
+; Dos mode only
+;
+;Notes:
+;
+; When initially loaded, the NT VDM redir has the following order:
+;
+; +----------------------+
+; | |
+; | Resident Code |
+; | |
+; +----------------------+
+; | |
+; | Resident Data |
+; | |
+; +----------------------+ ----------------+
+; | | |
+; | Initialisation Code | <- entry point v
+; | |
+; +----------------------+
+; | | all the stuff between these
+; | Initialisation Data | arrows is discarded if we stay
+; | | resident. Note that the redir
+; +----------------------+ does not uninstall
+; | |
+; | Initialisation Stack | ^
+; | | |
+; +----------------------+ ----------------+
+;
+;Revision History:
+;
+; 05-Sep-1991 rfirth
+; Created
+;
+;--*/
+
+
+
+ResidentStart segment public para 'code'
+ResidentStart ends
+
+ResidentCode segment public word 'code'
+ResidentCode ends
+
+ResidentData segment public word 'data'
+ResidentData ends
+
+ResidentEnd segment public para 'data'
+ResidentEnd ends
+
+ResidentGroup group ResidentStart, ResidentCode, ResidentData, ResidentEnd
+
+InitCode segment public para 'init'
+InitCode ends
+
+InitData segment public word 'init'
+InitData ends
+
+InitStack segment stack para 'stack'
+InitStack ends
+
+;
+; macros to avoid having to type in/possibly alter segment header guff
+;
+
+ResidentCodeStart macro
+ResidentCode segment public word 'code'
+endm
+
+ResidentCodeEnd macro
+ResidentCode ends
+endm
+
+ResidentDataStart macro
+ResidentData segment public word 'data'
+endm
+
+ResidentDataEnd macro
+ResidentData ends
+endm
+
+InitCodeStart macro
+InitCode segment public para 'init'
+endm
+
+InitCodeEnd macro
+InitCode ends
+endm
+
+InitDataStart macro
+InitData segment public word 'init'
+endm
+
+InitDataEnd macro
+InitData ends
+endm
diff --git a/private/mvdm/dos/v86/redir/usa/redirmsg.inc b/private/mvdm/dos/v86/redir/usa/redirmsg.inc
new file mode 100644
index 000000000..e08574077
--- /dev/null
+++ b/private/mvdm/dos/v86/redir/usa/redirmsg.inc
@@ -0,0 +1,45 @@
+page ,132
+
+if 0
+/*++
+
+Copyright (c) 1991 Microsoft Corporation
+
+Module Name:
+
+ redirmsg.inc
+
+Abstract:
+
+ Contains messages which we might want to internacionalize (geddit senorita?)
+
+Author:
+
+ Richard L Firth (rfirth) 10-Mar-1993
+
+Environment:
+
+ Dos mode
+
+Revision History:
+
+ 10-Mar-1993 RFirth
+ Created
+
+--*/
+endif
+
+CARRIAGE_RETURN equ 13
+LINE_FEED equ 10
+
+bad_ver_msg db "The program cannot be run on this version of MS-DOS", CARRIAGE_RETURN, LINE_FEED
+BAD_VER_MSG_LEN equ $-bad_ver_msg
+ db '$' ; for INT 21/09 display string
+
+already_loaded_msg db "The Vdm Redirector is already loaded", CARRIAGE_RETURN, LINE_FEED
+ALREADY_LOADED_MSG_LEN equ $-already_loaded_msg
+
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
+;cannot_load_msg db "The Vdm Redirector cannot be loaded", CARRIAGE_RETURN, LINE_FEED
+;CANNOT_LOAD_MSG_LEN equ $-cannot_load_msg
+; OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD OLD
diff --git a/private/mvdm/dos/v86/tools/src/buildidx/buildidx.c b/private/mvdm/dos/v86/tools/src/buildidx/buildidx.c
new file mode 100644
index 000000000..6e1bce188
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/buildidx/buildidx.c
@@ -0,0 +1,328 @@
+/*
+ PROGRAM NAME BUILDIDX.C Program by Sam W Nunn Sep 24 1987
+
+ To create from a file of messages a second file with offsets to the
+ message headers of the first file, the quantity of messages with it,
+ and update the level of the level of the files unless there are no
+ changes to the files ( both files already exist with accurate data
+ in the second file ).
+
+ One argument from command line is needed : input file spec
+
+ Sudeepb 03-May-1991 Ported for NT DOSEm
+*/
+
+
+#define LINT_ARGS ON /* Not needed in final version. */
+#include <stdio.h> /* Req. for feof, fgets, printf, fputs */
+ /* rewind. */
+#include <stdlib.h>
+#include <io.h> /* Req. for rename */
+#include <process.h> /* Req. for exit */
+#include <ctype.h> /* Req for isdigit, isalpha */
+#include <string.h> /* Required for strcpy, strcat, */
+ /* strlen */
+#define LNMAX 200 /* Max length of a line. */
+#define LVMAX 4 /* Max length of the message level. */
+#define FNMAX 64 /* Max length of the file spec. */
+#define TEMPFILE "tempfile.msg\0"
+
+ char fnameA[FNMAX]; /* File spec from command line. */
+ char fnameB[FNMAX]; /* File spec for index file. */
+
+void main(argc, argv)
+
+ int argc; /* Quantity of command parms. */
+ char *argv[]; /* Command line input to Message. */
+
+ {
+ int len, /* File spec character length */
+ comparable, /* Comparable %1.IDX and %1.MSG files ? */
+ Msg_Tot_Pos, /* Position on header line of total. */
+ Msg_Cnt_Str, /* String converted to int. */
+ Msg_Cnt; /* Quantity of messages per header. */
+ char msgline[LNMAX] , /* A line read from message file. */
+ filespec[FNMAX], /* Name and location of final ?.MSG */
+ header[10],
+ idxline[LNMAX] ; /* A line read from index file. */
+ long header_offset ; /* Byte count to header line. */
+ long header_os_str ; /* Byte count to header line. */
+ long return_offset ; /* Byte count to header line. */
+ FILE *msgfile , /* Message list to be checked */
+ *idxfile ; /* Index file to the messages. */
+
+
+ if ( argc != 2 ) /* Look for file to use */
+ { /* from command line. */
+ printf("Incorrect number of parms given to BUILDIDX.") ;
+ return ; /* Print error and quit. */
+ }
+ else
+ {
+ strcpy(fnameA,argv[1]) ; /* Get the first file spec. */
+ strcpy(fnameB,argv[1]) ; /* Get the second file spec. */
+ len = strlen(fnameB) ;
+ fnameB[len-3] = (char)73 ; /* Put the IDX extension on it. */
+ fnameB[len-2] = (char)68 ;
+ fnameB[len-1] = (char)88 ;
+ }
+ if (( msgfile = fopen(fnameA,"r")) != NULL ) /* Exist input file ? */
+ if (( idxfile = fopen(fnameB,"r")) != NULL ) /* Exist second file ? */
+ comparable = 1 ;
+ else
+ comparable = 0 ;
+ else
+ {
+ perror("Could't open message data file. \n") ;
+ exit(1);
+ }
+ if ( comparable )
+ { /* Test the Message Levels. */
+ fgets(msgline,LNMAX,msgfile) ;
+ fgets(idxline,LNMAX,idxfile) ;
+ if ( strcmp(msgline,idxline) == 0 )
+ comparable = 1 ;
+ else
+ comparable = 0 ;
+ }
+ else
+ printf("Can not find index file of the same message file level.\n") ;
+ header_offset = ftell(msgfile) ; /* Test header offset to the one */
+ fscanf(msgfile,"%s",header) ; /* recorded in the message file. */
+ fscanf(msgfile,"%lx",&header_os_str) ; /* Header offset. */
+ fscanf(msgfile,"%d",&Msg_Cnt_Str) ; /* Total messages. */
+ if ( header_offset != header_os_str )
+ comparable = 0 ;
+ else
+ fseek(msgfile,header_offset,0) ;
+ fgets(msgline,LNMAX,msgfile) ; /* Skip to header lines. */
+ while ( !feof(msgfile) && !feof(idxfile) && comparable )
+ { /* Test the message header lines. */
+ fgets(idxline,LNMAX,idxfile) ;
+ if( strcmp(idxline, msgline ) == 0 )
+ Msg_Cnt = 0 ; /* Msg_Cnt reset to count messages. */
+ else
+ comparable = 0 ;
+ header_offset = ftell(msgfile) ;
+ fgets(msgline,LNMAX,msgfile) ;
+ while ( !isalpha(msgline[0]) && !feof(msgfile) && comparable )
+ {
+ while ( !isdigit(msgline[0]) && !isalpha(msgline[0]) && !feof(msgfile) )
+ {
+ header_offset = ftell(msgfile) ;
+ fgets(msgline,LNMAX,msgfile) ;
+ }
+ while ( isdigit(msgline[0]) && !feof(msgfile) )
+ { /* Check the number of messages. */
+ Msg_Cnt++ ;
+ header_offset = ftell(msgfile) ;
+ fgets(msgline,LNMAX,msgfile) ;
+ }
+ }
+ if ( Msg_Cnt == Msg_Cnt_Str )
+ comparable = 1 ;
+ else
+ {
+ comparable = 0 ;
+ printf("The number of messages has changed. \n");
+ }
+ if (!feof(msgfile))
+ { /* Test header offset to the one */
+ return_offset = ftell(msgfile) ; /* recorded in the message file. */
+ fseek(msgfile,header_offset,0) ;
+ fscanf(msgfile,"%s",header) ;
+ fscanf(msgfile,"%lx",&header_os_str) ;
+ fscanf(msgfile,"%d",&Msg_Cnt_Str) ; /* Total messages. */
+ if ( header_offset != header_os_str )
+ comparable = 0 ;
+ else
+ fseek(msgfile,return_offset,0) ;
+ }
+ }
+ if ( comparable && feof(msgfile) && !feof(idxfile) )
+ { /* The two files compared OK. */
+ printf("Message file and index file are not changed.\n") ;
+ fclose(msgfile) ;
+ fclose(idxfile) ;
+ }
+ else /* Rebuild %1.MSG file then %1.IDX file. */
+ {
+ fclose(msgfile) ;
+ fclose(idxfile) ;
+ strcpy(filespec, argv[1]) ;
+ printf("Message file and index file will be updated.\n") ;
+ updatemsg() ; /* Make a new %1.MSG from the old. */
+ bldindex() ; /* Make an index file( %1.IDX ). */
+ unlink(fnameA) ; /* Get ridd of the old file. */
+ rename(TEMPFILE,filespec) ; /* Give output file the old file name. */
+ }
+ }
+
+
+ updatemsg()
+ {
+ int c, /* Charactor bucket for temp. storage */
+ Message_Level, /* Level of the message file. */
+ File_Offset, /* Offset to find title. */
+ Msg_Cnt, /* Quantity of messages per title. */
+ First_line , /* Control recording qty.of prev.msg. */
+ blank_line , /* A blank line from input sets to 1. */
+ title, /* Flag to indicate strg. is a title. */
+ index; /* Index into array. */
+ long bycnt_ot_fl , /* Byte count read from output file. */
+ MsgCntLoc , /* Location of the count of messages. */
+ temp_end ; /* Byte count read from output file. */
+ char File_in[LNMAX]; /* A line read from input file. */
+ FILE *inpfile , /* Message file to be updated. */
+ *outfile ; /* Updated message file. */
+
+ inpfile = fopen(fnameA,"r") ; /* Open file for input. */
+ outfile = fopen(TEMPFILE,"w"); /* Open file for output. */
+ Msg_Cnt = 0 ;
+ First_line = 1 ;
+ title = 0 ;
+ blank_line = 0 ;
+ /* Increment the Message level for the output file. */
+ fscanf(inpfile,"%d",&Message_Level) ; /* Read the old level. */
+ Message_Level++ ;
+ fprintf(outfile,"%04d\n",Message_Level) ; /* Output the new level. */
+ fgetc(inpfile); /* Skip over eol. */
+ while ( !feof(inpfile)) /* Stop when whole file has been read. */
+ {
+ while (( c = fgetc(inpfile)) == (char)32 ) ;
+ while ( c == (char)'\t')
+ c = fgetc(inpfile); /* Skip over leading blank spaces. */
+ index = 0 ;
+ if ( isdigit(c) ) /* Starting with a number ? */
+ {
+ File_in[index] = c ;
+ Msg_Cnt = Msg_Cnt + 1 ; /* Add to the quantity of messages. */
+ index = index + 1 ;
+ while (((c = fgetc(inpfile))!= (char)'\n' ) &&
+ ( index < LNMAX ) && !feof(inpfile))
+ { /* Stop at the end of line char. */
+ File_in[index] = c ;
+ index++ ;
+ }
+ File_in[index] = (char)'\n'; /* Add end of line to string. */
+ File_in[index+1] = (char)'\0'; /* Add end of string. */
+ }
+ else
+ {
+ if ( isalpha(c))
+ { /* Found the title of the module. */
+ if ( First_line ) /* Only on the first header. */
+ {
+ bycnt_ot_fl = ftell(outfile) ; /* Locate header offset. */
+ First_line = 0 ;
+ }
+ else
+ { /* Go back and update */
+ temp_end = ftell(outfile) ; /* the count of messages */
+ fseek(outfile,MsgCntLoc,0) ; /* under that header. */
+ fprintf(outfile,"%04d",Msg_Cnt) ;
+ Msg_Cnt = 0 ; /* Reset the msg. count. */
+ bycnt_ot_fl = temp_end ; /* Done with that, so off */
+ fseek(outfile,temp_end,0) ; /* to work on the next */
+ } /* header. */
+ title = 1 ;
+ File_in[index] = c ; /* Put together the header. */
+ index = index +1 ;
+ while (((c = fgetc(inpfile)) != (char)32 ) && ( c != (char)'\n') &&
+ ( c != (char)'\t'))
+ {
+ File_in[index] = c ; /* Save only the first str. */
+ index++ ; /* for the header. */
+ }
+ File_in[index] = (char)'\0';
+ /* Get ridd of the rest of the line, */
+ while (c != (char)'\n' ) /* we have no use for it. */
+ c = fgetc(inpfile) ;
+ }
+ else /* Line is PART of a define msg. */
+ {
+ while ( c == (char)'\t') /* Control the number of tabs */
+ c = fgetc(inpfile) ; /* to just one leading tab. */
+ /* One tab helps to make it visable. */
+ if ( c == (char)34 ) /* Looking for a quote mark. */
+ {
+ File_in[index] = (char)'\t' ;
+ index = index + 1 ; /* Get the whole message line */
+ File_in[index] = c ; /* into the string. */
+ index = index + 1 ;
+ while (((c = fgetc(inpfile)) != (char)'\n' ) &&
+ ( index < LNMAX ) && !feof(inpfile))
+ {
+ File_in[index] = c ;
+ index++ ; /* Stop at the end of line char. */
+ }
+ File_in[index] = (char)'\n'; /* Add end of line to string. */
+ index = index + 1 ;
+ File_in[index] = (char)'\0'; /* Add end of string. */
+ }
+ else
+ { /* Must not be a line to save. */
+ blank_line = 1 ;
+ /* Get ridd of the rest of the line, */
+ while (c != (char)'\n'&& !feof(inpfile) ) /* we have no use for it. */
+ c = fgetc(inpfile) ;
+ }
+ } /* End test for Alpha char. at the front of the line. */
+ } /* End test for a Digit at the front of the line. */
+ if ( title && !feof(inpfile))
+ { /* Output to the new file. */
+ fprintf(outfile,"%-8.8s %08lx %04d\n",File_in,bycnt_ot_fl,Msg_Cnt) ;
+ MsgCntLoc = ftell(outfile)-6 ;
+ title = 0 ;
+ }
+ else
+ {
+ title = 0 ;
+ if ( !First_line && !blank_line )
+ fputs(File_in,outfile) ; /* Output to the new file. */
+ else
+ blank_line = 0 ;
+ } /* End test for title line to output. */
+ } /* While not end of file */
+ if ( feof(inpfile) && Msg_Cnt > 0 )
+ {
+ temp_end = ftell(outfile) ; /* Put down the last */
+ fseek(outfile,MsgCntLoc,0) ; /* update to the quantity */
+ fprintf(outfile,"%04d",Msg_Cnt) ; /* of messages listed. */
+ fseek(outfile,temp_end,0) ;
+ printf("Message file updated.\n") ;
+ }
+ else
+ { /* Nothing else to do ! Might as well finish. */
+ printf("Message file update completed.\n") ;
+ }
+ /*cleanx(*inpfile, *outfile) ;*/
+ fclose(inpfile) ;
+ fclose(outfile) ;
+ } /* End of updatemsg */
+
+ bldindex()
+ {
+ FILE *msgf ;
+ FILE *idxf;
+ char msgline[LNMAX] ; /* A line read from input file. */
+
+ msgf = fopen(TEMPFILE,"r");
+ /*msgf = fopen(fnameA,"r"); */
+ idxf = fopen(fnameB,"w"); /* Open to write to %1.IDX file */
+ fgets(msgline,LNMAX,msgf) ;
+ fputs(msgline,idxf) ; /* Output the message file level. */
+ fgets(msgline,LNMAX,msgf) ;
+ while ( isalpha(msgline[0]) && !feof(msgf) )
+ {
+ fputs(msgline,idxf) ; /* Save header in the index file. */
+ fgets(msgline,LNMAX,msgf) ;
+ while ( !isalpha(msgline[0]) && !feof(msgf) )
+ fgets(msgline,LNMAX,msgf) ; /* Not saveing non-header lines. */
+ }
+ printf("Index file updated.\n") ;
+ fclose(msgf) ;
+ fclose(idxf) ;
+ }
+
+
diff --git a/private/mvdm/dos/v86/tools/src/buildidx/buildidx.def b/private/mvdm/dos/v86/tools/src/buildidx/buildidx.def
new file mode 100644
index 000000000..236d0940c
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/buildidx/buildidx.def
@@ -0,0 +1,7 @@
+NAME STRIPZ WINDOWCOMPAT
+
+DESCRIPTION 'DOS Message Index Builder'
+
+STACKSIZE 4096
+
+HEAPSIZE 16384
diff --git a/private/mvdm/dos/v86/tools/src/buildidx/makefile b/private/mvdm/dos/v86/tools/src/buildidx/makefile
new file mode 100644
index 000000000..cdec6645b
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/buildidx/makefile
@@ -0,0 +1,9 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+# builidx.exe is a utility used by DOSEm for internationalization work
+# of message files.
+
+!INCLUDE $(NTMAKEENV)\maketool.def
diff --git a/private/mvdm/dos/v86/tools/src/buildidx/sources b/private/mvdm/dos/v86/tools/src/buildidx/sources
new file mode 100644
index 000000000..89bfdead1
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/buildidx/sources
@@ -0,0 +1,14 @@
+MAJORCOMP=v86tools
+MINORCOMP=buildidx
+
+TARGETNAME=buildidx
+TARGETPATH=..\..\bin
+
+INCLUDES=\nt\public\sdk\inc
+
+SOURCES=buildidx.c
+
+BUILDTOOL=1
+TOOL_MODEL=/AS /G2s
+TOOL_LIBS=\nt\private\tools\lib\slibcep \nt\private\tools\lib\toolsp/NOD
+TOOL_TYPE=WINDOWCOMPAT
diff --git a/private/mvdm/dos/v86/tools/src/getsize/getsize.c b/private/mvdm/dos/v86/tools/src/getsize/getsize.c
new file mode 100644
index 000000000..68fd47792
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/getsize/getsize.c
@@ -0,0 +1,205 @@
+
+/***************************************************************************
+
+ Module Name: getsize
+
+ Description:
+ Obtains BIOS_DATA (bios data size), BIOS_CODE ( bios code size )
+ from ..\bios\msbio.map and DOSDATA (dos data size) from msdos.map
+ and compares it with existing values in bdsiz.inc. If the values are
+ update bdsiz.inc with the new values.
+
+ Sudeepb 03-May-1991 Ported for NT DOSEm.
+***************************************************************************/
+
+
+#include<stdio.h>
+#include<process.h>
+#include<string.h>
+#define MAXLINE 200
+#define MAXWORD 64
+
+int getline(s, lim, fileptr)
+char *s;
+int lim;
+FILE *fileptr;
+
+{
+
+ int c, i;
+
+ for (i=0; (i < lim-1) && ((c=fgetc(fileptr)) != EOF) && (c!='\n'); ++i)
+ s[i] = c;
+
+ if (c == '\n')
+ s[i++] = c;
+
+ s[i] = '\0';
+ return(i);
+}
+
+scanline(s, prev, template)
+char *s, *template, *prev ;
+
+{
+
+ char str[MAXWORD];
+ int i = 0;
+
+ while ( *s == ' ')
+ s++;
+
+ while ( *s != '\n' )
+ {
+ while( (*s != ' ') && (*s != '\n') && (*s != '\t'))
+ {
+ str[i++] = *s++;
+ }
+ str[i] = '\0';
+
+ if ( (*s == ' ') || (*s == '\t') )
+ s++;
+
+ /* printf("%s\n", str); */
+
+ if ( strcmp( str, template) == 0 )
+ return(0);
+
+ strcpy(prev, str);
+
+ i = 0;
+ }
+
+ return(-1);
+
+}
+
+
+void main()
+{
+ FILE *fp1, *fp2;
+ char buffer[MAXLINE],
+ prev[MAXWORD],
+ newdosdata[MAXWORD],
+ newbiosdata[MAXWORD],
+ newbioscode[MAXWORD],
+ olddosdata[MAXWORD],
+ oldbiosdata[MAXWORD],
+ oldbioscode[MAXWORD];
+
+
+ int len, scanres, changed = 0;
+
+ if ( (fp1 = fopen("ntdos.map", "r")) == NULL )
+ {
+ printf("getsize: cannot open ntdos.map\n");
+ exit(0);
+ }
+
+ if ( (fp2 = fopen("..\\bios\\ntio.map", "r")) == NULL )
+ {
+ printf("getsize: cannot open ntio.map\n");
+ exit(0);
+ }
+
+
+ /* Look for line containing string DOSDATA in msdos.map */
+
+ do
+ {
+ len = getline(buffer, MAXLINE, fp1);
+ scanres = scanline(buffer, prev, "DOSDATA");
+
+ }
+ while ( (scanres != 0) && (len !=0) ) ;
+
+ /* Save word before DOSDATA (dosdata size) in newdosdata. */
+ strcpy(newdosdata, prev);
+
+
+ /* Look for line containing string BIOS_DATA in msbio.map */
+
+ do
+ {
+ len = getline(buffer, MAXLINE, fp2);
+ scanres = scanline(buffer, prev, "BIOS_DATA");
+ }
+ while ( (scanres != 0) && (len !=0) ) ;
+
+ /* Save word before BIOS_DATA (biosdata size) in newbiosdata. */
+ strcpy(newbiosdata, prev);
+
+
+ /* Seek back to beginning of MSBIO.MAP */
+ if ( fseek(fp2, 0L, SEEK_SET) )
+ printf("getsize: fseek failed on msbio.map\n");
+
+ /* Look for line containing string BIOS_CODE in msbio.map */
+
+ do
+ {
+ len = getline(buffer, MAXLINE, fp2);
+ scanres = scanline(buffer, prev, "BIOS_CODE");
+ }
+ while ( (scanres != 0) && (len !=0) ) ;
+
+ /* Save word before BIOS_CODE (bios code size) in newbioscode. */
+ strcpy(newbioscode, prev);
+
+ fclose(fp1);
+ fclose(fp2);
+
+ if ( (fp1 = fopen("..\\..\\inc\\bdsize.inc", "r")) == NULL )
+ {
+ printf("getsize: cannot open origin.inc\n");
+ exit(0);
+ }
+
+ /* read in existing values of bios code , bios data and dos data */
+ /* size from bdsize.inc. */
+
+ fscanf(fp1, "%s%s%s", oldbiosdata, oldbiosdata, oldbiosdata);
+ fscanf(fp1, "%s%s%s", oldbioscode, oldbioscode, oldbioscode);
+ fscanf(fp1, "%s%s%s", olddosdata, olddosdata, olddosdata);
+
+ printf("oldbiosdata=%s newbiosdata=%s\n",oldbiosdata, newbiosdata);
+ printf("oldbioscode=%s newbioscode=%s\n",oldbioscode, newbioscode);
+ printf("olddosdata=%s newdosdata=%s\n",olddosdata, newdosdata);
+
+
+ /* Check to see if any one of them has changed */
+
+ if ( strcmp(oldbiosdata, newbiosdata) != 0 )
+ changed = 1;
+ else if ( strcmp(oldbioscode, newbioscode) != 0 )
+ changed = 1;
+ else if ( strcmp(olddosdata, newdosdata) != 0 )
+ changed = 1;
+
+ /* if not changed, done. */
+
+ if (changed == 0)
+ exit(0);
+
+
+ /* One of the values has changed update bdsize.inc */
+
+ fclose(fp1);
+
+ if ( (fp1 = fopen("..\\inc\\bdsize.inc", "w")) == NULL )
+ {
+ printf("getsize: cannot open origin.inc\n");
+ exit(0);
+ }
+
+ fprintf(fp1, "%s %s %s\n", "BIODATASIZ", "EQU", newbiosdata);
+ fprintf(fp1, "%s %s %s\n", "BIOCODESIZ", "EQU", newbioscode);
+ fprintf(fp1, "%s %s %s\n", "DOSDATASIZ", "EQU", newdosdata);
+}
+
+
+
+
+
+
+
diff --git a/private/mvdm/dos/v86/tools/src/getsize/getsize.def b/private/mvdm/dos/v86/tools/src/getsize/getsize.def
new file mode 100644
index 000000000..5f961c768
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/getsize/getsize.def
@@ -0,0 +1,7 @@
+NAME GETSIZE WINDOWCOMPAT
+
+DESCRIPTION 'Utility to get DOS data,code sizes'
+
+STACKSIZE 4096
+
+HEAPSIZE 16384
diff --git a/private/mvdm/dos/v86/tools/src/getsize/makefile b/private/mvdm/dos/v86/tools/src/getsize/makefile
new file mode 100644
index 000000000..ac264b66c
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/getsize/makefile
@@ -0,0 +1,6 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\maketool.def
diff --git a/private/mvdm/dos/v86/tools/src/getsize/sources b/private/mvdm/dos/v86/tools/src/getsize/sources
new file mode 100644
index 000000000..2ab91bb60
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/getsize/sources
@@ -0,0 +1,14 @@
+MAJORCOMP=v86tools
+MINORCOMP=getsize
+
+TARGETNAME=getsize
+TARGETPATH=..\..\bin
+
+INCLUDES=\nt\public\sdk\inc
+
+SOURCES=getsize.c
+
+BUILDTOOL=1
+TOOL_MODEL=/AS /G2s
+TOOL_LIBS=\nt\private\tools\lib\slibcep \nt\private\tools\lib\toolsp/NOD
+TOOL_TYPE=WINDOWCOMPAT
diff --git a/private/mvdm/dos/v86/tools/src/h2inc/h2inc.c b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.c
new file mode 100644
index 000000000..7574465d2
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.c
@@ -0,0 +1,2374 @@
+/*static char *SCCSID = "@(#)h2inc.c 13.28 90/08/21";*/
+
+/****************************** Module Header ******************************\
+* Module Name: h2inc
+*
+* .H to .INC file translator
+*
+* Created: 15-Aug-87
+*
+* Author: NeilK
+* Modified:Jameelh 25-Jul-88
+* New switches added at command line '-n' & '-c' & '-g'.
+* o '-c' strips off the comments.
+* o Can handle structs without typedefs.
+* o Struct name need not have a prepended '_'.
+* o Don't need a Hungarian tag for it to work.
+* o Added a tag - for ptda_s - to genereate a
+* named SEGMENT instead of struc. ( if '-g' specified )
+* o Added PUBLIC, INIT, and AINIT directives.
+* o Can handle structs within structs if 'typedef'ed.
+* o Added switch to define int size INT_16 or INT_32.
+* - All this works if '-n' switch is used.
+* o Added support for nested structs and bitfields upto
+* 32-bit long.
+* o Added XLATOFF & XLATON directives to switch translation
+* off and on.
+* Modified: Lindsay Harris [lindsayh] - 13-Dec-88
+* o Remove casts of KNOWN types from #define statements
+* o Bug fix in handling NEAR pointers
+* Modified: Floyd Rogers [floydr] - 02-Jan-89
+* o Added function prototype argument lists for -W3
+* o Modified to use runtime lib declarations
+* o Removed unused variables, routine.
+* o Found bug in GetFieldName that would trash memory.
+* Modified: Floyd Rogers [floydr] - 04-Jan-89
+* o Added -d switch so that pm include files wouldn't break
+* o Added -? switch so that users can see more info about options
+* o gathered all #defines together.
+* o gathered all data declarations together, and alphabetized.
+* o initialize option flags in preset
+* Modified: Floyd Rogers [floydr] - 20-Jan-89
+* o Merged with 1.2 version.
+* Added -d switch: when not specified, does not emit
+* struc definitions for typedef'd items. This maintains
+* the 'old' h2inc standard. 1.3 will have to specify -d.
+* See above.
+* o Deleted -n switch
+* o switches now lower case only
+* Modified: Floyd Rogers [floydr] - 17-Apr-89
+* o Merged with 2.0 version.
+* - Added processing of DEFINESOFF/DEFINESON to 2.0 version.
+* o REALLY removed -n switch
+* Modified: Floyd Rogers [floydr] - 18-Apr-89
+* o Fixed bug in processing fields - must emit DW, not just DD
+* Modified: Floyd Rogers [floydr] - 26-Apr-89
+* o Added code to check for string equates.
+* Modified: Floyd Rogers [floydr] - 10-May-89
+* o Fixed error in FindFieldname where compare was (pch == 0)
+* rather than (*pch == 0)
+* o changed all character compares and assignments of the null
+* character from 0 to '\000'
+* o beautified the thing by rationalizing all tabs to be at
+* 4 character increments, fixing up switch statements, moving
+* all open braces to the end of the preceding if/while/do/for.
+* Modified: JR (John Rogers, JohnRo@Microsoft) - 21-Aug-90
+* o PTR B789499: Allow comment to start right after semicolon
+* in field definition.
+* o Do real processing of unions. (Don't use nested unions yet.)
+* o Allow "struct sess2{" (no space before brace).
+* o Allow NOINC and INC as synonyms for XLATOFF and XLATON.
+* o Don't break if keyword is part of a token (e.g. mytypedef).
+* o Improved error reporting on initialization errors.
+* o Hungarianized more of the code.
+* o Fixed trivial portability error which C6 caught (*pch==NULL).
+* o Add version number to help text (run "h2inc -?" to display).
+*
+* Copyright (c) 1987-1990 Microsoft Corporation
+\***************************************************************************/
+
+char H2i1[]="h2inc - .H to .INC file translator (version 13.28)";
+char H2i2[]=" (C) Microsoft Corp 1987, 1988, 1989, 1990";
+#define TRUE 1
+#define FALSE 0
+#define IsAlpha(c) (((c|' ') >= 'a') && ((c|' ') <= 'z'))
+#define IsParen(c) (c == '(' || c == ')')
+#define IsDec(c) (c >= '0' && c <= '9')
+#define IsSeparator(c) (c && c != '_' && !IsDec(c) && !IsAlpha(c))
+#define IsHex(c) (IsDec(c) || (((c|' ') >= 'a') && ((c|' ') <= 'f')))
+#define IsOct(c) (c >= '0' && c <= '7')
+#define IsOper(c) (c && c == '<' || c == '>' || c == '!' || c == '&' || \
+ c == '|' || c == ';' || c == '~')
+#define IsWhite(c) ((c) == ' ' || (c) == '\t' || (c) == '\n')
+#define VOID void
+
+#define HEXCON 4
+#define OCTCON 2
+#define DECCON 1
+#define HEX(c) (c & HEXCON)
+#define OCT(c) (c & OCTCON)
+#define DEC(c) (c & DECCON)
+
+
+#define CCHMAX 2048
+#define CCHSYMMAX 512
+
+#define ICHEQUTAB 20
+#define ICHVALTAB (ICHEQUTAB+4)
+#define ICHCMTTAB (ICHVALTAB+8)
+
+typedef unsigned short BOOL; /* f */
+typedef char CHAR;
+typedef int INT;
+typedef long LONG;
+typedef unsigned char BYTE;
+typedef unsigned short WORD;
+typedef unsigned long DWORD;
+typedef CHAR * PSZ; /* psz - Pointer to zero-terminated string. */
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <malloc.h>
+#include <stdlib.h>
+#include <io.h>
+
+/*
+ * Structure definition processing stuff
+ */
+#define CCHALLOCMAX 8192
+#define cMaxDD 200
+#define cMaxDW 50
+#define cMaxDB 20
+#define cMaxW_D 20
+#define CCHTYPEMAX 512
+#define CCHTAGMAX 512
+#define CCHINDEXMAX 512
+#define CCHNAMEMAX 512
+#define CCHBITFIELDMAX 512
+
+#define TYPE_UNKNOWN 0
+#define TYPE_DB 1
+#define TYPE_DW 2
+#define TYPE_DD 3
+#define TYPE_PTR 4
+
+#define COMMENTCHAR ';'
+
+typedef enum {INIT_NONE, INIT_SIMPLE, INIT_ARRAY} INITTYPE;
+
+#define INT_16 1
+#define INT_32 2
+
+int cBitfield = 0;
+int cLines = 0;
+
+BOOL fArray = FALSE;
+BOOL fcomm_out = FALSE;
+BOOL fComment = FALSE;
+BOOL fDeftype = FALSE;
+BOOL fDefines = FALSE;
+BOOL fError = FALSE;
+BOOL fIf = FALSE;
+BOOL fInTypedef = FALSE; /* Currently in a typedef? */
+BOOL fMac = FALSE; /* Generate macros for structs */
+BOOL fNew = TRUE; /* Additions - Jameelh */
+BOOL fSeg = FALSE; /* Generate SEGMENTS, if specified */
+BOOL fSegAllowed = FALSE;
+BOOL fstructtype[32]; /* fTypes if TYPE <..> */
+INT fStruct = 0;
+BOOL fUnion = FALSE;
+BOOL fUseIfe = FALSE;
+BOOL fWarn = FALSE;
+
+FILE *hfErr = stderr;
+FILE *hfIn;
+FILE *hfOut = stdout;
+
+INT int_16_32=0;
+INT ctypeDB=0;
+INT ctypeDD=0;
+INT ctypeDW=0;
+
+CHAR rgchBitfield[CCHBITFIELDMAX];
+CHAR rgchIndex[CCHINDEXMAX];
+CHAR rgchLine[CCHMAX];
+CHAR rgchName[CCHNAMEMAX];
+CHAR rgchOut[CCHMAX];
+CHAR rgchSave[CCHMAX];
+CHAR rgchSym[CCHSYMMAX];
+CHAR rgchType[CCHTYPEMAX];
+CHAR rgchTag[CCHTAGMAX];
+CHAR rgchAlloc[CCHALLOCMAX];
+CHAR *pstructname[32]; /* upto 32 nested structs */
+
+CHAR *pchAlloc = rgchAlloc;
+CHAR *pchBitfield;
+CHAR *pchFileIn;
+CHAR *pchFileOut;
+CHAR *pchOut;
+
+CHAR *rgpchDD[cMaxDD+1] = {
+ "long",
+ "unsigned long",
+ "LONG",
+ "ULONG",
+ "ulong_t",
+ "FlatAddr", /* Huh.. */
+ NULL
+};
+
+CHAR *rgpchDB[cMaxDB+1] = {
+ "char",
+ "unsigned char",
+ "CHAR",
+ "BYTE",
+ "UCHAR",
+ "uchar_t",
+ NULL
+};
+
+CHAR *rgpchDW[cMaxDW+1] = {
+ "short",
+ "SHORT",
+ "USHORT",
+ "ushort_t",
+ NULL
+};
+
+CHAR *rgpchW_D[cMaxW_D+1] = { /* DW or DD depending on int_16_32 */
+ "int",
+ "INT",
+ "unsigned",
+ "UINT",
+ NULL
+};
+
+static CHAR *rgpchUsage="Usage: h2inc [-?] [-c] [-d] [-f] [-g] [-m] [-t] [-w] [-s symfile.h] infile.h [-o outfile.inc]\n";
+
+static PSZ pszUnionSizeVar = "?UnionSize";
+
+VOID main(int, unsigned char**);
+CHAR *fgetl(CHAR*, int, FILE*);
+CHAR *fgetlx(CHAR*, int, FILE*);
+VOID OpenFile(CHAR *);
+VOID Translate(void);
+VOID ProcessLine(void);
+VOID PrintString(CHAR *);
+PSZ FindString(PSZ, PSZ, BOOL);
+PSZ FindWord(PSZ, PSZ);
+BOOL DoComment(void);
+VOID DoAsm(CHAR *);
+VOID OutTab(void);
+VOID OutString(CHAR *);
+CHAR *GetToken(CHAR *, PSZ, INT);
+CHAR *SkipWhite(CHAR *);
+VOID OutFlush(void);
+BOOL IsLongConstant(CHAR *);
+VOID Error(PSZ);
+VOID Warning(CHAR *);
+VOID OutEqu(void);
+CHAR *IsBitfield(CHAR *);
+VOID DoBitfield(CHAR *, CHAR *);
+CHAR **CalcType2(CHAR *, CHAR **);
+INT CalcType(CHAR*);
+VOID FixSizeof(CHAR *);
+VOID FixCast( CHAR * );
+VOID DoIf(CHAR*);
+VOID DoIfLine(CHAR*);
+VOID DoInclude(CHAR*);
+VOID OutBitfield(void);
+VOID DoSimpleType(CHAR*);
+VOID AddType(CHAR*, CHAR**);
+VOID DoDefine(CHAR*);
+VOID DoStruct(CHAR*, BOOL);
+VOID DoUnionDefn(void);
+VOID DoUnionFieldDefn(INT, PSZ, PSZ);
+VOID DoDoneUnion(PSZ, BOOL);
+VOID DoStructLine(CHAR*);
+VOID EmitStrucHeader(PSZ, BOOL);
+VOID EmitStrucTrailer(PSZ, PSZ);
+VOID EmitSizeAsMod(INT);
+VOID EmitSizeAsNum(INT, PSZ);
+VOID getInitVal(PSZ, PSZ);
+BOOL PublicField(CHAR*);
+INITTYPE GetInitType(CHAR*);
+BOOL IsStructPtr(CHAR*);
+BOOL IsStructDefn(CHAR*);
+VOID GetFieldName(CHAR*);
+VOID DumpBitfields(void);
+VOID OutVal(CHAR *);
+VOID OutDiscard(void);
+VOID initerror(void);
+VOID DoNoInc(void);
+VOID DoXlatOff(void);
+VOID DoExtern(CHAR*);
+VOID DoDefinesOff(void);
+
+
+
+
+VOID main(argc, argv)
+int argc;
+unsigned char *argv[];
+{
+ char *pchtmp;
+ BOOL InpOpened, OtpOpened;
+ FILE *hfOutSave;
+#ifdef DEBUG
+ extern int3();
+
+ int3();
+#endif
+ InpOpened = OtpOpened = FALSE;
+
+ argc--; argv ++; /* Skip over invocation */
+ while (argc > 0) {
+ if (**argv == '-') {
+ switch (*(*argv+1)) {
+ case 's':
+ if (argc < 2)
+ initerror();
+ OpenFile(*++argv);
+ hfOutSave = hfOut;
+ hfOut = NULL;
+ Translate();
+ argv++; argc -= 2;
+ fclose(hfIn);
+ hfOut = hfOutSave;
+ break;
+
+ case 'd':
+ fDeftype = TRUE;
+ argv++; argc--;
+ break;
+ case 'f':
+ int_16_32 = INT_32;
+ argv++; argc--;
+ break;
+ case 'g':
+ fSegAllowed = TRUE;
+ argv++; argc--;
+ break;
+
+ case 'm':
+ fMac = TRUE;
+ argv++; argc--;
+ break;
+
+ case 't':
+ fNew = FALSE;
+ argv++; argc--;
+ break;
+
+ case 'c':
+ fcomm_out = TRUE;
+ argv++; argc--;
+ break;
+
+ case 'w':
+ fWarn = TRUE;
+ argv++; argc--;
+ break;
+
+ case 'o':
+ if (argc < 2 || OtpOpened)
+ initerror();
+ OtpOpened = TRUE;
+ hfErr = stdout;
+ pchFileOut = *++argv;
+ pchtmp = mktemp("H2XXXXXX");
+ if ((hfOut = fopen(pchtmp, "w")) == NULL) {
+ fprintf(hfErr, "Can't open temp file %s\n", pchtmp);
+ exit(1);
+ }
+ argv++; argc -= 2;
+ break;
+
+ case '?':
+ fprintf(hfErr, "\n%s\n%s\n\n", H2i1, H2i2);
+ fprintf(hfErr, rgpchUsage);
+ fprintf(hfErr, "\tc - Emit assembler comments (Default no comments)\n");
+ fprintf(hfErr, "\td - Emit DEFTYPE/struc for typedefs\n");
+ fprintf(hfErr, "\tf - Default size of 'int' is 32 bits\n");
+ fprintf(hfErr, "\tg - Segment directives allowed\n");
+ fprintf(hfErr, "\tm - Generate macros for structs\n");
+ fprintf(hfErr, "\tt - Don't handle typedef'd structs\n");
+ fprintf(hfErr, "\to - Output file follows\n");
+ fprintf(hfErr, "\ts - Symbol file follows\n");
+ fprintf(hfErr, "\tw - Emit warnings (default no warnings)\n");
+ fprintf(hfErr, "\t? - Print this message\n");
+ exit(0);
+ default:
+ initerror();
+ break;
+ }
+ }
+ else {
+ if (InpOpened)
+ initerror();
+ else {
+ OpenFile(*argv);
+ argc--; argv++;
+ InpOpened = TRUE;
+ }
+ }
+ }
+ if (!InpOpened)
+ initerror();
+
+/*
+ fprintf(hfErr, "%s\n"%s\n", h2i1, h2i2);
+*/
+
+ Translate();
+ fclose(hfIn);
+
+ /*
+ * Close the files, and then rename temp file to new file
+ */
+ fflush(hfOut);
+ if (ferror(hfOut)) {
+ fprintf(hfErr, "Error writing %s\n", pchtmp);
+ exit(1);
+ }
+ fcloseall();
+
+ if (!fError) {
+ if ((hfOutSave=fopen(pchFileOut, "r")) > 0) {
+ fclose(hfOutSave);
+ if (unlink(pchFileOut) < 0) {
+ unlink(pchtmp);
+ fprintf(hfErr, "Can't unlink %s\n", pchFileOut);
+ exit(1);
+ }
+ }
+ rename(pchtmp, pchFileOut);
+ }
+ exit(fError);
+
+} /* main() */
+
+VOID initerror()
+{
+ fprintf(hfErr, rgpchUsage);
+ exit(1);
+}
+
+VOID Translate()
+{
+ *rgchLine = '\000';
+ while (fgetlx(rgchLine, CCHMAX, hfIn))
+ ProcessLine();
+}
+
+VOID OpenFile(szFilename)
+char *szFilename;
+{
+ pchFileIn = szFilename;
+ if ((hfIn = fopen(pchFileIn, "r")) == NULL) {
+ fprintf(hfErr, "Can't open input file %s\n", pchFileIn);
+ exit(1);
+ }
+}
+
+/* Process a line, or more than one in some cases. */
+VOID ProcessLine()
+{
+ CHAR *pch;
+ CHAR buf[128];
+
+ cLines++;
+
+ pchOut = rgchOut;
+
+ /*
+ * Skip white space
+ */
+
+ if (*rgchLine == '\000' || ((*rgchLine == '\n') && !fcomm_out))
+ return;
+ pch = SkipWhite(rgchLine);
+ if (*pch == '\000') {
+ if (!fcomm_out)
+ return;
+ rgchLine[0] = '\0';
+ }
+
+ if (DoComment())
+ return;
+ /*
+ * If null comment line, just return
+ */
+
+ pch = SkipWhite(rgchLine);
+
+ if (!fComment && *pch == '\000')
+ return;
+
+ if (pch[0] == COMMENTCHAR) {
+ buf[0] = '\000';
+ pch = GetToken(pch, buf, 2);
+ if (!strcmp(buf, "ASM") || (fSegAllowed && !strcmp(buf, "GASM")) ||
+ (!fSegAllowed && !strcmp(buf, "!GASM"))) {
+ pch=SkipWhite(pch);
+ DoAsm(pch);
+ return;
+ }
+ if (!strcmp(buf, "DEFINESOFF")) {
+ DoDefinesOff();
+ return;
+ }
+ if (!strcmp(buf, "NOINC")) {
+ DoNoInc();
+ return;
+ }
+ if (!strcmp(buf, "XLATOFF")) {
+ DoXlatOff();
+ return;
+ }
+ if (!int_16_32) {
+ if (!strcmp(buf, "INT16"))
+ int_16_32 = INT_16;
+ else if (!strcmp(buf, "INT32"))
+ int_16_32 = INT_32;
+ }
+ if (fcomm_out) {
+ OutString(rgchLine);
+ OutFlush();
+ return;
+ }
+ else
+ return;
+ }
+
+ if (FindWord("#undef", rgchLine)) {
+ return;
+ }
+
+ if (FindWord("#include", rgchLine)) {
+ DoInclude(rgchLine);
+ return;
+ }
+
+ if (FindWord("#define", rgchLine)) {
+ DoDefine(pch);
+ return;
+ }
+
+ /*
+ * Handle extern before struct/union, so we don't get confused by
+ * "extern void flarp(struct x_s x);".
+ */
+ if (FindWord("extern", rgchLine) != NULL) {
+ DoExtern(rgchLine);
+ return;
+ }
+
+ if (FindWord("union", rgchLine) != NULL) {
+ DoStruct(rgchLine, TRUE);
+ return;
+ }
+
+ if (FindWord("struct", rgchLine) != NULL) {
+ DoStruct(rgchLine, FALSE);
+ return;
+ }
+
+ if (FindWord("typedef", rgchLine) != NULL) {
+ DoSimpleType(rgchLine);
+ return;
+ }
+
+ if (FindWord("#if", rgchLine) != NULL) {
+ DoIf(rgchLine);
+ return;
+ }
+
+ if (fIf)
+ DoIfLine(rgchLine);
+
+ /*
+ * Handle #ifndef, #else, #endif, etc.
+ *
+ */
+ pch = SkipWhite(rgchLine);
+ if (*pch == '#') {
+ OutString(pch + 1);
+ OutFlush();
+ return;
+ }
+
+ if (fNew || fStruct)
+ DoStructLine(rgchLine);
+}
+
+VOID PrintString(pch)
+register CHAR *pch;
+{
+ if (hfOut != NULL) {
+ while (*pch != '\000')
+ putc(*pch++, hfOut);
+ putc('\n', hfOut);
+ }
+}
+
+VOID Warning(sz)
+CHAR *sz;
+{
+ if (fWarn) {
+ fprintf(hfErr, "\n%s(%d) : Warning: %s:", pchFileIn, cLines, sz);
+ fprintf(hfErr, "\n>>> %s <<<\n\n", rgchLine);
+ }
+}
+
+VOID Error(psz)
+PSZ psz;
+{
+ fprintf(hfErr, "\n%s(%d) : Error: %s:", pchFileIn, cLines, psz);
+ fprintf(hfErr, "\n>>> %s <<<\n\n", rgchLine);
+ fError = TRUE;
+}
+
+VOID OutTab()
+{
+ *pchOut++ = '\t';
+}
+
+VOID OutString(pch)
+register CHAR *pch;
+{
+ while (*pch != '\000' && pchOut < &rgchOut[CCHMAX]) {
+ if (*pch == COMMENTCHAR && !fcomm_out)
+ break;
+ *pchOut++ = *pch++;
+ }
+
+ if (pch == &rgchOut[CCHMAX]) {
+ *--pch = '\000';
+ Error("Output line too long");
+ }
+}
+
+VOID OutEqu()
+{
+ OutString("\tEQU\t");
+}
+
+PSZ FindString(pszKey, pchStart, fToken)
+PSZ pszKey;
+PSZ pchStart;
+BOOL fToken;
+{
+ register INT cch;
+ register CHAR *pch;
+
+ pch = pchStart;
+ cch = strlen(pszKey);
+
+ while ((pch = strchr(pch, *pszKey)) != NULL) {
+ /*
+ * If rest of string matches, then we have a match
+ */
+ if (strncmp(pch, pszKey, cch) == 0) {
+ if (!fToken ||
+ ((pch == pchStart || IsWhite(*(pch - 1))) &&
+ (pch[cch] == '\000' || IsWhite(pch[cch])))) {
+ return(pch);
+ }
+ }
+ pch++;
+ }
+ return(NULL);
+}
+
+/*
+ * FindWord: Search for a word (not part of another word).
+ * Note that this also works for words beginning with "#", e.g. "#define".
+ * Unfortunately, this doesn't know about comments or string constants.
+ */
+PSZ FindWord(pszKey, pszStart)
+PSZ pszKey;
+PSZ pszStart;
+{
+ register INT cch;
+ register CHAR *pch;
+
+ pch = pszStart;
+ cch = strlen(pszKey);
+
+ while ((pch = strchr(pch, *pszKey)) != NULL) {
+ /*
+ * If rest of string matches, then we have a match
+ */
+ if (strncmp(pch, pszKey, cch) == 0) {
+ /* Insist on this being an exact match. */
+ if ( (pch == pszStart || !iscsymf(*(pch - 1))) &&
+ (pch[cch] == '\000' || !iscsym(pch[cch])) ) {
+ return (pch);
+ }
+ }
+ pch++;
+ }
+ return (NULL);
+}
+
+CHAR *SkipWhite(buf)
+register CHAR *buf;
+{
+ while (isspace(*buf))
+ buf++;
+ return(buf);
+}
+
+VOID OutDiscard()
+{
+ pchOut = rgchOut;
+}
+
+VOID OutFlush()
+{
+ *pchOut++ = '\000';
+
+ PrintString(rgchOut);
+
+ pchOut = rgchOut;
+}
+
+BOOL IsLongConstant(pch)
+register CHAR *pch;
+{
+ while (*pch != '\000' && *pch != COMMENTCHAR) {
+ if (*pch == 'L' || *pch == 'l')
+ return(TRUE);
+ pch++;
+ }
+ return(FALSE);
+}
+
+CHAR *GetToken(pch, pszToken, cSkip)
+register CHAR *pch;
+PSZ pszToken;
+INT cSkip;
+{
+ CHAR *pchEnd;
+ register CHAR *pchStart;
+
+ pchStart = pchEnd = pch;
+ assert(cSkip > 0);
+ while (cSkip-- > 0) {
+ /*
+ * Skip leading whitespace
+ */
+ while (isspace(*pch))
+ pch++;
+
+ pchStart = pch;
+
+ /*
+ * Depending of type of token, scan it.
+ */
+ if (iscsymf(*pchStart)) {
+ /* It's an identifier or keyword... */
+ while (*pch != '\000' && iscsym(*pch))
+ pch++;
+
+ } else if (*pchStart=='#') {
+ /*
+ * Preprocessor stuff (e.g. "#define") is treated as 1 token here.
+ */
+ pch++;
+ while (*pch != '\000' && iscsym(*pch))
+ pch++;
+
+ } else if (IsDec(*pchStart)) {
+ /* Must be a number, e.g. "0xffFF" or "1L". */
+ while (*pch != '\000' && (IsHex(*pch)
+ || ((*pch | ' ') == 'x')
+ || ((*pch | ' ') == 'l')))
+ pch++;
+
+ } else if (!strncmp(pch, "!GASM", 5)) {
+ /*
+ * Special case, treat as 1 token. We might regret this later,
+ * if GASM turns out to be the first 4 letters of a variable.
+ */
+ pch++;
+ while (*pch != '\000' && iscsym(*pch))
+ pch++;
+
+ } else {
+ /*
+ * Must be punctuation of some kind.
+ * Look for contiguous puncuation (e.g. "/*" or "*++").
+ */
+ while (*pch != '\000' && (!isspace(*pch)) && IsSeparator(*pch))
+ pch++;
+ }
+ pchEnd = pch;
+ }
+
+ while (pchStart != pch)
+ *pszToken++ = *pchStart++;
+
+ *pszToken = '\000';
+ return(pchEnd);
+}
+
+BOOL DoComment()
+{
+ register CHAR *pch;
+
+ if (fComment && *rgchLine && !(*rgchLine == '*' && rgchLine[1] == '/'))
+ rgchLine[0] = COMMENTCHAR;
+
+ if (!fComment && (pch=FindString("//", rgchLine, FALSE))) {
+ *pch++ = COMMENTCHAR;
+ *pch = ' ';
+ return (FALSE);
+ }
+
+ if ((pch = FindString("/*", rgchLine, FALSE)) != NULL) {
+ pch[0] = COMMENTCHAR;
+ if (pch[2] != '*')
+ pch[1] = ' ';
+ fComment = TRUE;
+ }
+
+ if (pch = FindString("*/", rgchLine, FALSE)) {
+ pch[0] = ' ';
+ pch[1] = ' ';
+ fComment = FALSE;
+ }
+
+ return(FALSE);
+}
+
+
+VOID DoDefine(pch)
+register CHAR *pch;
+{
+ register CHAR *pchVal;
+ CHAR *pchT;
+ CHAR rgchT[128];
+ int fString=FALSE;
+
+ /*
+ * Skip "#define" (1 token) and get name (2nd token) being #define'd into
+ * rgchSym.
+ */
+ pchVal = GetToken(pch, rgchSym, 2);
+ if ( (*rgchSym) == '\000')
+ Error("#define without name");
+
+ /* Make sure this isn't a macro with arguments. */
+ if ( (*pchVal) == '(') {
+ Warning("Macros with parameters - ignored");
+ return;
+ }
+
+ pchVal = SkipWhite(pchVal); /* Skip space (if any) after name. */
+
+ if (*pchVal == '"')
+ fString = TRUE;
+
+ if (fDefines) {
+ if (IsAlpha(*pchVal) || *pchVal == '_') {
+ Warning("Define of symbol to symbol - ignored");
+ return;
+ }
+ if (*pchVal == '(') {
+ strcpy(rgchT, pchVal);
+ FixSizeof(rgchT);
+ FixCast(rgchT);
+ pchT = SkipWhite(rgchT);
+ while (*pchT == '(')
+ pchT = SkipWhite(++pchT);
+
+ if (strncmp(pchT,"SIZE ", 5) && (IsAlpha(*pchT) || *pchT == '_')) {
+ Warning("Define of symbol to symbol - ignored");
+ return;
+ }
+ }
+ }
+
+ OutString(rgchSym);
+ OutEqu();
+ if (*pchVal == '\000' || *pchVal == COMMENTCHAR) {
+ *pchOut++ = '1';
+ OutFlush();
+ }
+ if (fString) {
+ *pchOut++ = '<';
+ *pchOut++ = *pchVal++;
+ if (*pchVal != '"') {
+ do {
+ if (*pchVal == '\\')
+ pchVal++;
+ *pchOut++ = *pchVal++;
+ } while (*pchVal != '"');
+ }
+ *pchOut++ = *pchVal++;
+ *pchOut++ = '>';
+ OutFlush();
+ }
+ else
+ OutVal(pchVal); /* process text, skip */
+}
+
+VOID OutVal(pch)
+char *pch;
+{
+ BOOL con;
+
+ FixSizeof(pch);
+ FixCast( pch ); /* Remove them */
+ while (*pch && *pch != ';') {
+ con = DECCON; /* default decimal */
+ if (IsDec(*pch)) {
+ if (*pch == '0') { /* could be octal or hex */
+ pch ++;
+ if ((*pch | ' ') == 'x') {
+ con = HEXCON; pch ++;
+ if (!IsDec(*pch))
+ *pchOut++ = '0';
+ }
+ else if (IsOct(*pch))
+ con = OCTCON;
+ else
+ *pchOut++ = '0';
+ }
+ while ( *pch && ( (HEX(con) && IsHex(*pch)) ||
+ (OCT(con) && IsOct(*pch)) ||
+ (DEC(con) && IsDec(*pch))) )
+ *pchOut++ = *pch++;
+
+ if (OCT(con))
+ *pchOut++ = 'Q';
+ else if (HEX(con))
+ *pchOut++ = 'H';
+
+ *pchOut++ = ' ';
+ if (*pch == 'L')
+ pch++;
+ }
+ else if (*pch == '>') {
+ switch (pch[1]) {
+ case '>':
+ OutString(" SHR ");
+ pch += 2;
+ break;
+ case '=':
+ OutString(" GE ");
+ pch += 2;
+ break;
+ default:
+ OutString(" GT ");
+ pch++;
+ break;
+ }
+ }
+ else if (*pch == '<') {
+ switch (pch[1]) {
+ case '<':
+ OutString(" SHL ");
+ pch += 2;
+ break;
+ case '=':
+ OutString(" LE ");
+ pch += 2;
+ break;
+ default:
+ OutString(" LT ");
+ pch++;
+ break;
+ }
+ }
+ else if (*pch == '=' && pch[1] == '=') {
+ OutString(" EQ ");
+ pch += 2;
+ }
+ else if (*pch == '!' && pch[1] == '=') {
+ OutString(" NE ");
+ pch += 2;
+ }
+ else if (*pch == '!') {
+ OutString(" NOT ");
+ pch ++;
+ Warning("Bitwise NOT used for '!'");
+ }
+ else if (*pch == '~') {
+ OutString(" NOT ");
+ pch ++;
+ }
+ else if (*pch == '&' && pch[1] != '&') {
+ OutString(" AND ");
+ pch ++;
+ }
+ else if (*pch == '|' && pch[1] != '|') {
+ OutString(" OR ");
+ pch ++;
+ }
+ else {
+ while (*pch && !IsSeparator(*pch))
+ *pchOut++ = *pch++;
+ while (*pch && IsSeparator(*pch) && !IsOper(*pch))
+ *pchOut++ = *pch++;
+ }
+ }
+ if (*pch == ';' && fcomm_out)
+ OutString(pch);
+ OutFlush();
+}
+
+VOID DoStruct(pch, fUnionT)
+register CHAR *pch;
+BOOL fUnionT;
+{
+ CHAR buf[128];
+
+ if (!IsStructDefn(pch)) {
+ if (FindWord("typedef", pch)) /* || IsStructPtr(pch) */
+ DoSimpleType(pch);
+ else
+ DoStructLine(pch);
+ return;
+ }
+ fUnion = fUnionT;
+ fInTypedef = (BOOL)FindWord("typedef", rgchLine);
+ fSeg = FALSE;
+ if (fUnion)
+ DoUnionDefn();
+
+ /* If fNew is set
+ * Handle simple structs - i.e. without typedefs now
+ * Names are maintained - no prepend tag is necessary
+ * Else simple structs - without typedef are ignored
+ */
+ if (!fNew && !fInTypedef)
+ return;
+
+ /*
+ * Skip "struct" or "typedef struct" and get structure name
+ */
+ pch = GetToken(pch, rgchType, (fInTypedef ? 3 : 2));
+
+ *rgchTag = '\000';
+ if (!fNew) {
+ /*
+ * Skip curly brace & semicolon
+ */
+ pch = GetToken(pch, rgchTag, 2);
+ if (rgchTag[0] != COMMENTCHAR) {
+ Error("Missing type prefix in structure definition");
+ return;
+ }
+ /*
+ * Now fetch hungarian tag
+ */
+ pch = GetToken(pch, rgchTag, 1);
+ }
+ else if (fSegAllowed) { /* check for segment directive */
+ pch = GetToken(pch, rgchTag, 2);
+ if (rgchTag[0] != COMMENTCHAR) {
+ *rgchTag = '\000';
+ goto go1;
+ }
+ pch = GetToken(pch, rgchTag, 1);
+ if (strcmp(rgchTag, "SEGMENT") != 0) {
+ *rgchTag = '\000';
+ goto go1;
+ }
+ pch = GetToken(pch, rgchType, 1);
+ *rgchTag = '\000';
+ sprintf(buf, "%s\tSEGMENT", rgchType);
+ OutString(buf);
+ OutFlush();
+ fSeg = TRUE;
+ goto go2;
+ }
+ if (!fNew && rgchTag[0])
+ strcat(rgchTag, "_");
+ if (fUnion)
+ goto go2; /* Don't output STRUC/etc yet. */
+go1:
+
+ /*
+ * Output "TYPE struc"
+ */
+ if (!fNew)
+ sprintf(buf,"\n%s\tSTRUC",(*rgchType == '_')?rgchType+1:rgchType);
+ else {
+ if (fInTypedef && fMac)
+ sprintf(buf, "\nDEFSTRUC\t,%s", rgchType);
+ else
+ sprintf(buf, "\n%s\tSTRUC", rgchType);
+ }
+ OutString(buf);
+ OutFlush();
+go2:
+ if (fNew) {
+ pstructname[fStruct] = malloc(strlen(rgchType)+1);
+ if (pstructname[fStruct] == NULL) {
+ Error("Can't allocate memory");
+ exit(2);
+ }
+ fstructtype[fStruct] = fInTypedef;
+ strcpy(pstructname[fStruct++], rgchType); /* save away struct name */
+ }
+ else
+ fStruct = TRUE;
+ cBitfield = 0;
+ pchBitfield = rgchBitfield;
+ return;
+}
+
+BOOL IsStructPtr(pch)
+char *pch;
+{
+ char cbuf[128];
+
+ if (GetToken(pch, cbuf, 2) == NULL)
+ return (FALSE);
+ if (cbuf[0] == '*')
+ return (TRUE);
+ else
+ return (FALSE);
+}
+
+BOOL IsStructDefn(pch)
+CHAR *pch;
+{
+ if (FindString("{", pch, FALSE))
+ return (TRUE);
+ else
+ return (FALSE);
+}
+
+VOID DoStructLine(pch)
+register CHAR *pch;
+{
+ CHAR *pchT;
+ CHAR *pComm;
+ CHAR *pType;
+ register INT type;
+ INITTYPE InitType;
+ char initval[100];
+
+ /*
+ * If the line has a colon in it, then we have a bitfield.
+ */
+ InitType = INIT_NONE;
+
+ if ((pchT = IsBitfield(pch))) {
+
+ if (cBitfield == -1) {
+ Error("Only one set of bitfields per structure allowed");
+ return;
+ }
+
+ while ((pchT = IsBitfield(pch))) {
+ DoBitfield(pch, pchT);
+ if (!fgetl(rgchLine, CCHMAX, hfIn))
+ break;
+ }
+
+ OutTab();
+ if (fNew) {
+ OutString(pstructname[fStruct-1]);
+ *pchOut++ = '_';
+ }
+ else
+ OutString(rgchTag);
+ OutString("fs");
+ OutTab();
+ if (cBitfield <= 16)
+ OutString("DW ?");
+ else
+ OutString("DD ?");
+ OutFlush();
+ cBitfield = -1; /* flag bitfield emitted */
+ /* Now drop through to process the next line */
+ }
+ pComm = FindString(";", pch, FALSE);
+
+ /*
+ * If we find a curly brace, then time for "ends"
+ */
+ if ((pType = strchr(pch, '}')) != NULL) {
+ if (fUnion) {
+ /*
+ * OK, now we finally know how large it is, so we can emit the
+ * STRUC..ENDS stuff.
+ */
+ DoDoneUnion(rgchType, /* pszTag */
+ fInTypedef);
+ fUnion = FALSE;
+ goto out;
+ }
+
+ /*
+ * Output "TYPE ends"
+ */
+ if (!fNew) {
+ /* remove underscore if one is present */
+ OutString((*rgchType == '_')?rgchType+1:rgchType);
+ OutString("\tENDS");
+ fStruct = FALSE;
+ }
+ else {
+ if (fstructtype[fStruct-1] && fMac) {
+ pType = GetToken(pType, initval, 2);
+ OutString("ENDSTRUC\t");
+ OutString(initval);
+ *pchOut++ = '\n';
+ goto out;
+ }
+ else {
+ OutString(pstructname[--fStruct]);
+ OutString("\tENDS\n");
+ free(pstructname[fStruct]);
+ goto out;
+ }
+ }
+ out:
+ OutFlush();
+
+ DumpBitfields();
+
+ return;
+ }
+
+ /*
+ * Figure out what type the thing is.
+ */
+ type = CalcType(pch);
+ /*
+ * Get field name and index, if any
+ */
+ GetFieldName(pch);
+ if (fSeg) {
+ if (PublicField(pch)) {
+ OutString("\tPUBLIC ");
+ OutString(rgchName);
+ OutFlush();
+ }
+ if ( (InitType=GetInitType(pch)) != INIT_NONE )
+ getInitVal(pch, initval);
+ }
+
+ if (fUnion == FALSE) {
+ OutString(rgchTag);
+ OutString(rgchName);
+ OutTab();
+ } else {
+ DoUnionFieldDefn(type,
+ rgchSym, /* pszFieldType (struct/union name). */
+ rgchName); /* pszFieldName */
+ goto DoneField;
+ }
+
+ switch (type) {
+ case TYPE_DB:
+ OutString("DB\t");
+ goto common;
+ break;
+
+ case TYPE_DW:
+ OutString("DW\t");
+ goto common;
+ break;
+
+ case TYPE_DD:
+ OutString("DD\t");
+ common:
+ if (fArray && (InitType != INIT_ARRAY))
+ OutString(rgchIndex);
+ if (InitType == INIT_NONE) {
+ if (fArray)
+ OutString(" DUP (?)");
+ else
+ OutString("?");
+ }
+ else {
+ if (InitType == INIT_ARRAY) {
+ if (!fArray)
+ Error("Initialization error (AINIT on nonarray type)");
+ else
+ OutString(initval);
+ }
+ else {
+ if (fArray)
+ OutString(" DUP (");
+ OutString(initval);
+ if (fArray)
+ OutString(")");
+ break;
+ }
+ }
+ break;
+
+ case TYPE_UNKNOWN:
+ if (fMac && !FindWord("struct", pch)) {
+ OutDiscard();
+ OutString(rgchSym);
+ OutTab();
+ OutString(rgchName);
+ if (fArray) {
+ OutString(",,");
+ OutString(rgchIndex);
+ }
+ }
+ else {
+ if (!fStruct) {
+ OutString(rgchSym);
+ if (!fArray && (InitType==INIT_NONE))
+ OutString(" <>");
+ else if ((InitType==INIT_NONE) && fArray) {
+ OutString(" * ");
+ OutString(rgchIndex);
+ OutString("DUP (<>)");
+ }
+ else
+ Error("Initialization error (1)");
+ }
+ else {
+ if (InitType!=INIT_NONE)
+ Error("Initialization error (2)");
+ OutString("DB\tSIZE ");
+ OutString(rgchSym);
+ if (fArray) {
+ OutString(" * ");
+ OutString(rgchIndex);
+ }
+ OutString(" DUP (?)");
+ }
+ }
+ break;
+
+ default:
+ break;
+ }
+DoneField:
+ if (fcomm_out) {
+ pComm++;
+ OutString(pComm);
+ }
+ OutFlush();
+ if ((InitType == INIT_ARRAY) && fArray) {
+ sprintf(initval, "\t.ERRNZ ($-%s) - (%s * %s)", rgchName,
+ rgchIndex, type==TYPE_DB?"1":type==TYPE_DW?"2":type==TYPE_DD?
+ "4":rgchSym);
+ OutString(initval);
+ OutFlush();
+ }
+}
+
+VOID DoUnionDefn(void)
+{
+ OutString(pszUnionSizeVar);
+ OutString(" = 0");
+ OutFlush();
+}
+
+VOID DoUnionFieldDefn(
+ INT type, /* TYPE_DW, etc. */
+ PSZ pszFieldType,
+ PSZ pszFieldName)
+{
+ OutString("if ");
+ EmitSizeAsNum(type, pszFieldType);
+ OutString(" gt ");
+ OutString(pszUnionSizeVar);
+ OutFlush();
+
+ OutString("\t");
+ OutString(pszUnionSizeVar);
+ OutString(" = ");
+ EmitSizeAsNum(type, pszFieldType);
+ OutFlush();
+
+ OutString("endif");
+ OutFlush();
+
+ OutString(pszFieldName);
+ OutString("\tequ\t(");
+ EmitSizeAsMod(type); /* Emit "byte" or whatever. */
+ OutString(" ptr 0"); /* Fields in unions always offset 0. */
+ OutString(")");
+ OutFlush();
+}
+
+VOID DoDoneUnion(PSZ pszTag, BOOL fTypedef)
+{
+ /* Generate "flarp STRUC" or whatever line. */
+ EmitStrucHeader(pszTag, fTypedef);
+
+ /* Generate single field, of the max size. */
+ OutString("\tDB\t");
+ OutString(pszUnionSizeVar);
+ OutString(" dup(?)");
+ OutFlush();
+
+ /* Now generate ENDS or whatever. */
+ EmitStrucTrailer(pszTag, (CHAR *)0);
+}
+
+/* Generate start of struct/union. */
+VOID EmitStrucHeader(PSZ pszTag, BOOL fTypedef)
+{
+ CHAR buf[128];
+
+ /*
+ * Output "TYPE struc"
+ */
+ if (!fNew)
+ sprintf(buf,"\n%s\tSTRUC",(*pszTag == '_')?pszTag+1:pszTag);
+ else {
+ if (fTypedef && fMac)
+ sprintf(buf, "\nDEFSTRUC\t,%s", pszTag);
+ else
+ sprintf(buf, "\n%s\tSTRUC", pszTag);
+ }
+ OutString(buf);
+ OutFlush();
+}
+
+/* Generate end of struct/union. */
+VOID EmitStrucTrailer(PSZ pszTag, PSZ pszInitval)
+{
+ if (!fNew) {
+ /* remove underscore if one is present */
+ OutString((*pszTag == '_')?pszTag+1:pszTag);
+ OutString("\tENDS");
+ }
+ else {
+ if (fstructtype[fStruct-1] && fMac) {
+ OutString("ENDSTRUC\t");
+ OutString(pszInitval);
+ }
+ else {
+ OutString(pszTag);
+ OutString("\tENDS\n");
+ }
+ }
+ OutFlush();
+}
+
+/*
+ * Generate size of type as modifier, if possible. (For a structure,
+ * generate a "byte" modifier, instead.)
+ */
+VOID EmitSizeAsMod(INT type)
+{
+ switch (type) {
+ case TYPE_DB:
+ OutString("byte");
+ break;
+ case TYPE_DW:
+ OutString("word");
+ break;
+ case TYPE_DD:
+ OutString("dword");
+ break;
+ case TYPE_PTR:
+ Warning("assuming pointer is 4 bytes long");
+ OutString("dword");
+ break;
+ case TYPE_UNKNOWN:
+ /* Struct, so treat as byte. */
+ OutString("byte");
+ }
+}
+
+/*
+ * Generate size of type as number, if possible. (For a structure,
+ * generate a "size typename" instead.)
+ */
+VOID EmitSizeAsNum(INT type, PSZ pszTypeName)
+{
+ switch (type) {
+ case TYPE_DB:
+ OutString("1");
+ break;
+ case TYPE_DW:
+ OutString("2");
+ break;
+ case TYPE_DD:
+ OutString("4");
+ break;
+ case TYPE_PTR:
+ Warning("assuming pointer is 4 bytes long");
+ OutString("4");
+ break;
+ case TYPE_UNKNOWN:
+ OutString("size ");
+ OutString(pszTypeName);
+ }
+}
+
+VOID DoBitfield(pch, pchColon)
+register CHAR *pch;
+CHAR *pchColon;
+{
+ register int w;
+ int cbit;
+ int temp;
+
+ GetFieldName(pch);
+ OutString(rgchTag);
+ OutString(rgchName);
+ OutEqu();
+
+ /*
+ * Skip ':' and any leading whitespace
+ */
+ pchColon = SkipWhite(pchColon + 1);
+
+ /*
+ * Calc number of bits for the field (handle up to 2 digits)
+ */
+ if (!isdigit(pchColon[0]))
+ Error("Illegal bitfield");
+
+ cbit = pchColon[0] - '0';
+ if (isdigit(pchColon[1]))
+ cbit = cbit * 10 + pchColon[1] - '0';
+
+ if (cbit + cBitfield > 32) {
+ Error("Only 32 bitfield bits allowed");
+ }
+
+ /*
+ * Calculate mask
+ * the field should look like this
+ *
+ * | 0..0 | 11 .. 11 | 00 ....... 00 |
+ * |<- cbit ->|<- cBitfield ->|
+ *
+ * If we have a 32 bit C compiler the following would produce the
+ * reqd. bit field.
+ *
+ * w = ((1 << cbit) - 1) << cBitfield;
+ *
+ * But now we have to split this up. If either cbit + cBitfield <= 16
+ * then there is no problem, or cBitfield is > 16 so that we just shift
+ * everything appropriately. If neither then we have to divide and rule.
+ *
+ */
+ if (cbit + cBitfield <= 16) {
+ w = ((1 << cbit) - 1) << cBitfield;
+ pchOut += sprintf(pchOut, "0%xh", w);
+ }
+ else if (cBitfield > 16) {
+ w = (((1 << cbit) - 1) << (cBitfield - 16));
+ pchOut += sprintf(pchOut, "0%x0000h", w);
+ }
+ else {
+ temp = cbit;
+ cbit = cbit + cBitfield - 16;
+ w = ((1 << cbit) - 1);
+ pchOut += sprintf(pchOut, "0%04x", w);
+ cbit = 16 - cBitfield;
+ w = ((1 << cbit) - 1) << cBitfield;
+ pchOut += sprintf(pchOut, "%04xh", w);
+ cbit = temp;
+ }
+
+ cBitfield += cbit;
+
+ OutBitfield();
+ pchOut = rgchOut;
+ return;
+
+}
+
+CHAR *IsBitfield(pch)
+register CHAR *pch;
+{
+ while (*pch != '\000' && *pch != COMMENTCHAR) {
+ if (*pch == ':')
+ return(pch);
+ pch++;
+ }
+ return(NULL);
+}
+
+/*
+ * Figure out the type of the field.
+ * If unknown type, this routine leaves the typename in rgchSym[].
+ */
+INT CalcType(pch)
+register CHAR *pch;
+{
+ register INT i;
+ CHAR chbuf[128];
+ CHAR token[128];
+
+ for (i=0;pch[i] && pch[i] != ';';i++)
+ chbuf[i] = pch[i];
+ chbuf[i]=0;
+
+ /*
+ * If it has a FAR in it, then assume a DD.
+ */
+ if (FindWord("FAR", chbuf) != NULL ||
+ FindWord("far", chbuf) != NULL)
+ return(TYPE_DD);
+
+ /*
+ * If no FAR, but it has a star, then PTR
+ */
+
+ i=2;
+ if (FindWord("typedef", chbuf))
+ i++;
+ if (FindWord("struct", chbuf) || FindWord("union", chbuf))
+ i++;
+ if (FindWord( "NEAR", chbuf) || FindWord( "near", chbuf))
+ i++;
+ GetToken(chbuf, token, i);
+ if (token[0] == '*') {
+ if (int_16_32 == INT_32)
+ return (TYPE_DD);
+ else
+ return (TYPE_DW);
+ }
+
+ /*
+ * Now look up the type in one of the tables.
+ * Note that we search the DD and DB tables before
+ * we search the DW table, because "unsigned" may be
+ * part of "unsigned long" and "unsigned char".
+ */
+ if (CalcType2(chbuf, rgpchDD) == 0)
+ return(TYPE_DD);
+
+ if (CalcType2(chbuf, rgpchDB) == 0)
+ return(TYPE_DB);
+
+ if (CalcType2(chbuf, rgpchDW) == 0) {
+ return(TYPE_DW);
+ }
+ if (CalcType2(chbuf, rgpchW_D) == 0) {
+ if (int_16_32 == INT_32)
+ return(TYPE_DD);
+ else if (!int_16_32)
+ Warning("int/unsigned assumed DW");
+ return(TYPE_DW);
+ }
+
+ /*
+ * An unknown type: must be a structure.
+ * Return the type name in rgchSym
+ */
+ i = 1;
+ if (FindWord("typedef", chbuf))
+ i++;
+ if (FindWord("struct", chbuf))
+ i++;
+ else if (FindWord("union", chbuf))
+ i++;
+ GetToken(chbuf, rgchSym, i);
+
+ return(TYPE_UNKNOWN);
+}
+
+/*
+ * This nifty little function searches the "symbol table"
+ * and returns NULL if the thing is found, or the pointer to the
+ * end of the symbol table if not.
+ */
+CHAR **CalcType2(pch, rgpch)
+CHAR *pch;
+register CHAR **rgpch;
+{
+ register INT i;
+
+ /*
+ * One of the DWORD types?
+ */
+ for (i=0 ; rgpch[i]!=NULL ; i++) {
+ if (FindString(rgpch[i], pch, TRUE) != NULL) {
+ return(NULL);
+ }
+ }
+ return(&rgpch[i]);
+}
+
+/*
+ * Find name part of field definition, and store in rgchName.
+ * Also calculates whether this is an array or not, returning
+ * the array index string in rgchIndex. Sets fArray (global).
+ */
+
+VOID GetFieldName(pch)
+register CHAR *pch;
+{
+ register CHAR *pchT;
+ CHAR *pchStart;
+ CHAR *pchEnd;
+
+ pchStart = pch;
+ /*
+ * Find name part of field. We do this by scanning ahead for the
+ * semicolon, then backing up to first separator char.
+ * Bitfields are handled here too, by stopping if we find a ':'.
+ */
+
+ while (*pch != COMMENTCHAR && *pch != ':') {
+ if (*pch == '\000') {
+ Error("Missing semicolon");
+ return;
+ }
+ pch++;
+ }
+
+ /*
+ * Back up past spaces
+ */
+ while (*(pch - 1) == ' ')
+ pch--;
+
+ fArray = FALSE;
+
+ /*
+ * Check for array definition:
+ */
+ if (*(pch - 1) == ']') {
+
+ fArray = TRUE;
+
+ /*
+ * Back up over array index
+ */
+ while (*(pch - 1) != '[' && pch != pchStart)
+ pch--;
+
+ /*
+ * remember pointer to '['..
+ */
+ pchEnd = pch - 1;
+
+ /*
+ * Save index string away...
+ */
+ for (pchT = rgchIndex; *pch != ']'; )
+ *pchT++ = *pch++;
+ *pchT = '\000';
+
+ pch = pchEnd;
+ FixSizeof(rgchIndex);
+ }
+
+ /*
+ * Back up past spaces
+ */
+ while (*(pch - 1) == ' ')
+ pch--;
+
+ /*
+ * Skip over proc declaration parameter lists
+ */
+ if (*(pch - 1) == ')') {
+ /*
+ * Skip the parameter list
+ */
+ while (*(--pch) != '(' && pch != pchStart)
+ ;
+ /*
+ * Skip any leftover trailing parens
+ */
+ while (*(pch - 1) == ')')
+ pch--;
+ }
+
+ /*
+ * Remember the end of the name
+ */
+ pchEnd = pch;
+
+ /*
+ * Scan the rest of the string to see if he has multiple fields on a line
+ */
+ for (pchT = pchStart; pchT != pchEnd; pchT++) {
+ if (*pchT == ',') {
+ Error("Only one field per line allowed");
+ return;
+ }
+ }
+
+ /*
+ * Now find the beginning of the name string...
+ */
+ while (pch>pchStart &&
+ *(pch - 1) != ' ' && *(pch - 1) != '(' && *(pch - 1) != '*') {
+
+ pch--;
+ /*
+ * If this is a bitfield guy, then reset pchEnd
+ */
+ if (*pch == ':')
+ pchEnd = pch;
+ }
+
+ /*
+ * Copy the name to rgchName.
+ */
+ for (pchT = rgchName; pch != pchEnd && pchT<&rgchName[CCHNAMEMAX-1]; )
+ *pchT++ = *pch++;
+ *pchT++ = '\000';
+
+ return;
+}
+
+/*
+ * This routine sticks the newly defined type in the appropriate array.
+ */
+
+VOID DoSimpleType(pch)
+register CHAR *pch;
+{
+ INT type;
+ CHAR **ppch;
+ CHAR buf[128];
+ char *ptype;
+
+ /*
+ * First see if this thing already has a type
+ */
+
+ GetFieldName(pch);
+
+ ptype = NULL;
+ switch (type = CalcType(pch)) {
+ case TYPE_DW:
+ if ((ppch = CalcType2(rgchName, rgpchDW)) != NULL) {
+ if (++ctypeDW < cMaxDW)
+ AddType(rgchName, ppch);
+ else
+ fprintf(hfErr, "Error - no room in symbol table - type %s not added\n", rgchName);
+ }
+ ptype = "dw";
+ break;
+ case TYPE_DD:
+ if ((ppch = CalcType2(rgchName, rgpchDD)) != NULL) {
+ if (++ctypeDD < cMaxDD)
+ AddType(rgchName, ppch);
+ else
+ fprintf(hfErr, "Error - no room in symbol table - type %s not added\n", rgchName);
+ }
+ ptype = "dd";
+ break;
+ case TYPE_DB:
+ if ((ppch = CalcType2(rgchName, rgpchDB)) != NULL) {
+ if (++ctypeDB < cMaxDB)
+ AddType(rgchName, ppch);
+ else
+ fprintf(hfErr, "Error - no room in symbol table - type %s not added\n", rgchName);
+ }
+ ptype = "db";
+ break;
+ case TYPE_UNKNOWN:
+ break;
+ default:
+ break;
+ }
+ if (fDeftype) {
+ if (fMac) {
+ sprintf(buf, "DEFTYPE\t%s,%s", rgchName, ptype? ptype : rgchSym);
+ }
+ else if (ptype) {
+ sprintf(buf, "%s struc\n\t%s ?\n%s ends\n",rgchName,ptype,rgchName);
+ }
+ else {
+ sprintf(buf, "%s struc\ndb size %s dup(?)\n%s ends\n",
+ rgchName, rgchSym, rgchName);
+ }
+ OutString(buf);
+ OutFlush();
+ }
+}
+
+VOID AddType(pch, ppch)
+register CHAR *pch;
+CHAR **ppch;
+{
+ INT cch;
+
+ cch = strlen(pch) + 1;
+
+ if (pchAlloc + cch > &rgchAlloc[CCHALLOCMAX]) {
+ Error("Symbol table full");
+ return;
+ }
+ strcpy(pchAlloc, pch);
+ *ppch = pchAlloc;
+ pchAlloc += cch;
+ return;
+}
+
+/*
+ * Because the peice of assembler can't handle EQU's inside of
+ * STRUC declarations, we buffer up the bitfield constant definitions
+ * in a separate buffer, and dump them out after we output the ENDS.
+ */
+VOID OutBitfield()
+{
+ *pchOut = '\000';
+
+ if (pchBitfield-rgchBitfield+strlen(rgchOut) > CCHBITFIELDMAX) {
+ Error("Internal error - bitfield name buffer overflow: bitfield ignored");
+ return;
+ }
+ strcpy(pchBitfield, rgchOut);
+ pchBitfield += strlen(rgchOut) + 1;
+}
+
+VOID DumpBitfields()
+{
+ register CHAR *pch;
+
+ for (pch = rgchBitfield; pch != pchBitfield; pch += strlen(pch) + 1) {
+ OutString(pch);
+ OutFlush();
+ }
+}
+
+VOID DoInclude(pch)
+register char *pch;
+{
+ register char *pchend;
+
+ OutString("INCLUDE ");
+ /*
+ * Skip ahead to start of file name
+ */
+ while (*pch != '\000' && *pch != '"' && *pch != '<')
+ pch++;
+
+ /*
+ * Skip string delimiter
+ */
+ pch++;
+
+ /* pch now points to the beginning of the filename.
+ * scan forward till the delimiter ('"' or '>').
+ * Then scan backwards till a '.' and append it with 'INC'
+ */
+ pchend = pch;
+ while (*pchend != '"' && *pchend != '>')
+ pchend++;
+ while (*pchend != '.')
+ pchend --;
+ *++pchend = '\000';
+ OutString(pch);
+ OutString("INC");
+ OutFlush();
+}
+
+
+/*
+ * Handle logical ORs...
+ */
+VOID DoIf(pch)
+CHAR *pch;
+{
+ static cIfTemp = 0;
+
+ if (strchr(pch, '&') != NULL) {
+ Error("Can't handle logical ANDs in IFs");
+ return;
+ }
+ if (FindWord("defined", pch) == NULL)
+ goto skip;
+ strcpy(rgchSym, "IFTEMP00");
+ rgchSym[7] += (char)(cIfTemp % 10);
+ rgchSym[6] += (char)(cIfTemp / 10);
+ cIfTemp++;
+
+ OutString(rgchSym);
+ OutString(" = 0");
+ OutFlush();
+skip:
+ fUseIfe = (BOOL)FindString("!(", pch, FALSE);
+
+ fIf = TRUE;
+
+ DoIfLine(pch);
+}
+
+VOID DoIfLine(pch)
+register CHAR *pch;
+{
+ BOOL fOutIf;
+ BOOL fIfndef;
+ BOOL fEx;
+ CHAR *pline;
+
+ pline=pch;
+ /*
+ * If this is the last line of defined()'s, remember to output initial if
+ */
+ fEx = FALSE;
+ fOutIf = ((strchr(pch, '\\') == NULL));
+
+ if (FindWord("defined", pch) != NULL) {
+ while ((pch = FindWord("defined", pch)) != NULL) {
+
+ /*
+ * If defined is preceded by '!', then use ifndef
+ */
+ fIfndef = (*(pch - 1) == '!');
+
+ OutString(fIfndef ? "IFNDEF " : "IFDEF ");
+
+ /* Skip "defined", "(", and get symbol */
+ while (*pch != '\000' && *pch++ != '(')
+ ;
+ pch = SkipWhite(pch);
+ while (*pch != '\000' && *pch != ' ' && *pch != ')')
+ *pchOut++ = *pch++;
+ OutFlush();
+
+ /*
+ * Now set temporary variable...
+ */
+ OutString(rgchSym);
+ OutString(" = 1");
+ OutFlush();
+
+ OutString("ENDIF");
+ OutFlush();
+ }
+ }
+ else
+ fEx = TRUE;
+
+ if (fOutIf) {
+ OutString(fUseIfe ? "IFE " : "IF ");
+ if (fEx) {
+ pch = GetToken(pline, rgchSym, 1);
+ OutVal(pch);
+ }
+ else {
+ OutString(rgchSym);
+ OutFlush();
+ }
+ fIf = FALSE;
+ }
+}
+
+VOID DoAsm(cline)
+char *cline;
+{
+ CHAR line[128];
+ CHAR *pch, *pch1;
+
+ if (fComment) { /* fComment => that we are still within
+ a comment => its not a single line ASM */
+ OutString(cline);
+ while (cLines++ && fgetl(line,sizeof(line) , hfIn)) {
+ pch = SkipWhite(line);
+ if (pch1=FindString("*/", pch, FALSE)) {
+ *pch1 = '\000';
+ OutString(line);
+ OutFlush();
+ fComment = FALSE;
+ return;
+ }
+ else {
+ OutString(line);
+ OutFlush();
+ }
+ }
+ }
+ else { /* Single line ASM */
+ OutString(cline);
+ OutFlush();
+ return;
+ }
+}
+
+BOOL PublicField(Str)
+CHAR *Str;
+{
+ char *pch;
+
+ if (pch = FindString(";", Str, FALSE)) {
+ if (FindWord("PUBLIC", pch) != NULL)
+ return (TRUE);
+ else
+ return (FALSE);
+ }
+ else
+ return (FALSE);
+}
+
+INITTYPE GetInitType(pch)
+CHAR *pch;
+{
+ if (FindWord("AINIT", pch))
+ return (INIT_ARRAY);
+ if (FindWord("INIT", pch))
+ return (INIT_SIMPLE);
+ else
+ return (INIT_NONE); /* No init (same value as FALSE). */
+}
+
+VOID getInitVal(pch, val)
+PSZ pch;
+PSZ val;
+{
+ CHAR *pval;
+
+ pval = val;
+ *pval = '\000';
+ {
+ PSZ pszInitOrAInit;
+
+ pszInitOrAInit = FindWord("INIT", pch);
+ if (pszInitOrAInit == NULL)
+ pszInitOrAInit = FindWord("AINIT", pch);
+ pch = pszInitOrAInit;
+ if (pch == NULL) {
+ Error("Initialization error (bug in getInitVal/caller?)");
+ return;
+ }
+ }
+
+ pch = FindString("<", pch, FALSE);
+ if (pch == NULL) {
+ Error("Initialization error (missing '<')");
+ return;
+ }
+
+ for (pch++; (*pch && *pch != '>') ; pch++, val++)
+ *val = *pch;
+ if (*pch == '>' && *(pch+1) == '>')
+ *val++ = '>';
+ if (*pch == '\000') {
+ Error("Initialization error (need '>' to end value)");
+ *pval = '\000';
+ return;
+ }
+ *val = '\000';
+}
+
+/* Fix sizeof( foo ) to size foo
+** sizeof foo to size foo
+** sizeof( struct foo ) to size foo
+*/
+VOID FixSizeof(pbuf)
+CHAR *pbuf;
+{
+ char *pch;
+ char *s;
+ int i;
+
+ while (TRUE) {
+ if ((pch=FindWord("sizeof", pbuf)) == NULL)
+ return;
+ s = "SIZE ";
+ for (i=0; i < 6 ; i++)
+ *pch++ = *s++;
+ if ((s=FindString("(", pch, FALSE)) == NULL)
+ continue;
+ *s++ = ' ';
+ i = 0;
+ do {
+ if (*s == '(')
+ i++;
+ else if (*s == ')') {
+ if (i == 0) {
+ *s = ' ';
+ break;
+ }
+ i--;
+ }
+ } while (*++s != '\000');
+ if ((pch=FindWord("struct", pch)) == NULL)
+ continue;
+ for (i=0; i<6;i++)
+ *pch++ = ' ';
+ while (*pch)
+ pch++;
+ *pch++ = ';';
+ *pch = '\000';
+ }
+}
+
+VOID FixCast( pch )
+CHAR *pch;
+{
+ /*
+ * Look for and remove any casts. These are defined as (XXX *),
+ * where XXX is a type we know about, and * may or may not be present.
+ * These are meaningless to assembler, which is typeless.
+ * We remove casts by whiting them out.
+ */
+
+ register CHAR *pchT;
+ register CHAR *pchT1;
+
+ CHAR *pchStart;
+ CHAR chBuf[ 128 ];
+
+ /* Start looking from the RHS */
+ while (pchStart = strchr( pch, '(' ) ) {
+ /* Worth looking - there are candidates */
+ while (*pchStart == '(' )
+ ++pchStart; /* May be nested for other reasons */
+
+ for( pchT = pchStart; *pchT && isspace( *pchT ); ++pchT )
+ ; /* Scan to start of type */
+ pchT1 = chBuf;
+ while (*pchT && (isalnum( *pchT ) || *pchT == '_' ) )
+ *pchT1++ = *pchT++; /* Copy ONLY type to local */
+ *pchT1 = '\0';
+
+
+ /* Is it a type we have? */
+ if (CalcType2( chBuf, rgpchDD ) == 0 ||
+ CalcType2( chBuf, rgpchDB ) == 0 ||
+ CalcType2( chBuf, rgpchDW ) == 0 ||
+ CalcType2( chBuf, rgpchW_D ) == 0 ) {
+ /* Known type - maybe a cast! */
+ while (*pchT && isspace( *pchT ) )
+ ++pchT;
+ if ( *pchT == '*' ) {
+ /* Pointer - still OK */
+ ++pchT;
+ while (*pchT && isspace( *pchT ) )
+ ++pchT;
+ }
+ if ( *pchT == ')' ) {
+ /* Found all the bits - white them out */
+ while (pchT >= pchStart )
+ *pchT-- = ' ';
+ *pchT = ' '; /* Skipped over leading ( */
+ }
+ }
+ pch = pchStart; /* Continue from here */
+ }
+
+ return;
+}
+
+VOID DoDefinesOff()
+{
+ fDefines = TRUE;
+ while (cLines++ && fgetl(rgchLine, CCHMAX, hfIn)) {
+ if (FindWord("DEFINESON", rgchLine)) {
+ fDefines = FALSE;
+ return;
+ }
+ ProcessLine();
+ }
+ fDefines = FALSE;
+ return;
+}
+
+VOID DoNoInc()
+{
+ while (cLines++ && fgetl(rgchLine, CCHMAX, hfIn)) {
+ if (FindWord("INC", rgchLine))
+ return;
+ }
+}
+
+VOID DoXlatOff()
+{
+ while (cLines++ && fgetl(rgchLine, CCHMAX, hfIn)) {
+ if (FindWord("XLATON", rgchLine))
+ return;
+ }
+}
+
+VOID DoExtern(pline)
+char *pline;
+{
+ char *pch;
+
+ while (TRUE) {
+ pch = pline;
+ while (*pch && *pch != ';')
+ pch++;
+ if (*pch == ';')
+ return;
+ if (fgetlx(pline, CCHMAX, hfIn))
+ cLines++;
+ else
+ return;
+ }
+}
+
+
+CHAR *fgetlx(buffer,buflen,fi)
+char *buffer;
+int buflen; /* Buffer length */
+FILE *fi; /* Input file */
+{
+ int i, j;
+ char *buf;
+
+ j = buflen;
+ buf = buffer;
+ while (TRUE) {
+ if (fgetl(buf, j, fi) == NULL)
+ return (NULL);
+ i = strlen(buf) - 1;
+ if (i < 0 || buf[i] != '\\')
+ return (buffer);
+ else if (buflen -i >= 40) {
+ j -= i;
+ buf += i;
+ }
+ else {
+ Error("Line too long");
+ break;
+ }
+ }
+ return (buffer);
+}
+
+/*
+ * This function differs from fgets() in the following ways:
+ *
+ * (1) It ignores carriage returns.
+ * (2) It expands tabs.
+ * (3) It does NOT include the terminating linefeed in the
+ * string it returns.
+ *
+ * I didn't spec the interface to behave this way; it is
+ * some fool PM private incompatible C runtime function.
+ */
+
+CHAR *fgetl(buffer,buflen,fi)
+CHAR *buffer; /* Buffer pointer */
+register int buflen; /* Buffer length */
+FILE *fi; /* Input file */
+{
+ int c; /* A character */
+ register CHAR *cp1; /* Char pointer */
+ int i; /* Counter */
+
+ if (buflen-- == 0) return(NULL); /* NULL if zero-length buffer */
+ for(cp1 = buffer; buflen > 0; ) { /* Loop to get line */
+ if ((c = getc(fi)) == EOF) { /* If end of file */
+ if (cp1 > buffer)
+ break; /* Break if buffer not empty */
+ return(NULL); /* End of file */
+ }
+ if (c == '\r')
+ continue; /* Ignore CRs */
+ if (c == '\t') { /* If tab */
+ i = 8 - ((cp1 - buffer) % 8);
+ /* Compute number of spaces to fill */
+ if (i > buflen)
+ i = buflen; /* Don't exceed space remaining */
+ while (i-- > 0) { /* While spaces remaining */
+ *cp1++ = ' '; /* Fill with space */
+ --buflen; /* Decrement buffer count */
+ }
+ continue; /* Go get next character */
+ }
+ if (c == '\n')
+ break; /* Break if linefeed */
+ *cp1++ = (CHAR)c; /* Copy the character */
+ --buflen; /* Decrement buffer count */
+ }
+ *cp1 = '\0'; /* Add terminator */
+ return(buffer); /* Return pointer to buffer */
+}
diff --git a/private/mvdm/dos/v86/tools/src/h2inc/h2inc.def b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.def
new file mode 100644
index 000000000..406495db2
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.def
@@ -0,0 +1 @@
+NAME h2inc WINDOWCOMPAT LONGNAMES
diff --git a/private/mvdm/dos/v86/tools/src/h2inc/h2inc.doc b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.doc
new file mode 100644
index 000000000..15688d084
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.doc
@@ -0,0 +1,204 @@
+/* static char *SCCSID = "@(#) h2inc.doc 13.1 88/11/01" */
+
+ H2INC - .H to .INC file translation program
+
+This program produces .INC files from .H files. It handles hex and decimal
+constant definitions (both word and long), structures, bitfields, and
+comments. It has some trouble with certain kinds of #define statements, but
+it currently handles everything interesting in the various internal and public
+Winthorn files.
+
+ COMMAND FORM
+
+ h2inc [-t] [-c] [-g] [-s symfile] file.h [-o outfile]
+
+Example:
+
+ h2inc -s os2def.h -s os2win.h user.h
+
+
+Translates file.h to an .inc file, sending output to outfile.inc if specified,
+or to stdout. symfile.h is a file to be scanned for typedefs that are used
+by file.h. One or more of "-s symfile.h" may be specified.
+
+The '-c' option retains comments. Default action is to strip comments.
+The '-g' option is described later on in this document.
+The '-t' option retains the use of the Hungarian tag prepended to structure
+element names. This is not always desired.
+
+
+ COMPILER DIRECTIVES
+
+The #undef directive is ignored. #include is handled by mapping to
+the masm include statement. The quote or angle bracket delimiters are
+removed, and any extension is replaced by ".inc":
+
+ #include "file.h" -> include file.inc
+ #include <file.ext> -> include file.inc
+
+Directives such as #ifdef, #if, #else and #endif are replaced by their
+MASM equivalents.
+
+Simple empty #defines are handled by assigning the constant the value of 1:
+
+ #define INCL_GPIINCLUDED -> INCL_GPIINCLUED equ 1
+
+
+
+ CONSTANTS
+
+h2inc understands hex, octal and decimal constants, both 16 and 32 bits.
+Constants in parens or preceded by casts are generally handled pretty well.
+Here are some examples illustrating how various constants are translated:
+
+ #define LONG_CONSTANT 0x12345678L
+ #define LONG_CONSTANT2 333L
+ #define WORD_CONSTANT 0x234
+ #define DEC_CONSTANT (-1)
+ #define LONG_DEC_CONSTANT (-4L)
+
+produces:
+
+ LONG_CONSTANT equ 012345678H
+ LONG_CONSTANT2 equ 333
+ WORD_CONSTANT equ 0234H
+ DEC_CONSTANT equ (-1)
+ LONG_DEC_CONSTANT equ (-4)
+
+ '>>', '<<' and '!' are translated to SHR, SHL and NOT respectively.
+ '&' and '|' are translated to AND and OR.
+
+ When a type cast is uncovered, it is blanked out. Type casts are
+ defined as ([ ]XXX[ ][*][ ]) where XXX is a type KNOWN to h2inc.
+ Known types are the built in int, short etc and any other type
+ that h2inc has discovered so far, for example in a typedef.
+
+
+ STRUCTURES
+
+Fields in a struct are expected only one per line. Field declarations like
+"INT a, b" are not handled.
+
+h2inc does a pretty good job of determining whether to use db, dw, or dd. It
+knows about all types defined in that .H file, plus the primary C types:
+char, int, unsigned, etc. It can also handle things of form "STRUCTURE *"
+and "STRUCTURE FAR *", and produce dw or dd as appropriate.
+
+Any primary data type h2inc does not know about is assumed to be a structure.
+If a primary data type is defined in another .h file, the "-s symfile" option
+will cause h2inc to scan that .h file for any type definitions. Those
+definitions will be used when translating the source file.
+
+Structure types, arrays, and bitfields are handled too. Below is
+an example structure, with its h2inc'd output:
+
+ The example above will get translated as follows:
+
+ typedef FOO DWORD
+
+ typedef struct _STRUCTURE { /* str */
+ SHORT wOne;
+ SHORT wTwo;
+ RECT *prc;
+ RECT rc;
+ FOO rgrc[10];
+ CHAR rgch[20];
+ BOOL fOneBit:1;
+ BOOL fTwoBits:2;
+ BOOL fThreeBits:3;
+ SHORT (FAR *lpfn)();
+ } STRUCTURE;
+
+
+ STRUCTURE struc
+ str_wOne dw ?
+ str_wTwo dw ?
+ str_prc dw ?
+ str_rc (size RECT)/2 dup (?)
+ str_rgrc (size FOO)/2 * 10 dup (?)
+ str_rgch db 20 dup (?)
+ str_fs dw ?
+ str_lpfn dd ?
+ STRUCTURE ends
+ str_fOneBit equ 00001h
+ str_fTwoBits equ 00006h
+ str_fThreeBits equ 00038h
+
+As can be seen, bitfields are handled in an interesting way. The C field
+name, prepended with the abbreviation tag, is actually the mask constant
+to use, rather than the field offset. The field offset is ALWAYS "fs"
+prepended with the abbreviation tag.
+
+Besides the standard winthorn types, h2inc also keeps track of other types
+defined in the file so that it can determine whether to use db, dw, dd, or
+dup.
+
+ IMPROVEMENTS
+
+
+ o ASM statements and directives can be included in a '.h'
+ file by enclosing as follows
+ /* ASM
+ asm statements and directives
+ */
+ These statements and/or directives are not processed, simply
+ copied.
+ There is a variation of ASM directive - ASMX. This works only
+ with '-g'. It is intended to be useful for defining segment
+ related stuff.
+ o A structure can be translated to ASM named segment by
+ naming the segment in a standard C comment on the same line
+ as 'struct'. Selectively the fields of the struct (nee segment)
+ can be declared PUBLIC or initialised. The initialisation has
+ two flavours INIT and AINIT. AINIT is for initialising arrays
+ with distinct values. The following eg. illustrates. This is only
+ possible using '-g' option.
+
+ struct foo { /* SEGMENT FOOSEG */
+ short able; /* Nothing special */
+ short baker; /* PUBLIC */
+ short charlie; /* INIT <MAXFOOBLE> */
+ long delta; /* PUBLIC INIT <42> */
+ char eagle[16]; /* Vanilla */
+ short fox[MAXFOX]; /* PUBLIC INIT <0> */
+ long golf[MAXG]; /* AINIT <2, 3, 5, 7, 11, 13> */
+ };
+
+ Would translate to:
+
+ FOOSEG segment
+ able DW ?
+ PUBLIC baker
+ baker DW ?
+ charlie DW MAXFOOBLE
+ PUBLIC delta
+ delta DD 42
+ eagle DB 16 DUP(?)
+ PUBLIC fox
+ fox DW MAXFOX DUP(0)
+ golf DD 2, 3, 5, 7, 11, 13
+ .errnz ($ - golf) - MAXG*(SIZE DWORD)
+ FOOSEG ends
+
+ with '-c' options on.
+
+ o INT size can be specified as either 16 bits or 32 bits by
+ a directive
+ /* INT16 */ or /* INT32 */
+ if neither is specified, a warning is issued whenever
+ 'int' is used.
+
+ o Nested structure declarations are now handled.
+
+ o Bit fields upto 32 bits are supported.
+
+ o Embedded structures i.e. structures within structures should
+ be declared with a typedef. eg.
+
+ typedef struct foo foo;
+ foo foobar[MAXFOO];
+ of course, the struct foo itself is declared elsewhere.
+
+ IMPROVEMENT IDEAS
+
+- Handle C "typedef enum" enumerated type definition statements.
diff --git a/private/mvdm/dos/v86/tools/src/h2inc/h2inc.mak b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.mak
new file mode 100644
index 000000000..684fe4b5c
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/h2inc/h2inc.mak
@@ -0,0 +1,27 @@
+# SCCSID = @(#)makefile 13.3 90/08/21
+
+include ..\makefile.inc
+
+CINC = -I. -I$(H286)
+CFLAGS = -AS -Ox
+
+all: h2inc.exe
+
+h2inc.exe: h2inc.obj h2inc.def
+ link$(CVPLINK) $(LIB286)\setargv h2inc, h2inc, h2inc/map/nod/noe, $(LIB286)\slibcep $(LIB286)\os2286, h2inc;
+ bind h2inc.exe $(LIB286)\doscalls.lib -o h2inc.exe
+
+h2inc.obj: h2inc.c $(H286)/ctype.h $(H286)/io.h \
+ $(H286)/malloc.h $(H286)/stdio.h $(H286)/stdlib.h \
+ $(H286)/string.h $(H286)/assert.h
+
+depend:
+ copy h2inc.mak makefile.old
+ sed "/^# Dependencies follow/,$$d" makefile.old > h2inc.mak
+ echo # Dependencies follow >> h2inc.mak
+ includes $(CINC) *.c >> h2inc.mak
+ echo # IF YOU PUT STUFF HERE IT WILL GET BLASTED >> h2inc.mak
+ echo # see depend: above >> h2inc.mak
+
+# DO NOT DELETE THE FOLLOWING LINE
+# Dependencies follow
diff --git a/private/mvdm/dos/v86/tools/src/stripdd/makefile b/private/mvdm/dos/v86/tools/src/stripdd/makefile
new file mode 100644
index 000000000..ac264b66c
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripdd/makefile
@@ -0,0 +1,6 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+!INCLUDE $(NTMAKEENV)\maketool.def
diff --git a/private/mvdm/dos/v86/tools/src/stripdd/sources b/private/mvdm/dos/v86/tools/src/stripdd/sources
new file mode 100644
index 000000000..c842457c7
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripdd/sources
@@ -0,0 +1,14 @@
+MAJORCOMP=v86tools
+MINORCOMP=stripdd
+
+TARGETNAME=stripdd
+TARGETPATH=..\..\bin
+
+INCLUDES=\nt\public\sdk\inc
+
+SOURCES=stripdd.c
+
+BUILDTOOL=1
+TOOL_MODEL=/AS /G2s
+TOOL_LIBS=\nt\private\tools\lib\slibcep \nt\private\tools\lib\toolsp/NOD
+TOOL_TYPE=WINDOWCOMPAT
diff --git a/private/mvdm/dos/v86/tools/src/stripdd/stripdd.c b/private/mvdm/dos/v86/tools/src/stripdd/stripdd.c
new file mode 100644
index 000000000..e3c5333a1
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripdd/stripdd.c
@@ -0,0 +1,184 @@
+/***
+****
+* File : stripdd.c
+* Used to strip out the zeroes in a segment which is orged to a high
+* value. Mostly written for the following scenario. Has not been
+* tested for any other stunts.
+*
+*
+* /--------------------------------------\ File offset Grows
+* | |
+* | |
+* | First Segment |
+* | |
+* | |
+* | |
+* |--------------------------------------|
+* | |
+* | |
+* | | |
+* | Zeroes due to the ORG |
+* | in the second segment |
+* | |
+* | |
+* |--------------------------------------|
+* | |
+* | |
+* | data part of 2nd segment |
+* |--------------------------------------|
+* | |
+* | |
+* | Tail for Stripdd |
+* | |
+* \--------------------------------------/
+*
+*
+* This utility removes the 'Zeroes' portion from the source file
+*
+*
+* The Tail is of the following format
+*
+* struct Tail {
+* int TailLen ; len of Tail including len field
+* struct Entry[NUMENTRIES]
+* long Terminator ; == -1
+* filler
+* }
+*
+* struct Entry {
+* long offset ; offset of Zeroes from the beg of file
+* int size ; number of zeroes to be stripped
+* }
+*
+*
+* Even though the Tail was designed variable number of entries
+* the utility handles only one entry right now.
+*
+* Also the offset field in the Entry structure is being
+* rounded to para boundary, assuming that the 2nd segment
+* starts at a para boundary.
+*
+*
+* Usage : stripdd <sourcefile> <destfile>
+***
+***/
+
+#include <fcntl.h>
+#include <io.h>
+#include <stdio.h>
+#include <sys\types.h>
+#include <sys\stat.h>
+#include <process.h>
+
+int SrcFile, DstFile ;
+unsigned int HeadLen, *HeadPtr ;
+long FileSize ;
+
+extern void *malloc() ;
+
+GetHeader ()
+{
+ char tempbuf[2] ;
+ int *tptr ;
+
+ fprintf ( stderr, "Reading in Tail Info...\n" ) ;
+
+ if ( (FileSize = lseek (SrcFile, -16L, SEEK_END )) == -1) {
+ fprintf ( stderr, "Error while seeking\n" ) ;
+ exit (1) ;
+ }
+
+ if ( read(SrcFile, tempbuf, 2) != 2 ) {
+ fprintf ( stderr, "Error while reading in the header\n" ) ;
+ exit ( 1 ) ;
+ }
+ tptr = (int *)tempbuf ;
+ HeadLen = *tptr - 2 ;
+ HeadPtr = malloc ( HeadLen ) ;
+ if (HeadPtr == NULL) {
+ fprintf ( stderr, "Memory allocation error\n" ) ;
+ exit (1) ;
+ }
+ if ( read(SrcFile, (char *)HeadPtr, HeadLen) != HeadLen ) {
+ fprintf ( stderr, "Error while reading in the header\n" ) ;
+ exit ( 1 ) ;
+ }
+
+ if ( lseek (SrcFile, 0L, SEEK_SET ) == -1) {
+ fprintf ( stderr, "Error while seeking\n" ) ;
+ exit (1) ;
+ }
+
+}
+
+Process()
+{
+ long offset ;
+
+
+ offset = * ( (long *)HeadPtr) ;
+ offset = (offset + 15) & 0xfffffff0 ;
+ fprintf ( stderr, "Copying first segment...\n" ) ;
+ copy ( offset ) ;
+ FileSize -= offset ;
+ HeadPtr += 2 ;
+ offset = *HeadPtr ;
+ fprintf ( stderr, "Stripping zeroes from the second segment...\n" ) ;
+ lseek ( SrcFile, offset, SEEK_CUR ) ;
+ FileSize -= offset ;
+ fprintf ( stderr, "Copying second segment...\n" ) ;
+ copy (FileSize) ;
+}
+char buf[4096] ;
+
+copy ( len )
+long len ;
+
+{
+ int readlen ;
+
+ while ( len > 0 ) {
+ if ( len > 4096 )
+ readlen = 4096 ;
+ else
+ readlen = len ;
+
+ if ( read (SrcFile, buf, readlen ) != readlen ) {
+ fprintf ( stderr, "Error while reading data\n" ) ;
+ exit (1) ;
+ }
+
+ if ( write (DstFile, buf, readlen ) != readlen ) {
+ fprintf ( stderr, "Error while writing data\n" ) ;
+ exit (1) ;
+ }
+ len -= readlen ;
+ }
+}
+
+main ( argc, argv )
+int argc ;
+char *argv[] ;
+
+{
+ if (argc != 3) {
+ fprintf ( stderr, "Usage : stripdd infile outfile\n" ) ;
+ exit (1) ;
+ }
+
+ SrcFile = open ( argv[1], O_BINARY ) ;
+ if ( SrcFile == -1 ) {
+ fprintf ( stderr, "Error opening %s\n", argv[1] ) ;
+ exit (1) ;
+ }
+
+ DstFile = open ( argv[2], O_RDWR | O_CREAT | O_TRUNC | O_BINARY,
+ S_IREAD | S_IWRITE ) ;
+
+ GetHeader() ;
+ Process() ;
+ fprintf ( stderr, "%s stripped to %s\n", argv[1], argv[2] ) ;
+ return(0) ;
+}
+
+
diff --git a/private/mvdm/dos/v86/tools/src/stripdd/stripdd.def b/private/mvdm/dos/v86/tools/src/stripdd/stripdd.def
new file mode 100644
index 000000000..608b997e6
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripdd/stripdd.def
@@ -0,0 +1,7 @@
+NAME STRIPDD WINDOWCOMPAT
+
+DESCRIPTION 'Stripping Utility for himem driver'
+
+STACKSIZE 4096
+
+HEAPSIZE 16384
diff --git a/private/mvdm/dos/v86/tools/src/stripz/makefile b/private/mvdm/dos/v86/tools/src/stripz/makefile
new file mode 100644
index 000000000..d62ae1f34
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripz/makefile
@@ -0,0 +1,9 @@
+#
+# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
+# file to this component. This file merely indirects to the real make file
+# that is shared by all the components of NT OS/2
+#
+# stripz.exe is a utility used by DOSEm to create memory image of
+# ntdos.sys.
+
+!INCLUDE $(NTMAKEENV)\maketool.def
diff --git a/private/mvdm/dos/v86/tools/src/stripz/sources b/private/mvdm/dos/v86/tools/src/stripz/sources
new file mode 100644
index 000000000..7af2cf795
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripz/sources
@@ -0,0 +1,14 @@
+MAJORCOMP=tools
+MINORCOMP=stripz
+
+TARGETNAME=stripz
+TARGETPATH=..\..\bin
+
+INCLUDES=..\inc;\nt\public\sdk\inc
+
+SOURCES=stripz.c
+
+BUILDTOOL=1
+TOOL_MODEL=/AS /G2s
+TOOL_LIBS=\nt\private\tools\lib\slibcep \nt\private\tools\lib\toolsp/NOD
+TOOL_TYPE=WINDOWCOMPAT
diff --git a/private/mvdm/dos/v86/tools/src/stripz/stripz.c b/private/mvdm/dos/v86/tools/src/stripz/stripz.c
new file mode 100644
index 000000000..760f646d7
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripz/stripz.c
@@ -0,0 +1,71 @@
+/*
+ * Stripz.c - Strip the header off of a .SYS file
+ *
+ * I don't know what this is for, but this program reads a file
+ * of the format
+ *
+ * DW <len>
+ * DB <len-2> dup (0)
+ * DB N bytes of data to keep
+ *
+ * This program copies argv[1] to argv[2], striping off those leading
+ * bytes of zero and the length word.
+ *
+ * We don't check to see if they're really zero, we just discard
+ * the first <len> bytes of argv[1].
+ */
+
+#include <stdio.h>
+#include <fcntl.h>
+#include <sys\types.h>
+#include <sys\stat.h>
+#include <io.h>
+
+char buf[16384];
+unsigned int pos;
+int rdcnt;
+int srcfile, tgtfile ;
+
+main(argc, argv)
+int argc ;
+char *argv[] ;
+{
+ if ( argc != 3 ) {
+ fprintf (stderr, "Usage : stripz src_file trgt_file\n") ;
+ exit (1) ;
+ }
+
+ if ((srcfile = open(argv[1], (O_BINARY | O_RDONLY))) == -1) {
+ fprintf (stderr, "Error opening %s\n", argv[1]) ;
+ exit (1) ;
+ }
+
+ rdcnt = read (srcfile, buf, 2);
+ if (rdcnt != 2) {
+ fprintf (stderr, "Can't read %s\n", argv[1]);
+ exit(1);
+ }
+
+ pos = lseek (srcfile, 0L, SEEK_END ) ;
+ if ( (long)(*(unsigned int *)buf) > pos ) {
+ fprintf (stderr, "File too short or improper format.\n");
+ exit(1);
+ }
+
+ lseek(srcfile, (long)(*(unsigned int *)buf), SEEK_SET ) ;
+
+ if ( (tgtfile = open(argv[2], (O_BINARY|O_WRONLY|O_CREAT|O_TRUNC),
+ (S_IREAD|S_IWRITE))) == -1) {
+ printf ("Error creating %s\n", argv[2]) ;
+ close (srcfile) ;
+ exit (1) ;
+ }
+
+ while ( (rdcnt = read (srcfile, buf, sizeof buf)) > 0)
+ write (tgtfile, buf, rdcnt);
+
+ close (srcfile) ;
+ close (tgtfile) ;
+
+ return ( 0 ) ;
+}
diff --git a/private/mvdm/dos/v86/tools/src/stripz/stripz.def b/private/mvdm/dos/v86/tools/src/stripz/stripz.def
new file mode 100644
index 000000000..42e645cb2
--- /dev/null
+++ b/private/mvdm/dos/v86/tools/src/stripz/stripz.def
@@ -0,0 +1,7 @@
+NAME STRIPZ WINDOWCOMPAT
+
+DESCRIPTION 'Text to RTF conversion utility'
+
+STACKSIZE 4096
+
+HEAPSIZE 16384